@scandit/web-datacapture-barcode 8.0.0-beta.2 → 8.0.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.
- package/LICENSE +1 -1
- package/THIRD_PARTY.txt +201 -71
- package/build/js/ar/BarcodeAr.js +1 -1
- package/build/js/ar/BarcodeArFeedback.js +1 -1
- package/build/js/ar/BarcodeArPresenter.js +1 -1
- package/build/js/ar/BarcodeArView.js +1 -1
- package/build/js/chunks/{chunk-ZQJQKBX6.js → chunk-4QYSTHLG.js} +1 -1
- package/build/js/chunks/{chunk-DAOHHWLA.js → chunk-57MQQWNB.js} +1 -1
- package/build/js/chunks/{chunk-24QH4TBX.js → chunk-5Q6EQEBB.js} +1 -1
- package/build/js/chunks/{chunk-JGFR6EJT.js → chunk-BUWIQBED.js} +1 -1
- package/build/js/chunks/{chunk-WLJK44YN.js → chunk-NE3R4NVC.js} +1 -1
- package/build/js/chunks/{chunk-CZQR5WQJ.js → chunk-QJFNNNI7.js} +1 -1
- package/build/js/chunks/{chunk-5P7G47HV.js → chunk-RLUCUFVA.js} +1 -1
- package/build/js/chunks/chunk-RVMZZAZJ.js +1 -0
- package/build/js/chunks/chunk-SCU7HYCK.js +2 -0
- package/build/js/chunks/{chunk-VD5CFXJU.js → chunk-SI7K4LM6.js} +1 -1
- package/build/js/chunks/{chunk-DSWVSQHP.js → chunk-U7BV6NAD.js} +1 -1
- package/build/js/chunks/{chunk-6HH5VZ3E.js → chunk-XBZZC32S.js} +1 -1
- package/build/js/find/BarcodeFindView.js +1 -1
- package/build/js/find/index.js +1 -1
- package/build/js/index.js +1 -1
- package/build/js/moduleLoader.js +1 -1
- package/build/js/spark/index.js +1 -1
- package/build/js/spark/ui/SparkScanView.js +1 -1
- package/build/js/spark/ui/SparkScanViewMiniPreview.js +1 -1
- package/build/js/spark/ui/SparkScanViewPresenter.js +1 -1
- package/build/js/spark/ui/index.js +1 -1
- package/build/js/worker/BarcodeCaptureWorkerManager.js +1 -1
- package/build/js/worker/WorkerMain.js +1 -1
- package/build/js/worker/barcodeCapture.inlineWorker.js +1 -1
- package/build/js/worker/dataCaptureEngine.js +1 -1
- package/package.json +2 -2
- package/sdc-lib/resources/models/barcode_label_localization_mslc_model_s.77afd87bb1ae.model +0 -0
- package/sdc-lib/scandit-datacapture-sdk-barcode-pthreads.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-barcode-pthreads.wasm +0 -0
- package/sdc-lib/scandit-datacapture-sdk-barcode-simd-pthreads.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-barcode-simd-pthreads.wasm +0 -0
- package/sdc-lib/scandit-datacapture-sdk-barcode-simd.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-barcode-simd.wasm +0 -0
- package/sdc-lib/scandit-datacapture-sdk-barcode.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-barcode.wasm +0 -0
- package/build/js/chunks/chunk-BD3MEJUD.js +0 -2
- package/build/js/chunks/chunk-OSA7SQXU.js +0 -1
- /package/build/js/chunks/{chunk-VFPCZE2A.js → chunk-IRKV6L4A.js} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {DataCaptureLoader,Logger}from'@scandit/web-datacapture-core';function i(r){let s=URL.createObjectURL(new Blob(['"use strict";(()=>{var p={"scandit-datacapture-sdk-barcode-pthreads.wasm":{bytes:7568438},"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":{bytes:7503605},"scandit-datacapture-sdk-barcode.wasm":{bytes:7446130},"scandit-datacapture-sdk-barcode-simd.wasm":{bytes:7380920}};function M(t){return typeof t=="object"&&t!=null}function C(t){if(typeof t=="string")return t;if(M(t)){if(typeof t.message=="string")return t.message}else if(typeof(t==null?void 0:t.toString)=="function")return t.toString();return"unknown error"}var d;(t=>{(l=>(l.Debug="debug",l.Info="info",l.Warn="warn",l.Error="error",l.Quiet="quiet"))(t.Level||(t.Level={}));let e=new Map([["debug",1],["info",2],["warn",3],["error",4],["quiet",5]]),a="debug";function r(l){a=l}t.setLevel=r;function s(l,...h){if(!(e.get(a)>e.get(l)))switch(l){case"debug":{console.debug(...h);break}case"info":{console.log(...h);break}case"warn":{console.warn(...h);break}case"error":{console.error(...h);break}}}t.log=s;function i(...l){s("warn",...l)}t.warn=i;function o(...l){s("debug",...l)}t.debug=o;function n(...l){s("info",...l)}t.info=n;function c(...l){s("error",...l)}t.error=c})(d||(d={}));var Te=class{constructor(t){if(typeof t!="function")throw new TypeError("FinalizationRegistry callback must be a function")}register(t,e,a){}unregister(t){return!1}};function re(t){typeof t.FinalizationRegistry>"u"&&(t.FinalizationRegistry=Te)}var A=class se extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,se.prototype),this.name=e.name}toString(){return`${this.name}: ${this.message}`}};var P=Promise.resolve(),Y=!1,j=!1,k,q={writableDataPath:""};async function ie(t){if(k==null)return;Y=!0;let e=new Promise((a,r)=>{setTimeout(()=>{r(new A({name:"BlockedIndexedDB",message:"IndexedDB database is blocked"}))},1500)});try{await Promise.race([new Promise((a,r)=>{k==null||k(t,s=>{if(s!=null){r(s);return}a()})}),e])}finally{Y=!1}}async function ne(t){return j||(Y?(j=!0,P=P.then(async()=>(j=!1,ie(t)))):P=ie(t)),P}async function oe(t){q=t,k=FS.syncfs,FS.syncfs=((e,a)=>{let r=a,s=()=>{r()},i=o=>{r(o)};ne(e).then(s).catch(i)});try{FS.mkdir(q.writableDataPath)}catch(e){if(e.code!=="EEXIST")throw k=void 0,e}return FS.mount(IDBFS,{},q.writableDataPath),ne(!0)}var de={};function Ee(t){return[...new Uint8Array(t)].map(e=>{let a=e.toString(16);return a.length===1?`0${a}`:a}).join("")}async function*Le(t){let e=t.getReader();try{for(;;){let{done:a,value:r}=await e.read();if(a)return;yield r}}finally{e.releaseLock()}}async function We(t){let e=[],a=0,r=0;for await(let i of Le(t))e.push(i),a+=i.length;let s=new Uint8Array(a);for(let i of e)s.set(i,r),r+=i.length;return s.buffer}var Re=(t=>(t.VALID="VALID",t.INVALID="INVALID",t.NOT_VERIFIABLE="NOT_VERIFIABLE",t))(Re||{});async function Ne(t,e,a){if(typeof crypto.subtle.digest!="function")return d.log(d.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 ${a} could not be verified`),"NOT_VERIFIABLE";try{let r=t instanceof Promise?await t:t,s=await crypto.subtle.digest("SHA-256",r),i=Ee(s);return e==null?(d.log(d.Level.Warn,"The library hash is not defined or empty, cannot correctly verify integrity."),"NOT_VERIFIABLE"):i===e?(d.log(d.Level.Debug,`Data Capture library WASM integrity found at ${a} has been verified correctly.`),"VALID"):(d.log(d.Level.Warn,`The Scandit Data Capture library WASM file found at ${a} seems invalid: expected file hash doesn\'t match (received: ${i}, expected: ${e}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),"INVALID")}catch(r){return d.log(d.Level.Warn,"Wasm response could not be verified",r),"NOT_VERIFIABLE"}}var X=new Map([["br",4.4],["gzip",2.9],["none",1]]);function He(t){var e;let a="content-encoding";if(t==null||t.get(a)==null)return X.get("none");let r=new Set(((e=t.get(a))!=null?e:"").split(",").map(s=>s.trim()));for(let[s,i]of X)if(r.has(s))return i;return X.get("none")}function _e(t){var e,a;if(t==null)return 0;let r=(e=He(t))!=null?e:1,s=Number.parseInt((a=t.get("content-length"))!=null?a:"0",10);return Number.isNaN(s)?0:Math.floor(s*r*100)/100}function ze(t){let{pathname:e}=new URL(t);for(let[a,r]of Object.entries(de))if(e.endsWith(a))return r.bytes;return 0}function ce(t){de=t}var Je=(t,e)=>{let a=_e(e);return a===0?ze(t):a};function Ve(t,e,a,{onProgress:r,onError:s,onComplete:i}){if(!e.body)return[e];let o=Je(t,e.headers),n=0,c=0;if(typeof TransformStream>"u")return d.warn("TransformStream is not supported in this environment. Progress tracking will be disabled."),[e];let[l,h]=a?e.body.tee():[e.body],m=l.pipeThrough(new TransformStream({async transform(g,f){try{n+=g.length,c=Number((n/o*100).toFixed(2)),o>0&&g.length>0&&c<100?r==null||r({percentage:c,loadedBytes:n,privateUri:t}):o===0&&g.length>0&&(r==null||r({percentage:null,loadedBytes:n,privateUri:t})),f.enqueue(g)}catch(w){f.error(w),s==null||s({error:w})}},flush(g){r==null||r({percentage:100,loadedBytes:n,privateUri:t}),i==null||i({percentage:100,loadedBytes:n,privateUri:t}),g.terminate()}}));return[new Response(m,{headers:new Headers(e.headers),status:e.status,statusText:e.statusText}),h]}async function K({wasmURI:t,expectedHash:e,verifyResponseHash:a,onProgress:r,onComplete:s,onError:i,referredOrigin:o}){let n=await fetch(t,{referrerPolicy:"origin",referrer:o!=null?o:""});if(!n.ok)throw new Error(`HTTP status code is not ok: ${n.status}, ${n.statusText}`);let[c,l]=Ve(t,n,a,{onProgress:r,onError:i,onComplete:s});return l!=null&&Ne(We(l),e,t),c}function le({wasmURI:t,expectedHash:e,verifyResponseHash:a,progressCallback:r,successCallback:s,errorCallback:i,importObject:o,referredOrigin:n}){async function c(h){try{let m=await K({wasmURI:t,expectedHash:e,verifyResponseHash:a,onProgress:r,referredOrigin:n}),g=await(h!=null?h:m).arrayBuffer(),f=await self.WebAssembly.instantiate(g,o);s(f.instance,f.module)}catch(m){d.log(d.Level.Error,m),d.log(d.Level.Error,`Couldn\'t instantiate Scandit SDK DataCapture library at ${t}, did you configure the path for it correctly?`),i==null||i(m)}}async function l(){let h;try{h=await K({wasmURI:t,expectedHash:e,verifyResponseHash:a,onProgress:r,referredOrigin:n});let m=await self.WebAssembly.instantiateStreaming(h,o);s(m.instance,m.module)}catch(m){d.log(d.Level.Warn,m),d.log(d.Level.Warn,"WebAssembly streaming compile failed. Falling back to ArrayBuffer instantiation (this will make things slower)"),c((h==null?void 0:h.bodyUsed)===!0?void 0:h)}}typeof self.WebAssembly.instantiateStreaming=="function"?l():c()}async function Z(t,e,a,r){return new Promise((s,i)=>{t().then(s).catch(o=>{let n=e*2;if(n>a){i(o);return}r(o),self.setTimeout(()=>{Z(t,n,a,r).then(s).catch(i)},e)})})}function Q(t){var e,a;let r="unknown";if((e=t.href)!=null&&e.startsWith("blob:null/"))r="localhost";else{let s=((a=t.pathname)==null?void 0:a.length)>1&&!t.pathname.startsWith("/");r=new URL(s?t.pathname:t.origin).hostname}return r.startsWith("[")&&r.endsWith("]")?(r=r.slice(1,-1),r):(/^(\\d{1,3}\\.){3}\\d{1,3}$/.test(r)&&(r=r.split(".").map(s=>Number.parseInt(s,10).toString()).join(".")),r)}async function ue(t,e){async function a(){return importScripts(t)}try{await Z(a,250,4e3,s=>{d.log(d.Level.Warn,s),d.log(d.Level.Warn,`Couldn\'t retrieve Scandit Data Capture library at ${t}, retrying...`)}),self.Module.mainScriptUrlOrBlob=t;let r=self.SDC_WASM_JS_VERSION;return r!==e&&d.log(d.Level.Warn,`The Scandit Data Capture library JS file found at ${t} seems invalid: expected version doesn\'t match (received: ${r}, expected: ${e}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),!0}catch(r){return d.log(d.Level.Error,r),!1}}var O=class{constructor(){this.promise=new Promise((t,e)=>{this.reject=e,this.resolve=t})}};var ee=class{constructor(t,e){this.workerFunctions=t,this.options=e,this.imageIdCounter=0,this.conversions=new Map}convertToJpeg(t,e){let a=this.imageIdCounter++,r=new O;this.conversions.set(a,r);let s=t.toBitmap();return this.workerFunctions.postMessage({type:"convertToJPEG",imageId:a,width:t.getWidth(),height:t.getHeight(),data:s,planes:t.getPlanes(),orientation:e,quality:this.options.quality},Array.from(new Set([s.buffer]))),r.promise}onConvertToJPEGResult(t,e){let a=this.conversions.get(t);a?(a.resolve(e),this.conversions.delete(t)):d.warn(`AsyncImageConverterForwarder: Conversion for imageId ${t} not found in Map`)}};var T=class{constructor(t){this.options=t}get quality(){return this.options.quality}async convertToJpeg(t,e){try{let{width:a,height:r,planes:s}=this.validateAndExtractImageData(t);this.prepareCanvas(a,r);let i=this.processImageData(t,s,a,r);return await this.convertToJpegBytes(i,e)}catch(a){throw d.warn(`Failed to convert image to JPEG: ${a}`),a instanceof Error?a:new Error("Failed to convert image to JPEG")}}validateAndExtractImageData(t){let e=t.getWidth(),a=t.getHeight(),r=t.getPlanes();if(e<=0||a<=0)throw d.warn(`Invalid image dimensions: ${e}x${a}`),new Error(`Invalid image dimensions: ${e}x${a}`);if(!r||r.length===0)throw d.warn("ImageBuffer has no planes"),new Error("ImageBuffer has no planes");return{width:e,height:a,planes:r}}prepareCanvas(t,e){if(!this.ensureCanvas(t,e))throw new Error("Failed to create OffscreenCanvas");if(!this.canvas||!this.context)throw new Error("Canvas or context not properly initialized")}processImageData(t,e,a,r){let s=this.createImageDataFromBuffer(t,e,a,r);if(s===null)throw new Error("Failed to create ImageData");return this.validateImageData(s,a,r),s}validateImageData(t,e,a){var r;if(t.width!==e||t.height!==a)throw d.warn(`ImageData dimensions mismatch: expected ${e}x${a}, got ${t.width}x${t.height}`),new Error("ImageData dimensions mismatch");if(!t.data||t.data.length!==e*a*4)throw d.warn(`ImageData has invalid data length: expected ${e*a*4}, got ${((r=t.data)==null?void 0:r.length)||0}`),new Error("ImageData has invalid data length")}async convertToJpegBytes(t,e){if(!this.context||!this.canvas)throw new Error("Canvas or context not available");try{this.context.putImageData(t,0,0)}catch(i){throw d.warn(`Failed to put image data on canvas: ${i}`),new Error(`Failed to put image data on canvas: ${i}`)}let a=e!==0?this.applyRotation(this.canvas,e):this.canvas,r;try{r=await this.canvasToBlob(a)}catch(i){throw d.warn(`Failed to convert canvas to blob: ${i}`),new Error(`Failed to convert canvas to blob: ${i}`)}if(!r||r.size===0)throw d.warn("Canvas convertToBlob returned empty or null blob"),new Error("Failed to create JPEG blob");let s;try{s=await r.arrayBuffer()}catch(i){throw d.warn(`Failed to get array buffer from blob: ${i}`),new Error(`Failed to get array buffer from blob: ${i}`)}if(!s||s.byteLength===0)throw d.warn("Blob arrayBuffer returned empty or null buffer"),new Error("Failed to get array buffer from blob");return new Uint8Array(s)}ensureCanvas(t,e){try{return(!this.canvas||this.canvas.width!==t||this.canvas.height!==e)&&(this.canvas=this.getNewCanvas(t,e),this.context=this.canvas.getContext("2d")),this.context!==null}catch(a){return d.warn("Failed to create HTMLCanvasElement",a),!1}}createImageDataFromBuffer(t,e,a,r){let s=new Set(e.map(i=>i.channel));try{if(this.isYUVFormat(s)){let n=t.toBitmap();return!n||n.length!==a*r*4?(d.warn(`Invalid bitmap data from toBitmap(): expected ${a*r*4} bytes, got ${(n==null?void 0:n.length)||0}`),null):new ImageData(new Uint8ClampedArray(n),a,r)}if(this.isRGBAFormat(s))return this.createImageDataFromRGBAPlanes(e,a,r);if(this.isRGBFormat(s))return this.createImageDataFromRGBPlanes(e,a,r);if(this.isGrayscaleFormat(s))return this.createImageDataFromGrayscalePlanes(e,a,r);d.warn(`Unknown image format with channels: ${Array.from(s).join(", ")}, falling back to toBitmap()`);let i=t.toBitmap();if(!i||i.length===0)return d.warn("toBitmap() returned empty or null data"),null;let o=i.length/(a*r);return o===4?new ImageData(new Uint8ClampedArray(i),a,r):(d.warn(`Unsupported format: ${o} bytes per pixel`),null)}catch(i){return d.warn(`Failed to create ImageData: ${i}`),null}}isYUVFormat(t){return t.has(0)&&t.has(1)&&t.has(2)}isRGBAFormat(t){return t.has(3)&&t.has(4)&&t.has(5)&&t.has(6)}isRGBFormat(t){return t.has(3)&&t.has(4)&&t.has(5)&&!t.has(6)}isGrayscaleFormat(t){return t.has(0)&&!t.has(1)&&!t.has(2)}createImageDataFromRGBAPlanes(t,e,a){let r=t.find(c=>c.channel===3),s=t.find(c=>c.channel===4),i=t.find(c=>c.channel===5),o=t.find(c=>c.channel===6);if(!r||!s||!i||!o)return d.warn("Missing RGBA planes"),null;let n=new Uint8ClampedArray(e*a*4);for(let c=0;c<a;c++)for(let l=0;l<e;l++){let h=(c*e+l)*4;n[h]=this.getPixelFromPlane(r,l,c),n[h+1]=this.getPixelFromPlane(s,l,c),n[h+2]=this.getPixelFromPlane(i,l,c),n[h+3]=this.getPixelFromPlane(o,l,c)}return new ImageData(n,e,a)}createImageDataFromRGBPlanes(t,e,a){let r=t.find(n=>n.channel===3),s=t.find(n=>n.channel===4),i=t.find(n=>n.channel===5);if(!r||!s||!i)return d.warn("Missing RGB planes"),null;let o=new Uint8ClampedArray(e*a*4);for(let n=0;n<a;n++)for(let c=0;c<e;c++){let l=(n*e+c)*4;o[l]=this.getPixelFromPlane(r,c,n),o[l+1]=this.getPixelFromPlane(s,c,n),o[l+2]=this.getPixelFromPlane(i,c,n),o[l+3]=255}return new ImageData(o,e,a)}createImageDataFromGrayscalePlanes(t,e,a){let r=t.find(i=>i.channel===0);if(!r)return d.warn("Missing Y plane for grayscale"),null;let s=new Uint8ClampedArray(e*a*4);for(let i=0;i<a;i++)for(let o=0;o<e;o++){let n=(i*e+o)*4,c=this.getPixelFromPlane(r,o,i);s[n]=c,s[n+1]=c,s[n+2]=c,s[n+3]=255}return new ImageData(s,e,a)}getPixelFromPlane(t,e,a){let r=Math.floor(e/(t.subsamplingX||1)),s=Math.floor(a/(t.subsamplingY||1)),i=t.rowStride,o=t.pixelStride,n=s*i+r*o,c=t.data;return n<c.length?c[n]:0}applyRotation(t,e){let a=e*Math.PI/180,r=e===90||e===270||e===-90||e===-270,s=r?t.height:t.width,i=r?t.width:t.height,o=this.getNewCanvas(s,i),n=o.getContext("2d");if(!n)throw new Error("Failed to get 2D context for rotated canvas");return n.translate(s/2,i/2),n.rotate(a),n.translate(-t.width/2,-t.height/2),n.drawImage(t,0,0),o}};T.JPEG_IMAGE_MIME_TYPE="image/jpeg";var pe=class extends T{getNewCanvas(t,e){return new OffscreenCanvas(t,e)}canvasToBlob(t){return t.convertToBlob({type:T.JPEG_IMAGE_MIME_TYPE,quality:this.options.quality})}};var E;(t=>{function e(){return"8.0.1"}t.sdkVersion=e})(E||(E={}));function Ue(t){return/^https?:\\/\\/(?:[^./]*\\.)*cdn.jsdelivr.net\\//.test(t)?{result:!0,cdnBaseURL:"https://cdn.jsdelivr.net/npm/"}:/^https?:\\/\\/(?:[^./]*\\.)*unpkg.com\\//.test(t)?{result:!0,cdnBaseURL:"https://unpkg.com/"}:{result:!1,cdnBaseURL:""}}function $e(t){let e=/@scandit\\/web-datacapture-[a-z]+/i.exec(t);return e?e[0]:null}function he(t,e,a){let r=e,s=Ue(r);if(s.result){let o=$e(r);o!=null&&(r=`${s.cdnBaseURL}${o}@${t}/sdc-lib/`)}let i=a.replace(".wasm","");return s.result?{jsURI:`${r}${i}.js`,wasmURI:`${r}${i}.wasm`}:{jsURI:`${r}${i}.js?v=${t}`,wasmURI:`${r}${i}.wasm?v=${t}`}}var Ge=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])),je=()=>(async t=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(t)}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 qe(){return typeof crossOriginIsolated>"u"?!1:crossOriginIsolated}function Ye(){try{return new WebAssembly.Memory({initial:1,maximum:1,shared:!0}).buffer.constructor.name==="SharedArrayBuffer"}catch{return!1}}async function me(){return Ge()}async function Xe(){if(!await je())return!1;let t=null;try{t=new Worker(URL.createObjectURL(new Blob([\'postMessage("Worker" in self);\'],{type:"text/javascript"})),{name:"nestedWorkerTest"})}catch{return!1}return new Promise(e=>{if(t==null){e(!1);return}t.onmessage=a=>{t==null||t.terminate(),e(a.data)}})}async function ge(){let t=await Xe();return qe()&&Ye()&&t}var fe=class be{constructor(e,a){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=e,this.workerFunctions=a,this._loadProgressCallback=this._loadProgressCallback.bind(this),ce(this.getWasmMetadata())}get Module(){return this.moduleHandler.get()}set isDrawLoopRunning(e){this._isDrawLoopRunning=e,!e&&typeof this.loopTimeoutId=="number"&&(clearTimeout(this.loopTimeoutId),this.loopTimeoutId=void 0)}get isDrawLoopRunning(){return this._isDrawLoopRunning}convertToLoadableFrameData(e){let a=this.getNextFrameId();this.frameDataPool.set(a,new Uint8ClampedArray(e.getFrameData()));let r=this.lastUsedModuleMirrorAxis==null?!1:this.lastUsedModuleMirrorAxis!==this.Module.Axis.None;return{frameId:a,width:e.getWidth(),height:e.getHeight(),isFrameSourceMirrored:r}}createContext(e){var a,r,s,i,o;let n=this.getModeDeserializers(),c=Q(location);(c==="localhost"||c==="127.0.0.1")&&navigator.userAgent.includes("Electron")&&e.appName!=null&&(c+=`-${e.appName}`),this.parentDomain=e.parentDomain,this.contextDeserializer=new this.Module.DataCaptureContextDeserializer(this.writableDataPath,e.deviceId,e.context.deviceModelName,c,this.parentDomain,n,e.delayedRegistration,e.highEndBlurryRecognition,this.resourcePath);let l=this.contextDeserializer.contextFromJson(JSON.stringify(e.context));if(l==null){let u=this.contextDeserializer.getLastError();throw new Error(`Could not create the context: ${u}`)}let h=l.getView();this.context=l.getContext(),l.delete();let m=this.Module.DataCaptureContextListener.extend("DataCaptureContextListener",{didChangeStatus:(u,b)=>{this.contextDidChangeStatus(JSON.parse(b.toJson())),u.delete()},didStartObservingContext:u=>{this.didStartObservingContext(),u.delete()},didStopObservingContext:u=>{u.delete()}}),g=this.Module.DataCaptureContextFrameListener.extend("DataCaptureContextFrameListener",{onObservationStarted:u=>{u.delete()},onObservationStopped:u=>{u.delete()},onFrameProcessingStarted:(u,b)=>{this.workerFunctions.postMessage({type:"onFrameProcessingStarted"}),b.delete(),u.delete()},onFrameProcessingFinished:(u,b)=>{this.workerFunctions.postMessage({type:"onFrameProcessingFinished"}),b.delete(),u.delete()},onFrameSkipped:(u,b)=>{this.workerFunctions.postMessage({type:"onFrameSkipped"}),b.delete(),u.delete()}}),f=this.Module.GestureRecognizer.extend("GestureRecognizer",{setGestureListener:(u,b)=>{var x;(x=this.gestureListener)==null||x.delete(),this.gestureListener=u.clone(),u.delete()}});(a=this.gestureRecognizer)==null||a.delete(),this.gestureRecognizer=new f;let w=new m;this.context.addListener(w),w.delete();let v=new g;this.context.addFrameListener(v),v.delete(),this.setView(h),(r=this.view)==null||r.setGestureRecognizer(this.gestureRecognizer);let F=this.Module.PlatformHintPresenter.extend("PlatformHintPresenter",{setHintPresenter:u=>{u.delete()},showToast:u=>{this.workerFunctions.postMessage({type:"showToast",payload:JSON.parse(u)})},hideToast:u=>{this.workerFunctions.postMessage({type:"hideToast",payload:JSON.parse(u)})},showGuidance:u=>{this.workerFunctions.postMessage({type:"showGuidance",payload:JSON.parse(u)})},hideGuidance:u=>{this.workerFunctions.postMessage({type:"hideGuidance",payload:JSON.parse(u)})},startUpdateTimer:u=>{this.workerFunctions.postMessage({type:"startUpdateTimer",payload:{duration:{unit:"ms",value:u}}})},stopUpdateTimer:()=>{this.workerFunctions.postMessage({type:"stopUpdateTimer"})}});(s=this.hintPresenterV2)==null||s.delete(),this.hintPresenterV2=null,(i=this.webPlatformHintPresenter)==null||i.delete(),this.webPlatformHintPresenter=null,this.webPlatformHintPresenter=new F,this.view&&(this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter),(o=this.view)==null||o.setHintPresenterV2(this.hintPresenterV2)),this.webAsyncImageConverterInstance=this.getAsyncImageConverterInstance({quality:1}),this.Module.ImageConverter.setAsyncInstance(this.webAsyncImageConverterInstance)}convertToJPEGResult(e,a){this.webAsyncImageConverterInstance instanceof ee&&this.webAsyncImageConverterInstance.onConvertToJPEGResult(e,a)}getAsyncImageConverterInstance(e){return this.workerFunctions.getOffscreenCanvas()!=null?new pe(e):new ee(this.workerFunctions,e)}onTap(e){var a;(a=this.gestureListener)==null||a.onTap(JSON.stringify(e))}hintPresenterV2Update(){var e;(e=this.hintPresenterV2)==null||e.update()}startReportingPerformanceMetrics(){this.performanceMetricsReporterTimer==null&&(this.performanceMetricsReporterTimer=setInterval(()=>{this.reportPerformanceMetrics();for(let e of Object.keys(this.performanceMetrics))this.performanceMetrics[e]=0},1e3))}async reportPerformanceMetrics(){this.workerFunctions.postMessage({type:"performanceMetricsReport",payload:{...this.performanceMetrics}})}deleteFrameData(e){this.frameDataPool.delete(e)}dispose(){var e,a,r,s;this.context.dispose(),this.frameDataPool.clear(),this.isDrawLoopRunning=!1,this.lastFrameCounter=-1,(e=this.gestureRecognizer)==null||e.delete(),this.gestureRecognizer=null,(a=this.gestureListener)==null||a.delete(),this.gestureListener=null,(r=this.hintPresenterV2)==null||r.delete(),this.hintPresenterV2=null,(s=this.webPlatformHintPresenter)==null||s.delete(),this.webPlatformHintPresenter=null}flushAnalytics(){this.context.flushAnalytics()}extractCentaurusLicense(e){return{payload:{centaurus:{licenseKey:this.Module.LicenseUtils[be.get3dPartyLicenseKeyMethodName](e)}}}}getModeDeserializers(){return new this.Module.VectorDataCaptureModeDeserializer}loadLibrary(e){return this.libraryLoadingPromise!=null?this.libraryLoadingPromise:(this.libraryLoadingPromise=this.setup(e),this.libraryLoadingPromise)}processFrame(e){var a;if(this.context==null)return{payload:e,transferables:[e.data.buffer]};let r=e.data,s=e.colorType==="GRAYSCALE"?this.Module.ImageBufferFormat.Grayscale8:this.Module.ImageBufferFormat.Rgba8888,i=this.Module.allocateUint8Array(r.byteLength);return this.Module.HEAPU8.set(r,i),(a=this.imageFrameSource)==null||a.outputFrame(i,e.width,e.height,s),{payload:e,transferables:[e.data.buffer]}}reportCameraProperties(e){this.context.setCameraProperties(e.deviceId,e.isFrontFacing,e.hasAutofocus)}requestFrameData(e){let a=this.frameDataPool.get(e);return a==null?{payload:{data:null}}:{payload:{data:a},transferables:[a.buffer]}}scheduleRedraw(e,a){this.addRedrawRequest(a),this.isDrawLoopRunning||this.startDrawLoop(e)}sendViewRefreshCommands(e){this.workerFunctions.postMessage({type:"draw",payload:e},[e.buffer])}setFrameSource(e,a){var r;this.lastUsedModuleMirrorAxis=this.mapMirrorAxisOnModule(e),(r=this.imageFrameSource)==null||r.delete(),this.imageFrameSource=new this.Module.ImageBufferFrameSource(this.lastUsedModuleMirrorAxis,a,0),this.context.setFrameSource(this.imageFrameSource)}startDrawLoop(e){this.isDrawLoopRunning=!0;let a=i=>this.redrawRequests.length>0&&this.redrawRequests[0]<=i,r=i=>{for(;this.redrawRequests.length>0&&this.redrawRequests[0]<=i;)this.redrawRequests.shift()},s=()=>{this.loopTimeoutId=setTimeout(()=>{if(!this.isDrawLoopRunning)return;let i=performance.now();if(a(i)){r(i),e.draw();let o=e.getDrawCommands();this.sendViewRefreshCommands(new Uint8Array(o))}s()},this.redrawInterval)};s()}updateContext(e){if(this.context!=null&&this.contextDeserializer!=null){e.view!=null&&!e.view.visible&&this.context.flushAnalytics();let a=this.onBeforeUpdateContextHook(e),r=this.contextDeserializer.updateContextFromJson(this.context,this.view,JSON.stringify(a.context));if(r==null){let i=this.contextDeserializer.getLastError();throw new Error(`Could not update the context: ${i}`)}this.context.delete(),this.context=r.getContext();let s=r.getView();r.delete(),s!=null&&a.view!=null&&s.setViewSize(a.view.width,a.view.height,a.view.orientation),!this.hintPresenterV2&&this.webPlatformHintPresenter&&(this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter)),s!=null&&this.hintPresenterV2&&s.setHintPresenterV2(this.hintPresenterV2),this.gestureRecognizer!=null&&(s==null||s.setGestureRecognizer(this.gestureRecognizer)),this.setView(s),d.debug("context updated",a)}}onBeforeUpdateContextHook(e){return e}onDocumentVisibilityChange(e){e==="hidden"&&this.context.flushAnalytics()}isFeatureSupported(e){return{payload:{supported:this.context.isFeatureSupported(e)}}}getViewfinderInfo(){var e,a;return{payload:{isDisplayingViewfinder:(a=(e=this.view)==null?void 0:e.isDisplayingViewfinder())!=null?a:!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(e){return this.getWasmSideModuleFileName()==null?[]:[`${e.replace(/\\/[^/]*$/,"/")}${this.getWasmSideModuleFileName()}`]}getWasmCoreExpectedHash(e,a){return a?e?"193e8c0d12bf3f73859ec31b79b8a6bb5f1bf14c0e83330162984f7bc4d41de9":"37abff9b10f9ffd5cf0c3556e11e28309658d2ceb6374b8c1acc0c99aa33c75d":e?"0296f4fb5e758ef03291ee43aa4115f9d8978442832fb21fde8bbf4628329dea":""}getWasmCoreFileName(e,a){return a?e?"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":"scandit-datacapture-sdk-barcode-pthreads.wasm":e?"scandit-datacapture-sdk-barcode-simd.wasm":""}getWasmMetadata(){return p}getWasmSideModuleFileName(){return""}_loadProgressCallback(e){this.workerFunctions.postMessage({type:"loadLibraryProgress",payload:e})}addRedrawRequest(e){this.redrawRequests.push(Math.round(performance.now())+e),this.redrawRequests.sort((a,r)=>a-r)}contextDidChangeStatus(e){e.code===260?e.message=e.message.replace("domain name",`domain name (${Q(location)})`):e.code===265&&(e.message=e.message.replace("domain name",`domain name (${this.parentDomain})`)),this.workerFunctions.postMessage({type:"contextDidChangeStatus",payload:e})}didStartObservingContext(){this.workerFunctions.postMessage({type:"didStartObservingContext"})}mapMirrorAxisOnModule(e){switch(e){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(e){this.view=e,this.setViewRefreshHandler(e),e==null&&(this.isDrawLoopRunning=!1,this.sendViewRefreshCommands(new Uint8Array([])))}addNativeOverlay(e){d.warn("addNativeOverlay has not been implemented for this module",e)}removeNativeOverlay(e){d.warn("removeNativeOverlay has not been implemented for this module",e)}setViewRefreshHandler(e){if(e==null||e.isViewRefreshHandlerSet)return;let a=this.Module.NeedsRedrawDelegate.extend("NeedsRedrawDelegate",{setNeedsRedrawIn:this.scheduleRedraw.bind(this,e)}),r=new a;e.setNeedsRedrawDelegate(r),e.isViewRefreshHandlerSet=!0}setupDataDecoding(){let e=this.moduleHandler.get(),a=e.DataDecoding.extend("DataDecoding",{decode(r,s){try{let i=JSON.parse(s),o=[];for(let n of i){let c=new TextDecoder(n.ianaName,{fatal:!0});o.push(c.decode(r.slice(n.startIndex,n.endIndex)))}return o.join("")}catch{return""}}});e.setDataDecoding(new a)}start(e,a,r){e&&a&&(this.setupDataDecoding(),this.moduleHandler.get().callMain(),this.moduleHandler.get().__emscripten_proxy_main!==void 0||r())}getWritableDataPath(e){return e!=null?(d.debug(`IndexedDB database name override in use to recover from blocked standard database: ${e}`),e):this.writableDataPathStandard}numOfMBToPages(e){return Math.ceil(1024*e*1024/64/1024)}async setup({libraryLocation:e,locationPath:a,writableDataPathOverride:r,overrideThreadsSupport:s,overrideSimdSupport:i,verifyResponseHash:o,referredOrigin:n,fixedWasmMemory:c}){var l;let h=!1,m=!1;this.writableDataPath=this.getWritableDataPath(r),this.resourcePath=`${e}${this.resourceFilesSubfolder}/`,self.path=a;let{resolve:g,reject:f,promise:w}=new O,v=E.sdkVersion();if(v==="")throw new A({name:"Invalid library version",message:"Library version is not defined or empty, cannot generate proper path to library files."});let[F,u]=await Promise.all([me(),ge()]);s!=="auto"&&(u=s==="on"),i!=="auto"&&(F=i==="on");let b=this.getWasmCoreFileName(F,u),x=he(v,e,b),{jsURI:G,wasmURI:ae}=x,Be={instantiateWasm:(y,Ae)=>(le({importObject:y,wasmURI:ae,expectedHash:this.getWasmCoreExpectedHash(F,u),verifyResponseHash:o,successCallback:Ae,progressCallback:this._loadProgressCallback,errorCallback:Pe=>{f(Pe)},referredOrigin:n}),{})},B=c===null?null:new WebAssembly.Memory({initial:this.numOfMBToPages(c),maximum:this.numOfMBToPages(300),shared:u});return B!==null&&d.log(d.Level.Debug,"Fixed wasmMemory set",B),this.moduleHandler.set({...B?{wasmMemory:B}:{},mainScriptUrlOrBlob:G,canvas:(l=this.workerFunctions.getOffscreenCanvas())!=null?l:{getContext:()=>null},...Be,dynamicLibraries:this.getWasmDynamicLibraries(ae),locateFile:y=>e+y,noInitialRun:!0,preRun:[async()=>{try{await oe({writableDataPath:this.writableDataPath})}catch(y){if(y.name==="BlockedIndexedDB"){f(y.toString());return}d.log(d.Level.Debug,"No IndexedDB support, some data will not be persisted:",y)}m=!0,this.start(m,h,g)}],onMainComplete:()=>{if([h,m].includes(!1)){d.log(d.Level.Warn,{runtimeLoaded:h,fileSystemSynced:m},"Both runtimeLoaded and fileSystemSynced should be true when calling onMainComplete"),f("onMainComplete has been called but runtime or file system was not ready.");return}g()},onRuntimeInitialized:()=>{h=!0,this.start(m,h,g)},print:y=>{d.log(d.Level.Info,y)}}),await ue(G,v)||f(`Couldn\'t retrieve Scandit Data Capture library at ${G}, did you configure the path for it correctly?`),w}};fe.get3dPartyLicenseKeyMethodName=atob("Z2V0QmxpbmtJZExpY2Vuc2VLZXk=");var D=fe;function ye(t){return typeof t=="object"&&t!=null&&t.document==null&&"addEventListener"in t&&typeof t.importScripts=="function"}function Se(t){console.warn("Reached unexpected case",t)}var te=class{constructor(t,e){this.onMessageListener=this.onMessage.bind(this),this.workerSelf=t,this.dataCaptureInstance=new D(e,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)}),ye(t)&&(re(t),this.listenToMessages())}listenToMessages(){this.workerSelf.addEventListener("message",this.onMessageListener),this.workerSelf.addEventListener("error",t=>{d.log(d.Level.Error,t)}),this.workerSelf.addEventListener("messageerror",t=>{d.log(d.Level.Error,t)})}postMessage(t,e){this.workerSelf.postMessage(t,e!=null?e:[])}getOffscreenCanvas(){if(this.isOffscreenCanvasSupported())return new this.workerSelf.OffscreenCanvas(32,32)}isOffscreenCanvasSupported(){return typeof this.workerSelf.OffscreenCanvas=="function"}hasPayload(t){return M(t)&&"payload"in t}hasTransferables(t){return M(t)&&Array.isArray(t.transferables)}async respondWith(t,e,a){let r=null,s;try{s=a(),s instanceof Promise&&(s=await s)}catch(o){s=void 0,r=C(o)}let i={type:"workerTaskId",command:t,id:e,payload:this.hasPayload(s)?s.payload:void 0};r!=null&&(i.error=r),this.postMessage(i,this.hasTransferables(s)?s.transferables:[])}onMessage(t){switch(t.data.command){case"loadLibrary":{{let{data:e}=t;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.loadLibrary({libraryLocation:e.libraryLocation,locationPath:e.locationPath,referredOrigin:e.referredOrigin,writableDataPathOverride:e.writableDataPathOverride,overrideThreadsSupport:e.overrideThreadsSupport,overrideSimdSupport:e.overrideSimdSupport,verifyResponseHash:e.verifyResponseHash,fixedWasmMemory:e.fixedWasmMemory}))}break}case"onTap":{{let{data:e}=t;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.onTap(e.point)})}break}case"hintPresenterV2update":{{let{data:e}=t;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.hintPresenterV2Update()})}break}case"createContext":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.createContext({context:e.context,deviceId:e.deviceId,delayedRegistration:e.delayedRegistration,highEndBlurryRecognition:e.highEndBlurryRecognition,appName:e.appName,parentDomain:e.parentDomain}))}break}case"setFrameSource":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.setFrameSource(e.mirrorAxis,e.isCameraFrameSource))}break}case"processFrame":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.processFrame({data:e.data,width:e.width,height:e.height,colorType:e.colorType}))}break}case"requestFrameData":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.requestFrameData(e.frameId))}break}case"deleteFrameData":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.deleteFrameData(e.frameId)})}break}case"updateContext":{{let{data:e}=t;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.updateContext(e))}break}case"dispose":{this.respondWith(t.data.command,t.data.id,()=>this.dataCaptureInstance.dispose());break}case"flushAnalytics":{this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.flushAnalytics()});break}case"reportCameraProperties":{{let{data:e}=t;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.reportCameraProperties(e))}break}case"setLogLevel":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>{d.setLevel(e.level)})}break}case"extractCentaurusLicense":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.extractCentaurusLicense(e.licenseKey))}break}case"documentVisibility":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.onDocumentVisibilityChange(e.state)})}break}case"isFeatureSupported":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.isFeatureSupported(e.feature))}break}case"getViewfinderInfo":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getViewfinderInfo())}break}case"getOpenSourceSoftwareLicenseInfo":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getOpenSourceSoftwareLicenseInfo())}break}case"addNativeOverlay":this.dataCaptureInstance.addNativeOverlay(t);break;case"removeNativeOverlay":this.dataCaptureInstance.removeNativeOverlay(t);break;case"convertToJPEGResult":{{let{data:e}=t;this.dataCaptureInstance.convertToJPEGResult(e.imageId,e.result)}break}default:return Se(t.data),!1}return!0}};var we=(t=>(t.Body="body",t.Footnote="footnote",t))(we||{}),L=(t=>(t.Start="start",t.Center="center",t.End="end",t))(L||{}),ve=(t=>(t.Normal="normal",t.Wider="wider",t.FitText="fitText",t))(ve||{}),Fe=(t=>(t.Normal="normal",t.Taller="taller",t))(Fe||{}),Me=(t=>(t.Square="square",t.Rounded="rounded",t))(Me||{}),W=(t=>(t.None="none",t.Check="check",t.ExclamationMark="exclamationMark",t))(W||{}),R=(t=>(t.Top="top",t.AboveViewFinder="aboveViewFinder",t.BelowViewFinder="belowViewFinder",t))(R||{}),Ce=(t=>(t.AboveViewFinder="aboveViewFinder",t.BelowViewFinder="belowViewFinder",t))(Ce||{}),ke=(t=>(t.BlackOnWhite="blackOnWhite",t.WhiteOnBlack="whiteOnBlack",t.Transparent="transparent",t))(ke||{}),I=(t=>(t.Success="success",t.Error="error",t.Warning="warning",t.Info="info",t.Notification="notification",t))(I||{}),De=(t=>(t[t.Ocr=0]="Ocr",t[t.HideLogo=1]="HideLogo",t[t.ShowTestLicenseMessage=2]="ShowTestLicenseMessage",t[t.AugmentedReality=5]="AugmentedReality",t[t.ActivityPingStatsAddon=8]="ActivityPingStatsAddon",t[t.ActivityPing=9]="ActivityPing",t[t.Registration=10]="Registration",t[t.Parser=11]="Parser",t[t.BarcodeCapture=14]="BarcodeCapture",t[t.Analytics=17]="Analytics",t[t.AnalyticsBatchMode=18]="AnalyticsBatchMode",t[t.AnalyticsScanContent=19]="AnalyticsScanContent",t[t.AnalyticsOnlineVerification=20]="AnalyticsOnlineVerification",t[t.SparkScan=21]="SparkScan",t[t.AamvaIdBarcodeVerification=22]="AamvaIdBarcodeVerification",t[t.MappingForTracking=23]="MappingForTracking",t[t.BarcodeFind=24]="BarcodeFind",t[t.MandatoryRegistration=25]="MandatoryRegistration",t[t.FeatureTracking=26]="FeatureTracking",t[t.IdCaptureViz=27]="IdCaptureViz",t[t.IdCaptureMrz=28]="IdCaptureMrz",t[t.IdCaptureBarcode=29]="IdCaptureBarcode",t[t.BarcodeSelectionAimToScan=30]="BarcodeSelectionAimToScan",t[t.BarcodeSelectionTapToScan=31]="BarcodeSelectionTapToScan",t[t.BarcodeCount=32]="BarcodeCount",t[t.BarcodePick=33]="BarcodePick",t[t.IdVerificationDataComparison=34]="IdVerificationDataComparison",t[t.SmartLabelBarcode=35]="SmartLabelBarcode",t[t.SmartLabelText=36]="SmartLabelText",t[t.VoidedIdDetection=37]="VoidedIdDetection",t[t.BarcodeArFull=38]="BarcodeArFull",t[t.BarcodeSequence=39]="BarcodeSequence",t))(De||{});var N=class{constructor(e,a,r){this.barcodeAr=null;this.coreEngine=e,this.Module=a,this.workerFunctions=r}async forSettings(e){var r;(r=this.barcodeAr)==null||r.delete(),this.barcodeAr=new this.Module.BarcodeAr(this.coreEngine.context,JSON.stringify(e));let a=this.Module.BarcodeArListener.extend("BarcodeArListener",{didUpdateSession:(s,i,o)=>{let n=this.coreEngine.convertToLoadableFrameData(o);this.workerFunctions.postMessage({type:"barcodeArDidUpdateSession",payload:{session:JSON.parse(i.toJson()),frameData:n}}),s.delete(),i.delete(),o.delete()}});this.barcodeAr.addListener(new a,1),this.Module.addBarcodeArToContext(this.coreEngine.context,this.barcodeAr)}start(){var e;(e=this.barcodeAr)==null||e.start()}pause(){var e;(e=this.barcodeAr)==null||e.pause()}stop(){var e;(e=this.barcodeAr)==null||e.stop()}setEnabled(e){var a;(a=this.barcodeAr)==null||a.setEnabled(e)}async removeMode(){this.barcodeAr!=null&&this.Module.removeBarcodeArFromContext(this.coreEngine.context,this.barcodeAr)}applySettings(e){var a;(a=this.barcodeAr)==null||a.applySettings(JSON.stringify(e))}};var H=class{constructor(e,a,r){this.trackingListenerSet=!1;this.coreEngine=e,this.Module=a,this.workerFunctions=r,this.setup()}barcodeBatchDidUpdateSession(e){this.workerFunctions.postMessage({type:"barcodeBatchDidUpdateSession",payload:JSON.parse(e.toJson())})}getBatchDeserializer(){return this.barcodeBatchDeserializer}setup(){let e=this.Module.BarcodeBatchListener.extend("BarcodeTrackingListener",{didUpdateSession:(r,s,i)=>{this.barcodeBatchDidUpdateSession(s),r.delete(),s.delete(),i.delete()},onTrackedBarcodeTapped:(r,s)=>{this.onTrackedBarcodeTapped(s),r.delete(),s.delete()}}),a=this.Module.BarcodeBatchDeserializerListener.extend("BarcodeTrackingDeserializerListener",{onModeDeserializationFinished:(r,s,i)=>{this.trackingListenerSet||(s.addListener(new e,1),this.trackingListenerSet=!0),r.delete(),s.delete(),i.delete()},onModeDeserializationStarted(r,s,i){r.delete(),s.delete(),i.delete()},onSettingsDeserializationStarted(r,s,i){r.delete(),s.delete(),i.delete()},onSettingsDeserializationFinished(r,s,i){r.delete(),s.delete(),i.delete()}});this.barcodeBatchDeserializer=new this.Module.BarcodeBatchDeserializer,this.barcodeBatchDeserializer.setListener(new a)}onTrackedBarcodeTapped(e){this.workerFunctions.postMessage({type:"didTapTrackedBarcode",payload:JSON.parse(e.toJson())})}};var _=class{constructor(e,a,r){this.captureListenerSet=!1;this.coreEngine=e,this.Module=a,this.workerFunctions=r,this.setup()}barcodeCaptureDidUpdateSession(e){this.workerFunctions.postMessage({type:"barcodeCaptureDidUpdateSession",payload:JSON.parse(e.toJson())})}barcodeBatchDidUpdateSession(e){this.workerFunctions.postMessage({type:"barcodeBatchDidUpdateSession",payload:JSON.parse(e.toJson())})}getCaptureDeserializer(){return this.barcodeCaptureDeserializer}getTrackingDeserializer(){return this.barcodeBatchDeserializer}setup(){let e=this.Module.BarcodeCaptureListener.extend("BarcodeCaptureListener",{didScan:(o,n,c)=>{this.barcodeCaptureDidScan(n,c),o.delete(),c.delete(),n.delete()},didUpdateSession:(o,n,c)=>{this.barcodeCaptureDidUpdateSession(n),o.delete(),c.delete(),n.delete()}}),a=this.Module.Feedback.extend("Feedback",{emit:()=>{this.successFeedback()}}),r=new e,s=new a,i=this.Module.BarcodeCaptureDeserializerListener.extend("BarcodeCaptureDeserializerListener",{onModeDeserializationFinished:(o,n,c)=>{n.addListener(r,1),n.setSuccessFeedback(s),o.delete(),n.delete(),c.delete()},onModeDeserializationStarted(o,n,c){o.delete(),n.delete(),c.delete()},onSettingsDeserializationStarted(o,n,c){o.delete(),n.delete(),c.delete()},onSettingsDeserializationFinished(o,n,c){o.delete(),n.delete(),c.delete()}});this.barcodeCaptureDeserializer=new this.Module.BarcodeCaptureDeserializer,this.barcodeCaptureDeserializer.setListener(new i)}successFeedback(){this.workerFunctions.postMessage({type:"successFeedback"})}barcodeCaptureDidScan(e,a){let r=this.coreEngine.convertToLoadableFrameData(a);this.workerFunctions.postMessage({type:"barcodeCaptureDidScan",payload:{session:JSON.parse(e.toJson()),frameData:r}})}};function Ke(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Ie(t){return t}var z=class{constructor(e,a,r){this.barcodeFind=null;this.basicOverlay=null;this.transparentGuidanceHintStyle={backgroundColor:"00000000",cornerRadius:4,fitToText:!1,isAnimatedToView:!1,textAlignment:L.Center,hintIcon:W.None,hintAnchor:R.AboveViewFinder,hintAnchorOffset:-12,horizontalMargin:0,iconColor:"00000000",lineHeight:-1,maxLines:1,maxWidthFraction:.8,textColor:"ffffffff",textSize:15,textWeight:600};this.customerTransformation=Ie;this.coreEngine=e,this.Module=a,this.workerFunctions=r}async forSettings(e){var o;(o=this.barcodeFind)==null||o.delete(),this.barcodeFind=new this.Module.BarcodeFind(this.coreEngine.context,JSON.stringify(e));let a=this.Module.Feedback.extend("Feedback",{emit:()=>{this.listUpdatedFeedback()}}),r=this.Module.Feedback.extend("Feedback",{emit:()=>{this.barcodeFindFeedback()}}),s=this.Module.BarcodeFindTransformer.extend("BarcodeFindTransformer",{transformBarcodeData:n=>this.customerTransformation(n)}),i=this.Module.BarcodeFindListener.extend("BarcodeFindListener",{didUpdateSession:(n,c,l)=>{let h=this.coreEngine.convertToLoadableFrameData(l);this.workerFunctions.postMessage({type:"barcodeFindDidUpdateSession",payload:{session:JSON.parse(c.toJson()),frameData:h}}),n.delete(),c.delete(),l.delete()},onSearchPaused:n=>{let c=[];for(let l=0;l<n.size();l++)c.push(n.get(l));this.workerFunctions.postMessage({type:"barcodeFindSearchPaused",payload:{foundItems:c}})},onSearchStopped:n=>{let c=[];for(let l=0;l<n.size();l++)c.push(n.get(l));this.workerFunctions.postMessage({type:"barcodeFindSearchStopped",payload:{foundItems:c}})},onSearchStarted:()=>{this.workerFunctions.postMessage({type:"barcodeFindSearchStarted",payload:{}})}});this.barcodeFind.setBarcodeFindTransformer(new s),this.barcodeFind.addListener(new i,1),this.barcodeFind.setItemListUpdatedFeedback(new a),this.barcodeFind.setFeedback(new r),this.Module.addBarcodeFindToContext(this.coreEngine.context,this.barcodeFind)}barcodeFindFeedback(){this.workerFunctions.postMessage({type:"barcodeFindFeedback",payload:{}})}start(){var e;(e=this.barcodeFind)==null||e.start()}stop(){var e;(e=this.barcodeFind)==null||e.stop()}pause(){var e;(e=this.barcodeFind)==null||e.pause()}setEnabled(e){var a;(a=this.barcodeFind)==null||a.setEnabled(e)}setItemList(e){var a;(a=this.barcodeFind)==null||a.setItemList(JSON.stringify(e))}async removeMode(){this.barcodeFind!=null&&this.Module.removeBarcodeFindFromContext(this.coreEngine.context,this.barcodeFind)}addBasicOverlay(){var e;(e=this.basicOverlay)==null||e.delete(),this.basicOverlay=null,this.barcodeFind!=null&&(this.basicOverlay=new this.Module.BarcodeFindBasicOverlay(this.barcodeFind)),this.coreEngine.view!=null&&this.basicOverlay!=null&&(this.basicOverlay.setGuidanceHandler(this.createWebFindGuidanceHandler()),this.Module.addBarcodeFindBasicOverlayToView(this.coreEngine.view,this.basicOverlay))}removeBasicOverlay(){this.coreEngine.view!=null&&this.basicOverlay!=null&&this.Module.removeBarcodeFindBasicOverlayFromView(this.coreEngine.view,this.basicOverlay)}async applySettings(e){var a;(a=this.barcodeFind)==null||a.applySettings(JSON.stringify(e))}updateBasicOverlay(e){let a=Object.entries(e).filter(([r,s])=>r!=="type");for(let[r,s]of a){let i=`set${Ke(r)}`;this.basicOverlay!=null&&typeof this.basicOverlay[i]=="function"&&s!=null&&this.basicOverlay[i](s)}}setTransformerFunction(e){this.customerTransformation=e!=null?e:Ie}successFeedback(){this.workerFunctions.postMessage({type:"successFeedback"})}listUpdatedFeedback(){this.workerFunctions.postMessage({type:"barcodeFindListUpdatedFeedback",payload:{}})}setToast(e,a){let r=this.coreEngine.hintPresenterV2;e?r==null||r.showToast(JSON.stringify(a)):r==null||r.hideToast(a.tag)}setGuidance(e,a,r){let s={tag:r,text:a,hintStyle:this.transparentGuidanceHintStyle};this.workerFunctions.postMessage({type:e?"showGuidance":"hideGuidance",payload:s})}createWebFindGuidanceHandler(){let e=this.Module.BarcodeFindGuidanceHandler.extend("BarcodeFindGuidanceHandler",{setInitialGuidance:(a,r)=>{this.setGuidance(a,r,"InitialGuidance")},setMoveCloserGuidance:(a,r)=>{this.setGuidance(!1,r,"InitialGuidance"),this.setGuidance(a,r,"MoveCloserGuidance")},setAllItemsFound:(a,r)=>{let s={text:r,toastHintStyle:I.Success,tag:"AllItemsFound"};this.setToast(a,s)},setTapShutterToPause:(a,r)=>{this.setGuidance(!1,r,"InitialGuidance"),this.setGuidance(a,r,"TapShutterToPause")},setTapShutterToResume:(a,r)=>{this.setGuidance(!1,r,"InitialGuidance"),this.setGuidance(a,r,"TapShutterResume")},setItemListUpdated:(a,r)=>{let s={text:r,toastHintStyle:I.Info,tag:"ItemListUpdated"};this.setToast(a,s)}});return new e}};var S=class{constructor(e){this.subscribers=new Set;this.property={key:e,value:null}}addSubscriber(e){var a;this.subscribers.add(e),(a=e.onPropertyChanged)==null||a.call(e,this.property)}removeSubscriber(e){this.subscribers.delete(e)}setProperty(e){var a;if(this.property.value!==e.value){this.property={key:this.property.key,value:e.value};for(let r of this.subscribers)(a=r.onPropertyChanged)==null||a.call(r,this.property)}}};var Ze={torch_state:new S("torch_state"),scanning_mode:new S("scanning_mode"),sound_enabled:new S("sound_enabled"),haptic_enabled:new S("haptic_enabled"),session_stop_reason:new S("session_stop_reason"),camera_position:new S("camera_position")},J=class{getBehaviorSubject(e){return Ze[e]}};var V=class{constructor(e,a,r){this.captureListenerSet=!1;this.propertyPushSource=new J;this.coreEngine=e,this.Module=a,this.workerFunctions=r,this.setup()}sparkScanDidUpdateSession(e){this.workerFunctions.postMessage({type:"sparkScanDidUpdateSession",payload:JSON.parse(e.toJson())})}getSparkScanDeserializer(){return this.sparkScanDeserializer}setup(){let e=this.Module.SparkScanListener.extend("SparkScanListener",{didScan:(s,i,o)=>{this.sparkScanDidScan(i,o),s.delete(),i.delete(),o.delete()},didUpdateSession:(s,i,o)=>{this.sparkScanDidUpdateSession(i),s.delete(),i.delete(),o.delete()}}),a=this.Module.Feedback.extend("Feedback",{emit:()=>{this.successFeedback()}}),r=this.Module.SparkScanDeserializerListener.extend("SparkScanDeserializerListener",{onModeDeserializationFinished:(s,i,o)=>{this.captureListenerSet||(i.addListener(new e,1),i.setSuccessFeedback(new a),i.setPropertyPushSource(this.propertyPushSource),this.captureListenerSet=!0),s.delete(),i.delete(),o.delete()},onModeDeserializationStarted(s,i,o){s.delete(),i.delete(),o.delete()},onSettingsDeserializationStarted(s,i,o){s.delete(),i.delete(),o.delete()},onSettingsDeserializationFinished(s,i,o){s.delete(),i.delete(),o.delete()},onOverlayDeserializationStarted(s,i,o){s.delete(),i.delete(),o.delete()},onOverlayDeserializationFinished:(s,i,o)=>{var n;(n=this.sparkScanOverlay)==null||n.delete(),this.sparkScanOverlay=i,s.delete(),o.delete()}});this.sparkScanDeserializer=new this.Module.SparkScanDeserializer,this.sparkScanDeserializer.setListener(new r)}emitErrorFeedback(e){var a;(a=this.sparkScanOverlay)==null||a.onErrorFeedbackEmitted(e)}overlayReadyForDraw(){var e;(e=this.sparkScanOverlay)==null||e.onReadyForNewData()}analyticsManagerPropertyChanged(e){this.propertyPushSource.getBehaviorSubject(e.key).setProperty(e)}successFeedback(){this.workerFunctions.postMessage({type:"successFeedback"})}sparkScanDidScan(e,a){let r=this.coreEngine.convertToLoadableFrameData(a);this.workerFunctions.postMessage({type:"sparkScanDidScan",payload:{session:JSON.parse(e.toJson()),frameData:r}})}};var U=class extends D{constructor(e,a){super(e,a)}getModeDeserializers(){this.barcodeCaptureMode=new _(this,this.Module,this.workerFunctions),this.barcodeBatchMode=new H(this,this.Module,this.workerFunctions),this.sparkScanMode=new V(this,this.Module,this.workerFunctions),this.barcodeFindMode=new z(this,this.Module,this.workerFunctions),this.barcodeArMode=new N(this,this.Module,this.workerFunctions);let e=super.getModeDeserializers();return e.push_back(this.barcodeCaptureMode.getCaptureDeserializer()),e.push_back(this.barcodeBatchMode.getBatchDeserializer()),e.push_back(this.sparkScanMode.getSparkScanDeserializer()),e}getWasmSideModuleFileName(){return""}getWasmCoreFileName(e,a){return a?e?"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":"scandit-datacapture-sdk-barcode-pthreads.wasm":e?"scandit-datacapture-sdk-barcode-simd.wasm":"scandit-datacapture-sdk-barcode.wasm"}getWasmCoreExpectedHash(e,a){return a?e?"193e8c0d12bf3f73859ec31b79b8a6bb5f1bf14c0e83330162984f7bc4d41de9":"37abff9b10f9ffd5cf0c3556e11e28309658d2ceb6374b8c1acc0c99aa33c75d":e?"0296f4fb5e758ef03291ee43aa4115f9d8978442832fb21fde8bbf4628329dea":"90229dacc7f1c9b592bedb534c69d62cbb1f8ecfaaf6f4640b8ea131189d09f6"}getWasmMetadata(){return p}};function Qe(t){return(a=>/^[$A-Z_a-z][\\w$]*\\s*\\(.*\\)\\s*\\{/.test(a)&&!a.startsWith("function"))(t)?`function ${t}`:t}var et=["fetch","XMLHttpRequest","eval","Function","self","globalThis","Module","importScripts","this","console","window","document","import","Worker","ServiceWorker"];function tt(t){return et.map(a=>new RegExp(`\\\\b${a}\\\\b`,"g")).some(a=>a.test(t))}function xe(t){if(t==null)return null;let e=Qe(t);if(tt(e))throw new Error("Function should be pure. Shouldn\'t introduce side effects, or rely on global scope");let a=`\'use strict\';\n return (${e});`;try{return new Function(a)()}catch{return null}}var $=class extends te{constructor(e,a){super(e,a),this.dataCaptureInstance=new U(a,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)})}async respondWith(e,a,r){let s=null,i;try{i=r(),i instanceof Promise&&(i=await i)}catch(n){i=void 0,s=C(n)}let o={type:"workerTaskId",command:e,id:a,payload:this.hasPayload(i)?i.payload:void 0};s!=null&&(o.error=s),this.postMessage(o,this.hasTransferables(i)?i.transferables:[])}onMessage(e){switch(e.data.command){case"sparkScanEmitErrorFeedback":{let{data:a}=e;return this.respondWith(a.command,a.id,()=>{this.dataCaptureInstance.sparkScanMode.emitErrorFeedback(a.shouldRemoveBrush)}),!0}case"sparkScanOverlayReadyForDraw":{let{data:a}=e;return this.respondWith(a.command,a.id,()=>{this.dataCaptureInstance.sparkScanMode.overlayReadyForDraw()}),!0}case"sparkScanAnalyticsManagerPropertyChanged":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.sparkScanMode.analyticsManagerPropertyChanged(a.property)}),!0}case"barcodeFindForSettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeFindMode.forSettings(a.settings)),!0}case"barcodeFindModeRemove":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeFindMode.removeMode()),!0}case"barcodeFindSearchStart":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.start()}),!0;case"barcodeFindSearchPause":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.pause()}),!0;case"barcodeFindSearchStop":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.stop()}),!0;case"barcodeFindSetItemList":{let{data:a}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.setItemList(a.itemList)}),!0}case"barcodeFindSetEnabled":{let{data:a}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.setEnabled(a.enabled)}),!0}case"barcodeFindApplySettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeFindMode.applySettings(a.settings)),!0}case"barcodeFindAddBasicOverlay":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.addBasicOverlay()}),!0}case"barcodeFindRemoveBasicOverlay":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.removeBasicOverlay()}),!0}case"barcodeFindUpdateBasicOverlay":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.updateBasicOverlay(a.jsonOverlay)}),!0}case"barcodeFindSetTransformerFunction":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{let r=xe(a.functionAsString);this.dataCaptureInstance.barcodeFindMode.setTransformerFunction(r)}),!0}case"barcodeArForSettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeArMode.forSettings(a.settings)),!0}case"barcodeArModeRemove":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeArMode.removeMode()),!0}case"barcodeArSearchStart":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeArMode.start()}),!0;case"barcodeArSearchPause":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeArMode.pause()}),!0;case"barcodeArSearchStop":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeArMode.stop()}),!0;case"barcodeArSetEnabled":{let{data:a}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeArMode.setEnabled(a.enabled)}),!0}case"barcodeArApplySettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeArMode.applySettings(a.settings)}),!0}default:return super.onMessage(e)}}};var br=new $(self,{get:()=>self.Module,set:t=>{self.Module=t}});function yr(t){}})();\n'],{type:"application/javascript"})),e=new Worker(s,r);return URL.revokeObjectURL(s),e}var o=class r extends DataCaptureLoader{constructor(){super(...arguments);this._name="BarcodeCapture";}get dataCaptureWorker(){return (this._dataCaptureWorker)!=null||(this._dataCaptureWorker=i({name:this.name})),this._dataCaptureWorker}get name(){return this._name}static async create(e){var a;let t=new r(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((d,l)=>{let n=this.workerCommandId++;this.workerTasks.set(n,{resolve:d,reject:l,command:e});let c={...t,command:e,id:n};this.dataCaptureWorker.postMessage(c,a);})}};
|
|
2
|
+
export{o as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-NE3R4NVC.js';import {a as a$1}from'./chunk-TRITJ43A.js';import {unknownErrorToString}from'@scandit/web-datacapture-core/build/js/private/utils/unknownErrorToString.js';import {WorkerMain}from'@scandit/web-datacapture-core/build/js/worker/index.js';var i=class extends WorkerMain{constructor(t,a$1){super(t,a$1),this.dataCaptureInstance=new a(a$1,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)});}async respondWith(t,a,r){let d=null,e;try{e=r(),e instanceof Promise&&(e=await e);}catch(c){e=void 0,d=unknownErrorToString(c);}let s={type:"workerTaskId",command:t,id:a,payload:this.hasPayload(e)?e.payload:void 0};d!=null&&(s.error=d),this.postMessage(s,this.hasTransferables(e)?e.transferables:[]);}onMessage(t){switch(t.data.command){case "sparkScanEmitErrorFeedback":{let{data:a}=t;return this.respondWith(a.command,a.id,()=>{this.dataCaptureInstance.sparkScanMode.emitErrorFeedback(a.shouldRemoveBrush);}),true}case "sparkScanOverlayReadyForDraw":{let{data:a}=t;return this.respondWith(a.command,a.id,()=>{this.dataCaptureInstance.sparkScanMode.overlayReadyForDraw();}),true}case "sparkScanAnalyticsManagerPropertyChanged":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.sparkScanMode.analyticsManagerPropertyChanged(a.property);}),true}case "barcodeFindForSettings":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeFindMode.forSettings(a.settings)),true}case "barcodeFindModeRemove":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeFindMode.removeMode()),true}case "barcodeFindSearchStart":return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.start();}),true;case "barcodeFindSearchPause":return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.pause();}),true;case "barcodeFindSearchStop":return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.stop();}),true;case "barcodeFindSetItemList":{let{data:a}=t;return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.setItemList(a.itemList);}),true}case "barcodeFindSetEnabled":{let{data:a}=t;return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.setEnabled(a.enabled);}),true}case "barcodeFindApplySettings":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeFindMode.applySettings(a.settings)),true}case "barcodeFindAddBasicOverlay":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.addBasicOverlay();}),true}case "barcodeFindRemoveBasicOverlay":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.removeBasicOverlay();}),true}case "barcodeFindUpdateBasicOverlay":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.updateBasicOverlay(a.jsonOverlay);}),true}case "barcodeFindSetTransformerFunction":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>{let r=a$1(a.functionAsString);this.dataCaptureInstance.barcodeFindMode.setTransformerFunction(r);}),true}case "barcodeArForSettings":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeArMode.forSettings(a.settings)),true}case "barcodeArModeRemove":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeArMode.removeMode()),true}case "barcodeArSearchStart":return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeArMode.start();}),true;case "barcodeArSearchPause":return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeArMode.pause();}),true;case "barcodeArSearchStop":return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeArMode.stop();}),true;case "barcodeArSetEnabled":{let{data:a}=t;return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeArMode.setEnabled(a.enabled);}),true}case "barcodeArApplySettings":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeArMode.applySettings(a.settings);}),true}default:return super.onMessage(t)}}};export{i as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$3}from'./chunk-JIUTBKIH.js';import {a as a$4}from'./chunk-NMXU6D43.js';import {a as a$1}from'./chunk-QCD3RIT4.js';import {c as c$1,b as b$3}from'./chunk-SZUPDKV5.js';import {a as a$5}from'./chunk-TC4DIIXB.js';import {b}from'./chunk-RU7XJPB3.js';import {a as a$2,c,b as b$1}from'./chunk-RUZMLCEP.js';import {a as a$6}from'./chunk-BVROH6QT.js';import {b as b$2}from'./chunk-6GGHOIBF.js';import {a}from'./chunk-CZQR5WQJ.js';import {Logger,DataCaptureView,Anchor,LogoStyle,Camera,isCameraFrameSource,FrameSourceState,Color,CameraPosition,TorchState,NumberWithUnit,RadiusLocationSelection}from'@scandit/web-datacapture-core';import {localStorage}from'@scandit/web-datacapture-core/build/js/private/utils/safeStorage.js';import {Timeout}from'@scandit/web-datacapture-core/build/js/private/utils/timeout.js';function v(U,e,a){let t=a.value;return typeof t!="function"?(Logger.warn(`@afterPrepareScanning applied to non-function: ${e}`),a):t.constructor.name==="AsyncFunction"||t.constructor===(async()=>{}).constructor?(a.value=function(...r){return this._preparationPromise?this._preparationPromise.then(()=>t.apply(this,r)):Promise.reject(new Error(`prepare should be called before calling ${e} method`))},a):(Logger.warn(`@afterPrepareScanning applied to non-async method: ${e}`),a)}var u=class u{constructor(e,a){this._context=null;this._sparkScan=null;this._preparationPromise=null;this._stopScanningPromise=null;this._dataCaptureView=null;this.cameras=[];this.preferenceManager=new a$1(localStorage);this.defaultSuccessBrush=a$2.defaultSuccessBrush();this.defaultErrorBrush=a$2.defaultErrorBrush();this.sparkScanView=e,this.setSparkScanViewSettings(a);}get camera(){var e;return (e=this.context)==null?void 0:e.frameSource}set context(e){this._context!==e&&(this._preparationPromise=null,this._context=e,e&&(this.analyticsManager=b.forContext(e)));}get context(){return this._context}set sparkScan(e){this._sparkScan!==e&&(this._preparationPromise=null,this._sparkScan=e);}get sparkScan(){return this._sparkScan}get sparkScan$(){if(!this._sparkScan)throw new Error("SparkScan mode is required to be set before calling this method");return this._sparkScan}get context$(){if(!this._context)throw new Error("Context is required to be set before calling this method");return this._context}setSparkScanViewSettings(e){this.sparkScanViewSettings=e,this.stateManager=new a$3(this.sparkScanViewSettings,this.preferenceManager),this.feedbackManager=a$4.withDefaults(this.sparkScanViewSettings.soundEnabled,this.sparkScanViewSettings.hapticEnabled),this.triggerButtonCollapseTimeout=new Timeout(this.sparkScanViewSettings.triggerButtonCollapseTimeout,async()=>{this.stateManager.state!=="idle"&&this._preparationPromise&&await this.switchToIdleState({sessionStopReason:"timeout"});}),this.inactiveStateTimeout=new Timeout(this.sparkScanViewSettings.inactiveStateTimeout,async()=>{this.stateManager.state!=="inactive"&&!this.stateManager.holdingToScan&&this._preparationPromise&&await this.switchToInactiveState({sessionStopReason:"timeout"});}),this.stateTimeouts={active:this.inactiveStateTimeout,inactive:this.triggerButtonCollapseTimeout};}get portraitOrientationTriggerButtonTranslateX(){var e;return (e=this.stateManager.portraitOrientationTriggerButtonTranslateX)!=null?e:this.defaultTriggerButtonTranslateX}get portraitOrientationTriggerButtonTranslateY(){var e;return (e=this.stateManager.portraitOrientationTriggerButtonTranslateY)!=null?e:this.defaultTriggerButtonTranslateY}get landscapeOrientationTriggerButtonTranslateX(){var e;return (e=this.stateManager.landscapeOrientationTriggerButtonTranslateX)!=null?e:this.defaultTriggerButtonTranslateX}get landscapeOrientationTriggerButtonTranslateY(){var e;return (e=this.stateManager.landscapeOrientationTriggerButtonTranslateY)!=null?e:this.defaultTriggerButtonTranslateY}get portraitOrientationMiniPreviewTranslateX(){var e;return (e=this.stateManager.portraitOrientationMiniPreviewTranslateX)!=null?e:this.defaultMiniPreviewTranslateX}get portraitOrientationMiniPreviewTranslateY(){var e;return (e=this.stateManager.portraitOrientationMiniPreviewTranslateY)!=null?e:this.defaultMiniPreviewTranslateY}get landscapeOrientationMiniPreviewTranslateX(){var e;return (e=this.stateManager.landscapeOrientationMiniPreviewTranslateX)!=null?e:this.defaultMiniPreviewTranslateX}get landscapeOrientationMiniPreviewTranslateY(){var e;return (e=this.stateManager.landscapeOrientationMiniPreviewTranslateY)!=null?e:this.defaultMiniPreviewTranslateY}get defaultTriggerButtonTranslateX(){return this.parentViewSizes.width-Math.min(this.parentViewSizes.width/3,110)-90/2}get defaultTriggerButtonTranslateY(){return this.parentViewSizes.height-Math.min(this.parentViewSizes.height/3,250)-90/2}get defaultMiniPreviewTranslateX(){return this.parentViewSizes.width-225-16}get parentViewSizes(){var e,a;return {width:(e=this.sparkScanView.parentElement.clientWidth)!=null?e:window.innerWidth,height:(a=this.sparkScanView.parentElement.clientHeight)!=null?a:window.innerHeight}}get defaultMiniPreviewTranslateY(){return 16}static forView(e,a){return new u(e,a)}async prepareScanning(e){if(this._preparationPromise)return this._preparationPromise;this._stopScanningPromise&&await this._stopScanningPromise,this._preparationPromise=this._internalPrepareScanning(e);try{await this._preparationPromise;}catch(a){throw this._preparationPromise=null,a}return this._preparationPromise}async _internalPrepareScanning(e){var s,o;let a=this.context$,t=this.sparkScan$;this._dataCaptureView=await DataCaptureView.forContext(a),this._dataCaptureView.logoAnchor=Anchor.BottomCenter,this._dataCaptureView.logoStyle=LogoStyle.Minimal,this._dataCaptureView.setHiddenProperty("stopVideoTracksOnVisibilityChange",false),this._dataCaptureView.setHiddenProperty("freezeFrameWhenStoppingFrameSource",false),this._dataCaptureView.connectToElement(e),this.cameras=await Camera.getAll(false,isCameraFrameSource(a.frameSource));let i=isCameraFrameSource(a.frameSource)?a.frameSource:(o=(s=this.cameras.find(n=>n.position===this.sparkScanViewSettings.defaultCameraPosition))!=null?s:this.cameras[0])!=null?o:Camera.pickBestGuess();await a.setFrameSource(i),await i.applySettings(a$5.recommendedCameraSettings),await i.switchToDesiredState(FrameSourceState.Standby);let r=await i.isTorchAvailable();this.sparkScanView.setTorchAvailable(r),this.sparkScanView.setZoomAvailable(i.isZoomAvailable()),this.sparkScanView.cameraSwitchButtonTapped(r,i.position),await a.setMode(t),t.addListener(this),this.sparkScanOverlay=await a$6.withSparkScanForView(t,this._dataCaptureView),await this.sparkScanOverlay.setShouldRemoveLocationsAfterScan(this.stateManager.scanningBehavior==="continuous"),this.analyticsManager.startSession({cameraPosition:this.camera.position,hapticEnabled:this.sparkScanViewSettings.hapticEnabled,scanningMode:this.stateManager.scanningMode,soundEnabled:this.sparkScanViewSettings.soundEnabled,torchState:this.camera.getDesiredTorchState()}),await this.applyPreferences(),await this.switchToIdleState();}async stopScanning(e){if(this._stopScanningPromise)return this._stopScanningPromise;this._preparationPromise=null,this._stopScanningPromise=this._internalStopScanning(e);try{await this._stopScanningPromise;}finally{this._stopScanningPromise=null;}}async _internalStopScanning(e){var a,t,i,r;await((a=this.sparkScan)==null?void 0:a.setEnabled(false)),(t=this.sparkScan)==null||t.removeListener(this),await((i=this.camera)==null?void 0:i.switchToDesiredState(FrameSourceState.Off)),(r=this._dataCaptureView)==null||r.detachFromElement(),this.analyticsManager.setSessionStopReason(e.sessionStopReason),this.setState("Initial");}async startScanning(){await this.switchToActiveState();}async pauseScanning(){await this.switchToInactiveState({sessionStopReason:"user"});}async onTriggerButtonPointerDown(){this.stateManager.triggerButtonPressed=true;}async onTriggerButtonTap(){switch(this.stateManager.state){case "Initial":{this.stateManager.triggerButtonPressed=false;return}case "idle":case "inactive":{await this.switchToActiveState({barcodeFeedback:new c(Color.fromRGBA(0,0,0,0),this.defaultSuccessBrush,this.feedbackManager.tapFeedback)});return}case "error":{await this.switchToActiveState({barcodeFeedback:new c(Color.fromRGBA(0,0,0,0),this.defaultSuccessBrush,this.feedbackManager.tapFeedback)});return}case "active":await(this.stateManager.continuousModeEnabled?this.switchToInactiveState({sessionStopReason:"user",barcodeFeedback:new c(Color.fromRGBA(0,0,0,0),this.defaultSuccessBrush,this.feedbackManager.tapFeedback)}):this.switchToActiveState({barcodeFeedback:new c(Color.fromRGBA(0,0,0,0),this.defaultSuccessBrush,this.feedbackManager.tapFeedback)}));}}async onTriggerButtonLongPressStart(){var e;this.stateManager.triggerButtonPressed=true,this.sparkScanViewSettings.holdToScanEnabled&&(this.scanningBehaviorCache=this.stateManager.scanningBehavior,this.stateManager.scanningBehavior="continuous",this.stateManager.holdingToScan=true,await((e=this.sparkScanOverlay)==null?void 0:e.setShouldRemoveLocationsAfterScan(true)),await this.switchToActiveState({barcodeFeedback:new c(Color.fromRGBA(0,0,0,0),this.defaultSuccessBrush,this.feedbackManager.tapFeedback)}));}async onTriggerButtonLongPressEnd(){var e,a;this.sparkScanViewSettings.holdToScanEnabled&&this.stateManager.state!=="error"?(this.stateManager.scanningBehavior=(e=this.scanningBehaviorCache)!=null?e:"single",this.stateManager.holdingToScan=false,await((a=this.sparkScanOverlay)==null?void 0:a.setShouldRemoveLocationsAfterScan(this.stateManager.continuousModeEnabled)),await this.switchToInactiveState({sessionStopReason:"user",barcodeFeedback:new b$1("",0,Color.fromRGBA(0,0,0,0),this.defaultErrorBrush,this.feedbackManager.noFeedback)})):this.stateManager.triggerButtonPressed=false;}async onClickOutside(){this.stateManager.idleState||await this.switchToIdleState();}async onVisibilityChange(){await this.switchToIdleState();}async onTargetModeButtonTap(e,a=this.feedbackManager.tapFeedback,t=true){var o,n,p;a.emit();let i=String(e),r={true:e&&this.stateManager.scanningMode instanceof b$3,false:!e&&this.stateManager.scanningMode instanceof c$1}[i];r&&(this.stateManager.scanningMode=this.stateManager.scanningMode.changeMode()),this.enableTargetMode(e),await((o=this.sparkScanOverlay)==null?void 0:o.setShouldDrawViewfinder(e)),this.startTimeoutForCurrentState(),this.sparkScanView.targetModeButtonTapped(e,t),r&&((p=(n=this.listener)==null?void 0:n.didChangeScanningMode)==null||p.call(n,this.stateManager.scanningMode),this.analyticsManager.setScanningMode(this.stateManager.scanningMode));}async onScanningBehaviorButtonTap(e,a=this.feedbackManager.tapFeedback,t=true){var i;a.emit(),this.stateManager.scanningMode=this.stateManager.scanningMode.copyWith(e?"continuous":"single"),await((i=this.sparkScanOverlay)==null?void 0:i.setShouldRemoveLocationsAfterScan(e)),this.startTimeoutForCurrentState(),this.sparkScanView.scanningBehaviorButtonTapped(e,t),this.analyticsManager.setScanningMode(this.stateManager.scanningMode);}async onBarcodeFindButtonTap(){var e,a;await this.switchToIdleState({sessionStopReason:"user"}),(a=(e=this.listener)==null?void 0:e.didTapBarcodeFindButton)==null||a.call(e,this.sparkScanView),this.restartTimeouts();}async onLabelCaptureButtonTap(){var e,a;await this.switchToIdleState({sessionStopReason:"user"}),(a=(e=this.listener)==null?void 0:e.didTapLabelCaptureButton)==null||a.call(e,this.sparkScanView),this.restartTimeouts();}async onCameraSwitchButtonTap(){var t,i;if(this.feedbackManager.emitTapFeedback(),this.restartTimeouts(),!this.camera||this.stateManager.state==="error")return;let e={[CameraPosition.WorldFacing]:CameraPosition.UserFacing,[CameraPosition.UserFacing]:CameraPosition.WorldFacing}[(t=this.camera)==null?void 0:t.position],a=this.cameras.find(r=>r.position===e);a&&(await((i=this.camera)==null?void 0:i.switchToDesiredState(FrameSourceState.Off)),await this.context$.setFrameSource(a),await a.applySettings(this.camera.settings),await a.switchToDesiredState(FrameSourceState.On),this.sparkScanView.cameraSwitchButtonTapped(await a.isTorchAvailable(),e),this.analyticsManager.setCameraPosition(e));}async onTorchButtonTap(e,a=this.feedbackManager.tapFeedback,t=true){var i,r;a.emit(),this.stateManager.torchState=e?TorchState.On:TorchState.Off,((i=this.camera)==null?void 0:i.getCurrentState())===FrameSourceState.On&&await((r=this.camera)==null?void 0:r.setDesiredTorchState(this.stateManager.torchState)),this.startTimeoutForCurrentState(),this.sparkScanView.torchButtonTapped(e,t),this.analyticsManager.setTorchState(this.stateManager.torchState);}restartTimeouts(){for(let e of [this.triggerButtonCollapseTimeout,this.inactiveStateTimeout,this.resumeCapturingTimeout])(e==null?void 0:e.running)===true&&e.start();}stopTimeouts(){for(let e of [this.triggerButtonCollapseTimeout,this.inactiveStateTimeout,this.resumeCapturingTimeout])e==null||e.stop();}async onMiniPreviewCloseButtonTap(){await this.switchToIdleState({sessionStopReason:"user"});}onMiniPreviewResizeButtonTap(){(this.stateManager.state==="active"||this.stateManager.state==="inactive")&&(this.feedbackManager.emitTapFeedback(),this.startTimeoutForCurrentState());}async onMiniPreviewZoomButtonTap(e){this.feedbackManager.emitTapFeedback(),this.stateManager.zoomFactor=e,this.camera&&(this.camera.settings.zoomFactor=e,await this.camera.applySettings(this.camera.settings)),this.startTimeoutForCurrentState();}async onMiniPreviewDrag(e,a){switch(this.stateManager.state==="active"&&await this.sparkScan$.setEnabled(false),a){case "landscape-primary":case "landscape-secondary":{this.stateManager.landscapeOrientationMiniPreviewTranslateX=e.x,this.stateManager.landscapeOrientationMiniPreviewTranslateY=e.y;break}case "portrait-primary":case "portrait-secondary":{this.stateManager.portraitOrientationMiniPreviewTranslateX=e.x,this.stateManager.portraitOrientationMiniPreviewTranslateY=e.y;break}}this.restartTimeouts();}onMiniPreviewPointerMove(){this.restartTimeouts();}async onMiniPreviewPointerUp(){await this.switchToActiveState();}async onMiniPreviewDragEnd(){this.stateManager.state==="active"&&await this.sparkScan$.setEnabled(true);}onTriggerButtonDrag(e,a){switch(a){case "landscape-primary":case "landscape-secondary":{this.stateManager.landscapeOrientationTriggerButtonTranslateX=e.x,this.stateManager.landscapeOrientationTriggerButtonTranslateY=e.y;break}case "portrait-primary":case "portrait-secondary":{this.stateManager.portraitOrientationTriggerButtonTranslateX=e.x,this.stateManager.portraitOrientationTriggerButtonTranslateY=e.y;break}}}async onOrientationChange(){if(this.stateManager.state==="active"&&this.stateManager.holdingToScan){this.restartTimeouts();return}this.stateManager.state==="error"&&await this.switchToInactiveState({sessionStopReason:"user"});}async didScan(e,a){if(!a.newlyRecognizedBarcode)return;let t=this.sparkScanView.feedbackDelegate.getFeedbackForBarcode(a.newlyRecognizedBarcode);t&&(t instanceof b$1?await this.switchToErrorState({barcodeFeedback:t}):t instanceof c&&await(this.stateManager.continuousModeEnabled?this.switchToActiveState({barcodeFeedback:t}):this.switchToInactiveState({sessionStopReason:"user",barcodeFeedback:t,emitSuccessFeedback:true})),this.restartTimeouts());}setListener(e){this.listener=e;}brushForFeedback(e){return e.brush}async switchToIdleState(e={}){var a,t,i,r,s;this.feedbackManager.emitTapFeedback(),await((a=this.sparkScanOverlay)==null?void 0:a.overlayReadyForDraw()),this.setState("idle"),await this.sparkScan$.setEnabled(false),await((t=this.camera)==null?void 0:t.switchToDesiredState(FrameSourceState.Standby)),(i=this.triggerButtonCollapseTimeout)==null||i.stop(),(r=this.inactiveStateTimeout)==null||r.stop(),(s=this.resumeCapturingTimeout)==null||s.stop(),this.stateManager.triggerButtonPressed=false,this.sparkScanView.switchToIdleState(),e.sessionStopReason!=null&&this.analyticsManager.setSessionStopReason(e.sessionStopReason);}async switchToActiveState(e={}){var t,i,r,s,o,n,p,d,T;let a=this.stateManager.state;await((t=this.camera)==null?void 0:t.switchToDesiredState(FrameSourceState.On)),await((i=this.camera)==null?void 0:i.setDesiredTorchState(this.stateManager.torchState)),e.barcodeFeedback&&await((r=this.sparkScanOverlay)==null?void 0:r.setBrush(this.brushForFeedback(e.barcodeFeedback))),await((s=this.sparkScanOverlay)==null?void 0:s.setShouldRemoveLocationsAfterScan(this.stateManager.continuousModeEnabled)),await((o=this.sparkScanOverlay)==null?void 0:o.overlayReadyForDraw()),this.feedbackManager.emitBarcodeFeedback(e.barcodeFeedback),this.stateManager.holdingToScan||(n=this.inactiveStateTimeout)==null||n.start(),(p=this.triggerButtonCollapseTimeout)==null||p.stop(),(d=this.resumeCapturingTimeout)==null||d.stop(),await this.sparkScanView.switchToActiveState(this.sparkScanViewSettings.visualFeedbackEnabled&&e.barcodeFeedback instanceof c,this.stateManager.scanningBehavior,(T=e.barcodeFeedback)==null?void 0:T.visualFeedbackColor,this.stateManager.zoomedIn&&a!=="active"),await this.sparkScan$.setEnabled(true),this.setState("active");}async switchToInactiveState(e){var t,i,r,s,o,n,p,d;(e.emitSuccessFeedback)!=null||(e.emitSuccessFeedback=true),this.setState("inactive"),e.barcodeFeedback&&await((t=this.sparkScanOverlay)==null?void 0:t.setBrush(this.brushForFeedback(e.barcodeFeedback))),this.stateManager.shouldEnableSuppression?await this.sparkScan$.setResultSuppressionEnabled(true):await this.sparkScan$.setEnabled(false),this.stateManager.triggerButtonPressed=false,this.stateManager.scanningMode.previewBehavior==="persistent"?e.barcodeFeedback instanceof c&&await((i=this.sparkScanOverlay)==null?void 0:i.setShouldRemoveLocationsAfterScan(true)):await((r=this.camera)==null?void 0:r.switchToDesiredState(FrameSourceState.Standby)),this.feedbackManager.emitBarcodeFeedback(e.barcodeFeedback),await((s=this.sparkScanOverlay)==null?void 0:s.overlayReadyForDraw()),(o=this.triggerButtonCollapseTimeout)==null||o.start(),(n=this.inactiveStateTimeout)==null||n.stop(),(p=this.resumeCapturingTimeout)==null||p.stop(),await this.sparkScanView.switchToInactiveState(this.sparkScanViewSettings.visualFeedbackEnabled&&e.barcodeFeedback instanceof c&&e.emitSuccessFeedback,this.stateManager.scanningBehavior,this.stateManager.previewBehavior,(d=e.barcodeFeedback)==null?void 0:d.visualFeedbackColor),this.analyticsManager.setSessionStopReason(e.sessionStopReason);}async switchToErrorState(e){var t,i,r,s,o,n;let a=e.barcodeFeedback.resumeCapturingDelay>0;a&&(this.setState("error"),this.stateManager.scanningBehavior="single",await this.sparkScan$.setEnabled(false),await((t=this.camera)==null?void 0:t.switchToDesiredState(FrameSourceState.Standby)),this.resumeCapturingTimeout=new Timeout(e.barcodeFeedback.resumeCapturingDelay,async()=>{this.stateManager.state!=="active"&&this._preparationPromise&&await this.switchToActiveState();}),this.resumeCapturingTimeout.start()),await((i=this.sparkScanOverlay)==null?void 0:i.setErrorBrush(e.barcodeFeedback.brush)),await((r=this.sparkScanOverlay)==null?void 0:r.overlayReadyForDraw()),await((s=this.sparkScanOverlay)==null?void 0:s.setShouldRemoveLocationsAfterScan(e.barcodeFeedback.resumeCapturingDelay===0)),await this.sparkScan$.workerCommand("sparkScanEmitErrorFeedback",{shouldRemoveBrush:!a}),this.feedbackManager.emitBarcodeFeedback(e.barcodeFeedback),(o=this.triggerButtonCollapseTimeout)==null||o.stop(),(n=this.inactiveStateTimeout)==null||n.stop(),await this.sparkScanView.switchToErrorState(e.barcodeFeedback,this.sparkScanViewSettings.visualFeedbackEnabled);}enableTargetModeLocationSelection(e){var r;let a=e?b$2.SparkScan.SparkScanSettings.targetModeLocationSelection.radius:b$2.SparkScan.SparkScanSettings.locationSelection.radius,t=e?b$2.SparkScan.SparkScanSettings.targetModeLocationSelection.unit:b$2.SparkScan.SparkScanSettings.locationSelection.unit,i=new NumberWithUnit(a,t);this.sparkScan$.settings.locationSelection=new RadiusLocationSelection(i),(r=this.sparkScanOverlay)==null||r.setRadius(i);}enableTargetMode(e){this.enableTargetModeLocationSelection(e);}async applyPreferences(){await this.onTargetModeButtonTap(this.stateManager.targetModeEnabled,this.feedbackManager.noFeedback,false),await this.onScanningBehaviorButtonTap(this.stateManager.continuousModeEnabled,this.feedbackManager.noFeedback,false),await this.onTorchButtonTap(this.stateManager.torchEnabled,this.feedbackManager.noFeedback,false);}setState(e){var a,t;e!==this.stateManager.state&&(this.stateManager.state=e,(t=(a=this.listener)==null?void 0:a.didChangeViewState)==null||t.call(a,e));}startTimeoutForCurrentState(){let e=this.stateTimeouts[this.stateManager.state];e==null||e.start();}};a([v],u.prototype,"switchToActiveState",1),a([v],u.prototype,"switchToInactiveState",1),a([v],u.prototype,"switchToErrorState",1);var D=u;export{D as a};
|
|
1
|
+
import {a as a$3}from'./chunk-JIUTBKIH.js';import {a as a$4}from'./chunk-NMXU6D43.js';import {a as a$1}from'./chunk-QCD3RIT4.js';import {c as c$1,b as b$3}from'./chunk-SZUPDKV5.js';import {a as a$5}from'./chunk-TC4DIIXB.js';import {b}from'./chunk-RU7XJPB3.js';import {a as a$2,c,b as b$1}from'./chunk-RUZMLCEP.js';import {a as a$6}from'./chunk-BVROH6QT.js';import {b as b$2}from'./chunk-6GGHOIBF.js';import {a}from'./chunk-QJFNNNI7.js';import {Logger,DataCaptureView,Anchor,LogoStyle,Camera,isCameraFrameSource,FrameSourceState,Color,CameraPosition,TorchState,NumberWithUnit,RadiusLocationSelection}from'@scandit/web-datacapture-core';import {localStorage}from'@scandit/web-datacapture-core/build/js/private/utils/safeStorage.js';import {Timeout}from'@scandit/web-datacapture-core/build/js/private/utils/timeout.js';function v(U,e,a){let t=a.value;return typeof t!="function"?(Logger.warn(`@afterPrepareScanning applied to non-function: ${e}`),a):t.constructor.name==="AsyncFunction"||t.constructor===(async()=>{}).constructor?(a.value=function(...r){return this._preparationPromise?this._preparationPromise.then(()=>t.apply(this,r)):Promise.reject(new Error(`prepare should be called before calling ${e} method`))},a):(Logger.warn(`@afterPrepareScanning applied to non-async method: ${e}`),a)}var u=class u{constructor(e,a){this._context=null;this._sparkScan=null;this._preparationPromise=null;this._stopScanningPromise=null;this._dataCaptureView=null;this.cameras=[];this.preferenceManager=new a$1(localStorage);this.defaultSuccessBrush=a$2.defaultSuccessBrush();this.defaultErrorBrush=a$2.defaultErrorBrush();this.sparkScanView=e,this.setSparkScanViewSettings(a);}get camera(){var e;return (e=this.context)==null?void 0:e.frameSource}set context(e){this._context!==e&&(this._preparationPromise=null,this._context=e,e&&(this.analyticsManager=b.forContext(e)));}get context(){return this._context}set sparkScan(e){this._sparkScan!==e&&(this._preparationPromise=null,this._sparkScan=e);}get sparkScan(){return this._sparkScan}get sparkScan$(){if(!this._sparkScan)throw new Error("SparkScan mode is required to be set before calling this method");return this._sparkScan}get context$(){if(!this._context)throw new Error("Context is required to be set before calling this method");return this._context}setSparkScanViewSettings(e){this.sparkScanViewSettings=e,this.stateManager=new a$3(this.sparkScanViewSettings,this.preferenceManager),this.feedbackManager=a$4.withDefaults(this.sparkScanViewSettings.soundEnabled,this.sparkScanViewSettings.hapticEnabled),this.triggerButtonCollapseTimeout=new Timeout(this.sparkScanViewSettings.triggerButtonCollapseTimeout,async()=>{this.stateManager.state!=="idle"&&this._preparationPromise&&await this.switchToIdleState({sessionStopReason:"timeout"});}),this.inactiveStateTimeout=new Timeout(this.sparkScanViewSettings.inactiveStateTimeout,async()=>{this.stateManager.state!=="inactive"&&!this.stateManager.holdingToScan&&this._preparationPromise&&await this.switchToInactiveState({sessionStopReason:"timeout"});}),this.stateTimeouts={active:this.inactiveStateTimeout,inactive:this.triggerButtonCollapseTimeout};}get portraitOrientationTriggerButtonTranslateX(){var e;return (e=this.stateManager.portraitOrientationTriggerButtonTranslateX)!=null?e:this.defaultTriggerButtonTranslateX}get portraitOrientationTriggerButtonTranslateY(){var e;return (e=this.stateManager.portraitOrientationTriggerButtonTranslateY)!=null?e:this.defaultTriggerButtonTranslateY}get landscapeOrientationTriggerButtonTranslateX(){var e;return (e=this.stateManager.landscapeOrientationTriggerButtonTranslateX)!=null?e:this.defaultTriggerButtonTranslateX}get landscapeOrientationTriggerButtonTranslateY(){var e;return (e=this.stateManager.landscapeOrientationTriggerButtonTranslateY)!=null?e:this.defaultTriggerButtonTranslateY}get portraitOrientationMiniPreviewTranslateX(){var e;return (e=this.stateManager.portraitOrientationMiniPreviewTranslateX)!=null?e:this.defaultMiniPreviewTranslateX}get portraitOrientationMiniPreviewTranslateY(){var e;return (e=this.stateManager.portraitOrientationMiniPreviewTranslateY)!=null?e:this.defaultMiniPreviewTranslateY}get landscapeOrientationMiniPreviewTranslateX(){var e;return (e=this.stateManager.landscapeOrientationMiniPreviewTranslateX)!=null?e:this.defaultMiniPreviewTranslateX}get landscapeOrientationMiniPreviewTranslateY(){var e;return (e=this.stateManager.landscapeOrientationMiniPreviewTranslateY)!=null?e:this.defaultMiniPreviewTranslateY}get defaultTriggerButtonTranslateX(){return this.parentViewSizes.width-Math.min(this.parentViewSizes.width/3,110)-90/2}get defaultTriggerButtonTranslateY(){return this.parentViewSizes.height-Math.min(this.parentViewSizes.height/3,250)-90/2}get defaultMiniPreviewTranslateX(){return this.parentViewSizes.width-225-16}get parentViewSizes(){var e,a;return {width:(e=this.sparkScanView.parentElement.clientWidth)!=null?e:window.innerWidth,height:(a=this.sparkScanView.parentElement.clientHeight)!=null?a:window.innerHeight}}get defaultMiniPreviewTranslateY(){return 16}static forView(e,a){return new u(e,a)}async prepareScanning(e){if(this._preparationPromise)return this._preparationPromise;this._stopScanningPromise&&await this._stopScanningPromise,this._preparationPromise=this._internalPrepareScanning(e);try{await this._preparationPromise;}catch(a){throw this._preparationPromise=null,a}return this._preparationPromise}async _internalPrepareScanning(e){var s,o;let a=this.context$,t=this.sparkScan$;this._dataCaptureView=await DataCaptureView.forContext(a),this._dataCaptureView.logoAnchor=Anchor.BottomCenter,this._dataCaptureView.logoStyle=LogoStyle.Minimal,this._dataCaptureView.setHiddenProperty("stopVideoTracksOnVisibilityChange",false),this._dataCaptureView.setHiddenProperty("freezeFrameWhenStoppingFrameSource",false),this._dataCaptureView.connectToElement(e),this.cameras=await Camera.getAll(false,isCameraFrameSource(a.frameSource));let i=isCameraFrameSource(a.frameSource)?a.frameSource:(o=(s=this.cameras.find(n=>n.position===this.sparkScanViewSettings.defaultCameraPosition))!=null?s:this.cameras[0])!=null?o:Camera.pickBestGuess();await a.setFrameSource(i),await i.applySettings(a$5.recommendedCameraSettings),await i.switchToDesiredState(FrameSourceState.Standby);let r=await i.isTorchAvailable();this.sparkScanView.setTorchAvailable(r),this.sparkScanView.setZoomAvailable(i.isZoomAvailable()),this.sparkScanView.cameraSwitchButtonTapped(r,i.position),await a.setMode(t),t.addListener(this),this.sparkScanOverlay=await a$6.withSparkScanForView(t,this._dataCaptureView),await this.sparkScanOverlay.setShouldRemoveLocationsAfterScan(this.stateManager.scanningBehavior==="continuous"),this.analyticsManager.startSession({cameraPosition:this.camera.position,hapticEnabled:this.sparkScanViewSettings.hapticEnabled,scanningMode:this.stateManager.scanningMode,soundEnabled:this.sparkScanViewSettings.soundEnabled,torchState:this.camera.getDesiredTorchState()}),await this.applyPreferences(),await this.switchToIdleState();}async stopScanning(e){if(this._stopScanningPromise)return this._stopScanningPromise;this._preparationPromise=null,this._stopScanningPromise=this._internalStopScanning(e);try{await this._stopScanningPromise;}finally{this._stopScanningPromise=null;}}async _internalStopScanning(e){var a,t,i,r;await((a=this.sparkScan)==null?void 0:a.setEnabled(false)),(t=this.sparkScan)==null||t.removeListener(this),await((i=this.camera)==null?void 0:i.switchToDesiredState(FrameSourceState.Off)),(r=this._dataCaptureView)==null||r.detachFromElement(),this.analyticsManager.setSessionStopReason(e.sessionStopReason),this.setState("Initial");}async startScanning(){await this.switchToActiveState();}async pauseScanning(){await this.switchToInactiveState({sessionStopReason:"user"});}async onTriggerButtonPointerDown(){this.stateManager.triggerButtonPressed=true;}async onTriggerButtonTap(){switch(this.stateManager.state){case "Initial":{this.stateManager.triggerButtonPressed=false;return}case "idle":case "inactive":{await this.switchToActiveState({barcodeFeedback:new c(Color.fromRGBA(0,0,0,0),this.defaultSuccessBrush,this.feedbackManager.tapFeedback)});return}case "error":{await this.switchToActiveState({barcodeFeedback:new c(Color.fromRGBA(0,0,0,0),this.defaultSuccessBrush,this.feedbackManager.tapFeedback)});return}case "active":await(this.stateManager.continuousModeEnabled?this.switchToInactiveState({sessionStopReason:"user",barcodeFeedback:new c(Color.fromRGBA(0,0,0,0),this.defaultSuccessBrush,this.feedbackManager.tapFeedback)}):this.switchToActiveState({barcodeFeedback:new c(Color.fromRGBA(0,0,0,0),this.defaultSuccessBrush,this.feedbackManager.tapFeedback)}));}}async onTriggerButtonLongPressStart(){var e;this.stateManager.triggerButtonPressed=true,this.sparkScanViewSettings.holdToScanEnabled&&(this.scanningBehaviorCache=this.stateManager.scanningBehavior,this.stateManager.scanningBehavior="continuous",this.stateManager.holdingToScan=true,await((e=this.sparkScanOverlay)==null?void 0:e.setShouldRemoveLocationsAfterScan(true)),await this.switchToActiveState({barcodeFeedback:new c(Color.fromRGBA(0,0,0,0),this.defaultSuccessBrush,this.feedbackManager.tapFeedback)}));}async onTriggerButtonLongPressEnd(){var e,a;this.sparkScanViewSettings.holdToScanEnabled&&this.stateManager.state!=="error"?(this.stateManager.scanningBehavior=(e=this.scanningBehaviorCache)!=null?e:"single",this.stateManager.holdingToScan=false,await((a=this.sparkScanOverlay)==null?void 0:a.setShouldRemoveLocationsAfterScan(this.stateManager.continuousModeEnabled)),await this.switchToInactiveState({sessionStopReason:"user",barcodeFeedback:new b$1("",0,Color.fromRGBA(0,0,0,0),this.defaultErrorBrush,this.feedbackManager.noFeedback)})):this.stateManager.triggerButtonPressed=false;}async onClickOutside(){this.stateManager.idleState||await this.switchToIdleState();}async onVisibilityChange(){await this.switchToIdleState();}async onTargetModeButtonTap(e,a=this.feedbackManager.tapFeedback,t=true){var o,n,p;a.emit();let i=String(e),r={true:e&&this.stateManager.scanningMode instanceof b$3,false:!e&&this.stateManager.scanningMode instanceof c$1}[i];r&&(this.stateManager.scanningMode=this.stateManager.scanningMode.changeMode()),this.enableTargetMode(e),await((o=this.sparkScanOverlay)==null?void 0:o.setShouldDrawViewfinder(e)),this.startTimeoutForCurrentState(),this.sparkScanView.targetModeButtonTapped(e,t),r&&((p=(n=this.listener)==null?void 0:n.didChangeScanningMode)==null||p.call(n,this.stateManager.scanningMode),this.analyticsManager.setScanningMode(this.stateManager.scanningMode));}async onScanningBehaviorButtonTap(e,a=this.feedbackManager.tapFeedback,t=true){var i;a.emit(),this.stateManager.scanningMode=this.stateManager.scanningMode.copyWith(e?"continuous":"single"),await((i=this.sparkScanOverlay)==null?void 0:i.setShouldRemoveLocationsAfterScan(e)),this.startTimeoutForCurrentState(),this.sparkScanView.scanningBehaviorButtonTapped(e,t),this.analyticsManager.setScanningMode(this.stateManager.scanningMode);}async onBarcodeFindButtonTap(){var e,a;await this.switchToIdleState({sessionStopReason:"user"}),(a=(e=this.listener)==null?void 0:e.didTapBarcodeFindButton)==null||a.call(e,this.sparkScanView),this.restartTimeouts();}async onLabelCaptureButtonTap(){var e,a;await this.switchToIdleState({sessionStopReason:"user"}),(a=(e=this.listener)==null?void 0:e.didTapLabelCaptureButton)==null||a.call(e,this.sparkScanView),this.restartTimeouts();}async onCameraSwitchButtonTap(){var t,i;if(this.feedbackManager.emitTapFeedback(),this.restartTimeouts(),!this.camera||this.stateManager.state==="error")return;let e={[CameraPosition.WorldFacing]:CameraPosition.UserFacing,[CameraPosition.UserFacing]:CameraPosition.WorldFacing}[(t=this.camera)==null?void 0:t.position],a=this.cameras.find(r=>r.position===e);a&&(await((i=this.camera)==null?void 0:i.switchToDesiredState(FrameSourceState.Off)),await this.context$.setFrameSource(a),await a.applySettings(this.camera.settings),await a.switchToDesiredState(FrameSourceState.On),this.sparkScanView.cameraSwitchButtonTapped(await a.isTorchAvailable(),e),this.analyticsManager.setCameraPosition(e));}async onTorchButtonTap(e,a=this.feedbackManager.tapFeedback,t=true){var i,r;a.emit(),this.stateManager.torchState=e?TorchState.On:TorchState.Off,((i=this.camera)==null?void 0:i.getCurrentState())===FrameSourceState.On&&await((r=this.camera)==null?void 0:r.setDesiredTorchState(this.stateManager.torchState)),this.startTimeoutForCurrentState(),this.sparkScanView.torchButtonTapped(e,t),this.analyticsManager.setTorchState(this.stateManager.torchState);}restartTimeouts(){for(let e of [this.triggerButtonCollapseTimeout,this.inactiveStateTimeout,this.resumeCapturingTimeout])(e==null?void 0:e.running)===true&&e.start();}stopTimeouts(){for(let e of [this.triggerButtonCollapseTimeout,this.inactiveStateTimeout,this.resumeCapturingTimeout])e==null||e.stop();}async onMiniPreviewCloseButtonTap(){await this.switchToIdleState({sessionStopReason:"user"});}onMiniPreviewResizeButtonTap(){(this.stateManager.state==="active"||this.stateManager.state==="inactive")&&(this.feedbackManager.emitTapFeedback(),this.startTimeoutForCurrentState());}async onMiniPreviewZoomButtonTap(e){this.feedbackManager.emitTapFeedback(),this.stateManager.zoomFactor=e,this.camera&&(this.camera.settings.zoomFactor=e,await this.camera.applySettings(this.camera.settings)),this.startTimeoutForCurrentState();}async onMiniPreviewDrag(e,a){switch(this.stateManager.state==="active"&&await this.sparkScan$.setEnabled(false),a){case "landscape-primary":case "landscape-secondary":{this.stateManager.landscapeOrientationMiniPreviewTranslateX=e.x,this.stateManager.landscapeOrientationMiniPreviewTranslateY=e.y;break}case "portrait-primary":case "portrait-secondary":{this.stateManager.portraitOrientationMiniPreviewTranslateX=e.x,this.stateManager.portraitOrientationMiniPreviewTranslateY=e.y;break}}this.restartTimeouts();}onMiniPreviewPointerMove(){this.restartTimeouts();}async onMiniPreviewPointerUp(){await this.switchToActiveState();}async onMiniPreviewDragEnd(){this.stateManager.state==="active"&&await this.sparkScan$.setEnabled(true);}onTriggerButtonDrag(e,a){switch(a){case "landscape-primary":case "landscape-secondary":{this.stateManager.landscapeOrientationTriggerButtonTranslateX=e.x,this.stateManager.landscapeOrientationTriggerButtonTranslateY=e.y;break}case "portrait-primary":case "portrait-secondary":{this.stateManager.portraitOrientationTriggerButtonTranslateX=e.x,this.stateManager.portraitOrientationTriggerButtonTranslateY=e.y;break}}}async onOrientationChange(){if(this.stateManager.state==="active"&&this.stateManager.holdingToScan){this.restartTimeouts();return}this.stateManager.state==="error"&&await this.switchToInactiveState({sessionStopReason:"user"});}async didScan(e,a){if(!a.newlyRecognizedBarcode)return;let t=this.sparkScanView.feedbackDelegate.getFeedbackForBarcode(a.newlyRecognizedBarcode);t&&(t instanceof b$1?await this.switchToErrorState({barcodeFeedback:t}):t instanceof c&&await(this.stateManager.continuousModeEnabled?this.switchToActiveState({barcodeFeedback:t}):this.switchToInactiveState({sessionStopReason:"user",barcodeFeedback:t,emitSuccessFeedback:true})),this.restartTimeouts());}setListener(e){this.listener=e;}brushForFeedback(e){return e.brush}async switchToIdleState(e={}){var a,t,i,r,s;this.feedbackManager.emitTapFeedback(),await((a=this.sparkScanOverlay)==null?void 0:a.overlayReadyForDraw()),this.setState("idle"),await this.sparkScan$.setEnabled(false),await((t=this.camera)==null?void 0:t.switchToDesiredState(FrameSourceState.Standby)),(i=this.triggerButtonCollapseTimeout)==null||i.stop(),(r=this.inactiveStateTimeout)==null||r.stop(),(s=this.resumeCapturingTimeout)==null||s.stop(),this.stateManager.triggerButtonPressed=false,this.sparkScanView.switchToIdleState(),e.sessionStopReason!=null&&this.analyticsManager.setSessionStopReason(e.sessionStopReason);}async switchToActiveState(e={}){var t,i,r,s,o,n,p,d,T;let a=this.stateManager.state;await((t=this.camera)==null?void 0:t.switchToDesiredState(FrameSourceState.On)),await((i=this.camera)==null?void 0:i.setDesiredTorchState(this.stateManager.torchState)),e.barcodeFeedback&&await((r=this.sparkScanOverlay)==null?void 0:r.setBrush(this.brushForFeedback(e.barcodeFeedback))),await((s=this.sparkScanOverlay)==null?void 0:s.setShouldRemoveLocationsAfterScan(this.stateManager.continuousModeEnabled)),await((o=this.sparkScanOverlay)==null?void 0:o.overlayReadyForDraw()),this.feedbackManager.emitBarcodeFeedback(e.barcodeFeedback),this.stateManager.holdingToScan||(n=this.inactiveStateTimeout)==null||n.start(),(p=this.triggerButtonCollapseTimeout)==null||p.stop(),(d=this.resumeCapturingTimeout)==null||d.stop(),await this.sparkScanView.switchToActiveState(this.sparkScanViewSettings.visualFeedbackEnabled&&e.barcodeFeedback instanceof c,this.stateManager.scanningBehavior,(T=e.barcodeFeedback)==null?void 0:T.visualFeedbackColor,this.stateManager.zoomedIn&&a!=="active"),await this.sparkScan$.setEnabled(true),this.setState("active");}async switchToInactiveState(e){var t,i,r,s,o,n,p,d;(e.emitSuccessFeedback)!=null||(e.emitSuccessFeedback=true),this.setState("inactive"),e.barcodeFeedback&&await((t=this.sparkScanOverlay)==null?void 0:t.setBrush(this.brushForFeedback(e.barcodeFeedback))),this.stateManager.shouldEnableSuppression?await this.sparkScan$.setResultSuppressionEnabled(true):await this.sparkScan$.setEnabled(false),this.stateManager.triggerButtonPressed=false,this.stateManager.scanningMode.previewBehavior==="persistent"?e.barcodeFeedback instanceof c&&await((i=this.sparkScanOverlay)==null?void 0:i.setShouldRemoveLocationsAfterScan(true)):await((r=this.camera)==null?void 0:r.switchToDesiredState(FrameSourceState.Standby)),this.feedbackManager.emitBarcodeFeedback(e.barcodeFeedback),await((s=this.sparkScanOverlay)==null?void 0:s.overlayReadyForDraw()),(o=this.triggerButtonCollapseTimeout)==null||o.start(),(n=this.inactiveStateTimeout)==null||n.stop(),(p=this.resumeCapturingTimeout)==null||p.stop(),await this.sparkScanView.switchToInactiveState(this.sparkScanViewSettings.visualFeedbackEnabled&&e.barcodeFeedback instanceof c&&e.emitSuccessFeedback,this.stateManager.scanningBehavior,this.stateManager.previewBehavior,(d=e.barcodeFeedback)==null?void 0:d.visualFeedbackColor),this.analyticsManager.setSessionStopReason(e.sessionStopReason);}async switchToErrorState(e){var t,i,r,s,o,n;let a=e.barcodeFeedback.resumeCapturingDelay>0;a&&(this.setState("error"),this.stateManager.scanningBehavior="single",await this.sparkScan$.setEnabled(false),await((t=this.camera)==null?void 0:t.switchToDesiredState(FrameSourceState.Standby)),this.resumeCapturingTimeout=new Timeout(e.barcodeFeedback.resumeCapturingDelay,async()=>{this.stateManager.state!=="active"&&this._preparationPromise&&await this.switchToActiveState();}),this.resumeCapturingTimeout.start()),await((i=this.sparkScanOverlay)==null?void 0:i.setErrorBrush(e.barcodeFeedback.brush)),await((r=this.sparkScanOverlay)==null?void 0:r.overlayReadyForDraw()),await((s=this.sparkScanOverlay)==null?void 0:s.setShouldRemoveLocationsAfterScan(e.barcodeFeedback.resumeCapturingDelay===0)),await this.sparkScan$.workerCommand("sparkScanEmitErrorFeedback",{shouldRemoveBrush:!a}),this.feedbackManager.emitBarcodeFeedback(e.barcodeFeedback),(o=this.triggerButtonCollapseTimeout)==null||o.stop(),(n=this.inactiveStateTimeout)==null||n.stop(),await this.sparkScanView.switchToErrorState(e.barcodeFeedback,this.sparkScanViewSettings.visualFeedbackEnabled);}enableTargetModeLocationSelection(e){var r;let a=e?b$2.SparkScan.SparkScanSettings.targetModeLocationSelection.radius:b$2.SparkScan.SparkScanSettings.locationSelection.radius,t=e?b$2.SparkScan.SparkScanSettings.targetModeLocationSelection.unit:b$2.SparkScan.SparkScanSettings.locationSelection.unit,i=new NumberWithUnit(a,t);this.sparkScan$.settings.locationSelection=new RadiusLocationSelection(i),(r=this.sparkScanOverlay)==null||r.setRadius(i);}enableTargetMode(e){this.enableTargetModeLocationSelection(e);}async applyPreferences(){await this.onTargetModeButtonTap(this.stateManager.targetModeEnabled,this.feedbackManager.noFeedback,false),await this.onScanningBehaviorButtonTap(this.stateManager.continuousModeEnabled,this.feedbackManager.noFeedback,false),await this.onTorchButtonTap(this.stateManager.torchEnabled,this.feedbackManager.noFeedback,false);}setState(e){var a,t;e!==this.stateManager.state&&(this.stateManager.state=e,(t=(a=this.listener)==null?void 0:a.didChangeViewState)==null||t.call(a,e));}startTimeoutForCurrentState(){let e=this.stateTimeouts[this.stateManager.state];e==null||e.start();}};a([v],u.prototype,"switchToActiveState",1),a([v],u.prototype,"switchToInactiveState",1),a([v],u.prototype,"switchToErrorState",1);var D=u;export{D as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-5FFSTOF2.js';import {a as a$8}from'./chunk-ZPCWOA3Y.js';import {a as a$7}from'./chunk-MHOUYN7K.js';import {a as a$a}from'./chunk-KMEGIFKL.js';import {a as a$5}from'./chunk-QRG4J3CL.js';import {b as b$1}from'./chunk-33EFB3RJ.js';import {b}from'./chunk-OH47PSIL.js';import {a as a$6}from'./chunk-Z4UVSYU5.js';import {a as a$1}from'./chunk-I53W7VSB.js';import {a as a$9}from'./chunk-O5SUMSOC.js';import {a as a$2}from'./chunk-DAOHHWLA.js';import {a as a$4}from'./chunk-LKQMBRKB.js';import {a as a$3}from'./chunk-5P7G47HV.js';import {Anchor,DataCaptureView,Direction,Point,Size}from'@scandit/web-datacapture-core';import {Backdrop}from'@scandit/web-datacapture-core/build/js/private/ui/atoms/Backdrop.js';import {ScanditHTMLElement}from'@scandit/web-datacapture-core/build/js/private/utils/ScanditHTMLElement.js';import {css}from'@scandit/web-datacapture-core/build/js/private/utils/css.js';import {defineCustomElements}from'@scandit/web-datacapture-core/build/js/private/utils/defineCustomElements.js';import {calculateArea,calculateWidth,calculateHeight}from'@scandit/web-datacapture-core/build/js/private/utils/quadrilateralUtils.js';import {Timeout}from'@scandit/web-datacapture-core/build/js/private/utils/timeout.js';var W={async highlightForBarcode(E,T){let t=a$a.create(E);T(t);}},c=class c extends ScanditHTMLElement{constructor(){super(...arguments);this.torchIconButton=null;this.cameraSwitchButton=null;this.zoomButton=null;this.onTorchButtonClickHandler=this.onTorchButtonClick.bind(this);this.onCameraSwitchButtonHandler=this.onCameraSwitchButtonClick.bind(this);this.onZoomButtonHandler=this.onZoomButtonClick.bind(this);this.onLayoutPointerDownHandler=this.onLayoutPointerDown.bind(this);this.onInfoAnnotationTapHandler=this.onInfoAnnotationTap.bind(this);this.pendingDeletionTimeout=null;}set shouldShowZoomControl(t){this.zoomButton&&(this.zoomButton.hidden=!t);}get shouldShowZoomControl(){return this.zoomButton===null?false:!this.zoomButton.hidden}set shouldShowCameraSwitchControl(t){this.cameraSwitchButton&&(this.cameraSwitchButton.hidden=!t);}get shouldShowCameraSwitchControl(){return this.cameraSwitchButton===null?false:!this.cameraSwitchButton.hidden}set shouldShowTorchControl(t){this.torchIconButton!==null&&(this.torchIconButton.hidden=!t);}get shouldShowTorchControl(){return this.torchIconButton===null?false:!this.torchIconButton.hidden}set torchControlPosition(t){var e;(e=this.torchIconButton)==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.TopLeft:t}`);}get torchControlPosition(){var e,o;let t=(o=(e=this.torchIconButton)==null?void 0:e.getAttribute("slot"))!=null?o:"";return t===""?Anchor.TopLeft:t.replace("controls-","")}set zoomControlPosition(t){var e;(e=this.zoomButton)==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.BottomRight:t}`);}get zoomControlPosition(){var e,o;let t=(o=(e=this.zoomButton)==null?void 0:e.getAttribute("slot"))!=null?o:"";return t===""?Anchor.BottomRight:t.replace("controls-","")}set cameraSwitchControlPosition(t){var e;(e=this.cameraSwitchButton)==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.TopRight:t}`);}get cameraSwitchControlPosition(){var e,o;let t=(o=(e=this.zoomButton)==null?void 0:e.getAttribute("slot"))!=null?o:"";return t===""?Anchor.TopRight:t.replace("controls-","")}static async createWithSettings(t,e,o,i,n){c.register();let r=document.createElement(c.tag);return r.barcodeArViewSettings=i,r.layout=a.create(),r.append(r.layout),a$1(t)?(r.dataCaptureView=t,r.dataCaptureView.containerElement.prepend(r),await t.setContext(e)):(r.dataCaptureView=await DataCaptureView.forContext(e),r.dataCaptureView.connectToElement(t),r.dataCaptureView.containerElement.prepend(r)),r.presenter=new a$2(r,e,o,i,n!=null?n:a$3.createRecommendedCameraSettings()),await r.presenter.prepare(),r}static async create(t,e,o){return c.createWithSettings(t,e,o,new a$4)}static register(){defineCustomElements({[a.tag]:a,[a$8.tag]:a$8,[a$7.tag]:a$7,[a$6.tag]:a$6,[c.tag]:c,[Backdrop.tag]:Backdrop,[a$5.tag]:a$5});}static createStyleElement(){return css`[data-could-be-deleted=true]{display:none!important}[data-on-foreground=true]{z-index:3}${c.tag}{inset:0;position:absolute;z-index:1}`}getHighlightForBarcode(t){return this.queryHighlightByDataId(a$9(t))}getAnnotationForBarcode(t){return this.queryAnnotationByDataId(a$9(t))}async start(){return this.presenter.startSearching()}async stop(){return this.presenter.stopSearching()}async pause(){return this.presenter.pauseSearching()}reset(){this.deletePendingViews(),this.deleteAllViews();}getNotificationPresenter(){return this.dataCaptureView.getNotificationPresenter()}toggleTorchIcon(t){this.torchIconButton!==null&&(this.torchIconButton.state=t);}onTorchButtonClick(){this.presenter.onTorchButtonClicked();}onCameraSwitchButtonClick(){this.presenter.onCameraSwitchButtonClicked();}onZoomButtonClick(){this.presenter.onZoomButtonClicked();}changeZoomButtonIcon(t){this.zoomButton&&(this.zoomButton.zoom=`${t}x`);}connectedCallback(){this.torchIconButton=a$6.create(),this.torchIconButton.slot=`controls-${this.torchControlPosition}`,this.torchIconButton.hidden=true,this.torchIconButton.addEventListener("pointerdown",this.onTorchButtonClickHandler),this.cameraSwitchButton=a$8.create(),this.cameraSwitchButton.slot=`controls-${this.cameraSwitchControlPosition}`,this.cameraSwitchButton.hidden=true,this.cameraSwitchButton.addEventListener("pointerdown",this.onCameraSwitchButtonHandler),this.zoomButton=a$7.create(),this.zoomButton.slot=`controls-${this.zoomControlPosition}`,this.zoomButton.hidden=true,this.zoomButton.addEventListener("pointerdown",this.onZoomButtonHandler),this.layout.append(this.torchIconButton,this.cameraSwitchButton,this.zoomButton),this.layout.addEventListener("pointerdown",this.onLayoutPointerDownHandler),this.layout.addEventListener("BarcodeArInfoAnnotationEventTap",this.onInfoAnnotationTapHandler),this.backdrop=Backdrop.create(),this.layout.append(this.backdrop),this.pendingDeletionTimeout=new Timeout(1e3,()=>{this.deletePendingViews();}),this.prepend(c.createStyleElement());}disconnectedCallback(){var t,e,o;this.deleteAllViews(),(t=this.torchIconButton)==null||t.removeEventListener("pointerdown",this.onTorchButtonClickHandler),(e=this.cameraSwitchButton)==null||e.removeEventListener("pointerdown",this.onCameraSwitchButtonHandler),(o=this.zoomButton)==null||o.removeEventListener("pointerdown",this.onZoomButtonHandler),this.layout.removeEventListener("pointerdown",this.onLayoutPointerDownHandler),this.layout.removeEventListener("BarcodeArInfoAnnotationEventTap",this.onInfoAnnotationTapHandler);}isPopoverAnnotation(t){return t instanceof b}isAnnotation(t){var e;return ((e=t.dataset)==null?void 0:e.identifier)==null?false:t.dataset.identifier.endsWith("-annotation")}areMultiplePopoverAllowed(){for(let t of this.layout.querySelectorAll("[data-identifier$='-annotation']"))if(t&&this.isPopoverAnnotation(t)&&t.annotationTrigger==="highlightTapAndBarcodeScan")return true;return false}async onLayoutPointerDown(t){let e=t.target,o=e==null?void 0:e.closest("[data-identifier$='-highlight']"),i=e==null?void 0:e.closest(b.tag);if((o==null?void 0:o.dataset.id)!=null){await this.handleHighlightClick(o);return}if((i==null?void 0:i.dataset.id)!=null){await this.handleAnnotationClick(i);return}await this.handleClickOutside();}async handleHighlightClick(t){var o;this.presenter.emitTappedFeedback(),(o=this.listener)==null||o.didTapHighlightForBarcode(this.presenter.barcodeAr,t.barcode,t);let e=this.queryAnnotationByDataIdentifier(t.dataset.identifier.replace("-highlight",""));!e||e.annotationTrigger==="barcodeScan"||(this.isPopoverAnnotation(e)?await this.handlePopoverHighlightClick(e,t):e.hidden=!e.hidden);}async handlePopoverHighlightClick(t,e){var o;if(!this.areMultiplePopoverAllowed()){let i=this.layout.querySelector(`${b.tag}[data-on-foreground="true"]`),n=(o=i==null?void 0:i.dataset.identifier)==null?void 0:o.replace("-annotation","-highlight"),r=this.layout.querySelector(`[data-identifier="${n}"]`);i!=null&&r!=null&&await this.hideBarcodeArPopover(i,r,false);}await this.toggleBarcodeArPopover(t,e);}async handleAnnotationClick(t){var i;let e=(i=t.dataset.identifier)==null?void 0:i.replace("-annotation","-highlight"),o=this.layout.querySelector(`[data-identifier="${e}"]`);o&&await this.toggleBarcodeArPopover(t,o);}async handleClickOutside(){var i;if(this.areMultiplePopoverAllowed())return;let t=this.layout.querySelector(`${b.tag}[data-on-foreground="true"]`);if(!t)return;let e=(i=t.dataset.identifier)==null?void 0:i.replace("-annotation","-highlight"),o=this.layout.querySelector(`[data-identifier="${e}"]`);o&&await this.hideBarcodeArPopover(t,o);}onInfoAnnotationTap(){this.presenter.emitTappedFeedback();}async showBarcodeArPopover(t,e){t.dataset.onForeground="true",t.hidden=false,e.dataset.onForeground="true",this.backdrop.open=true;}async hideBarcodeArPopover(t,e,o=true){t.dataset.onForeground="false",t.hidden=true,e&&(e.dataset.onForeground="false"),o&&this.hideBackdropIfNoPopovers();}hideBackdropIfNoPopovers(){[...this.layout.querySelectorAll(`${b.tag}`)].every(e=>e.hidden)&&(this.backdrop.open=false);}async toggleBarcodeArPopover(t,e){t.hidden?await this.showBarcodeArPopover(t,e):await this.hideBarcodeArPopover(t,e);}deleteAllViews(){for(let t of this.layout.querySelectorAll("[data-identifier]"))t.remove();}deletePendingViews(){for(let t of this.layout.querySelectorAll("[data-could-be-deleted='true']"))t.remove();this.hideBackdropIfNoPopovers();}identifierForHighlight(t){return `${t}-highlight`}identifierForAnnotation(t){return `${t}-annotation`}async onHighlightsOrAnnotationForTrackedBarcode(t){var e,o,i;await((o=(e=this.highlightProvider)!=null?e:W)==null?void 0:o.highlightForBarcode(t.barcode,async n=>this.onHighlight(t,n))),await((i=this.annotationProvider)==null?void 0:i.annotationForBarcode(t.barcode,async n=>this.onAnnotation(t,n)));}async onAnnotation(t,e){let o=e,i=a$9(t.barcode);this.updateExistingAnnotation(i)||(await this.setupNewAnnotation(o,i,t),this.updateAnnotationPosition(t,o));}updateExistingAnnotation(t){let e=this.queryAnnotationByDataId(t);return e?(e.dataset.couldBeDeleted="false",true):false}async setupNewAnnotation(t,e,o){if(t.dataset.id=e,t.dataset.identifier=this.identifierForAnnotation(o.identifier),t.hidden=true,this.layout.append(t),this.isPopoverAnnotation(t)){if(t.direction=Direction.Vertical,t.anchor==null&&(t.anchor="bottom-center"),this.areMultiplePopoverAllowed()||t.annotationTrigger==="highlightTapAndBarcodeScan"){let i=this.queryHighlightByDataId(e);i&&await this.showBarcodeArPopover(t,i);}}else t.hidden=t.annotationTrigger==="highlightTap";}getAnnotationVariationForQuad(t,e){let o=Math.max(0,Math.min(1,e)),i=t.anchorPositions,n=calculateArea(i),r=this.dataCaptureView.width,l=this.dataCaptureView.height,d=r*l;if(n<=0||d<=0)return 0;let u=n/d;return Math.max(0,Math.min(1,u))<=o?2:1}async onHighlight(t,e){let o=a$9(t.barcode),i=this.queryHighlightByDataId(o);i?i.dataset.couldBeDeleted="false":(e.dataset.id=o,e.dataset.identifier=this.identifierForHighlight(t.identifier),this.updateHighlightPosition(t,e),this.layout.append(e));}queryHighlightByDataIdentifier(t){return this.layout.querySelector(`[data-identifier$="${t}-highlight"]`)}queryAnnotationByDataIdentifier(t){return this.layout.querySelector(`[data-identifier$="${t}-annotation"]`)}queryHighlightByDataId(t){return this.layout.querySelector(`[data-identifier$="-highlight"][data-id="${t}"]`)}queryAnnotationByDataId(t){return this.layout.querySelector(`[data-identifier$="-annotation"][data-id="${t}"]`)}updateRemovedTrackedBarcodes(t){var i,n,r,l,d;let e=this.querySelectorAll("[data-identifier]");if(Object.keys(t.allTrackedBarcodes).length===0){for(let u of e)u.dataset.couldBeDeleted="true";(i=this.pendingDeletionTimeout)!=null&&i.running||(n=this.pendingDeletionTimeout)==null||n.start();return}let o=new Set(t.removedTrackedBarcodes);for(let u of e){let p=(r=u.dataset.identifier)==null?void 0:r.replace("-highlight","").replace("-annotation","");p!=null&&o.has(p)&&(u.dataset.couldBeDeleted="true");}(l=this.pendingDeletionTimeout)!=null&&l.running||(d=this.pendingDeletionTimeout)==null||d.start();}render(t){for(let[e,o]of Object.entries(t.allTrackedBarcodes)){t.addedTrackedBarcodes[e]!=null&&this.onHighlightsOrAnnotationForTrackedBarcode(o);let i=a$9(o.barcode),n=this.queryAnnotationByDataId(i),r=this.queryHighlightByDataId(i);r&&(this.updateBrushSize(r,o),this.updateHighlightPosition(o,r)),n&&this.updateAnnotationPosition(o,n,r);}this.updateRemovedTrackedBarcodes(t);}updateHighlightPosition(t,e,o="center"){if(e.hidden)return;let i=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(t.anchorPositions),n=this.normalizedViewPointFromFrameAnchorPositions(i,o);e.updatePosition(n,new Point(-50,-50),this.calculateRotationAngle(i.topLeft,i.topRight));}updateBrushSize(t,e){if(t.width==null||t.height==null)return;let o=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(e.anchorPositions),i=Math.round(calculateWidth(o)),n=Math.round(calculateHeight(o));t.width!==i&&(t.width=i),t.height!==n&&(t.height=n);}getTransformOrigin(t){return {"top-center":new Point(-50,0),"bottom-center":new Point(-50,-100),"left-center":new Point(0,-50),"right-center":new Point(-100,-50)}[t]}calculateAnnotationPosition(t,e,o){var p,w;let n=t.orderVerticesByPosition(),r=this.normalizedViewPointFromFrameAnchorPositions(t,"center"),d={"bottom-center":()=>{let s=this.normalizedViewPointFromFrameAnchorPositions(n,"topCenter");return new Point(s.x,s.y-7)},"top-center":()=>{let s=this.normalizedViewPointFromFrameAnchorPositions(n,"bottomCenter");return new Point(s.x,s.y+7)},"right-center":()=>{let s=this.normalizedViewPointFromFrameAnchorPositions(n,"centerLeft");return new Point(s.x-7,s.y)},"left-center":()=>{let s=this.normalizedViewPointFromFrameAnchorPositions(n,"centerRight");return new Point(s.x+7,s.y)}}[e]();return o?o instanceof b$1?(p={"bottom-center":new Point(r.x,r.y-7-o.clientHeight/2),"top-center":new Point(r.x,r.y+7+o.clientHeight/2),"right-center":new Point(r.x-7-o.clientWidth/2,r.y),"left-center":new Point(r.x+7+o.clientWidth/2,r.y)}[e])!=null?p:d:(w={"bottom-center":new Point(r.x,r.y-7-o.clientHeight/2),"top-center":new Point(r.x,r.y+7+o.clientHeight/2),"right-center":new Point(r.x-7-o.clientWidth/2,r.y),"left-center":new Point(r.x+7+o.clientWidth/2,r.y)}[e])!=null?w:d:d}updateAnnotationPosition(t,e,o){let i=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(t.anchorPositions);if(e.anchor||(e.anchor="top-center"),e.annotationVariation!=null){let l=this.getAnnotationVariationForQuad(t,a$5.threshold);e.annotationVariation=l;}let n=this.getTransformOrigin(e.anchor),r=this.calculateAnnotationPosition(i,e.anchor,o);e.updatePosition(r,n,this.calculateRotationAngle(i.topLeft,i.topRight));}normalizedViewPointFromFrameAnchorPositions(t,e="center"){let o=this.presenter.currentCamera.getMirrorImageEnabled(),i=new Size(this.dataCaptureView.width,this.dataCaptureView.height);if(o){let r=t[{centerLeft:"centerRight",centerRight:"centerLeft",center:"center",topCenter:"topCenter",bottomCenter:"bottomCenter"}[e]];return Point.mirrorX(r,i)}return t[e]}calculateRotationAngle(t,e){let o=e.x-t.x,n=this.presenter.isCameraMirrored()?-(e.y-t.y):e.y-t.y,r=Math.atan2(n,o);return Math.round(r*(180/Math.PI))}};c.tag="scandit-barcode-ar-view";var k=c;export{k as a};
|
|
1
|
+
import {a}from'./chunk-5FFSTOF2.js';import {a as a$8}from'./chunk-ZPCWOA3Y.js';import {a as a$7}from'./chunk-MHOUYN7K.js';import {a as a$a}from'./chunk-KMEGIFKL.js';import {a as a$5}from'./chunk-QRG4J3CL.js';import {b as b$1}from'./chunk-33EFB3RJ.js';import {b}from'./chunk-OH47PSIL.js';import {a as a$6}from'./chunk-Z4UVSYU5.js';import {a as a$1}from'./chunk-I53W7VSB.js';import {a as a$9}from'./chunk-O5SUMSOC.js';import {a as a$2}from'./chunk-57MQQWNB.js';import {a as a$4}from'./chunk-LKQMBRKB.js';import {a as a$3}from'./chunk-RLUCUFVA.js';import {Anchor,DataCaptureView,Direction,Point,Size}from'@scandit/web-datacapture-core';import {Backdrop}from'@scandit/web-datacapture-core/build/js/private/ui/atoms/Backdrop.js';import {ScanditHTMLElement}from'@scandit/web-datacapture-core/build/js/private/utils/ScanditHTMLElement.js';import {css}from'@scandit/web-datacapture-core/build/js/private/utils/css.js';import {defineCustomElements}from'@scandit/web-datacapture-core/build/js/private/utils/defineCustomElements.js';import {calculateArea,calculateWidth,calculateHeight}from'@scandit/web-datacapture-core/build/js/private/utils/quadrilateralUtils.js';import {Timeout}from'@scandit/web-datacapture-core/build/js/private/utils/timeout.js';var W={async highlightForBarcode(E,T){let t=a$a.create(E);T(t);}},c=class c extends ScanditHTMLElement{constructor(){super(...arguments);this.torchIconButton=null;this.cameraSwitchButton=null;this.zoomButton=null;this.onTorchButtonClickHandler=this.onTorchButtonClick.bind(this);this.onCameraSwitchButtonHandler=this.onCameraSwitchButtonClick.bind(this);this.onZoomButtonHandler=this.onZoomButtonClick.bind(this);this.onLayoutPointerDownHandler=this.onLayoutPointerDown.bind(this);this.onInfoAnnotationTapHandler=this.onInfoAnnotationTap.bind(this);this.pendingDeletionTimeout=null;}set shouldShowZoomControl(t){this.zoomButton&&(this.zoomButton.hidden=!t);}get shouldShowZoomControl(){return this.zoomButton===null?false:!this.zoomButton.hidden}set shouldShowCameraSwitchControl(t){this.cameraSwitchButton&&(this.cameraSwitchButton.hidden=!t);}get shouldShowCameraSwitchControl(){return this.cameraSwitchButton===null?false:!this.cameraSwitchButton.hidden}set shouldShowTorchControl(t){this.torchIconButton!==null&&(this.torchIconButton.hidden=!t);}get shouldShowTorchControl(){return this.torchIconButton===null?false:!this.torchIconButton.hidden}set torchControlPosition(t){var e;(e=this.torchIconButton)==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.TopLeft:t}`);}get torchControlPosition(){var e,o;let t=(o=(e=this.torchIconButton)==null?void 0:e.getAttribute("slot"))!=null?o:"";return t===""?Anchor.TopLeft:t.replace("controls-","")}set zoomControlPosition(t){var e;(e=this.zoomButton)==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.BottomRight:t}`);}get zoomControlPosition(){var e,o;let t=(o=(e=this.zoomButton)==null?void 0:e.getAttribute("slot"))!=null?o:"";return t===""?Anchor.BottomRight:t.replace("controls-","")}set cameraSwitchControlPosition(t){var e;(e=this.cameraSwitchButton)==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.TopRight:t}`);}get cameraSwitchControlPosition(){var e,o;let t=(o=(e=this.zoomButton)==null?void 0:e.getAttribute("slot"))!=null?o:"";return t===""?Anchor.TopRight:t.replace("controls-","")}static async createWithSettings(t,e,o,i,n){c.register();let r=document.createElement(c.tag);return r.barcodeArViewSettings=i,r.layout=a.create(),r.append(r.layout),a$1(t)?(r.dataCaptureView=t,r.dataCaptureView.containerElement.prepend(r),await t.setContext(e)):(r.dataCaptureView=await DataCaptureView.forContext(e),r.dataCaptureView.connectToElement(t),r.dataCaptureView.containerElement.prepend(r)),r.presenter=new a$2(r,e,o,i,n!=null?n:a$3.createRecommendedCameraSettings()),await r.presenter.prepare(),r}static async create(t,e,o){return c.createWithSettings(t,e,o,new a$4)}static register(){defineCustomElements({[a.tag]:a,[a$8.tag]:a$8,[a$7.tag]:a$7,[a$6.tag]:a$6,[c.tag]:c,[Backdrop.tag]:Backdrop,[a$5.tag]:a$5});}static createStyleElement(){return css`[data-could-be-deleted=true]{display:none!important}[data-on-foreground=true]{z-index:3}${c.tag}{inset:0;position:absolute;z-index:1}`}getHighlightForBarcode(t){return this.queryHighlightByDataId(a$9(t))}getAnnotationForBarcode(t){return this.queryAnnotationByDataId(a$9(t))}async start(){return this.presenter.startSearching()}async stop(){return this.presenter.stopSearching()}async pause(){return this.presenter.pauseSearching()}reset(){this.deletePendingViews(),this.deleteAllViews();}getNotificationPresenter(){return this.dataCaptureView.getNotificationPresenter()}toggleTorchIcon(t){this.torchIconButton!==null&&(this.torchIconButton.state=t);}onTorchButtonClick(){this.presenter.onTorchButtonClicked();}onCameraSwitchButtonClick(){this.presenter.onCameraSwitchButtonClicked();}onZoomButtonClick(){this.presenter.onZoomButtonClicked();}changeZoomButtonIcon(t){this.zoomButton&&(this.zoomButton.zoom=`${t}x`);}connectedCallback(){this.torchIconButton=a$6.create(),this.torchIconButton.slot=`controls-${this.torchControlPosition}`,this.torchIconButton.hidden=true,this.torchIconButton.addEventListener("pointerdown",this.onTorchButtonClickHandler),this.cameraSwitchButton=a$8.create(),this.cameraSwitchButton.slot=`controls-${this.cameraSwitchControlPosition}`,this.cameraSwitchButton.hidden=true,this.cameraSwitchButton.addEventListener("pointerdown",this.onCameraSwitchButtonHandler),this.zoomButton=a$7.create(),this.zoomButton.slot=`controls-${this.zoomControlPosition}`,this.zoomButton.hidden=true,this.zoomButton.addEventListener("pointerdown",this.onZoomButtonHandler),this.layout.append(this.torchIconButton,this.cameraSwitchButton,this.zoomButton),this.layout.addEventListener("pointerdown",this.onLayoutPointerDownHandler),this.layout.addEventListener("BarcodeArInfoAnnotationEventTap",this.onInfoAnnotationTapHandler),this.backdrop=Backdrop.create(),this.layout.append(this.backdrop),this.pendingDeletionTimeout=new Timeout(1e3,()=>{this.deletePendingViews();}),this.prepend(c.createStyleElement());}disconnectedCallback(){var t,e,o;this.deleteAllViews(),(t=this.torchIconButton)==null||t.removeEventListener("pointerdown",this.onTorchButtonClickHandler),(e=this.cameraSwitchButton)==null||e.removeEventListener("pointerdown",this.onCameraSwitchButtonHandler),(o=this.zoomButton)==null||o.removeEventListener("pointerdown",this.onZoomButtonHandler),this.layout.removeEventListener("pointerdown",this.onLayoutPointerDownHandler),this.layout.removeEventListener("BarcodeArInfoAnnotationEventTap",this.onInfoAnnotationTapHandler);}isPopoverAnnotation(t){return t instanceof b}isAnnotation(t){var e;return ((e=t.dataset)==null?void 0:e.identifier)==null?false:t.dataset.identifier.endsWith("-annotation")}areMultiplePopoverAllowed(){for(let t of this.layout.querySelectorAll("[data-identifier$='-annotation']"))if(t&&this.isPopoverAnnotation(t)&&t.annotationTrigger==="highlightTapAndBarcodeScan")return true;return false}async onLayoutPointerDown(t){let e=t.target,o=e==null?void 0:e.closest("[data-identifier$='-highlight']"),i=e==null?void 0:e.closest(b.tag);if((o==null?void 0:o.dataset.id)!=null){await this.handleHighlightClick(o);return}if((i==null?void 0:i.dataset.id)!=null){await this.handleAnnotationClick(i);return}await this.handleClickOutside();}async handleHighlightClick(t){var o;this.presenter.emitTappedFeedback(),(o=this.listener)==null||o.didTapHighlightForBarcode(this.presenter.barcodeAr,t.barcode,t);let e=this.queryAnnotationByDataIdentifier(t.dataset.identifier.replace("-highlight",""));!e||e.annotationTrigger==="barcodeScan"||(this.isPopoverAnnotation(e)?await this.handlePopoverHighlightClick(e,t):e.hidden=!e.hidden);}async handlePopoverHighlightClick(t,e){var o;if(!this.areMultiplePopoverAllowed()){let i=this.layout.querySelector(`${b.tag}[data-on-foreground="true"]`),n=(o=i==null?void 0:i.dataset.identifier)==null?void 0:o.replace("-annotation","-highlight"),r=this.layout.querySelector(`[data-identifier="${n}"]`);i!=null&&r!=null&&await this.hideBarcodeArPopover(i,r,false);}await this.toggleBarcodeArPopover(t,e);}async handleAnnotationClick(t){var i;let e=(i=t.dataset.identifier)==null?void 0:i.replace("-annotation","-highlight"),o=this.layout.querySelector(`[data-identifier="${e}"]`);o&&await this.toggleBarcodeArPopover(t,o);}async handleClickOutside(){var i;if(this.areMultiplePopoverAllowed())return;let t=this.layout.querySelector(`${b.tag}[data-on-foreground="true"]`);if(!t)return;let e=(i=t.dataset.identifier)==null?void 0:i.replace("-annotation","-highlight"),o=this.layout.querySelector(`[data-identifier="${e}"]`);o&&await this.hideBarcodeArPopover(t,o);}onInfoAnnotationTap(){this.presenter.emitTappedFeedback();}async showBarcodeArPopover(t,e){t.dataset.onForeground="true",t.hidden=false,e.dataset.onForeground="true",this.backdrop.open=true;}async hideBarcodeArPopover(t,e,o=true){t.dataset.onForeground="false",t.hidden=true,e&&(e.dataset.onForeground="false"),o&&this.hideBackdropIfNoPopovers();}hideBackdropIfNoPopovers(){[...this.layout.querySelectorAll(`${b.tag}`)].every(e=>e.hidden)&&(this.backdrop.open=false);}async toggleBarcodeArPopover(t,e){t.hidden?await this.showBarcodeArPopover(t,e):await this.hideBarcodeArPopover(t,e);}deleteAllViews(){for(let t of this.layout.querySelectorAll("[data-identifier]"))t.remove();}deletePendingViews(){for(let t of this.layout.querySelectorAll("[data-could-be-deleted='true']"))t.remove();this.hideBackdropIfNoPopovers();}identifierForHighlight(t){return `${t}-highlight`}identifierForAnnotation(t){return `${t}-annotation`}async onHighlightsOrAnnotationForTrackedBarcode(t){var e,o,i;await((o=(e=this.highlightProvider)!=null?e:W)==null?void 0:o.highlightForBarcode(t.barcode,async n=>this.onHighlight(t,n))),await((i=this.annotationProvider)==null?void 0:i.annotationForBarcode(t.barcode,async n=>this.onAnnotation(t,n)));}async onAnnotation(t,e){let o=e,i=a$9(t.barcode);this.updateExistingAnnotation(i)||(await this.setupNewAnnotation(o,i,t),this.updateAnnotationPosition(t,o));}updateExistingAnnotation(t){let e=this.queryAnnotationByDataId(t);return e?(e.dataset.couldBeDeleted="false",true):false}async setupNewAnnotation(t,e,o){if(t.dataset.id=e,t.dataset.identifier=this.identifierForAnnotation(o.identifier),t.hidden=true,this.layout.append(t),this.isPopoverAnnotation(t)){if(t.direction=Direction.Vertical,t.anchor==null&&(t.anchor="bottom-center"),this.areMultiplePopoverAllowed()||t.annotationTrigger==="highlightTapAndBarcodeScan"){let i=this.queryHighlightByDataId(e);i&&await this.showBarcodeArPopover(t,i);}}else t.hidden=t.annotationTrigger==="highlightTap";}getAnnotationVariationForQuad(t,e){let o=Math.max(0,Math.min(1,e)),i=t.anchorPositions,n=calculateArea(i),r=this.dataCaptureView.width,l=this.dataCaptureView.height,d=r*l;if(n<=0||d<=0)return 0;let u=n/d;return Math.max(0,Math.min(1,u))<=o?2:1}async onHighlight(t,e){let o=a$9(t.barcode),i=this.queryHighlightByDataId(o);i?i.dataset.couldBeDeleted="false":(e.dataset.id=o,e.dataset.identifier=this.identifierForHighlight(t.identifier),this.updateHighlightPosition(t,e),this.layout.append(e));}queryHighlightByDataIdentifier(t){return this.layout.querySelector(`[data-identifier$="${t}-highlight"]`)}queryAnnotationByDataIdentifier(t){return this.layout.querySelector(`[data-identifier$="${t}-annotation"]`)}queryHighlightByDataId(t){return this.layout.querySelector(`[data-identifier$="-highlight"][data-id="${t}"]`)}queryAnnotationByDataId(t){return this.layout.querySelector(`[data-identifier$="-annotation"][data-id="${t}"]`)}updateRemovedTrackedBarcodes(t){var i,n,r,l,d;let e=this.querySelectorAll("[data-identifier]");if(Object.keys(t.allTrackedBarcodes).length===0){for(let u of e)u.dataset.couldBeDeleted="true";(i=this.pendingDeletionTimeout)!=null&&i.running||(n=this.pendingDeletionTimeout)==null||n.start();return}let o=new Set(t.removedTrackedBarcodes);for(let u of e){let p=(r=u.dataset.identifier)==null?void 0:r.replace("-highlight","").replace("-annotation","");p!=null&&o.has(p)&&(u.dataset.couldBeDeleted="true");}(l=this.pendingDeletionTimeout)!=null&&l.running||(d=this.pendingDeletionTimeout)==null||d.start();}render(t){for(let[e,o]of Object.entries(t.allTrackedBarcodes)){t.addedTrackedBarcodes[e]!=null&&this.onHighlightsOrAnnotationForTrackedBarcode(o);let i=a$9(o.barcode),n=this.queryAnnotationByDataId(i),r=this.queryHighlightByDataId(i);r&&(this.updateBrushSize(r,o),this.updateHighlightPosition(o,r)),n&&this.updateAnnotationPosition(o,n,r);}this.updateRemovedTrackedBarcodes(t);}updateHighlightPosition(t,e,o="center"){if(e.hidden)return;let i=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(t.anchorPositions),n=this.normalizedViewPointFromFrameAnchorPositions(i,o);e.updatePosition(n,new Point(-50,-50),this.calculateRotationAngle(i.topLeft,i.topRight));}updateBrushSize(t,e){if(t.width==null||t.height==null)return;let o=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(e.anchorPositions),i=Math.round(calculateWidth(o)),n=Math.round(calculateHeight(o));t.width!==i&&(t.width=i),t.height!==n&&(t.height=n);}getTransformOrigin(t){return {"top-center":new Point(-50,0),"bottom-center":new Point(-50,-100),"left-center":new Point(0,-50),"right-center":new Point(-100,-50)}[t]}calculateAnnotationPosition(t,e,o){var p,w;let n=t.orderVerticesByPosition(),r=this.normalizedViewPointFromFrameAnchorPositions(t,"center"),d={"bottom-center":()=>{let s=this.normalizedViewPointFromFrameAnchorPositions(n,"topCenter");return new Point(s.x,s.y-7)},"top-center":()=>{let s=this.normalizedViewPointFromFrameAnchorPositions(n,"bottomCenter");return new Point(s.x,s.y+7)},"right-center":()=>{let s=this.normalizedViewPointFromFrameAnchorPositions(n,"centerLeft");return new Point(s.x-7,s.y)},"left-center":()=>{let s=this.normalizedViewPointFromFrameAnchorPositions(n,"centerRight");return new Point(s.x+7,s.y)}}[e]();return o?o instanceof b$1?(p={"bottom-center":new Point(r.x,r.y-7-o.clientHeight/2),"top-center":new Point(r.x,r.y+7+o.clientHeight/2),"right-center":new Point(r.x-7-o.clientWidth/2,r.y),"left-center":new Point(r.x+7+o.clientWidth/2,r.y)}[e])!=null?p:d:(w={"bottom-center":new Point(r.x,r.y-7-o.clientHeight/2),"top-center":new Point(r.x,r.y+7+o.clientHeight/2),"right-center":new Point(r.x-7-o.clientWidth/2,r.y),"left-center":new Point(r.x+7+o.clientWidth/2,r.y)}[e])!=null?w:d:d}updateAnnotationPosition(t,e,o){let i=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(t.anchorPositions);if(e.anchor||(e.anchor="top-center"),e.annotationVariation!=null){let l=this.getAnnotationVariationForQuad(t,a$5.threshold);e.annotationVariation=l;}let n=this.getTransformOrigin(e.anchor),r=this.calculateAnnotationPosition(i,e.anchor,o);e.updatePosition(r,n,this.calculateRotationAngle(i.topLeft,i.topRight));}normalizedViewPointFromFrameAnchorPositions(t,e="center"){let o=this.presenter.currentCamera.getMirrorImageEnabled(),i=new Size(this.dataCaptureView.width,this.dataCaptureView.height);if(o){let r=t[{centerLeft:"centerRight",centerRight:"centerLeft",center:"center",topCenter:"topCenter",bottomCenter:"bottomCenter"}[e]];return Point.mirrorX(r,i)}return t[e]}calculateRotationAngle(t,e){let o=e.x-t.x,n=this.presenter.isCameraMirrored()?-(e.y-t.y):e.y-t.y,r=Math.atan2(n,o);return Math.round(r*(180/Math.PI))}};c.tag="scandit-barcode-ar-view";var k=c;export{k as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeFindView}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeFindView}from'../chunks/chunk-5Q6EQEBB.js';
|
package/build/js/find/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeFindSettings}from'../chunks/chunk-HPHWNCN6.js';export{a as BarcodeFindView}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeFindSettings}from'../chunks/chunk-HPHWNCN6.js';export{a as BarcodeFindView}from'../chunks/chunk-5Q6EQEBB.js';export{a as BarcodeFind}from'../chunks/chunk-GHZPTMU5.js';export{a as BarcodeFindItem,c as BarcodeFindItemContent,b as BarcodeFindItemSearchOptions}from'../chunks/chunk-HTKUJZG2.js';export{a as BarcodeFindViewSettings}from'../chunks/chunk-4PTIOBXM.js';
|
package/build/js/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as BarcodeArStatusIconAnnotation,a as BarcodeArStatusIconAnnotationAnchor}from'./chunks/chunk-HQNY4HRW.js';export{a as BarcodeStatusIconContainer}from'./chunks/chunk-SDQOQ2G3.js';export{a as
|
|
1
|
+
export{b as BarcodeArStatusIconAnnotation,a as BarcodeArStatusIconAnnotationAnchor}from'./chunks/chunk-HQNY4HRW.js';export{a as BarcodeStatusIconContainer}from'./chunks/chunk-SDQOQ2G3.js';export{a as BarcodeFindSettings}from'./chunks/chunk-HPHWNCN6.js';export{a as BarcodeFindView}from'./chunks/chunk-5Q6EQEBB.js';export{a as BarcodeFind}from'./chunks/chunk-GHZPTMU5.js';export{a as BarcodeFindItem,c as BarcodeFindItemContent,b as BarcodeFindItemSearchOptions}from'./chunks/chunk-HTKUJZG2.js';export{a as SparkScanView}from'./chunks/chunk-BUWIQBED.js';export{a as SparkScanViewState}from'./chunks/chunk-L6IZLBEM.js';export{a as SparkScanViewSettings}from'./chunks/chunk-JUAJVG4Z.js';export{a as SparkScanToastSettings}from'./chunks/chunk-BRRT6GC7.js';export{a as SparkScanPreviewBehavior}from'./chunks/chunk-DFK7AQTK.js';export{a as SparkScanScanningBehavior}from'./chunks/chunk-IMYBB4ZA.js';export{a as SparkScanScanningMode,b as SparkScanScanningModeDefault,c as SparkScanScanningModeTarget}from'./chunks/chunk-SZUPDKV5.js';export{a as SparkScanSettings}from'./chunks/chunk-MPJZZO46.js';export{a as SparkScan}from'./chunks/chunk-TC4DIIXB.js';export{a as SparkScanSession}from'./chunks/chunk-KEN6J62X.js';export{b as SparkScanBarcodeErrorFeedback,a as SparkScanBarcodeFeedback,c as SparkScanBarcodeSuccessFeedback}from'./chunks/chunk-RUZMLCEP.js';export{a as BarcodeArSettings}from'./chunks/chunk-TZVKWSP7.js';export{a as BarcodeArView}from'./chunks/chunk-XBZZC32S.js';export{a as BarcodeArRectangleHighlight}from'./chunks/chunk-KMEGIFKL.js';export{a as BarcodeArResponsiveAnnotation}from'./chunks/chunk-QRG4J3CL.js';export{b as BarcodeArCircleHighlight,a as BarcodeArCircleHighlightPreset}from'./chunks/chunk-33EFB3RJ.js';export{d as BarcodeArInfoAnnotation,a as BarcodeArInfoAnnotationAnchor,b as BarcodeArInfoAnnotationWidthPreset}from'./chunks/chunk-I6NAW3SE.js';export{a as BarcodeArInfoAnnotationBodyComponent}from'./chunks/chunk-KELYPKGG.js';export{a as BarcodeArInfoAnnotationFooter}from'./chunks/chunk-FD4QVJDW.js';export{a as BarcodeArInfoAnnotationHeader}from'./chunks/chunk-MHRGFVAW.js';export{b as BarcodeArPopoverAnnotation,a as BarcodeArPopoverAnnotationAnchor}from'./chunks/chunk-OH47PSIL.js';export{a as BarcodeArPopoverAnnotationButton}from'./chunks/chunk-MVLSFC5H.js';export{a as BarcodeArAnnotationTrigger}from'./chunks/chunk-I6GJ7OYJ.js';export{a as BarcodeArViewSettings}from'./chunks/chunk-LKQMBRKB.js';export{a as TrackedBarcodeView}from'./chunks/chunk-644ETSOC.js';export{a as barcodeCaptureLoader}from'./chunks/chunk-4QYSTHLG.js';export{a as BarcodeAr}from'./chunks/chunk-RLUCUFVA.js';export{a as BarcodeArFeedback}from'./chunks/chunk-IRKV6L4A.js';export{a as BarcodeArSession}from'./chunks/chunk-SNPWBV7Y.js';export{a as BarcodeBatchSettings}from'./chunks/chunk-BNBC2BUN.js';export{a as BarcodeCapture}from'./chunks/chunk-HK6GAZQL.js';export{a as BarcodeCaptureFeedback}from'./chunks/chunk-WPSMXGDG.js';export{a as BarcodeCaptureOverlay}from'./chunks/chunk-LDSPZMGQ.js';export{a as BarcodeCaptureSession}from'./chunks/chunk-CLT5UZMK.js';export{a as LocalizedOnlyBarcode}from'./chunks/chunk-MUX2WWWH.js';export{a as BarcodeCaptureSettings}from'./chunks/chunk-H3URAF7U.js';export{a as ScanIntention}from'./chunks/chunk-NH3EDXZZ.js';export{a as ArucoDictionary}from'./chunks/chunk-DCUKY2F4.js';export{a as ArucoDictionaryPreset}from'./chunks/chunk-S5FTF2QC.js';export{a as ArucoMarker}from'./chunks/chunk-SSODGMFG.js';export{a as BarcodeBatch}from'./chunks/chunk-ISP2EL77.js';export{a as BarcodeBatchAdvancedOverlay}from'./chunks/chunk-QBMLA2J7.js';export{b as BarcodeBatchBasicOverlay,a as BarcodeBatchBasicOverlayStyle}from'./chunks/chunk-EOI2TZRV.js';export{a as SparkScanMiniPreviewSize}from'./chunks/chunk-MVDPXLVX.js';export{a as BarcodeFindViewSettings}from'./chunks/chunk-4PTIOBXM.js';export{a as SymbologyDescription}from'./chunks/chunk-OEYNGWOX.js';export{a as Range}from'./chunks/chunk-7SWSAHI5.js';export{a as SymbologySettings}from'./chunks/chunk-LBAL6OCN.js';export{a as BarcodeBatchSession}from'./chunks/chunk-JAFW53OO.js';export{a as TrackedBarcode}from'./chunks/chunk-3KF7PG5K.js';export{e as Barcode,c as Checksum,d as CompositeFlag,b as CompositeType,a as Symbology}from'./chunks/chunk-2BGFR4WR.js';export{a as StructuredAppendData}from'./chunks/chunk-IEE5MKEA.js';export{a as EncodingRange}from'./chunks/chunk-J4VFWBJ7.js';
|
package/build/js/moduleLoader.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as barcodeCaptureLoader}from'./chunks/chunk-
|
|
1
|
+
export{a as barcodeCaptureLoader}from'./chunks/chunk-4QYSTHLG.js';
|
package/build/js/spark/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as SparkScanView}from'../chunks/chunk-
|
|
1
|
+
export{a as SparkScanView}from'../chunks/chunk-BUWIQBED.js';export{a as SparkScanViewState}from'../chunks/chunk-L6IZLBEM.js';export{a as SparkScanViewSettings}from'../chunks/chunk-JUAJVG4Z.js';export{a as SparkScanToastSettings}from'../chunks/chunk-BRRT6GC7.js';export{a as SparkScanPreviewBehavior}from'../chunks/chunk-DFK7AQTK.js';export{a as SparkScanScanningBehavior}from'../chunks/chunk-IMYBB4ZA.js';export{a as SparkScanScanningMode,b as SparkScanScanningModeDefault,c as SparkScanScanningModeTarget}from'../chunks/chunk-SZUPDKV5.js';export{a as SparkScanSettings}from'../chunks/chunk-MPJZZO46.js';export{a as SparkScan}from'../chunks/chunk-TC4DIIXB.js';export{a as SparkScanSession}from'../chunks/chunk-KEN6J62X.js';export{b as SparkScanBarcodeErrorFeedback,a as SparkScanBarcodeFeedback,c as SparkScanBarcodeSuccessFeedback}from'../chunks/chunk-RUZMLCEP.js';export{a as SparkScanMiniPreviewSize}from'../chunks/chunk-MVDPXLVX.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as SparkScanView}from'../../chunks/chunk-
|
|
1
|
+
export{a as SparkScanView}from'../../chunks/chunk-BUWIQBED.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as SparkScanViewMiniPreview,a as SparkScanViewMiniPreviewButtonType}from'../../chunks/chunk-
|
|
1
|
+
export{b as SparkScanViewMiniPreview,a as SparkScanViewMiniPreviewButtonType}from'../../chunks/chunk-RVMZZAZJ.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as SparkScanViewPresenter}from'../../chunks/chunk-
|
|
1
|
+
export{a as SparkScanViewPresenter}from'../../chunks/chunk-U7BV6NAD.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as SparkScanView}from'../../chunks/chunk-
|
|
1
|
+
export{a as SparkScanView}from'../../chunks/chunk-BUWIQBED.js';export{a as SparkScanViewTriggerButton}from'../../chunks/chunk-CIJT43OI.js';export{a as SparkScanViewVisualFeedback}from'../../chunks/chunk-6KWMOMD7.js';export{b as SparkScanViewMiniPreview,a as SparkScanViewMiniPreviewButtonType}from'../../chunks/chunk-RVMZZAZJ.js';export{a as SparkScanViewToast}from'../../chunks/chunk-LWUFGA5M.js';export{a as SparkScanViewToolbar}from'../../chunks/chunk-XKXYG775.js';export{a as SparkScanViewIcon}from'../../chunks/chunk-5Q3AHWJL.js';export{a as SparkScanViewPresenter}from'../../chunks/chunk-U7BV6NAD.js';export{a as SparkScanViewStateManager}from'../../chunks/chunk-JIUTBKIH.js';export{a as SparkScanViewState}from'../../chunks/chunk-L6IZLBEM.js';export{a as SparkScanViewFeedbackManager}from'../../chunks/chunk-NMXU6D43.js';export{a as SparkScanViewPreferenceManager}from'../../chunks/chunk-QCD3RIT4.js';export{a as SparkScanViewSettings}from'../../chunks/chunk-JUAJVG4Z.js';export{a as SparkScanToastSettings}from'../../chunks/chunk-BRRT6GC7.js';export{a as SparkScanMiniPreviewSize}from'../../chunks/chunk-MVDPXLVX.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeCaptureWorkerManager}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeCaptureWorkerManager}from'../chunks/chunk-SCU7HYCK.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as WorkerMain}from'../chunks/chunk-
|
|
1
|
+
export{a as WorkerMain}from'../chunks/chunk-SI7K4LM6.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'../chunks/chunk-
|
|
1
|
+
import {a}from'../chunks/chunk-SI7K4LM6.js';new a(globalThis,{get:()=>globalThis.Module,set:e=>{globalThis.Module=e;}});function n(e){}export{n as InlineWorker};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as DataCaptureEngine}from'../chunks/chunk-
|
|
1
|
+
export{a as DataCaptureEngine}from'../chunks/chunk-NE3R4NVC.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scandit/web-datacapture-barcode",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.1",
|
|
4
4
|
"description": "Scandit Data Capture SDK for the Web",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"test-ci-coverage": "jest --ci --coverage --silent"
|
|
94
94
|
},
|
|
95
95
|
"peerDependencies": {
|
|
96
|
-
"@scandit/web-datacapture-core": "8.0.
|
|
96
|
+
"@scandit/web-datacapture-core": "8.0.1"
|
|
97
97
|
},
|
|
98
98
|
"dependencies": {
|
|
99
99
|
"@types/emscripten": "1.40.1"
|