├── API_Reference_BarcodeScanner.url
├── API_Reference_Foundational.url
├── LEGAL.txt
├── LICENSE
├── README.html
├── README.md
├── dist
├── DBR-PresetTemplates.json
├── barcode-scanner.ui.xml
├── dbr.bundle.d.ts
├── dbr.bundle.esm.d.ts
├── dbr.bundle.js
├── dbr.bundle.mjs
├── dbr.no-content-bundle.esm.js
├── dynamsoft-barcode-reader@10.4.31
│ └── dist
│ │ ├── DBR-PresetTemplates.json
│ │ ├── dbr.d.ts
│ │ ├── dbr.esm.js
│ │ └── dbr.js
├── dynamsoft-camera-enhancer@4.1.1
│ └── dist
│ │ ├── dce.d.ts
│ │ ├── dce.esm.js
│ │ ├── dce.js
│ │ ├── dce.mobile-native.ui.html
│ │ └── dce.ui.html
├── dynamsoft-capture-vision-router@2.4.33
│ └── dist
│ │ ├── cvr.d.ts
│ │ ├── cvr.esm.js
│ │ ├── cvr.js
│ │ └── cvr.worker.js
├── dynamsoft-capture-vision-std@1.4.21
│ └── dist
│ │ ├── dynamsoft-barcode-reader-bundle.js
│ │ └── dynamsoft-barcode-reader-bundle.wasm
├── dynamsoft-core@3.4.31
│ └── dist
│ │ ├── core.d.ts
│ │ ├── core.esm.js
│ │ ├── core.js
│ │ └── core.worker.js
├── dynamsoft-license@3.4.31
│ └── dist
│ │ ├── dls.license.dialog.html
│ │ ├── license.d.ts
│ │ ├── license.esm.js
│ │ ├── license.js
│ │ └── license.worker.js
└── dynamsoft-utility@1.4.32
│ └── dist
│ ├── utility.d.ts
│ ├── utility.esm.js
│ ├── utility.js
│ └── utility.worker.js
├── package.json
└── samples.url
/API_Reference_BarcodeScanner.url:
--------------------------------------------------------------------------------
1 | [InternetShortcut]
2 | URL=https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/barcode-scanner.html
--------------------------------------------------------------------------------
/API_Reference_Foundational.url:
--------------------------------------------------------------------------------
1 | [InternetShortcut]
2 | URL=https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/index.html
--------------------------------------------------------------------------------
/LEGAL.txt:
--------------------------------------------------------------------------------
1 | ===================================================================================
2 | >>>>>>>>>>>>>>>>>>>>>>>>>>> dynamsoft-barcode-reader <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
3 | ===================================================================================
4 |
5 | Legal Notices:
6 |
7 | This SDK contains parts of following softwares which are used under license.
8 |
9 | ===================================================================================
10 | Zlib.
11 |
12 | (C) 1995-2022 Jean-loup Gailly and Mark Adler
13 |
14 | This software is provided 'as-is', without any express or implied
15 | warranty. In no event will the authors be held liable for any damages
16 | arising from the use of this software.
17 |
18 | Permission is granted to anyone to use this software for any purpose,
19 | including commercial applications, and to alter it and redistribute it
20 | freely, subject to the following restrictions:
21 |
22 | 1. The origin of this software must not be misrepresented; you must not
23 | claim that you wrote the original software. If you use this software
24 | in a product, an acknowledgment in the product documentation would be
25 | appreciated but is not required.
26 | 2. Altered source versions must be plainly marked as such, and must not be
27 | misrepresented as being the original software.
28 | 3. This notice may not be removed or altered from any source distribution.
29 |
30 | Jean-loup Gailly Mark Adler
31 | jloup@gzip.org madler@alumni.caltech.edu
32 | ===================================================================================
33 |
34 |
35 |
36 | ===================================================================================
37 | Google's open-source ZXing ("Zebra Crossing")
38 |
39 | Apache License
40 | Version 2.0, January 2004
41 | http://www.apache.org/licenses/
42 |
43 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
44 |
45 | 1. Definitions.
46 |
47 | "License" shall mean the terms and conditions for use, reproduction,
48 | and distribution as defined by Sections 1 through 9 of this document.
49 |
50 | "Licensor" shall mean the copyright owner or entity authorized by
51 | the copyright owner that is granting the License.
52 |
53 | "Legal Entity" shall mean the union of the acting entity and all
54 | other entities that control, are controlled by, or are under common
55 | control with that entity. For the purposes of this definition,
56 | "control" means (i) the power, direct or indirect, to cause the
57 | direction or management of such entity, whether by contract or
58 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
59 | outstanding shares, or (iii) beneficial ownership of such entity.
60 |
61 | "You" (or "Your") shall mean an individual or Legal Entity
62 | exercising permissions granted by this License.
63 |
64 | "Source" form shall mean the preferred form for making modifications,
65 | including but not limited to software source code, documentation
66 | source, and configuration files.
67 |
68 | "Object" form shall mean any form resulting from mechanical
69 | transformation or translation of a Source form, including but
70 | not limited to compiled object code, generated documentation,
71 | and conversions to other media types.
72 |
73 | "Work" shall mean the work of authorship, whether in Source or
74 | Object form, made available under the License, as indicated by a
75 | copyright notice that is included in or attached to the work
76 | (an example is provided in the Appendix below).
77 |
78 | "Derivative Works" shall mean any work, whether in Source or Object
79 | form, that is based on (or derived from) the Work and for which the
80 | editorial revisions, annotations, elaborations, or other modifications
81 | represent, as a whole, an original work of authorship. For the purposes
82 | of this License, Derivative Works shall not include works that remain
83 | separable from, or merely link (or bind by name) to the interfaces of,
84 | the Work and Derivative Works thereof.
85 |
86 | "Contribution" shall mean any work of authorship, including
87 | the original version of the Work and any modifications or additions
88 | to that Work or Derivative Works thereof, that is intentionally
89 | submitted to Licensor for inclusion in the Work by the copyright owner
90 | or by an individual or Legal Entity authorized to submit on behalf of
91 | the copyright owner. For the purposes of this definition, "submitted"
92 | means any form of electronic, verbal, or written communication sent
93 | to the Licensor or its representatives, including but not limited to
94 | communication on electronic mailing lists, source code control systems,
95 | and issue tracking systems that are managed by, or on behalf of, the
96 | Licensor for the purpose of discussing and improving the Work, but
97 | excluding communication that is conspicuously marked or otherwise
98 | designated in writing by the copyright owner as "Not a Contribution."
99 |
100 | "Contributor" shall mean Licensor and any individual or Legal Entity
101 | on behalf of whom a Contribution has been received by Licensor and
102 | subsequently incorporated within the Work.
103 |
104 | 2. Grant of Copyright License. Subject to the terms and conditions of
105 | this License, each Contributor hereby grants to You a perpetual,
106 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
107 | copyright license to reproduce, prepare Derivative Works of,
108 | publicly display, publicly perform, sublicense, and distribute the
109 | Work and such Derivative Works in Source or Object form.
110 |
111 | 3. Grant of Patent License. Subject to the terms and conditions of
112 | this License, each Contributor hereby grants to You a perpetual,
113 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
114 | (except as stated in this section) patent license to make, have made,
115 | use, offer to sell, sell, import, and otherwise transfer the Work,
116 | where such license applies only to those patent claims licensable
117 | by such Contributor that are necessarily infringed by their
118 | Contribution(s) alone or by combination of their Contribution(s)
119 | with the Work to which such Contribution(s) was submitted. If You
120 | institute patent litigation against any entity (including a
121 | cross-claim or counterclaim in a lawsuit) alleging that the Work
122 | or a Contribution incorporated within the Work constitutes direct
123 | or contributory patent infringement, then any patent licenses
124 | granted to You under this License for that Work shall terminate
125 | as of the date such litigation is filed.
126 |
127 | 4. Redistribution. You may reproduce and distribute copies of the
128 | Work or Derivative Works thereof in any medium, with or without
129 | modifications, and in Source or Object form, provided that You
130 | meet the following conditions:
131 |
132 | (a) You must give any other recipients of the Work or
133 | Derivative Works a copy of this License; and
134 |
135 | (b) You must cause any modified files to carry prominent notices
136 | stating that You changed the files; and
137 |
138 | (c) You must retain, in the Source form of any Derivative Works
139 | that You distribute, all copyright, patent, trademark, and
140 | attribution notices from the Source form of the Work,
141 | excluding those notices that do not pertain to any part of
142 | the Derivative Works; and
143 |
144 | (d) If the Work includes a "NOTICE" text file as part of its
145 | distribution, then any Derivative Works that You distribute must
146 | include a readable copy of the attribution notices contained
147 | within such NOTICE file, excluding those notices that do not
148 | pertain to any part of the Derivative Works, in at least one
149 | of the following places: within a NOTICE text file distributed
150 | as part of the Derivative Works; within the Source form or
151 | documentation, if provided along with the Derivative Works; or,
152 | within a display generated by the Derivative Works, if and
153 | wherever such third-party notices normally appear. The contents
154 | of the NOTICE file are for informational purposes only and
155 | do not modify the License. You may add Your own attribution
156 | notices within Derivative Works that You distribute, alongside
157 | or as an addendum to the NOTICE text from the Work, provided
158 | that such additional attribution notices cannot be construed
159 | as modifying the License.
160 |
161 | You may add Your own copyright statement to Your modifications and
162 | may provide additional or different license terms and conditions
163 | for use, reproduction, or distribution of Your modifications, or
164 | for any such Derivative Works as a whole, provided Your use,
165 | reproduction, and distribution of the Work otherwise complies with
166 | the conditions stated in this License.
167 |
168 | 5. Submission of Contributions. Unless You explicitly state otherwise,
169 | any Contribution intentionally submitted for inclusion in the Work
170 | by You to the Licensor shall be under the terms and conditions of
171 | this License, without any additional terms or conditions.
172 | Notwithstanding the above, nothing herein shall supersede or modify
173 | the terms of any separate license agreement you may have executed
174 | with Licensor regarding such Contributions.
175 |
176 | 6. Trademarks. This License does not grant permission to use the trade
177 | names, trademarks, service marks, or product names of the Licensor,
178 | except as required for reasonable and customary use in describing the
179 | origin of the Work and reproducing the content of the NOTICE file.
180 |
181 | 7. Disclaimer of Warranty. Unless required by applicable law or
182 | agreed to in writing, Licensor provides the Work (and each
183 | Contributor provides its Contributions) on an "AS IS" BASIS,
184 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
185 | implied, including, without limitation, any warranties or conditions
186 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
187 | PARTICULAR PURPOSE. You are solely responsible for determining the
188 | appropriateness of using or redistributing the Work and assume any
189 | risks associated with Your exercise of permissions under this License.
190 |
191 | 8. Limitation of Liability. In no event and under no legal theory,
192 | whether in tort (including negligence), contract, or otherwise,
193 | unless required by applicable law (such as deliberate and grossly
194 | negligent acts) or agreed to in writing, shall any Contributor be
195 | liable to You for damages, including any direct, indirect, special,
196 | incidental, or consequential damages of any character arising as a
197 | result of this License or out of the use or inability to use the
198 | Work (including but not limited to damages for loss of goodwill,
199 | work stoppage, computer failure or malfunction, or any and all
200 | other commercial damages or losses), even if such Contributor
201 | has been advised of the possibility of such damages.
202 |
203 | 9. Accepting Warranty or Additional Liability. While redistributing
204 | the Work or Derivative Works thereof, You may choose to offer,
205 | and charge a fee for, acceptance of support, warranty, indemnity,
206 | or other liability obligations and/or rights consistent with this
207 | License. However, in accepting such obligations, You may act only
208 | on Your own behalf and on Your sole responsibility, not on behalf
209 | of any other Contributor, and only if You agree to indemnify,
210 | defend, and hold each Contributor harmless for any liability
211 | incurred by, or claims asserted against, such Contributor by reason
212 | of your accepting any such warranty or additional liability.
213 |
214 | END OF TERMS AND CONDITIONS
215 |
216 | APPENDIX: How to apply the Apache License to your work.
217 |
218 | To apply the Apache License to your work, attach the following
219 | boilerplate notice, with the fields enclosed by brackets "[]"
220 | replaced with your own identifying information. (Don't include
221 | the brackets!) The text should be enclosed in the appropriate
222 | comment syntax for the file format. We also recommend that a
223 | file or class name and description of purpose be included on the
224 | same "printed page" as the copyright notice for easier
225 | identification within third-party archives.
226 |
227 | Copyright [yyyy] [name of copyright owner]
228 |
229 | Licensed under the Apache License, Version 2.0 (the "License");
230 | you may not use this file except in compliance with the License.
231 | You may obtain a copy of the License at
232 |
233 | http://www.apache.org/licenses/LICENSE-2.0
234 |
235 | Unless required by applicable law or agreed to in writing, software
236 | distributed under the License is distributed on an "AS IS" BASIS,
237 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
238 | See the License for the specific language governing permissions and
239 | limitations under the License.
240 | ===================================================================================
241 |
242 |
243 |
244 | ===================================================================================
245 | OpenCV 4.5.2
246 |
247 |
248 | Copyright 2022, OpenCV Foundation
249 |
250 |
251 |
252 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
253 |
254 | http://www.apache.org/licenses/LICENSE-2.0
255 |
256 |
257 |
258 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
259 | ===================================================================================
260 |
261 |
262 |
263 | ===================================================================================
264 | JsonCpp library
265 |
266 | The JsonCpp library's source code, including accompanying documentation,
267 | tests and demonstration applications, are licensed under the following
268 | conditions...
269 |
270 | The author (Baptiste Lepilleur) explicitly disclaims copyright in all
271 | jurisdictions which recognize such a disclaimer. In such jurisdictions,
272 | this software is released into the Public Domain.
273 |
274 | In jurisdictions which do not recognize Public Domain property (e.g. Germany as of
275 | 2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is
276 | released under the terms of the MIT License (see below).
277 |
278 | In jurisdictions which recognize Public Domain property, the user of this
279 | software may choose to accept it either as 1) Public Domain, 2) under the
280 | conditions of the MIT License (see below), or 3) under the terms of dual
281 | Public Domain/MIT License conditions described here, as they choose.
282 |
283 | The MIT License is about as close to Public Domain as a license can get, and is
284 | described in clear, concise terms at:
285 |
286 | http://en.wikipedia.org/wiki/MIT_License
287 |
288 | The full text of the MIT License follows:
289 |
290 | ========================================================================
291 | Copyright (c) 2007-2010 Baptiste Lepilleur
292 |
293 | Permission is hereby granted, free of charge, to any person
294 | obtaining a copy of this software and associated documentation
295 | files (the "Software"), to deal in the Software without
296 | restriction, including without limitation the rights to use, copy,
297 | modify, merge, publish, distribute, sublicense, and/or sell copies
298 | of the Software, and to permit persons to whom the Software is
299 | furnished to do so, subject to the following conditions:
300 |
301 | The above copyright notice and this permission notice shall be
302 | included in all copies or substantial portions of the Software.
303 |
304 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
305 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
306 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
307 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
308 | BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
309 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
310 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
311 | SOFTWARE.
312 | ========================================================================
313 | (END LICENSE TEXT)
314 |
315 | The MIT license is compatible with both the GPL and commercial
316 | software, affording one all of the rights of Public Domain with the
317 | minor nuisance of being required to keep the above copyright notice
318 | and license text in the source code. Note also that by accepting the
319 | Public Domain "license" you can re-license your copy using whatever
320 | license you like.
321 | ===================================================================================
322 |
323 |
324 |
325 | ===================================================================================
326 | Leptonica
327 |
328 | /*====================================================================*
329 | - Copyright (C) 2001-2020 Leptonica. All rights reserved.
330 | -
331 | - Redistribution and use in source and binary forms, with or without
332 | - modification, are permitted provided that the following conditions
333 | - are met:
334 | - 1. Redistributions of source code must retain the above copyright
335 | - notice, this list of conditions and the following disclaimer.
336 | - 2. Redistributions in binary form must reproduce the above
337 | - copyright notice, this list of conditions and the following
338 | - disclaimer in the documentation and/or other materials
339 | - provided with the distribution.
340 | -
341 | - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
342 | - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
343 | - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
344 | - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANY
345 | - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
346 | - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
347 | - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
348 | - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
349 | - OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
350 | - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
351 | - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
352 | *====================================================================*/
353 | ===================================================================================
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright © 2003–2025 Dynamsoft. All Rights Reserved.
2 |
3 | The use of this software is governed by the Dynamsoft Terms and Conditions.
4 | URL=https://www.dynamsoft.com/barcode-reader/license-agreement/#javascript
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Barcode Scanner JavaScript Edition - User Guide
2 |
3 | - [Barcode Scanner JavaScript Edition - User Guide](#barcode-scanner-javascript-edition---user-guide)
4 | - [License](#license)
5 | - [Trial License](#trial-license)
6 | - [Full License](#full-license)
7 | - [Quick Start: Hello World Example](#quick-start-hello-world-example)
8 | - [Step 1: Setting up the HTML and Including the Barcode Scanner](#step-1-setting-up-the-html-and-including-the-barcode-scanner)
9 | - [Step 2: Initializing the Barcode Scanner](#step-2-initializing-the-barcode-scanner)
10 | - [Step 3: Launching the Barcode Scanner](#step-3-launching-the-barcode-scanner)
11 | - [Next Steps](#next-steps)
12 |
13 | This user guide provides a step-by-step walkthrough of a "Hello World" web application using the `BarcodeScanner` JavaScript Edition.
14 |
15 | The `BarcodeScanner` class offers the following features:
16 |
17 | - High-level APIs that deliver core functionality with a single line of code.
18 |
19 | - Pre-built UI components for fast and easy integration.
20 |
21 | - Intuitive configuration objects that streamline both algorithm and UI setup.
22 |
23 | We recommend using this guide as a reference when creating your own application. If you are looking for a fully customizable barcode decoding library, you are welcome to use the [Foundational APIs](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/index.html). Before starting, ensure the **basic requirements** are met.
24 |
25 |
38 |
39 | - Internet connection
40 | - A supported browser
41 | - Camera access
42 |
43 | > [!TIP]
44 | > Please refer to [system requirements](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/faq/system-requirement.html) for more details.
45 |
46 | ## License
47 |
48 | ### Trial License
49 |
50 |
55 |
56 | When getting started with Barcode Scanner, we recommend [getting your own 30-day trial license](https://www.dynamsoft.com/customer/license/trialLicense/?product=dbr&utm_source=github&package=js)
57 |
58 |
59 |
60 | > [!IMPORTANT]
61 | > The trial license can be renewed via the [customer portal](https://www.dynamsoft.com/customer/license/trialLicense/?product=dbr&utm_source=github&package=js) twice, each time for another 15 days, giving you a total of 60 days to develop your own application using the solution. Please contact the [Dynamsoft Support Team](https://www.dynamsoft.com/company/contact/) if you need more time for a full evaluation.
62 |
63 | ### Full License
64 |
65 | If you are fully satisfied with the solution and would like to move forward with a full license, please contact the [Dynamsoft Sales Team](https://www.dynamsoft.com/company/contact/).
66 |
67 | ## Quick Start: Hello World Example
68 |
69 | ```html
70 |
71 |
72 |
73 |
74 |
75 | Dynamsoft Barcode Scanner - Hello World
76 |
77 |
78 |
79 |
80 | Dynamsoft Barcode Scanner
81 |
82 |
94 |
95 |
96 | ```
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 | ### Step 1: Setting up the HTML and Including the Barcode Scanner
113 |
114 | As outlined earlier, this guide will help you create a simple Hello World barcode scanning application using vanilla JavaScript. The full sample code is also available in the [GitHub repository](https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v10.5.30).
115 |
116 | The first step before writing the code is to include the SDK in your application. You can simply include the SDK by using the precompiled script.
117 |
118 | ```html
119 |
120 |
121 |
122 |
123 |
124 | Dynamsoft Barcode Scanner - Hello World
125 |
126 |
127 |
128 |
129 | Dynamsoft Barcode Scanner
130 |
131 |
132 |
133 | ```
134 |
135 | In this example, we include the precompiled Barcode Scanner SDK script via public CDN in the header.
136 |
137 |
138 |
139 |
140 | Use a public CDN
141 |
142 | The simplest way to include the SDK is to use either the [**jsDelivr**](https://jsdelivr.com/) or [**UNPKG**](https://unpkg.com/) CDN.
143 |
144 | - jsDelivr
145 |
146 | ```html
147 |
148 | ```
149 |
150 | - UNPKG
151 |
152 | ```html
153 |
154 | ```
155 |
156 | When using a framework such as **React**, **Vue** or **Angular**, we recommend adding the package as a dependency using a package manager such as **npm** or **yarn**:
157 |
158 | ```sh
159 | npm i dynamsoft-barcode-reader-bundle@10.5.3000
160 | # or
161 | yarn add dynamsoft-barcode-reader-bundle@10.5.3000
162 | ```
163 |
164 | As for package managers like **npm** or **yarn**, you likely need to specify the location of the engine files as a link to a CDN. Please see the [BarcodeScannerConfig API](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/barcode-scanner.html#barcodescannerconfig) for a code snippet on how to set the `engineResourcePaths`.
165 |
166 |
167 |
168 | Host the SDK yourself
169 |
170 | Alternatively, you may choose to download the SDK and host the files on your own server or preferred CDN. This approach provides better control over versioning and availability.
171 |
172 | - From the website
173 |
174 | [Download Dynamsoft Barcode Reader JavaScript Package](https://www.dynamsoft.com/barcode-reader/downloads/?ver=10.5.30&utm_source=github&product=dbr&package=js)
175 |
176 | The resources are located at path `dynamsoft/distributables/`.
177 |
178 | - From npm
179 |
180 | ```sh
181 | npm i dynamsoft-barcode-reader-bundle@10.5.3000
182 | ```
183 |
184 | The resources are located at the path `node_modules/`, without `@`. You can copy it elsewhere and add `@` tag. One more thing to do is to [specify the engineResourcePaths](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/barcode-scanner.html#barcodescannerconfig) so that the SDK can correctly locate the resources.
185 |
186 | > [!IMPORTANT]
187 | > Since "node_modules" is reserved for Node.js dependencies, and in our case the package is used only as static resources, we recommend either renaming the "node_modules" folder or moving the "dynamsoft-" packages to a dedicated folder for static resources in your project to facilitate self-hosting.
188 |
189 | You can typically include SDK like this:
190 |
191 | ```html
192 |
193 | ```
194 |
195 |
196 |
197 |
198 | Barcode Scanner comes with a **Ready-to-Use UI**. When the Barcode Scanner launches, it creates a container which it populates with the **Ready-to-Use UI**.
199 |
200 | ### Step 2: Initializing the Barcode Scanner
201 |
202 | ```js
203 | // Initialize the Dynamsoft Barcode Scanner
204 | const Barcodescanner = new Dynamsoft.BarcodeScanner({
205 | // Please don't forget to replace YOUR_LICENSE_KEY_HERE
206 | license: "YOUR_LICENSE_KEY_HERE",
207 | });
208 | ```
209 |
210 | This is the **simplest** way to initialize the Barcode Scanner. The configuration object must include a valid **license** key. Without it, the scanner will fail to launch and display an error. For help obtaining a license, see the [licensing](#license) section.
211 |
212 | > [!TIP]
213 | > By default, the `BarcodeScanner` scans a single barcode at a time. However, it also supports a `MULTI_UNIQUE` scanning mode, which continuously scans and accumulates unique results in real time. You can enable this mode by modifying the [`BarcodeScannerConfig`](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/barcode-scanner.html#barcodescannerconfig) as follows:
214 |
215 | ```js
216 | // Initialize the Dynamsoft Barcode Scanner in MULTI_UNIQUE mode
217 | const barcodescanner = new Dynamsoft.BarcodeScanner({
218 | license: "YOUR_LICENSE_KEY_HERE",
219 | scanMode: Dynamsoft.EnumScanMode.SM_MULTI_UNIQUE,
220 | showResultView: true,
221 | });
222 | ```
223 |
224 | ### Step 3: Launching the Barcode Scanner
225 |
226 | ```js
227 | (async () => {
228 | // Launch the scanner and wait for the result
229 | const result = await barcodescanner.launch();
230 | alert(result.barcodeResults[0].text);
231 | })();
232 | ```
233 |
234 | Now that the Barcode Scanner has been initialized and configured, it is ready to be launched! Upon launch, the Barcode Scanner presents the main **`BarcodeScannerView`** UI in its container on the page, and is ready to start scanning. By default, we use the `SINGLE` scanning mode, which means only one decoding result will be included in the final result. In the code above, we directly alerted the successfully decoded barcode text on the page.
235 |
236 | > [!NOTE]
237 | > In the Hello World sample, after a successfully decoding process, the scanner closes and the user is met with an empty page. In order to open the scanner again, the user must refresh the page. You may choose to implement a more user-friendly behavior in a production environment, such as presenting the user with an option to re-open the Barcode Scanner upon closing it.
238 |
239 | ## Next Steps
240 |
241 | Now that you've implemented the basic functionality, here are some recommended next steps to further explore the capabilities of the Barcode Scanner
242 |
243 | 1. Learn how to [Customize the Barcode Scanner](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/barcode-scanner-customization.html)
244 | 2. Check out the [Official Samples and Demo](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/samples-demos/index.html?ver=10.5.30)
245 | 3. Learn about the [APIs of BarcodeScanner](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/barcode-scanner.html?ver=10.5.3000)
246 |
--------------------------------------------------------------------------------
/dist/DBR-PresetTemplates.json:
--------------------------------------------------------------------------------
1 | {
2 | "CaptureVisionTemplates": [
3 | {
4 | "Name": "ReadBarcodes_Default",
5 | "ImageROIProcessingNameArray": [
6 | "roi-read-barcodes"
7 | ],
8 | "Timeout": 10000
9 | },
10 | {
11 | "Name": "ReadBarcodes_SpeedFirst",
12 | "ImageROIProcessingNameArray": [
13 | "roi-read-barcodes-speed-first"
14 | ],
15 | "Timeout": 10000
16 | },
17 | {
18 | "Name": "ReadBarcodes_ReadRateFirst",
19 | "ImageROIProcessingNameArray": [
20 | "roi-read-barcodes-read-rate"
21 | ],
22 | "Timeout": 100000
23 | },
24 | {
25 | "Name": "ReadSingleBarcode",
26 | "ImageROIProcessingNameArray": [
27 | "roi-read-single-barcode"
28 | ],
29 | "Timeout": 10000
30 | },
31 | {
32 | "Name": "ReadBarcodes_Balance",
33 | "ImageROIProcessingNameArray": [
34 | "roi-read-barcodes-balance"
35 | ],
36 | "Timeout": 100000
37 | },
38 | {
39 | "Name": "ReadDenseBarcodes",
40 | "ImageROIProcessingNameArray": [
41 | "roi-read-barcodes-dense"
42 | ],
43 | "Timeout": 10000
44 | },
45 | {
46 | "Name": "ReadDistantBarcodes",
47 | "ImageROIProcessingNameArray": [
48 | "roi-read-barcodes-distant"
49 | ],
50 | "Timeout": 10000
51 | }
52 | ],
53 | "TargetROIDefOptions": [
54 | {
55 | "Name": "roi-read-barcodes",
56 | "TaskSettingNameArray": [
57 | "task-read-barcodes"
58 | ]
59 | },
60 | {
61 | "Name": "roi-read-barcodes-speed-first",
62 | "TaskSettingNameArray": [
63 | "task-read-barcodes-speed-first"
64 | ]
65 | },
66 | {
67 | "Name": "roi-read-barcodes-read-rate",
68 | "TaskSettingNameArray": [
69 | "task-read-barcodes-read-rate"
70 | ]
71 | },
72 | {
73 | "Name": "roi-read-single-barcode",
74 | "TaskSettingNameArray": [
75 | "task-read-single-barcode"
76 | ]
77 | },
78 | {
79 | "Name": "roi-read-barcodes-balance",
80 | "TaskSettingNameArray": [
81 | "task-read-barcodes-balance"
82 | ]
83 | },
84 | {
85 | "Name": "roi-read-barcodes-dense",
86 | "TaskSettingNameArray": [
87 | "task-read-barcodes-dense"
88 | ]
89 | },
90 | {
91 | "Name": "roi-read-barcodes-distant",
92 | "TaskSettingNameArray": [
93 | "task-read-barcodes-distant"
94 | ]
95 | }
96 | ],
97 | "BarcodeFormatSpecificationOptions": [
98 | {
99 | "Name": "bfs1",
100 | "BarcodeFormatIds": [
101 | "BF_PDF417",
102 | "BF_QR_CODE",
103 | "BF_DATAMATRIX",
104 | "BF_AZTEC",
105 | "BF_MICRO_QR",
106 | "BF_MICRO_PDF417",
107 | "BF_DOTCODE"
108 | ],
109 | "MirrorMode": "MM_BOTH"
110 | },
111 | {
112 | "Name": "bfs2",
113 | "BarcodeFormatIds": [
114 | "BF_ALL"
115 | ],
116 | "MirrorMode": "MM_NORMAL"
117 | },
118 | {
119 | "Name": "bfs1-speed-first",
120 | "BaseBarcodeFormatSpecification": "bfs1"
121 | },
122 | {
123 | "Name": "bfs2-speed-first",
124 | "BaseBarcodeFormatSpecification": "bfs2"
125 | },
126 | {
127 | "Name": "bfs1-read-rate-first",
128 | "BaseBarcodeFormatSpecification": "bfs1"
129 | },
130 | {
131 | "Name": "bfs2-read-rate-first",
132 | "BaseBarcodeFormatSpecification": "bfs2"
133 | },
134 | {
135 | "Name": "bfs1-single-barcode",
136 | "BaseBarcodeFormatSpecification": "bfs1"
137 | },
138 | {
139 | "Name": "bfs2-single-barcode",
140 | "BaseBarcodeFormatSpecification": "bfs2"
141 | },
142 | {
143 | "Name": "bfs1-balance",
144 | "BaseBarcodeFormatSpecification": "bfs1"
145 | },
146 | {
147 | "Name": "bfs2-balance",
148 | "BaseBarcodeFormatSpecification": "bfs2"
149 | },
150 | {
151 | "Name": "bfs1-dense",
152 | "BaseBarcodeFormatSpecification": "bfs1"
153 | },
154 | {
155 | "Name": "bfs2-dense",
156 | "BaseBarcodeFormatSpecification": "bfs2"
157 | },
158 | {
159 | "Name": "bfs1-distant",
160 | "BaseBarcodeFormatSpecification": "bfs1"
161 | },
162 | {
163 | "Name": "bfs2-distant",
164 | "BaseBarcodeFormatSpecification": "bfs2"
165 | }
166 | ],
167 | "BarcodeReaderTaskSettingOptions": [
168 | {
169 | "Name": "task-read-barcodes",
170 | "ExpectedBarcodesCount": 0,
171 | "LocalizationModes": [
172 | {
173 | "Mode": "LM_CONNECTED_BLOCKS"
174 | },
175 | {
176 | "Mode": "LM_LINES"
177 | }
178 | ],
179 | "DeblurModes": [
180 | {
181 | "Mode": "DM_BASED_ON_LOC_BIN"
182 | },
183 | {
184 | "Mode": "DM_THRESHOLD_BINARIZATION"
185 | }
186 | ],
187 | "BarcodeFormatSpecificationNameArray": [
188 | "bfs1",
189 | "bfs2"
190 | ],
191 | "SectionImageParameterArray": [
192 | {
193 | "Section": "ST_REGION_PREDETECTION",
194 | "ImageParameterName": "ip-read-barcodes"
195 | },
196 | {
197 | "Section": "ST_BARCODE_LOCALIZATION",
198 | "ImageParameterName": "ip-read-barcodes"
199 | },
200 | {
201 | "Section": "ST_BARCODE_DECODING",
202 | "ImageParameterName": "ip-read-barcodes"
203 | }
204 | ]
205 | },
206 | {
207 | "Name": "task-read-barcodes-speed-first",
208 | "ExpectedBarcodesCount": 0,
209 | "LocalizationModes": [
210 | {
211 | "Mode": "LM_SCAN_DIRECTLY",
212 | "ScanDirection": 2
213 | },
214 | {
215 | "Mode": "LM_CONNECTED_BLOCKS"
216 | }
217 | ],
218 | "DeblurModes": [
219 | {
220 | "Mode": "DM_BASED_ON_LOC_BIN"
221 | },
222 | {
223 | "Mode": "DM_THRESHOLD_BINARIZATION"
224 | },
225 | {
226 | "Mode": "DM_DEEP_ANALYSIS"
227 | }
228 | ],
229 | "BarcodeFormatSpecificationNameArray": [
230 | "bfs1-speed-first",
231 | "bfs2-speed-first"
232 | ],
233 | "SectionImageParameterArray": [
234 | {
235 | "Section": "ST_REGION_PREDETECTION",
236 | "ImageParameterName": "ip-read-barcodes-speed-first"
237 | },
238 | {
239 | "Section": "ST_BARCODE_LOCALIZATION",
240 | "ImageParameterName": "ip-read-barcodes-speed-first"
241 | },
242 | {
243 | "Section": "ST_BARCODE_DECODING",
244 | "ImageParameterName": "ip-read-barcodes-speed-first"
245 | }
246 | ]
247 | },
248 | {
249 | "Name": "task-read-barcodes-read-rate",
250 | "ExpectedBarcodesCount": 999,
251 | "LocalizationModes": [
252 | {
253 | "Mode": "LM_CONNECTED_BLOCKS"
254 | },
255 | {
256 | "Mode": "LM_LINES"
257 | },
258 | {
259 | "Mode": "LM_STATISTICS"
260 | }
261 | ],
262 | "DeblurModes": [
263 | {
264 | "Mode": "DM_BASED_ON_LOC_BIN"
265 | },
266 | {
267 | "Mode": "DM_THRESHOLD_BINARIZATION"
268 | },
269 | {
270 | "Mode": "DM_DIRECT_BINARIZATION"
271 | },
272 | {
273 | "Mode": "DM_SMOOTHING"
274 | }
275 | ],
276 | "BarcodeFormatSpecificationNameArray": [
277 | "bfs1-read-rate-first",
278 | "bfs2-read-rate-first"
279 | ],
280 | "SectionImageParameterArray": [
281 | {
282 | "Section": "ST_REGION_PREDETECTION",
283 | "ImageParameterName": "ip-read-barcodes-read-rate"
284 | },
285 | {
286 | "Section": "ST_BARCODE_LOCALIZATION",
287 | "ImageParameterName": "ip-read-barcodes-read-rate"
288 | },
289 | {
290 | "Section": "ST_BARCODE_DECODING",
291 | "ImageParameterName": "ip-read-barcodes-read-rate"
292 | }
293 | ]
294 | },
295 | {
296 | "Name": "task-read-single-barcode",
297 | "ExpectedBarcodesCount": 1,
298 | "LocalizationModes": [
299 | {
300 | "Mode": "LM_SCAN_DIRECTLY",
301 | "ScanDirection": 2
302 | },
303 | {
304 | "Mode": "LM_CONNECTED_BLOCKS"
305 | }
306 | ],
307 | "DeblurModes": [
308 | {
309 | "Mode": "DM_BASED_ON_LOC_BIN"
310 | },
311 | {
312 | "Mode": "DM_THRESHOLD_BINARIZATION"
313 | },
314 | {
315 | "Mode": "DM_DEEP_ANALYSIS"
316 | }
317 | ],
318 | "BarcodeFormatSpecificationNameArray": [
319 | "bfs1-single-barcode",
320 | "bfs2-single-barcode"
321 | ],
322 | "SectionImageParameterArray": [
323 | {
324 | "Section": "ST_REGION_PREDETECTION",
325 | "ImageParameterName": "ip-read-single-barcode"
326 | },
327 | {
328 | "Section": "ST_BARCODE_LOCALIZATION",
329 | "ImageParameterName": "ip-read-single-barcode"
330 | },
331 | {
332 | "Section": "ST_BARCODE_DECODING",
333 | "ImageParameterName": "ip-read-single-barcode"
334 | }
335 | ]
336 | },
337 | {
338 | "Name": "task-read-barcodes-balance",
339 | "ExpectedBarcodesCount": 999,
340 | "LocalizationModes": [
341 | {
342 | "Mode": "LM_CONNECTED_BLOCKS"
343 | },
344 | {
345 | "Mode": "LM_SCAN_DIRECTLY"
346 | }
347 | ],
348 | "DeblurModes": [
349 | {
350 | "Mode": "DM_BASED_ON_LOC_BIN"
351 | },
352 | {
353 | "Mode": "DM_THRESHOLD_BINARIZATION"
354 | },
355 | {
356 | "Mode": "DM_DIRECT_BINARIZATION"
357 | }
358 | ],
359 | "BarcodeFormatSpecificationNameArray": [
360 | "bfs1-balance",
361 | "bfs2-balance"
362 | ],
363 | "SectionImageParameterArray": [
364 | {
365 | "Section": "ST_REGION_PREDETECTION",
366 | "ImageParameterName": "ip-read-barcodes-balance"
367 | },
368 | {
369 | "Section": "ST_BARCODE_LOCALIZATION",
370 | "ImageParameterName": "ip-read-barcodes-balance"
371 | },
372 | {
373 | "Section": "ST_BARCODE_DECODING",
374 | "ImageParameterName": "ip-read-barcodes-balance"
375 | }
376 | ]
377 | },
378 | {
379 | "Name": "task-read-barcodes-dense",
380 | "ExpectedBarcodesCount": 0,
381 | "LocalizationModes": [
382 | {
383 | "Mode": "LM_CONNECTED_BLOCKS"
384 | },
385 | {
386 | "Mode": "LM_LINES"
387 | }
388 | ],
389 | "DeblurModes": [
390 | {
391 | "Mode": "DM_BASED_ON_LOC_BIN"
392 | },
393 | {
394 | "Mode": "DM_THRESHOLD_BINARIZATION"
395 | },
396 | {
397 | "Mode": "DM_DIRECT_BINARIZATION"
398 | },
399 | {
400 | "Mode": "DM_SMOOTHING"
401 | },
402 | {
403 | "Mode": "DM_GRAY_EQUALIZATION"
404 | }
405 | ],
406 | "BarcodeFormatSpecificationNameArray": [
407 | "bfs1-dense",
408 | "bfs2-dense"
409 | ],
410 | "SectionImageParameterArray": [
411 | {
412 | "Section": "ST_REGION_PREDETECTION",
413 | "ImageParameterName": "ip-read-barcodes-dense"
414 | },
415 | {
416 | "Section": "ST_BARCODE_LOCALIZATION",
417 | "ImageParameterName": "ip-read-barcodes-dense"
418 | },
419 | {
420 | "Section": "ST_BARCODE_DECODING",
421 | "ImageParameterName": "ip-read-barcodes-dense"
422 | }
423 | ]
424 | },
425 | {
426 | "Name": "task-read-barcodes-distant",
427 | "ExpectedBarcodesCount": 0,
428 | "LocalizationModes": [
429 | {
430 | "Mode": "LM_CONNECTED_BLOCKS"
431 | },
432 | {
433 | "Mode": "LM_LINES"
434 | }
435 | ],
436 | "DeblurModes": [
437 | {
438 | "Mode": "DM_BASED_ON_LOC_BIN"
439 | },
440 | {
441 | "Mode": "DM_THRESHOLD_BINARIZATION"
442 | },
443 | {
444 | "Mode": "DM_DIRECT_BINARIZATION"
445 | }
446 | ],
447 | "BarcodeFormatSpecificationNameArray": [
448 | "bfs1-distant",
449 | "bfs2-distant"
450 | ],
451 | "SectionImageParameterArray": [
452 | {
453 | "Section": "ST_REGION_PREDETECTION",
454 | "ImageParameterName": "ip-read-barcodes-distant"
455 | },
456 | {
457 | "Section": "ST_BARCODE_LOCALIZATION",
458 | "ImageParameterName": "ip-read-barcodes-distant"
459 | },
460 | {
461 | "Section": "ST_BARCODE_DECODING",
462 | "ImageParameterName": "ip-read-barcodes-distant"
463 | }
464 | ]
465 | }
466 | ],
467 | "ImageParameterOptions": [
468 | {
469 | "Name": "ip-read-barcodes",
470 | "TextDetectionMode": {
471 | "Mode": "TTDM_LINE",
472 | "Direction": "UNKNOWN",
473 | "Sensitivity": 3
474 | },
475 | "IfEraseTextZone": 1,
476 | "BinarizationModes": [
477 | {
478 | "Mode": "BM_LOCAL_BLOCK",
479 | "BlockSizeX": 71,
480 | "BlockSizeY": 71,
481 | "EnableFillBinaryVacancy": 0
482 | }
483 | ],
484 | "GrayscaleTransformationModes": [
485 | {
486 | "Mode": "GTM_ORIGINAL"
487 | }
488 | ]
489 | },
490 | {
491 | "Name": "ip-read-barcodes-speed-first",
492 | "TextDetectionMode": {
493 | "Mode": "TTDM_LINE",
494 | "Direction": "UNKNOWN",
495 | "Sensitivity": 3
496 | },
497 | "IfEraseTextZone": 1,
498 | "BinarizationModes": [
499 | {
500 | "Mode": "BM_LOCAL_BLOCK",
501 | "BlockSizeX": 27,
502 | "BlockSizeY": 27,
503 | "EnableFillBinaryVacancy": 1
504 | }
505 | ],
506 | "GrayscaleTransformationModes": [
507 | {
508 | "Mode": "GTM_ORIGINAL"
509 | }
510 | ],
511 | "ScaleDownThreshold": 2300
512 | },
513 | {
514 | "Name": "ip-read-barcodes-read-rate",
515 | "TextDetectionMode": {
516 | "Mode": "TTDM_LINE",
517 | "Direction": "UNKNOWN",
518 | "Sensitivity": 3
519 | },
520 | "IfEraseTextZone": 1,
521 | "BinarizationModes": [
522 | {
523 | "Mode": "BM_LOCAL_BLOCK",
524 | "BlockSizeX": 0,
525 | "BlockSizeY": 0,
526 | "EnableFillBinaryVacancy": 1
527 | }
528 | ],
529 | "GrayscaleTransformationModes": [
530 | {
531 | "Mode": "GTM_ORIGINAL"
532 | }
533 | ],
534 | "ScaleDownThreshold": 100000
535 | },
536 | {
537 | "Name": "ip-read-single-barcode",
538 | "TextDetectionMode": {
539 | "Mode": "TTDM_LINE",
540 | "Direction": "UNKNOWN",
541 | "Sensitivity": 3
542 | },
543 | "IfEraseTextZone": 1,
544 | "BinarizationModes": [
545 | {
546 | "Mode": "BM_LOCAL_BLOCK",
547 | "BlockSizeX": 27,
548 | "BlockSizeY": 27,
549 | "EnableFillBinaryVacancy": 0
550 | }
551 | ],
552 | "GrayscaleTransformationModes": [
553 | {
554 | "Mode": "GTM_ORIGINAL"
555 | }
556 | ],
557 | "ScaleDownThreshold": 2300
558 | },
559 | {
560 | "Name": "ip-read-barcodes-balance",
561 | "TextDetectionMode": {
562 | "Mode": "TTDM_LINE",
563 | "Direction": "UNKNOWN",
564 | "Sensitivity": 3
565 | },
566 | "IfEraseTextZone": 1,
567 | "BinarizationModes": [
568 | {
569 | "Mode": "BM_LOCAL_BLOCK",
570 | "BlockSizeX": 0,
571 | "BlockSizeY": 0,
572 | "EnableFillBinaryVacancy": 1
573 | }
574 | ],
575 | "GrayscaleTransformationModes": [
576 | {
577 | "Mode": "GTM_ORIGINAL"
578 | }
579 | ]
580 | },
581 | {
582 | "Name": "ip-read-barcodes-dense",
583 | "TextDetectionMode": {
584 | "Mode": "TTDM_LINE",
585 | "Direction": "UNKNOWN",
586 | "Sensitivity": 3
587 | },
588 | "IfEraseTextZone": 1,
589 | "BinarizationModes": [
590 | {
591 | "Mode": "BM_LOCAL_BLOCK",
592 | "BlockSizeX": 0,
593 | "BlockSizeY": 0,
594 | "EnableFillBinaryVacancy": 1
595 | }
596 | ],
597 | "GrayscaleTransformationModes": [
598 | {
599 | "Mode": "GTM_ORIGINAL"
600 | }
601 | ],
602 | "ScaleDownThreshold": 100000
603 | },
604 | {
605 | "Name": "ip-read-barcodes-distant",
606 | "TextDetectionMode": {
607 | "Mode": "TTDM_LINE",
608 | "Direction": "UNKNOWN",
609 | "Sensitivity": 3
610 | },
611 | "IfEraseTextZone": 1,
612 | "BinarizationModes": [
613 | {
614 | "Mode": "BM_LOCAL_BLOCK",
615 | "BlockSizeX": 0,
616 | "BlockSizeY": 0,
617 | "EnableFillBinaryVacancy": 1
618 | }
619 | ],
620 | "GrayscaleTransformationModes": [
621 | {
622 | "Mode": "GTM_ORIGINAL"
623 | }
624 | ],
625 | "ScaleDownThreshold": 2300
626 | }
627 | ]
628 | }
--------------------------------------------------------------------------------
/dist/dbr.bundle.d.ts:
--------------------------------------------------------------------------------
1 | import { EngineResourcePaths, DSImageData } from 'dynamsoft-core';
2 | import * as dynamsoftCore from 'dynamsoft-core';
3 | export { dynamsoftCore as Core };
4 | import { CapturedResult } from 'dynamsoft-capture-vision-router';
5 | import * as dynamsoftCaptureVisionRouter from 'dynamsoft-capture-vision-router';
6 | export { dynamsoftCaptureVisionRouter as CVR };
7 | import { EnumBarcodeFormat, BarcodeResultItem } from 'dynamsoft-barcode-reader';
8 | import * as dynamsoftBarcodeReader from 'dynamsoft-barcode-reader';
9 | export { dynamsoftBarcodeReader as DBR };
10 | import * as dynamsoftLicense from 'dynamsoft-license';
11 | export { dynamsoftLicense as License };
12 | import * as dynamsoftCameraEnhancer from 'dynamsoft-camera-enhancer';
13 | export { dynamsoftCameraEnhancer as DCE };
14 | import * as dynamsoftUtility from 'dynamsoft-utility';
15 | export { dynamsoftUtility as Utility };
16 |
17 | declare enum EnumScanMode {
18 | SM_SINGLE = 0,
19 | SM_MULTI_UNIQUE = 1
20 | }
21 | declare enum EnumOptimizationMode {
22 | OM_NONE = 0,
23 | OM_SPEED = 1,
24 | OM_COVERAGE = 2,
25 | OM_BALANCE = 3,
26 | OM_DPM = 4,
27 | OM_DENSE = 5
28 | }
29 | declare enum EnumResultStatus {
30 | RS_SUCCESS = 0,
31 | RS_CANCELLED = 1,
32 | RS_FAILED = 2
33 | }
34 |
35 | interface BarcodeScannerConfig {
36 | license?: string;
37 | scanMode?: EnumScanMode;
38 | templateFilePath?: string;
39 | utilizedTemplateNames?: UtilizedTemplateNames;
40 | engineResourcePaths?: EngineResourcePaths;
41 | barcodeFormats?: Array | EnumBarcodeFormat;
42 | duplicateForgetTime?: number;
43 | container?: HTMLElement | string | undefined;
44 | onUniqueBarcodeScanned?: (result: BarcodeResultItem) => void | Promise;
45 | showResultView?: boolean;
46 | showUploadImageButton?: boolean;
47 | removePoweredByMessage?: boolean;
48 | scannerViewConfig?: ScannerViewConfig;
49 | resultViewConfig?: ResultViewConfig;
50 | uiPath?: string;
51 | }
52 | interface ScannerViewConfig {
53 | container?: HTMLElement | string | undefined;
54 | showCloseButton?: boolean;
55 | }
56 | interface BarcodeResultViewToolbarButtonsConfig {
57 | clear?: ToolbarButtonConfig;
58 | done?: ToolbarButtonConfig;
59 | }
60 | interface ResultViewConfig {
61 | container?: HTMLElement | string | undefined;
62 | toolbarButtonsConfig?: BarcodeResultViewToolbarButtonsConfig;
63 | }
64 |
65 | type ResultStatus = {
66 | code: EnumResultStatus;
67 | message: string;
68 | };
69 | interface ToolbarButtonConfig {
70 | label?: string;
71 | className?: string;
72 | isHidden?: boolean;
73 | }
74 | interface BarcodeScanResult {
75 | status: ResultStatus;
76 | barcodeResults: Array;
77 | originalImageResult?: DSImageData;
78 | barcodeImage?: DSImageData;
79 | }
80 | interface UtilizedTemplateNames {
81 | single?: string;
82 | multi_unique?: string;
83 | image?: string;
84 | }
85 |
86 | declare class BarcodeScanner {
87 | #private;
88 | private _cameraEnhancer;
89 | private _cameraView;
90 | private _cvRouter;
91 | config: BarcodeScannerConfig;
92 | constructor(config?: BarcodeScannerConfig);
93 | launch(): Promise;
94 | decode(imageOrFile: Blob | string | DSImageData | HTMLImageElement | HTMLVideoElement | HTMLCanvasElement, templateName?: string): Promise;
95 | dispose(): void;
96 | }
97 |
98 | export { BarcodeScanner, EnumOptimizationMode, EnumResultStatus, EnumScanMode };
99 | export type { BarcodeResultViewToolbarButtonsConfig, BarcodeScanResult, BarcodeScannerConfig, ResultStatus, ResultViewConfig, ScannerViewConfig, ToolbarButtonConfig, UtilizedTemplateNames };
100 |
--------------------------------------------------------------------------------
/dist/dbr.bundle.esm.d.ts:
--------------------------------------------------------------------------------
1 | import { EngineResourcePaths, DSImageData } from 'dynamsoft-core';
2 | export * from 'dynamsoft-core';
3 | import { CapturedResult } from 'dynamsoft-capture-vision-router';
4 | export * from 'dynamsoft-capture-vision-router';
5 | import { EnumBarcodeFormat, BarcodeResultItem } from 'dynamsoft-barcode-reader';
6 | export * from 'dynamsoft-barcode-reader';
7 | export * from 'dynamsoft-license';
8 | export * from 'dynamsoft-camera-enhancer';
9 | export * from 'dynamsoft-utility';
10 |
11 | declare enum EnumScanMode {
12 | SM_SINGLE = 0,
13 | SM_MULTI_UNIQUE = 1
14 | }
15 | declare enum EnumOptimizationMode {
16 | OM_NONE = 0,
17 | OM_SPEED = 1,
18 | OM_COVERAGE = 2,
19 | OM_BALANCE = 3,
20 | OM_DPM = 4,
21 | OM_DENSE = 5
22 | }
23 | declare enum EnumResultStatus {
24 | RS_SUCCESS = 0,
25 | RS_CANCELLED = 1,
26 | RS_FAILED = 2
27 | }
28 |
29 | interface BarcodeScannerConfig {
30 | license?: string;
31 | scanMode?: EnumScanMode;
32 | templateFilePath?: string;
33 | utilizedTemplateNames?: UtilizedTemplateNames;
34 | engineResourcePaths?: EngineResourcePaths;
35 | barcodeFormats?: Array | EnumBarcodeFormat;
36 | duplicateForgetTime?: number;
37 | container?: HTMLElement | string | undefined;
38 | onUniqueBarcodeScanned?: (result: BarcodeResultItem) => void | Promise;
39 | showResultView?: boolean;
40 | showUploadImageButton?: boolean;
41 | removePoweredByMessage?: boolean;
42 | scannerViewConfig?: ScannerViewConfig;
43 | resultViewConfig?: ResultViewConfig;
44 | uiPath?: string;
45 | }
46 | interface ScannerViewConfig {
47 | container?: HTMLElement | string | undefined;
48 | showCloseButton?: boolean;
49 | }
50 | interface BarcodeResultViewToolbarButtonsConfig {
51 | clear?: ToolbarButtonConfig;
52 | done?: ToolbarButtonConfig;
53 | }
54 | interface ResultViewConfig {
55 | container?: HTMLElement | string | undefined;
56 | toolbarButtonsConfig?: BarcodeResultViewToolbarButtonsConfig;
57 | }
58 |
59 | type ResultStatus = {
60 | code: EnumResultStatus;
61 | message: string;
62 | };
63 | interface ToolbarButtonConfig {
64 | label?: string;
65 | className?: string;
66 | isHidden?: boolean;
67 | }
68 | interface BarcodeScanResult {
69 | status: ResultStatus;
70 | barcodeResults: Array;
71 | originalImageResult?: DSImageData;
72 | barcodeImage?: DSImageData;
73 | }
74 | interface UtilizedTemplateNames {
75 | single?: string;
76 | multi_unique?: string;
77 | image?: string;
78 | }
79 |
80 | declare class BarcodeScanner {
81 | #private;
82 | private _cameraEnhancer;
83 | private _cameraView;
84 | private _cvRouter;
85 | config: BarcodeScannerConfig;
86 | constructor(config?: BarcodeScannerConfig);
87 | launch(): Promise;
88 | decode(imageOrFile: Blob | string | DSImageData | HTMLImageElement | HTMLVideoElement | HTMLCanvasElement, templateName?: string): Promise;
89 | dispose(): void;
90 | }
91 |
92 | export { BarcodeScanner, EnumOptimizationMode, EnumResultStatus, EnumScanMode };
93 | export type { BarcodeResultViewToolbarButtonsConfig, BarcodeScanResult, BarcodeScannerConfig, ResultStatus, ResultViewConfig, ScannerViewConfig, ToolbarButtonConfig, UtilizedTemplateNames };
94 |
--------------------------------------------------------------------------------
/dist/dbr.no-content-bundle.esm.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Dynamsoft JavaScript Library
3 | * @product Dynamsoft Barcode Reader JS Edition Bundle
4 | * @website http://www.dynamsoft.com
5 | * @copyright Copyright 2025, Dynamsoft Corporation
6 | * @author Dynamsoft
7 | * @version 10.5.3000
8 | * @fileoverview Dynamsoft JavaScript Library for Barcode Reader
9 | * More info on dbr JS: https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/
10 | */
11 | import{CoreModule as e,EnumCapturedResultItemType as t,_toCanvas as i,EnumImagePixelFormat as s}from"dynamsoft-core";export*from"dynamsoft-core";import{CaptureVisionRouter as n,CapturedResultReceiver as o}from"dynamsoft-capture-vision-router";export*from"dynamsoft-capture-vision-router";import{CameraView as r,CameraEnhancer as a}from"dynamsoft-camera-enhancer";export*from"dynamsoft-camera-enhancer";import{LicenseManager as c}from"dynamsoft-license";export*from"dynamsoft-license";import{MultiFrameResultCrossFilter as l}from"dynamsoft-utility";export*from"dynamsoft-utility";export*from"dynamsoft-barcode-reader";function d(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)}function u(e,t,i,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,i):n?n.value=i:t.set(e,i),i}"function"==typeof SuppressedError&&SuppressedError;const h="undefined"==typeof self,f="function"==typeof importScripts,m=(()=>{if(!f){if(!h&&document.currentScript){let e=document.currentScript.src,t=e.indexOf("?");if(-1!=t)e=e.substring(0,t);else{let t=e.indexOf("#");-1!=t&&(e=e.substring(0,t))}return e.substring(0,e.lastIndexOf("/")+1)}return"./"}})(),g=e=>{if(null==e&&(e="./"),h||f);else{let t=document.createElement("a");t.href=e,e=t.href}return e.endsWith("/")||(e+="/"),e};var p,y,w;!function(e){e[e.SM_SINGLE=0]="SM_SINGLE",e[e.SM_MULTI_UNIQUE=1]="SM_MULTI_UNIQUE"}(p||(p={})),function(e){e[e.OM_NONE=0]="OM_NONE",e[e.OM_SPEED=1]="OM_SPEED",e[e.OM_COVERAGE=2]="OM_COVERAGE",e[e.OM_BALANCE=3]="OM_BALANCE",e[e.OM_DPM=4]="OM_DPM",e[e.OM_DENSE=5]="OM_DENSE"}(y||(y={})),function(e){e[e.RS_SUCCESS=0]="RS_SUCCESS",e[e.RS_CANCELLED=1]="RS_CANCELLED",e[e.RS_FAILED=2]="RS_FAILED"}(w||(w={}));var S={license:"",scanMode:p.SM_SINGLE,templateFilePath:void 0,utilizedTemplateNames:{single:"ReadSingleBarcode",multi_unique:"ReadBarcodes_SpeedFirst",image:"ReadBarcodes_ReadRateFirst"},engineResourcePaths:{rootDirectory:m},barcodeFormats:void 0,duplicateForgetTime:3e3,container:void 0,onUniqueBarcodeScanned:void 0,showResultView:!1,showUploadImageButton:!1,removePoweredByMessage:!1,uiPath:m,scannerViewConfig:{container:void 0,showCloseButton:!1},resultViewConfig:{container:void 0,toolbarButtonsConfig:{clear:{label:"Clear",className:"btn-clear",isHidden:!1},done:{label:"Done",className:"btn-done",isHidden:!1}}}};const _=e=>e&&"object"==typeof e&&"function"==typeof e.then,b=(async()=>{})().constructor;class E extends b{get status(){return this._s}get isPending(){return"pending"===this._s}get isFulfilled(){return"fulfilled"===this._s}get isRejected(){return"rejected"===this._s}get task(){return this._task}set task(e){let t;this._task=e,_(e)?t=e:"function"==typeof e&&(t=new b(e)),t&&(async()=>{try{const i=await t;e===this._task&&this.resolve(i)}catch(t){e===this._task&&this.reject(t)}})()}get isEmpty(){return null==this._task}constructor(e){let t,i;super(((e,s)=>{t=e,i=s})),this._s="pending",this.resolve=e=>{this.isPending&&(_(e)?this.task=e:(this._s="fulfilled",t(e)))},this.reject=e=>{this.isPending&&(this._s="rejected",i(e))},this.task=e}}const v=()=>window.matchMedia("(orientation: landscape)").matches;function R(e,t){for(const s in t)"Object"===(i=t[s],Object.prototype.toString.call(i).slice(8,-1))&&s in e?R(e[s],t[s]):e[s]=t[s];var i;return e}var C,I,x,M,N,q,L,T,O,A,V,B,k,D,F,P,U,j,G,H,W;class z{constructor(e){if(C.add(this),M.set(this,void 0),N.set(this,{status:{code:w.RS_SUCCESS,message:"Success."},barcodeResults:[]}),q.set(this,!1),L.set(this,void 0),T.set(this,void 0),this.config=S,e&&"object"!=typeof e||Array.isArray(e))throw"Invalid config.";R(this.config,e)}async launch(){if(d(this,q,"f"))throw new Error("The BarcodeScanner instance has been destroyed.");if(d(z,I,"f",x)&&!d(z,I,"f",x).isFulfilled)throw new Error("Cannot call `launch()` while a previous task is still running.");return u(z,I,new E,"f",x),await d(this,C,"m",O).call(this),d(z,I,"f",x)}async decode(e,t="ReadBarcodes_Default"){return u(this,T,t,"f"),await d(this,C,"m",A).call(this,!0),this._cvRouter.capture(e,t)}dispose(){u(this,q,!0,"f"),d(z,I,"f",x)&&d(z,I,"f",x).isPending&&d(z,I,"f",x).resolve(d(this,N,"f")),this._cameraEnhancer?.dispose(),this._cameraView?.dispose(),this._cvRouter?.dispose(),this._cameraEnhancer=null,this._cameraView=null,this._cvRouter=null,window.removeEventListener("resize",d(this,M,"f")),document.querySelector(".scanner-view-container")?.remove(),document.querySelector(".result-view-container")?.remove(),document.querySelector(".barcode-scanner-container")?.remove(),document.querySelector(".loading-page")?.remove()}}I=z,M=new WeakMap,N=new WeakMap,q=new WeakMap,L=new WeakMap,T=new WeakMap,C=new WeakSet,O=async function(){try{await d(this,C,"m",A).call(this);try{await this._cameraEnhancer.open()}catch(e){d(this,C,"m",W).call(this);document.querySelector(".no-camera-view").style.display="flex"}await this._cvRouter.startCapturing(d(this,T,"f"))}catch(e){d(this,N,"f").status={code:w.RS_FAILED,message:e.message||e},d(z,I,"f",x).reject(new Error(d(this,N,"f").status.message)),this.dispose()}finally{const e=document.querySelector(".loading-page");e&&(e.style.display="none")}},A=async function(t=!1){e.engineResourcePaths=this.config.engineResourcePaths,t||(this._cameraView=await r.createInstance(),this.config.scanMode===p.SM_SINGLE&&(this._cameraView._capturedResultReceiver.onCapturedResultReceived=()=>{}),await d(this,C,"m",B).call(this)),await c.initLicense(this.config.license||"",{executeNow:!0}),this._cvRouter=this._cvRouter||await n.createInstance(),await d(this,C,"m",V).call(this,t),t||(this._cameraEnhancer=await a.createInstance(this._cameraView),this._cvRouter.setInput(this._cameraEnhancer),d(this,C,"m",k).call(this),await d(this,C,"m",D).call(this))},V=async function(e=!1){e||(this.config.scanMode===p.SM_SINGLE?u(this,T,this.config.utilizedTemplateNames.single,"f"):this.config.scanMode===p.SM_MULTI_UNIQUE&&u(this,T,this.config.utilizedTemplateNames.multi_unique,"f")),this.config.templateFilePath&&await this._cvRouter.initSettings(this.config.templateFilePath);const i=await this._cvRouter.getSimplifiedSettings(d(this,T,"f"));e||this.config.scanMode!==p.SM_SINGLE||(i.capturedResultItemTypes=t.CRIT_ORIGINAL_IMAGE|t.CRIT_BARCODE);let s=this.config.barcodeFormats;if(s){Array.isArray(s)||(s=[s]),i.barcodeSettings.barcodeFormatIds=BigInt(0);for(let e=0;e{if("string"!=typeof e)throw new TypeError("Invalid url.");const t=await fetch(e);if(!t.ok)throw Error("Network Error: "+t.statusText);const i=await t.text();if(!i.trim().startsWith("<"))throw Error("Unable to get valid HTMLElement.");const s=document.createElement("div");if(s.insertAdjacentHTML("beforeend",i),1===s.childElementCount&&s.firstChild instanceof HTMLTemplateElement)return s.firstChild.content;const n=new DocumentFragment;for(let e of s.children)n.append(e);return n})(t);i.querySelectorAll("style").forEach((e=>{document.head.appendChild(e.cloneNode(!0))})),u(this,L,i.querySelector(".result-item"),"f");const s=i.querySelector(".btn-clear");if(s&&(s.addEventListener("click",(()=>{d(this,N,"f").barcodeResults=[],d(this,C,"m",G).call(this)})),this.config?.resultViewConfig?.toolbarButtonsConfig?.clear)){const e=this.config.resultViewConfig.toolbarButtonsConfig.clear;s.style.display=e.isHidden?"none":"flex",s.className=e.className?e.className:"btn-clear",s.innerText=e.label?e.label:"Clear",e.isHidden&&(i.querySelector(".toolbar-btns").style.justifyContent="center")}const n=i.querySelector(".btn-done");if(n&&(n.addEventListener("click",(()=>{const e=document.querySelector(".loading-page");e&&"none"===getComputedStyle(e).display&&this.dispose()})),this.config?.resultViewConfig?.toolbarButtonsConfig?.done)){const e=this.config.resultViewConfig.toolbarButtonsConfig.done;n.style.display=e.isHidden?"none":"flex",n.className=e.className?e.className:"btn-done",n.innerText=e.label?e.label:"Done",e.isHidden&&(i.querySelector(".toolbar-btns").style.justifyContent="center")}const o=this.config?.scannerViewConfig?.showCloseButton;if(o){const e=i.querySelector(".btn-close");e&&(e.style.display="",e.addEventListener("click",(()=>{d(this,N,"f").barcodeResults=[],d(this,N,"f").status={code:w.RS_CANCELLED,message:"Cancelled."},this.dispose()})))}this.config.showUploadImageButton&&d(this,C,"m",W).call(this,i.querySelector(".btn-upload-image"));const r=this._cameraView.getUIElement();r.shadowRoot.querySelector(".dce-sel-camera").remove(),r.shadowRoot.querySelector(".dce-sel-resolution").remove(),this._cameraView.setVideoFit("cover");const a=i.querySelector(".barcode-scanner-container");a.style.display=v()?"flex":"";const c=this.config.showResultView&&this.config.scanMode!==p.SM_SINGLE;let l;if(this.config.container?(a.style.position="relative",l=this.config.container):l=document.body,"string"==typeof l&&(l=document.querySelector(l),null===l))throw new Error("Failed to get the container");let h=this.config.scannerViewConfig.container;if("string"==typeof h&&(h=document.querySelector(h),null===h))throw new Error("Failed to get the container of the scanner view.");let f=this.config.resultViewConfig.container;if("string"==typeof f&&(f=document.querySelector(f),null===f))throw new Error("Failed to get the container of the result view.");const m=i.querySelector(".scanner-view-container"),y=i.querySelector(".result-view-container"),S=i.querySelector(".loading-page");m.append(S),h&&(m.append(r),h.append(m)),f&&f.append(y),h||f?h&&!f?(this.config.container||(y.style.position="absolute"),f=y,l.append(y)):!h&&f&&(this.config.container||(m.style.position="absolute"),h=m,m.append(r),l.append(m)):(h=m,f=y,c&&(Object.assign(m.style,{width:v()?"50%":"100%",height:v()?"100%":"50%"}),Object.assign(y.style,{width:v()?"50%":"100%",height:v()?"100%":"50%"})),m.append(r),l.append(a)),document.querySelector(".result-view-container").style.display=c?"":"none",this.config.removePoweredByMessage&&(r.shadowRoot.querySelector(".dce-msg-poweredby").style.display="none",document.querySelector(".no-result-svg").style.display="none"),u(this,M,(()=>{Object.assign(a.style,{display:v()?"flex":""}),!c||this.config.scannerViewConfig.container||this.config.resultViewConfig.container||(Object.assign(h.style,{width:v()?"50%":"100%",height:v()?"100%":"50%"}),Object.assign(f.style,{width:v()?"50%":"100%",height:v()?"100%":"50%"}))}),"f"),window.addEventListener("resize",d(this,M,"f")),this._cameraView._createDrawingLayer(2)},k=function(){const e=new o;let t=0;e.onCapturedResultReceived=async e=>{e.barcodeResultItems&&(this.config.scanMode===p.SM_SINGLE?2==++t&&d(this,C,"m",F).call(this,e):d(this,C,"m",P).call(this,e))},this._cvRouter.addResultReceiver(e)},D=async function(){const e=new l;e.enableResultCrossVerification(2,!0),e.enableResultDeduplication(2,!0),e.setDuplicateForgetTime(2,this.config.duplicateForgetTime),e.onDecodedBarcodesReceived=()=>{},await this._cvRouter.addResultFilter(e)},F=function(e){const n=this._cameraView.getUIElement().shadowRoot;new Promise((t=>{if(e.barcodeResultItems.length>1){d(this,C,"m",j).call(this);for(let i of e.barcodeResultItems){let e=0,s=0;for(let t=0;t<4;++t){let n=i.location.points[t];e+=n.x,s+=n.y}let o=this._cameraEnhancer.convertToClientCoordinates({x:e/4,y:s/4}),r=document.createElement("div");r.className="single-barcode-result-option",Object.assign(r.style,{position:"fixed",width:"32px",height:"32px",border:"#fff solid 4px","box-sizing":"border-box","border-radius":"16px",background:"#080",cursor:"pointer",transform:"translate(-50%, -50%)"}),r.style.left=o.x+"px",r.style.top=o.y+"px",r.addEventListener("click",(()=>{t(i)})),n.append(r)}}else t(e.barcodeResultItems[0])})).then((n=>{const o=e.items.filter((e=>e.type===t.CRIT_ORIGINAL_IMAGE))[0].imageData,r={status:{code:w.RS_SUCCESS,message:"Success."},originalImageResult:o,barcodeImage:(()=>{const e=i(o),t=n.location.points,r=Math.min(...t.map((e=>e.x))),a=Math.min(...t.map((e=>e.y))),c=Math.max(...t.map((e=>e.x)))-r,l=Math.max(...t.map((e=>e.y)))-a,d=document.createElement("canvas");d.width=c,d.height=l;const u=d.getContext("2d");u.beginPath(),u.moveTo(t[0].x-r,t[0].y-a);for(let e=1;ee.id===`${i.formatString}_${i.text}`));-1===e?(i.count=1,d(this,N,"f").barcodeResults.unshift(i),d(this,C,"m",G).call(this,i)):(d(this,N,"f").barcodeResults[e].count++,d(this,C,"m",H).call(this,e)),this.config.onUniqueBarcodeScanned&&this.config.onUniqueBarcodeScanned(i)}},U=function(e){const t=d(this,L,"f").cloneNode(!0);t.querySelector(".format-string").innerText=e.formatString;t.querySelector(".text-string").innerText=e.text.replace(/\n|\r/g,""),t.id=`${e.formatString}_${e.text}`;return t.querySelector(".delete-icon").addEventListener("click",(()=>{const t=[...document.querySelectorAll(".main-list .result-item")],i=t.findIndex((t=>t.id===`${e.formatString}_${e.text}`));d(this,N,"f").barcodeResults.splice(i,1),t[i].remove()})),t},j=function(){const e=this._cameraView.getUIElement().shadowRoot;if(e.querySelector(".single-mode-mask"))return;const t=document.createElement("div");t.className="single-mode-mask",Object.assign(t.style,{width:"100%",height:"100%",position:"absolute",top:"0",left:"0",right:"0",bottom:"0","background-color":"#4C4C4C",opacity:"0.5"}),e.append(t),this._cameraEnhancer.pause(),this._cvRouter.stopCapturing()},G=function(e){const t=document.querySelector(".no-result-svg");if(!(this.config.showResultView&&this.config.scanMode!==p.SM_SINGLE))return;const i=document.querySelector(".main-list");if(!e)return i.textContent="",void(t.style.display="");t.style.display="none";const s=d(this,C,"m",U).call(this,e);i.insertBefore(s,document.querySelector(".result-item"))},H=function(e){const t=document.querySelectorAll(".main-list .result-item"),i=t[e].querySelector(".result-count");let s=parseInt(i.textContent.replace("x",""));t[e].querySelector(".result-count").textContent="x"+ ++s},W=function(e){e||(e=document.querySelector(".btn-upload-image")),e&&(e.style.display="",e.addEventListener("change",(async e=>{const t=e.target.files,i={status:{code:w.RS_SUCCESS,message:"Success."},barcodeResults:[]};for(let e of t)try{const t=await this.decode(e,this.config.utilizedTemplateNames.image);t.barcodeResultItems&&i.barcodeResults.push(...t.barcodeResultItems)}catch(e){i.status={code:w.RS_FAILED,message:e.message||e},d(z,I,"f",x).reject(i.status.message),this.dispose()}d(z,I,"f",x).resolve(i),this.dispose()})))},x={value:null},n._defaultTemplate="ReadSingleBarcode";export{z as BarcodeScanner,y as EnumOptimizationMode,w as EnumResultStatus,p as EnumScanMode};
12 |
--------------------------------------------------------------------------------
/dist/dynamsoft-barcode-reader@10.4.31/dist/DBR-PresetTemplates.json:
--------------------------------------------------------------------------------
1 | {
2 | "CaptureVisionTemplates": [
3 | {
4 | "Name": "ReadBarcodes_Default",
5 | "ImageROIProcessingNameArray": [
6 | "roi-read-barcodes"
7 | ],
8 | "Timeout": 10000
9 | },
10 | {
11 | "Name": "ReadBarcodes_SpeedFirst",
12 | "ImageROIProcessingNameArray": [
13 | "roi-read-barcodes-speed-first"
14 | ],
15 | "Timeout": 10000
16 | },
17 | {
18 | "Name": "ReadBarcodes_ReadRateFirst",
19 | "ImageROIProcessingNameArray": [
20 | "roi-read-barcodes-read-rate"
21 | ],
22 | "Timeout": 100000
23 | },
24 | {
25 | "Name": "ReadSingleBarcode",
26 | "ImageROIProcessingNameArray": [
27 | "roi-read-single-barcode"
28 | ],
29 | "Timeout": 10000
30 | },
31 | {
32 | "Name": "ReadBarcodes_Balance",
33 | "ImageROIProcessingNameArray": [
34 | "roi-read-barcodes-balance"
35 | ],
36 | "Timeout": 100000
37 | },
38 | {
39 | "Name": "ReadDenseBarcodes",
40 | "ImageROIProcessingNameArray": [
41 | "roi-read-barcodes-dense"
42 | ],
43 | "Timeout": 10000
44 | },
45 | {
46 | "Name": "ReadDistantBarcodes",
47 | "ImageROIProcessingNameArray": [
48 | "roi-read-barcodes-distant"
49 | ],
50 | "Timeout": 10000
51 | }
52 | ],
53 | "TargetROIDefOptions": [
54 | {
55 | "Name": "roi-read-barcodes",
56 | "TaskSettingNameArray": [
57 | "task-read-barcodes"
58 | ]
59 | },
60 | {
61 | "Name": "roi-read-barcodes-speed-first",
62 | "TaskSettingNameArray": [
63 | "task-read-barcodes-speed-first"
64 | ]
65 | },
66 | {
67 | "Name": "roi-read-barcodes-read-rate",
68 | "TaskSettingNameArray": [
69 | "task-read-barcodes-read-rate"
70 | ]
71 | },
72 | {
73 | "Name": "roi-read-single-barcode",
74 | "TaskSettingNameArray": [
75 | "task-read-single-barcode"
76 | ]
77 | },
78 | {
79 | "Name": "roi-read-barcodes-balance",
80 | "TaskSettingNameArray": [
81 | "task-read-barcodes-balance"
82 | ]
83 | },
84 | {
85 | "Name": "roi-read-barcodes-dense",
86 | "TaskSettingNameArray": [
87 | "task-read-barcodes-dense"
88 | ]
89 | },
90 | {
91 | "Name": "roi-read-barcodes-distant",
92 | "TaskSettingNameArray": [
93 | "task-read-barcodes-distant"
94 | ]
95 | }
96 | ],
97 | "BarcodeFormatSpecificationOptions": [
98 | {
99 | "Name": "bfs1",
100 | "BarcodeFormatIds": [
101 | "BF_PDF417",
102 | "BF_QR_CODE",
103 | "BF_DATAMATRIX",
104 | "BF_AZTEC",
105 | "BF_MICRO_QR",
106 | "BF_MICRO_PDF417",
107 | "BF_DOTCODE"
108 | ],
109 | "MirrorMode": "MM_BOTH"
110 | },
111 | {
112 | "Name": "bfs2",
113 | "BarcodeFormatIds": [
114 | "BF_ALL"
115 | ],
116 | "MirrorMode": "MM_NORMAL"
117 | },
118 | {
119 | "Name": "bfs1-speed-first",
120 | "BaseBarcodeFormatSpecification": "bfs1"
121 | },
122 | {
123 | "Name": "bfs2-speed-first",
124 | "BaseBarcodeFormatSpecification": "bfs2"
125 | },
126 | {
127 | "Name": "bfs1-read-rate-first",
128 | "BaseBarcodeFormatSpecification": "bfs1"
129 | },
130 | {
131 | "Name": "bfs2-read-rate-first",
132 | "BaseBarcodeFormatSpecification": "bfs2"
133 | },
134 | {
135 | "Name": "bfs1-single-barcode",
136 | "BaseBarcodeFormatSpecification": "bfs1"
137 | },
138 | {
139 | "Name": "bfs2-single-barcode",
140 | "BaseBarcodeFormatSpecification": "bfs2"
141 | },
142 | {
143 | "Name": "bfs1-balance",
144 | "BaseBarcodeFormatSpecification": "bfs1"
145 | },
146 | {
147 | "Name": "bfs2-balance",
148 | "BaseBarcodeFormatSpecification": "bfs2"
149 | },
150 | {
151 | "Name": "bfs1-dense",
152 | "BaseBarcodeFormatSpecification": "bfs1"
153 | },
154 | {
155 | "Name": "bfs2-dense",
156 | "BaseBarcodeFormatSpecification": "bfs2"
157 | },
158 | {
159 | "Name": "bfs1-distant",
160 | "BaseBarcodeFormatSpecification": "bfs1"
161 | },
162 | {
163 | "Name": "bfs2-distant",
164 | "BaseBarcodeFormatSpecification": "bfs2"
165 | }
166 | ],
167 | "BarcodeReaderTaskSettingOptions": [
168 | {
169 | "Name": "task-read-barcodes",
170 | "ExpectedBarcodesCount": 0,
171 | "LocalizationModes": [
172 | {
173 | "Mode": "LM_CONNECTED_BLOCKS"
174 | },
175 | {
176 | "Mode": "LM_LINES"
177 | }
178 | ],
179 | "DeblurModes": [
180 | {
181 | "Mode": "DM_BASED_ON_LOC_BIN"
182 | },
183 | {
184 | "Mode": "DM_THRESHOLD_BINARIZATION"
185 | }
186 | ],
187 | "BarcodeFormatSpecificationNameArray": [
188 | "bfs1",
189 | "bfs2"
190 | ],
191 | "SectionImageParameterArray": [
192 | {
193 | "Section": "ST_REGION_PREDETECTION",
194 | "ImageParameterName": "ip-read-barcodes"
195 | },
196 | {
197 | "Section": "ST_BARCODE_LOCALIZATION",
198 | "ImageParameterName": "ip-read-barcodes"
199 | },
200 | {
201 | "Section": "ST_BARCODE_DECODING",
202 | "ImageParameterName": "ip-read-barcodes"
203 | }
204 | ]
205 | },
206 | {
207 | "Name": "task-read-barcodes-speed-first",
208 | "ExpectedBarcodesCount": 0,
209 | "LocalizationModes": [
210 | {
211 | "Mode": "LM_SCAN_DIRECTLY",
212 | "ScanDirection": 2
213 | },
214 | {
215 | "Mode": "LM_CONNECTED_BLOCKS"
216 | }
217 | ],
218 | "DeblurModes": [
219 | {
220 | "Mode": "DM_BASED_ON_LOC_BIN"
221 | },
222 | {
223 | "Mode": "DM_THRESHOLD_BINARIZATION"
224 | },
225 | {
226 | "Mode": "DM_DEEP_ANALYSIS"
227 | }
228 | ],
229 | "BarcodeFormatSpecificationNameArray": [
230 | "bfs1-speed-first",
231 | "bfs2-speed-first"
232 | ],
233 | "SectionImageParameterArray": [
234 | {
235 | "Section": "ST_REGION_PREDETECTION",
236 | "ImageParameterName": "ip-read-barcodes-speed-first"
237 | },
238 | {
239 | "Section": "ST_BARCODE_LOCALIZATION",
240 | "ImageParameterName": "ip-read-barcodes-speed-first"
241 | },
242 | {
243 | "Section": "ST_BARCODE_DECODING",
244 | "ImageParameterName": "ip-read-barcodes-speed-first"
245 | }
246 | ]
247 | },
248 | {
249 | "Name": "task-read-barcodes-read-rate",
250 | "ExpectedBarcodesCount": 999,
251 | "LocalizationModes": [
252 | {
253 | "Mode": "LM_CONNECTED_BLOCKS"
254 | },
255 | {
256 | "Mode": "LM_LINES"
257 | },
258 | {
259 | "Mode": "LM_STATISTICS"
260 | }
261 | ],
262 | "DeblurModes": [
263 | {
264 | "Mode": "DM_BASED_ON_LOC_BIN"
265 | },
266 | {
267 | "Mode": "DM_THRESHOLD_BINARIZATION"
268 | },
269 | {
270 | "Mode": "DM_DIRECT_BINARIZATION"
271 | },
272 | {
273 | "Mode": "DM_SMOOTHING"
274 | }
275 | ],
276 | "BarcodeFormatSpecificationNameArray": [
277 | "bfs1-read-rate-first",
278 | "bfs2-read-rate-first"
279 | ],
280 | "SectionImageParameterArray": [
281 | {
282 | "Section": "ST_REGION_PREDETECTION",
283 | "ImageParameterName": "ip-read-barcodes-read-rate"
284 | },
285 | {
286 | "Section": "ST_BARCODE_LOCALIZATION",
287 | "ImageParameterName": "ip-read-barcodes-read-rate"
288 | },
289 | {
290 | "Section": "ST_BARCODE_DECODING",
291 | "ImageParameterName": "ip-read-barcodes-read-rate"
292 | }
293 | ]
294 | },
295 | {
296 | "Name": "task-read-single-barcode",
297 | "ExpectedBarcodesCount": 1,
298 | "LocalizationModes": [
299 | {
300 | "Mode": "LM_SCAN_DIRECTLY",
301 | "ScanDirection": 2
302 | },
303 | {
304 | "Mode": "LM_CONNECTED_BLOCKS"
305 | }
306 | ],
307 | "DeblurModes": [
308 | {
309 | "Mode": "DM_BASED_ON_LOC_BIN"
310 | },
311 | {
312 | "Mode": "DM_THRESHOLD_BINARIZATION"
313 | },
314 | {
315 | "Mode": "DM_DEEP_ANALYSIS"
316 | }
317 | ],
318 | "BarcodeFormatSpecificationNameArray": [
319 | "bfs1-single-barcode",
320 | "bfs2-single-barcode"
321 | ],
322 | "SectionImageParameterArray": [
323 | {
324 | "Section": "ST_REGION_PREDETECTION",
325 | "ImageParameterName": "ip-read-single-barcode"
326 | },
327 | {
328 | "Section": "ST_BARCODE_LOCALIZATION",
329 | "ImageParameterName": "ip-read-single-barcode"
330 | },
331 | {
332 | "Section": "ST_BARCODE_DECODING",
333 | "ImageParameterName": "ip-read-single-barcode"
334 | }
335 | ]
336 | },
337 | {
338 | "Name": "task-read-barcodes-balance",
339 | "ExpectedBarcodesCount": 999,
340 | "LocalizationModes": [
341 | {
342 | "Mode": "LM_CONNECTED_BLOCKS"
343 | },
344 | {
345 | "Mode": "LM_SCAN_DIRECTLY"
346 | }
347 | ],
348 | "DeblurModes": [
349 | {
350 | "Mode": "DM_BASED_ON_LOC_BIN"
351 | },
352 | {
353 | "Mode": "DM_THRESHOLD_BINARIZATION"
354 | },
355 | {
356 | "Mode": "DM_DIRECT_BINARIZATION"
357 | }
358 | ],
359 | "BarcodeFormatSpecificationNameArray": [
360 | "bfs1-balance",
361 | "bfs2-balance"
362 | ],
363 | "SectionImageParameterArray": [
364 | {
365 | "Section": "ST_REGION_PREDETECTION",
366 | "ImageParameterName": "ip-read-barcodes-balance"
367 | },
368 | {
369 | "Section": "ST_BARCODE_LOCALIZATION",
370 | "ImageParameterName": "ip-read-barcodes-balance"
371 | },
372 | {
373 | "Section": "ST_BARCODE_DECODING",
374 | "ImageParameterName": "ip-read-barcodes-balance"
375 | }
376 | ]
377 | },
378 | {
379 | "Name": "task-read-barcodes-dense",
380 | "ExpectedBarcodesCount": 0,
381 | "LocalizationModes": [
382 | {
383 | "Mode": "LM_CONNECTED_BLOCKS"
384 | },
385 | {
386 | "Mode": "LM_LINES"
387 | }
388 | ],
389 | "DeblurModes": [
390 | {
391 | "Mode": "DM_BASED_ON_LOC_BIN"
392 | },
393 | {
394 | "Mode": "DM_THRESHOLD_BINARIZATION"
395 | },
396 | {
397 | "Mode": "DM_DIRECT_BINARIZATION"
398 | },
399 | {
400 | "Mode": "DM_SMOOTHING"
401 | },
402 | {
403 | "Mode": "DM_GRAY_EQUALIZATION"
404 | }
405 | ],
406 | "BarcodeFormatSpecificationNameArray": [
407 | "bfs1-dense",
408 | "bfs2-dense"
409 | ],
410 | "SectionImageParameterArray": [
411 | {
412 | "Section": "ST_REGION_PREDETECTION",
413 | "ImageParameterName": "ip-read-barcodes-dense"
414 | },
415 | {
416 | "Section": "ST_BARCODE_LOCALIZATION",
417 | "ImageParameterName": "ip-read-barcodes-dense"
418 | },
419 | {
420 | "Section": "ST_BARCODE_DECODING",
421 | "ImageParameterName": "ip-read-barcodes-dense"
422 | }
423 | ]
424 | },
425 | {
426 | "Name": "task-read-barcodes-distant",
427 | "ExpectedBarcodesCount": 0,
428 | "LocalizationModes": [
429 | {
430 | "Mode": "LM_CONNECTED_BLOCKS"
431 | },
432 | {
433 | "Mode": "LM_LINES"
434 | }
435 | ],
436 | "DeblurModes": [
437 | {
438 | "Mode": "DM_BASED_ON_LOC_BIN"
439 | },
440 | {
441 | "Mode": "DM_THRESHOLD_BINARIZATION"
442 | },
443 | {
444 | "Mode": "DM_DIRECT_BINARIZATION"
445 | }
446 | ],
447 | "BarcodeFormatSpecificationNameArray": [
448 | "bfs1-distant",
449 | "bfs2-distant"
450 | ],
451 | "SectionImageParameterArray": [
452 | {
453 | "Section": "ST_REGION_PREDETECTION",
454 | "ImageParameterName": "ip-read-barcodes-distant"
455 | },
456 | {
457 | "Section": "ST_BARCODE_LOCALIZATION",
458 | "ImageParameterName": "ip-read-barcodes-distant"
459 | },
460 | {
461 | "Section": "ST_BARCODE_DECODING",
462 | "ImageParameterName": "ip-read-barcodes-distant"
463 | }
464 | ]
465 | }
466 | ],
467 | "ImageParameterOptions": [
468 | {
469 | "Name": "ip-read-barcodes",
470 | "TextDetectionMode": {
471 | "Mode": "TTDM_LINE",
472 | "Direction": "UNKNOWN",
473 | "Sensitivity": 3
474 | },
475 | "IfEraseTextZone": 1,
476 | "BinarizationModes": [
477 | {
478 | "Mode": "BM_LOCAL_BLOCK",
479 | "BlockSizeX": 71,
480 | "BlockSizeY": 71,
481 | "EnableFillBinaryVacancy": 0
482 | }
483 | ],
484 | "GrayscaleTransformationModes": [
485 | {
486 | "Mode": "GTM_ORIGINAL"
487 | }
488 | ]
489 | },
490 | {
491 | "Name": "ip-read-barcodes-speed-first",
492 | "TextDetectionMode": {
493 | "Mode": "TTDM_LINE",
494 | "Direction": "UNKNOWN",
495 | "Sensitivity": 3
496 | },
497 | "IfEraseTextZone": 1,
498 | "BinarizationModes": [
499 | {
500 | "Mode": "BM_LOCAL_BLOCK",
501 | "BlockSizeX": 27,
502 | "BlockSizeY": 27,
503 | "EnableFillBinaryVacancy": 1
504 | }
505 | ],
506 | "GrayscaleTransformationModes": [
507 | {
508 | "Mode": "GTM_ORIGINAL"
509 | }
510 | ],
511 | "ScaleDownThreshold": 2300
512 | },
513 | {
514 | "Name": "ip-read-barcodes-read-rate",
515 | "TextDetectionMode": {
516 | "Mode": "TTDM_LINE",
517 | "Direction": "UNKNOWN",
518 | "Sensitivity": 3
519 | },
520 | "IfEraseTextZone": 1,
521 | "BinarizationModes": [
522 | {
523 | "Mode": "BM_LOCAL_BLOCK",
524 | "BlockSizeX": 0,
525 | "BlockSizeY": 0,
526 | "EnableFillBinaryVacancy": 1
527 | }
528 | ],
529 | "GrayscaleTransformationModes": [
530 | {
531 | "Mode": "GTM_ORIGINAL"
532 | }
533 | ],
534 | "ScaleDownThreshold": 100000
535 | },
536 | {
537 | "Name": "ip-read-single-barcode",
538 | "TextDetectionMode": {
539 | "Mode": "TTDM_LINE",
540 | "Direction": "UNKNOWN",
541 | "Sensitivity": 3
542 | },
543 | "IfEraseTextZone": 1,
544 | "BinarizationModes": [
545 | {
546 | "Mode": "BM_LOCAL_BLOCK",
547 | "BlockSizeX": 27,
548 | "BlockSizeY": 27,
549 | "EnableFillBinaryVacancy": 0
550 | }
551 | ],
552 | "GrayscaleTransformationModes": [
553 | {
554 | "Mode": "GTM_ORIGINAL"
555 | }
556 | ],
557 | "ScaleDownThreshold": 2300
558 | },
559 | {
560 | "Name": "ip-read-barcodes-balance",
561 | "TextDetectionMode": {
562 | "Mode": "TTDM_LINE",
563 | "Direction": "UNKNOWN",
564 | "Sensitivity": 3
565 | },
566 | "IfEraseTextZone": 1,
567 | "BinarizationModes": [
568 | {
569 | "Mode": "BM_LOCAL_BLOCK",
570 | "BlockSizeX": 0,
571 | "BlockSizeY": 0,
572 | "EnableFillBinaryVacancy": 1
573 | }
574 | ],
575 | "GrayscaleTransformationModes": [
576 | {
577 | "Mode": "GTM_ORIGINAL"
578 | }
579 | ]
580 | },
581 | {
582 | "Name": "ip-read-barcodes-dense",
583 | "TextDetectionMode": {
584 | "Mode": "TTDM_LINE",
585 | "Direction": "UNKNOWN",
586 | "Sensitivity": 3
587 | },
588 | "IfEraseTextZone": 1,
589 | "BinarizationModes": [
590 | {
591 | "Mode": "BM_LOCAL_BLOCK",
592 | "BlockSizeX": 0,
593 | "BlockSizeY": 0,
594 | "EnableFillBinaryVacancy": 1
595 | }
596 | ],
597 | "GrayscaleTransformationModes": [
598 | {
599 | "Mode": "GTM_ORIGINAL"
600 | }
601 | ],
602 | "ScaleDownThreshold": 100000
603 | },
604 | {
605 | "Name": "ip-read-barcodes-distant",
606 | "TextDetectionMode": {
607 | "Mode": "TTDM_LINE",
608 | "Direction": "UNKNOWN",
609 | "Sensitivity": 3
610 | },
611 | "IfEraseTextZone": 1,
612 | "BinarizationModes": [
613 | {
614 | "Mode": "BM_LOCAL_BLOCK",
615 | "BlockSizeX": 0,
616 | "BlockSizeY": 0,
617 | "EnableFillBinaryVacancy": 1
618 | }
619 | ],
620 | "GrayscaleTransformationModes": [
621 | {
622 | "Mode": "GTM_ORIGINAL"
623 | }
624 | ],
625 | "ScaleDownThreshold": 2300
626 | }
627 | ]
628 | }
--------------------------------------------------------------------------------
/dist/dynamsoft-barcode-reader@10.4.31/dist/dbr.d.ts:
--------------------------------------------------------------------------------
1 | import { CapturedResultItem, Quadrilateral, ImageTag, RegionObjectElement, DSImageData, EnumGrayscaleTransformationMode, EnumGrayscaleEnhancementMode, IntermediateResultExtraInfo, IntermediateResultUnit } from 'dynamsoft-core';
2 |
3 | declare class BarcodeReaderModule {
4 | static getVersion(): string;
5 | }
6 |
7 | declare const EnumBarcodeFormat: {
8 | /**No barcode format in BarcodeFormat*/
9 | BF_NULL: bigint;
10 | /**All supported formats in BarcodeFormat*/
11 | BF_ALL: bigint;
12 | /**Use the default barcode format settings*/
13 | BF_DEFAULT: bigint;
14 | /**Combined value of BF_CODABAR, BF_CODE_128, BF_CODE_39, BF_CODE_39_Extended, BF_CODE_93, BF_EAN_13, BF_EAN_8, INDUSTRIAL_25, BF_ITF, BF_UPC_A, BF_UPC_E, BF_MSI_CODE; */
15 | BF_ONED: bigint;
16 | /**Combined value of BF_GS1_DATABAR_OMNIDIRECTIONAL, BF_GS1_DATABAR_TRUNCATED, BF_GS1_DATABAR_STACKED, BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL, BF_GS1_DATABAR_EXPANDED, BF_GS1_DATABAR_EXPANDED_STACKED, BF_GS1_DATABAR_LIMITED*/
17 | BF_GS1_DATABAR: bigint;
18 | /**Code 39 */
19 | BF_CODE_39: bigint;
20 | /**Code 128 */
21 | BF_CODE_128: bigint;
22 | /**Code 93 */
23 | BF_CODE_93: bigint;
24 | /**Codabar */
25 | BF_CODABAR: bigint;
26 | /**Interleaved 2 of 5 */
27 | BF_ITF: bigint;
28 | /**EAN-13 */
29 | BF_EAN_13: bigint;
30 | /**EAN-8 */
31 | BF_EAN_8: bigint;
32 | /**UPC-A */
33 | BF_UPC_A: bigint;
34 | /**UPC-E */
35 | BF_UPC_E: bigint;
36 | /**Industrial 2 of 5 */
37 | BF_INDUSTRIAL_25: bigint;
38 | /**CODE39 Extended */
39 | BF_CODE_39_EXTENDED: bigint;
40 | /**GS1 Databar Omnidirectional*/
41 | BF_GS1_DATABAR_OMNIDIRECTIONAL: bigint;
42 | /**GS1 Databar Truncated*/
43 | BF_GS1_DATABAR_TRUNCATED: bigint;
44 | /**GS1 Databar Stacked*/
45 | BF_GS1_DATABAR_STACKED: bigint;
46 | /**GS1 Databar Stacked Omnidirectional*/
47 | BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL: bigint;
48 | /**GS1 Databar Expanded*/
49 | BF_GS1_DATABAR_EXPANDED: bigint;
50 | /**GS1 Databar Expaned Stacked*/
51 | BF_GS1_DATABAR_EXPANDED_STACKED: bigint;
52 | /**GS1 Databar Limited*/
53 | BF_GS1_DATABAR_LIMITED: bigint;
54 | /**Patch code. */
55 | BF_PATCHCODE: bigint;
56 | /**PDF417 */
57 | BF_CODE_32: bigint;
58 | /**PDF417 */
59 | BF_PDF417: bigint;
60 | /**QRCode */
61 | BF_QR_CODE: bigint;
62 | /**DataMatrix */
63 | BF_DATAMATRIX: bigint;
64 | /**AZTEC */
65 | BF_AZTEC: bigint;
66 | /**MAXICODE */
67 | BF_MAXICODE: bigint;
68 | /**Micro QR Code*/
69 | BF_MICRO_QR: bigint;
70 | /**Micro PDF417*/
71 | BF_MICRO_PDF417: bigint;
72 | /**GS1 Composite Code*/
73 | BF_GS1_COMPOSITE: bigint;
74 | /**MSI Code*/
75 | BF_MSI_CODE: bigint;
76 | BF_CODE_11: bigint;
77 | BF_TWO_DIGIT_ADD_ON: bigint;
78 | BF_FIVE_DIGIT_ADD_ON: bigint;
79 | BF_MATRIX_25: bigint;
80 | /**Combined value of BF2_USPSINTELLIGENTMAIL, BF2_POSTNET, BF2_PLANET, BF2_AUSTRALIANPOST, BF2_RM4SCC.*/
81 | BF_POSTALCODE: bigint;
82 | /**Nonstandard barcode */
83 | BF_NONSTANDARD_BARCODE: bigint;
84 | /**USPS Intelligent Mail.*/
85 | BF_USPSINTELLIGENTMAIL: bigint;
86 | /**Postnet.*/
87 | BF_POSTNET: bigint;
88 | /**Planet.*/
89 | BF_PLANET: bigint;
90 | /**Australian Post.*/
91 | BF_AUSTRALIANPOST: bigint;
92 | /**Royal Mail 4-State Customer Barcode.*/
93 | BF_RM4SCC: bigint;
94 | /**KIX.*/
95 | BF_KIX: bigint;
96 | /**DotCode.*/
97 | BF_DOTCODE: bigint;
98 | /**_PHARMACODE_ONE_TRACK.*/
99 | BF_PHARMACODE_ONE_TRACK: bigint;
100 | /**PHARMACODE_TWO_TRACK.*/
101 | BF_PHARMACODE_TWO_TRACK: bigint;
102 | /**PHARMACODE.*/
103 | BF_PHARMACODE: bigint;
104 | };
105 | type EnumBarcodeFormat = bigint;
106 |
107 | declare enum EnumExtendedBarcodeResultType {
108 | EBRT_STANDARD_RESULT = 0,
109 | EBRT_CANDIDATE_RESULT = 1,
110 | EBRT_PARTIAL_RESULT = 2
111 | }
112 |
113 | declare enum EnumQRCodeErrorCorrectionLevel {
114 | QRECL_ERROR_CORRECTION_H = 0,
115 | QRECL_ERROR_CORRECTION_L = 1,
116 | QRECL_ERROR_CORRECTION_M = 2,
117 | QRECL_ERROR_CORRECTION_Q = 3
118 | }
119 |
120 | /** Label: DBRJS10.0.10-Check
121 | * @enum EnumLocalizationMode
122 | *
123 | * Describes the localization mode.
124 | */
125 | declare enum EnumLocalizationMode {
126 | /**Not supported yet. */
127 | LM_AUTO = 1,
128 | /**Localizes barcodes by searching for connected blocks. This algorithm usually gives best result and it is recommended to set ConnectedBlocks to the highest priority. */
129 | LM_CONNECTED_BLOCKS = 2,
130 | /**Localizes barcodes by groups of contiguous black-white regions. This is optimized for QRCode and DataMatrix. */
131 | LM_STATISTICS = 4,
132 | /**Localizes barcodes by searching for groups of lines. This is optimized for 1D and PDF417 barcodes. */
133 | LM_LINES = 8,
134 | /**Localizes barcodes quickly. This mode is recommended in interactive scenario. Check @ref LM for available argument settings.*/
135 | LM_SCAN_DIRECTLY = 16,
136 | /**Localizes barcodes by groups of marks.This is optimized for DPM codes. */
137 | LM_STATISTICS_MARKS = 32,
138 | /**Localizes barcodes by groups of connected blocks and lines.This is optimized for postal codes. */
139 | LM_STATISTICS_POSTAL_CODE = 64,
140 | /**Localizes barcodes from the centre of the image. Check @ref LM for available argument settings. */
141 | LM_CENTRE = 128,
142 | /**Localizes 1D barcodes fast. Check @ref LM for available argument settings. */
143 | LM_ONED_FAST_SCAN = 256,
144 | LM_REV = -2147483648,
145 | /**Skips localization. */
146 | LM_SKIP = 0
147 | }
148 |
149 | /** Label: DBRJS10.0.10-Check
150 | * @enum EnumDeblurMode
151 | *
152 | * Describes the deblur mode.
153 | */
154 | declare enum EnumDeblurMode {
155 | /**Performs deblur process using the direct binarization algorithm.*/
156 | DM_DIRECT_BINARIZATION = 1,
157 | /**Performs deblur process using the threshold binarization algorithm.*/
158 | DM_THRESHOLD_BINARIZATION = 2,
159 | /**Performs deblur process using the gray equalization algorithm.*/
160 | DM_GRAY_EQUALIZATION = 4,
161 | /**Performs deblur process using the smoothing algorithm.*/
162 | DM_SMOOTHING = 8,
163 | /**Performs deblur process using the morphing algorithm.*/
164 | DM_MORPHING = 16,
165 | /**Performs deblur process using the deep analysis algorithm.*/
166 | DM_DEEP_ANALYSIS = 32,
167 | /**Performs deblur process using the sharpening algorithm.*/
168 | DM_SHARPENING = 64,
169 | /**Performs deblur process based on the binary image from the localization process.*/
170 | DM_BASED_ON_LOC_BIN = 128,
171 | /**Performs deblur process using the sharpening and smoothing algorithm.*/
172 | DM_SHARPENING_SMOOTHING = 256,
173 | /**Reserved setting for deblur mode.*/
174 | DM_REV = -2147483648,
175 | /**Skips the deblur process.*/
176 | DM_SKIP = 0
177 | }
178 |
179 | interface BarcodeDetails {
180 | }
181 |
182 | interface AztecDetails extends BarcodeDetails {
183 | rows: number;
184 | columns: number;
185 | layerNumber: number;
186 | }
187 |
188 | interface BarcodeResultItem extends CapturedResultItem {
189 | format: EnumBarcodeFormat;
190 | formatString: string;
191 | text: string;
192 | bytes: Uint8Array;
193 | location: Quadrilateral;
194 | confidence: number;
195 | angle: number;
196 | moduleSize: number;
197 | details: BarcodeDetails;
198 | isMirrored: boolean;
199 | isDPM: boolean;
200 | }
201 |
202 | interface DataMatrixDetails extends BarcodeDetails {
203 | rows: number;
204 | columns: number;
205 | dataRegionRows: number;
206 | dataRegionColumns: number;
207 | dataRegionNumber: number;
208 | }
209 |
210 | interface DecodedBarcodesResult {
211 | readonly originalImageHashId: string;
212 | readonly originalImageTag: ImageTag;
213 | readonly barcodeResultItems: Array;
214 | readonly errorCode: number;
215 | readonly errorString: string;
216 | }
217 | declare module "dynamsoft-capture-vision-router" {
218 | interface CapturedResultReceiver {
219 | onDecodedBarcodesReceived?: (result: DecodedBarcodesResult) => void;
220 | }
221 | interface CapturedResultFilter {
222 | onDecodedBarcodesReceived?: (result: DecodedBarcodesResult) => void;
223 | }
224 | }
225 |
226 | interface DecodedBarcodeElement extends RegionObjectElement {
227 | format: EnumBarcodeFormat;
228 | formatString: string;
229 | text: string;
230 | bytes: Uint8Array;
231 | details: BarcodeDetails;
232 | isDPM: boolean;
233 | isMirrored: boolean;
234 | angle: number;
235 | moduleSize: number;
236 | confidence: number;
237 | extendedBarcodeResults: Array;
238 | }
239 |
240 | interface ExtendedBarcodeResult extends DecodedBarcodeElement {
241 | extendedBarcodeResultType: EnumExtendedBarcodeResultType;
242 | deformation: number;
243 | clarity: number;
244 | samplingImage: DSImageData;
245 | }
246 |
247 | interface OneDCodeDetails extends BarcodeDetails {
248 | startCharsBytes: Array;
249 | stopCharsBytes: Array;
250 | checkDigitBytes: Array;
251 | startPatternRange: number;
252 | middlePatternRange: number;
253 | endPatternRange: number;
254 | }
255 |
256 | interface PDF417Details extends BarcodeDetails {
257 | rows: number;
258 | columns: number;
259 | errorCorrectionLevel: number;
260 | hasLeftRowIndicator: boolean;
261 | hasRightRowIndicator: boolean;
262 | }
263 |
264 | interface QRCodeDetails extends BarcodeDetails {
265 | rows: number;
266 | columns: number;
267 | errorCorrectionLevel: number;
268 | version: number;
269 | model: number;
270 | mode: number;
271 | page: number;
272 | totalPage: number;
273 | parityData: number;
274 | dataMaskPattern: number;
275 | codewords: Array;
276 | }
277 |
278 | interface SimplifiedBarcodeReaderSettings {
279 | barcodeFormatIds: EnumBarcodeFormat;
280 | expectedBarcodesCount: number;
281 | grayscaleTransformationModes: Array;
282 | grayscaleEnhancementModes: Array;
283 | localizationModes: Array;
284 | deblurModes: Array;
285 | minResultConfidence: number;
286 | minBarcodeTextLength: number;
287 | barcodeTextRegExPattern: string;
288 | }
289 |
290 | /**
291 | * The `CandidateBarcodeZone` interface represents a candidate barcode zone.
292 | */
293 | interface CandidateBarcodeZone {
294 | /** Location of the candidate barcode zone within the image. */
295 | location: Quadrilateral;
296 | /** Possible formats of the localized barcode. */
297 | possibleFormats: EnumBarcodeFormat;
298 | }
299 |
300 | /**
301 | * The `CandidateBarcodeZonesUnit` interface extends the `IntermediateResultUnit` interface and represents a unit of candidate barcode zones.
302 | */
303 | interface CandidateBarcodeZonesUnit extends IntermediateResultUnit {
304 | /** Array of candidate barcode zones represented as quadrilaterals. */
305 | candidateBarcodeZones: Array;
306 | }
307 | declare module "dynamsoft-capture-vision-router" {
308 | interface IntermediateResultReceiver {
309 | onCandidateBarcodeZonesUnitReceived?: (result: CandidateBarcodeZonesUnit, info: IntermediateResultExtraInfo) => void;
310 | }
311 | }
312 |
313 | interface ComplementedBarcodeImageUnit extends IntermediateResultUnit {
314 | imageData: DSImageData;
315 | location: Quadrilateral;
316 | }
317 | declare module "dynamsoft-capture-vision-router" {
318 | interface IntermediateResultReceiver {
319 | onComplementedBarcodeImageUnitReceived?: (result: ComplementedBarcodeImageUnit, info: IntermediateResultExtraInfo) => void;
320 | }
321 | }
322 |
323 | interface DecodedBarcodesUnit extends IntermediateResultUnit {
324 | decodedBarcodes: Array;
325 | }
326 | declare module "dynamsoft-capture-vision-router" {
327 | interface IntermediateResultReceiver {
328 | onDecodedBarcodesReceived?: (result: DecodedBarcodesUnit, info: IntermediateResultExtraInfo) => void;
329 | }
330 | }
331 |
332 | /**
333 | * The `DeformationResistedBarcode` interface represents a deformation-resisted barcode image.
334 | */
335 | interface DeformationResistedBarcode {
336 | /** Format of the barcode, as defined by `EnumBarcodeFormat`. */
337 | format: EnumBarcodeFormat;
338 | /** Image data of the deformation-resisted barcode image. */
339 | imageData: DSImageData;
340 | /** Location of the deformation-resisted barcode within the image. */
341 | location: Quadrilateral;
342 | }
343 |
344 | /**
345 | * The `DeformationResistedBarcodeImageUnit` interface extends the `IntermediateResultUnit` interface and represents a unit that holds the deformation-resisted barcode which includes the corresponding image data, its location, and the barcode format.
346 | */
347 | interface DeformationResistedBarcodeImageUnit extends IntermediateResultUnit {
348 | /** The deformation-resisted barcode. */
349 | deformationResistedBarcode: DeformationResistedBarcode;
350 | }
351 | declare module "dynamsoft-capture-vision-router" {
352 | interface IntermediateResultReceiver {
353 | onDeformationResistedBarcodeImageUnitReceived?: (result: DeformationResistedBarcodeImageUnit, info: IntermediateResultExtraInfo) => void;
354 | }
355 | }
356 |
357 | interface LocalizedBarcodeElement extends RegionObjectElement {
358 | possibleFormats: EnumBarcodeFormat;
359 | possibleFormatsString: string;
360 | angle: number;
361 | moduleSize: number;
362 | confidence: number;
363 | }
364 |
365 | interface LocalizedBarcodesUnit extends IntermediateResultUnit {
366 | localizedBarcodes: Array;
367 | }
368 | declare module "dynamsoft-capture-vision-router" {
369 | interface IntermediateResultReceiver {
370 | onLocalizedBarcodesReceived?: (result: LocalizedBarcodesUnit, info: IntermediateResultExtraInfo) => void;
371 | }
372 | }
373 |
374 | interface ScaledUpBarcodeImageUnit extends IntermediateResultUnit {
375 | imageData: DSImageData;
376 | }
377 | declare module "dynamsoft-capture-vision-router" {
378 | interface IntermediateResultReceiver {
379 | onScaledUpBarcodeImageUnitReceived?: (result: ScaledUpBarcodeImageUnit, info: IntermediateResultExtraInfo) => void;
380 | }
381 | }
382 |
383 | export { AztecDetails, BarcodeDetails, BarcodeReaderModule, BarcodeResultItem, CandidateBarcodeZone, CandidateBarcodeZonesUnit, ComplementedBarcodeImageUnit, DataMatrixDetails, DecodedBarcodeElement, DecodedBarcodesResult, DecodedBarcodesUnit, DeformationResistedBarcode, DeformationResistedBarcodeImageUnit, EnumBarcodeFormat, EnumDeblurMode, EnumExtendedBarcodeResultType, EnumLocalizationMode, EnumQRCodeErrorCorrectionLevel, ExtendedBarcodeResult, LocalizedBarcodeElement, LocalizedBarcodesUnit, OneDCodeDetails, PDF417Details, QRCodeDetails, ScaledUpBarcodeImageUnit, SimplifiedBarcodeReaderSettings };
384 |
--------------------------------------------------------------------------------
/dist/dynamsoft-barcode-reader@10.4.31/dist/dbr.esm.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Dynamsoft JavaScript Library
3 | * @product Dynamsoft Barcode Reader JS Edition
4 | * @website http://www.dynamsoft.com
5 | * @copyright Copyright 2024, Dynamsoft Corporation
6 | * @author Dynamsoft
7 | * @version 10.4.31
8 | * @fileoverview Dynamsoft JavaScript Library for Barcode Reader
9 | * More info on dbr JS: https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/
10 | */
11 | import{CoreModule as _,workerAutoResources as I,mapPackageRegister as B,compareVersion as R,innerVersions as n}from"dynamsoft-core";const t="undefined"==typeof self,A="function"==typeof importScripts,E=(()=>{if(!A){if(!t&&document.currentScript){let _=document.currentScript.src,I=_.indexOf("?");if(-1!=I)_=_.substring(0,I);else{let I=_.indexOf("#");-1!=I&&(_=_.substring(0,I))}return _.substring(0,_.lastIndexOf("/")+1)}return"./"}})(),T=_=>{if(null==_&&(_="./"),t||A);else{let I=document.createElement("a");I.href=_,_=I.href}return _.endsWith("/")||(_+="/"),_};_.engineResourcePaths.dbr={version:"10.4.31",path:E,isInternal:!0},I.dbr={js:!1,wasm:!0,deps:["license","dip"]},B.dbr={};const i="1.4.21";"string"!=typeof _.engineResourcePaths.std&&R(_.engineResourcePaths.std.version,i)<0&&(_.engineResourcePaths.std={version:i,path:T(E+`../../dynamsoft-capture-vision-std@${i}/dist/`),isInternal:!0});const D="2.4.31";(!_.engineResourcePaths.dip||"string"!=typeof _.engineResourcePaths.dip&&R(_.engineResourcePaths.dip.version,D)<0)&&(_.engineResourcePaths.dip={version:D,path:T(E+`../../dynamsoft-image-processing@${D}/dist/`),isInternal:!0});class O{static getVersion(){const _=n.dbr&&n.dbr.wasm,I=n.dbr&&n.dbr.worker;return`10.4.31(Worker: ${I||"Not Loaded"}, Wasm: ${_||"Not Loaded"})`}}const e={BF_NULL:BigInt(0),BF_ALL:BigInt("0xFFFFFFFEFFFFFFFF"),BF_DEFAULT:BigInt(4265345023),BF_ONED:BigInt(3147775),BF_GS1_DATABAR:BigInt(260096),BF_CODE_39:BigInt(1),BF_CODE_128:BigInt(2),BF_CODE_93:BigInt(4),BF_CODABAR:BigInt(8),BF_ITF:BigInt(16),BF_EAN_13:BigInt(32),BF_EAN_8:BigInt(64),BF_UPC_A:BigInt(128),BF_UPC_E:BigInt(256),BF_INDUSTRIAL_25:BigInt(512),BF_CODE_39_EXTENDED:BigInt(1024),BF_GS1_DATABAR_OMNIDIRECTIONAL:BigInt(2048),BF_GS1_DATABAR_TRUNCATED:BigInt(4096),BF_GS1_DATABAR_STACKED:BigInt(8192),BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL:BigInt(16384),BF_GS1_DATABAR_EXPANDED:BigInt(32768),BF_GS1_DATABAR_EXPANDED_STACKED:BigInt(65536),BF_GS1_DATABAR_LIMITED:BigInt(131072),BF_PATCHCODE:BigInt(262144),BF_CODE_32:BigInt(16777216),BF_PDF417:BigInt(33554432),BF_QR_CODE:BigInt(67108864),BF_DATAMATRIX:BigInt(134217728),BF_AZTEC:BigInt(268435456),BF_MAXICODE:BigInt(536870912),BF_MICRO_QR:BigInt(1073741824),BF_MICRO_PDF417:BigInt(524288),BF_GS1_COMPOSITE:BigInt(2147483648),BF_MSI_CODE:BigInt(1048576),BF_CODE_11:BigInt(2097152),BF_TWO_DIGIT_ADD_ON:BigInt(4194304),BF_FIVE_DIGIT_ADD_ON:BigInt(8388608),BF_MATRIX_25:BigInt(68719476736),BF_POSTALCODE:BigInt(0x3f0000000000000),BF_NONSTANDARD_BARCODE:BigInt(4294967296),BF_USPSINTELLIGENTMAIL:BigInt(4503599627370496),BF_POSTNET:BigInt(9007199254740992),BF_PLANET:BigInt(0x40000000000000),BF_AUSTRALIANPOST:BigInt(0x80000000000000),BF_RM4SCC:BigInt(72057594037927940),BF_KIX:BigInt(0x200000000000000),BF_DOTCODE:BigInt(8589934592),BF_PHARMACODE_ONE_TRACK:BigInt(17179869184),BF_PHARMACODE_TWO_TRACK:BigInt(34359738368),BF_PHARMACODE:BigInt(51539607552)};var C,S,N,L;!function(_){_[_.EBRT_STANDARD_RESULT=0]="EBRT_STANDARD_RESULT",_[_.EBRT_CANDIDATE_RESULT=1]="EBRT_CANDIDATE_RESULT",_[_.EBRT_PARTIAL_RESULT=2]="EBRT_PARTIAL_RESULT"}(C||(C={})),function(_){_[_.QRECL_ERROR_CORRECTION_H=0]="QRECL_ERROR_CORRECTION_H",_[_.QRECL_ERROR_CORRECTION_L=1]="QRECL_ERROR_CORRECTION_L",_[_.QRECL_ERROR_CORRECTION_M=2]="QRECL_ERROR_CORRECTION_M",_[_.QRECL_ERROR_CORRECTION_Q=3]="QRECL_ERROR_CORRECTION_Q"}(S||(S={})),function(_){_[_.LM_AUTO=1]="LM_AUTO",_[_.LM_CONNECTED_BLOCKS=2]="LM_CONNECTED_BLOCKS",_[_.LM_STATISTICS=4]="LM_STATISTICS",_[_.LM_LINES=8]="LM_LINES",_[_.LM_SCAN_DIRECTLY=16]="LM_SCAN_DIRECTLY",_[_.LM_STATISTICS_MARKS=32]="LM_STATISTICS_MARKS",_[_.LM_STATISTICS_POSTAL_CODE=64]="LM_STATISTICS_POSTAL_CODE",_[_.LM_CENTRE=128]="LM_CENTRE",_[_.LM_ONED_FAST_SCAN=256]="LM_ONED_FAST_SCAN",_[_.LM_REV=-2147483648]="LM_REV",_[_.LM_SKIP=0]="LM_SKIP"}(N||(N={})),function(_){_[_.DM_DIRECT_BINARIZATION=1]="DM_DIRECT_BINARIZATION",_[_.DM_THRESHOLD_BINARIZATION=2]="DM_THRESHOLD_BINARIZATION",_[_.DM_GRAY_EQUALIZATION=4]="DM_GRAY_EQUALIZATION",_[_.DM_SMOOTHING=8]="DM_SMOOTHING",_[_.DM_MORPHING=16]="DM_MORPHING",_[_.DM_DEEP_ANALYSIS=32]="DM_DEEP_ANALYSIS",_[_.DM_SHARPENING=64]="DM_SHARPENING",_[_.DM_BASED_ON_LOC_BIN=128]="DM_BASED_ON_LOC_BIN",_[_.DM_SHARPENING_SMOOTHING=256]="DM_SHARPENING_SMOOTHING",_[_.DM_REV=-2147483648]="DM_REV",_[_.DM_SKIP=0]="DM_SKIP"}(L||(L={}));export{O as BarcodeReaderModule,e as EnumBarcodeFormat,L as EnumDeblurMode,C as EnumExtendedBarcodeResultType,N as EnumLocalizationMode,S as EnumQRCodeErrorCorrectionLevel};
12 |
--------------------------------------------------------------------------------
/dist/dynamsoft-barcode-reader@10.4.31/dist/dbr.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Dynamsoft JavaScript Library
3 | * @product Dynamsoft Barcode Reader JS Edition
4 | * @website http://www.dynamsoft.com
5 | * @copyright Copyright 2024, Dynamsoft Corporation
6 | * @author Dynamsoft
7 | * @version 10.4.31
8 | * @fileoverview Dynamsoft JavaScript Library for Barcode Reader
9 | * More info on dbr JS: https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/
10 | */
11 | !function(_,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("dynamsoft-core")):"function"==typeof define&&define.amd?define(["exports","dynamsoft-core"],e):e(((_="undefined"!=typeof globalThis?globalThis:_||self).Dynamsoft=_.Dynamsoft||{},_.Dynamsoft.DBR={}),_.Dynamsoft.Core)}(this,(function(_,e){"use strict";const n="undefined"==typeof self,t="function"==typeof importScripts,I=(()=>{if(!t){if(!n&&document.currentScript){let _=document.currentScript.src,e=_.indexOf("?");if(-1!=e)_=_.substring(0,e);else{let e=_.indexOf("#");-1!=e&&(_=_.substring(0,e))}return _.substring(0,_.lastIndexOf("/")+1)}return"./"}})(),E=_=>{if(null==_&&(_="./"),n||t);else{let e=document.createElement("a");e.href=_,_=e.href}return _.endsWith("/")||(_+="/"),_};e.CoreModule.engineResourcePaths.dbr={version:"10.4.31",path:I,isInternal:!0},e.workerAutoResources.dbr={js:!1,wasm:!0,deps:["license","dip"]},e.mapPackageRegister.dbr={};const R="1.4.21";"string"!=typeof e.CoreModule.engineResourcePaths.std&&e.compareVersion(e.CoreModule.engineResourcePaths.std.version,R)<0&&(e.CoreModule.engineResourcePaths.std={version:R,path:E(I+`../../dynamsoft-capture-vision-std@${R}/dist/`),isInternal:!0});const i="2.4.31";(!e.CoreModule.engineResourcePaths.dip||"string"!=typeof e.CoreModule.engineResourcePaths.dip&&e.compareVersion(e.CoreModule.engineResourcePaths.dip.version,i)<0)&&(e.CoreModule.engineResourcePaths.dip={version:i,path:E(I+`../../dynamsoft-image-processing@${i}/dist/`),isInternal:!0});const B={BF_NULL:BigInt(0),BF_ALL:BigInt("0xFFFFFFFEFFFFFFFF"),BF_DEFAULT:BigInt(4265345023),BF_ONED:BigInt(3147775),BF_GS1_DATABAR:BigInt(260096),BF_CODE_39:BigInt(1),BF_CODE_128:BigInt(2),BF_CODE_93:BigInt(4),BF_CODABAR:BigInt(8),BF_ITF:BigInt(16),BF_EAN_13:BigInt(32),BF_EAN_8:BigInt(64),BF_UPC_A:BigInt(128),BF_UPC_E:BigInt(256),BF_INDUSTRIAL_25:BigInt(512),BF_CODE_39_EXTENDED:BigInt(1024),BF_GS1_DATABAR_OMNIDIRECTIONAL:BigInt(2048),BF_GS1_DATABAR_TRUNCATED:BigInt(4096),BF_GS1_DATABAR_STACKED:BigInt(8192),BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL:BigInt(16384),BF_GS1_DATABAR_EXPANDED:BigInt(32768),BF_GS1_DATABAR_EXPANDED_STACKED:BigInt(65536),BF_GS1_DATABAR_LIMITED:BigInt(131072),BF_PATCHCODE:BigInt(262144),BF_CODE_32:BigInt(16777216),BF_PDF417:BigInt(33554432),BF_QR_CODE:BigInt(67108864),BF_DATAMATRIX:BigInt(134217728),BF_AZTEC:BigInt(268435456),BF_MAXICODE:BigInt(536870912),BF_MICRO_QR:BigInt(1073741824),BF_MICRO_PDF417:BigInt(524288),BF_GS1_COMPOSITE:BigInt(2147483648),BF_MSI_CODE:BigInt(1048576),BF_CODE_11:BigInt(2097152),BF_TWO_DIGIT_ADD_ON:BigInt(4194304),BF_FIVE_DIGIT_ADD_ON:BigInt(8388608),BF_MATRIX_25:BigInt(68719476736),BF_POSTALCODE:BigInt(0x3f0000000000000),BF_NONSTANDARD_BARCODE:BigInt(4294967296),BF_USPSINTELLIGENTMAIL:BigInt(4503599627370496),BF_POSTNET:BigInt(9007199254740992),BF_PLANET:BigInt(0x40000000000000),BF_AUSTRALIANPOST:BigInt(0x80000000000000),BF_RM4SCC:BigInt(72057594037927940),BF_KIX:BigInt(0x200000000000000),BF_DOTCODE:BigInt(8589934592),BF_PHARMACODE_ONE_TRACK:BigInt(17179869184),BF_PHARMACODE_TWO_TRACK:BigInt(34359738368),BF_PHARMACODE:BigInt(51539607552)};var o,A,T,r;_.EnumExtendedBarcodeResultType=void 0,(o=_.EnumExtendedBarcodeResultType||(_.EnumExtendedBarcodeResultType={}))[o.EBRT_STANDARD_RESULT=0]="EBRT_STANDARD_RESULT",o[o.EBRT_CANDIDATE_RESULT=1]="EBRT_CANDIDATE_RESULT",o[o.EBRT_PARTIAL_RESULT=2]="EBRT_PARTIAL_RESULT",_.EnumQRCodeErrorCorrectionLevel=void 0,(A=_.EnumQRCodeErrorCorrectionLevel||(_.EnumQRCodeErrorCorrectionLevel={}))[A.QRECL_ERROR_CORRECTION_H=0]="QRECL_ERROR_CORRECTION_H",A[A.QRECL_ERROR_CORRECTION_L=1]="QRECL_ERROR_CORRECTION_L",A[A.QRECL_ERROR_CORRECTION_M=2]="QRECL_ERROR_CORRECTION_M",A[A.QRECL_ERROR_CORRECTION_Q=3]="QRECL_ERROR_CORRECTION_Q",_.EnumLocalizationMode=void 0,(T=_.EnumLocalizationMode||(_.EnumLocalizationMode={}))[T.LM_AUTO=1]="LM_AUTO",T[T.LM_CONNECTED_BLOCKS=2]="LM_CONNECTED_BLOCKS",T[T.LM_STATISTICS=4]="LM_STATISTICS",T[T.LM_LINES=8]="LM_LINES",T[T.LM_SCAN_DIRECTLY=16]="LM_SCAN_DIRECTLY",T[T.LM_STATISTICS_MARKS=32]="LM_STATISTICS_MARKS",T[T.LM_STATISTICS_POSTAL_CODE=64]="LM_STATISTICS_POSTAL_CODE",T[T.LM_CENTRE=128]="LM_CENTRE",T[T.LM_ONED_FAST_SCAN=256]="LM_ONED_FAST_SCAN",T[T.LM_REV=-2147483648]="LM_REV",T[T.LM_SKIP=0]="LM_SKIP",_.EnumDeblurMode=void 0,(r=_.EnumDeblurMode||(_.EnumDeblurMode={}))[r.DM_DIRECT_BINARIZATION=1]="DM_DIRECT_BINARIZATION",r[r.DM_THRESHOLD_BINARIZATION=2]="DM_THRESHOLD_BINARIZATION",r[r.DM_GRAY_EQUALIZATION=4]="DM_GRAY_EQUALIZATION",r[r.DM_SMOOTHING=8]="DM_SMOOTHING",r[r.DM_MORPHING=16]="DM_MORPHING",r[r.DM_DEEP_ANALYSIS=32]="DM_DEEP_ANALYSIS",r[r.DM_SHARPENING=64]="DM_SHARPENING",r[r.DM_BASED_ON_LOC_BIN=128]="DM_BASED_ON_LOC_BIN",r[r.DM_SHARPENING_SMOOTHING=256]="DM_SHARPENING_SMOOTHING",r[r.DM_REV=-2147483648]="DM_REV",r[r.DM_SKIP=0]="DM_SKIP",_.BarcodeReaderModule=class{static getVersion(){const _=e.innerVersions.dbr&&e.innerVersions.dbr.wasm,n=e.innerVersions.dbr&&e.innerVersions.dbr.worker;return`10.4.31(Worker: ${n||"Not Loaded"}, Wasm: ${_||"Not Loaded"})`}},_.EnumBarcodeFormat=B}));
12 |
--------------------------------------------------------------------------------
/dist/dynamsoft-camera-enhancer@4.1.1/dist/dce.mobile-native.ui.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
11 |
12 |
13 |
14 |
17 |
18 |
19 |
20 |
21 | A
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
720P
67 |
- 1.0X -
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
100 |
105 |
106 |
111 |
113 |
118 |
123 |
128 |
131 |
134 |
137 |
140 |
147 |
151 |
157 |
162 |
165 |
168 |
169 |
170 |
171 |
example camera
172 |
173 |
174 |
175 |
480P
176 |
720P
177 |
1080P
178 |
2K
179 |
4K
180 |
181 |
182 |
183 |
184 |
222 |
--------------------------------------------------------------------------------
/dist/dynamsoft-camera-enhancer@4.1.1/dist/dce.ui.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
11 |
12 |
13 |
14 |
17 |
18 |
19 |
20 |
21 | ask 1920x1080
22 | ask 1280x720
23 | ask 640x480
24 |
25 |
26 |
27 |
28 |
29 |
30 |
33 |
38 |
39 |
44 |
46 |
51 |
56 |
61 |
64 |
67 |
70 |
73 |
80 |
84 |
90 |
95 |
98 |
101 |
102 |
103 |
104 |
105 |
115 |
116 |
--------------------------------------------------------------------------------
/dist/dynamsoft-capture-vision-std@1.4.21/dist/dynamsoft-barcode-reader-bundle.wasm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dynamsoft/barcode-reader-javascript/39d65696c79e28647dcf621abd62a18110540be1/dist/dynamsoft-capture-vision-std@1.4.21/dist/dynamsoft-barcode-reader-bundle.wasm
--------------------------------------------------------------------------------
/dist/dynamsoft-core@3.4.31/dist/core.worker.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Dynamsoft JavaScript Library
3 | * @product Dynamsoft Core JS Edition
4 | * @website https://www.dynamsoft.com
5 | * @copyright Copyright 2024, Dynamsoft Corporation
6 | * @author Dynamsoft
7 | * @version 3.4.31
8 | * @fileoverview Dynamsoft JavaScript Library for Core
9 | * More info on Dynamsoft Core JS: https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/core/core-module.html
10 | */
11 | !function(){"use strict";const e=e=>e&&"object"==typeof e&&"function"==typeof e.then,s=(async()=>{})().constructor;class t extends s{get status(){return this._s}get isPending(){return"pending"===this._s}get isFulfilled(){return"fulfilled"===this._s}get isRejected(){return"rejected"===this._s}get task(){return this._task}set task(t){let o;this._task=t,e(t)?o=t:"function"==typeof t&&(o=new s(t)),o&&(async()=>{try{const e=await o;t===this._task&&this.resolve(e)}catch(e){t===this._task&&this.reject(e)}})()}get isEmpty(){return null==this._task}constructor(s){let t,o;super(((e,s)=>{t=e,o=s})),this._s="pending",this.resolve=s=>{this.isPending&&(e(s)?this.task=s:(this._s="fulfilled",t(s)))},this.reject=e=>{this.isPending&&(this._s="rejected",o(e))},this.task=s}}const o=self,r={};o.coreWorkerVersion="3.4.31",o.versions=r;const a={},n=o.waitAsyncDependency=async e=>{let s="string"==typeof e?[e]:e,o=[];for(let e of s)o.push(a[e]=a[e]||new t);await Promise.all(o)},i=async(e,s)=>{let o,r="string"==typeof e?[e]:e,n=[];for(let e of r){let r;n.push(r=a[e]=a[e]||new t(o=o||s())),r.isEmpty&&(r.task=o=o||s())}await Promise.all(n)},c=[];o.setBufferIntoWasm=(e,s=0,t=0,o=0)=>{t&&(e=o?e.subarray(t,o):e.subarray(t));let r=c[s]=c[s]||{ptr:0,size:0,maxSize:0};return e.length>r.maxSize&&(r.ptr&&m._free(r.ptr),r.ptr=m._malloc(e.length),r.maxSize=e.length),m.HEAPU8.set(e,r.ptr),r.size=e.length,r.ptr};const l={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(l.needed){for(let e=0;e=l.size?(l.needed+=r,t=m._malloc(r),l.temps.push(t)):(t=l.buffer+l.pos,l.pos+=r),t},copy:function(e,s,t){switch(t>>>=0,s.BYTES_PER_ELEMENT){case 2:t>>>=1;break;case 4:t>>>=2;break;case 8:t>>>=3}for(let o=0;o{let s=intArrayFromString(e),t=l.alloc(s,m.HEAP8);return l.copy(s,m.HEAP8,t),t},m=o.Module={print:e=>{o.bLog&&w(e)},printErr:e=>{o.bLog&&w(e)},locateFile:(e,s)=>["dynamsoft-barcode-reader-bundle.wasm","core.wasm"].includes(e)?u.std+e:e},u=o.engineResourcePaths={},g=o.loadCore=async()=>{const e="core";await i(e,(async()=>{let s=o.bLog&&(w(e+" loading..."),Date.now())||0,t=new Promise((t=>{Module.onRuntimeInitialized=()=>{o.bLog&&w(e+" initialized, cost "+(Date.now()-s)+" ms"),t(void 0)}})),r=u.std+"dynamsoft-barcode-reader-bundle.js";importScripts(r),await t}))},f=o.loadSideModule=async(e,{js:s,wasm:t})=>{await i(e,(async()=>{await n("core");let t=o.bLog&&(w(e+" loading..."),Date.now())||0;if(s instanceof Array)for(let t of s){let s=u[e]+t;importScripts(s)}else if(s){let s=u[e]+e+".worker.js";importScripts(s)}wasmImports.emscripten_bind_CoreWasm_PreSetModuleExist&&(d(),wasmImports.emscripten_bind_CoreWasm_PreSetModuleExist(p(e.toUpperCase()))),wasmImports.emscripten_bind_CvrWasm_SetModuleExist&&(d(),wasmImports.emscripten_bind_CvrWasm_SetModuleExist(p(e.toUpperCase())));const a=JSON.parse(UTF8ToString(wasmImports.emscripten_bind_CoreWasm_GetModuleVersion_0())),i=o[`${e}WorkerVersion`];r[e]={worker:`${i||"No Worker"}`,wasm:a[e.toUpperCase()]},o.bLog&&w(e+" initialized, cost "+(Date.now()-t)+" ms")}))},_=o.mapController={loadWasm:async(e,s)=>{try{Object.assign(u,e.engineResourcePaths),e.needLoadCore&&(e.bLog&&(o.bLog=!0),e.dm&&(o.strDomain=e.dm),e.bd&&(o.bDebug=!0),await g());for(let s of e.names)await f(s,e.autoResources[s]);if(e.needLoadCore){const e=JSON.parse(UTF8ToString(wasmImports.emscripten_bind_CoreWasm_GetModuleVersion_0()));r.core={worker:o.coreWorkerVersion,wasm:e.CORE}}for(let e in r)r[e].wasm&&(r[e].wasm=r[e].wasm.replace("20250211","23472-single-wasm"));h(s,{versions:r})}catch(e){console.log(e),b(s,e)}},setBLog:e=>{o.bLog=e.value},setBDebug:e=>{o.bDebug=e.value},getModuleVersion:async(e,s)=>{try{let e=UTF8ToString(wasmImports.emscripten_bind_CoreWasm_GetModuleVersion_0());h(s,{versions:JSON.parse(e)})}catch(e){b(s,e)}},cfd:async(e,s)=>{try{wasmImports.emscripten_bind_CoreWasm_static_CFD_1(e.count),h(s,{})}catch(e){b(s,e)}}};addEventListener("message",(e=>{const s=e.data?e.data:e,t=s.body,o=s.id,r=s.instanceID,a=_[s.type];if(!a)throw new Error("Unmatched task: "+s.type);"license_dynamsoft"==a&&(t.v="3.4.31-single-wasm"),a(t,o,r)}));const h=o.handleTaskRes=(e,s)=>{postMessage({type:"task",id:e,body:Object.assign({success:!0},s)})},b=o.handleTaskErr=(e,s)=>{postMessage({type:"task",id:e,body:{success:!1,message:(null==s?void 0:s.message)||"No have error message.",stack:o.bDebug&&(null==s?void 0:s.stack)||"No have stack."}})},w=o.log=e=>{postMessage({type:"log",message:e})}}();
--------------------------------------------------------------------------------
/dist/dynamsoft-license@3.4.31/dist/dls.license.dialog.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | x
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/dist/dynamsoft-license@3.4.31/dist/license.d.ts:
--------------------------------------------------------------------------------
1 | declare class LicenseModule {
2 | static getVersion(): string;
3 | }
4 |
5 | declare class LicenseManager {
6 | private static setLicenseServer;
7 | static _pLoad: any;
8 | static bPassValidation: boolean;
9 | static bCallInitLicense: boolean;
10 | private static _license;
11 | static get license(): string;
12 | static set license(license: string);
13 | /**
14 | * Specify the license server URL.
15 | */
16 | private static _licenseServer?;
17 | static get licenseServer(): string[] | string;
18 | static set licenseServer(value: string[] | string);
19 | private static _deviceFriendlyName;
20 | static get deviceFriendlyName(): string;
21 | static set deviceFriendlyName(value: string);
22 | /**
23 | * License the components.
24 | * @param license the license key to be used.
25 | * @remarks - for an online license, LicenseManager asks DLS for the license associated with the 'license' key and gets all usable modules
26 | - for an offline license, LicenseManager parses it to get a list of usable modules
27 | * @returns a promise resolving to true or false to indicate whether the license was initialized successfully.
28 | */
29 | static initLicense(license: string, options?: {
30 | executeNow: boolean;
31 | } | boolean): void | Promise;
32 | /**
33 | * The following methods should be called before `initLicense`.
34 | */
35 | static setDeviceFriendlyName(name: string): void;
36 | static getDeviceFriendlyName(): string;
37 | static getDeviceUUID(): Promise;
38 | }
39 |
40 | export { LicenseManager, LicenseModule };
41 |
--------------------------------------------------------------------------------
/dist/dynamsoft-license@3.4.31/dist/license.esm.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Dynamsoft JavaScript Library
3 | * @product Dynamsoft License JS Edition
4 | * @website https://www.dynamsoft.com
5 | * @copyright Copyright 2024, Dynamsoft Corporation
6 | * @author Dynamsoft
7 | * @version 3.4.31
8 | * @fileoverview Dynamsoft JavaScript Library for Core
9 | * More info DL JS: https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/license/license-module.html
10 | */
11 | import{mapPackageRegister as e,loadWasm as t,doOrWaitAsyncDependency as s,getNextTaskID as r,mapTaskCallBack as n,onLog as i,CoreModule as o,handleEngineResourcePaths as a,waitAsyncDependency as c,worker as l,mapAsyncDependency as d,workerAutoResources as u,compareVersion as f,innerVersions as h}from"dynamsoft-core";const g="undefined"==typeof self,m=g?{}:self,p="function"==typeof importScripts,y=(()=>{if(!p){if(!g&&document.currentScript){let e=document.currentScript.src,t=e.indexOf("?");if(-1!=t)e=e.substring(0,t);else{let t=e.indexOf("#");-1!=t&&(e=e.substring(0,t))}return e.substring(0,e.lastIndexOf("/")+1)}return"./"}})(),v=e=>{if(null==e&&(e="./"),g||p);else{let t=document.createElement("a");t.href=e,e=t.href}return e.endsWith("/")||(e+="/"),e},w=e=>e&&"object"==typeof e&&"function"==typeof e.then,b=(async()=>{})().constructor;class S extends b{get status(){return this._s}get isPending(){return"pending"===this._s}get isFulfilled(){return"fulfilled"===this._s}get isRejected(){return"rejected"===this._s}get task(){return this._task}set task(e){let t;this._task=e,w(e)?t=e:"function"==typeof e&&(t=new b(e)),t&&(async()=>{try{const s=await t;e===this._task&&this.resolve(s)}catch(t){e===this._task&&this.reject(t)}})()}get isEmpty(){return null==this._task}constructor(e){let t,s;super(((e,r)=>{t=e,s=r})),this._s="pending",this.resolve=e=>{this.isPending&&(w(e)?this.task=e:(this._s="fulfilled",t(e)))},this.reject=e=>{this.isPending&&(this._s="rejected",s(e))},this.task=e}}const _=" is not allowed to change after `createInstance` or `loadWasm` is called.",k=!g&&document.currentScript&&(document.currentScript.getAttribute("data-license")||document.currentScript.getAttribute("data-productKeys")||document.currentScript.getAttribute("data-licenseKey")||document.currentScript.getAttribute("data-handshakeCode")||document.currentScript.getAttribute("data-organizationID"))||"",E=(e,t)=>{const s=e;if(s._license!==t){if(!s._pLoad.isEmpty)throw new Error("`license`"+_);s._license=t}};!g&&document.currentScript&&document.currentScript.getAttribute("data-sessionPassword");const L=e=>{if(null==e)e=[];else{e=e instanceof Array?[...e]:[e];for(let t=0;t{t=L(t);const s=e;if(s._licenseServer!==t){if(!s._pLoad.isEmpty)throw new Error("`licenseServer`"+_);s._licenseServer=t}},x=(e,t)=>{t=t||"";const s=e;if(s._deviceFriendlyName!==t){if(!s._pLoad.isEmpty)throw new Error("`deviceFriendlyName`"+_);s._deviceFriendlyName=t}};let C,P,N,I,R;"undefined"!=typeof navigator&&(C=navigator,P=C.userAgent,N=C.platform,I=C.mediaDevices),function(){if(!g){const e={Edge:{search:"Edg",verSearch:"Edg"},OPR:null,Chrome:null,Safari:{str:C.vendor,search:"Apple",verSearch:["Version","iPhone OS","CPU OS"]},Firefox:null,Explorer:{search:"MSIE",verSearch:"MSIE"}},t={HarmonyOS:null,Android:null,iPhone:null,iPad:null,Windows:{str:N,search:"Win"},Mac:{str:N},Linux:{str:N}};let s="unknownBrowser",r=0,n="unknownOS";for(let t in e){const n=e[t]||{};let i=n.str||P,o=n.search||t,a=n.verStr||P,c=n.verSearch||t;if(c instanceof Array||(c=[c]),-1!=i.indexOf(o)){s=t;for(let e of c){let t=a.indexOf(e);if(-1!=t){r=parseFloat(a.substring(t+e.length+1));break}}break}}for(let e in t){const s=t[e]||{};let r=s.str||P,i=s.search||e;if(-1!=r.indexOf(i)){n=e;break}}"Linux"==n&&-1!=P.indexOf("Windows NT")&&(n="HarmonyOS"),R={browser:s,version:r,OS:n}}g&&(R={browser:"ssr",version:0,OS:"ssr"})}(),I&&I.getUserMedia,"Chrome"===R.browser&&R.version>66||"Safari"===R.browser&&R.version>13||"OPR"===R.browser&&R.version>43||"Edge"===R.browser&&R.version;const W=()=>(t("license"),s("dynamsoft_inited",(async()=>{let{lt:e,l:t,ls:s,sp:d,rmk:u,cv:f}=((e,t=!1)=>{const s=e;if(s._pLoad.isEmpty){let e,r,n,i=s._license||"",o=JSON.parse(JSON.stringify(s._licenseServer)),a=s._sessionPassword,c=0;if(i.startsWith("t")||i.startsWith("f"))c=0;else if(0===i.length||i.startsWith("P")||i.startsWith("L")||i.startsWith("Y")||i.startsWith("A"))c=1;else{c=2;const t=i.indexOf(":");-1!=t&&(i=i.substring(t+1));const s=i.indexOf("?");if(-1!=s&&(r=i.substring(s+1),i=i.substring(0,s)),i.startsWith("DLC2"))c=0;else{if(i.startsWith("DLS2")){let t;try{let e=i.substring(4);e=atob(e),t=JSON.parse(e)}catch(e){throw new Error("Format Error: The license string you specified is invalid, please check to make sure it is correct.")}if(i=t.handshakeCode?t.handshakeCode:t.organizationID?t.organizationID:"","number"==typeof i&&(i=JSON.stringify(i)),0===o.length){let e=[];t.mainServerURL&&(e[0]=t.mainServerURL),t.standbyServerURL&&(e[1]=t.standbyServerURL),o=L(e)}!a&&t.sessionPassword&&(a=t.sessionPassword),e=t.remark}i&&"200001"!==i&&!i.startsWith("200001-")||(c=1)}}if(c&&(t||(m.crypto||(n="Please upgrade your browser to support online key."),m.crypto.subtle||(n="Require https to use online key in this browser."))),n)throw new Error(n);return 1===c&&(i="",console.warn("Applying for a public trial license ...")),{lt:c,l:i,ls:o,sp:a,rmk:e,cv:r}}throw new Error("Can't preprocess license again"+_)})(D),h=new S;D._pLoad.task=h,(async()=>{try{await D._pLoad}catch(e){}})();let g=r();n[g]=t=>{if(t.message&&D._onAuthMessage){let e=D._onAuthMessage(t.message);null!=e&&(t.message=e)}let s,r=!1;if(1===e&&(r=!0),t.success?(i&&i("init license success"),t.message&&console.warn(t.message),o._bSupportIRTModule=t.bSupportIRTModule,o._bSupportDce4Module=t.bSupportDce4Module,D.bPassValidation=!0,[0,-10076].includes(t.initLicenseInfo.errorCode)?[-10076].includes(t.initLicenseInfo.errorCode)&&console.warn(t.initLicenseInfo.errorString):h.reject(new Error(t.initLicenseInfo.errorString))):(s=Error(t.message),t.stack&&(s.stack=t.stack),t.ltsErrorCode&&(s.ltsErrorCode=t.ltsErrorCode),r||111==t.ltsErrorCode&&-1!=t.message.toLowerCase().indexOf("trial license")&&(r=!0)),r){const e=a(o.engineResourcePaths);(async(e,t,s)=>{if(!e._bNeverShowDialog)try{let r=await fetch(e.engineResourcePath+"dls.license.dialog.html");if(!r.ok)throw Error("Get license dialog fail. Network Error: "+r.statusText);let n=await r.text();if(!n.trim().startsWith("<"))throw Error("Get license dialog fail. Can't get valid HTMLElement.");let i=document.createElement("div");i.innerHTML=n;let o=[];for(let e=0;e{if(e==t.target){a.remove();for(let e of o)e.remove()}}));else if(!l&&e.classList.contains("dls-license-icon-close"))l=e,e.addEventListener("click",(()=>{a.remove();for(let e of o)e.remove()}));else if(!d&&e.classList.contains("dls-license-icon-error"))d=e,"error"!=t&&e.remove();else if(!u&&e.classList.contains("dls-license-icon-warn"))u=e,"warn"!=t&&e.remove();else if(!f&&e.classList.contains("dls-license-msg-content")){f=e;let t=s;for(;t;){let s=t.indexOf("["),r=t.indexOf("]",s),n=t.indexOf("(",r),i=t.indexOf(")",n);if(-1==s||-1==r||-1==n||-1==i){e.appendChild(new Text(t));break}s>0&&e.appendChild(new Text(t.substring(0,s)));let o=document.createElement("a"),a=t.substring(s+1,r);o.innerText=a;let c=t.substring(n+1,i);o.setAttribute("href",c),o.setAttribute("target","_blank"),e.appendChild(o),t=t.substring(i+1)}}document.body.appendChild(a)}catch(t){e._onLog&&e._onLog(t.message||t)}})({_bNeverShowDialog:D._bNeverShowDialog,engineResourcePath:e.license,_onLog:i},t.success?"warn":"error",t.message)}t.success?h.resolve(void 0):h.reject(s)},await c("core"),l.postMessage({type:"license_dynamsoft",body:{v:"3.4.31",brtk:!!e,bptk:1===e,l:t,os:R,fn:D.deviceFriendlyName,ls:s,sp:d,rmk:u,cv:f},id:g}),D.bCallInitLicense=!0,await h})));let A;e.license={},e.license.dynamsoft=W,e.license.getAR=async()=>{{let e=d.dynamsoft_inited;e&&e.isRejected&&await e}return l?new Promise(((e,t)=>{let s=r();n[s]=async s=>{if(s.success){delete s.success;{let e=D.license;e&&(e.startsWith("t")||e.startsWith("f"))&&(s.pk=e)}if(Object.keys(s).length){if(s.lem){let e=Error(s.lem);e.ltsErrorCode=s.lec,delete s.lem,delete s.lec,s.ae=e}e(s)}else e(null)}else{let e=Error(s.message);s.stack&&(e.stack=s.stack),t(e)}},l.postMessage({type:"license_getAR",id:s})})):null};class D{static setLicenseServer(e){O(D,e)}static get license(){return this._license}static set license(e){E(D,e)}static get licenseServer(){return this._licenseServer}static set licenseServer(e){O(D,e)}static get deviceFriendlyName(){return this._deviceFriendlyName}static set deviceFriendlyName(e){x(D,e)}static initLicense(e,t){if(E(D,e),D.bCallInitLicense=!0,"boolean"==typeof t&&t||"object"==typeof t&&t.executeNow)return W()}static setDeviceFriendlyName(e){x(D,e)}static getDeviceFriendlyName(){return D._deviceFriendlyName}static getDeviceUUID(){return(async()=>(await s("dynamsoft_uuid",(async()=>{await t();let e=new S,s=r();n[s]=t=>{if(t.success)e.resolve(t.uuid);else{const s=Error(t.message);t.stack&&(s.stack=t.stack),e.reject(s)}},l.postMessage({type:"license_getDeviceUUID",id:s}),A=await e})),A))()}}D._pLoad=new S,D.bPassValidation=!1,D.bCallInitLicense=!1,D._license=k,D._licenseServer=[],D._deviceFriendlyName="",o.engineResourcePaths.license={version:"3.4.31",path:y,isInternal:!0},u.license={wasm:!0,js:!0},e.license.LicenseManager=D;const M="1.4.21";"string"!=typeof o.engineResourcePaths.std&&f(o.engineResourcePaths.std.version,M)<0&&(o.engineResourcePaths.std={version:M,path:v(y+`../../dynamsoft-capture-vision-std@${M}/dist/`),isInternal:!0});class F{static getVersion(){return`3.4.31(Worker: ${h.license&&h.license.worker||"Not Loaded"}, Wasm: ${h.license&&h.license.wasm||"Not Loaded"})`}}export{D as LicenseManager,F as LicenseModule};
12 |
--------------------------------------------------------------------------------
/dist/dynamsoft-license@3.4.31/dist/license.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Dynamsoft JavaScript Library
3 | * @product Dynamsoft License JS Edition
4 | * @website https://www.dynamsoft.com
5 | * @copyright Copyright 2024, Dynamsoft Corporation
6 | * @author Dynamsoft
7 | * @version 3.4.31
8 | * @fileoverview Dynamsoft JavaScript Library for Core
9 | * More info DL JS: https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/license/license-module.html
10 | */
11 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("dynamsoft-core")):"function"==typeof define&&define.amd?define(["exports","dynamsoft-core"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).Dynamsoft=e.Dynamsoft||{},e.Dynamsoft.License={}),e.Dynamsoft.Core)}(this,(function(e,t){"use strict";const s="undefined"==typeof self,r=s?{}:self,n="function"==typeof importScripts,i=(()=>{if(!n){if(!s&&document.currentScript){let e=document.currentScript.src,t=e.indexOf("?");if(-1!=t)e=e.substring(0,t);else{let t=e.indexOf("#");-1!=t&&(e=e.substring(0,t))}return e.substring(0,e.lastIndexOf("/")+1)}return"./"}})(),o=e=>{if(null==e&&(e="./"),s||n);else{let t=document.createElement("a");t.href=e,e=t.href}return e.endsWith("/")||(e+="/"),e},a=e=>e&&"object"==typeof e&&"function"==typeof e.then,c=(async()=>{})().constructor;class l extends c{get status(){return this._s}get isPending(){return"pending"===this._s}get isFulfilled(){return"fulfilled"===this._s}get isRejected(){return"rejected"===this._s}get task(){return this._task}set task(e){let t;this._task=e,a(e)?t=e:"function"==typeof e&&(t=new c(e)),t&&(async()=>{try{const s=await t;e===this._task&&this.resolve(s)}catch(t){e===this._task&&this.reject(t)}})()}get isEmpty(){return null==this._task}constructor(e){let t,s;super(((e,r)=>{t=e,s=r})),this._s="pending",this.resolve=e=>{this.isPending&&(a(e)?this.task=e:(this._s="fulfilled",t(e)))},this.reject=e=>{this.isPending&&(this._s="rejected",s(e))},this.task=e}}const d=" is not allowed to change after `createInstance` or `loadWasm` is called.",u=!s&&document.currentScript&&(document.currentScript.getAttribute("data-license")||document.currentScript.getAttribute("data-productKeys")||document.currentScript.getAttribute("data-licenseKey")||document.currentScript.getAttribute("data-handshakeCode")||document.currentScript.getAttribute("data-organizationID"))||"",f=(e,t)=>{const s=e;if(s._license!==t){if(!s._pLoad.isEmpty)throw new Error("`license`"+d);s._license=t}};!s&&document.currentScript&&document.currentScript.getAttribute("data-sessionPassword");const h=e=>{if(null==e)e=[];else{e=e instanceof Array?[...e]:[e];for(let t=0;t{t=h(t);const s=e;if(s._licenseServer!==t){if(!s._pLoad.isEmpty)throw new Error("`licenseServer`"+d);s._licenseServer=t}},p=(e,t)=>{t=t||"";const s=e;if(s._deviceFriendlyName!==t){if(!s._pLoad.isEmpty)throw new Error("`deviceFriendlyName`"+d);s._deviceFriendlyName=t}};let m,y,w,v,k;"undefined"!=typeof navigator&&(m=navigator,y=m.userAgent,w=m.platform,v=m.mediaDevices),function(){if(!s){const e={Edge:{search:"Edg",verSearch:"Edg"},OPR:null,Chrome:null,Safari:{str:m.vendor,search:"Apple",verSearch:["Version","iPhone OS","CPU OS"]},Firefox:null,Explorer:{search:"MSIE",verSearch:"MSIE"}},t={HarmonyOS:null,Android:null,iPhone:null,iPad:null,Windows:{str:w,search:"Win"},Mac:{str:w},Linux:{str:w}};let s="unknownBrowser",r=0,n="unknownOS";for(let t in e){const n=e[t]||{};let i=n.str||y,o=n.search||t,a=n.verStr||y,c=n.verSearch||t;if(c instanceof Array||(c=[c]),-1!=i.indexOf(o)){s=t;for(let e of c){let t=a.indexOf(e);if(-1!=t){r=parseFloat(a.substring(t+e.length+1));break}}break}}for(let e in t){const s=t[e]||{};let r=s.str||y,i=s.search||e;if(-1!=r.indexOf(i)){n=e;break}}"Linux"==n&&-1!=y.indexOf("Windows NT")&&(n="HarmonyOS"),k={browser:s,version:r,OS:n}}s&&(k={browser:"ssr",version:0,OS:"ssr"})}(),v&&v.getUserMedia,"Chrome"===k.browser&&k.version>66||"Safari"===k.browser&&k.version>13||"OPR"===k.browser&&k.version>43||"Edge"===k.browser&&k.version;const b=()=>(t.loadWasm("license"),t.doOrWaitAsyncDependency("dynamsoft_inited",(async()=>{let{lt:e,l:s,ls:n,sp:i,rmk:o,cv:a}=((e,t=!1)=>{const s=e;if(s._pLoad.isEmpty){let e,n,i,o=s._license||"",a=JSON.parse(JSON.stringify(s._licenseServer)),c=s._sessionPassword,l=0;if(o.startsWith("t")||o.startsWith("f"))l=0;else if(0===o.length||o.startsWith("P")||o.startsWith("L")||o.startsWith("Y")||o.startsWith("A"))l=1;else{l=2;const t=o.indexOf(":");-1!=t&&(o=o.substring(t+1));const s=o.indexOf("?");if(-1!=s&&(n=o.substring(s+1),o=o.substring(0,s)),o.startsWith("DLC2"))l=0;else{if(o.startsWith("DLS2")){let t;try{let e=o.substring(4);e=atob(e),t=JSON.parse(e)}catch(e){throw new Error("Format Error: The license string you specified is invalid, please check to make sure it is correct.")}if(o=t.handshakeCode?t.handshakeCode:t.organizationID?t.organizationID:"","number"==typeof o&&(o=JSON.stringify(o)),0===a.length){let e=[];t.mainServerURL&&(e[0]=t.mainServerURL),t.standbyServerURL&&(e[1]=t.standbyServerURL),a=h(e)}!c&&t.sessionPassword&&(c=t.sessionPassword),e=t.remark}o&&"200001"!==o&&!o.startsWith("200001-")||(l=1)}}if(l&&(t||(r.crypto||(i="Please upgrade your browser to support online key."),r.crypto.subtle||(i="Require https to use online key in this browser."))),i)throw new Error(i);return 1===l&&(o="",console.warn("Applying for a public trial license ...")),{lt:l,l:o,ls:a,sp:c,rmk:e,cv:n}}throw new Error("Can't preprocess license again"+d)})(_),c=new l;_._pLoad.task=c,(async()=>{try{await _._pLoad}catch(e){}})();let u=t.getNextTaskID();t.mapTaskCallBack[u]=s=>{if(s.message&&_._onAuthMessage){let e=_._onAuthMessage(s.message);null!=e&&(s.message=e)}let r,n=!1;if(1===e&&(n=!0),s.success?(t.onLog&&t.onLog("init license success"),s.message&&console.warn(s.message),t.CoreModule._bSupportIRTModule=s.bSupportIRTModule,t.CoreModule._bSupportDce4Module=s.bSupportDce4Module,_.bPassValidation=!0,[0,-10076].includes(s.initLicenseInfo.errorCode)?[-10076].includes(s.initLicenseInfo.errorCode)&&console.warn(s.initLicenseInfo.errorString):c.reject(new Error(s.initLicenseInfo.errorString))):(r=Error(s.message),s.stack&&(r.stack=s.stack),s.ltsErrorCode&&(r.ltsErrorCode=s.ltsErrorCode),n||111==s.ltsErrorCode&&-1!=s.message.toLowerCase().indexOf("trial license")&&(n=!0)),n){const e=t.handleEngineResourcePaths(t.CoreModule.engineResourcePaths);(async(e,t,s)=>{if(!e._bNeverShowDialog)try{let r=await fetch(e.engineResourcePath+"dls.license.dialog.html");if(!r.ok)throw Error("Get license dialog fail. Network Error: "+r.statusText);let n=await r.text();if(!n.trim().startsWith("<"))throw Error("Get license dialog fail. Can't get valid HTMLElement.");let i=document.createElement("div");i.innerHTML=n;let o=[];for(let e=0;e{if(e==t.target){a.remove();for(let e of o)e.remove()}}));else if(!l&&e.classList.contains("dls-license-icon-close"))l=e,e.addEventListener("click",(()=>{a.remove();for(let e of o)e.remove()}));else if(!d&&e.classList.contains("dls-license-icon-error"))d=e,"error"!=t&&e.remove();else if(!u&&e.classList.contains("dls-license-icon-warn"))u=e,"warn"!=t&&e.remove();else if(!f&&e.classList.contains("dls-license-msg-content")){f=e;let t=s;for(;t;){let s=t.indexOf("["),r=t.indexOf("]",s),n=t.indexOf("(",r),i=t.indexOf(")",n);if(-1==s||-1==r||-1==n||-1==i){e.appendChild(new Text(t));break}s>0&&e.appendChild(new Text(t.substring(0,s)));let o=document.createElement("a"),a=t.substring(s+1,r);o.innerText=a;let c=t.substring(n+1,i);o.setAttribute("href",c),o.setAttribute("target","_blank"),e.appendChild(o),t=t.substring(i+1)}}document.body.appendChild(a)}catch(t){e._onLog&&e._onLog(t.message||t)}})({_bNeverShowDialog:_._bNeverShowDialog,engineResourcePath:e.license,_onLog:t.onLog},s.success?"warn":"error",s.message)}s.success?c.resolve(void 0):c.reject(r)},await t.waitAsyncDependency("core"),t.worker.postMessage({type:"license_dynamsoft",body:{v:"3.4.31",brtk:!!e,bptk:1===e,l:s,os:k,fn:_.deviceFriendlyName,ls:n,sp:i,rmk:o,cv:a},id:u}),_.bCallInitLicense=!0,await c})));let S;t.mapPackageRegister.license={},t.mapPackageRegister.license.dynamsoft=b,t.mapPackageRegister.license.getAR=async()=>{{let e=t.mapAsyncDependency.dynamsoft_inited;e&&e.isRejected&&await e}return t.worker?new Promise(((e,s)=>{let r=t.getNextTaskID();t.mapTaskCallBack[r]=async t=>{if(t.success){delete t.success;{let e=_.license;e&&(e.startsWith("t")||e.startsWith("f"))&&(t.pk=e)}if(Object.keys(t).length){if(t.lem){let e=Error(t.lem);e.ltsErrorCode=t.lec,delete t.lem,delete t.lec,t.ae=e}e(t)}else e(null)}else{let e=Error(t.message);t.stack&&(e.stack=t.stack),s(e)}},t.worker.postMessage({type:"license_getAR",id:r})})):null};class _{static setLicenseServer(e){g(_,e)}static get license(){return this._license}static set license(e){f(_,e)}static get licenseServer(){return this._licenseServer}static set licenseServer(e){g(_,e)}static get deviceFriendlyName(){return this._deviceFriendlyName}static set deviceFriendlyName(e){p(_,e)}static initLicense(e,t){if(f(_,e),_.bCallInitLicense=!0,"boolean"==typeof t&&t||"object"==typeof t&&t.executeNow)return b()}static setDeviceFriendlyName(e){p(_,e)}static getDeviceFriendlyName(){return _._deviceFriendlyName}static getDeviceUUID(){return(async()=>(await t.doOrWaitAsyncDependency("dynamsoft_uuid",(async()=>{await t.loadWasm();let e=new l,s=t.getNextTaskID();t.mapTaskCallBack[s]=t=>{if(t.success)e.resolve(t.uuid);else{const s=Error(t.message);t.stack&&(s.stack=t.stack),e.reject(s)}},t.worker.postMessage({type:"license_getDeviceUUID",id:s}),S=await e})),S))()}}_._pLoad=new l,_.bPassValidation=!1,_.bCallInitLicense=!1,_._license=u,_._licenseServer=[],_._deviceFriendlyName="",t.CoreModule.engineResourcePaths.license={version:"3.4.31",path:i,isInternal:!0},t.workerAutoResources.license={wasm:!0,js:!0},t.mapPackageRegister.license.LicenseManager=_;const L="1.4.21";"string"!=typeof t.CoreModule.engineResourcePaths.std&&t.compareVersion(t.CoreModule.engineResourcePaths.std.version,L)<0&&(t.CoreModule.engineResourcePaths.std={version:L,path:o(i+`../../dynamsoft-capture-vision-std@${L}/dist/`),isInternal:!0});e.LicenseManager=_,e.LicenseModule=class{static getVersion(){return`3.4.31(Worker: ${t.innerVersions.license&&t.innerVersions.license.worker||"Not Loaded"}, Wasm: ${t.innerVersions.license&&t.innerVersions.license.wasm||"Not Loaded"})`}}}));
12 |
--------------------------------------------------------------------------------
/dist/dynamsoft-utility@1.4.32/dist/utility.d.ts:
--------------------------------------------------------------------------------
1 | import { DSImageData, Quadrilateral, LineSegment, Contour, Corner, Edge, EnumCapturedResultItemType, OriginalImageResultItem } from 'dynamsoft-core';
2 |
3 | declare class ImageManager {
4 | /**
5 | * This method saves an image in either PNG or JPG format. The desired file format is inferred from the file extension provided in the 'name' parameter. Should the specified file format be omitted or unsupported, the data will default to being exported in PNG format.
6 | *
7 | * @param image The image to be saved, of type `DSImageData`.
8 | * @param name The name of the file, as a string, under which the image will be saved.
9 | * @param download An optional boolean flag that, when set to true, triggers the download of the file.
10 | *
11 | * @returns A promise that resolves with the saved File object.
12 | */
13 | saveToFile(image: DSImageData, name: string, download?: boolean): Promise;
14 | drawOnImage(image: Blob | string, drawingItem: Array | Quadrilateral | Array | LineSegment | Array | Contour | Array | Corner | Array | Edge, type: "quads" | "lines" | "contours" | "corners" | "edges", color?: number, thickness?: number, download?: boolean): Promise;
15 | }
16 |
17 | declare class UtilityModule {
18 | static getVersion(): string;
19 | }
20 |
21 | type resultItemTypesString = "barcode" | "text_line" | "detected_quad" | "normalized_image";
22 | interface CapturedResultFilter {
23 | onOriginalImageResultReceived?: (result: OriginalImageResultItem) => void;
24 | onDecodedBarcodesReceived?: (result: any) => void;
25 | onRecognizedTextLinesReceived?: (result: any) => void;
26 | onDetectedQuadsReceived?: (result: any) => void;
27 | onNormalizedImagesReceived?: (result: any) => void;
28 | onParsedResultsReceived?: (result: any) => void;
29 | }
30 | declare class MultiFrameResultCrossFilter implements CapturedResultFilter {
31 | #private;
32 | verificationEnabled: {
33 | [key: number]: boolean;
34 | };
35 | duplicateFilterEnabled: {
36 | [key: number]: boolean;
37 | };
38 | duplicateForgetTime: {
39 | [key: number]: number;
40 | };
41 | private latestOverlappingEnabled;
42 | private maxOverlappingFrames;
43 | private overlapSet;
44 | private stabilityCount;
45 | private crossVerificationFrames;
46 | _dynamsoft(): void;
47 | /**
48 | * Enables or disables the verification of one or multiple specific result item types.
49 | * @param resultItemTypes Specifies one or multiple specific result item types, which can be defined using EnumCapturedResultItemType or a string. If using a string, only one type can be specified, and valid values include "barcode", "text_line", "detected_quad", and "normalized_image".
50 | * @param enabled Boolean to toggle verification on or off.
51 | */
52 | enableResultCrossVerification(resultItemTypes: EnumCapturedResultItemType | resultItemTypesString, enabled: boolean): void;
53 | /**
54 | * Checks if verification is active for a given result item type.
55 | * @param resultItemType Specifies the result item type, either with EnumCapturedResultItemType or a string. When using a string, the valid values include "barcode", "text_line", "detected_quad", and "normalized_image".
56 | * @returns Boolean indicating the status of verification for the specified type.
57 | */
58 | isResultCrossVerificationEnabled(resultItemTypes: EnumCapturedResultItemType | resultItemTypesString): boolean;
59 | /**
60 | * Enables or disables the deduplication process for one or multiple specific result item types.
61 | * @param resultItemTypes Specifies one or multiple specific result item types, which can be defined using EnumCapturedResultItemType or a string. If using a string, only one type can be specified, and valid values include "barcode", "text_line", "detected_quad", and "normalized_image".
62 | * @param enabled Boolean to toggle deduplication on or off.
63 | */
64 | enableResultDeduplication(resultItemTypes: EnumCapturedResultItemType | resultItemTypesString, enabled: boolean): void;
65 | /**
66 | * Checks if deduplication is active for a given result item type.
67 | * @param resultItemType Specifies the result item type, either with EnumCapturedResultItemType or a string. When using a string, the valid values include "barcode", "text_line", "detected_quad", and "normalized_image".
68 | * @returns Boolean indicating the deduplication status for the specified type.
69 | */
70 | isResultDeduplicationEnabled(resultItemTypes: EnumCapturedResultItemType | resultItemTypesString): boolean;
71 | /**
72 | * Sets the interval during which duplicates are disregarded for specific result item types.
73 | * @param resultItemTypes Specifies one or multiple specific result item types, which can be defined using EnumCapturedResultItemType or a string. If using a string, only one type can be specified, and valid values include "barcode", "text_line", "detected_quad", and "normalized_image".
74 | * @param time Time in milliseconds during which duplicates are disregarded.
75 | */
76 | setDuplicateForgetTime(resultItemTypes: EnumCapturedResultItemType | resultItemTypesString, time: number): void;
77 | /**
78 | * Retrieves the interval during which duplicates are disregarded for a given result item type.
79 | * @param resultItemType Specifies the result item type, either with EnumCapturedResultItemType or a string. When using a string, the valid values include "barcode", "text_line", "detected_quad", and "normalized_image".
80 | * @returns The set interval for the specified item type.
81 | */
82 | getDuplicateForgetTime(resultItemTypes: EnumCapturedResultItemType | resultItemTypesString): number;
83 | /**
84 | * Set the max referencing frames count for the to-the-latest overlapping feature.
85 | *
86 | * @param resultItemTypes Specifies the result item type, either with EnumCapturedResultItemType or a string. When using a string, the valid values include "barcode", "text_line", "detected_quad", and "normalized_image".
87 | * @param maxOverlappingFrames The max referencing frames count for the to-the-latest overlapping feature.
88 | */
89 | setMaxOverlappingFrames(resultItemTypes: EnumCapturedResultItemType | resultItemTypesString, maxOverlappingFrames: number): void;
90 | /**
91 | * Get the max referencing frames count for the to-the-latest overlapping feature.
92 | * @param resultItemTypes Specifies the result item type, either with EnumCapturedResultItemType or a string. When using a string, the valid values include "barcode", "text_line", "detected_quad", and "normalized_image".
93 | * @return Returns the max referencing frames count for the to-the-latest overlapping feature.
94 | */
95 | getMaxOverlappingFrames(resultItemType: EnumCapturedResultItemType): number;
96 | /**
97 | * Enables or disables the deduplication process for one or multiple specific result item types.
98 | * @param resultItemTypes Specifies one or multiple specific result item types, which can be defined using EnumCapturedResultItemType or a string. If using a string, only one type can be specified, and valid values include "barcode", "text_line", "detected_quad", and "normalized_image".
99 | * @param enabled Boolean to toggle deduplication on or off.
100 | */
101 | enableLatestOverlapping(resultItemTypes: EnumCapturedResultItemType | resultItemTypesString, enabled: boolean): void;
102 | /**
103 | * Checks if deduplication is active for a given result item type.
104 | * @param resultItemType Specifies the result item type, either with EnumCapturedResultItemType or a string. When using a string, the valid values include "barcode", "text_line", "detected_quad", and "normalized_image".
105 | *
106 | * @returns Boolean indicating the deduplication status for the specified type.
107 | */
108 | isLatestOverlappingEnabled(resultItemType: EnumCapturedResultItemType | resultItemTypesString): boolean;
109 | getFilteredResultItemTypes(): number;
110 | onOriginalImageResultReceived(result: OriginalImageResultItem): void;
111 | latestOverlappingFilter(result: any): void;
112 | onDecodedBarcodesReceived(result: any): void;
113 | onRecognizedTextLinesReceived(result: any): void;
114 | onDetectedQuadsReceived(result: any): void;
115 | onNormalizedImagesReceived(result: any): void;
116 | }
117 |
118 | export { ImageManager, MultiFrameResultCrossFilter, UtilityModule };
119 |
--------------------------------------------------------------------------------
/dist/dynamsoft-utility@1.4.32/dist/utility.esm.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Dynamsoft JavaScript Library
3 | * @product Dynamsoft Utility JS Edition
4 | * @website https://www.dynamsoft.com
5 | * @copyright Copyright 2024, Dynamsoft Corporation
6 | * @author Dynamsoft
7 | * @version 1.4.32
8 | * @fileoverview Dynamsoft JavaScript Library for Utility
9 | * More info DU JS: https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/utility/utility-module.html
10 | */
11 | import{_getNorImageData as t,_saveToFile as e,requestResource as i,getNextTaskID as n,mapTaskCallBack as o,worker as s,CoreModule as a,workerAutoResources as r,compareVersion as l,innerVersions as c,EnumCapturedResultItemType as h}from"dynamsoft-core";const f=async t=>{let e;await new Promise(((i,n)=>{e=new Image,e.onload=()=>i(e),e.onerror=n,e.src=URL.createObjectURL(t)}));const i=document.createElement("canvas"),n=i.getContext("2d");i.width=e.width,i.height=e.height,n.drawImage(e,0,0);return{bytes:Uint8Array.from(n.getImageData(0,0,i.width,i.height).data),width:i.width,height:i.height,stride:4*i.width,format:10}};class p{async saveToFile(i,n,o){if(!i||!n)return null;if("string"!=typeof n)throw new TypeError("FileName must be of type string.");const s=t(i);return e(s,n,o)}async drawOnImage(t,e,a,r=4294901760,l=1,c){let h;if(t instanceof Blob)h=await f(t);else if("string"==typeof t){let e=await i(t,"blob");h=await f(e)}return await new Promise(((t,i)=>{let f=n();o[f]=async e=>{if(e.success)return c&&this.saveToFile(e.image,"test.png",c),t(e.image);{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}},s.postMessage({type:"utility_drawOnImage",id:f,body:{dsImage:h,drawingItem:e instanceof Array?e:[e],color:r,thickness:l,type:a}})}))}}const u="undefined"==typeof self,g="function"==typeof importScripts,d=(()=>{if(!g){if(!u&&document.currentScript){let t=document.currentScript.src,e=t.indexOf("?");if(-1!=e)t=t.substring(0,e);else{let e=t.indexOf("#");-1!=e&&(t=t.substring(0,e))}return t.substring(0,t.lastIndexOf("/")+1)}return"./"}})(),y=t=>{if(null==t&&(t="./"),u||g);else{let e=document.createElement("a");e.href=t,t=e.href}return t.endsWith("/")||(t+="/"),t};a.engineResourcePaths.utility={version:"1.4.32",path:d,isInternal:!0},r.utility={js:!0,wasm:!0};const m="1.4.21";"string"!=typeof a.engineResourcePaths.std&&l(a.engineResourcePaths.std.version,m)<0&&(a.engineResourcePaths.std={version:m,path:y(d+`../../dynamsoft-capture-vision-std@${m}/dist/`),isInternal:!0});const v="2.4.31";(!a.engineResourcePaths.dip||"string"!=typeof a.engineResourcePaths.dip&&l(a.engineResourcePaths.dip.version,v)<0)&&(a.engineResourcePaths.dip={version:v,path:y(d+`../../dynamsoft-image-processing@${v}/dist/`),isInternal:!0});class x{static getVersion(){return`1.4.32(Worker: ${c.utility&&c.utility.worker||"Not Loaded"}, Wasm: ${c.utility&&c.utility.wasm||"Not Loaded"})`}}function I(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)}var E,b,R,T,_;function C(t,e){let i=!0;for(let a=0;a1)return Math.sqrt((l-a)**2+(c-r)**2);{const t=o+f*(a-o),e=s+f*(r-s);return Math.sqrt((l-t)**2+(c-e)**2)}}function M(t){const e=[];for(let i=0;i{C(e,t)&&i.push(t)})),e.forEach((e=>{C(t,e)&&i.push(e)}));return w(function(t){if(t.length<=1)return t;t.sort(((t,e)=>t.x-e.x||t.y-e.y));const e=t.shift();return t.sort(((t,i)=>Math.atan2(t.y-e.y,t.x-e.x)-Math.atan2(i.y-e.y,i.x-e.x))),[e,...t]}(i))}function S(t,e,i,n){const o=e.x-t.x,s=e.y-t.y,a=n.x-i.x,r=n.y-i.y,l=(-s*(t.x-i.x)+o*(t.y-i.y))/(-a*s+o*r),c=(a*(t.y-i.y)-r*(t.x-i.x))/(-a*s+o*r);return l>=0&&l<=1&&c>=0&&c<=1?{x:t.x+c*o,y:t.y+c*s}:null}function w(t){let e=0;for(let i=0;i0}function L(t,e){for(let i=0;i<4;i++)if(!F(t.points[i],t.points[(i+1)%4],e))return!1;return!0}"function"==typeof SuppressedError&&SuppressedError;const N=3,k=1,P=1,W=2,G=3,j=5,V=15,U=5;function Q(t,e,i,n){const o=t.points,s=e.points;let a=8*i;a=Math.max(a,5);const r=M(o)[3],l=M(o)[1],c=M(s)[3],h=M(s)[1];let f,p=0;if(f=Math.max(Math.abs(B(r,e.points[0])),Math.abs(B(r,e.points[3]))),f>p&&(p=f),f=Math.max(Math.abs(B(l,e.points[1])),Math.abs(B(l,e.points[2]))),f>p&&(p=f),f=Math.max(Math.abs(B(c,t.points[0])),Math.abs(B(c,t.points[3]))),f>p&&(p=f),f=Math.max(Math.abs(B(h,t.points[1])),Math.abs(B(h,t.points[2]))),f>p&&(p=f),p>a)return!1;const u=A(M(o)[0]),g=A(M(o)[2]),d=A(M(s)[0]),y=A(M(s)[2]),m=O(u,y),v=O(d,g),x=m>v,I=Math.min(m,v),E=O(u,g),b=O(d,y);let R=12*i;R=Math.max(R,5),R=Math.min(R,E),R=Math.min(R,b);return!!(I{e.x+=t,e.y+=i})),e.x/=t.length,e.y/=t.length,e}isProbablySameLocationWithOffset(t,e){const i=this.item.location,n=t.location;if(i.area<=0)return!1;if(Math.abs(i.area-n.area)>.4*i.area)return!1;let o=new Array(4).fill(0),s=new Array(4).fill(0),a=0,r=0;for(let t=0;t<4;++t)o[t]=Math.round(100*(n.points[t].x-i.points[t].x))/100,a+=o[t],s[t]=Math.round(100*(n.points[t].y-i.points[t].y))/100,r+=s[t];a/=4,r/=4;for(let t=0;t<4;++t){if(Math.abs(o[t]-a)>this.strictLimit||Math.abs(a)>.8)return!1;if(Math.abs(s[t]-r)>this.strictLimit||Math.abs(r)>.8)return!1}return e.x=a,e.y=r,!0}isLocationOverlap(t,e){if(this.locationArea>e){for(let e=0;e<4;e++)if(L(this.location,t.points[e]))return!0;const e=this.getCenterPoint(t.points);if(L(this.location,e))return!0}else{for(let e=0;e<4;e++)if(L(t,this.location.points[e]))return!0;if(L(t,this.getCenterPoint(this.location.points)))return!0}return!1}isMatchedLocationWithOffset(t,e={x:0,y:0}){if(this.isOneD){const i=Object.assign({},t.location);for(let t=0;t<4;t++)i.points[t].x-=e.x,i.points[t].y-=e.y;if(!this.isLocationOverlap(i,t.locationArea))return!1;const n=[this.location.points[0],this.location.points[3]],o=[this.location.points[1],this.location.points[2]];for(let t=0;t<4;t++){const e=i.points[t],s=0===t||3===t?n:o;if(Math.abs(B(s,e))>this.locationThreshold)return!1}}else for(let i=0;i<4;i++){const n=t.location.points[i],o=this.location.points[i];if(!(Math.abs(o.x+e.x-n.x)=this.locationThreshold)return!1}return!0}isOverlappedLocationWithOffset(t,e,i=!0){const n=Object.assign({},t.location);for(let t=0;t<4;t++)n.points[t].x-=e.x,n.points[t].y-=e.y;if(!this.isLocationOverlap(n,t.location.area))return!1;if(i){const t=.75;return D([...this.location.points],n.points)>this.locationArea*t}return!0}}const Z={BF_ONED:BigInt(3147775),BF_GS1_DATABAR:BigInt(260096)},q={barcode:2,text_line:4,detected_quad:8,normalized_image:16},z=t=>Object.values(q).includes(t)||q.hasOwnProperty(t),$=(t,e)=>"string"==typeof t?e[q[t]]:e[t],H=(t,e,i)=>{"string"==typeof t?e[q[t]]=i:e[t]=i},J=(t,e,i)=>{const n=[8,16].includes(i);if(!n&&t.isResultCrossVerificationEnabled(i))for(let t=0;t{H(e,this.verificationEnabled,t)})),I(this,b,"f").forEach(((t,e)=>{H(e,this.duplicateFilterEnabled,t)})),I(this,R,"f").forEach(((t,e)=>{H(e,this.duplicateForgetTime,t)})),I(this,T,"f").forEach(((t,e)=>{H(e,this.latestOverlappingEnabled,t)})),I(this,_,"f").forEach(((t,e)=>{H(e,this.maxOverlappingFrames,t)}))}enableResultCrossVerification(t,e){z(t)&&I(this,E,"f").set(t,e)}isResultCrossVerificationEnabled(t){return!!z(t)&&$(t,this.verificationEnabled)}enableResultDeduplication(t,e){z(t)&&(e&&this.enableLatestOverlapping(t,!1),I(this,b,"f").set(t,e))}isResultDeduplicationEnabled(t){return!!z(t)&&$(t,this.duplicateFilterEnabled)}setDuplicateForgetTime(t,e){z(t)&&(e>18e4&&(e=18e4),e<0&&(e=0),I(this,R,"f").set(t,e))}getDuplicateForgetTime(t){return z(t)?$(t,this.duplicateForgetTime):-1}setMaxOverlappingFrames(t,e){z(t)&&I(this,_,"f").set(t,e)}getMaxOverlappingFrames(t){return z(t)?$(t,this.maxOverlappingFrames):-1}enableLatestOverlapping(t,e){z(t)&&(e&&this.enableResultDeduplication(t,!1),I(this,T,"f").set(t,e))}isLatestOverlappingEnabled(t){return!!z(t)&&$(t,this.latestOverlappingEnabled)}getFilteredResultItemTypes(){let t=0;const e=[h.CRIT_BARCODE,h.CRIT_TEXT_LINE,h.CRIT_DETECTED_QUAD,h.CRIT_NORMALIZED_IMAGE];for(let i=0;i{if(1!==t.type){const e=(BigInt(t.format)&BigInt(Z.BF_ONED))!=BigInt(0)||(BigInt(t.format)&BigInt(Z.BF_GS1_DATABAR))!=BigInt(0);return new X(l,e?1:2,e,t)}})).filter(Boolean);if(this.overlapSet.length>0){const t=new Array(c).fill(new Array(this.overlapSet.length).fill(1));let e=0;for(;e-1!==t)).length;o>m&&(m=o,y=n,d.x=i.x,d.y=i.y)}}if(0===m){for(let e=0;e-1!=t)).length}let i=this.overlapSet.length<=N?m>=k:m>=W;if(!i&&s&&p>0){let t=0;for(let e=0;e=P:t>=G}i||(this.overlapSet=[])}if(0===this.overlapSet.length)this.stabilityCount=0,t.items.forEach(((t,e)=>{if(1!==t.type){const i=Object.assign({},t),n=(BigInt(t.format)&BigInt(Z.BF_ONED))!=BigInt(0)||(BigInt(t.format)&BigInt(Z.BF_GS1_DATABAR))!=BigInt(0),s=t.confidenceU||Math.abs(d.y)>U)&&(e=!1):e=!1;for(let i=0;i0){for(let t=0;t!(t.overlapCount+this.stabilityCount<=0&&t.crossVerificationFrame<=0)))}g.sort(((t,e)=>e-t)).forEach(((e,i)=>{t.items.splice(e,1)})),u.forEach((e=>{t.items.push(Object.assign(Object.assign({},e),{overlapped:!0}))}))}}onDecodedBarcodesReceived(t){this.latestOverlappingFilter(t),J(this,t.items,h.CRIT_BARCODE)}onRecognizedTextLinesReceived(t){J(this,t.items,h.CRIT_TEXT_LINE)}onDetectedQuadsReceived(t){J(this,t.items,h.CRIT_DETECTED_QUAD)}onNormalizedImagesReceived(t){J(this,t.items,h.CRIT_NORMALIZED_IMAGE)}}E=new WeakMap,b=new WeakMap,R=new WeakMap,T=new WeakMap,_=new WeakMap;export{p as ImageManager,K as MultiFrameResultCrossFilter,x as UtilityModule};
12 |
--------------------------------------------------------------------------------
/dist/dynamsoft-utility@1.4.32/dist/utility.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Dynamsoft JavaScript Library
3 | * @product Dynamsoft Utility JS Edition
4 | * @website https://www.dynamsoft.com
5 | * @copyright Copyright 2024, Dynamsoft Corporation
6 | * @author Dynamsoft
7 | * @version 1.4.32
8 | * @fileoverview Dynamsoft JavaScript Library for Utility
9 | * More info DU JS: https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/utility/utility-module.html
10 | */
11 | !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("dynamsoft-core")):"function"==typeof define&&define.amd?define(["exports","dynamsoft-core"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).Dynamsoft=t.Dynamsoft||{},t.Dynamsoft.Utility={}),t.Dynamsoft.Core)}(this,(function(t,e){"use strict";const i=async t=>{let e;await new Promise(((i,n)=>{e=new Image,e.onload=()=>i(e),e.onerror=n,e.src=URL.createObjectURL(t)}));const i=document.createElement("canvas"),n=i.getContext("2d");i.width=e.width,i.height=e.height,n.drawImage(e,0,0);return{bytes:Uint8Array.from(n.getImageData(0,0,i.width,i.height).data),width:i.width,height:i.height,stride:4*i.width,format:10}};const n="undefined"==typeof self,s="function"==typeof importScripts,o=(()=>{if(!s){if(!n&&document.currentScript){let t=document.currentScript.src,e=t.indexOf("?");if(-1!=e)t=t.substring(0,e);else{let e=t.indexOf("#");-1!=e&&(t=t.substring(0,e))}return t.substring(0,t.lastIndexOf("/")+1)}return"./"}})(),a=t=>{if(null==t&&(t="./"),n||s);else{let e=document.createElement("a");e.href=t,t=e.href}return t.endsWith("/")||(t+="/"),t};e.CoreModule.engineResourcePaths.utility={version:"1.4.32",path:o,isInternal:!0},e.workerAutoResources.utility={js:!0,wasm:!0};const r="1.4.21";"string"!=typeof e.CoreModule.engineResourcePaths.std&&e.compareVersion(e.CoreModule.engineResourcePaths.std.version,r)<0&&(e.CoreModule.engineResourcePaths.std={version:r,path:a(o+`../../dynamsoft-capture-vision-std@${r}/dist/`),isInternal:!0});const l="2.4.31";(!e.CoreModule.engineResourcePaths.dip||"string"!=typeof e.CoreModule.engineResourcePaths.dip&&e.compareVersion(e.CoreModule.engineResourcePaths.dip.version,l)<0)&&(e.CoreModule.engineResourcePaths.dip={version:l,path:a(o+`../../dynamsoft-image-processing@${l}/dist/`),isInternal:!0});function c(t,e,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(t):n?n.value:e.get(t)}var u,p,h,f,m;function d(t,e){let i=!0;for(let a=0;a1)return Math.sqrt((l-a)**2+(c-r)**2);{const t=s+p*(a-s),e=o+p*(r-o);return Math.sqrt((l-t)**2+(c-e)**2)}}function I(t){const e=[];for(let i=0;i{d(e,t)&&i.push(t)})),e.forEach((e=>{d(t,e)&&i.push(e)}));return R(function(t){if(t.length<=1)return t;t.sort(((t,e)=>t.x-e.x||t.y-e.y));const e=t.shift();return t.sort(((t,i)=>Math.atan2(t.y-e.y,t.x-e.x)-Math.atan2(i.y-e.y,i.x-e.x))),[e,...t]}(i))}function T(t,e,i,n){const s=e.x-t.x,o=e.y-t.y,a=n.x-i.x,r=n.y-i.y,l=(-o*(t.x-i.x)+s*(t.y-i.y))/(-a*o+s*r),c=(a*(t.y-i.y)-r*(t.x-i.x))/(-a*o+s*r);return l>=0&&l<=1&&c>=0&&c<=1?{x:t.x+c*s,y:t.y+c*o}:null}function R(t){let e=0;for(let i=0;i0}function v(t,e){for(let i=0;i<4;i++)if(!x(t.points[i],t.points[(i+1)%4],e))return!1;return!0}"function"==typeof SuppressedError&&SuppressedError;const b=3,M=1,_=1,O=2,B=3,D=5,A=15,w=5;function S(t,e,i,n){const s=t.points,o=e.points;let a=8*i;a=Math.max(a,5);const r=I(s)[3],l=I(s)[1],c=I(o)[3],u=I(o)[1];let p,h=0;if(p=Math.max(Math.abs(g(r,e.points[0])),Math.abs(g(r,e.points[3]))),p>h&&(h=p),p=Math.max(Math.abs(g(l,e.points[1])),Math.abs(g(l,e.points[2]))),p>h&&(h=p),p=Math.max(Math.abs(g(c,t.points[0])),Math.abs(g(c,t.points[3]))),p>h&&(h=p),p=Math.max(Math.abs(g(u,t.points[1])),Math.abs(g(u,t.points[2]))),p>h&&(h=p),h>a)return!1;const f=E(I(s)[0]),m=E(I(s)[2]),C=E(I(o)[0]),T=E(I(o)[2]),x=y(f,T),v=y(C,m),b=x>v,M=Math.min(x,v),_=y(f,m),O=y(C,T);let B=12*i;B=Math.max(B,5),B=Math.min(B,_),B=Math.min(B,O);return!!(M{e.x+=t,e.y+=i})),e.x/=t.length,e.y/=t.length,e}isProbablySameLocationWithOffset(t,e){const i=this.item.location,n=t.location;if(i.area<=0)return!1;if(Math.abs(i.area-n.area)>.4*i.area)return!1;let s=new Array(4).fill(0),o=new Array(4).fill(0),a=0,r=0;for(let t=0;t<4;++t)s[t]=Math.round(100*(n.points[t].x-i.points[t].x))/100,a+=s[t],o[t]=Math.round(100*(n.points[t].y-i.points[t].y))/100,r+=o[t];a/=4,r/=4;for(let t=0;t<4;++t){if(Math.abs(s[t]-a)>this.strictLimit||Math.abs(a)>.8)return!1;if(Math.abs(o[t]-r)>this.strictLimit||Math.abs(r)>.8)return!1}return e.x=a,e.y=r,!0}isLocationOverlap(t,e){if(this.locationArea>e){for(let e=0;e<4;e++)if(v(this.location,t.points[e]))return!0;const e=this.getCenterPoint(t.points);if(v(this.location,e))return!0}else{for(let e=0;e<4;e++)if(v(t,this.location.points[e]))return!0;if(v(t,this.getCenterPoint(this.location.points)))return!0}return!1}isMatchedLocationWithOffset(t,e={x:0,y:0}){if(this.isOneD){const i=Object.assign({},t.location);for(let t=0;t<4;t++)i.points[t].x-=e.x,i.points[t].y-=e.y;if(!this.isLocationOverlap(i,t.locationArea))return!1;const n=[this.location.points[0],this.location.points[3]],s=[this.location.points[1],this.location.points[2]];for(let t=0;t<4;t++){const e=i.points[t],o=0===t||3===t?n:s;if(Math.abs(g(o,e))>this.locationThreshold)return!1}}else for(let i=0;i<4;i++){const n=t.location.points[i],s=this.location.points[i];if(!(Math.abs(s.x+e.x-n.x)=this.locationThreshold)return!1}return!0}isOverlappedLocationWithOffset(t,e,i=!0){const n=Object.assign({},t.location);for(let t=0;t<4;t++)n.points[t].x-=e.x,n.points[t].y-=e.y;if(!this.isLocationOverlap(n,t.location.area))return!1;if(i){const t=.75;return C([...this.location.points],n.points)>this.locationArea*t}return!0}}const L={BF_ONED:BigInt(3147775),BF_GS1_DATABAR:BigInt(260096)},k={barcode:2,text_line:4,detected_quad:8,normalized_image:16},N=t=>Object.values(k).includes(t)||k.hasOwnProperty(t),V=(t,e)=>"string"==typeof t?e[k[t]]:e[t],P=(t,e,i)=>{"string"==typeof t?e[k[t]]=i:e[t]=i},W=(t,e,i)=>{const n=[8,16].includes(i);if(!n&&t.isResultCrossVerificationEnabled(i))for(let t=0;t{let c=e.getNextTaskID();e.mapTaskCallBack[c]=async e=>{if(e.success)return r&&this.saveToFile(e.image,"test.png",r),t(e.image);{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}},e.worker.postMessage({type:"utility_drawOnImage",id:c,body:{dsImage:l,drawingItem:n instanceof Array?n:[n],color:o,thickness:a,type:s}})}))}},t.MultiFrameResultCrossFilter=class{constructor(){this.verificationEnabled={[e.EnumCapturedResultItemType.CRIT_BARCODE]:!1,[e.EnumCapturedResultItemType.CRIT_TEXT_LINE]:!0,[e.EnumCapturedResultItemType.CRIT_DETECTED_QUAD]:!0,[e.EnumCapturedResultItemType.CRIT_NORMALIZED_IMAGE]:!1},this.duplicateFilterEnabled={[e.EnumCapturedResultItemType.CRIT_BARCODE]:!1,[e.EnumCapturedResultItemType.CRIT_TEXT_LINE]:!1,[e.EnumCapturedResultItemType.CRIT_DETECTED_QUAD]:!1,[e.EnumCapturedResultItemType.CRIT_NORMALIZED_IMAGE]:!1},this.duplicateForgetTime={[e.EnumCapturedResultItemType.CRIT_BARCODE]:3e3,[e.EnumCapturedResultItemType.CRIT_TEXT_LINE]:3e3,[e.EnumCapturedResultItemType.CRIT_DETECTED_QUAD]:3e3,[e.EnumCapturedResultItemType.CRIT_NORMALIZED_IMAGE]:3e3},this.latestOverlappingEnabled={[e.EnumCapturedResultItemType.CRIT_BARCODE]:!1,[e.EnumCapturedResultItemType.CRIT_TEXT_LINE]:!1,[e.EnumCapturedResultItemType.CRIT_DETECTED_QUAD]:!1,[e.EnumCapturedResultItemType.CRIT_NORMALIZED_IMAGE]:!1},this.maxOverlappingFrames={[e.EnumCapturedResultItemType.CRIT_BARCODE]:5,[e.EnumCapturedResultItemType.CRIT_TEXT_LINE]:5,[e.EnumCapturedResultItemType.CRIT_DETECTED_QUAD]:5,[e.EnumCapturedResultItemType.CRIT_NORMALIZED_IMAGE]:5},this.overlapSet=[],this.stabilityCount=0,this.crossVerificationFrames=5,u.set(this,new Map),p.set(this,new Map),h.set(this,new Map),f.set(this,new Map),m.set(this,new Map)}_dynamsoft(){c(this,u,"f").forEach(((t,e)=>{P(e,this.verificationEnabled,t)})),c(this,p,"f").forEach(((t,e)=>{P(e,this.duplicateFilterEnabled,t)})),c(this,h,"f").forEach(((t,e)=>{P(e,this.duplicateForgetTime,t)})),c(this,f,"f").forEach(((t,e)=>{P(e,this.latestOverlappingEnabled,t)})),c(this,m,"f").forEach(((t,e)=>{P(e,this.maxOverlappingFrames,t)}))}enableResultCrossVerification(t,e){N(t)&&c(this,u,"f").set(t,e)}isResultCrossVerificationEnabled(t){return!!N(t)&&V(t,this.verificationEnabled)}enableResultDeduplication(t,e){N(t)&&(e&&this.enableLatestOverlapping(t,!1),c(this,p,"f").set(t,e))}isResultDeduplicationEnabled(t){return!!N(t)&&V(t,this.duplicateFilterEnabled)}setDuplicateForgetTime(t,e){N(t)&&(e>18e4&&(e=18e4),e<0&&(e=0),c(this,h,"f").set(t,e))}getDuplicateForgetTime(t){return N(t)?V(t,this.duplicateForgetTime):-1}setMaxOverlappingFrames(t,e){N(t)&&c(this,m,"f").set(t,e)}getMaxOverlappingFrames(t){return N(t)?V(t,this.maxOverlappingFrames):-1}enableLatestOverlapping(t,e){N(t)&&(e&&this.enableResultDeduplication(t,!1),c(this,f,"f").set(t,e))}isLatestOverlappingEnabled(t){return!!N(t)&&V(t,this.latestOverlappingEnabled)}getFilteredResultItemTypes(){let t=0;const i=[e.EnumCapturedResultItemType.CRIT_BARCODE,e.EnumCapturedResultItemType.CRIT_TEXT_LINE,e.EnumCapturedResultItemType.CRIT_DETECTED_QUAD,e.EnumCapturedResultItemType.CRIT_NORMALIZED_IMAGE];for(let e=0;e{if(1!==t.type){const e=(BigInt(t.format)&BigInt(L.BF_ONED))!=BigInt(0)||(BigInt(t.format)&BigInt(L.BF_GS1_DATABAR))!=BigInt(0);return new F(c,e?1:2,e,t)}})).filter(Boolean);if(this.overlapSet.length>0){const t=new Array(u).fill(new Array(this.overlapSet.length).fill(1));let e=0;for(;e-1!==t)).length;s>g&&(g=s,y=n,d.x=i.x,d.y=i.y)}}if(0===g){for(let e=0;e-1!=t)).length}let i=this.overlapSet.length<=b?g>=M:g>=O;if(!i&&a&&h>0){let t=0;for(let e=0;e=_:t>=B}i||(this.overlapSet=[])}if(0===this.overlapSet.length)this.stabilityCount=0,t.items.forEach(((t,e)=>{if(1!==t.type){const i=Object.assign({},t),n=(BigInt(t.format)&BigInt(L.BF_ONED))!=BigInt(0)||(BigInt(t.format)&BigInt(L.BF_GS1_DATABAR))!=BigInt(0),s=t.confidencew||Math.abs(d.y)>w)&&(e=!1):e=!1;for(let i=0;i0){for(let t=0;t!(t.overlapCount+this.stabilityCount<=0&&t.crossVerificationFrame<=0)))}m.sort(((t,e)=>e-t)).forEach(((e,i)=>{t.items.splice(e,1)})),f.forEach((e=>{t.items.push(Object.assign(Object.assign({},e),{overlapped:!0}))}))}}onDecodedBarcodesReceived(t){this.latestOverlappingFilter(t),W(this,t.items,e.EnumCapturedResultItemType.CRIT_BARCODE)}onRecognizedTextLinesReceived(t){W(this,t.items,e.EnumCapturedResultItemType.CRIT_TEXT_LINE)}onDetectedQuadsReceived(t){W(this,t.items,e.EnumCapturedResultItemType.CRIT_DETECTED_QUAD)}onNormalizedImagesReceived(t){W(this,t.items,e.EnumCapturedResultItemType.CRIT_NORMALIZED_IMAGE)}},t.UtilityModule=class{static getVersion(){return`1.4.32(Worker: ${e.innerVersions.utility&&e.innerVersions.utility.worker||"Not Loaded"}, Wasm: ${e.innerVersions.utility&&e.innerVersions.utility.wasm||"Not Loaded"})`}}}));
12 |
--------------------------------------------------------------------------------
/dist/dynamsoft-utility@1.4.32/dist/utility.worker.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Dynamsoft JavaScript Library
3 | * @product Dynamsoft Utility JS Edition
4 | * @website https://www.dynamsoft.com
5 | * @copyright Copyright 2024, Dynamsoft Corporation
6 | * @author Dynamsoft
7 | * @version 1.4.32
8 | * @fileoverview Dynamsoft JavaScript Library for Utility
9 | * More info DU JS: https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/utility/utility-module.html
10 | */
11 | !function(){"use strict";self.utilityWorkerVersion="1.4.32",Object.assign(mapController,{utility_drawOnImage:async(e,t)=>{let s;try{let a=wasmImports.emscripten_bind_Create_CImageData(e.dsImage.bytes.length,setBufferIntoWasm(e.dsImage.bytes,0),e.dsImage.width,e.dsImage.height,e.dsImage.stride,e.dsImage.format,0);const r=e.type.charAt(0).toUpperCase()+e.type.slice(1);ep(),s=JSON.parse(UTF8ToString(wasmImports[`emscripten_bind_UtilityWasm_DrawOnImage${r}_5`](a,es(JSON.stringify(e.drawingItem)),e.drawingItem.length,e.color,e.thickness)));let n=s.bytes;n&&(n=new Uint8Array(new Uint8Array(HEAP8.buffer,n.ptr,n.length)),s.bytes=n),wasmImports.emscripten_bind_Destory_CImageData(a),handleTaskRes(t,{success:!0,image:s})}catch(e){return console.log(e),void handleTaskErr(t,e)}}})}();
12 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "dynamsoft-barcode-reader-bundle",
3 | "version": "10.5.3000",
4 | "description": "Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR Code, DaraMatrix, PDF417, and Aztec Code.",
5 | "main": "dist/dbr.bundle.js",
6 | "module": "dist/dbr.no-content-bundle.esm.js",
7 | "exports": {
8 | "import": {
9 | "types": "./dist/dbr.bundle.esm.d.ts",
10 | "default": "./dist/dbr.no-content-bundle.esm.js"
11 | },
12 | "require": {
13 | "types": "./dist/dbr.bundle.d.ts",
14 | "default": "./dist/dbr.bundle.js"
15 | }
16 | },
17 | "sideEffects": true,
18 | "types": "dist/dbr.bundle.esm.d.ts",
19 | "type": "module",
20 | "files": [
21 | "/dist",
22 | "LEGAL.txt",
23 | "LICENSE",
24 | "samples.url",
25 | "API_Reference_BarcodeScanner.url",
26 | "API_Reference_Foundational.url"
27 | ],
28 | "scripts": {
29 | "build": "rollup -c --environment BUILD:production",
30 | "build-dev": "rollup -c --environment BUILD:development",
31 | "test": "echo \"Error: no test specified\" && exit 1",
32 | "update:readme": "updateReadme --package=dynamsoft-barcode-reader-bundle --version=latest --branch=preview --html --rtu",
33 | "updateLink:npm": "updateLink --source=npm",
34 | "updateLink:zip": "updateLink --source=zip",
35 | "updateLink:github": "updateLink --source=github",
36 | "update:prod": "updatePackage --package=dynamsoft-barcode-reader-bundle --version=auto --env=production --tag=latest",
37 | "update:beta": "updatePackage --package=dynamsoft-barcode-reader-bundle --version=auto --env=beta --tag=beta",
38 | "update:iv": "updatePackage --package=dynamsoft-barcode-reader-bundle --version=auto --env=internalVersion --tag=iv",
39 | "update:dev": "updatePackage --package=dynamsoft-barcode-reader-bundle --version=auto --env=development --tag=latest",
40 | "makeZip": "makeZip --package=dynamsoft-barcode-reader-bundle --version=auto --sampleBranch=_dev --structure=new --otherPkgs=dynamsoft-capture-vision-std dynamsoft-image-processing dynamsoft-core dynamsoft-license dynamsoft-capture-vision-router dynamsoft-utility dynamsoft-camera-enhancer dynamsoft-barcode-reader",
41 | "easyPublish": "npm run update:dev && npm run build && npm publish"
42 | },
43 | "keywords": [
44 | "HTML5 barcode",
45 | "JavaScript barcode",
46 | "Web barcode",
47 | "barcode",
48 | "PDF417",
49 | "QRCode",
50 | "Aztec Code",
51 | "WebAssembly",
52 | "SDK",
53 | "Linear barcode",
54 | "1D barcode"
55 | ],
56 | "author": {
57 | "name": "Dynamsoft",
58 | "url": "https://www.dynamsoft.com",
59 | "email": "support@dynamsoft.com"
60 | },
61 | "license": "SEE LICENSE IN LICENSE",
62 | "repository": {
63 | "type": "git",
64 | "url": "https://github.com/dynamsoft/barcode-reader-javascript.git"
65 | },
66 | "publishConfig": {
67 | "registry": "https://registry.npmjs.org/",
68 | "tag": "latest"
69 | },
70 | "devDependencies": {
71 | "@dynamsoft/rd2-scripts": "^0.1.38",
72 | "@rollup/plugin-node-resolve": "^15.2.3",
73 | "@rollup/plugin-replace": "^5.0.5",
74 | "@rollup/plugin-terser": "^0.4.4",
75 | "@rollup/plugin-typescript": "^11.1.6",
76 | "@scannerproxy/curscript-path": "^2.0.6",
77 | "mutable-promise": "^1.1.15",
78 | "rollup": "^3.29.3",
79 | "rollup-plugin-dts": "^6.1.0",
80 | "tslib": "^2.6.2",
81 | "typescript": "^4.9.5"
82 | },
83 | "dependencies": {
84 | "dynamsoft-barcode-reader": "10.4.31",
85 | "dynamsoft-camera-enhancer": "4.1.1",
86 | "dynamsoft-capture-vision-router": "2.4.33",
87 | "dynamsoft-core": "3.4.31",
88 | "dynamsoft-license": "3.4.31",
89 | "dynamsoft-utility": "1.4.32"
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/samples.url:
--------------------------------------------------------------------------------
1 | [InternetShortcut]
2 | URL=https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/v10.5.30
--------------------------------------------------------------------------------