barcode-detector 3.0.6 → 3.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/ponyfill.js +1 -1
- package/dist/es/ponyfill.js +1223 -1272
- package/dist/iife/index.js +1 -1
- package/dist/iife/polyfill.js +1 -1
- package/dist/iife/ponyfill.js +1 -1
- package/package.json +15 -14
package/README.md
CHANGED
|
@@ -168,7 +168,7 @@ For legacy browsers or userscripts that lack support for `<script type="module">
|
|
|
168
168
|
|
|
169
169
|
The core barcode reading functionality of this package is powered by [`zxing-wasm`](https://github.com/Sec-ant/zxing-wasm). Therefore, a `.wasm` binary file is fetched at runtime. By default, the `.wasm` serving path is initialized with a jsDelivr CDN URL. However, there're cases where this is not desired, such as the allowed serving path is white-listed by the Content Security Policy (CSP), or offline usage is required.
|
|
170
170
|
|
|
171
|
-
To customize the `.wasm` serving path, this package reexports `prepareZXingModule` along with `ZXING_WASM_VERSION` and `
|
|
171
|
+
To customize the `.wasm` serving path, this package reexports `prepareZXingModule` along with `ZXING_WASM_VERSION`, `ZXING_WASM_SHA256` and `ZXING_CPP_COMMIT` from `zxing-wasm`. For more details on how to use them, please check [Configuring `.wasm` Serving](https://github.com/Sec-ant/zxing-wasm?tab=readme-ov-file#configuring-wasm-serving) and [Controlling `.wasm` Instantiation Timing and Caching](https://github.com/Sec-ant/zxing-wasm?tab=readme-ov-file#controlling-wasm-instantiation-timing-and-caching) sections in the `zxing-wasm` repository.
|
|
172
172
|
|
|
173
173
|
An example usage to override the `.wasm` serving path with an `unpkg.com` CDN url is as follows:
|
|
174
174
|
|
package/dist/cjs/ponyfill.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Me=o=>{throw TypeError(o)};var Fe=(o,l,h)=>l.has(o)||Me("Cannot "+h);var je=(o,l,h)=>(Fe(o,l,"read from private field"),h?h.call(o):l.get(o)),Re=(o,l,h)=>l.has(o)?Me("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(o):l.set(o,h),Le=(o,l,h,f)=>(Fe(o,l,"write to private field"),f?f.call(o,h):l.set(o,h),h);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ft=[["Aztec","M"],["Codabar","L"],["Code39","L"],["Code93","L"],["Code128","L"],["DataBar","L"],["DataBarExpanded","L"],["DataMatrix","M"],["EAN-8","L"],["EAN-13","L"],["ITF","L"],["MaxiCode","M"],["PDF417","M"],["QRCode","M"],["UPC-A","L"],["UPC-E","L"],["MicroQRCode","M"],["rMQRCode","M"],["DXFilmEdge","L"],["DataBarLimited","L"]],jt=Ft.map(([o])=>o),Ba=jt.filter((o,l)=>Ft[l][1]==="L"),Wa=jt.filter((o,l)=>Ft[l][1]==="M");function Qt(o){switch(o){case"Linear-Codes":return Ba.reduce((l,h)=>l|Qt(h),0);case"Matrix-Codes":return Wa.reduce((l,h)=>l|Qt(h),0);case"Any":return(1<<Ft.length)-1;case"None":return 0;default:return 1<<jt.indexOf(o)}}function Ua(o){if(o===0)return"None";const l=31-Math.clz32(o);return jt[l]}function Va(o){return o.reduce((l,h)=>l|Qt(h),0)}const ka=["LocalAverage","GlobalHistogram","FixedThreshold","BoolCast"];function Ha(o){return ka.indexOf(o)}const Be=["Unknown","ASCII","ISO8859_1","ISO8859_2","ISO8859_3","ISO8859_4","ISO8859_5","ISO8859_6","ISO8859_7","ISO8859_8","ISO8859_9","ISO8859_10","ISO8859_11","ISO8859_13","ISO8859_14","ISO8859_15","ISO8859_16","Cp437","Cp1250","Cp1251","Cp1252","Cp1256","Shift_JIS","Big5","GB2312","GB18030","EUC_JP","EUC_KR","UTF16BE","UTF16BE","UTF8","UTF16LE","UTF32BE","UTF32LE","BINARY"];function Na(o){return o==="UnicodeBig"?Be.indexOf("UTF16BE"):Be.indexOf(o)}const za=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function Ga(o){return za[o]}const Xa=["Ignore","Read","Require"];function qa(o){return Xa.indexOf(o)}const Ya=["Plain","ECI","HRI","Hex","Escaped"];function Za(o){return Ya.indexOf(o)}const Mt={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,tryDenoise:!1,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,tryCode39ExtendedMode:!0,returnErrors:!1,eanAddOnSymbol:"Ignore",textMode:"HRI",characterSet:"Unknown"};function We(o){return{...o,formats:Va(o.formats),binarizer:Ha(o.binarizer),eanAddOnSymbol:qa(o.eanAddOnSymbol),textMode:Za(o.textMode),characterSet:Na(o.characterSet)}}function Qa(o){return{...o,format:Ua(o.format),contentType:Ga(o.contentType),eccLevel:o.ecLevel}}const Ja="2.2.2",Ka="c0a7c6cd2165457c721c58045edd22ffee9624e9",to={locateFile:(o,l)=>{const h=o.match(/_(.+?)\.wasm$/);return h?`https://fastly.jsdelivr.net/npm/zxing-wasm@2.2.2/dist/${h[1]}/${o}`:l+o}},It=new WeakMap;function eo(o,l){return Object.is(o,l)||Object.keys(o).length===Object.keys(l).length&&Object.keys(o).every(h=>Object.hasOwn(l,h)&&o[h]===l[h])}function Ve(o,{overrides:l,equalityFn:h=eo,fireImmediately:f=!1}={}){var C;const[O,I]=(C=It.get(o))!=null?C:[to],j=l!=null?l:O;let A;if(f){if(I&&(A=h(O,j)))return I;const M=o({...j});return It.set(o,[j,M]),M}(A!=null?A:h(O,j))||It.set(o,[j])}function ro(o){It.delete(o)}async function no(o,l,h=Mt){const f={...Mt,...h},C=await Ve(o,{fireImmediately:!0});let O,I;if("width"in l&&"height"in l&&"data"in l){const{data:A,data:{byteLength:M},width:z,height:X}=l;I=C._malloc(M),C.HEAPU8.set(A,I),O=C.readBarcodesFromPixmap(I,z,X,We(f))}else{let A,M;if("buffer"in l)[A,M]=[l.byteLength,l];else if("byteLength"in l)[A,M]=[l.byteLength,new Uint8Array(l)];else if("size"in l)[A,M]=[l.size,new Uint8Array(await l.arrayBuffer())];else throw new TypeError("Invalid input type");I=C._malloc(A),C.HEAPU8.set(M,I),O=C.readBarcodesFromImage(I,A,We(f))}C._free(I);const j=[];for(let A=0;A<O.size();++A)j.push(Qa(O.get(A)));return j}({...Mt,formats:[...Mt.formats]});var Kt=async function(o={}){var l,h,f=o,C,O,I=new Promise((e,t)=>{C=e,O=t}),j=typeof window=="object",A=typeof Bun<"u",M=typeof WorkerGlobalScope<"u";typeof process=="object"&&!((h=process.versions)===null||h===void 0)&&h.node&&process.type!="renderer";var z="./this.program",X,q="";function it(e){return f.locateFile?f.locateFile(e,q):q+e}var st,et;if(j||M||A){try{q=new URL(".",X).href}catch{}M&&(et=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),st=async e=>{var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw new Error(t.status+" : "+t.url)}}var vt=console.log.bind(console),G=console.error.bind(console),ut,yt,ee=!1,Y,B,mt,rt,nt,P,re,ne;function ae(){var e=yt.buffer;Y=new Int8Array(e),mt=new Int16Array(e),f.HEAPU8=B=new Uint8Array(e),rt=new Uint16Array(e),nt=new Int32Array(e),P=new Uint32Array(e),re=new Float32Array(e),ne=new Float64Array(e)}function Qe(){if(f.preRun)for(typeof f.preRun=="function"&&(f.preRun=[f.preRun]);f.preRun.length;)lr(f.preRun.shift());oe(se)}function Je(){_.ya()}function Ke(){if(f.postRun)for(typeof f.postRun=="function"&&(f.postRun=[f.postRun]);f.postRun.length;)cr(f.postRun.shift());oe(ie)}var Z=0,ct=null;function tr(e){var t;Z++,(t=f.monitorRunDependencies)===null||t===void 0||t.call(f,Z)}function er(e){var t;if(Z--,(t=f.monitorRunDependencies)===null||t===void 0||t.call(f,Z),Z==0&&ct){var r=ct;ct=null,r()}}function Rt(e){var t;(t=f.onAbort)===null||t===void 0||t.call(f,e),e="Aborted("+e+")",G(e),ee=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw O(r),r}var gt;function rr(){return it("zxing_reader.wasm")}function nr(e){if(e==gt&&ut)return new Uint8Array(ut);if(et)return et(e);throw"both async and sync fetching of the wasm failed"}async function ar(e){if(!ut)try{var t=await st(e);return new Uint8Array(t)}catch{}return nr(e)}async function or(e,t){try{var r=await ar(e),n=await WebAssembly.instantiate(r,t);return n}catch(a){G(`failed to asynchronously prepare wasm: ${a}`),Rt(a)}}async function ir(e,t,r){if(!e&&typeof WebAssembly.instantiateStreaming=="function")try{var n=fetch(t,{credentials:"same-origin"}),a=await WebAssembly.instantiateStreaming(n,r);return a}catch(i){G(`wasm streaming compile failed: ${i}`),G("falling back to ArrayBuffer instantiation")}return or(t,r)}function sr(){return{a:Nn}}async function ur(){function e(i,u){return _=i.exports,yt=_.xa,ae(),me=_.Ba,er(),_}tr();function t(i){return e(i.instance)}var r=sr();if(f.instantiateWasm)return new Promise((i,u)=>{f.instantiateWasm(r,(s,c)=>{i(e(s))})});gt!=null||(gt=rr());try{var n=await ir(ut,gt,r),a=t(n);return a}catch(i){return O(i),Promise.reject(i)}}var oe=e=>{for(;e.length>0;)e.shift()(f)},ie=[],cr=e=>ie.push(e),se=[],lr=e=>se.push(e),m=e=>qn(e),g=()=>Yn(),wt=[],$t=0,fr=e=>{var t=new Lt(e);return t.get_caught()||(t.set_caught(!0),$t--),t.set_rethrown(!1),wt.push(t),Qn(e),Gn(e)},V=0,dr=()=>{y(0,0);var e=wt.pop();Zn(e.excPtr),V=0};class Lt{constructor(t){this.excPtr=t,this.ptr=t-24}set_type(t){P[this.ptr+4>>2]=t}get_type(){return P[this.ptr+4>>2]}set_destructor(t){P[this.ptr+8>>2]=t}get_destructor(){return P[this.ptr+8>>2]}set_caught(t){t=t?1:0,Y[this.ptr+12]=t}get_caught(){return Y[this.ptr+12]!=0}set_rethrown(t){t=t?1:0,Y[this.ptr+13]=t}get_rethrown(){return Y[this.ptr+13]!=0}init(t,r){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(r)}set_adjusted_ptr(t){P[this.ptr+16>>2]=t}get_adjusted_ptr(){return P[this.ptr+16>>2]}}var bt=e=>Xn(e),Bt=e=>{var t=V;if(!t)return bt(0),0;var r=new Lt(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return bt(0),t;for(var a of e){if(a===0||a===n)break;var i=r.ptr+16;if(Jn(a,n,i))return bt(a),t}return bt(n),t},hr=()=>Bt([]),pr=e=>Bt([e]),vr=(e,t)=>Bt([e,t]),yr=()=>{var e=wt.pop();e||Rt("no exception to throw");var t=e.excPtr;throw e.get_rethrown()||(wt.push(e),e.set_rethrown(!0),e.set_caught(!1),$t++),V=t,V},mr=(e,t,r)=>{var n=new Lt(e);throw n.init(t,r),V=e,$t++,V},gr=()=>$t,wr=e=>{throw V||(V=e),V},$r=()=>Rt(""),Ct={},Wt=e=>{for(;e.length;){var t=e.pop(),r=e.pop();r(t)}};function lt(e){return this.fromWireType(P[e>>2])}var at={},Q={},Tt={},br=class extends Error{constructor(e){super(e),this.name="InternalError"}},Pt=e=>{throw new br(e)},J=(e,t,r)=>{e.forEach(s=>Tt[s]=t);function n(s){var c=r(s);c.length!==e.length&&Pt("Mismatched type converter count");for(var d=0;d<e.length;++d)U(e[d],c[d])}var a=new Array(t.length),i=[],u=0;t.forEach((s,c)=>{Q.hasOwnProperty(s)?a[c]=Q[s]:(i.push(s),at.hasOwnProperty(s)||(at[s]=[]),at[s].push(()=>{a[c]=Q[s],++u,u===i.length&&n(a)}))}),i.length===0&&n(a)},Cr=e=>{var t=Ct[e];delete Ct[e];var r=t.rawConstructor,n=t.rawDestructor,a=t.fields,i=a.map(u=>u.getterReturnType).concat(a.map(u=>u.setterArgumentType));J([e],i,u=>{var s={};return a.forEach((c,d)=>{var p=c.fieldName,v=u[d],$=u[d].optional,b=c.getter,E=c.getterContext,S=u[d+a.length],x=c.setter,D=c.setterContext;s[p]={read:N=>v.fromWireType(b(E,N)),write:(N,R)=>{var L=[];x(D,N,S.toWireType(L,R)),Wt(L)},optional:$}}),[{name:t.name,fromWireType:c=>{var d={};for(var p in s)d[p]=s[p].read(c);return n(c),d},toWireType:(c,d)=>{for(var p in s)if(!(p in d)&&!s[p].optional)throw new TypeError(`Missing field: "${p}"`);var v=r();for(p in s)s[p].write(v,d[p]);return c!==null&&c.push(n,v),v},argPackAdvance:k,readValueFromPointer:lt,destructorFunction:n}]})},Tr=(e,t,r,n,a)=>{},Pr=()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);ue=e},ue,F=e=>{for(var t="",r=e;B[r];)t+=ue[B[r++]];return t},ft=class extends Error{constructor(e){super(e),this.name="BindingError"}},T=e=>{throw new ft(e)};function _r(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=t.name;if(e||T(`type "${n}" must have a positive integer typeid pointer`),Q.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;T(`Cannot register type '${n}' twice`)}if(Q[e]=t,delete Tt[e],at.hasOwnProperty(e)){var a=at[e];delete at[e],a.forEach(i=>i())}}function U(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return _r(e,t,r)}var k=8,Er=(e,t,r,n)=>{t=F(t),U(e,{name:t,fromWireType:function(a){return!!a},toWireType:function(a,i){return i?r:n},argPackAdvance:k,readValueFromPointer:function(a){return this.fromWireType(B[a])},destructorFunction:null})},Or=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Ut=e=>{function t(r){return r.$$.ptrType.registeredClass.name}T(t(e)+" instance already deleted")},Vt=!1,ce=e=>{},Ar=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},le=e=>{e.count.value-=1;var t=e.count.value===0;t&&Ar(e)},dt=e=>typeof FinalizationRegistry>"u"?(dt=t=>t,e):(Vt=new FinalizationRegistry(t=>{le(t.$$)}),dt=t=>{var r=t.$$,n=!!r.smartPtr;if(n){var a={$$:r};Vt.register(t,a,t)}return t},ce=t=>Vt.unregister(t),dt(e)),xr=()=>{let e=_t.prototype;Object.assign(e,{isAliasOf(r){if(!(this instanceof _t)||!(r instanceof _t))return!1;var n=this.$$.ptrType.registeredClass,a=this.$$.ptr;r.$$=r.$$;for(var i=r.$$.ptrType.registeredClass,u=r.$$.ptr;n.baseClass;)a=n.upcast(a),n=n.baseClass;for(;i.baseClass;)u=i.upcast(u),i=i.baseClass;return n===i&&a===u},clone(){if(this.$$.ptr||Ut(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var r=dt(Object.create(Object.getPrototypeOf(this),{$$:{value:Or(this.$$)}}));return r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},delete(){this.$$.ptr||Ut(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&T("Object already scheduled for deletion"),ce(this),le(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Ut(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&T("Object already scheduled for deletion"),this.$$.deleteScheduled=!0,this}});const t=Symbol.dispose;t&&(e[t]=e.delete)};function _t(){}var kt=(e,t)=>Object.defineProperty(t,"name",{value:e}),fe={},de=(e,t,r)=>{if(e[t].overloadTable===void 0){var n=e[t];e[t]=function(){for(var a=arguments.length,i=new Array(a),u=0;u<a;u++)i[u]=arguments[u];return e[t].overloadTable.hasOwnProperty(i.length)||T(`Function '${r}' called with an invalid number of arguments (${i.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[i.length].apply(this,i)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},he=(e,t,r)=>{f.hasOwnProperty(e)?((r===void 0||f[e].overloadTable!==void 0&&f[e].overloadTable[r]!==void 0)&&T(`Cannot register public name '${e}' twice`),de(f,e,e),f[e].overloadTable.hasOwnProperty(r)&&T(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),f[e].overloadTable[r]=t):(f[e]=t,f[e].argCount=r)},Sr=48,Dr=57,Ir=e=>{e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return t>=Sr&&t<=Dr?`_${e}`:e};function Mr(e,t,r,n,a,i,u,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=i,this.upcast=u,this.downcast=s,this.pureVirtualFunctions=[]}var Ht=(e,t,r)=>{for(;t!==r;)t.upcast||T(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e},Nt=e=>{if(e===null)return"null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e};function Fr(e,t){if(t===null)return this.isReference&&T(`null is not a valid ${this.name}`),0;t.$$||T(`Cannot pass "${Nt(t)}" as a ${this.name}`),t.$$.ptr||T(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass,n=Ht(t.$$.ptr,r,this.registeredClass);return n}function jr(e,t){var r;if(t===null)return this.isReference&&T(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,r),r):0;(!t||!t.$$)&&T(`Cannot pass "${Nt(t)}" as a ${this.name}`),t.$$.ptr||T(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&T(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;if(r=Ht(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(t.$$.smartPtr===void 0&&T("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:T(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var a=t.clone();r=this.rawShare(r,H.toHandle(()=>a.delete())),e!==null&&e.push(this.rawDestructor,r)}break;default:T("Unsupporting sharing policy")}return r}function Rr(e,t){if(t===null)return this.isReference&&T(`null is not a valid ${this.name}`),0;t.$$||T(`Cannot pass "${Nt(t)}" as a ${this.name}`),t.$$.ptr||T(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&T(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass,n=Ht(t.$$.ptr,r,this.registeredClass);return n}var pe=(e,t,r)=>{if(t===r)return e;if(r.baseClass===void 0)return null;var n=pe(e,t,r.baseClass);return n===null?null:r.downcast(n)},Lr={},Br=(e,t)=>{for(t===void 0&&T("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t},Wr=(e,t)=>(t=Br(e,t),Lr[t]),Et=(e,t)=>{(!t.ptrType||!t.ptr)&&Pt("makeClassHandle requires ptr and ptrType");var r=!!t.smartPtrType,n=!!t.smartPtr;return r!==n&&Pt("Both smartPtrType and smartPtr must be specified"),t.count={value:1},dt(Object.create(e,{$$:{value:t,writable:!0}}))};function Ur(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=Wr(this.registeredClass,t);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function a(){return this.isSmartPointer?Et(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Et(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i=this.registeredClass.getActualType(t),u=fe[i];if(!u)return a.call(this);var s;this.isConst?s=u.constPointerType:s=u.pointerType;var c=pe(t,this.registeredClass,s.registeredClass);return c===null?a.call(this):this.isSmartPointer?Et(s.registeredClass.instancePrototype,{ptrType:s,ptr:c,smartPtrType:this,smartPtr:e}):Et(s.registeredClass.instancePrototype,{ptrType:s,ptr:c})}var Vr=()=>{Object.assign(Ot.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){var t;(t=this.rawDestructor)===null||t===void 0||t.call(this,e)},argPackAdvance:k,readValueFromPointer:lt,fromWireType:Ur})};function Ot(e,t,r,n,a,i,u,s,c,d,p){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=i,this.sharingPolicy=u,this.rawGetPointee=s,this.rawConstructor=c,this.rawShare=d,this.rawDestructor=p,!a&&t.baseClass===void 0?n?(this.toWireType=Fr,this.destructorFunction=null):(this.toWireType=Rr,this.destructorFunction=null):this.toWireType=jr}var ve=(e,t,r)=>{f.hasOwnProperty(e)||Pt("Replacing nonexistent public symbol"),f[e].overloadTable!==void 0&&r!==void 0?f[e].overloadTable[r]=t:(f[e]=t,f[e].argCount=r)},ye=[],me,w=e=>{var t=ye[e];return t||(ye[e]=t=me.get(e)),t},kr=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.includes("j"))return dynCallLegacy(e,t,r);var n=w(t),a=n(...r);return a},Hr=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return function(){for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return kr(e,t,a,r)}},W=function(e,t){e=F(e);function r(){if(e.includes("j"))return Hr(e,t);var a=w(t);return a}var n=r();return typeof n!="function"&&T(`unknown function pointer with signature ${e}: ${t}`),n};class Nr extends Error{}var ge=e=>{var t=zn(e),r=F(t);return tt(t),r},At=(e,t)=>{var r=[],n={};function a(i){if(!n[i]&&!Q[i]){if(Tt[i]){Tt[i].forEach(a);return}r.push(i),n[i]=!0}}throw t.forEach(a),new Nr(`${e}: `+r.map(ge).join([", "]))},zr=(e,t,r,n,a,i,u,s,c,d,p,v,$)=>{p=F(p),i=W(a,i),s&&(s=W(u,s)),d&&(d=W(c,d)),$=W(v,$);var b=Ir(p);he(b,function(){At(`Cannot construct ${p} due to unbound types`,[n])}),J([e,t,r],n?[n]:[],E=>{E=E[0];var S,x;n?(S=E.registeredClass,x=S.instancePrototype):x=_t.prototype;var D=kt(p,function(){if(Object.getPrototypeOf(this)!==N)throw new ft(`Use 'new' to construct ${p}`);if(R.constructor_body===void 0)throw new ft(`${p} has no accessible constructor`);for(var De=arguments.length,St=new Array(De),Dt=0;Dt<De;Dt++)St[Dt]=arguments[Dt];var Ie=R.constructor_body[St.length];if(Ie===void 0)throw new ft(`Tried to invoke ctor of ${p} with invalid number of parameters (${St.length}) - expected (${Object.keys(R.constructor_body).toString()}) parameters instead!`);return Ie.apply(this,St)}),N=Object.create(x,{constructor:{value:D}});D.prototype=N;var R=new Mr(p,D,N,$,S,i,s,d);if(R.baseClass){var L,xt;(xt=(L=R.baseClass).__derivedClasses)!==null&&xt!==void 0||(L.__derivedClasses=[]),R.baseClass.__derivedClasses.push(R)}var La=new Ot(p,R,!0,!1,!1),xe=new Ot(p+"*",R,!1,!1,!1),Se=new Ot(p+" const*",R,!1,!0,!1);return fe[e]={pointerType:xe,constPointerType:Se},ve(b,D),[La,xe,Se]})},zt=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(P[t+n*4>>2]);return r};function Gr(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].destructorFunction===void 0)return!0;return!1}function Gt(e,t,r,n,a,i){var u=t.length;u<2&&T("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=t[1]!==null&&r!==null,c=Gr(t),d=t[0].name!=="void",p=u-2,v=new Array(p),$=[],b=[],E=function(){b.length=0;var S;$.length=s?2:1,$[0]=a,s&&(S=t[1].toWireType(b,this),$[1]=S);for(var x=0;x<p;++x)v[x]=t[x+2].toWireType(b,x<0||arguments.length<=x?void 0:arguments[x]),$.push(v[x]);var D=n(...$);function N(R){if(c)Wt(b);else for(var L=s?1:2;L<t.length;L++){var xt=L===1?S:v[L-2];t[L].destructorFunction!==null&&t[L].destructorFunction(xt)}if(d)return t[0].fromWireType(R)}return N(D)};return kt(e,E)}var Xr=(e,t,r,n,a,i)=>{var u=zt(t,r);a=W(n,a),J([],[e],s=>{s=s[0];var c=`constructor ${s.name}`;if(s.registeredClass.constructor_body===void 0&&(s.registeredClass.constructor_body=[]),s.registeredClass.constructor_body[t-1]!==void 0)throw new ft(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${s.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return s.registeredClass.constructor_body[t-1]=()=>{At(`Cannot construct ${s.name} due to unbound types`,u)},J([],u,d=>(d.splice(1,0,null),s.registeredClass.constructor_body[t-1]=Gt(c,d,null,a,i),[])),[]})},we=e=>{e=e.trim();const t=e.indexOf("(");return t===-1?e:e.slice(0,t)},qr=(e,t,r,n,a,i,u,s,c,d)=>{var p=zt(r,n);t=F(t),t=we(t),i=W(a,i),J([],[e],v=>{v=v[0];var $=`${v.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&v.registeredClass.pureVirtualFunctions.push(t);function b(){At(`Cannot call ${$} due to unbound types`,p)}var E=v.registeredClass.instancePrototype,S=E[t];return S===void 0||S.overloadTable===void 0&&S.className!==v.name&&S.argCount===r-2?(b.argCount=r-2,b.className=v.name,E[t]=b):(de(E,t,$),E[t].overloadTable[r-2]=b),J([],p,x=>{var D=Gt($,x,v,i,u);return E[t].overloadTable===void 0?(D.argCount=r-2,E[t]=D):E[t].overloadTable[r-2]=D,[]}),[]})},$e=[],K=[0,1,,1,null,1,!0,1,!1,1],Xt=e=>{e>9&&--K[e+1]===0&&(K[e]=void 0,$e.push(e))},H={toValue:e=>(e||T(`Cannot use deleted val. handle = ${e}`),K[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const t=$e.pop()||K.length;return K[t]=e,K[t+1]=1,t}}}},be={name:"emscripten::val",fromWireType:e=>{var t=H.toValue(e);return Xt(e),t},toWireType:(e,t)=>H.toHandle(t),argPackAdvance:k,readValueFromPointer:lt,destructorFunction:null},Yr=e=>U(e,be),Zr=(e,t)=>{switch(t){case 4:return function(r){return this.fromWireType(re[r>>2])};case 8:return function(r){return this.fromWireType(ne[r>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Qr=(e,t,r)=>{t=F(t),U(e,{name:t,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:k,readValueFromPointer:Zr(t,r),destructorFunction:null})},Jr=(e,t,r,n,a,i,u,s)=>{var c=zt(t,r);e=F(e),e=we(e),a=W(n,a),he(e,function(){At(`Cannot call ${e} due to unbound types`,c)},t-1),J([],c,d=>{var p=[d[0],null].concat(d.slice(1));return ve(e,Gt(e,p,null,a,i),t-1),[]})},Kr=(e,t,r)=>{switch(t){case 1:return r?n=>Y[n]:n=>B[n];case 2:return r?n=>mt[n>>1]:n=>rt[n>>1];case 4:return r?n=>nt[n>>2]:n=>P[n>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},tn=(e,t,r,n,a)=>{t=F(t);const i=n===0;let u=c=>c;if(i){var s=32-8*r;u=c=>c<<s>>>s,a=u(a)}U(e,{name:t,fromWireType:u,toWireType:(c,d)=>d,argPackAdvance:k,readValueFromPointer:Kr(t,r,n!==0),destructorFunction:null})},en=(e,t,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[t];function i(u){var s=P[u>>2],c=P[u+4>>2];return new a(Y.buffer,c,s)}r=F(r),U(e,{name:r,fromWireType:i,argPackAdvance:k,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},rn=Object.assign({optional:!0},be),nn=(e,t)=>{U(e,rn)},an=(e,t,r,n)=>{if(!(n>0))return 0;for(var a=r,i=r+n-1,u=0;u<e.length;++u){var s=e.charCodeAt(u);if(s>=55296&&s<=57343){var c=e.charCodeAt(++u);s=65536+((s&1023)<<10)|c&1023}if(s<=127){if(r>=i)break;t[r++]=s}else if(s<=2047){if(r+1>=i)break;t[r++]=192|s>>6,t[r++]=128|s&63}else if(s<=65535){if(r+2>=i)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|s&63}else{if(r+3>=i)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|s&63}}return t[r]=0,r-a},ot=(e,t,r)=>an(e,B,t,r),Ce=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t},Te=typeof TextDecoder<"u"?new TextDecoder:void 0,Pe=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN;for(var n=t+r,a=t;e[a]&&!(a>=n);)++a;if(a-t>16&&e.buffer&&Te)return Te.decode(e.subarray(t,a));for(var i="";t<a;){var u=e[t++];if(!(u&128)){i+=String.fromCharCode(u);continue}var s=e[t++]&63;if((u&224)==192){i+=String.fromCharCode((u&31)<<6|s);continue}var c=e[t++]&63;if((u&240)==224?u=(u&15)<<12|s<<6|c:u=(u&7)<<18|s<<12|c<<6|e[t++]&63,u<65536)i+=String.fromCharCode(u);else{var d=u-65536;i+=String.fromCharCode(55296|d>>10,56320|d&1023)}}return i},on=(e,t)=>e?Pe(B,e,t):"",sn=(e,t)=>{t=F(t),U(e,{name:t,fromWireType(r){for(var n=P[r>>2],a=r+4,i,s,u=a,s=0;s<=n;++s){var c=a+s;if(s==n||B[c]==0){var d=c-u,p=on(u,d);i===void 0?i=p:(i+="\0",i+=p),u=c+1}}return tt(r),i},toWireType(r,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var a,i=typeof n=="string";i||ArrayBuffer.isView(n)&&n.BYTES_PER_ELEMENT==1||T("Cannot pass non-string to std::string"),i?a=Ce(n):a=n.length;var u=Ae(4+a+1),s=u+4;return P[u>>2]=a,i?ot(n,s,a+1):B.set(n,s),r!==null&&r.push(tt,u),u},argPackAdvance:k,readValueFromPointer:lt,destructorFunction(r){tt(r)}})},_e=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,un=(e,t)=>{for(var r=e>>1,n=r+t/2,a=r;!(a>=n)&&rt[a];)++a;if(a-r>16&&_e)return _e.decode(rt.subarray(r,a));for(var i="",u=r;!(u>=n);++u){var s=rt[u];if(s==0)break;i+=String.fromCharCode(s)}return i},cn=(e,t,r)=>{if(r!=null||(r=2147483647),r<2)return 0;r-=2;for(var n=t,a=r<e.length*2?r/2:e.length,i=0;i<a;++i){var u=e.charCodeAt(i);mt[t>>1]=u,t+=2}return mt[t>>1]=0,t-n},ln=e=>e.length*2,fn=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var a=nt[e+r*4>>2];if(a==0)break;if(++r,a>=65536){var i=a-65536;n+=String.fromCharCode(55296|i>>10,56320|i&1023)}else n+=String.fromCharCode(a)}return n},dn=(e,t,r)=>{if(r!=null||(r=2147483647),r<4)return 0;for(var n=t,a=n+r-4,i=0;i<e.length;++i){var u=e.charCodeAt(i);if(u>=55296&&u<=57343){var s=e.charCodeAt(++i);u=65536+((u&1023)<<10)|s&1023}if(nt[t>>2]=u,t+=4,t+4>a)break}return nt[t>>2]=0,t-n},hn=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t},pn=(e,t,r)=>{r=F(r);var n,a,i,u;t===2?(n=un,a=cn,u=ln,i=s=>rt[s>>1]):t===4&&(n=fn,a=dn,u=hn,i=s=>P[s>>2]),U(e,{name:r,fromWireType:s=>{for(var c=P[s>>2],d,p=s+4,v=0;v<=c;++v){var $=s+4+v*t;if(v==c||i($)==0){var b=$-p,E=n(p,b);d===void 0?d=E:(d+="\0",d+=E),p=$+t}}return tt(s),d},toWireType:(s,c)=>{typeof c!="string"&&T(`Cannot pass non-string to C++ string type ${r}`);var d=u(c),p=Ae(4+d+t);return P[p>>2]=d/t,a(c,p+4,d+t),s!==null&&s.push(tt,p),p},argPackAdvance:k,readValueFromPointer:lt,destructorFunction(s){tt(s)}})},vn=(e,t,r,n,a,i)=>{Ct[e]={name:F(t),rawConstructor:W(r,n),rawDestructor:W(a,i),fields:[]}},yn=(e,t,r,n,a,i,u,s,c,d)=>{Ct[e].fields.push({fieldName:F(t),getterReturnType:r,getter:W(n,a),getterContext:i,setterArgumentType:u,setter:W(s,c),setterContext:d})},mn=(e,t)=>{t=F(t),U(e,{isVoid:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})},qt=[],gn=(e,t,r,n)=>(e=qt[e],t=H.toValue(t),e(null,t,r,n)),wn={},$n=e=>{var t=wn[e];return t===void 0?F(e):t},Ee=()=>{if(typeof globalThis=="object")return globalThis;function e(t){t.$$$embind_global$$$=t;var r=typeof $$$embind_global$$$=="object"&&t.$$$embind_global$$$==t;return r||delete t.$$$embind_global$$$,r}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&e(global)?$$$embind_global$$$=global:typeof self=="object"&&e(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},bn=e=>e===0?H.toHandle(Ee()):(e=$n(e),H.toHandle(Ee()[e])),Cn=e=>{var t=qt.length;return qt.push(e),t},Oe=(e,t)=>{var r=Q[e];return r===void 0&&T(`${t} has unknown type ${ge(e)}`),r},Tn=(e,t)=>{for(var r=new Array(e),n=0;n<e;++n)r[n]=Oe(P[t+n*4>>2],`parameter ${n}`);return r},Pn=(e,t,r)=>{var n=[],a=e.toWireType(n,r);return n.length&&(P[t>>2]=H.toHandle(n)),a},_n=Reflect.construct,En=(e,t,r)=>{var n=Tn(e,t),a=n.shift();e--;var i=new Array(e),u=(c,d,p,v)=>{for(var $=0,b=0;b<e;++b)i[b]=n[b].readValueFromPointer(v+$),$+=n[b].argPackAdvance;var E=r===1?_n(d,i):d.apply(c,i);return Pn(a,p,E)},s=`methodCaller<(${n.map(c=>c.name).join(", ")}) => ${a.name}>`;return Cn(kt(s,u))},On=e=>{e>9&&(K[e+1]+=1)},An=e=>{var t=H.toValue(e);Wt(t),Xt(e)},xn=(e,t)=>{e=Oe(e,"_emval_take_value");var r=e.readValueFromPointer(t);return H.toHandle(r)},Sn=(e,t,r,n)=>{var a=new Date().getFullYear(),i=new Date(a,0,1),u=new Date(a,6,1),s=i.getTimezoneOffset(),c=u.getTimezoneOffset(),d=Math.max(s,c);P[e>>2]=d*60,nt[t>>2]=+(s!=c);var p=b=>{var E=b>=0?"-":"+",S=Math.abs(b),x=String(Math.floor(S/60)).padStart(2,"0"),D=String(S%60).padStart(2,"0");return`UTC${E}${x}${D}`},v=p(s),$=p(c);c<s?(ot(v,r,17),ot($,n,17)):(ot(v,n,17),ot($,r,17))},Dn=()=>2147483648,In=(e,t)=>Math.ceil(e/t)*t,Mn=e=>{var t=yt.buffer,r=(e-t.byteLength+65535)/65536|0;try{return yt.grow(r),ae(),1}catch{}},Fn=e=>{var t=B.length;e>>>=0;var r=Dn();if(e>r)return!1;for(var n=1;n<=4;n*=2){var a=t*(1+.2/n);a=Math.min(a,e+100663296);var i=Math.min(r,In(Math.max(e,a),65536)),u=Mn(i);if(u)return!0}return!1},Yt={},jn=()=>z||"./this.program",ht=()=>{if(!ht.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:jn()};for(var r in Yt)Yt[r]===void 0?delete t[r]:t[r]=Yt[r];var n=[];for(var r in t)n.push(`${r}=${t[r]}`);ht.strings=n}return ht.strings},Rn=(e,t)=>{var r=0,n=0;for(var a of ht()){var i=t+r;P[e+n>>2]=i,r+=ot(a,i,1/0)+1,n+=4}return 0},Ln=(e,t)=>{var r=ht();P[e>>2]=r.length;var n=0;for(var a of r)n+=Ce(a)+1;return P[t>>2]=n,0},Bn=e=>52;function Wn(e,t,r,n,a){return 70}var Un=[null,[],[]],Vn=(e,t)=>{var r=Un[e];t===0||t===10?((e===1?vt:G)(Pe(r)),r.length=0):r.push(t)},kn=(e,t,r,n)=>{for(var a=0,i=0;i<r;i++){var u=P[t>>2],s=P[t+4>>2];t+=8;for(var c=0;c<s;c++)Vn(e,B[u+c]);a+=s}return P[n>>2]=a,0},Hn=e=>e;Pr(),xr(),Vr(),f.noExitRuntime&&f.noExitRuntime,f.print&&(vt=f.print),f.printErr&&(G=f.printErr),f.wasmBinary&&(ut=f.wasmBinary),f.arguments&&f.arguments,f.thisProgram&&(z=f.thisProgram);var Nn={s:fr,w:dr,a:hr,j:pr,m:vr,P:yr,p:mr,ga:gr,d:wr,ba:$r,ua:Cr,aa:Tr,pa:Er,sa:zr,ra:Xr,H:qr,na:Yr,V:Qr,W:Jr,x:tn,t:en,ta:nn,oa:sn,Q:pn,I:vn,va:yn,qa:mn,da:gn,wa:Xt,D:bn,ma:En,X:On,Y:An,U:xn,ca:Sn,ha:Fn,ea:Rn,fa:Ln,ia:Bn,_:Wn,S:kn,K:Pa,C:Ea,M:na,R:Ia,q:$a,b:ia,E:Ta,ka:Aa,c:sa,ja:xa,h:ra,i:fa,r:va,O:Ca,v:ma,F:wa,L:ba,z:Oa,J:Ma,$:Fa,Z:ja,k:ua,f:ea,e:oa,g:aa,N:Da,l:la,la:_a,o:ya,B:da,u:ga,T:pa,A:Sa,n:ca,G:ha,y:Hn},_=await ur();_.ya;var zn=_.za,tt=f._free=_.Aa,Ae=f._malloc=_.Ca,Gn=_.Da,y=_.Ea,Xn=_.Fa,qn=_.Ga,Yn=_.Ha,Zn=_.Ia,Qn=_.Ja,Jn=_.Ka;f.dynCall_viijii=_.La;var Kn=f.dynCall_iiijj=_.Ma;f.dynCall_jiji=_.Na;var ta=f.dynCall_jiiii=_.Oa;f.dynCall_iiiiij=_.Pa,f.dynCall_iiiiijj=_.Qa,f.dynCall_iiiiiijj=_.Ra;function ea(e,t){var r=g();try{w(e)(t)}catch(n){if(m(r),n!==n+0)throw n;y(1,0)}}function ra(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(i){if(m(a),i!==i+0)throw i;y(1,0)}}function na(e,t,r,n,a){var i=g();try{return w(e)(t,r,n,a)}catch(u){if(m(i),u!==u+0)throw u;y(1,0)}}function aa(e,t,r,n){var a=g();try{w(e)(t,r,n)}catch(i){if(m(a),i!==i+0)throw i;y(1,0)}}function oa(e,t,r){var n=g();try{w(e)(t,r)}catch(a){if(m(n),a!==a+0)throw a;y(1,0)}}function ia(e,t){var r=g();try{return w(e)(t)}catch(n){if(m(r),n!==n+0)throw n;y(1,0)}}function sa(e,t,r){var n=g();try{return w(e)(t,r)}catch(a){if(m(n),a!==a+0)throw a;y(1,0)}}function ua(e){var t=g();try{w(e)()}catch(r){if(m(t),r!==r+0)throw r;y(1,0)}}function ca(e,t,r,n,a,i,u,s,c,d,p){var v=g();try{w(e)(t,r,n,a,i,u,s,c,d,p)}catch($){if(m(v),$!==$+0)throw $;y(1,0)}}function la(e,t,r,n,a){var i=g();try{w(e)(t,r,n,a)}catch(u){if(m(i),u!==u+0)throw u;y(1,0)}}function fa(e,t,r,n,a){var i=g();try{return w(e)(t,r,n,a)}catch(u){if(m(i),u!==u+0)throw u;y(1,0)}}function da(e,t,r,n,a,i,u){var s=g();try{w(e)(t,r,n,a,i,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function ha(e,t,r,n,a,i,u,s,c,d,p,v,$,b,E,S){var x=g();try{w(e)(t,r,n,a,i,u,s,c,d,p,v,$,b,E,S)}catch(D){if(m(x),D!==D+0)throw D;y(1,0)}}function pa(e,t,r,n,a,i,u,s,c){var d=g();try{w(e)(t,r,n,a,i,u,s,c)}catch(p){if(m(d),p!==p+0)throw p;y(1,0)}}function va(e,t,r,n,a,i){var u=g();try{return w(e)(t,r,n,a,i)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function ya(e,t,r,n,a,i){var u=g();try{w(e)(t,r,n,a,i)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function ma(e,t,r,n,a,i,u){var s=g();try{return w(e)(t,r,n,a,i,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function ga(e,t,r,n,a,i,u,s){var c=g();try{w(e)(t,r,n,a,i,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function wa(e,t,r,n,a,i,u,s){var c=g();try{return w(e)(t,r,n,a,i,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function $a(e){var t=g();try{return w(e)()}catch(r){if(m(t),r!==r+0)throw r;y(1,0)}}function ba(e,t,r,n,a,i,u,s,c){var d=g();try{return w(e)(t,r,n,a,i,u,s,c)}catch(p){if(m(d),p!==p+0)throw p;y(1,0)}}function Ca(e,t,r,n,a,i,u){var s=g();try{return w(e)(t,r,n,a,i,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function Ta(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(i){if(m(a),i!==i+0)throw i;y(1,0)}}function Pa(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(i){if(m(a),i!==i+0)throw i;y(1,0)}}function _a(e,t,r,n,a,i,u,s){var c=g();try{w(e)(t,r,n,a,i,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function Ea(e,t,r,n,a,i){var u=g();try{return w(e)(t,r,n,a,i)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function Oa(e,t,r,n,a,i,u,s,c,d){var p=g();try{return w(e)(t,r,n,a,i,u,s,c,d)}catch(v){if(m(p),v!==v+0)throw v;y(1,0)}}function Aa(e,t,r){var n=g();try{return w(e)(t,r)}catch(a){if(m(n),a!==a+0)throw a;y(1,0)}}function xa(e,t,r,n,a){var i=g();try{return w(e)(t,r,n,a)}catch(u){if(m(i),u!==u+0)throw u;y(1,0)}}function Sa(e,t,r,n,a,i,u,s,c,d){var p=g();try{w(e)(t,r,n,a,i,u,s,c,d)}catch(v){if(m(p),v!==v+0)throw v;y(1,0)}}function Da(e,t,r,n,a,i,u){var s=g();try{w(e)(t,r,n,a,i,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function Ia(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(i){if(m(a),i!==i+0)throw i;y(1,0)}}function Ma(e,t,r,n,a,i,u,s,c,d,p,v){var $=g();try{return w(e)(t,r,n,a,i,u,s,c,d,p,v)}catch(b){if(m($),b!==b+0)throw b;y(1,0)}}function Fa(e,t,r,n,a,i,u){var s=g();try{return Kn(e,t,r,n,a,i,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function ja(e,t,r,n,a){var i=g();try{return ta(e,t,r,n,a)}catch(u){if(m(i),u!==u+0)throw u;y(1,0)}}function Zt(){if(Z>0){ct=Zt;return}if(Qe(),Z>0){ct=Zt;return}function e(){var t;f.calledRun=!0,!ee&&(Je(),C(f),(t=f.onRuntimeInitialized)===null||t===void 0||t.call(f),Ke())}f.setStatus?(f.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>f.setStatus(""),1),e()},1)):e()}function Ra(){if(f.preInit)for(typeof f.preInit=="function"&&(f.preInit=[f.preInit]);f.preInit.length>0;)f.preInit.shift()()}return Ra(),Zt(),l=I,l};function te(o){return Ve(Kt,o)}function ao(){return ro(Kt)}function oo(o){te({overrides:o,equalityFn:Object.is,fireImmediately:!1})}async function io(o,l){return no(Kt,o,l)}const so="1c961d9d9a1f0001f5d00486bcf8e1b1a91fcf9fe17ebcbd6e2b6efe21e23038",ke=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["databar_limited","DataBarLimited"],["data_matrix","DataMatrix"],["dx_film_edge","DXFilmEdge"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["maxi_code","MaxiCode"],["micro_qr_code","MicroQRCode"],["pdf417","PDF417"],["qr_code","QRCode"],["rm_qr_code","rMQRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"],["linear_codes","Linear-Codes"],["matrix_codes","Matrix-Codes"],["any","Any"]],uo=[...ke,["unknown"]].map(o=>o[0]),Jt=new Map(ke);function co(o){for(const[l,h]of Jt)if(o===h)return l;return"unknown"}function lo(o){if(He(o))return{width:o.naturalWidth,height:o.naturalHeight};if(Ne(o))return{width:o.width.baseVal.value,height:o.height.baseVal.value};if(ze(o))return{width:o.videoWidth,height:o.videoHeight};if(Xe(o))return{width:o.width,height:o.height};if(Ye(o))return{width:o.displayWidth,height:o.displayHeight};if(Ge(o))return{width:o.width,height:o.height};if(qe(o))return{width:o.width,height:o.height};throw new TypeError("The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'.")}function He(o){var l,h;try{return o instanceof((h=(l=o==null?void 0:o.ownerDocument)==null?void 0:l.defaultView)==null?void 0:h.HTMLImageElement)}catch{return!1}}function Ne(o){var l,h;try{return o instanceof((h=(l=o==null?void 0:o.ownerDocument)==null?void 0:l.defaultView)==null?void 0:h.SVGImageElement)}catch{return!1}}function ze(o){var l,h;try{return o instanceof((h=(l=o==null?void 0:o.ownerDocument)==null?void 0:l.defaultView)==null?void 0:h.HTMLVideoElement)}catch{return!1}}function Ge(o){var l,h;try{return o instanceof((h=(l=o==null?void 0:o.ownerDocument)==null?void 0:l.defaultView)==null?void 0:h.HTMLCanvasElement)}catch{return!1}}function Xe(o){try{return o instanceof ImageBitmap||Object.prototype.toString.call(o)==="[object ImageBitmap]"}catch{return!1}}function qe(o){try{return o instanceof OffscreenCanvas||Object.prototype.toString.call(o)==="[object OffscreenCanvas]"}catch{return!1}}function Ye(o){try{return o instanceof VideoFrame||Object.prototype.toString.call(o)==="[object VideoFrame]"}catch{return!1}}function fo(o){try{return o instanceof Blob||Object.prototype.toString.call(o)==="[object Blob]"}catch{return!1}}function ho(o){try{return o instanceof ImageData||Object.prototype.toString.call(o)==="[object ImageData]"}catch{return!1}}function po(o,l){try{const h=new OffscreenCanvas(o,l);if(h.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return h;throw void 0}catch{const h=document.createElement("canvas");return h.width=o,h.height=l,h}}async function Ze(o){if(He(o)&&!await go(o))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(Ne(o)&&!await wo(o))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(Ye(o)&&$o(o))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(ze(o)&&(o.readyState===0||o.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(Xe(o)&&Co(o))throw new DOMException("The image source is detached.","InvalidStateError");const{width:l,height:h}=lo(o);if(l===0||h===0)return null;const C=po(l,h).getContext("2d");C.drawImage(o,0,0);try{return C.getImageData(0,0,l,h)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function vo(o){let l;try{l=await createImageBitmap(o)}catch{try{if(globalThis.Image){l=new Image;let C="";try{C=URL.createObjectURL(o),l.src=C,await l.decode()}finally{URL.revokeObjectURL(C)}}else return o}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}}return await Ze(l)}function yo(o){const{width:l,height:h}=o;if(l===0||h===0)return null;const f=o.getContext("2d");try{return f.getImageData(0,0,l,h)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function mo(o){if(fo(o))return await vo(o);if(ho(o)){if(bo(o))throw new DOMException("The image data has been detached.","InvalidStateError");return o}return Ge(o)||qe(o)?yo(o):await Ze(o)}async function go(o){try{return await o.decode(),!0}catch{return!1}}async function wo(o){var l;try{return await((l=o.decode)==null?void 0:l.call(o)),!0}catch{return!1}}function $o(o){return o.format===null}function bo(o){return o.data.buffer.byteLength===0}function Co(o){return o.width===0&&o.height===0}function Ue(o,l){return To(o)?new DOMException(`${l}: ${o.message}`,o.name):Po(o)?new o.constructor(`${l}: ${o.message}`):new Error(`${l}: ${o}`)}function To(o){return o instanceof DOMException||Object.prototype.toString.call(o)==="[object DOMException]"}function Po(o){return o instanceof Error||Object.prototype.toString.call(o)==="[object Error]"}var pt;class _o{constructor(l={}){Re(this,pt);var h;try{const f=(h=l==null?void 0:l.formats)==null?void 0:h.filter(C=>C!=="unknown");if((f==null?void 0:f.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const C of f!=null?f:[])if(!Jt.has(C))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${C}' is not a valid enum value of type BarcodeFormat.`);Le(this,pt,f!=null?f:[]),te({fireImmediately:!0}).catch(()=>{})}catch(f){throw Ue(f,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return uo.filter(l=>l!=="unknown")}async detect(l){try{const h=await mo(l);if(h===null)return[];let f;const C={tryCode39ExtendedMode:!1,textMode:"Plain",formats:je(this,pt).map(O=>Jt.get(O))};try{f=await io(h,C)}catch(O){throw console.error(O),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return f.map(O=>{const{topLeft:{x:I,y:j},topRight:{x:A,y:M},bottomLeft:{x:z,y:X},bottomRight:{x:q,y:it}}=O.position,st=Math.min(I,A,z,q),et=Math.min(j,M,X,it),vt=Math.max(I,A,z,q),G=Math.max(j,M,X,it);return{boundingBox:new DOMRectReadOnly(st,et,vt-st,G-et),rawValue:O.text,format:co(O.format),cornerPoints:[{x:I,y:j},{x:A,y:M},{x:q,y:it},{x:z,y:X}]}})}catch(h){throw Ue(h,"Failed to execute 'detect' on 'BarcodeDetector'")}}}pt=new WeakMap;exports.BarcodeDetector=_o;exports.ZXING_CPP_COMMIT=Ka;exports.ZXING_WASM_SHA256=so;exports.ZXING_WASM_VERSION=Ja;exports.prepareZXingModule=te;exports.purgeZXingModule=ao;exports.setZXingModuleOverrides=oo;
|
|
1
|
+
"use strict";var Ve=o=>{throw TypeError(o)};var We=(o,l,h)=>l.has(o)||Ve("Cannot "+h);var He=(o,l,h)=>(We(o,l,"read from private field"),h?h.call(o):l.get(o)),ke=(o,l,h)=>l.has(o)?Ve("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(o):l.set(o,h),Ne=(o,l,h,b)=>(We(o,l,"write to private field"),b?b.call(o,h):l.set(o,h),h);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Dt=[["Aztec","M"],["Codabar","L"],["Code39","L"],["Code93","L"],["Code128","L"],["DataBar","L"],["DataBarExpanded","L"],["DataMatrix","M"],["EAN-8","L"],["EAN-13","L"],["ITF","L"],["MaxiCode","M"],["PDF417","M"],["QRCode","M"],["UPC-A","L"],["UPC-E","L"],["MicroQRCode","M"],["rMQRCode","M"],["DXFilmEdge","L"],["DataBarLimited","L"]],Mt=Dt.map(([o])=>o),Ma=Mt.filter((o,l)=>Dt[l][1]==="L"),Aa=Mt.filter((o,l)=>Dt[l][1]==="M");function qt(o){switch(o){case"Linear-Codes":return Ma.reduce((l,h)=>l|qt(h),0);case"Matrix-Codes":return Aa.reduce((l,h)=>l|qt(h),0);case"Any":return(1<<Dt.length)-1;case"None":return 0;default:return 1<<Mt.indexOf(o)}}function Fa(o){if(o===0)return"None";const l=31-Math.clz32(o);return Mt[l]}function Ra(o){return o.reduce((l,h)=>l|qt(h),0)}const ja=["LocalAverage","GlobalHistogram","FixedThreshold","BoolCast"];function Ba(o){return ja.indexOf(o)}const ze=["Unknown","ASCII","ISO8859_1","ISO8859_2","ISO8859_3","ISO8859_4","ISO8859_5","ISO8859_6","ISO8859_7","ISO8859_8","ISO8859_9","ISO8859_10","ISO8859_11","ISO8859_13","ISO8859_14","ISO8859_15","ISO8859_16","Cp437","Cp1250","Cp1251","Cp1252","Cp1256","Shift_JIS","Big5","GB2312","GB18030","EUC_JP","EUC_KR","UTF16BE","UTF16BE","UTF8","UTF16LE","UTF32BE","UTF32LE","BINARY"];function La(o){return o==="UnicodeBig"?ze.indexOf("UTF16BE"):ze.indexOf(o)}const Ua=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function Va(o){return Ua[o]}const Wa=["Ignore","Read","Require"];function Ha(o){return Wa.indexOf(o)}const ka=["Plain","ECI","HRI","Hex","Escaped"];function Na(o){return ka.indexOf(o)}const It={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,tryDenoise:!1,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,tryCode39ExtendedMode:!0,returnErrors:!1,eanAddOnSymbol:"Ignore",textMode:"HRI",characterSet:"Unknown"};function Ge(o){return{...o,formats:Ra(o.formats),binarizer:Ba(o.binarizer),eanAddOnSymbol:Ha(o.eanAddOnSymbol),textMode:Na(o.textMode),characterSet:La(o.characterSet)}}function za(o){return{...o,format:Fa(o.format),contentType:Va(o.contentType),eccLevel:o.ecLevel}}const Ga="2.2.4",Xa="fba4e9503fee4518ca2e89510baeea9bcc36dc8d",qa={locateFile:(o,l)=>{const h=o.match(/_(.+?)\.wasm$/);return h?`https://fastly.jsdelivr.net/npm/zxing-wasm@2.2.4/dist/${h[1]}/${o}`:l+o}},St=new WeakMap;function Ya(o,l){return Object.is(o,l)||Object.keys(o).length===Object.keys(l).length&&Object.keys(o).every(h=>Object.hasOwn(l,h)&&o[h]===l[h])}function qe(o,{overrides:l,equalityFn:h=Ya,fireImmediately:b=!1}={}){var f;const[I,D]=(f=St.get(o))!=null?f:[qa],M=l!=null?l:I;let _;if(b){if(D&&(_=h(I,M)))return D;const A=o({...M});return St.set(o,[M,A]),A}(_!=null?_:h(I,M))||St.set(o,[M])}function Za(o){St.delete(o)}async function Qa(o,l,h=It){const b={...It,...h},f=await qe(o,{fireImmediately:!0});let I,D;if("width"in l&&"height"in l&&"data"in l){const{data:_,data:{byteLength:A},width:U,height:G}=l;D=f._malloc(A),f.HEAPU8.set(_,D),I=f.readBarcodesFromPixmap(D,U,G,Ge(b))}else{let _,A;if("buffer"in l)[_,A]=[l.byteLength,l];else if("byteLength"in l)[_,A]=[l.byteLength,new Uint8Array(l)];else if("size"in l)[_,A]=[l.size,new Uint8Array(await l.arrayBuffer())];else throw new TypeError("Invalid input type");D=f._malloc(_),f.HEAPU8.set(A,D),I=f.readBarcodesFromImage(D,_,Ge(b))}f._free(D);const M=[];for(let _=0;_<I.size();++_)M.push(za(I.get(_)));return M}({...It,formats:[...It.formats]});async function Zt(o={}){var l,h,b,f=o,I=!!globalThis.window,D=typeof Bun<"u",M=!!globalThis.WorkerGlobalScope;!((h=globalThis.process)===null||h===void 0||(h=h.versions)===null||h===void 0)&&h.node&&((b=globalThis.process)===null||b===void 0?void 0:b.type)!="renderer";var _="./this.program",A,U="";function G(t){return f.locateFile?f.locateFile(t,U):U+t}var tt,X;if(I||M||D){try{U=new URL(".",A).href}catch{}M&&(X=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),tt=async t=>{var e=await fetch(t,{credentials:"same-origin"});if(e.ok)return e.arrayBuffer();throw new Error(e.status+" : "+e.url)}}var nt=console.log.bind(console),V=console.error.bind(console),q,dt=!1,Jt,Kt,Y,W,ht,at,ot,T,te,ee,re=!1;function ne(){var t=Et.buffer;Y=new Int8Array(t),ht=new Int16Array(t),f.HEAPU8=W=new Uint8Array(t),at=new Uint16Array(t),ot=new Int32Array(t),T=new Uint32Array(t),te=new Float32Array(t),ee=new Float64Array(t)}function ar(){if(f.preRun)for(typeof f.preRun=="function"&&(f.preRun=[f.preRun]);f.preRun.length;)yr(f.preRun.shift());ae(ie)}function or(){re=!0,lt.xa()}function ir(){if(f.postRun)for(typeof f.postRun=="function"&&(f.postRun=[f.postRun]);f.postRun.length;)pr(f.postRun.shift());ae(oe)}function At(t){var e,r;(e=f.onAbort)===null||e===void 0||e.call(f,t),t="Aborted("+t+")",V(t),dt=!0,t+=". Build with -sASSERTIONS for more info.";var n=new WebAssembly.RuntimeError(t);throw(r=Kt)===null||r===void 0||r(n),n}var pt;function sr(){return G("zxing_reader.wasm")}function ur(t){if(t==pt&&q)return new Uint8Array(q);if(X)return X(t);throw"both async and sync fetching of the wasm failed"}async function cr(t){if(!q)try{var e=await tt(t);return new Uint8Array(e)}catch{}return ur(t)}async function lr(t,e){try{var r=await cr(t),n=await WebAssembly.instantiate(r,e);return n}catch(a){V(`failed to asynchronously prepare wasm: ${a}`),At(a)}}async function fr(t,e,r){if(!t&&WebAssembly.instantiateStreaming)try{var n=fetch(e,{credentials:"same-origin"}),a=await WebAssembly.instantiateStreaming(n,r);return a}catch(i){V(`wasm streaming compile failed: ${i}`),V("falling back to ArrayBuffer instantiation")}return lr(e,r)}function dr(){var t={a:qn};return t}async function hr(){function t(i,s){return lt=i.exports,Xn(lt),ne(),lt}function e(i){return t(i.instance)}var r=dr();if(f.instantiateWasm)return new Promise((i,s)=>{f.instantiateWasm(r,(u,c)=>{i(t(u))})});pt!=null||(pt=sr());var n=await fr(q,pt,r),a=e(n);return a}var ae=t=>{for(;t.length>0;)t.shift()(f)},oe=[],pr=t=>oe.push(t),ie=[],yr=t=>ie.push(t),m=t=>xe(t),g=()=>Se(),yt=[],vt=0,vr=t=>{var e=new Ft(t);return e.get_caught()||(e.set_caught(!0),vt--),e.set_rethrown(!1),yt.push(e),De(t),Oe(t)},H=0,mr=()=>{v(0,0);var t=yt.pop();Ie(t.excPtr),H=0};class Ft{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){T[this.ptr+4>>2]=e}get_type(){return T[this.ptr+4>>2]}set_destructor(e){T[this.ptr+8>>2]=e}get_destructor(){return T[this.ptr+8>>2]}set_caught(e){e=e?1:0,Y[this.ptr+12]=e}get_caught(){return Y[this.ptr+12]!=0}set_rethrown(e){e=e?1:0,Y[this.ptr+13]=e}get_rethrown(){return Y[this.ptr+13]!=0}init(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)}set_adjusted_ptr(e){T[this.ptr+16>>2]=e}get_adjusted_ptr(){return T[this.ptr+16>>2]}}var mt=t=>_e(t),Rt=t=>{var e=H;if(!e)return mt(0),0;var r=new Ft(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return mt(0),e;for(var a of t){if(a===0||a===n)break;var i=r.ptr+16;if(Me(a,n,i))return mt(a),e}return mt(n),e},gr=()=>Rt([]),wr=t=>Rt([t]),br=(t,e)=>Rt([t,e]),$r=()=>{var t=yt.pop();t||At("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||(yt.push(t),t.set_rethrown(!0),t.set_caught(!1),vt++),H=e,H},Cr=(t,e,r)=>{var n=new Ft(t);throw n.init(e,r),H=t,vt++,H},Tr=()=>vt,Pr=t=>{throw H||(H=t),H},Er=()=>At(""),gt={},jt=t=>{for(;t.length;){var e=t.pop(),r=t.pop();r(e)}};function it(t){return this.fromWireType(T[t>>2])}var et={},Z={},wt={},Or=class extends Error{constructor(t){super(t),this.name="InternalError"}},bt=t=>{throw new Or(t)},Q=(t,e,r)=>{t.forEach(u=>wt[u]=e);function n(u){var c=r(u);c.length!==t.length&&bt("Mismatched type converter count");for(var d=0;d<t.length;++d)B(t[d],c[d])}var a=new Array(e.length),i=[],s=0;{const u=e;for(let c=0;c<u.length;++c){const d=u[c];Z.hasOwnProperty(d)?a[c]=Z[d]:(i.push(d),et.hasOwnProperty(d)||(et[d]=[]),et[d].push(()=>{a[c]=Z[d],++s,s===i.length&&n(a)}))}}i.length===0&&n(a)},_r=t=>{var e=gt[t];delete gt[t];var r=e.rawConstructor,n=e.rawDestructor,a=e.fields,i=a.map(s=>s.getterReturnType).concat(a.map(s=>s.setterArgumentType));Q([t],i,s=>{var u={};{const c=a;for(let d=0;d<c.length;++d){const p=c[d],y=s[d],C=p.getter,E=p.getterContext,S=s[d+a.length],x=p.setter,O=p.setterContext;u[p.fieldName]={read:P=>y.fromWireType(C(E,P)),write:(P,K)=>{var R=[];x(O,P,S.toWireType(R,K)),jt(R)},optional:y.optional}}}return[{name:e.name,fromWireType:c=>{var d={};for(var p in u)d[p]=u[p].read(c);return n(c),d},toWireType:(c,d)=>{for(var p in u)if(!(p in d)&&!u[p].optional)throw new TypeError(`Missing field: "${p}"`);var y=r();for(p in u)u[p].write(y,d[p]);return c!==null&&c.push(n,y),y},readValueFromPointer:it,destructorFunction:n}]})},xr=(t,e,r,n,a)=>{},F=t=>{for(var e="";;){var r=W[t++];if(!r)return e;e+=String.fromCharCode(r)}},st=class extends Error{constructor(t){super(t),this.name="BindingError"}},$=t=>{throw new st(t)};function Sr(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=e.name;if(t||$(`type "${n}" must have a positive integer typeid pointer`),Z.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;$(`Cannot register type '${n}' twice`)}if(Z[t]=e,delete wt[t],et.hasOwnProperty(t)){var a=et[t];delete et[t],a.forEach(i=>i())}}function B(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Sr(t,e,r)}var Ir=(t,e,r,n)=>{e=F(e),B(t,{name:e,fromWireType:function(a){return!!a},toWireType:function(a,i){return i?r:n},readValueFromPointer:function(a){return this.fromWireType(W[a])},destructorFunction:null})},Dr=t=>({count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}),Bt=t=>{function e(r){return r.$$.ptrType.registeredClass.name}$(e(t)+" instance already deleted")},Lt=!1,se=t=>{},Mr=t=>{t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)},ue=t=>{t.count.value-=1;var e=t.count.value===0;e&&Mr(t)},ut=t=>globalThis.FinalizationRegistry?(Lt=new FinalizationRegistry(e=>{ue(e.$$)}),ut=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var a={$$:r};Lt.register(e,a,e)}return e},se=e=>Lt.unregister(e),ut(t)):(ut=e=>e,t),Ar=()=>{let t=$t.prototype;Object.assign(t,{isAliasOf(r){if(!(this instanceof $t)||!(r instanceof $t))return!1;var n=this.$$.ptrType.registeredClass,a=this.$$.ptr;r.$$=r.$$;for(var i=r.$$.ptrType.registeredClass,s=r.$$.ptr;n.baseClass;)a=n.upcast(a),n=n.baseClass;for(;i.baseClass;)s=i.upcast(s),i=i.baseClass;return n===i&&a===s},clone(){if(this.$$.ptr||Bt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var r=ut(Object.create(Object.getPrototypeOf(this),{$$:{value:Dr(this.$$)}}));return r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},delete(){this.$$.ptr||Bt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&$("Object already scheduled for deletion"),se(this),ue(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Bt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&$("Object already scheduled for deletion"),this.$$.deleteScheduled=!0,this}});const e=Symbol.dispose;e&&(t[e]=t.delete)};function $t(){}var Ut=(t,e)=>Object.defineProperty(e,"name",{value:t}),ce={},le=(t,e,r)=>{if(t[e].overloadTable===void 0){var n=t[e];t[e]=function(){for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return t[e].overloadTable.hasOwnProperty(i.length)||$(`Function '${r}' called with an invalid number of arguments (${i.length}) - expects one of (${t[e].overloadTable})!`),t[e].overloadTable[i.length].apply(this,i)},t[e].overloadTable=[],t[e].overloadTable[n.argCount]=n}},fe=(t,e,r)=>{f.hasOwnProperty(t)?((r===void 0||f[t].overloadTable!==void 0&&f[t].overloadTable[r]!==void 0)&&$(`Cannot register public name '${t}' twice`),le(f,t,t),f[t].overloadTable.hasOwnProperty(r)&&$(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),f[t].overloadTable[r]=e):(f[t]=e,f[t].argCount=r)},Fr=48,Rr=57,jr=t=>{t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return e>=Fr&&e<=Rr?`_${t}`:t};function Br(t,e,r,n,a,i,s,u){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=i,this.upcast=s,this.downcast=u,this.pureVirtualFunctions=[]}var Vt=(t,e,r)=>{for(;e!==r;)e.upcast||$(`Expected null or instance of ${r.name}, got an instance of ${e.name}`),t=e.upcast(t),e=e.baseClass;return t},Wt=t=>{if(t===null)return"null";var e=typeof t;return e==="object"||e==="array"||e==="function"?t.toString():""+t};function Lr(t,e){if(e===null)return this.isReference&&$(`null is not a valid ${this.name}`),0;e.$$||$(`Cannot pass "${Wt(e)}" as a ${this.name}`),e.$$.ptr||$(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=Vt(e.$$.ptr,r,this.registeredClass);return n}function Ur(t,e){var r;if(e===null)return this.isReference&&$(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),t!==null&&t.push(this.rawDestructor,r),r):0;(!e||!e.$$)&&$(`Cannot pass "${Wt(e)}" as a ${this.name}`),e.$$.ptr||$(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&e.$$.ptrType.isConst&&$(`Cannot convert argument of type ${e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name} to parameter type ${this.name}`);var n=e.$$.ptrType.registeredClass;if(r=Vt(e.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(e.$$.smartPtr===void 0&&$("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:$(`Cannot convert argument of type ${e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=e.$$.smartPtr;break;case 2:if(e.$$.smartPtrType===this)r=e.$$.smartPtr;else{var a=e.clone();r=this.rawShare(r,L.toHandle(()=>a.delete())),t!==null&&t.push(this.rawDestructor,r)}break;default:$("Unsupporting sharing policy")}return r}function Vr(t,e){if(e===null)return this.isReference&&$(`null is not a valid ${this.name}`),0;e.$$||$(`Cannot pass "${Wt(e)}" as a ${this.name}`),e.$$.ptr||$(`Cannot pass deleted object as a pointer of type ${this.name}`),e.$$.ptrType.isConst&&$(`Cannot convert argument of type ${e.$$.ptrType.name} to parameter type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=Vt(e.$$.ptr,r,this.registeredClass);return n}var de=(t,e,r)=>{if(e===r)return t;if(r.baseClass===void 0)return null;var n=de(t,e,r.baseClass);return n===null?null:r.downcast(n)},Wr={},Hr=(t,e)=>{for(e===void 0&&$("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e},kr=(t,e)=>(e=Hr(t,e),Wr[e]),Ct=(t,e)=>{(!e.ptrType||!e.ptr)&&bt("makeClassHandle requires ptr and ptrType");var r=!!e.smartPtrType,n=!!e.smartPtr;return r!==n&&bt("Both smartPtrType and smartPtr must be specified"),e.count={value:1},ut(Object.create(t,{$$:{value:e,writable:!0}}))};function Nr(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=kr(this.registeredClass,e);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=e,r.$$.smartPtr=t,r.clone();var n=r.clone();return this.destructor(t),n}function a(){return this.isSmartPointer?Ct(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):Ct(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var i=this.registeredClass.getActualType(e),s=ce[i];if(!s)return a.call(this);var u;this.isConst?u=s.constPointerType:u=s.pointerType;var c=de(e,this.registeredClass,u.registeredClass);return c===null?a.call(this):this.isSmartPointer?Ct(u.registeredClass.instancePrototype,{ptrType:u,ptr:c,smartPtrType:this,smartPtr:t}):Ct(u.registeredClass.instancePrototype,{ptrType:u,ptr:c})}var zr=()=>{Object.assign(Tt.prototype,{getPointee(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t},destructor(t){var e;(e=this.rawDestructor)===null||e===void 0||e.call(this,t)},readValueFromPointer:it,fromWireType:Nr})};function Tt(t,e,r,n,a,i,s,u,c,d,p){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=i,this.sharingPolicy=s,this.rawGetPointee=u,this.rawConstructor=c,this.rawShare=d,this.rawDestructor=p,!a&&e.baseClass===void 0?n?(this.toWireType=Lr,this.destructorFunction=null):(this.toWireType=Vr,this.destructorFunction=null):this.toWireType=Ur}var he=(t,e,r)=>{f.hasOwnProperty(t)||bt("Replacing nonexistent public symbol"),f[t].overloadTable!==void 0&&r!==void 0?f[t].overloadTable[r]=e:(f[t]=e,f[t].argCount=r)},N={},Gr=(t,e,r)=>{t=t.replace(/p/g,"i");var n=N[t];return n(e,...r)},pe=[],w=t=>{var e=pe[t];return e||(pe[t]=e=Re.get(t)),e},Xr=function(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(t.includes("j"))return Gr(t,e,r);var n=w(e),a=n(...r);return a},qr=function(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return function(){for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return Xr(t,e,a,r)}},j=function(t,e){t=F(t);function r(){if(t.includes("j"))return qr(t,e);var a=w(e);return a}var n=r();return typeof n!="function"&&$(`unknown function pointer with signature ${t}: ${e}`),n};class Yr extends Error{}var ye=t=>{var e=Ee(t),r=F(e);return z(e),r},Pt=(t,e)=>{var r=[],n={};function a(i){if(!n[i]&&!Z[i]){if(wt[i]){wt[i].forEach(a);return}r.push(i),n[i]=!0}}throw e.forEach(a),new Yr(`${t}: `+r.map(ye).join([", "]))},Zr=(t,e,r,n,a,i,s,u,c,d,p,y,C)=>{p=F(p),i=j(a,i),u&&(u=j(s,u)),d&&(d=j(c,d)),C=j(y,C);var E=jr(p);fe(E,function(){Pt(`Cannot construct ${p} due to unbound types`,[n])}),Q([t,e,r],n?[n]:[],S=>{S=S[0];var x,O;n?(x=S.registeredClass,O=x.instancePrototype):O=$t.prototype;var P=Ut(p,function(){if(Object.getPrototypeOf(this)!==K)throw new st(`Use 'new' to construct ${p}`);if(R.constructor_body===void 0)throw new st(`${p} has no accessible constructor`);for(var Le=arguments.length,_t=new Array(Le),xt=0;xt<Le;xt++)_t[xt]=arguments[xt];var Ue=R.constructor_body[_t.length];if(Ue===void 0)throw new st(`Tried to invoke ctor of ${p} with invalid number of parameters (${_t.length}) - expected (${Object.keys(R.constructor_body).toString()}) parameters instead!`);return Ue.apply(this,_t)}),K=Object.create(O,{constructor:{value:P}});P.prototype=K;var R=new Br(p,P,K,C,x,i,u,d);if(R.baseClass){var k,Ot;(Ot=(k=R.baseClass).__derivedClasses)!==null&&Ot!==void 0||(k.__derivedClasses=[]),R.baseClass.__derivedClasses.push(R)}var Da=new Tt(p,R,!0,!1,!1),je=new Tt(p+"*",R,!1,!1,!1),Be=new Tt(p+" const*",R,!1,!0,!1);return ce[t]={pointerType:je,constPointerType:Be},he(E,P),[Da,je,Be]})},Ht=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(T[e+n*4>>2]);return r};function Qr(t){for(var e=1;e<t.length;++e)if(t[e]!==null&&t[e].destructorFunction===void 0)return!0;return!1}function kt(t,e,r,n,a,i){var s=e.length;s<2&&$("argTypes array size mismatch! Must at least get return value and 'this' types!");var u=e[1]!==null&&r!==null,c=Qr(e),d=!e[0].isVoid,p=s-2,y=new Array(p),C=[],E=[],S=function(){E.length=0;var x;C.length=u?2:1,C[0]=a,u&&(x=e[1].toWireType(E,this),C[1]=x);for(var O=0;O<p;++O)y[O]=e[O+2].toWireType(E,O<0||arguments.length<=O?void 0:arguments[O]),C.push(y[O]);var P=n(...C);function K(R){if(c)jt(E);else for(var k=u?1:2;k<e.length;k++){var Ot=k===1?x:y[k-2];e[k].destructorFunction!==null&&e[k].destructorFunction(Ot)}if(d)return e[0].fromWireType(R)}return K(P)};return Ut(t,S)}var Jr=(t,e,r,n,a,i)=>{var s=Ht(e,r);a=j(n,a),Q([],[t],u=>{u=u[0];var c=`constructor ${u.name}`;if(u.registeredClass.constructor_body===void 0&&(u.registeredClass.constructor_body=[]),u.registeredClass.constructor_body[e-1]!==void 0)throw new st(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${u.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return u.registeredClass.constructor_body[e-1]=()=>{Pt(`Cannot construct ${u.name} due to unbound types`,s)},Q([],s,d=>(d.splice(1,0,null),u.registeredClass.constructor_body[e-1]=kt(c,d,null,a,i),[])),[]})},ve=t=>{t=t.trim();const e=t.indexOf("(");return e===-1?t:t.slice(0,e)},Kr=(t,e,r,n,a,i,s,u,c,d)=>{var p=Ht(r,n);e=F(e),e=ve(e),i=j(a,i),Q([],[t],y=>{y=y[0];var C=`${y.name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),u&&y.registeredClass.pureVirtualFunctions.push(e);function E(){Pt(`Cannot call ${C} due to unbound types`,p)}var S=y.registeredClass.instancePrototype,x=S[e];return x===void 0||x.overloadTable===void 0&&x.className!==y.name&&x.argCount===r-2?(E.argCount=r-2,E.className=y.name,S[e]=E):(le(S,e,C),S[e].overloadTable[r-2]=E),Q([],p,O=>{var P=kt(C,O,y,i,s);return S[e].overloadTable===void 0?(P.argCount=r-2,S[e]=P):S[e].overloadTable[r-2]=P,[]}),[]})},me=[],J=[0,1,,1,null,1,!0,1,!1,1],Nt=t=>{t>9&&--J[t+1]===0&&(J[t]=void 0,me.push(t))},L={toValue:t=>(t||$(`Cannot use deleted val. handle = ${t}`),J[t]),toHandle:t=>{switch(t){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const e=me.pop()||J.length;return J[e]=t,J[e+1]=1,e}}}},ge={name:"emscripten::val",fromWireType:t=>{var e=L.toValue(t);return Nt(t),e},toWireType:(t,e)=>L.toHandle(e),readValueFromPointer:it,destructorFunction:null},tn=t=>B(t,ge),en=(t,e)=>{switch(e){case 4:return function(r){return this.fromWireType(te[r>>2])};case 8:return function(r){return this.fromWireType(ee[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},rn=(t,e,r)=>{e=F(e),B(t,{name:e,fromWireType:n=>n,toWireType:(n,a)=>a,readValueFromPointer:en(e,r),destructorFunction:null})},nn=(t,e,r,n,a,i,s,u)=>{var c=Ht(e,r);t=F(t),t=ve(t),a=j(n,a),fe(t,function(){Pt(`Cannot call ${t} due to unbound types`,c)},e-1),Q([],c,d=>{var p=[d[0],null].concat(d.slice(1));return he(t,kt(t,p,null,a,i),e-1),[]})},an=(t,e,r)=>{switch(e){case 1:return r?n=>Y[n]:n=>W[n];case 2:return r?n=>ht[n>>1]:n=>at[n>>1];case 4:return r?n=>ot[n>>2]:n=>T[n>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},on=(t,e,r,n,a)=>{e=F(e);const i=n===0;let s=c=>c;if(i){var u=32-8*r;s=c=>c<<u>>>u,a=s(a)}B(t,{name:e,fromWireType:s,toWireType:(c,d)=>d,readValueFromPointer:an(e,r,n!==0),destructorFunction:null})},sn=(t,e,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[e];function i(s){var u=T[s>>2],c=T[s+4>>2];return new a(Y.buffer,c,u)}r=F(r),B(t,{name:r,fromWireType:i,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},un=Object.assign({optional:!0},ge),cn=(t,e)=>{B(t,un)},ln=(t,e,r,n)=>{if(!(n>0))return 0;for(var a=r,i=r+n-1,s=0;s<t.length;++s){var u=t.codePointAt(s);if(u<=127){if(r>=i)break;e[r++]=u}else if(u<=2047){if(r+1>=i)break;e[r++]=192|u>>6,e[r++]=128|u&63}else if(u<=65535){if(r+2>=i)break;e[r++]=224|u>>12,e[r++]=128|u>>6&63,e[r++]=128|u&63}else{if(r+3>=i)break;e[r++]=240|u>>18,e[r++]=128|u>>12&63,e[r++]=128|u>>6&63,e[r++]=128|u&63,s++}}return e[r]=0,r-a},rt=(t,e,r)=>ln(t,W,e,r),we=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++r):e+=3}return e},be=globalThis.TextDecoder&&new TextDecoder,$e=(t,e,r,n)=>{var a=e+r;if(n)return a;for(;t[e]&&!(e>=a);)++e;return e},Ce=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;var a=$e(t,e,r,n);if(a-e>16&&t.buffer&&be)return be.decode(t.subarray(e,a));for(var i="";e<a;){var s=t[e++];if(!(s&128)){i+=String.fromCharCode(s);continue}var u=t[e++]&63;if((s&224)==192){i+=String.fromCharCode((s&31)<<6|u);continue}var c=t[e++]&63;if((s&240)==224?s=(s&15)<<12|u<<6|c:s=(s&7)<<18|u<<12|c<<6|t[e++]&63,s<65536)i+=String.fromCharCode(s);else{var d=s-65536;i+=String.fromCharCode(55296|d>>10,56320|d&1023)}}return i},fn=(t,e,r)=>t?Ce(W,t,e,r):"",dn=(t,e)=>{e=F(e),B(t,{name:e,fromWireType(r){var n=T[r>>2],a=r+4,i;return i=fn(a,n,!0),z(r),i},toWireType(r,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var a,i=typeof n=="string";i||ArrayBuffer.isView(n)&&n.BYTES_PER_ELEMENT==1||$("Cannot pass non-string to std::string"),i?a=we(n):a=n.length;var s=Xt(4+a+1),u=s+4;return T[s>>2]=a,i?rt(n,u,a+1):W.set(n,u),r!==null&&r.push(z,s),s},readValueFromPointer:it,destructorFunction(r){z(r)}})},Te=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,hn=(t,e,r)=>{var n=t>>1,a=$e(at,n,e/2,r);if(a-n>16&&Te)return Te.decode(at.subarray(n,a));for(var i="",s=n;s<a;++s){var u=at[s];i+=String.fromCharCode(u)}return i},pn=(t,e,r)=>{if(r!=null||(r=2147483647),r<2)return 0;r-=2;for(var n=e,a=r<t.length*2?r/2:t.length,i=0;i<a;++i){var s=t.charCodeAt(i);ht[e>>1]=s,e+=2}return ht[e>>1]=0,e-n},yn=t=>t.length*2,vn=(t,e,r)=>{for(var n="",a=t>>2,i=0;!(i>=e/4);i++){var s=T[a+i];if(!s&&!r)break;n+=String.fromCodePoint(s)}return n},mn=(t,e,r)=>{if(r!=null||(r=2147483647),r<4)return 0;for(var n=e,a=n+r-4,i=0;i<t.length;++i){var s=t.codePointAt(i);if(s>65535&&i++,ot[e>>2]=s,e+=4,e+4>a)break}return ot[e>>2]=0,e-n},gn=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.codePointAt(r);n>65535&&r++,e+=4}return e},wn=(t,e,r)=>{r=F(r);var n,a,i;e===2?(n=hn,a=pn,i=yn):(n=vn,a=mn,i=gn),B(t,{name:r,fromWireType:s=>{var u=T[s>>2],c=n(s+4,u*e,!0);return z(s),c},toWireType:(s,u)=>{typeof u!="string"&&$(`Cannot pass non-string to C++ string type ${r}`);var c=i(u),d=Xt(4+c+e);return T[d>>2]=c/e,a(u,d+4,c+e),s!==null&&s.push(z,d),d},readValueFromPointer:it,destructorFunction(s){z(s)}})},bn=(t,e,r,n,a,i)=>{gt[t]={name:F(e),rawConstructor:j(r,n),rawDestructor:j(a,i),fields:[]}},$n=(t,e,r,n,a,i,s,u,c,d)=>{gt[t].fields.push({fieldName:F(e),getterReturnType:r,getter:j(n,a),getterContext:i,setterArgumentType:s,setter:j(u,c),setterContext:d})},Cn=(t,e)=>{e=F(e),B(t,{isVoid:!0,name:e,fromWireType:()=>{},toWireType:(r,n)=>{}})},zt=[],Tn=t=>{var e=zt.length;return zt.push(t),e},Pn=(t,e)=>{var r=Z[t];return r===void 0&&$(`${e} has unknown type ${ye(t)}`),r},En=(t,e)=>{for(var r=new Array(t),n=0;n<t;++n)r[n]=Pn(T[e+n*4>>2],`parameter ${n}`);return r},On=(t,e,r)=>{var n=[],a=t(n,r);return n.length&&(T[e>>2]=L.toHandle(n)),a},_n={},Pe=t=>{var e=_n[t];return e===void 0?F(t):e},xn=(t,e,r)=>{var n=8,[a,...i]=En(t,e),s=a.toWireType.bind(a),u=i.map(y=>y.readValueFromPointer.bind(y));t--;var c=new Array(t),d=(y,C,E,S)=>{for(var x=0,O=0;O<t;++O)c[O]=u[O](S+x),x+=n;var P;switch(r){case 0:P=L.toValue(y).apply(null,c);break;case 2:P=Reflect.construct(L.toValue(y),c);break;case 3:P=c[0];break;case 1:P=L.toValue(y)[Pe(C)](...c);break}return On(s,E,P)},p=`methodCaller<(${i.map(y=>y.name)}) => ${a.name}>`;return Tn(Ut(p,d))},Sn=t=>t?(t=Pe(t),L.toHandle(globalThis[t])):L.toHandle(globalThis),In=t=>{t>9&&(J[t+1]+=1)},Dn=(t,e,r,n,a)=>zt[t](e,r,n,a),Mn=t=>{var e=L.toValue(t);jt(e),Nt(t)},An=(t,e,r,n)=>{var a=new Date().getFullYear(),i=new Date(a,0,1),s=new Date(a,6,1),u=i.getTimezoneOffset(),c=s.getTimezoneOffset(),d=Math.max(u,c);T[t>>2]=d*60,ot[e>>2]=+(u!=c);var p=E=>{var S=E>=0?"-":"+",x=Math.abs(E),O=String(Math.floor(x/60)).padStart(2,"0"),P=String(x%60).padStart(2,"0");return`UTC${S}${O}${P}`},y=p(u),C=p(c);c<u?(rt(y,r,17),rt(C,n,17)):(rt(y,n,17),rt(C,r,17))},Fn=()=>2147483648,Rn=(t,e)=>Math.ceil(t/e)*e,jn=t=>{var e=Et.buffer.byteLength,r=(t-e+65535)/65536|0;try{return Et.grow(r),ne(),1}catch{}},Bn=t=>{var e=W.length;t>>>=0;var r=Fn();if(t>r)return!1;for(var n=1;n<=4;n*=2){var a=e*(1+.2/n);a=Math.min(a,t+100663296);var i=Math.min(r,Rn(Math.max(t,a),65536)),s=jn(i);if(s)return!0}return!1},Gt={},Ln=()=>_||"./this.program",ct=()=>{if(!ct.strings){var t=(typeof navigator=="object"&&navigator.language||"C").replace("-","_")+".UTF-8",e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:t,_:Ln()};for(var r in Gt)Gt[r]===void 0?delete e[r]:e[r]=Gt[r];var n=[];for(var r in e)n.push(`${r}=${e[r]}`);ct.strings=n}return ct.strings},Un=(t,e)=>{var r=0,n=0;for(var a of ct()){var i=e+r;T[t+n>>2]=i,r+=rt(a,i,1/0)+1,n+=4}return 0},Vn=(t,e)=>{var r=ct();T[t>>2]=r.length;var n=0;for(var a of r)n+=we(a)+1;return T[e>>2]=n,0},Wn=t=>52;function Hn(t,e,r,n,a){return 70}var kn=[null,[],[]],Nn=(t,e)=>{var r=kn[t];e===0||e===10?((t===1?nt:V)(Ce(r)),r.length=0):r.push(e)},zn=(t,e,r,n)=>{for(var a=0,i=0;i<r;i++){var s=T[e>>2],u=T[e+4>>2];e+=8;for(var c=0;c<u;c++)Nn(t,W[s+c]);a+=u}return T[n>>2]=a,0},Gn=t=>t;if(Ar(),zr(),f.noExitRuntime&&f.noExitRuntime,f.print&&(nt=f.print),f.printErr&&(V=f.printErr),f.wasmBinary&&(q=f.wasmBinary),f.arguments&&f.arguments,f.thisProgram&&(_=f.thisProgram),f.preInit)for(typeof f.preInit=="function"&&(f.preInit=[f.preInit]);f.preInit.length>0;)f.preInit.shift()();var Ee,z,Xt,Oe,v,_e,xe,Se,Ie,De,Me,Ae,Fe,Et,Re;function Xn(t){Ee=t.ya,z=f._free=t.za,Xt=f._malloc=t.Ba,Oe=t.Ca,v=t.Da,_e=t.Ea,xe=t.Fa,Se=t.Ga,Ie=t.Ha,De=t.Ia,Me=t.Ja,N.viijii=t.Ka,Ae=N.iiijj=t.La,N.jiji=t.Ma,Fe=N.jiiii=t.Na,N.iiiiij=t.Oa,N.iiiiijj=t.Pa,N.iiiiiijj=t.Qa,Et=t.wa,Re=t.Aa}var qn={s:vr,w:mr,a:gr,j:wr,m:br,Q:$r,p:Cr,U:Tr,d:Pr,ca:Er,ta:_r,ba:xr,oa:Ir,ra:Zr,qa:Jr,H:Kr,ma:tn,X:rn,Y:nn,x:on,t:sn,sa:cn,na:dn,R:wn,I:bn,ua:$n,pa:Cn,N:xn,va:Nt,D:Sn,S:In,M:Dn,ia:Mn,da:An,ga:Bn,ea:Un,fa:Vn,ha:Wn,$:Hn,V:zn,K:ma,C:ba,Z:ea,T:Oa,r:ha,b:Kn,E:va,ka:Ca,c:ra,ja:Ta,h:ta,i:oa,q:ca,P:ya,v:fa,F:da,L:pa,z:$a,J:_a,aa:xa,_:Sa,f:na,l:Yn,e:Jn,g:Qn,O:Ea,k:Zn,la:ga,o:la,B:ia,u:wa,W:ua,A:Pa,n:aa,G:sa,y:Gn};function Yn(t,e){var r=g();try{w(t)(e)}catch(n){if(m(r),n!==n+0)throw n;v(1,0)}}function Zn(t,e,r,n,a){var i=g();try{w(t)(e,r,n,a)}catch(s){if(m(i),s!==s+0)throw s;v(1,0)}}function Qn(t,e,r,n){var a=g();try{w(t)(e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function Jn(t,e,r){var n=g();try{w(t)(e,r)}catch(a){if(m(n),a!==a+0)throw a;v(1,0)}}function Kn(t,e){var r=g();try{return w(t)(e)}catch(n){if(m(r),n!==n+0)throw n;v(1,0)}}function ta(t,e,r,n){var a=g();try{return w(t)(e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function ea(t,e,r,n,a,i){var s=g();try{return w(t)(e,r,n,a,i)}catch(u){if(m(s),u!==u+0)throw u;v(1,0)}}function ra(t,e,r){var n=g();try{return w(t)(e,r)}catch(a){if(m(n),a!==a+0)throw a;v(1,0)}}function na(t){var e=g();try{w(t)()}catch(r){if(m(e),r!==r+0)throw r;v(1,0)}}function aa(t,e,r,n,a,i,s,u,c,d,p){var y=g();try{w(t)(e,r,n,a,i,s,u,c,d,p)}catch(C){if(m(y),C!==C+0)throw C;v(1,0)}}function oa(t,e,r,n,a){var i=g();try{return w(t)(e,r,n,a)}catch(s){if(m(i),s!==s+0)throw s;v(1,0)}}function ia(t,e,r,n,a,i,s){var u=g();try{w(t)(e,r,n,a,i,s)}catch(c){if(m(u),c!==c+0)throw c;v(1,0)}}function sa(t,e,r,n,a,i,s,u,c,d,p,y,C,E,S,x){var O=g();try{w(t)(e,r,n,a,i,s,u,c,d,p,y,C,E,S,x)}catch(P){if(m(O),P!==P+0)throw P;v(1,0)}}function ua(t,e,r,n,a,i,s,u,c){var d=g();try{w(t)(e,r,n,a,i,s,u,c)}catch(p){if(m(d),p!==p+0)throw p;v(1,0)}}function ca(t,e,r,n,a,i){var s=g();try{return w(t)(e,r,n,a,i)}catch(u){if(m(s),u!==u+0)throw u;v(1,0)}}function la(t,e,r,n,a,i){var s=g();try{w(t)(e,r,n,a,i)}catch(u){if(m(s),u!==u+0)throw u;v(1,0)}}function fa(t,e,r,n,a,i,s){var u=g();try{return w(t)(e,r,n,a,i,s)}catch(c){if(m(u),c!==c+0)throw c;v(1,0)}}function da(t,e,r,n,a,i,s,u){var c=g();try{return w(t)(e,r,n,a,i,s,u)}catch(d){if(m(c),d!==d+0)throw d;v(1,0)}}function ha(t){var e=g();try{return w(t)()}catch(r){if(m(e),r!==r+0)throw r;v(1,0)}}function pa(t,e,r,n,a,i,s,u,c){var d=g();try{return w(t)(e,r,n,a,i,s,u,c)}catch(p){if(m(d),p!==p+0)throw p;v(1,0)}}function ya(t,e,r,n,a,i,s){var u=g();try{return w(t)(e,r,n,a,i,s)}catch(c){if(m(u),c!==c+0)throw c;v(1,0)}}function va(t,e,r,n){var a=g();try{return w(t)(e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function ma(t,e,r,n){var a=g();try{return w(t)(e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function ga(t,e,r,n,a,i,s,u){var c=g();try{w(t)(e,r,n,a,i,s,u)}catch(d){if(m(c),d!==d+0)throw d;v(1,0)}}function wa(t,e,r,n,a,i,s,u){var c=g();try{w(t)(e,r,n,a,i,s,u)}catch(d){if(m(c),d!==d+0)throw d;v(1,0)}}function ba(t,e,r,n,a,i){var s=g();try{return w(t)(e,r,n,a,i)}catch(u){if(m(s),u!==u+0)throw u;v(1,0)}}function $a(t,e,r,n,a,i,s,u,c,d){var p=g();try{return w(t)(e,r,n,a,i,s,u,c,d)}catch(y){if(m(p),y!==y+0)throw y;v(1,0)}}function Ca(t,e,r){var n=g();try{return w(t)(e,r)}catch(a){if(m(n),a!==a+0)throw a;v(1,0)}}function Ta(t,e,r,n,a){var i=g();try{return w(t)(e,r,n,a)}catch(s){if(m(i),s!==s+0)throw s;v(1,0)}}function Pa(t,e,r,n,a,i,s,u,c,d){var p=g();try{w(t)(e,r,n,a,i,s,u,c,d)}catch(y){if(m(p),y!==y+0)throw y;v(1,0)}}function Ea(t,e,r,n,a,i,s){var u=g();try{w(t)(e,r,n,a,i,s)}catch(c){if(m(u),c!==c+0)throw c;v(1,0)}}function Oa(t,e,r,n){var a=g();try{return w(t)(e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function _a(t,e,r,n,a,i,s,u,c,d,p,y){var C=g();try{return w(t)(e,r,n,a,i,s,u,c,d,p,y)}catch(E){if(m(C),E!==E+0)throw E;v(1,0)}}function xa(t,e,r,n,a,i,s){var u=g();try{return Ae(t,e,r,n,a,i,s)}catch(c){if(m(u),c!==c+0)throw c;v(1,0)}}function Sa(t,e,r,n,a){var i=g();try{return Fe(t,e,r,n,a)}catch(s){if(m(i),s!==s+0)throw s;v(1,0)}}function Ia(){ar();function t(){var e,r;f.calledRun=!0,!dt&&(or(),(e=Jt)===null||e===void 0||e(f),(r=f.onRuntimeInitialized)===null||r===void 0||r.call(f),ir())}f.setStatus?(f.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>f.setStatus(""),1),t()},1)):t()}var lt;return lt=await hr(),Ia(),re?l=f:l=new Promise((t,e)=>{Jt=t,Kt=e}),l}function Qt(o){return qe(Zt,o)}function Ja(){return Za(Zt)}function Ka(o){Qt({overrides:o,equalityFn:Object.is,fireImmediately:!1})}async function to(o,l){return Qa(Zt,o,l)}const eo="85d46f55d7c86a4d09bb04273367408b19c324f582d040d018aecb25a9a82942",Ye=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["databar_limited","DataBarLimited"],["data_matrix","DataMatrix"],["dx_film_edge","DXFilmEdge"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["maxi_code","MaxiCode"],["micro_qr_code","MicroQRCode"],["pdf417","PDF417"],["qr_code","QRCode"],["rm_qr_code","rMQRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"],["linear_codes","Linear-Codes"],["matrix_codes","Matrix-Codes"],["any","Any"]],ro=[...Ye,["unknown"]].map(o=>o[0]),Yt=new Map(Ye);function no(o){for(const[l,h]of Yt)if(o===h)return l;return"unknown"}function ao(o){if(Ze(o))return{width:o.naturalWidth,height:o.naturalHeight};if(Qe(o))return{width:o.width.baseVal.value,height:o.height.baseVal.value};if(Je(o))return{width:o.videoWidth,height:o.videoHeight};if(tr(o))return{width:o.width,height:o.height};if(rr(o))return{width:o.displayWidth,height:o.displayHeight};if(Ke(o))return{width:o.width,height:o.height};if(er(o))return{width:o.width,height:o.height};throw new TypeError("The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'.")}function Ze(o){var l,h;try{return o instanceof((h=(l=o==null?void 0:o.ownerDocument)==null?void 0:l.defaultView)==null?void 0:h.HTMLImageElement)}catch{return!1}}function Qe(o){var l,h;try{return o instanceof((h=(l=o==null?void 0:o.ownerDocument)==null?void 0:l.defaultView)==null?void 0:h.SVGImageElement)}catch{return!1}}function Je(o){var l,h;try{return o instanceof((h=(l=o==null?void 0:o.ownerDocument)==null?void 0:l.defaultView)==null?void 0:h.HTMLVideoElement)}catch{return!1}}function Ke(o){var l,h;try{return o instanceof((h=(l=o==null?void 0:o.ownerDocument)==null?void 0:l.defaultView)==null?void 0:h.HTMLCanvasElement)}catch{return!1}}function tr(o){try{return o instanceof ImageBitmap||Object.prototype.toString.call(o)==="[object ImageBitmap]"}catch{return!1}}function er(o){try{return o instanceof OffscreenCanvas||Object.prototype.toString.call(o)==="[object OffscreenCanvas]"}catch{return!1}}function rr(o){try{return o instanceof VideoFrame||Object.prototype.toString.call(o)==="[object VideoFrame]"}catch{return!1}}function oo(o){try{return o instanceof Blob||Object.prototype.toString.call(o)==="[object Blob]"}catch{return!1}}function io(o){try{return o instanceof ImageData||Object.prototype.toString.call(o)==="[object ImageData]"}catch{return!1}}function so(o,l){try{const h=new OffscreenCanvas(o,l);if(h.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return h;throw void 0}catch{const h=document.createElement("canvas");return h.width=o,h.height=l,h}}async function nr(o){if(Ze(o)&&!await fo(o))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(Qe(o)&&!await ho(o))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(rr(o)&&po(o))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(Je(o)&&(o.readyState===0||o.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(tr(o)&&vo(o))throw new DOMException("The image source is detached.","InvalidStateError");const{width:l,height:h}=ao(o);if(l===0||h===0)return null;const f=so(l,h).getContext("2d");f.drawImage(o,0,0);try{return f.getImageData(0,0,l,h)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function uo(o){let l;try{l=await createImageBitmap(o)}catch{try{if(globalThis.Image){l=new Image;let f="";try{f=URL.createObjectURL(o),l.src=f,await l.decode()}finally{URL.revokeObjectURL(f)}}else return o}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}}return await nr(l)}function co(o){const{width:l,height:h}=o;if(l===0||h===0)return null;const b=o.getContext("2d");try{return b.getImageData(0,0,l,h)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function lo(o){if(oo(o))return await uo(o);if(io(o)){if(yo(o))throw new DOMException("The image data has been detached.","InvalidStateError");return o}return Ke(o)||er(o)?co(o):await nr(o)}async function fo(o){try{return await o.decode(),!0}catch{return!1}}async function ho(o){var l;try{return await((l=o.decode)==null?void 0:l.call(o)),!0}catch{return!1}}function po(o){return o.format===null}function yo(o){return o.data.buffer.byteLength===0}function vo(o){return o.width===0&&o.height===0}function Xe(o,l){return mo(o)?new DOMException(`${l}: ${o.message}`,o.name):go(o)?new o.constructor(`${l}: ${o.message}`):new Error(`${l}: ${o}`)}function mo(o){return o instanceof DOMException||Object.prototype.toString.call(o)==="[object DOMException]"}function go(o){return o instanceof Error||Object.prototype.toString.call(o)==="[object Error]"}var ft;class wo{constructor(l={}){ke(this,ft);var h;try{const b=(h=l==null?void 0:l.formats)==null?void 0:h.filter(f=>f!=="unknown");if((b==null?void 0:b.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const f of b!=null?b:[])if(!Yt.has(f))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${f}' is not a valid enum value of type BarcodeFormat.`);Ne(this,ft,b!=null?b:[]),Qt({fireImmediately:!0}).catch(()=>{})}catch(b){throw Xe(b,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return ro.filter(l=>l!=="unknown")}async detect(l){try{const h=await lo(l);if(h===null)return[];let b;const f={tryCode39ExtendedMode:!1,textMode:"Plain",formats:He(this,ft).map(I=>Yt.get(I))};try{b=await to(h,f)}catch(I){throw console.error(I),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return b.map(I=>{const{topLeft:{x:D,y:M},topRight:{x:_,y:A},bottomLeft:{x:U,y:G},bottomRight:{x:tt,y:X}}=I.position,nt=Math.min(D,_,U,tt),V=Math.min(M,A,G,X),q=Math.max(D,_,U,tt),dt=Math.max(M,A,G,X);return{boundingBox:new DOMRectReadOnly(nt,V,q-nt,dt-V),rawValue:I.text,format:no(I.format),cornerPoints:[{x:D,y:M},{x:_,y:A},{x:tt,y:X},{x:U,y:G}]}})}catch(h){throw Xe(h,"Failed to execute 'detect' on 'BarcodeDetector'")}}}ft=new WeakMap;exports.BarcodeDetector=wo;exports.ZXING_CPP_COMMIT=Xa;exports.ZXING_WASM_SHA256=eo;exports.ZXING_WASM_VERSION=Ga;exports.prepareZXingModule=Qt;exports.purgeZXingModule=Ja;exports.setZXingModuleOverrides=Ka;
|