diff --git a/.gitignore b/.gitignore index 54f07af58b4cd9fb7d7e5e11909310ce21eeabcf..251ce6d2bd9308e5975611a1ad18308ba6da8117 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ pnpm-debug.log* lerna-debug.log* node_modules -dist dist-ssr *.local @@ -21,4 +20,4 @@ dist-ssr *.ntvs* *.njsproj *.sln -*.sw? \ No newline at end of file +*.sw? diff --git a/dist/assets/index-c5b4e48b.css b/dist/assets/index-c5b4e48b.css new file mode 100644 index 0000000000000000000000000000000000000000..c57de2db32e0d4428ca3a3a13e9343eb2185b4d5 --- /dev/null +++ b/dist/assets/index-c5b4e48b.css @@ -0,0 +1 @@ +body{font-family:Arial,Helvetica,sans-serif}input{max-width:30%}p{color:#000}h3{margin-left:4px;margin-top:20px;margin-bottom:4px}p.lock{cursor:default;margin:0}p#dropText{font-size:100px}.container{display:flex}button{border:none}button.interface{background-color:#c8c8c8;padding:4px;border-radius:6px;margin:4px;width:28%;min-width:80px}button.interface:hover{background-color:#a0a0a0;cursor:pointer}button.lock{background:none;border:none;margin:0;padding:0;cursor:pointer}div,h2{margin:4px}.info{background-color:#ddd;padding:5px;border-radius:8px}.full-flex{flex:1}.panel{display:flex;flex-direction:column;padding:4px}.settings{width:35vh;height:65vh;margin:4px;display:flex;border-radius:6px;border:1px solid rgb(0,0,0);flex-direction:column}#previewSVG{width:100%;height:100%}div.SVGbox{border:1px solid rgb(0,0,0)}div.preview{width:65vh;height:65vh;margin:4px;border-radius:6px;background-color:#fff;border:1px solid rgb(0,0,0);display:flex;align-items:center;justify-content:center}div#dropZone{background-color:#b4b4b499;position:fixed;top:0;left:0;width:100%;height:100%;z-index:999;visibility:hidden;display:flex;align-items:center;justify-content:center} diff --git a/dist/assets/logo-a252ba3f.png b/dist/assets/logo-a252ba3f.png new file mode 100644 index 0000000000000000000000000000000000000000..da305d1ce037e7fd1461dd72b656a97391711ac2 Binary files /dev/null and b/dist/assets/logo-a252ba3f.png differ diff --git a/dist/assets/main-e1885530.js b/dist/assets/main-e1885530.js new file mode 100644 index 0000000000000000000000000000000000000000..dd63356a245658d856128f7cb584189ef274156f --- /dev/null +++ b/dist/assets/main-e1885530.js @@ -0,0 +1,22 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&a(l)}).observe(document,{childList:!0,subtree:!0});function r(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(o){if(o.ep)return;o.ep=!0;const s=r(o);fetch(o.href,s)}})();var he=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function hr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ea(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function a(){return this instanceof a?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,o.get?o:{enumerable:!0,get:function(){return e[a]}})}),r}var jn={exports:{}},de=jn.exports={},Be,Ie;function Wt(){throw new Error("setTimeout has not been defined")}function Ht(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Be=setTimeout:Be=Wt}catch{Be=Wt}try{typeof clearTimeout=="function"?Ie=clearTimeout:Ie=Ht}catch{Ie=Ht}})();function zn(e){if(Be===setTimeout)return setTimeout(e,0);if((Be===Wt||!Be)&&setTimeout)return Be=setTimeout,setTimeout(e,0);try{return Be(e,0)}catch{try{return Be.call(null,e,0)}catch{return Be.call(this,e,0)}}}function xa(e){if(Ie===clearTimeout)return clearTimeout(e);if((Ie===Ht||!Ie)&&clearTimeout)return Ie=clearTimeout,clearTimeout(e);try{return Ie(e)}catch{try{return Ie.call(null,e)}catch{return Ie.call(this,e)}}}var Ce=[],Je=!1,He,ct=-1;function Ra(){!Je||!He||(Je=!1,He.length?Ce=He.concat(Ce):ct=-1,Ce.length&&qn())}function qn(){if(!Je){var e=zn(Ra);Je=!0;for(var t=Ce.length;t;){for(He=Ce,Ce=[];++ct<t;)He&&He[ct].run();ct=-1,t=Ce.length}He=null,Je=!1,xa(e)}}de.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];Ce.push(new Gn(e,t)),Ce.length===1&&!Je&&zn(qn)};function Gn(e,t){this.fun=e,this.array=t}Gn.prototype.run=function(){this.fun.apply(null,this.array)};de.title="browser";de.browser=!0;de.env={};de.argv=[];de.version="";de.versions={};function Fe(){}de.on=Fe;de.addListener=Fe;de.once=Fe;de.off=Fe;de.removeListener=Fe;de.removeAllListeners=Fe;de.emit=Fe;de.prependListener=Fe;de.prependOnceListener=Fe;de.listeners=function(e){return[]};de.binding=function(e){throw new Error("process.binding is not supported")};de.cwd=function(){return"/"};de.chdir=function(e){throw new Error("process.chdir is not supported")};de.umask=function(){return 0};var Sa=jn.exports;const Ma=hr(Sa);var rt={},Rt={};Rt.byteLength=Oa;Rt.toByteArray=Ia;Rt.fromByteArray=Ca;var Le=[],Se=[],Ta=typeof Uint8Array<"u"?Uint8Array:Array,Lt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Ve=0,Aa=Lt.length;Ve<Aa;++Ve)Le[Ve]=Lt[Ve],Se[Lt.charCodeAt(Ve)]=Ve;Se["-".charCodeAt(0)]=62;Se["_".charCodeAt(0)]=63;function Wn(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var a=r===t?0:4-r%4;return[r,a]}function Oa(e){var t=Wn(e),r=t[0],a=t[1];return(r+a)*3/4-a}function Ba(e,t,r){return(t+r)*3/4-r}function Ia(e){var t,r=Wn(e),a=r[0],o=r[1],s=new Ta(Ba(e,a,o)),l=0,f=o>0?a-4:a,h;for(h=0;h<f;h+=4)t=Se[e.charCodeAt(h)]<<18|Se[e.charCodeAt(h+1)]<<12|Se[e.charCodeAt(h+2)]<<6|Se[e.charCodeAt(h+3)],s[l++]=t>>16&255,s[l++]=t>>8&255,s[l++]=t&255;return o===2&&(t=Se[e.charCodeAt(h)]<<2|Se[e.charCodeAt(h+1)]>>4,s[l++]=t&255),o===1&&(t=Se[e.charCodeAt(h)]<<10|Se[e.charCodeAt(h+1)]<<4|Se[e.charCodeAt(h+2)]>>2,s[l++]=t>>8&255,s[l++]=t&255),s}function La(e){return Le[e>>18&63]+Le[e>>12&63]+Le[e>>6&63]+Le[e&63]}function Na(e,t,r){for(var a,o=[],s=t;s<r;s+=3)a=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),o.push(La(a));return o.join("")}function Ca(e){for(var t,r=e.length,a=r%3,o=[],s=16383,l=0,f=r-a;l<f;l+=s)o.push(Na(e,l,l+s>f?f:l+s));return a===1?(t=e[r-1],o.push(Le[t>>2]+Le[t<<4&63]+"==")):a===2&&(t=(e[r-2]<<8)+e[r-1],o.push(Le[t>>10]+Le[t>>4&63]+Le[t<<2&63]+"=")),o.join("")}var cr={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */cr.read=function(e,t,r,a,o){var s,l,f=o*8-a-1,h=(1<<f)-1,v=h>>1,g=-7,w=r?o-1:0,E=r?-1:1,A=e[t+w];for(w+=E,s=A&(1<<-g)-1,A>>=-g,g+=f;g>0;s=s*256+e[t+w],w+=E,g-=8);for(l=s&(1<<-g)-1,s>>=-g,g+=a;g>0;l=l*256+e[t+w],w+=E,g-=8);if(s===0)s=1-v;else{if(s===h)return l?NaN:(A?-1:1)*(1/0);l=l+Math.pow(2,a),s=s-v}return(A?-1:1)*l*Math.pow(2,s-a)};cr.write=function(e,t,r,a,o,s){var l,f,h,v=s*8-o-1,g=(1<<v)-1,w=g>>1,E=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=a?0:s-1,x=a?1:-1,S=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(f=isNaN(t)?1:0,l=g):(l=Math.floor(Math.log(t)/Math.LN2),t*(h=Math.pow(2,-l))<1&&(l--,h*=2),l+w>=1?t+=E/h:t+=E*Math.pow(2,1-w),t*h>=2&&(l++,h/=2),l+w>=g?(f=0,l=g):l+w>=1?(f=(t*h-1)*Math.pow(2,o),l=l+w):(f=t*Math.pow(2,w-1)*Math.pow(2,o),l=0));o>=8;e[r+A]=f&255,A+=x,f/=256,o-=8);for(l=l<<o|f,v+=o;v>0;e[r+A]=l&255,A+=x,l/=256,v-=8);e[r+A-x]|=S*128};/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh <https://feross.org> + * @license MIT + */(function(e){const t=Rt,r=cr,a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=f,e.SlowBuffer=D,e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o,f.TYPED_ARRAY_SUPPORT=s(),!f.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{const u=new Uint8Array(1),n={foo:function(){return 42}};return Object.setPrototypeOf(n,Uint8Array.prototype),Object.setPrototypeOf(u,n),u.foo()===42}catch{return!1}}Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}});function l(u){if(u>o)throw new RangeError('The value "'+u+'" is invalid for option "size"');const n=new Uint8Array(u);return Object.setPrototypeOf(n,f.prototype),n}function f(u,n,i){if(typeof u=="number"){if(typeof n=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return w(u)}return h(u,n,i)}f.poolSize=8192;function h(u,n,i){if(typeof u=="string")return E(u,n);if(ArrayBuffer.isView(u))return x(u);if(u==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof u);if(Ee(u,ArrayBuffer)||u&&Ee(u.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ee(u,SharedArrayBuffer)||u&&Ee(u.buffer,SharedArrayBuffer)))return S(u,n,i);if(typeof u=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const c=u.valueOf&&u.valueOf();if(c!=null&&c!==u)return f.from(c,n,i);const y=O(u);if(y)return y;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof u[Symbol.toPrimitive]=="function")return f.from(u[Symbol.toPrimitive]("string"),n,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof u)}f.from=function(u,n,i){return h(u,n,i)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array);function v(u){if(typeof u!="number")throw new TypeError('"size" argument must be of type number');if(u<0)throw new RangeError('The value "'+u+'" is invalid for option "size"')}function g(u,n,i){return v(u),u<=0?l(u):n!==void 0?typeof i=="string"?l(u).fill(n,i):l(u).fill(n):l(u)}f.alloc=function(u,n,i){return g(u,n,i)};function w(u){return v(u),l(u<0?0:I(u)|0)}f.allocUnsafe=function(u){return w(u)},f.allocUnsafeSlow=function(u){return w(u)};function E(u,n){if((typeof n!="string"||n==="")&&(n="utf8"),!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n);const i=F(u,n)|0;let c=l(i);const y=c.write(u,n);return y!==i&&(c=c.slice(0,y)),c}function A(u){const n=u.length<0?0:I(u.length)|0,i=l(n);for(let c=0;c<n;c+=1)i[c]=u[c]&255;return i}function x(u){if(Ee(u,Uint8Array)){const n=new Uint8Array(u);return S(n.buffer,n.byteOffset,n.byteLength)}return A(u)}function S(u,n,i){if(n<0||u.byteLength<n)throw new RangeError('"offset" is outside of buffer bounds');if(u.byteLength<n+(i||0))throw new RangeError('"length" is outside of buffer bounds');let c;return n===void 0&&i===void 0?c=new Uint8Array(u):i===void 0?c=new Uint8Array(u,n):c=new Uint8Array(u,n,i),Object.setPrototypeOf(c,f.prototype),c}function O(u){if(f.isBuffer(u)){const n=I(u.length)|0,i=l(n);return i.length===0||u.copy(i,0,0,n),i}if(u.length!==void 0)return typeof u.length!="number"||ze(u.length)?l(0):A(u);if(u.type==="Buffer"&&Array.isArray(u.data))return A(u.data)}function I(u){if(u>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return u|0}function D(u){return+u!=u&&(u=0),f.alloc(+u)}f.isBuffer=function(n){return n!=null&&n._isBuffer===!0&&n!==f.prototype},f.compare=function(n,i){if(Ee(n,Uint8Array)&&(n=f.from(n,n.offset,n.byteLength)),Ee(i,Uint8Array)&&(i=f.from(i,i.offset,i.byteLength)),!f.isBuffer(n)||!f.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(n===i)return 0;let c=n.length,y=i.length;for(let b=0,R=Math.min(c,y);b<R;++b)if(n[b]!==i[b]){c=n[b],y=i[b];break}return c<y?-1:y<c?1:0},f.isEncoding=function(n){switch(String(n).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(n,i){if(!Array.isArray(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return f.alloc(0);let c;if(i===void 0)for(i=0,c=0;c<n.length;++c)i+=n[c].length;const y=f.allocUnsafe(i);let b=0;for(c=0;c<n.length;++c){let R=n[c];if(Ee(R,Uint8Array))b+R.length>y.length?(f.isBuffer(R)||(R=f.from(R)),R.copy(y,b)):Uint8Array.prototype.set.call(y,R,b);else if(f.isBuffer(R))R.copy(y,b);else throw new TypeError('"list" argument must be an Array of Buffers');b+=R.length}return y};function F(u,n){if(f.isBuffer(u))return u.length;if(ArrayBuffer.isView(u)||Ee(u,ArrayBuffer))return u.byteLength;if(typeof u!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof u);const i=u.length,c=arguments.length>2&&arguments[2]===!0;if(!c&&i===0)return 0;let y=!1;for(;;)switch(n){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return V(u).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return it(u).length;default:if(y)return c?-1:V(u).length;n=(""+n).toLowerCase(),y=!0}}f.byteLength=F;function k(u,n,i){let c=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,n>>>=0,i<=n))return"";for(u||(u="utf8");;)switch(u){case"hex":return se(this,n,i);case"utf8":case"utf-8":return B(this,n,i);case"ascii":return H(this,n,i);case"latin1":case"binary":return J(this,n,i);case"base64":return N(this,n,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _e(this,n,i);default:if(c)throw new TypeError("Unknown encoding: "+u);u=(u+"").toLowerCase(),c=!0}}f.prototype._isBuffer=!0;function P(u,n,i){const c=u[n];u[n]=u[i],u[i]=c}f.prototype.swap16=function(){const n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let i=0;i<n;i+=2)P(this,i,i+1);return this},f.prototype.swap32=function(){const n=this.length;if(n%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let i=0;i<n;i+=4)P(this,i,i+3),P(this,i+1,i+2);return this},f.prototype.swap64=function(){const n=this.length;if(n%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let i=0;i<n;i+=8)P(this,i,i+7),P(this,i+1,i+6),P(this,i+2,i+5),P(this,i+3,i+4);return this},f.prototype.toString=function(){const n=this.length;return n===0?"":arguments.length===0?B(this,0,n):k.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(n){if(!f.isBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:f.compare(this,n)===0},f.prototype.inspect=function(){let n="";const i=e.INSPECT_MAX_BYTES;return n=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(n+=" ... "),"<Buffer "+n+">"},a&&(f.prototype[a]=f.prototype.inspect),f.prototype.compare=function(n,i,c,y,b){if(Ee(n,Uint8Array)&&(n=f.from(n,n.offset,n.byteLength)),!f.isBuffer(n))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof n);if(i===void 0&&(i=0),c===void 0&&(c=n?n.length:0),y===void 0&&(y=0),b===void 0&&(b=this.length),i<0||c>n.length||y<0||b>this.length)throw new RangeError("out of range index");if(y>=b&&i>=c)return 0;if(y>=b)return-1;if(i>=c)return 1;if(i>>>=0,c>>>=0,y>>>=0,b>>>=0,this===n)return 0;let R=b-y,Y=c-i;const fe=Math.min(R,Y),oe=this.slice(y,b),ue=n.slice(i,c);for(let ie=0;ie<fe;++ie)if(oe[ie]!==ue[ie]){R=oe[ie],Y=ue[ie];break}return R<Y?-1:Y<R?1:0};function G(u,n,i,c,y){if(u.length===0)return-1;if(typeof i=="string"?(c=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,ze(i)&&(i=y?0:u.length-1),i<0&&(i=u.length+i),i>=u.length){if(y)return-1;i=u.length-1}else if(i<0)if(y)i=0;else return-1;if(typeof n=="string"&&(n=f.from(n,c)),f.isBuffer(n))return n.length===0?-1:te(u,n,i,c,y);if(typeof n=="number")return n=n&255,typeof Uint8Array.prototype.indexOf=="function"?y?Uint8Array.prototype.indexOf.call(u,n,i):Uint8Array.prototype.lastIndexOf.call(u,n,i):te(u,[n],i,c,y);throw new TypeError("val must be string, number or Buffer")}function te(u,n,i,c,y){let b=1,R=u.length,Y=n.length;if(c!==void 0&&(c=String(c).toLowerCase(),c==="ucs2"||c==="ucs-2"||c==="utf16le"||c==="utf-16le")){if(u.length<2||n.length<2)return-1;b=2,R/=2,Y/=2,i/=2}function fe(ue,ie){return b===1?ue[ie]:ue.readUInt16BE(ie*b)}let oe;if(y){let ue=-1;for(oe=i;oe<R;oe++)if(fe(u,oe)===fe(n,ue===-1?0:oe-ue)){if(ue===-1&&(ue=oe),oe-ue+1===Y)return ue*b}else ue!==-1&&(oe-=oe-ue),ue=-1}else for(i+Y>R&&(i=R-Y),oe=i;oe>=0;oe--){let ue=!0;for(let ie=0;ie<Y;ie++)if(fe(u,oe+ie)!==fe(n,ie)){ue=!1;break}if(ue)return oe}return-1}f.prototype.includes=function(n,i,c){return this.indexOf(n,i,c)!==-1},f.prototype.indexOf=function(n,i,c){return G(this,n,i,c,!0)},f.prototype.lastIndexOf=function(n,i,c){return G(this,n,i,c,!1)};function X(u,n,i,c){i=Number(i)||0;const y=u.length-i;c?(c=Number(c),c>y&&(c=y)):c=y;const b=n.length;c>b/2&&(c=b/2);let R;for(R=0;R<c;++R){const Y=parseInt(n.substr(R*2,2),16);if(ze(Y))return R;u[i+R]=Y}return R}function q(u,n,i,c){return Qe(V(n,u.length-i),u,i,c)}function me(u,n,i,c){return Qe(Te(n),u,i,c)}function j(u,n,i,c){return Qe(it(n),u,i,c)}function L(u,n,i,c){return Qe(Ye(n,u.length-i),u,i,c)}f.prototype.write=function(n,i,c,y){if(i===void 0)y="utf8",c=this.length,i=0;else if(c===void 0&&typeof i=="string")y=i,c=this.length,i=0;else if(isFinite(i))i=i>>>0,isFinite(c)?(c=c>>>0,y===void 0&&(y="utf8")):(y=c,c=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const b=this.length-i;if((c===void 0||c>b)&&(c=b),n.length>0&&(c<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");y||(y="utf8");let R=!1;for(;;)switch(y){case"hex":return X(this,n,i,c);case"utf8":case"utf-8":return q(this,n,i,c);case"ascii":case"latin1":case"binary":return me(this,n,i,c);case"base64":return j(this,n,i,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,n,i,c);default:if(R)throw new TypeError("Unknown encoding: "+y);y=(""+y).toLowerCase(),R=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function N(u,n,i){return n===0&&i===u.length?t.fromByteArray(u):t.fromByteArray(u.slice(n,i))}function B(u,n,i){i=Math.min(u.length,i);const c=[];let y=n;for(;y<i;){const b=u[y];let R=null,Y=b>239?4:b>223?3:b>191?2:1;if(y+Y<=i){let fe,oe,ue,ie;switch(Y){case 1:b<128&&(R=b);break;case 2:fe=u[y+1],(fe&192)===128&&(ie=(b&31)<<6|fe&63,ie>127&&(R=ie));break;case 3:fe=u[y+1],oe=u[y+2],(fe&192)===128&&(oe&192)===128&&(ie=(b&15)<<12|(fe&63)<<6|oe&63,ie>2047&&(ie<55296||ie>57343)&&(R=ie));break;case 4:fe=u[y+1],oe=u[y+2],ue=u[y+3],(fe&192)===128&&(oe&192)===128&&(ue&192)===128&&(ie=(b&15)<<18|(fe&63)<<12|(oe&63)<<6|ue&63,ie>65535&&ie<1114112&&(R=ie))}}R===null?(R=65533,Y=1):R>65535&&(R-=65536,c.push(R>>>10&1023|55296),R=56320|R&1023),c.push(R),y+=Y}return W(c)}const U=4096;function W(u){const n=u.length;if(n<=U)return String.fromCharCode.apply(String,u);let i="",c=0;for(;c<n;)i+=String.fromCharCode.apply(String,u.slice(c,c+=U));return i}function H(u,n,i){let c="";i=Math.min(u.length,i);for(let y=n;y<i;++y)c+=String.fromCharCode(u[y]&127);return c}function J(u,n,i){let c="";i=Math.min(u.length,i);for(let y=n;y<i;++y)c+=String.fromCharCode(u[y]);return c}function se(u,n,i){const c=u.length;(!n||n<0)&&(n=0),(!i||i<0||i>c)&&(i=c);let y="";for(let b=n;b<i;++b)y+=at[u[b]];return y}function _e(u,n,i){const c=u.slice(n,i);let y="";for(let b=0;b<c.length-1;b+=2)y+=String.fromCharCode(c[b]+c[b+1]*256);return y}f.prototype.slice=function(n,i){const c=this.length;n=~~n,i=i===void 0?c:~~i,n<0?(n+=c,n<0&&(n=0)):n>c&&(n=c),i<0?(i+=c,i<0&&(i=0)):i>c&&(i=c),i<n&&(i=n);const y=this.subarray(n,i);return Object.setPrototypeOf(y,f.prototype),y};function Q(u,n,i){if(u%1!==0||u<0)throw new RangeError("offset is not uint");if(u+n>i)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUintLE=f.prototype.readUIntLE=function(n,i,c){n=n>>>0,i=i>>>0,c||Q(n,i,this.length);let y=this[n],b=1,R=0;for(;++R<i&&(b*=256);)y+=this[n+R]*b;return y},f.prototype.readUintBE=f.prototype.readUIntBE=function(n,i,c){n=n>>>0,i=i>>>0,c||Q(n,i,this.length);let y=this[n+--i],b=1;for(;i>0&&(b*=256);)y+=this[n+--i]*b;return y},f.prototype.readUint8=f.prototype.readUInt8=function(n,i){return n=n>>>0,i||Q(n,1,this.length),this[n]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(n,i){return n=n>>>0,i||Q(n,2,this.length),this[n]|this[n+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(n,i){return n=n>>>0,i||Q(n,2,this.length),this[n]<<8|this[n+1]},f.prototype.readUint32LE=f.prototype.readUInt32LE=function(n,i){return n=n>>>0,i||Q(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},f.prototype.readUint32BE=f.prototype.readUInt32BE=function(n,i){return n=n>>>0,i||Q(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},f.prototype.readBigUInt64LE=Re(function(n){n=n>>>0,M(n,"offset");const i=this[n],c=this[n+7];(i===void 0||c===void 0)&&C(n,this.length-8);const y=i+this[++n]*2**8+this[++n]*2**16+this[++n]*2**24,b=this[++n]+this[++n]*2**8+this[++n]*2**16+c*2**24;return BigInt(y)+(BigInt(b)<<BigInt(32))}),f.prototype.readBigUInt64BE=Re(function(n){n=n>>>0,M(n,"offset");const i=this[n],c=this[n+7];(i===void 0||c===void 0)&&C(n,this.length-8);const y=i*2**24+this[++n]*2**16+this[++n]*2**8+this[++n],b=this[++n]*2**24+this[++n]*2**16+this[++n]*2**8+c;return(BigInt(y)<<BigInt(32))+BigInt(b)}),f.prototype.readIntLE=function(n,i,c){n=n>>>0,i=i>>>0,c||Q(n,i,this.length);let y=this[n],b=1,R=0;for(;++R<i&&(b*=256);)y+=this[n+R]*b;return b*=128,y>=b&&(y-=Math.pow(2,8*i)),y},f.prototype.readIntBE=function(n,i,c){n=n>>>0,i=i>>>0,c||Q(n,i,this.length);let y=i,b=1,R=this[n+--y];for(;y>0&&(b*=256);)R+=this[n+--y]*b;return b*=128,R>=b&&(R-=Math.pow(2,8*i)),R},f.prototype.readInt8=function(n,i){return n=n>>>0,i||Q(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},f.prototype.readInt16LE=function(n,i){n=n>>>0,i||Q(n,2,this.length);const c=this[n]|this[n+1]<<8;return c&32768?c|4294901760:c},f.prototype.readInt16BE=function(n,i){n=n>>>0,i||Q(n,2,this.length);const c=this[n+1]|this[n]<<8;return c&32768?c|4294901760:c},f.prototype.readInt32LE=function(n,i){return n=n>>>0,i||Q(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},f.prototype.readInt32BE=function(n,i){return n=n>>>0,i||Q(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},f.prototype.readBigInt64LE=Re(function(n){n=n>>>0,M(n,"offset");const i=this[n],c=this[n+7];(i===void 0||c===void 0)&&C(n,this.length-8);const y=this[n+4]+this[n+5]*2**8+this[n+6]*2**16+(c<<24);return(BigInt(y)<<BigInt(32))+BigInt(i+this[++n]*2**8+this[++n]*2**16+this[++n]*2**24)}),f.prototype.readBigInt64BE=Re(function(n){n=n>>>0,M(n,"offset");const i=this[n],c=this[n+7];(i===void 0||c===void 0)&&C(n,this.length-8);const y=(i<<24)+this[++n]*2**16+this[++n]*2**8+this[++n];return(BigInt(y)<<BigInt(32))+BigInt(this[++n]*2**24+this[++n]*2**16+this[++n]*2**8+c)}),f.prototype.readFloatLE=function(n,i){return n=n>>>0,i||Q(n,4,this.length),r.read(this,n,!0,23,4)},f.prototype.readFloatBE=function(n,i){return n=n>>>0,i||Q(n,4,this.length),r.read(this,n,!1,23,4)},f.prototype.readDoubleLE=function(n,i){return n=n>>>0,i||Q(n,8,this.length),r.read(this,n,!0,52,8)},f.prototype.readDoubleBE=function(n,i){return n=n>>>0,i||Q(n,8,this.length),r.read(this,n,!1,52,8)};function ee(u,n,i,c,y,b){if(!f.isBuffer(u))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>y||n<b)throw new RangeError('"value" argument is out of bounds');if(i+c>u.length)throw new RangeError("Index out of range")}f.prototype.writeUintLE=f.prototype.writeUIntLE=function(n,i,c,y){if(n=+n,i=i>>>0,c=c>>>0,!y){const Y=Math.pow(2,8*c)-1;ee(this,n,i,c,Y,0)}let b=1,R=0;for(this[i]=n&255;++R<c&&(b*=256);)this[i+R]=n/b&255;return i+c},f.prototype.writeUintBE=f.prototype.writeUIntBE=function(n,i,c,y){if(n=+n,i=i>>>0,c=c>>>0,!y){const Y=Math.pow(2,8*c)-1;ee(this,n,i,c,Y,0)}let b=c-1,R=1;for(this[i+b]=n&255;--b>=0&&(R*=256);)this[i+b]=n/R&255;return i+c},f.prototype.writeUint8=f.prototype.writeUInt8=function(n,i,c){return n=+n,i=i>>>0,c||ee(this,n,i,1,255,0),this[i]=n&255,i+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(n,i,c){return n=+n,i=i>>>0,c||ee(this,n,i,2,65535,0),this[i]=n&255,this[i+1]=n>>>8,i+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(n,i,c){return n=+n,i=i>>>0,c||ee(this,n,i,2,65535,0),this[i]=n>>>8,this[i+1]=n&255,i+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(n,i,c){return n=+n,i=i>>>0,c||ee(this,n,i,4,4294967295,0),this[i+3]=n>>>24,this[i+2]=n>>>16,this[i+1]=n>>>8,this[i]=n&255,i+4},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(n,i,c){return n=+n,i=i>>>0,c||ee(this,n,i,4,4294967295,0),this[i]=n>>>24,this[i+1]=n>>>16,this[i+2]=n>>>8,this[i+3]=n&255,i+4};function ce(u,n,i,c,y){p(n,c,y,u,i,7);let b=Number(n&BigInt(4294967295));u[i++]=b,b=b>>8,u[i++]=b,b=b>>8,u[i++]=b,b=b>>8,u[i++]=b;let R=Number(n>>BigInt(32)&BigInt(4294967295));return u[i++]=R,R=R>>8,u[i++]=R,R=R>>8,u[i++]=R,R=R>>8,u[i++]=R,i}function ae(u,n,i,c,y){p(n,c,y,u,i,7);let b=Number(n&BigInt(4294967295));u[i+7]=b,b=b>>8,u[i+6]=b,b=b>>8,u[i+5]=b,b=b>>8,u[i+4]=b;let R=Number(n>>BigInt(32)&BigInt(4294967295));return u[i+3]=R,R=R>>8,u[i+2]=R,R=R>>8,u[i+1]=R,R=R>>8,u[i]=R,i+8}f.prototype.writeBigUInt64LE=Re(function(n,i=0){return ce(this,n,i,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeBigUInt64BE=Re(function(n,i=0){return ae(this,n,i,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeIntLE=function(n,i,c,y){if(n=+n,i=i>>>0,!y){const fe=Math.pow(2,8*c-1);ee(this,n,i,c,fe-1,-fe)}let b=0,R=1,Y=0;for(this[i]=n&255;++b<c&&(R*=256);)n<0&&Y===0&&this[i+b-1]!==0&&(Y=1),this[i+b]=(n/R>>0)-Y&255;return i+c},f.prototype.writeIntBE=function(n,i,c,y){if(n=+n,i=i>>>0,!y){const fe=Math.pow(2,8*c-1);ee(this,n,i,c,fe-1,-fe)}let b=c-1,R=1,Y=0;for(this[i+b]=n&255;--b>=0&&(R*=256);)n<0&&Y===0&&this[i+b+1]!==0&&(Y=1),this[i+b]=(n/R>>0)-Y&255;return i+c},f.prototype.writeInt8=function(n,i,c){return n=+n,i=i>>>0,c||ee(this,n,i,1,127,-128),n<0&&(n=255+n+1),this[i]=n&255,i+1},f.prototype.writeInt16LE=function(n,i,c){return n=+n,i=i>>>0,c||ee(this,n,i,2,32767,-32768),this[i]=n&255,this[i+1]=n>>>8,i+2},f.prototype.writeInt16BE=function(n,i,c){return n=+n,i=i>>>0,c||ee(this,n,i,2,32767,-32768),this[i]=n>>>8,this[i+1]=n&255,i+2},f.prototype.writeInt32LE=function(n,i,c){return n=+n,i=i>>>0,c||ee(this,n,i,4,2147483647,-2147483648),this[i]=n&255,this[i+1]=n>>>8,this[i+2]=n>>>16,this[i+3]=n>>>24,i+4},f.prototype.writeInt32BE=function(n,i,c){return n=+n,i=i>>>0,c||ee(this,n,i,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),this[i]=n>>>24,this[i+1]=n>>>16,this[i+2]=n>>>8,this[i+3]=n&255,i+4},f.prototype.writeBigInt64LE=Re(function(n,i=0){return ce(this,n,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),f.prototype.writeBigInt64BE=Re(function(n,i=0){return ae(this,n,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ye(u,n,i,c,y,b){if(i+c>u.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function _(u,n,i,c,y){return n=+n,i=i>>>0,y||ye(u,n,i,4),r.write(u,n,i,c,23,4),i+4}f.prototype.writeFloatLE=function(n,i,c){return _(this,n,i,!0,c)},f.prototype.writeFloatBE=function(n,i,c){return _(this,n,i,!1,c)};function m(u,n,i,c,y){return n=+n,i=i>>>0,y||ye(u,n,i,8),r.write(u,n,i,c,52,8),i+8}f.prototype.writeDoubleLE=function(n,i,c){return m(this,n,i,!0,c)},f.prototype.writeDoubleBE=function(n,i,c){return m(this,n,i,!1,c)},f.prototype.copy=function(n,i,c,y){if(!f.isBuffer(n))throw new TypeError("argument should be a Buffer");if(c||(c=0),!y&&y!==0&&(y=this.length),i>=n.length&&(i=n.length),i||(i=0),y>0&&y<c&&(y=c),y===c||n.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(c<0||c>=this.length)throw new RangeError("Index out of range");if(y<0)throw new RangeError("sourceEnd out of bounds");y>this.length&&(y=this.length),n.length-i<y-c&&(y=n.length-i+c);const b=y-c;return this===n&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,c,y):Uint8Array.prototype.set.call(n,this.subarray(c,y),i),b},f.prototype.fill=function(n,i,c,y){if(typeof n=="string"){if(typeof i=="string"?(y=i,i=0,c=this.length):typeof c=="string"&&(y=c,c=this.length),y!==void 0&&typeof y!="string")throw new TypeError("encoding must be a string");if(typeof y=="string"&&!f.isEncoding(y))throw new TypeError("Unknown encoding: "+y);if(n.length===1){const R=n.charCodeAt(0);(y==="utf8"&&R<128||y==="latin1")&&(n=R)}}else typeof n=="number"?n=n&255:typeof n=="boolean"&&(n=Number(n));if(i<0||this.length<i||this.length<c)throw new RangeError("Out of range index");if(c<=i)return this;i=i>>>0,c=c===void 0?this.length:c>>>0,n||(n=0);let b;if(typeof n=="number")for(b=i;b<c;++b)this[b]=n;else{const R=f.isBuffer(n)?n:f.from(n,y),Y=R.length;if(Y===0)throw new TypeError('The value "'+n+'" is invalid for argument "value"');for(b=0;b<c-i;++b)this[b+i]=R[b%Y]}return this};const T={};function $(u,n,i){T[u]=class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:n.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${u}]`,this.stack,delete this.name}get code(){return u}set code(y){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:y,writable:!0})}toString(){return`${this.name} [${u}]: ${this.message}`}}}$("ERR_BUFFER_OUT_OF_BOUNDS",function(u){return u?`${u} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),$("ERR_INVALID_ARG_TYPE",function(u,n){return`The "${u}" argument must be of type number. Received type ${typeof n}`},TypeError),$("ERR_OUT_OF_RANGE",function(u,n,i){let c=`The value of "${u}" is out of range.`,y=i;return Number.isInteger(i)&&Math.abs(i)>2**32?y=z(String(i)):typeof i=="bigint"&&(y=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(y=z(y)),y+="n"),c+=` It must be ${n}. Received ${y}`,c},RangeError);function z(u){let n="",i=u.length;const c=u[0]==="-"?1:0;for(;i>=c+4;i-=3)n=`_${u.slice(i-3,i)}${n}`;return`${u.slice(0,i)}${n}`}function d(u,n,i){M(n,"offset"),(u[n]===void 0||u[n+i]===void 0)&&C(n,u.length-(i+1))}function p(u,n,i,c,y,b){if(u>i||u<n){const R=typeof n=="bigint"?"n":"";let Y;throw b>3?n===0||n===BigInt(0)?Y=`>= 0${R} and < 2${R} ** ${(b+1)*8}${R}`:Y=`>= -(2${R} ** ${(b+1)*8-1}${R}) and < 2 ** ${(b+1)*8-1}${R}`:Y=`>= ${n}${R} and <= ${i}${R}`,new T.ERR_OUT_OF_RANGE("value",Y,u)}d(c,y,b)}function M(u,n){if(typeof u!="number")throw new T.ERR_INVALID_ARG_TYPE(n,"number",u)}function C(u,n,i){throw Math.floor(u)!==u?(M(u,i),new T.ERR_OUT_OF_RANGE(i||"offset","an integer",u)):n<0?new T.ERR_BUFFER_OUT_OF_BOUNDS:new T.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${n}`,u)}const re=/[^+/0-9A-Za-z-_]/g;function Z(u){if(u=u.split("=")[0],u=u.trim().replace(re,""),u.length<2)return"";for(;u.length%4!==0;)u=u+"=";return u}function V(u,n){n=n||1/0;let i;const c=u.length;let y=null;const b=[];for(let R=0;R<c;++R){if(i=u.charCodeAt(R),i>55295&&i<57344){if(!y){if(i>56319){(n-=3)>-1&&b.push(239,191,189);continue}else if(R+1===c){(n-=3)>-1&&b.push(239,191,189);continue}y=i;continue}if(i<56320){(n-=3)>-1&&b.push(239,191,189),y=i;continue}i=(y-55296<<10|i-56320)+65536}else y&&(n-=3)>-1&&b.push(239,191,189);if(y=null,i<128){if((n-=1)<0)break;b.push(i)}else if(i<2048){if((n-=2)<0)break;b.push(i>>6|192,i&63|128)}else if(i<65536){if((n-=3)<0)break;b.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((n-=4)<0)break;b.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return b}function Te(u){const n=[];for(let i=0;i<u.length;++i)n.push(u.charCodeAt(i)&255);return n}function Ye(u,n){let i,c,y;const b=[];for(let R=0;R<u.length&&!((n-=2)<0);++R)i=u.charCodeAt(R),c=i>>8,y=i%256,b.push(y),b.push(c);return b}function it(u){return t.toByteArray(Z(u))}function Qe(u,n,i,c){let y;for(y=0;y<c&&!(y+i>=n.length||y>=u.length);++y)n[y+i]=u[y];return y}function Ee(u,n){return u instanceof n||u!=null&&u.constructor!=null&&u.constructor.name!=null&&u.constructor.name===n.name}function ze(u){return u!==u}const at=function(){const u="0123456789abcdef",n=new Array(256);for(let i=0;i<16;++i){const c=i*16;for(let y=0;y<16;++y)n[c+y]=u[i]+u[y]}return n}();function Re(u){return typeof BigInt>"u"?qe:u}function qe(){throw new Error("BigInt not supported")}})(rt);var dr={exports:{}},et=typeof Reflect=="object"?Reflect:null,Ar=et&&typeof et.apply=="function"?et.apply:function(t,r,a){return Function.prototype.apply.call(t,r,a)},dt;et&&typeof et.ownKeys=="function"?dt=et.ownKeys:Object.getOwnPropertySymbols?dt=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:dt=function(t){return Object.getOwnPropertyNames(t)};function ka(e){console&&console.warn&&console.warn(e)}var Hn=Number.isNaN||function(t){return t!==t};function ne(){ne.init.call(this)}dr.exports=ne;dr.exports.once=$a;ne.EventEmitter=ne;ne.prototype._events=void 0;ne.prototype._eventsCount=0;ne.prototype._maxListeners=void 0;var Or=10;function St(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(ne,"defaultMaxListeners",{enumerable:!0,get:function(){return Or},set:function(e){if(typeof e!="number"||e<0||Hn(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Or=e}});ne.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};ne.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Hn(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function Zn(e){return e._maxListeners===void 0?ne.defaultMaxListeners:e._maxListeners}ne.prototype.getMaxListeners=function(){return Zn(this)};ne.prototype.emit=function(t){for(var r=[],a=1;a<arguments.length;a++)r.push(arguments[a]);var o=t==="error",s=this._events;if(s!==void 0)o=o&&s.error===void 0;else if(!o)return!1;if(o){var l;if(r.length>0&&(l=r[0]),l instanceof Error)throw l;var f=new Error("Unhandled error."+(l?" ("+l.message+")":""));throw f.context=l,f}var h=s[t];if(h===void 0)return!1;if(typeof h=="function")Ar(h,this,r);else for(var v=h.length,g=Kn(h,v),a=0;a<v;++a)Ar(g[a],this,r);return!0};function Xn(e,t,r,a){var o,s,l;if(St(r),s=e._events,s===void 0?(s=e._events=Object.create(null),e._eventsCount=0):(s.newListener!==void 0&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),l=s[t]),l===void 0)l=s[t]=r,++e._eventsCount;else if(typeof l=="function"?l=s[t]=a?[r,l]:[l,r]:a?l.unshift(r):l.push(r),o=Zn(e),o>0&&l.length>o&&!l.warned){l.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=l.length,ka(f)}return e}ne.prototype.addListener=function(t,r){return Xn(this,t,r,!1)};ne.prototype.on=ne.prototype.addListener;ne.prototype.prependListener=function(t,r){return Xn(this,t,r,!0)};function Fa(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Yn(e,t,r){var a={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=Fa.bind(a);return o.listener=r,a.wrapFn=o,o}ne.prototype.once=function(t,r){return St(r),this.on(t,Yn(this,t,r)),this};ne.prototype.prependOnceListener=function(t,r){return St(r),this.prependListener(t,Yn(this,t,r)),this};ne.prototype.removeListener=function(t,r){var a,o,s,l,f;if(St(r),o=this._events,o===void 0)return this;if(a=o[t],a===void 0)return this;if(a===r||a.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete o[t],o.removeListener&&this.emit("removeListener",t,a.listener||r));else if(typeof a!="function"){for(s=-1,l=a.length-1;l>=0;l--)if(a[l]===r||a[l].listener===r){f=a[l].listener,s=l;break}if(s<0)return this;s===0?a.shift():Pa(a,s),a.length===1&&(o[t]=a[0]),o.removeListener!==void 0&&this.emit("removeListener",t,f||r)}return this};ne.prototype.off=ne.prototype.removeListener;ne.prototype.removeAllListeners=function(t){var r,a,o;if(a=this._events,a===void 0)return this;if(a.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):a[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete a[t]),this;if(arguments.length===0){var s=Object.keys(a),l;for(o=0;o<s.length;++o)l=s[o],l!=="removeListener"&&this.removeAllListeners(l);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=a[t],typeof r=="function")this.removeListener(t,r);else if(r!==void 0)for(o=r.length-1;o>=0;o--)this.removeListener(t,r[o]);return this};function Qn(e,t,r){var a=e._events;if(a===void 0)return[];var o=a[t];return o===void 0?[]:typeof o=="function"?r?[o.listener||o]:[o]:r?Ua(o):Kn(o,o.length)}ne.prototype.listeners=function(t){return Qn(this,t,!0)};ne.prototype.rawListeners=function(t){return Qn(this,t,!1)};ne.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):Vn.call(e,t)};ne.prototype.listenerCount=Vn;function Vn(e){var t=this._events;if(t!==void 0){var r=t[e];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}ne.prototype.eventNames=function(){return this._eventsCount>0?dt(this._events):[]};function Kn(e,t){for(var r=new Array(t),a=0;a<t;++a)r[a]=e[a];return r}function Pa(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function Ua(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}function $a(e,t){return new Promise(function(r,a){function o(l){e.removeListener(t,s),a(l)}function s(){typeof e.removeListener=="function"&&e.removeListener("error",o),r([].slice.call(arguments))}Jn(e,t,s,{once:!0}),t!=="error"&&Da(e,o,{once:!0})})}function Da(e,t,r){typeof e.on=="function"&&Jn(e,"error",t,r)}function Jn(e,t,r,a){if(typeof e.on=="function")a.once?e.once(t,r):e.on(t,r);else if(typeof e.addEventListener=="function")e.addEventListener(t,function o(s){a.once&&e.removeEventListener(t,o),r(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var pr=dr.exports;const ja=hr(pr);var Mt={exports:{}},vr="_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ei="-0123456789"+vr,za=new RegExp("^[^"+vr+"]|[^\\"+ei+"]","g"),qa=12,Ga={random:ti,sanitize:ri,ensure:Wa};function ti(e){return e=e||qa,Br(1,vr)+Br(e-1,ei)}function ri(e){return e.replace(za,"_")}function Wa(e,t){return typeof e=="string"?ri(e):ti(t)}function Br(e,t){for(var r=t.length,a="";e>0;)e--,a+=t[Math.floor(Math.random()*r)];return a}var Ha=typeof he=="object"&&he&&he.Object===Object&&he,Za=typeof self=="object"&&self&&self.Object===Object&&self,Xa=Ha||Za||Function("return this")(),Ya=Xa.isFinite;function Qa(e){return typeof e=="number"&&Ya(e)}var ut=Qa,yt={},Zt={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var r=rt,a=r.Buffer;function o(l,f){for(var h in l)f[h]=l[h]}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=s);function s(l,f,h){return a(l,f,h)}s.prototype=Object.create(a.prototype),o(a,s),s.from=function(l,f,h){if(typeof l=="number")throw new TypeError("Argument must not be a number");return a(l,f,h)},s.alloc=function(l,f,h){if(typeof l!="number")throw new TypeError("Argument must be a number");var v=a(l);return f!==void 0?typeof h=="string"?v.fill(f,h):v.fill(f):v.fill(0),v},s.allocUnsafe=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return a(l)},s.allocUnsafeSlow=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(l)}})(Zt,Zt.exports);var Va=Zt.exports,gr=Va.Buffer,Ir=gr.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Ka(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function Ja(e){var t=Ka(e);if(typeof t!="string"&&(gr.isEncoding===Ir||!Ir(e)))throw new Error("Unknown encoding: "+e);return t||e}yt.StringDecoder=lt;function lt(e){this.encoding=Ja(e);var t;switch(this.encoding){case"utf16le":this.text=ao,this.end=oo,t=4;break;case"utf8":this.fillLast=ro,t=4;break;case"base64":this.text=so,this.end=fo,t=3;break;default:this.write=uo,this.end=lo;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=gr.allocUnsafe(t)}lt.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};lt.prototype.end=io;lt.prototype.text=no;lt.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function Nt(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function eo(e,t,r){var a=t.length-1;if(a<r)return 0;var o=Nt(t[a]);return o>=0?(o>0&&(e.lastNeed=o-1),o):--a<r||o===-2?0:(o=Nt(t[a]),o>=0?(o>0&&(e.lastNeed=o-2),o):--a<r||o===-2?0:(o=Nt(t[a]),o>=0?(o>0&&(o===2?o=0:e.lastNeed=o-3),o):0))}function to(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"�"}}function ro(e){var t=this.lastTotal-this.lastNeed,r=to(this,e);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function no(e,t){var r=eo(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var a=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,a),e.toString("utf8",t,a)}function io(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function ao(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var a=r.charCodeAt(r.length-1);if(a>=55296&&a<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function oo(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function so(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function fo(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function uo(e){return e.toString(this.encoding)}function lo(e){return e&&e.length?this.write(e):""}var Xt={exports:{}};typeof Object.create=="function"?Xt.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Xt.exports=function(t,r){if(r){t.super_=r;var a=function(){};a.prototype=r.prototype,t.prototype=new a,t.prototype.constructor=t}};var $e=Xt.exports,Yt={exports:{}},ni=pr.EventEmitter;const ho={},co=Object.freeze(Object.defineProperty({__proto__:null,default:ho},Symbol.toStringTag,{value:"Module"})),ii=Ea(co);var Ct,Lr;function po(){if(Lr)return Ct;Lr=1;function e(x,S){var O=Object.keys(x);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(x);S&&(I=I.filter(function(D){return Object.getOwnPropertyDescriptor(x,D).enumerable})),O.push.apply(O,I)}return O}function t(x){for(var S=1;S<arguments.length;S++){var O=arguments[S]!=null?arguments[S]:{};S%2?e(Object(O),!0).forEach(function(I){r(x,I,O[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(O)):e(Object(O)).forEach(function(I){Object.defineProperty(x,I,Object.getOwnPropertyDescriptor(O,I))})}return x}function r(x,S,O){return S=l(S),S in x?Object.defineProperty(x,S,{value:O,enumerable:!0,configurable:!0,writable:!0}):x[S]=O,x}function a(x,S){if(!(x instanceof S))throw new TypeError("Cannot call a class as a function")}function o(x,S){for(var O=0;O<S.length;O++){var I=S[O];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(x,l(I.key),I)}}function s(x,S,O){return S&&o(x.prototype,S),O&&o(x,O),Object.defineProperty(x,"prototype",{writable:!1}),x}function l(x){var S=f(x,"string");return typeof S=="symbol"?S:String(S)}function f(x,S){if(typeof x!="object"||x===null)return x;var O=x[Symbol.toPrimitive];if(O!==void 0){var I=O.call(x,S||"default");if(typeof I!="object")return I;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(x)}var h=rt,v=h.Buffer,g=ii,w=g.inspect,E=w&&w.custom||"inspect";function A(x,S,O){v.prototype.copy.call(x,S,O)}return Ct=function(){function x(){a(this,x),this.head=null,this.tail=null,this.length=0}return s(x,[{key:"push",value:function(O){var I={data:O,next:null};this.length>0?this.tail.next=I:this.head=I,this.tail=I,++this.length}},{key:"unshift",value:function(O){var I={data:O,next:this.head};this.length===0&&(this.tail=I),this.head=I,++this.length}},{key:"shift",value:function(){if(this.length!==0){var O=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,O}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(O){if(this.length===0)return"";for(var I=this.head,D=""+I.data;I=I.next;)D+=O+I.data;return D}},{key:"concat",value:function(O){if(this.length===0)return v.alloc(0);for(var I=v.allocUnsafe(O>>>0),D=this.head,F=0;D;)A(D.data,I,F),F+=D.data.length,D=D.next;return I}},{key:"consume",value:function(O,I){var D;return O<this.head.data.length?(D=this.head.data.slice(0,O),this.head.data=this.head.data.slice(O)):O===this.head.data.length?D=this.shift():D=I?this._getString(O):this._getBuffer(O),D}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(O){var I=this.head,D=1,F=I.data;for(O-=F.length;I=I.next;){var k=I.data,P=O>k.length?k.length:O;if(P===k.length?F+=k:F+=k.slice(0,O),O-=P,O===0){P===k.length?(++D,I.next?this.head=I.next:this.head=this.tail=null):(this.head=I,I.data=k.slice(P));break}++D}return this.length-=D,F}},{key:"_getBuffer",value:function(O){var I=v.allocUnsafe(O),D=this.head,F=1;for(D.data.copy(I),O-=D.data.length;D=D.next;){var k=D.data,P=O>k.length?k.length:O;if(k.copy(I,I.length-O,0,P),O-=P,O===0){P===k.length?(++F,D.next?this.head=D.next:this.head=this.tail=null):(this.head=D,D.data=k.slice(P));break}++F}return this.length-=F,I}},{key:E,value:function(O,I){return w(this,t(t({},I),{},{depth:0,customInspect:!1}))}}]),x}(),Ct}function vo(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return a||o?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Qt,this,e)):process.nextTick(Qt,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(s){!t&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(pt,r):(r._writableState.errorEmitted=!0,process.nextTick(Nr,r,s)):process.nextTick(Nr,r,s):t?(process.nextTick(pt,r),t(s)):process.nextTick(pt,r)}),this)}function Nr(e,t){Qt(e,t),pt(e)}function pt(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function go(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Qt(e,t){e.emit("error",t)}function yo(e,t){var r=e._readableState,a=e._writableState;r&&r.autoDestroy||a&&a.autoDestroy?e.destroy(t):e.emit("error",t)}var ai={destroy:vo,undestroy:go,errorOrDestroy:yo},Xe={};function mo(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var oi={};function Me(e,t,r){r||(r=Error);function a(s,l,f){return typeof t=="string"?t:t(s,l,f)}var o=function(s){mo(l,s);function l(f,h,v){return s.call(this,a(f,h,v))||this}return l}(r);o.prototype.name=r.name,o.prototype.code=e,oi[e]=o}function Cr(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(a){return String(a)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function wo(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function _o(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function bo(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Me("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Me("ERR_INVALID_ARG_TYPE",function(e,t,r){var a;typeof t=="string"&&wo(t,"not ")?(a="must not be",t=t.replace(/^not /,"")):a="must be";var o;if(_o(e," argument"))o="The ".concat(e," ").concat(a," ").concat(Cr(t,"type"));else{var s=bo(e,".")?"property":"argument";o='The "'.concat(e,'" ').concat(s," ").concat(a," ").concat(Cr(t,"type"))}return o+=". Received type ".concat(typeof r),o},TypeError);Me("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Me("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Me("ERR_STREAM_PREMATURE_CLOSE","Premature close");Me("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Me("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Me("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Me("ERR_STREAM_WRITE_AFTER_END","write after end");Me("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Me("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Me("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Xe.codes=oi;var Eo=Xe.codes.ERR_INVALID_OPT_VALUE;function xo(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function Ro(e,t,r,a){var o=xo(t,a,r);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0){var s=a?r:"highWaterMark";throw new Eo(s,o)}return Math.floor(o)}return e.objectMode?16:16*1024}var si={getHighWaterMark:Ro},So=Mo;function Mo(e,t){if(kt("noDeprecation"))return e;var r=!1;function a(){if(!r){if(kt("throwDeprecation"))throw new Error(t);kt("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return a}function kt(e){try{if(!he.localStorage)return!1}catch{return!1}var t=he.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}var Ft,kr;function fi(){if(kr)return Ft;kr=1,Ft=X;function e(_){var m=this;this.next=null,this.entry=null,this.finish=function(){ye(m,_)}}var t;X.WritableState=G;var r={deprecate:So},a=ni,o=rt.Buffer,s=(typeof he<"u"?he:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function l(_){return o.from(_)}function f(_){return o.isBuffer(_)||_ instanceof s}var h=ai,v=si,g=v.getHighWaterMark,w=Xe.codes,E=w.ERR_INVALID_ARG_TYPE,A=w.ERR_METHOD_NOT_IMPLEMENTED,x=w.ERR_MULTIPLE_CALLBACK,S=w.ERR_STREAM_CANNOT_PIPE,O=w.ERR_STREAM_DESTROYED,I=w.ERR_STREAM_NULL_VALUES,D=w.ERR_STREAM_WRITE_AFTER_END,F=w.ERR_UNKNOWN_ENCODING,k=h.errorOrDestroy;$e(X,a);function P(){}function G(_,m,T){t=t||tt(),_=_||{},typeof T!="boolean"&&(T=m instanceof t),this.objectMode=!!_.objectMode,T&&(this.objectMode=this.objectMode||!!_.writableObjectMode),this.highWaterMark=g(this,_,"writableHighWaterMark",T),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var $=_.decodeStrings===!1;this.decodeStrings=!$,this.defaultEncoding=_.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(z){W(m,z)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=_.emitClose!==!1,this.autoDestroy=!!_.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}G.prototype.getBuffer=function(){for(var m=this.bufferedRequest,T=[];m;)T.push(m),m=m.next;return T},function(){try{Object.defineProperty(G.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var te;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(te=Function.prototype[Symbol.hasInstance],Object.defineProperty(X,Symbol.hasInstance,{value:function(m){return te.call(this,m)?!0:this!==X?!1:m&&m._writableState instanceof G}})):te=function(m){return m instanceof this};function X(_){t=t||tt();var m=this instanceof t;if(!m&&!te.call(X,this))return new X(_);this._writableState=new G(_,this,m),this.writable=!0,_&&(typeof _.write=="function"&&(this._write=_.write),typeof _.writev=="function"&&(this._writev=_.writev),typeof _.destroy=="function"&&(this._destroy=_.destroy),typeof _.final=="function"&&(this._final=_.final)),a.call(this)}X.prototype.pipe=function(){k(this,new S)};function q(_,m){var T=new D;k(_,T),process.nextTick(m,T)}function me(_,m,T,$){var z;return T===null?z=new I:typeof T!="string"&&!m.objectMode&&(z=new E("chunk",["string","Buffer"],T)),z?(k(_,z),process.nextTick($,z),!1):!0}X.prototype.write=function(_,m,T){var $=this._writableState,z=!1,d=!$.objectMode&&f(_);return d&&!o.isBuffer(_)&&(_=l(_)),typeof m=="function"&&(T=m,m=null),d?m="buffer":m||(m=$.defaultEncoding),typeof T!="function"&&(T=P),$.ending?q(this,T):(d||me(this,$,_,T))&&($.pendingcb++,z=L(this,$,d,_,m,T)),z},X.prototype.cork=function(){this._writableState.corked++},X.prototype.uncork=function(){var _=this._writableState;_.corked&&(_.corked--,!_.writing&&!_.corked&&!_.bufferProcessing&&_.bufferedRequest&&se(this,_))},X.prototype.setDefaultEncoding=function(m){if(typeof m=="string"&&(m=m.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((m+"").toLowerCase())>-1))throw new F(m);return this._writableState.defaultEncoding=m,this},Object.defineProperty(X.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function j(_,m,T){return!_.objectMode&&_.decodeStrings!==!1&&typeof m=="string"&&(m=o.from(m,T)),m}Object.defineProperty(X.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function L(_,m,T,$,z,d){if(!T){var p=j(m,$,z);$!==p&&(T=!0,z="buffer",$=p)}var M=m.objectMode?1:$.length;m.length+=M;var C=m.length<m.highWaterMark;if(C||(m.needDrain=!0),m.writing||m.corked){var re=m.lastBufferedRequest;m.lastBufferedRequest={chunk:$,encoding:z,isBuf:T,callback:d,next:null},re?re.next=m.lastBufferedRequest:m.bufferedRequest=m.lastBufferedRequest,m.bufferedRequestCount+=1}else N(_,m,!1,M,$,z,d);return C}function N(_,m,T,$,z,d,p){m.writelen=$,m.writecb=p,m.writing=!0,m.sync=!0,m.destroyed?m.onwrite(new O("write")):T?_._writev(z,m.onwrite):_._write(z,d,m.onwrite),m.sync=!1}function B(_,m,T,$,z){--m.pendingcb,T?(process.nextTick(z,$),process.nextTick(ce,_,m),_._writableState.errorEmitted=!0,k(_,$)):(z($),_._writableState.errorEmitted=!0,k(_,$),ce(_,m))}function U(_){_.writing=!1,_.writecb=null,_.length-=_.writelen,_.writelen=0}function W(_,m){var T=_._writableState,$=T.sync,z=T.writecb;if(typeof z!="function")throw new x;if(U(T),m)B(_,T,$,m,z);else{var d=_e(T)||_.destroyed;!d&&!T.corked&&!T.bufferProcessing&&T.bufferedRequest&&se(_,T),$?process.nextTick(H,_,T,d,z):H(_,T,d,z)}}function H(_,m,T,$){T||J(_,m),m.pendingcb--,$(),ce(_,m)}function J(_,m){m.length===0&&m.needDrain&&(m.needDrain=!1,_.emit("drain"))}function se(_,m){m.bufferProcessing=!0;var T=m.bufferedRequest;if(_._writev&&T&&T.next){var $=m.bufferedRequestCount,z=new Array($),d=m.corkedRequestsFree;d.entry=T;for(var p=0,M=!0;T;)z[p]=T,T.isBuf||(M=!1),T=T.next,p+=1;z.allBuffers=M,N(_,m,!0,m.length,z,"",d.finish),m.pendingcb++,m.lastBufferedRequest=null,d.next?(m.corkedRequestsFree=d.next,d.next=null):m.corkedRequestsFree=new e(m),m.bufferedRequestCount=0}else{for(;T;){var C=T.chunk,re=T.encoding,Z=T.callback,V=m.objectMode?1:C.length;if(N(_,m,!1,V,C,re,Z),T=T.next,m.bufferedRequestCount--,m.writing)break}T===null&&(m.lastBufferedRequest=null)}m.bufferedRequest=T,m.bufferProcessing=!1}X.prototype._write=function(_,m,T){T(new A("_write()"))},X.prototype._writev=null,X.prototype.end=function(_,m,T){var $=this._writableState;return typeof _=="function"?(T=_,_=null,m=null):typeof m=="function"&&(T=m,m=null),_!=null&&this.write(_,m),$.corked&&($.corked=1,this.uncork()),$.ending||ae(this,$,T),this},Object.defineProperty(X.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function _e(_){return _.ending&&_.length===0&&_.bufferedRequest===null&&!_.finished&&!_.writing}function Q(_,m){_._final(function(T){m.pendingcb--,T&&k(_,T),m.prefinished=!0,_.emit("prefinish"),ce(_,m)})}function ee(_,m){!m.prefinished&&!m.finalCalled&&(typeof _._final=="function"&&!m.destroyed?(m.pendingcb++,m.finalCalled=!0,process.nextTick(Q,_,m)):(m.prefinished=!0,_.emit("prefinish")))}function ce(_,m){var T=_e(m);if(T&&(ee(_,m),m.pendingcb===0&&(m.finished=!0,_.emit("finish"),m.autoDestroy))){var $=_._readableState;(!$||$.autoDestroy&&$.endEmitted)&&_.destroy()}return T}function ae(_,m,T){m.ending=!0,ce(_,m),T&&(m.finished?process.nextTick(T):_.once("finish",T)),m.ended=!0,_.writable=!1}function ye(_,m,T){var $=_.entry;for(_.entry=null;$;){var z=$.callback;m.pendingcb--,z(T),$=$.next}m.corkedRequestsFree.next=_}return Object.defineProperty(X.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(m){this._writableState&&(this._writableState.destroyed=m)}}),X.prototype.destroy=h.destroy,X.prototype._undestroy=h.undestroy,X.prototype._destroy=function(_,m){m(_)},Ft}var Pt,Fr;function tt(){if(Fr)return Pt;Fr=1;var e=Object.keys||function(v){var g=[];for(var w in v)g.push(w);return g};Pt=l;var t=li(),r=fi();$e(l,t);for(var a=e(r.prototype),o=0;o<a.length;o++){var s=a[o];l.prototype[s]||(l.prototype[s]=r.prototype[s])}function l(v){if(!(this instanceof l))return new l(v);t.call(this,v),r.call(this,v),this.allowHalfOpen=!0,v&&(v.readable===!1&&(this.readable=!1),v.writable===!1&&(this.writable=!1),v.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",f)))}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function f(){this._writableState.ended||process.nextTick(h,this)}function h(v){v.end()}return Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(g){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=g,this._writableState.destroyed=g)}}),Pt}var Pr=Xe.codes.ERR_STREAM_PREMATURE_CLOSE;function To(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];e.apply(this,a)}}}function Ao(){}function Oo(e){return e.setHeader&&typeof e.abort=="function"}function ui(e,t,r){if(typeof t=="function")return ui(e,null,t);t||(t={}),r=To(r||Ao);var a=t.readable||t.readable!==!1&&e.readable,o=t.writable||t.writable!==!1&&e.writable,s=function(){e.writable||f()},l=e._writableState&&e._writableState.finished,f=function(){o=!1,l=!0,a||r.call(e)},h=e._readableState&&e._readableState.endEmitted,v=function(){a=!1,h=!0,o||r.call(e)},g=function(x){r.call(e,x)},w=function(){var x;if(a&&!h)return(!e._readableState||!e._readableState.ended)&&(x=new Pr),r.call(e,x);if(o&&!l)return(!e._writableState||!e._writableState.ended)&&(x=new Pr),r.call(e,x)},E=function(){e.req.on("finish",f)};return Oo(e)?(e.on("complete",f),e.on("abort",w),e.req?E():e.on("request",E)):o&&!e._writableState&&(e.on("end",s),e.on("close",s)),e.on("end",v),e.on("finish",f),t.error!==!1&&e.on("error",g),e.on("close",w),function(){e.removeListener("complete",f),e.removeListener("abort",w),e.removeListener("request",E),e.req&&e.req.removeListener("finish",f),e.removeListener("end",s),e.removeListener("close",s),e.removeListener("finish",f),e.removeListener("end",v),e.removeListener("error",g),e.removeListener("close",w)}}var yr=ui,Ut,Ur;function Bo(){if(Ur)return Ut;Ur=1;var e;function t(F,k,P){return k=r(k),k in F?Object.defineProperty(F,k,{value:P,enumerable:!0,configurable:!0,writable:!0}):F[k]=P,F}function r(F){var k=a(F,"string");return typeof k=="symbol"?k:String(k)}function a(F,k){if(typeof F!="object"||F===null)return F;var P=F[Symbol.toPrimitive];if(P!==void 0){var G=P.call(F,k||"default");if(typeof G!="object")return G;throw new TypeError("@@toPrimitive must return a primitive value.")}return(k==="string"?String:Number)(F)}var o=yr,s=Symbol("lastResolve"),l=Symbol("lastReject"),f=Symbol("error"),h=Symbol("ended"),v=Symbol("lastPromise"),g=Symbol("handlePromise"),w=Symbol("stream");function E(F,k){return{value:F,done:k}}function A(F){var k=F[s];if(k!==null){var P=F[w].read();P!==null&&(F[v]=null,F[s]=null,F[l]=null,k(E(P,!1)))}}function x(F){process.nextTick(A,F)}function S(F,k){return function(P,G){F.then(function(){if(k[h]){P(E(void 0,!0));return}k[g](P,G)},G)}}var O=Object.getPrototypeOf(function(){}),I=Object.setPrototypeOf((e={get stream(){return this[w]},next:function(){var k=this,P=this[f];if(P!==null)return Promise.reject(P);if(this[h])return Promise.resolve(E(void 0,!0));if(this[w].destroyed)return new Promise(function(q,me){process.nextTick(function(){k[f]?me(k[f]):q(E(void 0,!0))})});var G=this[v],te;if(G)te=new Promise(S(G,this));else{var X=this[w].read();if(X!==null)return Promise.resolve(E(X,!1));te=new Promise(this[g])}return this[v]=te,te}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var k=this;return new Promise(function(P,G){k[w].destroy(null,function(te){if(te){G(te);return}P(E(void 0,!0))})})}),e),O),D=function(k){var P,G=Object.create(I,(P={},t(P,w,{value:k,writable:!0}),t(P,s,{value:null,writable:!0}),t(P,l,{value:null,writable:!0}),t(P,f,{value:null,writable:!0}),t(P,h,{value:k._readableState.endEmitted,writable:!0}),t(P,g,{value:function(X,q){var me=G[w].read();me?(G[v]=null,G[s]=null,G[l]=null,X(E(me,!1))):(G[s]=X,G[l]=q)},writable:!0}),P));return G[v]=null,o(k,function(te){if(te&&te.code!=="ERR_STREAM_PREMATURE_CLOSE"){var X=G[l];X!==null&&(G[v]=null,G[s]=null,G[l]=null,X(te)),G[f]=te;return}var q=G[s];q!==null&&(G[v]=null,G[s]=null,G[l]=null,q(E(void 0,!0))),G[h]=!0}),k.on("readable",x.bind(null,G)),G};return Ut=D,Ut}var $t,$r;function Io(){return $r||($r=1,$t=function(){throw new Error("Readable.from is not available in the browser")}),$t}var Dt,Dr;function li(){if(Dr)return Dt;Dr=1,Dt=q;var e;q.ReadableState=X,pr.EventEmitter;var t=function(p,M){return p.listeners(M).length},r=ni,a=rt.Buffer,o=(typeof he<"u"?he:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(d){return a.from(d)}function l(d){return a.isBuffer(d)||d instanceof o}var f=ii,h;f&&f.debuglog?h=f.debuglog("stream"):h=function(){};var v=po(),g=ai,w=si,E=w.getHighWaterMark,A=Xe.codes,x=A.ERR_INVALID_ARG_TYPE,S=A.ERR_STREAM_PUSH_AFTER_EOF,O=A.ERR_METHOD_NOT_IMPLEMENTED,I=A.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,D,F,k;$e(q,r);var P=g.errorOrDestroy,G=["error","close","destroy","pause","resume"];function te(d,p,M){if(typeof d.prependListener=="function")return d.prependListener(p,M);!d._events||!d._events[p]?d.on(p,M):Array.isArray(d._events[p])?d._events[p].unshift(M):d._events[p]=[M,d._events[p]]}function X(d,p,M){e=e||tt(),d=d||{},typeof M!="boolean"&&(M=p instanceof e),this.objectMode=!!d.objectMode,M&&(this.objectMode=this.objectMode||!!d.readableObjectMode),this.highWaterMark=E(this,d,"readableHighWaterMark",M),this.buffer=new v,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=d.emitClose!==!1,this.autoDestroy=!!d.autoDestroy,this.destroyed=!1,this.defaultEncoding=d.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,d.encoding&&(D||(D=yt.StringDecoder),this.decoder=new D(d.encoding),this.encoding=d.encoding)}function q(d){if(e=e||tt(),!(this instanceof q))return new q(d);var p=this instanceof e;this._readableState=new X(d,this,p),this.readable=!0,d&&(typeof d.read=="function"&&(this._read=d.read),typeof d.destroy=="function"&&(this._destroy=d.destroy)),r.call(this)}Object.defineProperty(q.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(p){this._readableState&&(this._readableState.destroyed=p)}}),q.prototype.destroy=g.destroy,q.prototype._undestroy=g.undestroy,q.prototype._destroy=function(d,p){p(d)},q.prototype.push=function(d,p){var M=this._readableState,C;return M.objectMode?C=!0:typeof d=="string"&&(p=p||M.defaultEncoding,p!==M.encoding&&(d=a.from(d,p),p=""),C=!0),me(this,d,p,!1,C)},q.prototype.unshift=function(d){return me(this,d,null,!0,!1)};function me(d,p,M,C,re){h("readableAddChunk",p);var Z=d._readableState;if(p===null)Z.reading=!1,W(d,Z);else{var V;if(re||(V=L(Z,p)),V)P(d,V);else if(Z.objectMode||p&&p.length>0)if(typeof p!="string"&&!Z.objectMode&&Object.getPrototypeOf(p)!==a.prototype&&(p=s(p)),C)Z.endEmitted?P(d,new I):j(d,Z,p,!0);else if(Z.ended)P(d,new S);else{if(Z.destroyed)return!1;Z.reading=!1,Z.decoder&&!M?(p=Z.decoder.write(p),Z.objectMode||p.length!==0?j(d,Z,p,!1):se(d,Z)):j(d,Z,p,!1)}else C||(Z.reading=!1,se(d,Z))}return!Z.ended&&(Z.length<Z.highWaterMark||Z.length===0)}function j(d,p,M,C){p.flowing&&p.length===0&&!p.sync?(p.awaitDrain=0,d.emit("data",M)):(p.length+=p.objectMode?1:M.length,C?p.buffer.unshift(M):p.buffer.push(M),p.needReadable&&H(d)),se(d,p)}function L(d,p){var M;return!l(p)&&typeof p!="string"&&p!==void 0&&!d.objectMode&&(M=new x("chunk",["string","Buffer","Uint8Array"],p)),M}q.prototype.isPaused=function(){return this._readableState.flowing===!1},q.prototype.setEncoding=function(d){D||(D=yt.StringDecoder);var p=new D(d);this._readableState.decoder=p,this._readableState.encoding=this._readableState.decoder.encoding;for(var M=this._readableState.buffer.head,C="";M!==null;)C+=p.write(M.data),M=M.next;return this._readableState.buffer.clear(),C!==""&&this._readableState.buffer.push(C),this._readableState.length=C.length,this};var N=1073741824;function B(d){return d>=N?d=N:(d--,d|=d>>>1,d|=d>>>2,d|=d>>>4,d|=d>>>8,d|=d>>>16,d++),d}function U(d,p){return d<=0||p.length===0&&p.ended?0:p.objectMode?1:d!==d?p.flowing&&p.length?p.buffer.head.data.length:p.length:(d>p.highWaterMark&&(p.highWaterMark=B(d)),d<=p.length?d:p.ended?p.length:(p.needReadable=!0,0))}q.prototype.read=function(d){h("read",d),d=parseInt(d,10);var p=this._readableState,M=d;if(d!==0&&(p.emittedReadable=!1),d===0&&p.needReadable&&((p.highWaterMark!==0?p.length>=p.highWaterMark:p.length>0)||p.ended))return h("read: emitReadable",p.length,p.ended),p.length===0&&p.ended?T(this):H(this),null;if(d=U(d,p),d===0&&p.ended)return p.length===0&&T(this),null;var C=p.needReadable;h("need readable",C),(p.length===0||p.length-d<p.highWaterMark)&&(C=!0,h("length less than watermark",C)),p.ended||p.reading?(C=!1,h("reading or ended",C)):C&&(h("do read"),p.reading=!0,p.sync=!0,p.length===0&&(p.needReadable=!0),this._read(p.highWaterMark),p.sync=!1,p.reading||(d=U(M,p)));var re;return d>0?re=m(d,p):re=null,re===null?(p.needReadable=p.length<=p.highWaterMark,d=0):(p.length-=d,p.awaitDrain=0),p.length===0&&(p.ended||(p.needReadable=!0),M!==d&&p.ended&&T(this)),re!==null&&this.emit("data",re),re};function W(d,p){if(h("onEofChunk"),!p.ended){if(p.decoder){var M=p.decoder.end();M&&M.length&&(p.buffer.push(M),p.length+=p.objectMode?1:M.length)}p.ended=!0,p.sync?H(d):(p.needReadable=!1,p.emittedReadable||(p.emittedReadable=!0,J(d)))}}function H(d){var p=d._readableState;h("emitReadable",p.needReadable,p.emittedReadable),p.needReadable=!1,p.emittedReadable||(h("emitReadable",p.flowing),p.emittedReadable=!0,process.nextTick(J,d))}function J(d){var p=d._readableState;h("emitReadable_",p.destroyed,p.length,p.ended),!p.destroyed&&(p.length||p.ended)&&(d.emit("readable"),p.emittedReadable=!1),p.needReadable=!p.flowing&&!p.ended&&p.length<=p.highWaterMark,_(d)}function se(d,p){p.readingMore||(p.readingMore=!0,process.nextTick(_e,d,p))}function _e(d,p){for(;!p.reading&&!p.ended&&(p.length<p.highWaterMark||p.flowing&&p.length===0);){var M=p.length;if(h("maybeReadMore read 0"),d.read(0),M===p.length)break}p.readingMore=!1}q.prototype._read=function(d){P(this,new O("_read()"))},q.prototype.pipe=function(d,p){var M=this,C=this._readableState;switch(C.pipesCount){case 0:C.pipes=d;break;case 1:C.pipes=[C.pipes,d];break;default:C.pipes.push(d);break}C.pipesCount+=1,h("pipe count=%d opts=%j",C.pipesCount,p);var re=(!p||p.end!==!1)&&d!==process.stdout&&d!==process.stderr,Z=re?Te:qe;C.endEmitted?process.nextTick(Z):M.once("end",Z),d.on("unpipe",V);function V(u,n){h("onunpipe"),u===M&&n&&n.hasUnpiped===!1&&(n.hasUnpiped=!0,Qe())}function Te(){h("onend"),d.end()}var Ye=Q(M);d.on("drain",Ye);var it=!1;function Qe(){h("cleanup"),d.removeListener("close",at),d.removeListener("finish",Re),d.removeListener("drain",Ye),d.removeListener("error",ze),d.removeListener("unpipe",V),M.removeListener("end",Te),M.removeListener("end",qe),M.removeListener("data",Ee),it=!0,C.awaitDrain&&(!d._writableState||d._writableState.needDrain)&&Ye()}M.on("data",Ee);function Ee(u){h("ondata");var n=d.write(u);h("dest.write",n),n===!1&&((C.pipesCount===1&&C.pipes===d||C.pipesCount>1&&z(C.pipes,d)!==-1)&&!it&&(h("false write response, pause",C.awaitDrain),C.awaitDrain++),M.pause())}function ze(u){h("onerror",u),qe(),d.removeListener("error",ze),t(d,"error")===0&&P(d,u)}te(d,"error",ze);function at(){d.removeListener("finish",Re),qe()}d.once("close",at);function Re(){h("onfinish"),d.removeListener("close",at),qe()}d.once("finish",Re);function qe(){h("unpipe"),M.unpipe(d)}return d.emit("pipe",M),C.flowing||(h("pipe resume"),M.resume()),d};function Q(d){return function(){var M=d._readableState;h("pipeOnDrain",M.awaitDrain),M.awaitDrain&&M.awaitDrain--,M.awaitDrain===0&&t(d,"data")&&(M.flowing=!0,_(d))}}q.prototype.unpipe=function(d){var p=this._readableState,M={hasUnpiped:!1};if(p.pipesCount===0)return this;if(p.pipesCount===1)return d&&d!==p.pipes?this:(d||(d=p.pipes),p.pipes=null,p.pipesCount=0,p.flowing=!1,d&&d.emit("unpipe",this,M),this);if(!d){var C=p.pipes,re=p.pipesCount;p.pipes=null,p.pipesCount=0,p.flowing=!1;for(var Z=0;Z<re;Z++)C[Z].emit("unpipe",this,{hasUnpiped:!1});return this}var V=z(p.pipes,d);return V===-1?this:(p.pipes.splice(V,1),p.pipesCount-=1,p.pipesCount===1&&(p.pipes=p.pipes[0]),d.emit("unpipe",this,M),this)},q.prototype.on=function(d,p){var M=r.prototype.on.call(this,d,p),C=this._readableState;return d==="data"?(C.readableListening=this.listenerCount("readable")>0,C.flowing!==!1&&this.resume()):d==="readable"&&!C.endEmitted&&!C.readableListening&&(C.readableListening=C.needReadable=!0,C.flowing=!1,C.emittedReadable=!1,h("on readable",C.length,C.reading),C.length?H(this):C.reading||process.nextTick(ce,this)),M},q.prototype.addListener=q.prototype.on,q.prototype.removeListener=function(d,p){var M=r.prototype.removeListener.call(this,d,p);return d==="readable"&&process.nextTick(ee,this),M},q.prototype.removeAllListeners=function(d){var p=r.prototype.removeAllListeners.apply(this,arguments);return(d==="readable"||d===void 0)&&process.nextTick(ee,this),p};function ee(d){var p=d._readableState;p.readableListening=d.listenerCount("readable")>0,p.resumeScheduled&&!p.paused?p.flowing=!0:d.listenerCount("data")>0&&d.resume()}function ce(d){h("readable nexttick read 0"),d.read(0)}q.prototype.resume=function(){var d=this._readableState;return d.flowing||(h("resume"),d.flowing=!d.readableListening,ae(this,d)),d.paused=!1,this};function ae(d,p){p.resumeScheduled||(p.resumeScheduled=!0,process.nextTick(ye,d,p))}function ye(d,p){h("resume",p.reading),p.reading||d.read(0),p.resumeScheduled=!1,d.emit("resume"),_(d),p.flowing&&!p.reading&&d.read(0)}q.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function _(d){var p=d._readableState;for(h("flow",p.flowing);p.flowing&&d.read()!==null;);}q.prototype.wrap=function(d){var p=this,M=this._readableState,C=!1;d.on("end",function(){if(h("wrapped end"),M.decoder&&!M.ended){var V=M.decoder.end();V&&V.length&&p.push(V)}p.push(null)}),d.on("data",function(V){if(h("wrapped data"),M.decoder&&(V=M.decoder.write(V)),!(M.objectMode&&V==null)&&!(!M.objectMode&&(!V||!V.length))){var Te=p.push(V);Te||(C=!0,d.pause())}});for(var re in d)this[re]===void 0&&typeof d[re]=="function"&&(this[re]=function(Te){return function(){return d[Te].apply(d,arguments)}}(re));for(var Z=0;Z<G.length;Z++)d.on(G[Z],this.emit.bind(this,G[Z]));return this._read=function(V){h("wrapped _read",V),C&&(C=!1,d.resume())},this},typeof Symbol=="function"&&(q.prototype[Symbol.asyncIterator]=function(){return F===void 0&&(F=Bo()),F(this)}),Object.defineProperty(q.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(q.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(q.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(p){this._readableState&&(this._readableState.flowing=p)}}),q._fromList=m,Object.defineProperty(q.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function m(d,p){if(p.length===0)return null;var M;return p.objectMode?M=p.buffer.shift():!d||d>=p.length?(p.decoder?M=p.buffer.join(""):p.buffer.length===1?M=p.buffer.first():M=p.buffer.concat(p.length),p.buffer.clear()):M=p.buffer.consume(d,p.decoder),M}function T(d){var p=d._readableState;h("endReadable",p.endEmitted),p.endEmitted||(p.ended=!0,process.nextTick($,p,d))}function $(d,p){if(h("endReadableNT",d.endEmitted,d.length),!d.endEmitted&&d.length===0&&(d.endEmitted=!0,p.readable=!1,p.emit("end"),d.autoDestroy)){var M=p._writableState;(!M||M.autoDestroy&&M.finished)&&p.destroy()}}typeof Symbol=="function"&&(q.from=function(d,p){return k===void 0&&(k=Io()),k(q,d,p)});function z(d,p){for(var M=0,C=d.length;M<C;M++)if(d[M]===p)return M;return-1}return Dt}var hi=ke,Tt=Xe.codes,Lo=Tt.ERR_METHOD_NOT_IMPLEMENTED,No=Tt.ERR_MULTIPLE_CALLBACK,Co=Tt.ERR_TRANSFORM_ALREADY_TRANSFORMING,ko=Tt.ERR_TRANSFORM_WITH_LENGTH_0,At=tt();$e(ke,At);function Fo(e,t){var r=this._transformState;r.transforming=!1;var a=r.writecb;if(a===null)return this.emit("error",new No);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),a(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function ke(e){if(!(this instanceof ke))return new ke(e);At.call(this,e),this._transformState={afterTransform:Fo.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Po)}function Po(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){jr(e,t,r)}):jr(this,null,null)}ke.prototype.push=function(e,t){return this._transformState.needTransform=!1,At.prototype.push.call(this,e,t)};ke.prototype._transform=function(e,t,r){r(new Lo("_transform()"))};ke.prototype._write=function(e,t,r){var a=this._transformState;if(a.writecb=r,a.writechunk=e,a.writeencoding=t,!a.transforming){var o=this._readableState;(a.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}};ke.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};ke.prototype._destroy=function(e,t){At.prototype._destroy.call(this,e,function(r){t(r)})};function jr(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new ko;if(e._transformState.transforming)throw new Co;return e.push(null)}var Uo=ft,ci=hi;$e(ft,ci);function ft(e){if(!(this instanceof ft))return new ft(e);ci.call(this,e)}ft.prototype._transform=function(e,t,r){r(null,e)};var jt;function $o(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var di=Xe.codes,Do=di.ERR_MISSING_ARGS,jo=di.ERR_STREAM_DESTROYED;function zr(e){if(e)throw e}function zo(e){return e.setHeader&&typeof e.abort=="function"}function qo(e,t,r,a){a=$o(a);var o=!1;e.on("close",function(){o=!0}),jt===void 0&&(jt=yr),jt(e,{readable:t,writable:r},function(l){if(l)return a(l);o=!0,a()});var s=!1;return function(l){if(!o&&!s){if(s=!0,zo(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();a(l||new jo("pipe"))}}}function qr(e){e()}function Go(e,t){return e.pipe(t)}function Wo(e){return!e.length||typeof e[e.length-1]!="function"?zr:e.pop()}function Ho(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var a=Wo(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Do("streams");var o,s=t.map(function(l,f){var h=f<t.length-1,v=f>0;return qo(l,h,v,function(g){o||(o=g),g&&s.forEach(qr),!h&&(s.forEach(qr),a(o))})});return t.reduce(Go)}var Zo=Ho;(function(e,t){t=e.exports=li(),t.Stream=t,t.Readable=t,t.Writable=fi(),t.Duplex=tt(),t.Transform=hi,t.PassThrough=Uo,t.finished=yr,t.pipeline=Zo})(Yt,Yt.exports);var mr=Yt.exports,Xo=function(e,t,r){for(var a=Math.min(r-t,e.length),o=[],s=null,l=-1;!s&&++l<a;){var f=e[l];f===` +`?o.length+l&&(s="drill",o=[]):(o.push(f),f==="*"&&o[0]!==";"&&(s="gerber",o=[]))}return s},Yo=Xo,Qo=function(e,t,r){if(e!=="gerber"&&e!=="drill")throw new Error('filetype to get next block must be "drill" or "gerber"');for(var a=t.length-r,o=e==="gerber"?"*":` +`,s=e==="gerber"?"%":"",l=!1,f=!1,h=!1,v=!1,g=[],w=0,E=0;!v&&w<a;){var A=t[r+w];A===` +`&&E++,A===s?f?(h=!0,g.pop()):(f=!0,g.push(A)):A===o?(l=!0,f&&g.push(A)):A>=" "&&A<="~"&&g.push(A),w++,v=l&&(!f||h)}var x=v?g.join("").trim():"",S=v?"":g.join("");return{lines:E,read:w,block:x,rem:S}},Vo=Qo,Ko=function(e){return{type:"done",line:e||-1}},Jo=function(e,t,r){return{type:"set",line:r||-1,prop:e,value:t}},es=function(e,t,r){return{type:"level",line:r||-1,level:e,value:t}},ts=function(e,t,r){return{type:"tool",line:r||-1,code:e,tool:t}},rs=function(e,t,r){return{type:"op",line:r||-1,op:e,coord:t}},ns=function(e,t,r){return{type:"macro",line:r||-1,name:e,blocks:t}},is={set:Jo,done:Ko,level:es,tool:ts,op:rs,macro:ns},pi=is,Vt=1/0,as=9007199254740991,os=17976931348623157e292,Gr=0/0,ss="[object Symbol]",fs=/^\s+|\s+$/g,us=/^[-+]0x[0-9a-f]+$/i,ls=/^0b[01]+$/i,hs=/^0o[0-7]+$/i,wr="\\ud800-\\udfff",vi="\\u0300-\\u036f\\ufe20-\\ufe23",gi="\\u20d0-\\u20f0",yi="\\ufe0e\\ufe0f",cs="["+wr+"]",Kt="["+vi+gi+"]",Jt="\\ud83c[\\udffb-\\udfff]",ds="(?:"+Kt+"|"+Jt+")",mi="[^"+wr+"]",wi="(?:\\ud83c[\\udde6-\\uddff]){2}",_i="[\\ud800-\\udbff][\\udc00-\\udfff]",bi="\\u200d",Ei=ds+"?",xi="["+yi+"]?",ps="(?:"+bi+"(?:"+[mi,wi,_i].join("|")+")"+xi+Ei+")*",vs=xi+Ei+ps,gs="(?:"+[mi+Kt+"?",Kt,wi,_i,cs].join("|")+")",er=RegExp(Jt+"(?="+Jt+")|"+gs+vs,"g"),ys=RegExp("["+bi+wr+vi+gi+yi+"]"),ms=parseInt,ws=typeof he=="object"&&he&&he.Object===Object&&he,_s=typeof self=="object"&&self&&self.Object===Object&&self,bs=ws||_s||Function("return this")(),Es=Rs("length");function xs(e){return e.split("")}function Rs(e){return function(t){return t==null?void 0:t[e]}}function _r(e){return ys.test(e)}function Ri(e){return _r(e)?Ms(e):Es(e)}function Ss(e){return _r(e)?Ts(e):xs(e)}function Ms(e){for(var t=er.lastIndex=0;er.test(e);)t++;return t}function Ts(e){return e.match(er)||[]}var As=Object.prototype,Os=As.toString,Wr=bs.Symbol,Bs=Math.ceil,Is=Math.floor,Hr=Wr?Wr.prototype:void 0,Zr=Hr?Hr.toString:void 0;function Xr(e,t){var r="";if(!e||t<1||t>as)return r;do t%2&&(r+=e),t=Is(t/2),t&&(e+=e);while(t);return r}function Ls(e,t,r){var a=-1,o=e.length;t<0&&(t=-t>o?0:o+t),r=r>o?o:r,r<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var s=Array(o);++a<o;)s[a]=e[a+t];return s}function Si(e){if(typeof e=="string")return e;if(Mi(e))return Zr?Zr.call(e):"";var t=e+"";return t=="0"&&1/e==-Vt?"-0":t}function Ns(e,t,r){var a=e.length;return r=r===void 0?a:r,!t&&r>=a?e:Ls(e,t,r)}function Cs(e,t){t=t===void 0?" ":Si(t);var r=t.length;if(r<2)return r?Xr(t,e):t;var a=Xr(t,Bs(e/Ri(t)));return _r(t)?Ns(Ss(a),0,e).join(""):a.slice(0,e)}function Yr(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function ks(e){return!!e&&typeof e=="object"}function Mi(e){return typeof e=="symbol"||ks(e)&&Os.call(e)==ss}function Fs(e){if(!e)return e===0?e:0;if(e=Us(e),e===Vt||e===-Vt){var t=e<0?-1:1;return t*os}return e===e?e:0}function Ps(e){var t=Fs(e),r=t%1;return t===t?r?t-r:t:0}function Us(e){if(typeof e=="number")return e;if(Mi(e))return Gr;if(Yr(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Yr(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(fs,"");var r=ls.test(e);return r||hs.test(e)?ms(e.slice(2),r?2:8):us.test(e)?Gr:+e}function $s(e){return e==null?"":Si(e)}function Ds(e,t,r){e=$s(e),t=Ps(t);var a=t?Ri(e):0;return t&&a<t?Cs(t-a,r)+e:e}var js=Ds,tr=1/0,zs=9007199254740991,qs=17976931348623157e292,Qr=0/0,Gs="[object Symbol]",Ws=/^\s+|\s+$/g,Hs=/^[-+]0x[0-9a-f]+$/i,Zs=/^0b[01]+$/i,Xs=/^0o[0-7]+$/i,br="\\ud800-\\udfff",Ti="\\u0300-\\u036f\\ufe20-\\ufe23",Ai="\\u20d0-\\u20f0",Oi="\\ufe0e\\ufe0f",Ys="["+br+"]",rr="["+Ti+Ai+"]",nr="\\ud83c[\\udffb-\\udfff]",Qs="(?:"+rr+"|"+nr+")",Bi="[^"+br+"]",Ii="(?:\\ud83c[\\udde6-\\uddff]){2}",Li="[\\ud800-\\udbff][\\udc00-\\udfff]",Ni="\\u200d",Ci=Qs+"?",ki="["+Oi+"]?",Vs="(?:"+Ni+"(?:"+[Bi,Ii,Li].join("|")+")"+ki+Ci+")*",Ks=ki+Ci+Vs,Js="(?:"+[Bi+rr+"?",rr,Ii,Li,Ys].join("|")+")",ir=RegExp(nr+"(?="+nr+")|"+Js+Ks,"g"),ef=RegExp("["+Ni+br+Ti+Ai+Oi+"]"),tf=parseInt,rf=typeof he=="object"&&he&&he.Object===Object&&he,nf=typeof self=="object"&&self&&self.Object===Object&&self,af=rf||nf||Function("return this")(),of=ff("length");function sf(e){return e.split("")}function ff(e){return function(t){return t==null?void 0:t[e]}}function Er(e){return ef.test(e)}function Fi(e){return Er(e)?lf(e):of(e)}function uf(e){return Er(e)?hf(e):sf(e)}function lf(e){for(var t=ir.lastIndex=0;ir.test(e);)t++;return t}function hf(e){return e.match(ir)||[]}var cf=Object.prototype,df=cf.toString,Vr=af.Symbol,pf=Math.ceil,vf=Math.floor,Kr=Vr?Vr.prototype:void 0,Jr=Kr?Kr.toString:void 0;function en(e,t){var r="";if(!e||t<1||t>zs)return r;do t%2&&(r+=e),t=vf(t/2),t&&(e+=e);while(t);return r}function gf(e,t,r){var a=-1,o=e.length;t<0&&(t=-t>o?0:o+t),r=r>o?o:r,r<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var s=Array(o);++a<o;)s[a]=e[a+t];return s}function Pi(e){if(typeof e=="string")return e;if(Ui(e))return Jr?Jr.call(e):"";var t=e+"";return t=="0"&&1/e==-tr?"-0":t}function yf(e,t,r){var a=e.length;return r=r===void 0?a:r,!t&&r>=a?e:gf(e,t,r)}function mf(e,t){t=t===void 0?" ":Pi(t);var r=t.length;if(r<2)return r?en(t,e):t;var a=en(t,pf(e/Fi(t)));return Er(t)?yf(uf(a),0,e).join(""):a.slice(0,e)}function tn(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function wf(e){return!!e&&typeof e=="object"}function Ui(e){return typeof e=="symbol"||wf(e)&&df.call(e)==Gs}function _f(e){if(!e)return e===0?e:0;if(e=Ef(e),e===tr||e===-tr){var t=e<0?-1:1;return t*qs}return e===e?e:0}function bf(e){var t=_f(e),r=t%1;return t===t?r?t-r:t:0}function Ef(e){if(typeof e=="number")return e;if(Ui(e))return Qr;if(tn(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=tn(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(Ws,"");var r=Zs.test(e);return r||Xs.test(e)?tf(e.slice(2),r?2:8):Hs.test(e)?Qr:+e}function xf(e){return e==null?"":Pi(e)}function Rf(e,t,r){e=xf(e),t=bf(t);var a=t?Fi(e):0;return t&&a<t?e+mf(t-a,r):e}var Sf=Rf,rn=ut,Mf=js,Tf=Sf,Af=function(e,t){if(e==null)return NaN;var r=""+e,a="+";(r[0]==="-"||r[0]==="+")&&(a=r[0],r=r.slice(1));var o=r.indexOf(".")!==-1;if(o||t==null||t.zero==null)return Number(a+r);if(t.places==null||t.places.length!==2)return NaN;var s=t.places[0],l=t.places[1];if(!rn(s)||!rn(l))return NaN;if(t.zero==="T")r=Tf(r,s+l,"0");else if(t.zero==="L")r=Mf(r,s+l,"0");else return NaN;var f=r.slice(0,s),h=r.slice(s,s+l);return+(a+f+"."+h)},xr=Af,Of=xr,Bf=/[XY]0\d+/,If=/[XY]\d+0(?=\D|$)/,Lf=[{coord:"x",test:/X([+-]?[\d.]+)/},{coord:"y",test:/Y([+-]?[\d.]+)/},{coord:"i",test:/I([+-]?[\d.]+)/},{coord:"j",test:/J([+-]?[\d.]+)/},{coord:"a",test:/A([\d.]+)/}],Nf=function(e,t){if(e==null)return{};if(t.zero==null||t.places==null)throw new Error("cannot parse coordinate with format undefined");var r=Lf.reduce(function(a,o){var s=e.match(o.test);return s&&(a[o.coord]=Of(s[1],t)),a},{});return r},Cf=function(e){return If.test(e)?"L":Bf.test(e)?"T":null},$i={parse:Nf,detectZero:Cf},kf=/[+\-/xX()]/,Di=/[$\d.]+/,Ff=new RegExp([kf.source,Di.source].join("|"),"g"),Pf=function(t,r){var a=r.match(Ff),o,s=function(){var v=a.shift(),g;return Di.test(v)?g={type:"n",val:v}:(g=o(),a.shift()),g},l=function(){var v=s(),g=a[0];for(g==="X"&&(t._warn("multiplication in macros should use 'x', not 'X'"),g="x");g==="x"||g==="/";){a.shift();var w=s();v={type:g,left:v,right:w},g=a[0]}return v};o=function(){for(var v=l(),g=a[0];g==="+"||g==="-";){a.shift();var w=l();v={type:g,left:v,right:w},g=a[0]}return v};var f=o(),h=function(v,g){var w=function(A){return A[0]==="$"?Number(g[A]):Number(A)},E=v.type;return E==="n"?w(v.val):E==="+"?h(v.left,g)+h(v.right,g):E==="-"?h(v.left,g)-h(v.right,g):E==="x"?h(v.left,g)*h(v.right,g):h(v.left,g)/h(v.right,g)};return function(v){return h(f,v)}},nn=Pf,Uf=/^-?[\d.]+$/,an=/^(\$[\d+])=(.+)/,$f=function(e,t){if(t[0]==="0")return{type:"comment"};if(an.test(t)){var r=t.match(an),a=r[1],o=r[2],s=nn(e,o),l=function(w){return w[a]=s(w),w};return{type:"variable",set:l}}var f=function(w){return Uf.test(w)?Number(w):nn(e,w)},h=t.split(",").map(f),v=h[0],g=h[1];if(v===1)return{type:"circle",exp:g,dia:h[2],cx:h[3],cy:h[4],rot:h[5]||0};if(v===2&&e._warn("macro aperture vector primitives with code 2 are deprecated"),v===2||v===20)return{type:"vect",exp:g,width:h[2],x1:h[3],y1:h[4],x2:h[5],y2:h[6],rot:h[7]};if(v===21)return{type:"rect",exp:g,width:h[2],height:h[3],cx:h[4],cy:h[5],rot:h[6]};if(v===22)return e._warn("macro aperture lower-left rectangle primitives are deprecated"),{type:"rectLL",exp:g,width:h[2],height:h[3],x:h[4],y:h[5],rot:h[6]};if(v===4)return{type:"outline",exp:g,points:h.slice(3,-1),rot:h[h.length-1]};if(v===5)return{type:"poly",exp:g,vertices:h[2],cx:h[3],cy:h[4],dia:h[5],rot:h[6]};if(v===6)return{type:"moire",exp:1,cx:h[1],cy:h[2],dia:h[3],ringThx:h[4],ringGap:h[5],maxRings:h[6],crossThx:h[7],crossLen:h[8],rot:h[9]};if(v===7)return{type:"thermal",exp:1,cx:h[1],cy:h[2],outerDia:h[3],innerDia:h[4],gap:h[5],rot:h[6]};e._warn(v+" is an unrecognized primitive for a macro aperture")},Df=$f,be=pi,Ge=xr,jf=$i,zf=Df,on=/^G0*([123])/,sn=/^G3([67])/,fn=/^G7([45])/,un=/^G7([01])/,ln=/^G9([01])/,qf=/^G0*4/,Gf=/^%TO[^%*]*/,hn=/^(?:G54)?D0*([1-9]\d+)/,cn=/D0*([123])$/,dn=/^(?:G0*[123])?((?:[XYIJ][+-]?\d+){1,4})(?:D0*[123])?$/,pn=/^%MO(IN|MM)/,vn=/^%FS([LT]?)([AI]?)(.*)X([0-7])([0-7])Y\4\5/,gn=/^%LP([CD])/,yn=/^%SR(?:X(\d+)Y(\d+)I([\d.]+)J([\d.]+))?/,ji=/^%ADD0*(\d{2,})([A-Za-z_$][\w\-.]*)(?:,((?:X?[\d.-]+)*))?/,zi=/^%AM([A-Za-z_$][\w\-.]*)\*?(.*)/,mn=/\*MO(IN|MM)$/,wn=function(e,t){var r=t==="IN"?"in":"mm";return e._push(be.set("units",r))},Wf=function(e,t){var r={places:e.format.places},a=t.match(ji),o=a[1],s=a[2],l=a[3]?a[3].split("X"):[],f,h;s==="C"?(f="circle",h=3):s==="R"?(f="rect",h=4):s==="O"?(f="obround",h=4):s==="P"?(f="poly",h=5):(f=s,h=0);var v;f==="circle"?v=[Ge(l[0],r)]:f==="rect"||f==="obround"?v=[Ge(l[0],r),Ge(l[1],r)]:f==="poly"?(v=[Ge(l[0],r),Number(l[1]),0],l[2]&&(v[2]=Number(l[2]))):v=l.map(Number);var g=[];l[h-1]?g=[Ge(l[h-2],r),Ge(l[h-1],r)]:l[h-2]&&(g=[Ge(l[h-2],r)]);var w={shape:f,params:v,hole:g};return e._push(be.tool(o,w))},Hf=function(e,t){var r=t.match(zi),a=r[1];a.match(/-/)&&e._warn("hyphens in macro name are illegal: "+a);var o=r[2].length?r[2].split("*"):[],s=o.filter(Boolean).map(function(l){return zf(e,l)});return e._push(be.macro(a,s))},Zf=function(e,t){if(!(qf.test(t)||Gf.test(t))){if(t==="M02")return e._push(be.done());if(sn.test(t)){var r=t.match(sn)[1],a=r==="6";return e._push(be.set("region",a))}if(fn.test(t)){var o=t.match(fn)[1],s=o==="4"?"s":"m";return e._push(be.set("arc",s))}if(pn.test(t)){var l=t.match(pn)[1];return wn(e,l)}if(un.test(t)){var f=t.match(un)[1],h=f==="0"?"in":"mm";return e._push(be.set("backupUnits",h))}if(vn.test(t)){var v=t.match(vn),g=v[1],w=v[2],E=v[3],A=Number(v[4]),x=Number(v[5]),S=e.format;S.zero=S.zero||g,S.places||(S.places=[A,x]),S.zero?S.zero==="T"&&e._warn("trailing zero suppression has been deprecated"):(S.zero="L",e._warn("zero suppression missing from format; assuming leading")),E&&e._warn('unknown characters "'+E+'" in "'+t+'" were ignored');var O=1.5*Math.pow(10,-S.places[1]);if(e._push(be.set("nota",w)),e._push(be.set("epsilon",O)),mn.test(t)){var I=t.match(mn)[1];wn(e,I)}return}if(ln.test(t)){var D=t.match(ln)[1],F=D==="0"?"A":"I";return e._push(be.set("backupNota",F))}if(gn.test(t)){var k=t.match(gn)[1];return e._push(be.level("polarity",k))}if(yn.test(t)){var P=t.match(yn),G=P[1]||1,te=P[2]||1,X=P[3]||0,q=P[4]||0,me={x:Number(G),y:Number(te),i:Number(X),j:Number(q)};return e._push(be.level("stepRep",me))}if(hn.test(t)){var j=t.match(hn)[1];return e._push(be.set("tool",j))}if(ji.test(t))return Wf(e,t);if(zi.test(t))return Hf(e,t);if(cn.test(t)||on.test(t)||dn.test(t)){var L=t.match(cn),N=t.match(on),B=t.match(dn),U;if(N&&(N[1]==="1"?U="i":N[1]==="2"?U="cw":U="ccw",e._push(be.set("mode",U))),L||B){var W=L?L[1]:"",H=B?B[1]:"",J=jf.parse(H,e.format),se="last";W==="1"?se="int":W==="2"?se="move":W==="3"&&(se="flash"),e._push(be.op(se,J))}return}return e._warn('block "'+t+'" was not recognized and was ignored')}},Xf=Zf,qi={DRILL:"5",MOVE:"0",LINEAR:"1",CW_ARC:"2",CCW_ARC:"3"},_n=ut,le=pi,ot=qi,Yf=xr,ar=$i,bn=/;FILE_FORMAT=(\d):(\d)/,En=/;TYPE=(PLATED|NON_PLATED)/,xn=/;FORMAT={(.):(.)\/ (absolute|.+)? \/ (metric|inch) \/.+(trailing|leading|decimal|keep)/,Gi=/^(INCH|METRIC|M71|M72)/,Wi=/,([TL])Z/,Qf=/,(0{1,8})\.(0{1,8})/,Rn=/T0*(\d+)[\S]*C([\d.]+)/,Sn=/T0*(\d+)(?![\S]*C)/,Rr=/((?:[XYIJA][+-]?[\d.]+){1,4})(?:G85((?:[XY][+-]?[\d.]+){1,2}))?/,Mn=/^G0([01235])/,Vf=function(e,t,r){var a={};if(xn.test(t)){var o=t.match(xn),s=Number(o[1]),l=Number(o[2]),f=o[3],h=o[4],v=o[5];_n(s)&&_n(l)&&(a.places=[s,l]),f==="absolute"?e._push(le.set("backupNota","A",r)):e._push(le.set("backupNota","I",r)),h==="metric"?e._push(le.set("backupUnits","mm",r)):e._push(le.set("backupUnits","in",r)),v==="leading"||v==="keep"?a.zero="L":v==="trailing"?a.zero="T":a.zero="D"}else if(bn.test(t)){var g=t.match(bn);a.places=[Number(g[1]),Number(g[2])]}else if(En.test(t)){var w=t.match(En),E=w[1]==="PLATED"?"pth":"npth";e._push(le.set("holePlating",E,r))}return a},Kf=function(e,t,r){var a=t.match(Gi),o=t.match(Wi),s=t.match(Qf),l=a[1]==="METRIC"||a[1]==="M71"?"mm":"in",f=o&&o[1];e.format.zero==null&&f&&(e.format.zero=f==="T"?"L":"T"),e.format.places==null&&(s?e.format.places=[s[1].length,s[2].length]:e.format.places=l==="in"?[2,4]:[3,3]),e._push(le.set("units",l,r))},Jf=function(e,t,r){var a=t.match(Rr),o=ar.parse(a[1],e.format);if(a[2])return e._push(le.op("move",o,r)),e._push(le.set("mode","i",r)),o=ar.parse(a[2],e.format),e._push(le.op("int",o,r));switch(Mn.test(t)&&(e._drillMode=t.match(Mn)[1]),e._drillMode){case ot.DRILL:return e._push(le.op("flash",o,r));case ot.MOVE:return e._push(le.op("move",o,r));case ot.LINEAR:return e._push(le.set("mode","i",r)),e._push(le.op("int",o,r));case ot.CW_ARC:return e._push(le.set("mode","cw",r)),e._push(le.op("int",o,r));case ot.CCW_ARC:return e._push(le.set("mode","ccw",r)),e._push(le.op("int",o,r))}},Hi=function(e,t,r){if(Rn.test(t)){var a=t.match(Rn),o=a[1],s=Yf(a[2]),l={shape:"circle",params:[s],hole:[]};return e._push(le.tool(o,l,r))}if(Sn.test(t)){var f=t.match(Sn)[1];e._push(le.set("tool",f,r))}if(Rr.test(t))return e.format.places||(e.format.places=[2,4],e._warn("places format missing; assuming [2, 4]")),e.format.zero||(e.format.zero="T",e._warn("zero suppression missing; assuming trailing suppression")),Jf(e,t,r);if(t==="M00"||t==="M30")return e._push(le.done(r));if(t==="G90")return e._push(le.set("nota","A",r));if(t==="G91")return e._push(le.set("nota","I",r));if(Gi.test(t))return Kf(e,t,r)},Zi=function(e){e._drillStash.forEach(function(t){Hi(e,t.block,t.line)}),e._drillStash=[]},eu=function(e,t){if(t[0]===";"){var r=Vf(e,t,e.line);Object.keys(r).forEach(function(a){e.format[a]||(e.format[a]=r[a])})}else e.format.zero?Hi(e,t,e.line):(e._drillStash.push({line:e.line,block:t}),Rr.test(t)&&(e.format.zero=ar.detectZero(t),e.format.zero&&e._warn("zero suppression missing; detected "+(e.format.zero==="L"?"leading":"trailing")+" suppression")),(e.format.zero||Wi.test(t)||e._drillStash.length>=1e3)&&Zi(e))},tu={parse:eu,flush:Zi},ru=function(e,t){return{message:e,line:t}},nu=ru,iu=yt.StringDecoder,au=$e,Xi=mr.Transform,Yi=Yo,ou=Vo,su=Xf,Qi=tu,fu=nu,uu=qi,or=65535,De=function(e,t,r){Xi.call(this,{readableObjectMode:!0}),this._decoder=new iu("utf8"),this._stash="",this._index=0,this._drillMode=uu.DRILL,this._drillStash=[],this._syncResult=null,this.line=0,this.format={places:e,zero:t,filetype:r}};au(De,Xi);De.prototype._process=function(e,t){for(;this._index<e.length;){var r=ou(t,e,this._index);this._index+=r.read,this.line+=r.lines,this._stash+=r.rem,r.block&&(t==="gerber"?su(this,r.block):Qi.parse(this,r.block))}};De.prototype._transform=function(e,t,r){var a=this.format.filetype;if(e=this._decoder.write(e),!a)if(a=Yi(e,this._index,or),this._index+=e.length,a)this.format.filetype=a,this._index=0;else return this._index>=or?r(new Error("unable to determine filetype")):(this._stash+=e,r());e=this._stash+e,this._stash="",this._process(e,a),this._index=0,r()};De.prototype._flush=function(e){return this.format.filetype==="drill"&&Qi.flush(this),e&&e()};De.prototype._push=function(e){e.line===-1&&(e.line=this.line);var t=this._syncResult?this._syncResult:this;t.push(e)};De.prototype._warn=function(e){this.emit("warning",fu(e,this.line))};De.prototype.parseSync=function(e){var t=Yi(e,this._index,100*or);return this.format.filetype=t,this._syncResult=[],this._process(e,t),this._flush(),this._syncResult};var lu=De,Tn=ut,hu=lu,cu=function(e){if(Array.isArray(e)&&e.length===2&&Tn(e[0])&&Tn(e[1]))return e;throw new Error("places must be an array of two whole numbers")},du=function(e){if(e==="T"||e==="L")return e;throw new Error("zero suppression must be 'L' or 'T'")},pu=function(e){if(e==="gerber"||e==="drill")return e;throw new Error('filetype must be "drill" or "gerber"')},vu=function(e){e=e||{};var t=e.places?cu(e.places):null,r=e.zero?du(e.zero):null,a=e.filetype?pu(e.filetype):null;return new hu(t,r,a)},An=1/0,Vi=9007199254740991,gu=17976931348623157e292,On=0/0,yu=4294967295,mu="[object Function]",wu="[object GeneratorFunction]",_u="[object Symbol]",bu=/^\s+|\s+$/g,Eu=/^[-+]0x[0-9a-f]+$/i,xu=/^0b[01]+$/i,Ru=/^0o[0-7]+$/i,Su=/^(?:0|[1-9]\d*)$/,Mu=parseInt,Tu=Object.prototype,Ki=Tu.toString;function Au(e,t,r){return e===e&&(r!==void 0&&(e=e<=r?e:r),t!==void 0&&(e=e>=t?e:t)),e}function Ou(e,t,r,a){var o=e.length;for(r=sr(r),r<0&&(r=-r>o?0:o+r),a=a===void 0||a>o?o:sr(a),a<0&&(a+=o),a=r>a?0:Du(a);r<a;)e[r++]=t;return e}function Bu(e,t){return t=t??Vi,!!t&&(typeof e=="number"||Su.test(e))&&e>-1&&e%1==0&&e<t}function Iu(e,t,r){if(!mt(r))return!1;var a=typeof t;return(a=="number"?Cu(r)&&Bu(t,r.length):a=="string"&&t in r)?Nu(r[t],e):!1}function Lu(e,t,r,a){var o=e?e.length:0;return o?(r&&typeof r!="number"&&Iu(e,t,r)&&(r=0,a=o),Ou(e,t,r,a)):[]}function Nu(e,t){return e===t||e!==e&&t!==t}function Cu(e){return e!=null&&Fu(e.length)&&!ku(e)}function ku(e){var t=mt(e)?Ki.call(e):"";return t==mu||t==wu}function Fu(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Vi}function mt(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Pu(e){return!!e&&typeof e=="object"}function Uu(e){return typeof e=="symbol"||Pu(e)&&Ki.call(e)==_u}function $u(e){if(!e)return e===0?e:0;if(e=ju(e),e===An||e===-An){var t=e<0?-1:1;return t*gu}return e===e?e:0}function sr(e){var t=$u(e),r=t%1;return t===t?r?t-r:t:0}function Du(e){return e?Au(sr(e),0,yu):0}function ju(e){if(typeof e=="number")return e;if(Uu(e))return On;if(mt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=mt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(bu,"");var r=xu.test(e);return r||Ru.test(e)?Mu(e.slice(2),r?2:8):Eu.test(e)?On:+e}var zu=Lu,qu=zu,Gu=function(e,t){var r,a;for(a=0;a<e.length;a++)if(r=e[a],t(r))return r},Bn=function(e,t,r){var a=e.reduce(function(o,s){var l=Wu(t,s.position);return l<r&&l<o.distance?{point:s,distance:l}:o},{point:void 0,distance:1/0});return a.point},Wu=function(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2))},Ze=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Hu=function(e,t){return e.type==="line"&&(Ze(e.start,t.start)&&Ze(e.end,t.end)||Ze(e.start,t.end)&&Ze(e.end,t.start))},Zu=function(e){var t={type:e.type,start:e.end,end:e.start};return e.type==="arc"&&(t.center=e.center,t.radius=e.radius,t.sweep=e.sweep,t.dir=e.dir==="cw"?"ccw":"cw"),t},Ot=function(e,t){this._edges=[],this._optimize=e,this._fillGaps=t,this.length=0};Ot.prototype.add=function(e){var t={segment:e,start:e.start,end:e.end};this._edges.push(t),this.length++};Ot.prototype._fillGapsAndOptimize=function(){var e=this._edges.map(function(x){return x.segment});this._edges=[],this.length=0;for(var t=e.reduce(function(x,S){return x.concat([{position:S.start,edges:[]},{position:S.end,edges:[]}])},[]),r=e.length,a=0;a<r;a++){var o=e[a],s,l,f=this._fillGaps,h=a*2,v=h+1,g=t.slice(0,h).concat(t.slice(v+1));s=Bn(g,o.start,f),l=Bn(g,o.end,f),s?f&&(o.start=s.position):s={position:o.start,edges:[]},l?f&&(o.end=l.position):l={position:o.end,edges:[]};var w=Gu(this._edges,function(x){return Hu(x.segment,o)});if(!w){var E=this._edges.length,A={segment:o,start:s,end:l};t[h].edges.push(E),t[h].position=A.start.position,t[v].edges.push(E),t[v].position=A.end.position,this._edges.push(A),this.length++}}this._edges.forEach(function(x){t.forEach(function(S){Ze(S.position,x.start.position)&&(x.start.edges=x.start.edges.concat(S.edges)),Ze(S.position,x.end.position)&&(x.end.edges=x.end.edges.concat(S.edges))})})};Ot.prototype.traverse=function(){if(!this._optimize)return this._edges.map(function(h){return h.segment});this._fillGapsAndOptimize();for(var e=qu(Array(this._edges.length),!1),t=[],r=[],a,o,s,l,f={position:[]};r.length<this._edges.length;)for(a=e.indexOf(!1),t.push(a);t.length;)a=t.pop(),e[a]||(e[a]=!0,o=this._edges[a],s=o.end,Ze(f.position,s.position)?(l=Zu(o.segment),f=o.start):(l=o.segment,f=o.end),f.edges.reverse().forEach(function(h){e[h]||t.push(h)}),r.push(l));return r};var Xu=Ot,Yu=function(e,t){return{message:e,line:t}},Qu=Yu,Vu="[object AsyncFunction]",Ku="[object Function]",Ju="[object GeneratorFunction]",el="[object Null]",tl="[object Proxy]",rl="[object Undefined]",nl=typeof he=="object"&&he&&he.Object===Object&&he,il=typeof self=="object"&&self&&self.Object===Object&&self,al=nl||il||Function("return this")(),Ji=Object.prototype,ol=Ji.hasOwnProperty,ea=Ji.toString,In=al.Symbol,We=In?In.toStringTag:void 0;function sl(e){return e==null?e===void 0?rl:el:We&&We in Object(e)?fl(e):ul(e)}function fl(e){var t=ol.call(e,We),r=e[We];try{e[We]=void 0;var a=!0}catch{}var o=ea.call(e);return a&&(t?e[We]=r:delete e[We]),o}function ul(e){return ea.call(e)}function ll(e){if(!hl(e))return!1;var t=sl(e);return t==Ku||t==Ju||t==Vu||t==tl}function hl(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var cl=ll,dl=function(){return[1/0,1/0,-1/0,-1/0]},ta=function(e,t){return[Math.min(e[0],t[0]),Math.min(e[1],t[1]),Math.max(e[2],t[2]),Math.max(e[3],t[3])]},pl=function(e,t){return[Math.min(e[0],t[0]),Math.min(e[1],t[1]),Math.max(e[2],t[0]),Math.max(e[3],t[1])]},vl=function(e,t,r,a){return[Math.min(e[0],r-t),Math.min(e[1],a-t),Math.max(e[2],r+t),Math.max(e[3],a+t)]},ra=function(e,t){var r=t[0],a=t[1];return[e[0]+r,e[1]+a,e[2]+r,e[3]+a]},gl=function(e,t){return ta(e,ra(e,t))},Sr={new:dl,add:ta,addPoint:pl,addCircle:vl,translate:ra,repeat:gl},yl=cl,ml=ut,ge=Sr,ve=function(e){var t=Math.round(e*1e8)/1e8;return t===0?0:t},wl=function(e){return e*Math.PI/180},wt=function(e,t){t=wl(t);var r=Math.sin(t),a=Math.cos(t),o=e[0],s=e[1];return[ve(o*a-s*r),ve(o*r+s*a)]},_t=function(e,t,r,a){var o=e/2;if(t=t||0,r=r||0,a&&(t||r)){var s=wt([t,r],a);t=s[0],r=s[1]}return{shape:{type:"circle",cx:t,cy:r,r:e/2},box:ge.addCircle(ge.new(),o,t,r)}},na=function(e,t,r,a,o,s){if(s){var l=wt([e,t],s),f=wt([r,a],s);e=l[0],t=l[1],r=f[0],a=f[1]}var h=(a-t)/(r-e),v=o/2,g=v,w=v;ml(h)?(g*=h/Math.sqrt(1+Math.pow(h,2)),w*=1/Math.sqrt(1+Math.pow(h,2))):w=0;var E=[];E.push([ve(e+g),ve(t-w)]),E.push([ve(r+g),ve(a-w)]),E.push([ve(r-g),ve(a+w)]),E.push([ve(e-g),ve(t+w)]);var A=E.reduce(function(x,S){return ge.addPoint(x,S)},ge.new());return{shape:{type:"poly",points:E},box:A}},Oe=function(e,t,r,a,o,s){a=a||0,o=o||0,r=r||0,s=s||0;var l=e/2,f=t/2;if(s){var h=a-l,v=a+l,g=o,w=o;return na(h,g,v,w,t,s)}return{shape:{type:"rect",cx:a,cy:o,r,width:e,height:t},box:[-l+a,-f+o,l+a,f+o]}},_l=function(e,t){for(var r=[],a=ge.new(),o,s=0;s<e.length-2;s+=2)o=[e[s],e[s+1]],t&&(o=wt(o,t)),r.push(o),a=ge.addPoint(a,o);return{shape:{type:"poly",points:r},box:a}},ia=function(e,t,r,a,o){a=a||0,o=o||0;for(var s=[],l=ge.new(),f=e/2,h=r*Math.PI/180,v=2*Math.PI/t,g,w,E,A=0;A<t;A++)g=v*A+h,w=a+ve(f*Math.cos(g)),E=o+ve(f*Math.sin(g)),l=ge.addPoint(l,[w,E]),s.push([w,E]);return{shape:{type:"poly",points:s},box:l}},aa=function(e,t,r,a){return{type:"ring",cx:e,cy:t,r,width:a}},bl=function(e,t,r,a,o,s,l,f,h){for(var v=e/2,g=[],w=ge.addCircle(ge.new(),v,l,f),E=t/2,A=r+E;v>t&&g.length<a;)v-=E,g.push(aa(l,f,ve(v),t)),v-=A;v>0&&g.length<a&&g.push(_t(ve(2*v),l,f).shape);var x=Oe(s,o,0,l,f,h),S=Oe(o,s,0,l,f,h);return g.push(x.shape),g.push(S.shape),w=ge.add(w,x.box),w=ge.add(w,S.box),{shape:g,box:w}},El=function(e,t,r,a,o,s){var l=ve((r-o)/2),f=ve((r+o)/4),h=ve((r-a)/2),v=ve((r-h)/2),g=ge.addCircle(ge.new(),r/2,e,t),w=[Oe(l,l,0,e+f,t+f,s).shape,Oe(l,l,0,e-f,t+f,s).shape,Oe(l,l,0,e-f,t-f,s).shape,Oe(l,l,0,e+f,t-f,s).shape],E=aa(e,t,v,h);return{shape:{type:"clip",shape:w,clip:E},box:g}},xl=function(e,t){var r={shape:[],box:ge.new()},a=1;return t=t||[],t.reduce(function(o,s){var l;switch(s.type!=="variable"&&s.type!=="comment"&&(s=Object.keys(s).reduce(function(w,E){var A=s[E];return w[E]=x(A),w;function x(S){return Array.isArray(S)?S.map(x):yl(S)?S(e):S}},{})),s.exp!=null&&s.exp!==a&&(o.shape.push({type:"layer",polarity:s.exp===1?"dark":"clear",box:o.box.slice(0)}),a=s.exp),s.type){case"circle":l=_t(s.dia,s.cx,s.cy,s.rot);break;case"vect":l=na(s.x1,s.y1,s.x2,s.y2,s.width,s.rot);break;case"rect":l=Oe(s.width,s.height,0,s.cx,s.cy,s.rot);break;case"rectLL":var f=s.height/2,h=s.width/2,v=s.x+h,g=s.y+f;l=Oe(s.width,s.height,0,v,g,s.rot);break;case"outline":l=_l(s.points,s.rot);break;case"poly":l=ia(s.dia,s.vertices,s.rot,s.cx,s.cy);break;case"moire":l=bl(s.dia,s.ringThx,s.ringGap,s.maxRings,s.crossThx,s.crossLen,s.cx,s.cy,s.rot);break;case"thermal":l=El(s.cx,s.cy,s.outerDia,s.innerDia,s.gap,s.rot);break;case"variable":return e=s.set(e),o;default:return o}return o.shape=o.shape.concat(l.shape),a===1&&(o.box=ge.add(o.box,l.box)),o},r)},Rl=function(t,r){var a=[],o=ge.new(),s=t.shape,l=t.params,f,h;if(s==="circle")h=_t(l[0]);else if(s==="rect")h=Oe(l[0],l[1]);else if(s==="obround")h=Oe(l[0],l[1],Math.min(l[0],l[1])/2);else if(s==="poly")h=ia(l[0],l[1],l[2]);else{var v=l.reduce(function(g,w,E){return g["$"+(E+1)]=w,g},{});return xl(v,r[s])}return a.push(h.shape),o=ge.add(o,h.box),t.hole.length&&(f=t.hole.length===1?_t(t.hole[0]).shape:Oe(t.hole[0],t.hole[1]).shape,a.push({type:"layer",polarity:"clear",box:o},f)),{shape:a,box:o}},pe=Sr,we=Math.PI/2,Ln=Math.PI,xe=Math.PI*2,Ke=3*Math.PI/2,Sl=function(e,t,r,a){return r?(a._warn("flash in region ignored"),pe.new()):t?(t.flashed||(t.flashed=!0,a.push({type:"shape",tool:t.code,shape:t.pad})),a.push({type:"pad",tool:t.code,x:e[0],y:e[1]}),pe.translate(t.box,e)):(a._warn("flash with unknown tool ignored"),pe.new())},Ml=function(e,t,r,a,o){for(var s,l,f,h,v;v==null&&o.length>0;)h=o.pop(),s=Math.atan2(e[1]-h[1],e[0]-h[0]),l=Math.atan2(t[1]-h[1],t[0]-h[0]),r==="cw"?s=s>=l?s:s+xe:l=l>=s?l:l+xe,f=Math.abs(s-l),a==="s"?f<=we&&(v=h):v=h;if(v!=null)return s=s>=0?s:s+xe,s=s<xe?s:s-xe,l=l>=0?l:l+xe,l=l<xe?l:l-xe,{center:v,sweep:f,start:e.concat(s),end:t.concat(l)}},Tl=function(e,t,r,a,o){var s=e.start,l=e.end,f=e.center,h=e.sweep,v,g;o==="cw"?(v=l[2],g=s[2]):(v=s[2],g=l[2]);var w=[s,l];return(v>g||h===xe)&&w.push([f[0]+t,f[1]]),v=v>=we?v-we:v+Ke,g=g>=we?g-we:g+Ke,(v>g||h===xe)&&w.push([f[0],f[1]+t]),v=v>=we?v-we:v+Ke,g=g>=we?g-we:g+Ke,(v>g||h===xe)&&w.push([f[0]-t,f[1]]),v=v>=we?v-we:v+Ke,g=g>=we?g-we:g+Ke,(v>g||h===xe)&&w.push([f[0],f[1]-t]),w.reduce(function(E,A){if(!r){var x=pe.translate(a.box,A);return pe.add(E,x)}return pe.addPoint(E,A)},pe.new())},Nn=function(e,t){return e>=t?e:0},Al=function(e,t,r,a,o){var s=r==="ccw"?1:-1,l=(e[0]+t[0])/2,f=(e[1]+t[1])/2,h=t[0]-e[1],v=t[1]-e[1],g=Math.sqrt(Math.pow(h,2)+Math.pow(v,2)),w=g/2,E=Math.sqrt(Math.pow(o,2)-Math.pow(w,2)),A=-s*v*E/g,x=s*h*E/g;return[[Nn(l+A,a),Nn(f+x,a)]]},Ol=function(e,t,r,a,o,s,l,f,h,v){var g=r[2]||Math.sqrt(Math.pow(r[0],2)+Math.pow(r[1],2)),w=[],E=[],A=[];r[0]&&s==="s"?E.push(e[0]+r[0],e[0]-r[0]):E.push(e[0]+r[0]),r[1]&&s==="s"?A.push(e[1]+r[1],e[1]-r[1]):A.push(e[1]+r[1]);for(var x=0;x<E.length;x++)for(var S=0;S<A.length;S++)w.push([E[x],A[S]]);var O;r[2]?(s="m",O=Al(e,t,o,f,r[2])):s==="s"?O=w.filter(function(F){var k=Math.sqrt(Math.pow(F[0]-e[0],2)+Math.pow(F[1]-e[1],2)),P=Math.sqrt(Math.pow(F[0]-t[0],2)+Math.pow(F[1]-t[1],2));return Math.abs(k-g)<=f&&Math.abs(P-g)<=f}):O=w;var I=Ml(e,t,o,s,O);s==="m"&&e[0]===t[0]&&e[1]===t[1]&&(I.sweep=xe);var D=pe.new();return I!=null?(h.add({type:"arc",start:I.start,end:I.end,center:I.center,sweep:I.sweep,radius:g,dir:o}),D=Tl(I,g,l,a,o)):v._warn("skipping impossible arc"),D},Bl=function(e,t,r,a,o){if(o.add({type:"line",start:e,end:t}),!a){var s=pe.translate(r.box,e),l=pe.translate(r.box,t);return pe.add(s,l)}var f=pe.new();return f=pe.addPoint(f,e),f=pe.addPoint(f,t),f},Il=function(e,t,r,a,o){var s=r.trace[0]/2,l=r.trace[1]/2,f=Math.atan2(t[1]-e[1],t[0]-e[0]),h=e[0]-s,v=e[0]+s,g=e[1]-l,w=e[1]+l,E=t[0]-s,A=t[0]+s,x=t[1]-l,S=t[1]+l,O=[];return e[0]===t[0]&&e[1]===t[1]?O.push([h,g],[v,g],[v,w],[h,w]):f>=0&&f<we?O.push([h,g],[v,g],[A,x],[A,S],[E,S],[h,w]):f>=we&&f<=Ln?O.push([v,g],[v,w],[A,S],[E,S],[E,x],[h,g]):f>=-Ln&&f<-we?O.push([v,w],[h,w],[E,S],[E,x],[A,x],[v,g]):O.push([h,w],[h,g],[E,x],[A,x],[A,S],[v,w]),O.forEach(function(I,D){var F=D<O.length-1?D+1:0;a.add({type:"line",start:I,end:O[F]})}),o._finishPath(),pe.add(pe.translate(r.box,e),pe.translate(r.box,t))},Ll=function(e,t,r,a,o,s,l,f,h,v){var g=l||a&&a.trace.length>0,w=l||a&&a.trace.length===1,E=a?a.code:"[NO TOOL SET]";return g?o==="i"?l||a.trace.length===1?Bl(e,t,a,l,h):Il(e,t,a,h,v):w?Ol(e,t,r,a,o,s,l,f,h,v):(v._warn("cannot draw arc with non-circular tool "+E+"; ignoring interpolate"),pe.new()):(v._warn("tool "+E+" is not strokable; ignoring interpolate"),pe.new())},Nl=function(e,t,r,a,o,s,l,f,h,v){var g=[t.x!=null?t.x:r[0],t.y!=null?t.y:r[1]],w=[t.i!=null?t.i:0,t.j!=null?t.j:0,t.a],E;switch(e){case"flash":E=Sl(g,a,l,v);break;case"int":E=Ll(r,g,w,a,o,s,l,h,f,v);break;default:E=pe.new();break}return{pos:g,box:E}},Cl=Nl,oa=mr.Transform,kl=$e,sa=Xu,Fl=Qu,Pl=Rl,Ul=Cl,vt=Sr,$l=11e-5,Dl=function(e){return e==="units"||e==="backupUnits"||e==="nota"||e==="backupNota"},je=function(e,t,r,a,o,s){oa.call(this,{readableObjectMode:!0,writableObjectMode:!0}),this.format={units:e,backupUnits:t||"in",nota:r,backupNota:a||"A"},this._formatLock={units:e!=null,backupUnits:t!=null,nota:r!=null,backupNota:a!=null},this._plotAsOutline=s===!0?$l:s,(e||this.format.backupUnits)==="in"&&(this._plotAsOutline=this._plotAsOutline/25.4),this._optimizePaths=o||s,this._line=0,this._done=!1,this._tool=null,this._outTool=null,this._tools={},this._macros={},this._pos=[0,0],this._box=vt.new(),this._mode=null,this._arc=null,this._region=!1,this._path=new sa(this._optimizePaths,this._plotAsOutline),this._epsilon=null,this._lastOp=null,this._stepRep=[]};kl(je,oa);je.prototype._finishPath=function(e){var t=this._path.traverse();if(this._path=new sa(!e&&this._optimizePaths,this._plotAsOutline),t.length){var r=this._plotAsOutline?this._outTool:this._tool;!this._region&&r.trace.length===1?this.push({type:"stroke",width:r.trace[0],path:t}):this.push({type:"fill",path:t})}};je.prototype._warn=function(e){this.emit("warning",Fl(e,this._line))};je.prototype._checkFormat=function(){this.format.units||(this.format.units=this.format.backupUnits,this._warn("units not set; using backup units: "+this.format.units)),this.format.nota||(this.format.nota=this.format.backupNota,this._warn("notation not set; using backup notation: "+this.format.nota))};je.prototype._updateBox=function(e){var t=this._stepRep.length;if(!t)this._box=vt.add(this._box,e);else{var r=vt.repeat(e,this._stepRep[t-1]);this._box=vt.add(this._box,r)}};je.prototype._transform=function(e,t,r){var a=e.type;if(this._line=e.line,this._done)return this._warn("ignoring extra command recieved after done command"),r();if(a==="op"){this._checkFormat();var o=e.op,s=e.coord;if(this.nota==="I"){var l=this;s=Object.keys(s).reduce(function(F,k){var P=s[k];return k==="x"?F[k]=l._pos[0]+P:k==="y"?F[k]=l._pos[1]+P:F[k]=P,F},{})}o==="last"&&(this._warn("modal operation commands are deprecated"),o=this._lastOp),o==="int"&&(this._mode==null&&(this._warn("no interpolation mode specified; assuming linear"),this._mode="i"),this._arc==null&&this._mode.slice(-2)==="cw"&&!s.a&&(this._warn("quadrant mode unspecified; assuming single quadrant"),this._arc="s")),this._plotAsOutline&&(this._outTool=this._tool);var f=Ul(o,s,this._pos,this._tool,this._mode,this._arc,this._region||this._plotAsOutline,this._path,this._epsilon,this);this._lastOp=o,this._pos=f.pos,this._updateBox(f.box)}else if(a==="set"){var h=e.prop,v=e.value;h==="region"?(this._finishPath(v),this._region=v):Dl(h)&&!this._formatLock[h]?(this.format[h]=v,(h==="units"||h==="nota")&&(this._formatLock[h]=!0)):h==="tool"?this._region?this._warn("cannot change tool while region mode is on"):this._tools[v]?this._outTool||(this._finishPath(),this._tool=this._tools[v]):this._warn("tool "+v+" is not defined"):this["_"+h]=v}else if(a==="tool"){var g=e.code,w=e.tool;this._tools[g]&&this._warn("tool "+g+" is already defined; overwriting definition");var E=Pl(w,this._macros),A={code:g,trace:[],pad:E.shape,flashed:!1,box:E.box};(w.shape==="circle"||w.shape==="rect")&&w.hole.length===0&&(A.trace=w.params),this._outTool||(this._finishPath(),this._tools[g]=A,this._tool=A)}else if(a==="macro")this._macros[e.name]=e.blocks;else if(a==="level"){var x=e.level,S=e.value;if(this._finishPath(),x==="polarity")this.push({type:"polarity",polarity:S==="C"?"clear":"dark",box:this._box.slice(0)});else{var O=[];if(S.x>1||S.y>1)for(var I=0;I<S.x;I++)for(var D=0;D<S.y;D++)O.push([I*S.i,D*S.j]);this._stepRep=O,this.push({type:"repeat",offsets:this._stepRep.slice(0),box:this._box.slice(0)})}}else a==="done"&&(this._done=!0);return r()};je.prototype._flush=function(e){this._finishPath(),this.push({type:"size",box:this._box,units:this.format.units}),e()};var jl=je,zl=jl,Cn=function(e){if(e==="A"||e==="I")return e;throw new Error('notation must be "in" or "mm"')},kn=function(e){if(e==="in"||e==="mm")return e;throw new Error('units must be "in" or "mm"')},ql=function(t){t=t||{};var r=t.units?kn(t.units):null,a=t.backupUnits?kn(t.backupUnits):null,o=t.nota?Cn(t.nota):null,s=t.backupNota?Cn(t.backupNota):null;return new zl(r,a,o,s,t.optimizePaths,t.plotAsOutline)};/*! + * escape-html + * Copyright(c) 2012-2013 TJ Holowaychuk + * Copyright(c) 2015 Andreas Lubbe + * Copyright(c) 2015 Tiancheng "Timothy" Gu + * MIT Licensed + */var Gl=/["'&<>]/,Wl=Hl;function Hl(e){var t=""+e,r=Gl.exec(t);if(!r)return t;var a,o="",s=0,l=0;for(s=r.index;s<t.length;s++){switch(t.charCodeAt(s)){case 34:a=""";break;case 38:a="&";break;case 39:a="'";break;case 60:a="<";break;case 62:a=">";break;default:continue}l!==s&&(o+=t.substring(l,s)),l=s+1,o+=a}return l!==s?o+t.substring(l,s):o}var zt=Wl,fa=function(t,r,a){r=r||{},a=a||[];var o="<"+zt(t),s=Object.keys(r).reduce(function(f,h){var v=r[h],g=v!=null?" "+zt(h)+'="'+zt(v)+'"':"";return f+g},""),l=a.length?">"+a.join("")+"</"+t+">":"/>";return o+s+l},st=function(e){return Math.round(1e10*e)/1e7},Zl=function(e,t,r){return r("rect",{x:st(e[0]),y:st(e[1]),width:st(e[2]-e[0]),height:st(e[3]-e[1]),fill:t})},Xl=function(e,t,r){var a="url(#"+e+")";return r("g",{mask:a},t)},Yl=function(e,t,r,a){r=[Zl(t,"#fff",a)].concat(r);var o={id:e,fill:"#000",stroke:"#000"};return a("mask",o,[a("g",{},r)])},Bt={shift:st,maskLayer:Xl,createMask:Yl},Mr=Bt,Ae=Mr.shift,Fn=Mr.createMask,Ql=Mr.maskLayer,It=function(e,t,r){return{tag:e,attr:t,children:r||[]}},fr=function(e,t,r,a){var o={cx:Ae(e),cy:Ae(t),r:Ae(r)};return a!=null&&(o["stroke-width"]=Ae(a),o.fill="none"),It("circle",o)},ua=function(e,t,r,a,o){var s={x:Ae(e-a/2),y:Ae(t-o/2),width:Ae(a),height:Ae(o)};return r&&(s.rx=Ae(r),s.ry=Ae(r)),It("rect",s)},la=function(e){var t=e.map(function(r){return r.map(Ae).join(",")}).join(" ");return It("polygon",{points:t})},Vl=function(e,t,r,a,o){var s=e+"mask-"+t,l="url(#"+s+")",f=fr(a.cx,a.cy,a.r,a.width),h=o("mask",{id:s,stroke:"#fff"},[o(f.tag,f.attr)]),v=r.map(function(w){var E=w.type==="rect"?ua(w.cx,w.cy,w.r,w.width,w.height):la(w.points);return o(E.tag,E.attr)}),g=It("g",{mask:l},v);return{mask:h,layer:g}},Kl=function(t,r,a,o){var s=t+"_pad-"+r,l=s+"_",f=a.reduce(function(h,v,g){var w;switch(v.type){case"circle":w=fr(v.cx,v.cy,v.r);break;case"ring":w=fr(v.cx,v.cy,v.r,v.width);break;case"rect":w=ua(v.cx,v.cy,v.r,v.width,v.height);break;case"poly":w=la(v.points);break;case"clip":var E=Vl(l,g,v.shape,v.clip,o);h.masks.push(E.mask),w=E.layer;break;case"layer":if(h.count++,h.last=v.polarity,v.polarity==="clear"){var A=l+h.count;h.maskId=A,h.maskBox=v.box.slice(0),h.maskChildren=[],h.layers=[Ql(A,h.layers,o)]}else{var x=Fn(h.maskId,h.maskBox,h.maskChildren,o);h.masks.push(x)}break}if(w){a.length===1&&(w.attr.id=s);var S=o(w.tag,w.attr,w.children);h.last==="dark"?h.layers.push(S):h.maskChildren.push(S)}return h},{count:0,last:"dark",layers:[],maskId:"",maskBox:[],maskChildren:[],masks:[]});return f.last==="clear"&&f.masks.push(Fn(f.maskId,f.maskBox,f.maskChildren,o)),a.length>1&&(f.layers=o("g",{id:s},f.layers)),f.masks.concat(f.layers)},Jl=Bt,Pn=Jl.shift,eh=function(t,r,a,o,s){var l="#"+t+"_pad-"+r;return s("use",{"xlink:href":l,x:Pn(a),y:Pn(o)})},th=Bt,Ue=th.shift,rh=function(e,t){return e[0]===t[0]&&e[1]===t[1]},nh=function(e){return"M "+Ue(e[0])+" "+Ue(e[1])},ha=function(e,t){var r=e==="L"||e==="M"?"":"L ";return r+Ue(t[0])+" "+Ue(t[1])},ur=function(e,t,r,a,o,s){if(r===0)return ha(e,o);if(r===2*Math.PI){var l=[2*s[0]-o[0],2*s[1]-o[1]],f=ur(e,t,Math.PI,a,l,s),h=ur("A",t,Math.PI,a,o,s);return f+" "+h}var v=e==="A"?"":"A ";return t=Ue(t),v+=t+" "+t+" 0 ",v+=r>Math.PI?"1 ":"0 ",v+=a==="ccw"?"1 ":"0 ",v+=Ue(o[0])+" "+Ue(o[1]),v},ih=function(e,t){var r=t.type,a=t.start,o=t.end;return rh(e.last,a)||(e.data+=(e.data?" ":"")+nh(a),e.lastCmd="M"),e.data+=" ",r==="line"?(e.data+=ha(e.lastCmd,o),e.lastCmd="L"):(e.data+=ur(e.lastCmd,t.radius,t.sweep,t.dir,o,t.center),e.lastCmd="A"),e.last=o,e},ah=function(t,r,a){var o=t.reduce(ih,{last:[],data:""}).data,s={d:o};return r!=null&&(s.fill="none",s["stroke-width"]=Ue(r)),a("path",s)},oh=fa,ca=function(e,t,r){var a=r||oh,o={version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"0","fill-rule":"evenodd",width:e.width+e.units,height:e.height+e.units,viewBox:e.viewBox.join(" ")};typeof t=="string"&&(t={id:t}),Object.keys(t||{}).forEach(function(h){var v=t[h];v!=null&&(o[h]=v)});var s=[];if(e.layer.length){e.defs.length&&s.push(a("defs",{},e.defs));var l=e.viewBox[3]+2*e.viewBox[1],f="translate(0,"+l+") scale(1,-1)";s.push(a("g",{transform:f,fill:"currentColor",stroke:"currentColor"},e.layer))}return a("svg",o,s)},da=mr.Transform,sh=$e,pa=ut,fh=Kl,uh=eh,Un=ah,Tr=Bt,lh=ca,Pe=Tr.shift,va=Tr.maskLayer,hh=Tr.createMask,ch=0,lr=1,ga=2,Ne=function(e,t,r,a){da.call(this,{writableObjectMode:!0,readableObjectMode:a}),this.id=e,this.attributes=t,this.defs=[],this.layer=[],this.viewBox=[0,0,0,0],this.width=0,this.height=0,this.units="",this._maskId="",this._maskBox=[],this._mask=[],this._blockMode=!1,this._blockBox=[],this._block=[],this._blockCount=0,this._blockLayerCount=0,this._offsets=[],this._clearCount=0,this._lastLayer=0,this._blockCount=0,this._blockCount=0,this._element=r};sh(Ne,da);Ne.prototype._transform=function(e,t,r){switch(e.type){case"shape":this.defs=this.defs.concat(fh(this.id,e.tool,e.shape,this._element));break;case"pad":this._draw(uh(this.id,e.tool,e.x,e.y,this._element));break;case"fill":this._draw(Un(e.path,null,this._element));break;case"stroke":this._draw(Un(e.path,e.width,this._element));break;case"polarity":this._handleNewPolarity(e.polarity,e.box);break;case"repeat":this._handleNewRepeat(e.offsets,e.box);break;case"size":this._handleSize(e.box,e.units)}r()};Ne.prototype._flush=function(e){this._handleNewRepeat([]),this.push(lh(this,this.attributes,this._element)),e()};Ne.prototype._finishBlockLayer=function(){if(this._block.length){this._blockLayerCount++;var e=this.id+"_block-"+this._blockCount+"-"+this._blockLayerCount;this.defs.push(this._element("g",{id:e},this._block)),this._block=[]}};Ne.prototype._finishClearLayer=function(){return this._maskId?(this.defs.push(hh(this._maskId,this._maskBox,this._mask,this._element)),this._maskId="",this._maskBox=[],this._mask=[],!0):!1};Ne.prototype._handleNewPolarity=function(e,t){if(this._blockMode)return this._blockLayerCount===0&&!this._block.length&&(this._blockMode=e==="dark"?lr:ga),this._finishBlockLayer();this._clearCount=e==="clear"?this._clearCount+1:this._clearCount;var r=this.id+"_clear-"+this._clearCount;e==="clear"?(this.layer=[va(r,this.layer,this._element)],this._maskId=r,this._maskBox=t.slice(0)):this._finishClearLayer(t)};Ne.prototype._handleNewRepeat=function(e,t){var r=e.length===0,a=this._finishClearLayer();this._finishBlockLayer();var o=this.layer,s=this._element,l=this._blockMode,f=this._blockLayerCount,h=this.id+"_block-"+this._blockCount+"-";if(this._offsets.forEach(function(g){for(var w=l;w<=f;w+=2)o.push(s("use",{"xlink:href":"#"+h+w,x:Pe(g[0]),y:Pe(g[1])}))}),f>2-l){var v=h+"clear";this.layer=[va(v,o,this._element)],this._maskId=v,this._maskBox=this._blockBox.slice(0),this._mask=this._offsets.reduce(function(g,w){for(var E,A=1;A<=f;A++){E=l===lr?A%2===1:A%2===0;var x={"xlink:href":"#"+h+A,x:Pe(w[0]),y:Pe(w[1])};E&&(x.fill="#fff",x.stroke="#fff"),g.push(s("use",x))}return g},[]),a=this._finishClearLayer()}this._offsets=e,r?this._blockMode=ch:(this._blockMode=a?ga:lr,this._blockCount++,this._blockLayerCount=0,this._blockBox=t.every(pa)?t:[0,0,0,0])};Ne.prototype._handleSize=function(e,t){if(e.every(pa)){var r=Pe(e[0]),a=Pe(e[1]),o=Pe(e[2]-e[0]),s=Pe(e[3]-e[1]);this.viewBox=[r,a,o,s],this.width=o/1e3,this.height=s/1e3,this.units=t}};Ne.prototype._draw=function(e){this._blockMode?this._block.push(e):this._maskId?this._mask.push(e):this.layer.push(e)};var dh=Ne,ph=["id","attributes","defs","layer","viewBox","width","height","units"],vh=function(t){return ph.reduce(function(r,a){var o=t[a];return o!=null&&(r[a]=t[a]),r},{})},gh=Ga,yh=vu,mh=ql,wh=fa,_h=dh,bh=ca,Eh=vh,xh=function(e){typeof e=="string"?e={id:e}:e||(e={});var t={id:gh.ensure(e.id),attributes:e.attributes||{},createElement:e.createElement||wh,objectMode:e.objectMode==null?!1:e.objectMode,parser:{places:e.places,zero:e.zero,filetype:e.filetype},plotter:{units:e.units,backupUnits:e.backupUnits,nota:e.nota,backupNota:e.backupNota,optimizePaths:e.optimizePaths,plotAsOutline:e.plotAsOutline}};return t};Mt.exports=function(t,r,a){typeof r=="function"&&(a=r,r=null);var o=xh(r),s=a!=null,l=new _h(o.id,o.attributes,o.createElement,o.objectMode),f=yh(o.parser),h=mh(o.plotter);if(l.parser=f,l.plotter=h,f.on("warning",function(E){l.emit("warning",E)}),h.on("warning",function(E){l.emit("warning",E)}),f.once("error",function(E){l.emit("error",E)}),h.once("error",function(E){l.emit("error",E)}),f.once("end",function(){l.filetype=f.format.filetype}),t.pipe?(t.setEncoding("utf8"),t.pipe(f)):process.nextTick(function(){f.write(t),f.end()}),f.pipe(h).pipe(l),s){var v="",g=function(){return a(null,v)};l.on("readable",function(){var E;do E=l.read()||"",v+=E;while(E)}),l.once("end",g),l.once("error",function(w){return l.removeListener("end",g),a(w)})}return l};Mt.exports.render=bh;Mt.exports.clone=Eh;var Rh=Mt.exports;const Sh=hr(Rh);var ya={};(function(e){(function(){var t=e||!1||this||window;t.default=t;var r="http://www.w3.org/2000/xmlns/",a="http://www.w3.org/1999/xhtml",o="http://www.w3.org/2000/svg",s='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [<!ENTITY nbsp " ">]>',l=/url\(["']?(.+?)["']?\)/,f={woff2:"font/woff2",woff:"font/woff",otf:"application/x-font-opentype",ttf:"application/x-font-ttf",eot:"application/vnd.ms-fontobject",sfnt:"application/font-sfnt",svg:"image/svg+xml"},h=function(L){return L instanceof HTMLElement||L instanceof SVGElement},v=function(L){if(!h(L))throw new Error("an HTMLElement or SVGElement is required; got "+L)},g=function(L){return new Promise(function(N,B){h(L)?N(L):B(new Error("an HTMLElement or SVGElement is required; got "+L))})},w=function(L){return L&&L.lastIndexOf("http",0)===0&&L.lastIndexOf(window.location.host)===-1},E=function(L){var N=Object.keys(f).filter(function(B){return L.indexOf("."+B)>0}).map(function(B){return f[B]});return N?N[0]:(console.error("Unknown font format for "+L+". Fonts may not be working correctly."),"application/octet-stream")},A=function(L){for(var N="",B=new Uint8Array(L),U=0;U<B.byteLength;U++)N+=String.fromCharCode(B[U]);return window.btoa(N)},x=function(L,N,B){var U=L.viewBox&&L.viewBox.baseVal&&L.viewBox.baseVal[B]||N.getAttribute(B)!==null&&!N.getAttribute(B).match(/%$/)&&parseInt(N.getAttribute(B))||L.getBoundingClientRect()[B]||parseInt(N.style[B])||parseInt(window.getComputedStyle(L).getPropertyValue(B));return typeof U>"u"||U===null||isNaN(parseFloat(U))?0:U},S=function(L,N,B,U){if(L.tagName==="svg")return{width:B||x(L,N,"width"),height:U||x(L,N,"height")};if(L.getBBox){var W=L.getBBox(),H=W.x,J=W.y,se=W.width,_e=W.height;return{width:H+se,height:J+_e}}},O=function(L){return decodeURIComponent(encodeURIComponent(L).replace(/%([0-9A-F]{2})/g,function(N,B){var U=String.fromCharCode("0x"+B);return U==="%"?"%25":U}))},I=function(L){for(var N=window.atob(L.split(",")[1]),B=L.split(",")[0].split(":")[1].split(";")[0],U=new ArrayBuffer(N.length),W=new Uint8Array(U),H=0;H<N.length;H++)W[H]=N.charCodeAt(H);return new Blob([U],{type:B})},D=function(L,N){if(N)try{return L.querySelector(N)||L.parentNode&&L.parentNode.querySelector(N)}catch(B){console.warn('Invalid CSS selector "'+N+'"',B)}},F=function(L,N){var B=L.cssText.match(l),U=B&&B[1]||"";if(!(!U||U.match(/^data:/)||U==="about:blank")){var W=U.startsWith("../")?N+"/../"+U:U.startsWith("./")?N+"/."+U:U;return{text:L.cssText,format:E(W),url:W}}},k=function(L){return Promise.all(Array.from(L.querySelectorAll("image")).map(function(N){var B=N.getAttributeNS("http://www.w3.org/1999/xlink","href")||N.getAttribute("href");return B?(w(B)&&(B+=(B.indexOf("?")===-1?"?":"&")+"t="+new Date().valueOf()),new Promise(function(U,W){var H=document.createElement("canvas"),J=new Image;J.crossOrigin="anonymous",J.src=B,J.onerror=function(){return W(new Error("Could not load "+B))},J.onload=function(){H.width=J.width,H.height=J.height,H.getContext("2d").drawImage(J,0,0),N.setAttributeNS("http://www.w3.org/1999/xlink","href",H.toDataURL("image/png")),U(!0)}})):Promise.resolve(null)}))},P={},G=function(L){return Promise.all(L.map(function(N){return new Promise(function(B,U){if(P[N.url])return B(P[N.url]);var W=new XMLHttpRequest;W.addEventListener("load",function(){var H=A(W.response),J=N.text.replace(l,'url("data:'+N.format+";base64,"+H+'")')+` +`;P[N.url]=J,B(J)}),W.addEventListener("error",function(H){console.warn("Failed to load font from: "+N.url,H),P[N.url]=null,B(null)}),W.addEventListener("abort",function(H){console.warn("Aborted loading font from: "+N.url,H),B(null)}),W.open("GET",N.url),W.responseType="arraybuffer",W.send()})})).then(function(N){return N.filter(function(B){return B}).join("")})},te=null,X=function(){return te||(te=Array.from(document.styleSheets).map(function(L){try{return{rules:L.cssRules,href:L.href}}catch(N){return console.warn("Stylesheet could not be loaded: "+L.href,N),{}}}))},q=function(L,N){var B=N||{},U=B.selectorRemap,W=B.modifyStyle,H=B.modifyCss,J=B.fonts,se=B.excludeUnusedCss,_e=H||function(ae,ye){var _=U?U(ae):ae,m=W?W(ye):ye;return _+"{"+m+`} +`},Q=[],ee=typeof J>"u",ce=J||[];return X().forEach(function(ae){var ye=ae.rules,_=ae.href;ye&&Array.from(ye).forEach(function(m){if(typeof m.style<"u")if(D(L,m.selectorText))Q.push(_e(m.selectorText,m.style.cssText));else if(ee&&m.cssText.match(/^@font-face/)){var T=F(m,_);T&&ce.push(T)}else se||Q.push(m.cssText)})}),G(ce).then(function(ae){return Q.join(` +`)+ae})},me=function(){if(!navigator.msSaveOrOpenBlob&&!("download"in document.createElement("a")))return{popup:window.open()}};t.prepareSvg=function(j,L,N){v(j);var B=L||{},U=B.left,W=U===void 0?0:U,H=B.top,J=H===void 0?0:H,se=B.width,_e=B.height,Q=B.scale,ee=Q===void 0?1:Q,ce=B.responsive,ae=ce===void 0?!1:ce,ye=B.excludeCss,_=ye===void 0?!1:ye;return k(j).then(function(){var m=j.cloneNode(!0);m.style.backgroundColor=(L||{}).backgroundColor||j.style.backgroundColor;var T=S(j,m,se,_e),$=T.width,z=T.height;if(j.tagName!=="svg")if(j.getBBox){m.getAttribute("transform")!=null&&m.setAttribute("transform",m.getAttribute("transform").replace(/translate\(.*?\)/,""));var d=document.createElementNS("http://www.w3.org/2000/svg","svg");d.appendChild(m),m=d}else{console.error("Attempted to render non-SVG element",j);return}if(m.setAttribute("version","1.1"),m.setAttribute("viewBox",[W,J,$,z].join(" ")),m.getAttribute("xmlns")||m.setAttributeNS(r,"xmlns",o),m.getAttribute("xmlns:xlink")||m.setAttributeNS(r,"xmlns:xlink","http://www.w3.org/1999/xlink"),ae?(m.removeAttribute("width"),m.removeAttribute("height"),m.setAttribute("preserveAspectRatio","xMinYMin meet")):(m.setAttribute("width",$*ee),m.setAttribute("height",z*ee)),Array.from(m.querySelectorAll("foreignObject > *")).forEach(function(C){C.setAttributeNS(r,"xmlns",C.tagName==="svg"?o:a)}),_){var p=document.createElement("div");p.appendChild(m);var M=p.innerHTML;if(typeof N=="function")N(M,$,z);else return{src:M,width:$,height:z}}else return q(j,L).then(function(C){var re=document.createElement("style");re.setAttribute("type","text/css"),re.innerHTML=`<![CDATA[ +`+C+` +]]>`;var Z=document.createElement("defs");Z.appendChild(re),m.insertBefore(Z,m.firstChild);var V=document.createElement("div");V.appendChild(m);var Te=V.innerHTML.replace(/NS\d+:href/gi,'xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href');if(typeof N=="function")N(Te,$,z);else return{src:Te,width:$,height:z}})})},t.svgAsDataUri=function(j,L,N){return v(j),t.prepareSvg(j,L).then(function(B){var U=B.src,W=B.width,H=B.height,J="data:image/svg+xml;base64,"+window.btoa(O(s+U));return typeof N=="function"&&N(J,W,H),J})},t.svgAsPngUri=function(j,L,N){v(j);var B=L||{},U=B.encoderType,W=U===void 0?"image/png":U,H=B.encoderOptions,J=H===void 0?.8:H,se=B.canvg,_e=function(ee){var ce=ee.src,ae=ee.width,ye=ee.height,_=document.createElement("canvas"),m=_.getContext("2d"),T=window.devicePixelRatio||1;_.width=ae*T,_.height=ye*T,_.style.width=_.width+"px",_.style.height=_.height+"px",m.setTransform(T,0,0,T,0,0),se?se(_,ce):m.drawImage(ce,0,0);var $=void 0;try{$=_.toDataURL(W,J)}catch(z){if(typeof SecurityError<"u"&&z instanceof SecurityError||z.name==="SecurityError"){console.error("Rendered SVG images cannot be downloaded in this browser.");return}else throw z}return typeof N=="function"&&N($,_.width,_.height),Promise.resolve($)};return se?t.prepareSvg(j,L).then(_e):t.svgAsDataUri(j,L).then(function(Q){return new Promise(function(ee,ce){var ae=new Image;ae.onload=function(){return ee(_e({src:ae,width:ae.width,height:ae.height}))},ae.onerror=function(){ce(`There was an error loading the data URI as an image on the following SVG +`+window.atob(Q.slice(26))+`Open the following link to see browser's diagnosis +`+Q)},ae.src=Q})})},t.download=function(j,L,N){if(navigator.msSaveOrOpenBlob)navigator.msSaveOrOpenBlob(I(L),j);else{var B=document.createElement("a");if("download"in B){B.download=j,B.style.display="none",document.body.appendChild(B);try{var U=I(L),W=URL.createObjectURL(U);B.href=W,B.onclick=function(){return requestAnimationFrame(function(){return URL.revokeObjectURL(W)})}}catch(H){console.error(H),console.warn("Error while getting object URL. Falling back to string URL."),B.href=L}B.click(),document.body.removeChild(B)}else N&&N.popup&&(N.popup.document.title=j,N.popup.location.replace(L))}},t.saveSvg=function(j,L,N){var B=me();return g(j).then(function(U){return t.svgAsDataUri(U,N||{})}).then(function(U){return t.download(L,U,B)})},t.saveSvgAsPng=function(j,L,N){var B=me();return g(j).then(function(U){return t.svgAsPngUri(U,N||{})}).then(function(U){return t.download(L,U,B)})}})()})(ya);window.Buffer=rt.Buffer;window.process=Ma;window.EventEmitter=ja;document.getElementById("body");let gt=document.getElementById("previewSVG");const bt=["Edge_Cuts","profile","B_Cu","copper_bottom","F_Cu","copper_top","B_Mask","soldermask_bottom","F_Mask","soldermask_top","B_Paste","solderpaste_bottom","F_Paste","solderpaste_top","drill","B_Silkscreen","B_Silks","silkscreen_bottom","F_Silkscreen","F_Silks","silkscreen_top"],$n={Edge_Cuts:[70,105,58,1],profile:[70,105,58,1],B_Cu:[30,130,220,.8],copper_bottom:[30,130,220,.8],F_Cu:[89,165,82,.8],copper_top:[89,165,82,.8],B_Mask:[200,177,170,.6],soldermask_bottom:[200,177,170,.6],F_Mask:[239,177,58,1],soldermask_top:[239,177,58,1],B_Paste:[200,20,230,.2],solderpaste_bottom:[200,20,230,.2],F_Paste:[200,20,230,.3],solderpaste_top:[200,20,230,.3],drill:[120,120,120,1],B_Silkscreen:[255,255,255,.6],B_Silks:[255,255,255,.6],silkscreen_bottom:[255,255,255,.6],F_Silkscreen:[255,255,255,1],F_Silks:[255,255,255,1],silkscreen_top:[255,255,255,1]};let Et=[],xt=null,K={fillEdge:!0,asSVG:!1,dpi:1e3,svgOrig:[NaN,NaN],lockOrig:!1,svgDim:[NaN,NaN],lockDim:!1,svgMargin:[0,0]};function Dn(){if(xt===null)gt.outerHTML='<svg id="previewSVG"></svg>';else{let e=new XMLSerializer;gt.outerHTML=e.serializeToString(xt)}gt=document.getElementById("previewSVG")}function ht(e=!1){let t=new DOMParser;if(xt=t.parseFromString('<svg id="previewSVG" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"></svg>',"text/xml"),Et.length==0){Dn();return}let r=Et.toSorted((x,S)=>bt.indexOf(x[0])-bt.indexOf(S[0])),a,o,s=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=Number.MAX_VALUE,h=-Number.MAX_VALUE,v=xt.childNodes[0];v.setAttribute("stroke-linecap","round"),v.setAttribute("stroke-linejoin","round"),v.setAttribute("stroke-width","0"),v.setAttribute("fill-rule","evenodd");let g,w,E;for([a,o]of r)w=t.parseFromString(o,"text/xml"),E=w.childNodes[0],g=E.getAttribute("viewBox").split(" ").map(x=>Number(x)),E.childNodes.length!=0&&(s=Math.min(s,g[0]),l=Math.max(l,g[0]+g[2]),f=Math.min(f,g[1]),h=Math.max(h,g[1]+g[3]));e||((!K.lockOrig||isNaN(K.svgOrig[0]))&&(K.svgOrig[0]=s/1e3,K.svgOrig[1]=f/1e3),(!K.lockDim||isNaN(K.svgDim[0]))&&(K.svgDim[0]=(l-s)/1e3,K.svgDim[1]=(h-f)/1e3)),Th();let A=[K.svgOrig[0]-K.svgMargin[0],K.svgOrig[1]-K.svgMargin[1],K.svgDim[0]+2*K.svgMargin[0],K.svgDim[1]+2*K.svgMargin[1]].map(x=>x*1e3);v.setAttribute("viewBox",A.join(" ")),v.setAttribute("width",`${(A[2]/1e3).toFixed(3)}mm`),v.setAttribute("height",`${(A[3]/1e3).toFixed(3)}mm`);for([a,o]of r){w=t.parseFromString(o,"text/xml"),E=w.childNodes[0],g=E.getAttribute("viewBox").split(" ").map(O=>Number(O));let x="rgb("+$n[a].slice(0,3).join(",")+")",S=$n[a][3];for(let O of E.childNodes){if(O.tagName=="g"){const I=/translate\([-.\d]+,\s*([-.\d]+)\)/,D=O.getAttribute("transform").match(I);let F=Number(D[1]);F+=A[1]+A[3]-(g[1]+g[3]),F+=A[1]-g[1],O.setAttribute("transform",`translate(0, ${F}) scale(1, -1)`),O.setAttribute("opacity",S),O.setAttribute("fill",x),O.setAttribute("stroke",x),O.childNodes.forEach(k=>{["profile","Edge_Cuts"].includes(a)&&K.fillEdge&&(k.removeAttribute("fill"),k.setAttribute("stroke","none"))})}v.appendChild(O.cloneNode(!0))}}Dn()}function ma(e=!1){e||ya.saveSvgAsPng(gt,"diagram.png")}var nt=document.getElementById("dropZone");function Mh(){nt.style.visibility="visible"}function wa(){nt.style.visibility="hidden"}window.addEventListener("dragenter",e=>{Mh()});function _a(e){e.dataTransfer.dropEffect="copy",e.preventDefault()}nt.addEventListener("dragenter",_a);nt.addEventListener("dragover",_a);nt.addEventListener("dragleave",e=>{wa()});nt.addEventListener("drop",e=>{if(e.preventDefault(),wa(),!e.dataTransfer.items)return;let t=[];for(let r of e.dataTransfer.files){let a;if(r.name.endsWith(".xln")||r.name.endsWith(".drl"))a="drill";else{if(!r.name.endsWith(".gbr"))continue;let s=r.name.replace(".gbr",""),l=-1;for(let f in bt)if(a=bt[f],s.endsWith(a)){l=f;break}if(l==-1)continue}let o=new Promise((s,l)=>{const f=new FileReader;f.onload=h=>{const v={encoding:"utf8",optimizePaths:!0};Sh(f.result,v,(g,w)=>{s(g?null:[a,w])})},f.onerror=l,f.readAsText(r)});t.push(o)}Promise.all(t).then(r=>{Et=r,ht()})});function ba(){let e=document.getElementById("settingsFill"),t=document.getElementById("settingsAsSVG"),r=document.getElementById("settingsDPI"),a=document.getElementById("settingsOrigX"),o=document.getElementById("settingsOrigY"),s=document.getElementById("settingsDimX"),l=document.getElementById("settingsDimY"),f=document.getElementById("settingsMarginX"),h=document.getElementById("settingsMarginY");K.fillEdge=e.checked,K.asSVG=t.checked,K.dpi=Number(r.value),K.svgMargin=[Number(f.value),Number(h.value)],K.svgOrig=[Number(a.value),Number(o.value)],K.svgDim=[Number(s.value),Number(l.value)]}function Th(){let e=document.getElementById("settingsOrigX"),t=document.getElementById("settingsOrigY"),r=document.getElementById("settingsDimX"),a=document.getElementById("settingsDimY");e.value=K.svgOrig[0],t.value=K.svgOrig[1],r.value=K.svgDim[0],a.value=K.svgDim[1]}function Ah(){for(let e of["settingsFill","settingsAsSVG","settingsDPI","settingsOrigX","settingsOrigY","settingsDimX","settingsDimY","settingsMarginX","settingsMarginY"])document.getElementById(e).addEventListener("change",()=>{ba(),ht(!0)})}let qt=document.getElementById("settingsLockOrig"),Gt=document.getElementById("settingsLockDim");qt.addEventListener("click",()=>{let e=document.getElementById("settingsOrigX"),t=document.getElementById("settingsOrigY");K.lockOrig?(e.disabled=!1,t.disabled=!1,K.lockOrig=!1,qt.innerHTML="🔓"):(e.disabled=!0,t.disabled=!0,K.lockOrig=!0,qt.innerHTML="🔒"),ht()});Gt.addEventListener("click",()=>{let e=document.getElementById("settingsDimX"),t=document.getElementById("settingsDimY");K.lockDim?(e.disabled=!1,t.disabled=!1,K.lockDim=!1,Gt.innerHTML="🔓"):(e.disabled=!0,t.disabled=!0,K.lockDim=!0,Gt.innerHTML="🔒"),ht()});document.getElementById("downloadRenderButton").addEventListener("click",()=>{ma(!1)});document.getElementById("downloadlayersButton").addEventListener("click",()=>{ma(!0)});ba();Ah();Et=JSON.parse('[["F_Cu","<svg version=\\"1.1\\" xmlns=\\"http://www.w3.org/2000/svg\\" xmlns:xlink=\\"http://www.w3.org/1999/xlink\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\" stroke-width=\\"0\\" fill-rule=\\"evenodd\\" width=\\"32.531mm\\" height=\\"34.7mm\\" viewBox=\\"53775 -68780 32531 34700\\"><defs><rect x=\\"-635\\" y=\\"-1270\\" width=\\"1270\\" height=\\"2540\\" id=\\"M7zzQZkyObU1_pad-10\\"/><rect x=\\"-850\\" y=\\"-1000\\" width=\\"1700\\" height=\\"2000\\" id=\\"M7zzQZkyObU1_pad-11\\"/><rect x=\\"-1000\\" y=\\"-850\\" width=\\"2000\\" height=\\"1700\\" id=\\"M7zzQZkyObU1_pad-12\\"/><rect x=\\"-1500\\" y=\\"-800\\" width=\\"3000\\" height=\\"1600\\" id=\\"M7zzQZkyObU1_pad-13\\"/><rect x=\\"-600\\" y=\\"-1200\\" width=\\"1200\\" height=\\"2400\\" id=\\"M7zzQZkyObU1_pad-14\\"/><circle cx=\\"0\\" cy=\\"0\\" r=\\"600\\" id=\\"M7zzQZkyObU1_pad-15\\"/><rect x=\\"-370\\" y=\\"-1200\\" width=\\"740\\" height=\\"2400\\" id=\\"M7zzQZkyObU1_pad-16\\"/></defs><g transform=\\"translate(0,-102860) scale(1,-1)\\" fill=\\"currentColor\\" stroke=\\"currentColor\\"><use xlink:href=\\"#M7zzQZkyObU1_pad-10\\" x=\\"67970\\" y=\\"-61550\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-10\\" x=\\"65430\\" y=\\"-61550\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-10\\" x=\\"62890\\" y=\\"-61550\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-10\\" x=\\"60350\\" y=\\"-61550\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-10\\" x=\\"57810\\" y=\\"-61550\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-10\\" x=\\"55270\\" y=\\"-61550\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-11\\" x=\\"82550\\" y=\\"-48800\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-11\\" x=\\"82550\\" y=\\"-52800\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-12\\" x=\\"81375\\" y=\\"-55880\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-12\\" x=\\"77375\\" y=\\"-55880\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-12\\" x=\\"63595\\" y=\\"-55880\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-12\\" x=\\"59595\\" y=\\"-55880\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-12\\" x=\\"71215\\" y=\\"-55880\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-12\\" x=\\"67215\\" y=\\"-55880\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-13\\" x=\\"61235\\" y=\\"-35560\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-13\\" x=\\"61235\\" y=\\"-38100\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-13\\" x=\\"61235\\" y=\\"-40640\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-13\\" x=\\"61235\\" y=\\"-43180\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-13\\" x=\\"61235\\" y=\\"-45720\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-13\\" x=\\"61235\\" y=\\"-48260\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-13\\" x=\\"61235\\" y=\\"-50800\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-13\\" x=\\"78470\\" y=\\"-50800\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-13\\" x=\\"78470\\" y=\\"-48260\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-13\\" x=\\"78470\\" y=\\"-45720\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-13\\" x=\\"78470\\" y=\\"-43180\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-13\\" x=\\"78470\\" y=\\"-40640\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-13\\" x=\\"78470\\" y=\\"-38100\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-13\\" x=\\"78470\\" y=\\"-35560\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-14\\" x=\\"71125\\" y=\\"-52070\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-14\\" x=\\"68585\\" y=\\"-52070\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-15\\" x=\\"68580\\" y=\\"-34680\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-15\\" x=\\"68580\\" y=\\"-37220\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-15\\" x=\\"71120\\" y=\\"-37220\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-15\\" x=\\"71120\\" y=\\"-34680\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-11\\" x=\\"57785\\" y=\\"-47720\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-11\\" x=\\"57785\\" y=\\"-43720\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-16\\" x=\\"81915\\" y=\\"-61550\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-16\\" x=\\"81915\\" y=\\"-65450\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-16\\" x=\\"80645\\" y=\\"-61550\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-16\\" x=\\"80645\\" y=\\"-65450\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-16\\" x=\\"79375\\" y=\\"-61550\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-16\\" x=\\"79375\\" y=\\"-65450\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-16\\" x=\\"78105\\" y=\\"-61550\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-16\\" x=\\"78105\\" y=\\"-65450\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-16\\" x=\\"76835\\" y=\\"-61550\\"/><use xlink:href=\\"#M7zzQZkyObU1_pad-16\\" x=\\"76835\\" y=\\"-65450\\"/><path d=\\"M 77765 -67310 78105 -66970 78105 -65450 79375 -65450 79375 -67050 79375 -66720 M 79375 -67050 79635 -67310 81280 -67310 81915 -66675 81915 -65450 83140 -65450 85090 -63500 85090 -48895 84995 -48800 82550 -48800 M 85090 -48895 85090 -42545 80645 -38100 77470 -38100 79450 -38100 M 56515 -67310 71120 -67310 77765 -67310 M 71215 -67215 71120 -67310 M 55270 -60915 55270 -61550 55270 -66065 56515 -67310 M 71215 -55880 71215 -67215 M 81915 -68580 86106 -64389 86106 -41910 79756 -35560 77470 -35560 79450 -35560 M 60039.002 -59404.002 54260.998 -59404.002 53975 -59690 53975 -66675 55880 -68580 81915 -68580 M 60350 -59715 60039.002 -59404.002 M 60350 -61550 60350 -59715 M 81915 -59690 81915 -61550 M 77470 -48260 74930 -50800 74930 -56504.295 76845.206 -58419.501 80644.501 -58419.501 81915 -59690 M 74120.499 -49069.501 74120.499 -56839.602 76509.9 -59229.002 77384.002 -59229.002 78105 -59950 78105 -61550 M 77470 -45720 74120.499 -49069.501 M 76835 -60960 73310.998 -57435.998 73310.998 -47339.002 77470 -43180 M 76835 -61550 76835 -60960 M 56515 -56385.488 57914.512 -57785 62300 -57785 65430 -60915 M 56515 -48990 56515 -56385.488 M 57785 -47720 56515 -48990 M 57229.704 -58245 57229 -58245 55372 -56388 55372 -43053 57785 -40640 62235 -40640 M 61769.501 -58594.501 57579.205 -58594.501 57229.704 -58245 M 62890 -59715 61769.501 -58594.501 M 62890 -60915 62890 -59715 M 62235 -48392 62235 -48260 M 58325 -43180 57785 -43720 M 62235 -43180 58325 -43180 M 59595 -51530 59595 -55880 M 60325 -50800 59595 -51530 M 62235 -50800 60325 -50800 M 63595 -55880 67215 -55880 M 77375 -50895 77375 -55880 M 79375 -50800 77470 -50800 77375 -50895 M 81375 -55880 81915 -55880 82550 -55245 82550 -52800\\" fill=\\"none\\" stroke-width=\\"400\\"/></g></svg>"],["Edge_Cuts","<svg version=\\"1.1\\" xmlns=\\"http://www.w3.org/2000/svg\\" xmlns:xlink=\\"http://www.w3.org/1999/xlink\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\" stroke-width=\\"0\\" fill-rule=\\"evenodd\\" width=\\"34.39mm\\" height=\\"38.835mm\\" viewBox=\\"52655 -71170 34390 38835\\"><g transform=\\"translate(0,-103505) scale(1,-1)\\" fill=\\"currentColor\\" stroke=\\"currentColor\\"><path d=\\"M 86995 -34925 A 2540 2540 0 0 1 84455 -32385 L 55245 -32385 A 2540 2540 0 0 1 52705 -34925 L 52705 -68580 A 2540 2540 0 0 1 55245 -71120 L 84455 -71120 A 2540 2540 0 0 1 86995 -68580 L 86995 -34925\\" fill=\\"none\\" stroke-width=\\"100\\"/></g></svg>"]]');ht(); diff --git a/dist/index.html b/dist/index.html new file mode 100644 index 0000000000000000000000000000000000000000..70cca1596f4a6825a5003b174515ed2545ebb6e9 --- /dev/null +++ b/dist/index.html @@ -0,0 +1,83 @@ +<!-- Quentin Bolsee and Jake Read, MIT Center for Bits and Atoms, 2023 --> +<!DOCTYPE html> +<html> +<head> + <link rel="icon" type="image/x-icon" href="/assets/logo-a252ba3f.png"> + + <meta charset="utf-8"> + <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> + <meta http-equiv="Pragma" content="no-cache" /> + <meta http-equiv="Expires" content="-1" /> + <script type="module" crossorigin src="/assets/main-e1885530.js"></script> + <link rel="stylesheet" href="/assets/index-c5b4e48b.css"> +</head> +<body style="background-color: rgb(255, 255, 255);"> + <h1>gerber2png</h1> + <div id="dropZone"><p id="dropText">↑</p></div> + <input type="file" id="fileInput" multiple hidden></input> + <canvas id="canvas" hidden></canvas> + <div class="container"> + <div class="panel"> + <h2>Viewer</h2> + <div class="preview"> + <svg id="previewSVG"></svg> + </div> + <div> + <!-- <button class="interface" id="loadButton">Load file(s)...</button></input> --> + <button class="interface" id="downloadRenderButton">Download render</button> + <button class="interface" id="downloadlayersButton">Download layers</button> + </div> + </div> + <div class="panel"> + <h2>Settings</h2> + <div class="settings"> + <h3>Rendering</h3> + + <div> + <input type="checkbox" id="settingsFill" checked=checked> + <label for="settingsFill">Fill edge cut</label> + </div> + + <div> + <input type="checkbox" id="settingsAsSVG" checked=unchecked> + <label for="settingsAsSVG">Download as SVG</label> + </div> + + <h3>Resolution [DPI]</h3> + + <div> + <input id="settingsDPI" step=1 min=1 type="number" value="1000"> + </div> + + <h3>Origin [mm]</h3> + <div> + <label for="settingsOrigX">x:</label> + <input id="settingsOrigX" step=0.1 type="number"> + <label for="settingsOrigY">y:</label> + <input id="settingsOrigY" step=0.1 type="number"> + <button class="lock" id="settingsLockOrig">🔓</button> + </div> + + <h3>Dimensions [mm]</h3> + <div> + <label for="settingsDimX">x:</label> + <input id="settingsDimX" step=0.1 type="number"> + <label for="settingsDimY">y:</label> + <input id="settingsDimY" step=0.1 type="number"> + <button class="lock" id="settingsLockDim">🔓</button> + </div> + + <h3>Margins [mm]</h3> + <div> + <label for="settingsMarginX">x:</label> + <input id="settingsMarginX" step=0.1 min=0 type="number" value=3> + <label for="settingsMarginY">y:</label> + <input id="settingsMarginY" step=0.1 min=0 type="number" value=3> + </div> + </div> + </div> + </div> + + +</body> +</html>