@scandit/web-datacapture-label 7.5.0 → 7.5.1

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.
Files changed (57) hide show
  1. package/build/js/api/LabelCaptureValidationFlowOverlay.js +1 -1
  2. package/build/js/chunks/{chunk-B6LTA5XL.js → chunk-2TZIERFQ.js} +1 -1
  3. package/build/js/chunks/chunk-5LEX3KID.js +1 -0
  4. package/build/js/chunks/{chunk-PB6TETN2.js → chunk-6CE6XSPR.js} +1 -1
  5. package/build/js/chunks/chunk-FAENA7EU.js +2 -0
  6. package/build/js/chunks/{chunk-MGSZ4ASN.js → chunk-KJXYUFEN.js} +1 -1
  7. package/build/js/chunks/{chunk-U3WTMY4D.js → chunk-ZZ2WDJJ6.js} +1 -1
  8. package/build/js/index.js +1 -1
  9. package/build/js/moduleLoader.js +1 -1
  10. package/build/js/private/viewfinderTranslator.js +1 -1
  11. package/build/js/ui/atoms/TextInput.js +1 -1
  12. package/build/js/worker/LabelCaptureWorkerManager.js +1 -1
  13. package/build/js/worker/WorkerMain.js +1 -1
  14. package/build/js/worker/dataCaptureEngine.js +1 -1
  15. package/build/js/worker/labelCapture.inlineWorker.js +1 -1
  16. package/build/js/worker/proxies/AimerViewfinderProxy.js +1 -1
  17. package/build/js/worker/proxies/BarcodeFieldProxy.js +1 -1
  18. package/build/js/worker/proxies/CapturedLabelProxy.js +1 -1
  19. package/build/js/worker/proxies/CustomBarcodeProxy.js +1 -1
  20. package/build/js/worker/proxies/CustomTextProxy.js +1 -1
  21. package/build/js/worker/proxies/ExpiryDateTextProxy.js +1 -1
  22. package/build/js/worker/proxies/ImeiOneBarcodeProxy.js +1 -1
  23. package/build/js/worker/proxies/ImeiTwoBarcodeProxy.js +1 -1
  24. package/build/js/worker/proxies/LabelCaptureAdvancedOverlayProxy.js +1 -1
  25. package/build/js/worker/proxies/LabelCaptureBasicOverlayProxy.js +1 -1
  26. package/build/js/worker/proxies/LabelCaptureHelperProxy.js +1 -1
  27. package/build/js/worker/proxies/LabelCaptureOverlayHelperProxy.js +1 -1
  28. package/build/js/worker/proxies/LabelCaptureProxy.js +1 -1
  29. package/build/js/worker/proxies/LabelCaptureSessionProxy.js +1 -1
  30. package/build/js/worker/proxies/LabelCaptureSettingsProxy.js +1 -1
  31. package/build/js/worker/proxies/LabelDefinitionProxy.js +1 -1
  32. package/build/js/worker/proxies/LabelFieldDefinitionProxy.js +1 -1
  33. package/build/js/worker/proxies/LabelFieldLocationProxy.js +1 -1
  34. package/build/js/worker/proxies/LabelFieldProxy.js +1 -1
  35. package/build/js/worker/proxies/NativeProxy.js +1 -1
  36. package/build/js/worker/proxies/NoViewfinderProxy.js +1 -1
  37. package/build/js/worker/proxies/PackingDateTextProxy.js +1 -1
  38. package/build/js/worker/proxies/PartNumberBarcodeProxy.js +1 -1
  39. package/build/js/worker/proxies/RectangularViewfinderAnimationProxy.js +1 -1
  40. package/build/js/worker/proxies/RectangularViewfinderProxy.js +1 -1
  41. package/build/js/worker/proxies/SerialNumberBarcodeProxy.js +1 -1
  42. package/build/js/worker/proxies/TotalPriceTextProxy.js +1 -1
  43. package/build/js/worker/proxies/UnitPriceTextProxy.js +1 -1
  44. package/build/js/worker/proxies/ValidationFlowOverlayProxy.js +1 -1
  45. package/build/js/worker/proxies/ValidationFlowSettingsProxy.js +1 -1
  46. package/build/js/worker/proxies/WeightTextProxy.js +1 -1
  47. package/package.json +2 -2
  48. package/sdc-lib/scandit-datacapture-sdk-label-pthreads.js +1 -1
  49. package/sdc-lib/scandit-datacapture-sdk-label-pthreads.wasm +0 -0
  50. package/sdc-lib/scandit-datacapture-sdk-label-simd-pthreads.js +1 -1
  51. package/sdc-lib/scandit-datacapture-sdk-label-simd-pthreads.wasm +0 -0
  52. package/sdc-lib/scandit-datacapture-sdk-label-simd.js +1 -1
  53. package/sdc-lib/scandit-datacapture-sdk-label-simd.wasm +0 -0
  54. package/sdc-lib/scandit-datacapture-sdk-label.js +1 -1
  55. package/sdc-lib/scandit-datacapture-sdk-label.wasm +0 -0
  56. package/build/js/chunks/chunk-XGYW75UY.js +0 -1
  57. package/build/js/chunks/chunk-Y52JRZ4T.js +0 -2
@@ -1 +1 @@
1
- export{a as LabelCaptureValidationFlowOverlay}from'../chunks/chunk-U3WTMY4D.js';
1
+ export{a as LabelCaptureValidationFlowOverlay}from'../chunks/chunk-ZZ2WDJJ6.js';
@@ -1 +1 @@
1
- import {a}from'./chunk-Y52JRZ4T.js';import {a as a$1}from'./chunk-L6U6LZ6D.js';function l(){return {moduleName:"LabelCapture",load:async t=>{let e=t,r=await a.create({...e,libraryLocation:e.libraryLocation});return a$1.set("LabelCapture",r),r}}}export{l as a};
1
+ import {a}from'./chunk-FAENA7EU.js';import {a as a$1}from'./chunk-L6U6LZ6D.js';function l(){return {moduleName:"LabelCapture",load:async t=>{let e=t,r=await a.create({...e,libraryLocation:e.libraryLocation});return a$1.set("LabelCapture",r),r}}}export{l as a};
@@ -0,0 +1 @@
1
+ var t={"scandit-datacapture-sdk-label-simd-pthreads.wasm":{bytes:7835952},"scandit-datacapture-sdk-label-pthreads.wasm":{bytes:7894308},"scandit-datacapture-sdk-label-simd.wasm":{bytes:7720700},"scandit-datacapture-sdk-label.wasm":{bytes:7779342}};export{t as a};
@@ -7,4 +7,4 @@ import {AimerSvgIcon}from'@scandit/web-datacapture-core/build/js/private/ui/atom
7
7
  </div>
8
8
  <div class="error-message"></div>
9
9
  </label>
