UNPKG

@scandit/web-datacapture-barcode

Version:

Scandit Data Capture SDK for the Web

7 lines (4 loc) 1.85 kB
import { b } from './chunk-XCZGCZ5K.js'; import { RadiusLocationSelection, NumberWithUnit } from '@scandit/web-datacapture-core'; var a=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={};this.enableTargetModeHiddenProperties(1);}get enabledSymbologies(){return Object.keys(this.symbologies).filter(o=>{var i;return (i=this.symbologies[o])==null?void 0:i.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,!0);}enableSymbology(e,o){this.settingsForSymbology(e).isEnabled=o;}toJSONObject(){var i;let e={},o=Object.keys(this.symbologies);return {codeDuplicateFilter:this.codeDuplicateFilter,locationSelection:this.locationSelection.toJSONObject(),properties:{...this.properties},symbologies:o.reduce((n,r)=>{var S;let s=(S=this.symbologies[r])==null?void 0:S.toJSONObject();return s&&(n[r]=s),n},e),scanIntention:(i=this.scanIntention)!=null?i:null}}enableTargetModeHiddenProperties(e){var i;let o=(i={1:b.SparkScan.SparkScanSettings.hiddenProperties.zoom1x,2:b.SparkScan.SparkScanSettings.hiddenProperties.zoom2x}[e])!=null?i:{};for(let[n,r]of Object.entries(o))this.setProperty(n,r);}disableTargetModeHiddenProperties(){let e={...b.SparkScan.SparkScanSettings.hiddenProperties.zoom1x,...b.SparkScan.SparkScanSettings.hiddenProperties.zoom2x};for(let[o]of Object.entries(e))this.setProperty(o,void 0);}}; export { a };