@scandit/web-datacapture-barcode 7.5.0 → 7.6.0-beta.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/build/js/BarcodeBatch.js +1 -1
- package/build/js/BarcodeBatchBasicOverlay.js +1 -1
- package/build/js/BarcodeBatchSettings.js +1 -1
- package/build/js/BarcodeCapture.js +1 -1
- package/build/js/BarcodeCaptureOverlay.d.ts +13 -1
- package/build/js/BarcodeCaptureOverlay.js +1 -1
- package/build/js/BarcodeCaptureSettings.js +1 -1
- package/build/js/Defaults.d.ts +0 -2
- package/build/js/Defaults.js +1 -1
- 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/BarcodeArSettings.js +1 -1
- package/build/js/ar/BarcodeArView.js +1 -1
- package/build/js/ar/ui/atoms/BarcodeArInfoAnnotationFooter.js +1 -1
- package/build/js/ar/ui/atoms/BarcodeArInfoAnnotationHeader.js +1 -1
- package/build/js/ar/ui/atoms/private/BarcodeArInfoAnnotationHeaderFooterUtils.js +1 -1
- package/build/js/ar/ui/atoms/private/BarcodeStatusIconContainer.js +1 -1
- package/build/js/ar/ui/atoms/private/CssArrows.js +1 -1
- package/build/js/ar/ui/organisms/BarcodeArInfoAnnotation.js +1 -1
- package/build/js/ar/ui/organisms/BarcodeArPopoverAnnotation.js +1 -1
- package/build/js/ar/ui/organisms/BarcodeArPopoverAnnotationButton.js +1 -1
- package/build/js/ar/ui/organisms/BarcodeArResponsiveAnnotation.js +1 -1
- package/build/js/ar/ui/organisms/BarcodeArStatusIconAnnotation.js +1 -1
- package/build/js/chunks/{chunk-UKOWYLLZ.js → chunk-3UGEG7WU.js} +1 -1
- package/build/js/chunks/{chunk-NAHMBS3A.js → chunk-42Y6V4GC.js} +1 -1
- package/build/js/chunks/chunk-47MOJIQ3.js +2 -0
- package/build/js/chunks/{chunk-ZF7YEGPW.js → chunk-4ID5S6I7.js} +1 -1
- package/build/js/chunks/{chunk-GT4V3BBH.js → chunk-5URXITXR.js} +1 -1
- package/build/js/chunks/{chunk-ZI75KHWU.js → chunk-6BZ6LQZN.js} +1 -1
- package/build/js/chunks/{chunk-ISEAB7YQ.js → chunk-6OJJXHYF.js} +1 -1
- package/build/js/chunks/{chunk-ZQ3QRLEZ.js → chunk-6UIDWTVF.js} +1 -1
- package/build/js/chunks/{chunk-7MDNYMWU.js → chunk-74HYYKNV.js} +1 -1
- package/build/js/chunks/chunk-AIFHDZKW.js +1 -0
- package/build/js/chunks/{chunk-DGF7ODRH.js → chunk-B5IOSUX4.js} +1 -1
- package/build/js/chunks/{chunk-YZS4FYM4.js → chunk-DBBTZTKB.js} +1 -1
- package/build/js/chunks/{chunk-C3BYC73L.js → chunk-EUPONI3T.js} +1 -1
- package/build/js/chunks/{chunk-MAA4EROF.js → chunk-EWLALL5J.js} +1 -1
- package/build/js/chunks/chunk-F7NAOKPF.js +1 -0
- package/build/js/chunks/chunk-HFXWQGKV.js +6 -0
- package/build/js/chunks/{chunk-D66HVQKO.js → chunk-HMU4GQFX.js} +1 -1
- package/build/js/chunks/{chunk-EW4BAEBZ.js → chunk-IER6LQYW.js} +1 -1
- package/build/js/chunks/{chunk-6BIERYLN.js → chunk-IHFZ5YLD.js} +1 -1
- package/build/js/chunks/{chunk-NW3BYZWA.js → chunk-IHZC5SW5.js} +1 -1
- package/build/js/chunks/{chunk-WYDK7FDG.js → chunk-IKMOZCI6.js} +1 -1
- package/build/js/chunks/{chunk-I3E2HP2L.js → chunk-JZLJVB6X.js} +1 -1
- package/build/js/chunks/{chunk-UZD5DJXU.js → chunk-LBKCNRLC.js} +1 -1
- package/build/js/chunks/{chunk-WXR7X3J5.js → chunk-LGBIU7XO.js} +1 -1
- package/build/js/chunks/{chunk-Q7LPEF5X.js → chunk-LP2XGGSB.js} +1 -1
- package/build/js/chunks/{chunk-O6JPGVIL.js → chunk-LR6JSIOR.js} +1 -1
- package/build/js/chunks/{chunk-FRFBKO7R.js → chunk-N6QWL4ZH.js} +2 -2
- package/build/js/chunks/{chunk-2A2DLPAB.js → chunk-OIFWCYQI.js} +1 -1
- package/build/js/chunks/chunk-OLJXVUYE.js +1 -0
- package/build/js/chunks/{chunk-XTOFHCOV.js → chunk-PKI34F7X.js} +1 -1
- package/build/js/chunks/{chunk-5CKMOWBK.js → chunk-QCO6TK2S.js} +1 -1
- package/build/js/chunks/{chunk-BZWA4BPU.js → chunk-QZGFNS2K.js} +1 -1
- package/build/js/chunks/{chunk-VU7W53X2.js → chunk-RLKGZ42F.js} +1 -1
- package/build/js/chunks/chunk-RXRQ4VLH.js +1 -0
- package/build/js/chunks/{chunk-K3NQKPWC.js → chunk-TFYQKG6K.js} +1 -1
- package/build/js/chunks/chunk-TGED2OQU.js +1 -0
- package/build/js/chunks/{chunk-LN6NHJTD.js → chunk-V633PC7B.js} +1 -1
- package/build/js/chunks/{chunk-VINHRCNE.js → chunk-VJ3VETQO.js} +1 -1
- package/build/js/chunks/{chunk-6WNR57VU.js → chunk-W6ENSHSF.js} +1 -1
- package/build/js/chunks/{chunk-P4F5WUAR.js → chunk-WICRT6CF.js} +1 -1
- package/build/js/chunks/{chunk-45M2WAHF.js → chunk-X3UPVJLZ.js} +1 -1
- package/build/js/chunks/{chunk-YWCXI7D5.js → chunk-XGY5EQR4.js} +1 -1
- package/build/js/chunks/{chunk-NE5ADP4U.js → chunk-YD2VGEB5.js} +1 -1
- package/build/js/chunks/{chunk-ACNWENKW.js → chunk-YWNGCXKZ.js} +1 -1
- package/build/js/chunks/{chunk-NKRL5HIU.js → chunk-ZXTRTKEZ.js} +1 -1
- package/build/js/find/BarcodeFind.js +1 -1
- package/build/js/find/BarcodeFindFeedback.js +1 -1
- package/build/js/find/BarcodeFindPresenter.js +1 -1
- package/build/js/find/BarcodeFindSettings.js +1 -1
- package/build/js/find/BarcodeFindView.js +1 -1
- package/build/js/find/index.js +1 -1
- package/build/js/find/ui/atoms/CardListButton.js +1 -1
- package/build/js/find/ui/molecules/CardListContainer.js +1 -1
- package/build/js/find/ui/molecules/ImageAndTextCardLayout.js +1 -1
- package/build/js/index.d.ts +1 -1
- package/build/js/index.js +1 -1
- package/build/js/moduleLoader.js +1 -1
- package/build/js/spark/SparkScan.js +1 -1
- package/build/js/spark/SparkScanBarcodeFeedback.js +1 -1
- package/build/js/spark/SparkScanOverlay.js +1 -1
- package/build/js/spark/SparkScanSettings.js +1 -1
- package/build/js/spark/SparkScanTargetAimerViewfinder.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/SparkScanViewFeedbackManager.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/SparkScanViewSettings.js +1 -1
- package/build/js/spark/ui/SparkScanViewTriggerButton.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_ocr_fallback_ocr_default.8c2870b758fd.model +0 -0
- package/sdc-lib/resources/models/barcode_ocr_fallback_ocr_detector_default.9e7b3e9f0b6c.model +0 -0
- package/sdc-lib/resources/models/id_ocr.1740d002ffbf.model +0 -0
- package/sdc-lib/resources/models/ocr_barcode_semantics_default.8c2870b758fd.model +0 -0
- package/sdc-lib/resources/models/ocr_mrz_default.8b80192212c2.model +0 -0
- package/sdc-lib/resources/models/ocr_price_label_default.1d18eb896da3.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-5HCHOM4R.js +0 -1
- package/build/js/chunks/chunk-DHCNYKSL.js +0 -1
- package/build/js/chunks/chunk-KICLFEZA.js +0 -1
- package/build/js/chunks/chunk-LAYALN2H.js +0 -1
- package/build/js/chunks/chunk-O2DTDLQ5.js +0 -2
- package/build/js/chunks/chunk-VS7IRHEK.js +0 -1
- package/build/js/chunks/chunk-VZNESTL2.js +0 -6
- package/sdc-lib/resources/models/barcode_ocr_fallback_ocr_default.4df1cd250f2d.model +0 -0
- package/sdc-lib/resources/models/barcode_ocr_fallback_ocr_detector_default.d02cb8506d3f.model +0 -0
- package/sdc-lib/resources/models/id_ocr.f42a207632c0.model +0 -0
- package/sdc-lib/resources/models/ocr_barcode_semantics_default.f48356d94444.model +0 -0
- package/sdc-lib/resources/models/ocr_mrz_default.050ddaa9b833.model +0 -0
- package/sdc-lib/resources/models/ocr_price_label_default.ff089db78a2c.model +0 -0
- /package/build/js/chunks/{chunk-IRAW536A.js → chunk-IDFWBXDZ.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-YWNGCXKZ.js';import {TorchState,Camera,FrameSourceState}from'@scandit/web-datacapture-core';var h=(t=>(t.Started="started",t.Paused="paused",t.Stopped="stopped",t))(h||{}),c=class{constructor(e,i,t,s,o){this.viewState="paused";this.barcodeFindViewUiListener=null;this.torchState=TorchState.Off;this.sessionState=null;this.barcodeFindView=e,this.barcodeFind=t,this.context=i,this.viewSettings=s,this.cameraSettings=o,t.feedback=a.createWithOptions(this.viewSettings.soundEnabled,this.viewSettings.hapticEnabled);}async prepare(){await this.barcodeFind.setEnabled(false),this.barcodeFind.addPrivateListener(this);let e=Camera.default;await this.context.setFrameSource(e),await this.context.frameSource.applySettings(this.cameraSettings),this.isTorchAvailable=await e.isTorchAvailable();}async dispose(){await this.context.removeMode(this.barcodeFind),this.barcodeFind.removePrivateListener(this);}async didPauseSearch(e){this.barcodeFindView.switchToPaused(Object.values(this.customerItemsListState),e);}async didStartSearch(){this.barcodeFindView.switchToStarted();}async didStopSearch(e){var i;(i=this.barcodeFindViewUiListener)==null||i.didTapFinishButton(e);}async onSetItemList(e){this.customerItemsListState=e.reduce((i,t)=>(i[t.searchOptions.barcodeData]=t,i),{}),this.barcodeFind.feedback.itemListUpdated.emit(),this.barcodeFindView.updateProgressBar(0,Object.values(this.customerItemsListState).length);}onDidUpdateSession(e,i,t){this.sessionState=i,this.barcodeFindView.updateProgressBar(this.sessionState.allFoundItems.length),this.barcodeFindView.renderDots(this.sessionState);}async onShutterButtonClicked(){this.viewState==="paused"||this.viewState==="stopped"?await this.startSearching():await this.pauseSearching();}async onTorchButtonClicked(){this.isTorchAvailable&&(await this.context.frameSource.setDesiredTorchState(this.torchState===TorchState.Off?TorchState.On:TorchState.Off),this.torchState=this.torchState===TorchState.Off?TorchState.On:TorchState.Off,this.barcodeFindView.toggleTorchIcon(this.torchState));}onDotClick(e){var t,s;let i=(t=this.sessionState)==null?void 0:t.trackedBarcodes[e];if(i!=null){let o=this.customerItemsListState[(s=i.barcode.data)!=null?s:""];this.barcodeFindView.moveCardOnTheFront(o);}}onFinishButtonClicked(){this.stopSearching();}onFindListUpdatedFeedback(){this.barcodeFind.feedback.itemListUpdated.emit();}onFeedback(){this.barcodeFind.feedback.found.emit(),this.barcodeFindView.setShutterButtonPulse(true);}async pauseSearching(){var e;this.viewState="paused",await((e=this.context.frameSource)==null?void 0:e.switchToDesiredState(FrameSourceState.Standby)),await this.barcodeFind.setEnabled(false),await this.barcodeFind.pause(),this.barcodeFindView.setShutterButtonPulse(false);}async startSearching(){var e;this.viewState="started",await((e=this.context.frameSource)==null?void 0:e.switchToDesiredState(FrameSourceState.On)),await this.barcodeFind.setEnabled(true),await this.barcodeFind.start();}async stopSearching(){var e;this.viewState="stopped",await this.barcodeFind.setEnabled(false),await((e=this.context.frameSource)==null?void 0:e.switchToDesiredState(FrameSourceState.Off)),await this.barcodeFind.stop(),this.barcodeFindView.setShutterButtonPulse(false),this.sessionState=null;}};export{h as a,c as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$
|
|
1
|
+
import {a as a$3}from'./chunk-7O2NHA3I.js';import {a as a$2}from'./chunk-LTNZJEG4.js';import {a as a$4}from'./chunk-4QSEBPWB.js';import {a as a$1}from'./chunk-2ZSOWJ2F.js';import {a}from'./chunk-WVIC3JWX.js';import {a as a$5}from'./chunk-TGED2OQU.js';import {DataCaptureEngine}from'@scandit/web-datacapture-core/build/js/worker/index.js';var c=class extends DataCaptureEngine{constructor(e,r){super(e,r);}getModeDeserializers(){this.barcodeCaptureMode=new a(this,this.Module,this.workerFunctions),this.barcodeBatchMode=new a$1(this,this.Module,this.workerFunctions),this.sparkScanMode=new a$2(this,this.Module,this.workerFunctions),this.barcodeFindMode=new a$3(this,this.Module,this.workerFunctions),this.barcodeArMode=new a$4(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,r){return r?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,r){return r?e?"617dc3a59433872908215e72b4f95cd68f31808ff8b4b117556308eb03e9f176":"b889ecb27c387ee929936f533d8662b2868418c4cd2087b17c4ba3140558c10f":e?"3576c62ac18c6b18183f1650f1e0a1b4430933ca1071454d00ed6dbd5ad72af0":"56cd79de1860a2c56234933a9d823c54ddfb17004a478f54811e747d9c8dd954"}getWasmMetadata(){return a$5}};export{c as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-WPSMXGDG.js';import {a as a$1}from'./chunk-OLFIL5XY.js';import {b}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-WPSMXGDG.js';import {a as a$1}from'./chunk-OLFIL5XY.js';import {b}from'./chunk-OLJXVUYE.js';import {CameraSettings,convertToPublicFrameData,Logger}from'@scandit/web-datacapture-core';var p=class u{constructor(){this.type="barcodeCapture";this._isEnabled=true;this._feedback=a.default;this._context=null;this.listeners=new Set;this.allowedRemainingWorkerMessages=new Set;this.workerMessageListener=this.onWorkerMessage.bind(this);}static get recommendedCameraSettings(){return new CameraSettings(b.BarcodeCapture.RecommendedCameraSettings)}get context(){return this._context}get feedback(){return this._feedback}static async forContext(e,a){let t=new u;return t.settings=a,e&&await e.setMode(t),t}async setFeedback(e){return this._feedback=e,this.notifyContext()}isEnabled(){return this._isEnabled}async setEnabled(e){this._isEnabled=e,await this.notifyContext();}async applySettings(e){return this.settings=e,this.notifyContext()}addListener(e){this.listeners.has(e)||this.listeners.add(e);}removeListener(e){this.listeners.delete(e);}toJSONObject(){return {type:this.type,enabled:this._isEnabled,feedback:this.feedback.toJSONObject(),settings:this.settings.toJSONObject()}}attachedToContext(e){this._context=e,this._context.subscribeToWorkerMessages(this.workerMessageListener);}async detachedFromContext(){var e;(e=this._context)==null||e.unsubscribeToWorkerMessages(this.workerMessageListener),this._context=null;}sendClearFrameDataRequest(e){setTimeout(()=>{var a;(a=this.context)==null||a.workerCommand("deleteFrameData",{frameId:e});},0);}async onDidScan(e){if(this.context==null)return;let a=a$1.fromJSON(e.payload.session),{frameData:t}=e.payload;if(!this._isEnabled){this.sendClearFrameDataRequest(t.frameId),this.allowedRemainingWorkerMessages.clear();return}this.allowedRemainingWorkerMessages.add("successFeedback");let o=[];for(let r of this.listeners)if(r.didScan)try{let s=r.didScan(this,a,convertToPublicFrameData(t,this.context));s instanceof Promise&&await s;}catch(s){o.push(s);}this.sendClearFrameDataRequest(t.frameId),this.allowedRemainingWorkerMessages.add("barcodeCaptureDidUpdateSession");for(let r of o)Logger.log(Logger.Level.Error,r);}onDidUpdateSession(e){let a=a$1.fromJSON(e.payload);if(!(!this._isEnabled&&!this.allowedRemainingWorkerMessages.has(e.type))){this.allowedRemainingWorkerMessages.delete(e.type);for(let t of this.listeners)t.didUpdateSession&&t.didUpdateSession(this,a);}}onSuccessFeedback(e){!this._isEnabled&&!this.allowedRemainingWorkerMessages.has(e.type)||(this.allowedRemainingWorkerMessages.delete(e.type),this.feedback.success.emit());}async onWorkerMessage(e){switch(e.type){case "barcodeCaptureDidScan":{this.onDidScan(e);break}case "barcodeCaptureDidUpdateSession":{this.onDidUpdateSession(e);break}case "successFeedback":{this.onSuccessFeedback(e);break}}}async notifyContext(){this.context!=null&&await this.context.update();}};export{p as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-DCUKY2F4.js';import {b}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-DCUKY2F4.js';import {b}from'./chunk-OLJXVUYE.js';import {PrivateNoneLocationSelection}from'@scandit/web-datacapture-core';var S=class{constructor(){this.codeDuplicateFilter=b.BarcodeCapture.BarcodeCaptureSettings.codeDuplicateFilter;this.locationSelection=null;this.enabledCompositeTypes=[];this.scanIntention="manual";this.properties={};this.symbologies={};this._arucoDictionary=null;}get enabledSymbologies(){return Object.keys(this.symbologies).filter(o=>{var e;return (e=this.symbologies[o])==null?void 0:e.isEnabled})}get compositeTypeDescriptions(){return b.CompositeTypeDescriptions.reduce((o,e)=>(o[e.types[0]]=e,o),{})}settingsForSymbology(o){if(!this.symbologies[o]){let e=b.SymbologySettings[o];e._symbology=o,this.symbologies[o]=e;}return this.symbologies[o]}setProperty(o,e){this.properties[o]=e;}getProperty(o){return this.properties[o]}enableSymbologies(o){for(let e of o)this.enableSymbology(e,true);}enableSymbology(o,e){this.settingsForSymbology(o).isEnabled=e,o==="aruco"&&(this._arucoDictionary=a.fromPreset("5X5_50"));}enableSymbologiesForCompositeTypes(o){for(let e of o)this.enableSymbologies(this.compositeTypeDescriptions[e].symbologies);}setArucoDictionary(o){this._arucoDictionary=o;}toJSONObject(){var e,i,r,n,s;let o={};return {codeDuplicateFilter:this.codeDuplicateFilter,enabledCompositeTypes:[...this.enabledCompositeTypes],locationSelection:(i=(e=this.locationSelection)==null?void 0:e.toJSONObject())!=null?i:PrivateNoneLocationSelection,properties:{...this.properties},symbologies:Object.keys(this.symbologies).reduce((c,l)=>{var a;let y=(a=this.symbologies[l])==null?void 0:a.toJSONObject();return y&&(c[l]=y),c},o),scanIntention:(r=this.scanIntention)!=null?r:null,arucoDictionary:(s=(n=this._arucoDictionary)==null?void 0:n.toJSONObject())!=null?s:null}}};export{S as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-OLJXVUYE.js';var i=class{constructor(){this.properties={};this.symbologies={};}get enabledSymbologies(){return Object.keys(this.symbologies).filter(e=>this.symbologies[e].isEnabled)}settingsForSymbology(e){if(!this.symbologies[e]){let o=b.SymbologySettings[e];o._symbology=e,this.symbologies[e]=o;}return this.symbologies[e]}setProperty(e,o){this.properties[e]=o;}getProperty(e){return this.properties[e]}enableSymbologies(e){for(let o of e)this.enableSymbology(o,true);}enableSymbology(e,o){this.settingsForSymbology(e).isEnabled=o;}toJSONObject(){return {properties:this.properties,symbologies:Object.keys(this.symbologies).reduce((e,o)=>(e[o]=this.symbologies[o].toJSONObject(),e),{})}}};export{i as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a as a$2}from'./chunk-XSJEGOGN.js';import {a as a$1}from'./chunk-YQNNEW67.js';import {a as a$
|
|
1
|
+
import {a as a$2}from'./chunk-XSJEGOGN.js';import {a as a$1}from'./chunk-YQNNEW67.js';import {a as a$6,b as b$3}from'./chunk-RWDAYBTQ.js';import {b}from'./chunk-5DP5VNWQ.js';import {a as a$5,b as b$2}from'./chunk-OPL5NVVM.js';import {g as g$2}from'./chunk-3A6GSH7S.js';import {g as g$1}from'./chunk-DVHTYKDX.js';import {a as a$3}from'./chunk-DOA2Q3CZ.js';import {j,i,f,a,g,n}from'./chunk-4JEIREAU.js';import {c,e,a as a$4,b as b$1}from'./chunk-YBD5JYCX.js';import {Point}from'@scandit/web-datacapture-core';import {ScanditHTMLElement,defineCustomElements,html,Timeout}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';var H=(i=>(i.ResizeButton="resizeButton",i.ZoomButton="zoomButton",i.TorchButton="torchButton",i.CloseButton="closeButton",i))(H||{}),I=1200,w=class w extends ScanditHTMLElement{constructor(){super(...arguments);this.resizeButtonTapListener=this.onResizeButtonTap.bind(this);this.zoomButtonTapListener=this.onZoomButtonTap.bind(this);this.torchButtonTapListener=this.onTorchButtonTap.bind(this);this.closeButtonTapListener=this.onCloseButtonTap.bind(this);this.pointerDownListener=this.onPointerDown.bind(this);this.longPressStartListener=this.onLongPressStart.bind(this);this.toolbarVisibilityChangeListener=this.onToolbarVisibilityChange.bind(this);this.longPressEndListener=this.onLongPressEnd.bind(this);this.dragEndListener=this.onDragEnd.bind(this);this.fadeOutAnimation=new Animation(new KeyframeEffect(this,[{opacity:1},{opacity:0}],{duration:500,fill:"both"}));this.replayFadeOutTimeout=null;this.longPressController=new b(this);}get visible(){return this.hasAttribute("visible")}set visible(t){this.toggleAttribute("visible",t);}get size(){return this.expanded?"expanded":"regular"}set size(t){var i;this.toggleAttribute("expanded",t==="expanded");let o=this.getNextTranslate();(i=this.dragController)==null||i.translateTo(o,false).then(async()=>{var n;return (n=this.dragController)==null?void 0:n.repositionIfOutOfBounds()});}get expanded(){return this.hasAttribute("expanded")}get[a](){var t;return Number((t=this.getAttribute(a))!=null?t:"1")}set[a](t){this.setAttribute(a,String(t));}get darkened(){return this.hasAttribute("darkened")}set darkened(t){this.toggleAttribute("darkened",t);}get orientation(){var t;return (t=this.getAttribute("orientation"))!=null?t:"portrait-primary"}set orientation(t){this.setAttribute("orientation",t);}get[g](){return this.hasAttribute(g)}set[g](t){this.toggleAttribute(g,t);}get[j](){return this.hasAttribute(j)}set[j](t){this.toggleAttribute(j,t);}get[i](){return this.hasAttribute(i)}set[i](t){this.toggleAttribute(i,t);}get[f](){return this.hasAttribute(f)}set[f](t){this.toggleAttribute(f,t);}get[n](){return this.hasAttribute(n)}set[n](t){this.toggleAttribute(n,t);}get cover(){return this.hasAttribute("cover")}set cover(t){this.toggleAttribute("cover",t);}get pressed(){return this.hasAttribute("pressed")}set pressed(t){this.toggleAttribute("pressed",t);}static create(){return defineCustomElements({[b$1]:w,[a$4]:a$3,[e]:a$2,[c]:a$1}),document.createElement(b$1)}repositionIfOutOfBounds(){var t;(t=this.dragController)==null||t.repositionIfOutOfBounds();}showToast(t,o,i){this.toast.show(t,o,i);}hideToast(){this.toast.hide();}zoomIn(){this.zoomButton&&(this[a]=2,this.zoomButton.textContent="2x",this.showToast("warning","2x zoom",1e3));}zoomOut(){this.zoomButton&&(this[a]=1,this.zoomButton.textContent="1x",this.showToast("info","1x zoom",1e3));}async fadeOut(){try{this.fadeOutAnimation.play(),await this.fadeOutAnimation.finished,this.visible=false;}catch(t){}}cancelFadeOut(){var t;(t=this.replayFadeOutTimeout)==null||t.stop(),this.fadeOutAnimation.cancel();}async rewindAnimation(){var t,o;(((t=this.replayFadeOutTimeout)==null?void 0:t.running)===true||this.fadeOutAnimation.playState!=="idle")&&(this.cancelFadeOut(),(o=this.replayFadeOutTimeout)==null||o.start());}translateTo(t){var o;(o=this.dragController)==null||o.translateTo(t,false);}render(){var t,o,i$1,n$1,a$1,l,b;this.innerHTML=html`
|
|
2
2
|
<spark-scan-view-toast></spark-scan-view-toast>
|
|
3
3
|
<div id="host"></div>
|
|
4
4
|
<div id="controls">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$4}from'./chunk-ZQ3QRLEZ.js';import {a as a$1}from'./chunk-C3BYC73L.js';import {a as a$2}from'./chunk-62I36ZHW.js';import {b}from'./chunk-WXR7X3J5.js';import {a as a$6}from'./chunk-RWDAYBTQ.js';import {a as a$5,c,e,f,g,h,i,j,k,b as b$1,d as d$2}from'./chunk-DVHTYKDX.js';import {n,j as j$1,i as i$1,d as d$1,c as c$1,k as k$1,l,m,f as f$1,b as b$2,e as e$1,g as g$1}from'./chunk-4JEIREAU.js';import {d}from'./chunk-YBD5JYCX.js';import {a as a$3}from'./chunk-YZS4FYM4.js';import {a}from'./chunk-P4F5WUAR.js';import {Point,CameraPosition,Color}from'@scandit/web-datacapture-core';import {OrientationObserver,orientationChangeEvent}from'@scandit/web-datacapture-core/build/js/private/OrientationObserver.js';import {ScanditHTMLElement,Timeout,defineCustomElements,css,clamp}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';var _=class v extends ScanditHTMLElement{constructor(){super(...arguments);this.targetModeButtonVisible=false;this.scanningBehaviorButtonVisible=false;this.torchControlVisible=true;this.zoomSwitchControlVisible=true;this.previewSizeControlVisible=true;this.barcodeFindButtonVisible=false;this.labelCaptureButtonVisible=false;this.cameraSwitchButtonVisible=false;this.previewCloseControlVisible=true;this.triggerButtonVisible=true;this.feedbackDelegate={getFeedbackForBarcode:()=>a.success()};this.torchButtonVisible=true;this.handModeButtonVisible=false;this.resizeObserver=null;this.onResizeHandler=this.onResize.bind(this);this.miniPreview=b.create();this.triggerButton=a$1.create();this.visualFeedback=a$2.create();this.miniPreviewTimeout=new Timeout(500,this.onMiniPreviewTimeoutFinished.bind(this));this.orientationObserver=new OrientationObserver;this.miniPreviewPointerUpListener=this.onMiniPreviewPointerUp.bind(this);this.miniPreviewPointerMoveListener=this.onMiniPreviewPointerMove.bind(this);this.miniPreviewButtonTapListener=this.onMiniPreviewButtonTap.bind(this);this.miniPreviewDragListener=this.onMiniPreviewDrag.bind(this);this.miniPreviewDragEndListener=this.onMiniPreviewDragEnd.bind(this);this.triggerButtonPointerDownListener=this.onTriggerButtonPointerDown.bind(this);this.triggerButtonTapListener=this.onTriggerButtonTap.bind(this);this.triggerButtonLongPressStartListener=this.onTriggerButtonLongPressStart.bind(this);this.triggerButtonLongPressEndListener=this.onTriggerButtonLongPressEnd.bind(this);this.triggerButtonDragListener=this.onTriggerButtonDrag.bind(this);this.toolbarButtonTapListener=this.onToolbarButtonTap.bind(this);this.clickOutsideListener=this.onClickOutside.bind(this);this.visibilityChangeListener=this.onVisibilityChange.bind(this);this.orientationChangeListener=this.onOrientationChange.bind(this);this.holdingToScan=false;}get _targetModeEnabledMessage(){var e;return (e=this.settings.toastSettings.targetModeEnabledMessage)!=null?e:"Aimer on"}get _targetModeDisabledMessage(){var e;return (e=this.settings.toastSettings.targetModeDisabledMessage)!=null?e:"Aimer off"}get _continuousModeEnabledMessage(){var e;return (e=this.settings.toastSettings.continuousModeEnabledMessage)!=null?e:"Continuous mode on"}get _continuousModeDisabledMessage(){var e;return (e=this.settings.toastSettings.continuousModeDisabledMessage)!=null?e:"Continuous mode off"}get _scanPausedMessage(){var e;return (e=this.settings.toastSettings.scanPausedMessage)!=null?e:"Scan paused"}get _torchEnabledMessage(){var e;return (e=this.settings.toastSettings.torchEnabledMessage)!=null?e:"Torch on"}get _torchDisabledMessage(){var e;return (e=this.settings.toastSettings.torchDisabledMessage)!=null?e:"Torch off"}get _zoomedInMessage(){var e;return (e=this.settings.toastSettings.zoomedInMessage)!=null?e:"2x zoom"}get _zoomedOutMessage(){var e;return (e=this.settings.toastSettings.zoomedOutMessage)!=null?e:"1x zoom"}static forElement(e,r,t,i){let n=v.create();return n.presenter=a$3.forView(n,r,t,i!=null?i:new a$4),n.settings=n.presenter.sparkScanViewSettings,n.append(n.miniPreview,n.triggerButton,n.visualFeedback,v.createStyleElement().cloneNode(true)),n.hidden=true,e.append(n),n}static create(){return defineCustomElements({[d]:v}),document.createElement("spark-scan-view")}static createStyleElement(){return css`:root{${a$5}:#12161966;${c}:#12161966;${e}:#5b707f4d;${f}:#fff;${g}:#121619cc;${h}:#fbc02c;${i}:#fff;${j}:#2ec1ce;${k}:#fa4446}${d}{position:relative}`}async prepareScanning(){this.mount(),this.hidden=false,await this.presenter.prepareScanning(this.miniPreview.host);}async startScanning(){await this.presenter.startScanning();}async pauseScanning(){await this.presenter.pauseScanning();}async stopScanning(){await this.presenter.stopScanning({sessionStopReason:"user"});}showToast(e){this.miniPreview.showToast("info",e,1e3);}setListener(e){this.presenter.setListener(e);}setTriggerButtonImage(e){this.triggerButton.setImage(e);}setWidthAndHeightCssStyleProperties(){var t,i;let e=((t=this.parentElement)==null?void 0:t.clientWidth)||document.body.clientWidth,r=((i=this.parentElement)==null?void 0:i.clientHeight)||document.body.clientHeight;this.style.setProperty("--dvw",`${e}px`),this.style.setProperty("--dvh",`${r}px`),this.style.setProperty("--dvw-half","calc(var(--dvw) / 2)"),this.style.setProperty("--dvh-half","calc(var(--dvh) / 2)");}onResize(){this.setWidthAndHeightCssStyleProperties(),this.triggerButton.repositionIfOutOfBounds(),this.miniPreview.repositionIfOutOfBounds();}mount(){this.unmount(),this.resizeObserver=new ResizeObserver(this.onResizeHandler),this.resizeObserver.observe(this.parentElement),this.miniPreview[n]=this.previewCloseControlVisible,this.miniPreview[j$1]=this.previewSizeControlVisible,this.miniPreview[i$1]=this.zoomSwitchControlVisible,this.miniPreview.size=this.settings.defaultMiniPreviewSize,this.miniPreview.toolbar&&(this.miniPreview.toolbar[d$1]=this.targetModeButtonVisible,this.miniPreview.toolbar[c$1]=this.scanningBehaviorButtonVisible,this.miniPreview.toolbar[k$1]=this.barcodeFindButtonVisible,this.miniPreview.toolbar[l]=this.labelCaptureButtonVisible,this.miniPreview.toolbar[m]=this.cameraSwitchButtonVisible),this.triggerButton.visible=this.triggerButtonVisible;for(let[e$1,r]of [[this.triggerButtonCollapsedColor,a$5],[this.triggerButtonExpandedColor,c],[this.triggerButtonAnimationColor,e],[this.triggerButtonTintColor,f],[this.toolbarBackgroundColor,g],[this.toolbarIconActiveTintColor,h],[this.toolbarIconInactiveTintColor,i]])e$1&&this.style.setProperty(r,`#${e$1.toJSON()}`);this.setTriggerButtonPressedColor("triggerButtonCollapsedColor",a$5,b$1),this.setTriggerButtonPressedColor("triggerButtonExpandedColor",c,d$2),this.miniPreview.addEventListener("pointerup",this.miniPreviewPointerUpListener),this.miniPreview.addEventListener("pointermove",this.miniPreviewPointerMoveListener),this.miniPreview.addEventListener("minipreviewbuttontap",this.miniPreviewButtonTapListener),this.miniPreview.addEventListener("toolbarbuttontap",this.toolbarButtonTapListener),this.miniPreview.addEventListener("drag",this.miniPreviewDragListener),this.miniPreview.addEventListener("dragend",this.miniPreviewDragEndListener),this.triggerButton.addEventListener("pointerdown",this.triggerButtonPointerDownListener),this.triggerButton.addEventListener("tap",this.triggerButtonTapListener),this.triggerButton.addEventListener("longpressstart",this.triggerButtonLongPressStartListener),this.triggerButton.addEventListener("longpressend",this.triggerButtonLongPressEndListener),this.triggerButton.addEventListener("drag",this.triggerButtonDragListener),this.orientationObserver.register(),this.orientationObserver.addEventListener(orientationChangeEvent,this.orientationChangeListener),this.orientationObserver.dispatchOrientationChangeEvent(this.orientationObserver.orientation),document.addEventListener("pointerup",this.clickOutsideListener),document.addEventListener("visibilitychange",this.visibilityChangeListener),this.setWidthAndHeightCssStyleProperties();}unmount(){var e;(e=this.resizeObserver)==null||e.disconnect(),this.miniPreview.removeEventListener("pointerup",this.miniPreviewPointerUpListener),this.miniPreview.removeEventListener("pointermove",this.miniPreviewPointerMoveListener),this.miniPreview.removeEventListener("minipreviewbuttontap",this.miniPreviewButtonTapListener),this.miniPreview.removeEventListener("toolbarbuttontap",this.toolbarButtonTapListener),this.miniPreview.removeEventListener("drag",this.miniPreviewDragListener),this.miniPreview.removeEventListener("dragend",this.miniPreviewDragEndListener),this.triggerButton.removeEventListener("pointerdown",this.triggerButtonPointerDownListener),this.triggerButton.removeEventListener("tap",this.triggerButtonTapListener),this.triggerButton.removeEventListener("holdstart",this.triggerButtonLongPressStartListener),this.triggerButton.removeEventListener("holdend",this.triggerButtonLongPressEndListener),this.triggerButton.removeEventListener("drag",this.triggerButtonDragListener),this.orientationObserver.unregister(),this.orientationObserver.removeEventListener(orientationChangeEvent,this.orientationChangeListener),document.removeEventListener("pointerup",this.clickOutsideListener),document.removeEventListener("visibilitychange",this.visibilityChangeListener),this.miniPreviewTimeout.stop();}connectedCallback(){this.mount();}disconnectedCallback(){this.unmount();}setTorchAvailable(e){this.miniPreview.toolbar&&(this.miniPreview[f$1]=this.torchControlVisible&&e);}setZoomAvailable(e){this.miniPreview[i$1]=this.zoomSwitchControlVisible&&e;}switchToIdleState(){this.miniPreview.darkened=false,this.miniPreview.visible=false,this.miniPreview.hideToast(),this.triggerButton.expanded=false,this.triggerButton.stopPulsating();}async switchToActiveState(e,r,t,i){this.miniPreviewTimeout.stop(),this.miniPreview.hideToast(),this.miniPreview.cancelFadeOut(),this.miniPreview.darkened=false,this.miniPreview.visible=true,this.triggerButton.expanded=true,this.triggerButton.startPulsating(),this.miniPreview.toolbar&&(this.miniPreview.toolbar[b$2]=r),e&&(t&&this.style.setProperty(j,`#${t.toJSON()}`),await this.visualFeedback.emitSuccessFeedback()),i===true&&this.miniPreview.showToast("warning",this._zoomedInMessage,1e3);}async switchToInactiveState(e,r,t,i){this.miniPreview.darkened=t==="persistent"||e,this.miniPreview.visible=t==="persistent"||e,this.triggerButton.expanded=true,this.triggerButton.stopPulsating(),this.miniPreview.toolbar&&(this.miniPreview.toolbar[b$2]=r),e&&(i&&this.style.setProperty(j,`#${i.toJSON()}`),await this.visualFeedback.emitSuccessFeedback(),t==="default"&&this.miniPreviewTimeout.start()),t==="persistent"&&this.miniPreview.showToast("warning",this._scanPausedMessage,Number.POSITIVE_INFINITY);}async switchToErrorState(e,r){e.resumeCapturingDelay>0&&(this.triggerButton.stopPulsating(),this.miniPreview.showToast("error",e.message,e.resumeCapturingDelay)),r&&(this.style.setProperty(k,`#${e.visualFeedbackColor.toJSON()}`),await this.visualFeedback.emitErrorFeedback());}async onMiniPreviewPointerUp(){await this.presenter.onMiniPreviewPointerUp();}onMiniPreviewPointerMove(){this.presenter.onMiniPreviewPointerMove();}async onMiniPreviewButtonTap(e){switch(e.detail.tapped){case "torchButton":{await this.presenter.onTorchButtonTap(e.detail.enabled);break}case "closeButton":{await this.presenter.onMiniPreviewCloseButtonTap();break}case "resizeButton":{this.presenter.onMiniPreviewResizeButtonTap();break}case "zoomButton":{await this.presenter.onMiniPreviewZoomButtonTap(e.detail.zoomFactor);break}}this.miniPreviewTimeout.running&&this.miniPreviewTimeout.start();}async onMiniPreviewDrag(e){e instanceof a$6&&await this.presenter.onMiniPreviewDrag(e.point,this.orientationObserver.orientation.type);}async onMiniPreviewDragEnd(e){e instanceof a$6&&await this.presenter.onMiniPreviewDragEnd();}async onTriggerButtonPointerDown(){await this.presenter.onTriggerButtonPointerDown();}async onTriggerButtonTap(){await this.presenter.onTriggerButtonTap();}async onTriggerButtonLongPressStart(){this.holdingToScan||(this.holdingToScan=true,await this.presenter.onTriggerButtonLongPressStart());}async onTriggerButtonLongPressEnd(){this.holdingToScan&&(this.holdingToScan=false,await this.presenter.onTriggerButtonLongPressEnd());}onTriggerButtonDrag(e){e instanceof a$6&&this.presenter.onTriggerButtonDrag(e.point,this.orientationObserver.orientation.type);}async onToolbarButtonTap(e){switch(this.miniPreview.rewindAnimation(),e.detail.tapped){case "targetModeButton":{await this.onTargetModeButtonTap(e);return}case "scanningBehaviorButton":{await this.onScanningBehaviorButtonTap(e);return}case "barcodeFindButton":{await this.onBarcodeFindButtonTap();return}case "labelCaptureButton":{await this.onLabelCaptureButtonTap();return}case "cameraSwitchButton":await this.onCameraSwitchButtonTap();}}async onClickOutside(e){e.composedPath().includes(this)||await this.presenter.onClickOutside();}async onVisibilityChange(){document.visibilityState==="hidden"&&await this.presenter.onVisibilityChange();}async onTargetModeButtonTap(e){await this.presenter.onTargetModeButtonTap(e.detail.enabled);}async onScanningBehaviorButtonTap(e){await this.presenter.onScanningBehaviorButtonTap(e.detail.enabled);}async onBarcodeFindButtonTap(){await this.presenter.onBarcodeFindButtonTap();}async onLabelCaptureButtonTap(){await this.presenter.onLabelCaptureButtonTap();}async onCameraSwitchButtonTap(){this.miniPreview[f$1]=false,await this.presenter.onCameraSwitchButtonTap();}async onTorchButtonTap(e){await this.presenter.onTorchButtonTap(e.detail.enabled);}async onMiniPreviewTimeoutFinished(){await this.miniPreview.fadeOut();}async onOrientationChange(e){this.setWidthAndHeightCssStyleProperties(),this.miniPreview.orientation=e.detail.type;let r,t,i,n;switch(e.detail.type){case "landscape-primary":case "landscape-secondary":{r=this.presenter.landscapeOrientationTriggerButtonTranslateX,t=this.presenter.landscapeOrientationTriggerButtonTranslateY,i=this.presenter.landscapeOrientationMiniPreviewTranslateX,n=this.presenter.landscapeOrientationMiniPreviewTranslateY;break}case "portrait-primary":case "portrait-secondary":{r=this.presenter.portraitOrientationTriggerButtonTranslateX,t=this.presenter.portraitOrientationTriggerButtonTranslateY,i=this.presenter.portraitOrientationMiniPreviewTranslateX,n=this.presenter.portraitOrientationMiniPreviewTranslateY;break}}this.triggerButton.translateTo(new Point(r,t)),this.miniPreview.translateTo(new Point(i,n)),await this.presenter.onOrientationChange();}targetModeButtonTapped(e,r=true){if(r){let t=e?"warning":"info",i=e?this._targetModeEnabledMessage:this._targetModeDisabledMessage;this.miniPreview.showToast(t,i,1e3);}this.miniPreview.toolbar&&(this.miniPreview.toolbar[e$1]=e),this.miniPreviewTimeout.running&&this.miniPreviewTimeout.start();}scanningBehaviorButtonTapped(e,r=true){if(r){let t=e?"warning":"info",i=e?this._continuousModeEnabledMessage:this._continuousModeDisabledMessage;this.miniPreview.showToast(t,i,1e3);}this.miniPreview.toolbar&&(this.miniPreview.toolbar[b$2]=e?"continuous":"single"),this.miniPreviewTimeout.running&&this.miniPreviewTimeout.start();}torchButtonTapped(e,r=true){if(r){let t=e?"warning":"info",i=e?this._torchEnabledMessage:this._torchDisabledMessage;this.miniPreview.showToast(t,i,1e3);}this.miniPreview.toolbar&&(this.miniPreview[g$1]=e),this.miniPreviewTimeout.running&&this.miniPreviewTimeout.start();}cameraSwitchButtonTapped(e,r){var t;this.miniPreview[f$1]=this.torchControlVisible&&e,(t=this.miniPreview.toolbar)==null||t.enableCameraSwitchButton(r===CameraPosition.UserFacing);}getDefaultCssVariableValue(e){return window.getComputedStyle(this).getPropertyValue(e)}setTriggerButtonPressedColor(e,r,t){var B;let i=(B=this[e])!=null?B:Color.fromHex(this.getDefaultCssVariableValue(r)),n=clamp(i.alpha+i.alpha*.25,i.alpha,255),U=i.withAlpha(n);this.style.setProperty(t,`#${U.toJSON()}`);}};export{_ as a};
|
|
1
|
+
import {a as a$4}from'./chunk-6UIDWTVF.js';import {a as a$1}from'./chunk-EUPONI3T.js';import {a as a$2}from'./chunk-62I36ZHW.js';import {b}from'./chunk-LGBIU7XO.js';import {a as a$6}from'./chunk-RWDAYBTQ.js';import {a as a$5,c,e,f,g,h,i,j,k,b as b$1,d as d$2}from'./chunk-DVHTYKDX.js';import {n,j as j$1,i as i$1,d as d$1,c as c$1,k as k$1,l,m,f as f$1,b as b$2,e as e$1,g as g$1}from'./chunk-4JEIREAU.js';import {d}from'./chunk-YBD5JYCX.js';import {a as a$3}from'./chunk-DBBTZTKB.js';import {a}from'./chunk-WICRT6CF.js';import {Point,CameraPosition,Color}from'@scandit/web-datacapture-core';import {OrientationObserver,orientationChangeEvent}from'@scandit/web-datacapture-core/build/js/private/OrientationObserver.js';import {ScanditHTMLElement,Timeout,defineCustomElements,css,clamp}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';var _=class v extends ScanditHTMLElement{constructor(){super(...arguments);this.targetModeButtonVisible=false;this.scanningBehaviorButtonVisible=false;this.torchControlVisible=true;this.zoomSwitchControlVisible=true;this.previewSizeControlVisible=true;this.barcodeFindButtonVisible=false;this.labelCaptureButtonVisible=false;this.cameraSwitchButtonVisible=false;this.previewCloseControlVisible=true;this.triggerButtonVisible=true;this.feedbackDelegate={getFeedbackForBarcode:()=>a.success()};this.torchButtonVisible=true;this.handModeButtonVisible=false;this.resizeObserver=null;this.onResizeHandler=this.onResize.bind(this);this.miniPreview=b.create();this.triggerButton=a$1.create();this.visualFeedback=a$2.create();this.miniPreviewTimeout=new Timeout(500,this.onMiniPreviewTimeoutFinished.bind(this));this.orientationObserver=new OrientationObserver;this.miniPreviewPointerUpListener=this.onMiniPreviewPointerUp.bind(this);this.miniPreviewPointerMoveListener=this.onMiniPreviewPointerMove.bind(this);this.miniPreviewButtonTapListener=this.onMiniPreviewButtonTap.bind(this);this.miniPreviewDragListener=this.onMiniPreviewDrag.bind(this);this.miniPreviewDragEndListener=this.onMiniPreviewDragEnd.bind(this);this.triggerButtonPointerDownListener=this.onTriggerButtonPointerDown.bind(this);this.triggerButtonTapListener=this.onTriggerButtonTap.bind(this);this.triggerButtonLongPressStartListener=this.onTriggerButtonLongPressStart.bind(this);this.triggerButtonLongPressEndListener=this.onTriggerButtonLongPressEnd.bind(this);this.triggerButtonDragListener=this.onTriggerButtonDrag.bind(this);this.toolbarButtonTapListener=this.onToolbarButtonTap.bind(this);this.clickOutsideListener=this.onClickOutside.bind(this);this.visibilityChangeListener=this.onVisibilityChange.bind(this);this.orientationChangeListener=this.onOrientationChange.bind(this);this.holdingToScan=false;}get _targetModeEnabledMessage(){var e;return (e=this.settings.toastSettings.targetModeEnabledMessage)!=null?e:"Aimer on"}get _targetModeDisabledMessage(){var e;return (e=this.settings.toastSettings.targetModeDisabledMessage)!=null?e:"Aimer off"}get _continuousModeEnabledMessage(){var e;return (e=this.settings.toastSettings.continuousModeEnabledMessage)!=null?e:"Continuous mode on"}get _continuousModeDisabledMessage(){var e;return (e=this.settings.toastSettings.continuousModeDisabledMessage)!=null?e:"Continuous mode off"}get _scanPausedMessage(){var e;return (e=this.settings.toastSettings.scanPausedMessage)!=null?e:"Scan paused"}get _torchEnabledMessage(){var e;return (e=this.settings.toastSettings.torchEnabledMessage)!=null?e:"Torch on"}get _torchDisabledMessage(){var e;return (e=this.settings.toastSettings.torchDisabledMessage)!=null?e:"Torch off"}get _zoomedInMessage(){var e;return (e=this.settings.toastSettings.zoomedInMessage)!=null?e:"2x zoom"}get _zoomedOutMessage(){var e;return (e=this.settings.toastSettings.zoomedOutMessage)!=null?e:"1x zoom"}static forElement(e,r,t,i){let n=v.create();return n.presenter=a$3.forView(n,r,t,i!=null?i:new a$4),n.settings=n.presenter.sparkScanViewSettings,n.append(n.miniPreview,n.triggerButton,n.visualFeedback,v.createStyleElement().cloneNode(true)),n.hidden=true,e.append(n),n}static create(){return defineCustomElements({[d]:v}),document.createElement("spark-scan-view")}static createStyleElement(){return css`:root{${a$5}:#12161966;${c}:#12161966;${e}:#5b707f4d;${f}:#fff;${g}:#121619cc;${h}:#fbc02c;${i}:#fff;${j}:#2ec1ce;${k}:#fa4446}${d}{position:relative}`}async prepareScanning(){this.mount(),this.hidden=false,await this.presenter.prepareScanning(this.miniPreview.host);}async startScanning(){await this.presenter.startScanning();}async pauseScanning(){await this.presenter.pauseScanning();}async stopScanning(){await this.presenter.stopScanning({sessionStopReason:"user"});}showToast(e){this.miniPreview.showToast("info",e,1e3);}setListener(e){this.presenter.setListener(e);}setTriggerButtonImage(e){this.triggerButton.setImage(e);}setWidthAndHeightCssStyleProperties(){var t,i;let e=((t=this.parentElement)==null?void 0:t.clientWidth)||document.body.clientWidth,r=((i=this.parentElement)==null?void 0:i.clientHeight)||document.body.clientHeight;this.style.setProperty("--dvw",`${e}px`),this.style.setProperty("--dvh",`${r}px`),this.style.setProperty("--dvw-half","calc(var(--dvw) / 2)"),this.style.setProperty("--dvh-half","calc(var(--dvh) / 2)");}onResize(){this.setWidthAndHeightCssStyleProperties(),this.triggerButton.repositionIfOutOfBounds(),this.miniPreview.repositionIfOutOfBounds();}mount(){this.unmount(),this.resizeObserver=new ResizeObserver(this.onResizeHandler),this.resizeObserver.observe(this.parentElement),this.miniPreview[n]=this.previewCloseControlVisible,this.miniPreview[j$1]=this.previewSizeControlVisible,this.miniPreview[i$1]=this.zoomSwitchControlVisible,this.miniPreview.size=this.settings.defaultMiniPreviewSize,this.miniPreview.toolbar&&(this.miniPreview.toolbar[d$1]=this.targetModeButtonVisible,this.miniPreview.toolbar[c$1]=this.scanningBehaviorButtonVisible,this.miniPreview.toolbar[k$1]=this.barcodeFindButtonVisible,this.miniPreview.toolbar[l]=this.labelCaptureButtonVisible,this.miniPreview.toolbar[m]=this.cameraSwitchButtonVisible),this.triggerButton.visible=this.triggerButtonVisible;for(let[e$1,r]of [[this.triggerButtonCollapsedColor,a$5],[this.triggerButtonExpandedColor,c],[this.triggerButtonAnimationColor,e],[this.triggerButtonTintColor,f],[this.toolbarBackgroundColor,g],[this.toolbarIconActiveTintColor,h],[this.toolbarIconInactiveTintColor,i]])e$1&&this.style.setProperty(r,`#${e$1.toJSON()}`);this.setTriggerButtonPressedColor("triggerButtonCollapsedColor",a$5,b$1),this.setTriggerButtonPressedColor("triggerButtonExpandedColor",c,d$2),this.miniPreview.addEventListener("pointerup",this.miniPreviewPointerUpListener),this.miniPreview.addEventListener("pointermove",this.miniPreviewPointerMoveListener),this.miniPreview.addEventListener("minipreviewbuttontap",this.miniPreviewButtonTapListener),this.miniPreview.addEventListener("toolbarbuttontap",this.toolbarButtonTapListener),this.miniPreview.addEventListener("drag",this.miniPreviewDragListener),this.miniPreview.addEventListener("dragend",this.miniPreviewDragEndListener),this.triggerButton.addEventListener("pointerdown",this.triggerButtonPointerDownListener),this.triggerButton.addEventListener("tap",this.triggerButtonTapListener),this.triggerButton.addEventListener("longpressstart",this.triggerButtonLongPressStartListener),this.triggerButton.addEventListener("longpressend",this.triggerButtonLongPressEndListener),this.triggerButton.addEventListener("drag",this.triggerButtonDragListener),this.orientationObserver.register(),this.orientationObserver.addEventListener(orientationChangeEvent,this.orientationChangeListener),this.orientationObserver.dispatchOrientationChangeEvent(this.orientationObserver.orientation),document.addEventListener("pointerup",this.clickOutsideListener),document.addEventListener("visibilitychange",this.visibilityChangeListener),this.setWidthAndHeightCssStyleProperties();}unmount(){var e;(e=this.resizeObserver)==null||e.disconnect(),this.miniPreview.removeEventListener("pointerup",this.miniPreviewPointerUpListener),this.miniPreview.removeEventListener("pointermove",this.miniPreviewPointerMoveListener),this.miniPreview.removeEventListener("minipreviewbuttontap",this.miniPreviewButtonTapListener),this.miniPreview.removeEventListener("toolbarbuttontap",this.toolbarButtonTapListener),this.miniPreview.removeEventListener("drag",this.miniPreviewDragListener),this.miniPreview.removeEventListener("dragend",this.miniPreviewDragEndListener),this.triggerButton.removeEventListener("pointerdown",this.triggerButtonPointerDownListener),this.triggerButton.removeEventListener("tap",this.triggerButtonTapListener),this.triggerButton.removeEventListener("holdstart",this.triggerButtonLongPressStartListener),this.triggerButton.removeEventListener("holdend",this.triggerButtonLongPressEndListener),this.triggerButton.removeEventListener("drag",this.triggerButtonDragListener),this.orientationObserver.unregister(),this.orientationObserver.removeEventListener(orientationChangeEvent,this.orientationChangeListener),document.removeEventListener("pointerup",this.clickOutsideListener),document.removeEventListener("visibilitychange",this.visibilityChangeListener),this.miniPreviewTimeout.stop();}connectedCallback(){this.mount();}disconnectedCallback(){this.unmount();}setTorchAvailable(e){this.miniPreview.toolbar&&(this.miniPreview[f$1]=this.torchControlVisible&&e);}setZoomAvailable(e){this.miniPreview[i$1]=this.zoomSwitchControlVisible&&e;}switchToIdleState(){this.miniPreview.darkened=false,this.miniPreview.visible=false,this.miniPreview.hideToast(),this.triggerButton.expanded=false,this.triggerButton.stopPulsating();}async switchToActiveState(e,r,t,i){this.miniPreviewTimeout.stop(),this.miniPreview.hideToast(),this.miniPreview.cancelFadeOut(),this.miniPreview.darkened=false,this.miniPreview.visible=true,this.triggerButton.expanded=true,this.triggerButton.startPulsating(),this.miniPreview.toolbar&&(this.miniPreview.toolbar[b$2]=r),e&&(t&&this.style.setProperty(j,`#${t.toJSON()}`),await this.visualFeedback.emitSuccessFeedback()),i===true&&this.miniPreview.showToast("warning",this._zoomedInMessage,1e3);}async switchToInactiveState(e,r,t,i){this.miniPreview.darkened=t==="persistent"||e,this.miniPreview.visible=t==="persistent"||e,this.triggerButton.expanded=true,this.triggerButton.stopPulsating(),this.miniPreview.toolbar&&(this.miniPreview.toolbar[b$2]=r),e&&(i&&this.style.setProperty(j,`#${i.toJSON()}`),await this.visualFeedback.emitSuccessFeedback(),t==="default"&&this.miniPreviewTimeout.start()),t==="persistent"&&this.miniPreview.showToast("warning",this._scanPausedMessage,Number.POSITIVE_INFINITY);}async switchToErrorState(e,r){e.resumeCapturingDelay>0&&(this.triggerButton.stopPulsating(),this.miniPreview.showToast("error",e.message,e.resumeCapturingDelay)),r&&(this.style.setProperty(k,`#${e.visualFeedbackColor.toJSON()}`),await this.visualFeedback.emitErrorFeedback());}async onMiniPreviewPointerUp(){await this.presenter.onMiniPreviewPointerUp();}onMiniPreviewPointerMove(){this.presenter.onMiniPreviewPointerMove();}async onMiniPreviewButtonTap(e){switch(e.detail.tapped){case "torchButton":{await this.presenter.onTorchButtonTap(e.detail.enabled);break}case "closeButton":{await this.presenter.onMiniPreviewCloseButtonTap();break}case "resizeButton":{this.presenter.onMiniPreviewResizeButtonTap();break}case "zoomButton":{await this.presenter.onMiniPreviewZoomButtonTap(e.detail.zoomFactor);break}}this.miniPreviewTimeout.running&&this.miniPreviewTimeout.start();}async onMiniPreviewDrag(e){e instanceof a$6&&await this.presenter.onMiniPreviewDrag(e.point,this.orientationObserver.orientation.type);}async onMiniPreviewDragEnd(e){e instanceof a$6&&await this.presenter.onMiniPreviewDragEnd();}async onTriggerButtonPointerDown(){await this.presenter.onTriggerButtonPointerDown();}async onTriggerButtonTap(){await this.presenter.onTriggerButtonTap();}async onTriggerButtonLongPressStart(){this.holdingToScan||(this.holdingToScan=true,await this.presenter.onTriggerButtonLongPressStart());}async onTriggerButtonLongPressEnd(){this.holdingToScan&&(this.holdingToScan=false,await this.presenter.onTriggerButtonLongPressEnd());}onTriggerButtonDrag(e){e instanceof a$6&&this.presenter.onTriggerButtonDrag(e.point,this.orientationObserver.orientation.type);}async onToolbarButtonTap(e){switch(this.miniPreview.rewindAnimation(),e.detail.tapped){case "targetModeButton":{await this.onTargetModeButtonTap(e);return}case "scanningBehaviorButton":{await this.onScanningBehaviorButtonTap(e);return}case "barcodeFindButton":{await this.onBarcodeFindButtonTap();return}case "labelCaptureButton":{await this.onLabelCaptureButtonTap();return}case "cameraSwitchButton":await this.onCameraSwitchButtonTap();}}async onClickOutside(e){e.composedPath().includes(this)||await this.presenter.onClickOutside();}async onVisibilityChange(){document.visibilityState==="hidden"&&await this.presenter.onVisibilityChange();}async onTargetModeButtonTap(e){await this.presenter.onTargetModeButtonTap(e.detail.enabled);}async onScanningBehaviorButtonTap(e){await this.presenter.onScanningBehaviorButtonTap(e.detail.enabled);}async onBarcodeFindButtonTap(){await this.presenter.onBarcodeFindButtonTap();}async onLabelCaptureButtonTap(){await this.presenter.onLabelCaptureButtonTap();}async onCameraSwitchButtonTap(){this.miniPreview[f$1]=false,await this.presenter.onCameraSwitchButtonTap();}async onTorchButtonTap(e){await this.presenter.onTorchButtonTap(e.detail.enabled);}async onMiniPreviewTimeoutFinished(){await this.miniPreview.fadeOut();}async onOrientationChange(e){this.setWidthAndHeightCssStyleProperties(),this.miniPreview.orientation=e.detail.type;let r,t,i,n;switch(e.detail.type){case "landscape-primary":case "landscape-secondary":{r=this.presenter.landscapeOrientationTriggerButtonTranslateX,t=this.presenter.landscapeOrientationTriggerButtonTranslateY,i=this.presenter.landscapeOrientationMiniPreviewTranslateX,n=this.presenter.landscapeOrientationMiniPreviewTranslateY;break}case "portrait-primary":case "portrait-secondary":{r=this.presenter.portraitOrientationTriggerButtonTranslateX,t=this.presenter.portraitOrientationTriggerButtonTranslateY,i=this.presenter.portraitOrientationMiniPreviewTranslateX,n=this.presenter.portraitOrientationMiniPreviewTranslateY;break}}this.triggerButton.translateTo(new Point(r,t)),this.miniPreview.translateTo(new Point(i,n)),await this.presenter.onOrientationChange();}targetModeButtonTapped(e,r=true){if(r){let t=e?"warning":"info",i=e?this._targetModeEnabledMessage:this._targetModeDisabledMessage;this.miniPreview.showToast(t,i,1e3);}this.miniPreview.toolbar&&(this.miniPreview.toolbar[e$1]=e),this.miniPreviewTimeout.running&&this.miniPreviewTimeout.start();}scanningBehaviorButtonTapped(e,r=true){if(r){let t=e?"warning":"info",i=e?this._continuousModeEnabledMessage:this._continuousModeDisabledMessage;this.miniPreview.showToast(t,i,1e3);}this.miniPreview.toolbar&&(this.miniPreview.toolbar[b$2]=e?"continuous":"single"),this.miniPreviewTimeout.running&&this.miniPreviewTimeout.start();}torchButtonTapped(e,r=true){if(r){let t=e?"warning":"info",i=e?this._torchEnabledMessage:this._torchDisabledMessage;this.miniPreview.showToast(t,i,1e3);}this.miniPreview.toolbar&&(this.miniPreview[g$1]=e),this.miniPreviewTimeout.running&&this.miniPreviewTimeout.start();}cameraSwitchButtonTapped(e,r){var t;this.miniPreview[f$1]=this.torchControlVisible&&e,(t=this.miniPreview.toolbar)==null||t.enableCameraSwitchButton(r===CameraPosition.UserFacing);}getDefaultCssVariableValue(e){return window.getComputedStyle(this).getPropertyValue(e)}setTriggerButtonPressedColor(e,r,t){var B;let i=(B=this[e])!=null?B:Color.fromHex(this.getDefaultCssVariableValue(r)),n=clamp(i.alpha+i.alpha*.25,i.alpha,255),U=i.withAlpha(n);this.style.setProperty(t,`#${U.toJSON()}`);}};export{_ as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {d,e as e$1,a,c,g,f,h,i,n,o,j,k,l,m}from'./chunk-
|
|
1
|
+
import {d,e as e$1,a,c,g,f,h,i,n,o,j,k,l,m}from'./chunk-HFXWQGKV.js';import {Color}from'@scandit/web-datacapture-core';import {defineCustomElements}from'@scandit/web-datacapture-core/build/js/private/utils/defineCustomElements.js';import {ScanditHTMLElement}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';var e=class e extends ScanditHTMLElement{constructor(){super();this._defaultBackgroundColor=Color.fromHex("#000000");this._defaultTextColor=Color.fromHex("#FFFFFF");let t=this.attachShadow({mode:"open"});t.innerHTML=d(),t.append(e$1()),this.containerElement=t.querySelector(a),this.textElement=t.querySelector(c);}static create(){return e.register(),document.createElement(e.tag)}static register(){defineCustomElements({[e.tag]:e});}set icon(t){g(this,t);}get icon(){return f(this)}get backgroundColor(){return h(this,this._defaultBackgroundColor)}set backgroundColor(t){i(this,t);}get text(){return n(this.textElement)}set text(t){o(this.textElement,t);}get textColor(){return j(this,this._defaultTextColor)}set textColor(t){k(this,t);}get textSize(){return l(this)}set textSize(t){m(this,t);}connectedCallback(){this.backgroundColor=this.backgroundColor,this.textColor=this.textColor;}};e.tag="scandit-barcode-ar-info-annotation-footer";var x=e;export{x as a};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {a as a$7}from'./chunk-5GGUCEGU.js';import {b as b$1}from'./chunk-
|
|
1
|
+
import {a as a$7}from'./chunk-5GGUCEGU.js';import {b as b$1}from'./chunk-EWLALL5J.js';import {a as a$6}from'./chunk-QCO6TK2S.js';import {a}from'./chunk-WRTJHOS5.js';import {b}from'./chunk-YJ42KEYE.js';import {a as a$8}from'./chunk-7J6MRLL2.js';import {a as a$2}from'./chunk-YH5IBNOK.js';import {a as a$4}from'./chunk-TFYQKG6K.js';import {a as a$5}from'./chunk-POONUNDO.js';import {b as b$2}from'./chunk-IHFZ5YLD.js';import {a as a$1}from'./chunk-JKO4EZPZ.js';import {a as a$3}from'./chunk-I53W7VSB.js';import {b as b$3}from'./chunk-OLJXVUYE.js';import {Anchor,Localization,DataCaptureView,Size,Point}from'@scandit/web-datacapture-core';import {ShutterButton}from'@scandit/web-datacapture-core/build/js/private/ui/atoms/ShutterButton.js';import {ScanditHTMLElement}from'@scandit/web-datacapture-core/build/js/private/utils/ScanditHTMLElement.js';import {defineCustomElements}from'@scandit/web-datacapture-core/build/js/private/utils/defineCustomElements.js';import {html}from'@scandit/web-datacapture-core/build/js/private/utils/html.js';import {Card}from'@scandit/web-datacapture-core/build/js/private/ui/atoms/Card.js';var d={FinishButton:a$2.tag,ShutterButton:ShutterButton.tag,ProgressBarWithLabel:a.tag,CardListContainer:b$1.tag,TorchIconButton:a$1.tag},c=class c extends ScanditHTMLElement{constructor(){super(...arguments);this.shouldShowCarousel=true;this.shouldShowPauseButton=true;this.shouldShowFinishButton=true;this.shouldShowProgressBar=true;this.shouldShowTorchControl=false;this.torchControlPosition=Anchor.TopLeft;this.textForItemListUpdatedWhenPausedHint=null;this.textForItemListUpdatedHint=null;this.textForTapShutterToResumeSearchHint=null;this.textForTapShutterToPauseScreenHint=null;this.textForMoveCloserToBarcodesHint=null;this.textForPointAtBarcodesToSearchHint=null;this.textForAllItemsFoundSuccessfullyHint=null;this.textForCollapseCardsButton=Localization.getInstance().get("barcode.find.view.textForCollapseCardsButton");this.barcodeFindViewUiListener=null;this.shutterButton=null;this.finishButton=null;this.progressBar=null;this.cardList=null;this.onShutterButtonClickedHandler=this.onShutterButtonClicked.bind(this);this.onFinishButtonClickedHandler=this.onFinishButtonClicked.bind(this);this.onTorchButtonClickedHandler=this.onTorchButtonClicked.bind(this);this.torchIconButton=null;this.onDotClickHandler=this.onDotClick.bind(this);}get camera(){return this.presenter.context.frameSource}static async createWithSettings(t,o,i,s,r){let e=document.createElement(c.tag);return e.barcodeFindViewSettings=s,e.layout=b.create(),e.layout.innerHTML=html`
|
|
2
2
|
<${a.tag} slot="progress" value="0" max="1" ${e.shouldShowProgressBar?"":"hidden"}></${a.tag}>
|
|
3
3
|
<${a$1.tag} slot="top-controls-left" ${e.shouldShowTorchControl?"":"hidden"}></${a$1.tag}>
|
|
4
4
|
<${b$1.tag} slot="card-list" hidden text-for-collapse-cards-button=${e.textForCollapseCardsButton}></${b$1.tag}>
|
|
5
5
|
<${ShutterButton.tag} slot="bottom-controls-center" variant="play" ${e.shouldShowPauseButton?"":"hidden"}></${ShutterButton.tag}>
|
|
6
6
|
<${a$2.tag} slot="bottom-controls-right" ${e.shouldShowFinishButton?"":"hidden"}></${a$2.tag}>
|
|
7
|
-
`,e.append(e.layout),a$3(t)?(e.dataCaptureView=t,t.htmlElement.prepend(e),await o.
|
|
7
|
+
`,e.append(e.layout),a$3(t)?(e.dataCaptureView=t,t.htmlElement.prepend(e),await o.setMode(i),await t.setContext(o)):(e.dataCaptureView=await DataCaptureView.forContext(o),e.dataCaptureView.connectToElement(t),t.prepend(e)),e.presenter=new b$2(e,o,i,s,r!=null?r:a$4.recommendedCameraSettings),await e.presenter.prepare(),e.barcodeFindBasicOverlay=await a$5.withBarcodeFind(i,e.dataCaptureView),e}static async create(t,o,i){return c.createWithSettings(t,o,i,b$3.BarcodeFind.BarcodeFindViewSettings.settings,a$4.recommendedCameraSettings)}static register(){defineCustomElements({[c.tag]:c});}async startSearching(){return this.onShutterButtonClickedHandler()}async stopSearching(){return this.presenter.stopSearching()}async pauseSearching(){return this.onShutterButtonClickedHandler()}setListener(t){this.barcodeFindViewUiListener=t,this.presenter.barcodeFindViewUiListener=this.barcodeFindViewUiListener;}async setShouldShowUserGuidanceView(t){return this.shouldShowUserGuidance=t,this.barcodeFindBasicOverlay.setUserGuidanceEnabled(this.shouldShowUserGuidance)}async setShouldShowHints(t){return this.shouldShowHints=t,this.barcodeFindBasicOverlay.setShouldShowHint(this.shouldShowHints)}setShouldShowCarousel(t){this.shouldShowCarousel=t,this.layout.toggleVisibility(d.CardListContainer,t);}setShouldShowPauseButton(t){this.shouldShowPauseButton=t,this.layout.toggleVisibility(d.ShutterButton,t);}setShouldShowFinishButton(t){this.shouldShowFinishButton=t,this.layout.toggleVisibility(d.FinishButton,t);}setShouldShowProgressBar(t){this.shouldShowProgressBar=t,this.layout.toggleVisibility(d.ProgressBarWithLabel,t);}setShouldShowTorchControl(t){this.shouldShowTorchControl=this.presenter.isTorchAvailable?t:false,this.layout.toggleVisibility(d.TorchIconButton,this.shouldShowTorchControl);}setTorchControlPosition(t){var i;this.torchControlPosition=t,[Anchor.TopCenter,Anchor.TopLeft,Anchor.TopRight,Anchor.BottomLeft].includes(t)||(this.torchControlPosition=Anchor.TopLeft);let o={[Anchor.TopCenter]:"top-controls-center",[Anchor.TopLeft]:"top-controls-left",[Anchor.TopRight]:"top-controls-right",[Anchor.BottomLeft]:"bottom-controls-left"}[this.torchControlPosition];(i=this.torchIconButton)==null||i.setAttribute("slot",o);}setTextForCollapseCardsButton(t){this.textForCollapseCardsButton=t,this.cardList!=null&&(this.cardList["text-for-collapse-cards-button"]=t);}async setTextForAllItemsFoundSuccessfullyHint(t){return this.textForAllItemsFoundSuccessfullyHint=t,this.barcodeFindBasicOverlay.setTextForAllItemsFoundSuccessfullyHint(this.textForAllItemsFoundSuccessfullyHint)}async setTextForPointAtBarcodesToSearchHint(t){return this.textForPointAtBarcodesToSearchHint=t,this.barcodeFindBasicOverlay.setTextForPointAtBarcodesToSearchHint(this.textForPointAtBarcodesToSearchHint)}async setTextForMoveCloserToBarcodesHint(t){return this.textForMoveCloserToBarcodesHint=t,this.barcodeFindBasicOverlay.setTextForPointAtBarcodesToSearchHint(this.textForMoveCloserToBarcodesHint)}async setTextForTapShutterToPauseScreenHint(t){return this.textForTapShutterToPauseScreenHint=t,this.barcodeFindBasicOverlay.setTextForPointAtBarcodesToSearchHint(this.textForTapShutterToPauseScreenHint)}async setTextForTapShutterToResumeSearchHint(t){return this.textForTapShutterToResumeSearchHint=t,this.barcodeFindBasicOverlay.setTextForTapShutterToResumeScreenHint(this.textForTapShutterToResumeSearchHint)}async setTextForItemListUpdatedWhenPausedHint(t){return this.textForItemListUpdatedWhenPausedHint=t,this.barcodeFindBasicOverlay.setTextForItemListUpdatedWhenPausedHint(this.textForItemListUpdatedWhenPausedHint)}async setTextForItemListUpdatedHint(t){return this.textForItemListUpdatedHint=t,this.barcodeFindBasicOverlay.setTextForItemListUpdatedWhenPausedHint(this.textForItemListUpdatedHint)}connectedCallback(){var t,o,i;this.shutterButton=this.layout.querySelector(d.ShutterButton),this.finishButton=this.layout.querySelector(d.FinishButton),this.progressBar=this.layout.querySelector(d.ProgressBarWithLabel),this.cardList=this.layout.querySelector(d.CardListContainer),this.torchIconButton=this.layout.querySelector(d.TorchIconButton),(t=this.torchIconButton)==null||t.addEventListener("pointerdown",this.onTorchButtonClickedHandler),(o=this.shutterButton)==null||o.addEventListener("pointerdown",this.onShutterButtonClickedHandler),(i=this.finishButton)==null||i.addEventListener("pointerdown",this.onFinishButtonClickedHandler),this.layout.addEventListener("onlayouttap",this.onDotClickHandler);}disconnectedCallback(){var t,o,i;(t=this.shutterButton)==null||t.removeEventListener("pointerdown",this.onShutterButtonClickedHandler),(o=this.torchIconButton)==null||o.addEventListener("pointerdown",this.onTorchButtonClickedHandler),(i=this.finishButton)==null||i.removeEventListener("pointerdown",this.onFinishButtonClickedHandler),this.layout.removeEventListener("onlayouttap",this.onDotClickHandler),this.presenter.dispose();}async onShutterButtonClicked(){this.presenter.onShutterButtonClicked();}async onTorchButtonClicked(){this.presenter.onTorchButtonClicked();}updateProgressBar(t,o){this.progressBar&&(this.progressBar.value!==t&&(this.progressBar.value=t),o!=null&&this.progressBar.max!==o&&(this.progressBar.max=o));}setShutterButtonPulse(t){this.shutterButton!=null&&(this.shutterButton.pulse=t);}switchToPaused(t,o){var s,r;let i=[];for(let e of t){let l=Card.create();l.id=`${String(e.uid)}`;let n=a$6.create();if(l.append(n),n.title=e.searchOptions.barcodeData,o.some(u=>u.searchOptions.barcodeData===e.searchOptions.barcodeData)){n.title=e.searchOptions.barcodeData;let u=a$7.create();u.slot="right",n.append(u);}i.push(l);}(s=this.cardList)==null||s.renderCards(i),(r=this.cardList)==null||r.removeAttribute("hidden"),this.shutterButton.variant="play",this.shutterButton.pulse=false,this.toggleDotPulse(false);}moveCardOnTheFront(t){var i,s;if(!t)return;let o=(i=this.cardList)==null?void 0:i.getCardBySelector(`${Card.tag}#${t.uid}`);o!=null&&((s=this.cardList)==null||s.unshiftCard(o));}switchToStarted(){var t;this.clearDots(),(t=this.cardList)==null||t.setAttribute("hidden",""),this.shutterButton.variant="pause";}toggleTorchIcon(t){this.torchIconButton&&(this.torchIconButton.state=t);}onFinishButtonClicked(){this.presenter.onFinishButtonClicked();}clearDots(){let t=this.layout.querySelectorAll("[data-identifier]");for(let o of t)o.remove();}toggleDotPulse(t){let o=[...this.layout.querySelectorAll("[data-identifier]")];for(let i of o)i.pulse=t;}pointTransformation(t){return `translate3d(calc(${t.x}px - 50%), calc(${t.y}px - 50%), 0px)`}onDotClick(t){let o=t.detail.target;if(o.dataset.identifier!=null){for(let i of this.layout.querySelectorAll(a$8.tag))i.pulse=false,o===i&&o.variant==="target"&&(o.pulse=true);this.presenter.onDotClick(o.dataset.identifier);}}renderDots(t){var o,i,s;for(let r of t.removedTrackedBarcodes){let e=this.layout.querySelector(`[data-identifier="${r}"]`);e==null||e.remove();}if(t.addedTrackedBarcodes.length>0){let r=document.createDocumentFragment();for(let e of t.addedTrackedBarcodes){let l=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(e.anchorPositions),n=a$8.createWithColors(this.barcodeFindViewSettings.inListItemColor,this.barcodeFindViewSettings.notInListItemColor);n.style.setProperty("position","absolute"),n.style.setProperty("transform",this.pointTransformation(l.center)),n.dataset.identifier=`${e.identifier}`,e.barcode.data!=null&&((o=t.foundTrackedBarcodesInLastProcessedFrame[`${e.identifier}`])==null?void 0:o.barcode.data)===e.barcode.data&&(n.setAttribute("variant","target"),n.pulse=true),r.append(n);}this.layout.append(r);}for(let r of t.updatedTrackedBarcodes){let e=this.layout.querySelector(`[data-identifier="${r.identifier}"]`),{center:l}=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(r.anchorPositions);if(e){let n=(s=(i=this.camera)==null?void 0:i.getMirrorImageEnabled())!=null?s:false,u=new Size(this.dataCaptureView.width,this.dataCaptureView.height);e.style.setProperty("position","absolute");let H=n?Point.mirrorX(l,u):l;e.style.setProperty("transform",this.pointTransformation(H));}}}};c.tag="scandit-barcode-find-view";var S=c;S.register();export{S as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import {Color}from'@scandit/web-datacapture-core';import {gray900}from'@scandit/web-datacapture-core/build/js/private/ui/colors.js';import {ScanditHTMLElement,html,defineCustomElements,css}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';var a="--text-size",i="--text-color",b="slot[name='text']",e=class e extends ScanditHTMLElement{constructor(){super();let t=this.attachShadow({mode:"open"});t.innerHTML=html`<button type="button" role="button" class="container">
|
|
2
2
|
<slot name="barcode-icon"></slot>
|
|
3
3
|
<slot name="text"></slot>
|
|
4
|
-
</button>`,t.append(e.createStyleElement().cloneNode(true)),this.containerElement=t.querySelector(".container"),this.containerElement.style.setProperty(a,"10px"),this.containerElement.style.setProperty(i,`#${gray900.toJSON()}`);}set textSize(t){this.containerElement.style.setProperty(a,`${t}px`);}get textSize(){let t=this.containerElement.style.getPropertyValue(a).replace("px","");return Number.parseInt(t,10)}set textColor(t){this.containerElement.style.setProperty(i,`#${t.toJSON()}`);}get textColor(){let t=this.containerElement.style.getPropertyValue(i);return Color.fromHex(t)}get text(){var o,n;let t=(o=this.containerElement.querySelector(b))==null?void 0:o.assignedSlot;return (n=t==null?void 0:t.textContent)!=null?n:""}set disabled(t){this.containerElement.disabled=t;}get disabled(){return this.containerElement.disabled}static register(){defineCustomElements({[e.tag]:e});}static create(t,o){e.register();let n=document.createElement(e.tag);if(t.slot="barcode-icon",t.width=24,t.height=24,o!=null){let r=document.createElement("span");r.slot="text",r.textContent=o,n.append(r);}return n.append(t),n}static createStyleElement(){return css`.container{align-items:center;-webkit-appearance:none;background-color:
|
|
4
|
+
</button>`,t.append(e.createStyleElement().cloneNode(true)),this.containerElement=t.querySelector(".container"),this.containerElement.style.setProperty(a,"10px"),this.containerElement.style.setProperty(i,`#${gray900.toJSON()}`);}set textSize(t){this.containerElement.style.setProperty(a,`${t}px`);}get textSize(){let t=this.containerElement.style.getPropertyValue(a).replace("px","");return Number.parseInt(t,10)}set textColor(t){this.containerElement.style.setProperty(i,`#${t.toJSON()}`);}get textColor(){let t=this.containerElement.style.getPropertyValue(i);return Color.fromHex(t)}get text(){var o,n;let t=(o=this.containerElement.querySelector(b))==null?void 0:o.assignedSlot;return (n=t==null?void 0:t.textContent)!=null?n:""}set disabled(t){this.containerElement.disabled=t;}get disabled(){return this.containerElement.disabled}static register(){defineCustomElements({[e.tag]:e});}static create(t,o){e.register();let n=document.createElement(e.tag);if(t.slot="barcode-icon",t.width=24,t.height=24,o!=null){let r=document.createElement("span");r.slot="text",r.textContent=o,n.append(r);}return n.append(t),n}static createStyleElement(){return css`.container{align-items:center;-webkit-appearance:none;background-color:initial;border:none;color:var(--text-color);display:flex;flex-direction:column;font-family:SF Pro Text,sans-serif;font-size:var(--text-size);gap:6px;justify-content:center;margin:0;padding:10px;transition:background-color .1s ease-in-out}.container:hover{background-color:#e0e0e0}.container:active{background-color:#ccc}`}};e.tag="scandit-barcode-ar-popover-button-annotation";var c=e;export{c as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-4PTIOBXM.js';import {a as a$1}from'./chunk-OEYNGWOX.js';import {a as a$2}from'./chunk-LBAL6OCN.js';import {CameraSettings,Color,CameraPosition,TorchState,VideoResolution,FocusGestureStrategy,MeasureUnit}from'@scandit/web-datacapture-core';import {fromEntries}from'@scandit/web-datacapture-core/build/js/private/utils/fromEntries.js';var f=e=>({SymbologySettings:Object.keys(e.SymbologySettings).reduce((t,o)=>(t[o]=a$2.fromJSON(JSON.parse(e.SymbologySettings[o])),t),{}),SymbologyDescriptions:e.SymbologyDescriptions.map(t=>a$1.fromJSON(JSON.parse(t))),CompositeTypeDescriptions:e.CompositeTypeDescriptions.map(t=>JSON.parse(t)),BarcodeCapture:{BarcodeCaptureOverlay:{DefaultBrush:{fillColor:Color.fromJSON(e.BarcodeCapture.BarcodeCaptureOverlay.DefaultBrush.fillColor),strokeColor:Color.fromJSON(e.BarcodeCapture.BarcodeCaptureOverlay.DefaultBrush.strokeColor),strokeWidth:e.BarcodeCapture.BarcodeCaptureOverlay.DefaultBrush.strokeWidth},styles:fromEntries(Object.keys(e.BarcodeCapture.BarcodeCaptureOverlay.styles).map(t=>[t,{DefaultBrush:{fillColor:Color.fromJSON(e.BarcodeCapture.BarcodeCaptureOverlay.styles[t].DefaultBrush.fillColor),strokeColor:Color.fromJSON(e.BarcodeCapture.BarcodeCaptureOverlay.styles[t].DefaultBrush.strokeColor),strokeWidth:e.BarcodeCapture.BarcodeCaptureOverlay.styles[t].DefaultBrush.strokeWidth}}]))},BarcodeCaptureSettings:{codeDuplicateFilter:e.BarcodeCapture.BarcodeCaptureSettings.codeDuplicateFilter},RecommendedCameraSettings:CameraSettings.fromJSON(e.BarcodeCapture.RecommendedCameraSettings)},BarcodeBatch:{BarcodeBatchBasicOverlay:{defaultStyle:e.BarcodeBatch.BarcodeBatchBasicOverlay.defaultStyle,DefaultBrush:{fillColor:Color.fromJSON(e.BarcodeBatch.BarcodeBatchBasicOverlay.DefaultBrush.fillColor),strokeColor:Color.fromJSON(e.BarcodeBatch.BarcodeBatchBasicOverlay.DefaultBrush.strokeColor),strokeWidth:e.BarcodeBatch.BarcodeBatchBasicOverlay.DefaultBrush.strokeWidth},styles:fromEntries(Object.keys(e.BarcodeBatch.BarcodeBatchBasicOverlay.styles).map(t=>[t,{DefaultBrush:{fillColor:Color.fromJSON(e.BarcodeBatch.BarcodeBatchBasicOverlay.styles[t].DefaultBrush.fillColor),strokeColor:Color.fromJSON(e.BarcodeBatch.BarcodeBatchBasicOverlay.styles[t].DefaultBrush.strokeColor),strokeWidth:e.BarcodeBatch.BarcodeBatchBasicOverlay.styles[t].DefaultBrush.strokeWidth}}]))},RecommendedCameraSettings:CameraSettings.fromJSON(e.BarcodeBatch.RecommendedCameraSettings)},BarcodeFind:{CameraSettings:{hiddenProperties:{exposureTargetBias:e.BarcodeFind.CameraSettings.hiddenProperties.exposureTargetBias,grayScaleFrameReader:e.BarcodeFind.CameraSettings.hiddenProperties.grayScaleFrameReader},settings:CameraSettings.fromJSON(e.BarcodeFind.CameraSettings.settings)},BarcodeFindViewSettings:{settings:a.fromJSON(e.BarcodeFind.BarcodeFindViewSettings.settings)}},SparkScan:{SparkScanFeedback:{errorVibrationPattern:e.SparkScan.SparkScanFeedback.errorVibrationPattern},SparkScanSettings:{codeDuplicateFilter:e.SparkScan.SparkScanSettings.codeDuplicateFilter,locationSelection:{radius:e.SparkScan.SparkScanSettings.locationSelection.radius,unit:e.SparkScan.SparkScanSettings.locationSelection.unit},targetModeLocationSelection:{radius:e.SparkScan.SparkScanSettings.targetModeLocationSelection.radius,unit:e.SparkScan.SparkScanSettings.targetModeLocationSelection.unit}},SparkScanOverlay:{DefaultBrush:{fillColor:Color.fromJSON(e.SparkScan.SparkScanOverlay.DefaultBrush.fillColor),strokeColor:Color.fromJSON(e.SparkScan.SparkScanOverlay.DefaultBrush.strokeColor),strokeWidth:e.SparkScan.SparkScanOverlay.DefaultBrush.strokeWidth},defaultStyle:"frame"},CameraSettings:{hiddenProperties:{exposureTargetBias:e.SparkScan.CameraSettings.hiddenProperties.exposureTargetBias,grayScaleFrameReader:e.SparkScan.CameraSettings.hiddenProperties.grayScaleFrameReader,repeatedTriggerInterval:e.SparkScan.CameraSettings.hiddenProperties.repeatedTriggerInterval},settings:CameraSettings.fromJSON(e.SparkScan.CameraSettings.settings)},SparkScanViewSettings:{triggerButtonCollapseTimeout:e.SparkScan.SparkScanViewSettings.triggerButtonCollapseTimeout,defaultHandMode:e.SparkScan.SparkScanViewSettings.defaultHandMode,defaultTorchState:e.SparkScan.SparkScanViewSettings.defaultTorchState,defaultMiniPreviewSize:e.SparkScan.SparkScanViewSettings.defaultMiniPreviewSize,defaultCameraPosition:e.SparkScan.SparkScanViewSettings.defaultCameraPosition,soundEnabled:e.SparkScan.SparkScanViewSettings.soundEnabled,hapticEnabled:e.SparkScan.SparkScanViewSettings.hapticEnabled,holdToScanEnabled:e.SparkScan.SparkScanViewSettings.holdToScanEnabled,visualFeedbackEnabled:e.SparkScan.SparkScanViewSettings.visualFeedbackEnabled,inactiveStateTimeout:e.SparkScan.SparkScanViewSettings.inactiveStateTimeout,zoomFactorOut:e.SparkScan.SparkScanViewSettings.zoomFactorOut,zoomFactorIn:e.SparkScan.SparkScanViewSettings.zoomFactorIn}},SparkCapture:{SparkCaptureSettings:{codeDuplicateFilter:e.SparkCapture.SparkCaptureSettings.codeDuplicateFilter}}}),u=f({BarcodeCapture:{BarcodeCaptureSettings:{codeDuplicateFilter:-2},BarcodeCaptureOverlay:{DefaultBrush:{fillColor:"#00000000",strokeColor:"#FFFFFFFF",strokeWidth:3},styles:{frame:{DefaultBrush:{fillColor:"#00000000",strokeColor:"#FFFFFFFF",strokeWidth:3}}}},RecommendedCameraSettings:{zoomFactor:1,zoomGestureZoomFactor:2,focusGestureStrategy:"manualUntilCapture",preferredResolution:"auto"}},SymbologySettings:{ean13Upca:JSON.stringify({activeSymbolCounts:[12],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]}),ean8:JSON.stringify({activeSymbolCounts:[8],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]}),upce:JSON.stringify({activeSymbolCounts:[6],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]}),code128:JSON.stringify({activeSymbolCounts:[40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:["strip_leading_fnc1"]}),code39:JSON.stringify({activeSymbolCounts:[40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]}),code93:JSON.stringify({activeSymbolCounts:[40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]}),interleavedTwoOfFive:JSON.stringify({activeSymbolCounts:[40,38,36,34,32,30,28,26,24,22,20,18,16,14,12,10,8,6],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]}),qr:JSON.stringify({activeSymbolCounts:[],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]}),dataMatrix:JSON.stringify({activeSymbolCounts:[],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:["strip_leading_fnc1"]}),pdf417:JSON.stringify({activeSymbolCounts:[],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]}),msiPlessey:JSON.stringify({activeSymbolCounts:[32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]}),databar:JSON.stringify({activeSymbolCounts:[2],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]}),databarExpanded:JSON.stringify({activeSymbolCounts:[],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]}),codabar:JSON.stringify({activeSymbolCounts:[20,19,18,17,16,15,14,13,12,11,10,9,8,7],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]}),aztec:JSON.stringify({activeSymbolCounts:[],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]}),maxicode:JSON.stringify({activeSymbolCounts:[],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]}),code11:JSON.stringify({activeSymbolCounts:[20,19,18,17,16,15,14,13,12,11,10,9,8,7],checksums:["mod11"],colorInvertedEnabled:false,enabled:false,extensions:[]}),databarLimited:JSON.stringify({activeSymbolCounts:[1],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]}),code25:JSON.stringify({activeSymbolCounts:[20,19,18,17,16,15,14,13,12,11,10,9,8,7],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]}),microPdf417:JSON.stringify({activeSymbolCounts:[],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]}),rm4scc:JSON.stringify({activeSymbolCounts:[24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]}),kix:JSON.stringify({activeSymbolCounts:[24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]}),dotcode:JSON.stringify({activeSymbolCounts:[],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]}),microQr:JSON.stringify({activeSymbolCounts:[],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]}),code32:JSON.stringify({activeSymbolCounts:[8],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]}),lapa4sc:JSON.stringify({activeSymbolCounts:[16],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]}),iata2of5:JSON.stringify({activeSymbolCounts:[20,19,18,17,16,15,14,13,12,11,10,9,8,7],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]}),matrix2of5:JSON.stringify({activeSymbolCounts:[20,19,18,17,16,15,14,13,12,11,10,9,8,7],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]}),uspsIntelligentMail:JSON.stringify({activeSymbolCounts:[65],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]}),aruco:JSON.stringify({activeSymbolCounts:[],checksums:[],colorInvertedEnabled:false,enabled:false,extensions:[]})},BarcodeBatch:{BarcodeBatchBasicOverlay:{defaultStyle:"frame",DefaultBrush:{fillColor:"#00000000",strokeColor:"#FFFFFFFF",strokeWidth:3},styles:{frame:{DefaultBrush:{fillColor:"#00FFFF73",strokeColor:"#00FFFF",strokeWidth:3}},dot:{DefaultBrush:{fillColor:"#00FFFF73",strokeColor:"#00FFFF",strokeWidth:1}},legacy:{DefaultBrush:{fillColor:"#00000000",strokeColor:"#FFFFFFFF",strokeWidth:1}}}},RecommendedCameraSettings:{zoomFactor:1,zoomGestureZoomFactor:2,focusGestureStrategy:"manualUntilCapture",preferredResolution:"fullHd"}},BarcodeFind:{CameraSettings:{hiddenProperties:{exposureTargetBias:-1,grayScaleFrameReader:true},settings:{zoomFactor:1,zoomGestureZoomFactor:1,focusGestureStrategy:"manualUntilCapture",preferredResolution:"fullHd"}},BarcodeFindViewSettings:{settings:{inListItemColor:Color.fromHex("#2EC1CE").toJSON(),notInListItemColor:Color.fromHex("#FFFFFF").toJSON(),hapticEnabled:true,soundEnabled:true}}},SparkScan:{SparkScanFeedback:{errorVibrationPattern:[600]},SparkScanSettings:{codeDuplicateFilter:-2,locationSelection:{radius:.5,unit:MeasureUnit.Fraction},targetModeLocationSelection:{radius:.07,unit:MeasureUnit.Fraction}},SparkScanOverlay:{DefaultBrush:{fillColor:"#00000000",strokeColor:"#FFFFFFFF",strokeWidth:3},defaultStyle:"frame"},CameraSettings:{hiddenProperties:{exposureTargetBias:-1,grayScaleFrameReader:true,repeatedTriggerInterval:1},settings:{focus:{focusGestureStrategy:FocusGestureStrategy.None},preferredResolution:VideoResolution.FullHD,zoomFactor:1,zoomGestureZoomFactor:2}},SparkScanViewSettings:{defaultHandMode:"right",defaultTorchState:TorchState.Off,defaultMiniPreviewSize:"regular",defaultCameraPosition:CameraPosition.WorldFacing,hapticEnabled:true,holdToScanEnabled:true,soundEnabled:true,triggerButtonCollapseTimeout:5e3,visualFeedbackEnabled:true,inactiveStateTimeout:1e4,zoomFactorOut:1,zoomFactorIn:2}},CompositeTypeDescriptions:[JSON.stringify({symbologies:["ean8","ean13Upca","microPdf417","databarLimited","upce","databar","databarExpanded"],types:["A"]}),JSON.stringify({symbologies:["ean8","ean13Upca","microPdf417","databarLimited","upce","databar","databarExpanded"],types:["B"]}),JSON.stringify({symbologies:["code128","pdf417"],types:["C"]})],SparkCapture:{SparkCaptureSettings:{codeDuplicateFilter:1e3}},SymbologyDescriptions:[JSON.stringify({activeSymbolCountRange:{maximum:12,minimum:12,step:1},defaultSymbolCountRange:{maximum:12,minimum:12,step:1},identifier:"ean13Upca",isAvailable:true,isColorInvertible:true,readableName:"EAN-13/UPC-A",supportedChecksums:[],supportedExtensions:["two_digit_add_on","strict","remove_leading_upca_zero","relaxed_sharp_quiet_zone_check","five_digit_add_on"]}),JSON.stringify({activeSymbolCountRange:{maximum:8,minimum:8,step:1},defaultSymbolCountRange:{maximum:8,minimum:8,step:1},identifier:"ean8",isAvailable:true,isColorInvertible:true,readableName:"EAN-8",supportedChecksums:[],supportedExtensions:["two_digit_add_on","strict","relaxed_sharp_quiet_zone_check","five_digit_add_on"]}),JSON.stringify({activeSymbolCountRange:{maximum:6,minimum:6,step:1},defaultSymbolCountRange:{maximum:6,minimum:6,step:1},identifier:"upce",isAvailable:true,isColorInvertible:true,readableName:"UPC-E",supportedChecksums:[],supportedExtensions:["two_digit_add_on","strict","return_as_upca","remove_leading_upca_zero","five_digit_add_on"]}),JSON.stringify({activeSymbolCountRange:{maximum:50,minimum:4,step:1},defaultSymbolCountRange:{maximum:40,minimum:6,step:1},identifier:"code128",isAvailable:true,isColorInvertible:true,readableName:"Code 128",supportedChecksums:[],supportedExtensions:["strict"]}),JSON.stringify({activeSymbolCountRange:{maximum:50,minimum:3,step:1},defaultSymbolCountRange:{maximum:40,minimum:6,step:1},identifier:"code39",isAvailable:true,isColorInvertible:true,readableName:"Code 39",supportedChecksums:["mod43"],supportedExtensions:["strict","relaxed_sharp_quiet_zone_check","full_ascii"]}),JSON.stringify({activeSymbolCountRange:{maximum:60,minimum:5,step:1},defaultSymbolCountRange:{maximum:40,minimum:6,step:1},identifier:"code93",isAvailable:true,isColorInvertible:false,readableName:"Code 93",supportedChecksums:[],supportedExtensions:["strict"]}),JSON.stringify({activeSymbolCountRange:{maximum:50,minimum:4,step:2},defaultSymbolCountRange:{maximum:40,minimum:6,step:2},identifier:"interleavedTwoOfFive",isAvailable:true,isColorInvertible:false,readableName:"Interleaved Two of Five",supportedChecksums:[],supportedExtensions:["strict"]}),JSON.stringify({activeSymbolCountRange:{maximum:0,minimum:0,step:0},defaultSymbolCountRange:{maximum:0,minimum:0,step:0},identifier:"qr",isAvailable:true,isColorInvertible:true,readableName:"QR Code",supportedChecksums:[],supportedExtensions:["guess_encoding"]}),JSON.stringify({activeSymbolCountRange:{maximum:0,minimum:0,step:0},defaultSymbolCountRange:{maximum:0,minimum:0,step:0},identifier:"dataMatrix",isAvailable:true,isColorInvertible:true,readableName:"Data Matrix",supportedChecksums:[],supportedExtensions:["direct_part_marking_mode"]}),JSON.stringify({activeSymbolCountRange:{maximum:0,minimum:0,step:0},defaultSymbolCountRange:{maximum:0,minimum:0,step:0},identifier:"pdf417",isAvailable:true,isColorInvertible:false,readableName:"PDF417",supportedChecksums:[],supportedExtensions:[]}),JSON.stringify({activeSymbolCountRange:{maximum:32,minimum:3,step:1},defaultSymbolCountRange:{maximum:32,minimum:6,step:1},identifier:"msiPlessey",isAvailable:true,isColorInvertible:false,readableName:"MSI Plessey",supportedChecksums:["mod11","mod1010","mod1110"],supportedExtensions:["strict"]}),JSON.stringify({activeSymbolCountRange:{maximum:2,minimum:2,step:1},defaultSymbolCountRange:{maximum:2,minimum:2,step:1},identifier:"databar",isAvailable:true,isColorInvertible:false,readableName:"GS1 DataBar 14",supportedChecksums:[],supportedExtensions:["strict"]}),JSON.stringify({activeSymbolCountRange:{maximum:0,minimum:0,step:0},defaultSymbolCountRange:{maximum:0,minimum:0,step:0},identifier:"databarExpanded",isAvailable:true,isColorInvertible:false,readableName:"GS1 DataBar Expanded",supportedChecksums:[],supportedExtensions:["strict"]}),JSON.stringify({activeSymbolCountRange:{maximum:34,minimum:3,step:1},defaultSymbolCountRange:{maximum:20,minimum:7,step:1},identifier:"codabar",isAvailable:true,isColorInvertible:false,readableName:"Codabar",supportedChecksums:["mod11","mod16"],supportedExtensions:["strict"]}),JSON.stringify({activeSymbolCountRange:{maximum:0,minimum:0,step:0},defaultSymbolCountRange:{maximum:0,minimum:0,step:0},identifier:"aztec",isAvailable:true,isColorInvertible:false,readableName:"Aztec",supportedChecksums:[],supportedExtensions:[]}),JSON.stringify({activeSymbolCountRange:{maximum:0,minimum:0,step:0},defaultSymbolCountRange:{maximum:0,minimum:0,step:0},identifier:"maxicode",isAvailable:true,isColorInvertible:false,readableName:"MaxiCode",supportedChecksums:[],supportedExtensions:[]}),JSON.stringify({activeSymbolCountRange:{maximum:34,minimum:5,step:1},defaultSymbolCountRange:{maximum:20,minimum:7,step:1},identifier:"code11",isAvailable:true,isColorInvertible:false,readableName:"Code 11",supportedChecksums:["mod11"],supportedExtensions:["strict"]}),JSON.stringify({activeSymbolCountRange:{maximum:1,minimum:1,step:1},defaultSymbolCountRange:{maximum:1,minimum:1,step:1},identifier:"databarLimited",isAvailable:true,isColorInvertible:false,readableName:"GS1 DataBar Limited",supportedChecksums:[],supportedExtensions:["strict"]}),JSON.stringify({activeSymbolCountRange:{maximum:32,minimum:3,step:1},defaultSymbolCountRange:{maximum:20,minimum:7,step:1},identifier:"code25",isAvailable:true,isColorInvertible:false,readableName:"Code 25",supportedChecksums:[],supportedExtensions:["strict"]}),JSON.stringify({activeSymbolCountRange:{maximum:0,minimum:0,step:0},defaultSymbolCountRange:{maximum:0,minimum:0,step:0},identifier:"microPdf417",isAvailable:true,isColorInvertible:false,readableName:"MicroPDF417",supportedChecksums:[],supportedExtensions:[]}),JSON.stringify({activeSymbolCountRange:{maximum:50,minimum:4,step:1},defaultSymbolCountRange:{maximum:24,minimum:7,step:1},identifier:"rm4scc",isAvailable:true,isColorInvertible:false,readableName:"RM4SCC",supportedChecksums:[],supportedExtensions:[]}),JSON.stringify({activeSymbolCountRange:{maximum:50,minimum:4,step:1},defaultSymbolCountRange:{maximum:24,minimum:7,step:1},identifier:"kix",isAvailable:true,isColorInvertible:false,readableName:"KIX",supportedChecksums:[],supportedExtensions:[]}),JSON.stringify({activeSymbolCountRange:{maximum:0,minimum:0,step:0},defaultSymbolCountRange:{maximum:0,minimum:0,step:0},identifier:"dotcode",isAvailable:true,isColorInvertible:true,readableName:"DotCode",supportedChecksums:[],supportedExtensions:[]}),JSON.stringify({activeSymbolCountRange:{maximum:0,minimum:0,step:0},defaultSymbolCountRange:{maximum:0,minimum:0,step:0},identifier:"microQr",isAvailable:true,isColorInvertible:true,readableName:"Micro QR",supportedChecksums:[],supportedExtensions:[]}),JSON.stringify({activeSymbolCountRange:{maximum:8,minimum:8,step:1},defaultSymbolCountRange:{maximum:8,minimum:8,step:1},identifier:"code32",isAvailable:true,isColorInvertible:false,readableName:"Code 32",supportedChecksums:[],supportedExtensions:["strict"]}),JSON.stringify({activeSymbolCountRange:{maximum:16,minimum:16,step:1},defaultSymbolCountRange:{maximum:16,minimum:16,step:1},identifier:"lapa4sc",isAvailable:true,isColorInvertible:false,readableName:"LAPA4SC",supportedChecksums:[],supportedExtensions:[]}),JSON.stringify({activeSymbolCountRange:{maximum:32,minimum:3,step:1},defaultSymbolCountRange:{maximum:20,minimum:7,step:1},identifier:"iata2of5",isAvailable:true,isColorInvertible:false,readableName:"IATA 2 of 5",supportedChecksums:["mod1010"],supportedExtensions:["strict"]}),JSON.stringify({activeSymbolCountRange:{maximum:32,minimum:3,step:1},defaultSymbolCountRange:{maximum:20,minimum:7,step:1},identifier:"matrix2of5",isAvailable:true,isColorInvertible:false,readableName:"Matrix 2 of 5",supportedChecksums:[],supportedExtensions:["strict"]}),JSON.stringify({activeSymbolCountRange:{maximum:65,minimum:65,step:1},defaultSymbolCountRange:{maximum:65,minimum:65,step:1},identifier:"uspsIntelligentMail",isAvailable:true,isColorInvertible:false,readableName:"USPS Intelligent Mail",supportedChecksums:[],supportedExtensions:[]}),JSON.stringify({activeSymbolCountRange:{maximum:0,minimum:0,step:0},defaultSymbolCountRange:{maximum:0,minimum:0,step:0},identifier:"aruco",isAvailable:true,isColorInvertible:false,readableName:"ArUco",supportedChecksums:[],supportedExtensions:[]})]});function h(e){u=e;}a$1.defaults=()=>({SymbologyDescriptions:u.SymbologyDescriptions});export{f as a,u as b,h as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-XS6RV73B.js';import {b}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-XS6RV73B.js';import {b}from'./chunk-OLJXVUYE.js';import {CameraSettings,convertToPublicFrameData,Logger}from'@scandit/web-datacapture-core';var p=class c{constructor(){this.type="sparkScan";this._synchronousFrameFlow=false;this._isEnabled=true;this._isSuppressed=false;this._context=null;this.listeners=new Set;this.allowedRemainingWorkerMessages=new Set;this.workerMessageListener=this.onWorkerMessage.bind(this);}static get recommendedCameraSettings(){return new CameraSettings(b.SparkScan.CameraSettings.settings)}get context(){return this._context}static forSettings(e){let a=new c;return a.settings=e,a}isEnabled(){return this._isEnabled&&!this._isSuppressed}async setEnabled(e){this._isEnabled=e,await this.notifyContext();}async setResultSuppressionEnabled(e){this._isSuppressed=e,await this.notifyContext();}async applySettings(e){return this.settings=e,this.notifyContext()}addListener(e){this.listeners.add(e);}removeListener(e){this.listeners.delete(e);}toJSONObject(){return {type:this.type,enabled:this._isEnabled,settings:this.settings.toJSONObject(),isSuppressed:this._isSuppressed}}async workerCommand(e,a){this.context&&await this.context.workerCommand(e,a);}attachedToContext(e){this._context=e,this._context.subscribeToWorkerMessages(this.workerMessageListener);}async detachedFromContext(){var e;(e=this._context)==null||e.unsubscribeToWorkerMessages(this.workerMessageListener),this._context=null;}sendClearFrameDataRequest(e){queueMicrotask(()=>{var a;console.log("sendClearFrameDataRequest: queueMicrotask"),(a=this.context)==null||a.workerCommand("deleteFrameData",{frameId:e});});}async onDidScan(e){if(this.context==null)return;let{frameData:a$1}=e.payload;if(!this._isEnabled){this.sendClearFrameDataRequest(a$1.frameId),this.allowedRemainingWorkerMessages.clear();return}this.allowedRemainingWorkerMessages.add("successFeedback");let t=[],s=a.fromJSON(e.payload.session);for(let r of this.listeners)if(r.didScan)try{let i=r.didScan(this,s,convertToPublicFrameData(a$1,this.context));i instanceof Promise&&await i;}catch(i){t.push(i);}this.sendClearFrameDataRequest(a$1.frameId),this.allowedRemainingWorkerMessages.add("sparkScanDidUpdateSession");for(let r of t)Logger.error(r);}onDidUpdateSession(e){var t;if(!this._isEnabled&&!this.allowedRemainingWorkerMessages.has(e.type))return;this.allowedRemainingWorkerMessages.delete(e.type);let a$1=a.fromJSON(e.payload);for(let s of this.listeners)(t=s.didUpdateSession)==null||t.call(s,this,a$1);}async onWorkerMessage(e){switch(e.type){case "sparkScanDidScan":{this.onDidScan(e);break}case "sparkScanDidUpdateSession":{this.onDidUpdateSession(e);break}}}async notifyContext(){this.context&&await this.context.update();}};export{p as a};
|
|
@@ -11,4 +11,4 @@ import {html,ScanditHTMLElement,defineCustomElements,css}from'@scandit/web-datac
|
|
|
11
11
|
<slot name="right"></slot>
|
|
12
12
|
</div>
|
|
13
13
|
</div>
|
|
14
|
-
`,t=class t extends ScanditHTMLElement{constructor(){super();let e=this.attachShadow({mode:"open"});e.innerHTML=c,e.append(t.createStyleElement().cloneNode(true));}set title(e){var a;let i=(a=this.shadowRoot)==null?void 0:a.querySelector(".title");i!=null&&(i.textContent=e);}set subtitle(e){var a;let i=(a=this.shadowRoot)==null?void 0:a.querySelector(".subtitle");i!=null&&(i.textContent=e);}static create(){return document.createElement(t.tag)}static register(){defineCustomElements({[t.tag]:t});}static createStyleElement(){return css`#container{align-items:center;display:flex;flex-direction:row;gap:.625rem;justify-content:center;padding:1rem}.overflow-text-mask{-webkit-mask-image:linear-gradient(90deg,#000 95
|
|
14
|
+
`,t=class t extends ScanditHTMLElement{constructor(){super();let e=this.attachShadow({mode:"open"});e.innerHTML=c,e.append(t.createStyleElement().cloneNode(true));}set title(e){var a;let i=(a=this.shadowRoot)==null?void 0:a.querySelector(".title");i!=null&&(i.textContent=e);}set subtitle(e){var a;let i=(a=this.shadowRoot)==null?void 0:a.querySelector(".subtitle");i!=null&&(i.textContent=e);}static create(){return document.createElement(t.tag)}static register(){defineCustomElements({[t.tag]:t});}static createStyleElement(){return css`#container{align-items:center;display:flex;flex-direction:row;gap:.625rem;justify-content:center;padding:1rem}.overflow-text-mask{-webkit-mask-image:linear-gradient(90deg,#000 95%,#0000);mask-image:linear-gradient(90deg,#000 95%,#0000);overflow-x:auto;padding-right:.3rem}#container>div{display:flex;flex:1 1 17.5%;justify-content:center}#container>div.middle{flex:1 1 65%;flex-direction:column;overflow:hidden}#container>div .rect{background:gray;height:50px;width:50px}#container .title{color:#121619;font-size:.938rem;font-weight:600}#container .subtitle{font-size:.75rem;font-weight:400;margin-top:.25rem}`}};t.tag="scandit-image-and-text-card-layout";var n=t;n.register();export{n as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-F7NAOKPF.js';import {gray900}from'@scandit/web-datacapture-core/build/js/private/ui/colors.js';import {ScanditHTMLElement,html,defineCustomElements,css}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';import {Color}from'@scandit/web-datacapture-core';var e=class e extends ScanditHTMLElement{constructor(){super();let t=this.attachShadow({mode:"open"});t.innerHTML=html`<div class="container">
|
|
2
2
|
<span class="ghost-arrow arw-bottom-center"></span>
|
|
3
3
|
<div class="icon-container">
|
|
4
4
|
<slot name="barcode-icon"></slot>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {d}from'./chunk-
|
|
1
|
+
import {d}from'./chunk-42Y6V4GC.js';import {a}from'./chunk-CYVVGAZ4.js';import {ScanditHTMLElement,Logger}from'@scandit/web-datacapture-core';import {defineCustomElements}from'@scandit/web-datacapture-core/build/js/private/utils/defineCustomElements.js';var o=class o extends ScanditHTMLElement{constructor(){super(...arguments);this.closeUp=null;this.farAway=null;this._annotationVariation=1;}static register(){defineCustomElements({[o.tag]:o});}static create(t,a,i){let n=document.createElement(o.tag);return n._barcode=t,n.closeUp=a,n.farAway=i,a instanceof d||(Logger.warn("Only BarcodeArInfoAnnotation is supported at the moment. The close up annotation will be ignored."),n.closeUp=null),i instanceof d||(Logger.warn("Only BarcodeArInfoAnnotation is supported at the moment. The far away annotation will be ignored."),n.farAway=null),n.closeUp&&(n.closeUp.hidden=true),n.farAway&&(n.farAway.hidden=true),n}get currentAnnotation(){return this._annotationVariation===2?this.farAway:this.closeUp}get annotationTrigger(){var t,a;return (a=(t=this.currentAnnotation)==null?void 0:t.annotationTrigger)!=null?a:"highlightTapAndBarcodeScan"}set annotationTrigger(t){this.closeUp&&(this.closeUp.annotationTrigger=t),this.farAway&&(this.farAway.annotationTrigger=t);}set anchor(t){this.closeUp.anchor!==void 0&&(this.closeUp.anchor=t),this.farAway.anchor!==void 0&&(this.farAway.anchor=t);}get anchor(){var t;return (t=this.currentAnnotation.anchor)!=null?t:void 0}get barcode(){return this._barcode}updatePosition(t,a$1,i){this.updateAnnotationVisibility(),a(this,t,a$1);}get annotationVariation(){return this._annotationVariation}set annotationVariation(t){t!==this._annotationVariation&&(this._annotationVariation=t,this.updateAnnotationVisibility());}updateAnnotationVisibility(){let t=this._annotationVariation===2,a=!t;this.closeUp&&(this.closeUp.hidden=t),this.farAway&&(this.farAway.hidden=a);}static get threshold(){return o._threshold}static set threshold(t){o._threshold=t;}connectedCallback(){this.closeUp&&this.append(this.closeUp),this.farAway&&this.append(this.farAway),this.updateAnnotationVisibility();}disconnectedCallback(){this.closeUp&&this.closeUp.remove(),this.farAway&&this.farAway.remove();}};o.tag="scandit-barcode-ar-responsive-annotation",o._threshold=.1;var c=o;export{c as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b}from'./chunk-OLJXVUYE.js';import {Brush,NoViewfinder}from'@scandit/web-datacapture-core';var l=(e=>(e.Frame="frame",e))(l||{}),i=class o{constructor(){this.type="barcodeCapture";this._brush=new Brush(b.BarcodeCapture.BarcodeCaptureOverlay.DefaultBrush.fillColor,b.BarcodeCapture.BarcodeCaptureOverlay.DefaultBrush.strokeColor,b.BarcodeCapture.BarcodeCaptureOverlay.DefaultBrush.strokeWidth);this._shouldShowScanAreaGuides=false;this._shouldRemoveLocationsAfterScan=true;this._style="frame";this._viewfinder=null;}get style(){return this._style}static async withBarcodeCapture(e){return o.withBarcodeCaptureForView(e,null)}static async withBarcodeCaptureForView(e,r){let a=new o;return a.barcodeCapture=e,await a.setBrush(a._brush),await(r==null?void 0:r.addOverlay(a)),a}static async withBarcodeCaptureForViewWithStyle(e,r,a){return await o.withBarcodeCaptureForView(e,r)}getBrush(){return this._brush}getViewfinder(){return this._viewfinder}async setBrush(e){this._brush=e,await this.barcodeCapture.notifyContext();}async setShouldShowScanAreaGuides(e){this._shouldShowScanAreaGuides=e,await this.barcodeCapture.notifyContext();}async setShouldRemoveLocationsAfterScan(e){this._shouldRemoveLocationsAfterScan=e,await this.barcodeCapture.notifyContext();}async setViewfinder(e){this._viewfinder=e,await this.barcodeCapture.notifyContext();}shouldShowScanAreaGuides(){return this._shouldShowScanAreaGuides}shouldRemoveLocationsAfterScan(){return this._shouldRemoveLocationsAfterScan}toJSONObject(){var e,r;return {type:this.type,brush:this._brush.toJSONObject(),drawLocalizedOnlyBarcodes:false,shouldShowScanAreaGuides:this._shouldShowScanAreaGuides,shouldRemoveLocationsAfterScan:this._shouldRemoveLocationsAfterScan,viewfinder:(r=(e=this._viewfinder)==null?void 0:e.toJSONObject())!=null?r:NoViewfinder.toJSONObject(),style:this.style}}};export{l as a,i as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$
|
|
1
|
+
import {a as a$2}from'./chunk-7JPCVI74.js';import {a as a$1,b as b$1}from'./chunk-HTKUJZG2.js';import {a}from'./chunk-YWNGCXKZ.js';import {b}from'./chunk-OLJXVUYE.js';import {CameraSettings,convertToPublicFrameData}from'@scandit/web-datacapture-core';import {warnMultithreadingUnavailable}from'@scandit/web-datacapture-core/build/js/private/utils/warnMultithreadingUnavailable.js';var m=class u{constructor(){this.feedback=a.createDefaultFeedback();this.skipSerialization=true;this.type="barcodeFind";this._isEnabled=true;this._context=null;this.listeners=new Set;this.privateListeners=new Set;this.workerMessageListener=this.onWorkerMessage.bind(this);this._transformer=null;}static get recommendedCameraSettings(){let e=new CameraSettings(b.BarcodeFind.CameraSettings.settings);for(let[t,r]of Object.entries(b.BarcodeFind.CameraSettings.hiddenProperties))e.setProperty(t,r);return e}get context(){return this._context}get allListeners(){return [...this.privateListeners,...this.listeners]}static async forSettings(e){warnMultithreadingUnavailable();let t=new u;return t.settings=e,t}isEnabled(){return this._isEnabled}async setEnabled(e){var t;this._isEnabled=e,await this.workerCommand("barcodeFindSetEnabled",{enabled:e}),await((t=this.context)==null?void 0:t.update([{type:"modeEnabled",newValue:e}],{updateContext:false}));}async applySettings(e){this.settings=e,await this.workerCommand("barcodeFindApplySettings",{settings:e.toJSONObject()});}addListener(e){this.listeners.add(e);}removeListener(e){this.listeners.delete(e);}async setItemList(e){var t;for(let r of this.privateListeners)(t=r.onSetItemList)==null||t.call(r,e);return this.workerCommand("barcodeFindSetItemList",{itemList:e.map(r=>r.toJSONObject())})}async setBarcodeTransformer(e){var t;return this._transformer=e,this.workerCommand("barcodeFindSetTransformerFunction",{functionAsString:(t=this._transformer)==null?void 0:t.transformBarcodeData.toString()})}async start(){return this.workerCommand("barcodeFindSearchStart",{})}async stop(){return this.workerCommand("barcodeFindSearchStop",{})}async pause(){return this.workerCommand("barcodeFindSearchPause",{})}toJSONObject(){return {type:this.type,enabled:this.isEnabled(),settings:this.settings.toJSONObject()}}async workerCommand(e,t){this.context!=null&&await this.context.workerCommand(e,t);}async attachedToContext(e){this._context=e,this._context.subscribeToWorkerMessages(this.workerMessageListener),await this.workerCommand("barcodeFindForSettings",{settings:this.settings.toJSONObject()});}async detachedFromContext(){var e;await this.workerCommand("barcodeFindModeRemove",{}),(e=this._context)==null||e.unsubscribeToWorkerMessages(this.workerMessageListener),this._context=null;}async onWorkerMessage(e){var t,r,c;switch(e.type){case "barcodeFindDidUpdateSession":{if(this._context==null)return;for(let a of this.allListeners)(t=a.onDidUpdateSession)==null||t.call(a,this,a$2.fromJSON(e.payload.session),convertToPublicFrameData(e.payload.frameData,this._context));break}case "barcodeFindSearchPaused":{for(let a of this.allListeners){let i=e.payload.foundItems.map(o=>new a$1(new b$1(o),null));a.didPauseSearch(i);}break}case "barcodeFindSearchStarted":{for(let a of this.allListeners)a.didStartSearch();break}case "barcodeFindSearchStopped":{for(let a of this.allListeners){let i=e.payload.foundItems.map(o=>new a$1(new b$1(o),null));a.didStopSearch(i);}break}case "barcodeFindListUpdatedFeedback":{for(let a of this.allListeners)(r=a.onFindListUpdatedFeedback)==null||r.call(a);break}case "barcodeFindFeedback":{for(let a of this.allListeners)(c=a.onFeedback)==null||c.call(a);break}}}addPrivateListener(e){this.privateListeners.add(e);}removePrivateListener(e){this.privateListeners.delete(e);}};export{m as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s={"scandit-datacapture-sdk-barcode-pthreads.wasm":{bytes:7223853},"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":{bytes:7160455},"scandit-datacapture-sdk-barcode.wasm":{bytes:7107543},"scandit-datacapture-sdk-barcode-simd.wasm":{bytes:7043794}};export{s as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-OLJXVUYE.js';import {RadiusLocationSelection,NumberWithUnit}from'@scandit/web-datacapture-core';var S=class{constructor(){this.codeDuplicateFilter=b.SparkScan.SparkScanSettings.codeDuplicateFilter;this.scanIntention="manual";this.locationSelection=new RadiusLocationSelection(new NumberWithUnit(b.SparkScan.SparkScanSettings.locationSelection.radius,b.SparkScan.SparkScanSettings.locationSelection.unit));this.properties={};this.symbologies={};}get enabledSymbologies(){return Object.keys(this.symbologies).filter(t=>{var e;return (e=this.symbologies[t])==null?void 0:e.isEnabled})}settingsForSymbology(o){if(!this.symbologies[o]){let t=b.SymbologySettings[o];t._symbology=o,this.symbologies[o]=t;}return this.symbologies[o]}setProperty(o,t){this.properties[o]=t;}getProperty(o){return this.properties[o]}enableSymbologies(o){for(let t of o)this.enableSymbology(t,true);}enableSymbology(o,t){this.settingsForSymbology(o).isEnabled=t;}toJSONObject(){var e;let o={},t=Object.keys(this.symbologies);return {codeDuplicateFilter:this.codeDuplicateFilter,locationSelection:this.locationSelection.toJSONObject(),properties:{...this.properties},symbologies:t.reduce((n,s)=>{var r;let l=(r=this.symbologies[s])==null?void 0:r.toJSONObject();return l&&(n[s]=l),n},o),scanIntention:(e=this.scanIntention)!=null?e:null}}};export{S as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-ZBWUSH2F.js';import {b}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-ZBWUSH2F.js';import {b}from'./chunk-OLJXVUYE.js';import {Brush}from'@scandit/web-datacapture-core';var h=(a=>(a.Frame="frame",a.Dot="dot",a))(h||{}),o=class c{constructor(){this.type="barcodeTrackingBasic";this._style=b.BarcodeBatch.BarcodeBatchBasicOverlay.defaultStyle;this._shouldShowScanAreaGuides=false;this._brushesForBarcodes=new Map;}get style(){return this._style}get listener(){return this._listener}set listener(e){this._listener=e;}get brush(){return this._brush}static async withBarcodeBatch(e){return c.withBarcodeBatchForView(e,null)}static async withBarcodeBatchForView(e,a){return c.withBarcodeBatchForViewWithStyle(e,a,b.BarcodeBatch.BarcodeBatchBasicOverlay.defaultStyle)}static async withBarcodeBatchForViewWithStyle(e,a$1,s){let r=new c;return r.barcodeBatch=e,r._style=s,r._brush=new Brush(b.BarcodeBatch.BarcodeBatchBasicOverlay.styles[r.style].DefaultBrush.fillColor,b.BarcodeBatch.BarcodeBatchBasicOverlay.styles[r.style].DefaultBrush.strokeColor,b.BarcodeBatch.BarcodeBatchBasicOverlay.styles[r.style].DefaultBrush.strokeWidth),a$1&&await a$1.addOverlay(r),r.privateListener=new a(r),e.addPrivateListener(r.privateListener),r}async setBrush(e){this._brush=e,await this.barcodeBatch.notifyContext();}shouldShowScanAreaGuides(){return this._shouldShowScanAreaGuides}async setShouldShowScanAreaGuides(e){this._shouldShowScanAreaGuides=e,await this.barcodeBatch.notifyContext();}async setBrushForTrackedBarcode(e,a){this._brushesForBarcodes.set(a.identifier,e),await this.barcodeBatch.notifyContext();}async clearTrackedBarcodeBrushes(){this._brushesForBarcodes.clear(),await this.barcodeBatch.notifyContext();}toJSONObject(){return {type:this.type,brush:this._brush.toJSONObject(),shouldShowScanAreaGuides:this._shouldShowScanAreaGuides,style:this._style,brushesForBarcodes:[...this._brushesForBarcodes.entries()].reduce((e,[a,s])=>(e[a]=s.toJSONObject(),e),{})}}};export{h as a,o as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-ZZQLFO35.js';import {a as a$8}from'./chunk-ZPCWOA3Y.js';import {a as a$7}from'./chunk-DQVSIMLI.js';import {b}from'./chunk-DGF7ODRH.js';import {a as a$a}from'./chunk-KMEGIFKL.js';import {a as a$5}from'./chunk-VU7W53X2.js';import {b as b$1}from'./chunk-RUJWPCWD.js';import {a as a$6}from'./chunk-JKO4EZPZ.js';import {a as a$9}from'./chunk-NDQSQK6H.js';import {a as a$1}from'./chunk-I53W7VSB.js';import {a as a$2}from'./chunk-EW4BAEBZ.js';import {a as a$4}from'./chunk-LKQMBRKB.js';import {a as a$3}from'./chunk-KICLFEZA.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}`}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&&(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);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),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),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,i=-(e.y-t.y),n=Math.atan2(i,o);return Math.round(n*(180/Math.PI))}};c.tag="scandit-barcode-ar-view";var k=c;export{k as a};
|
|
1
|
+
import {a}from'./chunk-ZZQLFO35.js';import {a as a$8}from'./chunk-ZPCWOA3Y.js';import {a as a$7}from'./chunk-DQVSIMLI.js';import {b}from'./chunk-B5IOSUX4.js';import {a as a$a}from'./chunk-KMEGIFKL.js';import {a as a$5}from'./chunk-RLKGZ42F.js';import {b as b$1}from'./chunk-RUJWPCWD.js';import {a as a$6}from'./chunk-JKO4EZPZ.js';import {a as a$1}from'./chunk-I53W7VSB.js';import {a as a$9}from'./chunk-NDQSQK6H.js';import {a as a$2}from'./chunk-IER6LQYW.js';import {a as a$4}from'./chunk-LKQMBRKB.js';import {a as a$3}from'./chunk-AIFHDZKW.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}`}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&&(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);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),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),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,i=-(e.y-t.y),n=Math.atan2(i,o);return Math.round(n*(180/Math.PI))}};c.tag="scandit-barcode-ar-view";var k=c;export{k as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a,b as b$1}from'./chunk-E5OIMFVX.js';import {b}from'./chunk-
|
|
1
|
+
import {a,b as b$1}from'./chunk-E5OIMFVX.js';import {b}from'./chunk-OLJXVUYE.js';import {Vibration,Feedback,Brush,Color}from'@scandit/web-datacapture-core';var r=class{constructor(e,c){this.visualFeedbackColor=e,this.feedback=c;}static defaultSuccessFeedback(){let e=Vibration.withPattern([300]);return new Feedback(e,a)}static defaultErrorFeedback(){let e=Vibration.withPattern(b.SparkScan.SparkScanFeedback.errorVibrationPattern);return new Feedback(e,b$1)}static defaultSuccessBrush(){return new Brush(Color.fromRGBA(0,0,0,0),Color.fromRGBA(250,250,250,1),3)}static defaultErrorBrush(){return new Brush(Color.fromRGBA(0,0,0,0),Color.fromRGBA(250,68,70,1),1)}static success(){return new u}},k=class extends r{constructor(e,c,a,s,o){super(a!=null?a:Color.fromRGBA(250,68,70,1),o!=null?o:r.defaultErrorFeedback()),this.message=e,this.resumeCapturingDelay=c,this.brush=s!=null?s:r.defaultErrorBrush();}toJSONObject(){return {type:"error",barcodeFeedback:{feedback:this.feedback.toJSONObject(),message:this.message,resumeCapturingDelay:this.resumeCapturingDelay,visualFeedbackColor:this.visualFeedbackColor.toJSON(),brush:this.brush.toJSONObject()}}}},u=class extends r{constructor(e,c,a){super(e!=null?e:Color.fromRGBA(46,193,206,1),a!=null?a:r.defaultSuccessFeedback()),this.brush=c!=null?c:r.defaultSuccessBrush();}toJSONObject(){return {type:"success",barcodeFeedback:{visualFeedbackColor:this.visualFeedbackColor.toJSON(),feedback:this.feedback.toJSONObject(),brush:this.brush.toJSONObject()}}}};export{r as a,k as b,u as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-
|
|
1
|
+
import {a as a$1}from'./chunk-47MOJIQ3.js';import {a}from'./chunk-LKZBVQXD.js';import {Localization}from'@scandit/web-datacapture-core';import {normalizeLibraryLocation}from'@scandit/web-datacapture-core/build/js/private/Helper.js';function b(r){return Localization.getInstance().updateIfMissing({...a}),r!=null&&r.libraryLocation&&(r.libraryLocation=normalizeLibraryLocation(r.libraryLocation)),{moduleName:"BarcodeCapture",load:async n=>{var e,o;let a=n;return await a$1.create({...a,libraryLocation:(e=r==null?void 0:r.libraryLocation)!=null?e:a.libraryLocation,highEndBlurryRecognition:(o=r==null?void 0:r.highEndBlurryRecognition)!=null?o:false})}}}export{b as a};
|
|
@@ -3,4 +3,4 @@ import {ScanditHTMLElement,html,defineCustomElements,css}from'@scandit/web-datac
|
|
|
3
3
|
<slot name="icon"></slot>
|
|
4
4
|
<slot></slot>
|
|
5
5
|
</button>
|
|
6
|
-
`,e.append(t.createStyleElement().cloneNode(true));}async connectedCallback(){let o=await new ScanditIconBuilder().withIcon(ScanditIconType.ChevronDown).withIconColor(Color.fromHex("#3D4852").withAlpha(.8)).withWidth(24).withHeight(24).withIconSize(20).build();o.setAttribute("slot","icon"),this.append(o);}static create(){return document.createElement(t.tag)}static register(){defineCustomElements({[t.tag]:t});}static createStyleElement(){return css`:host{display:inline-block;font-family:SF Pro Text,sans-serif}:host button{align-items:center;background-color
|
|
6
|
+
`,e.append(t.createStyleElement().cloneNode(true));}async connectedCallback(){let o=await new ScanditIconBuilder().withIcon(ScanditIconType.ChevronDown).withIconColor(Color.fromHex("#3D4852").withAlpha(.8)).withWidth(24).withHeight(24).withIconSize(20).build();o.setAttribute("slot","icon"),this.append(o);}static create(){return document.createElement(t.tag)}static register(){defineCustomElements({[t.tag]:t});}static createStyleElement(){return css`:host{display:inline-block;font-family:SF Pro Text,sans-serif}:host button{align-items:center;background-color:#ffffffe6;border:none;border-radius:1rem;color:#3d4852cc;display:flex;font-size:.688rem;font-weight:600;gap:.25rem;justify-content:center;min-width:140px;min-width:100px;padding:.25rem .5rem}`}};t.tag="scandit-find-card-list-button";var n=t;n.register();export{n as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-
|
|
1
|
+
import {a as a$1}from'./chunk-QZGFNS2K.js';import {a as a$2}from'./chunk-CYVVGAZ4.js';import {Color,ScanditIcon,ScanditIconBuilder,ScanditIconType,ScanditIconShape}from'@scandit/web-datacapture-core';import {SecondaryOrange100,gray900}from'@scandit/web-datacapture-core/build/js/private/ui/colors.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';var c=(o=>(o[o.Top="top-center"]="Top",o[o.Bottom="bottom-center"]="Bottom",o[o.Left="left-center"]="Left",o[o.Right="right-center"]="Right",o))(c||{}),i=class i extends ScanditHTMLElement{constructor(){super();this.annotationTrigger="highlightTapAndBarcodeScan";this.anchor=c.Bottom;this.onToggleListener=this.onToggle.bind(this);this._backgroundColor=Color.fromHex("#fff");this._icon=null;this.statusIconContainer=a$1.create();}get barcode(){return this._barcode}set barcode(t){this._barcode=t;}set text(t){this.statusIconContainer.text=t;}get text(){return this.statusIconContainer.text}set hasTip(t){this.statusIconContainer.toggleAttribute("tip",t);}get hasTip(){return this.statusIconContainer.hasAttribute("tip")}set icon(t){var e;(e=this.icon)==null||e.remove(),this._icon=t,t&&(t.slot="barcode-icon",t.width=24,t.height=24,t.setIconSize(16),this.statusIconContainer.append(t));}get icon(){var t;return (t=this.statusIconContainer.querySelector(ScanditIcon.tag))!=null?t:this._icon}set backgroundColor(t){this._backgroundColor=t,this.statusIconContainer.backgroundColor=t;}get backgroundColor(){return this.statusIconContainer.backgroundColor}set textColor(t){this.statusIconContainer.textColor=t;}get textColor(){return this.statusIconContainer.textColor}static create(t){i.register();let e=document.createElement(i.tag);return e.barcode=t,e}static register(){defineCustomElements({[a$1.tag]:a$1,[i.tag]:i});}async connectedCallback(){if(!this._icon){let e=new ScanditIconBuilder().withIcon(ScanditIconType.ExclamationMark).withBackgroundShape(ScanditIconShape.Circle).withBackgroundColor(SecondaryOrange100).withIconColor(gray900).withWidth(24).withHeight(24).withIconSize(16);this._icon=await e.build();}this.icon=this._icon;let t=css`${i.tag}{align-items:center;display:flex;justify-content:center;min-height:48px;min-width:48px}`;this.append(t),this.append(this.statusIconContainer),this.statusIconContainer.append(this.icon),this.addEventListener("pointerup",this.onToggleListener);}disconnectedCallback(){this.removeEventListener("pointerup",this.onToggleListener);}onToggle(){this.statusIconContainer.expanded=!this.statusIconContainer.expanded;}updatePosition(t,e,o){a$2(this,t,e,o);}};i.tag="scandit-barcode-ar-status-icon-annotation";var a=i;export{c as a,a as b};
|