10
- `,r=class r extends ScanditHTMLElement{constructor(){super();this._inputElement=null;this._labelText=null;this._labelContainer=null;this._errorMessageElement=null;this._iconContainerElement=null;this._type="text";this._value="";this._label="";this._locale=navigator.language||"en-US";this._currencyCode="USD";this._required=false;this._requiredMessage="";this._invalidMessage="";this._handleChange=this._onChange.bind(this);this._handleInput=this._onInput.bind(this);this._handleFocus=this._onFocus.bind(this);this._handleBlur=this._onBlur.bind(this);this._handleCrossIconClick=this._onCrossIconClick.bind(this);this._handleAimerIconClick=this._onAimerIconClick.bind(this);this._handleKeyboardIconClick=this._onKeyboardIconClick.bind(this);this._crossIcon=null;this._aimerIcon=null;this._intlFormatter=null;this._keyboardIcon=null;this._showKeyboardTimeout=void 0;let t=this.attachShadow({mode:"open"});t.innerHTML=v,t.appendChild(r.createStyleElement()),this._inputElement=t.querySelector(".text-input"),this._labelText=t.querySelector(".label-text"),this._labelContainer=t.querySelector("label"),this._errorMessageElement=t.querySelector(".error-message"),this._iconContainerElement=t.querySelector(".icon-container");}get value(){return this._value}set value(t){var e;this._value=t,this._inputElement&&(this._inputElement.value=this._formatValue(t),(e=this._labelContainer)==null||e.classList.toggle("has-value",t.length>0),this._updateIconVisibility());}get name(){var t;return ((t=this._inputElement)==null?void 0:t.name)||""}set name(t){this._inputElement&&this._labelContainer&&(this._labelContainer.htmlFor=t,this._inputElement.name=t);}get type(){return this._type}set type(t){this._type=t,this._inputElement&&this._value&&(this._inputElement.value=this._formatValue(this._value)),this._inputElement&&(this._type==="currency"?(this._inputElement.inputMode="numeric",this._inputElement.setAttribute("aria-role","textbox"),this._inputElement.setAttribute("aria-description","Currency input")):this._type==="date"&&(this._inputElement.inputMode="numeric",this._inputElement.setAttribute("aria-role","textbox"),this._inputElement.setAttribute("aria-description","Date input")));}get label(){return this._label}set label(t){this._label=t,this._labelText.textContent=t;}get locale(){return this._locale}set locale(t){this._locale=t,this._intlFormatter=new Intl.NumberFormat(this._locale,{style:"currency",currency:this._currencyCode,currencyDisplay:"symbol"}),this._inputElement&&this._value&&(this._inputElement.value=this._formatValue(this._value));}get currencyCode(){return this._currencyCode}set currencyCode(t){this._currencyCode=t,this._intlFormatter=new Intl.NumberFormat(this._locale,{style:"currency",currency:this._currencyCode,currencyDisplay:"symbol"}),this._type==="currency"&&this._inputElement&&this._value&&(this._inputElement.value=this._formatValue(this._value));}get required(){var t,e,i;return (i=(e=(t=this._inputElement)==null?void 0:t.required)!=null?e:this._required)!=null?i:false}set required(t){this._required=t,this._inputElement&&(this._inputElement.required=t);}get invalid(){return this.hasAttribute("invalid")}set invalid(t){this.toggleAttribute("invalid",t);}get errorMessage(){var t;return ((t=this._errorMessageElement)==null?void 0:t.textContent)||""}set errorMessage(t){this._errorMessageElement&&(this._errorMessageElement.textContent=t);}_formatValue(t){var e,i;if(!t)return "";switch(this._type){case "currency":try{let n=Number.parseFloat(t.replace(/[^\d.-]/g,""));return Number.isNaN(n)?t:(i=(e=this._intlFormatter)==null?void 0:e.format(n))!=null?i:t}catch(n){return t.startsWith("$")?t:`$${t}`}case "date":try{let n=new Date(t);return Number.isNaN(n.getTime())?t:n.toLocaleDateString(this._locale,{year:"numeric",month:"2-digit",day:"2-digit"})}catch(n){return t}default:return t}}_onInput(t){var i;if(!this._inputElement)return;let e=t.target;(i=this._labelContainer)==null||i.classList.toggle("has-value",e.value.length>0),this._updateIconVisibility();}_onChange(t){if(!this._inputElement)return;let i=t.target.value;this.value=i,this.dispatchEvent(new CustomEvent("text-input-change",{bubbles:true,composed:true,detail:{target:this,innerInput:this._inputElement,value:this._value,formattedValue:this._inputElement.value}}));}_onFocus(t){this.setAttribute("focused",""),this._updateIconVisibility(),this.dispatchEvent(new CustomEvent("text-input-focus",{detail:{target:this,innerInput:this._inputElement},bubbles:true,composed:true}));}_onBlur(){this.removeAttribute("focused"),this._inputElement&&this._value&&(this._inputElement.value=this._formatValue(this._value)),this.dispatchEvent(new CustomEvent("text-input-blur",{detail:{target:this,innerInput:this._inputElement},bubbles:true,composed:true})),setTimeout(()=>{this._updateIconVisibility();},500);}focus(t){this._inputElement&&this._inputElement.focus(t);}showKeyboard(t=100,e){var i;if(this._inputElement){let n=document.createElement("input");n.style.position="absolute",n.style.top=`${this._inputElement.offsetTop+7}px`,n.style.left=`${this._inputElement.offsetLeft}px`,n.style.height="0",n.style.opacity="0",document.body.appendChild(n),n.focus(),(i=this._showKeyboardTimeout)==null||i.stop(),this._showKeyboardTimeout=new Timeout(t,()=>{var s,o;n.focus(),(s=this._inputElement)==null||s.focus(),(o=this._inputElement)==null||o.scrollIntoView({behavior:"smooth",block:"center",inline:"center"}),document.body.removeChild(n),e==null||e();}),this._showKeyboardTimeout.start();}}hideKeyboard(){var t;(t=this._inputElement)==null||t.blur();}select(){var t,e;(e=(t=this._inputElement)==null?void 0:t.select)==null||e.call(t);}blur(){var t,e;(e=(t=this._inputElement)==null?void 0:t.blur)==null||e.call(t);}scrollIntoView(t){var e;(e=this._inputElement)==null||e.scrollIntoView(t);}connectedCallback(){var t,e,i;if(this.hasAttribute("label")&&(this.label=this.getAttribute("label")||""),this.hasAttribute("type")){let n=this.getAttribute("type");(n==="text"||n==="date"||n==="currency")&&(this.type=n);}this.hasAttribute("value")&&(this.value=this.getAttribute("value")||""),this.hasAttribute("locale")&&(this.locale=this.getAttribute("locale")||navigator.language||"en-US"),this.hasAttribute("currency-code")&&(this.currencyCode=this.getAttribute("currency-code")||"USD"),this.hasAttribute("required")&&(this.required=this.getAttribute("required")!==null),this.hasAttribute("error-message")&&this._errorMessageElement&&(this._errorMessageElement.textContent=this.getAttribute("error-message")||""),this._crossIcon=RoundedCrossSvgIcon.create(),this._crossIcon.size=24,(t=this._iconContainerElement)==null||t.appendChild(this._crossIcon),this._aimerIcon=AimerSvgIcon.create(),this._aimerIcon.size=24,(e=this._iconContainerElement)==null||e.appendChild(this._aimerIcon),this._keyboardIcon=KeyboardSvgIcon.create(),this._keyboardIcon.size=24,(i=this._iconContainerElement)==null||i.appendChild(this._keyboardIcon),this._intlFormatter=new Intl.NumberFormat(this._locale,{style:"currency",currency:this._currencyCode,currencyDisplay:"symbol"}),this._setupEventListeners(),this._updateIconVisibility();}disconnectedCallback(){var t,e,i;this._removeEventListeners(),(t=this._crossIcon)==null||t.remove(),(e=this._aimerIcon)==null||e.remove(),(i=this._keyboardIcon)==null||i.remove();}_setupEventListeners(){var t,e,i;this._inputElement&&(this._inputElement.addEventListener("input",this._handleInput),this._inputElement.addEventListener("change",this._handleChange),this._inputElement.addEventListener("focus",this._handleFocus),this._inputElement.addEventListener("blur",this._handleBlur),(t=this._crossIcon)==null||t.addEventListener("click",this._handleCrossIconClick,{capture:true}),(e=this._aimerIcon)==null||e.addEventListener("click",this._handleAimerIconClick,{capture:true}),(i=this._keyboardIcon)==null||i.addEventListener("click",this._handleKeyboardIconClick,{capture:true}));}_removeEventListeners(){var t,e,i;this._inputElement&&(this._inputElement.removeEventListener("input",this._handleInput),this._inputElement.removeEventListener("change",this._handleChange),this._inputElement.removeEventListener("focus",this._handleFocus),this._inputElement.removeEventListener("blur",this._handleBlur),(t=this._crossIcon)==null||t.removeEventListener("click",this._handleCrossIconClick,{capture:true}),(e=this._aimerIcon)==null||e.removeEventListener("click",this._handleAimerIconClick,{capture:true}),(i=this._keyboardIcon)==null||i.removeEventListener("click",this._handleKeyboardIconClick,{capture:true}));}_onCrossIconClick(t){!t||!this._crossIcon||(t.preventDefault(),t.stopPropagation(),this.dispatchEvent(new CustomEvent("text-input-clear-icon-click",{bubbles:true,composed:true,detail:{target:this,innerInput:this._inputElement}})));}_onAimerIconClick(t){!t||!this._aimerIcon||(t.stopPropagation(),t.preventDefault(),this.dispatchEvent(new CustomEvent("text-input-aimer-icon-click",{bubbles:true,composed:true,detail:{target:this,innerInput:this._inputElement}})));}_onKeyboardIconClick(t){!t||!this._keyboardIcon||(t.stopPropagation(),t.preventDefault(),this.dispatchEvent(new CustomEvent("text-input-keyboard-icon-click",{bubbles:true,composed:true,detail:{target:this,innerInput:this._inputElement}})));}_updateIconVisibility(){var i;if(!this._crossIcon||!this._aimerIcon||!this._keyboardIcon)return;let t=(i=this._labelContainer)==null?void 0:i.classList.contains("has-value"),e=this.hasAttribute("focused");this._crossIcon.style.display=t?"block":"none",this._aimerIcon.style.display=e&&!t?"block":"none",this._keyboardIcon.style.display=!e&&!t?"block":"none";}static create(){return document.createElement(r.tag)}static register(){defineCustomElements({[r.tag]:r});}static createStyleElement(){return css`:host{display:block;font-family:Noto Sans,Open Sans,sans-serif}.text-input-container{display:flex;flex-direction:column;width:100%}.label-text{color:#000;font-size:.75rem;font-style:normal;font-weight:400;margin-bottom:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.input-wrapper{align-items:center;border-bottom:1px solid #000;display:flex;gap:.5rem;height:1.75rem;overflow:hidden;position:relative;transition:border-color .2s ease-in-out;width:100%}.text-input{background-color:transparent;border:none;cursor:pointer;flex:1;font-size:1rem;font-style:normal;font-weight:700;padding:0;-webkit-tap-highlight-color:transparent;-webkit-appearance:none;appearance:none;user-select:none;-webkit-user-select:none}.text-input,.text-input:focus{outline:none}.text-input:focus-visible{outline:none}:host([focused]) .input-wrapper{border-color:#000}:host ${AimerSvgIcon.tag},:host ${RoundedCrossSvgIcon.tag},:host ${KeyboardSvgIcon.tag}{cursor:pointer;pointer-events:auto}:host([invalid]) .input-wrapper{border-color:#${SecondaryRed100.toJSON()}}.error-message{color:#${SecondaryRed100.toJSON()};font-size:.75rem;margin-top:.25rem;min-height:1rem;opacity:0;transition:opacity .35s ease-in-out}:host([invalid]) .error-message{opacity:1}.icon-container{align-items:center;cursor:pointer;display:flex;height:1.5rem;justify-content:center;width:1.5rem}`}};r.tag="scandit-text-input";var p=r;export{p as a};
10
+ `,r=class r extends ScanditHTMLElement{constructor(){super();this._inputElement=null;this._labelText=null;this._labelContainer=null;this._errorMessageElement=null;this._iconContainerElement=null;this._type="text";this._value="";this._label="";this._locale=navigator.language||"en-US";this._currencyCode="USD";this._required=false;this._requiredMessage="";this._invalidMessage="";this._handleChange=this._onChange.bind(this);this._handleInput=this._onInput.bind(this);this._handleFocus=this._onFocus.bind(this);this._handleBlur=this._onBlur.bind(this);this._handleCrossIconClick=this._onCrossIconClick.bind(this);this._handleAimerIconClick=this._onAimerIconClick.bind(this);this._handleKeyboardIconClick=this._onKeyboardIconClick.bind(this);this._crossIcon=null;this._aimerIcon=null;this._intlFormatter=null;this._keyboardIcon=null;this._showKeyboardTimeout=void 0;let t=this.attachShadow({mode:"open"});t.innerHTML=v,t.appendChild(r.createStyleElement()),this._inputElement=t.querySelector(".text-input"),this._labelText=t.querySelector(".label-text"),this._labelContainer=t.querySelector("label"),this._errorMessageElement=t.querySelector(".error-message"),this._iconContainerElement=t.querySelector(".icon-container");}get value(){return this._value}set value(t){var e;this._value=t,this._inputElement&&(this._inputElement.value=this._formatValue(t),(e=this._labelContainer)==null||e.classList.toggle("has-value",t.length>0),this._updateIconVisibility());}get name(){var t;return ((t=this._inputElement)==null?void 0:t.name)||""}set name(t){this._inputElement&&this._labelContainer&&(this._labelContainer.htmlFor=t,this._inputElement.name=t);}get type(){return this._type}set type(t){this._type=t,this._inputElement&&this._value&&(this._inputElement.value=this._formatValue(this._value)),this._inputElement&&(this._type==="currency"?(this._inputElement.inputMode="numeric",this._inputElement.setAttribute("aria-role","textbox"),this._inputElement.setAttribute("aria-description","Currency input")):this._type==="date"&&(this._inputElement.inputMode="numeric",this._inputElement.setAttribute("aria-role","textbox"),this._inputElement.setAttribute("aria-description","Date input")));}get label(){return this._label}set label(t){this._label=t,this._labelText.textContent=t;}get locale(){return this._locale}set locale(t){this._locale=t,this._intlFormatter=new Intl.NumberFormat(this._locale,{style:"currency",currency:this._currencyCode,currencyDisplay:"symbol"}),this._inputElement&&this._value&&(this._inputElement.value=this._formatValue(this._value));}get currencyCode(){return this._currencyCode}set currencyCode(t){this._currencyCode=t,this._intlFormatter=new Intl.NumberFormat(this._locale,{style:"currency",currency:this._currencyCode,currencyDisplay:"symbol"}),this._type==="currency"&&this._inputElement&&this._value&&(this._inputElement.value=this._formatValue(this._value));}get required(){var t,e,i;return (i=(e=(t=this._inputElement)==null?void 0:t.required)!=null?e:this._required)!=null?i:false}set required(t){this._required=t,this._inputElement&&(this._inputElement.required=t);}get invalid(){return this.hasAttribute("invalid")}set invalid(t){this.toggleAttribute("invalid",t);}get errorMessage(){var t;return ((t=this._errorMessageElement)==null?void 0:t.textContent)||""}set errorMessage(t){this._errorMessageElement&&(this._errorMessageElement.textContent=t);}_formatValue(t){var e,i;if(!t)return "";switch(this._type){case "currency":try{let n=Number.parseFloat(t.replace(/[^\d.-]/g,""));return Number.isNaN(n)?t:(i=(e=this._intlFormatter)==null?void 0:e.format(n))!=null?i:t}catch(n){return t.startsWith("$")?t:`$${t}`}case "date":try{let n=new Date(t);return Number.isNaN(n.getTime())?t:n.toLocaleDateString(this._locale,{year:"numeric",month:"2-digit",day:"2-digit"})}catch(n){return t}default:return t}}_onInput(t){var i;if(!this._inputElement)return;let e=t.target;(i=this._labelContainer)==null||i.classList.toggle("has-value",e.value.length>0),this._updateIconVisibility();}_onChange(t){if(!this._inputElement)return;let i=t.target.value;this.value=i,this.dispatchEvent(new CustomEvent("text-input-change",{bubbles:true,composed:true,detail:{target:this,innerInput:this._inputElement,value:this._value,formattedValue:this._inputElement.value}}));}_onFocus(t){this.setAttribute("focused",""),this._updateIconVisibility(),this.dispatchEvent(new CustomEvent("text-input-focus",{detail:{target:this,innerInput:this._inputElement},bubbles:true,composed:true}));}_onBlur(){this.removeAttribute("focused"),this._inputElement&&this._value&&(this._inputElement.value=this._formatValue(this._value)),this.dispatchEvent(new CustomEvent("text-input-blur",{detail:{target:this,innerInput:this._inputElement},bubbles:true,composed:true})),setTimeout(()=>{this._updateIconVisibility();},500);}focus(t){this._inputElement&&this._inputElement.focus(t);}showKeyboard(t=100,e){var i;if(this._inputElement){let n=document.createElement("input");n.style.position="absolute",n.style.top=`${this._inputElement.offsetTop+7}px`,n.style.left=`${this._inputElement.offsetLeft}px`,n.style.height="0",n.style.opacity="0",document.body.appendChild(n),n.focus(),(i=this._showKeyboardTimeout)==null||i.stop(),this._showKeyboardTimeout=new Timeout(t,()=>{var s,o;n.focus(),(s=this._inputElement)==null||s.focus(),(o=this._inputElement)==null||o.scrollIntoView({behavior:"smooth",block:"center",inline:"center"}),document.body.removeChild(n),e==null||e();}),this._showKeyboardTimeout.start();}}hideKeyboard(){var t;(t=this._inputElement)==null||t.blur();}select(){var t,e;(e=(t=this._inputElement)==null?void 0:t.select)==null||e.call(t);}blur(){var t,e;(e=(t=this._inputElement)==null?void 0:t.blur)==null||e.call(t);}scrollIntoView(t){var e;(e=this._inputElement)==null||e.scrollIntoView(t);}connectedCallback(){var t,e,i;if(this.hasAttribute("label")&&(this.label=this.getAttribute("label")||""),this.hasAttribute("type")){let n=this.getAttribute("type");(n==="text"||n==="date"||n==="currency")&&(this.type=n);}this.hasAttribute("value")&&(this.value=this.getAttribute("value")||""),this.hasAttribute("locale")&&(this.locale=this.getAttribute("locale")||navigator.language||"en-US"),this.hasAttribute("currency-code")&&(this.currencyCode=this.getAttribute("currency-code")||"USD"),this.hasAttribute("required")&&(this.required=this.getAttribute("required")!==null),this.hasAttribute("error-message")&&this._errorMessageElement&&(this._errorMessageElement.textContent=this.getAttribute("error-message")||""),this._crossIcon=RoundedCrossSvgIcon.create(),this._crossIcon.size=24,(t=this._iconContainerElement)==null||t.appendChild(this._crossIcon),this._aimerIcon=AimerSvgIcon.create(),this._aimerIcon.size=24,(e=this._iconContainerElement)==null||e.appendChild(this._aimerIcon),this._keyboardIcon=KeyboardSvgIcon.create(),this._keyboardIcon.size=24,(i=this._iconContainerElement)==null||i.appendChild(this._keyboardIcon),this._intlFormatter=new Intl.NumberFormat(this._locale,{style:"currency",currency:this._currencyCode,currencyDisplay:"symbol"}),this._setupEventListeners(),this._updateIconVisibility();}disconnectedCallback(){var t,e,i;this._removeEventListeners(),(t=this._crossIcon)==null||t.remove(),(e=this._aimerIcon)==null||e.remove(),(i=this._keyboardIcon)==null||i.remove();}_setupEventListeners(){var t,e,i;this._inputElement&&(this._inputElement.addEventListener("input",this._handleInput),this._inputElement.addEventListener("change",this._handleChange),this._inputElement.addEventListener("focus",this._handleFocus),this._inputElement.addEventListener("blur",this._handleBlur),(t=this._crossIcon)==null||t.addEventListener("click",this._handleCrossIconClick,{capture:true}),(e=this._aimerIcon)==null||e.addEventListener("click",this._handleAimerIconClick,{capture:true}),(i=this._keyboardIcon)==null||i.addEventListener("click",this._handleKeyboardIconClick,{capture:true}));}_removeEventListeners(){var t,e,i;this._inputElement&&(this._inputElement.removeEventListener("input",this._handleInput),this._inputElement.removeEventListener("change",this._handleChange),this._inputElement.removeEventListener("focus",this._handleFocus),this._inputElement.removeEventListener("blur",this._handleBlur),(t=this._crossIcon)==null||t.removeEventListener("click",this._handleCrossIconClick,{capture:true}),(e=this._aimerIcon)==null||e.removeEventListener("click",this._handleAimerIconClick,{capture:true}),(i=this._keyboardIcon)==null||i.removeEventListener("click",this._handleKeyboardIconClick,{capture:true}));}_onCrossIconClick(t){!t||!this._crossIcon||(t.preventDefault(),t.stopPropagation(),this.dispatchEvent(new CustomEvent("text-input-clear-icon-click",{bubbles:true,composed:true,detail:{target:this,innerInput:this._inputElement}})));}_onAimerIconClick(t){!t||!this._aimerIcon||(t.stopPropagation(),t.preventDefault(),this.dispatchEvent(new CustomEvent("text-input-aimer-icon-click",{bubbles:true,composed:true,detail:{target:this,innerInput:this._inputElement}})));}_onKeyboardIconClick(t){!t||!this._keyboardIcon||(t.stopPropagation(),t.preventDefault(),this.dispatchEvent(new CustomEvent("text-input-keyboard-icon-click",{bubbles:true,composed:true,detail:{target:this,innerInput:this._inputElement}})));}_updateIconVisibility(){var i;if(!this._crossIcon||!this._aimerIcon||!this._keyboardIcon)return;let t=(i=this._labelContainer)==null?void 0:i.classList.contains("has-value"),e=this.hasAttribute("focused");this._crossIcon.style.display=t?"block":"none",this._aimerIcon.style.display=e&&!t?"block":"none",this._keyboardIcon.style.display=!e&&!t?"block":"none";}static create(){return document.createElement(r.tag)}static register(){defineCustomElements({[r.tag]:r});}static createStyleElement(){return css`:host{display:block;font-family:Noto Sans,Open Sans,sans-serif}.text-input-container{display:flex;flex-direction:column;width:100%}.label-text{color:#000;font-size:.75rem;font-style:normal;font-weight:400;margin-bottom:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.input-wrapper{align-items:center;border-bottom:1px solid #000;display:flex;gap:.5rem;height:1.75rem;overflow:hidden;position:relative;transition:border-color .2s ease-in-out;width:100%}.text-input{background-color:initial;border:none;cursor:pointer;flex:1;font-size:1rem;font-style:normal;font-weight:700;padding:0;-webkit-tap-highlight-color:transparent;-webkit-appearance:none;appearance:none;user-select:none;-webkit-user-select:none}.text-input,.text-input:focus{outline:none}.text-input:focus-visible{outline:none}:host([focused]) .input-wrapper{border-color:#000}:host ${AimerSvgIcon.tag},:host ${RoundedCrossSvgIcon.tag},:host ${KeyboardSvgIcon.tag}{cursor:pointer;pointer-events:auto}:host([invalid]) .input-wrapper{border-color:#${SecondaryRed100.toJSON()}}.error-message{color:#${SecondaryRed100.toJSON()};font-size:.75rem;margin-top:.25rem;min-height:1rem;opacity:0;transition:opacity .35s ease-in-out}:host([invalid]) .error-message{opacity:1}.icon-container{align-items:center;cursor:pointer;display:flex;height:1.5rem;justify-content:center;width:1.5rem}`}};r.tag="scandit-text-input";var p=r;export{p as a};
@@ -0,0 +1,2 @@
1
+ import {DataCaptureLoader,Logger}from'@scandit/web-datacapture-core';function s(n){let i=URL.createObjectURL(new Blob(['"use strict";(()=>{var ia=(i,a)=>()=>(i&&(a=i(i=0)),a);var d,o=ia(()=>{d={"scandit-datacapture-sdk-label-simd-pthreads.wasm":{bytes:7835952},"scandit-datacapture-sdk-label-pthreads.wasm":{bytes:7894308},"scandit-datacapture-sdk-label-simd.wasm":{bytes:7720700},"scandit-datacapture-sdk-label.wasm":{bytes:7779342}}});o();o();o();o();o();function Z(i){return typeof i=="object"&&i!=null}function Y(i){if(typeof i=="string")return i;if(Z(i)){if(typeof i.message=="string")return i.message}else if(typeof(i==null?void 0:i.toString)=="function")return i.toString();return"unknown error"}o();o();var u;(i=>{(y=>(y.Debug="debug",y.Info="info",y.Warn="warn",y.Error="error",y.Quiet="quiet"))(i.Level||(i.Level={}));let a=new Map([["debug",1],["info",2],["warn",3],["error",4],["quiet",5]]),e="debug";function t(y){e=y}i.setLevel=t;function r(y,...m){if(!(a.get(e)>a.get(y)))switch(y){case"debug":{console.debug(...m);break}case"info":{console.log(...m);break}case"warn":{console.warn(...m);break}case"error":{console.error(...m);break}}}i.log=r;function n(...y){r("warn",...y)}i.warn=n;function s(...y){r("debug",...y)}i.debug=s;function l(...y){r("info",...y)}i.info=l;function p(...y){r("error",...y)}i.error=p})(u||(u={}));o();o();var na=class{constructor(i){if(typeof i!="function")throw new TypeError("FinalizationRegistry callback must be a function")}register(i,a,e){}unregister(i){return!1}};function yt(i){typeof i.FinalizationRegistry>"u"&&(i.FinalizationRegistry=na)}o();o();function oa(i){return/^https?:\\/\\/(?:[^./]*\\.)*cdn.jsdelivr.net\\//.test(i)?{result:!0,cdnBaseURL:"https://cdn.jsdelivr.net/npm/"}:/^https?:\\/\\/(?:[^./]*\\.)*unpkg.com\\//.test(i)?{result:!0,cdnBaseURL:"https://unpkg.com/"}:{result:!1,cdnBaseURL:""}}function sa(i){let a=/@scandit\\/web-datacapture-[a-z]+/i.exec(i);return a?a[0]:null}function ht(i,a,e){let t=a,r=oa(t);if(r.result){let s=sa(t);s!=null&&(t=`${r.cdnBaseURL}${s}@${i}/sdc-lib/`)}let n=e.replace(".wasm","");return r.result?{jsURI:`${t}${n}.js`,wasmURI:`${t}${n}.wasm`}:{jsURI:`${t}${n}.js?v=${i}`,wasmURI:`${t}${n}.wasm?v=${i}`}}o();o();var ce=class vt extends Error{constructor(a){super(a.message),Object.setPrototypeOf(this,vt.prototype),this.name=a.name}toString(){return`${this.name}: ${this.message}`}};var ue=Promise.resolve(),He=!1,Ne=!1,ee,we={writableDataPath:""};async function gt(i){if(ee==null)return;He=!0;let a=new Promise((e,t)=>{setTimeout(()=>{t(new ce({name:"BlockedIndexedDB",message:"IndexedDB database is blocked"}))},1500)});try{await Promise.race([new Promise((e,t)=>{ee==null||ee(i,r=>{if(r!=null){t(r);return}e()})}),a])}finally{He=!1}}async function bt(i){return Ne||(He?(Ne=!0,ue=ue.then(async()=>(Ne=!1,gt(i)))):ue=gt(i)),ue}async function ft(i){we=i,ee=FS.syncfs,FS.syncfs=(a,e)=>{let t=e,r=()=>{t()},n=s=>{t(s)};bt(a).then(r).catch(n)};try{FS.mkdir(we.writableDataPath)}catch(a){if(a.code!=="EEXIST")throw ee=void 0,a}return FS.mount(IDBFS,{},we.writableDataPath),bt(!0)}o();o();o();var Pt={};function la(i){return[...new Uint8Array(i)].map(a=>{let e=a.toString(16);return e.length===1?`0${e}`:e}).join("")}async function*da(i){let a=i.getReader();try{for(;;){let{done:e,value:t}=await a.read();if(e)return;yield t}}finally{a.releaseLock()}}async function ma(i){let a=[],e=0,t=0;for await(let n of da(i))a.push(n),e+=n.length;let r=new Uint8Array(e);for(let n of a)r.set(n,t),t+=n.length;return r.buffer}var pa=(i=>(i.VALID="VALID",i.INVALID="INVALID",i.NOT_VERIFIABLE="NOT_VERIFIABLE",i))(pa||{});async function ca(i,a,e){if(typeof crypto.subtle.digest!="function")return u.log(u.Level.Warn,`Insecure context (see https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts): The hash of the Scandit Data Capture library WASM file found at ${e} could not be verified`),"NOT_VERIFIABLE";try{let t=i instanceof Promise?await i:i,r=await crypto.subtle.digest("SHA-256",t),n=la(r);return a==null?(u.log(u.Level.Warn,"The library hash is not defined or empty, cannot correctly verify integrity."),"NOT_VERIFIABLE"):n===a?(u.log(u.Level.Debug,`Data Capture library WASM integrity found at ${e} has been verified correctly.`),"VALID"):(u.log(u.Level.Warn,`The Scandit Data Capture library WASM file found at ${e} seems invalid: expected file hash doesn\'t match (received: ${n}, expected: ${a}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),"INVALID")}catch(t){return u.log(u.Level.Warn,"Wasm response could not be verified",t),"NOT_VERIFIABLE"}}var Se=new Map([["br",4.4],["gzip",2.9],["none",1]]);function ua(i){var a;let e="content-encoding";if(i==null||i.get(e)==null)return Se.get("none");let t=new Set(((a=i.get(e))!=null?a:"").split(",").map(r=>r.trim()));for(let[r,n]of Se)if(t.has(r))return n;return Se.get("none")}function ya(i){var a,e;if(i==null)return 0;let t=(a=ua(i))!=null?a:1,r=Number.parseInt((e=i.get("content-length"))!=null?e:"0",10);return Number.isNaN(r)?0:Math.floor(r*t*100)/100}function ha(i){let{pathname:a}=new URL(i);for(let[e,t]of Object.entries(Pt))if(a.endsWith(e))return t.bytes;return 0}function xt(i){Pt=i}var va=(i,a)=>{let e=ya(a);return e===0?ha(i):e};function ga(i,a,e,{onProgress:t,onError:r,onComplete:n}){if(!a.body)return[a];let s=va(i,a.headers),l=0,p=0;if(typeof TransformStream>"u")return u.warn("TransformStream is not supported in this environment. Progress tracking will be disabled."),[a];let[y,m]=e?a.body.tee():[a.body],b=y.pipeThrough(new TransformStream({async transform(g,S){try{l+=g.length,p=Number((l/s*100).toFixed(2)),s>0&&g.length>0&&p<100?t==null||t({percentage:p,loadedBytes:l,privateUri:i}):s===0&&g.length>0&&(t==null||t({percentage:null,loadedBytes:l,privateUri:i})),S.enqueue(g)}catch(J){S.error(J),r==null||r({error:J})}},flush(g){t==null||t({percentage:100,loadedBytes:l,privateUri:i}),n==null||n({percentage:100,loadedBytes:l,privateUri:i}),g.terminate()}}));return[new Response(b,{headers:new Headers(a.headers),status:a.status,statusText:a.statusText}),m]}async function Ce({wasmURI:i,expectedHash:a,verifyResponseHash:e,onProgress:t,onComplete:r,onError:n,referredOrigin:s}){let l=await fetch(i,{referrerPolicy:"origin",referrer:s!=null?s:""});if(!l.ok)throw new Error(`HTTP status code is not ok: ${l.status}, ${l.statusText}`);let[p,y]=ga(i,l,e,{onProgress:t,onError:n,onComplete:r});return y!=null&&ca(ma(y),a,i),p}function Nt({wasmURI:i,expectedHash:a,verifyResponseHash:e,progressCallback:t,successCallback:r,errorCallback:n,importObject:s,referredOrigin:l}){async function p(m){try{let b=await Ce({wasmURI:i,expectedHash:a,verifyResponseHash:e,onProgress:t,referredOrigin:l}),g=await(m!=null?m:b).arrayBuffer(),S=await self.WebAssembly.instantiate(g,s);r(S.instance,S.module)}catch(b){u.log(u.Level.Error,b),u.log(u.Level.Error,`Couldn\'t instantiate Scandit SDK DataCapture library at ${i}, did you configure the path for it correctly?`),n==null||n(b)}}async function y(){let m;try{m=await Ce({wasmURI:i,expectedHash:a,verifyResponseHash:e,onProgress:t,referredOrigin:l});let b=await self.WebAssembly.instantiateStreaming(m,s);r(b.instance,b.module)}catch(b){u.log(u.Level.Warn,b),u.log(u.Level.Warn,"WebAssembly streaming compile failed. Falling back to ArrayBuffer instantiation (this will make things slower)"),p((m==null?void 0:m.bodyUsed)===!0?void 0:m)}}typeof self.WebAssembly.instantiateStreaming=="function"?y():p()}async function Fe(i,a,e,t){return new Promise((r,n)=>{i().then(r).catch(s=>{let l=a*2;if(l>e){n(s);return}t(s),self.setTimeout(()=>{Fe(i,l,e,t).then(r).catch(n)},a)})})}function Ie(i){var a,e;let t="unknown";if((a=i.href)!=null&&a.startsWith("blob:null/"))t="localhost";else{let r=((e=i.pathname)==null?void 0:e.length)>1&&!i.pathname.startsWith("/");t=new URL(r?i.pathname:i.origin).hostname}return t.startsWith("[")&&t.endsWith("]")?(t=t.slice(1,-1),t):(/^(\\d{1,3}\\.){3}\\d{1,3}$/.test(t)&&(t=t.split(".").map(r=>Number.parseInt(r,10).toString()).join(".")),t)}async function wt(i,a){async function e(){return importScripts(i)}try{await Fe(e,250,4e3,r=>{u.log(u.Level.Warn,r),u.log(u.Level.Warn,`Couldn\'t retrieve Scandit Data Capture library at ${i}, retrying...`)}),self.Module.mainScriptUrlOrBlob=i;let t=self.SDC_WASM_JS_VERSION;return t!==a&&u.log(u.Level.Warn,`The Scandit Data Capture library JS file found at ${i} seems invalid: expected version doesn\'t match (received: ${t}, expected: ${a}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),!0}catch(t){return u.log(u.Level.Error,t),!1}}o();var ye;(i=>{function a(){return"7.5.1"}i.sdkVersion=a})(ye||(ye={}));o();var Ht=class{constructor(){this.promise=new Promise((i,a)=>{this.reject=a,this.resolve=i})}};o();var ba=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),fa=()=>(async i=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(i)}catch{return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]));function Pa(){return typeof crossOriginIsolated>"u"?!1:crossOriginIsolated}function xa(){try{return new WebAssembly.Memory({initial:1,maximum:1,shared:!0}).buffer.constructor.name==="SharedArrayBuffer"}catch{return!1}}async function St(){return ba()}async function Na(){if(!await fa())return!1;let i=null;try{i=new Worker(URL.createObjectURL(new Blob([\'postMessage("Worker" in self);\'],{type:"text/javascript"})),{name:"nestedWorkerTest"})}catch{return!1}return new Promise(a=>{if(i==null){a(!1);return}i.onmessage=e=>{i==null||i.terminate(),a(e.data)}})}async function Ct(){let i=await Na();return Pa()&&xa()&&i}var Ft=class It{constructor(a,e){this.hintPresenterV2=null,this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL=10,this.redrawInterval=1e3/30,this.redrawRequests=[],this._isDrawLoopRunning=!1,this.frameDataPool=new Map,this.lastFrameCounter=-1,this.poorMansBenchmarkLogs=!1,this.writableDataPathStandard="/scandit_sync_folder",this.resourceFilesSubfolder="resources",this.performanceMetricsReporterTimer=void 0,this.performanceMetrics={frameDataPoolSize:0,processedFramesCount:0,redrawRequestsCount:0,actualRedrawsCount:0},this.gestureListener=null,this.webPlatformHintPresenter=null,this.moduleHandler=a,this.workerFunctions=e,this._loadProgressCallback=this._loadProgressCallback.bind(this),xt(this.getWasmMetadata())}get Module(){return this.moduleHandler.get()}set isDrawLoopRunning(a){this._isDrawLoopRunning=a,!a&&typeof this.loopTimeoutId=="number"&&(clearTimeout(this.loopTimeoutId),this.loopTimeoutId=void 0)}get isDrawLoopRunning(){return this._isDrawLoopRunning}convertToLoadableFrameData(a){let e=this.getNextFrameId();this.frameDataPool.set(e,new Uint8ClampedArray(a.getFrameData()));let t=this.lastUsedModuleMirrorAxis==null?!1:this.lastUsedModuleMirrorAxis!==this.Module.Axis.None;return{frameId:e,width:a.getWidth(),height:a.getHeight(),isFrameSourceMirrored:t}}createContext(a){var e,t,r,n,s;let l=this.getModeDeserializers(),p=Ie(location);(p==="localhost"||p==="127.0.0.1")&&navigator.userAgent.includes("Electron")&&a.appName!=null&&(p+=`-${a.appName}`),this.parentDomain=a.parentDomain,this.contextDeserializer=new this.Module.DataCaptureContextDeserializer(this.writableDataPath,a.deviceId,a.context.deviceModelName,p,this.parentDomain,l,a.delayedRegistration,a.highEndBlurryRecognition,this.resourcePath);let y=this.contextDeserializer.contextFromJson(JSON.stringify(a.context));if(y==null){let h=this.contextDeserializer.getLastError();throw new Error(`Could not create the context: ${h}`)}let m=y.getView();this.context=y.getContext(),y.delete();let b=this.Module.DataCaptureContextListener.extend("DataCaptureContextListener",{didChangeStatus:(h,I)=>{this.contextDidChangeStatus(JSON.parse(I.toJson())),h.delete()},didStartObservingContext:h=>{this.didStartObservingContext(),h.delete()},didStopObservingContext:h=>{h.delete()}}),g=this.Module.DataCaptureContextFrameListener.extend("DataCaptureContextFrameListener",{onObservationStarted:h=>{h.delete()},onObservationStopped:h=>{h.delete()},onFrameProcessingStarted:(h,I)=>{this.workerFunctions.postMessage({type:"onFrameProcessingStarted"}),I.delete(),h.delete()},onFrameProcessingFinished:(h,I)=>{this.workerFunctions.postMessage({type:"onFrameProcessingFinished"}),I.delete(),h.delete()},onFrameSkipped:(h,I)=>{this.workerFunctions.postMessage({type:"onFrameSkipped"}),I.delete(),h.delete()}}),S=this.Module.GestureRecognizer.extend("GestureRecognizer",{setGestureListener:(h,I)=>{var me;(me=this.gestureListener)==null||me.delete(),this.gestureListener=h.clone(),h.delete()}});(e=this.gestureRecognizer)==null||e.delete(),this.gestureRecognizer=new S;let J=new b;this.context.addListener(J),J.delete();let $=new g;this.context.addFrameListener($),$.delete(),this.setView(m),(t=this.view)==null||t.setGestureRecognizer(this.gestureRecognizer);let Q=this.Module.PlatformHintPresenter.extend("PlatformHintPresenter",{setHintPresenter:h=>{h.delete()},showToast:h=>{this.workerFunctions.postMessage({type:"showToast",payload:JSON.parse(h)})},hideToast:h=>{this.workerFunctions.postMessage({type:"hideToast",payload:JSON.parse(h)})},showGuidance:h=>{this.workerFunctions.postMessage({type:"showGuidance",payload:JSON.parse(h)})},hideGuidance:h=>{this.workerFunctions.postMessage({type:"hideGuidance",payload:JSON.parse(h)})},startUpdateTimer:h=>{this.workerFunctions.postMessage({type:"startUpdateTimer",payload:{duration:{unit:"ms",value:h}}})},stopUpdateTimer:()=>{this.workerFunctions.postMessage({type:"stopUpdateTimer"})}});(r=this.hintPresenterV2)==null||r.delete(),this.hintPresenterV2=null,(n=this.webPlatformHintPresenter)==null||n.delete(),this.webPlatformHintPresenter=null,this.webPlatformHintPresenter=new Q,this.view&&(this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter),(s=this.view)==null||s.setHintPresenterV2(this.hintPresenterV2))}onTap(a){var e;(e=this.gestureListener)==null||e.onTap(JSON.stringify(a))}hintPresenterV2Update(){var a;(a=this.hintPresenterV2)==null||a.update()}startReportingPerformanceMetrics(){this.performanceMetricsReporterTimer==null&&(this.performanceMetricsReporterTimer=setInterval(()=>{this.reportPerformanceMetrics();for(let a of Object.keys(this.performanceMetrics))this.performanceMetrics[a]=0},1e3))}async reportPerformanceMetrics(){this.workerFunctions.postMessage({type:"performanceMetricsReport",payload:{...this.performanceMetrics}})}deleteFrameData(a){this.frameDataPool.delete(a)}dispose(){var a,e,t,r;this.context.dispose(),this.frameDataPool.clear(),this.isDrawLoopRunning=!1,this.lastFrameCounter=-1,(a=this.gestureRecognizer)==null||a.delete(),this.gestureRecognizer=null,(e=this.gestureListener)==null||e.delete(),this.gestureListener=null,(t=this.hintPresenterV2)==null||t.delete(),this.hintPresenterV2=null,(r=this.webPlatformHintPresenter)==null||r.delete(),this.webPlatformHintPresenter=null}flushAnalytics(){this.context.flushAnalytics()}extractCentaurusLicense(a){return{payload:{centaurus:{licenseKey:this.Module.LicenseUtils[It.get3dPartyLicenseKeyMethodName](a)}}}}getModeDeserializers(){return new this.Module.VectorDataCaptureModeDeserializer}loadLibrary(a){return this.libraryLoadingPromise!=null?this.libraryLoadingPromise:(this.libraryLoadingPromise=this.setup(a),this.libraryLoadingPromise)}processFrame(a){var e;if(this.context==null)return{payload:a,transferables:[a.data.buffer]};let t=a.data,r=a.colorType==="GRAYSCALE"?this.Module.ImageBufferFormat.Grayscale8:this.Module.ImageBufferFormat.Rgba8888,n=this.Module.allocateUint8Array(t.byteLength);return this.Module.HEAPU8.set(t,n),(e=this.imageFrameSource)==null||e.outputFrame(n,a.width,a.height,r),{payload:a,transferables:[a.data.buffer]}}reportCameraProperties(a){this.context.setCameraProperties(a.deviceId,a.isFrontFacing,a.hasAutofocus)}requestFrameData(a){let e=this.frameDataPool.get(a);return e==null?{payload:{data:null}}:{payload:{data:e},transferables:[e.buffer]}}scheduleRedraw(a,e){this.addRedrawRequest(e),this.isDrawLoopRunning||this.startDrawLoop(a)}sendViewRefreshCommands(a){this.workerFunctions.postMessage({type:"draw",payload:a},[a.buffer])}setFrameSource(a,e){var t;this.lastUsedModuleMirrorAxis=this.mapMirrorAxisOnModule(a),(t=this.imageFrameSource)==null||t.delete(),this.imageFrameSource=new this.Module.ImageBufferFrameSource(this.lastUsedModuleMirrorAxis,e,0),this.context.setFrameSource(this.imageFrameSource)}startDrawLoop(a){this.isDrawLoopRunning=!0;let e=n=>this.redrawRequests.length>0&&this.redrawRequests[0]<=n,t=n=>{for(;this.redrawRequests.length>0&&this.redrawRequests[0]<=n;)this.redrawRequests.shift()},r=()=>{this.loopTimeoutId=setTimeout(()=>{if(!this.isDrawLoopRunning)return;let n=performance.now();if(e(n)){t(n),a.draw();let s=a.getDrawCommands();this.sendViewRefreshCommands(new Uint8Array(s))}r()},this.redrawInterval)};r()}updateContext(a){if(this.context!=null&&this.contextDeserializer!=null){a.view!=null&&!a.view.visible&&this.context.flushAnalytics();let e=this.onBeforeUpdateContextHook(a),t=this.contextDeserializer.updateContextFromJson(this.context,this.view,JSON.stringify(e.context));if(t==null){let n=this.contextDeserializer.getLastError();throw new Error(`Could not update the context: ${n}`)}this.context.delete(),this.context=t.getContext();let r=t.getView();t.delete(),r!=null&&e.view!=null&&r.setViewSize(e.view.width,e.view.height,e.view.orientation),!this.hintPresenterV2&&this.webPlatformHintPresenter&&(this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter)),r!=null&&this.hintPresenterV2&&r.setHintPresenterV2(this.hintPresenterV2),this.gestureRecognizer!=null&&(r==null||r.setGestureRecognizer(this.gestureRecognizer)),this.setView(r),u.debug("context updated",e)}}onBeforeUpdateContextHook(a){return a}onDocumentVisibilityChange(a){a==="hidden"&&this.context.flushAnalytics()}isFeatureSupported(a){return{payload:{supported:this.context.isFeatureSupported(a)}}}getViewfinderInfo(){var a,e;return{payload:{isDisplayingViewfinder:(e=(a=this.view)==null?void 0:a.isDisplayingViewfinder())!=null?e:!1,rect:JSON.parse(this.view.getViewfinderRect())}}}getOpenSourceSoftwareLicenseInfo(){return{payload:{licenseText:this.Module.OpenSourceSoftwareLicenseInfo.getLicenseText()}}}getNextFrameId(){return this.lastFrameCounter++,this.lastFrameCounter>=this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL&&(this.lastFrameCounter=0),this.lastFrameCounter}getWasmDynamicLibraries(a){return this.getWasmSideModuleFileName()==null?[]:[`${a.replace(/\\/[^/]*$/,"/")}${this.getWasmSideModuleFileName()}`]}getWasmCoreExpectedHash(a,e){return e?a?"70d7eb5229b59ebbad1d06f20e8c73a7cdbdd4a22400173e2b13ddf2d09fc87c":"40c4d72b3f826984ab7aaa7d870c487d147d1174509bb116253505f1c4422e58":a?"53f72a1e491019cbb75739e6e763497b18f8b73512905c0da0951d7c531221af":""}getWasmCoreFileName(a,e){return e?a?"scandit-datacapture-sdk-label-simd-pthreads.wasm":"scandit-datacapture-sdk-label-pthreads.wasm":a?"scandit-datacapture-sdk-label-simd.wasm":""}getWasmMetadata(){return d}getWasmSideModuleFileName(){return""}_loadProgressCallback(a){this.workerFunctions.postMessage({type:"loadLibraryProgress",payload:a})}addRedrawRequest(a){this.redrawRequests.push(Math.round(performance.now())+a),this.redrawRequests.sort((e,t)=>e-t)}contextDidChangeStatus(a){a.code===260?a.message=a.message.replace("domain name",`domain name (${Ie(location)})`):a.code===265&&(a.message=a.message.replace("domain name",`domain name (${this.parentDomain})`)),this.workerFunctions.postMessage({type:"contextDidChangeStatus",payload:a})}didStartObservingContext(){this.workerFunctions.postMessage({type:"didStartObservingContext"})}mapMirrorAxisOnModule(a){switch(a){case"None":return this.Module.Axis.None;case"X":return this.Module.Axis.X;case"Y":return this.Module.Axis.Y;default:return this.Module.Axis.None}}setView(a){this.view=a,this.setViewRefreshHandler(a),a==null&&(this.isDrawLoopRunning=!1,this.sendViewRefreshCommands(new Uint8Array([])))}addNativeOverlay(a){u.warn("addNativeOverlay has not been implemented for this module",a)}removeNativeOverlay(a){u.warn("removeNativeOverlay has not been implemented for this module",a)}setViewRefreshHandler(a){if(a==null||a.isViewRefreshHandlerSet)return;let e=this.Module.NeedsRedrawDelegate.extend("NeedsRedrawDelegate",{setNeedsRedrawIn:this.scheduleRedraw.bind(this,a)}),t=new e;a.setNeedsRedrawDelegate(t),a.isViewRefreshHandlerSet=!0}setupDataDecoding(){let a=this.moduleHandler.get(),e=a.DataDecoding.extend("DataDecoding",{decode(t,r){try{let n=JSON.parse(r),s=[];for(let l of n){let p=new TextDecoder(l.ianaName,{fatal:!0});s.push(p.decode(t.slice(l.startIndex,l.endIndex)))}return s.join("")}catch{return""}}});a.setDataDecoding(new e)}start(a,e,t){a&&e&&(this.setupDataDecoding(),this.moduleHandler.get().callMain(),this.moduleHandler.get().__emscripten_proxy_main!==void 0||t())}getWritableDataPath(a){return a!=null?(u.debug(`IndexedDB database name override in use to recover from blocked standard database: ${a}`),a):this.writableDataPathStandard}numOfMBToPages(a){return Math.ceil(1024*a*1024/64/1024)}async setup({libraryLocation:a,locationPath:e,writableDataPathOverride:t,overrideThreadsSupport:r,overrideSimdSupport:n,verifyResponseHash:s,referredOrigin:l,fixedWasmMemory:p}){var y;let m=!1,b=!1;this.writableDataPath=this.getWritableDataPath(t),this.resourcePath=`${a}${this.resourceFilesSubfolder}/`,self.path=e;let{resolve:g,reject:S,promise:J}=new Ht,$=ye.sdkVersion();if($==="")throw new ce({name:"Invalid library version",message:"Library version is not defined or empty, cannot generate proper path to library files."});let[Q,h]=await Promise.all([St(),Ct()]);r!=="auto"&&(h=r==="on"),n!=="auto"&&(Q=n==="on");let I=this.getWasmCoreFileName(Q,h),me=ht($,a,I),{jsURI:xe,wasmURI:ut}=me,ea={instantiateWasm:(T,ta)=>(Nt({importObject:T,wasmURI:ut,expectedHash:this.getWasmCoreExpectedHash(Q,h),verifyResponseHash:s,successCallback:ta,progressCallback:this._loadProgressCallback,errorCallback:aa=>{S(aa)},referredOrigin:l}),{})},pe=p===null?null:new WebAssembly.Memory({initial:this.numOfMBToPages(p),maximum:this.numOfMBToPages(300),shared:h});return pe!==null&&u.log(u.Level.Debug,"Fixed wasmMemory set",pe),this.moduleHandler.set({...pe?{wasmMemory:pe}:{},mainScriptUrlOrBlob:xe,canvas:(y=this.workerFunctions.getOffscreenCanvas())!=null?y:{getContext:()=>null},...ea,dynamicLibraries:this.getWasmDynamicLibraries(ut),locateFile:T=>a+T,noInitialRun:!0,preRun:[async()=>{try{await ft({writableDataPath:this.writableDataPath})}catch(T){if(T.name==="BlockedIndexedDB"){S(T.toString());return}u.log(u.Level.Debug,"No IndexedDB support, some data will not be persisted:",T)}b=!0,this.start(b,m,g)}],onMainComplete:()=>{if([m,b].includes(!1)){u.log(u.Level.Warn,{runtimeLoaded:m,fileSystemSynced:b},"Both runtimeLoaded and fileSystemSynced should be true when calling onMainComplete"),S("onMainComplete has been called but runtime or file system was not ready.");return}g()},onRuntimeInitialized:()=>{m=!0,this.start(b,m,g)},print:T=>{u.log(u.Level.Info,T)}}),await wt(xe,$)||S(`Couldn\'t retrieve Scandit Data Capture library at ${xe}, did you configure the path for it correctly?`),J}};Ft.get3dPartyLicenseKeyMethodName=atob("Z2V0QmxpbmtJZExpY2Vuc2VLZXk=");var te=Ft;o();function Ot(i){return typeof i=="object"&&i!=null&&i.document==null&&"addEventListener"in i&&typeof i.importScripts=="function"}o();function Lt(i){console.warn("Reached unexpected case",i)}var Oe=class{constructor(i,a){this.onMessageListener=this.onMessage.bind(this),this.workerSelf=i,this.dataCaptureInstance=new te(a,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)}),Ot(i)&&(yt(i),this.listenToMessages())}listenToMessages(){this.workerSelf.addEventListener("message",this.onMessageListener),this.workerSelf.addEventListener("error",i=>{u.log(u.Level.Error,i)}),this.workerSelf.addEventListener("messageerror",i=>{u.log(u.Level.Error,i)})}postMessage(i,a){this.workerSelf.postMessage(i,a!=null?a:[])}getOffscreenCanvas(){if(typeof this.workerSelf.OffscreenCanvas=="function")return new this.workerSelf.OffscreenCanvas(32,32)}hasPayload(i){return Z(i)&&"payload"in i}hasTransferables(i){return Z(i)&&Array.isArray(i.transferables)}async respondWith(i,a,e){let t=null,r;try{r=e(),r instanceof Promise&&(r=await r)}catch(s){r=void 0,t=Y(s)}let n={type:"workerTaskId",command:i,id:a,payload:this.hasPayload(r)?r.payload:void 0};t!=null&&(n.error=t),this.postMessage(n,this.hasTransferables(r)?r.transferables:[])}onMessage(i){switch(i.data.command){case"loadLibrary":{{let{data:a}=i;this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.loadLibrary({libraryLocation:a.libraryLocation,locationPath:a.locationPath,referredOrigin:a.referredOrigin,writableDataPathOverride:a.writableDataPathOverride,overrideThreadsSupport:a.overrideThreadsSupport,overrideSimdSupport:a.overrideSimdSupport,verifyResponseHash:a.verifyResponseHash,fixedWasmMemory:a.fixedWasmMemory}))}break}case"onTap":{{let{data:a}=i;this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.onTap(a.point)})}break}case"hintPresenterV2update":{{let{data:a}=i;this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.hintPresenterV2Update()})}break}case"createContext":{{let{data:a}=i;this.respondWith(a.command,a.id,()=>this.dataCaptureInstance.createContext({context:a.context,deviceId:a.deviceId,delayedRegistration:a.delayedRegistration,highEndBlurryRecognition:a.highEndBlurryRecognition,appName:a.appName,parentDomain:a.parentDomain}))}break}case"setFrameSource":{{let{data:a}=i;this.respondWith(a.command,a.id,()=>this.dataCaptureInstance.setFrameSource(a.mirrorAxis,a.isCameraFrameSource))}break}case"processFrame":{{let{data:a}=i;this.respondWith(a.command,a.id,()=>this.dataCaptureInstance.processFrame({data:a.data,width:a.width,height:a.height,colorType:a.colorType}))}break}case"requestFrameData":{{let{data:a}=i;this.respondWith(a.command,a.id,()=>this.dataCaptureInstance.requestFrameData(a.frameId))}break}case"deleteFrameData":{{let{data:a}=i;this.respondWith(a.command,a.id,()=>{this.dataCaptureInstance.deleteFrameData(a.frameId)})}break}case"updateContext":{{let{data:a}=i;this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.updateContext(a))}break}case"dispose":{this.respondWith(i.data.command,i.data.id,()=>this.dataCaptureInstance.dispose());break}case"flushAnalytics":{this.respondWith(i.data.command,i.data.id,()=>{this.dataCaptureInstance.flushAnalytics()});break}case"reportCameraProperties":{{let{data:a}=i;this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.reportCameraProperties(a))}break}case"setLogLevel":{{let{data:a}=i;this.respondWith(a.command,a.id,()=>{u.setLevel(a.level)})}break}case"extractCentaurusLicense":{{let{data:a}=i;this.respondWith(a.command,a.id,()=>this.dataCaptureInstance.extractCentaurusLicense(a.licenseKey))}break}case"documentVisibility":{{let{data:a}=i;this.respondWith(a.command,a.id,()=>{this.dataCaptureInstance.onDocumentVisibilityChange(a.state)})}break}case"isFeatureSupported":{{let{data:a}=i;this.respondWith(a.command,a.id,()=>this.dataCaptureInstance.isFeatureSupported(a.feature))}break}case"getViewfinderInfo":{{let{data:a}=i;this.respondWith(a.command,a.id,()=>this.dataCaptureInstance.getViewfinderInfo())}break}case"getOpenSourceSoftwareLicenseInfo":{{let{data:a}=i;this.respondWith(a.command,a.id,()=>this.dataCaptureInstance.getOpenSourceSoftwareLicenseInfo())}break}case"addNativeOverlay":this.dataCaptureInstance.addNativeOverlay(i);break;case"removeNativeOverlay":this.dataCaptureInstance.removeNativeOverlay(i);break;default:return Lt(i.data),!1}return!0}};o();o();o();var c=class{constructor(){this.handleToNativeImplementationMap=new Map;this.nativeImplementationToHandleMap=new WeakMap}get Module(){return Tt.Module}mapNativeImplementationToHandle(a){this.handleToNativeImplementationMap.set(this.handle.id,a),this.nativeImplementationToHandleMap.set(a,this.handle);let e={...this.handle};return this.handle={...e,id:e.id+1},e}nativeImplementationFromHandle(a){let e=this.handleToNativeImplementationMap.get(a.id);if(!e)throw new Error("Invalid handle.");return e}handleFromNativeImplementation(a){let e=this.nativeImplementationToHandleMap.get(a);if(e==null)throw new Error("Invalid native implementation.");return e}};o();o();o();o();o();o();var Le=class extends c{constructor(){super(...arguments);this.handle={className:"LabelFieldLocation",id:0}}async createWithType(e){let t=this.Module.LabelFieldLocation.createWithType(e);return this.mapNativeImplementationToHandle(t)}async createWithRect(e){let t=this.Module.LabelFieldLocation.createWithRect(e);return this.mapNativeImplementationToHandle(t)}async getLabelFieldLocationType(e){throw new Error("This method must be implemented manually.")}async getRect(e){throw new Error("This method must be implemented manually.")}},A=new Le;var Te=class extends c{constructor(){super(...arguments);this.handle={className:"CustomBarcode",id:0}}async create(e,t){let r=this.Module.CustomBarcode.create(e,t);return this.mapNativeImplementationToHandle(r)}async getName(e){return this.nativeImplementationFromHandle(e).getName()}async isOptional(e){return this.nativeImplementationFromHandle(e).isOptional()}async setOptional(e,t){this.nativeImplementationFromHandle(e).setOptional(t)}async getPatterns(e){return this.nativeImplementationFromHandle(e).getPatterns()}async setPatterns(e,t){this.nativeImplementationFromHandle(e).setPatterns(t)}async getLocation(e){throw new Error("This method must be implemented manually.")}async getSymbologies(e){return this.nativeImplementationFromHandle(e).getSymbologies()}async setSymbologies(e,t){throw new Error("This method must be implemented manually.")}async setLocation(e,t){this.nativeImplementationFromHandle(e).setLocation(A.nativeImplementationFromHandle(t))}async getDataTypePatterns(e){return this.nativeImplementationFromHandle(e).getDataTypePatterns()}async setDataTypePatterns(e,t){this.nativeImplementationFromHandle(e).setDataTypePatterns(t)}async getHiddenProperties(e){return this.nativeImplementationFromHandle(e).getHiddenProperties()}async setHiddenProperties(e,t){this.nativeImplementationFromHandle(e).setHiddenProperties(t)}async asLabelFieldDefinition(e){throw new Error("This method must be implemented manually.")}},ae=new Te;o();var Ae=class extends c{constructor(){super(...arguments);this.handle={className:"CustomText",id:0}}async create(e){let t=this.Module.CustomText.create(e);return this.mapNativeImplementationToHandle(t)}async getName(e){return this.nativeImplementationFromHandle(e).getName()}async isOptional(e){return this.nativeImplementationFromHandle(e).isOptional()}async setOptional(e,t){this.nativeImplementationFromHandle(e).setOptional(t)}async getPatterns(e){return this.nativeImplementationFromHandle(e).getPatterns()}async setPatterns(e,t){this.nativeImplementationFromHandle(e).setPatterns(t)}async getLocation(e){throw new Error("This method must be implemented manually.")}async setLocation(e,t){this.nativeImplementationFromHandle(e).setLocation(A.nativeImplementationFromHandle(t))}async getDataTypePatterns(e){return this.nativeImplementationFromHandle(e).getDataTypePatterns()}async setDataTypePatterns(e,t){this.nativeImplementationFromHandle(e).setDataTypePatterns(t)}async getHiddenProperties(e){return this.nativeImplementationFromHandle(e).getHiddenProperties()}async setHiddenProperties(e,t){this.nativeImplementationFromHandle(e).setHiddenProperties(t)}async asLabelFieldDefinition(e){throw new Error("This method must be implemented manually.")}},ie=new Ae;o();var De=class extends c{constructor(){super(...arguments);this.handle={className:"ExpiryDateText",id:0}}async create(e){let t=this.Module.ExpiryDateText.create(e);return this.mapNativeImplementationToHandle(t)}async getName(e){return this.nativeImplementationFromHandle(e).getName()}async isOptional(e){return this.nativeImplementationFromHandle(e).isOptional()}async setOptional(e,t){this.nativeImplementationFromHandle(e).setOptional(t)}async getPatterns(e){return this.nativeImplementationFromHandle(e).getPatterns()}async setPatterns(e,t){this.nativeImplementationFromHandle(e).setPatterns(t)}async getHiddenProperties(e){return this.nativeImplementationFromHandle(e).getHiddenProperties()}async setHiddenProperties(e,t){this.nativeImplementationFromHandle(e).setHiddenProperties(t)}async asLabelFieldDefinition(e){return this.nativeImplementationFromHandle(e).asLabelFieldDefinition()}async setLabelDateFormat(e,t){this.nativeImplementationFromHandle(e).setLabelDateFormat(t)}async getLabelDateFormat(e){return this.nativeImplementationFromHandle(e).getLabelDateFormat()}async getLocation(e){return this.nativeImplementationFromHandle(e).getLocation()}async setLocation(e,t){this.nativeImplementationFromHandle(e).setLocation(t)}async getDataTypePatterns(e){return this.nativeImplementationFromHandle(e).getDataTypePatterns()}async setDataTypePatterns(e,t){this.nativeImplementationFromHandle(e).setDataTypePatterns(t)}async resetDataTypePatterns(e){this.nativeImplementationFromHandle(e).resetDataTypePatterns()}},re=new De;o();var Me=class extends c{constructor(){super(...arguments);this.handle={className:"ImeiOneBarcode",id:0}}async create(e){let t=this.Module.ImeiOneBarcode.create(e);return this.mapNativeImplementationToHandle(t)}async getName(e){return this.nativeImplementationFromHandle(e).getName()}async isOptional(e){return this.nativeImplementationFromHandle(e).isOptional()}async setOptional(e,t){this.nativeImplementationFromHandle(e).setOptional(t)}async getPatterns(e){return this.nativeImplementationFromHandle(e).getPatterns()}async setPatterns(e,t){this.nativeImplementationFromHandle(e).setPatterns(t)}async getSymbologies(e){return this.nativeImplementationFromHandle(e).getSymbologies()}async setSymbologies(e,t){this.nativeImplementationFromHandle(e).setSymbologies(t)}async getHiddenProperties(e){return this.nativeImplementationFromHandle(e).getHiddenProperties()}async setHiddenProperties(e,t){this.nativeImplementationFromHandle(e).setHiddenProperties(t)}async getLocation(e){throw new Error("This method must be implemented manually.")}async setLocation(e,t){throw new Error("This method must be implemented manually.")}async getDataTypePatterns(e){return this.nativeImplementationFromHandle(e).getDataTypePatterns()}async setDataTypePatterns(e,t){this.nativeImplementationFromHandle(e).setDataTypePatterns(t)}async asLabelFieldDefinition(e){throw new Error("This method must be implemented manually.")}},D=new Me;o();var Re=class extends c{constructor(){super(...arguments);this.handle={className:"ImeiTwoBarcode",id:0}}async create(e){let t=this.Module.ImeiTwoBarcode.create(e);return this.mapNativeImplementationToHandle(t)}async getName(e){return this.nativeImplementationFromHandle(e).getName()}async isOptional(e){return this.nativeImplementationFromHandle(e).isOptional()}async setOptional(e,t){this.nativeImplementationFromHandle(e).setOptional(t)}async getPatterns(e){return this.nativeImplementationFromHandle(e).getPatterns()}async setPatterns(e,t){this.nativeImplementationFromHandle(e).setPatterns(t)}async getSymbologies(e){return this.nativeImplementationFromHandle(e).getSymbologies()}async setSymbologies(e,t){this.nativeImplementationFromHandle(e).setSymbologies(t)}async getHiddenProperties(e){return this.nativeImplementationFromHandle(e).getHiddenProperties()}async setHiddenProperties(e,t){this.nativeImplementationFromHandle(e).setHiddenProperties(t)}async getLocation(e){throw new Error("This method must be implemented manually.")}async setLocation(e,t){throw new Error("This method must be implemented manually.")}async getDataTypePatterns(e){return this.nativeImplementationFromHandle(e).getDataTypePatterns()}async setDataTypePatterns(e,t){this.nativeImplementationFromHandle(e).setDataTypePatterns(t)}async asLabelFieldDefinition(e){throw new Error("This method must be implemented manually.")}},M=new Re;o();var Be=class extends c{constructor(){super(...arguments);this.handle={className:"PackingDateText",id:0}}async create(e){let t=this.Module.PackingDateText.create(e);return this.mapNativeImplementationToHandle(t)}async getName(e){return this.nativeImplementationFromHandle(e).getName()}async isOptional(e){return this.nativeImplementationFromHandle(e).isOptional()}async setOptional(e,t){this.nativeImplementationFromHandle(e).setOptional(t)}async getPatterns(e){return this.nativeImplementationFromHandle(e).getPatterns()}async setPatterns(e,t){this.nativeImplementationFromHandle(e).setPatterns(t)}async getHiddenProperties(e){return this.nativeImplementationFromHandle(e).getHiddenProperties()}async setHiddenProperties(e,t){this.nativeImplementationFromHandle(e).setHiddenProperties(t)}async asLabelFieldDefinition(e){throw new Error("This method must be implemented manually.")}async setLabelDateFormat(e,t){throw new Error("setLabelDateFormat must be implemented manually.")}async getLabelDateFormat(e){throw new Error("getLabelDateFormat must be implemented manually.")}async getLocation(e){throw new Error("This method must be implemented manually.")}async setLocation(e,t){throw new Error("This method must be implemented manually.")}async getDataTypePatterns(e){throw new Error("This method must be implemented manually.")}async setDataTypePatterns(e,t){throw new Error("This method must be implemented manually.")}async resetDataTypePatterns(e){throw new Error("resetDataTypePatterns must be implemented manually.")}},ne=new Be;o();var Ee=class extends c{constructor(){super(...arguments);this.handle={className:"PartNumberBarcode",id:0}}async create(e){let t=this.Module.PartNumberBarcode.create(e);return this.mapNativeImplementationToHandle(t)}async getName(e){return this.nativeImplementationFromHandle(e).getName()}async isOptional(e){return this.nativeImplementationFromHandle(e).isOptional()}async setOptional(e,t){this.nativeImplementationFromHandle(e).setOptional(t)}async getPatterns(e){return this.nativeImplementationFromHandle(e).getPatterns()}async setPatterns(e,t){this.nativeImplementationFromHandle(e).setPatterns(t)}async getSymbologies(e){return this.nativeImplementationFromHandle(e).getSymbologies()}async setSymbologies(e,t){this.nativeImplementationFromHandle(e).setSymbologies(t)}async getHiddenProperties(e){return this.nativeImplementationFromHandle(e).getHiddenProperties()}async setHiddenProperties(e,t){this.nativeImplementationFromHandle(e).setHiddenProperties(t)}async getLocation(e){throw new Error("This method must be implemented manually.")}async setLocation(e,t){throw new Error("This method must be implemented manually.")}async getDataTypePatterns(e){return this.nativeImplementationFromHandle(e).getDataTypePatterns()}async setDataTypePatterns(e,t){this.nativeImplementationFromHandle(e).setDataTypePatterns(t)}async asLabelFieldDefinition(e){throw new Error("This method must be implemented manually.")}},R=new Ee;o();var We=class extends c{constructor(){super(...arguments);this.handle={className:"SerialNumberBarcode",id:0}}async create(e){let t=this.Module.SerialNumberBarcode.create(e);return this.mapNativeImplementationToHandle(t)}async getName(e){return this.nativeImplementationFromHandle(e).getName()}async isOptional(e){return this.nativeImplementationFromHandle(e).isOptional()}async setOptional(e,t){this.nativeImplementationFromHandle(e).setOptional(t)}async getPatterns(e){return this.nativeImplementationFromHandle(e).getPatterns()}async setPatterns(e,t){this.nativeImplementationFromHandle(e).setPatterns(t)}async getSymbologies(e){return this.nativeImplementationFromHandle(e).getSymbologies()}async setSymbologies(e,t){this.nativeImplementationFromHandle(e).setSymbologies(t)}async getHiddenProperties(e){return this.nativeImplementationFromHandle(e).getHiddenProperties()}async setHiddenProperties(e,t){this.nativeImplementationFromHandle(e).setHiddenProperties(t)}async getLocation(e){throw new Error("This method must be implemented manually.")}async setLocation(e,t){throw new Error("This method must be implemented manually.")}async getDataTypePatterns(e){return this.nativeImplementationFromHandle(e).getDataTypePatterns()}async setDataTypePatterns(e,t){this.nativeImplementationFromHandle(e).setDataTypePatterns(t)}async asLabelFieldDefinition(e){throw new Error("This method must be implemented manually.")}},B=new We;o();var ke=class extends c{constructor(){super(...arguments);this.handle={className:"TotalPriceText",id:0}}async create(e){let t=this.Module.TotalPriceText.create(e);return this.mapNativeImplementationToHandle(t)}async getName(e){return this.nativeImplementationFromHandle(e).getName()}async isOptional(e){return this.nativeImplementationFromHandle(e).isOptional()}async setOptional(e,t){this.nativeImplementationFromHandle(e).setOptional(t)}async getPatterns(e){return this.nativeImplementationFromHandle(e).getPatterns()}async setPatterns(e,t){this.nativeImplementationFromHandle(e).setPatterns(t)}async getHiddenProperties(e){return this.nativeImplementationFromHandle(e).getHiddenProperties()}async setHiddenProperties(e,t){this.nativeImplementationFromHandle(e).setHiddenProperties(t)}async getLocation(e){throw new Error("This method must be implemented manually.")}async setLocation(e,t){throw new Error("This method must be implemented manually.")}async getDataTypePatterns(e){return this.nativeImplementationFromHandle(e).getDataTypePatterns()}async setDataTypePatterns(e,t){this.nativeImplementationFromHandle(e).setDataTypePatterns(t)}async resetDataTypePatterns(e){this.nativeImplementationFromHandle(e).resetDataTypePatterns()}async asLabelFieldDefinition(e){throw new Error("This method must be implemented manually.")}},E=new ke;o();var _e=class extends c{constructor(){super(...arguments);this.handle={className:"UnitPriceText",id:0}}async create(e){let t=this.Module.UnitPriceText.create(e);return this.mapNativeImplementationToHandle(t)}async getName(e){return this.nativeImplementationFromHandle(e).getName()}async isOptional(e){return this.nativeImplementationFromHandle(e).isOptional()}async setOptional(e,t){this.nativeImplementationFromHandle(e).setOptional(t)}async getPatterns(e){return this.nativeImplementationFromHandle(e).getPatterns()}async setPatterns(e,t){this.nativeImplementationFromHandle(e).setPatterns(t)}async getHiddenProperties(e){return this.nativeImplementationFromHandle(e).getHiddenProperties()}async setHiddenProperties(e,t){this.nativeImplementationFromHandle(e).setHiddenProperties(t)}async getLocation(e){throw new Error("This method must be implemented manually.")}async setLocation(e,t){throw new Error("This method must be implemented manually.")}async getDataTypePatterns(e){return this.nativeImplementationFromHandle(e).getDataTypePatterns()}async setDataTypePatterns(e,t){this.nativeImplementationFromHandle(e).setDataTypePatterns(t)}async resetDataTypePatterns(e){this.nativeImplementationFromHandle(e).resetDataTypePatterns()}async asLabelFieldDefinition(e){throw new Error("This method must be implemented manually.")}},W=new _e;o();var Ve=class extends c{constructor(){super(...arguments);this.handle={className:"WeightText",id:0}}async create(e){let t=this.Module.WeightText.create(e);return this.mapNativeImplementationToHandle(t)}async getName(e){return this.nativeImplementationFromHandle(e).getName()}async isOptional(e){return this.nativeImplementationFromHandle(e).isOptional()}async setOptional(e,t){this.nativeImplementationFromHandle(e).setOptional(t)}async getPatterns(e){return this.nativeImplementationFromHandle(e).getPatterns()}async setPatterns(e,t){this.nativeImplementationFromHandle(e).setPatterns(t)}async getHiddenProperties(e){return this.nativeImplementationFromHandle(e).getHiddenProperties()}async setHiddenProperties(e,t){this.nativeImplementationFromHandle(e).setHiddenProperties(t)}async getLocation(e){throw new Error("This method must be implemented manually.")}async setLocation(e,t){throw new Error("This method must be implemented manually.")}async getDataTypePatterns(e){return this.nativeImplementationFromHandle(e).getDataTypePatterns()}async setDataTypePatterns(e,t){this.nativeImplementationFromHandle(e).setDataTypePatterns(t)}async resetDataTypePatterns(e){this.nativeImplementationFromHandle(e).resetDataTypePatterns()}async asLabelFieldDefinition(e){throw new Error("This method must be implemented manually.")}},k=new Ve;var Je=class extends c{constructor(){super(...arguments);this.handle={className:"LabelFieldDefinition",id:0};this.concreteImplementationRegistry=new Map([["CustomBarcode",ae],["CustomText",ie],["ExpiryDateText",re],["ImeiOneBarcode",D],["ImeiTwoBarcode",M],["PackingDateText",ne],["PartNumberBarcode",R],["SerialNumberBarcode",B],["TotalPriceText",E],["UnitPriceText",W],["WeightText",k]])}nativeImplementationFromHandle(e){let t=this.concreteImplementationRegistry.get(e.className);if(!t)throw new Error("Handle doesn\'t point to a concrete implementation of LabelFieldDefinition.");return t.nativeImplementationFromHandle(e)}async getName(e){return this.nativeImplementationFromHandle(e).getName()}async isOptional(e){return this.nativeImplementationFromHandle(e).isOptional()}async setOptional(e,t){throw new Error("This method must be implemented manually.")}async getPatterns(e){return this.nativeImplementationFromHandle(e).getPatterns()}async setPatterns(e,t){throw new Error("This method must be implemented manually.")}async getHiddenProperties(e){throw new Error("This method must be implemented manually.")}async setHiddenProperties(e,t){throw new Error("This method must be implemented manually.")}async getLocation(e){throw new Error("This method must be implemented manually.")}async setLocation(e,t){throw new Error("This method must be implemented manually.")}async getDataTypePatterns(e){throw new Error("This method must be implemented manually.")}async setDataTypePatterns(e,t){throw new Error("This method must be implemented manually.")}},At=new Je;var Ue=class extends c{constructor(){super(...arguments);this.handle={className:"LabelDefinition",id:0}}async create(e,t){let r=this.Module.LabelDefinition.create(e,t.map(n=>At.nativeImplementationFromHandle(n)));return this.mapNativeImplementationToHandle(r)}async getName(e){return this.nativeImplementationFromHandle(e).getName()}async getFieldDefinitions(e){return this.nativeImplementationFromHandle(e).getFieldDefinitions()}async createVinLabelDefinition(e){let t=this.Module.LabelDefinition.createVinLabelDefinition(e);return this.mapNativeImplementationToHandle(t)}async createPriceCaptureDefinition(e){let t=this.Module.LabelDefinition.createPriceCaptureDefinition(e);return this.mapNativeImplementationToHandle(t)}async getHiddenProperties(e){return this.nativeImplementationFromHandle(e).getHiddenProperties()}async setHiddenProperties(e,t){this.nativeImplementationFromHandle(e).setHiddenProperties(t)}},_=new Ue;var je=i=>i.result!=null&&i.error==null,ze=class extends c{constructor(){super(...arguments);this.handle={className:"LabelCaptureSettings",id:0}}async loadFromString(e){let t=this.Module.LabelCaptureSettings.loadFromString(e);if(!je(t))throw new Error(t.error);let r=t.result;return this.mapNativeImplementationToHandle(r)}async createFromLabelDefinitions(e){let t=this.Module.LabelCaptureSettings.createFromLabelDefinitions(e.map(n=>_.nativeImplementationFromHandle(n)));if(!je(t))throw new Error(t.error);let r=t.result;return this.mapNativeImplementationToHandle(r)}async create(e,t,r){let n=this.Module.LabelCaptureSettings.create(e.map(l=>_.nativeImplementationFromHandle(l)),t,r);if(!je(n))throw new Error(n.error);let s=n.result;return this.mapNativeImplementationToHandle(s)}async setLocationSelection(e,t){this.nativeImplementationFromHandle(e).setLocationSelection(t)}async getLocationSelection(e){throw new Error("This method must be implemented manually.")}async getLicenseKey(e){return this.nativeImplementationFromHandle(e).getLicenseKey()}async setLicenseKey(e,t){this.nativeImplementationFromHandle(e).setLicenseKey(t)}async getLicensee(e){return this.nativeImplementationFromHandle(e).getLicensee()}async setLicensee(e,t){this.nativeImplementationFromHandle(e).setLicensee(t)}async getIntProperty(e,t){return this.nativeImplementationFromHandle(e).getIntProperty(t)}async setIntProperty(e,t,r){this.nativeImplementationFromHandle(e).setIntProperty(t,r)}async getBlueprintJson(e){return this.nativeImplementationFromHandle(e).getBlueprintJson()}},O=new ze;o();function Dt(i,a){return new Promise((e,t)=>{i.then({run:r=>{r?e(r):t(new Error(a))}})})}var Ge=class extends c{constructor(){super(...arguments);this.handle={className:"LabelCapture",id:0}}async create(e,t){let r=O.nativeImplementationFromHandle(t),n=this.Module.LabelCapture.create(e,r);return this.mapNativeImplementationToHandle(n)}async isEnabled(e){return this.nativeImplementationFromHandle(e).isEnabled()}async setEnabled(e,t){this.nativeImplementationFromHandle(e).setEnabled(t)}async isAttachedToContext(e){return this.nativeImplementationFromHandle(e).isAttachedToContext()}async addListenerAsync(e,t,r){this.nativeImplementationFromHandle(e).addListenerAsync(t,r)}async removeListenerAsync(e,t){this.nativeImplementationFromHandle(e).removeListenerAsync(t)}async getSession(e){throw new Error("This method must be implemented manually.")}async shouldUseEngineDrivenAnimations(e){return this.nativeImplementationFromHandle(e).shouldUseEngineDrivenAnimations()}async applySettingsWrapped(e,t){let r=this.nativeImplementationFromHandle(e).applySettingsWrapped(t);await Dt(r,"Failed to apply settings")}async getContext(e){return this.nativeImplementationFromHandle(e).getContext()}async registerExternalOcrBackend(e,t){this.nativeImplementationFromHandle(e).registerExternalOcrBackend(t)}},P=new Ge;var $e=class extends c{constructor(){super(...arguments);this.handle={className:"LabelCaptureAdvancedOverlay",id:0}}async setShouldShowScanAreaGuides(e,t){return this.nativeImplementationFromHandle(e).setShouldShowScanAreaGuides(t)}async getShouldShowScanAreaGuides(e){return this.nativeImplementationFromHandle(e).getShouldShowScanAreaGuides()}async requireArFeatureAvailabilityFromContext(e){return this.nativeImplementationFromHandle(e).requireArFeatureAvailabilityFromContext()}create(e){let t=P.nativeImplementationFromHandle(e),r=this.Module.LabelCaptureAdvancedOverlay.create(t);return this.mapNativeImplementationToHandle(r)}},U=new $e;o();var qe=class extends c{constructor(){super(...arguments);this.handle={className:"LabelCaptureBasicOverlay",id:0}}async create(e){let t=P.nativeImplementationFromHandle(e),r=this.Module.LabelCaptureBasicOverlay.create(t);return this.mapNativeImplementationToHandle(r)}async setDefaultFieldBrush(e,t,r){this.nativeImplementationFromHandle(e).setDefaultFieldBrush(t,r)}async getDefaultFieldBrush(e,t){return this.nativeImplementationFromHandle(e).getDefaultFieldBrush(t)}async setDefaultLabelBrush(e,t){this.nativeImplementationFromHandle(e).setDefaultLabelBrush(t)}async getDefaultLabelBrush(e){return this.nativeImplementationFromHandle(e).getDefaultLabelBrush()}async setBrushForField(e,t,r,n){this.nativeImplementationFromHandle(e).setBrushForField(t,r,n)}async setBrushForLabel(e,t,r){this.nativeImplementationFromHandle(e).setBrushForLabel(t,r)}async setListener(e,t){this.nativeImplementationFromHandle(e).setListener(t)}async getListener(e){return this.nativeImplementationFromHandle(e).getListener()}async setShouldShowScanAreaGuides(e,t){this.nativeImplementationFromHandle(e).setShouldShowScanAreaGuides(t)}async getShouldShowScanAreaGuides(e){return this.nativeImplementationFromHandle(e).getShouldShowScanAreaGuides()}async getViewfinder(e){return this.nativeImplementationFromHandle(e).getViewfinder()}async setViewfinder(e,t){this.nativeImplementationFromHandle(e).setViewfinder(t)}},w=new qe;o();var Ke=class extends c{constructor(){super(...arguments);this.handle={className:"LabelCaptureOverlayHelper",id:0}}addBasicOverlay(e,t){this.Module.LabelCaptureOverlayHelper.addBasicOverlay(e,t)}removeBasicOverlay(e,t){this.Module.LabelCaptureOverlayHelper.removeBasicOverlay(e,t)}addAdvancedOverlay(e,t){this.Module.LabelCaptureOverlayHelper.addAdvancedOverlay(e,t)}removeAdvancedOverlay(e,t){this.Module.LabelCaptureOverlayHelper.removeAdvancedOverlay(e,t)}addValidationFlowOverlay(e,t){this.Module.LabelCaptureOverlayHelper.addValidationFlowOverlay(e,t)}removeValidationFlowOverlay(e,t){this.Module.LabelCaptureOverlayHelper.removeValidationFlowOverlay(e,t)}},j=new Ke;o();o();var Xe=class extends c{constructor(){super(...arguments);this.handle={className:"ValidationFlowSettings",id:0}}setMissingFieldsHintText(e,t){return this.nativeImplementationFromHandle(e).setMissingFieldsHintText(t),Promise.resolve()}getMissingFieldsHintText(e){return Promise.resolve(this.nativeImplementationFromHandle(e).getMissingFieldsHintText())}setStandbyHintText(e,t){return this.nativeImplementationFromHandle(e).setStandbyHintText(t),Promise.resolve()}getStandbyHintText(e){return Promise.resolve(this.nativeImplementationFromHandle(e).getStandbyHintText())}setValidationHintText(e,t){return this.nativeImplementationFromHandle(e).setValidationHintText(t),Promise.resolve()}getValidationHintText(e){return Promise.resolve(this.nativeImplementationFromHandle(e).getValidationHintText())}setValidationErrorText(e,t){return this.nativeImplementationFromHandle(e).setValidationErrorText(t),Promise.resolve()}getValidationErrorText(e){return Promise.resolve(this.nativeImplementationFromHandle(e).getValidationErrorText())}setRequiredFieldErrorText(e,t){return this.nativeImplementationFromHandle(e).setRequiredFieldErrorText(t),Promise.resolve()}getRequiredFieldErrorText(e){return Promise.resolve(this.nativeImplementationFromHandle(e).getRequiredFieldErrorText())}setManualInputButtonText(e,t){return this.nativeImplementationFromHandle(e).setManualInputButtonText(t),Promise.resolve()}getManualInputButtonText(e){return Promise.resolve(this.nativeImplementationFromHandle(e).getManualInputButtonText())}async create(){let e=this.Module.ValidationFlowSettings.create();return this.mapNativeImplementationToHandle(e)}},N=new Xe;var Qe=class extends c{constructor(){super(...arguments);this.handle={className:"ValidationFlowOverlay",id:0}}async create(e){let t=P.nativeImplementationFromHandle(e),r=this.Module.ValidationFlowOverlay.create(t);return this.mapNativeImplementationToHandle(r)}getLabelViewfinder(e){return Promise.resolve(this.nativeImplementationFromHandle(e).getLabelViewfinder())}getTargetViewfinder(e){return Promise.resolve(this.nativeImplementationFromHandle(e).getTargetViewfinder())}async applySettings(e){let t=N.nativeImplementationFromHandle(e);this.nativeImplementationFromHandle(this.handle).applySettings(t)}},q=new Qe;var he=class extends te{constructor(a,e){super(a,e)}getModeDeserializers(){return super.getModeDeserializers()}getWasmSideModuleFileName(){return""}getWasmCoreFileName(a,e){return e?a?"scandit-datacapture-sdk-label-simd-pthreads.wasm":"scandit-datacapture-sdk-label-pthreads.wasm":a?"scandit-datacapture-sdk-label-simd.wasm":"scandit-datacapture-sdk-label.wasm"}getWasmCoreExpectedHash(a,e){return e?a?"70d7eb5229b59ebbad1d06f20e8c73a7cdbdd4a22400173e2b13ddf2d09fc87c":"40c4d72b3f826984ab7aaa7d870c487d147d1174509bb116253505f1c4422e58":a?"53f72a1e491019cbb75739e6e763497b18f8b73512905c0da0951d7c531221af":"e4f4e60111d448c4200236f7b2881b1e25ef8950d65139e1c821cba9b1954fc9"}onBeforeUpdateContextHook(a){var e;return((e=a.context.view)==null?void 0:e.overlays)!=null&&(a.context.view.overlays=void 0),a}addNativeOverlay(a){if(!this.view)throw new Error("View is not set");a.data.overlayHandle.className==="LabelCaptureBasicOverlay"?j.addBasicOverlay(w.nativeImplementationFromHandle(a.data.overlayHandle),this.view):a.data.overlayHandle.className==="LabelCaptureAdvancedOverlay"?j.addAdvancedOverlay(U.nativeImplementationFromHandle(a.data.overlayHandle),this.view):a.data.overlayHandle.className==="ValidationFlowOverlay"&&j.addValidationFlowOverlay(q.nativeImplementationFromHandle(a.data.overlayHandle),this.view)}removeNativeOverlay(a){if(!this.view)throw new Error("View is not set");a.data.overlayHandle.className==="LabelCaptureBasicOverlay"?j.removeBasicOverlay(w.nativeImplementationFromHandle(a.data.overlayHandle),this.view):a.data.overlayHandle.className==="LabelCaptureAdvancedOverlay"?j.removeAdvancedOverlay(U.nativeImplementationFromHandle(a.data.overlayHandle),this.view):a.data.overlayHandle.className==="ValidationFlowOverlay"&&j.removeValidationFlowOverlay(q.nativeImplementationFromHandle(a.data.overlayHandle),this.view)}getWasmMetadata(){return d}};o();o();o();function Mt(){if(typeof self=="object")return!1;let i=(()=>{if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;if(typeof self<"u")return self;throw new Error("No global object found")})();return Object.defineProperty(i,"globalThis",{value:i,writable:!0,configurable:!0}),!0}o();var F=(i=>(i.Pixel="pixel",i.Fraction="fraction",i))(F||{}),f=class Rt{constructor(a,e){this._value=a,this._unit=e}get value(){return this._value}get unit(){return this._unit}static fromJSON(a){return new Rt(a.value,a.unit)}toJSONObject(){return{unit:this.unit,value:this.value}}},ge=class Ze{constructor(a,e){this._x=a,this._y=e}static get zero(){return new Ze(new f(0,"pixel"),new f(0,"pixel"))}get x(){return this._x}get y(){return this._y}static fromJSON(a){return new Ze(f.fromJSON(a.x),f.fromJSON(a.y))}toJSONObject(){return{x:this.x.toJSONObject(),y:this.y.toJSONObject()}}};var Bt=class Et{constructor(a,e){this._width=a,this._height=e}get width(){return this._width}get height(){return this._height}static fromJSON(a){return new Et(f.fromJSON(a.width),f.fromJSON(a.height))}isSameAs(a){return JSON.stringify(this.toJSONObject())===JSON.stringify(a.toJSONObject())}toJSONObject(){return{width:this.width.toJSONObject(),height:this.height.toJSONObject()}}};var ve=class{constructor(i,a){this._size=i,this._aspect=a}get size(){return this._size}get aspect(){return this._aspect}},Wt=(i=>(i.WidthAndHeight="widthAndHeight",i.WidthAndAspectRatio="widthAndAspectRatio",i.HeightAndAspectRatio="heightAndAspectRatio",i.ShorterDimensionAndAspectRatio="shorterDimensionAndAspectRatio",i))(Wt||{}),et=class V{constructor(){this._shorterDimensionAndAspectRatio=null}get widthAndHeight(){return this._widthAndHeight}get widthAndAspectRatio(){return this._widthAndAspectRatio}get heightAndAspectRatio(){return this._heightAndAspectRatio}get shorterDimensionAndAspectRatio(){return this._shorterDimensionAndAspectRatio}get sizingMode(){return this.widthAndAspectRatio?"widthAndAspectRatio":this.heightAndAspectRatio?"heightAndAspectRatio":this.shorterDimensionAndAspectRatio?"shorterDimensionAndAspectRatio":"widthAndHeight"}static sizeWithWidthAndHeight(a){let e=new V;return e._widthAndHeight=a,e}static sizeWithWidthAndAspectRatio(a,e){let t=new V;return t._widthAndAspectRatio=new ve(a,e),t}static sizeWithHeightAndAspectRatio(a,e){let t=new V;return t._heightAndAspectRatio=new ve(a,e),t}static sizeWithShorterDimensionAndAspectRatio(a,e){let t=new V;return t._shorterDimensionAndAspectRatio=new ve(a,e),t}static fromJSON(a){if(a.width&&a.height)return V.sizeWithWidthAndHeight(new Bt(f.fromJSON(a.width),f.fromJSON(a.height)));if(a.width&&typeof a.aspect=="number")return V.sizeWithWidthAndAspectRatio(f.fromJSON(a.width),a.aspect);if(a.height&&typeof a.aspect=="number")return V.sizeWithHeightAndAspectRatio(f.fromJSON(a.height),a.aspect);if(a.shorterDimension&&typeof a.aspect=="number")return V.sizeWithShorterDimensionAndAspectRatio(f.fromJSON(a.shorterDimension),a.aspect);throw new Error(`SizeWithUnitAndAspectJSON is malformed: ${JSON.stringify(a)}`)}toJSONObject(){var a,e,t,r,n,s,l,p;switch(this.sizingMode){case"widthAndAspectRatio":return{width:(a=this.widthAndAspectRatio)==null?void 0:a.size.toJSONObject(),aspect:(e=this.widthAndAspectRatio)==null?void 0:e.aspect};case"heightAndAspectRatio":return{height:(t=this.heightAndAspectRatio)==null?void 0:t.size.toJSONObject(),aspect:(r=this.heightAndAspectRatio)==null?void 0:r.aspect};case"shorterDimensionAndAspectRatio":return{shorterDimension:(n=this.shorterDimensionAndAspectRatio)==null?void 0:n.size.toJSONObject(),aspect:(s=this.shorterDimensionAndAspectRatio)==null?void 0:s.aspect};default:return{width:(l=this.widthAndHeight)==null?void 0:l.width.toJSONObject(),height:(p=this.widthAndHeight)==null?void 0:p.height.toJSONObject()}}}},tt=class Ye{constructor(a,e,t,r){this._left=a,this._top=e,this._right=t,this._bottom=r}static get zero(){return new Ye(new f(0,"pixel"),new f(0,"pixel"),new f(0,"pixel"),new f(0,"pixel"))}get left(){return this._left}get right(){return this._right}get top(){return this._top}get bottom(){return this._bottom}static fromJSON(a){return new Ye(f.fromJSON(a.left),f.fromJSON(a.top),f.fromJSON(a.right),f.fromJSON(a.bottom))}toJSONObject(){return{left:this.left.toJSONObject(),right:this.right.toJSONObject(),top:this.top.toJSONObject(),bottom:this.bottom.toJSONObject()}}},x=class H{constructor(a){this.hexadecimalString=a}get redComponent(){return this.hexadecimalString.slice(0,2)}get greenComponent(){return this.hexadecimalString.slice(2,4)}get blueComponent(){return this.hexadecimalString.slice(4,6)}get alphaComponent(){return this.hexadecimalString.slice(6,8)}get red(){return H.hexToNumber(this.redComponent)}get green(){return H.hexToNumber(this.greenComponent)}get blue(){return H.hexToNumber(this.blueComponent)}get alpha(){return H.hexToNumber(this.alphaComponent)}static fromHex(a){return new H(H.normalizeHex(a))}static fromRGBA(a,e,t,r=1){let n=[a,e,t,H.normalizeAlpha(r)].reduce((s,l)=>s+H.numberToHex(l),"");return new H(n)}static areEquals(a,e){return a==null||e==null?!1:a.hexadecimalString===e.hexadecimalString}static hexToNumber(a){return Number.parseInt(a,16)}static fromJSON(a){return H.fromHex(a)}static numberToHex(a){let e=Math.round(a).toString(16);return e.length===1&&(e=`0${e}`),e.toUpperCase()}static normalizeHex(a){let e=a;return e.startsWith("#")&&(e=e.slice(1)),e.length<6&&(e=[...e].map(t=>t+t).join("")),e.length===6&&(e+="FF"),e.toUpperCase()}static normalizeAlpha(a){return a>0&&a<=1?255*a:a}withAlpha(a){let e=this.hexadecimalString.slice(0,6)+H.numberToHex(H.normalizeAlpha(a));return H.fromHex(e)}toJSON(){return this.hexadecimalString}},kt=(i=>(i.Unknown="unknown",i.Portrait="portrait",i.PortraitUpsideDown="portraitUpsideDown",i.LandscapeRight="landscapeRight",i.LandscapeLeft="landscapeLeft",i))(kt||{}),_t=(i=>(i.None="none",i.Horizontal="horizontal",i.LeftToRight="leftToRight",i.RightToLeft="rightToLeft",i.Vertical="vertical",i.TopToBottom="topToBottom",i.BottomToTop="bottomToTop",i))(_t||{}),Vt=(i=>(i.TopLeft="topLeft",i.TopCenter="topCenter",i.TopRight="topRight",i.CenterLeft="centerLeft",i.Center="center",i.CenterRight="centerRight",i.BottomLeft="bottomLeft",i.BottomCenter="bottomCenter",i.BottomRight="bottomRight",i))(Vt||{});o();o();var Jt="PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iNTQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTU4IDEwSDI4LjZMMjIuOS41QTEgMSAwIDAgMCAyMiAwSDJhMiAyIDAgMCAwLTIgMnY0NmE2IDYgMCAwIDAgNiA2aDQ4YTYgNiAwIDAgMCA2LTZWMTJhMiAyIDAgMCAwLTItMlptLTM3LjUgOGE0LjUgNC41IDAgMSAxIDAgOSA0LjUgNC41IDAgMCAxIDAtOVptMjcuNCAyNy41YTEgMSAwIDAgMS0uOS41SDEzYTEgMSAwIDAgMS0uOC0xLjVsNy0xMWExIDEgMCAwIDEgMS42LS4xbDUgNiA5LjQtMTVhMSAxIDAgMCAxIDEuMy0uM2wuNC40IDExIDIwYTEgMSAwIDAgMSAwIDFaIi8+PC9zdmc+";o();var wa=(i=>(i.Rounded="rounded",i.Square="square",i))(wa||{}),Ha=(i=>(i.Light="light",i.Bold="bold",i))(Ha||{}),Ut=class jt{constructor(a){this._isLooping=!1,this._isLooping=a}get isLooping(){return this._isLooping}static fromJSON(a){return a===null?null:new jt(a.looping)}toJSONObject(){return{looping:this.isLooping}}};o();var Sa=(i=>(i.Minimal="minimal",i.Extended="extended",i))(Sa||{}),zt=class{constructor(){this.type="tapToFocus"}toJSONObject(){return{type:this.type}}},Gt=class{constructor(){this.type="swipeToZoom"}toJSONObject(){return{type:this.type}}};var Ca=class{static fromJSON(i){return(i==null?void 0:i.type)==="tapToFocus"?new zt:null}},Fa=class{static fromJSON(i){return(i==null?void 0:i.type)==="swipeToZoom"?new Gt:null}};function at(i){let a="document"in self?self.document:void 0,e=a==null?void 0:a.createRange().createContextualFragment(i);if(e)return e.firstElementChild}function Ia(i){var a;return{Camera:{Settings:{preferredResolution:i.Camera.Settings.preferredResolution,zoomFactor:i.Camera.Settings.zoomFactor,zoomGestureZoomFactor:i.Camera.Settings.zoomGestureZoomFactor,focusGestureStrategy:i.Camera.Settings.focusGestureStrategy},defaultPosition:(a=i.Camera.defaultPosition)!=null?a:null,availablePositions:i.Camera.availablePositions},SingleImageUploader:{Settings:{iconElement:at(i.SingleImageUploader.Settings.iconElement),informationElement:at(i.SingleImageUploader.Settings.informationElement),buttonElement:at(i.SingleImageUploader.Settings.buttonElement),containerStyle:i.SingleImageUploader.Settings.containerStyle,iconStyle:i.SingleImageUploader.Settings.iconStyle,informationStyle:i.SingleImageUploader.Settings.informationStyle,buttonStyle:i.SingleImageUploader.Settings.buttonStyle,onlyCameraCapture:i.SingleImageUploader.Settings.onlyCameraCapture}},DataCaptureView:{scanAreaMargins:tt.fromJSON(JSON.parse(i.DataCaptureView.scanAreaMargins)),pointOfInterest:ge.fromJSON(JSON.parse(i.DataCaptureView.pointOfInterest)),logoStyle:i.DataCaptureView.logoStyle,logoAnchor:i.DataCaptureView.logoAnchor,logoOffset:ge.fromJSON(JSON.parse(i.DataCaptureView.logoOffset)),focusGesture:Ca.fromJSON(JSON.parse(i.DataCaptureView.focusGesture)),zoomGesture:Fa.fromJSON(JSON.parse(i.DataCaptureView.zoomGesture)),cameraRecoveryText:i.DataCaptureView.cameraRecoveryText},LaserlineViewfinder:{width:f.fromJSON(JSON.parse(i.LaserlineViewfinder.width)),enabledColor:x.fromJSON(i.LaserlineViewfinder.enabledColor),disabledColor:x.fromJSON(i.LaserlineViewfinder.disabledColor)},RectangularViewfinder:Object.keys(i.RectangularViewfinder.styles).reduce((e,t)=>{let r=i.RectangularViewfinder.styles[t];return e.styles[t]={size:et.fromJSON(JSON.parse(r.size)),color:x.fromJSON(r.color),style:r.style,lineStyle:r.lineStyle,dimming:Number.parseFloat(r.dimming.toString()),animation:Ut.fromJSON(JSON.parse(r.animation))},e},{defaultStyle:i.RectangularViewfinder.defaultStyle,styles:{}}),AimerViewfinder:{frameColor:x.fromJSON(i.AimerViewfinder.frameColor),dotColor:x.fromJSON(i.AimerViewfinder.dotColor)},Brush:{fillColor:x.fromJSON(i.Brush.fillColor),strokeColor:x.fromJSON(i.Brush.strokeColor),strokeWidth:i.Brush.strokeWidth},Feedback:{defaultVibrationPattern:i.Feedback.defaultVibrationPattern}}}var be=Ia({DataCaptureView:{focusGesture:"null",zoomGesture:"null",logoAnchor:"bottomRight",logoStyle:"extended",logoOffset:JSON.stringify({x:{value:0,unit:"fraction"},y:{value:0,unit:"fraction"}}),pointOfInterest:JSON.stringify({x:{value:.5,unit:"fraction"},y:{value:.5,unit:"fraction"}}),scanAreaMargins:JSON.stringify({left:{value:0,unit:"fraction"},right:{value:0,unit:"fraction"},top:{value:0,unit:"fraction"},bottom:{value:0,unit:"fraction"}}),cameraRecoveryText:"(This text is updated from translations)"},Camera:{Settings:{preferredResolution:"auto",zoomFactor:1,focusGestureStrategy:"manualUntilCapture",zoomGestureZoomFactor:2},defaultPosition:"worldFacing",availablePositions:["worldFacing","userFacing"]},SingleImageUploader:{Settings:{iconElement:atob(Jt),informationElement:"<p data-scandit-default>(This text is updated from translations)</p>",buttonElement:"<div data-scandit-default>(This text is updated from translations)</div>",containerStyle:{backgroundColor:"#FFFFFF"},iconStyle:{fill:"#121619"},informationStyle:{color:"#121619",marginBottom:"2em"},buttonStyle:{color:"#FFFFFF",backgroundColor:"#121619",fontWeight:"bold",padding:"1.25em",width:"12em",textAlign:"center",textTransform:"uppercase"},onlyCameraCapture:!1}},LaserlineViewfinder:{width:JSON.stringify({unit:"fraction",value:.8}),enabledColor:"#FFFFFFFF",disabledColor:"#00000000"},AimerViewfinder:{frameColor:"#FFFFFFFF",dotColor:"#FFFFFFCC"},RectangularViewfinder:{defaultStyle:"rounded",styles:{rounded:{size:JSON.stringify({aspect:1,shorterDimension:{unit:"fraction",value:.75}}),color:"#FFFFFFFF",style:"rounded",lineStyle:"light",dimming:0,animation:JSON.stringify({looping:!0})},square:{size:JSON.stringify({aspect:1,shorterDimension:{unit:"fraction",value:.75}}),color:"#FFFFFFFF",style:"square",lineStyle:"light",dimming:0,animation:JSON.stringify({looping:!0})}}},Brush:{fillColor:"#00000000",strokeColor:"#00000000",strokeWidth:0},Feedback:{defaultVibrationPattern:[300]}});o();var oe=class it{constructor(a=be.Brush.fillColor,e=be.Brush.strokeColor,t=be.Brush.strokeWidth){this.fill={color:a},this.stroke={color:e,width:t}}static get transparent(){let a=x.fromRGBA(255,255,255,0);return new it(a,a,0)}get fillColor(){return this.fill.color}get strokeColor(){return this.stroke.color}get strokeWidth(){return this.stroke.width}static areEquals(a,e){return a==null||e==null?!1:x.areEquals(a.fill.color,e.fill.color)&&x.areEquals(a.stroke.color,e.stroke.color)&&a.stroke.width===e.stroke.width}toJSONObject(){return{fill:{color:this.fillColor.toJSON()},stroke:{width:this.strokeWidth,color:this.strokeColor.toJSON()}}}static fromJSONObject(a){return new it(x.fromJSON(a.fill.color),x.fromJSON(a.stroke.color),a.stroke.width)}};Mt();function $t(i){return x.fromRGBA(i.r*255,i.g*255,i.b*255,i.a*255)}function z(i){return{r:i.red/255,g:i.green/255,b:i.blue/255,a:i.alpha/255}}function rt(i){return oe.fromJSONObject({fill:{color:$t(i.fillColor).toJSON()},stroke:{color:$t(i.strokeColor).toJSON(),width:i.strokeWidth}})}function G(i){let a=i instanceof oe?i:oe.fromJSONObject(i);return{fillColor:z(a.fillColor),strokeColor:z(a.strokeColor),strokeWidth:a.strokeWidth}}o();o();var C=(m=>(m[m.TopLeft=0]="TopLeft",m[m.TopRight=1]="TopRight",m[m.BottomRight=2]="BottomRight",m[m.BottomLeft=3]="BottomLeft",m[m.Top=4]="Top",m[m.Right=5]="Right",m[m.Bottom=6]="Bottom",m[m.Left=7]="Left",m[m.Center=8]="Center",m[m.WholeLabel=9]="WholeLabel",m))(C||{});function qt(i){return{[C.Bottom]:6,[C.BottomLeft]:3,[C.BottomRight]:2,[C.Center]:8,[C.Left]:7,[C.Right]:5,[C.Top]:4,[C.TopLeft]:0,[C.TopRight]:1,[C.WholeLabel]:9}[i]}o();function Oa(i){return{[F.Fraction]:2,[F.Pixel]:0}[i]}function se(i){return{value:i.value,unit:Oa(i.unit)}}o();o();o();var v=(i=>(i.EAN13UPCA="ean13Upca",i.UPCE="upce",i.EAN8="ean8",i.Code39="code39",i.Code93="code93",i.Code128="code128",i.Code11="code11",i.Code25="code25",i.Codabar="codabar",i.InterleavedTwoOfFive="interleavedTwoOfFive",i.MSIPlessey="msiPlessey",i.QR="qr",i.DataMatrix="dataMatrix",i.Aztec="aztec",i.MaxiCode="maxicode",i.DotCode="dotcode",i.KIX="kix",i.RM4SCC="rm4scc",i.GS1Databar="databar",i.GS1DatabarExpanded="databarExpanded",i.GS1DatabarLimited="databarLimited",i.PDF417="pdf417",i.MicroPDF417="microPdf417",i.MicroQR="microQr",i.Code32="code32",i.Lapa4SC="lapa4sc",i.IATATwoOfFive="iata2of5",i.MatrixTwoOfFive="matrix2of5",i.USPSIntelligentMail="uspsIntelligentMail",i.ArUco="aruco",i))(v||{}),Kt=(i=>(i.A="A",i.B="B",i.C="C",i))(Kt||{}),Xt=(i=>(i.Mod10="mod10",i.Mod11="mod11",i.Mod16="mod16",i.Mod43="mod43",i.Mod47="mod47",i.Mod103="mod103",i.Mod10AndMod11="mod1110",i.Mod10AndMod10="mod1010",i))(Xt||{}),Qt=(i=>(i.None="none",i.Unknown="unknown",i.Linked="linked",i.GS1TypeA="gs1TypeA",i.GS1TypeB="gs1TypeB",i.GS1TypeC="gs1TypeC",i))(Qt||{});function K(i){return{[v.Aztec]:13,[v.Codabar]:8,[v.Code11]:6,[v.Code128]:5,[v.Code25]:7,[v.Code32]:24,[v.Code39]:3,[v.Code93]:4,[v.DataMatrix]:12,[v.DotCode]:15,[v.EAN13UPCA]:0,[v.EAN8]:2,[v.GS1Databar]:18,[v.GS1DatabarExpanded]:19,[v.GS1DatabarLimited]:20,[v.IATATwoOfFive]:26,[v.InterleavedTwoOfFive]:9,[v.KIX]:16,[v.Lapa4SC]:25,[v.MSIPlessey]:10,[v.MatrixTwoOfFive]:27,[v.MaxiCode]:14,[v.MicroPDF417]:22,[v.MicroQR]:23,[v.PDF417]:21,[v.QR]:11,[v.RM4SCC]:17,[v.UPCE]:1,[v.USPSIntelligentMail]:28,[v.ArUco]:29}[i]}o();o();var La={[F.Pixel]:0,[F.Fraction]:2},_o={0:F.Pixel,2:F.Fraction,1:F.Pixel};function le(i){let a=La[i.unit];return{value:i.value,unit:a}}o();var nt=class extends c{constructor(){super(...arguments);this.handle={className:"AimerViewfinder",id:0}}create(){let e=this.Module.AimerViewfinder.create();return this.mapNativeImplementationToHandle(e)}async setFrameColor(e,t){this.nativeImplementationFromHandle(e).setFrameColor(t)}async getFrameColor(e){return this.nativeImplementationFromHandle(e).getFrameColor()}async setDotColor(e,t){this.nativeImplementationFromHandle(e).setDotColor(t)}async getDotColor(e){return this.nativeImplementationFromHandle(e).getDotColor()}async getDotColorDefault(){return this.Module.AimerViewfinder.getDotColorDefault()}async getFrameColorDefault(){return this.Module.AimerViewfinder.getFrameColorDefault()}},de=new nt;o();var ot=class extends c{constructor(){super(...arguments);this.handle={className:"NoViewfinder",id:0}}create(){let e=this.Module.NoViewfinder.create();return this.mapNativeImplementationToHandle(e)}},st=new ot;o();var lt=class extends c{constructor(){super(...arguments);this.handle={className:"RectangularViewfinderAnimation",id:0}}create(e){let t=this.Module.RectangularViewfinderAnimation.create(e);return this.mapNativeImplementationToHandle(t)}async isLooping(e){return this.nativeImplementationFromHandle(e).isLooping()}async toJson(e){return this.nativeImplementationFromHandle(e).toJson()}getNativeImplementation(e){return this.nativeImplementationFromHandle(e)}},dt=new lt;o();var mt=class extends c{constructor(){super(...arguments);this.handle={className:"RectangularViewfinder",id:0}}create(){let e=this.Module.RectangularViewfinder.create();return this.mapNativeImplementationToHandle(e)}createForStyles(e,t){let r=this.Module.RectangularViewfinder.createForStyles(e,t);return this.mapNativeImplementationToHandle(r)}async setWidthAndHeight(e,t,r){this.nativeImplementationFromHandle(e).setWidthAndHeight(t,r)}async setWidthAndAspectRatio(e,t,r){this.nativeImplementationFromHandle(e).setWidthAndAspectRatio(t,r)}async setHeightAndAspectRatio(e,t,r){this.nativeImplementationFromHandle(e).setHeightAndAspectRatio(t,r)}async setShorterDimensionAndAspectRatio(e,t,r){this.nativeImplementationFromHandle(e).setShorterDimensionAndAspectRatio(t,r)}async getSizeWithUnitAndAspect(e){return this.nativeImplementationFromHandle(e).getSizeWithUnitAndAspect()}async setColor(e,t){this.nativeImplementationFromHandle(e).setColor(t)}async getColor(e){return this.nativeImplementationFromHandle(e).getColor()}async setDisabledColor(e,t){this.nativeImplementationFromHandle(e).setDisabledColor(t)}async getDisabledColor(e){return this.nativeImplementationFromHandle(e).getDisabledColor()}async getStyle(e){return this.nativeImplementationFromHandle(e).getStyle()}async setAnimation(e,t){this.nativeImplementationFromHandle(e).setAnimation(t)}async getAnimation(e){return this.nativeImplementationFromHandle(e).getAnimation()}async setDimming(e,t){this.nativeImplementationFromHandle(e).setDimming(t)}async getDimming(e){return this.nativeImplementationFromHandle(e).getDimming()}async setDisabledDimming(e,t){this.nativeImplementationFromHandle(e).setDisabledDimming(t)}async getDisabledDimming(e){return this.nativeImplementationFromHandle(e).getDisabledDimming()}async getLineStyle(e){return this.nativeImplementationFromHandle(e).getLineStyle()}},L=new mt;async function Zt(i){var a,e;if(i.type==="rectangular"){let t=L.createForStyles(i.style==="rounded"?1:0,i.lineStyle==="light"?1:0),r=[];i.size.width&&i.size.height?r.push(L.setWidthAndHeight(t,le(i.size.width),le(i.size.height))):i.size.width&&i.size.aspect?r.push(L.setWidthAndAspectRatio(t,le(i.size.width),i.size.aspect)):i.size.height&&i.size.aspect&&r.push(L.setHeightAndAspectRatio(t,le(i.size.height),i.size.aspect)),r.push(L.setColor(t,z(x.fromJSON(i.color)))),r.push(L.setDisabledColor(t,z(x.fromJSON(i.disabledColor)))),r.push(L.setDimming(t,i.dimming));let n=dt.create((e=(a=i.animation)==null?void 0:a.looping)!=null?e:!1);return r.push(L.setAnimation(t,dt.getNativeImplementation(n))),await Promise.all(r),L.nativeImplementationFromHandle(t)}if(i.type==="aimer"){let t=de.create(),r=[];return r.push(de.setFrameColor(t,z(x.fromJSON(i.frameColor)))),r.push(de.setDotColor(t,z(x.fromJSON(i.dotColor)))),await Promise.all(r),de.nativeImplementationFromHandle(t)}return st.nativeImplementationFromHandle(st.create())}o();var pt=class extends c{constructor(){super(...arguments);this.handle={className:"BarcodeField",id:0}}async defaultSymbologies(e){return this.Module.BarcodeField.defaultSymbologies(e)}async getSymbologies(e){throw new Error("This method must be implemented manually.")}async setSymbologies(e,t){throw new Error("This method must be implemented manually.")}async getName(e){throw new Error("This method must be implemented manually.")}async isOptional(e){throw new Error("This method must be implemented manually.")}async setOptional(e,t){throw new Error("This method must be implemented manually.")}async getPatterns(e){throw new Error("This method must be implemented manually.")}async setPatterns(e,t){throw new Error("This method must be implemented manually.")}async getDataTypePatterns(e){throw new Error("This method must be implemented manually.")}async setDataTypePatterns(e,t){throw new Error("This method must be implemented manually.")}async getHiddenProperties(e){throw new Error("This method must be implemented manually.")}async setHiddenProperties(e,t){throw new Error("This method must be implemented manually.")}async getLocation(e){throw new Error("This method must be implemented manually.")}async setLocation(e,t){throw new Error("This method must be implemented manually.")}},X=new pt;o();var ct=class extends c{constructor(){super(...arguments);this.handle={className:"LabelCaptureHelper",id:0}}async addLabelCaptureToContext(e,t){this.Module.LabelCaptureHelper.addLabelCaptureToContext(e,t)}},Yt=new ct;o();var fe=class{constructor(a){this.workerMain=a}onFieldsScanned(a){this.workerMain.postCallbackMessage({type:"validationFlowListenerOnFieldsScanned",payload:{fields:a.map(e=>({labelField:JSON.parse(e.getLabelField().toJson()),valid:e.isValid()}))}})}onScanTimeout(){this.workerMain.postCallbackMessage({type:"validationFlowListenerOnScanTimeout"})}onLabelIsMissingRequiredField(a){this.workerMain.postCallbackMessage({type:"validationFlowListenerOnLabelIsMissingRequiredField",payload:{fields:a.map(e=>({labelField:JSON.parse(e.getLabelField().toJson()),valid:e.isValid()}))}})}onCloudBackupServiceStartedForFields(a){u.warn("Cloud Backup feature is not available for the web yet.")}onCloudBackupServiceFailedForFields(a){u.warn("Cloud Backup feature is not available for the web yet.")}onStateChanged(a){this.workerMain.postCallbackMessage({type:"validationFlowListenerOnStateChanged",payload:{state:a}})}};var Pe=class extends Oe{constructor(e,t){super(e,t);this.overlayListenerAdded=!1;this.labelBrushMap=new Map;this.fieldBrushMap=new Map;this.validationFlowHandlerListener=null;this.dataCaptureInstance=new he(t,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)}),this.labelCaptureBasicOverlayListener={onLabelTapped:(r,n)=>{this.postCallbackMessage({type:"labelCaptureBasicOverlayOnLabelTapped",payload:{labelJSON:JSON.parse(n.toJson())}})},brushForField:(r,n,s)=>{this.postCallbackMessage({type:"labelCaptureBasicOverlayBrushForField",payload:{fieldJSON:JSON.parse(n.toJson()),labelJSON:JSON.parse(s.toJson())}});let l=this.getFieldIdentifier(s,n);return this.fieldBrushMap.get(l)},brushForLabel:(r,n)=>{this.postCallbackMessage({type:"labelCaptureBasicOverlayBrushForLabel",payload:{labelJSON:JSON.parse(n.toJson())}});let s=this.getLabelIdentifier(n);return this.labelBrushMap.get(s)}}}get Module(){return this.dataCaptureInstance.Module}async respondWith(e,t,r){let n=null,s;try{s=r(),s instanceof Promise&&(s=await s)}catch(p){s=void 0,n=Y(p)}let l={type:"workerTaskId",command:e,id:t,payload:this.hasPayload(s)?s.payload:void 0};n!=null&&(l.error=n),this.postMessage(l,this.hasTransferables(s)?s.transferables:[])}postCallbackMessage(e,t){this.postMessage(e,t)}onMessage(e){switch(e.data.command){case"labelCaptureForContext":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{let r=await P.create(this.dataCaptureInstance.context,t.payload.settingsHandle);return await Yt.addLabelCaptureToContext(P.nativeImplementationFromHandle(r),this.dataCaptureInstance.context),{payload:r}}),!0}case"labelCaptureIsEnabled":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>({payload:await P.isEnabled(t.payload.labelCaptureHandle)})),!0}case"labelCaptureSetEnabled":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{await P.setEnabled(t.payload.labelCaptureHandle,t.payload.enabled)}),!0}case"labelCaptureApplySettings":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{await P.applySettingsWrapped(t.payload.labelCaptureHandle,O.nativeImplementationFromHandle(t.payload.settingsHandle))}),!0}case"labelCaptureAddListener":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{await P.nativeImplementationFromHandle(t.payload.labelCaptureHandle).addListenerAsync(this,1)}),!0}case"labelCaptureRemoveListener":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{await P.nativeImplementationFromHandle(t.payload.labelCaptureHandle).removeListenerAsync(this)}),!0}case"labelCaptureBuildLabelCaptureSettings":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{let{hiddenProperties:r,labelDefinitionHandles:n,labelProperties:s}=t.payload;return{payload:await O.create(n,JSON.stringify(r),s?JSON.stringify(s):"")}}),!0}case"labelCaptureBuildLabelDefinition":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>({payload:await _.create(t.payload.name,t.payload.fieldDefinitionHandles)})),!0}case"labelCaptureBuildVinLabelDefinition":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{let r=await _.createVinLabelDefinition(t.payload.name),n=_.nativeImplementationFromHandle(r),s=await n.getHiddenProperties(),l=n.getFieldDefinitions().map(p=>({name:p.getName(),patterns:p.getPatterns(),isOptional:p.isOptional()}));return{payload:{handle:r,name:n.getName(),hiddenProperties:s,fields:l}}}),!0}case"labelCaptureBuildPriceCaptureDefinition":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{let r=await _.createPriceCaptureDefinition(t.payload.name),n=_.nativeImplementationFromHandle(r),s=await n.getHiddenProperties(),l=n.getFieldDefinitions().map(p=>({name:p.getName(),patterns:p.getPatterns(),isOptional:p.isOptional()}));return{payload:{handle:r,name:n.getName(),hiddenProperties:s,fields:l}}}),!0}case"labelCaptureBuildCustomBarcode":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{let r=await ae.create(t.payload.name,await X.defaultSymbologies(t.payload.symbologies.map(s=>K(s)))),n=ae.nativeImplementationFromHandle(r);if(n.setOptional(t.payload.isOptional),t.payload.patterns.length>0&&n.setPatterns(t.payload.patterns),t.payload.locationHandle){let s=A.nativeImplementationFromHandle(t.payload.locationHandle);n.setLocation(s)}return t.payload.dataTypePatterns.length>0&&n.setDataTypePatterns(t.payload.dataTypePatterns),Object.keys(t.payload.hiddenProperties).length>0&&n.setHiddenProperties(JSON.stringify(t.payload.hiddenProperties)),{payload:r}}),!0}case"labelCaptureBuildCustomText":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{let r=await ie.create(t.payload.name),n=ie.nativeImplementationFromHandle(r);if(n.setOptional(t.payload.isOptional),t.payload.patterns.length>0&&n.setPatterns(t.payload.patterns),t.payload.locationHandle){let s=A.nativeImplementationFromHandle(t.payload.locationHandle);n.setLocation(s)}return t.payload.dataTypePatterns.length>0&&n.setDataTypePatterns(t.payload.dataTypePatterns),Object.keys(t.payload.hiddenProperties).length>0&&n.setHiddenProperties(JSON.stringify(t.payload.hiddenProperties)),{payload:r}}),!0}case"labelCaptureBuildExpiryDateText":{let{data:t}=e,{name:r,isOptional:n,patterns:s,labelDateFormat:l,hiddenProperties:p,dataTypePatterns:y,shouldResetDataTypePatterns:m}=t.payload;return this.respondWith(t.command,t.id,async()=>{let b=await re.create(r),g=re.nativeImplementationFromHandle(b);return g.setOptional(n),l&&g.setLabelDateFormat(l),s.length>0&&g.setPatterns(s),m?g.resetDataTypePatterns():y&&y.length>0&&g.setDataTypePatterns(y),Object.keys(p).length>0&&g.setHiddenProperties(JSON.stringify(p)),{payload:b}}),!0}case"labelCaptureBuildImeiOneBarcode":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{let r=await D.create(t.payload.name);return Object.keys(t.payload.hiddenProperties).length>0&&await D.setHiddenProperties(r,JSON.stringify(t.payload.hiddenProperties)),await D.setOptional(r,t.payload.isOptional),t.payload.patterns.length>0&&await D.setPatterns(r,t.payload.patterns),t.payload.dataTypePatterns.length>0&&await D.setDataTypePatterns(r,t.payload.dataTypePatterns),await D.setSymbologies(r,await X.defaultSymbologies(t.payload.symbologies.map(n=>K(n)))),{payload:r}}),!0}case"labelCaptureBuildImeiTwoBarcode":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{let r=await M.create(t.payload.name);return Object.keys(t.payload.hiddenProperties).length>0&&await M.setHiddenProperties(r,JSON.stringify(t.payload.hiddenProperties)),await M.setOptional(r,t.payload.isOptional),t.payload.patterns.length>0&&await M.setPatterns(r,t.payload.patterns),t.payload.dataTypePatterns.length>0&&await M.setDataTypePatterns(r,t.payload.dataTypePatterns),await M.setSymbologies(r,await X.defaultSymbologies(t.payload.symbologies.map(n=>K(n)))),{payload:r}}),!0}case"labelCaptureBuildPackingDateText":{let{data:t}=e,{name:r,isOptional:n,patterns:s,labelDateFormat:l,hiddenProperties:p,dataTypePatterns:y,shouldResetDataTypePatterns:m}=t.payload;return this.respondWith(t.command,t.id,async()=>{let b=await ne.create(r),g=ne.nativeImplementationFromHandle(b);return g.setOptional(n),l&&g.setLabelDateFormat(l),s.length>0&&g.setPatterns(s),m?g.resetDataTypePatterns():y&&y.length>0&&g.setDataTypePatterns(y),Object.keys(p).length>0&&g.setHiddenProperties(JSON.stringify(p)),{payload:b}}),!0}case"labelCaptureBuildPartNumberBarcode":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{let r=await R.create(t.payload.name);return Object.keys(t.payload.hiddenProperties).length>0&&await R.setHiddenProperties(r,JSON.stringify(t.payload.hiddenProperties)),await R.setOptional(r,t.payload.isOptional),t.payload.patterns.length>0&&await R.setPatterns(r,t.payload.patterns),t.payload.dataTypePatterns.length>0&&await R.setDataTypePatterns(r,t.payload.dataTypePatterns),await R.setSymbologies(r,await X.defaultSymbologies(t.payload.symbologies.map(n=>K(n)))),{payload:r}}),!0}case"labelCaptureBuildSerialNumberBarcode":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{let r=await B.create(t.payload.name);return Object.keys(t.payload.hiddenProperties).length>0&&await B.setHiddenProperties(r,JSON.stringify(t.payload.hiddenProperties)),await B.setOptional(r,t.payload.isOptional),t.payload.patterns.length>0&&await B.setPatterns(r,t.payload.patterns),t.payload.dataTypePatterns.length>0&&await B.setDataTypePatterns(r,t.payload.dataTypePatterns),await B.setSymbologies(r,await X.defaultSymbologies(t.payload.symbologies.map(n=>K(n)))),{payload:r}}),!0}case"labelCaptureBuildTotalPriceText":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{let{name:r,isOptional:n,patterns:s,hiddenProperties:l,dataTypePatterns:p,shouldResetDataTypePatterns:y}=t.payload,m=await E.create(r);return Object.keys(l).length>0&&await E.setHiddenProperties(m,JSON.stringify(l)),await E.setOptional(m,n),s.length>0&&await E.setPatterns(m,s),y?await E.resetDataTypePatterns(m):p&&p.length>0&&await E.setDataTypePatterns(m,p),{payload:m}}),!0}case"labelCaptureBuildUnitPriceText":{let{data:t}=e,{name:r,isOptional:n,patterns:s,hiddenProperties:l,dataTypePatterns:p,shouldResetDataTypePatterns:y}=t.payload;return this.respondWith(t.command,t.id,async()=>{let m=await W.create(r);return Object.keys(l).length>0&&await W.setHiddenProperties(m,JSON.stringify(l)),await W.setOptional(m,n),s.length>0&&await W.setPatterns(m,s),y?await W.resetDataTypePatterns(m):p&&p.length>0&&await W.setDataTypePatterns(m,p),{payload:m}}),!0}case"labelCaptureBuildWeightText":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{let{name:r,isOptional:n,patterns:s,hiddenProperties:l,dataTypePatterns:p,shouldResetDataTypePatterns:y}=t.payload,m=await k.create(r);return Object.keys(l).length>0&&await k.setHiddenProperties(m,JSON.stringify(l)),await k.setOptional(m,n),s.length>0&&await k.setPatterns(m,s),y?await k.resetDataTypePatterns(m):p&&p.length>0&&await k.setDataTypePatterns(m,p),{payload:m}}),!0}case"labelCaptureSettingsGetLocationSelection":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{let n=await O.nativeImplementationFromHandle(t.payload.settingsHandle).getLocationSelection();return{payload:n?JSON.parse(n.toJson()):void 0}}),!0}case"labelCaptureSettingsSetLocationSelection":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{if(t.payload.locationSelection.type==="rectangular"){let r=t.payload.locationSelection,n=this.Module.RectangularLocationSelection.create();if(r.size.width&&r.size.aspect){let l=se(r.size.width);n.setWidthAndAspectRatio(l,r.size.aspect)}if(r.size.height&&r.size.aspect){let l=se(r.size.height);n.setHeightAndAspectRatio(l,r.size.aspect)}if(r.size.width&&r.size.height){let l=se(r.size.width),p=se(r.size.height);n.setWidthAndHeight(l,p)}O.nativeImplementationFromHandle(t.payload.settingsHandle).setLocationSelection(n)}}),!0}case"labelCaptureSettingsGetProperty":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{let r=O.nativeImplementationFromHandle(t.payload.settingsHandle);return{payload:(()=>{switch(t.payload.key){case"licenseKey":return r.getLicenseKey();case"licensee":return r.getLicensee();default:return r.getIntProperty(t.payload.key)}})()}}),!0}case"labelCaptureSettingsSetProperty":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{let r=O.nativeImplementationFromHandle(t.payload.settingsHandle);switch(t.payload.key){case"licenseKey":typeof t.payload.value=="string"&&await r.setLicenseKey(t.payload.value);break;case"licensee":typeof t.payload.value=="string"&&await r.setLicensee(t.payload.value);break;default:typeof t.payload.value=="number"&&Number.isInteger(t.payload.value)&&await r.setIntProperty(t.payload.key,t.payload.value);break}}),!0}case"labelCaptureSettingsGetBlueprintJson":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>({payload:await O.nativeImplementationFromHandle(t.payload.settingsHandle).getBlueprintJson()})),!0}case"labelCaptureBuildLabelFieldLocation":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{let r;if(t.payload.rect)r=await A.createWithRect(t.payload.rect);else if(t.payload.locationType)r=await A.createWithType(qt(t.payload.locationType));else throw new Error("Cannot build a LabelFieldLocation without specifying a rect or locationType");return{payload:r}}),!0}case"labelCaptureBasicOverlayForLabelCapture":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>({payload:await w.create(t.payload.labelCaptureHandle)})),!0}case"labelCaptureBasicOverlaySetDefaultFieldBrush":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{w.setDefaultFieldBrush(t.payload.labelCaptureBasicOverlayHandle,t.payload.labelFieldState,t.payload.brush?G(t.payload.brush):void 0)}),!0}case"labelCaptureBasicOverlayGetDefaultFieldBrush":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{let r=await w.getDefaultFieldBrush(t.payload.labelCaptureBasicOverlayHandle,t.payload.labelFieldState);return{payload:r?rt(r):void 0}}),!0}case"labelCaptureBasicOverlaySetDefaultLabelBrush":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{w.setDefaultLabelBrush(t.payload.labelCaptureBasicOverlayHandle,t.payload.brush?G(t.payload.brush):void 0)}),!0}case"labelCaptureBasicOverlayGetDefaultLabelBrush":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{let r=await w.getDefaultLabelBrush(t.payload.labelCaptureBasicOverlayHandle);return{payload:r?rt(r):void 0}}),!0}case"labelCaptureBasicOverlaySetBrushForField":{let{data:t}=e,{brush:r,fieldJSON:n,labelCaptureBasicOverlayHandle:s,labelJSON:l}=t.payload;return this.respondWith(t.command,t.id,async()=>{if(this.overlayListenerAdded){let p=this.getFieldIdentifierFromJSON(l,n);if(r){let y=G(r);this.fieldBrushMap.set(p,y)}else this.fieldBrushMap.delete(p);return}await w.setBrushForField(s,r?G(r):void 0,n,l)}),!0}case"labelCaptureBasicOverlaySetBrushForLabel":{let{data:t}=e,{brush:r,labelCaptureBasicOverlayHandle:n,labelJSON:s}=t.payload;return this.respondWith(t.command,t.id,async()=>{if(this.overlayListenerAdded){let l=this.getLabelIdentifierFromJSON(s);if(r){let p=G(r);this.labelBrushMap.set(l,p)}else this.labelBrushMap.delete(l);return}await w.setBrushForLabel(n,r?G(r):void 0,s)}),!0}case"labelCaptureBasicOverlaySetListener":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{await w.setListener(t.payload.labelCaptureBasicOverlayHandle,this.labelCaptureBasicOverlayListener),this.overlayListenerAdded=!0}),!0}case"labelCaptureBasicOverlaySetShouldShowScanAreaGuides":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{await w.setShouldShowScanAreaGuides(t.payload.labelCaptureBasicOverlayHandle,t.payload.show)}),!0}case"labelCaptureBasicOverlayGetShouldShowScanAreaGuides":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>({payload:await w.getShouldShowScanAreaGuides(t.payload.labelCaptureBasicOverlayHandle)})),!0}case"labelCaptureBasicOverlayGetViewfinder":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>({payload:await w.getViewfinder(t.payload.labelCaptureBasicOverlayHandle)})),!0}case"labelCaptureBasicOverlayUpdateViewfinder":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{let r=await Zt(t.payload.viewfinderJSON);await w.setViewfinder(t.payload.labelCaptureBasicOverlayHandle,r)}),!0}case"addNativeOverlay":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{this.dataCaptureInstance.addNativeOverlay(e)}),!0}case"removeNativeOverlay":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{this.dataCaptureInstance.removeNativeOverlay(e)}),!0}case"labelCaptureAdvancedOverlayForLabelCapture":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>({payload:await U.create(t.payload.labelCaptureHandle)})),!0}case"labelCaptureAdvancedOverlaySetShouldShowScanAreaGuides":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{await U.setShouldShowScanAreaGuides(t.payload.labelCaptureAdvancedOverlayHandle,t.payload.show)}),!0}case"labelCaptureAdvancedOverlayGetShouldShowScanAreaGuides":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>({payload:await U.getShouldShowScanAreaGuides(t.payload.labelCaptureAdvancedOverlayHandle)})),!0}case"validationFlowOverlayForLabelCapture":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>({payload:await q.create(t.payload.labelCaptureHandle)})),!0}case"validationFlowOverlayApplySettings":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{let r=q.nativeImplementationFromHandle(t.payload.overlayHandle),n=N.nativeImplementationFromHandle(t.payload.settingsHandle);await r.applySettings(n)}),!0}case"validationFlowHandlerCreate":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{let n=await P.nativeImplementationFromHandle(t.payload.labelCaptureHandle).validationFlowHandler();return this.validationFlowHandlerListener||(this.validationFlowHandlerListener=new fe(this),n.addListener(this.validationFlowHandlerListener)),{payload:t.payload.labelCaptureHandle}}),!0}case"validationFlowHandlerStartCompleteLabelScan":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{await(await P.nativeImplementationFromHandle(t.payload.labelCaptureHandle).validationFlowHandler()).startCompleteLabelScan(t.payload.labelName)}),!0}case"validationFlowHandlerStartPartialLabelScan":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{await(await P.nativeImplementationFromHandle(t.payload.labelCaptureHandle).validationFlowHandler()).startPartialLabelScan(t.payload.fieldNames)}),!0}case"validationFlowHandlerUpdateFieldValue":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>({payload:await(await P.nativeImplementationFromHandle(t.payload.labelCaptureHandle).validationFlowHandler()).updateFieldValue(t.payload.fieldName,t.payload.value)})),!0}case"validationFlowHandlerFinishFlow":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{let s=await(await P.nativeImplementationFromHandle(t.payload.labelCaptureHandle).validationFlowHandler()).finishFlow();return s.type==="error"?{payload:s}:{payload:{type:"result",result:s.result.map(l=>({labelField:JSON.parse(l.getLabelField().toJson()),valid:l.isValid()}))}}}),!0}case"validationFlowHandlerPauseScan":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{await(await P.nativeImplementationFromHandle(t.payload.labelCaptureHandle).validationFlowHandler()).pauseScan()}),!0}case"validationFlowHandlerResumeScan":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{await(await P.nativeImplementationFromHandle(t.payload.labelCaptureHandle).validationFlowHandler()).resumeScan()}),!0}case"validationFlowHandlerGetValidationFlowFields":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>({payload:(await(await P.nativeImplementationFromHandle(t.payload.labelCaptureHandle).validationFlowHandler()).validationFlowFields()).map(l=>({labelField:JSON.parse(l.getLabelField().toJson()),valid:l.isValid()}))})),!0}case"validationFlowSettingsCreate":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>({payload:await N.create()})),!0}case"validationFlowSettingsSetMissingFieldsHintText":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{await N.nativeImplementationFromHandle(t.payload.settingsHandle).setMissingFieldsHintText(t.payload.text)}),!0}case"validationFlowSettingsGetMissingFieldsHintText":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>({payload:await N.nativeImplementationFromHandle(t.payload.settingsHandle).getMissingFieldsHintText()})),!0}case"validationFlowSettingsSetStandbyHintText":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{await N.nativeImplementationFromHandle(t.payload.settingsHandle).setStandbyHintText(t.payload.text)}),!0}case"validationFlowSettingsGetStandbyHintText":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>({payload:await N.nativeImplementationFromHandle(t.payload.settingsHandle).getStandbyHintText()})),!0}case"validationFlowSettingsSetValidationHintText":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{await N.nativeImplementationFromHandle(t.payload.settingsHandle).setValidationHintText(t.payload.text)}),!0}case"validationFlowSettingsGetValidationHintText":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>({payload:await N.nativeImplementationFromHandle(t.payload.settingsHandle).getValidationHintText()})),!0}case"validationFlowSettingsSetValidationErrorText":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{await N.nativeImplementationFromHandle(t.payload.settingsHandle).setValidationErrorText(t.payload.text)}),!0}case"validationFlowSettingsGetValidationErrorText":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>({payload:await N.nativeImplementationFromHandle(t.payload.settingsHandle).getValidationErrorText()})),!0}case"validationFlowSettingsSetRequiredFieldErrorText":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{await N.nativeImplementationFromHandle(t.payload.settingsHandle).setRequiredFieldErrorText(t.payload.text)}),!0}case"validationFlowSettingsGetRequiredFieldErrorText":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>({payload:await N.nativeImplementationFromHandle(t.payload.settingsHandle).getRequiredFieldErrorText()})),!0}case"validationFlowSettingsSetManualInputButtonText":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>{await N.nativeImplementationFromHandle(t.payload.settingsHandle).setManualInputButtonText(t.payload.text)}),!0}case"validationFlowSettingsGetManualInputButtonText":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>({payload:await N.nativeImplementationFromHandle(t.payload.settingsHandle).getManualInputButtonText()})),!0}default:return super.onMessage(e)}}onObservationStarted(){this.postCallbackMessage({type:"labelCaptureOnObservationStarted"})}onObservationStopped(){this.postCallbackMessage({type:"labelCaptureOnObservationStopped"})}onSessionUpdated(e,t,r){this.postCallbackMessage({type:"labelCaptureOnSessionUpdated",payload:{session:JSON.parse(t.toJson()),data:this.dataCaptureInstance.convertToLoadableFrameData(r)}}),r.delete()}getFieldIdentifier(e,t){var r;return`${e.getTrackingId()}-${t.getName()}-${(r=t.getText())!=null?r:""}`}getFieldIdentifierFromJSON(e,t){var r;return`${e.trackingId}-${t.name}-${(r=t.text)!=null?r:""}`}getLabelIdentifier(e){return e.getTrackingId()}getLabelIdentifierFromJSON(e){return e.trackingId}};var Tt=new Pe(self,{get:()=>self.Module,set:i=>{self.Module=i}});function Zs(i){}})();\n'],{type:"application/javascript"})),e=new Worker(i,n);return URL.revokeObjectURL(i),e}var o=class n extends DataCaptureLoader{constructor(){super(...arguments);this._name="BarcodeCapture";}get dataCaptureWorker(){return (this._dataCaptureWorker)!=null||(this._dataCaptureWorker=s({name:this.name})),this._dataCaptureWorker}get name(){return this._name}static async create(e){var a;let t=new n(e);return await t.workerCommand("setLogLevel",{level:(a=e.logLevel)!=null?a:Logger.Level.Debug}),await t.load(),t}async workerCommand(e,t,a){return new Promise((l,d)=>{let r=this.workerCommandId++;this.workerTasks.set(r,{resolve:l,reject:d,command:e});let m={...t,command:e,id:r};this.dataCaptureWorker.postMessage(m,a);})}};
2
+ export{o as a};