barcode-detector 3.0.5 → 3.0.6
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/dist/cjs/ponyfill.js +1 -1
- package/dist/es/ponyfill.js +3 -3
- package/dist/iife/index.js +1 -1
- package/dist/iife/polyfill.js +1 -1
- package/dist/iife/ponyfill.js +1 -1
- package/package.json +16 -16
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.0",Ka="0a3797f698b339c1c01c487a7a43f1368610f503",to={locateFile:(o,l)=>{const h=o.match(/_(.+?)\.wasm$/);return h?`https://fastly.jsdelivr.net/npm/zxing-wasm@2.2.0/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="68d20eb8c486afabf49fab6d9fbc5f118df8648ec6200e8039ef8912a169c00c",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 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;
|
package/dist/es/ponyfill.js
CHANGED
|
@@ -160,10 +160,10 @@ function Qa(o) {
|
|
|
160
160
|
eccLevel: o.ecLevel
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
|
-
const bo = "2.2.
|
|
163
|
+
const bo = "2.2.2", Co = "c0a7c6cd2165457c721c58045edd22ffee9624e9", Ja = {
|
|
164
164
|
locateFile: (o, l) => {
|
|
165
165
|
const h = o.match(/_(.+?)\.wasm$/);
|
|
166
|
-
return h ? `https://fastly.jsdelivr.net/npm/zxing-wasm@2.2.
|
|
166
|
+
return h ? `https://fastly.jsdelivr.net/npm/zxing-wasm@2.2.2/dist/${h[1]}/${o}` : l + o;
|
|
167
167
|
}
|
|
168
168
|
}, It = /* @__PURE__ */ new WeakMap();
|
|
169
169
|
function Ka(o, l) {
|
|
@@ -1783,7 +1783,7 @@ function Po(o) {
|
|
|
1783
1783
|
async function ro(o, l) {
|
|
1784
1784
|
return eo(Kt, o, l);
|
|
1785
1785
|
}
|
|
1786
|
-
const _o = "
|
|
1786
|
+
const _o = "1c961d9d9a1f0001f5d00486bcf8e1b1a91fcf9fe17ebcbd6e2b6efe21e23038", ke = [
|
|
1787
1787
|
["aztec", "Aztec"],
|
|
1788
1788
|
["code_128", "Code128"],
|
|
1789
1789
|
["code_39", "Code39"],
|
package/dist/iife/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var BarcodeDetectionAPI=function(_){"use strict";var Ze=_=>{throw TypeError(_)};var Qe=(_,M,R)=>M.has(_)||Ze("Cannot "+R);var Je=(_,M,R)=>(Qe(_,M,"read from private field"),R?R.call(_):M.get(_)),Ke=(_,M,R)=>M.has(_)?Ze("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(_):M.set(_,R),tr=(_,M,R,gt)=>(Qe(_,M,"write to private field"),gt?gt.call(_,R):M.set(_,R),R);var ct,me;const M=[["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"]],R=M.map(([i])=>i),gt=R.filter((i,f)=>M[f][1]==="L"),er=R.filter((i,f)=>M[f][1]==="M");function Lt(i){switch(i){case"Linear-Codes":return gt.reduce((f,p)=>f|Lt(p),0);case"Matrix-Codes":return er.reduce((f,p)=>f|Lt(p),0);case"Any":return(1<<M.length)-1;case"None":return 0;default:return 1<<R.indexOf(i)}}function rr(i){if(i===0)return"None";const f=31-Math.clz32(i);return R[f]}function nr(i){return i.reduce((f,p)=>f|Lt(p),0)}const ar=["LocalAverage","GlobalHistogram","FixedThreshold","BoolCast"];function or(i){return ar.indexOf(i)}const ne=["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 ir(i){return i==="UnicodeBig"?ne.indexOf("UTF16BE"):ne.indexOf(i)}const sr=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function ur(i){return sr[i]}const cr=["Ignore","Read","Require"];function lr(i){return cr.indexOf(i)}const fr=["Plain","ECI","HRI","Hex","Escaped"];function dr(i){return fr.indexOf(i)}const wt={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 ae(i){return{...i,formats:nr(i.formats),binarizer:or(i.binarizer),eanAddOnSymbol:lr(i.eanAddOnSymbol),textMode:dr(i.textMode),characterSet:ir(i.characterSet)}}function hr(i){return{...i,format:rr(i.format),contentType:ur(i.contentType),eccLevel:i.ecLevel}}const pr="2.2.0",vr="0a3797f698b339c1c01c487a7a43f1368610f503",yr={locateFile:(i,f)=>{const p=i.match(/_(.+?)\.wasm$/);return p?`https://fastly.jsdelivr.net/npm/zxing-wasm@2.2.0/dist/${p[1]}/${i}`:f+i}},$t=new WeakMap;function mr(i,f){return Object.is(i,f)||Object.keys(i).length===Object.keys(f).length&&Object.keys(i).every(p=>Object.hasOwn(f,p)&&i[p]===f[p])}function oe(i,{overrides:f,equalityFn:p=mr,fireImmediately:l=!1}={}){var C;const[A,F]=(C=$t.get(i))!=null?C:[yr],L=f!=null?f:A;let S;if(l){if(F&&(S=p(A,L)))return F;const j=i({...L});return $t.set(i,[L,j]),j}(S!=null?S:p(A,L))||$t.set(i,[L])}function gr(i){$t.delete(i)}async function wr(i,f,p=wt){const l={...wt,...p},C=await oe(i,{fireImmediately:!0});let A,F;if("width"in f&&"height"in f&&"data"in f){const{data:S,data:{byteLength:j},width:q,height:Z}=f;F=C._malloc(j),C.HEAPU8.set(S,F),A=C.readBarcodesFromPixmap(F,q,Z,ae(l))}else{let S,j;if("buffer"in f)[S,j]=[f.byteLength,f];else if("byteLength"in f)[S,j]=[f.byteLength,new Uint8Array(f)];else if("size"in f)[S,j]=[f.size,new Uint8Array(await f.arrayBuffer())];else throw new TypeError("Invalid input type");F=C._malloc(S),C.HEAPU8.set(j,F),A=C.readBarcodesFromImage(F,S,ae(l))}C._free(F);const L=[];for(let S=0;S<A.size();++S)L.push(hr(A.get(S)));return L}({...wt,formats:[...wt.formats]});var Wt=async function(i={}){var f,p,l=i,C,A,F=new Promise((e,t)=>{C=e,A=t}),L=typeof window=="object",S=typeof Bun<"u",j=typeof WorkerGlobalScope<"u";typeof process=="object"&&!((p=process.versions)===null||p===void 0)&&p.node&&process.type!="renderer";var q="./this.program",Z,Q="";function lt(e){return l.locateFile?l.locateFile(e,Q):Q+e}var ft,at;if(L||j||S){try{Q=new URL(".",Z).href}catch{}j&&(at=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),ft=async e=>{var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw new Error(t.status+" : "+t.url)}}var bt=console.log.bind(console),Y=console.error.bind(console),dt,Ct,ge=!1,J,V,Tt,ot,it,P,we,$e;function be(){var e=Ct.buffer;J=new Int8Array(e),Tt=new Int16Array(e),l.HEAPU8=V=new Uint8Array(e),ot=new Uint16Array(e),it=new Int32Array(e),P=new Uint32Array(e),we=new Float32Array(e),$e=new Float64Array(e)}function Ur(){if(l.preRun)for(typeof l.preRun=="function"&&(l.preRun=[l.preRun]);l.preRun.length;)Kr(l.preRun.shift());Ce(Pe)}function Vr(){E.ya()}function kr(){if(l.postRun)for(typeof l.postRun=="function"&&(l.postRun=[l.postRun]);l.postRun.length;)Jr(l.postRun.shift());Ce(Te)}var K=0,ht=null;function Hr(e){var t;K++,(t=l.monitorRunDependencies)===null||t===void 0||t.call(l,K)}function Nr(e){var t;if(K--,(t=l.monitorRunDependencies)===null||t===void 0||t.call(l,K),K==0&&ht){var r=ht;ht=null,r()}}function kt(e){var t;(t=l.onAbort)===null||t===void 0||t.call(l,e),e="Aborted("+e+")",Y(e),ge=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw A(r),r}var Pt;function zr(){return lt("zxing_reader.wasm")}function Gr(e){if(e==Pt&&dt)return new Uint8Array(dt);if(at)return at(e);throw"both async and sync fetching of the wasm failed"}async function Xr(e){if(!dt)try{var t=await ft(e);return new Uint8Array(t)}catch{}return Gr(e)}async function qr(e,t){try{var r=await Xr(e),n=await WebAssembly.instantiate(r,t);return n}catch(a){Y(`failed to asynchronously prepare wasm: ${a}`),kt(a)}}async function Yr(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(o){Y(`wasm streaming compile failed: ${o}`),Y("falling back to ArrayBuffer instantiation")}return qr(t,r)}function Zr(){return{a:Ma}}async function Qr(){function e(o,u){return E=o.exports,Ct=E.xa,be(),Fe=E.Ba,Nr(),E}Hr();function t(o){return e(o.instance)}var r=Zr();if(l.instantiateWasm)return new Promise((o,u)=>{l.instantiateWasm(r,(s,c)=>{o(e(s))})});Pt!=null||(Pt=zr());try{var n=await Yr(dt,Pt,r),a=t(n);return a}catch(o){return A(o),Promise.reject(o)}}var Ce=e=>{for(;e.length>0;)e.shift()(l)},Te=[],Jr=e=>Te.push(e),Pe=[],Kr=e=>Pe.push(e),m=e=>Ba(e),g=()=>La(),_t=[],Et=0,tn=e=>{var t=new Ht(e);return t.get_caught()||(t.set_caught(!0),Et--),t.set_rethrown(!1),_t.push(t),Ua(e),ja(e)},N=0,en=()=>{y(0,0);var e=_t.pop();Wa(e.excPtr),N=0};class Ht{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,J[this.ptr+12]=t}get_caught(){return J[this.ptr+12]!=0}set_rethrown(t){t=t?1:0,J[this.ptr+13]=t}get_rethrown(){return J[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 Ot=e=>Ra(e),Nt=e=>{var t=N;if(!t)return Ot(0),0;var r=new Ht(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return Ot(0),t;for(var a of e){if(a===0||a===n)break;var o=r.ptr+16;if(Va(a,n,o))return Ot(a),t}return Ot(n),t},rn=()=>Nt([]),nn=e=>Nt([e]),an=(e,t)=>Nt([e,t]),on=()=>{var e=_t.pop();e||kt("no exception to throw");var t=e.excPtr;throw e.get_rethrown()||(_t.push(e),e.set_rethrown(!0),e.set_caught(!1),Et++),N=t,N},sn=(e,t,r)=>{var n=new Ht(e);throw n.init(t,r),N=e,Et++,N},un=()=>Et,cn=e=>{throw N||(N=e),N},ln=()=>kt(""),At={},zt=e=>{for(;e.length;){var t=e.pop(),r=e.pop();r(t)}};function pt(e){return this.fromWireType(P[e>>2])}var st={},tt={},St={},fn=class extends Error{constructor(e){super(e),this.name="InternalError"}},Dt=e=>{throw new fn(e)},et=(e,t,r)=>{e.forEach(s=>St[s]=t);function n(s){var c=r(s);c.length!==e.length&&Dt("Mismatched type converter count");for(var d=0;d<e.length;++d)H(e[d],c[d])}var a=new Array(t.length),o=[],u=0;t.forEach((s,c)=>{tt.hasOwnProperty(s)?a[c]=tt[s]:(o.push(s),st.hasOwnProperty(s)||(st[s]=[]),st[s].push(()=>{a[c]=tt[s],++u,u===o.length&&n(a)}))}),o.length===0&&n(a)},dn=e=>{var t=At[e];delete At[e];var r=t.rawConstructor,n=t.rawDestructor,a=t.fields,o=a.map(u=>u.getterReturnType).concat(a.map(u=>u.setterArgumentType));et([e],o,u=>{var s={};return a.forEach((c,d)=>{var h=c.fieldName,v=u[d],$=u[d].optional,b=c.getter,O=c.getterContext,I=u[d+a.length],D=c.setter,x=c.setterContext;s[h]={read:X=>v.fromWireType(b(O,X)),write:(X,W)=>{var U=[];D(x,X,I.toWireType(U,W)),zt(U)},optional:$}}),[{name:t.name,fromWireType:c=>{var d={};for(var h in s)d[h]=s[h].read(c);return n(c),d},toWireType:(c,d)=>{for(var h in s)if(!(h in d)&&!s[h].optional)throw new TypeError(`Missing field: "${h}"`);var v=r();for(h in s)s[h].write(v,d[h]);return c!==null&&c.push(n,v),v},argPackAdvance:z,readValueFromPointer:pt,destructorFunction:n}]})},hn=(e,t,r,n,a)=>{},pn=()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);_e=e},_e,B=e=>{for(var t="",r=e;V[r];)t+=_e[V[r++]];return t},vt=class extends Error{constructor(e){super(e),this.name="BindingError"}},T=e=>{throw new vt(e)};function vn(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`),tt.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;T(`Cannot register type '${n}' twice`)}if(tt[e]=t,delete St[e],st.hasOwnProperty(e)){var a=st[e];delete st[e],a.forEach(o=>o())}}function H(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return vn(e,t,r)}var z=8,yn=(e,t,r,n)=>{t=B(t),H(e,{name:t,fromWireType:function(a){return!!a},toWireType:function(a,o){return o?r:n},argPackAdvance:z,readValueFromPointer:function(a){return this.fromWireType(V[a])},destructorFunction:null})},mn=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Gt=e=>{function t(r){return r.$$.ptrType.registeredClass.name}T(t(e)+" instance already deleted")},Xt=!1,Ee=e=>{},gn=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},Oe=e=>{e.count.value-=1;var t=e.count.value===0;t&&gn(e)},yt=e=>typeof FinalizationRegistry>"u"?(yt=t=>t,e):(Xt=new FinalizationRegistry(t=>{Oe(t.$$)}),yt=t=>{var r=t.$$,n=!!r.smartPtr;if(n){var a={$$:r};Xt.register(t,a,t)}return t},Ee=t=>Xt.unregister(t),yt(e)),wn=()=>{let e=It.prototype;Object.assign(e,{isAliasOf(r){if(!(this instanceof It)||!(r instanceof It))return!1;var n=this.$$.ptrType.registeredClass,a=this.$$.ptr;r.$$=r.$$;for(var o=r.$$.ptrType.registeredClass,u=r.$$.ptr;n.baseClass;)a=n.upcast(a),n=n.baseClass;for(;o.baseClass;)u=o.upcast(u),o=o.baseClass;return n===o&&a===u},clone(){if(this.$$.ptr||Gt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var r=yt(Object.create(Object.getPrototypeOf(this),{$$:{value:mn(this.$$)}}));return r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},delete(){this.$$.ptr||Gt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&T("Object already scheduled for deletion"),Ee(this),Oe(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Gt(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 It(){}var qt=(e,t)=>Object.defineProperty(t,"name",{value:e}),Ae={},Se=(e,t,r)=>{if(e[t].overloadTable===void 0){var n=e[t];e[t]=function(){for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return e[t].overloadTable.hasOwnProperty(o.length)||T(`Function '${r}' called with an invalid number of arguments (${o.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[o.length].apply(this,o)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},De=(e,t,r)=>{l.hasOwnProperty(e)?((r===void 0||l[e].overloadTable!==void 0&&l[e].overloadTable[r]!==void 0)&&T(`Cannot register public name '${e}' twice`),Se(l,e,e),l[e].overloadTable.hasOwnProperty(r)&&T(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),l[e].overloadTable[r]=t):(l[e]=t,l[e].argCount=r)},$n=48,bn=57,Cn=e=>{e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return t>=$n&&t<=bn?`_${e}`:e};function Tn(e,t,r,n,a,o,u,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=u,this.downcast=s,this.pureVirtualFunctions=[]}var Yt=(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},Zt=e=>{if(e===null)return"null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e};function Pn(e,t){if(t===null)return this.isReference&&T(`null is not a valid ${this.name}`),0;t.$$||T(`Cannot pass "${Zt(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=Yt(t.$$.ptr,r,this.registeredClass);return n}function _n(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 "${Zt(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=Yt(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,G.toHandle(()=>a.delete())),e!==null&&e.push(this.rawDestructor,r)}break;default:T("Unsupporting sharing policy")}return r}function En(e,t){if(t===null)return this.isReference&&T(`null is not a valid ${this.name}`),0;t.$$||T(`Cannot pass "${Zt(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=Yt(t.$$.ptr,r,this.registeredClass);return n}var Ie=(e,t,r)=>{if(t===r)return e;if(r.baseClass===void 0)return null;var n=Ie(e,t,r.baseClass);return n===null?null:r.downcast(n)},On={},An=(e,t)=>{for(t===void 0&&T("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t},Sn=(e,t)=>(t=An(e,t),On[t]),xt=(e,t)=>{(!t.ptrType||!t.ptr)&&Dt("makeClassHandle requires ptr and ptrType");var r=!!t.smartPtrType,n=!!t.smartPtr;return r!==n&&Dt("Both smartPtrType and smartPtr must be specified"),t.count={value:1},yt(Object.create(e,{$$:{value:t,writable:!0}}))};function Dn(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=Sn(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?xt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):xt(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var o=this.registeredClass.getActualType(t),u=Ae[o];if(!u)return a.call(this);var s;this.isConst?s=u.constPointerType:s=u.pointerType;var c=Ie(t,this.registeredClass,s.registeredClass);return c===null?a.call(this):this.isSmartPointer?xt(s.registeredClass.instancePrototype,{ptrType:s,ptr:c,smartPtrType:this,smartPtr:e}):xt(s.registeredClass.instancePrototype,{ptrType:s,ptr:c})}var In=()=>{Object.assign(Mt.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:z,readValueFromPointer:pt,fromWireType:Dn})};function Mt(e,t,r,n,a,o,u,s,c,d,h){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=u,this.rawGetPointee=s,this.rawConstructor=c,this.rawShare=d,this.rawDestructor=h,!a&&t.baseClass===void 0?n?(this.toWireType=Pn,this.destructorFunction=null):(this.toWireType=En,this.destructorFunction=null):this.toWireType=_n}var xe=(e,t,r)=>{l.hasOwnProperty(e)||Dt("Replacing nonexistent public symbol"),l[e].overloadTable!==void 0&&r!==void 0?l[e].overloadTable[r]=t:(l[e]=t,l[e].argCount=r)},Me=[],Fe,w=e=>{var t=Me[e];return t||(Me[e]=t=Fe.get(e)),t},xn=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},Mn=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),o=0;o<n;o++)a[o]=arguments[o];return xn(e,t,a,r)}},k=function(e,t){e=B(e);function r(){if(e.includes("j"))return Mn(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 Fn extends Error{}var je=e=>{var t=Fa(e),r=B(t);return nt(t),r},Ft=(e,t)=>{var r=[],n={};function a(o){if(!n[o]&&!tt[o]){if(St[o]){St[o].forEach(a);return}r.push(o),n[o]=!0}}throw t.forEach(a),new Fn(`${e}: `+r.map(je).join([", "]))},jn=(e,t,r,n,a,o,u,s,c,d,h,v,$)=>{h=B(h),o=k(a,o),s&&(s=k(u,s)),d&&(d=k(c,d)),$=k(v,$);var b=Cn(h);De(b,function(){Ft(`Cannot construct ${h} due to unbound types`,[n])}),et([e,t,r],n?[n]:[],O=>{O=O[0];var I,D;n?(I=O.registeredClass,D=I.instancePrototype):D=It.prototype;var x=qt(h,function(){if(Object.getPrototypeOf(this)!==X)throw new vt(`Use 'new' to construct ${h}`);if(W.constructor_body===void 0)throw new vt(`${h} has no accessible constructor`);for(var qe=arguments.length,Rt=new Array(qe),Bt=0;Bt<qe;Bt++)Rt[Bt]=arguments[Bt];var Ye=W.constructor_body[Rt.length];if(Ye===void 0)throw new vt(`Tried to invoke ctor of ${h} with invalid number of parameters (${Rt.length}) - expected (${Object.keys(W.constructor_body).toString()}) parameters instead!`);return Ye.apply(this,Rt)}),X=Object.create(D,{constructor:{value:x}});x.prototype=X;var W=new Tn(h,x,X,$,I,o,s,d);if(W.baseClass){var U,jt;(jt=(U=W.baseClass).__derivedClasses)!==null&&jt!==void 0||(U.__derivedClasses=[]),W.baseClass.__derivedClasses.push(W)}var Oo=new Mt(h,W,!0,!1,!1),Ge=new Mt(h+"*",W,!1,!1,!1),Xe=new Mt(h+" const*",W,!1,!0,!1);return Ae[e]={pointerType:Ge,constPointerType:Xe},xe(b,x),[Oo,Ge,Xe]})},Qt=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(P[t+n*4>>2]);return r};function Rn(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].destructorFunction===void 0)return!0;return!1}function Jt(e,t,r,n,a,o){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=Rn(t),d=t[0].name!=="void",h=u-2,v=new Array(h),$=[],b=[],O=function(){b.length=0;var I;$.length=s?2:1,$[0]=a,s&&(I=t[1].toWireType(b,this),$[1]=I);for(var D=0;D<h;++D)v[D]=t[D+2].toWireType(b,D<0||arguments.length<=D?void 0:arguments[D]),$.push(v[D]);var x=n(...$);function X(W){if(c)zt(b);else for(var U=s?1:2;U<t.length;U++){var jt=U===1?I:v[U-2];t[U].destructorFunction!==null&&t[U].destructorFunction(jt)}if(d)return t[0].fromWireType(W)}return X(x)};return qt(e,O)}var Bn=(e,t,r,n,a,o)=>{var u=Qt(t,r);a=k(n,a),et([],[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 vt(`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]=()=>{Ft(`Cannot construct ${s.name} due to unbound types`,u)},et([],u,d=>(d.splice(1,0,null),s.registeredClass.constructor_body[t-1]=Jt(c,d,null,a,o),[])),[]})},Re=e=>{e=e.trim();const t=e.indexOf("(");return t===-1?e:e.slice(0,t)},Ln=(e,t,r,n,a,o,u,s,c,d)=>{var h=Qt(r,n);t=B(t),t=Re(t),o=k(a,o),et([],[e],v=>{v=v[0];var $=`${v.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&v.registeredClass.pureVirtualFunctions.push(t);function b(){Ft(`Cannot call ${$} due to unbound types`,h)}var O=v.registeredClass.instancePrototype,I=O[t];return I===void 0||I.overloadTable===void 0&&I.className!==v.name&&I.argCount===r-2?(b.argCount=r-2,b.className=v.name,O[t]=b):(Se(O,t,$),O[t].overloadTable[r-2]=b),et([],h,D=>{var x=Jt($,D,v,o,u);return O[t].overloadTable===void 0?(x.argCount=r-2,O[t]=x):O[t].overloadTable[r-2]=x,[]}),[]})},Be=[],rt=[0,1,,1,null,1,!0,1,!1,1],Kt=e=>{e>9&&--rt[e+1]===0&&(rt[e]=void 0,Be.push(e))},G={toValue:e=>(e||T(`Cannot use deleted val. handle = ${e}`),rt[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=Be.pop()||rt.length;return rt[t]=e,rt[t+1]=1,t}}}},Le={name:"emscripten::val",fromWireType:e=>{var t=G.toValue(e);return Kt(e),t},toWireType:(e,t)=>G.toHandle(t),argPackAdvance:z,readValueFromPointer:pt,destructorFunction:null},Wn=e=>H(e,Le),Un=(e,t)=>{switch(t){case 4:return function(r){return this.fromWireType(we[r>>2])};case 8:return function(r){return this.fromWireType($e[r>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Vn=(e,t,r)=>{t=B(t),H(e,{name:t,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:z,readValueFromPointer:Un(t,r),destructorFunction:null})},kn=(e,t,r,n,a,o,u,s)=>{var c=Qt(t,r);e=B(e),e=Re(e),a=k(n,a),De(e,function(){Ft(`Cannot call ${e} due to unbound types`,c)},t-1),et([],c,d=>{var h=[d[0],null].concat(d.slice(1));return xe(e,Jt(e,h,null,a,o),t-1),[]})},Hn=(e,t,r)=>{switch(t){case 1:return r?n=>J[n]:n=>V[n];case 2:return r?n=>Tt[n>>1]:n=>ot[n>>1];case 4:return r?n=>it[n>>2]:n=>P[n>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Nn=(e,t,r,n,a)=>{t=B(t);const o=n===0;let u=c=>c;if(o){var s=32-8*r;u=c=>c<<s>>>s,a=u(a)}H(e,{name:t,fromWireType:u,toWireType:(c,d)=>d,argPackAdvance:z,readValueFromPointer:Hn(t,r,n!==0),destructorFunction:null})},zn=(e,t,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[t];function o(u){var s=P[u>>2],c=P[u+4>>2];return new a(J.buffer,c,s)}r=B(r),H(e,{name:r,fromWireType:o,argPackAdvance:z,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Gn=Object.assign({optional:!0},Le),Xn=(e,t)=>{H(e,Gn)},qn=(e,t,r,n)=>{if(!(n>0))return 0;for(var a=r,o=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>=o)break;t[r++]=s}else if(s<=2047){if(r+1>=o)break;t[r++]=192|s>>6,t[r++]=128|s&63}else if(s<=65535){if(r+2>=o)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|s&63}else{if(r+3>=o)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},ut=(e,t,r)=>qn(e,V,t,r),We=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},Ue=typeof TextDecoder<"u"?new TextDecoder:void 0,Ve=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&&Ue)return Ue.decode(e.subarray(t,a));for(var o="";t<a;){var u=e[t++];if(!(u&128)){o+=String.fromCharCode(u);continue}var s=e[t++]&63;if((u&224)==192){o+=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)o+=String.fromCharCode(u);else{var d=u-65536;o+=String.fromCharCode(55296|d>>10,56320|d&1023)}}return o},Yn=(e,t)=>e?Ve(V,e,t):"",Zn=(e,t)=>{t=B(t),H(e,{name:t,fromWireType(r){for(var n=P[r>>2],a=r+4,o,s,u=a,s=0;s<=n;++s){var c=a+s;if(s==n||V[c]==0){var d=c-u,h=Yn(u,d);o===void 0?o=h:(o+="\0",o+=h),u=c+1}}return nt(r),o},toWireType(r,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var a,o=typeof n=="string";o||ArrayBuffer.isView(n)&&n.BYTES_PER_ELEMENT==1||T("Cannot pass non-string to std::string"),o?a=We(n):a=n.length;var u=ze(4+a+1),s=u+4;return P[u>>2]=a,o?ut(n,s,a+1):V.set(n,s),r!==null&&r.push(nt,u),u},argPackAdvance:z,readValueFromPointer:pt,destructorFunction(r){nt(r)}})},ke=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Qn=(e,t)=>{for(var r=e>>1,n=r+t/2,a=r;!(a>=n)&&ot[a];)++a;if(a-r>16&&ke)return ke.decode(ot.subarray(r,a));for(var o="",u=r;!(u>=n);++u){var s=ot[u];if(s==0)break;o+=String.fromCharCode(s)}return o},Jn=(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,o=0;o<a;++o){var u=e.charCodeAt(o);Tt[t>>1]=u,t+=2}return Tt[t>>1]=0,t-n},Kn=e=>e.length*2,ta=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var a=it[e+r*4>>2];if(a==0)break;if(++r,a>=65536){var o=a-65536;n+=String.fromCharCode(55296|o>>10,56320|o&1023)}else n+=String.fromCharCode(a)}return n},ea=(e,t,r)=>{if(r!=null||(r=2147483647),r<4)return 0;for(var n=t,a=n+r-4,o=0;o<e.length;++o){var u=e.charCodeAt(o);if(u>=55296&&u<=57343){var s=e.charCodeAt(++o);u=65536+((u&1023)<<10)|s&1023}if(it[t>>2]=u,t+=4,t+4>a)break}return it[t>>2]=0,t-n},ra=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},na=(e,t,r)=>{r=B(r);var n,a,o,u;t===2?(n=Qn,a=Jn,u=Kn,o=s=>ot[s>>1]):t===4&&(n=ta,a=ea,u=ra,o=s=>P[s>>2]),H(e,{name:r,fromWireType:s=>{for(var c=P[s>>2],d,h=s+4,v=0;v<=c;++v){var $=s+4+v*t;if(v==c||o($)==0){var b=$-h,O=n(h,b);d===void 0?d=O:(d+="\0",d+=O),h=$+t}}return nt(s),d},toWireType:(s,c)=>{typeof c!="string"&&T(`Cannot pass non-string to C++ string type ${r}`);var d=u(c),h=ze(4+d+t);return P[h>>2]=d/t,a(c,h+4,d+t),s!==null&&s.push(nt,h),h},argPackAdvance:z,readValueFromPointer:pt,destructorFunction(s){nt(s)}})},aa=(e,t,r,n,a,o)=>{At[e]={name:B(t),rawConstructor:k(r,n),rawDestructor:k(a,o),fields:[]}},oa=(e,t,r,n,a,o,u,s,c,d)=>{At[e].fields.push({fieldName:B(t),getterReturnType:r,getter:k(n,a),getterContext:o,setterArgumentType:u,setter:k(s,c),setterContext:d})},ia=(e,t)=>{t=B(t),H(e,{isVoid:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})},te=[],sa=(e,t,r,n)=>(e=te[e],t=G.toValue(t),e(null,t,r,n)),ua={},ca=e=>{var t=ua[e];return t===void 0?B(e):t},He=()=>{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.")},la=e=>e===0?G.toHandle(He()):(e=ca(e),G.toHandle(He()[e])),fa=e=>{var t=te.length;return te.push(e),t},Ne=(e,t)=>{var r=tt[e];return r===void 0&&T(`${t} has unknown type ${je(e)}`),r},da=(e,t)=>{for(var r=new Array(e),n=0;n<e;++n)r[n]=Ne(P[t+n*4>>2],`parameter ${n}`);return r},ha=(e,t,r)=>{var n=[],a=e.toWireType(n,r);return n.length&&(P[t>>2]=G.toHandle(n)),a},pa=Reflect.construct,va=(e,t,r)=>{var n=da(e,t),a=n.shift();e--;var o=new Array(e),u=(c,d,h,v)=>{for(var $=0,b=0;b<e;++b)o[b]=n[b].readValueFromPointer(v+$),$+=n[b].argPackAdvance;var O=r===1?pa(d,o):d.apply(c,o);return ha(a,h,O)},s=`methodCaller<(${n.map(c=>c.name).join(", ")}) => ${a.name}>`;return fa(qt(s,u))},ya=e=>{e>9&&(rt[e+1]+=1)},ma=e=>{var t=G.toValue(e);zt(t),Kt(e)},ga=(e,t)=>{e=Ne(e,"_emval_take_value");var r=e.readValueFromPointer(t);return G.toHandle(r)},wa=(e,t,r,n)=>{var a=new Date().getFullYear(),o=new Date(a,0,1),u=new Date(a,6,1),s=o.getTimezoneOffset(),c=u.getTimezoneOffset(),d=Math.max(s,c);P[e>>2]=d*60,it[t>>2]=+(s!=c);var h=b=>{var O=b>=0?"-":"+",I=Math.abs(b),D=String(Math.floor(I/60)).padStart(2,"0"),x=String(I%60).padStart(2,"0");return`UTC${O}${D}${x}`},v=h(s),$=h(c);c<s?(ut(v,r,17),ut($,n,17)):(ut(v,n,17),ut($,r,17))},$a=()=>2147483648,ba=(e,t)=>Math.ceil(e/t)*t,Ca=e=>{var t=Ct.buffer,r=(e-t.byteLength+65535)/65536|0;try{return Ct.grow(r),be(),1}catch{}},Ta=e=>{var t=V.length;e>>>=0;var r=$a();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 o=Math.min(r,ba(Math.max(e,a),65536)),u=Ca(o);if(u)return!0}return!1},ee={},Pa=()=>q||"./this.program",mt=()=>{if(!mt.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,_:Pa()};for(var r in ee)ee[r]===void 0?delete t[r]:t[r]=ee[r];var n=[];for(var r in t)n.push(`${r}=${t[r]}`);mt.strings=n}return mt.strings},_a=(e,t)=>{var r=0,n=0;for(var a of mt()){var o=t+r;P[e+n>>2]=o,r+=ut(a,o,1/0)+1,n+=4}return 0},Ea=(e,t)=>{var r=mt();P[e>>2]=r.length;var n=0;for(var a of r)n+=We(a)+1;return P[t>>2]=n,0},Oa=e=>52;function Aa(e,t,r,n,a){return 70}var Sa=[null,[],[]],Da=(e,t)=>{var r=Sa[e];t===0||t===10?((e===1?bt:Y)(Ve(r)),r.length=0):r.push(t)},Ia=(e,t,r,n)=>{for(var a=0,o=0;o<r;o++){var u=P[t>>2],s=P[t+4>>2];t+=8;for(var c=0;c<s;c++)Da(e,V[u+c]);a+=s}return P[n>>2]=a,0},xa=e=>e;pn(),wn(),In(),l.noExitRuntime&&l.noExitRuntime,l.print&&(bt=l.print),l.printErr&&(Y=l.printErr),l.wasmBinary&&(dt=l.wasmBinary),l.arguments&&l.arguments,l.thisProgram&&(q=l.thisProgram);var Ma={s:tn,w:en,a:rn,j:nn,m:an,P:on,p:sn,ga:un,d:cn,ba:ln,ua:dn,aa:hn,pa:yn,sa:jn,ra:Bn,H:Ln,na:Wn,V:Vn,W:kn,x:Nn,t:zn,ta:Xn,oa:Zn,Q:na,I:aa,va:oa,qa:ia,da:sa,wa:Kt,D:la,ma:va,X:ya,Y:ma,U:ga,ca:wa,ha:Ta,ea:_a,fa:Ea,ia:Oa,_:Aa,S:Ia,K:po,C:yo,M:Ga,R:Co,q:co,b:Ya,E:ho,ka:go,c:Za,ja:wo,h:za,i:to,r:ao,O:fo,v:io,F:uo,L:lo,z:mo,J:To,$:Po,Z:_o,k:Qa,f:Na,e:qa,g:Xa,N:bo,l:Ka,la:vo,o:oo,B:eo,u:so,T:no,A:$o,n:Ja,G:ro,y:xa},E=await Qr();E.ya;var Fa=E.za,nt=l._free=E.Aa,ze=l._malloc=E.Ca,ja=E.Da,y=E.Ea,Ra=E.Fa,Ba=E.Ga,La=E.Ha,Wa=E.Ia,Ua=E.Ja,Va=E.Ka;l.dynCall_viijii=E.La;var ka=l.dynCall_iiijj=E.Ma;l.dynCall_jiji=E.Na;var Ha=l.dynCall_jiiii=E.Oa;l.dynCall_iiiiij=E.Pa,l.dynCall_iiiiijj=E.Qa,l.dynCall_iiiiiijj=E.Ra;function Na(e,t){var r=g();try{w(e)(t)}catch(n){if(m(r),n!==n+0)throw n;y(1,0)}}function za(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function Ga(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function Xa(e,t,r,n){var a=g();try{w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function qa(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 Ya(e,t){var r=g();try{return w(e)(t)}catch(n){if(m(r),n!==n+0)throw n;y(1,0)}}function Za(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 Qa(e){var t=g();try{w(e)()}catch(r){if(m(t),r!==r+0)throw r;y(1,0)}}function Ja(e,t,r,n,a,o,u,s,c,d,h){var v=g();try{w(e)(t,r,n,a,o,u,s,c,d,h)}catch($){if(m(v),$!==$+0)throw $;y(1,0)}}function Ka(e,t,r,n,a){var o=g();try{w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function to(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function eo(e,t,r,n,a,o,u){var s=g();try{w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function ro(e,t,r,n,a,o,u,s,c,d,h,v,$,b,O,I){var D=g();try{w(e)(t,r,n,a,o,u,s,c,d,h,v,$,b,O,I)}catch(x){if(m(D),x!==x+0)throw x;y(1,0)}}function no(e,t,r,n,a,o,u,s,c){var d=g();try{w(e)(t,r,n,a,o,u,s,c)}catch(h){if(m(d),h!==h+0)throw h;y(1,0)}}function ao(e,t,r,n,a,o){var u=g();try{return w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function oo(e,t,r,n,a,o){var u=g();try{w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function io(e,t,r,n,a,o,u){var s=g();try{return w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function so(e,t,r,n,a,o,u,s){var c=g();try{w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function uo(e,t,r,n,a,o,u,s){var c=g();try{return w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function co(e){var t=g();try{return w(e)()}catch(r){if(m(t),r!==r+0)throw r;y(1,0)}}function lo(e,t,r,n,a,o,u,s,c){var d=g();try{return w(e)(t,r,n,a,o,u,s,c)}catch(h){if(m(d),h!==h+0)throw h;y(1,0)}}function fo(e,t,r,n,a,o,u){var s=g();try{return w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function ho(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function po(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function vo(e,t,r,n,a,o,u,s){var c=g();try{w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function yo(e,t,r,n,a,o){var u=g();try{return w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function mo(e,t,r,n,a,o,u,s,c,d){var h=g();try{return w(e)(t,r,n,a,o,u,s,c,d)}catch(v){if(m(h),v!==v+0)throw v;y(1,0)}}function go(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 wo(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function $o(e,t,r,n,a,o,u,s,c,d){var h=g();try{w(e)(t,r,n,a,o,u,s,c,d)}catch(v){if(m(h),v!==v+0)throw v;y(1,0)}}function bo(e,t,r,n,a,o,u){var s=g();try{w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function Co(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function To(e,t,r,n,a,o,u,s,c,d,h,v){var $=g();try{return w(e)(t,r,n,a,o,u,s,c,d,h,v)}catch(b){if(m($),b!==b+0)throw b;y(1,0)}}function Po(e,t,r,n,a,o,u){var s=g();try{return ka(e,t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function _o(e,t,r,n,a){var o=g();try{return Ha(e,t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function re(){if(K>0){ht=re;return}if(Ur(),K>0){ht=re;return}function e(){var t;l.calledRun=!0,!ge&&(Vr(),C(l),(t=l.onRuntimeInitialized)===null||t===void 0||t.call(l),kr())}l.setStatus?(l.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>l.setStatus(""),1),e()},1)):e()}function Eo(){if(l.preInit)for(typeof l.preInit=="function"&&(l.preInit=[l.preInit]);l.preInit.length>0;)l.preInit.shift()()}return Eo(),re(),f=F,f};function Ut(i){return oe(Wt,i)}function $r(){return gr(Wt)}function br(i){Ut({overrides:i,equalityFn:Object.is,fireImmediately:!1})}async function Cr(i,f){return wr(Wt,i,f)}const Tr="68d20eb8c486afabf49fab6d9fbc5f118df8648ec6200e8039ef8912a169c00c",ie=[["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"]],Pr=[...ie,["unknown"]].map(i=>i[0]),Vt=new Map(ie);function _r(i){for(const[f,p]of Vt)if(i===p)return f;return"unknown"}function Er(i){if(se(i))return{width:i.naturalWidth,height:i.naturalHeight};if(ue(i))return{width:i.width.baseVal.value,height:i.height.baseVal.value};if(ce(i))return{width:i.videoWidth,height:i.videoHeight};if(fe(i))return{width:i.width,height:i.height};if(he(i))return{width:i.displayWidth,height:i.displayHeight};if(le(i))return{width:i.width,height:i.height};if(de(i))return{width:i.width,height:i.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 se(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLImageElement)}catch{return!1}}function ue(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.SVGImageElement)}catch{return!1}}function ce(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLVideoElement)}catch{return!1}}function le(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLCanvasElement)}catch{return!1}}function fe(i){try{return i instanceof ImageBitmap||Object.prototype.toString.call(i)==="[object ImageBitmap]"}catch{return!1}}function de(i){try{return i instanceof OffscreenCanvas||Object.prototype.toString.call(i)==="[object OffscreenCanvas]"}catch{return!1}}function he(i){try{return i instanceof VideoFrame||Object.prototype.toString.call(i)==="[object VideoFrame]"}catch{return!1}}function Or(i){try{return i instanceof Blob||Object.prototype.toString.call(i)==="[object Blob]"}catch{return!1}}function Ar(i){try{return i instanceof ImageData||Object.prototype.toString.call(i)==="[object ImageData]"}catch{return!1}}function Sr(i,f){try{const p=new OffscreenCanvas(i,f);if(p.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return p;throw void 0}catch{const p=document.createElement("canvas");return p.width=i,p.height=f,p}}async function pe(i){if(se(i)&&!await Mr(i))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(ue(i)&&!await Fr(i))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(he(i)&&jr(i))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(ce(i)&&(i.readyState===0||i.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(fe(i)&&Br(i))throw new DOMException("The image source is detached.","InvalidStateError");const{width:f,height:p}=Er(i);if(f===0||p===0)return null;const C=Sr(f,p).getContext("2d");C.drawImage(i,0,0);try{return C.getImageData(0,0,f,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Dr(i){let f;try{f=await createImageBitmap(i)}catch{try{if(globalThis.Image){f=new Image;let C="";try{C=URL.createObjectURL(i),f.src=C,await f.decode()}finally{URL.revokeObjectURL(C)}}else return i}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}}return await pe(f)}function Ir(i){const{width:f,height:p}=i;if(f===0||p===0)return null;const l=i.getContext("2d");try{return l.getImageData(0,0,f,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function xr(i){if(Or(i))return await Dr(i);if(Ar(i)){if(Rr(i))throw new DOMException("The image data has been detached.","InvalidStateError");return i}return le(i)||de(i)?Ir(i):await pe(i)}async function Mr(i){try{return await i.decode(),!0}catch{return!1}}async function Fr(i){var f;try{return await((f=i.decode)==null?void 0:f.call(i)),!0}catch{return!1}}function jr(i){return i.format===null}function Rr(i){return i.data.buffer.byteLength===0}function Br(i){return i.width===0&&i.height===0}function ve(i,f){return Lr(i)?new DOMException(`${f}: ${i.message}`,i.name):Wr(i)?new i.constructor(`${f}: ${i.message}`):new Error(`${f}: ${i}`)}function Lr(i){return i instanceof DOMException||Object.prototype.toString.call(i)==="[object DOMException]"}function Wr(i){return i instanceof Error||Object.prototype.toString.call(i)==="[object Error]"}class ye{constructor(f={}){Ke(this,ct);var p;try{const l=(p=f==null?void 0:f.formats)==null?void 0:p.filter(C=>C!=="unknown");if((l==null?void 0:l.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const C of l!=null?l:[])if(!Vt.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.`);tr(this,ct,l!=null?l:[]),Ut({fireImmediately:!0}).catch(()=>{})}catch(l){throw ve(l,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Pr.filter(f=>f!=="unknown")}async detect(f){try{const p=await xr(f);if(p===null)return[];let l;const C={tryCode39ExtendedMode:!1,textMode:"Plain",formats:Je(this,ct).map(A=>Vt.get(A))};try{l=await Cr(p,C)}catch(A){throw console.error(A),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return l.map(A=>{const{topLeft:{x:F,y:L},topRight:{x:S,y:j},bottomLeft:{x:q,y:Z},bottomRight:{x:Q,y:lt}}=A.position,ft=Math.min(F,S,q,Q),at=Math.min(L,j,Z,lt),bt=Math.max(F,S,q,Q),Y=Math.max(L,j,Z,lt);return{boundingBox:new DOMRectReadOnly(ft,at,bt-ft,Y-at),rawValue:A.text,format:_r(A.format),cornerPoints:[{x:F,y:L},{x:S,y:j},{x:Q,y:lt},{x:q,y:Z}]}})}catch(p){throw ve(p,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return ct=new WeakMap,(me=globalThis.BarcodeDetector)!=null||(globalThis.BarcodeDetector=ye),_.BarcodeDetector=ye,_.ZXING_CPP_COMMIT=vr,_.ZXING_WASM_SHA256=Tr,_.ZXING_WASM_VERSION=pr,_.prepareZXingModule=Ut,_.purgeZXingModule=$r,_.setZXingModuleOverrides=br,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}),_}({});
|
|
1
|
+
var BarcodeDetectionAPI=function(_){"use strict";var Ze=_=>{throw TypeError(_)};var Qe=(_,M,R)=>M.has(_)||Ze("Cannot "+R);var Je=(_,M,R)=>(Qe(_,M,"read from private field"),R?R.call(_):M.get(_)),Ke=(_,M,R)=>M.has(_)?Ze("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(_):M.set(_,R),tr=(_,M,R,gt)=>(Qe(_,M,"write to private field"),gt?gt.call(_,R):M.set(_,R),R);var ct,me;const M=[["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"]],R=M.map(([i])=>i),gt=R.filter((i,f)=>M[f][1]==="L"),er=R.filter((i,f)=>M[f][1]==="M");function Lt(i){switch(i){case"Linear-Codes":return gt.reduce((f,p)=>f|Lt(p),0);case"Matrix-Codes":return er.reduce((f,p)=>f|Lt(p),0);case"Any":return(1<<M.length)-1;case"None":return 0;default:return 1<<R.indexOf(i)}}function rr(i){if(i===0)return"None";const f=31-Math.clz32(i);return R[f]}function nr(i){return i.reduce((f,p)=>f|Lt(p),0)}const ar=["LocalAverage","GlobalHistogram","FixedThreshold","BoolCast"];function or(i){return ar.indexOf(i)}const ne=["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 ir(i){return i==="UnicodeBig"?ne.indexOf("UTF16BE"):ne.indexOf(i)}const sr=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function ur(i){return sr[i]}const cr=["Ignore","Read","Require"];function lr(i){return cr.indexOf(i)}const fr=["Plain","ECI","HRI","Hex","Escaped"];function dr(i){return fr.indexOf(i)}const wt={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 ae(i){return{...i,formats:nr(i.formats),binarizer:or(i.binarizer),eanAddOnSymbol:lr(i.eanAddOnSymbol),textMode:dr(i.textMode),characterSet:ir(i.characterSet)}}function hr(i){return{...i,format:rr(i.format),contentType:ur(i.contentType),eccLevel:i.ecLevel}}const pr="2.2.2",vr="c0a7c6cd2165457c721c58045edd22ffee9624e9",yr={locateFile:(i,f)=>{const p=i.match(/_(.+?)\.wasm$/);return p?`https://fastly.jsdelivr.net/npm/zxing-wasm@2.2.2/dist/${p[1]}/${i}`:f+i}},$t=new WeakMap;function mr(i,f){return Object.is(i,f)||Object.keys(i).length===Object.keys(f).length&&Object.keys(i).every(p=>Object.hasOwn(f,p)&&i[p]===f[p])}function oe(i,{overrides:f,equalityFn:p=mr,fireImmediately:l=!1}={}){var C;const[A,F]=(C=$t.get(i))!=null?C:[yr],L=f!=null?f:A;let S;if(l){if(F&&(S=p(A,L)))return F;const j=i({...L});return $t.set(i,[L,j]),j}(S!=null?S:p(A,L))||$t.set(i,[L])}function gr(i){$t.delete(i)}async function wr(i,f,p=wt){const l={...wt,...p},C=await oe(i,{fireImmediately:!0});let A,F;if("width"in f&&"height"in f&&"data"in f){const{data:S,data:{byteLength:j},width:q,height:Z}=f;F=C._malloc(j),C.HEAPU8.set(S,F),A=C.readBarcodesFromPixmap(F,q,Z,ae(l))}else{let S,j;if("buffer"in f)[S,j]=[f.byteLength,f];else if("byteLength"in f)[S,j]=[f.byteLength,new Uint8Array(f)];else if("size"in f)[S,j]=[f.size,new Uint8Array(await f.arrayBuffer())];else throw new TypeError("Invalid input type");F=C._malloc(S),C.HEAPU8.set(j,F),A=C.readBarcodesFromImage(F,S,ae(l))}C._free(F);const L=[];for(let S=0;S<A.size();++S)L.push(hr(A.get(S)));return L}({...wt,formats:[...wt.formats]});var Wt=async function(i={}){var f,p,l=i,C,A,F=new Promise((e,t)=>{C=e,A=t}),L=typeof window=="object",S=typeof Bun<"u",j=typeof WorkerGlobalScope<"u";typeof process=="object"&&!((p=process.versions)===null||p===void 0)&&p.node&&process.type!="renderer";var q="./this.program",Z,Q="";function lt(e){return l.locateFile?l.locateFile(e,Q):Q+e}var ft,at;if(L||j||S){try{Q=new URL(".",Z).href}catch{}j&&(at=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),ft=async e=>{var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw new Error(t.status+" : "+t.url)}}var bt=console.log.bind(console),Y=console.error.bind(console),dt,Ct,ge=!1,J,V,Tt,ot,it,P,we,$e;function be(){var e=Ct.buffer;J=new Int8Array(e),Tt=new Int16Array(e),l.HEAPU8=V=new Uint8Array(e),ot=new Uint16Array(e),it=new Int32Array(e),P=new Uint32Array(e),we=new Float32Array(e),$e=new Float64Array(e)}function Ur(){if(l.preRun)for(typeof l.preRun=="function"&&(l.preRun=[l.preRun]);l.preRun.length;)Kr(l.preRun.shift());Ce(Pe)}function Vr(){E.ya()}function kr(){if(l.postRun)for(typeof l.postRun=="function"&&(l.postRun=[l.postRun]);l.postRun.length;)Jr(l.postRun.shift());Ce(Te)}var K=0,ht=null;function Hr(e){var t;K++,(t=l.monitorRunDependencies)===null||t===void 0||t.call(l,K)}function Nr(e){var t;if(K--,(t=l.monitorRunDependencies)===null||t===void 0||t.call(l,K),K==0&&ht){var r=ht;ht=null,r()}}function kt(e){var t;(t=l.onAbort)===null||t===void 0||t.call(l,e),e="Aborted("+e+")",Y(e),ge=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw A(r),r}var Pt;function zr(){return lt("zxing_reader.wasm")}function Gr(e){if(e==Pt&&dt)return new Uint8Array(dt);if(at)return at(e);throw"both async and sync fetching of the wasm failed"}async function Xr(e){if(!dt)try{var t=await ft(e);return new Uint8Array(t)}catch{}return Gr(e)}async function qr(e,t){try{var r=await Xr(e),n=await WebAssembly.instantiate(r,t);return n}catch(a){Y(`failed to asynchronously prepare wasm: ${a}`),kt(a)}}async function Yr(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(o){Y(`wasm streaming compile failed: ${o}`),Y("falling back to ArrayBuffer instantiation")}return qr(t,r)}function Zr(){return{a:Ma}}async function Qr(){function e(o,u){return E=o.exports,Ct=E.xa,be(),Fe=E.Ba,Nr(),E}Hr();function t(o){return e(o.instance)}var r=Zr();if(l.instantiateWasm)return new Promise((o,u)=>{l.instantiateWasm(r,(s,c)=>{o(e(s))})});Pt!=null||(Pt=zr());try{var n=await Yr(dt,Pt,r),a=t(n);return a}catch(o){return A(o),Promise.reject(o)}}var Ce=e=>{for(;e.length>0;)e.shift()(l)},Te=[],Jr=e=>Te.push(e),Pe=[],Kr=e=>Pe.push(e),m=e=>Ba(e),g=()=>La(),_t=[],Et=0,tn=e=>{var t=new Ht(e);return t.get_caught()||(t.set_caught(!0),Et--),t.set_rethrown(!1),_t.push(t),Ua(e),ja(e)},N=0,en=()=>{y(0,0);var e=_t.pop();Wa(e.excPtr),N=0};class Ht{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,J[this.ptr+12]=t}get_caught(){return J[this.ptr+12]!=0}set_rethrown(t){t=t?1:0,J[this.ptr+13]=t}get_rethrown(){return J[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 Ot=e=>Ra(e),Nt=e=>{var t=N;if(!t)return Ot(0),0;var r=new Ht(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return Ot(0),t;for(var a of e){if(a===0||a===n)break;var o=r.ptr+16;if(Va(a,n,o))return Ot(a),t}return Ot(n),t},rn=()=>Nt([]),nn=e=>Nt([e]),an=(e,t)=>Nt([e,t]),on=()=>{var e=_t.pop();e||kt("no exception to throw");var t=e.excPtr;throw e.get_rethrown()||(_t.push(e),e.set_rethrown(!0),e.set_caught(!1),Et++),N=t,N},sn=(e,t,r)=>{var n=new Ht(e);throw n.init(t,r),N=e,Et++,N},un=()=>Et,cn=e=>{throw N||(N=e),N},ln=()=>kt(""),At={},zt=e=>{for(;e.length;){var t=e.pop(),r=e.pop();r(t)}};function pt(e){return this.fromWireType(P[e>>2])}var st={},tt={},St={},fn=class extends Error{constructor(e){super(e),this.name="InternalError"}},Dt=e=>{throw new fn(e)},et=(e,t,r)=>{e.forEach(s=>St[s]=t);function n(s){var c=r(s);c.length!==e.length&&Dt("Mismatched type converter count");for(var d=0;d<e.length;++d)H(e[d],c[d])}var a=new Array(t.length),o=[],u=0;t.forEach((s,c)=>{tt.hasOwnProperty(s)?a[c]=tt[s]:(o.push(s),st.hasOwnProperty(s)||(st[s]=[]),st[s].push(()=>{a[c]=tt[s],++u,u===o.length&&n(a)}))}),o.length===0&&n(a)},dn=e=>{var t=At[e];delete At[e];var r=t.rawConstructor,n=t.rawDestructor,a=t.fields,o=a.map(u=>u.getterReturnType).concat(a.map(u=>u.setterArgumentType));et([e],o,u=>{var s={};return a.forEach((c,d)=>{var h=c.fieldName,v=u[d],$=u[d].optional,b=c.getter,O=c.getterContext,I=u[d+a.length],D=c.setter,x=c.setterContext;s[h]={read:X=>v.fromWireType(b(O,X)),write:(X,W)=>{var U=[];D(x,X,I.toWireType(U,W)),zt(U)},optional:$}}),[{name:t.name,fromWireType:c=>{var d={};for(var h in s)d[h]=s[h].read(c);return n(c),d},toWireType:(c,d)=>{for(var h in s)if(!(h in d)&&!s[h].optional)throw new TypeError(`Missing field: "${h}"`);var v=r();for(h in s)s[h].write(v,d[h]);return c!==null&&c.push(n,v),v},argPackAdvance:z,readValueFromPointer:pt,destructorFunction:n}]})},hn=(e,t,r,n,a)=>{},pn=()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);_e=e},_e,B=e=>{for(var t="",r=e;V[r];)t+=_e[V[r++]];return t},vt=class extends Error{constructor(e){super(e),this.name="BindingError"}},T=e=>{throw new vt(e)};function vn(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`),tt.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;T(`Cannot register type '${n}' twice`)}if(tt[e]=t,delete St[e],st.hasOwnProperty(e)){var a=st[e];delete st[e],a.forEach(o=>o())}}function H(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return vn(e,t,r)}var z=8,yn=(e,t,r,n)=>{t=B(t),H(e,{name:t,fromWireType:function(a){return!!a},toWireType:function(a,o){return o?r:n},argPackAdvance:z,readValueFromPointer:function(a){return this.fromWireType(V[a])},destructorFunction:null})},mn=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Gt=e=>{function t(r){return r.$$.ptrType.registeredClass.name}T(t(e)+" instance already deleted")},Xt=!1,Ee=e=>{},gn=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},Oe=e=>{e.count.value-=1;var t=e.count.value===0;t&&gn(e)},yt=e=>typeof FinalizationRegistry>"u"?(yt=t=>t,e):(Xt=new FinalizationRegistry(t=>{Oe(t.$$)}),yt=t=>{var r=t.$$,n=!!r.smartPtr;if(n){var a={$$:r};Xt.register(t,a,t)}return t},Ee=t=>Xt.unregister(t),yt(e)),wn=()=>{let e=It.prototype;Object.assign(e,{isAliasOf(r){if(!(this instanceof It)||!(r instanceof It))return!1;var n=this.$$.ptrType.registeredClass,a=this.$$.ptr;r.$$=r.$$;for(var o=r.$$.ptrType.registeredClass,u=r.$$.ptr;n.baseClass;)a=n.upcast(a),n=n.baseClass;for(;o.baseClass;)u=o.upcast(u),o=o.baseClass;return n===o&&a===u},clone(){if(this.$$.ptr||Gt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var r=yt(Object.create(Object.getPrototypeOf(this),{$$:{value:mn(this.$$)}}));return r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},delete(){this.$$.ptr||Gt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&T("Object already scheduled for deletion"),Ee(this),Oe(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Gt(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 It(){}var qt=(e,t)=>Object.defineProperty(t,"name",{value:e}),Ae={},Se=(e,t,r)=>{if(e[t].overloadTable===void 0){var n=e[t];e[t]=function(){for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return e[t].overloadTable.hasOwnProperty(o.length)||T(`Function '${r}' called with an invalid number of arguments (${o.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[o.length].apply(this,o)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},De=(e,t,r)=>{l.hasOwnProperty(e)?((r===void 0||l[e].overloadTable!==void 0&&l[e].overloadTable[r]!==void 0)&&T(`Cannot register public name '${e}' twice`),Se(l,e,e),l[e].overloadTable.hasOwnProperty(r)&&T(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),l[e].overloadTable[r]=t):(l[e]=t,l[e].argCount=r)},$n=48,bn=57,Cn=e=>{e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return t>=$n&&t<=bn?`_${e}`:e};function Tn(e,t,r,n,a,o,u,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=u,this.downcast=s,this.pureVirtualFunctions=[]}var Yt=(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},Zt=e=>{if(e===null)return"null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e};function Pn(e,t){if(t===null)return this.isReference&&T(`null is not a valid ${this.name}`),0;t.$$||T(`Cannot pass "${Zt(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=Yt(t.$$.ptr,r,this.registeredClass);return n}function _n(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 "${Zt(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=Yt(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,G.toHandle(()=>a.delete())),e!==null&&e.push(this.rawDestructor,r)}break;default:T("Unsupporting sharing policy")}return r}function En(e,t){if(t===null)return this.isReference&&T(`null is not a valid ${this.name}`),0;t.$$||T(`Cannot pass "${Zt(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=Yt(t.$$.ptr,r,this.registeredClass);return n}var Ie=(e,t,r)=>{if(t===r)return e;if(r.baseClass===void 0)return null;var n=Ie(e,t,r.baseClass);return n===null?null:r.downcast(n)},On={},An=(e,t)=>{for(t===void 0&&T("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t},Sn=(e,t)=>(t=An(e,t),On[t]),xt=(e,t)=>{(!t.ptrType||!t.ptr)&&Dt("makeClassHandle requires ptr and ptrType");var r=!!t.smartPtrType,n=!!t.smartPtr;return r!==n&&Dt("Both smartPtrType and smartPtr must be specified"),t.count={value:1},yt(Object.create(e,{$$:{value:t,writable:!0}}))};function Dn(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=Sn(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?xt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):xt(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var o=this.registeredClass.getActualType(t),u=Ae[o];if(!u)return a.call(this);var s;this.isConst?s=u.constPointerType:s=u.pointerType;var c=Ie(t,this.registeredClass,s.registeredClass);return c===null?a.call(this):this.isSmartPointer?xt(s.registeredClass.instancePrototype,{ptrType:s,ptr:c,smartPtrType:this,smartPtr:e}):xt(s.registeredClass.instancePrototype,{ptrType:s,ptr:c})}var In=()=>{Object.assign(Mt.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:z,readValueFromPointer:pt,fromWireType:Dn})};function Mt(e,t,r,n,a,o,u,s,c,d,h){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=u,this.rawGetPointee=s,this.rawConstructor=c,this.rawShare=d,this.rawDestructor=h,!a&&t.baseClass===void 0?n?(this.toWireType=Pn,this.destructorFunction=null):(this.toWireType=En,this.destructorFunction=null):this.toWireType=_n}var xe=(e,t,r)=>{l.hasOwnProperty(e)||Dt("Replacing nonexistent public symbol"),l[e].overloadTable!==void 0&&r!==void 0?l[e].overloadTable[r]=t:(l[e]=t,l[e].argCount=r)},Me=[],Fe,w=e=>{var t=Me[e];return t||(Me[e]=t=Fe.get(e)),t},xn=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},Mn=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),o=0;o<n;o++)a[o]=arguments[o];return xn(e,t,a,r)}},k=function(e,t){e=B(e);function r(){if(e.includes("j"))return Mn(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 Fn extends Error{}var je=e=>{var t=Fa(e),r=B(t);return nt(t),r},Ft=(e,t)=>{var r=[],n={};function a(o){if(!n[o]&&!tt[o]){if(St[o]){St[o].forEach(a);return}r.push(o),n[o]=!0}}throw t.forEach(a),new Fn(`${e}: `+r.map(je).join([", "]))},jn=(e,t,r,n,a,o,u,s,c,d,h,v,$)=>{h=B(h),o=k(a,o),s&&(s=k(u,s)),d&&(d=k(c,d)),$=k(v,$);var b=Cn(h);De(b,function(){Ft(`Cannot construct ${h} due to unbound types`,[n])}),et([e,t,r],n?[n]:[],O=>{O=O[0];var I,D;n?(I=O.registeredClass,D=I.instancePrototype):D=It.prototype;var x=qt(h,function(){if(Object.getPrototypeOf(this)!==X)throw new vt(`Use 'new' to construct ${h}`);if(W.constructor_body===void 0)throw new vt(`${h} has no accessible constructor`);for(var qe=arguments.length,Rt=new Array(qe),Bt=0;Bt<qe;Bt++)Rt[Bt]=arguments[Bt];var Ye=W.constructor_body[Rt.length];if(Ye===void 0)throw new vt(`Tried to invoke ctor of ${h} with invalid number of parameters (${Rt.length}) - expected (${Object.keys(W.constructor_body).toString()}) parameters instead!`);return Ye.apply(this,Rt)}),X=Object.create(D,{constructor:{value:x}});x.prototype=X;var W=new Tn(h,x,X,$,I,o,s,d);if(W.baseClass){var U,jt;(jt=(U=W.baseClass).__derivedClasses)!==null&&jt!==void 0||(U.__derivedClasses=[]),W.baseClass.__derivedClasses.push(W)}var Oo=new Mt(h,W,!0,!1,!1),Ge=new Mt(h+"*",W,!1,!1,!1),Xe=new Mt(h+" const*",W,!1,!0,!1);return Ae[e]={pointerType:Ge,constPointerType:Xe},xe(b,x),[Oo,Ge,Xe]})},Qt=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(P[t+n*4>>2]);return r};function Rn(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].destructorFunction===void 0)return!0;return!1}function Jt(e,t,r,n,a,o){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=Rn(t),d=t[0].name!=="void",h=u-2,v=new Array(h),$=[],b=[],O=function(){b.length=0;var I;$.length=s?2:1,$[0]=a,s&&(I=t[1].toWireType(b,this),$[1]=I);for(var D=0;D<h;++D)v[D]=t[D+2].toWireType(b,D<0||arguments.length<=D?void 0:arguments[D]),$.push(v[D]);var x=n(...$);function X(W){if(c)zt(b);else for(var U=s?1:2;U<t.length;U++){var jt=U===1?I:v[U-2];t[U].destructorFunction!==null&&t[U].destructorFunction(jt)}if(d)return t[0].fromWireType(W)}return X(x)};return qt(e,O)}var Bn=(e,t,r,n,a,o)=>{var u=Qt(t,r);a=k(n,a),et([],[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 vt(`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]=()=>{Ft(`Cannot construct ${s.name} due to unbound types`,u)},et([],u,d=>(d.splice(1,0,null),s.registeredClass.constructor_body[t-1]=Jt(c,d,null,a,o),[])),[]})},Re=e=>{e=e.trim();const t=e.indexOf("(");return t===-1?e:e.slice(0,t)},Ln=(e,t,r,n,a,o,u,s,c,d)=>{var h=Qt(r,n);t=B(t),t=Re(t),o=k(a,o),et([],[e],v=>{v=v[0];var $=`${v.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&v.registeredClass.pureVirtualFunctions.push(t);function b(){Ft(`Cannot call ${$} due to unbound types`,h)}var O=v.registeredClass.instancePrototype,I=O[t];return I===void 0||I.overloadTable===void 0&&I.className!==v.name&&I.argCount===r-2?(b.argCount=r-2,b.className=v.name,O[t]=b):(Se(O,t,$),O[t].overloadTable[r-2]=b),et([],h,D=>{var x=Jt($,D,v,o,u);return O[t].overloadTable===void 0?(x.argCount=r-2,O[t]=x):O[t].overloadTable[r-2]=x,[]}),[]})},Be=[],rt=[0,1,,1,null,1,!0,1,!1,1],Kt=e=>{e>9&&--rt[e+1]===0&&(rt[e]=void 0,Be.push(e))},G={toValue:e=>(e||T(`Cannot use deleted val. handle = ${e}`),rt[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=Be.pop()||rt.length;return rt[t]=e,rt[t+1]=1,t}}}},Le={name:"emscripten::val",fromWireType:e=>{var t=G.toValue(e);return Kt(e),t},toWireType:(e,t)=>G.toHandle(t),argPackAdvance:z,readValueFromPointer:pt,destructorFunction:null},Wn=e=>H(e,Le),Un=(e,t)=>{switch(t){case 4:return function(r){return this.fromWireType(we[r>>2])};case 8:return function(r){return this.fromWireType($e[r>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Vn=(e,t,r)=>{t=B(t),H(e,{name:t,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:z,readValueFromPointer:Un(t,r),destructorFunction:null})},kn=(e,t,r,n,a,o,u,s)=>{var c=Qt(t,r);e=B(e),e=Re(e),a=k(n,a),De(e,function(){Ft(`Cannot call ${e} due to unbound types`,c)},t-1),et([],c,d=>{var h=[d[0],null].concat(d.slice(1));return xe(e,Jt(e,h,null,a,o),t-1),[]})},Hn=(e,t,r)=>{switch(t){case 1:return r?n=>J[n]:n=>V[n];case 2:return r?n=>Tt[n>>1]:n=>ot[n>>1];case 4:return r?n=>it[n>>2]:n=>P[n>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Nn=(e,t,r,n,a)=>{t=B(t);const o=n===0;let u=c=>c;if(o){var s=32-8*r;u=c=>c<<s>>>s,a=u(a)}H(e,{name:t,fromWireType:u,toWireType:(c,d)=>d,argPackAdvance:z,readValueFromPointer:Hn(t,r,n!==0),destructorFunction:null})},zn=(e,t,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[t];function o(u){var s=P[u>>2],c=P[u+4>>2];return new a(J.buffer,c,s)}r=B(r),H(e,{name:r,fromWireType:o,argPackAdvance:z,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Gn=Object.assign({optional:!0},Le),Xn=(e,t)=>{H(e,Gn)},qn=(e,t,r,n)=>{if(!(n>0))return 0;for(var a=r,o=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>=o)break;t[r++]=s}else if(s<=2047){if(r+1>=o)break;t[r++]=192|s>>6,t[r++]=128|s&63}else if(s<=65535){if(r+2>=o)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|s&63}else{if(r+3>=o)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},ut=(e,t,r)=>qn(e,V,t,r),We=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},Ue=typeof TextDecoder<"u"?new TextDecoder:void 0,Ve=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&&Ue)return Ue.decode(e.subarray(t,a));for(var o="";t<a;){var u=e[t++];if(!(u&128)){o+=String.fromCharCode(u);continue}var s=e[t++]&63;if((u&224)==192){o+=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)o+=String.fromCharCode(u);else{var d=u-65536;o+=String.fromCharCode(55296|d>>10,56320|d&1023)}}return o},Yn=(e,t)=>e?Ve(V,e,t):"",Zn=(e,t)=>{t=B(t),H(e,{name:t,fromWireType(r){for(var n=P[r>>2],a=r+4,o,s,u=a,s=0;s<=n;++s){var c=a+s;if(s==n||V[c]==0){var d=c-u,h=Yn(u,d);o===void 0?o=h:(o+="\0",o+=h),u=c+1}}return nt(r),o},toWireType(r,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var a,o=typeof n=="string";o||ArrayBuffer.isView(n)&&n.BYTES_PER_ELEMENT==1||T("Cannot pass non-string to std::string"),o?a=We(n):a=n.length;var u=ze(4+a+1),s=u+4;return P[u>>2]=a,o?ut(n,s,a+1):V.set(n,s),r!==null&&r.push(nt,u),u},argPackAdvance:z,readValueFromPointer:pt,destructorFunction(r){nt(r)}})},ke=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Qn=(e,t)=>{for(var r=e>>1,n=r+t/2,a=r;!(a>=n)&&ot[a];)++a;if(a-r>16&&ke)return ke.decode(ot.subarray(r,a));for(var o="",u=r;!(u>=n);++u){var s=ot[u];if(s==0)break;o+=String.fromCharCode(s)}return o},Jn=(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,o=0;o<a;++o){var u=e.charCodeAt(o);Tt[t>>1]=u,t+=2}return Tt[t>>1]=0,t-n},Kn=e=>e.length*2,ta=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var a=it[e+r*4>>2];if(a==0)break;if(++r,a>=65536){var o=a-65536;n+=String.fromCharCode(55296|o>>10,56320|o&1023)}else n+=String.fromCharCode(a)}return n},ea=(e,t,r)=>{if(r!=null||(r=2147483647),r<4)return 0;for(var n=t,a=n+r-4,o=0;o<e.length;++o){var u=e.charCodeAt(o);if(u>=55296&&u<=57343){var s=e.charCodeAt(++o);u=65536+((u&1023)<<10)|s&1023}if(it[t>>2]=u,t+=4,t+4>a)break}return it[t>>2]=0,t-n},ra=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},na=(e,t,r)=>{r=B(r);var n,a,o,u;t===2?(n=Qn,a=Jn,u=Kn,o=s=>ot[s>>1]):t===4&&(n=ta,a=ea,u=ra,o=s=>P[s>>2]),H(e,{name:r,fromWireType:s=>{for(var c=P[s>>2],d,h=s+4,v=0;v<=c;++v){var $=s+4+v*t;if(v==c||o($)==0){var b=$-h,O=n(h,b);d===void 0?d=O:(d+="\0",d+=O),h=$+t}}return nt(s),d},toWireType:(s,c)=>{typeof c!="string"&&T(`Cannot pass non-string to C++ string type ${r}`);var d=u(c),h=ze(4+d+t);return P[h>>2]=d/t,a(c,h+4,d+t),s!==null&&s.push(nt,h),h},argPackAdvance:z,readValueFromPointer:pt,destructorFunction(s){nt(s)}})},aa=(e,t,r,n,a,o)=>{At[e]={name:B(t),rawConstructor:k(r,n),rawDestructor:k(a,o),fields:[]}},oa=(e,t,r,n,a,o,u,s,c,d)=>{At[e].fields.push({fieldName:B(t),getterReturnType:r,getter:k(n,a),getterContext:o,setterArgumentType:u,setter:k(s,c),setterContext:d})},ia=(e,t)=>{t=B(t),H(e,{isVoid:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})},te=[],sa=(e,t,r,n)=>(e=te[e],t=G.toValue(t),e(null,t,r,n)),ua={},ca=e=>{var t=ua[e];return t===void 0?B(e):t},He=()=>{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.")},la=e=>e===0?G.toHandle(He()):(e=ca(e),G.toHandle(He()[e])),fa=e=>{var t=te.length;return te.push(e),t},Ne=(e,t)=>{var r=tt[e];return r===void 0&&T(`${t} has unknown type ${je(e)}`),r},da=(e,t)=>{for(var r=new Array(e),n=0;n<e;++n)r[n]=Ne(P[t+n*4>>2],`parameter ${n}`);return r},ha=(e,t,r)=>{var n=[],a=e.toWireType(n,r);return n.length&&(P[t>>2]=G.toHandle(n)),a},pa=Reflect.construct,va=(e,t,r)=>{var n=da(e,t),a=n.shift();e--;var o=new Array(e),u=(c,d,h,v)=>{for(var $=0,b=0;b<e;++b)o[b]=n[b].readValueFromPointer(v+$),$+=n[b].argPackAdvance;var O=r===1?pa(d,o):d.apply(c,o);return ha(a,h,O)},s=`methodCaller<(${n.map(c=>c.name).join(", ")}) => ${a.name}>`;return fa(qt(s,u))},ya=e=>{e>9&&(rt[e+1]+=1)},ma=e=>{var t=G.toValue(e);zt(t),Kt(e)},ga=(e,t)=>{e=Ne(e,"_emval_take_value");var r=e.readValueFromPointer(t);return G.toHandle(r)},wa=(e,t,r,n)=>{var a=new Date().getFullYear(),o=new Date(a,0,1),u=new Date(a,6,1),s=o.getTimezoneOffset(),c=u.getTimezoneOffset(),d=Math.max(s,c);P[e>>2]=d*60,it[t>>2]=+(s!=c);var h=b=>{var O=b>=0?"-":"+",I=Math.abs(b),D=String(Math.floor(I/60)).padStart(2,"0"),x=String(I%60).padStart(2,"0");return`UTC${O}${D}${x}`},v=h(s),$=h(c);c<s?(ut(v,r,17),ut($,n,17)):(ut(v,n,17),ut($,r,17))},$a=()=>2147483648,ba=(e,t)=>Math.ceil(e/t)*t,Ca=e=>{var t=Ct.buffer,r=(e-t.byteLength+65535)/65536|0;try{return Ct.grow(r),be(),1}catch{}},Ta=e=>{var t=V.length;e>>>=0;var r=$a();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 o=Math.min(r,ba(Math.max(e,a),65536)),u=Ca(o);if(u)return!0}return!1},ee={},Pa=()=>q||"./this.program",mt=()=>{if(!mt.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,_:Pa()};for(var r in ee)ee[r]===void 0?delete t[r]:t[r]=ee[r];var n=[];for(var r in t)n.push(`${r}=${t[r]}`);mt.strings=n}return mt.strings},_a=(e,t)=>{var r=0,n=0;for(var a of mt()){var o=t+r;P[e+n>>2]=o,r+=ut(a,o,1/0)+1,n+=4}return 0},Ea=(e,t)=>{var r=mt();P[e>>2]=r.length;var n=0;for(var a of r)n+=We(a)+1;return P[t>>2]=n,0},Oa=e=>52;function Aa(e,t,r,n,a){return 70}var Sa=[null,[],[]],Da=(e,t)=>{var r=Sa[e];t===0||t===10?((e===1?bt:Y)(Ve(r)),r.length=0):r.push(t)},Ia=(e,t,r,n)=>{for(var a=0,o=0;o<r;o++){var u=P[t>>2],s=P[t+4>>2];t+=8;for(var c=0;c<s;c++)Da(e,V[u+c]);a+=s}return P[n>>2]=a,0},xa=e=>e;pn(),wn(),In(),l.noExitRuntime&&l.noExitRuntime,l.print&&(bt=l.print),l.printErr&&(Y=l.printErr),l.wasmBinary&&(dt=l.wasmBinary),l.arguments&&l.arguments,l.thisProgram&&(q=l.thisProgram);var Ma={s:tn,w:en,a:rn,j:nn,m:an,P:on,p:sn,ga:un,d:cn,ba:ln,ua:dn,aa:hn,pa:yn,sa:jn,ra:Bn,H:Ln,na:Wn,V:Vn,W:kn,x:Nn,t:zn,ta:Xn,oa:Zn,Q:na,I:aa,va:oa,qa:ia,da:sa,wa:Kt,D:la,ma:va,X:ya,Y:ma,U:ga,ca:wa,ha:Ta,ea:_a,fa:Ea,ia:Oa,_:Aa,S:Ia,K:po,C:yo,M:Ga,R:Co,q:co,b:Ya,E:ho,ka:go,c:Za,ja:wo,h:za,i:to,r:ao,O:fo,v:io,F:uo,L:lo,z:mo,J:To,$:Po,Z:_o,k:Qa,f:Na,e:qa,g:Xa,N:bo,l:Ka,la:vo,o:oo,B:eo,u:so,T:no,A:$o,n:Ja,G:ro,y:xa},E=await Qr();E.ya;var Fa=E.za,nt=l._free=E.Aa,ze=l._malloc=E.Ca,ja=E.Da,y=E.Ea,Ra=E.Fa,Ba=E.Ga,La=E.Ha,Wa=E.Ia,Ua=E.Ja,Va=E.Ka;l.dynCall_viijii=E.La;var ka=l.dynCall_iiijj=E.Ma;l.dynCall_jiji=E.Na;var Ha=l.dynCall_jiiii=E.Oa;l.dynCall_iiiiij=E.Pa,l.dynCall_iiiiijj=E.Qa,l.dynCall_iiiiiijj=E.Ra;function Na(e,t){var r=g();try{w(e)(t)}catch(n){if(m(r),n!==n+0)throw n;y(1,0)}}function za(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function Ga(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function Xa(e,t,r,n){var a=g();try{w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function qa(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 Ya(e,t){var r=g();try{return w(e)(t)}catch(n){if(m(r),n!==n+0)throw n;y(1,0)}}function Za(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 Qa(e){var t=g();try{w(e)()}catch(r){if(m(t),r!==r+0)throw r;y(1,0)}}function Ja(e,t,r,n,a,o,u,s,c,d,h){var v=g();try{w(e)(t,r,n,a,o,u,s,c,d,h)}catch($){if(m(v),$!==$+0)throw $;y(1,0)}}function Ka(e,t,r,n,a){var o=g();try{w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function to(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function eo(e,t,r,n,a,o,u){var s=g();try{w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function ro(e,t,r,n,a,o,u,s,c,d,h,v,$,b,O,I){var D=g();try{w(e)(t,r,n,a,o,u,s,c,d,h,v,$,b,O,I)}catch(x){if(m(D),x!==x+0)throw x;y(1,0)}}function no(e,t,r,n,a,o,u,s,c){var d=g();try{w(e)(t,r,n,a,o,u,s,c)}catch(h){if(m(d),h!==h+0)throw h;y(1,0)}}function ao(e,t,r,n,a,o){var u=g();try{return w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function oo(e,t,r,n,a,o){var u=g();try{w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function io(e,t,r,n,a,o,u){var s=g();try{return w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function so(e,t,r,n,a,o,u,s){var c=g();try{w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function uo(e,t,r,n,a,o,u,s){var c=g();try{return w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function co(e){var t=g();try{return w(e)()}catch(r){if(m(t),r!==r+0)throw r;y(1,0)}}function lo(e,t,r,n,a,o,u,s,c){var d=g();try{return w(e)(t,r,n,a,o,u,s,c)}catch(h){if(m(d),h!==h+0)throw h;y(1,0)}}function fo(e,t,r,n,a,o,u){var s=g();try{return w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function ho(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function po(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function vo(e,t,r,n,a,o,u,s){var c=g();try{w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function yo(e,t,r,n,a,o){var u=g();try{return w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function mo(e,t,r,n,a,o,u,s,c,d){var h=g();try{return w(e)(t,r,n,a,o,u,s,c,d)}catch(v){if(m(h),v!==v+0)throw v;y(1,0)}}function go(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 wo(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function $o(e,t,r,n,a,o,u,s,c,d){var h=g();try{w(e)(t,r,n,a,o,u,s,c,d)}catch(v){if(m(h),v!==v+0)throw v;y(1,0)}}function bo(e,t,r,n,a,o,u){var s=g();try{w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function Co(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function To(e,t,r,n,a,o,u,s,c,d,h,v){var $=g();try{return w(e)(t,r,n,a,o,u,s,c,d,h,v)}catch(b){if(m($),b!==b+0)throw b;y(1,0)}}function Po(e,t,r,n,a,o,u){var s=g();try{return ka(e,t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function _o(e,t,r,n,a){var o=g();try{return Ha(e,t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function re(){if(K>0){ht=re;return}if(Ur(),K>0){ht=re;return}function e(){var t;l.calledRun=!0,!ge&&(Vr(),C(l),(t=l.onRuntimeInitialized)===null||t===void 0||t.call(l),kr())}l.setStatus?(l.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>l.setStatus(""),1),e()},1)):e()}function Eo(){if(l.preInit)for(typeof l.preInit=="function"&&(l.preInit=[l.preInit]);l.preInit.length>0;)l.preInit.shift()()}return Eo(),re(),f=F,f};function Ut(i){return oe(Wt,i)}function $r(){return gr(Wt)}function br(i){Ut({overrides:i,equalityFn:Object.is,fireImmediately:!1})}async function Cr(i,f){return wr(Wt,i,f)}const Tr="1c961d9d9a1f0001f5d00486bcf8e1b1a91fcf9fe17ebcbd6e2b6efe21e23038",ie=[["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"]],Pr=[...ie,["unknown"]].map(i=>i[0]),Vt=new Map(ie);function _r(i){for(const[f,p]of Vt)if(i===p)return f;return"unknown"}function Er(i){if(se(i))return{width:i.naturalWidth,height:i.naturalHeight};if(ue(i))return{width:i.width.baseVal.value,height:i.height.baseVal.value};if(ce(i))return{width:i.videoWidth,height:i.videoHeight};if(fe(i))return{width:i.width,height:i.height};if(he(i))return{width:i.displayWidth,height:i.displayHeight};if(le(i))return{width:i.width,height:i.height};if(de(i))return{width:i.width,height:i.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 se(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLImageElement)}catch{return!1}}function ue(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.SVGImageElement)}catch{return!1}}function ce(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLVideoElement)}catch{return!1}}function le(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLCanvasElement)}catch{return!1}}function fe(i){try{return i instanceof ImageBitmap||Object.prototype.toString.call(i)==="[object ImageBitmap]"}catch{return!1}}function de(i){try{return i instanceof OffscreenCanvas||Object.prototype.toString.call(i)==="[object OffscreenCanvas]"}catch{return!1}}function he(i){try{return i instanceof VideoFrame||Object.prototype.toString.call(i)==="[object VideoFrame]"}catch{return!1}}function Or(i){try{return i instanceof Blob||Object.prototype.toString.call(i)==="[object Blob]"}catch{return!1}}function Ar(i){try{return i instanceof ImageData||Object.prototype.toString.call(i)==="[object ImageData]"}catch{return!1}}function Sr(i,f){try{const p=new OffscreenCanvas(i,f);if(p.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return p;throw void 0}catch{const p=document.createElement("canvas");return p.width=i,p.height=f,p}}async function pe(i){if(se(i)&&!await Mr(i))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(ue(i)&&!await Fr(i))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(he(i)&&jr(i))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(ce(i)&&(i.readyState===0||i.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(fe(i)&&Br(i))throw new DOMException("The image source is detached.","InvalidStateError");const{width:f,height:p}=Er(i);if(f===0||p===0)return null;const C=Sr(f,p).getContext("2d");C.drawImage(i,0,0);try{return C.getImageData(0,0,f,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Dr(i){let f;try{f=await createImageBitmap(i)}catch{try{if(globalThis.Image){f=new Image;let C="";try{C=URL.createObjectURL(i),f.src=C,await f.decode()}finally{URL.revokeObjectURL(C)}}else return i}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}}return await pe(f)}function Ir(i){const{width:f,height:p}=i;if(f===0||p===0)return null;const l=i.getContext("2d");try{return l.getImageData(0,0,f,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function xr(i){if(Or(i))return await Dr(i);if(Ar(i)){if(Rr(i))throw new DOMException("The image data has been detached.","InvalidStateError");return i}return le(i)||de(i)?Ir(i):await pe(i)}async function Mr(i){try{return await i.decode(),!0}catch{return!1}}async function Fr(i){var f;try{return await((f=i.decode)==null?void 0:f.call(i)),!0}catch{return!1}}function jr(i){return i.format===null}function Rr(i){return i.data.buffer.byteLength===0}function Br(i){return i.width===0&&i.height===0}function ve(i,f){return Lr(i)?new DOMException(`${f}: ${i.message}`,i.name):Wr(i)?new i.constructor(`${f}: ${i.message}`):new Error(`${f}: ${i}`)}function Lr(i){return i instanceof DOMException||Object.prototype.toString.call(i)==="[object DOMException]"}function Wr(i){return i instanceof Error||Object.prototype.toString.call(i)==="[object Error]"}class ye{constructor(f={}){Ke(this,ct);var p;try{const l=(p=f==null?void 0:f.formats)==null?void 0:p.filter(C=>C!=="unknown");if((l==null?void 0:l.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const C of l!=null?l:[])if(!Vt.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.`);tr(this,ct,l!=null?l:[]),Ut({fireImmediately:!0}).catch(()=>{})}catch(l){throw ve(l,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Pr.filter(f=>f!=="unknown")}async detect(f){try{const p=await xr(f);if(p===null)return[];let l;const C={tryCode39ExtendedMode:!1,textMode:"Plain",formats:Je(this,ct).map(A=>Vt.get(A))};try{l=await Cr(p,C)}catch(A){throw console.error(A),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return l.map(A=>{const{topLeft:{x:F,y:L},topRight:{x:S,y:j},bottomLeft:{x:q,y:Z},bottomRight:{x:Q,y:lt}}=A.position,ft=Math.min(F,S,q,Q),at=Math.min(L,j,Z,lt),bt=Math.max(F,S,q,Q),Y=Math.max(L,j,Z,lt);return{boundingBox:new DOMRectReadOnly(ft,at,bt-ft,Y-at),rawValue:A.text,format:_r(A.format),cornerPoints:[{x:F,y:L},{x:S,y:j},{x:Q,y:lt},{x:q,y:Z}]}})}catch(p){throw ve(p,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return ct=new WeakMap,(me=globalThis.BarcodeDetector)!=null||(globalThis.BarcodeDetector=ye),_.BarcodeDetector=ye,_.ZXING_CPP_COMMIT=vr,_.ZXING_WASM_SHA256=Tr,_.ZXING_WASM_VERSION=pr,_.prepareZXingModule=Ut,_.purgeZXingModule=$r,_.setZXingModuleOverrides=br,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}),_}({});
|
package/dist/iife/polyfill.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var BarcodeDetectionAPI=function(_){"use strict";var Ye=_=>{throw TypeError(_)};var Ze=(_,M,R)=>M.has(_)||Ye("Cannot "+R);var Qe=(_,M,R)=>(Ze(_,M,"read from private field"),R?R.call(_):M.get(_)),Je=(_,M,R)=>M.has(_)?Ye("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(_):M.set(_,R),Ke=(_,M,R,gt)=>(Ze(_,M,"write to private field"),gt?gt.call(_,R):M.set(_,R),R);var ct,ye;const M=[["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"]],R=M.map(([i])=>i),gt=R.filter((i,f)=>M[f][1]==="L"),tr=R.filter((i,f)=>M[f][1]==="M");function Bt(i){switch(i){case"Linear-Codes":return gt.reduce((f,p)=>f|Bt(p),0);case"Matrix-Codes":return tr.reduce((f,p)=>f|Bt(p),0);case"Any":return(1<<M.length)-1;case"None":return 0;default:return 1<<R.indexOf(i)}}function er(i){if(i===0)return"None";const f=31-Math.clz32(i);return R[f]}function rr(i){return i.reduce((f,p)=>f|Bt(p),0)}const nr=["LocalAverage","GlobalHistogram","FixedThreshold","BoolCast"];function ar(i){return nr.indexOf(i)}const ne=["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 or(i){return i==="UnicodeBig"?ne.indexOf("UTF16BE"):ne.indexOf(i)}const ir=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function sr(i){return ir[i]}const ur=["Ignore","Read","Require"];function cr(i){return ur.indexOf(i)}const lr=["Plain","ECI","HRI","Hex","Escaped"];function fr(i){return lr.indexOf(i)}const wt={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 ae(i){return{...i,formats:rr(i.formats),binarizer:ar(i.binarizer),eanAddOnSymbol:cr(i.eanAddOnSymbol),textMode:fr(i.textMode),characterSet:or(i.characterSet)}}function dr(i){return{...i,format:er(i.format),contentType:sr(i.contentType),eccLevel:i.ecLevel}}const hr="2.2.0",pr="0a3797f698b339c1c01c487a7a43f1368610f503",vr={locateFile:(i,f)=>{const p=i.match(/_(.+?)\.wasm$/);return p?`https://fastly.jsdelivr.net/npm/zxing-wasm@2.2.0/dist/${p[1]}/${i}`:f+i}},$t=new WeakMap;function yr(i,f){return Object.is(i,f)||Object.keys(i).length===Object.keys(f).length&&Object.keys(i).every(p=>Object.hasOwn(f,p)&&i[p]===f[p])}function oe(i,{overrides:f,equalityFn:p=yr,fireImmediately:l=!1}={}){var C;const[A,F]=(C=$t.get(i))!=null?C:[vr],B=f!=null?f:A;let S;if(l){if(F&&(S=p(A,B)))return F;const j=i({...B});return $t.set(i,[B,j]),j}(S!=null?S:p(A,B))||$t.set(i,[B])}function mr(i){$t.delete(i)}async function gr(i,f,p=wt){const l={...wt,...p},C=await oe(i,{fireImmediately:!0});let A,F;if("width"in f&&"height"in f&&"data"in f){const{data:S,data:{byteLength:j},width:q,height:Z}=f;F=C._malloc(j),C.HEAPU8.set(S,F),A=C.readBarcodesFromPixmap(F,q,Z,ae(l))}else{let S,j;if("buffer"in f)[S,j]=[f.byteLength,f];else if("byteLength"in f)[S,j]=[f.byteLength,new Uint8Array(f)];else if("size"in f)[S,j]=[f.size,new Uint8Array(await f.arrayBuffer())];else throw new TypeError("Invalid input type");F=C._malloc(S),C.HEAPU8.set(j,F),A=C.readBarcodesFromImage(F,S,ae(l))}C._free(F);const B=[];for(let S=0;S<A.size();++S)B.push(dr(A.get(S)));return B}({...wt,formats:[...wt.formats]});var Wt=async function(i={}){var f,p,l=i,C,A,F=new Promise((e,t)=>{C=e,A=t}),B=typeof window=="object",S=typeof Bun<"u",j=typeof WorkerGlobalScope<"u";typeof process=="object"&&!((p=process.versions)===null||p===void 0)&&p.node&&process.type!="renderer";var q="./this.program",Z,Q="";function lt(e){return l.locateFile?l.locateFile(e,Q):Q+e}var ft,at;if(B||j||S){try{Q=new URL(".",Z).href}catch{}j&&(at=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),ft=async e=>{var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw new Error(t.status+" : "+t.url)}}var bt=console.log.bind(console),Y=console.error.bind(console),dt,Ct,me=!1,J,V,Tt,ot,it,P,ge,we;function $e(){var e=Ct.buffer;J=new Int8Array(e),Tt=new Int16Array(e),l.HEAPU8=V=new Uint8Array(e),ot=new Uint16Array(e),it=new Int32Array(e),P=new Uint32Array(e),ge=new Float32Array(e),we=new Float64Array(e)}function Ur(){if(l.preRun)for(typeof l.preRun=="function"&&(l.preRun=[l.preRun]);l.preRun.length;)Kr(l.preRun.shift());be(Te)}function Vr(){E.ya()}function kr(){if(l.postRun)for(typeof l.postRun=="function"&&(l.postRun=[l.postRun]);l.postRun.length;)Jr(l.postRun.shift());be(Ce)}var K=0,ht=null;function Hr(e){var t;K++,(t=l.monitorRunDependencies)===null||t===void 0||t.call(l,K)}function Nr(e){var t;if(K--,(t=l.monitorRunDependencies)===null||t===void 0||t.call(l,K),K==0&&ht){var r=ht;ht=null,r()}}function kt(e){var t;(t=l.onAbort)===null||t===void 0||t.call(l,e),e="Aborted("+e+")",Y(e),me=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw A(r),r}var Pt;function zr(){return lt("zxing_reader.wasm")}function Gr(e){if(e==Pt&&dt)return new Uint8Array(dt);if(at)return at(e);throw"both async and sync fetching of the wasm failed"}async function Xr(e){if(!dt)try{var t=await ft(e);return new Uint8Array(t)}catch{}return Gr(e)}async function qr(e,t){try{var r=await Xr(e),n=await WebAssembly.instantiate(r,t);return n}catch(a){Y(`failed to asynchronously prepare wasm: ${a}`),kt(a)}}async function Yr(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(o){Y(`wasm streaming compile failed: ${o}`),Y("falling back to ArrayBuffer instantiation")}return qr(t,r)}function Zr(){return{a:Ma}}async function Qr(){function e(o,u){return E=o.exports,Ct=E.xa,$e(),Me=E.Ba,Nr(),E}Hr();function t(o){return e(o.instance)}var r=Zr();if(l.instantiateWasm)return new Promise((o,u)=>{l.instantiateWasm(r,(s,c)=>{o(e(s))})});Pt!=null||(Pt=zr());try{var n=await Yr(dt,Pt,r),a=t(n);return a}catch(o){return A(o),Promise.reject(o)}}var be=e=>{for(;e.length>0;)e.shift()(l)},Ce=[],Jr=e=>Ce.push(e),Te=[],Kr=e=>Te.push(e),m=e=>La(e),g=()=>Ba(),_t=[],Et=0,tn=e=>{var t=new Ht(e);return t.get_caught()||(t.set_caught(!0),Et--),t.set_rethrown(!1),_t.push(t),Ua(e),ja(e)},N=0,en=()=>{y(0,0);var e=_t.pop();Wa(e.excPtr),N=0};class Ht{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,J[this.ptr+12]=t}get_caught(){return J[this.ptr+12]!=0}set_rethrown(t){t=t?1:0,J[this.ptr+13]=t}get_rethrown(){return J[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 Ot=e=>Ra(e),Nt=e=>{var t=N;if(!t)return Ot(0),0;var r=new Ht(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return Ot(0),t;for(var a of e){if(a===0||a===n)break;var o=r.ptr+16;if(Va(a,n,o))return Ot(a),t}return Ot(n),t},rn=()=>Nt([]),nn=e=>Nt([e]),an=(e,t)=>Nt([e,t]),on=()=>{var e=_t.pop();e||kt("no exception to throw");var t=e.excPtr;throw e.get_rethrown()||(_t.push(e),e.set_rethrown(!0),e.set_caught(!1),Et++),N=t,N},sn=(e,t,r)=>{var n=new Ht(e);throw n.init(t,r),N=e,Et++,N},un=()=>Et,cn=e=>{throw N||(N=e),N},ln=()=>kt(""),At={},zt=e=>{for(;e.length;){var t=e.pop(),r=e.pop();r(t)}};function pt(e){return this.fromWireType(P[e>>2])}var st={},tt={},St={},fn=class extends Error{constructor(e){super(e),this.name="InternalError"}},Dt=e=>{throw new fn(e)},et=(e,t,r)=>{e.forEach(s=>St[s]=t);function n(s){var c=r(s);c.length!==e.length&&Dt("Mismatched type converter count");for(var d=0;d<e.length;++d)H(e[d],c[d])}var a=new Array(t.length),o=[],u=0;t.forEach((s,c)=>{tt.hasOwnProperty(s)?a[c]=tt[s]:(o.push(s),st.hasOwnProperty(s)||(st[s]=[]),st[s].push(()=>{a[c]=tt[s],++u,u===o.length&&n(a)}))}),o.length===0&&n(a)},dn=e=>{var t=At[e];delete At[e];var r=t.rawConstructor,n=t.rawDestructor,a=t.fields,o=a.map(u=>u.getterReturnType).concat(a.map(u=>u.setterArgumentType));et([e],o,u=>{var s={};return a.forEach((c,d)=>{var h=c.fieldName,v=u[d],$=u[d].optional,b=c.getter,O=c.getterContext,x=u[d+a.length],D=c.setter,I=c.setterContext;s[h]={read:X=>v.fromWireType(b(O,X)),write:(X,W)=>{var U=[];D(I,X,x.toWireType(U,W)),zt(U)},optional:$}}),[{name:t.name,fromWireType:c=>{var d={};for(var h in s)d[h]=s[h].read(c);return n(c),d},toWireType:(c,d)=>{for(var h in s)if(!(h in d)&&!s[h].optional)throw new TypeError(`Missing field: "${h}"`);var v=r();for(h in s)s[h].write(v,d[h]);return c!==null&&c.push(n,v),v},argPackAdvance:z,readValueFromPointer:pt,destructorFunction:n}]})},hn=(e,t,r,n,a)=>{},pn=()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);Pe=e},Pe,L=e=>{for(var t="",r=e;V[r];)t+=Pe[V[r++]];return t},vt=class extends Error{constructor(e){super(e),this.name="BindingError"}},T=e=>{throw new vt(e)};function vn(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`),tt.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;T(`Cannot register type '${n}' twice`)}if(tt[e]=t,delete St[e],st.hasOwnProperty(e)){var a=st[e];delete st[e],a.forEach(o=>o())}}function H(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return vn(e,t,r)}var z=8,yn=(e,t,r,n)=>{t=L(t),H(e,{name:t,fromWireType:function(a){return!!a},toWireType:function(a,o){return o?r:n},argPackAdvance:z,readValueFromPointer:function(a){return this.fromWireType(V[a])},destructorFunction:null})},mn=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Gt=e=>{function t(r){return r.$$.ptrType.registeredClass.name}T(t(e)+" instance already deleted")},Xt=!1,_e=e=>{},gn=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},Ee=e=>{e.count.value-=1;var t=e.count.value===0;t&&gn(e)},yt=e=>typeof FinalizationRegistry>"u"?(yt=t=>t,e):(Xt=new FinalizationRegistry(t=>{Ee(t.$$)}),yt=t=>{var r=t.$$,n=!!r.smartPtr;if(n){var a={$$:r};Xt.register(t,a,t)}return t},_e=t=>Xt.unregister(t),yt(e)),wn=()=>{let e=xt.prototype;Object.assign(e,{isAliasOf(r){if(!(this instanceof xt)||!(r instanceof xt))return!1;var n=this.$$.ptrType.registeredClass,a=this.$$.ptr;r.$$=r.$$;for(var o=r.$$.ptrType.registeredClass,u=r.$$.ptr;n.baseClass;)a=n.upcast(a),n=n.baseClass;for(;o.baseClass;)u=o.upcast(u),o=o.baseClass;return n===o&&a===u},clone(){if(this.$$.ptr||Gt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var r=yt(Object.create(Object.getPrototypeOf(this),{$$:{value:mn(this.$$)}}));return r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},delete(){this.$$.ptr||Gt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&T("Object already scheduled for deletion"),_e(this),Ee(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Gt(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 xt(){}var qt=(e,t)=>Object.defineProperty(t,"name",{value:e}),Oe={},Ae=(e,t,r)=>{if(e[t].overloadTable===void 0){var n=e[t];e[t]=function(){for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return e[t].overloadTable.hasOwnProperty(o.length)||T(`Function '${r}' called with an invalid number of arguments (${o.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[o.length].apply(this,o)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},Se=(e,t,r)=>{l.hasOwnProperty(e)?((r===void 0||l[e].overloadTable!==void 0&&l[e].overloadTable[r]!==void 0)&&T(`Cannot register public name '${e}' twice`),Ae(l,e,e),l[e].overloadTable.hasOwnProperty(r)&&T(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),l[e].overloadTable[r]=t):(l[e]=t,l[e].argCount=r)},$n=48,bn=57,Cn=e=>{e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return t>=$n&&t<=bn?`_${e}`:e};function Tn(e,t,r,n,a,o,u,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=u,this.downcast=s,this.pureVirtualFunctions=[]}var Yt=(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},Zt=e=>{if(e===null)return"null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e};function Pn(e,t){if(t===null)return this.isReference&&T(`null is not a valid ${this.name}`),0;t.$$||T(`Cannot pass "${Zt(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=Yt(t.$$.ptr,r,this.registeredClass);return n}function _n(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 "${Zt(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=Yt(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,G.toHandle(()=>a.delete())),e!==null&&e.push(this.rawDestructor,r)}break;default:T("Unsupporting sharing policy")}return r}function En(e,t){if(t===null)return this.isReference&&T(`null is not a valid ${this.name}`),0;t.$$||T(`Cannot pass "${Zt(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=Yt(t.$$.ptr,r,this.registeredClass);return n}var De=(e,t,r)=>{if(t===r)return e;if(r.baseClass===void 0)return null;var n=De(e,t,r.baseClass);return n===null?null:r.downcast(n)},On={},An=(e,t)=>{for(t===void 0&&T("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t},Sn=(e,t)=>(t=An(e,t),On[t]),It=(e,t)=>{(!t.ptrType||!t.ptr)&&Dt("makeClassHandle requires ptr and ptrType");var r=!!t.smartPtrType,n=!!t.smartPtr;return r!==n&&Dt("Both smartPtrType and smartPtr must be specified"),t.count={value:1},yt(Object.create(e,{$$:{value:t,writable:!0}}))};function Dn(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=Sn(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?It(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):It(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var o=this.registeredClass.getActualType(t),u=Oe[o];if(!u)return a.call(this);var s;this.isConst?s=u.constPointerType:s=u.pointerType;var c=De(t,this.registeredClass,s.registeredClass);return c===null?a.call(this):this.isSmartPointer?It(s.registeredClass.instancePrototype,{ptrType:s,ptr:c,smartPtrType:this,smartPtr:e}):It(s.registeredClass.instancePrototype,{ptrType:s,ptr:c})}var xn=()=>{Object.assign(Mt.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:z,readValueFromPointer:pt,fromWireType:Dn})};function Mt(e,t,r,n,a,o,u,s,c,d,h){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=u,this.rawGetPointee=s,this.rawConstructor=c,this.rawShare=d,this.rawDestructor=h,!a&&t.baseClass===void 0?n?(this.toWireType=Pn,this.destructorFunction=null):(this.toWireType=En,this.destructorFunction=null):this.toWireType=_n}var xe=(e,t,r)=>{l.hasOwnProperty(e)||Dt("Replacing nonexistent public symbol"),l[e].overloadTable!==void 0&&r!==void 0?l[e].overloadTable[r]=t:(l[e]=t,l[e].argCount=r)},Ie=[],Me,w=e=>{var t=Ie[e];return t||(Ie[e]=t=Me.get(e)),t},In=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},Mn=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),o=0;o<n;o++)a[o]=arguments[o];return In(e,t,a,r)}},k=function(e,t){e=L(e);function r(){if(e.includes("j"))return Mn(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 Fn extends Error{}var Fe=e=>{var t=Fa(e),r=L(t);return nt(t),r},Ft=(e,t)=>{var r=[],n={};function a(o){if(!n[o]&&!tt[o]){if(St[o]){St[o].forEach(a);return}r.push(o),n[o]=!0}}throw t.forEach(a),new Fn(`${e}: `+r.map(Fe).join([", "]))},jn=(e,t,r,n,a,o,u,s,c,d,h,v,$)=>{h=L(h),o=k(a,o),s&&(s=k(u,s)),d&&(d=k(c,d)),$=k(v,$);var b=Cn(h);Se(b,function(){Ft(`Cannot construct ${h} due to unbound types`,[n])}),et([e,t,r],n?[n]:[],O=>{O=O[0];var x,D;n?(x=O.registeredClass,D=x.instancePrototype):D=xt.prototype;var I=qt(h,function(){if(Object.getPrototypeOf(this)!==X)throw new vt(`Use 'new' to construct ${h}`);if(W.constructor_body===void 0)throw new vt(`${h} has no accessible constructor`);for(var Xe=arguments.length,Rt=new Array(Xe),Lt=0;Lt<Xe;Lt++)Rt[Lt]=arguments[Lt];var qe=W.constructor_body[Rt.length];if(qe===void 0)throw new vt(`Tried to invoke ctor of ${h} with invalid number of parameters (${Rt.length}) - expected (${Object.keys(W.constructor_body).toString()}) parameters instead!`);return qe.apply(this,Rt)}),X=Object.create(D,{constructor:{value:I}});I.prototype=X;var W=new Tn(h,I,X,$,x,o,s,d);if(W.baseClass){var U,jt;(jt=(U=W.baseClass).__derivedClasses)!==null&&jt!==void 0||(U.__derivedClasses=[]),W.baseClass.__derivedClasses.push(W)}var Oo=new Mt(h,W,!0,!1,!1),ze=new Mt(h+"*",W,!1,!1,!1),Ge=new Mt(h+" const*",W,!1,!0,!1);return Oe[e]={pointerType:ze,constPointerType:Ge},xe(b,I),[Oo,ze,Ge]})},Qt=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(P[t+n*4>>2]);return r};function Rn(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].destructorFunction===void 0)return!0;return!1}function Jt(e,t,r,n,a,o){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=Rn(t),d=t[0].name!=="void",h=u-2,v=new Array(h),$=[],b=[],O=function(){b.length=0;var x;$.length=s?2:1,$[0]=a,s&&(x=t[1].toWireType(b,this),$[1]=x);for(var D=0;D<h;++D)v[D]=t[D+2].toWireType(b,D<0||arguments.length<=D?void 0:arguments[D]),$.push(v[D]);var I=n(...$);function X(W){if(c)zt(b);else for(var U=s?1:2;U<t.length;U++){var jt=U===1?x:v[U-2];t[U].destructorFunction!==null&&t[U].destructorFunction(jt)}if(d)return t[0].fromWireType(W)}return X(I)};return qt(e,O)}var Ln=(e,t,r,n,a,o)=>{var u=Qt(t,r);a=k(n,a),et([],[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 vt(`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]=()=>{Ft(`Cannot construct ${s.name} due to unbound types`,u)},et([],u,d=>(d.splice(1,0,null),s.registeredClass.constructor_body[t-1]=Jt(c,d,null,a,o),[])),[]})},je=e=>{e=e.trim();const t=e.indexOf("(");return t===-1?e:e.slice(0,t)},Bn=(e,t,r,n,a,o,u,s,c,d)=>{var h=Qt(r,n);t=L(t),t=je(t),o=k(a,o),et([],[e],v=>{v=v[0];var $=`${v.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&v.registeredClass.pureVirtualFunctions.push(t);function b(){Ft(`Cannot call ${$} due to unbound types`,h)}var O=v.registeredClass.instancePrototype,x=O[t];return x===void 0||x.overloadTable===void 0&&x.className!==v.name&&x.argCount===r-2?(b.argCount=r-2,b.className=v.name,O[t]=b):(Ae(O,t,$),O[t].overloadTable[r-2]=b),et([],h,D=>{var I=Jt($,D,v,o,u);return O[t].overloadTable===void 0?(I.argCount=r-2,O[t]=I):O[t].overloadTable[r-2]=I,[]}),[]})},Re=[],rt=[0,1,,1,null,1,!0,1,!1,1],Kt=e=>{e>9&&--rt[e+1]===0&&(rt[e]=void 0,Re.push(e))},G={toValue:e=>(e||T(`Cannot use deleted val. handle = ${e}`),rt[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=Re.pop()||rt.length;return rt[t]=e,rt[t+1]=1,t}}}},Le={name:"emscripten::val",fromWireType:e=>{var t=G.toValue(e);return Kt(e),t},toWireType:(e,t)=>G.toHandle(t),argPackAdvance:z,readValueFromPointer:pt,destructorFunction:null},Wn=e=>H(e,Le),Un=(e,t)=>{switch(t){case 4:return function(r){return this.fromWireType(ge[r>>2])};case 8:return function(r){return this.fromWireType(we[r>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Vn=(e,t,r)=>{t=L(t),H(e,{name:t,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:z,readValueFromPointer:Un(t,r),destructorFunction:null})},kn=(e,t,r,n,a,o,u,s)=>{var c=Qt(t,r);e=L(e),e=je(e),a=k(n,a),Se(e,function(){Ft(`Cannot call ${e} due to unbound types`,c)},t-1),et([],c,d=>{var h=[d[0],null].concat(d.slice(1));return xe(e,Jt(e,h,null,a,o),t-1),[]})},Hn=(e,t,r)=>{switch(t){case 1:return r?n=>J[n]:n=>V[n];case 2:return r?n=>Tt[n>>1]:n=>ot[n>>1];case 4:return r?n=>it[n>>2]:n=>P[n>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Nn=(e,t,r,n,a)=>{t=L(t);const o=n===0;let u=c=>c;if(o){var s=32-8*r;u=c=>c<<s>>>s,a=u(a)}H(e,{name:t,fromWireType:u,toWireType:(c,d)=>d,argPackAdvance:z,readValueFromPointer:Hn(t,r,n!==0),destructorFunction:null})},zn=(e,t,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[t];function o(u){var s=P[u>>2],c=P[u+4>>2];return new a(J.buffer,c,s)}r=L(r),H(e,{name:r,fromWireType:o,argPackAdvance:z,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Gn=Object.assign({optional:!0},Le),Xn=(e,t)=>{H(e,Gn)},qn=(e,t,r,n)=>{if(!(n>0))return 0;for(var a=r,o=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>=o)break;t[r++]=s}else if(s<=2047){if(r+1>=o)break;t[r++]=192|s>>6,t[r++]=128|s&63}else if(s<=65535){if(r+2>=o)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|s&63}else{if(r+3>=o)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},ut=(e,t,r)=>qn(e,V,t,r),Be=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},We=typeof TextDecoder<"u"?new TextDecoder:void 0,Ue=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&&We)return We.decode(e.subarray(t,a));for(var o="";t<a;){var u=e[t++];if(!(u&128)){o+=String.fromCharCode(u);continue}var s=e[t++]&63;if((u&224)==192){o+=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)o+=String.fromCharCode(u);else{var d=u-65536;o+=String.fromCharCode(55296|d>>10,56320|d&1023)}}return o},Yn=(e,t)=>e?Ue(V,e,t):"",Zn=(e,t)=>{t=L(t),H(e,{name:t,fromWireType(r){for(var n=P[r>>2],a=r+4,o,s,u=a,s=0;s<=n;++s){var c=a+s;if(s==n||V[c]==0){var d=c-u,h=Yn(u,d);o===void 0?o=h:(o+="\0",o+=h),u=c+1}}return nt(r),o},toWireType(r,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var a,o=typeof n=="string";o||ArrayBuffer.isView(n)&&n.BYTES_PER_ELEMENT==1||T("Cannot pass non-string to std::string"),o?a=Be(n):a=n.length;var u=Ne(4+a+1),s=u+4;return P[u>>2]=a,o?ut(n,s,a+1):V.set(n,s),r!==null&&r.push(nt,u),u},argPackAdvance:z,readValueFromPointer:pt,destructorFunction(r){nt(r)}})},Ve=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Qn=(e,t)=>{for(var r=e>>1,n=r+t/2,a=r;!(a>=n)&&ot[a];)++a;if(a-r>16&&Ve)return Ve.decode(ot.subarray(r,a));for(var o="",u=r;!(u>=n);++u){var s=ot[u];if(s==0)break;o+=String.fromCharCode(s)}return o},Jn=(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,o=0;o<a;++o){var u=e.charCodeAt(o);Tt[t>>1]=u,t+=2}return Tt[t>>1]=0,t-n},Kn=e=>e.length*2,ta=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var a=it[e+r*4>>2];if(a==0)break;if(++r,a>=65536){var o=a-65536;n+=String.fromCharCode(55296|o>>10,56320|o&1023)}else n+=String.fromCharCode(a)}return n},ea=(e,t,r)=>{if(r!=null||(r=2147483647),r<4)return 0;for(var n=t,a=n+r-4,o=0;o<e.length;++o){var u=e.charCodeAt(o);if(u>=55296&&u<=57343){var s=e.charCodeAt(++o);u=65536+((u&1023)<<10)|s&1023}if(it[t>>2]=u,t+=4,t+4>a)break}return it[t>>2]=0,t-n},ra=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},na=(e,t,r)=>{r=L(r);var n,a,o,u;t===2?(n=Qn,a=Jn,u=Kn,o=s=>ot[s>>1]):t===4&&(n=ta,a=ea,u=ra,o=s=>P[s>>2]),H(e,{name:r,fromWireType:s=>{for(var c=P[s>>2],d,h=s+4,v=0;v<=c;++v){var $=s+4+v*t;if(v==c||o($)==0){var b=$-h,O=n(h,b);d===void 0?d=O:(d+="\0",d+=O),h=$+t}}return nt(s),d},toWireType:(s,c)=>{typeof c!="string"&&T(`Cannot pass non-string to C++ string type ${r}`);var d=u(c),h=Ne(4+d+t);return P[h>>2]=d/t,a(c,h+4,d+t),s!==null&&s.push(nt,h),h},argPackAdvance:z,readValueFromPointer:pt,destructorFunction(s){nt(s)}})},aa=(e,t,r,n,a,o)=>{At[e]={name:L(t),rawConstructor:k(r,n),rawDestructor:k(a,o),fields:[]}},oa=(e,t,r,n,a,o,u,s,c,d)=>{At[e].fields.push({fieldName:L(t),getterReturnType:r,getter:k(n,a),getterContext:o,setterArgumentType:u,setter:k(s,c),setterContext:d})},ia=(e,t)=>{t=L(t),H(e,{isVoid:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})},te=[],sa=(e,t,r,n)=>(e=te[e],t=G.toValue(t),e(null,t,r,n)),ua={},ca=e=>{var t=ua[e];return t===void 0?L(e):t},ke=()=>{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.")},la=e=>e===0?G.toHandle(ke()):(e=ca(e),G.toHandle(ke()[e])),fa=e=>{var t=te.length;return te.push(e),t},He=(e,t)=>{var r=tt[e];return r===void 0&&T(`${t} has unknown type ${Fe(e)}`),r},da=(e,t)=>{for(var r=new Array(e),n=0;n<e;++n)r[n]=He(P[t+n*4>>2],`parameter ${n}`);return r},ha=(e,t,r)=>{var n=[],a=e.toWireType(n,r);return n.length&&(P[t>>2]=G.toHandle(n)),a},pa=Reflect.construct,va=(e,t,r)=>{var n=da(e,t),a=n.shift();e--;var o=new Array(e),u=(c,d,h,v)=>{for(var $=0,b=0;b<e;++b)o[b]=n[b].readValueFromPointer(v+$),$+=n[b].argPackAdvance;var O=r===1?pa(d,o):d.apply(c,o);return ha(a,h,O)},s=`methodCaller<(${n.map(c=>c.name).join(", ")}) => ${a.name}>`;return fa(qt(s,u))},ya=e=>{e>9&&(rt[e+1]+=1)},ma=e=>{var t=G.toValue(e);zt(t),Kt(e)},ga=(e,t)=>{e=He(e,"_emval_take_value");var r=e.readValueFromPointer(t);return G.toHandle(r)},wa=(e,t,r,n)=>{var a=new Date().getFullYear(),o=new Date(a,0,1),u=new Date(a,6,1),s=o.getTimezoneOffset(),c=u.getTimezoneOffset(),d=Math.max(s,c);P[e>>2]=d*60,it[t>>2]=+(s!=c);var h=b=>{var O=b>=0?"-":"+",x=Math.abs(b),D=String(Math.floor(x/60)).padStart(2,"0"),I=String(x%60).padStart(2,"0");return`UTC${O}${D}${I}`},v=h(s),$=h(c);c<s?(ut(v,r,17),ut($,n,17)):(ut(v,n,17),ut($,r,17))},$a=()=>2147483648,ba=(e,t)=>Math.ceil(e/t)*t,Ca=e=>{var t=Ct.buffer,r=(e-t.byteLength+65535)/65536|0;try{return Ct.grow(r),$e(),1}catch{}},Ta=e=>{var t=V.length;e>>>=0;var r=$a();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 o=Math.min(r,ba(Math.max(e,a),65536)),u=Ca(o);if(u)return!0}return!1},ee={},Pa=()=>q||"./this.program",mt=()=>{if(!mt.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,_:Pa()};for(var r in ee)ee[r]===void 0?delete t[r]:t[r]=ee[r];var n=[];for(var r in t)n.push(`${r}=${t[r]}`);mt.strings=n}return mt.strings},_a=(e,t)=>{var r=0,n=0;for(var a of mt()){var o=t+r;P[e+n>>2]=o,r+=ut(a,o,1/0)+1,n+=4}return 0},Ea=(e,t)=>{var r=mt();P[e>>2]=r.length;var n=0;for(var a of r)n+=Be(a)+1;return P[t>>2]=n,0},Oa=e=>52;function Aa(e,t,r,n,a){return 70}var Sa=[null,[],[]],Da=(e,t)=>{var r=Sa[e];t===0||t===10?((e===1?bt:Y)(Ue(r)),r.length=0):r.push(t)},xa=(e,t,r,n)=>{for(var a=0,o=0;o<r;o++){var u=P[t>>2],s=P[t+4>>2];t+=8;for(var c=0;c<s;c++)Da(e,V[u+c]);a+=s}return P[n>>2]=a,0},Ia=e=>e;pn(),wn(),xn(),l.noExitRuntime&&l.noExitRuntime,l.print&&(bt=l.print),l.printErr&&(Y=l.printErr),l.wasmBinary&&(dt=l.wasmBinary),l.arguments&&l.arguments,l.thisProgram&&(q=l.thisProgram);var Ma={s:tn,w:en,a:rn,j:nn,m:an,P:on,p:sn,ga:un,d:cn,ba:ln,ua:dn,aa:hn,pa:yn,sa:jn,ra:Ln,H:Bn,na:Wn,V:Vn,W:kn,x:Nn,t:zn,ta:Xn,oa:Zn,Q:na,I:aa,va:oa,qa:ia,da:sa,wa:Kt,D:la,ma:va,X:ya,Y:ma,U:ga,ca:wa,ha:Ta,ea:_a,fa:Ea,ia:Oa,_:Aa,S:xa,K:po,C:yo,M:Ga,R:Co,q:co,b:Ya,E:ho,ka:go,c:Za,ja:wo,h:za,i:to,r:ao,O:fo,v:io,F:uo,L:lo,z:mo,J:To,$:Po,Z:_o,k:Qa,f:Na,e:qa,g:Xa,N:bo,l:Ka,la:vo,o:oo,B:eo,u:so,T:no,A:$o,n:Ja,G:ro,y:Ia},E=await Qr();E.ya;var Fa=E.za,nt=l._free=E.Aa,Ne=l._malloc=E.Ca,ja=E.Da,y=E.Ea,Ra=E.Fa,La=E.Ga,Ba=E.Ha,Wa=E.Ia,Ua=E.Ja,Va=E.Ka;l.dynCall_viijii=E.La;var ka=l.dynCall_iiijj=E.Ma;l.dynCall_jiji=E.Na;var Ha=l.dynCall_jiiii=E.Oa;l.dynCall_iiiiij=E.Pa,l.dynCall_iiiiijj=E.Qa,l.dynCall_iiiiiijj=E.Ra;function Na(e,t){var r=g();try{w(e)(t)}catch(n){if(m(r),n!==n+0)throw n;y(1,0)}}function za(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function Ga(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function Xa(e,t,r,n){var a=g();try{w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function qa(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 Ya(e,t){var r=g();try{return w(e)(t)}catch(n){if(m(r),n!==n+0)throw n;y(1,0)}}function Za(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 Qa(e){var t=g();try{w(e)()}catch(r){if(m(t),r!==r+0)throw r;y(1,0)}}function Ja(e,t,r,n,a,o,u,s,c,d,h){var v=g();try{w(e)(t,r,n,a,o,u,s,c,d,h)}catch($){if(m(v),$!==$+0)throw $;y(1,0)}}function Ka(e,t,r,n,a){var o=g();try{w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function to(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function eo(e,t,r,n,a,o,u){var s=g();try{w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function ro(e,t,r,n,a,o,u,s,c,d,h,v,$,b,O,x){var D=g();try{w(e)(t,r,n,a,o,u,s,c,d,h,v,$,b,O,x)}catch(I){if(m(D),I!==I+0)throw I;y(1,0)}}function no(e,t,r,n,a,o,u,s,c){var d=g();try{w(e)(t,r,n,a,o,u,s,c)}catch(h){if(m(d),h!==h+0)throw h;y(1,0)}}function ao(e,t,r,n,a,o){var u=g();try{return w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function oo(e,t,r,n,a,o){var u=g();try{w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function io(e,t,r,n,a,o,u){var s=g();try{return w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function so(e,t,r,n,a,o,u,s){var c=g();try{w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function uo(e,t,r,n,a,o,u,s){var c=g();try{return w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function co(e){var t=g();try{return w(e)()}catch(r){if(m(t),r!==r+0)throw r;y(1,0)}}function lo(e,t,r,n,a,o,u,s,c){var d=g();try{return w(e)(t,r,n,a,o,u,s,c)}catch(h){if(m(d),h!==h+0)throw h;y(1,0)}}function fo(e,t,r,n,a,o,u){var s=g();try{return w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function ho(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function po(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function vo(e,t,r,n,a,o,u,s){var c=g();try{w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function yo(e,t,r,n,a,o){var u=g();try{return w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function mo(e,t,r,n,a,o,u,s,c,d){var h=g();try{return w(e)(t,r,n,a,o,u,s,c,d)}catch(v){if(m(h),v!==v+0)throw v;y(1,0)}}function go(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 wo(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function $o(e,t,r,n,a,o,u,s,c,d){var h=g();try{w(e)(t,r,n,a,o,u,s,c,d)}catch(v){if(m(h),v!==v+0)throw v;y(1,0)}}function bo(e,t,r,n,a,o,u){var s=g();try{w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function Co(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function To(e,t,r,n,a,o,u,s,c,d,h,v){var $=g();try{return w(e)(t,r,n,a,o,u,s,c,d,h,v)}catch(b){if(m($),b!==b+0)throw b;y(1,0)}}function Po(e,t,r,n,a,o,u){var s=g();try{return ka(e,t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function _o(e,t,r,n,a){var o=g();try{return Ha(e,t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function re(){if(K>0){ht=re;return}if(Ur(),K>0){ht=re;return}function e(){var t;l.calledRun=!0,!me&&(Vr(),C(l),(t=l.onRuntimeInitialized)===null||t===void 0||t.call(l),kr())}l.setStatus?(l.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>l.setStatus(""),1),e()},1)):e()}function Eo(){if(l.preInit)for(typeof l.preInit=="function"&&(l.preInit=[l.preInit]);l.preInit.length>0;)l.preInit.shift()()}return Eo(),re(),f=F,f};function Ut(i){return oe(Wt,i)}function wr(){return mr(Wt)}function $r(i){Ut({overrides:i,equalityFn:Object.is,fireImmediately:!1})}async function br(i,f){return gr(Wt,i,f)}const Cr="68d20eb8c486afabf49fab6d9fbc5f118df8648ec6200e8039ef8912a169c00c",ie=[["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"]],Tr=[...ie,["unknown"]].map(i=>i[0]),Vt=new Map(ie);function Pr(i){for(const[f,p]of Vt)if(i===p)return f;return"unknown"}function _r(i){if(se(i))return{width:i.naturalWidth,height:i.naturalHeight};if(ue(i))return{width:i.width.baseVal.value,height:i.height.baseVal.value};if(ce(i))return{width:i.videoWidth,height:i.videoHeight};if(fe(i))return{width:i.width,height:i.height};if(he(i))return{width:i.displayWidth,height:i.displayHeight};if(le(i))return{width:i.width,height:i.height};if(de(i))return{width:i.width,height:i.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 se(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLImageElement)}catch{return!1}}function ue(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.SVGImageElement)}catch{return!1}}function ce(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLVideoElement)}catch{return!1}}function le(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLCanvasElement)}catch{return!1}}function fe(i){try{return i instanceof ImageBitmap||Object.prototype.toString.call(i)==="[object ImageBitmap]"}catch{return!1}}function de(i){try{return i instanceof OffscreenCanvas||Object.prototype.toString.call(i)==="[object OffscreenCanvas]"}catch{return!1}}function he(i){try{return i instanceof VideoFrame||Object.prototype.toString.call(i)==="[object VideoFrame]"}catch{return!1}}function Er(i){try{return i instanceof Blob||Object.prototype.toString.call(i)==="[object Blob]"}catch{return!1}}function Or(i){try{return i instanceof ImageData||Object.prototype.toString.call(i)==="[object ImageData]"}catch{return!1}}function Ar(i,f){try{const p=new OffscreenCanvas(i,f);if(p.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return p;throw void 0}catch{const p=document.createElement("canvas");return p.width=i,p.height=f,p}}async function pe(i){if(se(i)&&!await Ir(i))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(ue(i)&&!await Mr(i))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(he(i)&&Fr(i))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(ce(i)&&(i.readyState===0||i.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(fe(i)&&Rr(i))throw new DOMException("The image source is detached.","InvalidStateError");const{width:f,height:p}=_r(i);if(f===0||p===0)return null;const C=Ar(f,p).getContext("2d");C.drawImage(i,0,0);try{return C.getImageData(0,0,f,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Sr(i){let f;try{f=await createImageBitmap(i)}catch{try{if(globalThis.Image){f=new Image;let C="";try{C=URL.createObjectURL(i),f.src=C,await f.decode()}finally{URL.revokeObjectURL(C)}}else return i}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}}return await pe(f)}function Dr(i){const{width:f,height:p}=i;if(f===0||p===0)return null;const l=i.getContext("2d");try{return l.getImageData(0,0,f,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function xr(i){if(Er(i))return await Sr(i);if(Or(i)){if(jr(i))throw new DOMException("The image data has been detached.","InvalidStateError");return i}return le(i)||de(i)?Dr(i):await pe(i)}async function Ir(i){try{return await i.decode(),!0}catch{return!1}}async function Mr(i){var f;try{return await((f=i.decode)==null?void 0:f.call(i)),!0}catch{return!1}}function Fr(i){return i.format===null}function jr(i){return i.data.buffer.byteLength===0}function Rr(i){return i.width===0&&i.height===0}function ve(i,f){return Lr(i)?new DOMException(`${f}: ${i.message}`,i.name):Br(i)?new i.constructor(`${f}: ${i.message}`):new Error(`${f}: ${i}`)}function Lr(i){return i instanceof DOMException||Object.prototype.toString.call(i)==="[object DOMException]"}function Br(i){return i instanceof Error||Object.prototype.toString.call(i)==="[object Error]"}class Wr{constructor(f={}){Je(this,ct);var p;try{const l=(p=f==null?void 0:f.formats)==null?void 0:p.filter(C=>C!=="unknown");if((l==null?void 0:l.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const C of l!=null?l:[])if(!Vt.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.`);Ke(this,ct,l!=null?l:[]),Ut({fireImmediately:!0}).catch(()=>{})}catch(l){throw ve(l,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Tr.filter(f=>f!=="unknown")}async detect(f){try{const p=await xr(f);if(p===null)return[];let l;const C={tryCode39ExtendedMode:!1,textMode:"Plain",formats:Qe(this,ct).map(A=>Vt.get(A))};try{l=await br(p,C)}catch(A){throw console.error(A),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return l.map(A=>{const{topLeft:{x:F,y:B},topRight:{x:S,y:j},bottomLeft:{x:q,y:Z},bottomRight:{x:Q,y:lt}}=A.position,ft=Math.min(F,S,q,Q),at=Math.min(B,j,Z,lt),bt=Math.max(F,S,q,Q),Y=Math.max(B,j,Z,lt);return{boundingBox:new DOMRectReadOnly(ft,at,bt-ft,Y-at),rawValue:A.text,format:Pr(A.format),cornerPoints:[{x:F,y:B},{x:S,y:j},{x:Q,y:lt},{x:q,y:Z}]}})}catch(p){throw ve(p,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return ct=new WeakMap,(ye=globalThis.BarcodeDetector)!=null||(globalThis.BarcodeDetector=Wr),_.ZXING_CPP_COMMIT=pr,_.ZXING_WASM_SHA256=Cr,_.ZXING_WASM_VERSION=hr,_.prepareZXingModule=Ut,_.purgeZXingModule=wr,_.setZXingModuleOverrides=$r,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}),_}({});
|
|
1
|
+
var BarcodeDetectionAPI=function(_){"use strict";var Ye=_=>{throw TypeError(_)};var Ze=(_,M,R)=>M.has(_)||Ye("Cannot "+R);var Qe=(_,M,R)=>(Ze(_,M,"read from private field"),R?R.call(_):M.get(_)),Je=(_,M,R)=>M.has(_)?Ye("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(_):M.set(_,R),Ke=(_,M,R,gt)=>(Ze(_,M,"write to private field"),gt?gt.call(_,R):M.set(_,R),R);var ct,ye;const M=[["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"]],R=M.map(([i])=>i),gt=R.filter((i,f)=>M[f][1]==="L"),tr=R.filter((i,f)=>M[f][1]==="M");function Bt(i){switch(i){case"Linear-Codes":return gt.reduce((f,p)=>f|Bt(p),0);case"Matrix-Codes":return tr.reduce((f,p)=>f|Bt(p),0);case"Any":return(1<<M.length)-1;case"None":return 0;default:return 1<<R.indexOf(i)}}function er(i){if(i===0)return"None";const f=31-Math.clz32(i);return R[f]}function rr(i){return i.reduce((f,p)=>f|Bt(p),0)}const nr=["LocalAverage","GlobalHistogram","FixedThreshold","BoolCast"];function ar(i){return nr.indexOf(i)}const ne=["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 or(i){return i==="UnicodeBig"?ne.indexOf("UTF16BE"):ne.indexOf(i)}const ir=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function sr(i){return ir[i]}const ur=["Ignore","Read","Require"];function cr(i){return ur.indexOf(i)}const lr=["Plain","ECI","HRI","Hex","Escaped"];function fr(i){return lr.indexOf(i)}const wt={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 ae(i){return{...i,formats:rr(i.formats),binarizer:ar(i.binarizer),eanAddOnSymbol:cr(i.eanAddOnSymbol),textMode:fr(i.textMode),characterSet:or(i.characterSet)}}function dr(i){return{...i,format:er(i.format),contentType:sr(i.contentType),eccLevel:i.ecLevel}}const hr="2.2.2",pr="c0a7c6cd2165457c721c58045edd22ffee9624e9",vr={locateFile:(i,f)=>{const p=i.match(/_(.+?)\.wasm$/);return p?`https://fastly.jsdelivr.net/npm/zxing-wasm@2.2.2/dist/${p[1]}/${i}`:f+i}},$t=new WeakMap;function yr(i,f){return Object.is(i,f)||Object.keys(i).length===Object.keys(f).length&&Object.keys(i).every(p=>Object.hasOwn(f,p)&&i[p]===f[p])}function oe(i,{overrides:f,equalityFn:p=yr,fireImmediately:l=!1}={}){var C;const[A,F]=(C=$t.get(i))!=null?C:[vr],B=f!=null?f:A;let S;if(l){if(F&&(S=p(A,B)))return F;const j=i({...B});return $t.set(i,[B,j]),j}(S!=null?S:p(A,B))||$t.set(i,[B])}function mr(i){$t.delete(i)}async function gr(i,f,p=wt){const l={...wt,...p},C=await oe(i,{fireImmediately:!0});let A,F;if("width"in f&&"height"in f&&"data"in f){const{data:S,data:{byteLength:j},width:q,height:Z}=f;F=C._malloc(j),C.HEAPU8.set(S,F),A=C.readBarcodesFromPixmap(F,q,Z,ae(l))}else{let S,j;if("buffer"in f)[S,j]=[f.byteLength,f];else if("byteLength"in f)[S,j]=[f.byteLength,new Uint8Array(f)];else if("size"in f)[S,j]=[f.size,new Uint8Array(await f.arrayBuffer())];else throw new TypeError("Invalid input type");F=C._malloc(S),C.HEAPU8.set(j,F),A=C.readBarcodesFromImage(F,S,ae(l))}C._free(F);const B=[];for(let S=0;S<A.size();++S)B.push(dr(A.get(S)));return B}({...wt,formats:[...wt.formats]});var Wt=async function(i={}){var f,p,l=i,C,A,F=new Promise((e,t)=>{C=e,A=t}),B=typeof window=="object",S=typeof Bun<"u",j=typeof WorkerGlobalScope<"u";typeof process=="object"&&!((p=process.versions)===null||p===void 0)&&p.node&&process.type!="renderer";var q="./this.program",Z,Q="";function lt(e){return l.locateFile?l.locateFile(e,Q):Q+e}var ft,at;if(B||j||S){try{Q=new URL(".",Z).href}catch{}j&&(at=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),ft=async e=>{var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw new Error(t.status+" : "+t.url)}}var bt=console.log.bind(console),Y=console.error.bind(console),dt,Ct,me=!1,J,V,Tt,ot,it,P,ge,we;function $e(){var e=Ct.buffer;J=new Int8Array(e),Tt=new Int16Array(e),l.HEAPU8=V=new Uint8Array(e),ot=new Uint16Array(e),it=new Int32Array(e),P=new Uint32Array(e),ge=new Float32Array(e),we=new Float64Array(e)}function Ur(){if(l.preRun)for(typeof l.preRun=="function"&&(l.preRun=[l.preRun]);l.preRun.length;)Kr(l.preRun.shift());be(Te)}function Vr(){E.ya()}function kr(){if(l.postRun)for(typeof l.postRun=="function"&&(l.postRun=[l.postRun]);l.postRun.length;)Jr(l.postRun.shift());be(Ce)}var K=0,ht=null;function Hr(e){var t;K++,(t=l.monitorRunDependencies)===null||t===void 0||t.call(l,K)}function Nr(e){var t;if(K--,(t=l.monitorRunDependencies)===null||t===void 0||t.call(l,K),K==0&&ht){var r=ht;ht=null,r()}}function kt(e){var t;(t=l.onAbort)===null||t===void 0||t.call(l,e),e="Aborted("+e+")",Y(e),me=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw A(r),r}var Pt;function zr(){return lt("zxing_reader.wasm")}function Gr(e){if(e==Pt&&dt)return new Uint8Array(dt);if(at)return at(e);throw"both async and sync fetching of the wasm failed"}async function Xr(e){if(!dt)try{var t=await ft(e);return new Uint8Array(t)}catch{}return Gr(e)}async function qr(e,t){try{var r=await Xr(e),n=await WebAssembly.instantiate(r,t);return n}catch(a){Y(`failed to asynchronously prepare wasm: ${a}`),kt(a)}}async function Yr(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(o){Y(`wasm streaming compile failed: ${o}`),Y("falling back to ArrayBuffer instantiation")}return qr(t,r)}function Zr(){return{a:Ma}}async function Qr(){function e(o,u){return E=o.exports,Ct=E.xa,$e(),Me=E.Ba,Nr(),E}Hr();function t(o){return e(o.instance)}var r=Zr();if(l.instantiateWasm)return new Promise((o,u)=>{l.instantiateWasm(r,(s,c)=>{o(e(s))})});Pt!=null||(Pt=zr());try{var n=await Yr(dt,Pt,r),a=t(n);return a}catch(o){return A(o),Promise.reject(o)}}var be=e=>{for(;e.length>0;)e.shift()(l)},Ce=[],Jr=e=>Ce.push(e),Te=[],Kr=e=>Te.push(e),m=e=>La(e),g=()=>Ba(),_t=[],Et=0,tn=e=>{var t=new Ht(e);return t.get_caught()||(t.set_caught(!0),Et--),t.set_rethrown(!1),_t.push(t),Ua(e),ja(e)},N=0,en=()=>{y(0,0);var e=_t.pop();Wa(e.excPtr),N=0};class Ht{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,J[this.ptr+12]=t}get_caught(){return J[this.ptr+12]!=0}set_rethrown(t){t=t?1:0,J[this.ptr+13]=t}get_rethrown(){return J[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 Ot=e=>Ra(e),Nt=e=>{var t=N;if(!t)return Ot(0),0;var r=new Ht(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return Ot(0),t;for(var a of e){if(a===0||a===n)break;var o=r.ptr+16;if(Va(a,n,o))return Ot(a),t}return Ot(n),t},rn=()=>Nt([]),nn=e=>Nt([e]),an=(e,t)=>Nt([e,t]),on=()=>{var e=_t.pop();e||kt("no exception to throw");var t=e.excPtr;throw e.get_rethrown()||(_t.push(e),e.set_rethrown(!0),e.set_caught(!1),Et++),N=t,N},sn=(e,t,r)=>{var n=new Ht(e);throw n.init(t,r),N=e,Et++,N},un=()=>Et,cn=e=>{throw N||(N=e),N},ln=()=>kt(""),At={},zt=e=>{for(;e.length;){var t=e.pop(),r=e.pop();r(t)}};function pt(e){return this.fromWireType(P[e>>2])}var st={},tt={},St={},fn=class extends Error{constructor(e){super(e),this.name="InternalError"}},Dt=e=>{throw new fn(e)},et=(e,t,r)=>{e.forEach(s=>St[s]=t);function n(s){var c=r(s);c.length!==e.length&&Dt("Mismatched type converter count");for(var d=0;d<e.length;++d)H(e[d],c[d])}var a=new Array(t.length),o=[],u=0;t.forEach((s,c)=>{tt.hasOwnProperty(s)?a[c]=tt[s]:(o.push(s),st.hasOwnProperty(s)||(st[s]=[]),st[s].push(()=>{a[c]=tt[s],++u,u===o.length&&n(a)}))}),o.length===0&&n(a)},dn=e=>{var t=At[e];delete At[e];var r=t.rawConstructor,n=t.rawDestructor,a=t.fields,o=a.map(u=>u.getterReturnType).concat(a.map(u=>u.setterArgumentType));et([e],o,u=>{var s={};return a.forEach((c,d)=>{var h=c.fieldName,v=u[d],$=u[d].optional,b=c.getter,O=c.getterContext,x=u[d+a.length],D=c.setter,I=c.setterContext;s[h]={read:X=>v.fromWireType(b(O,X)),write:(X,W)=>{var U=[];D(I,X,x.toWireType(U,W)),zt(U)},optional:$}}),[{name:t.name,fromWireType:c=>{var d={};for(var h in s)d[h]=s[h].read(c);return n(c),d},toWireType:(c,d)=>{for(var h in s)if(!(h in d)&&!s[h].optional)throw new TypeError(`Missing field: "${h}"`);var v=r();for(h in s)s[h].write(v,d[h]);return c!==null&&c.push(n,v),v},argPackAdvance:z,readValueFromPointer:pt,destructorFunction:n}]})},hn=(e,t,r,n,a)=>{},pn=()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);Pe=e},Pe,L=e=>{for(var t="",r=e;V[r];)t+=Pe[V[r++]];return t},vt=class extends Error{constructor(e){super(e),this.name="BindingError"}},T=e=>{throw new vt(e)};function vn(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`),tt.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;T(`Cannot register type '${n}' twice`)}if(tt[e]=t,delete St[e],st.hasOwnProperty(e)){var a=st[e];delete st[e],a.forEach(o=>o())}}function H(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return vn(e,t,r)}var z=8,yn=(e,t,r,n)=>{t=L(t),H(e,{name:t,fromWireType:function(a){return!!a},toWireType:function(a,o){return o?r:n},argPackAdvance:z,readValueFromPointer:function(a){return this.fromWireType(V[a])},destructorFunction:null})},mn=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Gt=e=>{function t(r){return r.$$.ptrType.registeredClass.name}T(t(e)+" instance already deleted")},Xt=!1,_e=e=>{},gn=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},Ee=e=>{e.count.value-=1;var t=e.count.value===0;t&&gn(e)},yt=e=>typeof FinalizationRegistry>"u"?(yt=t=>t,e):(Xt=new FinalizationRegistry(t=>{Ee(t.$$)}),yt=t=>{var r=t.$$,n=!!r.smartPtr;if(n){var a={$$:r};Xt.register(t,a,t)}return t},_e=t=>Xt.unregister(t),yt(e)),wn=()=>{let e=xt.prototype;Object.assign(e,{isAliasOf(r){if(!(this instanceof xt)||!(r instanceof xt))return!1;var n=this.$$.ptrType.registeredClass,a=this.$$.ptr;r.$$=r.$$;for(var o=r.$$.ptrType.registeredClass,u=r.$$.ptr;n.baseClass;)a=n.upcast(a),n=n.baseClass;for(;o.baseClass;)u=o.upcast(u),o=o.baseClass;return n===o&&a===u},clone(){if(this.$$.ptr||Gt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var r=yt(Object.create(Object.getPrototypeOf(this),{$$:{value:mn(this.$$)}}));return r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},delete(){this.$$.ptr||Gt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&T("Object already scheduled for deletion"),_e(this),Ee(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Gt(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 xt(){}var qt=(e,t)=>Object.defineProperty(t,"name",{value:e}),Oe={},Ae=(e,t,r)=>{if(e[t].overloadTable===void 0){var n=e[t];e[t]=function(){for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return e[t].overloadTable.hasOwnProperty(o.length)||T(`Function '${r}' called with an invalid number of arguments (${o.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[o.length].apply(this,o)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},Se=(e,t,r)=>{l.hasOwnProperty(e)?((r===void 0||l[e].overloadTable!==void 0&&l[e].overloadTable[r]!==void 0)&&T(`Cannot register public name '${e}' twice`),Ae(l,e,e),l[e].overloadTable.hasOwnProperty(r)&&T(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),l[e].overloadTable[r]=t):(l[e]=t,l[e].argCount=r)},$n=48,bn=57,Cn=e=>{e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return t>=$n&&t<=bn?`_${e}`:e};function Tn(e,t,r,n,a,o,u,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=u,this.downcast=s,this.pureVirtualFunctions=[]}var Yt=(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},Zt=e=>{if(e===null)return"null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e};function Pn(e,t){if(t===null)return this.isReference&&T(`null is not a valid ${this.name}`),0;t.$$||T(`Cannot pass "${Zt(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=Yt(t.$$.ptr,r,this.registeredClass);return n}function _n(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 "${Zt(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=Yt(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,G.toHandle(()=>a.delete())),e!==null&&e.push(this.rawDestructor,r)}break;default:T("Unsupporting sharing policy")}return r}function En(e,t){if(t===null)return this.isReference&&T(`null is not a valid ${this.name}`),0;t.$$||T(`Cannot pass "${Zt(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=Yt(t.$$.ptr,r,this.registeredClass);return n}var De=(e,t,r)=>{if(t===r)return e;if(r.baseClass===void 0)return null;var n=De(e,t,r.baseClass);return n===null?null:r.downcast(n)},On={},An=(e,t)=>{for(t===void 0&&T("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t},Sn=(e,t)=>(t=An(e,t),On[t]),It=(e,t)=>{(!t.ptrType||!t.ptr)&&Dt("makeClassHandle requires ptr and ptrType");var r=!!t.smartPtrType,n=!!t.smartPtr;return r!==n&&Dt("Both smartPtrType and smartPtr must be specified"),t.count={value:1},yt(Object.create(e,{$$:{value:t,writable:!0}}))};function Dn(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=Sn(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?It(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):It(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var o=this.registeredClass.getActualType(t),u=Oe[o];if(!u)return a.call(this);var s;this.isConst?s=u.constPointerType:s=u.pointerType;var c=De(t,this.registeredClass,s.registeredClass);return c===null?a.call(this):this.isSmartPointer?It(s.registeredClass.instancePrototype,{ptrType:s,ptr:c,smartPtrType:this,smartPtr:e}):It(s.registeredClass.instancePrototype,{ptrType:s,ptr:c})}var xn=()=>{Object.assign(Mt.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:z,readValueFromPointer:pt,fromWireType:Dn})};function Mt(e,t,r,n,a,o,u,s,c,d,h){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=u,this.rawGetPointee=s,this.rawConstructor=c,this.rawShare=d,this.rawDestructor=h,!a&&t.baseClass===void 0?n?(this.toWireType=Pn,this.destructorFunction=null):(this.toWireType=En,this.destructorFunction=null):this.toWireType=_n}var xe=(e,t,r)=>{l.hasOwnProperty(e)||Dt("Replacing nonexistent public symbol"),l[e].overloadTable!==void 0&&r!==void 0?l[e].overloadTable[r]=t:(l[e]=t,l[e].argCount=r)},Ie=[],Me,w=e=>{var t=Ie[e];return t||(Ie[e]=t=Me.get(e)),t},In=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},Mn=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),o=0;o<n;o++)a[o]=arguments[o];return In(e,t,a,r)}},k=function(e,t){e=L(e);function r(){if(e.includes("j"))return Mn(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 Fn extends Error{}var Fe=e=>{var t=Fa(e),r=L(t);return nt(t),r},Ft=(e,t)=>{var r=[],n={};function a(o){if(!n[o]&&!tt[o]){if(St[o]){St[o].forEach(a);return}r.push(o),n[o]=!0}}throw t.forEach(a),new Fn(`${e}: `+r.map(Fe).join([", "]))},jn=(e,t,r,n,a,o,u,s,c,d,h,v,$)=>{h=L(h),o=k(a,o),s&&(s=k(u,s)),d&&(d=k(c,d)),$=k(v,$);var b=Cn(h);Se(b,function(){Ft(`Cannot construct ${h} due to unbound types`,[n])}),et([e,t,r],n?[n]:[],O=>{O=O[0];var x,D;n?(x=O.registeredClass,D=x.instancePrototype):D=xt.prototype;var I=qt(h,function(){if(Object.getPrototypeOf(this)!==X)throw new vt(`Use 'new' to construct ${h}`);if(W.constructor_body===void 0)throw new vt(`${h} has no accessible constructor`);for(var Xe=arguments.length,Rt=new Array(Xe),Lt=0;Lt<Xe;Lt++)Rt[Lt]=arguments[Lt];var qe=W.constructor_body[Rt.length];if(qe===void 0)throw new vt(`Tried to invoke ctor of ${h} with invalid number of parameters (${Rt.length}) - expected (${Object.keys(W.constructor_body).toString()}) parameters instead!`);return qe.apply(this,Rt)}),X=Object.create(D,{constructor:{value:I}});I.prototype=X;var W=new Tn(h,I,X,$,x,o,s,d);if(W.baseClass){var U,jt;(jt=(U=W.baseClass).__derivedClasses)!==null&&jt!==void 0||(U.__derivedClasses=[]),W.baseClass.__derivedClasses.push(W)}var Oo=new Mt(h,W,!0,!1,!1),ze=new Mt(h+"*",W,!1,!1,!1),Ge=new Mt(h+" const*",W,!1,!0,!1);return Oe[e]={pointerType:ze,constPointerType:Ge},xe(b,I),[Oo,ze,Ge]})},Qt=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(P[t+n*4>>2]);return r};function Rn(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].destructorFunction===void 0)return!0;return!1}function Jt(e,t,r,n,a,o){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=Rn(t),d=t[0].name!=="void",h=u-2,v=new Array(h),$=[],b=[],O=function(){b.length=0;var x;$.length=s?2:1,$[0]=a,s&&(x=t[1].toWireType(b,this),$[1]=x);for(var D=0;D<h;++D)v[D]=t[D+2].toWireType(b,D<0||arguments.length<=D?void 0:arguments[D]),$.push(v[D]);var I=n(...$);function X(W){if(c)zt(b);else for(var U=s?1:2;U<t.length;U++){var jt=U===1?x:v[U-2];t[U].destructorFunction!==null&&t[U].destructorFunction(jt)}if(d)return t[0].fromWireType(W)}return X(I)};return qt(e,O)}var Ln=(e,t,r,n,a,o)=>{var u=Qt(t,r);a=k(n,a),et([],[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 vt(`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]=()=>{Ft(`Cannot construct ${s.name} due to unbound types`,u)},et([],u,d=>(d.splice(1,0,null),s.registeredClass.constructor_body[t-1]=Jt(c,d,null,a,o),[])),[]})},je=e=>{e=e.trim();const t=e.indexOf("(");return t===-1?e:e.slice(0,t)},Bn=(e,t,r,n,a,o,u,s,c,d)=>{var h=Qt(r,n);t=L(t),t=je(t),o=k(a,o),et([],[e],v=>{v=v[0];var $=`${v.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&v.registeredClass.pureVirtualFunctions.push(t);function b(){Ft(`Cannot call ${$} due to unbound types`,h)}var O=v.registeredClass.instancePrototype,x=O[t];return x===void 0||x.overloadTable===void 0&&x.className!==v.name&&x.argCount===r-2?(b.argCount=r-2,b.className=v.name,O[t]=b):(Ae(O,t,$),O[t].overloadTable[r-2]=b),et([],h,D=>{var I=Jt($,D,v,o,u);return O[t].overloadTable===void 0?(I.argCount=r-2,O[t]=I):O[t].overloadTable[r-2]=I,[]}),[]})},Re=[],rt=[0,1,,1,null,1,!0,1,!1,1],Kt=e=>{e>9&&--rt[e+1]===0&&(rt[e]=void 0,Re.push(e))},G={toValue:e=>(e||T(`Cannot use deleted val. handle = ${e}`),rt[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=Re.pop()||rt.length;return rt[t]=e,rt[t+1]=1,t}}}},Le={name:"emscripten::val",fromWireType:e=>{var t=G.toValue(e);return Kt(e),t},toWireType:(e,t)=>G.toHandle(t),argPackAdvance:z,readValueFromPointer:pt,destructorFunction:null},Wn=e=>H(e,Le),Un=(e,t)=>{switch(t){case 4:return function(r){return this.fromWireType(ge[r>>2])};case 8:return function(r){return this.fromWireType(we[r>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Vn=(e,t,r)=>{t=L(t),H(e,{name:t,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:z,readValueFromPointer:Un(t,r),destructorFunction:null})},kn=(e,t,r,n,a,o,u,s)=>{var c=Qt(t,r);e=L(e),e=je(e),a=k(n,a),Se(e,function(){Ft(`Cannot call ${e} due to unbound types`,c)},t-1),et([],c,d=>{var h=[d[0],null].concat(d.slice(1));return xe(e,Jt(e,h,null,a,o),t-1),[]})},Hn=(e,t,r)=>{switch(t){case 1:return r?n=>J[n]:n=>V[n];case 2:return r?n=>Tt[n>>1]:n=>ot[n>>1];case 4:return r?n=>it[n>>2]:n=>P[n>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Nn=(e,t,r,n,a)=>{t=L(t);const o=n===0;let u=c=>c;if(o){var s=32-8*r;u=c=>c<<s>>>s,a=u(a)}H(e,{name:t,fromWireType:u,toWireType:(c,d)=>d,argPackAdvance:z,readValueFromPointer:Hn(t,r,n!==0),destructorFunction:null})},zn=(e,t,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[t];function o(u){var s=P[u>>2],c=P[u+4>>2];return new a(J.buffer,c,s)}r=L(r),H(e,{name:r,fromWireType:o,argPackAdvance:z,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Gn=Object.assign({optional:!0},Le),Xn=(e,t)=>{H(e,Gn)},qn=(e,t,r,n)=>{if(!(n>0))return 0;for(var a=r,o=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>=o)break;t[r++]=s}else if(s<=2047){if(r+1>=o)break;t[r++]=192|s>>6,t[r++]=128|s&63}else if(s<=65535){if(r+2>=o)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|s&63}else{if(r+3>=o)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},ut=(e,t,r)=>qn(e,V,t,r),Be=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},We=typeof TextDecoder<"u"?new TextDecoder:void 0,Ue=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&&We)return We.decode(e.subarray(t,a));for(var o="";t<a;){var u=e[t++];if(!(u&128)){o+=String.fromCharCode(u);continue}var s=e[t++]&63;if((u&224)==192){o+=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)o+=String.fromCharCode(u);else{var d=u-65536;o+=String.fromCharCode(55296|d>>10,56320|d&1023)}}return o},Yn=(e,t)=>e?Ue(V,e,t):"",Zn=(e,t)=>{t=L(t),H(e,{name:t,fromWireType(r){for(var n=P[r>>2],a=r+4,o,s,u=a,s=0;s<=n;++s){var c=a+s;if(s==n||V[c]==0){var d=c-u,h=Yn(u,d);o===void 0?o=h:(o+="\0",o+=h),u=c+1}}return nt(r),o},toWireType(r,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var a,o=typeof n=="string";o||ArrayBuffer.isView(n)&&n.BYTES_PER_ELEMENT==1||T("Cannot pass non-string to std::string"),o?a=Be(n):a=n.length;var u=Ne(4+a+1),s=u+4;return P[u>>2]=a,o?ut(n,s,a+1):V.set(n,s),r!==null&&r.push(nt,u),u},argPackAdvance:z,readValueFromPointer:pt,destructorFunction(r){nt(r)}})},Ve=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Qn=(e,t)=>{for(var r=e>>1,n=r+t/2,a=r;!(a>=n)&&ot[a];)++a;if(a-r>16&&Ve)return Ve.decode(ot.subarray(r,a));for(var o="",u=r;!(u>=n);++u){var s=ot[u];if(s==0)break;o+=String.fromCharCode(s)}return o},Jn=(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,o=0;o<a;++o){var u=e.charCodeAt(o);Tt[t>>1]=u,t+=2}return Tt[t>>1]=0,t-n},Kn=e=>e.length*2,ta=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var a=it[e+r*4>>2];if(a==0)break;if(++r,a>=65536){var o=a-65536;n+=String.fromCharCode(55296|o>>10,56320|o&1023)}else n+=String.fromCharCode(a)}return n},ea=(e,t,r)=>{if(r!=null||(r=2147483647),r<4)return 0;for(var n=t,a=n+r-4,o=0;o<e.length;++o){var u=e.charCodeAt(o);if(u>=55296&&u<=57343){var s=e.charCodeAt(++o);u=65536+((u&1023)<<10)|s&1023}if(it[t>>2]=u,t+=4,t+4>a)break}return it[t>>2]=0,t-n},ra=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},na=(e,t,r)=>{r=L(r);var n,a,o,u;t===2?(n=Qn,a=Jn,u=Kn,o=s=>ot[s>>1]):t===4&&(n=ta,a=ea,u=ra,o=s=>P[s>>2]),H(e,{name:r,fromWireType:s=>{for(var c=P[s>>2],d,h=s+4,v=0;v<=c;++v){var $=s+4+v*t;if(v==c||o($)==0){var b=$-h,O=n(h,b);d===void 0?d=O:(d+="\0",d+=O),h=$+t}}return nt(s),d},toWireType:(s,c)=>{typeof c!="string"&&T(`Cannot pass non-string to C++ string type ${r}`);var d=u(c),h=Ne(4+d+t);return P[h>>2]=d/t,a(c,h+4,d+t),s!==null&&s.push(nt,h),h},argPackAdvance:z,readValueFromPointer:pt,destructorFunction(s){nt(s)}})},aa=(e,t,r,n,a,o)=>{At[e]={name:L(t),rawConstructor:k(r,n),rawDestructor:k(a,o),fields:[]}},oa=(e,t,r,n,a,o,u,s,c,d)=>{At[e].fields.push({fieldName:L(t),getterReturnType:r,getter:k(n,a),getterContext:o,setterArgumentType:u,setter:k(s,c),setterContext:d})},ia=(e,t)=>{t=L(t),H(e,{isVoid:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})},te=[],sa=(e,t,r,n)=>(e=te[e],t=G.toValue(t),e(null,t,r,n)),ua={},ca=e=>{var t=ua[e];return t===void 0?L(e):t},ke=()=>{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.")},la=e=>e===0?G.toHandle(ke()):(e=ca(e),G.toHandle(ke()[e])),fa=e=>{var t=te.length;return te.push(e),t},He=(e,t)=>{var r=tt[e];return r===void 0&&T(`${t} has unknown type ${Fe(e)}`),r},da=(e,t)=>{for(var r=new Array(e),n=0;n<e;++n)r[n]=He(P[t+n*4>>2],`parameter ${n}`);return r},ha=(e,t,r)=>{var n=[],a=e.toWireType(n,r);return n.length&&(P[t>>2]=G.toHandle(n)),a},pa=Reflect.construct,va=(e,t,r)=>{var n=da(e,t),a=n.shift();e--;var o=new Array(e),u=(c,d,h,v)=>{for(var $=0,b=0;b<e;++b)o[b]=n[b].readValueFromPointer(v+$),$+=n[b].argPackAdvance;var O=r===1?pa(d,o):d.apply(c,o);return ha(a,h,O)},s=`methodCaller<(${n.map(c=>c.name).join(", ")}) => ${a.name}>`;return fa(qt(s,u))},ya=e=>{e>9&&(rt[e+1]+=1)},ma=e=>{var t=G.toValue(e);zt(t),Kt(e)},ga=(e,t)=>{e=He(e,"_emval_take_value");var r=e.readValueFromPointer(t);return G.toHandle(r)},wa=(e,t,r,n)=>{var a=new Date().getFullYear(),o=new Date(a,0,1),u=new Date(a,6,1),s=o.getTimezoneOffset(),c=u.getTimezoneOffset(),d=Math.max(s,c);P[e>>2]=d*60,it[t>>2]=+(s!=c);var h=b=>{var O=b>=0?"-":"+",x=Math.abs(b),D=String(Math.floor(x/60)).padStart(2,"0"),I=String(x%60).padStart(2,"0");return`UTC${O}${D}${I}`},v=h(s),$=h(c);c<s?(ut(v,r,17),ut($,n,17)):(ut(v,n,17),ut($,r,17))},$a=()=>2147483648,ba=(e,t)=>Math.ceil(e/t)*t,Ca=e=>{var t=Ct.buffer,r=(e-t.byteLength+65535)/65536|0;try{return Ct.grow(r),$e(),1}catch{}},Ta=e=>{var t=V.length;e>>>=0;var r=$a();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 o=Math.min(r,ba(Math.max(e,a),65536)),u=Ca(o);if(u)return!0}return!1},ee={},Pa=()=>q||"./this.program",mt=()=>{if(!mt.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,_:Pa()};for(var r in ee)ee[r]===void 0?delete t[r]:t[r]=ee[r];var n=[];for(var r in t)n.push(`${r}=${t[r]}`);mt.strings=n}return mt.strings},_a=(e,t)=>{var r=0,n=0;for(var a of mt()){var o=t+r;P[e+n>>2]=o,r+=ut(a,o,1/0)+1,n+=4}return 0},Ea=(e,t)=>{var r=mt();P[e>>2]=r.length;var n=0;for(var a of r)n+=Be(a)+1;return P[t>>2]=n,0},Oa=e=>52;function Aa(e,t,r,n,a){return 70}var Sa=[null,[],[]],Da=(e,t)=>{var r=Sa[e];t===0||t===10?((e===1?bt:Y)(Ue(r)),r.length=0):r.push(t)},xa=(e,t,r,n)=>{for(var a=0,o=0;o<r;o++){var u=P[t>>2],s=P[t+4>>2];t+=8;for(var c=0;c<s;c++)Da(e,V[u+c]);a+=s}return P[n>>2]=a,0},Ia=e=>e;pn(),wn(),xn(),l.noExitRuntime&&l.noExitRuntime,l.print&&(bt=l.print),l.printErr&&(Y=l.printErr),l.wasmBinary&&(dt=l.wasmBinary),l.arguments&&l.arguments,l.thisProgram&&(q=l.thisProgram);var Ma={s:tn,w:en,a:rn,j:nn,m:an,P:on,p:sn,ga:un,d:cn,ba:ln,ua:dn,aa:hn,pa:yn,sa:jn,ra:Ln,H:Bn,na:Wn,V:Vn,W:kn,x:Nn,t:zn,ta:Xn,oa:Zn,Q:na,I:aa,va:oa,qa:ia,da:sa,wa:Kt,D:la,ma:va,X:ya,Y:ma,U:ga,ca:wa,ha:Ta,ea:_a,fa:Ea,ia:Oa,_:Aa,S:xa,K:po,C:yo,M:Ga,R:Co,q:co,b:Ya,E:ho,ka:go,c:Za,ja:wo,h:za,i:to,r:ao,O:fo,v:io,F:uo,L:lo,z:mo,J:To,$:Po,Z:_o,k:Qa,f:Na,e:qa,g:Xa,N:bo,l:Ka,la:vo,o:oo,B:eo,u:so,T:no,A:$o,n:Ja,G:ro,y:Ia},E=await Qr();E.ya;var Fa=E.za,nt=l._free=E.Aa,Ne=l._malloc=E.Ca,ja=E.Da,y=E.Ea,Ra=E.Fa,La=E.Ga,Ba=E.Ha,Wa=E.Ia,Ua=E.Ja,Va=E.Ka;l.dynCall_viijii=E.La;var ka=l.dynCall_iiijj=E.Ma;l.dynCall_jiji=E.Na;var Ha=l.dynCall_jiiii=E.Oa;l.dynCall_iiiiij=E.Pa,l.dynCall_iiiiijj=E.Qa,l.dynCall_iiiiiijj=E.Ra;function Na(e,t){var r=g();try{w(e)(t)}catch(n){if(m(r),n!==n+0)throw n;y(1,0)}}function za(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function Ga(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function Xa(e,t,r,n){var a=g();try{w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function qa(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 Ya(e,t){var r=g();try{return w(e)(t)}catch(n){if(m(r),n!==n+0)throw n;y(1,0)}}function Za(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 Qa(e){var t=g();try{w(e)()}catch(r){if(m(t),r!==r+0)throw r;y(1,0)}}function Ja(e,t,r,n,a,o,u,s,c,d,h){var v=g();try{w(e)(t,r,n,a,o,u,s,c,d,h)}catch($){if(m(v),$!==$+0)throw $;y(1,0)}}function Ka(e,t,r,n,a){var o=g();try{w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function to(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function eo(e,t,r,n,a,o,u){var s=g();try{w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function ro(e,t,r,n,a,o,u,s,c,d,h,v,$,b,O,x){var D=g();try{w(e)(t,r,n,a,o,u,s,c,d,h,v,$,b,O,x)}catch(I){if(m(D),I!==I+0)throw I;y(1,0)}}function no(e,t,r,n,a,o,u,s,c){var d=g();try{w(e)(t,r,n,a,o,u,s,c)}catch(h){if(m(d),h!==h+0)throw h;y(1,0)}}function ao(e,t,r,n,a,o){var u=g();try{return w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function oo(e,t,r,n,a,o){var u=g();try{w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function io(e,t,r,n,a,o,u){var s=g();try{return w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function so(e,t,r,n,a,o,u,s){var c=g();try{w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function uo(e,t,r,n,a,o,u,s){var c=g();try{return w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function co(e){var t=g();try{return w(e)()}catch(r){if(m(t),r!==r+0)throw r;y(1,0)}}function lo(e,t,r,n,a,o,u,s,c){var d=g();try{return w(e)(t,r,n,a,o,u,s,c)}catch(h){if(m(d),h!==h+0)throw h;y(1,0)}}function fo(e,t,r,n,a,o,u){var s=g();try{return w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function ho(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function po(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function vo(e,t,r,n,a,o,u,s){var c=g();try{w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function yo(e,t,r,n,a,o){var u=g();try{return w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function mo(e,t,r,n,a,o,u,s,c,d){var h=g();try{return w(e)(t,r,n,a,o,u,s,c,d)}catch(v){if(m(h),v!==v+0)throw v;y(1,0)}}function go(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 wo(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function $o(e,t,r,n,a,o,u,s,c,d){var h=g();try{w(e)(t,r,n,a,o,u,s,c,d)}catch(v){if(m(h),v!==v+0)throw v;y(1,0)}}function bo(e,t,r,n,a,o,u){var s=g();try{w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function Co(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function To(e,t,r,n,a,o,u,s,c,d,h,v){var $=g();try{return w(e)(t,r,n,a,o,u,s,c,d,h,v)}catch(b){if(m($),b!==b+0)throw b;y(1,0)}}function Po(e,t,r,n,a,o,u){var s=g();try{return ka(e,t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function _o(e,t,r,n,a){var o=g();try{return Ha(e,t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function re(){if(K>0){ht=re;return}if(Ur(),K>0){ht=re;return}function e(){var t;l.calledRun=!0,!me&&(Vr(),C(l),(t=l.onRuntimeInitialized)===null||t===void 0||t.call(l),kr())}l.setStatus?(l.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>l.setStatus(""),1),e()},1)):e()}function Eo(){if(l.preInit)for(typeof l.preInit=="function"&&(l.preInit=[l.preInit]);l.preInit.length>0;)l.preInit.shift()()}return Eo(),re(),f=F,f};function Ut(i){return oe(Wt,i)}function wr(){return mr(Wt)}function $r(i){Ut({overrides:i,equalityFn:Object.is,fireImmediately:!1})}async function br(i,f){return gr(Wt,i,f)}const Cr="1c961d9d9a1f0001f5d00486bcf8e1b1a91fcf9fe17ebcbd6e2b6efe21e23038",ie=[["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"]],Tr=[...ie,["unknown"]].map(i=>i[0]),Vt=new Map(ie);function Pr(i){for(const[f,p]of Vt)if(i===p)return f;return"unknown"}function _r(i){if(se(i))return{width:i.naturalWidth,height:i.naturalHeight};if(ue(i))return{width:i.width.baseVal.value,height:i.height.baseVal.value};if(ce(i))return{width:i.videoWidth,height:i.videoHeight};if(fe(i))return{width:i.width,height:i.height};if(he(i))return{width:i.displayWidth,height:i.displayHeight};if(le(i))return{width:i.width,height:i.height};if(de(i))return{width:i.width,height:i.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 se(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLImageElement)}catch{return!1}}function ue(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.SVGImageElement)}catch{return!1}}function ce(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLVideoElement)}catch{return!1}}function le(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLCanvasElement)}catch{return!1}}function fe(i){try{return i instanceof ImageBitmap||Object.prototype.toString.call(i)==="[object ImageBitmap]"}catch{return!1}}function de(i){try{return i instanceof OffscreenCanvas||Object.prototype.toString.call(i)==="[object OffscreenCanvas]"}catch{return!1}}function he(i){try{return i instanceof VideoFrame||Object.prototype.toString.call(i)==="[object VideoFrame]"}catch{return!1}}function Er(i){try{return i instanceof Blob||Object.prototype.toString.call(i)==="[object Blob]"}catch{return!1}}function Or(i){try{return i instanceof ImageData||Object.prototype.toString.call(i)==="[object ImageData]"}catch{return!1}}function Ar(i,f){try{const p=new OffscreenCanvas(i,f);if(p.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return p;throw void 0}catch{const p=document.createElement("canvas");return p.width=i,p.height=f,p}}async function pe(i){if(se(i)&&!await Ir(i))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(ue(i)&&!await Mr(i))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(he(i)&&Fr(i))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(ce(i)&&(i.readyState===0||i.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(fe(i)&&Rr(i))throw new DOMException("The image source is detached.","InvalidStateError");const{width:f,height:p}=_r(i);if(f===0||p===0)return null;const C=Ar(f,p).getContext("2d");C.drawImage(i,0,0);try{return C.getImageData(0,0,f,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Sr(i){let f;try{f=await createImageBitmap(i)}catch{try{if(globalThis.Image){f=new Image;let C="";try{C=URL.createObjectURL(i),f.src=C,await f.decode()}finally{URL.revokeObjectURL(C)}}else return i}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}}return await pe(f)}function Dr(i){const{width:f,height:p}=i;if(f===0||p===0)return null;const l=i.getContext("2d");try{return l.getImageData(0,0,f,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function xr(i){if(Er(i))return await Sr(i);if(Or(i)){if(jr(i))throw new DOMException("The image data has been detached.","InvalidStateError");return i}return le(i)||de(i)?Dr(i):await pe(i)}async function Ir(i){try{return await i.decode(),!0}catch{return!1}}async function Mr(i){var f;try{return await((f=i.decode)==null?void 0:f.call(i)),!0}catch{return!1}}function Fr(i){return i.format===null}function jr(i){return i.data.buffer.byteLength===0}function Rr(i){return i.width===0&&i.height===0}function ve(i,f){return Lr(i)?new DOMException(`${f}: ${i.message}`,i.name):Br(i)?new i.constructor(`${f}: ${i.message}`):new Error(`${f}: ${i}`)}function Lr(i){return i instanceof DOMException||Object.prototype.toString.call(i)==="[object DOMException]"}function Br(i){return i instanceof Error||Object.prototype.toString.call(i)==="[object Error]"}class Wr{constructor(f={}){Je(this,ct);var p;try{const l=(p=f==null?void 0:f.formats)==null?void 0:p.filter(C=>C!=="unknown");if((l==null?void 0:l.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const C of l!=null?l:[])if(!Vt.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.`);Ke(this,ct,l!=null?l:[]),Ut({fireImmediately:!0}).catch(()=>{})}catch(l){throw ve(l,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Tr.filter(f=>f!=="unknown")}async detect(f){try{const p=await xr(f);if(p===null)return[];let l;const C={tryCode39ExtendedMode:!1,textMode:"Plain",formats:Qe(this,ct).map(A=>Vt.get(A))};try{l=await br(p,C)}catch(A){throw console.error(A),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return l.map(A=>{const{topLeft:{x:F,y:B},topRight:{x:S,y:j},bottomLeft:{x:q,y:Z},bottomRight:{x:Q,y:lt}}=A.position,ft=Math.min(F,S,q,Q),at=Math.min(B,j,Z,lt),bt=Math.max(F,S,q,Q),Y=Math.max(B,j,Z,lt);return{boundingBox:new DOMRectReadOnly(ft,at,bt-ft,Y-at),rawValue:A.text,format:Pr(A.format),cornerPoints:[{x:F,y:B},{x:S,y:j},{x:Q,y:lt},{x:q,y:Z}]}})}catch(p){throw ve(p,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return ct=new WeakMap,(ye=globalThis.BarcodeDetector)!=null||(globalThis.BarcodeDetector=Wr),_.ZXING_CPP_COMMIT=pr,_.ZXING_WASM_SHA256=Cr,_.ZXING_WASM_VERSION=hr,_.prepareZXingModule=Ut,_.purgeZXingModule=wr,_.setZXingModuleOverrides=$r,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}),_}({});
|
package/dist/iife/ponyfill.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var BarcodeDetectionAPI=function(_){"use strict";var qe=_=>{throw TypeError(_)};var Ye=(_,M,R)=>M.has(_)||qe("Cannot "+R);var Ze=(_,M,R)=>(Ye(_,M,"read from private field"),R?R.call(_):M.get(_)),Qe=(_,M,R)=>M.has(_)?qe("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(_):M.set(_,R),Je=(_,M,R,gt)=>(Ye(_,M,"write to private field"),gt?gt.call(_,R):M.set(_,R),R);var ct;const M=[["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"]],R=M.map(([i])=>i),gt=R.filter((i,f)=>M[f][1]==="L"),Ke=R.filter((i,f)=>M[f][1]==="M");function Bt(i){switch(i){case"Linear-Codes":return gt.reduce((f,p)=>f|Bt(p),0);case"Matrix-Codes":return Ke.reduce((f,p)=>f|Bt(p),0);case"Any":return(1<<M.length)-1;case"None":return 0;default:return 1<<R.indexOf(i)}}function tr(i){if(i===0)return"None";const f=31-Math.clz32(i);return R[f]}function er(i){return i.reduce((f,p)=>f|Bt(p),0)}const rr=["LocalAverage","GlobalHistogram","FixedThreshold","BoolCast"];function nr(i){return rr.indexOf(i)}const ne=["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 ar(i){return i==="UnicodeBig"?ne.indexOf("UTF16BE"):ne.indexOf(i)}const or=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function ir(i){return or[i]}const sr=["Ignore","Read","Require"];function ur(i){return sr.indexOf(i)}const cr=["Plain","ECI","HRI","Hex","Escaped"];function lr(i){return cr.indexOf(i)}const wt={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 ae(i){return{...i,formats:er(i.formats),binarizer:nr(i.binarizer),eanAddOnSymbol:ur(i.eanAddOnSymbol),textMode:lr(i.textMode),characterSet:ar(i.characterSet)}}function fr(i){return{...i,format:tr(i.format),contentType:ir(i.contentType),eccLevel:i.ecLevel}}const dr="2.2.0",hr="0a3797f698b339c1c01c487a7a43f1368610f503",pr={locateFile:(i,f)=>{const p=i.match(/_(.+?)\.wasm$/);return p?`https://fastly.jsdelivr.net/npm/zxing-wasm@2.2.0/dist/${p[1]}/${i}`:f+i}},$t=new WeakMap;function vr(i,f){return Object.is(i,f)||Object.keys(i).length===Object.keys(f).length&&Object.keys(i).every(p=>Object.hasOwn(f,p)&&i[p]===f[p])}function oe(i,{overrides:f,equalityFn:p=vr,fireImmediately:l=!1}={}){var C;const[A,F]=(C=$t.get(i))!=null?C:[pr],B=f!=null?f:A;let S;if(l){if(F&&(S=p(A,B)))return F;const j=i({...B});return $t.set(i,[B,j]),j}(S!=null?S:p(A,B))||$t.set(i,[B])}function yr(i){$t.delete(i)}async function mr(i,f,p=wt){const l={...wt,...p},C=await oe(i,{fireImmediately:!0});let A,F;if("width"in f&&"height"in f&&"data"in f){const{data:S,data:{byteLength:j},width:q,height:Z}=f;F=C._malloc(j),C.HEAPU8.set(S,F),A=C.readBarcodesFromPixmap(F,q,Z,ae(l))}else{let S,j;if("buffer"in f)[S,j]=[f.byteLength,f];else if("byteLength"in f)[S,j]=[f.byteLength,new Uint8Array(f)];else if("size"in f)[S,j]=[f.size,new Uint8Array(await f.arrayBuffer())];else throw new TypeError("Invalid input type");F=C._malloc(S),C.HEAPU8.set(j,F),A=C.readBarcodesFromImage(F,S,ae(l))}C._free(F);const B=[];for(let S=0;S<A.size();++S)B.push(fr(A.get(S)));return B}({...wt,formats:[...wt.formats]});var Wt=async function(i={}){var f,p,l=i,C,A,F=new Promise((e,t)=>{C=e,A=t}),B=typeof window=="object",S=typeof Bun<"u",j=typeof WorkerGlobalScope<"u";typeof process=="object"&&!((p=process.versions)===null||p===void 0)&&p.node&&process.type!="renderer";var q="./this.program",Z,Q="";function lt(e){return l.locateFile?l.locateFile(e,Q):Q+e}var ft,at;if(B||j||S){try{Q=new URL(".",Z).href}catch{}j&&(at=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),ft=async e=>{var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw new Error(t.status+" : "+t.url)}}var bt=console.log.bind(console),Y=console.error.bind(console),dt,Ct,ye=!1,J,V,Tt,ot,it,P,me,ge;function we(){var e=Ct.buffer;J=new Int8Array(e),Tt=new Int16Array(e),l.HEAPU8=V=new Uint8Array(e),ot=new Uint16Array(e),it=new Int32Array(e),P=new Uint32Array(e),me=new Float32Array(e),ge=new Float64Array(e)}function Wr(){if(l.preRun)for(typeof l.preRun=="function"&&(l.preRun=[l.preRun]);l.preRun.length;)Jr(l.preRun.shift());$e(Ce)}function Ur(){E.ya()}function Vr(){if(l.postRun)for(typeof l.postRun=="function"&&(l.postRun=[l.postRun]);l.postRun.length;)Qr(l.postRun.shift());$e(be)}var K=0,ht=null;function kr(e){var t;K++,(t=l.monitorRunDependencies)===null||t===void 0||t.call(l,K)}function Hr(e){var t;if(K--,(t=l.monitorRunDependencies)===null||t===void 0||t.call(l,K),K==0&&ht){var r=ht;ht=null,r()}}function kt(e){var t;(t=l.onAbort)===null||t===void 0||t.call(l,e),e="Aborted("+e+")",Y(e),ye=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw A(r),r}var Pt;function Nr(){return lt("zxing_reader.wasm")}function zr(e){if(e==Pt&&dt)return new Uint8Array(dt);if(at)return at(e);throw"both async and sync fetching of the wasm failed"}async function Gr(e){if(!dt)try{var t=await ft(e);return new Uint8Array(t)}catch{}return zr(e)}async function Xr(e,t){try{var r=await Gr(e),n=await WebAssembly.instantiate(r,t);return n}catch(a){Y(`failed to asynchronously prepare wasm: ${a}`),kt(a)}}async function qr(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(o){Y(`wasm streaming compile failed: ${o}`),Y("falling back to ArrayBuffer instantiation")}return Xr(t,r)}function Yr(){return{a:xa}}async function Zr(){function e(o,u){return E=o.exports,Ct=E.xa,we(),xe=E.Ba,Hr(),E}kr();function t(o){return e(o.instance)}var r=Yr();if(l.instantiateWasm)return new Promise((o,u)=>{l.instantiateWasm(r,(s,c)=>{o(e(s))})});Pt!=null||(Pt=Nr());try{var n=await qr(dt,Pt,r),a=t(n);return a}catch(o){return A(o),Promise.reject(o)}}var $e=e=>{for(;e.length>0;)e.shift()(l)},be=[],Qr=e=>be.push(e),Ce=[],Jr=e=>Ce.push(e),m=e=>Ra(e),g=()=>La(),_t=[],Et=0,Kr=e=>{var t=new Ht(e);return t.get_caught()||(t.set_caught(!0),Et--),t.set_rethrown(!1),_t.push(t),Wa(e),Fa(e)},N=0,tn=()=>{y(0,0);var e=_t.pop();Ba(e.excPtr),N=0};class Ht{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,J[this.ptr+12]=t}get_caught(){return J[this.ptr+12]!=0}set_rethrown(t){t=t?1:0,J[this.ptr+13]=t}get_rethrown(){return J[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 Ot=e=>ja(e),Nt=e=>{var t=N;if(!t)return Ot(0),0;var r=new Ht(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return Ot(0),t;for(var a of e){if(a===0||a===n)break;var o=r.ptr+16;if(Ua(a,n,o))return Ot(a),t}return Ot(n),t},en=()=>Nt([]),rn=e=>Nt([e]),nn=(e,t)=>Nt([e,t]),an=()=>{var e=_t.pop();e||kt("no exception to throw");var t=e.excPtr;throw e.get_rethrown()||(_t.push(e),e.set_rethrown(!0),e.set_caught(!1),Et++),N=t,N},on=(e,t,r)=>{var n=new Ht(e);throw n.init(t,r),N=e,Et++,N},sn=()=>Et,un=e=>{throw N||(N=e),N},cn=()=>kt(""),At={},zt=e=>{for(;e.length;){var t=e.pop(),r=e.pop();r(t)}};function pt(e){return this.fromWireType(P[e>>2])}var st={},tt={},St={},ln=class extends Error{constructor(e){super(e),this.name="InternalError"}},Dt=e=>{throw new ln(e)},et=(e,t,r)=>{e.forEach(s=>St[s]=t);function n(s){var c=r(s);c.length!==e.length&&Dt("Mismatched type converter count");for(var d=0;d<e.length;++d)H(e[d],c[d])}var a=new Array(t.length),o=[],u=0;t.forEach((s,c)=>{tt.hasOwnProperty(s)?a[c]=tt[s]:(o.push(s),st.hasOwnProperty(s)||(st[s]=[]),st[s].push(()=>{a[c]=tt[s],++u,u===o.length&&n(a)}))}),o.length===0&&n(a)},fn=e=>{var t=At[e];delete At[e];var r=t.rawConstructor,n=t.rawDestructor,a=t.fields,o=a.map(u=>u.getterReturnType).concat(a.map(u=>u.setterArgumentType));et([e],o,u=>{var s={};return a.forEach((c,d)=>{var h=c.fieldName,v=u[d],$=u[d].optional,b=c.getter,O=c.getterContext,I=u[d+a.length],D=c.setter,x=c.setterContext;s[h]={read:X=>v.fromWireType(b(O,X)),write:(X,W)=>{var U=[];D(x,X,I.toWireType(U,W)),zt(U)},optional:$}}),[{name:t.name,fromWireType:c=>{var d={};for(var h in s)d[h]=s[h].read(c);return n(c),d},toWireType:(c,d)=>{for(var h in s)if(!(h in d)&&!s[h].optional)throw new TypeError(`Missing field: "${h}"`);var v=r();for(h in s)s[h].write(v,d[h]);return c!==null&&c.push(n,v),v},argPackAdvance:z,readValueFromPointer:pt,destructorFunction:n}]})},dn=(e,t,r,n,a)=>{},hn=()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);Te=e},Te,L=e=>{for(var t="",r=e;V[r];)t+=Te[V[r++]];return t},vt=class extends Error{constructor(e){super(e),this.name="BindingError"}},T=e=>{throw new vt(e)};function pn(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`),tt.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;T(`Cannot register type '${n}' twice`)}if(tt[e]=t,delete St[e],st.hasOwnProperty(e)){var a=st[e];delete st[e],a.forEach(o=>o())}}function H(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return pn(e,t,r)}var z=8,vn=(e,t,r,n)=>{t=L(t),H(e,{name:t,fromWireType:function(a){return!!a},toWireType:function(a,o){return o?r:n},argPackAdvance:z,readValueFromPointer:function(a){return this.fromWireType(V[a])},destructorFunction:null})},yn=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Gt=e=>{function t(r){return r.$$.ptrType.registeredClass.name}T(t(e)+" instance already deleted")},Xt=!1,Pe=e=>{},mn=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},_e=e=>{e.count.value-=1;var t=e.count.value===0;t&&mn(e)},yt=e=>typeof FinalizationRegistry>"u"?(yt=t=>t,e):(Xt=new FinalizationRegistry(t=>{_e(t.$$)}),yt=t=>{var r=t.$$,n=!!r.smartPtr;if(n){var a={$$:r};Xt.register(t,a,t)}return t},Pe=t=>Xt.unregister(t),yt(e)),gn=()=>{let e=It.prototype;Object.assign(e,{isAliasOf(r){if(!(this instanceof It)||!(r instanceof It))return!1;var n=this.$$.ptrType.registeredClass,a=this.$$.ptr;r.$$=r.$$;for(var o=r.$$.ptrType.registeredClass,u=r.$$.ptr;n.baseClass;)a=n.upcast(a),n=n.baseClass;for(;o.baseClass;)u=o.upcast(u),o=o.baseClass;return n===o&&a===u},clone(){if(this.$$.ptr||Gt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var r=yt(Object.create(Object.getPrototypeOf(this),{$$:{value:yn(this.$$)}}));return r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},delete(){this.$$.ptr||Gt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&T("Object already scheduled for deletion"),Pe(this),_e(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Gt(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 It(){}var qt=(e,t)=>Object.defineProperty(t,"name",{value:e}),Ee={},Oe=(e,t,r)=>{if(e[t].overloadTable===void 0){var n=e[t];e[t]=function(){for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return e[t].overloadTable.hasOwnProperty(o.length)||T(`Function '${r}' called with an invalid number of arguments (${o.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[o.length].apply(this,o)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},Ae=(e,t,r)=>{l.hasOwnProperty(e)?((r===void 0||l[e].overloadTable!==void 0&&l[e].overloadTable[r]!==void 0)&&T(`Cannot register public name '${e}' twice`),Oe(l,e,e),l[e].overloadTable.hasOwnProperty(r)&&T(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),l[e].overloadTable[r]=t):(l[e]=t,l[e].argCount=r)},wn=48,$n=57,bn=e=>{e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return t>=wn&&t<=$n?`_${e}`:e};function Cn(e,t,r,n,a,o,u,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=u,this.downcast=s,this.pureVirtualFunctions=[]}var Yt=(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},Zt=e=>{if(e===null)return"null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e};function Tn(e,t){if(t===null)return this.isReference&&T(`null is not a valid ${this.name}`),0;t.$$||T(`Cannot pass "${Zt(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=Yt(t.$$.ptr,r,this.registeredClass);return n}function Pn(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 "${Zt(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=Yt(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,G.toHandle(()=>a.delete())),e!==null&&e.push(this.rawDestructor,r)}break;default:T("Unsupporting sharing policy")}return r}function _n(e,t){if(t===null)return this.isReference&&T(`null is not a valid ${this.name}`),0;t.$$||T(`Cannot pass "${Zt(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=Yt(t.$$.ptr,r,this.registeredClass);return n}var Se=(e,t,r)=>{if(t===r)return e;if(r.baseClass===void 0)return null;var n=Se(e,t,r.baseClass);return n===null?null:r.downcast(n)},En={},On=(e,t)=>{for(t===void 0&&T("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t},An=(e,t)=>(t=On(e,t),En[t]),xt=(e,t)=>{(!t.ptrType||!t.ptr)&&Dt("makeClassHandle requires ptr and ptrType");var r=!!t.smartPtrType,n=!!t.smartPtr;return r!==n&&Dt("Both smartPtrType and smartPtr must be specified"),t.count={value:1},yt(Object.create(e,{$$:{value:t,writable:!0}}))};function Sn(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=An(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?xt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):xt(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var o=this.registeredClass.getActualType(t),u=Ee[o];if(!u)return a.call(this);var s;this.isConst?s=u.constPointerType:s=u.pointerType;var c=Se(t,this.registeredClass,s.registeredClass);return c===null?a.call(this):this.isSmartPointer?xt(s.registeredClass.instancePrototype,{ptrType:s,ptr:c,smartPtrType:this,smartPtr:e}):xt(s.registeredClass.instancePrototype,{ptrType:s,ptr:c})}var Dn=()=>{Object.assign(Mt.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:z,readValueFromPointer:pt,fromWireType:Sn})};function Mt(e,t,r,n,a,o,u,s,c,d,h){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=u,this.rawGetPointee=s,this.rawConstructor=c,this.rawShare=d,this.rawDestructor=h,!a&&t.baseClass===void 0?n?(this.toWireType=Tn,this.destructorFunction=null):(this.toWireType=_n,this.destructorFunction=null):this.toWireType=Pn}var De=(e,t,r)=>{l.hasOwnProperty(e)||Dt("Replacing nonexistent public symbol"),l[e].overloadTable!==void 0&&r!==void 0?l[e].overloadTable[r]=t:(l[e]=t,l[e].argCount=r)},Ie=[],xe,w=e=>{var t=Ie[e];return t||(Ie[e]=t=xe.get(e)),t},In=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},xn=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),o=0;o<n;o++)a[o]=arguments[o];return In(e,t,a,r)}},k=function(e,t){e=L(e);function r(){if(e.includes("j"))return xn(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 Mn extends Error{}var Me=e=>{var t=Ma(e),r=L(t);return nt(t),r},Ft=(e,t)=>{var r=[],n={};function a(o){if(!n[o]&&!tt[o]){if(St[o]){St[o].forEach(a);return}r.push(o),n[o]=!0}}throw t.forEach(a),new Mn(`${e}: `+r.map(Me).join([", "]))},Fn=(e,t,r,n,a,o,u,s,c,d,h,v,$)=>{h=L(h),o=k(a,o),s&&(s=k(u,s)),d&&(d=k(c,d)),$=k(v,$);var b=bn(h);Ae(b,function(){Ft(`Cannot construct ${h} due to unbound types`,[n])}),et([e,t,r],n?[n]:[],O=>{O=O[0];var I,D;n?(I=O.registeredClass,D=I.instancePrototype):D=It.prototype;var x=qt(h,function(){if(Object.getPrototypeOf(this)!==X)throw new vt(`Use 'new' to construct ${h}`);if(W.constructor_body===void 0)throw new vt(`${h} has no accessible constructor`);for(var Ge=arguments.length,Rt=new Array(Ge),Lt=0;Lt<Ge;Lt++)Rt[Lt]=arguments[Lt];var Xe=W.constructor_body[Rt.length];if(Xe===void 0)throw new vt(`Tried to invoke ctor of ${h} with invalid number of parameters (${Rt.length}) - expected (${Object.keys(W.constructor_body).toString()}) parameters instead!`);return Xe.apply(this,Rt)}),X=Object.create(D,{constructor:{value:x}});x.prototype=X;var W=new Cn(h,x,X,$,I,o,s,d);if(W.baseClass){var U,jt;(jt=(U=W.baseClass).__derivedClasses)!==null&&jt!==void 0||(U.__derivedClasses=[]),W.baseClass.__derivedClasses.push(W)}var Eo=new Mt(h,W,!0,!1,!1),Ne=new Mt(h+"*",W,!1,!1,!1),ze=new Mt(h+" const*",W,!1,!0,!1);return Ee[e]={pointerType:Ne,constPointerType:ze},De(b,x),[Eo,Ne,ze]})},Qt=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(P[t+n*4>>2]);return r};function jn(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].destructorFunction===void 0)return!0;return!1}function Jt(e,t,r,n,a,o){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=jn(t),d=t[0].name!=="void",h=u-2,v=new Array(h),$=[],b=[],O=function(){b.length=0;var I;$.length=s?2:1,$[0]=a,s&&(I=t[1].toWireType(b,this),$[1]=I);for(var D=0;D<h;++D)v[D]=t[D+2].toWireType(b,D<0||arguments.length<=D?void 0:arguments[D]),$.push(v[D]);var x=n(...$);function X(W){if(c)zt(b);else for(var U=s?1:2;U<t.length;U++){var jt=U===1?I:v[U-2];t[U].destructorFunction!==null&&t[U].destructorFunction(jt)}if(d)return t[0].fromWireType(W)}return X(x)};return qt(e,O)}var Rn=(e,t,r,n,a,o)=>{var u=Qt(t,r);a=k(n,a),et([],[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 vt(`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]=()=>{Ft(`Cannot construct ${s.name} due to unbound types`,u)},et([],u,d=>(d.splice(1,0,null),s.registeredClass.constructor_body[t-1]=Jt(c,d,null,a,o),[])),[]})},Fe=e=>{e=e.trim();const t=e.indexOf("(");return t===-1?e:e.slice(0,t)},Ln=(e,t,r,n,a,o,u,s,c,d)=>{var h=Qt(r,n);t=L(t),t=Fe(t),o=k(a,o),et([],[e],v=>{v=v[0];var $=`${v.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&v.registeredClass.pureVirtualFunctions.push(t);function b(){Ft(`Cannot call ${$} due to unbound types`,h)}var O=v.registeredClass.instancePrototype,I=O[t];return I===void 0||I.overloadTable===void 0&&I.className!==v.name&&I.argCount===r-2?(b.argCount=r-2,b.className=v.name,O[t]=b):(Oe(O,t,$),O[t].overloadTable[r-2]=b),et([],h,D=>{var x=Jt($,D,v,o,u);return O[t].overloadTable===void 0?(x.argCount=r-2,O[t]=x):O[t].overloadTable[r-2]=x,[]}),[]})},je=[],rt=[0,1,,1,null,1,!0,1,!1,1],Kt=e=>{e>9&&--rt[e+1]===0&&(rt[e]=void 0,je.push(e))},G={toValue:e=>(e||T(`Cannot use deleted val. handle = ${e}`),rt[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=je.pop()||rt.length;return rt[t]=e,rt[t+1]=1,t}}}},Re={name:"emscripten::val",fromWireType:e=>{var t=G.toValue(e);return Kt(e),t},toWireType:(e,t)=>G.toHandle(t),argPackAdvance:z,readValueFromPointer:pt,destructorFunction:null},Bn=e=>H(e,Re),Wn=(e,t)=>{switch(t){case 4:return function(r){return this.fromWireType(me[r>>2])};case 8:return function(r){return this.fromWireType(ge[r>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Un=(e,t,r)=>{t=L(t),H(e,{name:t,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:z,readValueFromPointer:Wn(t,r),destructorFunction:null})},Vn=(e,t,r,n,a,o,u,s)=>{var c=Qt(t,r);e=L(e),e=Fe(e),a=k(n,a),Ae(e,function(){Ft(`Cannot call ${e} due to unbound types`,c)},t-1),et([],c,d=>{var h=[d[0],null].concat(d.slice(1));return De(e,Jt(e,h,null,a,o),t-1),[]})},kn=(e,t,r)=>{switch(t){case 1:return r?n=>J[n]:n=>V[n];case 2:return r?n=>Tt[n>>1]:n=>ot[n>>1];case 4:return r?n=>it[n>>2]:n=>P[n>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Hn=(e,t,r,n,a)=>{t=L(t);const o=n===0;let u=c=>c;if(o){var s=32-8*r;u=c=>c<<s>>>s,a=u(a)}H(e,{name:t,fromWireType:u,toWireType:(c,d)=>d,argPackAdvance:z,readValueFromPointer:kn(t,r,n!==0),destructorFunction:null})},Nn=(e,t,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[t];function o(u){var s=P[u>>2],c=P[u+4>>2];return new a(J.buffer,c,s)}r=L(r),H(e,{name:r,fromWireType:o,argPackAdvance:z,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},zn=Object.assign({optional:!0},Re),Gn=(e,t)=>{H(e,zn)},Xn=(e,t,r,n)=>{if(!(n>0))return 0;for(var a=r,o=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>=o)break;t[r++]=s}else if(s<=2047){if(r+1>=o)break;t[r++]=192|s>>6,t[r++]=128|s&63}else if(s<=65535){if(r+2>=o)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|s&63}else{if(r+3>=o)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},ut=(e,t,r)=>Xn(e,V,t,r),Le=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},Be=typeof TextDecoder<"u"?new TextDecoder:void 0,We=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&&Be)return Be.decode(e.subarray(t,a));for(var o="";t<a;){var u=e[t++];if(!(u&128)){o+=String.fromCharCode(u);continue}var s=e[t++]&63;if((u&224)==192){o+=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)o+=String.fromCharCode(u);else{var d=u-65536;o+=String.fromCharCode(55296|d>>10,56320|d&1023)}}return o},qn=(e,t)=>e?We(V,e,t):"",Yn=(e,t)=>{t=L(t),H(e,{name:t,fromWireType(r){for(var n=P[r>>2],a=r+4,o,s,u=a,s=0;s<=n;++s){var c=a+s;if(s==n||V[c]==0){var d=c-u,h=qn(u,d);o===void 0?o=h:(o+="\0",o+=h),u=c+1}}return nt(r),o},toWireType(r,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var a,o=typeof n=="string";o||ArrayBuffer.isView(n)&&n.BYTES_PER_ELEMENT==1||T("Cannot pass non-string to std::string"),o?a=Le(n):a=n.length;var u=He(4+a+1),s=u+4;return P[u>>2]=a,o?ut(n,s,a+1):V.set(n,s),r!==null&&r.push(nt,u),u},argPackAdvance:z,readValueFromPointer:pt,destructorFunction(r){nt(r)}})},Ue=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Zn=(e,t)=>{for(var r=e>>1,n=r+t/2,a=r;!(a>=n)&&ot[a];)++a;if(a-r>16&&Ue)return Ue.decode(ot.subarray(r,a));for(var o="",u=r;!(u>=n);++u){var s=ot[u];if(s==0)break;o+=String.fromCharCode(s)}return o},Qn=(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,o=0;o<a;++o){var u=e.charCodeAt(o);Tt[t>>1]=u,t+=2}return Tt[t>>1]=0,t-n},Jn=e=>e.length*2,Kn=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var a=it[e+r*4>>2];if(a==0)break;if(++r,a>=65536){var o=a-65536;n+=String.fromCharCode(55296|o>>10,56320|o&1023)}else n+=String.fromCharCode(a)}return n},ta=(e,t,r)=>{if(r!=null||(r=2147483647),r<4)return 0;for(var n=t,a=n+r-4,o=0;o<e.length;++o){var u=e.charCodeAt(o);if(u>=55296&&u<=57343){var s=e.charCodeAt(++o);u=65536+((u&1023)<<10)|s&1023}if(it[t>>2]=u,t+=4,t+4>a)break}return it[t>>2]=0,t-n},ea=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},ra=(e,t,r)=>{r=L(r);var n,a,o,u;t===2?(n=Zn,a=Qn,u=Jn,o=s=>ot[s>>1]):t===4&&(n=Kn,a=ta,u=ea,o=s=>P[s>>2]),H(e,{name:r,fromWireType:s=>{for(var c=P[s>>2],d,h=s+4,v=0;v<=c;++v){var $=s+4+v*t;if(v==c||o($)==0){var b=$-h,O=n(h,b);d===void 0?d=O:(d+="\0",d+=O),h=$+t}}return nt(s),d},toWireType:(s,c)=>{typeof c!="string"&&T(`Cannot pass non-string to C++ string type ${r}`);var d=u(c),h=He(4+d+t);return P[h>>2]=d/t,a(c,h+4,d+t),s!==null&&s.push(nt,h),h},argPackAdvance:z,readValueFromPointer:pt,destructorFunction(s){nt(s)}})},na=(e,t,r,n,a,o)=>{At[e]={name:L(t),rawConstructor:k(r,n),rawDestructor:k(a,o),fields:[]}},aa=(e,t,r,n,a,o,u,s,c,d)=>{At[e].fields.push({fieldName:L(t),getterReturnType:r,getter:k(n,a),getterContext:o,setterArgumentType:u,setter:k(s,c),setterContext:d})},oa=(e,t)=>{t=L(t),H(e,{isVoid:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})},te=[],ia=(e,t,r,n)=>(e=te[e],t=G.toValue(t),e(null,t,r,n)),sa={},ua=e=>{var t=sa[e];return t===void 0?L(e):t},Ve=()=>{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.")},ca=e=>e===0?G.toHandle(Ve()):(e=ua(e),G.toHandle(Ve()[e])),la=e=>{var t=te.length;return te.push(e),t},ke=(e,t)=>{var r=tt[e];return r===void 0&&T(`${t} has unknown type ${Me(e)}`),r},fa=(e,t)=>{for(var r=new Array(e),n=0;n<e;++n)r[n]=ke(P[t+n*4>>2],`parameter ${n}`);return r},da=(e,t,r)=>{var n=[],a=e.toWireType(n,r);return n.length&&(P[t>>2]=G.toHandle(n)),a},ha=Reflect.construct,pa=(e,t,r)=>{var n=fa(e,t),a=n.shift();e--;var o=new Array(e),u=(c,d,h,v)=>{for(var $=0,b=0;b<e;++b)o[b]=n[b].readValueFromPointer(v+$),$+=n[b].argPackAdvance;var O=r===1?ha(d,o):d.apply(c,o);return da(a,h,O)},s=`methodCaller<(${n.map(c=>c.name).join(", ")}) => ${a.name}>`;return la(qt(s,u))},va=e=>{e>9&&(rt[e+1]+=1)},ya=e=>{var t=G.toValue(e);zt(t),Kt(e)},ma=(e,t)=>{e=ke(e,"_emval_take_value");var r=e.readValueFromPointer(t);return G.toHandle(r)},ga=(e,t,r,n)=>{var a=new Date().getFullYear(),o=new Date(a,0,1),u=new Date(a,6,1),s=o.getTimezoneOffset(),c=u.getTimezoneOffset(),d=Math.max(s,c);P[e>>2]=d*60,it[t>>2]=+(s!=c);var h=b=>{var O=b>=0?"-":"+",I=Math.abs(b),D=String(Math.floor(I/60)).padStart(2,"0"),x=String(I%60).padStart(2,"0");return`UTC${O}${D}${x}`},v=h(s),$=h(c);c<s?(ut(v,r,17),ut($,n,17)):(ut(v,n,17),ut($,r,17))},wa=()=>2147483648,$a=(e,t)=>Math.ceil(e/t)*t,ba=e=>{var t=Ct.buffer,r=(e-t.byteLength+65535)/65536|0;try{return Ct.grow(r),we(),1}catch{}},Ca=e=>{var t=V.length;e>>>=0;var r=wa();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 o=Math.min(r,$a(Math.max(e,a),65536)),u=ba(o);if(u)return!0}return!1},ee={},Ta=()=>q||"./this.program",mt=()=>{if(!mt.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,_:Ta()};for(var r in ee)ee[r]===void 0?delete t[r]:t[r]=ee[r];var n=[];for(var r in t)n.push(`${r}=${t[r]}`);mt.strings=n}return mt.strings},Pa=(e,t)=>{var r=0,n=0;for(var a of mt()){var o=t+r;P[e+n>>2]=o,r+=ut(a,o,1/0)+1,n+=4}return 0},_a=(e,t)=>{var r=mt();P[e>>2]=r.length;var n=0;for(var a of r)n+=Le(a)+1;return P[t>>2]=n,0},Ea=e=>52;function Oa(e,t,r,n,a){return 70}var Aa=[null,[],[]],Sa=(e,t)=>{var r=Aa[e];t===0||t===10?((e===1?bt:Y)(We(r)),r.length=0):r.push(t)},Da=(e,t,r,n)=>{for(var a=0,o=0;o<r;o++){var u=P[t>>2],s=P[t+4>>2];t+=8;for(var c=0;c<s;c++)Sa(e,V[u+c]);a+=s}return P[n>>2]=a,0},Ia=e=>e;hn(),gn(),Dn(),l.noExitRuntime&&l.noExitRuntime,l.print&&(bt=l.print),l.printErr&&(Y=l.printErr),l.wasmBinary&&(dt=l.wasmBinary),l.arguments&&l.arguments,l.thisProgram&&(q=l.thisProgram);var xa={s:Kr,w:tn,a:en,j:rn,m:nn,P:an,p:on,ga:sn,d:un,ba:cn,ua:fn,aa:dn,pa:vn,sa:Fn,ra:Rn,H:Ln,na:Bn,V:Un,W:Vn,x:Hn,t:Nn,ta:Gn,oa:Yn,Q:ra,I:na,va:aa,qa:oa,da:ia,wa:Kt,D:ca,ma:pa,X:va,Y:ya,U:ma,ca:ga,ha:Ca,ea:Pa,fa:_a,ia:Ea,_:Oa,S:Da,K:ho,C:vo,M:za,R:bo,q:uo,b:qa,E:fo,ka:mo,c:Ya,ja:go,h:Na,i:Ka,r:no,O:lo,v:oo,F:so,L:co,z:yo,J:Co,$:To,Z:Po,k:Za,f:Ha,e:Xa,g:Ga,N:$o,l:Ja,la:po,o:ao,B:to,u:io,T:ro,A:wo,n:Qa,G:eo,y:Ia},E=await Zr();E.ya;var Ma=E.za,nt=l._free=E.Aa,He=l._malloc=E.Ca,Fa=E.Da,y=E.Ea,ja=E.Fa,Ra=E.Ga,La=E.Ha,Ba=E.Ia,Wa=E.Ja,Ua=E.Ka;l.dynCall_viijii=E.La;var Va=l.dynCall_iiijj=E.Ma;l.dynCall_jiji=E.Na;var ka=l.dynCall_jiiii=E.Oa;l.dynCall_iiiiij=E.Pa,l.dynCall_iiiiijj=E.Qa,l.dynCall_iiiiiijj=E.Ra;function Ha(e,t){var r=g();try{w(e)(t)}catch(n){if(m(r),n!==n+0)throw n;y(1,0)}}function Na(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function za(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function Ga(e,t,r,n){var a=g();try{w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function Xa(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 qa(e,t){var r=g();try{return w(e)(t)}catch(n){if(m(r),n!==n+0)throw n;y(1,0)}}function Ya(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 Za(e){var t=g();try{w(e)()}catch(r){if(m(t),r!==r+0)throw r;y(1,0)}}function Qa(e,t,r,n,a,o,u,s,c,d,h){var v=g();try{w(e)(t,r,n,a,o,u,s,c,d,h)}catch($){if(m(v),$!==$+0)throw $;y(1,0)}}function Ja(e,t,r,n,a){var o=g();try{w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function Ka(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function to(e,t,r,n,a,o,u){var s=g();try{w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function eo(e,t,r,n,a,o,u,s,c,d,h,v,$,b,O,I){var D=g();try{w(e)(t,r,n,a,o,u,s,c,d,h,v,$,b,O,I)}catch(x){if(m(D),x!==x+0)throw x;y(1,0)}}function ro(e,t,r,n,a,o,u,s,c){var d=g();try{w(e)(t,r,n,a,o,u,s,c)}catch(h){if(m(d),h!==h+0)throw h;y(1,0)}}function no(e,t,r,n,a,o){var u=g();try{return w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function ao(e,t,r,n,a,o){var u=g();try{w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function oo(e,t,r,n,a,o,u){var s=g();try{return w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function io(e,t,r,n,a,o,u,s){var c=g();try{w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function so(e,t,r,n,a,o,u,s){var c=g();try{return w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function uo(e){var t=g();try{return w(e)()}catch(r){if(m(t),r!==r+0)throw r;y(1,0)}}function co(e,t,r,n,a,o,u,s,c){var d=g();try{return w(e)(t,r,n,a,o,u,s,c)}catch(h){if(m(d),h!==h+0)throw h;y(1,0)}}function lo(e,t,r,n,a,o,u){var s=g();try{return w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function fo(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function ho(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function po(e,t,r,n,a,o,u,s){var c=g();try{w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function vo(e,t,r,n,a,o){var u=g();try{return w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function yo(e,t,r,n,a,o,u,s,c,d){var h=g();try{return w(e)(t,r,n,a,o,u,s,c,d)}catch(v){if(m(h),v!==v+0)throw v;y(1,0)}}function mo(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 go(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function wo(e,t,r,n,a,o,u,s,c,d){var h=g();try{w(e)(t,r,n,a,o,u,s,c,d)}catch(v){if(m(h),v!==v+0)throw v;y(1,0)}}function $o(e,t,r,n,a,o,u){var s=g();try{w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function bo(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function Co(e,t,r,n,a,o,u,s,c,d,h,v){var $=g();try{return w(e)(t,r,n,a,o,u,s,c,d,h,v)}catch(b){if(m($),b!==b+0)throw b;y(1,0)}}function To(e,t,r,n,a,o,u){var s=g();try{return Va(e,t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function Po(e,t,r,n,a){var o=g();try{return ka(e,t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function re(){if(K>0){ht=re;return}if(Wr(),K>0){ht=re;return}function e(){var t;l.calledRun=!0,!ye&&(Ur(),C(l),(t=l.onRuntimeInitialized)===null||t===void 0||t.call(l),Vr())}l.setStatus?(l.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>l.setStatus(""),1),e()},1)):e()}function _o(){if(l.preInit)for(typeof l.preInit=="function"&&(l.preInit=[l.preInit]);l.preInit.length>0;)l.preInit.shift()()}return _o(),re(),f=F,f};function Ut(i){return oe(Wt,i)}function gr(){return yr(Wt)}function wr(i){Ut({overrides:i,equalityFn:Object.is,fireImmediately:!1})}async function $r(i,f){return mr(Wt,i,f)}const br="68d20eb8c486afabf49fab6d9fbc5f118df8648ec6200e8039ef8912a169c00c",ie=[["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"]],Cr=[...ie,["unknown"]].map(i=>i[0]),Vt=new Map(ie);function Tr(i){for(const[f,p]of Vt)if(i===p)return f;return"unknown"}function Pr(i){if(se(i))return{width:i.naturalWidth,height:i.naturalHeight};if(ue(i))return{width:i.width.baseVal.value,height:i.height.baseVal.value};if(ce(i))return{width:i.videoWidth,height:i.videoHeight};if(fe(i))return{width:i.width,height:i.height};if(he(i))return{width:i.displayWidth,height:i.displayHeight};if(le(i))return{width:i.width,height:i.height};if(de(i))return{width:i.width,height:i.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 se(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLImageElement)}catch{return!1}}function ue(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.SVGImageElement)}catch{return!1}}function ce(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLVideoElement)}catch{return!1}}function le(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLCanvasElement)}catch{return!1}}function fe(i){try{return i instanceof ImageBitmap||Object.prototype.toString.call(i)==="[object ImageBitmap]"}catch{return!1}}function de(i){try{return i instanceof OffscreenCanvas||Object.prototype.toString.call(i)==="[object OffscreenCanvas]"}catch{return!1}}function he(i){try{return i instanceof VideoFrame||Object.prototype.toString.call(i)==="[object VideoFrame]"}catch{return!1}}function _r(i){try{return i instanceof Blob||Object.prototype.toString.call(i)==="[object Blob]"}catch{return!1}}function Er(i){try{return i instanceof ImageData||Object.prototype.toString.call(i)==="[object ImageData]"}catch{return!1}}function Or(i,f){try{const p=new OffscreenCanvas(i,f);if(p.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return p;throw void 0}catch{const p=document.createElement("canvas");return p.width=i,p.height=f,p}}async function pe(i){if(se(i)&&!await Ir(i))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(ue(i)&&!await xr(i))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(he(i)&&Mr(i))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(ce(i)&&(i.readyState===0||i.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(fe(i)&&jr(i))throw new DOMException("The image source is detached.","InvalidStateError");const{width:f,height:p}=Pr(i);if(f===0||p===0)return null;const C=Or(f,p).getContext("2d");C.drawImage(i,0,0);try{return C.getImageData(0,0,f,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Ar(i){let f;try{f=await createImageBitmap(i)}catch{try{if(globalThis.Image){f=new Image;let C="";try{C=URL.createObjectURL(i),f.src=C,await f.decode()}finally{URL.revokeObjectURL(C)}}else return i}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}}return await pe(f)}function Sr(i){const{width:f,height:p}=i;if(f===0||p===0)return null;const l=i.getContext("2d");try{return l.getImageData(0,0,f,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Dr(i){if(_r(i))return await Ar(i);if(Er(i)){if(Fr(i))throw new DOMException("The image data has been detached.","InvalidStateError");return i}return le(i)||de(i)?Sr(i):await pe(i)}async function Ir(i){try{return await i.decode(),!0}catch{return!1}}async function xr(i){var f;try{return await((f=i.decode)==null?void 0:f.call(i)),!0}catch{return!1}}function Mr(i){return i.format===null}function Fr(i){return i.data.buffer.byteLength===0}function jr(i){return i.width===0&&i.height===0}function ve(i,f){return Rr(i)?new DOMException(`${f}: ${i.message}`,i.name):Lr(i)?new i.constructor(`${f}: ${i.message}`):new Error(`${f}: ${i}`)}function Rr(i){return i instanceof DOMException||Object.prototype.toString.call(i)==="[object DOMException]"}function Lr(i){return i instanceof Error||Object.prototype.toString.call(i)==="[object Error]"}class Br{constructor(f={}){Qe(this,ct);var p;try{const l=(p=f==null?void 0:f.formats)==null?void 0:p.filter(C=>C!=="unknown");if((l==null?void 0:l.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const C of l!=null?l:[])if(!Vt.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.`);Je(this,ct,l!=null?l:[]),Ut({fireImmediately:!0}).catch(()=>{})}catch(l){throw ve(l,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Cr.filter(f=>f!=="unknown")}async detect(f){try{const p=await Dr(f);if(p===null)return[];let l;const C={tryCode39ExtendedMode:!1,textMode:"Plain",formats:Ze(this,ct).map(A=>Vt.get(A))};try{l=await $r(p,C)}catch(A){throw console.error(A),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return l.map(A=>{const{topLeft:{x:F,y:B},topRight:{x:S,y:j},bottomLeft:{x:q,y:Z},bottomRight:{x:Q,y:lt}}=A.position,ft=Math.min(F,S,q,Q),at=Math.min(B,j,Z,lt),bt=Math.max(F,S,q,Q),Y=Math.max(B,j,Z,lt);return{boundingBox:new DOMRectReadOnly(ft,at,bt-ft,Y-at),rawValue:A.text,format:Tr(A.format),cornerPoints:[{x:F,y:B},{x:S,y:j},{x:Q,y:lt},{x:q,y:Z}]}})}catch(p){throw ve(p,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return ct=new WeakMap,_.BarcodeDetector=Br,_.ZXING_CPP_COMMIT=hr,_.ZXING_WASM_SHA256=br,_.ZXING_WASM_VERSION=dr,_.prepareZXingModule=Ut,_.purgeZXingModule=gr,_.setZXingModuleOverrides=wr,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}),_}({});
|
|
1
|
+
var BarcodeDetectionAPI=function(_){"use strict";var qe=_=>{throw TypeError(_)};var Ye=(_,M,R)=>M.has(_)||qe("Cannot "+R);var Ze=(_,M,R)=>(Ye(_,M,"read from private field"),R?R.call(_):M.get(_)),Qe=(_,M,R)=>M.has(_)?qe("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(_):M.set(_,R),Je=(_,M,R,gt)=>(Ye(_,M,"write to private field"),gt?gt.call(_,R):M.set(_,R),R);var ct;const M=[["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"]],R=M.map(([i])=>i),gt=R.filter((i,f)=>M[f][1]==="L"),Ke=R.filter((i,f)=>M[f][1]==="M");function Bt(i){switch(i){case"Linear-Codes":return gt.reduce((f,p)=>f|Bt(p),0);case"Matrix-Codes":return Ke.reduce((f,p)=>f|Bt(p),0);case"Any":return(1<<M.length)-1;case"None":return 0;default:return 1<<R.indexOf(i)}}function tr(i){if(i===0)return"None";const f=31-Math.clz32(i);return R[f]}function er(i){return i.reduce((f,p)=>f|Bt(p),0)}const rr=["LocalAverage","GlobalHistogram","FixedThreshold","BoolCast"];function nr(i){return rr.indexOf(i)}const ne=["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 ar(i){return i==="UnicodeBig"?ne.indexOf("UTF16BE"):ne.indexOf(i)}const or=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function ir(i){return or[i]}const sr=["Ignore","Read","Require"];function ur(i){return sr.indexOf(i)}const cr=["Plain","ECI","HRI","Hex","Escaped"];function lr(i){return cr.indexOf(i)}const wt={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 ae(i){return{...i,formats:er(i.formats),binarizer:nr(i.binarizer),eanAddOnSymbol:ur(i.eanAddOnSymbol),textMode:lr(i.textMode),characterSet:ar(i.characterSet)}}function fr(i){return{...i,format:tr(i.format),contentType:ir(i.contentType),eccLevel:i.ecLevel}}const dr="2.2.2",hr="c0a7c6cd2165457c721c58045edd22ffee9624e9",pr={locateFile:(i,f)=>{const p=i.match(/_(.+?)\.wasm$/);return p?`https://fastly.jsdelivr.net/npm/zxing-wasm@2.2.2/dist/${p[1]}/${i}`:f+i}},$t=new WeakMap;function vr(i,f){return Object.is(i,f)||Object.keys(i).length===Object.keys(f).length&&Object.keys(i).every(p=>Object.hasOwn(f,p)&&i[p]===f[p])}function oe(i,{overrides:f,equalityFn:p=vr,fireImmediately:l=!1}={}){var C;const[A,F]=(C=$t.get(i))!=null?C:[pr],B=f!=null?f:A;let S;if(l){if(F&&(S=p(A,B)))return F;const j=i({...B});return $t.set(i,[B,j]),j}(S!=null?S:p(A,B))||$t.set(i,[B])}function yr(i){$t.delete(i)}async function mr(i,f,p=wt){const l={...wt,...p},C=await oe(i,{fireImmediately:!0});let A,F;if("width"in f&&"height"in f&&"data"in f){const{data:S,data:{byteLength:j},width:q,height:Z}=f;F=C._malloc(j),C.HEAPU8.set(S,F),A=C.readBarcodesFromPixmap(F,q,Z,ae(l))}else{let S,j;if("buffer"in f)[S,j]=[f.byteLength,f];else if("byteLength"in f)[S,j]=[f.byteLength,new Uint8Array(f)];else if("size"in f)[S,j]=[f.size,new Uint8Array(await f.arrayBuffer())];else throw new TypeError("Invalid input type");F=C._malloc(S),C.HEAPU8.set(j,F),A=C.readBarcodesFromImage(F,S,ae(l))}C._free(F);const B=[];for(let S=0;S<A.size();++S)B.push(fr(A.get(S)));return B}({...wt,formats:[...wt.formats]});var Wt=async function(i={}){var f,p,l=i,C,A,F=new Promise((e,t)=>{C=e,A=t}),B=typeof window=="object",S=typeof Bun<"u",j=typeof WorkerGlobalScope<"u";typeof process=="object"&&!((p=process.versions)===null||p===void 0)&&p.node&&process.type!="renderer";var q="./this.program",Z,Q="";function lt(e){return l.locateFile?l.locateFile(e,Q):Q+e}var ft,at;if(B||j||S){try{Q=new URL(".",Z).href}catch{}j&&(at=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),ft=async e=>{var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw new Error(t.status+" : "+t.url)}}var bt=console.log.bind(console),Y=console.error.bind(console),dt,Ct,ye=!1,J,V,Tt,ot,it,P,me,ge;function we(){var e=Ct.buffer;J=new Int8Array(e),Tt=new Int16Array(e),l.HEAPU8=V=new Uint8Array(e),ot=new Uint16Array(e),it=new Int32Array(e),P=new Uint32Array(e),me=new Float32Array(e),ge=new Float64Array(e)}function Wr(){if(l.preRun)for(typeof l.preRun=="function"&&(l.preRun=[l.preRun]);l.preRun.length;)Jr(l.preRun.shift());$e(Ce)}function Ur(){E.ya()}function Vr(){if(l.postRun)for(typeof l.postRun=="function"&&(l.postRun=[l.postRun]);l.postRun.length;)Qr(l.postRun.shift());$e(be)}var K=0,ht=null;function kr(e){var t;K++,(t=l.monitorRunDependencies)===null||t===void 0||t.call(l,K)}function Hr(e){var t;if(K--,(t=l.monitorRunDependencies)===null||t===void 0||t.call(l,K),K==0&&ht){var r=ht;ht=null,r()}}function kt(e){var t;(t=l.onAbort)===null||t===void 0||t.call(l,e),e="Aborted("+e+")",Y(e),ye=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw A(r),r}var Pt;function Nr(){return lt("zxing_reader.wasm")}function zr(e){if(e==Pt&&dt)return new Uint8Array(dt);if(at)return at(e);throw"both async and sync fetching of the wasm failed"}async function Gr(e){if(!dt)try{var t=await ft(e);return new Uint8Array(t)}catch{}return zr(e)}async function Xr(e,t){try{var r=await Gr(e),n=await WebAssembly.instantiate(r,t);return n}catch(a){Y(`failed to asynchronously prepare wasm: ${a}`),kt(a)}}async function qr(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(o){Y(`wasm streaming compile failed: ${o}`),Y("falling back to ArrayBuffer instantiation")}return Xr(t,r)}function Yr(){return{a:xa}}async function Zr(){function e(o,u){return E=o.exports,Ct=E.xa,we(),xe=E.Ba,Hr(),E}kr();function t(o){return e(o.instance)}var r=Yr();if(l.instantiateWasm)return new Promise((o,u)=>{l.instantiateWasm(r,(s,c)=>{o(e(s))})});Pt!=null||(Pt=Nr());try{var n=await qr(dt,Pt,r),a=t(n);return a}catch(o){return A(o),Promise.reject(o)}}var $e=e=>{for(;e.length>0;)e.shift()(l)},be=[],Qr=e=>be.push(e),Ce=[],Jr=e=>Ce.push(e),m=e=>Ra(e),g=()=>La(),_t=[],Et=0,Kr=e=>{var t=new Ht(e);return t.get_caught()||(t.set_caught(!0),Et--),t.set_rethrown(!1),_t.push(t),Wa(e),Fa(e)},N=0,tn=()=>{y(0,0);var e=_t.pop();Ba(e.excPtr),N=0};class Ht{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,J[this.ptr+12]=t}get_caught(){return J[this.ptr+12]!=0}set_rethrown(t){t=t?1:0,J[this.ptr+13]=t}get_rethrown(){return J[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 Ot=e=>ja(e),Nt=e=>{var t=N;if(!t)return Ot(0),0;var r=new Ht(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return Ot(0),t;for(var a of e){if(a===0||a===n)break;var o=r.ptr+16;if(Ua(a,n,o))return Ot(a),t}return Ot(n),t},en=()=>Nt([]),rn=e=>Nt([e]),nn=(e,t)=>Nt([e,t]),an=()=>{var e=_t.pop();e||kt("no exception to throw");var t=e.excPtr;throw e.get_rethrown()||(_t.push(e),e.set_rethrown(!0),e.set_caught(!1),Et++),N=t,N},on=(e,t,r)=>{var n=new Ht(e);throw n.init(t,r),N=e,Et++,N},sn=()=>Et,un=e=>{throw N||(N=e),N},cn=()=>kt(""),At={},zt=e=>{for(;e.length;){var t=e.pop(),r=e.pop();r(t)}};function pt(e){return this.fromWireType(P[e>>2])}var st={},tt={},St={},ln=class extends Error{constructor(e){super(e),this.name="InternalError"}},Dt=e=>{throw new ln(e)},et=(e,t,r)=>{e.forEach(s=>St[s]=t);function n(s){var c=r(s);c.length!==e.length&&Dt("Mismatched type converter count");for(var d=0;d<e.length;++d)H(e[d],c[d])}var a=new Array(t.length),o=[],u=0;t.forEach((s,c)=>{tt.hasOwnProperty(s)?a[c]=tt[s]:(o.push(s),st.hasOwnProperty(s)||(st[s]=[]),st[s].push(()=>{a[c]=tt[s],++u,u===o.length&&n(a)}))}),o.length===0&&n(a)},fn=e=>{var t=At[e];delete At[e];var r=t.rawConstructor,n=t.rawDestructor,a=t.fields,o=a.map(u=>u.getterReturnType).concat(a.map(u=>u.setterArgumentType));et([e],o,u=>{var s={};return a.forEach((c,d)=>{var h=c.fieldName,v=u[d],$=u[d].optional,b=c.getter,O=c.getterContext,I=u[d+a.length],D=c.setter,x=c.setterContext;s[h]={read:X=>v.fromWireType(b(O,X)),write:(X,W)=>{var U=[];D(x,X,I.toWireType(U,W)),zt(U)},optional:$}}),[{name:t.name,fromWireType:c=>{var d={};for(var h in s)d[h]=s[h].read(c);return n(c),d},toWireType:(c,d)=>{for(var h in s)if(!(h in d)&&!s[h].optional)throw new TypeError(`Missing field: "${h}"`);var v=r();for(h in s)s[h].write(v,d[h]);return c!==null&&c.push(n,v),v},argPackAdvance:z,readValueFromPointer:pt,destructorFunction:n}]})},dn=(e,t,r,n,a)=>{},hn=()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);Te=e},Te,L=e=>{for(var t="",r=e;V[r];)t+=Te[V[r++]];return t},vt=class extends Error{constructor(e){super(e),this.name="BindingError"}},T=e=>{throw new vt(e)};function pn(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`),tt.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;T(`Cannot register type '${n}' twice`)}if(tt[e]=t,delete St[e],st.hasOwnProperty(e)){var a=st[e];delete st[e],a.forEach(o=>o())}}function H(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return pn(e,t,r)}var z=8,vn=(e,t,r,n)=>{t=L(t),H(e,{name:t,fromWireType:function(a){return!!a},toWireType:function(a,o){return o?r:n},argPackAdvance:z,readValueFromPointer:function(a){return this.fromWireType(V[a])},destructorFunction:null})},yn=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Gt=e=>{function t(r){return r.$$.ptrType.registeredClass.name}T(t(e)+" instance already deleted")},Xt=!1,Pe=e=>{},mn=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},_e=e=>{e.count.value-=1;var t=e.count.value===0;t&&mn(e)},yt=e=>typeof FinalizationRegistry>"u"?(yt=t=>t,e):(Xt=new FinalizationRegistry(t=>{_e(t.$$)}),yt=t=>{var r=t.$$,n=!!r.smartPtr;if(n){var a={$$:r};Xt.register(t,a,t)}return t},Pe=t=>Xt.unregister(t),yt(e)),gn=()=>{let e=It.prototype;Object.assign(e,{isAliasOf(r){if(!(this instanceof It)||!(r instanceof It))return!1;var n=this.$$.ptrType.registeredClass,a=this.$$.ptr;r.$$=r.$$;for(var o=r.$$.ptrType.registeredClass,u=r.$$.ptr;n.baseClass;)a=n.upcast(a),n=n.baseClass;for(;o.baseClass;)u=o.upcast(u),o=o.baseClass;return n===o&&a===u},clone(){if(this.$$.ptr||Gt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var r=yt(Object.create(Object.getPrototypeOf(this),{$$:{value:yn(this.$$)}}));return r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},delete(){this.$$.ptr||Gt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&T("Object already scheduled for deletion"),Pe(this),_e(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Gt(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 It(){}var qt=(e,t)=>Object.defineProperty(t,"name",{value:e}),Ee={},Oe=(e,t,r)=>{if(e[t].overloadTable===void 0){var n=e[t];e[t]=function(){for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return e[t].overloadTable.hasOwnProperty(o.length)||T(`Function '${r}' called with an invalid number of arguments (${o.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[o.length].apply(this,o)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},Ae=(e,t,r)=>{l.hasOwnProperty(e)?((r===void 0||l[e].overloadTable!==void 0&&l[e].overloadTable[r]!==void 0)&&T(`Cannot register public name '${e}' twice`),Oe(l,e,e),l[e].overloadTable.hasOwnProperty(r)&&T(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),l[e].overloadTable[r]=t):(l[e]=t,l[e].argCount=r)},wn=48,$n=57,bn=e=>{e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return t>=wn&&t<=$n?`_${e}`:e};function Cn(e,t,r,n,a,o,u,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=u,this.downcast=s,this.pureVirtualFunctions=[]}var Yt=(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},Zt=e=>{if(e===null)return"null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e};function Tn(e,t){if(t===null)return this.isReference&&T(`null is not a valid ${this.name}`),0;t.$$||T(`Cannot pass "${Zt(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=Yt(t.$$.ptr,r,this.registeredClass);return n}function Pn(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 "${Zt(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=Yt(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,G.toHandle(()=>a.delete())),e!==null&&e.push(this.rawDestructor,r)}break;default:T("Unsupporting sharing policy")}return r}function _n(e,t){if(t===null)return this.isReference&&T(`null is not a valid ${this.name}`),0;t.$$||T(`Cannot pass "${Zt(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=Yt(t.$$.ptr,r,this.registeredClass);return n}var Se=(e,t,r)=>{if(t===r)return e;if(r.baseClass===void 0)return null;var n=Se(e,t,r.baseClass);return n===null?null:r.downcast(n)},En={},On=(e,t)=>{for(t===void 0&&T("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t},An=(e,t)=>(t=On(e,t),En[t]),xt=(e,t)=>{(!t.ptrType||!t.ptr)&&Dt("makeClassHandle requires ptr and ptrType");var r=!!t.smartPtrType,n=!!t.smartPtr;return r!==n&&Dt("Both smartPtrType and smartPtr must be specified"),t.count={value:1},yt(Object.create(e,{$$:{value:t,writable:!0}}))};function Sn(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=An(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?xt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):xt(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var o=this.registeredClass.getActualType(t),u=Ee[o];if(!u)return a.call(this);var s;this.isConst?s=u.constPointerType:s=u.pointerType;var c=Se(t,this.registeredClass,s.registeredClass);return c===null?a.call(this):this.isSmartPointer?xt(s.registeredClass.instancePrototype,{ptrType:s,ptr:c,smartPtrType:this,smartPtr:e}):xt(s.registeredClass.instancePrototype,{ptrType:s,ptr:c})}var Dn=()=>{Object.assign(Mt.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:z,readValueFromPointer:pt,fromWireType:Sn})};function Mt(e,t,r,n,a,o,u,s,c,d,h){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=u,this.rawGetPointee=s,this.rawConstructor=c,this.rawShare=d,this.rawDestructor=h,!a&&t.baseClass===void 0?n?(this.toWireType=Tn,this.destructorFunction=null):(this.toWireType=_n,this.destructorFunction=null):this.toWireType=Pn}var De=(e,t,r)=>{l.hasOwnProperty(e)||Dt("Replacing nonexistent public symbol"),l[e].overloadTable!==void 0&&r!==void 0?l[e].overloadTable[r]=t:(l[e]=t,l[e].argCount=r)},Ie=[],xe,w=e=>{var t=Ie[e];return t||(Ie[e]=t=xe.get(e)),t},In=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},xn=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),o=0;o<n;o++)a[o]=arguments[o];return In(e,t,a,r)}},k=function(e,t){e=L(e);function r(){if(e.includes("j"))return xn(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 Mn extends Error{}var Me=e=>{var t=Ma(e),r=L(t);return nt(t),r},Ft=(e,t)=>{var r=[],n={};function a(o){if(!n[o]&&!tt[o]){if(St[o]){St[o].forEach(a);return}r.push(o),n[o]=!0}}throw t.forEach(a),new Mn(`${e}: `+r.map(Me).join([", "]))},Fn=(e,t,r,n,a,o,u,s,c,d,h,v,$)=>{h=L(h),o=k(a,o),s&&(s=k(u,s)),d&&(d=k(c,d)),$=k(v,$);var b=bn(h);Ae(b,function(){Ft(`Cannot construct ${h} due to unbound types`,[n])}),et([e,t,r],n?[n]:[],O=>{O=O[0];var I,D;n?(I=O.registeredClass,D=I.instancePrototype):D=It.prototype;var x=qt(h,function(){if(Object.getPrototypeOf(this)!==X)throw new vt(`Use 'new' to construct ${h}`);if(W.constructor_body===void 0)throw new vt(`${h} has no accessible constructor`);for(var Ge=arguments.length,Rt=new Array(Ge),Lt=0;Lt<Ge;Lt++)Rt[Lt]=arguments[Lt];var Xe=W.constructor_body[Rt.length];if(Xe===void 0)throw new vt(`Tried to invoke ctor of ${h} with invalid number of parameters (${Rt.length}) - expected (${Object.keys(W.constructor_body).toString()}) parameters instead!`);return Xe.apply(this,Rt)}),X=Object.create(D,{constructor:{value:x}});x.prototype=X;var W=new Cn(h,x,X,$,I,o,s,d);if(W.baseClass){var U,jt;(jt=(U=W.baseClass).__derivedClasses)!==null&&jt!==void 0||(U.__derivedClasses=[]),W.baseClass.__derivedClasses.push(W)}var Eo=new Mt(h,W,!0,!1,!1),Ne=new Mt(h+"*",W,!1,!1,!1),ze=new Mt(h+" const*",W,!1,!0,!1);return Ee[e]={pointerType:Ne,constPointerType:ze},De(b,x),[Eo,Ne,ze]})},Qt=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(P[t+n*4>>2]);return r};function jn(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].destructorFunction===void 0)return!0;return!1}function Jt(e,t,r,n,a,o){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=jn(t),d=t[0].name!=="void",h=u-2,v=new Array(h),$=[],b=[],O=function(){b.length=0;var I;$.length=s?2:1,$[0]=a,s&&(I=t[1].toWireType(b,this),$[1]=I);for(var D=0;D<h;++D)v[D]=t[D+2].toWireType(b,D<0||arguments.length<=D?void 0:arguments[D]),$.push(v[D]);var x=n(...$);function X(W){if(c)zt(b);else for(var U=s?1:2;U<t.length;U++){var jt=U===1?I:v[U-2];t[U].destructorFunction!==null&&t[U].destructorFunction(jt)}if(d)return t[0].fromWireType(W)}return X(x)};return qt(e,O)}var Rn=(e,t,r,n,a,o)=>{var u=Qt(t,r);a=k(n,a),et([],[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 vt(`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]=()=>{Ft(`Cannot construct ${s.name} due to unbound types`,u)},et([],u,d=>(d.splice(1,0,null),s.registeredClass.constructor_body[t-1]=Jt(c,d,null,a,o),[])),[]})},Fe=e=>{e=e.trim();const t=e.indexOf("(");return t===-1?e:e.slice(0,t)},Ln=(e,t,r,n,a,o,u,s,c,d)=>{var h=Qt(r,n);t=L(t),t=Fe(t),o=k(a,o),et([],[e],v=>{v=v[0];var $=`${v.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&v.registeredClass.pureVirtualFunctions.push(t);function b(){Ft(`Cannot call ${$} due to unbound types`,h)}var O=v.registeredClass.instancePrototype,I=O[t];return I===void 0||I.overloadTable===void 0&&I.className!==v.name&&I.argCount===r-2?(b.argCount=r-2,b.className=v.name,O[t]=b):(Oe(O,t,$),O[t].overloadTable[r-2]=b),et([],h,D=>{var x=Jt($,D,v,o,u);return O[t].overloadTable===void 0?(x.argCount=r-2,O[t]=x):O[t].overloadTable[r-2]=x,[]}),[]})},je=[],rt=[0,1,,1,null,1,!0,1,!1,1],Kt=e=>{e>9&&--rt[e+1]===0&&(rt[e]=void 0,je.push(e))},G={toValue:e=>(e||T(`Cannot use deleted val. handle = ${e}`),rt[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=je.pop()||rt.length;return rt[t]=e,rt[t+1]=1,t}}}},Re={name:"emscripten::val",fromWireType:e=>{var t=G.toValue(e);return Kt(e),t},toWireType:(e,t)=>G.toHandle(t),argPackAdvance:z,readValueFromPointer:pt,destructorFunction:null},Bn=e=>H(e,Re),Wn=(e,t)=>{switch(t){case 4:return function(r){return this.fromWireType(me[r>>2])};case 8:return function(r){return this.fromWireType(ge[r>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},Un=(e,t,r)=>{t=L(t),H(e,{name:t,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:z,readValueFromPointer:Wn(t,r),destructorFunction:null})},Vn=(e,t,r,n,a,o,u,s)=>{var c=Qt(t,r);e=L(e),e=Fe(e),a=k(n,a),Ae(e,function(){Ft(`Cannot call ${e} due to unbound types`,c)},t-1),et([],c,d=>{var h=[d[0],null].concat(d.slice(1));return De(e,Jt(e,h,null,a,o),t-1),[]})},kn=(e,t,r)=>{switch(t){case 1:return r?n=>J[n]:n=>V[n];case 2:return r?n=>Tt[n>>1]:n=>ot[n>>1];case 4:return r?n=>it[n>>2]:n=>P[n>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Hn=(e,t,r,n,a)=>{t=L(t);const o=n===0;let u=c=>c;if(o){var s=32-8*r;u=c=>c<<s>>>s,a=u(a)}H(e,{name:t,fromWireType:u,toWireType:(c,d)=>d,argPackAdvance:z,readValueFromPointer:kn(t,r,n!==0),destructorFunction:null})},Nn=(e,t,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[t];function o(u){var s=P[u>>2],c=P[u+4>>2];return new a(J.buffer,c,s)}r=L(r),H(e,{name:r,fromWireType:o,argPackAdvance:z,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},zn=Object.assign({optional:!0},Re),Gn=(e,t)=>{H(e,zn)},Xn=(e,t,r,n)=>{if(!(n>0))return 0;for(var a=r,o=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>=o)break;t[r++]=s}else if(s<=2047){if(r+1>=o)break;t[r++]=192|s>>6,t[r++]=128|s&63}else if(s<=65535){if(r+2>=o)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|s&63}else{if(r+3>=o)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},ut=(e,t,r)=>Xn(e,V,t,r),Le=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},Be=typeof TextDecoder<"u"?new TextDecoder:void 0,We=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&&Be)return Be.decode(e.subarray(t,a));for(var o="";t<a;){var u=e[t++];if(!(u&128)){o+=String.fromCharCode(u);continue}var s=e[t++]&63;if((u&224)==192){o+=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)o+=String.fromCharCode(u);else{var d=u-65536;o+=String.fromCharCode(55296|d>>10,56320|d&1023)}}return o},qn=(e,t)=>e?We(V,e,t):"",Yn=(e,t)=>{t=L(t),H(e,{name:t,fromWireType(r){for(var n=P[r>>2],a=r+4,o,s,u=a,s=0;s<=n;++s){var c=a+s;if(s==n||V[c]==0){var d=c-u,h=qn(u,d);o===void 0?o=h:(o+="\0",o+=h),u=c+1}}return nt(r),o},toWireType(r,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var a,o=typeof n=="string";o||ArrayBuffer.isView(n)&&n.BYTES_PER_ELEMENT==1||T("Cannot pass non-string to std::string"),o?a=Le(n):a=n.length;var u=He(4+a+1),s=u+4;return P[u>>2]=a,o?ut(n,s,a+1):V.set(n,s),r!==null&&r.push(nt,u),u},argPackAdvance:z,readValueFromPointer:pt,destructorFunction(r){nt(r)}})},Ue=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Zn=(e,t)=>{for(var r=e>>1,n=r+t/2,a=r;!(a>=n)&&ot[a];)++a;if(a-r>16&&Ue)return Ue.decode(ot.subarray(r,a));for(var o="",u=r;!(u>=n);++u){var s=ot[u];if(s==0)break;o+=String.fromCharCode(s)}return o},Qn=(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,o=0;o<a;++o){var u=e.charCodeAt(o);Tt[t>>1]=u,t+=2}return Tt[t>>1]=0,t-n},Jn=e=>e.length*2,Kn=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var a=it[e+r*4>>2];if(a==0)break;if(++r,a>=65536){var o=a-65536;n+=String.fromCharCode(55296|o>>10,56320|o&1023)}else n+=String.fromCharCode(a)}return n},ta=(e,t,r)=>{if(r!=null||(r=2147483647),r<4)return 0;for(var n=t,a=n+r-4,o=0;o<e.length;++o){var u=e.charCodeAt(o);if(u>=55296&&u<=57343){var s=e.charCodeAt(++o);u=65536+((u&1023)<<10)|s&1023}if(it[t>>2]=u,t+=4,t+4>a)break}return it[t>>2]=0,t-n},ea=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},ra=(e,t,r)=>{r=L(r);var n,a,o,u;t===2?(n=Zn,a=Qn,u=Jn,o=s=>ot[s>>1]):t===4&&(n=Kn,a=ta,u=ea,o=s=>P[s>>2]),H(e,{name:r,fromWireType:s=>{for(var c=P[s>>2],d,h=s+4,v=0;v<=c;++v){var $=s+4+v*t;if(v==c||o($)==0){var b=$-h,O=n(h,b);d===void 0?d=O:(d+="\0",d+=O),h=$+t}}return nt(s),d},toWireType:(s,c)=>{typeof c!="string"&&T(`Cannot pass non-string to C++ string type ${r}`);var d=u(c),h=He(4+d+t);return P[h>>2]=d/t,a(c,h+4,d+t),s!==null&&s.push(nt,h),h},argPackAdvance:z,readValueFromPointer:pt,destructorFunction(s){nt(s)}})},na=(e,t,r,n,a,o)=>{At[e]={name:L(t),rawConstructor:k(r,n),rawDestructor:k(a,o),fields:[]}},aa=(e,t,r,n,a,o,u,s,c,d)=>{At[e].fields.push({fieldName:L(t),getterReturnType:r,getter:k(n,a),getterContext:o,setterArgumentType:u,setter:k(s,c),setterContext:d})},oa=(e,t)=>{t=L(t),H(e,{isVoid:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})},te=[],ia=(e,t,r,n)=>(e=te[e],t=G.toValue(t),e(null,t,r,n)),sa={},ua=e=>{var t=sa[e];return t===void 0?L(e):t},Ve=()=>{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.")},ca=e=>e===0?G.toHandle(Ve()):(e=ua(e),G.toHandle(Ve()[e])),la=e=>{var t=te.length;return te.push(e),t},ke=(e,t)=>{var r=tt[e];return r===void 0&&T(`${t} has unknown type ${Me(e)}`),r},fa=(e,t)=>{for(var r=new Array(e),n=0;n<e;++n)r[n]=ke(P[t+n*4>>2],`parameter ${n}`);return r},da=(e,t,r)=>{var n=[],a=e.toWireType(n,r);return n.length&&(P[t>>2]=G.toHandle(n)),a},ha=Reflect.construct,pa=(e,t,r)=>{var n=fa(e,t),a=n.shift();e--;var o=new Array(e),u=(c,d,h,v)=>{for(var $=0,b=0;b<e;++b)o[b]=n[b].readValueFromPointer(v+$),$+=n[b].argPackAdvance;var O=r===1?ha(d,o):d.apply(c,o);return da(a,h,O)},s=`methodCaller<(${n.map(c=>c.name).join(", ")}) => ${a.name}>`;return la(qt(s,u))},va=e=>{e>9&&(rt[e+1]+=1)},ya=e=>{var t=G.toValue(e);zt(t),Kt(e)},ma=(e,t)=>{e=ke(e,"_emval_take_value");var r=e.readValueFromPointer(t);return G.toHandle(r)},ga=(e,t,r,n)=>{var a=new Date().getFullYear(),o=new Date(a,0,1),u=new Date(a,6,1),s=o.getTimezoneOffset(),c=u.getTimezoneOffset(),d=Math.max(s,c);P[e>>2]=d*60,it[t>>2]=+(s!=c);var h=b=>{var O=b>=0?"-":"+",I=Math.abs(b),D=String(Math.floor(I/60)).padStart(2,"0"),x=String(I%60).padStart(2,"0");return`UTC${O}${D}${x}`},v=h(s),$=h(c);c<s?(ut(v,r,17),ut($,n,17)):(ut(v,n,17),ut($,r,17))},wa=()=>2147483648,$a=(e,t)=>Math.ceil(e/t)*t,ba=e=>{var t=Ct.buffer,r=(e-t.byteLength+65535)/65536|0;try{return Ct.grow(r),we(),1}catch{}},Ca=e=>{var t=V.length;e>>>=0;var r=wa();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 o=Math.min(r,$a(Math.max(e,a),65536)),u=ba(o);if(u)return!0}return!1},ee={},Ta=()=>q||"./this.program",mt=()=>{if(!mt.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,_:Ta()};for(var r in ee)ee[r]===void 0?delete t[r]:t[r]=ee[r];var n=[];for(var r in t)n.push(`${r}=${t[r]}`);mt.strings=n}return mt.strings},Pa=(e,t)=>{var r=0,n=0;for(var a of mt()){var o=t+r;P[e+n>>2]=o,r+=ut(a,o,1/0)+1,n+=4}return 0},_a=(e,t)=>{var r=mt();P[e>>2]=r.length;var n=0;for(var a of r)n+=Le(a)+1;return P[t>>2]=n,0},Ea=e=>52;function Oa(e,t,r,n,a){return 70}var Aa=[null,[],[]],Sa=(e,t)=>{var r=Aa[e];t===0||t===10?((e===1?bt:Y)(We(r)),r.length=0):r.push(t)},Da=(e,t,r,n)=>{for(var a=0,o=0;o<r;o++){var u=P[t>>2],s=P[t+4>>2];t+=8;for(var c=0;c<s;c++)Sa(e,V[u+c]);a+=s}return P[n>>2]=a,0},Ia=e=>e;hn(),gn(),Dn(),l.noExitRuntime&&l.noExitRuntime,l.print&&(bt=l.print),l.printErr&&(Y=l.printErr),l.wasmBinary&&(dt=l.wasmBinary),l.arguments&&l.arguments,l.thisProgram&&(q=l.thisProgram);var xa={s:Kr,w:tn,a:en,j:rn,m:nn,P:an,p:on,ga:sn,d:un,ba:cn,ua:fn,aa:dn,pa:vn,sa:Fn,ra:Rn,H:Ln,na:Bn,V:Un,W:Vn,x:Hn,t:Nn,ta:Gn,oa:Yn,Q:ra,I:na,va:aa,qa:oa,da:ia,wa:Kt,D:ca,ma:pa,X:va,Y:ya,U:ma,ca:ga,ha:Ca,ea:Pa,fa:_a,ia:Ea,_:Oa,S:Da,K:ho,C:vo,M:za,R:bo,q:uo,b:qa,E:fo,ka:mo,c:Ya,ja:go,h:Na,i:Ka,r:no,O:lo,v:oo,F:so,L:co,z:yo,J:Co,$:To,Z:Po,k:Za,f:Ha,e:Xa,g:Ga,N:$o,l:Ja,la:po,o:ao,B:to,u:io,T:ro,A:wo,n:Qa,G:eo,y:Ia},E=await Zr();E.ya;var Ma=E.za,nt=l._free=E.Aa,He=l._malloc=E.Ca,Fa=E.Da,y=E.Ea,ja=E.Fa,Ra=E.Ga,La=E.Ha,Ba=E.Ia,Wa=E.Ja,Ua=E.Ka;l.dynCall_viijii=E.La;var Va=l.dynCall_iiijj=E.Ma;l.dynCall_jiji=E.Na;var ka=l.dynCall_jiiii=E.Oa;l.dynCall_iiiiij=E.Pa,l.dynCall_iiiiijj=E.Qa,l.dynCall_iiiiiijj=E.Ra;function Ha(e,t){var r=g();try{w(e)(t)}catch(n){if(m(r),n!==n+0)throw n;y(1,0)}}function Na(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function za(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function Ga(e,t,r,n){var a=g();try{w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function Xa(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 qa(e,t){var r=g();try{return w(e)(t)}catch(n){if(m(r),n!==n+0)throw n;y(1,0)}}function Ya(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 Za(e){var t=g();try{w(e)()}catch(r){if(m(t),r!==r+0)throw r;y(1,0)}}function Qa(e,t,r,n,a,o,u,s,c,d,h){var v=g();try{w(e)(t,r,n,a,o,u,s,c,d,h)}catch($){if(m(v),$!==$+0)throw $;y(1,0)}}function Ja(e,t,r,n,a){var o=g();try{w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function Ka(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function to(e,t,r,n,a,o,u){var s=g();try{w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function eo(e,t,r,n,a,o,u,s,c,d,h,v,$,b,O,I){var D=g();try{w(e)(t,r,n,a,o,u,s,c,d,h,v,$,b,O,I)}catch(x){if(m(D),x!==x+0)throw x;y(1,0)}}function ro(e,t,r,n,a,o,u,s,c){var d=g();try{w(e)(t,r,n,a,o,u,s,c)}catch(h){if(m(d),h!==h+0)throw h;y(1,0)}}function no(e,t,r,n,a,o){var u=g();try{return w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function ao(e,t,r,n,a,o){var u=g();try{w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function oo(e,t,r,n,a,o,u){var s=g();try{return w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function io(e,t,r,n,a,o,u,s){var c=g();try{w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function so(e,t,r,n,a,o,u,s){var c=g();try{return w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function uo(e){var t=g();try{return w(e)()}catch(r){if(m(t),r!==r+0)throw r;y(1,0)}}function co(e,t,r,n,a,o,u,s,c){var d=g();try{return w(e)(t,r,n,a,o,u,s,c)}catch(h){if(m(d),h!==h+0)throw h;y(1,0)}}function lo(e,t,r,n,a,o,u){var s=g();try{return w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function fo(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function ho(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function po(e,t,r,n,a,o,u,s){var c=g();try{w(e)(t,r,n,a,o,u,s)}catch(d){if(m(c),d!==d+0)throw d;y(1,0)}}function vo(e,t,r,n,a,o){var u=g();try{return w(e)(t,r,n,a,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}function yo(e,t,r,n,a,o,u,s,c,d){var h=g();try{return w(e)(t,r,n,a,o,u,s,c,d)}catch(v){if(m(h),v!==v+0)throw v;y(1,0)}}function mo(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 go(e,t,r,n,a){var o=g();try{return w(e)(t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function wo(e,t,r,n,a,o,u,s,c,d){var h=g();try{w(e)(t,r,n,a,o,u,s,c,d)}catch(v){if(m(h),v!==v+0)throw v;y(1,0)}}function $o(e,t,r,n,a,o,u){var s=g();try{w(e)(t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function bo(e,t,r,n){var a=g();try{return w(e)(t,r,n)}catch(o){if(m(a),o!==o+0)throw o;y(1,0)}}function Co(e,t,r,n,a,o,u,s,c,d,h,v){var $=g();try{return w(e)(t,r,n,a,o,u,s,c,d,h,v)}catch(b){if(m($),b!==b+0)throw b;y(1,0)}}function To(e,t,r,n,a,o,u){var s=g();try{return Va(e,t,r,n,a,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}function Po(e,t,r,n,a){var o=g();try{return ka(e,t,r,n,a)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}function re(){if(K>0){ht=re;return}if(Wr(),K>0){ht=re;return}function e(){var t;l.calledRun=!0,!ye&&(Ur(),C(l),(t=l.onRuntimeInitialized)===null||t===void 0||t.call(l),Vr())}l.setStatus?(l.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>l.setStatus(""),1),e()},1)):e()}function _o(){if(l.preInit)for(typeof l.preInit=="function"&&(l.preInit=[l.preInit]);l.preInit.length>0;)l.preInit.shift()()}return _o(),re(),f=F,f};function Ut(i){return oe(Wt,i)}function gr(){return yr(Wt)}function wr(i){Ut({overrides:i,equalityFn:Object.is,fireImmediately:!1})}async function $r(i,f){return mr(Wt,i,f)}const br="1c961d9d9a1f0001f5d00486bcf8e1b1a91fcf9fe17ebcbd6e2b6efe21e23038",ie=[["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"]],Cr=[...ie,["unknown"]].map(i=>i[0]),Vt=new Map(ie);function Tr(i){for(const[f,p]of Vt)if(i===p)return f;return"unknown"}function Pr(i){if(se(i))return{width:i.naturalWidth,height:i.naturalHeight};if(ue(i))return{width:i.width.baseVal.value,height:i.height.baseVal.value};if(ce(i))return{width:i.videoWidth,height:i.videoHeight};if(fe(i))return{width:i.width,height:i.height};if(he(i))return{width:i.displayWidth,height:i.displayHeight};if(le(i))return{width:i.width,height:i.height};if(de(i))return{width:i.width,height:i.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 se(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLImageElement)}catch{return!1}}function ue(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.SVGImageElement)}catch{return!1}}function ce(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLVideoElement)}catch{return!1}}function le(i){var f,p;try{return i instanceof((p=(f=i==null?void 0:i.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLCanvasElement)}catch{return!1}}function fe(i){try{return i instanceof ImageBitmap||Object.prototype.toString.call(i)==="[object ImageBitmap]"}catch{return!1}}function de(i){try{return i instanceof OffscreenCanvas||Object.prototype.toString.call(i)==="[object OffscreenCanvas]"}catch{return!1}}function he(i){try{return i instanceof VideoFrame||Object.prototype.toString.call(i)==="[object VideoFrame]"}catch{return!1}}function _r(i){try{return i instanceof Blob||Object.prototype.toString.call(i)==="[object Blob]"}catch{return!1}}function Er(i){try{return i instanceof ImageData||Object.prototype.toString.call(i)==="[object ImageData]"}catch{return!1}}function Or(i,f){try{const p=new OffscreenCanvas(i,f);if(p.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return p;throw void 0}catch{const p=document.createElement("canvas");return p.width=i,p.height=f,p}}async function pe(i){if(se(i)&&!await Ir(i))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(ue(i)&&!await xr(i))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(he(i)&&Mr(i))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(ce(i)&&(i.readyState===0||i.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(fe(i)&&jr(i))throw new DOMException("The image source is detached.","InvalidStateError");const{width:f,height:p}=Pr(i);if(f===0||p===0)return null;const C=Or(f,p).getContext("2d");C.drawImage(i,0,0);try{return C.getImageData(0,0,f,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Ar(i){let f;try{f=await createImageBitmap(i)}catch{try{if(globalThis.Image){f=new Image;let C="";try{C=URL.createObjectURL(i),f.src=C,await f.decode()}finally{URL.revokeObjectURL(C)}}else return i}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}}return await pe(f)}function Sr(i){const{width:f,height:p}=i;if(f===0||p===0)return null;const l=i.getContext("2d");try{return l.getImageData(0,0,f,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Dr(i){if(_r(i))return await Ar(i);if(Er(i)){if(Fr(i))throw new DOMException("The image data has been detached.","InvalidStateError");return i}return le(i)||de(i)?Sr(i):await pe(i)}async function Ir(i){try{return await i.decode(),!0}catch{return!1}}async function xr(i){var f;try{return await((f=i.decode)==null?void 0:f.call(i)),!0}catch{return!1}}function Mr(i){return i.format===null}function Fr(i){return i.data.buffer.byteLength===0}function jr(i){return i.width===0&&i.height===0}function ve(i,f){return Rr(i)?new DOMException(`${f}: ${i.message}`,i.name):Lr(i)?new i.constructor(`${f}: ${i.message}`):new Error(`${f}: ${i}`)}function Rr(i){return i instanceof DOMException||Object.prototype.toString.call(i)==="[object DOMException]"}function Lr(i){return i instanceof Error||Object.prototype.toString.call(i)==="[object Error]"}class Br{constructor(f={}){Qe(this,ct);var p;try{const l=(p=f==null?void 0:f.formats)==null?void 0:p.filter(C=>C!=="unknown");if((l==null?void 0:l.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const C of l!=null?l:[])if(!Vt.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.`);Je(this,ct,l!=null?l:[]),Ut({fireImmediately:!0}).catch(()=>{})}catch(l){throw ve(l,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Cr.filter(f=>f!=="unknown")}async detect(f){try{const p=await Dr(f);if(p===null)return[];let l;const C={tryCode39ExtendedMode:!1,textMode:"Plain",formats:Ze(this,ct).map(A=>Vt.get(A))};try{l=await $r(p,C)}catch(A){throw console.error(A),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return l.map(A=>{const{topLeft:{x:F,y:B},topRight:{x:S,y:j},bottomLeft:{x:q,y:Z},bottomRight:{x:Q,y:lt}}=A.position,ft=Math.min(F,S,q,Q),at=Math.min(B,j,Z,lt),bt=Math.max(F,S,q,Q),Y=Math.max(B,j,Z,lt);return{boundingBox:new DOMRectReadOnly(ft,at,bt-ft,Y-at),rawValue:A.text,format:Tr(A.format),cornerPoints:[{x:F,y:B},{x:S,y:j},{x:Q,y:lt},{x:q,y:Z}]}})}catch(p){throw ve(p,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return ct=new WeakMap,_.BarcodeDetector=Br,_.ZXING_CPP_COMMIT=hr,_.ZXING_WASM_SHA256=br,_.ZXING_WASM_VERSION=dr,_.prepareZXingModule=Ut,_.purgeZXingModule=gr,_.setZXingModuleOverrides=wr,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}),_}({});
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "barcode-detector",
|
|
3
3
|
"description": "A Barcode Detection API polyfill that uses ZXing webassembly under the hood",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "3.0.
|
|
5
|
+
"version": "3.0.6",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"./dist"
|
|
@@ -87,29 +87,29 @@
|
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
|
-
"@biomejs/biome": "2.
|
|
91
|
-
"@changesets/cli": "^2.29.
|
|
92
|
-
"@commitlint/cli": "^
|
|
93
|
-
"@commitlint/config-conventional": "^
|
|
94
|
-
"@types/node": "^
|
|
90
|
+
"@biomejs/biome": "2.2.4",
|
|
91
|
+
"@changesets/cli": "^2.29.7",
|
|
92
|
+
"@commitlint/cli": "^20.0.0",
|
|
93
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
94
|
+
"@types/node": "^24.6.0",
|
|
95
95
|
"@vitest/browser": "^3.2.4",
|
|
96
96
|
"@vitest/coverage-istanbul": "^3.2.4",
|
|
97
97
|
"@vitest/ui": "^3.2.4",
|
|
98
|
-
"concurrently": "^9.2.
|
|
98
|
+
"concurrently": "^9.2.1",
|
|
99
99
|
"http-server": "^14.1.1",
|
|
100
|
-
"lint-staged": "^16.
|
|
101
|
-
"playwright": "^1.
|
|
102
|
-
"prettier": "^3.6.
|
|
100
|
+
"lint-staged": "^16.2.3",
|
|
101
|
+
"playwright": "^1.55.1",
|
|
102
|
+
"prettier": "^3.6.2",
|
|
103
103
|
"rimraf": "^6.0.1",
|
|
104
|
-
"simple-git-hooks": "^2.13.
|
|
105
|
-
"start-server-and-test": "^2.
|
|
106
|
-
"tsx": "^4.20.
|
|
107
|
-
"typescript": "^5.
|
|
108
|
-
"vite": "^7.
|
|
104
|
+
"simple-git-hooks": "^2.13.1",
|
|
105
|
+
"start-server-and-test": "^2.1.2",
|
|
106
|
+
"tsx": "^4.20.6",
|
|
107
|
+
"typescript": "^5.9.2",
|
|
108
|
+
"vite": "^7.1.7",
|
|
109
109
|
"vitest": "^3.2.4"
|
|
110
110
|
},
|
|
111
111
|
"dependencies": {
|
|
112
|
-
"zxing-wasm": "2.2.
|
|
112
|
+
"zxing-wasm": "2.2.2"
|
|
113
113
|
},
|
|
114
114
|
"scripts": {
|
|
115
115
|
"update-hooks": "simple-git-hooks",
|