barcode-detector 2.2.0 → 2.2.2
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/pure.js +3 -3
- package/dist/es/pure.js +1187 -854
- package/dist/iife/index.js +3 -3
- package/dist/iife/pure.js +3 -3
- package/dist/iife/side-effects.js +3 -3
- package/package.json +9 -9
package/dist/iife/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var BarcodeDetectionAPI=function(I){"use strict";var cr=(I,B,z)=>{if(!B.has(I))throw TypeError("Cannot "+z)};var oe=(I,B,z)=>(cr(I,B,"read from private field"),z?z.call(I):B.get(I)),lr=(I,B,z)=>{if(B.has(I))throw TypeError("Cannot add the same private member more than once");B instanceof WeakSet?B.add(I):B.set(I,z)},dr=(I,B,z,nt)=>(cr(I,B,"write to private field"),nt?nt.call(I,z):B.set(I,z),z);var ct,be;const B=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["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"]],z=[...B,["unknown"]].map(i=>i[0]),nt=new Map(B);function hr(i){for(const[f,u]of nt)if(i===u)return f;return"unknown"}function fr(i){if(ie(i))return{width:i.naturalWidth,height:i.naturalHeight};if(se(i))return{width:i.width.baseVal.value,height:i.height.baseVal.value};if(ue(i))return{width:i.videoWidth,height:i.videoHeight};if(le(i))return{width:i.width,height:i.height};if(he(i))return{width:i.displayWidth,height:i.displayHeight};if(ce(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 ie(i){try{return i instanceof HTMLImageElement}catch{return!1}}function se(i){try{return i instanceof SVGImageElement}catch{return!1}}function ue(i){try{return i instanceof HTMLVideoElement}catch{return!1}}function ce(i){try{return i instanceof HTMLCanvasElement}catch{return!1}}function le(i){try{return i instanceof ImageBitmap}catch{return!1}}function de(i){try{return i instanceof OffscreenCanvas}catch{return!1}}function he(i){try{return i instanceof VideoFrame}catch{return!1}}function fe(i){try{return i instanceof Blob}catch{return!1}}function pr(i){try{return i instanceof ImageData}catch{return!1}}function mr(i,f){try{const u=new OffscreenCanvas(i,f);if(u.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return u;throw void 0}catch{const u=document.createElement("canvas");return u.width=i,u.height=f,u}}async function pe(i){if(ie(i)&&!await wr(i))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(se(i)&&!await $r(i))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(he(i)&&br(i))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(ue(i)&&(i.readyState===0||i.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(le(i)&&_r(i))throw new DOMException("The image source is detached.","InvalidStateError");const{width:f,height:u}=fr(i);if(f===0||u===0)return null;const v=mr(f,u).getContext("2d");v.drawImage(i,0,0);try{return v.getImageData(0,0,f,u)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function yr(i){let f;try{if(globalThis.createImageBitmap)f=await createImageBitmap(i);else if(globalThis.Image){f=new Image;let w="";try{w=URL.createObjectURL(i),f.src=w,await f.decode()}finally{URL.revokeObjectURL(w)}}else return i}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await pe(f)}function vr(i){const{width:f,height:u}=i;if(f===0||u===0)return null;const w=i.getContext("2d");try{return w.getImageData(0,0,f,u)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function gr(i){if(fe(i))return await yr(i);if(pr(i)){if(Cr(i))throw new DOMException("The image data has been detached.","InvalidStateError");return i}return ce(i)||de(i)?vr(i):await pe(i)}async function wr(i){try{return await i.decode(),!0}catch{return!1}}async function $r(i){var f;try{return await((f=i.decode)==null?void 0:f.call(i)),!0}catch{return!1}}function br(i){return i.format===null}function Cr(i){return i.data.buffer.byteLength===0}function _r(i){return i.width===0&&i.height===0}function me(i,f){return i instanceof DOMException?new DOMException(`${f}: ${i.message}`,i.name):i instanceof Error?new i.constructor(`${f}: ${i.message}`):new Error(`${f}: ${i}`)}const ye=["Aztec","Codabar","Code128","Code39","Code93","DataBar","DataBarExpanded","DataMatrix","DXFilmEdge","EAN-13","EAN-8","ITF","Linear-Codes","Matrix-Codes","MaxiCode","MicroQRCode","None","PDF417","QRCode","rMQRCode","UPC-A","UPC-E"];function Tr(i){return i.join("|")}function Pr(i){const f=ve(i);let u=0,w=ye.length-1;for(;u<=w;){const v=Math.floor((u+w)/2),$=ye[v],U=ve($);if(U===f)return $;U<f?u=v+1:w=v-1}return"None"}function ve(i){return i.toLowerCase().replace(/_-\[\]/g,"")}function Er(i,f){return i.Binarizer[f]}function Ar(i,f){return i.CharacterSet[f]}const Dr=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function Or(i){return Dr[i.value]}function Fr(i,f){return i.EanAddOnSymbol[f]}function Sr(i,f){return i.TextMode[f]}const pt={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,tryCode39ExtendedMode:!1,validateCode39CheckSum:!1,validateITFCheckSum:!1,returnCodabarStartEnd:!1,returnErrors:!1,eanAddOnSymbol:"Read",textMode:"Plain",characterSet:"Unknown"};function ge(i,f){return{...f,formats:Tr(f.formats),binarizer:Er(i,f.binarizer),eanAddOnSymbol:Fr(i,f.eanAddOnSymbol),textMode:Sr(i,f.textMode),characterSet:Ar(i,f.characterSet)}}const xr={width:200,height:200,format:"QRCode",characterSet:"UTF8",eccLevel:-1,margin:10};function we(i){return{...i,format:Pr(i.format),eccLevel:i.eccLevel,contentType:Or(i.contentType)}}const Mr={locateFile:(i,f)=>{const u=i.match(/_(.+?)\.wasm$/);return u?`https://fastly.jsdelivr.net/npm/zxing-wasm@1.1.1/dist/${u[1]}/${i}`:f+i}};let Bt=new WeakMap;function Ht(i,f){var u;const w=Bt.get(i);if(w!=null&&w.modulePromise&&(f===void 0||Object.is(f,w.moduleOverrides)))return w.modulePromise;const v=(u=f!=null?f:w==null?void 0:w.moduleOverrides)!=null?u:Mr,$=i({...v});return Bt.set(i,{moduleOverrides:v,modulePromise:$}),$}function Ir(i,f){Bt.set(i,{moduleOverrides:f})}async function jr(i,f,u=pt){const w={...pt,...u},v=await Ht(i),{size:$}=f,U=new Uint8Array(await f.arrayBuffer()),N=v._malloc($);v.HEAPU8.set(U,N);const L=v.readBarcodesFromImage(N,$,ge(v,w));v._free(N);const D=[];for(let G=0;G<L.size();++G)D.push(we(L.get(G)));return D}async function Rr(i,f,u=pt){const w={...pt,...u},v=await Ht(i),{data:$,width:U,height:N,data:{byteLength:L}}=f,D=v._malloc(L);v.HEAPU8.set($,D);const G=v.readBarcodesFromPixmap(D,U,N,ge(v,w));v._free(D);const Q=[];for(let V=0;V<G.size();++V)Q.push(we(G.get(V)));return Q}structuredClone(pt),structuredClone(xr);var Pt=(()=>{var i=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(f={}){var u=f,w,v;u.ready=new Promise((t,e)=>{w=t,v=e});var $=Object.assign({},u),U="./this.program",N=typeof window=="object",L=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var D="";function G(t){return u.locateFile?u.locateFile(t,D):D+t}var Q;(N||L)&&(L?D=self.location.href:typeof document<"u"&&document.currentScript&&(D=document.currentScript.src),i&&(D=i),D.indexOf("blob:")!==0?D=D.substr(0,D.replace(/[?#].*/,"").lastIndexOf("/")+1):D="",L&&(Q=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)})),u.print||console.log.bind(console);var V=u.printErr||console.error.bind(console);Object.assign(u,$),$=null,u.arguments&&u.arguments,u.thisProgram&&(U=u.thisProgram),u.quit&&u.quit;var K;u.wasmBinary&&(K=u.wasmBinary),typeof WebAssembly!="object"&>("no native wasm support detected");var at,mt=!1;function Ut(t,e){t||gt(e)}var Y,H,lt,yt,k,_,Ce,_e;function Te(){var t=at.buffer;u.HEAP8=Y=new Int8Array(t),u.HEAP16=lt=new Int16Array(t),u.HEAPU8=H=new Uint8Array(t),u.HEAPU16=yt=new Uint16Array(t),u.HEAP32=k=new Int32Array(t),u.HEAPU32=_=new Uint32Array(t),u.HEAPF32=Ce=new Float32Array(t),u.HEAPF64=_e=new Float64Array(t)}var Pe=[],Ee=[],Ae=[];function Ur(){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)Yr(u.preRun.shift());Lt(Pe)}function Lr(){Lt(Ee)}function Vr(){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)Nr(u.postRun.shift());Lt(Ae)}function Yr(t){Pe.unshift(t)}function zr(t){Ee.unshift(t)}function Nr(t){Ae.unshift(t)}var ot=0,vt=null;function Gr(t){ot++,u.monitorRunDependencies&&u.monitorRunDependencies(ot)}function Xr(t){if(ot--,u.monitorRunDependencies&&u.monitorRunDependencies(ot),ot==0&&vt){var e=vt;vt=null,e()}}function gt(t){u.onAbort&&u.onAbort(t),t="Aborted("+t+")",V(t),mt=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw v(e),e}var qr="data:application/octet-stream;base64,",De=t=>t.startsWith(qr),dt;dt="zxing_reader.wasm",De(dt)||(dt=G(dt));function Oe(t){if(t==dt&&K)return new Uint8Array(K);if(Q)return Q(t);throw"both async and sync fetching of the wasm failed"}function Qr(t){return!K&&(N||L)&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(e=>{if(!e.ok)throw"failed to load wasm binary file at '"+t+"'";return e.arrayBuffer()}).catch(()=>Oe(t)):Promise.resolve().then(()=>Oe(t))}function Fe(t,e,r){return Qr(t).then(n=>WebAssembly.instantiate(n,e)).then(n=>n).then(r,n=>{V(`failed to asynchronously prepare wasm: ${n}`),gt(n)})}function Zr(t,e,r,n){return!t&&typeof WebAssembly.instantiateStreaming=="function"&&!De(e)&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(a=>{var o=WebAssembly.instantiateStreaming(a,r);return o.then(n,function(s){return V(`wasm streaming compile failed: ${s}`),V("falling back to ArrayBuffer instantiation"),Fe(e,r,n)})}):Fe(e,r,n)}function Jr(){var t={a:Ma};function e(n,a){return E=n.exports,at=E.fa,Te(),Le=E.ja,zr(E.ga),Xr(),E}Gr();function r(n){e(n.instance)}if(u.instantiateWasm)try{return u.instantiateWasm(t,e)}catch(n){V(`Module.instantiateWasm callback failed with error: ${n}`),v(n)}return Zr(K,dt,t,r).catch(v),{}}var Lt=t=>{for(;t.length>0;)t.shift()(u)};u.noExitRuntime;var Et=[],At=0,Kr=t=>{var e=new Vt(t);return e.get_caught()||(e.set_caught(!0),At--),e.set_rethrown(!1),Et.push(e),ar(e.excPtr),e.get_exception_ptr()},tt=0,tn=()=>{A(0,0);var t=Et.pop();nr(t.excPtr),tt=0};function Vt(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(e){_[this.ptr+4>>2]=e},this.get_type=function(){return _[this.ptr+4>>2]},this.set_destructor=function(e){_[this.ptr+8>>2]=e},this.get_destructor=function(){return _[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,Y[this.ptr+12>>0]=e},this.get_caught=function(){return Y[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,Y[this.ptr+13>>0]=e},this.get_rethrown=function(){return Y[this.ptr+13>>0]!=0},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)},this.set_adjusted_ptr=function(e){_[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return _[this.ptr+16>>2]},this.get_exception_ptr=function(){var e=ir(this.get_type());if(e)return _[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr}}var en=t=>{throw tt||(tt=t),tt},Yt=t=>{var e=tt;if(!e)return Tt(0),0;var r=new Vt(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return Tt(0),e;for(var a in t){var o=t[a];if(o===0||o===n)break;var s=r.ptr+16;if(or(o,n,s))return Tt(o),e}return Tt(n),e},rn=()=>Yt([]),nn=t=>Yt([t]),an=(t,e)=>Yt([t,e]),on=()=>{var t=Et.pop();t||gt("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||(Et.push(t),t.set_rethrown(!0),t.set_caught(!1),At++),tt=e,tt},sn=(t,e,r)=>{var n=new Vt(t);throw n.init(e,r),tt=t,At++,tt},un=()=>At,Dt={},Se=t=>{for(;t.length;){var e=t.pop(),r=t.pop();r(e)}};function zt(t){return this.fromWireType(k[t>>2])}var ht={},it={},Ot={},xe,Ft=t=>{throw new xe(t)},st=(t,e,r)=>{t.forEach(function(c){Ot[c]=e});function n(c){var l=r(c);l.length!==t.length&&Ft("Mismatched type converter count");for(var h=0;h<t.length;++h)Z(t[h],l[h])}var a=new Array(e.length),o=[],s=0;e.forEach((c,l)=>{it.hasOwnProperty(c)?a[l]=it[c]:(o.push(c),ht.hasOwnProperty(c)||(ht[c]=[]),ht[c].push(()=>{a[l]=it[c],++s,s===o.length&&n(a)}))}),o.length===0&&n(a)},cn=t=>{var e=Dt[t];delete Dt[t];var r=e.rawConstructor,n=e.rawDestructor,a=e.fields,o=a.map(s=>s.getterReturnType).concat(a.map(s=>s.setterArgumentType));st([t],o,s=>{var c={};return a.forEach((l,h)=>{var p=l.fieldName,y=s[h],g=l.getter,b=l.getterContext,T=s[h+a.length],R=l.setter,P=l.setterContext;c[p]={read:W=>y.fromWireType(g(b,W)),write:(W,d)=>{var m=[];R(P,W,T.toWireType(m,d)),Se(m)}}}),[{name:e.name,fromWireType:l=>{var h={};for(var p in c)h[p]=c[p].read(l);return n(l),h},toWireType:(l,h)=>{for(var p in c)if(!(p in h))throw new TypeError(`Missing field: "${p}"`);var y=r();for(p in c)c[p].write(y,h[p]);return l!==null&&l.push(n,y),y},argPackAdvance:J,readValueFromPointer:zt,destructorFunction:n}]})},ln=(t,e,r,n,a)=>{},dn=()=>{for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);Me=t},Me,j=t=>{for(var e="",r=t;H[r];)e+=Me[H[r++]];return e},ft,C=t=>{throw new ft(t)};function hn(t,e,r={}){var n=e.name;if(t||C(`type "${n}" must have a positive integer typeid pointer`),it.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;C(`Cannot register type '${n}' twice`)}if(it[t]=e,delete Ot[t],ht.hasOwnProperty(t)){var a=ht[t];delete ht[t],a.forEach(o=>o())}}function Z(t,e,r={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return hn(t,e,r)}var J=8,fn=(t,e,r,n)=>{e=j(e),Z(t,{name:e,fromWireType:function(a){return!!a},toWireType:function(a,o){return o?r:n},argPackAdvance:J,readValueFromPointer:function(a){return this.fromWireType(H[a])},destructorFunction:null})},pn=t=>({count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}),Nt=t=>{function e(r){return r.$$.ptrType.registeredClass.name}C(e(t)+" instance already deleted")},Gt=!1,Ie=t=>{},mn=t=>{t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)},je=t=>{t.count.value-=1;var e=t.count.value===0;e&&mn(t)},Re=(t,e,r)=>{if(e===r)return t;if(r.baseClass===void 0)return null;var n=Re(t,e,r.baseClass);return n===null?null:r.downcast(n)},We={},yn=()=>Object.keys(bt).length,vn=()=>{var t=[];for(var e in bt)bt.hasOwnProperty(e)&&t.push(bt[e]);return t},wt=[],Xt=()=>{for(;wt.length;){var t=wt.pop();t.$$.deleteScheduled=!1,t.delete()}},$t,gn=t=>{$t=t,wt.length&&$t&&$t(Xt)},wn=()=>{u.getInheritedInstanceCount=yn,u.getLiveInheritedInstances=vn,u.flushPendingDeletes=Xt,u.setDelayFunction=gn},bt={},$n=(t,e)=>{for(e===void 0&&C("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e},bn=(t,e)=>(e=$n(t,e),bt[e]),St=(t,e)=>{(!e.ptrType||!e.ptr)&&Ft("makeClassHandle requires ptr and ptrType");var r=!!e.smartPtrType,n=!!e.smartPtr;return r!==n&&Ft("Both smartPtrType and smartPtr must be specified"),e.count={value:1},Ct(Object.create(t,{$$:{value:e}}))};function Cn(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=bn(this.registeredClass,e);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=e,r.$$.smartPtr=t,r.clone();var n=r.clone();return this.destructor(t),n}function a(){return this.isSmartPointer?St(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):St(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var o=this.registeredClass.getActualType(e),s=We[o];if(!s)return a.call(this);var c;this.isConst?c=s.constPointerType:c=s.pointerType;var l=Re(e,this.registeredClass,c.registeredClass);return l===null?a.call(this):this.isSmartPointer?St(c.registeredClass.instancePrototype,{ptrType:c,ptr:l,smartPtrType:this,smartPtr:t}):St(c.registeredClass.instancePrototype,{ptrType:c,ptr:l})}var Ct=t=>typeof FinalizationRegistry>"u"?(Ct=e=>e,t):(Gt=new FinalizationRegistry(e=>{je(e.$$)}),Ct=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var a={$$:r};Gt.register(e,a,e)}return e},Ie=e=>Gt.unregister(e),Ct(t)),_n=()=>{Object.assign(xt.prototype,{isAliasOf(t){if(!(this instanceof xt)||!(t instanceof xt))return!1;var e=this.$$.ptrType.registeredClass,r=this.$$.ptr;t.$$=t.$$;for(var n=t.$$.ptrType.registeredClass,a=t.$$.ptr;e.baseClass;)r=e.upcast(r),e=e.baseClass;for(;n.baseClass;)a=n.upcast(a),n=n.baseClass;return e===n&&r===a},clone(){if(this.$$.ptr||Nt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=Ct(Object.create(Object.getPrototypeOf(this),{$$:{value:pn(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},delete(){this.$$.ptr||Nt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&C("Object already scheduled for deletion"),Ie(this),je(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Nt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&C("Object already scheduled for deletion"),wt.push(this),wt.length===1&&$t&&$t(Xt),this.$$.deleteScheduled=!0,this}})};function xt(){}var Tn=48,Pn=57,ke=t=>{if(t===void 0)return"_unknown";t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return e>=Tn&&e<=Pn?`_${t}`:t};function qt(t,e){return t=ke(t),{[t]:function(){return e.apply(this,arguments)}}[t]}var Be=(t,e,r)=>{if(t[e].overloadTable===void 0){var n=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||C(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${t[e].overloadTable})!`),t[e].overloadTable[arguments.length].apply(this,arguments)},t[e].overloadTable=[],t[e].overloadTable[n.argCount]=n}},Qt=(t,e,r)=>{u.hasOwnProperty(t)?((r===void 0||u[t].overloadTable!==void 0&&u[t].overloadTable[r]!==void 0)&&C(`Cannot register public name '${t}' twice`),Be(u,t,t),u.hasOwnProperty(r)&&C(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),u[t].overloadTable[r]=e):(u[t]=e,r!==void 0&&(u[t].numArguments=r))};function En(t,e,r,n,a,o,s,c){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=s,this.downcast=c,this.pureVirtualFunctions=[]}var Zt=(t,e,r)=>{for(;e!==r;)e.upcast||C(`Expected null or instance of ${r.name}, got an instance of ${e.name}`),t=e.upcast(t),e=e.baseClass;return t};function An(t,e){if(e===null)return this.isReference&&C(`null is not a valid ${this.name}`),0;e.$$||C(`Cannot pass "${ee(e)}" as a ${this.name}`),e.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=Zt(e.$$.ptr,r,this.registeredClass);return n}function Dn(t,e){var r;if(e===null)return this.isReference&&C(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),t!==null&&t.push(this.rawDestructor,r),r):0;e.$$||C(`Cannot pass "${ee(e)}" as a ${this.name}`),e.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&e.$$.ptrType.isConst&&C(`Cannot convert argument of type ${e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name} to parameter type ${this.name}`);var n=e.$$.ptrType.registeredClass;if(r=Zt(e.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(e.$$.smartPtr===void 0&&C("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:C(`Cannot convert argument of type ${e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=e.$$.smartPtr;break;case 2:if(e.$$.smartPtrType===this)r=e.$$.smartPtr;else{var a=e.clone();r=this.rawShare(r,rt.toHandle(()=>a.delete())),t!==null&&t.push(this.rawDestructor,r)}break;default:C("Unsupporting sharing policy")}return r}function On(t,e){if(e===null)return this.isReference&&C(`null is not a valid ${this.name}`),0;e.$$||C(`Cannot pass "${ee(e)}" as a ${this.name}`),e.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`),e.$$.ptrType.isConst&&C(`Cannot convert argument of type ${e.$$.ptrType.name} to parameter type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=Zt(e.$$.ptr,r,this.registeredClass);return n}function He(t){return this.fromWireType(_[t>>2])}var Fn=()=>{Object.assign(Mt.prototype,{getPointee(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t},destructor(t){this.rawDestructor&&this.rawDestructor(t)},argPackAdvance:J,readValueFromPointer:He,deleteObject(t){t!==null&&t.delete()},fromWireType:Cn})};function Mt(t,e,r,n,a,o,s,c,l,h,p){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=s,this.rawGetPointee=c,this.rawConstructor=l,this.rawShare=h,this.rawDestructor=p,!a&&e.baseClass===void 0?n?(this.toWireType=An,this.destructorFunction=null):(this.toWireType=On,this.destructorFunction=null):this.toWireType=Dn}var Ue=(t,e,r)=>{u.hasOwnProperty(t)||Ft("Replacing nonexistant public symbol"),u[t].overloadTable!==void 0&&r!==void 0?u[t].overloadTable[r]=e:(u[t]=e,u[t].argCount=r)},Sn=(t,e,r)=>{var n=u["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)},It=[],Le,O=t=>{var e=It[t];return e||(t>=It.length&&(It.length=t+1),It[t]=e=Le.get(t)),e},xn=(t,e,r)=>{if(t.includes("j"))return Sn(t,e,r);var n=O(e).apply(null,r);return n},Mn=(t,e)=>{var r=[];return function(){return r.length=0,Object.assign(r,arguments),xn(t,e,r)}},q=(t,e)=>{t=j(t);function r(){return t.includes("j")?Mn(t,e):O(e)}var n=r();return typeof n!="function"&&C(`unknown function pointer with signature ${t}: ${e}`),n},In=(t,e)=>{var r=qt(e,function(n){this.name=e,this.message=n;var a=new Error(n).stack;a!==void 0&&(this.stack=this.toString()+`
|
|
2
|
-
`+a.replace(/^Error(:[^\n]*)?\n/,""))});return r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},r},Ve,Ye=t=>{var e=rr(t),r=j(e);return et(e),r},jt=(t,e)=>{var r=[],n={};function a(o){if(!n[o]&&!it[o]){if(Ot[o]){Ot[o].forEach(a);return}r.push(o),n[o]=!0}}throw e.forEach(a),new Ve(`${t}: `+r.map(Ye).join([", "]))},jn=(t,e,r,n,a,o,s,c,l,h,p,y,g)=>{p=j(p),o=q(a,o),c&&(c=q(s,c)),h&&(h=q(l,h)),g=q(y,g);var b=ke(p);Qt(b,function(){jt(`Cannot construct ${p} due to unbound types`,[n])}),st([t,e,r],n?[n]:[],function(T){T=T[0];var R,P;n?(R=T.registeredClass,P=R.instancePrototype):P=xt.prototype;var W=qt(b,function(){if(Object.getPrototypeOf(this)!==d)throw new ft("Use 'new' to construct "+p);if(m.constructor_body===void 0)throw new ft(p+" has no accessible constructor");var kt=m.constructor_body[arguments.length];if(kt===void 0)throw new ft(`Tried to invoke ctor of ${p} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(m.constructor_body).toString()}) parameters instead!`);return kt.apply(this,arguments)}),d=Object.create(P,{constructor:{value:W}});W.prototype=d;var m=new En(p,W,d,g,R,o,c,h);m.baseClass&&(m.baseClass.__derivedClasses===void 0&&(m.baseClass.__derivedClasses=[]),m.baseClass.__derivedClasses.push(m));var x=new Mt(p,m,!0,!1,!1),M=new Mt(p+"*",m,!1,!1,!1),ut=new Mt(p+" const*",m,!1,!0,!1);return We[t]={pointerType:M,constPointerType:ut},Ue(b,W),[x,M,ut]})},Jt=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(_[e+n*4>>2]);return r};function Kt(t,e,r,n,a,o){var s=e.length;s<2&&C("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var c=e[1]!==null&&r!==null,l=!1,h=1;h<e.length;++h)if(e[h]!==null&&e[h].destructorFunction===void 0){l=!0;break}var p=e[0].name!=="void",y=s-2,g=new Array(y),b=[],T=[];return function(){arguments.length!==y&&C(`function ${t} called with ${arguments.length} arguments, expected ${y}`),T.length=0;var R;b.length=c?2:1,b[0]=a,c&&(R=e[1].toWireType(T,this),b[1]=R);for(var P=0;P<y;++P)g[P]=e[P+2].toWireType(T,arguments[P]),b.push(g[P]);var W=n.apply(null,b);function d(m){if(l)Se(T);else for(var x=c?1:2;x<e.length;x++){var M=x===1?R:g[x-2];e[x].destructorFunction!==null&&e[x].destructorFunction(M)}if(p)return e[0].fromWireType(m)}return d(W)}}var Rn=(t,e,r,n,a,o)=>{var s=Jt(e,r);a=q(n,a),st([],[t],function(c){c=c[0];var l=`constructor ${c.name}`;if(c.registeredClass.constructor_body===void 0&&(c.registeredClass.constructor_body=[]),c.registeredClass.constructor_body[e-1]!==void 0)throw new ft(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${c.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return c.registeredClass.constructor_body[e-1]=()=>{jt(`Cannot construct ${c.name} due to unbound types`,s)},st([],s,h=>(h.splice(1,0,null),c.registeredClass.constructor_body[e-1]=Kt(l,h,null,a,o),[])),[]})},ze=t=>{t=t.trim();const e=t.indexOf("(");return e!==-1?(Ut(t[t.length-1]==")","Parentheses for argument names should match."),t.substr(0,e)):t},Wn=(t,e,r,n,a,o,s,c,l)=>{var h=Jt(r,n);e=j(e),e=ze(e),o=q(a,o),st([],[t],function(p){p=p[0];var y=`${p.name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),c&&p.registeredClass.pureVirtualFunctions.push(e);function g(){jt(`Cannot call ${y} due to unbound types`,h)}var b=p.registeredClass.instancePrototype,T=b[e];return T===void 0||T.overloadTable===void 0&&T.className!==p.name&&T.argCount===r-2?(g.argCount=r-2,g.className=p.name,b[e]=g):(Be(b,e,y),b[e].overloadTable[r-2]=g),st([],h,function(R){var P=Kt(y,R,p,o,s);return b[e].overloadTable===void 0?(P.argCount=r-2,b[e]=P):b[e].overloadTable[r-2]=P,[]}),[]})};function kn(){Object.assign(Ne.prototype,{get(t){return this.allocated[t]},has(t){return this.allocated[t]!==void 0},allocate(t){var e=this.freelist.pop()||this.allocated.length;return this.allocated[e]=t,e},free(t){this.allocated[t]=void 0,this.freelist.push(t)}})}function Ne(){this.allocated=[void 0],this.freelist=[]}var X=new Ne,Ge=t=>{t>=X.reserved&&--X.get(t).refcount===0&&X.free(t)},Bn=()=>{for(var t=0,e=X.reserved;e<X.allocated.length;++e)X.allocated[e]!==void 0&&++t;return t},Hn=()=>{X.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),X.reserved=X.allocated.length,u.count_emval_handles=Bn},rt={toValue:t=>(t||C("Cannot use deleted val. handle = "+t),X.get(t).value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return X.allocate({refcount:1,value:t})}}},Un=(t,e)=>{e=j(e),Z(t,{name:e,fromWireType:r=>{var n=rt.toValue(r);return Ge(r),n},toWireType:(r,n)=>rt.toHandle(n),argPackAdvance:J,readValueFromPointer:zt,destructorFunction:null})},Ln=(t,e,r)=>{switch(e){case 1:return r?function(n){return this.fromWireType(Y[n>>0])}:function(n){return this.fromWireType(H[n>>0])};case 2:return r?function(n){return this.fromWireType(lt[n>>1])}:function(n){return this.fromWireType(yt[n>>1])};case 4:return r?function(n){return this.fromWireType(k[n>>2])}:function(n){return this.fromWireType(_[n>>2])};default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},Vn=(t,e,r,n)=>{e=j(e);function a(){}a.values={},Z(t,{name:e,constructor:a,fromWireType:function(o){return this.constructor.values[o]},toWireType:(o,s)=>s.value,argPackAdvance:J,readValueFromPointer:Ln(e,r,n),destructorFunction:null}),Qt(e,a)},te=(t,e)=>{var r=it[t];return r===void 0&&C(e+" has unknown type "+Ye(t)),r},Yn=(t,e,r)=>{var n=te(t,"enum");e=j(e);var a=n.constructor,o=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:qt(`${n.name}_${e}`,function(){})}});a.values[r]=o,a[e]=o},ee=t=>{if(t===null)return"null";var e=typeof t;return e==="object"||e==="array"||e==="function"?t.toString():""+t},zn=(t,e)=>{switch(e){case 4:return function(r){return this.fromWireType(Ce[r>>2])};case 8:return function(r){return this.fromWireType(_e[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},Nn=(t,e,r)=>{e=j(e),Z(t,{name:e,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:J,readValueFromPointer:zn(e,r),destructorFunction:null})},Gn=(t,e,r,n,a,o,s)=>{var c=Jt(e,r);t=j(t),t=ze(t),a=q(n,a),Qt(t,function(){jt(`Cannot call ${t} due to unbound types`,c)},e-1),st([],c,function(l){var h=[l[0],null].concat(l.slice(1));return Ue(t,Kt(t,h,null,a,o),e-1),[]})},Xn=(t,e,r)=>{switch(e){case 1:return r?n=>Y[n>>0]:n=>H[n>>0];case 2:return r?n=>lt[n>>1]:n=>yt[n>>1];case 4:return r?n=>k[n>>2]:n=>_[n>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},qn=(t,e,r,n,a)=>{e=j(e);var o=p=>p;if(n===0){var s=32-8*r;o=p=>p<<s>>>s}var c=e.includes("unsigned"),l=(p,y)=>{},h;c?h=function(p,y){return l(y,this.name),y>>>0}:h=function(p,y){return l(y,this.name),y},Z(t,{name:e,fromWireType:o,toWireType:h,argPackAdvance:J,readValueFromPointer:Xn(e,r,n!==0),destructorFunction:null})},Qn=(t,e,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[e];function o(s){var c=_[s>>2],l=_[s+4>>2];return new a(Y.buffer,l,c)}r=j(r),Z(t,{name:r,fromWireType:o,argPackAdvance:J,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Xe=(t,e,r,n)=>{if(!(n>0))return 0;for(var a=r,o=r+n-1,s=0;s<t.length;++s){var c=t.charCodeAt(s);if(c>=55296&&c<=57343){var l=t.charCodeAt(++s);c=65536+((c&1023)<<10)|l&1023}if(c<=127){if(r>=o)break;e[r++]=c}else if(c<=2047){if(r+1>=o)break;e[r++]=192|c>>6,e[r++]=128|c&63}else if(c<=65535){if(r+2>=o)break;e[r++]=224|c>>12,e[r++]=128|c>>6&63,e[r++]=128|c&63}else{if(r+3>=o)break;e[r++]=240|c>>18,e[r++]=128|c>>12&63,e[r++]=128|c>>6&63,e[r++]=128|c&63}}return e[r]=0,r-a},Zn=(t,e,r)=>Xe(t,H,e,r),qe=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++r):e+=3}return e},Qe=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,Jn=(t,e,r)=>{for(var n=e+r,a=e;t[a]&&!(a>=n);)++a;if(a-e>16&&t.buffer&&Qe)return Qe.decode(t.subarray(e,a));for(var o="";e<a;){var s=t[e++];if(!(s&128)){o+=String.fromCharCode(s);continue}var c=t[e++]&63;if((s&224)==192){o+=String.fromCharCode((s&31)<<6|c);continue}var l=t[e++]&63;if((s&240)==224?s=(s&15)<<12|c<<6|l:s=(s&7)<<18|c<<12|l<<6|t[e++]&63,s<65536)o+=String.fromCharCode(s);else{var h=s-65536;o+=String.fromCharCode(55296|h>>10,56320|h&1023)}}return o},re=(t,e)=>t?Jn(H,t,e):"",Kn=(t,e)=>{e=j(e);var r=e==="std::string";Z(t,{name:e,fromWireType(n){var a=_[n>>2],o=n+4,s;if(r)for(var c=o,l=0;l<=a;++l){var h=o+l;if(l==a||H[h]==0){var p=h-c,y=re(c,p);s===void 0?s=y:(s+="\0",s+=y),c=h+1}}else{for(var g=new Array(a),l=0;l<a;++l)g[l]=String.fromCharCode(H[o+l]);s=g.join("")}return et(n),s},toWireType(n,a){a instanceof ArrayBuffer&&(a=new Uint8Array(a));var o,s=typeof a=="string";s||a instanceof Uint8Array||a instanceof Uint8ClampedArray||a instanceof Int8Array||C("Cannot pass non-string to std::string"),r&&s?o=qe(a):o=a.length;var c=ae(4+o+1),l=c+4;if(_[c>>2]=o,r&&s)Zn(a,l,o+1);else if(s)for(var h=0;h<o;++h){var p=a.charCodeAt(h);p>255&&(et(l),C("String has UTF-16 code units that do not fit in 8 bits")),H[l+h]=p}else for(var h=0;h<o;++h)H[l+h]=a[h];return n!==null&&n.push(et,c),c},argPackAdvance:J,readValueFromPointer:He,destructorFunction(n){et(n)}})},Ze=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,ta=(t,e)=>{for(var r=t,n=r>>1,a=n+e/2;!(n>=a)&&yt[n];)++n;if(r=n<<1,r-t>32&&Ze)return Ze.decode(H.subarray(t,r));for(var o="",s=0;!(s>=e/2);++s){var c=lt[t+s*2>>1];if(c==0)break;o+=String.fromCharCode(c)}return o},ea=(t,e,r)=>{if(r===void 0&&(r=2147483647),r<2)return 0;r-=2;for(var n=e,a=r<t.length*2?r/2:t.length,o=0;o<a;++o){var s=t.charCodeAt(o);lt[e>>1]=s,e+=2}return lt[e>>1]=0,e-n},ra=t=>t.length*2,na=(t,e)=>{for(var r=0,n="";!(r>=e/4);){var a=k[t+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},aa=(t,e,r)=>{if(r===void 0&&(r=2147483647),r<4)return 0;for(var n=e,a=n+r-4,o=0;o<t.length;++o){var s=t.charCodeAt(o);if(s>=55296&&s<=57343){var c=t.charCodeAt(++o);s=65536+((s&1023)<<10)|c&1023}if(k[e>>2]=s,e+=4,e+4>a)break}return k[e>>2]=0,e-n},oa=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n>=55296&&n<=57343&&++r,e+=4}return e},ia=(t,e,r)=>{r=j(r);var n,a,o,s,c;e===2?(n=ta,a=ea,s=ra,o=()=>yt,c=1):e===4&&(n=na,a=aa,s=oa,o=()=>_,c=2),Z(t,{name:r,fromWireType:l=>{for(var h=_[l>>2],p=o(),y,g=l+4,b=0;b<=h;++b){var T=l+4+b*e;if(b==h||p[T>>c]==0){var R=T-g,P=n(g,R);y===void 0?y=P:(y+="\0",y+=P),g=T+e}}return et(l),y},toWireType:(l,h)=>{typeof h!="string"&&C(`Cannot pass non-string to C++ string type ${r}`);var p=s(h),y=ae(4+p+e);return _[y>>2]=p>>c,a(h,y+4,p+e),l!==null&&l.push(et,y),y},argPackAdvance:J,readValueFromPointer:zt,destructorFunction(l){et(l)}})},sa=(t,e,r,n,a,o)=>{Dt[t]={name:j(e),rawConstructor:q(r,n),rawDestructor:q(a,o),fields:[]}},ua=(t,e,r,n,a,o,s,c,l,h)=>{Dt[t].fields.push({fieldName:j(e),getterReturnType:r,getter:q(n,a),getterContext:o,setterArgumentType:s,setter:q(c,l),setterContext:h})},ca=(t,e)=>{e=j(e),Z(t,{isVoid:!0,name:e,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})},la={},da=t=>{var e=la[t];return e===void 0?j(t):e},Je=()=>{if(typeof globalThis=="object")return globalThis;function t(e){e.$$$embind_global$$$=e;var r=typeof $$$embind_global$$$=="object"&&e.$$$embind_global$$$==e;return r||delete e.$$$embind_global$$$,r}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&t(global)?$$$embind_global$$$=global:typeof self=="object"&&t(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},ha=t=>t===0?rt.toHandle(Je()):(t=da(t),rt.toHandle(Je()[t])),fa=t=>{t>4&&(X.get(t).refcount+=1)},pa=t=>{var e=new Array(t+1);return function(r,n,a){e[0]=r;for(var o=0;o<t;++o){var s=te(_[n+o*4>>2],"parameter "+o);e[o+1]=s.readValueFromPointer(a),a+=s.argPackAdvance}var c=new(r.bind.apply(r,e));return rt.toHandle(c)}},Ke={},ma=(t,e,r,n)=>{t=rt.toValue(t);var a=Ke[e];return a||(a=pa(e),Ke[e]=a),a(t,r,n)},ya=(t,e)=>{t=te(t,"_emval_take_value");var r=t.readValueFromPointer(e);return rt.toHandle(r)},va=()=>{gt("")},ga=(t,e,r)=>H.copyWithin(t,e,e+r),wa=()=>2147483648,$a=t=>{var e=at.buffer,r=(t-e.byteLength+65535)/65536;try{return at.grow(r),Te(),1}catch{}},ba=t=>{var e=H.length;t>>>=0;var r=wa();if(t>r)return!1;for(var n=(l,h)=>l+(h-l%h)%h,a=1;a<=4;a*=2){var o=e*(1+.2/a);o=Math.min(o,t+100663296);var s=Math.min(r,n(Math.max(t,o),65536)),c=$a(s);if(c)return!0}return!1},ne={},Ca=()=>U||"./this.program",_t=()=>{if(!_t.strings){var t=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:t,_:Ca()};for(var r in ne)ne[r]===void 0?delete e[r]:e[r]=ne[r];var n=[];for(var r in e)n.push(`${r}=${e[r]}`);_t.strings=n}return _t.strings},_a=(t,e)=>{for(var r=0;r<t.length;++r)Y[e++>>0]=t.charCodeAt(r);Y[e>>0]=0},Ta=(t,e)=>{var r=0;return _t().forEach((n,a)=>{var o=e+r;_[t+a*4>>2]=o,_a(n,o),r+=n.length+1}),0},Pa=(t,e)=>{var r=_t();_[t>>2]=r.length;var n=0;return r.forEach(a=>n+=a.length+1),_[e>>2]=n,0},Ea=t=>t,Rt=t=>t%4===0&&(t%100!==0||t%400===0),Aa=(t,e)=>{for(var r=0,n=0;n<=e;r+=t[n++]);return r},tr=[31,29,31,30,31,30,31,31,30,31,30,31],er=[31,28,31,30,31,30,31,31,30,31,30,31],Da=(t,e)=>{for(var r=new Date(t.getTime());e>0;){var n=Rt(r.getFullYear()),a=r.getMonth(),o=(n?tr:er)[a];if(e>o-r.getDate())e-=o-r.getDate()+1,r.setDate(1),a<11?r.setMonth(a+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1));else return r.setDate(r.getDate()+e),r}return r};function Oa(t,e,r){var n=r>0?r:qe(t)+1,a=new Array(n),o=Xe(t,a,0,a.length);return e&&(a.length=o),a}var Fa=(t,e)=>{Y.set(t,e)},Sa=(t,e,r,n)=>{var a=_[n+40>>2],o={tm_sec:k[n>>2],tm_min:k[n+4>>2],tm_hour:k[n+8>>2],tm_mday:k[n+12>>2],tm_mon:k[n+16>>2],tm_year:k[n+20>>2],tm_wday:k[n+24>>2],tm_yday:k[n+28>>2],tm_isdst:k[n+32>>2],tm_gmtoff:k[n+36>>2],tm_zone:a?re(a):""},s=re(r),c={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var l in c)s=s.replace(new RegExp(l,"g"),c[l]);var h=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],p=["January","February","March","April","May","June","July","August","September","October","November","December"];function y(d,m,x){for(var M=typeof d=="number"?d.toString():d||"";M.length<m;)M=x[0]+M;return M}function g(d,m){return y(d,m,"0")}function b(d,m){function x(ut){return ut<0?-1:ut>0?1:0}var M;return(M=x(d.getFullYear()-m.getFullYear()))===0&&(M=x(d.getMonth()-m.getMonth()))===0&&(M=x(d.getDate()-m.getDate())),M}function T(d){switch(d.getDay()){case 0:return new Date(d.getFullYear()-1,11,29);case 1:return d;case 2:return new Date(d.getFullYear(),0,3);case 3:return new Date(d.getFullYear(),0,2);case 4:return new Date(d.getFullYear(),0,1);case 5:return new Date(d.getFullYear()-1,11,31);case 6:return new Date(d.getFullYear()-1,11,30)}}function R(d){var m=Da(new Date(d.tm_year+1900,0,1),d.tm_yday),x=new Date(m.getFullYear(),0,4),M=new Date(m.getFullYear()+1,0,4),ut=T(x),kt=T(M);return b(ut,m)<=0?b(kt,m)<=0?m.getFullYear()+1:m.getFullYear():m.getFullYear()-1}var P={"%a":d=>h[d.tm_wday].substring(0,3),"%A":d=>h[d.tm_wday],"%b":d=>p[d.tm_mon].substring(0,3),"%B":d=>p[d.tm_mon],"%C":d=>{var m=d.tm_year+1900;return g(m/100|0,2)},"%d":d=>g(d.tm_mday,2),"%e":d=>y(d.tm_mday,2," "),"%g":d=>R(d).toString().substring(2),"%G":d=>R(d),"%H":d=>g(d.tm_hour,2),"%I":d=>{var m=d.tm_hour;return m==0?m=12:m>12&&(m-=12),g(m,2)},"%j":d=>g(d.tm_mday+Aa(Rt(d.tm_year+1900)?tr:er,d.tm_mon-1),3),"%m":d=>g(d.tm_mon+1,2),"%M":d=>g(d.tm_min,2),"%n":()=>`
|
|
3
|
-
`,"%p":d=>d.tm_hour>=0&&d.tm_hour<12?"AM":"PM","%S":d=>
|
|
1
|
+
var BarcodeDetectionAPI=function(I){"use strict";var cr=(I,B,z)=>{if(!B.has(I))throw TypeError("Cannot "+z)};var se=(I,B,z)=>(cr(I,B,"read from private field"),z?z.call(I):B.get(I)),lr=(I,B,z)=>{if(B.has(I))throw TypeError("Cannot add the same private member more than once");B instanceof WeakSet?B.add(I):B.set(I,z)},dr=(I,B,z,nt)=>(cr(I,B,"write to private field"),nt?nt.call(I,z):B.set(I,z),z);var ct,Te;const B=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["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"]],z=[...B,["unknown"]].map(i=>i[0]),nt=new Map(B);function fr(i){for(const[p,c]of nt)if(i===c)return p;return"unknown"}function hr(i){if(ue(i))return{width:i.naturalWidth,height:i.naturalHeight};if(ce(i))return{width:i.width.baseVal.value,height:i.height.baseVal.value};if(le(i))return{width:i.videoWidth,height:i.videoHeight};if(fe(i))return{width:i.width,height:i.height};if(pe(i))return{width:i.displayWidth,height:i.displayHeight};if(de(i))return{width:i.width,height:i.height};if(he(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 ue(i){try{return i instanceof HTMLImageElement}catch{return!1}}function ce(i){try{return i instanceof SVGImageElement}catch{return!1}}function le(i){try{return i instanceof HTMLVideoElement}catch{return!1}}function de(i){try{return i instanceof HTMLCanvasElement}catch{return!1}}function fe(i){try{return i instanceof ImageBitmap}catch{return!1}}function he(i){try{return i instanceof OffscreenCanvas}catch{return!1}}function pe(i){try{return i instanceof VideoFrame}catch{return!1}}function me(i){try{return i instanceof Blob}catch{return!1}}function pr(i){try{return i instanceof ImageData}catch{return!1}}function mr(i,p){try{const c=new OffscreenCanvas(i,p);if(c.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return c;throw void 0}catch{const c=document.createElement("canvas");return c.width=i,c.height=p,c}}async function ve(i){if(ue(i)&&!await wr(i))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(ce(i)&&!await $r(i))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(pe(i)&&br(i))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(le(i)&&(i.readyState===0||i.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(fe(i)&&Tr(i))throw new DOMException("The image source is detached.","InvalidStateError");const{width:p,height:c}=hr(i);if(p===0||c===0)return null;const g=mr(p,c).getContext("2d");g.drawImage(i,0,0);try{return g.getImageData(0,0,p,c)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function vr(i){let p;try{if(globalThis.createImageBitmap)p=await createImageBitmap(i);else if(globalThis.Image){p=new Image;let $="";try{$=URL.createObjectURL(i),p.src=$,await p.decode()}finally{URL.revokeObjectURL($)}}else return i}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await ve(p)}function yr(i){const{width:p,height:c}=i;if(p===0||c===0)return null;const $=i.getContext("2d");try{return $.getImageData(0,0,p,c)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function gr(i){if(me(i))return await vr(i);if(pr(i)){if(Cr(i))throw new DOMException("The image data has been detached.","InvalidStateError");return i}return de(i)||he(i)?yr(i):await ve(i)}async function wr(i){try{return await i.decode(),!0}catch{return!1}}async function $r(i){var p;try{return await((p=i.decode)==null?void 0:p.call(i)),!0}catch{return!1}}function br(i){return i.format===null}function Cr(i){return i.data.buffer.byteLength===0}function Tr(i){return i.width===0&&i.height===0}function ye(i,p){return i instanceof DOMException?new DOMException(`${p}: ${i.message}`,i.name):i instanceof Error?new i.constructor(`${p}: ${i.message}`):new Error(`${p}: ${i}`)}const ge=["Aztec","Codabar","Code128","Code39","Code93","DataBar","DataBarExpanded","DataMatrix","DXFilmEdge","EAN-13","EAN-8","ITF","Linear-Codes","Matrix-Codes","MaxiCode","MicroQRCode","None","PDF417","QRCode","rMQRCode","UPC-A","UPC-E"];function _r(i){return i.join("|")}function Pr(i){const p=we(i);let c=0,$=ge.length-1;for(;c<=$;){const g=Math.floor((c+$)/2),b=ge[g],U=we(b);if(U===p)return b;U<p?c=g+1:$=g-1}return"None"}function we(i){return i.toLowerCase().replace(/_-\[\]/g,"")}function Er(i,p){return i.Binarizer[p]}function Ar(i,p){return i.CharacterSet[p]}const Dr=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function Or(i){return Dr[i.value]}function Fr(i,p){return i.EanAddOnSymbol[p]}function xr(i,p){return i.TextMode[p]}const ut={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,tryCode39ExtendedMode:!1,validateCode39CheckSum:!1,validateITFCheckSum:!1,returnCodabarStartEnd:!1,returnErrors:!1,eanAddOnSymbol:"Read",textMode:"Plain",characterSet:"Unknown"};function $e(i,p){return{...p,formats:_r(p.formats),binarizer:Er(i,p.binarizer),eanAddOnSymbol:Fr(i,p.eanAddOnSymbol),textMode:xr(i,p.textMode),characterSet:Ar(i,p.characterSet)}}function be(i){return{...i,format:Pr(i.format),eccLevel:i.eccLevel,contentType:Or(i.contentType)}}const Sr={locateFile:(i,p)=>{const c=i.match(/_(.+?)\.wasm$/);return c?`https://fastly.jsdelivr.net/npm/zxing-wasm@1.1.3/dist/${c[1]}/${i}`:p+i}};let Bt=new WeakMap;function Ut(i,p){var c;const $=Bt.get(i);if($!=null&&$.modulePromise&&(p===void 0||Object.is(p,$.moduleOverrides)))return $.modulePromise;const g=(c=p!=null?p:$==null?void 0:$.moduleOverrides)!=null?c:Sr,b=i({...g});return Bt.set(i,{moduleOverrides:g,modulePromise:b}),b}function Mr(i,p){Bt.set(i,{moduleOverrides:p})}async function jr(i,p,c=ut){const $={...ut,...c},g=await Ut(i),{size:b}=p,U=new Uint8Array(await p.arrayBuffer()),N=g._malloc(b);g.HEAPU8.set(U,N);const V=g.readBarcodesFromImage(N,b,$e(g,$));g._free(N);const S=[];for(let G=0;G<V.size();++G)S.push(be(V.get(G)));return S}async function Ir(i,p,c=ut){const $={...ut,...c},g=await Ut(i),{data:b,width:U,height:N,data:{byteLength:V}}=p,S=g._malloc(V);g.HEAPU8.set(b,S);const G=g.readBarcodesFromPixmap(S,U,N,$e(g,$));g._free(S);const Q=[];for(let L=0;L<G.size();++L)Q.push(be(G.get(L)));return Q}({...ut,formats:[...ut.formats]});var Pt=(()=>{var i=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(p={}){var c=p,$,g;c.ready=new Promise((t,e)=>{$=t,g=e});var b=Object.assign({},c),U="./this.program",N=typeof window=="object",V=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var S="";function G(t){return c.locateFile?c.locateFile(t,S):S+t}var Q;(N||V)&&(V?S=self.location.href:typeof document<"u"&&document.currentScript&&(S=document.currentScript.src),i&&(S=i),S.indexOf("blob:")!==0?S=S.substr(0,S.replace(/[?#].*/,"").lastIndexOf("/")+1):S="",V&&(Q=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)})),c.print||console.log.bind(console);var L=c.printErr||console.error.bind(console);Object.assign(c,b),b=null,c.arguments&&c.arguments,c.thisProgram&&(U=c.thisProgram),c.quit&&c.quit;var K;c.wasmBinary&&(K=c.wasmBinary),typeof WebAssembly!="object"&&Et("no native wasm support detected");var at,mt=!1,Y,k,lt,vt,H,_,_e,Pe;function Ee(){var t=at.buffer;c.HEAP8=Y=new Int8Array(t),c.HEAP16=lt=new Int16Array(t),c.HEAPU8=k=new Uint8Array(t),c.HEAPU16=vt=new Uint16Array(t),c.HEAP32=H=new Int32Array(t),c.HEAPU32=_=new Uint32Array(t),c.HEAPF32=_e=new Float32Array(t),c.HEAPF64=Pe=new Float64Array(t)}var Ae=[],De=[],Oe=[];function Br(){if(c.preRun)for(typeof c.preRun=="function"&&(c.preRun=[c.preRun]);c.preRun.length;)Lr(c.preRun.shift());Vt(Ae)}function Ur(){Vt(De)}function Vr(){if(c.postRun)for(typeof c.postRun=="function"&&(c.postRun=[c.postRun]);c.postRun.length;)zr(c.postRun.shift());Vt(Oe)}function Lr(t){Ae.unshift(t)}function Yr(t){De.unshift(t)}function zr(t){Oe.unshift(t)}var ot=0,yt=null;function Nr(t){var e;ot++,(e=c.monitorRunDependencies)===null||e===void 0||e.call(c,ot)}function Gr(t){var e;if(ot--,(e=c.monitorRunDependencies)===null||e===void 0||e.call(c,ot),ot==0&&yt){var r=yt;yt=null,r()}}function Et(t){var e;(e=c.onAbort)===null||e===void 0||e.call(c,t),t="Aborted("+t+")",L(t),mt=!0,t+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(t);throw g(r),r}var Xr="data:application/octet-stream;base64,",Fe=t=>t.startsWith(Xr),dt;dt="zxing_reader.wasm",Fe(dt)||(dt=G(dt));function xe(t){if(t==dt&&K)return new Uint8Array(K);if(Q)return Q(t);throw"both async and sync fetching of the wasm failed"}function qr(t){return!K&&(N||V)&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(e=>{if(!e.ok)throw"failed to load wasm binary file at '"+t+"'";return e.arrayBuffer()}).catch(()=>xe(t)):Promise.resolve().then(()=>xe(t))}function Se(t,e,r){return qr(t).then(n=>WebAssembly.instantiate(n,e)).then(n=>n).then(r,n=>{L(`failed to asynchronously prepare wasm: ${n}`),Et(n)})}function Qr(t,e,r,n){return!t&&typeof WebAssembly.instantiateStreaming=="function"&&!Fe(e)&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(a=>{var o=WebAssembly.instantiateStreaming(a,r);return o.then(n,function(s){return L(`wasm streaming compile failed: ${s}`),L("falling back to ArrayBuffer instantiation"),Se(e,r,n)})}):Se(e,r,n)}function Zr(){var t={a:Ha};function e(n,a){return M=n.exports,at=M.ia,Ee(),Ve=M.ma,Yr(M.ja),Gr(),M}Nr();function r(n){e(n.instance)}if(c.instantiateWasm)try{return c.instantiateWasm(t,e)}catch(n){L(`Module.instantiateWasm callback failed with error: ${n}`),g(n)}return Qr(K,dt,t,r).catch(g),{}}var Vt=t=>{for(;t.length>0;)t.shift()(c)};c.noExitRuntime;var At=[],Dt=0,Jr=t=>{var e=new Lt(t);return e.get_caught()||(e.set_caught(!0),Dt--),e.set_rethrown(!1),At.push(e),rr(e.excPtr),e.get_exception_ptr()},tt=0,Kr=()=>{P(0,0);var t=At.pop();er(t.excPtr),tt=0};function Lt(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(e){_[this.ptr+4>>2]=e},this.get_type=function(){return _[this.ptr+4>>2]},this.set_destructor=function(e){_[this.ptr+8>>2]=e},this.get_destructor=function(){return _[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,Y[this.ptr+12>>0]=e},this.get_caught=function(){return Y[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,Y[this.ptr+13>>0]=e},this.get_rethrown=function(){return Y[this.ptr+13>>0]!=0},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)},this.set_adjusted_ptr=function(e){_[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return _[this.ptr+16>>2]},this.get_exception_ptr=function(){var e=ar(this.get_type());if(e)return _[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr}}var tn=t=>{throw tt||(tt=t),tt},Yt=t=>{var e=tt;if(!e)return _t(0),0;var r=new Lt(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return _t(0),e;for(var a in t){var o=t[a];if(o===0||o===n)break;var s=r.ptr+16;if(nr(o,n,s))return _t(o),e}return _t(n),e},en=()=>Yt([]),rn=t=>Yt([t]),nn=(t,e)=>Yt([t,e]),an=()=>{var t=At.pop();t||Et("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||(At.push(t),t.set_rethrown(!0),t.set_caught(!1),Dt++),tt=e,tt},on=(t,e,r)=>{var n=new Lt(t);throw n.init(e,r),tt=t,Dt++,tt},sn=()=>Dt,Ot={},zt=t=>{for(;t.length;){var e=t.pop(),r=t.pop();r(e)}};function Nt(t){return this.fromWireType(H[t>>2])}var ft={},it={},Ft={},Me,xt=t=>{throw new Me(t)},st=(t,e,r)=>{t.forEach(function(u){Ft[u]=e});function n(u){var l=r(u);l.length!==t.length&&xt("Mismatched type converter count");for(var f=0;f<t.length;++f)Z(t[f],l[f])}var a=new Array(e.length),o=[],s=0;e.forEach((u,l)=>{it.hasOwnProperty(u)?a[l]=it[u]:(o.push(u),ft.hasOwnProperty(u)||(ft[u]=[]),ft[u].push(()=>{a[l]=it[u],++s,s===o.length&&n(a)}))}),o.length===0&&n(a)},un=t=>{var e=Ot[t];delete Ot[t];var r=e.rawConstructor,n=e.rawDestructor,a=e.fields,o=a.map(s=>s.getterReturnType).concat(a.map(s=>s.setterArgumentType));st([t],o,s=>{var u={};return a.forEach((l,f)=>{var h=l.fieldName,v=s[f],y=l.getter,w=l.getterContext,E=s[f+a.length],F=l.setter,T=l.setterContext;u[h]={read:W=>v.fromWireType(y(w,W)),write:(W,d)=>{var m=[];F(T,W,E.toWireType(m,d)),zt(m)}}}),[{name:e.name,fromWireType:l=>{var f={};for(var h in u)f[h]=u[h].read(l);return n(l),f},toWireType:(l,f)=>{for(var h in u)if(!(h in f))throw new TypeError(`Missing field: "${h}"`);var v=r();for(h in u)u[h].write(v,f[h]);return l!==null&&l.push(n,v),v},argPackAdvance:J,readValueFromPointer:Nt,destructorFunction:n}]})},cn=(t,e,r,n,a)=>{},ln=()=>{for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);je=t},je,R=t=>{for(var e="",r=t;k[r];)e+=je[k[r++]];return e},ht,C=t=>{throw new ht(t)};function dn(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=e.name;if(t||C(`type "${n}" must have a positive integer typeid pointer`),it.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;C(`Cannot register type '${n}' twice`)}if(it[t]=e,delete Ft[t],ft.hasOwnProperty(t)){var a=ft[t];delete ft[t],a.forEach(o=>o())}}function Z(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return dn(t,e,r)}var J=8,fn=(t,e,r,n)=>{e=R(e),Z(t,{name:e,fromWireType:function(a){return!!a},toWireType:function(a,o){return o?r:n},argPackAdvance:J,readValueFromPointer:function(a){return this.fromWireType(k[a])},destructorFunction:null})},hn=t=>({count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}),Gt=t=>{function e(r){return r.$$.ptrType.registeredClass.name}C(e(t)+" instance already deleted")},Xt=!1,Ie=t=>{},pn=t=>{t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)},Re=t=>{t.count.value-=1;var e=t.count.value===0;e&&pn(t)},We=(t,e,r)=>{if(e===r)return t;if(r.baseClass===void 0)return null;var n=We(t,e,r.baseClass);return n===null?null:r.downcast(n)},ke={},mn=()=>Object.keys($t).length,vn=()=>{var t=[];for(var e in $t)$t.hasOwnProperty(e)&&t.push($t[e]);return t},gt=[],qt=()=>{for(;gt.length;){var t=gt.pop();t.$$.deleteScheduled=!1,t.delete()}},wt,yn=t=>{wt=t,gt.length&&wt&&wt(qt)},gn=()=>{c.getInheritedInstanceCount=mn,c.getLiveInheritedInstances=vn,c.flushPendingDeletes=qt,c.setDelayFunction=yn},$t={},wn=(t,e)=>{for(e===void 0&&C("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e},$n=(t,e)=>(e=wn(t,e),$t[e]),St=(t,e)=>{(!e.ptrType||!e.ptr)&&xt("makeClassHandle requires ptr and ptrType");var r=!!e.smartPtrType,n=!!e.smartPtr;return r!==n&&xt("Both smartPtrType and smartPtr must be specified"),e.count={value:1},bt(Object.create(t,{$$:{value:e,writable:!0}}))};function bn(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=$n(this.registeredClass,e);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=e,r.$$.smartPtr=t,r.clone();var n=r.clone();return this.destructor(t),n}function a(){return this.isSmartPointer?St(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):St(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var o=this.registeredClass.getActualType(e),s=ke[o];if(!s)return a.call(this);var u;this.isConst?u=s.constPointerType:u=s.pointerType;var l=We(e,this.registeredClass,u.registeredClass);return l===null?a.call(this):this.isSmartPointer?St(u.registeredClass.instancePrototype,{ptrType:u,ptr:l,smartPtrType:this,smartPtr:t}):St(u.registeredClass.instancePrototype,{ptrType:u,ptr:l})}var bt=t=>typeof FinalizationRegistry>"u"?(bt=e=>e,t):(Xt=new FinalizationRegistry(e=>{Re(e.$$)}),bt=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var a={$$:r};Xt.register(e,a,e)}return e},Ie=e=>Xt.unregister(e),bt(t)),Cn=()=>{Object.assign(Mt.prototype,{isAliasOf(t){if(!(this instanceof Mt)||!(t instanceof Mt))return!1;var e=this.$$.ptrType.registeredClass,r=this.$$.ptr;t.$$=t.$$;for(var n=t.$$.ptrType.registeredClass,a=t.$$.ptr;e.baseClass;)r=e.upcast(r),e=e.baseClass;for(;n.baseClass;)a=n.upcast(a),n=n.baseClass;return e===n&&r===a},clone(){if(this.$$.ptr||Gt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=bt(Object.create(Object.getPrototypeOf(this),{$$:{value:hn(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},delete(){this.$$.ptr||Gt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&C("Object already scheduled for deletion"),Ie(this),Re(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&&C("Object already scheduled for deletion"),gt.push(this),gt.length===1&&wt&&wt(qt),this.$$.deleteScheduled=!0,this}})};function Mt(){}var Ct=(t,e)=>Object.defineProperty(e,"name",{value:t}),He=(t,e,r)=>{if(t[e].overloadTable===void 0){var n=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||C(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${t[e].overloadTable})!`),t[e].overloadTable[arguments.length].apply(this,arguments)},t[e].overloadTable=[],t[e].overloadTable[n.argCount]=n}},Qt=(t,e,r)=>{c.hasOwnProperty(t)?((r===void 0||c[t].overloadTable!==void 0&&c[t].overloadTable[r]!==void 0)&&C(`Cannot register public name '${t}' twice`),He(c,t,t),c.hasOwnProperty(r)&&C(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),c[t].overloadTable[r]=e):(c[t]=e,r!==void 0&&(c[t].numArguments=r))},Tn=48,_n=57,Pn=t=>{if(t===void 0)return"_unknown";t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return e>=Tn&&e<=_n?`_${t}`:t};function En(t,e,r,n,a,o,s,u){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=s,this.downcast=u,this.pureVirtualFunctions=[]}var Zt=(t,e,r)=>{for(;e!==r;)e.upcast||C(`Expected null or instance of ${r.name}, got an instance of ${e.name}`),t=e.upcast(t),e=e.baseClass;return t};function An(t,e){if(e===null)return this.isReference&&C(`null is not a valid ${this.name}`),0;e.$$||C(`Cannot pass "${re(e)}" as a ${this.name}`),e.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=Zt(e.$$.ptr,r,this.registeredClass);return n}function Dn(t,e){var r;if(e===null)return this.isReference&&C(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),t!==null&&t.push(this.rawDestructor,r),r):0;(!e||!e.$$)&&C(`Cannot pass "${re(e)}" as a ${this.name}`),e.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&e.$$.ptrType.isConst&&C(`Cannot convert argument of type ${e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name} to parameter type ${this.name}`);var n=e.$$.ptrType.registeredClass;if(r=Zt(e.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(e.$$.smartPtr===void 0&&C("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:C(`Cannot convert argument of type ${e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=e.$$.smartPtr;break;case 2:if(e.$$.smartPtrType===this)r=e.$$.smartPtr;else{var a=e.clone();r=this.rawShare(r,et.toHandle(()=>a.delete())),t!==null&&t.push(this.rawDestructor,r)}break;default:C("Unsupporting sharing policy")}return r}function On(t,e){if(e===null)return this.isReference&&C(`null is not a valid ${this.name}`),0;e.$$||C(`Cannot pass "${re(e)}" as a ${this.name}`),e.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`),e.$$.ptrType.isConst&&C(`Cannot convert argument of type ${e.$$.ptrType.name} to parameter type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=Zt(e.$$.ptr,r,this.registeredClass);return n}function Be(t){return this.fromWireType(_[t>>2])}var Fn=()=>{Object.assign(jt.prototype,{getPointee(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t},destructor(t){var e;(e=this.rawDestructor)===null||e===void 0||e.call(this,t)},argPackAdvance:J,readValueFromPointer:Be,deleteObject(t){t!==null&&t.delete()},fromWireType:bn})};function jt(t,e,r,n,a,o,s,u,l,f,h){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=s,this.rawGetPointee=u,this.rawConstructor=l,this.rawShare=f,this.rawDestructor=h,!a&&e.baseClass===void 0?n?(this.toWireType=An,this.destructorFunction=null):(this.toWireType=On,this.destructorFunction=null):this.toWireType=Dn}var Ue=(t,e,r)=>{c.hasOwnProperty(t)||xt("Replacing nonexistant public symbol"),c[t].overloadTable!==void 0&&r!==void 0?c[t].overloadTable[r]=e:(c[t]=e,c[t].argCount=r)},xn=(t,e,r)=>{var n=c["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)},It=[],Ve,A=t=>{var e=It[t];return e||(t>=It.length&&(It.length=t+1),It[t]=e=Ve.get(t)),e},Sn=(t,e,r)=>{if(t.includes("j"))return xn(t,e,r);var n=A(e).apply(null,r);return n},Mn=(t,e)=>{var r=[];return function(){return r.length=0,Object.assign(r,arguments),Sn(t,e,r)}},q=(t,e)=>{t=R(t);function r(){return t.includes("j")?Mn(t,e):A(e)}var n=r();return typeof n!="function"&&C(`unknown function pointer with signature ${t}: ${e}`),n},jn=(t,e)=>{var r=Ct(e,function(n){this.name=e,this.message=n;var a=new Error(n).stack;a!==void 0&&(this.stack=this.toString()+`
|
|
2
|
+
`+a.replace(/^Error(:[^\n]*)?\n/,""))});return r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},r},Le,Ye=t=>{var e=tr(t),r=R(e);return rt(e),r},Rt=(t,e)=>{var r=[],n={};function a(o){if(!n[o]&&!it[o]){if(Ft[o]){Ft[o].forEach(a);return}r.push(o),n[o]=!0}}throw e.forEach(a),new Le(`${t}: `+r.map(Ye).join([", "]))},In=(t,e,r,n,a,o,s,u,l,f,h,v,y)=>{h=R(h),o=q(a,o),u&&(u=q(s,u)),f&&(f=q(l,f)),y=q(v,y);var w=Pn(h);Qt(w,function(){Rt(`Cannot construct ${h} due to unbound types`,[n])}),st([t,e,r],n?[n]:[],function(E){E=E[0];var F,T;n?(F=E.registeredClass,T=F.instancePrototype):T=Mt.prototype;var W=Ct(h,function(){if(Object.getPrototypeOf(this)!==d)throw new ht("Use 'new' to construct "+h);if(m.constructor_body===void 0)throw new ht(h+" has no accessible constructor");var ur=m.constructor_body[arguments.length];if(ur===void 0)throw new ht(`Tried to invoke ctor of ${h} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(m.constructor_body).toString()}) parameters instead!`);return ur.apply(this,arguments)}),d=Object.create(T,{constructor:{value:W}});W.prototype=d;var m=new En(h,W,d,y,F,o,u,f);if(m.baseClass){var x,j;(j=(x=m.baseClass).__derivedClasses)!==null&&j!==void 0||(x.__derivedClasses=[]),m.baseClass.__derivedClasses.push(m)}var pt=new jt(h,m,!0,!1,!1),Ht=new jt(h+"*",m,!1,!1,!1),sr=new jt(h+" const*",m,!1,!0,!1);return ke[t]={pointerType:Ht,constPointerType:sr},Ue(w,W),[pt,Ht,sr]})},Jt=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(_[e+n*4>>2]);return r};function Rn(t){for(var e=1;e<t.length;++e)if(t[e]!==null&&t[e].destructorFunction===void 0)return!0;return!1}function Kt(t,e,r,n,a,o){var s=e.length;s<2&&C("argTypes array size mismatch! Must at least get return value and 'this' types!");var u=e[1]!==null&&r!==null,l=Rn(e),f=e[0].name!=="void",h=s-2,v=new Array(h),y=[],w=[],E=function(){arguments.length!==h&&C(`function ${t} called with ${arguments.length} arguments, expected ${h}`),w.length=0;var F;y.length=u?2:1,y[0]=a,u&&(F=e[1].toWireType(w,this),y[1]=F);for(var T=0;T<h;++T)v[T]=e[T+2].toWireType(w,arguments[T]),y.push(v[T]);var W=n.apply(null,y);function d(m){if(l)zt(w);else for(var x=u?1:2;x<e.length;x++){var j=x===1?F:v[x-2];e[x].destructorFunction!==null&&e[x].destructorFunction(j)}if(f)return e[0].fromWireType(m)}return d(W)};return Ct(t,E)}var Wn=(t,e,r,n,a,o)=>{var s=Jt(e,r);a=q(n,a),st([],[t],function(u){u=u[0];var l=`constructor ${u.name}`;if(u.registeredClass.constructor_body===void 0&&(u.registeredClass.constructor_body=[]),u.registeredClass.constructor_body[e-1]!==void 0)throw new ht(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${u.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return u.registeredClass.constructor_body[e-1]=()=>{Rt(`Cannot construct ${u.name} due to unbound types`,s)},st([],s,f=>(f.splice(1,0,null),u.registeredClass.constructor_body[e-1]=Kt(l,f,null,a,o),[])),[]})},ze=t=>{t=t.trim();const e=t.indexOf("(");return e!==-1?t.substr(0,e):t},kn=(t,e,r,n,a,o,s,u,l)=>{var f=Jt(r,n);e=R(e),e=ze(e),o=q(a,o),st([],[t],function(h){h=h[0];var v=`${h.name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),u&&h.registeredClass.pureVirtualFunctions.push(e);function y(){Rt(`Cannot call ${v} due to unbound types`,f)}var w=h.registeredClass.instancePrototype,E=w[e];return E===void 0||E.overloadTable===void 0&&E.className!==h.name&&E.argCount===r-2?(y.argCount=r-2,y.className=h.name,w[e]=y):(He(w,e,v),w[e].overloadTable[r-2]=y),st([],f,function(F){var T=Kt(v,F,h,o,s);return w[e].overloadTable===void 0?(T.argCount=r-2,w[e]=T):w[e].overloadTable[r-2]=T,[]}),[]})};function Hn(){Object.assign(Ne.prototype,{get(t){return this.allocated[t]},has(t){return this.allocated[t]!==void 0},allocate(t){var e=this.freelist.pop()||this.allocated.length;return this.allocated[e]=t,e},free(t){this.allocated[t]=void 0,this.freelist.push(t)}})}function Ne(){this.allocated=[void 0],this.freelist=[]}var X=new Ne,te=t=>{t>=X.reserved&&--X.get(t).refcount===0&&X.free(t)},Bn=()=>{for(var t=0,e=X.reserved;e<X.allocated.length;++e)X.allocated[e]!==void 0&&++t;return t},Un=()=>{X.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),X.reserved=X.allocated.length,c.count_emval_handles=Bn},et={toValue:t=>(t||C("Cannot use deleted val. handle = "+t),X.get(t).value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return X.allocate({refcount:1,value:t})}}},Vn=(t,e)=>{e=R(e),Z(t,{name:e,fromWireType:r=>{var n=et.toValue(r);return te(r),n},toWireType:(r,n)=>et.toHandle(n),argPackAdvance:J,readValueFromPointer:Nt,destructorFunction:null})},Ln=(t,e,r)=>{switch(e){case 1:return r?function(n){return this.fromWireType(Y[n>>0])}:function(n){return this.fromWireType(k[n>>0])};case 2:return r?function(n){return this.fromWireType(lt[n>>1])}:function(n){return this.fromWireType(vt[n>>1])};case 4:return r?function(n){return this.fromWireType(H[n>>2])}:function(n){return this.fromWireType(_[n>>2])};default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},Yn=(t,e,r,n)=>{e=R(e);function a(){}a.values={},Z(t,{name:e,constructor:a,fromWireType:function(o){return this.constructor.values[o]},toWireType:(o,s)=>s.value,argPackAdvance:J,readValueFromPointer:Ln(e,r,n),destructorFunction:null}),Qt(e,a)},ee=(t,e)=>{var r=it[t];return r===void 0&&C(e+" has unknown type "+Ye(t)),r},zn=(t,e,r)=>{var n=ee(t,"enum");e=R(e);var a=n.constructor,o=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:Ct(`${n.name}_${e}`,function(){})}});a.values[r]=o,a[e]=o},re=t=>{if(t===null)return"null";var e=typeof t;return e==="object"||e==="array"||e==="function"?t.toString():""+t},Nn=(t,e)=>{switch(e){case 4:return function(r){return this.fromWireType(_e[r>>2])};case 8:return function(r){return this.fromWireType(Pe[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},Gn=(t,e,r)=>{e=R(e),Z(t,{name:e,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:J,readValueFromPointer:Nn(e,r),destructorFunction:null})},Xn=(t,e,r,n,a,o,s)=>{var u=Jt(e,r);t=R(t),t=ze(t),a=q(n,a),Qt(t,function(){Rt(`Cannot call ${t} due to unbound types`,u)},e-1),st([],u,function(l){var f=[l[0],null].concat(l.slice(1));return Ue(t,Kt(t,f,null,a,o),e-1),[]})},qn=(t,e,r)=>{switch(e){case 1:return r?n=>Y[n>>0]:n=>k[n>>0];case 2:return r?n=>lt[n>>1]:n=>vt[n>>1];case 4:return r?n=>H[n>>2]:n=>_[n>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},Qn=(t,e,r,n,a)=>{e=R(e);var o=h=>h;if(n===0){var s=32-8*r;o=h=>h<<s>>>s}var u=e.includes("unsigned"),l=(h,v)=>{},f;u?f=function(h,v){return l(v,this.name),v>>>0}:f=function(h,v){return l(v,this.name),v},Z(t,{name:e,fromWireType:o,toWireType:f,argPackAdvance:J,readValueFromPointer:qn(e,r,n!==0),destructorFunction:null})},Zn=(t,e,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[e];function o(s){var u=_[s>>2],l=_[s+4>>2];return new a(Y.buffer,l,u)}r=R(r),Z(t,{name:r,fromWireType:o,argPackAdvance:J,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Ge=(t,e,r,n)=>{if(!(n>0))return 0;for(var a=r,o=r+n-1,s=0;s<t.length;++s){var u=t.charCodeAt(s);if(u>=55296&&u<=57343){var l=t.charCodeAt(++s);u=65536+((u&1023)<<10)|l&1023}if(u<=127){if(r>=o)break;e[r++]=u}else if(u<=2047){if(r+1>=o)break;e[r++]=192|u>>6,e[r++]=128|u&63}else if(u<=65535){if(r+2>=o)break;e[r++]=224|u>>12,e[r++]=128|u>>6&63,e[r++]=128|u&63}else{if(r+3>=o)break;e[r++]=240|u>>18,e[r++]=128|u>>12&63,e[r++]=128|u>>6&63,e[r++]=128|u&63}}return e[r]=0,r-a},Jn=(t,e,r)=>Ge(t,k,e,r),Xe=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++r):e+=3}return e},qe=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,Kn=(t,e,r)=>{for(var n=e+r,a=e;t[a]&&!(a>=n);)++a;if(a-e>16&&t.buffer&&qe)return qe.decode(t.subarray(e,a));for(var o="";e<a;){var s=t[e++];if(!(s&128)){o+=String.fromCharCode(s);continue}var u=t[e++]&63;if((s&224)==192){o+=String.fromCharCode((s&31)<<6|u);continue}var l=t[e++]&63;if((s&240)==224?s=(s&15)<<12|u<<6|l:s=(s&7)<<18|u<<12|l<<6|t[e++]&63,s<65536)o+=String.fromCharCode(s);else{var f=s-65536;o+=String.fromCharCode(55296|f>>10,56320|f&1023)}}return o},ne=(t,e)=>t?Kn(k,t,e):"",ta=(t,e)=>{e=R(e);var r=e==="std::string";Z(t,{name:e,fromWireType(n){var a=_[n>>2],o=n+4,s;if(r)for(var u=o,l=0;l<=a;++l){var f=o+l;if(l==a||k[f]==0){var h=f-u,v=ne(u,h);s===void 0?s=v:(s+="\0",s+=v),u=f+1}}else{for(var y=new Array(a),l=0;l<a;++l)y[l]=String.fromCharCode(k[o+l]);s=y.join("")}return rt(n),s},toWireType(n,a){a instanceof ArrayBuffer&&(a=new Uint8Array(a));var o,s=typeof a=="string";s||a instanceof Uint8Array||a instanceof Uint8ClampedArray||a instanceof Int8Array||C("Cannot pass non-string to std::string"),r&&s?o=Xe(a):o=a.length;var u=ie(4+o+1),l=u+4;if(_[u>>2]=o,r&&s)Jn(a,l,o+1);else if(s)for(var f=0;f<o;++f){var h=a.charCodeAt(f);h>255&&(rt(l),C("String has UTF-16 code units that do not fit in 8 bits")),k[l+f]=h}else for(var f=0;f<o;++f)k[l+f]=a[f];return n!==null&&n.push(rt,u),u},argPackAdvance:J,readValueFromPointer:Be,destructorFunction(n){rt(n)}})},Qe=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,ea=(t,e)=>{for(var r=t,n=r>>1,a=n+e/2;!(n>=a)&&vt[n];)++n;if(r=n<<1,r-t>32&&Qe)return Qe.decode(k.subarray(t,r));for(var o="",s=0;!(s>=e/2);++s){var u=lt[t+s*2>>1];if(u==0)break;o+=String.fromCharCode(u)}return o},ra=(t,e,r)=>{var n;if((n=r)!==null&&n!==void 0||(r=2147483647),r<2)return 0;r-=2;for(var a=e,o=r<t.length*2?r/2:t.length,s=0;s<o;++s){var u=t.charCodeAt(s);lt[e>>1]=u,e+=2}return lt[e>>1]=0,e-a},na=t=>t.length*2,aa=(t,e)=>{for(var r=0,n="";!(r>=e/4);){var a=H[t+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},oa=(t,e,r)=>{var n;if((n=r)!==null&&n!==void 0||(r=2147483647),r<4)return 0;for(var a=e,o=a+r-4,s=0;s<t.length;++s){var u=t.charCodeAt(s);if(u>=55296&&u<=57343){var l=t.charCodeAt(++s);u=65536+((u&1023)<<10)|l&1023}if(H[e>>2]=u,e+=4,e+4>o)break}return H[e>>2]=0,e-a},ia=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n>=55296&&n<=57343&&++r,e+=4}return e},sa=(t,e,r)=>{r=R(r);var n,a,o,s,u;e===2?(n=ea,a=ra,s=na,o=()=>vt,u=1):e===4&&(n=aa,a=oa,s=ia,o=()=>_,u=2),Z(t,{name:r,fromWireType:l=>{for(var f=_[l>>2],h=o(),v,y=l+4,w=0;w<=f;++w){var E=l+4+w*e;if(w==f||h[E>>u]==0){var F=E-y,T=n(y,F);v===void 0?v=T:(v+="\0",v+=T),y=E+e}}return rt(l),v},toWireType:(l,f)=>{typeof f!="string"&&C(`Cannot pass non-string to C++ string type ${r}`);var h=s(f),v=ie(4+h+e);return _[v>>2]=h>>u,a(f,v+4,h+e),l!==null&&l.push(rt,v),v},argPackAdvance:J,readValueFromPointer:Nt,destructorFunction(l){rt(l)}})},ua=(t,e,r,n,a,o)=>{Ot[t]={name:R(e),rawConstructor:q(r,n),rawDestructor:q(a,o),fields:[]}},ca=(t,e,r,n,a,o,s,u,l,f)=>{Ot[t].fields.push({fieldName:R(e),getterReturnType:r,getter:q(n,a),getterContext:o,setterArgumentType:s,setter:q(u,l),setterContext:f})},la=(t,e)=>{e=R(e),Z(t,{isVoid:!0,name:e,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})},ae=[],da=(t,e,r,n)=>(t=ae[t],e=et.toValue(e),t(null,e,r,n)),fa={},ha=t=>{var e=fa[t];return e===void 0?R(t):e},Ze=()=>{if(typeof globalThis=="object")return globalThis;function t(e){e.$$$embind_global$$$=e;var r=typeof $$$embind_global$$$=="object"&&e.$$$embind_global$$$==e;return r||delete e.$$$embind_global$$$,r}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&t(global)?$$$embind_global$$$=global:typeof self=="object"&&t(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},pa=t=>t===0?et.toHandle(Ze()):(t=ha(t),et.toHandle(Ze()[t])),ma=t=>{var e=ae.length;return ae.push(t),e},va=(t,e)=>{for(var r=new Array(t),n=0;n<t;++n)r[n]=ee(_[e+n*4>>2],"parameter "+n);return r},ya=Reflect.construct,ga=(t,e,r)=>{var n=[],a=t.toWireType(n,r);return n.length&&(_[e>>2]=et.toHandle(n)),a},wa=(t,e,r)=>{var n=va(t,e),a=n.shift();t--;var o=new Array(t),s=(l,f,h,v)=>{for(var y=0,w=0;w<t;++w)o[w]=n[w].readValueFromPointer(v+y),y+=n[w].argPackAdvance;for(var E=r===1?ya(f,o):f.apply(l,o),w=0;w<t;++w){var F,T;(F=(T=n[w]).deleteObject)===null||F===void 0||F.call(T,o[w])}return ga(a,h,E)},u=`methodCaller<(${n.map(l=>l.name).join(", ")}) => ${a.name}>`;return ma(Ct(u,s))},$a=t=>{t>4&&(X.get(t).refcount+=1)},ba=t=>{var e=et.toValue(t);zt(e),te(t)},Ca=(t,e)=>{t=ee(t,"_emval_take_value");var r=t.readValueFromPointer(e);return et.toHandle(r)},Ta=()=>{Et("")},_a=(t,e,r)=>k.copyWithin(t,e,e+r),Pa=()=>2147483648,Ea=t=>{var e=at.buffer,r=(t-e.byteLength+65535)/65536;try{return at.grow(r),Ee(),1}catch{}},Aa=t=>{var e=k.length;t>>>=0;var r=Pa();if(t>r)return!1;for(var n=(l,f)=>l+(f-l%f)%f,a=1;a<=4;a*=2){var o=e*(1+.2/a);o=Math.min(o,t+100663296);var s=Math.min(r,n(Math.max(t,o),65536)),u=Ea(s);if(u)return!0}return!1},oe={},Da=()=>U||"./this.program",Tt=()=>{if(!Tt.strings){var t=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:t,_:Da()};for(var r in oe)oe[r]===void 0?delete e[r]:e[r]=oe[r];var n=[];for(var r in e)n.push(`${r}=${e[r]}`);Tt.strings=n}return Tt.strings},Oa=(t,e)=>{for(var r=0;r<t.length;++r)Y[e++>>0]=t.charCodeAt(r);Y[e>>0]=0},Fa=(t,e)=>{var r=0;return Tt().forEach((n,a)=>{var o=e+r;_[t+a*4>>2]=o,Oa(n,o),r+=n.length+1}),0},xa=(t,e)=>{var r=Tt();_[t>>2]=r.length;var n=0;return r.forEach(a=>n+=a.length+1),_[e>>2]=n,0},Sa=t=>t,Wt=t=>t%4===0&&(t%100!==0||t%400===0),Ma=(t,e)=>{for(var r=0,n=0;n<=e;r+=t[n++]);return r},Je=[31,29,31,30,31,30,31,31,30,31,30,31],Ke=[31,28,31,30,31,30,31,31,30,31,30,31],ja=(t,e)=>{for(var r=new Date(t.getTime());e>0;){var n=Wt(r.getFullYear()),a=r.getMonth(),o=(n?Je:Ke)[a];if(e>o-r.getDate())e-=o-r.getDate()+1,r.setDate(1),a<11?r.setMonth(a+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1));else return r.setDate(r.getDate()+e),r}return r};function Ia(t,e,r){var n=r>0?r:Xe(t)+1,a=new Array(n),o=Ge(t,a,0,a.length);return e&&(a.length=o),a}var Ra=(t,e)=>{Y.set(t,e)},Wa=(t,e,r,n)=>{var a=_[n+40>>2],o={tm_sec:H[n>>2],tm_min:H[n+4>>2],tm_hour:H[n+8>>2],tm_mday:H[n+12>>2],tm_mon:H[n+16>>2],tm_year:H[n+20>>2],tm_wday:H[n+24>>2],tm_yday:H[n+28>>2],tm_isdst:H[n+32>>2],tm_gmtoff:H[n+36>>2],tm_zone:a?ne(a):""},s=ne(r),u={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var l in u)s=s.replace(new RegExp(l,"g"),u[l]);var f=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],h=["January","February","March","April","May","June","July","August","September","October","November","December"];function v(d,m,x){for(var j=typeof d=="number"?d.toString():d||"";j.length<m;)j=x[0]+j;return j}function y(d,m){return v(d,m,"0")}function w(d,m){function x(pt){return pt<0?-1:pt>0?1:0}var j;return(j=x(d.getFullYear()-m.getFullYear()))===0&&(j=x(d.getMonth()-m.getMonth()))===0&&(j=x(d.getDate()-m.getDate())),j}function E(d){switch(d.getDay()){case 0:return new Date(d.getFullYear()-1,11,29);case 1:return d;case 2:return new Date(d.getFullYear(),0,3);case 3:return new Date(d.getFullYear(),0,2);case 4:return new Date(d.getFullYear(),0,1);case 5:return new Date(d.getFullYear()-1,11,31);case 6:return new Date(d.getFullYear()-1,11,30)}}function F(d){var m=ja(new Date(d.tm_year+1900,0,1),d.tm_yday),x=new Date(m.getFullYear(),0,4),j=new Date(m.getFullYear()+1,0,4),pt=E(x),Ht=E(j);return w(pt,m)<=0?w(Ht,m)<=0?m.getFullYear()+1:m.getFullYear():m.getFullYear()-1}var T={"%a":d=>f[d.tm_wday].substring(0,3),"%A":d=>f[d.tm_wday],"%b":d=>h[d.tm_mon].substring(0,3),"%B":d=>h[d.tm_mon],"%C":d=>{var m=d.tm_year+1900;return y(m/100|0,2)},"%d":d=>y(d.tm_mday,2),"%e":d=>v(d.tm_mday,2," "),"%g":d=>F(d).toString().substring(2),"%G":d=>F(d),"%H":d=>y(d.tm_hour,2),"%I":d=>{var m=d.tm_hour;return m==0?m=12:m>12&&(m-=12),y(m,2)},"%j":d=>y(d.tm_mday+Ma(Wt(d.tm_year+1900)?Je:Ke,d.tm_mon-1),3),"%m":d=>y(d.tm_mon+1,2),"%M":d=>y(d.tm_min,2),"%n":()=>`
|
|
3
|
+
`,"%p":d=>d.tm_hour>=0&&d.tm_hour<12?"AM":"PM","%S":d=>y(d.tm_sec,2),"%t":()=>" ","%u":d=>d.tm_wday||7,"%U":d=>{var m=d.tm_yday+7-d.tm_wday;return y(Math.floor(m/7),2)},"%V":d=>{var m=Math.floor((d.tm_yday+7-(d.tm_wday+6)%7)/7);if((d.tm_wday+371-d.tm_yday-2)%7<=2&&m++,m){if(m==53){var x=(d.tm_wday+371-d.tm_yday)%7;x!=4&&(x!=3||!Wt(d.tm_year))&&(m=1)}}else{m=52;var j=(d.tm_wday+7-d.tm_yday-1)%7;(j==4||j==5&&Wt(d.tm_year%400-1))&&m++}return y(m,2)},"%w":d=>d.tm_wday,"%W":d=>{var m=d.tm_yday+7-(d.tm_wday+6)%7;return y(Math.floor(m/7),2)},"%y":d=>(d.tm_year+1900).toString().substring(2),"%Y":d=>d.tm_year+1900,"%z":d=>{var m=d.tm_gmtoff,x=m>=0;return m=Math.abs(m)/60,m=m/60*100+m%60,(x?"+":"-")+("0000"+m).slice(-4)},"%Z":d=>d.tm_zone,"%%":()=>"%"};s=s.replace(/%%/g,"\0\0");for(var l in T)s.includes(l)&&(s=s.replace(new RegExp(l,"g"),T[l](o)));s=s.replace(/\0\0/g,"%");var W=Ia(s,!1);return W.length>e?0:(Ra(W,t),W.length-1)},ka=(t,e,r,n,a)=>Wa(t,e,r,n);Me=c.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},ln(),ht=c.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},Cn(),gn(),Fn(),Le=c.UnboundTypeError=jn(Error,"UnboundTypeError"),Hn(),Un();var Ha={s:Jr,u:Kr,b:en,g:rn,q:nn,J:an,f:on,V:sn,d:tn,da:un,Q:cn,_:fn,ca:In,ba:Wn,w:kn,Y:Vn,x:Yn,h:zn,L:Gn,M:Xn,t:Qn,o:Zn,K:ta,C:sa,A:ua,ea:ca,$:la,R:da,ha:te,fa:pa,Z:wa,N:$a,O:ba,aa:Ca,B:Ta,X:_a,W:Aa,T:Fa,U:xa,E:eo,D:Ya,F:to,n:ro,a:Ba,e:Na,m:La,k:Xa,H:Ja,v:Qa,G:Ka,z:ao,P:io,l:Ga,j:za,c:Va,p:Ua,I:Za,r:no,i:qa,y:oo,ga:Sa,S:ka},M=Zr(),rt=c._free=t=>(rt=c._free=M.ka)(t),ie=c._malloc=t=>(ie=c._malloc=M.la)(t),tr=t=>(tr=M.na)(t),P=(t,e)=>(P=M.oa)(t,e),_t=t=>(_t=M.pa)(t),D=()=>(D=M.qa)(),O=t=>(O=M.ra)(t),er=t=>(er=M.sa)(t),rr=t=>(rr=M.ta)(t),nr=(t,e,r)=>(nr=M.ua)(t,e,r),ar=t=>(ar=M.va)(t);c.dynCall_viijii=(t,e,r,n,a,o,s)=>(c.dynCall_viijii=M.wa)(t,e,r,n,a,o,s);var or=c.dynCall_jiiii=(t,e,r,n,a)=>(or=c.dynCall_jiiii=M.xa)(t,e,r,n,a);c.dynCall_iiiiij=(t,e,r,n,a,o,s)=>(c.dynCall_iiiiij=M.ya)(t,e,r,n,a,o,s),c.dynCall_iiiiijj=(t,e,r,n,a,o,s,u,l)=>(c.dynCall_iiiiijj=M.za)(t,e,r,n,a,o,s,u,l),c.dynCall_iiiiiijj=(t,e,r,n,a,o,s,u,l,f)=>(c.dynCall_iiiiiijj=M.Aa)(t,e,r,n,a,o,s,u,l,f);function Ba(t,e){var r=D();try{return A(t)(e)}catch(n){if(O(r),n!==n+0)throw n;P(1,0)}}function Ua(t,e,r,n){var a=D();try{A(t)(e,r,n)}catch(o){if(O(a),o!==o+0)throw o;P(1,0)}}function Va(t,e,r){var n=D();try{A(t)(e,r)}catch(a){if(O(n),a!==a+0)throw a;P(1,0)}}function La(t,e,r,n){var a=D();try{return A(t)(e,r,n)}catch(o){if(O(a),o!==o+0)throw o;P(1,0)}}function Ya(t,e,r,n,a){var o=D();try{return A(t)(e,r,n,a)}catch(s){if(O(o),s!==s+0)throw s;P(1,0)}}function za(t,e){var r=D();try{A(t)(e)}catch(n){if(O(r),n!==n+0)throw n;P(1,0)}}function Na(t,e,r){var n=D();try{return A(t)(e,r)}catch(a){if(O(n),a!==a+0)throw a;P(1,0)}}function Ga(t){var e=D();try{A(t)()}catch(r){if(O(e),r!==r+0)throw r;P(1,0)}}function Xa(t,e,r,n,a){var o=D();try{return A(t)(e,r,n,a)}catch(s){if(O(o),s!==s+0)throw s;P(1,0)}}function qa(t,e,r,n,a,o,s,u,l,f,h){var v=D();try{A(t)(e,r,n,a,o,s,u,l,f,h)}catch(y){if(O(v),y!==y+0)throw y;P(1,0)}}function Qa(t,e,r,n,a,o,s){var u=D();try{return A(t)(e,r,n,a,o,s)}catch(l){if(O(u),l!==l+0)throw l;P(1,0)}}function Za(t,e,r,n,a){var o=D();try{A(t)(e,r,n,a)}catch(s){if(O(o),s!==s+0)throw s;P(1,0)}}function Ja(t,e,r,n,a,o){var s=D();try{return A(t)(e,r,n,a,o)}catch(u){if(O(s),u!==u+0)throw u;P(1,0)}}function Ka(t,e,r,n,a,o,s,u){var l=D();try{return A(t)(e,r,n,a,o,s,u)}catch(f){if(O(l),f!==f+0)throw f;P(1,0)}}function to(t,e,r,n){var a=D();try{return A(t)(e,r,n)}catch(o){if(O(a),o!==o+0)throw o;P(1,0)}}function eo(t,e,r,n){var a=D();try{return A(t)(e,r,n)}catch(o){if(O(a),o!==o+0)throw o;P(1,0)}}function ro(t){var e=D();try{return A(t)()}catch(r){if(O(e),r!==r+0)throw r;P(1,0)}}function no(t,e,r,n,a,o,s,u){var l=D();try{A(t)(e,r,n,a,o,s,u)}catch(f){if(O(l),f!==f+0)throw f;P(1,0)}}function ao(t,e,r,n,a,o,s,u,l,f,h,v){var y=D();try{return A(t)(e,r,n,a,o,s,u,l,f,h,v)}catch(w){if(O(y),w!==w+0)throw w;P(1,0)}}function oo(t,e,r,n,a,o,s,u,l,f,h,v,y,w,E,F){var T=D();try{A(t)(e,r,n,a,o,s,u,l,f,h,v,y,w,E,F)}catch(W){if(O(T),W!==W+0)throw W;P(1,0)}}function io(t,e,r,n,a){var o=D();try{return or(t,e,r,n,a)}catch(s){if(O(o),s!==s+0)throw s;P(1,0)}}var kt;yt=function t(){kt||ir(),kt||(yt=t)};function ir(){if(ot>0||(Br(),ot>0))return;function t(){kt||(kt=!0,c.calledRun=!0,!mt&&(Ur(),$(c),c.onRuntimeInitialized&&c.onRuntimeInitialized(),Vr()))}c.setStatus?(c.setStatus("Running..."),setTimeout(function(){setTimeout(function(){c.setStatus("")},1),t()},1)):t()}if(c.preInit)for(typeof c.preInit=="function"&&(c.preInit=[c.preInit]);c.preInit.length>0;)c.preInit.pop()();return ir(),p.ready}})();function Rr(i){return Ut(Pt,i)}function Wr(i){return Mr(Pt,i)}async function kr(i,p){return jr(Pt,i,p)}async function Hr(i,p){return Ir(Pt,i,p)}class Ce extends EventTarget{constructor(c={}){var $;super();lr(this,ct,void 0);try{const g=($=c==null?void 0:c.formats)==null?void 0:$.filter(b=>b!=="unknown");if((g==null?void 0:g.length)===0)throw new TypeError("Hint option provided, but is empty.");g==null||g.forEach(b=>{if(!nt.has(b))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${b}' is not a valid enum value of type BarcodeFormat.`)}),dr(this,ct,g!=null?g:[]),Rr().then(b=>{this.dispatchEvent(new CustomEvent("load",{detail:b}))}).catch(b=>{this.dispatchEvent(new CustomEvent("error",{detail:b}))})}catch(g){throw ye(g,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return z.filter(c=>c!=="unknown")}async detect(c){try{const $=await gr(c);if($===null)return[];let g;try{me($)?g=await kr($,{tryHarder:!0,formats:se(this,ct).map(b=>nt.get(b))}):g=await Hr($,{tryHarder:!0,formats:se(this,ct).map(b=>nt.get(b))})}catch(b){throw console.error(b),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return g.map(b=>{const{topLeft:{x:U,y:N},topRight:{x:V,y:S},bottomLeft:{x:G,y:Q},bottomRight:{x:L,y:K}}=b.position,at=Math.min(U,V,G,L),mt=Math.min(N,S,Q,K),Y=Math.max(U,V,G,L),k=Math.max(N,S,Q,K);return{boundingBox:new DOMRectReadOnly(at,mt,Y-at,k-mt),rawValue:b.text,format:fr(b.format),cornerPoints:[{x:U,y:N},{x:V,y:S},{x:L,y:K},{x:G,y:Q}]}})}catch($){throw ye($,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return ct=new WeakMap,(Te=globalThis.BarcodeDetector)!=null||(globalThis.BarcodeDetector=Ce),I.BarcodeDetector=Ce,I.setZXingModuleOverrides=Wr,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"}),I}({});
|
package/dist/iife/pure.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var BarcodeDetectionAPI=function(I){"use strict";var sr=(I,H,z)=>{if(!H.has(I))throw TypeError("Cannot "+z)};var oe=(I,H,z)=>(sr(I,H,"read from private field"),z?z.call(I):H.get(I)),ur=(I,H,z)=>{if(H.has(I))throw TypeError("Cannot add the same private member more than once");H instanceof WeakSet?H.add(I):H.set(I,z)},cr=(I,H,z,nt)=>(sr(I,H,"write to private field"),nt?nt.call(I,z):H.set(I,z),z);var ct;const H=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["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"]],z=[...H,["unknown"]].map(i=>i[0]),nt=new Map(H);function lr(i){for(const[f,u]of nt)if(i===u)return f;return"unknown"}function dr(i){if(ie(i))return{width:i.naturalWidth,height:i.naturalHeight};if(se(i))return{width:i.width.baseVal.value,height:i.height.baseVal.value};if(ue(i))return{width:i.videoWidth,height:i.videoHeight};if(le(i))return{width:i.width,height:i.height};if(he(i))return{width:i.displayWidth,height:i.displayHeight};if(ce(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 ie(i){try{return i instanceof HTMLImageElement}catch{return!1}}function se(i){try{return i instanceof SVGImageElement}catch{return!1}}function ue(i){try{return i instanceof HTMLVideoElement}catch{return!1}}function ce(i){try{return i instanceof HTMLCanvasElement}catch{return!1}}function le(i){try{return i instanceof ImageBitmap}catch{return!1}}function de(i){try{return i instanceof OffscreenCanvas}catch{return!1}}function he(i){try{return i instanceof VideoFrame}catch{return!1}}function fe(i){try{return i instanceof Blob}catch{return!1}}function hr(i){try{return i instanceof ImageData}catch{return!1}}function fr(i,f){try{const u=new OffscreenCanvas(i,f);if(u.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return u;throw void 0}catch{const u=document.createElement("canvas");return u.width=i,u.height=f,u}}async function pe(i){if(ie(i)&&!await vr(i))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(se(i)&&!await gr(i))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(he(i)&&wr(i))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(ue(i)&&(i.readyState===0||i.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(le(i)&&br(i))throw new DOMException("The image source is detached.","InvalidStateError");const{width:f,height:u}=dr(i);if(f===0||u===0)return null;const v=fr(f,u).getContext("2d");v.drawImage(i,0,0);try{return v.getImageData(0,0,f,u)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function pr(i){let f;try{if(globalThis.createImageBitmap)f=await createImageBitmap(i);else if(globalThis.Image){f=new Image;let w="";try{w=URL.createObjectURL(i),f.src=w,await f.decode()}finally{URL.revokeObjectURL(w)}}else return i}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await pe(f)}function mr(i){const{width:f,height:u}=i;if(f===0||u===0)return null;const w=i.getContext("2d");try{return w.getImageData(0,0,f,u)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function yr(i){if(fe(i))return await pr(i);if(hr(i)){if($r(i))throw new DOMException("The image data has been detached.","InvalidStateError");return i}return ce(i)||de(i)?mr(i):await pe(i)}async function vr(i){try{return await i.decode(),!0}catch{return!1}}async function gr(i){var f;try{return await((f=i.decode)==null?void 0:f.call(i)),!0}catch{return!1}}function wr(i){return i.format===null}function $r(i){return i.data.buffer.byteLength===0}function br(i){return i.width===0&&i.height===0}function me(i,f){return i instanceof DOMException?new DOMException(`${f}: ${i.message}`,i.name):i instanceof Error?new i.constructor(`${f}: ${i.message}`):new Error(`${f}: ${i}`)}const ye=["Aztec","Codabar","Code128","Code39","Code93","DataBar","DataBarExpanded","DataMatrix","DXFilmEdge","EAN-13","EAN-8","ITF","Linear-Codes","Matrix-Codes","MaxiCode","MicroQRCode","None","PDF417","QRCode","rMQRCode","UPC-A","UPC-E"];function Cr(i){return i.join("|")}function _r(i){const f=ve(i);let u=0,w=ye.length-1;for(;u<=w;){const v=Math.floor((u+w)/2),$=ye[v],U=ve($);if(U===f)return $;U<f?u=v+1:w=v-1}return"None"}function ve(i){return i.toLowerCase().replace(/_-\[\]/g,"")}function Tr(i,f){return i.Binarizer[f]}function Pr(i,f){return i.CharacterSet[f]}const Er=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function Ar(i){return Er[i.value]}function Dr(i,f){return i.EanAddOnSymbol[f]}function Or(i,f){return i.TextMode[f]}const pt={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,tryCode39ExtendedMode:!1,validateCode39CheckSum:!1,validateITFCheckSum:!1,returnCodabarStartEnd:!1,returnErrors:!1,eanAddOnSymbol:"Read",textMode:"Plain",characterSet:"Unknown"};function ge(i,f){return{...f,formats:Cr(f.formats),binarizer:Tr(i,f.binarizer),eanAddOnSymbol:Dr(i,f.eanAddOnSymbol),textMode:Or(i,f.textMode),characterSet:Pr(i,f.characterSet)}}const Fr={width:200,height:200,format:"QRCode",characterSet:"UTF8",eccLevel:-1,margin:10};function we(i){return{...i,format:_r(i.format),eccLevel:i.eccLevel,contentType:Ar(i.contentType)}}const Sr={locateFile:(i,f)=>{const u=i.match(/_(.+?)\.wasm$/);return u?`https://fastly.jsdelivr.net/npm/zxing-wasm@1.1.1/dist/${u[1]}/${i}`:f+i}};let Ht=new WeakMap;function Bt(i,f){var u;const w=Ht.get(i);if(w!=null&&w.modulePromise&&(f===void 0||Object.is(f,w.moduleOverrides)))return w.modulePromise;const v=(u=f!=null?f:w==null?void 0:w.moduleOverrides)!=null?u:Sr,$=i({...v});return Ht.set(i,{moduleOverrides:v,modulePromise:$}),$}function xr(i,f){Ht.set(i,{moduleOverrides:f})}async function Mr(i,f,u=pt){const w={...pt,...u},v=await Bt(i),{size:$}=f,U=new Uint8Array(await f.arrayBuffer()),N=v._malloc($);v.HEAPU8.set(U,N);const L=v.readBarcodesFromImage(N,$,ge(v,w));v._free(N);const D=[];for(let G=0;G<L.size();++G)D.push(we(L.get(G)));return D}async function Ir(i,f,u=pt){const w={...pt,...u},v=await Bt(i),{data:$,width:U,height:N,data:{byteLength:L}}=f,D=v._malloc(L);v.HEAPU8.set($,D);const G=v.readBarcodesFromPixmap(D,U,N,ge(v,w));v._free(D);const Q=[];for(let V=0;V<G.size();++V)Q.push(we(G.get(V)));return Q}structuredClone(pt),structuredClone(Fr);var Pt=(()=>{var i=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(f={}){var u=f,w,v;u.ready=new Promise((t,e)=>{w=t,v=e});var $=Object.assign({},u),U="./this.program",N=typeof window=="object",L=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var D="";function G(t){return u.locateFile?u.locateFile(t,D):D+t}var Q;(N||L)&&(L?D=self.location.href:typeof document<"u"&&document.currentScript&&(D=document.currentScript.src),i&&(D=i),D.indexOf("blob:")!==0?D=D.substr(0,D.replace(/[?#].*/,"").lastIndexOf("/")+1):D="",L&&(Q=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)})),u.print||console.log.bind(console);var V=u.printErr||console.error.bind(console);Object.assign(u,$),$=null,u.arguments&&u.arguments,u.thisProgram&&(U=u.thisProgram),u.quit&&u.quit;var K;u.wasmBinary&&(K=u.wasmBinary),typeof WebAssembly!="object"&>("no native wasm support detected");var at,mt=!1;function Ut(t,e){t||gt(e)}var Y,B,lt,yt,k,_,$e,be;function Ce(){var t=at.buffer;u.HEAP8=Y=new Int8Array(t),u.HEAP16=lt=new Int16Array(t),u.HEAPU8=B=new Uint8Array(t),u.HEAPU16=yt=new Uint16Array(t),u.HEAP32=k=new Int32Array(t),u.HEAPU32=_=new Uint32Array(t),u.HEAPF32=$e=new Float32Array(t),u.HEAPF64=be=new Float64Array(t)}var _e=[],Te=[],Pe=[];function Br(){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)Vr(u.preRun.shift());Lt(_e)}function Ur(){Lt(Te)}function Lr(){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)zr(u.postRun.shift());Lt(Pe)}function Vr(t){_e.unshift(t)}function Yr(t){Te.unshift(t)}function zr(t){Pe.unshift(t)}var ot=0,vt=null;function Nr(t){ot++,u.monitorRunDependencies&&u.monitorRunDependencies(ot)}function Gr(t){if(ot--,u.monitorRunDependencies&&u.monitorRunDependencies(ot),ot==0&&vt){var e=vt;vt=null,e()}}function gt(t){u.onAbort&&u.onAbort(t),t="Aborted("+t+")",V(t),mt=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw v(e),e}var Xr="data:application/octet-stream;base64,",Ee=t=>t.startsWith(Xr),dt;dt="zxing_reader.wasm",Ee(dt)||(dt=G(dt));function Ae(t){if(t==dt&&K)return new Uint8Array(K);if(Q)return Q(t);throw"both async and sync fetching of the wasm failed"}function qr(t){return!K&&(N||L)&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(e=>{if(!e.ok)throw"failed to load wasm binary file at '"+t+"'";return e.arrayBuffer()}).catch(()=>Ae(t)):Promise.resolve().then(()=>Ae(t))}function De(t,e,r){return qr(t).then(n=>WebAssembly.instantiate(n,e)).then(n=>n).then(r,n=>{V(`failed to asynchronously prepare wasm: ${n}`),gt(n)})}function Qr(t,e,r,n){return!t&&typeof WebAssembly.instantiateStreaming=="function"&&!Ee(e)&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(a=>{var o=WebAssembly.instantiateStreaming(a,r);return o.then(n,function(s){return V(`wasm streaming compile failed: ${s}`),V("falling back to ArrayBuffer instantiation"),De(e,r,n)})}):De(e,r,n)}function Zr(){var t={a:xa};function e(n,a){return E=n.exports,at=E.fa,Ce(),Be=E.ja,Yr(E.ga),Gr(),E}Nr();function r(n){e(n.instance)}if(u.instantiateWasm)try{return u.instantiateWasm(t,e)}catch(n){V(`Module.instantiateWasm callback failed with error: ${n}`),v(n)}return Qr(K,dt,t,r).catch(v),{}}var Lt=t=>{for(;t.length>0;)t.shift()(u)};u.noExitRuntime;var Et=[],At=0,Jr=t=>{var e=new Vt(t);return e.get_caught()||(e.set_caught(!0),At--),e.set_rethrown(!1),Et.push(e),rr(e.excPtr),e.get_exception_ptr()},tt=0,Kr=()=>{A(0,0);var t=Et.pop();er(t.excPtr),tt=0};function Vt(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(e){_[this.ptr+4>>2]=e},this.get_type=function(){return _[this.ptr+4>>2]},this.set_destructor=function(e){_[this.ptr+8>>2]=e},this.get_destructor=function(){return _[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,Y[this.ptr+12>>0]=e},this.get_caught=function(){return Y[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,Y[this.ptr+13>>0]=e},this.get_rethrown=function(){return Y[this.ptr+13>>0]!=0},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)},this.set_adjusted_ptr=function(e){_[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return _[this.ptr+16>>2]},this.get_exception_ptr=function(){var e=ar(this.get_type());if(e)return _[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr}}var tn=t=>{throw tt||(tt=t),tt},Yt=t=>{var e=tt;if(!e)return Tt(0),0;var r=new Vt(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return Tt(0),e;for(var a in t){var o=t[a];if(o===0||o===n)break;var s=r.ptr+16;if(nr(o,n,s))return Tt(o),e}return Tt(n),e},en=()=>Yt([]),rn=t=>Yt([t]),nn=(t,e)=>Yt([t,e]),an=()=>{var t=Et.pop();t||gt("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||(Et.push(t),t.set_rethrown(!0),t.set_caught(!1),At++),tt=e,tt},on=(t,e,r)=>{var n=new Vt(t);throw n.init(e,r),tt=t,At++,tt},sn=()=>At,Dt={},Oe=t=>{for(;t.length;){var e=t.pop(),r=t.pop();r(e)}};function zt(t){return this.fromWireType(k[t>>2])}var ht={},it={},Ot={},Fe,Ft=t=>{throw new Fe(t)},st=(t,e,r)=>{t.forEach(function(c){Ot[c]=e});function n(c){var l=r(c);l.length!==t.length&&Ft("Mismatched type converter count");for(var h=0;h<t.length;++h)Z(t[h],l[h])}var a=new Array(e.length),o=[],s=0;e.forEach((c,l)=>{it.hasOwnProperty(c)?a[l]=it[c]:(o.push(c),ht.hasOwnProperty(c)||(ht[c]=[]),ht[c].push(()=>{a[l]=it[c],++s,s===o.length&&n(a)}))}),o.length===0&&n(a)},un=t=>{var e=Dt[t];delete Dt[t];var r=e.rawConstructor,n=e.rawDestructor,a=e.fields,o=a.map(s=>s.getterReturnType).concat(a.map(s=>s.setterArgumentType));st([t],o,s=>{var c={};return a.forEach((l,h)=>{var p=l.fieldName,y=s[h],g=l.getter,b=l.getterContext,T=s[h+a.length],R=l.setter,P=l.setterContext;c[p]={read:W=>y.fromWireType(g(b,W)),write:(W,d)=>{var m=[];R(P,W,T.toWireType(m,d)),Oe(m)}}}),[{name:e.name,fromWireType:l=>{var h={};for(var p in c)h[p]=c[p].read(l);return n(l),h},toWireType:(l,h)=>{for(var p in c)if(!(p in h))throw new TypeError(`Missing field: "${p}"`);var y=r();for(p in c)c[p].write(y,h[p]);return l!==null&&l.push(n,y),y},argPackAdvance:J,readValueFromPointer:zt,destructorFunction:n}]})},cn=(t,e,r,n,a)=>{},ln=()=>{for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);Se=t},Se,j=t=>{for(var e="",r=t;B[r];)e+=Se[B[r++]];return e},ft,C=t=>{throw new ft(t)};function dn(t,e,r={}){var n=e.name;if(t||C(`type "${n}" must have a positive integer typeid pointer`),it.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;C(`Cannot register type '${n}' twice`)}if(it[t]=e,delete Ot[t],ht.hasOwnProperty(t)){var a=ht[t];delete ht[t],a.forEach(o=>o())}}function Z(t,e,r={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return dn(t,e,r)}var J=8,hn=(t,e,r,n)=>{e=j(e),Z(t,{name:e,fromWireType:function(a){return!!a},toWireType:function(a,o){return o?r:n},argPackAdvance:J,readValueFromPointer:function(a){return this.fromWireType(B[a])},destructorFunction:null})},fn=t=>({count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}),Nt=t=>{function e(r){return r.$$.ptrType.registeredClass.name}C(e(t)+" instance already deleted")},Gt=!1,xe=t=>{},pn=t=>{t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)},Me=t=>{t.count.value-=1;var e=t.count.value===0;e&&pn(t)},Ie=(t,e,r)=>{if(e===r)return t;if(r.baseClass===void 0)return null;var n=Ie(t,e,r.baseClass);return n===null?null:r.downcast(n)},je={},mn=()=>Object.keys(bt).length,yn=()=>{var t=[];for(var e in bt)bt.hasOwnProperty(e)&&t.push(bt[e]);return t},wt=[],Xt=()=>{for(;wt.length;){var t=wt.pop();t.$$.deleteScheduled=!1,t.delete()}},$t,vn=t=>{$t=t,wt.length&&$t&&$t(Xt)},gn=()=>{u.getInheritedInstanceCount=mn,u.getLiveInheritedInstances=yn,u.flushPendingDeletes=Xt,u.setDelayFunction=vn},bt={},wn=(t,e)=>{for(e===void 0&&C("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e},$n=(t,e)=>(e=wn(t,e),bt[e]),St=(t,e)=>{(!e.ptrType||!e.ptr)&&Ft("makeClassHandle requires ptr and ptrType");var r=!!e.smartPtrType,n=!!e.smartPtr;return r!==n&&Ft("Both smartPtrType and smartPtr must be specified"),e.count={value:1},Ct(Object.create(t,{$$:{value:e}}))};function bn(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=$n(this.registeredClass,e);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=e,r.$$.smartPtr=t,r.clone();var n=r.clone();return this.destructor(t),n}function a(){return this.isSmartPointer?St(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):St(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var o=this.registeredClass.getActualType(e),s=je[o];if(!s)return a.call(this);var c;this.isConst?c=s.constPointerType:c=s.pointerType;var l=Ie(e,this.registeredClass,c.registeredClass);return l===null?a.call(this):this.isSmartPointer?St(c.registeredClass.instancePrototype,{ptrType:c,ptr:l,smartPtrType:this,smartPtr:t}):St(c.registeredClass.instancePrototype,{ptrType:c,ptr:l})}var Ct=t=>typeof FinalizationRegistry>"u"?(Ct=e=>e,t):(Gt=new FinalizationRegistry(e=>{Me(e.$$)}),Ct=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var a={$$:r};Gt.register(e,a,e)}return e},xe=e=>Gt.unregister(e),Ct(t)),Cn=()=>{Object.assign(xt.prototype,{isAliasOf(t){if(!(this instanceof xt)||!(t instanceof xt))return!1;var e=this.$$.ptrType.registeredClass,r=this.$$.ptr;t.$$=t.$$;for(var n=t.$$.ptrType.registeredClass,a=t.$$.ptr;e.baseClass;)r=e.upcast(r),e=e.baseClass;for(;n.baseClass;)a=n.upcast(a),n=n.baseClass;return e===n&&r===a},clone(){if(this.$$.ptr||Nt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=Ct(Object.create(Object.getPrototypeOf(this),{$$:{value:fn(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},delete(){this.$$.ptr||Nt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&C("Object already scheduled for deletion"),xe(this),Me(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Nt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&C("Object already scheduled for deletion"),wt.push(this),wt.length===1&&$t&&$t(Xt),this.$$.deleteScheduled=!0,this}})};function xt(){}var _n=48,Tn=57,Re=t=>{if(t===void 0)return"_unknown";t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return e>=_n&&e<=Tn?`_${t}`:t};function qt(t,e){return t=Re(t),{[t]:function(){return e.apply(this,arguments)}}[t]}var We=(t,e,r)=>{if(t[e].overloadTable===void 0){var n=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||C(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${t[e].overloadTable})!`),t[e].overloadTable[arguments.length].apply(this,arguments)},t[e].overloadTable=[],t[e].overloadTable[n.argCount]=n}},Qt=(t,e,r)=>{u.hasOwnProperty(t)?((r===void 0||u[t].overloadTable!==void 0&&u[t].overloadTable[r]!==void 0)&&C(`Cannot register public name '${t}' twice`),We(u,t,t),u.hasOwnProperty(r)&&C(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),u[t].overloadTable[r]=e):(u[t]=e,r!==void 0&&(u[t].numArguments=r))};function Pn(t,e,r,n,a,o,s,c){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=s,this.downcast=c,this.pureVirtualFunctions=[]}var Zt=(t,e,r)=>{for(;e!==r;)e.upcast||C(`Expected null or instance of ${r.name}, got an instance of ${e.name}`),t=e.upcast(t),e=e.baseClass;return t};function En(t,e){if(e===null)return this.isReference&&C(`null is not a valid ${this.name}`),0;e.$$||C(`Cannot pass "${ee(e)}" as a ${this.name}`),e.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=Zt(e.$$.ptr,r,this.registeredClass);return n}function An(t,e){var r;if(e===null)return this.isReference&&C(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),t!==null&&t.push(this.rawDestructor,r),r):0;e.$$||C(`Cannot pass "${ee(e)}" as a ${this.name}`),e.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&e.$$.ptrType.isConst&&C(`Cannot convert argument of type ${e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name} to parameter type ${this.name}`);var n=e.$$.ptrType.registeredClass;if(r=Zt(e.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(e.$$.smartPtr===void 0&&C("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:C(`Cannot convert argument of type ${e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=e.$$.smartPtr;break;case 2:if(e.$$.smartPtrType===this)r=e.$$.smartPtr;else{var a=e.clone();r=this.rawShare(r,rt.toHandle(()=>a.delete())),t!==null&&t.push(this.rawDestructor,r)}break;default:C("Unsupporting sharing policy")}return r}function Dn(t,e){if(e===null)return this.isReference&&C(`null is not a valid ${this.name}`),0;e.$$||C(`Cannot pass "${ee(e)}" as a ${this.name}`),e.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`),e.$$.ptrType.isConst&&C(`Cannot convert argument of type ${e.$$.ptrType.name} to parameter type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=Zt(e.$$.ptr,r,this.registeredClass);return n}function ke(t){return this.fromWireType(_[t>>2])}var On=()=>{Object.assign(Mt.prototype,{getPointee(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t},destructor(t){this.rawDestructor&&this.rawDestructor(t)},argPackAdvance:J,readValueFromPointer:ke,deleteObject(t){t!==null&&t.delete()},fromWireType:bn})};function Mt(t,e,r,n,a,o,s,c,l,h,p){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=s,this.rawGetPointee=c,this.rawConstructor=l,this.rawShare=h,this.rawDestructor=p,!a&&e.baseClass===void 0?n?(this.toWireType=En,this.destructorFunction=null):(this.toWireType=Dn,this.destructorFunction=null):this.toWireType=An}var He=(t,e,r)=>{u.hasOwnProperty(t)||Ft("Replacing nonexistant public symbol"),u[t].overloadTable!==void 0&&r!==void 0?u[t].overloadTable[r]=e:(u[t]=e,u[t].argCount=r)},Fn=(t,e,r)=>{var n=u["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)},It=[],Be,O=t=>{var e=It[t];return e||(t>=It.length&&(It.length=t+1),It[t]=e=Be.get(t)),e},Sn=(t,e,r)=>{if(t.includes("j"))return Fn(t,e,r);var n=O(e).apply(null,r);return n},xn=(t,e)=>{var r=[];return function(){return r.length=0,Object.assign(r,arguments),Sn(t,e,r)}},q=(t,e)=>{t=j(t);function r(){return t.includes("j")?xn(t,e):O(e)}var n=r();return typeof n!="function"&&C(`unknown function pointer with signature ${t}: ${e}`),n},Mn=(t,e)=>{var r=qt(e,function(n){this.name=e,this.message=n;var a=new Error(n).stack;a!==void 0&&(this.stack=this.toString()+`
|
|
2
|
-
`+a.replace(/^Error(:[^\n]*)?\n/,""))});return r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},r},Ue,Le=t=>{var e=tr(t),r=j(e);return et(e),r},jt=(t,e)=>{var r=[],n={};function a(o){if(!n[o]&&!it[o]){if(Ot[o]){Ot[o].forEach(a);return}r.push(o),n[o]=!0}}throw e.forEach(a),new Ue(`${t}: `+r.map(Le).join([", "]))},In=(t,e,r,n,a,o,s,c,l,h,p,y,g)=>{p=j(p),o=q(a,o),c&&(c=q(s,c)),h&&(h=q(l,h)),g=q(y,g);var b=Re(p);Qt(b,function(){jt(`Cannot construct ${p} due to unbound types`,[n])}),st([t,e,r],n?[n]:[],function(T){T=T[0];var R,P;n?(R=T.registeredClass,P=R.instancePrototype):P=xt.prototype;var W=qt(b,function(){if(Object.getPrototypeOf(this)!==d)throw new ft("Use 'new' to construct "+p);if(m.constructor_body===void 0)throw new ft(p+" has no accessible constructor");var kt=m.constructor_body[arguments.length];if(kt===void 0)throw new ft(`Tried to invoke ctor of ${p} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(m.constructor_body).toString()}) parameters instead!`);return kt.apply(this,arguments)}),d=Object.create(P,{constructor:{value:W}});W.prototype=d;var m=new Pn(p,W,d,g,R,o,c,h);m.baseClass&&(m.baseClass.__derivedClasses===void 0&&(m.baseClass.__derivedClasses=[]),m.baseClass.__derivedClasses.push(m));var x=new Mt(p,m,!0,!1,!1),M=new Mt(p+"*",m,!1,!1,!1),ut=new Mt(p+" const*",m,!1,!0,!1);return je[t]={pointerType:M,constPointerType:ut},He(b,W),[x,M,ut]})},Jt=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(_[e+n*4>>2]);return r};function Kt(t,e,r,n,a,o){var s=e.length;s<2&&C("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var c=e[1]!==null&&r!==null,l=!1,h=1;h<e.length;++h)if(e[h]!==null&&e[h].destructorFunction===void 0){l=!0;break}var p=e[0].name!=="void",y=s-2,g=new Array(y),b=[],T=[];return function(){arguments.length!==y&&C(`function ${t} called with ${arguments.length} arguments, expected ${y}`),T.length=0;var R;b.length=c?2:1,b[0]=a,c&&(R=e[1].toWireType(T,this),b[1]=R);for(var P=0;P<y;++P)g[P]=e[P+2].toWireType(T,arguments[P]),b.push(g[P]);var W=n.apply(null,b);function d(m){if(l)Oe(T);else for(var x=c?1:2;x<e.length;x++){var M=x===1?R:g[x-2];e[x].destructorFunction!==null&&e[x].destructorFunction(M)}if(p)return e[0].fromWireType(m)}return d(W)}}var jn=(t,e,r,n,a,o)=>{var s=Jt(e,r);a=q(n,a),st([],[t],function(c){c=c[0];var l=`constructor ${c.name}`;if(c.registeredClass.constructor_body===void 0&&(c.registeredClass.constructor_body=[]),c.registeredClass.constructor_body[e-1]!==void 0)throw new ft(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${c.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return c.registeredClass.constructor_body[e-1]=()=>{jt(`Cannot construct ${c.name} due to unbound types`,s)},st([],s,h=>(h.splice(1,0,null),c.registeredClass.constructor_body[e-1]=Kt(l,h,null,a,o),[])),[]})},Ve=t=>{t=t.trim();const e=t.indexOf("(");return e!==-1?(Ut(t[t.length-1]==")","Parentheses for argument names should match."),t.substr(0,e)):t},Rn=(t,e,r,n,a,o,s,c,l)=>{var h=Jt(r,n);e=j(e),e=Ve(e),o=q(a,o),st([],[t],function(p){p=p[0];var y=`${p.name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),c&&p.registeredClass.pureVirtualFunctions.push(e);function g(){jt(`Cannot call ${y} due to unbound types`,h)}var b=p.registeredClass.instancePrototype,T=b[e];return T===void 0||T.overloadTable===void 0&&T.className!==p.name&&T.argCount===r-2?(g.argCount=r-2,g.className=p.name,b[e]=g):(We(b,e,y),b[e].overloadTable[r-2]=g),st([],h,function(R){var P=Kt(y,R,p,o,s);return b[e].overloadTable===void 0?(P.argCount=r-2,b[e]=P):b[e].overloadTable[r-2]=P,[]}),[]})};function Wn(){Object.assign(Ye.prototype,{get(t){return this.allocated[t]},has(t){return this.allocated[t]!==void 0},allocate(t){var e=this.freelist.pop()||this.allocated.length;return this.allocated[e]=t,e},free(t){this.allocated[t]=void 0,this.freelist.push(t)}})}function Ye(){this.allocated=[void 0],this.freelist=[]}var X=new Ye,ze=t=>{t>=X.reserved&&--X.get(t).refcount===0&&X.free(t)},kn=()=>{for(var t=0,e=X.reserved;e<X.allocated.length;++e)X.allocated[e]!==void 0&&++t;return t},Hn=()=>{X.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),X.reserved=X.allocated.length,u.count_emval_handles=kn},rt={toValue:t=>(t||C("Cannot use deleted val. handle = "+t),X.get(t).value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return X.allocate({refcount:1,value:t})}}},Bn=(t,e)=>{e=j(e),Z(t,{name:e,fromWireType:r=>{var n=rt.toValue(r);return ze(r),n},toWireType:(r,n)=>rt.toHandle(n),argPackAdvance:J,readValueFromPointer:zt,destructorFunction:null})},Un=(t,e,r)=>{switch(e){case 1:return r?function(n){return this.fromWireType(Y[n>>0])}:function(n){return this.fromWireType(B[n>>0])};case 2:return r?function(n){return this.fromWireType(lt[n>>1])}:function(n){return this.fromWireType(yt[n>>1])};case 4:return r?function(n){return this.fromWireType(k[n>>2])}:function(n){return this.fromWireType(_[n>>2])};default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},Ln=(t,e,r,n)=>{e=j(e);function a(){}a.values={},Z(t,{name:e,constructor:a,fromWireType:function(o){return this.constructor.values[o]},toWireType:(o,s)=>s.value,argPackAdvance:J,readValueFromPointer:Un(e,r,n),destructorFunction:null}),Qt(e,a)},te=(t,e)=>{var r=it[t];return r===void 0&&C(e+" has unknown type "+Le(t)),r},Vn=(t,e,r)=>{var n=te(t,"enum");e=j(e);var a=n.constructor,o=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:qt(`${n.name}_${e}`,function(){})}});a.values[r]=o,a[e]=o},ee=t=>{if(t===null)return"null";var e=typeof t;return e==="object"||e==="array"||e==="function"?t.toString():""+t},Yn=(t,e)=>{switch(e){case 4:return function(r){return this.fromWireType($e[r>>2])};case 8:return function(r){return this.fromWireType(be[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},zn=(t,e,r)=>{e=j(e),Z(t,{name:e,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:J,readValueFromPointer:Yn(e,r),destructorFunction:null})},Nn=(t,e,r,n,a,o,s)=>{var c=Jt(e,r);t=j(t),t=Ve(t),a=q(n,a),Qt(t,function(){jt(`Cannot call ${t} due to unbound types`,c)},e-1),st([],c,function(l){var h=[l[0],null].concat(l.slice(1));return He(t,Kt(t,h,null,a,o),e-1),[]})},Gn=(t,e,r)=>{switch(e){case 1:return r?n=>Y[n>>0]:n=>B[n>>0];case 2:return r?n=>lt[n>>1]:n=>yt[n>>1];case 4:return r?n=>k[n>>2]:n=>_[n>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},Xn=(t,e,r,n,a)=>{e=j(e);var o=p=>p;if(n===0){var s=32-8*r;o=p=>p<<s>>>s}var c=e.includes("unsigned"),l=(p,y)=>{},h;c?h=function(p,y){return l(y,this.name),y>>>0}:h=function(p,y){return l(y,this.name),y},Z(t,{name:e,fromWireType:o,toWireType:h,argPackAdvance:J,readValueFromPointer:Gn(e,r,n!==0),destructorFunction:null})},qn=(t,e,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[e];function o(s){var c=_[s>>2],l=_[s+4>>2];return new a(Y.buffer,l,c)}r=j(r),Z(t,{name:r,fromWireType:o,argPackAdvance:J,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Ne=(t,e,r,n)=>{if(!(n>0))return 0;for(var a=r,o=r+n-1,s=0;s<t.length;++s){var c=t.charCodeAt(s);if(c>=55296&&c<=57343){var l=t.charCodeAt(++s);c=65536+((c&1023)<<10)|l&1023}if(c<=127){if(r>=o)break;e[r++]=c}else if(c<=2047){if(r+1>=o)break;e[r++]=192|c>>6,e[r++]=128|c&63}else if(c<=65535){if(r+2>=o)break;e[r++]=224|c>>12,e[r++]=128|c>>6&63,e[r++]=128|c&63}else{if(r+3>=o)break;e[r++]=240|c>>18,e[r++]=128|c>>12&63,e[r++]=128|c>>6&63,e[r++]=128|c&63}}return e[r]=0,r-a},Qn=(t,e,r)=>Ne(t,B,e,r),Ge=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++r):e+=3}return e},Xe=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,Zn=(t,e,r)=>{for(var n=e+r,a=e;t[a]&&!(a>=n);)++a;if(a-e>16&&t.buffer&&Xe)return Xe.decode(t.subarray(e,a));for(var o="";e<a;){var s=t[e++];if(!(s&128)){o+=String.fromCharCode(s);continue}var c=t[e++]&63;if((s&224)==192){o+=String.fromCharCode((s&31)<<6|c);continue}var l=t[e++]&63;if((s&240)==224?s=(s&15)<<12|c<<6|l:s=(s&7)<<18|c<<12|l<<6|t[e++]&63,s<65536)o+=String.fromCharCode(s);else{var h=s-65536;o+=String.fromCharCode(55296|h>>10,56320|h&1023)}}return o},re=(t,e)=>t?Zn(B,t,e):"",Jn=(t,e)=>{e=j(e);var r=e==="std::string";Z(t,{name:e,fromWireType(n){var a=_[n>>2],o=n+4,s;if(r)for(var c=o,l=0;l<=a;++l){var h=o+l;if(l==a||B[h]==0){var p=h-c,y=re(c,p);s===void 0?s=y:(s+="\0",s+=y),c=h+1}}else{for(var g=new Array(a),l=0;l<a;++l)g[l]=String.fromCharCode(B[o+l]);s=g.join("")}return et(n),s},toWireType(n,a){a instanceof ArrayBuffer&&(a=new Uint8Array(a));var o,s=typeof a=="string";s||a instanceof Uint8Array||a instanceof Uint8ClampedArray||a instanceof Int8Array||C("Cannot pass non-string to std::string"),r&&s?o=Ge(a):o=a.length;var c=ae(4+o+1),l=c+4;if(_[c>>2]=o,r&&s)Qn(a,l,o+1);else if(s)for(var h=0;h<o;++h){var p=a.charCodeAt(h);p>255&&(et(l),C("String has UTF-16 code units that do not fit in 8 bits")),B[l+h]=p}else for(var h=0;h<o;++h)B[l+h]=a[h];return n!==null&&n.push(et,c),c},argPackAdvance:J,readValueFromPointer:ke,destructorFunction(n){et(n)}})},qe=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Kn=(t,e)=>{for(var r=t,n=r>>1,a=n+e/2;!(n>=a)&&yt[n];)++n;if(r=n<<1,r-t>32&&qe)return qe.decode(B.subarray(t,r));for(var o="",s=0;!(s>=e/2);++s){var c=lt[t+s*2>>1];if(c==0)break;o+=String.fromCharCode(c)}return o},ta=(t,e,r)=>{if(r===void 0&&(r=2147483647),r<2)return 0;r-=2;for(var n=e,a=r<t.length*2?r/2:t.length,o=0;o<a;++o){var s=t.charCodeAt(o);lt[e>>1]=s,e+=2}return lt[e>>1]=0,e-n},ea=t=>t.length*2,ra=(t,e)=>{for(var r=0,n="";!(r>=e/4);){var a=k[t+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},na=(t,e,r)=>{if(r===void 0&&(r=2147483647),r<4)return 0;for(var n=e,a=n+r-4,o=0;o<t.length;++o){var s=t.charCodeAt(o);if(s>=55296&&s<=57343){var c=t.charCodeAt(++o);s=65536+((s&1023)<<10)|c&1023}if(k[e>>2]=s,e+=4,e+4>a)break}return k[e>>2]=0,e-n},aa=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n>=55296&&n<=57343&&++r,e+=4}return e},oa=(t,e,r)=>{r=j(r);var n,a,o,s,c;e===2?(n=Kn,a=ta,s=ea,o=()=>yt,c=1):e===4&&(n=ra,a=na,s=aa,o=()=>_,c=2),Z(t,{name:r,fromWireType:l=>{for(var h=_[l>>2],p=o(),y,g=l+4,b=0;b<=h;++b){var T=l+4+b*e;if(b==h||p[T>>c]==0){var R=T-g,P=n(g,R);y===void 0?y=P:(y+="\0",y+=P),g=T+e}}return et(l),y},toWireType:(l,h)=>{typeof h!="string"&&C(`Cannot pass non-string to C++ string type ${r}`);var p=s(h),y=ae(4+p+e);return _[y>>2]=p>>c,a(h,y+4,p+e),l!==null&&l.push(et,y),y},argPackAdvance:J,readValueFromPointer:zt,destructorFunction(l){et(l)}})},ia=(t,e,r,n,a,o)=>{Dt[t]={name:j(e),rawConstructor:q(r,n),rawDestructor:q(a,o),fields:[]}},sa=(t,e,r,n,a,o,s,c,l,h)=>{Dt[t].fields.push({fieldName:j(e),getterReturnType:r,getter:q(n,a),getterContext:o,setterArgumentType:s,setter:q(c,l),setterContext:h})},ua=(t,e)=>{e=j(e),Z(t,{isVoid:!0,name:e,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})},ca={},la=t=>{var e=ca[t];return e===void 0?j(t):e},Qe=()=>{if(typeof globalThis=="object")return globalThis;function t(e){e.$$$embind_global$$$=e;var r=typeof $$$embind_global$$$=="object"&&e.$$$embind_global$$$==e;return r||delete e.$$$embind_global$$$,r}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&t(global)?$$$embind_global$$$=global:typeof self=="object"&&t(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},da=t=>t===0?rt.toHandle(Qe()):(t=la(t),rt.toHandle(Qe()[t])),ha=t=>{t>4&&(X.get(t).refcount+=1)},fa=t=>{var e=new Array(t+1);return function(r,n,a){e[0]=r;for(var o=0;o<t;++o){var s=te(_[n+o*4>>2],"parameter "+o);e[o+1]=s.readValueFromPointer(a),a+=s.argPackAdvance}var c=new(r.bind.apply(r,e));return rt.toHandle(c)}},Ze={},pa=(t,e,r,n)=>{t=rt.toValue(t);var a=Ze[e];return a||(a=fa(e),Ze[e]=a),a(t,r,n)},ma=(t,e)=>{t=te(t,"_emval_take_value");var r=t.readValueFromPointer(e);return rt.toHandle(r)},ya=()=>{gt("")},va=(t,e,r)=>B.copyWithin(t,e,e+r),ga=()=>2147483648,wa=t=>{var e=at.buffer,r=(t-e.byteLength+65535)/65536;try{return at.grow(r),Ce(),1}catch{}},$a=t=>{var e=B.length;t>>>=0;var r=ga();if(t>r)return!1;for(var n=(l,h)=>l+(h-l%h)%h,a=1;a<=4;a*=2){var o=e*(1+.2/a);o=Math.min(o,t+100663296);var s=Math.min(r,n(Math.max(t,o),65536)),c=wa(s);if(c)return!0}return!1},ne={},ba=()=>U||"./this.program",_t=()=>{if(!_t.strings){var t=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:t,_:ba()};for(var r in ne)ne[r]===void 0?delete e[r]:e[r]=ne[r];var n=[];for(var r in e)n.push(`${r}=${e[r]}`);_t.strings=n}return _t.strings},Ca=(t,e)=>{for(var r=0;r<t.length;++r)Y[e++>>0]=t.charCodeAt(r);Y[e>>0]=0},_a=(t,e)=>{var r=0;return _t().forEach((n,a)=>{var o=e+r;_[t+a*4>>2]=o,Ca(n,o),r+=n.length+1}),0},Ta=(t,e)=>{var r=_t();_[t>>2]=r.length;var n=0;return r.forEach(a=>n+=a.length+1),_[e>>2]=n,0},Pa=t=>t,Rt=t=>t%4===0&&(t%100!==0||t%400===0),Ea=(t,e)=>{for(var r=0,n=0;n<=e;r+=t[n++]);return r},Je=[31,29,31,30,31,30,31,31,30,31,30,31],Ke=[31,28,31,30,31,30,31,31,30,31,30,31],Aa=(t,e)=>{for(var r=new Date(t.getTime());e>0;){var n=Rt(r.getFullYear()),a=r.getMonth(),o=(n?Je:Ke)[a];if(e>o-r.getDate())e-=o-r.getDate()+1,r.setDate(1),a<11?r.setMonth(a+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1));else return r.setDate(r.getDate()+e),r}return r};function Da(t,e,r){var n=r>0?r:Ge(t)+1,a=new Array(n),o=Ne(t,a,0,a.length);return e&&(a.length=o),a}var Oa=(t,e)=>{Y.set(t,e)},Fa=(t,e,r,n)=>{var a=_[n+40>>2],o={tm_sec:k[n>>2],tm_min:k[n+4>>2],tm_hour:k[n+8>>2],tm_mday:k[n+12>>2],tm_mon:k[n+16>>2],tm_year:k[n+20>>2],tm_wday:k[n+24>>2],tm_yday:k[n+28>>2],tm_isdst:k[n+32>>2],tm_gmtoff:k[n+36>>2],tm_zone:a?re(a):""},s=re(r),c={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var l in c)s=s.replace(new RegExp(l,"g"),c[l]);var h=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],p=["January","February","March","April","May","June","July","August","September","October","November","December"];function y(d,m,x){for(var M=typeof d=="number"?d.toString():d||"";M.length<m;)M=x[0]+M;return M}function g(d,m){return y(d,m,"0")}function b(d,m){function x(ut){return ut<0?-1:ut>0?1:0}var M;return(M=x(d.getFullYear()-m.getFullYear()))===0&&(M=x(d.getMonth()-m.getMonth()))===0&&(M=x(d.getDate()-m.getDate())),M}function T(d){switch(d.getDay()){case 0:return new Date(d.getFullYear()-1,11,29);case 1:return d;case 2:return new Date(d.getFullYear(),0,3);case 3:return new Date(d.getFullYear(),0,2);case 4:return new Date(d.getFullYear(),0,1);case 5:return new Date(d.getFullYear()-1,11,31);case 6:return new Date(d.getFullYear()-1,11,30)}}function R(d){var m=Aa(new Date(d.tm_year+1900,0,1),d.tm_yday),x=new Date(m.getFullYear(),0,4),M=new Date(m.getFullYear()+1,0,4),ut=T(x),kt=T(M);return b(ut,m)<=0?b(kt,m)<=0?m.getFullYear()+1:m.getFullYear():m.getFullYear()-1}var P={"%a":d=>h[d.tm_wday].substring(0,3),"%A":d=>h[d.tm_wday],"%b":d=>p[d.tm_mon].substring(0,3),"%B":d=>p[d.tm_mon],"%C":d=>{var m=d.tm_year+1900;return g(m/100|0,2)},"%d":d=>g(d.tm_mday,2),"%e":d=>y(d.tm_mday,2," "),"%g":d=>R(d).toString().substring(2),"%G":d=>R(d),"%H":d=>g(d.tm_hour,2),"%I":d=>{var m=d.tm_hour;return m==0?m=12:m>12&&(m-=12),g(m,2)},"%j":d=>g(d.tm_mday+Ea(Rt(d.tm_year+1900)?Je:Ke,d.tm_mon-1),3),"%m":d=>g(d.tm_mon+1,2),"%M":d=>g(d.tm_min,2),"%n":()=>`
|
|
3
|
-
`,"%p":d=>d.tm_hour>=0&&d.tm_hour<12?"AM":"PM","%S":d=>
|
|
1
|
+
var BarcodeDetectionAPI=function(I){"use strict";var sr=(I,B,z)=>{if(!B.has(I))throw TypeError("Cannot "+z)};var se=(I,B,z)=>(sr(I,B,"read from private field"),z?z.call(I):B.get(I)),ur=(I,B,z)=>{if(B.has(I))throw TypeError("Cannot add the same private member more than once");B instanceof WeakSet?B.add(I):B.set(I,z)},cr=(I,B,z,nt)=>(sr(I,B,"write to private field"),nt?nt.call(I,z):B.set(I,z),z);var ct;const B=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["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"]],z=[...B,["unknown"]].map(i=>i[0]),nt=new Map(B);function lr(i){for(const[p,c]of nt)if(i===c)return p;return"unknown"}function dr(i){if(ue(i))return{width:i.naturalWidth,height:i.naturalHeight};if(ce(i))return{width:i.width.baseVal.value,height:i.height.baseVal.value};if(le(i))return{width:i.videoWidth,height:i.videoHeight};if(fe(i))return{width:i.width,height:i.height};if(pe(i))return{width:i.displayWidth,height:i.displayHeight};if(de(i))return{width:i.width,height:i.height};if(he(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 ue(i){try{return i instanceof HTMLImageElement}catch{return!1}}function ce(i){try{return i instanceof SVGImageElement}catch{return!1}}function le(i){try{return i instanceof HTMLVideoElement}catch{return!1}}function de(i){try{return i instanceof HTMLCanvasElement}catch{return!1}}function fe(i){try{return i instanceof ImageBitmap}catch{return!1}}function he(i){try{return i instanceof OffscreenCanvas}catch{return!1}}function pe(i){try{return i instanceof VideoFrame}catch{return!1}}function me(i){try{return i instanceof Blob}catch{return!1}}function fr(i){try{return i instanceof ImageData}catch{return!1}}function hr(i,p){try{const c=new OffscreenCanvas(i,p);if(c.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return c;throw void 0}catch{const c=document.createElement("canvas");return c.width=i,c.height=p,c}}async function ve(i){if(ue(i)&&!await yr(i))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(ce(i)&&!await gr(i))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(pe(i)&&wr(i))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(le(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:p,height:c}=dr(i);if(p===0||c===0)return null;const g=hr(p,c).getContext("2d");g.drawImage(i,0,0);try{return g.getImageData(0,0,p,c)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function pr(i){let p;try{if(globalThis.createImageBitmap)p=await createImageBitmap(i);else if(globalThis.Image){p=new Image;let $="";try{$=URL.createObjectURL(i),p.src=$,await p.decode()}finally{URL.revokeObjectURL($)}}else return i}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await ve(p)}function mr(i){const{width:p,height:c}=i;if(p===0||c===0)return null;const $=i.getContext("2d");try{return $.getImageData(0,0,p,c)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function vr(i){if(me(i))return await pr(i);if(fr(i)){if($r(i))throw new DOMException("The image data has been detached.","InvalidStateError");return i}return de(i)||he(i)?mr(i):await ve(i)}async function yr(i){try{return await i.decode(),!0}catch{return!1}}async function gr(i){var p;try{return await((p=i.decode)==null?void 0:p.call(i)),!0}catch{return!1}}function wr(i){return i.format===null}function $r(i){return i.data.buffer.byteLength===0}function br(i){return i.width===0&&i.height===0}function ye(i,p){return i instanceof DOMException?new DOMException(`${p}: ${i.message}`,i.name):i instanceof Error?new i.constructor(`${p}: ${i.message}`):new Error(`${p}: ${i}`)}const ge=["Aztec","Codabar","Code128","Code39","Code93","DataBar","DataBarExpanded","DataMatrix","DXFilmEdge","EAN-13","EAN-8","ITF","Linear-Codes","Matrix-Codes","MaxiCode","MicroQRCode","None","PDF417","QRCode","rMQRCode","UPC-A","UPC-E"];function Cr(i){return i.join("|")}function Tr(i){const p=we(i);let c=0,$=ge.length-1;for(;c<=$;){const g=Math.floor((c+$)/2),b=ge[g],U=we(b);if(U===p)return b;U<p?c=g+1:$=g-1}return"None"}function we(i){return i.toLowerCase().replace(/_-\[\]/g,"")}function _r(i,p){return i.Binarizer[p]}function Pr(i,p){return i.CharacterSet[p]}const Er=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function Ar(i){return Er[i.value]}function Dr(i,p){return i.EanAddOnSymbol[p]}function Or(i,p){return i.TextMode[p]}const ut={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,tryCode39ExtendedMode:!1,validateCode39CheckSum:!1,validateITFCheckSum:!1,returnCodabarStartEnd:!1,returnErrors:!1,eanAddOnSymbol:"Read",textMode:"Plain",characterSet:"Unknown"};function $e(i,p){return{...p,formats:Cr(p.formats),binarizer:_r(i,p.binarizer),eanAddOnSymbol:Dr(i,p.eanAddOnSymbol),textMode:Or(i,p.textMode),characterSet:Pr(i,p.characterSet)}}function be(i){return{...i,format:Tr(i.format),eccLevel:i.eccLevel,contentType:Ar(i.contentType)}}const Fr={locateFile:(i,p)=>{const c=i.match(/_(.+?)\.wasm$/);return c?`https://fastly.jsdelivr.net/npm/zxing-wasm@1.1.3/dist/${c[1]}/${i}`:p+i}};let Bt=new WeakMap;function Ut(i,p){var c;const $=Bt.get(i);if($!=null&&$.modulePromise&&(p===void 0||Object.is(p,$.moduleOverrides)))return $.modulePromise;const g=(c=p!=null?p:$==null?void 0:$.moduleOverrides)!=null?c:Fr,b=i({...g});return Bt.set(i,{moduleOverrides:g,modulePromise:b}),b}function xr(i,p){Bt.set(i,{moduleOverrides:p})}async function Sr(i,p,c=ut){const $={...ut,...c},g=await Ut(i),{size:b}=p,U=new Uint8Array(await p.arrayBuffer()),N=g._malloc(b);g.HEAPU8.set(U,N);const V=g.readBarcodesFromImage(N,b,$e(g,$));g._free(N);const S=[];for(let G=0;G<V.size();++G)S.push(be(V.get(G)));return S}async function Mr(i,p,c=ut){const $={...ut,...c},g=await Ut(i),{data:b,width:U,height:N,data:{byteLength:V}}=p,S=g._malloc(V);g.HEAPU8.set(b,S);const G=g.readBarcodesFromPixmap(S,U,N,$e(g,$));g._free(S);const Q=[];for(let L=0;L<G.size();++L)Q.push(be(G.get(L)));return Q}({...ut,formats:[...ut.formats]});var Pt=(()=>{var i=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(p={}){var c=p,$,g;c.ready=new Promise((t,e)=>{$=t,g=e});var b=Object.assign({},c),U="./this.program",N=typeof window=="object",V=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var S="";function G(t){return c.locateFile?c.locateFile(t,S):S+t}var Q;(N||V)&&(V?S=self.location.href:typeof document<"u"&&document.currentScript&&(S=document.currentScript.src),i&&(S=i),S.indexOf("blob:")!==0?S=S.substr(0,S.replace(/[?#].*/,"").lastIndexOf("/")+1):S="",V&&(Q=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)})),c.print||console.log.bind(console);var L=c.printErr||console.error.bind(console);Object.assign(c,b),b=null,c.arguments&&c.arguments,c.thisProgram&&(U=c.thisProgram),c.quit&&c.quit;var K;c.wasmBinary&&(K=c.wasmBinary),typeof WebAssembly!="object"&&Et("no native wasm support detected");var at,mt=!1,Y,k,lt,vt,H,_,Ce,Te;function _e(){var t=at.buffer;c.HEAP8=Y=new Int8Array(t),c.HEAP16=lt=new Int16Array(t),c.HEAPU8=k=new Uint8Array(t),c.HEAPU16=vt=new Uint16Array(t),c.HEAP32=H=new Int32Array(t),c.HEAPU32=_=new Uint32Array(t),c.HEAPF32=Ce=new Float32Array(t),c.HEAPF64=Te=new Float64Array(t)}var Pe=[],Ee=[],Ae=[];function Hr(){if(c.preRun)for(typeof c.preRun=="function"&&(c.preRun=[c.preRun]);c.preRun.length;)Vr(c.preRun.shift());Vt(Pe)}function Br(){Vt(Ee)}function Ur(){if(c.postRun)for(typeof c.postRun=="function"&&(c.postRun=[c.postRun]);c.postRun.length;)Yr(c.postRun.shift());Vt(Ae)}function Vr(t){Pe.unshift(t)}function Lr(t){Ee.unshift(t)}function Yr(t){Ae.unshift(t)}var ot=0,yt=null;function zr(t){var e;ot++,(e=c.monitorRunDependencies)===null||e===void 0||e.call(c,ot)}function Nr(t){var e;if(ot--,(e=c.monitorRunDependencies)===null||e===void 0||e.call(c,ot),ot==0&&yt){var r=yt;yt=null,r()}}function Et(t){var e;(e=c.onAbort)===null||e===void 0||e.call(c,t),t="Aborted("+t+")",L(t),mt=!0,t+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(t);throw g(r),r}var Gr="data:application/octet-stream;base64,",De=t=>t.startsWith(Gr),dt;dt="zxing_reader.wasm",De(dt)||(dt=G(dt));function Oe(t){if(t==dt&&K)return new Uint8Array(K);if(Q)return Q(t);throw"both async and sync fetching of the wasm failed"}function Xr(t){return!K&&(N||V)&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(e=>{if(!e.ok)throw"failed to load wasm binary file at '"+t+"'";return e.arrayBuffer()}).catch(()=>Oe(t)):Promise.resolve().then(()=>Oe(t))}function Fe(t,e,r){return Xr(t).then(n=>WebAssembly.instantiate(n,e)).then(n=>n).then(r,n=>{L(`failed to asynchronously prepare wasm: ${n}`),Et(n)})}function qr(t,e,r,n){return!t&&typeof WebAssembly.instantiateStreaming=="function"&&!De(e)&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(a=>{var o=WebAssembly.instantiateStreaming(a,r);return o.then(n,function(s){return L(`wasm streaming compile failed: ${s}`),L("falling back to ArrayBuffer instantiation"),Fe(e,r,n)})}):Fe(e,r,n)}function Qr(){var t={a:ka};function e(n,a){return M=n.exports,at=M.ia,_e(),Be=M.ma,Lr(M.ja),Nr(),M}zr();function r(n){e(n.instance)}if(c.instantiateWasm)try{return c.instantiateWasm(t,e)}catch(n){L(`Module.instantiateWasm callback failed with error: ${n}`),g(n)}return qr(K,dt,t,r).catch(g),{}}var Vt=t=>{for(;t.length>0;)t.shift()(c)};c.noExitRuntime;var At=[],Dt=0,Zr=t=>{var e=new Lt(t);return e.get_caught()||(e.set_caught(!0),Dt--),e.set_rethrown(!1),At.push(e),tr(e.excPtr),e.get_exception_ptr()},tt=0,Jr=()=>{P(0,0);var t=At.pop();Ke(t.excPtr),tt=0};function Lt(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(e){_[this.ptr+4>>2]=e},this.get_type=function(){return _[this.ptr+4>>2]},this.set_destructor=function(e){_[this.ptr+8>>2]=e},this.get_destructor=function(){return _[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,Y[this.ptr+12>>0]=e},this.get_caught=function(){return Y[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,Y[this.ptr+13>>0]=e},this.get_rethrown=function(){return Y[this.ptr+13>>0]!=0},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)},this.set_adjusted_ptr=function(e){_[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return _[this.ptr+16>>2]},this.get_exception_ptr=function(){var e=rr(this.get_type());if(e)return _[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr}}var Kr=t=>{throw tt||(tt=t),tt},Yt=t=>{var e=tt;if(!e)return _t(0),0;var r=new Lt(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return _t(0),e;for(var a in t){var o=t[a];if(o===0||o===n)break;var s=r.ptr+16;if(er(o,n,s))return _t(o),e}return _t(n),e},tn=()=>Yt([]),en=t=>Yt([t]),rn=(t,e)=>Yt([t,e]),nn=()=>{var t=At.pop();t||Et("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||(At.push(t),t.set_rethrown(!0),t.set_caught(!1),Dt++),tt=e,tt},an=(t,e,r)=>{var n=new Lt(t);throw n.init(e,r),tt=t,Dt++,tt},on=()=>Dt,Ot={},zt=t=>{for(;t.length;){var e=t.pop(),r=t.pop();r(e)}};function Nt(t){return this.fromWireType(H[t>>2])}var ft={},it={},Ft={},xe,xt=t=>{throw new xe(t)},st=(t,e,r)=>{t.forEach(function(u){Ft[u]=e});function n(u){var l=r(u);l.length!==t.length&&xt("Mismatched type converter count");for(var f=0;f<t.length;++f)Z(t[f],l[f])}var a=new Array(e.length),o=[],s=0;e.forEach((u,l)=>{it.hasOwnProperty(u)?a[l]=it[u]:(o.push(u),ft.hasOwnProperty(u)||(ft[u]=[]),ft[u].push(()=>{a[l]=it[u],++s,s===o.length&&n(a)}))}),o.length===0&&n(a)},sn=t=>{var e=Ot[t];delete Ot[t];var r=e.rawConstructor,n=e.rawDestructor,a=e.fields,o=a.map(s=>s.getterReturnType).concat(a.map(s=>s.setterArgumentType));st([t],o,s=>{var u={};return a.forEach((l,f)=>{var h=l.fieldName,v=s[f],y=l.getter,w=l.getterContext,E=s[f+a.length],F=l.setter,T=l.setterContext;u[h]={read:W=>v.fromWireType(y(w,W)),write:(W,d)=>{var m=[];F(T,W,E.toWireType(m,d)),zt(m)}}}),[{name:e.name,fromWireType:l=>{var f={};for(var h in u)f[h]=u[h].read(l);return n(l),f},toWireType:(l,f)=>{for(var h in u)if(!(h in f))throw new TypeError(`Missing field: "${h}"`);var v=r();for(h in u)u[h].write(v,f[h]);return l!==null&&l.push(n,v),v},argPackAdvance:J,readValueFromPointer:Nt,destructorFunction:n}]})},un=(t,e,r,n,a)=>{},cn=()=>{for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);Se=t},Se,R=t=>{for(var e="",r=t;k[r];)e+=Se[k[r++]];return e},ht,C=t=>{throw new ht(t)};function ln(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=e.name;if(t||C(`type "${n}" must have a positive integer typeid pointer`),it.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;C(`Cannot register type '${n}' twice`)}if(it[t]=e,delete Ft[t],ft.hasOwnProperty(t)){var a=ft[t];delete ft[t],a.forEach(o=>o())}}function Z(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return ln(t,e,r)}var J=8,dn=(t,e,r,n)=>{e=R(e),Z(t,{name:e,fromWireType:function(a){return!!a},toWireType:function(a,o){return o?r:n},argPackAdvance:J,readValueFromPointer:function(a){return this.fromWireType(k[a])},destructorFunction:null})},fn=t=>({count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}),Gt=t=>{function e(r){return r.$$.ptrType.registeredClass.name}C(e(t)+" instance already deleted")},Xt=!1,Me=t=>{},hn=t=>{t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)},je=t=>{t.count.value-=1;var e=t.count.value===0;e&&hn(t)},Ie=(t,e,r)=>{if(e===r)return t;if(r.baseClass===void 0)return null;var n=Ie(t,e,r.baseClass);return n===null?null:r.downcast(n)},Re={},pn=()=>Object.keys($t).length,mn=()=>{var t=[];for(var e in $t)$t.hasOwnProperty(e)&&t.push($t[e]);return t},gt=[],qt=()=>{for(;gt.length;){var t=gt.pop();t.$$.deleteScheduled=!1,t.delete()}},wt,vn=t=>{wt=t,gt.length&&wt&&wt(qt)},yn=()=>{c.getInheritedInstanceCount=pn,c.getLiveInheritedInstances=mn,c.flushPendingDeletes=qt,c.setDelayFunction=vn},$t={},gn=(t,e)=>{for(e===void 0&&C("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e},wn=(t,e)=>(e=gn(t,e),$t[e]),St=(t,e)=>{(!e.ptrType||!e.ptr)&&xt("makeClassHandle requires ptr and ptrType");var r=!!e.smartPtrType,n=!!e.smartPtr;return r!==n&&xt("Both smartPtrType and smartPtr must be specified"),e.count={value:1},bt(Object.create(t,{$$:{value:e,writable:!0}}))};function $n(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=wn(this.registeredClass,e);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=e,r.$$.smartPtr=t,r.clone();var n=r.clone();return this.destructor(t),n}function a(){return this.isSmartPointer?St(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):St(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var o=this.registeredClass.getActualType(e),s=Re[o];if(!s)return a.call(this);var u;this.isConst?u=s.constPointerType:u=s.pointerType;var l=Ie(e,this.registeredClass,u.registeredClass);return l===null?a.call(this):this.isSmartPointer?St(u.registeredClass.instancePrototype,{ptrType:u,ptr:l,smartPtrType:this,smartPtr:t}):St(u.registeredClass.instancePrototype,{ptrType:u,ptr:l})}var bt=t=>typeof FinalizationRegistry>"u"?(bt=e=>e,t):(Xt=new FinalizationRegistry(e=>{je(e.$$)}),bt=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var a={$$:r};Xt.register(e,a,e)}return e},Me=e=>Xt.unregister(e),bt(t)),bn=()=>{Object.assign(Mt.prototype,{isAliasOf(t){if(!(this instanceof Mt)||!(t instanceof Mt))return!1;var e=this.$$.ptrType.registeredClass,r=this.$$.ptr;t.$$=t.$$;for(var n=t.$$.ptrType.registeredClass,a=t.$$.ptr;e.baseClass;)r=e.upcast(r),e=e.baseClass;for(;n.baseClass;)a=n.upcast(a),n=n.baseClass;return e===n&&r===a},clone(){if(this.$$.ptr||Gt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=bt(Object.create(Object.getPrototypeOf(this),{$$:{value:fn(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},delete(){this.$$.ptr||Gt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&C("Object already scheduled for deletion"),Me(this),je(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&&C("Object already scheduled for deletion"),gt.push(this),gt.length===1&&wt&&wt(qt),this.$$.deleteScheduled=!0,this}})};function Mt(){}var Ct=(t,e)=>Object.defineProperty(e,"name",{value:t}),We=(t,e,r)=>{if(t[e].overloadTable===void 0){var n=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||C(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${t[e].overloadTable})!`),t[e].overloadTable[arguments.length].apply(this,arguments)},t[e].overloadTable=[],t[e].overloadTable[n.argCount]=n}},Qt=(t,e,r)=>{c.hasOwnProperty(t)?((r===void 0||c[t].overloadTable!==void 0&&c[t].overloadTable[r]!==void 0)&&C(`Cannot register public name '${t}' twice`),We(c,t,t),c.hasOwnProperty(r)&&C(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),c[t].overloadTable[r]=e):(c[t]=e,r!==void 0&&(c[t].numArguments=r))},Cn=48,Tn=57,_n=t=>{if(t===void 0)return"_unknown";t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return e>=Cn&&e<=Tn?`_${t}`:t};function Pn(t,e,r,n,a,o,s,u){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=s,this.downcast=u,this.pureVirtualFunctions=[]}var Zt=(t,e,r)=>{for(;e!==r;)e.upcast||C(`Expected null or instance of ${r.name}, got an instance of ${e.name}`),t=e.upcast(t),e=e.baseClass;return t};function En(t,e){if(e===null)return this.isReference&&C(`null is not a valid ${this.name}`),0;e.$$||C(`Cannot pass "${re(e)}" as a ${this.name}`),e.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=Zt(e.$$.ptr,r,this.registeredClass);return n}function An(t,e){var r;if(e===null)return this.isReference&&C(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),t!==null&&t.push(this.rawDestructor,r),r):0;(!e||!e.$$)&&C(`Cannot pass "${re(e)}" as a ${this.name}`),e.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&e.$$.ptrType.isConst&&C(`Cannot convert argument of type ${e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name} to parameter type ${this.name}`);var n=e.$$.ptrType.registeredClass;if(r=Zt(e.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(e.$$.smartPtr===void 0&&C("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:C(`Cannot convert argument of type ${e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=e.$$.smartPtr;break;case 2:if(e.$$.smartPtrType===this)r=e.$$.smartPtr;else{var a=e.clone();r=this.rawShare(r,et.toHandle(()=>a.delete())),t!==null&&t.push(this.rawDestructor,r)}break;default:C("Unsupporting sharing policy")}return r}function Dn(t,e){if(e===null)return this.isReference&&C(`null is not a valid ${this.name}`),0;e.$$||C(`Cannot pass "${re(e)}" as a ${this.name}`),e.$$.ptr||C(`Cannot pass deleted object as a pointer of type ${this.name}`),e.$$.ptrType.isConst&&C(`Cannot convert argument of type ${e.$$.ptrType.name} to parameter type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=Zt(e.$$.ptr,r,this.registeredClass);return n}function ke(t){return this.fromWireType(_[t>>2])}var On=()=>{Object.assign(jt.prototype,{getPointee(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t},destructor(t){var e;(e=this.rawDestructor)===null||e===void 0||e.call(this,t)},argPackAdvance:J,readValueFromPointer:ke,deleteObject(t){t!==null&&t.delete()},fromWireType:$n})};function jt(t,e,r,n,a,o,s,u,l,f,h){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=s,this.rawGetPointee=u,this.rawConstructor=l,this.rawShare=f,this.rawDestructor=h,!a&&e.baseClass===void 0?n?(this.toWireType=En,this.destructorFunction=null):(this.toWireType=Dn,this.destructorFunction=null):this.toWireType=An}var He=(t,e,r)=>{c.hasOwnProperty(t)||xt("Replacing nonexistant public symbol"),c[t].overloadTable!==void 0&&r!==void 0?c[t].overloadTable[r]=e:(c[t]=e,c[t].argCount=r)},Fn=(t,e,r)=>{var n=c["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)},It=[],Be,A=t=>{var e=It[t];return e||(t>=It.length&&(It.length=t+1),It[t]=e=Be.get(t)),e},xn=(t,e,r)=>{if(t.includes("j"))return Fn(t,e,r);var n=A(e).apply(null,r);return n},Sn=(t,e)=>{var r=[];return function(){return r.length=0,Object.assign(r,arguments),xn(t,e,r)}},q=(t,e)=>{t=R(t);function r(){return t.includes("j")?Sn(t,e):A(e)}var n=r();return typeof n!="function"&&C(`unknown function pointer with signature ${t}: ${e}`),n},Mn=(t,e)=>{var r=Ct(e,function(n){this.name=e,this.message=n;var a=new Error(n).stack;a!==void 0&&(this.stack=this.toString()+`
|
|
2
|
+
`+a.replace(/^Error(:[^\n]*)?\n/,""))});return r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},r},Ue,Ve=t=>{var e=Je(t),r=R(e);return rt(e),r},Rt=(t,e)=>{var r=[],n={};function a(o){if(!n[o]&&!it[o]){if(Ft[o]){Ft[o].forEach(a);return}r.push(o),n[o]=!0}}throw e.forEach(a),new Ue(`${t}: `+r.map(Ve).join([", "]))},jn=(t,e,r,n,a,o,s,u,l,f,h,v,y)=>{h=R(h),o=q(a,o),u&&(u=q(s,u)),f&&(f=q(l,f)),y=q(v,y);var w=_n(h);Qt(w,function(){Rt(`Cannot construct ${h} due to unbound types`,[n])}),st([t,e,r],n?[n]:[],function(E){E=E[0];var F,T;n?(F=E.registeredClass,T=F.instancePrototype):T=Mt.prototype;var W=Ct(h,function(){if(Object.getPrototypeOf(this)!==d)throw new ht("Use 'new' to construct "+h);if(m.constructor_body===void 0)throw new ht(h+" has no accessible constructor");var ir=m.constructor_body[arguments.length];if(ir===void 0)throw new ht(`Tried to invoke ctor of ${h} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(m.constructor_body).toString()}) parameters instead!`);return ir.apply(this,arguments)}),d=Object.create(T,{constructor:{value:W}});W.prototype=d;var m=new Pn(h,W,d,y,F,o,u,f);if(m.baseClass){var x,j;(j=(x=m.baseClass).__derivedClasses)!==null&&j!==void 0||(x.__derivedClasses=[]),m.baseClass.__derivedClasses.push(m)}var pt=new jt(h,m,!0,!1,!1),Ht=new jt(h+"*",m,!1,!1,!1),or=new jt(h+" const*",m,!1,!0,!1);return Re[t]={pointerType:Ht,constPointerType:or},He(w,W),[pt,Ht,or]})},Jt=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(_[e+n*4>>2]);return r};function In(t){for(var e=1;e<t.length;++e)if(t[e]!==null&&t[e].destructorFunction===void 0)return!0;return!1}function Kt(t,e,r,n,a,o){var s=e.length;s<2&&C("argTypes array size mismatch! Must at least get return value and 'this' types!");var u=e[1]!==null&&r!==null,l=In(e),f=e[0].name!=="void",h=s-2,v=new Array(h),y=[],w=[],E=function(){arguments.length!==h&&C(`function ${t} called with ${arguments.length} arguments, expected ${h}`),w.length=0;var F;y.length=u?2:1,y[0]=a,u&&(F=e[1].toWireType(w,this),y[1]=F);for(var T=0;T<h;++T)v[T]=e[T+2].toWireType(w,arguments[T]),y.push(v[T]);var W=n.apply(null,y);function d(m){if(l)zt(w);else for(var x=u?1:2;x<e.length;x++){var j=x===1?F:v[x-2];e[x].destructorFunction!==null&&e[x].destructorFunction(j)}if(f)return e[0].fromWireType(m)}return d(W)};return Ct(t,E)}var Rn=(t,e,r,n,a,o)=>{var s=Jt(e,r);a=q(n,a),st([],[t],function(u){u=u[0];var l=`constructor ${u.name}`;if(u.registeredClass.constructor_body===void 0&&(u.registeredClass.constructor_body=[]),u.registeredClass.constructor_body[e-1]!==void 0)throw new ht(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${u.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return u.registeredClass.constructor_body[e-1]=()=>{Rt(`Cannot construct ${u.name} due to unbound types`,s)},st([],s,f=>(f.splice(1,0,null),u.registeredClass.constructor_body[e-1]=Kt(l,f,null,a,o),[])),[]})},Le=t=>{t=t.trim();const e=t.indexOf("(");return e!==-1?t.substr(0,e):t},Wn=(t,e,r,n,a,o,s,u,l)=>{var f=Jt(r,n);e=R(e),e=Le(e),o=q(a,o),st([],[t],function(h){h=h[0];var v=`${h.name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),u&&h.registeredClass.pureVirtualFunctions.push(e);function y(){Rt(`Cannot call ${v} due to unbound types`,f)}var w=h.registeredClass.instancePrototype,E=w[e];return E===void 0||E.overloadTable===void 0&&E.className!==h.name&&E.argCount===r-2?(y.argCount=r-2,y.className=h.name,w[e]=y):(We(w,e,v),w[e].overloadTable[r-2]=y),st([],f,function(F){var T=Kt(v,F,h,o,s);return w[e].overloadTable===void 0?(T.argCount=r-2,w[e]=T):w[e].overloadTable[r-2]=T,[]}),[]})};function kn(){Object.assign(Ye.prototype,{get(t){return this.allocated[t]},has(t){return this.allocated[t]!==void 0},allocate(t){var e=this.freelist.pop()||this.allocated.length;return this.allocated[e]=t,e},free(t){this.allocated[t]=void 0,this.freelist.push(t)}})}function Ye(){this.allocated=[void 0],this.freelist=[]}var X=new Ye,te=t=>{t>=X.reserved&&--X.get(t).refcount===0&&X.free(t)},Hn=()=>{for(var t=0,e=X.reserved;e<X.allocated.length;++e)X.allocated[e]!==void 0&&++t;return t},Bn=()=>{X.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),X.reserved=X.allocated.length,c.count_emval_handles=Hn},et={toValue:t=>(t||C("Cannot use deleted val. handle = "+t),X.get(t).value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return X.allocate({refcount:1,value:t})}}},Un=(t,e)=>{e=R(e),Z(t,{name:e,fromWireType:r=>{var n=et.toValue(r);return te(r),n},toWireType:(r,n)=>et.toHandle(n),argPackAdvance:J,readValueFromPointer:Nt,destructorFunction:null})},Vn=(t,e,r)=>{switch(e){case 1:return r?function(n){return this.fromWireType(Y[n>>0])}:function(n){return this.fromWireType(k[n>>0])};case 2:return r?function(n){return this.fromWireType(lt[n>>1])}:function(n){return this.fromWireType(vt[n>>1])};case 4:return r?function(n){return this.fromWireType(H[n>>2])}:function(n){return this.fromWireType(_[n>>2])};default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},Ln=(t,e,r,n)=>{e=R(e);function a(){}a.values={},Z(t,{name:e,constructor:a,fromWireType:function(o){return this.constructor.values[o]},toWireType:(o,s)=>s.value,argPackAdvance:J,readValueFromPointer:Vn(e,r,n),destructorFunction:null}),Qt(e,a)},ee=(t,e)=>{var r=it[t];return r===void 0&&C(e+" has unknown type "+Ve(t)),r},Yn=(t,e,r)=>{var n=ee(t,"enum");e=R(e);var a=n.constructor,o=Object.create(n.constructor.prototype,{value:{value:r},constructor:{value:Ct(`${n.name}_${e}`,function(){})}});a.values[r]=o,a[e]=o},re=t=>{if(t===null)return"null";var e=typeof t;return e==="object"||e==="array"||e==="function"?t.toString():""+t},zn=(t,e)=>{switch(e){case 4:return function(r){return this.fromWireType(Ce[r>>2])};case 8:return function(r){return this.fromWireType(Te[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},Nn=(t,e,r)=>{e=R(e),Z(t,{name:e,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:J,readValueFromPointer:zn(e,r),destructorFunction:null})},Gn=(t,e,r,n,a,o,s)=>{var u=Jt(e,r);t=R(t),t=Le(t),a=q(n,a),Qt(t,function(){Rt(`Cannot call ${t} due to unbound types`,u)},e-1),st([],u,function(l){var f=[l[0],null].concat(l.slice(1));return He(t,Kt(t,f,null,a,o),e-1),[]})},Xn=(t,e,r)=>{switch(e){case 1:return r?n=>Y[n>>0]:n=>k[n>>0];case 2:return r?n=>lt[n>>1]:n=>vt[n>>1];case 4:return r?n=>H[n>>2]:n=>_[n>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},qn=(t,e,r,n,a)=>{e=R(e);var o=h=>h;if(n===0){var s=32-8*r;o=h=>h<<s>>>s}var u=e.includes("unsigned"),l=(h,v)=>{},f;u?f=function(h,v){return l(v,this.name),v>>>0}:f=function(h,v){return l(v,this.name),v},Z(t,{name:e,fromWireType:o,toWireType:f,argPackAdvance:J,readValueFromPointer:Xn(e,r,n!==0),destructorFunction:null})},Qn=(t,e,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[e];function o(s){var u=_[s>>2],l=_[s+4>>2];return new a(Y.buffer,l,u)}r=R(r),Z(t,{name:r,fromWireType:o,argPackAdvance:J,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},ze=(t,e,r,n)=>{if(!(n>0))return 0;for(var a=r,o=r+n-1,s=0;s<t.length;++s){var u=t.charCodeAt(s);if(u>=55296&&u<=57343){var l=t.charCodeAt(++s);u=65536+((u&1023)<<10)|l&1023}if(u<=127){if(r>=o)break;e[r++]=u}else if(u<=2047){if(r+1>=o)break;e[r++]=192|u>>6,e[r++]=128|u&63}else if(u<=65535){if(r+2>=o)break;e[r++]=224|u>>12,e[r++]=128|u>>6&63,e[r++]=128|u&63}else{if(r+3>=o)break;e[r++]=240|u>>18,e[r++]=128|u>>12&63,e[r++]=128|u>>6&63,e[r++]=128|u&63}}return e[r]=0,r-a},Zn=(t,e,r)=>ze(t,k,e,r),Ne=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++r):e+=3}return e},Ge=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,Jn=(t,e,r)=>{for(var n=e+r,a=e;t[a]&&!(a>=n);)++a;if(a-e>16&&t.buffer&&Ge)return Ge.decode(t.subarray(e,a));for(var o="";e<a;){var s=t[e++];if(!(s&128)){o+=String.fromCharCode(s);continue}var u=t[e++]&63;if((s&224)==192){o+=String.fromCharCode((s&31)<<6|u);continue}var l=t[e++]&63;if((s&240)==224?s=(s&15)<<12|u<<6|l:s=(s&7)<<18|u<<12|l<<6|t[e++]&63,s<65536)o+=String.fromCharCode(s);else{var f=s-65536;o+=String.fromCharCode(55296|f>>10,56320|f&1023)}}return o},ne=(t,e)=>t?Jn(k,t,e):"",Kn=(t,e)=>{e=R(e);var r=e==="std::string";Z(t,{name:e,fromWireType(n){var a=_[n>>2],o=n+4,s;if(r)for(var u=o,l=0;l<=a;++l){var f=o+l;if(l==a||k[f]==0){var h=f-u,v=ne(u,h);s===void 0?s=v:(s+="\0",s+=v),u=f+1}}else{for(var y=new Array(a),l=0;l<a;++l)y[l]=String.fromCharCode(k[o+l]);s=y.join("")}return rt(n),s},toWireType(n,a){a instanceof ArrayBuffer&&(a=new Uint8Array(a));var o,s=typeof a=="string";s||a instanceof Uint8Array||a instanceof Uint8ClampedArray||a instanceof Int8Array||C("Cannot pass non-string to std::string"),r&&s?o=Ne(a):o=a.length;var u=ie(4+o+1),l=u+4;if(_[u>>2]=o,r&&s)Zn(a,l,o+1);else if(s)for(var f=0;f<o;++f){var h=a.charCodeAt(f);h>255&&(rt(l),C("String has UTF-16 code units that do not fit in 8 bits")),k[l+f]=h}else for(var f=0;f<o;++f)k[l+f]=a[f];return n!==null&&n.push(rt,u),u},argPackAdvance:J,readValueFromPointer:ke,destructorFunction(n){rt(n)}})},Xe=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,ta=(t,e)=>{for(var r=t,n=r>>1,a=n+e/2;!(n>=a)&&vt[n];)++n;if(r=n<<1,r-t>32&&Xe)return Xe.decode(k.subarray(t,r));for(var o="",s=0;!(s>=e/2);++s){var u=lt[t+s*2>>1];if(u==0)break;o+=String.fromCharCode(u)}return o},ea=(t,e,r)=>{var n;if((n=r)!==null&&n!==void 0||(r=2147483647),r<2)return 0;r-=2;for(var a=e,o=r<t.length*2?r/2:t.length,s=0;s<o;++s){var u=t.charCodeAt(s);lt[e>>1]=u,e+=2}return lt[e>>1]=0,e-a},ra=t=>t.length*2,na=(t,e)=>{for(var r=0,n="";!(r>=e/4);){var a=H[t+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},aa=(t,e,r)=>{var n;if((n=r)!==null&&n!==void 0||(r=2147483647),r<4)return 0;for(var a=e,o=a+r-4,s=0;s<t.length;++s){var u=t.charCodeAt(s);if(u>=55296&&u<=57343){var l=t.charCodeAt(++s);u=65536+((u&1023)<<10)|l&1023}if(H[e>>2]=u,e+=4,e+4>o)break}return H[e>>2]=0,e-a},oa=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n>=55296&&n<=57343&&++r,e+=4}return e},ia=(t,e,r)=>{r=R(r);var n,a,o,s,u;e===2?(n=ta,a=ea,s=ra,o=()=>vt,u=1):e===4&&(n=na,a=aa,s=oa,o=()=>_,u=2),Z(t,{name:r,fromWireType:l=>{for(var f=_[l>>2],h=o(),v,y=l+4,w=0;w<=f;++w){var E=l+4+w*e;if(w==f||h[E>>u]==0){var F=E-y,T=n(y,F);v===void 0?v=T:(v+="\0",v+=T),y=E+e}}return rt(l),v},toWireType:(l,f)=>{typeof f!="string"&&C(`Cannot pass non-string to C++ string type ${r}`);var h=s(f),v=ie(4+h+e);return _[v>>2]=h>>u,a(f,v+4,h+e),l!==null&&l.push(rt,v),v},argPackAdvance:J,readValueFromPointer:Nt,destructorFunction(l){rt(l)}})},sa=(t,e,r,n,a,o)=>{Ot[t]={name:R(e),rawConstructor:q(r,n),rawDestructor:q(a,o),fields:[]}},ua=(t,e,r,n,a,o,s,u,l,f)=>{Ot[t].fields.push({fieldName:R(e),getterReturnType:r,getter:q(n,a),getterContext:o,setterArgumentType:s,setter:q(u,l),setterContext:f})},ca=(t,e)=>{e=R(e),Z(t,{isVoid:!0,name:e,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})},ae=[],la=(t,e,r,n)=>(t=ae[t],e=et.toValue(e),t(null,e,r,n)),da={},fa=t=>{var e=da[t];return e===void 0?R(t):e},qe=()=>{if(typeof globalThis=="object")return globalThis;function t(e){e.$$$embind_global$$$=e;var r=typeof $$$embind_global$$$=="object"&&e.$$$embind_global$$$==e;return r||delete e.$$$embind_global$$$,r}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&t(global)?$$$embind_global$$$=global:typeof self=="object"&&t(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},ha=t=>t===0?et.toHandle(qe()):(t=fa(t),et.toHandle(qe()[t])),pa=t=>{var e=ae.length;return ae.push(t),e},ma=(t,e)=>{for(var r=new Array(t),n=0;n<t;++n)r[n]=ee(_[e+n*4>>2],"parameter "+n);return r},va=Reflect.construct,ya=(t,e,r)=>{var n=[],a=t.toWireType(n,r);return n.length&&(_[e>>2]=et.toHandle(n)),a},ga=(t,e,r)=>{var n=ma(t,e),a=n.shift();t--;var o=new Array(t),s=(l,f,h,v)=>{for(var y=0,w=0;w<t;++w)o[w]=n[w].readValueFromPointer(v+y),y+=n[w].argPackAdvance;for(var E=r===1?va(f,o):f.apply(l,o),w=0;w<t;++w){var F,T;(F=(T=n[w]).deleteObject)===null||F===void 0||F.call(T,o[w])}return ya(a,h,E)},u=`methodCaller<(${n.map(l=>l.name).join(", ")}) => ${a.name}>`;return pa(Ct(u,s))},wa=t=>{t>4&&(X.get(t).refcount+=1)},$a=t=>{var e=et.toValue(t);zt(e),te(t)},ba=(t,e)=>{t=ee(t,"_emval_take_value");var r=t.readValueFromPointer(e);return et.toHandle(r)},Ca=()=>{Et("")},Ta=(t,e,r)=>k.copyWithin(t,e,e+r),_a=()=>2147483648,Pa=t=>{var e=at.buffer,r=(t-e.byteLength+65535)/65536;try{return at.grow(r),_e(),1}catch{}},Ea=t=>{var e=k.length;t>>>=0;var r=_a();if(t>r)return!1;for(var n=(l,f)=>l+(f-l%f)%f,a=1;a<=4;a*=2){var o=e*(1+.2/a);o=Math.min(o,t+100663296);var s=Math.min(r,n(Math.max(t,o),65536)),u=Pa(s);if(u)return!0}return!1},oe={},Aa=()=>U||"./this.program",Tt=()=>{if(!Tt.strings){var t=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:t,_:Aa()};for(var r in oe)oe[r]===void 0?delete e[r]:e[r]=oe[r];var n=[];for(var r in e)n.push(`${r}=${e[r]}`);Tt.strings=n}return Tt.strings},Da=(t,e)=>{for(var r=0;r<t.length;++r)Y[e++>>0]=t.charCodeAt(r);Y[e>>0]=0},Oa=(t,e)=>{var r=0;return Tt().forEach((n,a)=>{var o=e+r;_[t+a*4>>2]=o,Da(n,o),r+=n.length+1}),0},Fa=(t,e)=>{var r=Tt();_[t>>2]=r.length;var n=0;return r.forEach(a=>n+=a.length+1),_[e>>2]=n,0},xa=t=>t,Wt=t=>t%4===0&&(t%100!==0||t%400===0),Sa=(t,e)=>{for(var r=0,n=0;n<=e;r+=t[n++]);return r},Qe=[31,29,31,30,31,30,31,31,30,31,30,31],Ze=[31,28,31,30,31,30,31,31,30,31,30,31],Ma=(t,e)=>{for(var r=new Date(t.getTime());e>0;){var n=Wt(r.getFullYear()),a=r.getMonth(),o=(n?Qe:Ze)[a];if(e>o-r.getDate())e-=o-r.getDate()+1,r.setDate(1),a<11?r.setMonth(a+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1));else return r.setDate(r.getDate()+e),r}return r};function ja(t,e,r){var n=r>0?r:Ne(t)+1,a=new Array(n),o=ze(t,a,0,a.length);return e&&(a.length=o),a}var Ia=(t,e)=>{Y.set(t,e)},Ra=(t,e,r,n)=>{var a=_[n+40>>2],o={tm_sec:H[n>>2],tm_min:H[n+4>>2],tm_hour:H[n+8>>2],tm_mday:H[n+12>>2],tm_mon:H[n+16>>2],tm_year:H[n+20>>2],tm_wday:H[n+24>>2],tm_yday:H[n+28>>2],tm_isdst:H[n+32>>2],tm_gmtoff:H[n+36>>2],tm_zone:a?ne(a):""},s=ne(r),u={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var l in u)s=s.replace(new RegExp(l,"g"),u[l]);var f=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],h=["January","February","March","April","May","June","July","August","September","October","November","December"];function v(d,m,x){for(var j=typeof d=="number"?d.toString():d||"";j.length<m;)j=x[0]+j;return j}function y(d,m){return v(d,m,"0")}function w(d,m){function x(pt){return pt<0?-1:pt>0?1:0}var j;return(j=x(d.getFullYear()-m.getFullYear()))===0&&(j=x(d.getMonth()-m.getMonth()))===0&&(j=x(d.getDate()-m.getDate())),j}function E(d){switch(d.getDay()){case 0:return new Date(d.getFullYear()-1,11,29);case 1:return d;case 2:return new Date(d.getFullYear(),0,3);case 3:return new Date(d.getFullYear(),0,2);case 4:return new Date(d.getFullYear(),0,1);case 5:return new Date(d.getFullYear()-1,11,31);case 6:return new Date(d.getFullYear()-1,11,30)}}function F(d){var m=Ma(new Date(d.tm_year+1900,0,1),d.tm_yday),x=new Date(m.getFullYear(),0,4),j=new Date(m.getFullYear()+1,0,4),pt=E(x),Ht=E(j);return w(pt,m)<=0?w(Ht,m)<=0?m.getFullYear()+1:m.getFullYear():m.getFullYear()-1}var T={"%a":d=>f[d.tm_wday].substring(0,3),"%A":d=>f[d.tm_wday],"%b":d=>h[d.tm_mon].substring(0,3),"%B":d=>h[d.tm_mon],"%C":d=>{var m=d.tm_year+1900;return y(m/100|0,2)},"%d":d=>y(d.tm_mday,2),"%e":d=>v(d.tm_mday,2," "),"%g":d=>F(d).toString().substring(2),"%G":d=>F(d),"%H":d=>y(d.tm_hour,2),"%I":d=>{var m=d.tm_hour;return m==0?m=12:m>12&&(m-=12),y(m,2)},"%j":d=>y(d.tm_mday+Sa(Wt(d.tm_year+1900)?Qe:Ze,d.tm_mon-1),3),"%m":d=>y(d.tm_mon+1,2),"%M":d=>y(d.tm_min,2),"%n":()=>`
|
|
3
|
+
`,"%p":d=>d.tm_hour>=0&&d.tm_hour<12?"AM":"PM","%S":d=>y(d.tm_sec,2),"%t":()=>" ","%u":d=>d.tm_wday||7,"%U":d=>{var m=d.tm_yday+7-d.tm_wday;return y(Math.floor(m/7),2)},"%V":d=>{var m=Math.floor((d.tm_yday+7-(d.tm_wday+6)%7)/7);if((d.tm_wday+371-d.tm_yday-2)%7<=2&&m++,m){if(m==53){var x=(d.tm_wday+371-d.tm_yday)%7;x!=4&&(x!=3||!Wt(d.tm_year))&&(m=1)}}else{m=52;var j=(d.tm_wday+7-d.tm_yday-1)%7;(j==4||j==5&&Wt(d.tm_year%400-1))&&m++}return y(m,2)},"%w":d=>d.tm_wday,"%W":d=>{var m=d.tm_yday+7-(d.tm_wday+6)%7;return y(Math.floor(m/7),2)},"%y":d=>(d.tm_year+1900).toString().substring(2),"%Y":d=>d.tm_year+1900,"%z":d=>{var m=d.tm_gmtoff,x=m>=0;return m=Math.abs(m)/60,m=m/60*100+m%60,(x?"+":"-")+("0000"+m).slice(-4)},"%Z":d=>d.tm_zone,"%%":()=>"%"};s=s.replace(/%%/g,"\0\0");for(var l in T)s.includes(l)&&(s=s.replace(new RegExp(l,"g"),T[l](o)));s=s.replace(/\0\0/g,"%");var W=ja(s,!1);return W.length>e?0:(Ia(W,t),W.length-1)},Wa=(t,e,r,n,a)=>Ra(t,e,r,n);xe=c.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},cn(),ht=c.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},bn(),yn(),On(),Ue=c.UnboundTypeError=Mn(Error,"UnboundTypeError"),kn(),Bn();var ka={s:Zr,u:Jr,b:tn,g:en,q:rn,J:nn,f:an,V:on,d:Kr,da:sn,Q:un,_:dn,ca:jn,ba:Rn,w:Wn,Y:Un,x:Ln,h:Yn,L:Nn,M:Gn,t:qn,o:Qn,K:Kn,C:ia,A:sa,ea:ua,$:ca,R:la,ha:te,fa:ha,Z:ga,N:wa,O:$a,aa:ba,B:Ca,X:Ta,W:Ea,T:Oa,U:Fa,E:to,D:La,F:Ka,n:eo,a:Ha,e:za,m:Va,k:Ga,H:Za,v:qa,G:Ja,z:no,P:oo,l:Na,j:Ya,c:Ua,p:Ba,I:Qa,r:ro,i:Xa,y:ao,ga:xa,S:Wa},M=Qr(),rt=c._free=t=>(rt=c._free=M.ka)(t),ie=c._malloc=t=>(ie=c._malloc=M.la)(t),Je=t=>(Je=M.na)(t),P=(t,e)=>(P=M.oa)(t,e),_t=t=>(_t=M.pa)(t),D=()=>(D=M.qa)(),O=t=>(O=M.ra)(t),Ke=t=>(Ke=M.sa)(t),tr=t=>(tr=M.ta)(t),er=(t,e,r)=>(er=M.ua)(t,e,r),rr=t=>(rr=M.va)(t);c.dynCall_viijii=(t,e,r,n,a,o,s)=>(c.dynCall_viijii=M.wa)(t,e,r,n,a,o,s);var nr=c.dynCall_jiiii=(t,e,r,n,a)=>(nr=c.dynCall_jiiii=M.xa)(t,e,r,n,a);c.dynCall_iiiiij=(t,e,r,n,a,o,s)=>(c.dynCall_iiiiij=M.ya)(t,e,r,n,a,o,s),c.dynCall_iiiiijj=(t,e,r,n,a,o,s,u,l)=>(c.dynCall_iiiiijj=M.za)(t,e,r,n,a,o,s,u,l),c.dynCall_iiiiiijj=(t,e,r,n,a,o,s,u,l,f)=>(c.dynCall_iiiiiijj=M.Aa)(t,e,r,n,a,o,s,u,l,f);function Ha(t,e){var r=D();try{return A(t)(e)}catch(n){if(O(r),n!==n+0)throw n;P(1,0)}}function Ba(t,e,r,n){var a=D();try{A(t)(e,r,n)}catch(o){if(O(a),o!==o+0)throw o;P(1,0)}}function Ua(t,e,r){var n=D();try{A(t)(e,r)}catch(a){if(O(n),a!==a+0)throw a;P(1,0)}}function Va(t,e,r,n){var a=D();try{return A(t)(e,r,n)}catch(o){if(O(a),o!==o+0)throw o;P(1,0)}}function La(t,e,r,n,a){var o=D();try{return A(t)(e,r,n,a)}catch(s){if(O(o),s!==s+0)throw s;P(1,0)}}function Ya(t,e){var r=D();try{A(t)(e)}catch(n){if(O(r),n!==n+0)throw n;P(1,0)}}function za(t,e,r){var n=D();try{return A(t)(e,r)}catch(a){if(O(n),a!==a+0)throw a;P(1,0)}}function Na(t){var e=D();try{A(t)()}catch(r){if(O(e),r!==r+0)throw r;P(1,0)}}function Ga(t,e,r,n,a){var o=D();try{return A(t)(e,r,n,a)}catch(s){if(O(o),s!==s+0)throw s;P(1,0)}}function Xa(t,e,r,n,a,o,s,u,l,f,h){var v=D();try{A(t)(e,r,n,a,o,s,u,l,f,h)}catch(y){if(O(v),y!==y+0)throw y;P(1,0)}}function qa(t,e,r,n,a,o,s){var u=D();try{return A(t)(e,r,n,a,o,s)}catch(l){if(O(u),l!==l+0)throw l;P(1,0)}}function Qa(t,e,r,n,a){var o=D();try{A(t)(e,r,n,a)}catch(s){if(O(o),s!==s+0)throw s;P(1,0)}}function Za(t,e,r,n,a,o){var s=D();try{return A(t)(e,r,n,a,o)}catch(u){if(O(s),u!==u+0)throw u;P(1,0)}}function Ja(t,e,r,n,a,o,s,u){var l=D();try{return A(t)(e,r,n,a,o,s,u)}catch(f){if(O(l),f!==f+0)throw f;P(1,0)}}function Ka(t,e,r,n){var a=D();try{return A(t)(e,r,n)}catch(o){if(O(a),o!==o+0)throw o;P(1,0)}}function to(t,e,r,n){var a=D();try{return A(t)(e,r,n)}catch(o){if(O(a),o!==o+0)throw o;P(1,0)}}function eo(t){var e=D();try{return A(t)()}catch(r){if(O(e),r!==r+0)throw r;P(1,0)}}function ro(t,e,r,n,a,o,s,u){var l=D();try{A(t)(e,r,n,a,o,s,u)}catch(f){if(O(l),f!==f+0)throw f;P(1,0)}}function no(t,e,r,n,a,o,s,u,l,f,h,v){var y=D();try{return A(t)(e,r,n,a,o,s,u,l,f,h,v)}catch(w){if(O(y),w!==w+0)throw w;P(1,0)}}function ao(t,e,r,n,a,o,s,u,l,f,h,v,y,w,E,F){var T=D();try{A(t)(e,r,n,a,o,s,u,l,f,h,v,y,w,E,F)}catch(W){if(O(T),W!==W+0)throw W;P(1,0)}}function oo(t,e,r,n,a){var o=D();try{return nr(t,e,r,n,a)}catch(s){if(O(o),s!==s+0)throw s;P(1,0)}}var kt;yt=function t(){kt||ar(),kt||(yt=t)};function ar(){if(ot>0||(Hr(),ot>0))return;function t(){kt||(kt=!0,c.calledRun=!0,!mt&&(Br(),$(c),c.onRuntimeInitialized&&c.onRuntimeInitialized(),Ur()))}c.setStatus?(c.setStatus("Running..."),setTimeout(function(){setTimeout(function(){c.setStatus("")},1),t()},1)):t()}if(c.preInit)for(typeof c.preInit=="function"&&(c.preInit=[c.preInit]);c.preInit.length>0;)c.preInit.pop()();return ar(),p.ready}})();function jr(i){return Ut(Pt,i)}function Ir(i){return xr(Pt,i)}async function Rr(i,p){return Sr(Pt,i,p)}async function Wr(i,p){return Mr(Pt,i,p)}class kr extends EventTarget{constructor(c={}){var $;super();ur(this,ct,void 0);try{const g=($=c==null?void 0:c.formats)==null?void 0:$.filter(b=>b!=="unknown");if((g==null?void 0:g.length)===0)throw new TypeError("Hint option provided, but is empty.");g==null||g.forEach(b=>{if(!nt.has(b))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${b}' is not a valid enum value of type BarcodeFormat.`)}),cr(this,ct,g!=null?g:[]),jr().then(b=>{this.dispatchEvent(new CustomEvent("load",{detail:b}))}).catch(b=>{this.dispatchEvent(new CustomEvent("error",{detail:b}))})}catch(g){throw ye(g,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return z.filter(c=>c!=="unknown")}async detect(c){try{const $=await vr(c);if($===null)return[];let g;try{me($)?g=await Rr($,{tryHarder:!0,formats:se(this,ct).map(b=>nt.get(b))}):g=await Wr($,{tryHarder:!0,formats:se(this,ct).map(b=>nt.get(b))})}catch(b){throw console.error(b),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return g.map(b=>{const{topLeft:{x:U,y:N},topRight:{x:V,y:S},bottomLeft:{x:G,y:Q},bottomRight:{x:L,y:K}}=b.position,at=Math.min(U,V,G,L),mt=Math.min(N,S,Q,K),Y=Math.max(U,V,G,L),k=Math.max(N,S,Q,K);return{boundingBox:new DOMRectReadOnly(at,mt,Y-at,k-mt),rawValue:b.text,format:lr(b.format),cornerPoints:[{x:U,y:N},{x:V,y:S},{x:L,y:K},{x:G,y:Q}]}})}catch($){throw ye($,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return ct=new WeakMap,I.BarcodeDetector=kr,I.setZXingModuleOverrides=Ir,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"}),I}({});
|