@mescius/wijmo.barcode.composite 5.20232.939 → 5.20241.2-rc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [English](#wijmo) | [日本語](#wijmo-jp) | [中文](#wijmo-cn) | [한국어](#wijmo-kr)
1
+ [English](#wijmo) | [日本語](#wijmo-jp) | [한국어](#wijmo-kr)
2
2
 
3
3
  # Wijmo
4
4
 
@@ -59,19 +59,19 @@ Sample source code available with our [Wijmo Developer Pack](https://developer.m
59
59
  ### To install latest release version:
60
60
 
61
61
  ```sh
62
- npm install @grapecity/wijmo.all
62
+ npm install @mescius/wijmo.all
63
63
  ```
64
64
 
65
65
  ### To install latest nightly build:
66
66
 
67
67
  ```sh
68
- npm install @grapecity/wijmo.all@nightly
68
+ npm install @mescius/wijmo.all@nightly
69
69
  ```
70
70
 
71
71
  ### To install latest RC build:
72
72
 
73
73
  ```sh
74
- npm install @grapecity/wijmo.all@rc
74
+ npm install @mescius/wijmo.all@rc
75
75
  ```
76
76
 
77
77
  ## Documentation
@@ -159,99 +159,6 @@ Submit questions to our team of [Wijmo Experts](https://developer.mescius.com/fo
159
159
  - [サポート&サービス](https://developer.mescius.jp/support)
160
160
  - [サブスクリプションサービス利用規約](https://download.mescius.jp/license/other/componentone-subscriptionservice.pdf)
161
161
 
162
- ## Wijmo CN
163
-
164
- Wijmo 是一套完整的企业级 JavaScript UI 开发组件。 它包括强大的表格、图表、数据透视、输入等组件,并且可以支持各类主流前端框架,包括 Angular、React 和 Vue。
165
-
166
- Wijmo 的轻量级、高性能 JavaScript UI 组件可以将您的开发时间缩短一半。
167
-
168
- 查看我们 [FlexGrid 表格](https://demo.grapecity.com.cn/wijmo/demos/Grid/Overview/purejs) 组件.
169
-
170
-
171
- ---
172
-
173
- ## 从 NPM 获取您所缺少的开发包!
174
-
175
- 请务必下载 Wijmo 以获得完整的开发包。 NPM 仅包含我们的 JS 组件,但我们的开发包包含数百个示例,其中包含每个 JS 框架的源代码、实际参考应用程序等等!
176
-
177
- **[下载 Wijmo 开发包](https://www.grapecity.com.cn/developer/wijmojs/download) 以启动您的项目。**
178
-
179
- ---
180
-
181
- ## 示例
182
-
183
- 每种 JavaScript 框架中都提供超过 450 个功能示例
184
-
185
- - [JavaScript 示例](https://demo.grapecity.com.cn/wijmo/demos/Grid/Overview/purejs)
186
- - [Vue 示例](https://demo.grapecity.com.cn/wijmo/demos/Grid/Overview/vue)
187
- - [Angular 示例](https://demo.grapecity.com.cn/wijmo/demos/Grid/Overview/angular)
188
- - [React 示例](https://demo.grapecity.com.cn/wijmo/demos/Grid/Overview/react)
189
-
190
- 我们还提供了 JavaScript 框架中可用的实际应用示例
191
-
192
-
193
- - [Vue 参考应用](https://www.grapecity.com/wijmo/demos/reference-samples/#GeoDashboard)
194
- - [Angular 参考应用](https://demos.wijmo.com/5/SampleExplorer/SampleExplorer/Sample/WealthHealth)
195
- - [React 参考应用](https://www.grapecity.com/wijmo/demos/reference-samples/#GeoDashboard)
196
- - [React Redux 参考应用](https://www.grapecity.com/wijmo/demos/reference-samples/#CryptoCurrencyTracking)
197
-
198
- [Wijmo 开发包](https://www.grapecity.com.cn/developer/wijmojs/download) 中提供了示例源代码。
199
-
200
- ## 安装
201
-
202
- ### 安装最新版本:
203
-
204
- ```sh
205
- npm install @grapecity/wijmo.all
206
- ```
207
-
208
- ### 安装最新的 nightly 版本:
209
- ```sh
210
- npm install @grapecity/wijmo.all@nightly
211
- ```
212
-
213
- ### 安装最新的 RC 版本:
214
-
215
- ```sh
216
- npm install @grapecity/wijmo.all@rc
217
- ```
218
-
219
- ## 文档
220
-
221
- 在线文档可在此处获取:
222
-
223
- - [API Reference](https://demo.grapecity.com.cn/wijmo/api/)
224
- - [Documentation Guides](https://demo.grapecity.com.cn/wijmo/docs/GettingStarted/Introduction)
225
-
226
- ## 许可
227
-
228
- Wijmo授权由开发授权和部署授权组成
229
-
230
- 了解 [WijmoJS 价格与授权方式](https://www.grapecity.com.cn/developer/wijmojs#price).
231
-
232
- ## 资源
233
-
234
- - [快速入门指南](https://demo.grapecity.com.cn/wijmo/docs/GettingStarted/QuickStart/QuickStart-PureJS)
235
- - [Wijmo 产品介绍](https://www.grapecity.com.cn/developer/wijmojs)
236
- - [博客](https://www.grapecity.com.cn/blogs/tags/wijmo)
237
- - [论坛](https://gcdn.grapecity.com.cn/showforum-140-1.html)
238
-
239
- Wijmo 开发包可以从 [这里](https://www.grapecity.com.cn/developer/wijmojs/download) 下载
240
-
241
- ## 支持
242
-
243
- **Wijmo 随时为您提供支持**
244
-
245
- 提供多种售前支持方式。您可以通过电话热线、邮件、售前顾问、在线咨询、添加企业微信等方式获取获取售前咨询、产品解决方案、产品选型等1V1服务。帮您快速了解产品特性,助您POC验证成功,节省时间成本。
246
-
247
- - [联系我们](https://www.grapecity.com.cn/support#goumaizixun)
248
-
249
-
250
- ## 问题反馈
251
-
252
- 我们重视您的反馈并利用建议来帮助创建产品路线图。 告诉我们你的想法。
253
-
254
- [提交您的问题和反馈建议](https://gcdn.grapecity.com.cn/showforum-173-1.html)
255
162
 
256
163
  # Wijmo KR
257
164
 
@@ -302,19 +209,19 @@ Wijmo는 또한 NPM을 지원합니다. 이를 통해 최신 버전의 Wijmo 라
302
209
  **[최신 정식 버전]**
303
210
 
304
211
  ```sh
305
- npm install @grapecity/wijmo.all
212
+ npm install @mescius/wijmo.all
306
213
  ```
307
214
 
308
215
  **[Nightly 버전]**
309
216
 
310
217
  ```sh
311
- npm install @grapecity/wijmo.all@nightly
218
+ npm install @mescius/wijmo.all@nightly
312
219
  ```
313
220
 
314
221
  **[RC 버전]**
315
222
 
316
223
  ```sh
317
- npm install @grapecity/wijmo.all@rc
224
+ npm install @mescius/wijmo.all@rc
318
225
  ```
319
226
 
320
227
  ## 빠른시작 가이드
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * Wijmo Library 5.20232.939
3
+ * Wijmo Library 5.20241.2
4
4
  * https://developer.mescius.com/wijmo
5
5
  *
6
6
  * Copyright(c) MESCIUS inc. All rights reserved.
package/es2015-esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * Wijmo Library 5.20232.939
3
+ * Wijmo Library 5.20241.2
4
4
  * https://developer.mescius.com/wijmo
5
5
  *
6
6
  * Copyright(c) MESCIUS inc. All rights reserved.
@@ -11,4 +11,4 @@
11
11
  *
12
12
  */
13
13
 
14
- import{asEnum,addClass,_registerModule}from"@mescius/wijmo";import{Utils,VerticalLayoutArea,MatrixSymbolArea,InvalidTextException,TwoDimensionalBarcode,InvalidOptionsException,TextTooLongException,MatrixBuilder,Constants,InvalidCharacterException,Option,BitBuffer,OneDimensionalBarcode,LabelArea,SymbolArea,Barcode,BarcodeBase,_LabelPositionConvertor,_EnumDictionary}from"@mescius/wijmo.barcode";import*as selfModule from"@mescius/wijmo.barcode.composite";export class ISO646Encoder{constructor(e){this.bitBuffer=e}static isISO646Only(e){return ISO646Encoder.ISO646.indexOf(e)>-1}encode(e){let t=ISO646Encoder.Table[e];if(t)this.bitBuffer.putBits(t);else{const t=e.charCodeAt(0);if(t>=48&&t<=57)this.bitBuffer.put(t-43,5);else if(e>="A"&&e<="Z")this.bitBuffer.put(t-1,7);else{if(!(e>="a"&&e<="z"))throw new InvalidCharacterException(e);this.bitBuffer.put(t-7,7)}}}FNC1NumericLatch(){this.bitBuffer.putBits(ISO646Encoder.Table.FNC1NumericLatch)}NumericLatch(){this.bitBuffer.putBits(ISO646Encoder.Table.NumericLatch)}AlphanumericLatch(){this.bitBuffer.putBits(ISO646Encoder.Table.AlphanumericLatch)}}ISO646Encoder.Table={"!":"11101000",'"':"11101001","%":"11101010","&":"11101011","'":"11101100","(":"11101101",")":"11101110","*":"11101111","+":"11110000",",":"11110001","-":"11110010",".":"11110011","/":"11110100",":":"11110101",";":"11110110","<":"11110111","=":"11111000",">":"11111001","?":"11111010",_:"11111011"," ":"11111100",FNC1NumericLatch:"01111",NumericLatch:"000",AlphanumericLatch:"00100"};ISO646Encoder.ISO646="abcdefghijklmnopqrstuvwxyz!\"%&'()+:;<=>?_ ";export class AlphanumericEncoder{constructor(e){this.bitBuffer=e}static isUpperCase(e){return e>="A"&&e<="Z"}static isLowerCase(e){return e>="a"&&e<="z"}encode(e){let t=AlphanumericEncoder.Table[e];if(t)this.bitBuffer.putBits(t);else{const t=e.charCodeAt(0);if(t>=48&&t<=57)this.bitBuffer.put(t-43,5);else{if(!AlphanumericEncoder.isUpperCase(e))throw new InvalidCharacterException(e);this.bitBuffer.put(t-33,6)}}}FNC1NumericLatch(){this.bitBuffer.putBits(AlphanumericEncoder.Table.FNC1NumericLatch)}NumericLatch(){this.bitBuffer.putBits(AlphanumericEncoder.Table.NumericLatch)}ISO646Latch(){this.bitBuffer.putBits(AlphanumericEncoder.Table.ISO646Latch)}}AlphanumericEncoder.Table={"*":"111010",",":"111011","-":"111100",".":"111101","/":"111110",FNC1NumericLatch:"01111",NumericLatch:"000",ISO646Latch:"00100"};export class NumericEncoder{static isNumericOrFNC1(e){const t=e.charCodeAt(0);return e===Constants.FNC1||t>=48&&t<=57}static isNumeric(e){const t=e.charCodeAt(0);return t>=48&&t<=57}constructor(e){this.bitBuffer=e}encode(e,t){let r,i;const n=11*(r=e===Constants.FNC1?10:e.charCodeAt(0)-48)+(i=t===Constants.FNC1?10:t.charCodeAt(0)-48)+8;this.bitBuffer.put(n,7)}encodeOne(e){let t;t=e===Constants.FNC1?10:e.charCodeAt(0)-48+1;this.bitBuffer.put(t,4)}AlphanumericLatch(){this.bitBuffer.put(0,4)}}export class GS1GeneralPurposeDataEncodation{constructor(e,t=!1){this.text="";this.mode=GS1GeneralPurposeDataEncodation.EncodeMod.Numeric;this.bitBuffer=e;this.needExtraPadding=t}encodeGeneralData(e){if(!e)return;const{bitBuffer:t}=this;let r=GS1GeneralPurposeDataEncodation.EncodeMod.Numeric;for(let i=e.length,n=0;i>0;i=e.length-n){const o=e[n];switch(r){case GS1GeneralPurposeDataEncodation.EncodeMod.Numeric:{const s=new NumericEncoder(t),a=t.length;if(1===i)if(NumericEncoder.isNumeric(o)){a>24&&a%12<=8&&a%12>5?s.encodeOne(o):s.encode(o,Constants.FNC1);n++}else{s.AlphanumericLatch();r=GS1GeneralPurposeDataEncodation.EncodeMod.Alphanumeric}else if(NumericEncoder.isNumericOrFNC1(o)&&NumericEncoder.isNumericOrFNC1(e[n+1])&&(o!==Constants.FNC1||e[n+1]!==Constants.FNC1)){s.encode(o,e[n+1]);n+=2}else{s.AlphanumericLatch();r=GS1GeneralPurposeDataEncodation.EncodeMod.Alphanumeric}break}case GS1GeneralPurposeDataEncodation.EncodeMod.Alphanumeric:{const i=new AlphanumericEncoder(t);if(o===Constants.FNC1){i.FNC1NumericLatch();r=GS1GeneralPurposeDataEncodation.EncodeMod.Numeric;n++}else if(NumericEncoder.isNumeric(o)){let t=n+1;for(;t<e.length&&NumericEncoder.isNumeric(e[t]);t++);if(t-n>=6||t-n>=4&&t===e.length){i.NumericLatch();r=GS1GeneralPurposeDataEncodation.EncodeMod.Numeric}else{i.encode(o);n++}}else if(ISO646Encoder.isISO646Only(o)){i.ISO646Latch();r=GS1GeneralPurposeDataEncodation.EncodeMod.ISO646}else{i.encode(o);n++}break}case GS1GeneralPurposeDataEncodation.EncodeMod.ISO646:{const i=new ISO646Encoder(t);if(NumericEncoder.isNumericOrFNC1(o)){let t=n+1;for(;t<e.length&&NumericEncoder.isNumericOrFNC1(e[t]);t++);if(t-n>=4){for(;t<e.length&&!ISO646Encoder.isISO646Only(e[t]);t++);if(t==e.length||t-n>10){i.NumericLatch();r=GS1GeneralPurposeDataEncodation.EncodeMod.Numeric;break}}}else{let t=n;for(;t<e.length&&!ISO646Encoder.isISO646Only(e[t]);t++);if(t-n>10){i.AlphanumericLatch();r=GS1GeneralPurposeDataEncodation.EncodeMod.Alphanumeric;break}}if(o===Constants.FNC1){i.FNC1NumericLatch();r=GS1GeneralPurposeDataEncodation.EncodeMod.Numeric;n++}else{i.encode(o);n++}break}}}this.mode=r}padTo(e){const{bitBuffer:t}=this,r=e-t.length;this._pad(r)}_pad(e){const{bitBuffer:t}=this;for(;e>0;)if(this.mode===GS1GeneralPurposeDataEncodation.EncodeMod.Numeric){this.mode=GS1GeneralPurposeDataEncodation.EncodeMod.Alphanumeric;if(e>=4){t.put(0,4);e-=4}else{t.put(0,e);e=0}}else if(e>=5){t.put(4,5);e-=5}else{4===e?t.put(2,e):3===e?t.put(1,e):t.put(0,e);e=0}}encode(e=""){const{bitBuffer:t,needExtraPadding:r}=this;this.encodeGeneralData(e);let i,n=~~((t.length+11)/12);i=12*(n=n<3?3:n)-t.length;r&&(i+=12);this._pad(i)}}GS1GeneralPurposeDataEncodation.EncodeMod={Numeric:"Numeric",Alphanumeric:"Alphanumeric",ISO646:"ISO646"};const mb=new MatrixBuilder(69,7),pwr928=mb.toMatrix();function init928(){let e,t,r,i=Utils.fillArray(new Array(7),0);i[6]=1;for(e=0;e<7;e++)pwr928[0][e]=i[e];for(t=1;t<69;t++){for(r=0,e=6;e>=1;e--){r=2*i[e]+~~(r/928);pwr928[t][e]=i[e]=r%928}pwr928[t][0]=i[0]=2*i[0]+~~(r/928)}}init928();function getBit(e,t){return 0==(e[~~(t/16)]&32768>>t%16)?0:1}export function encode928(e,t,r){let i,n,o,s,a,c,l;for(a=l=o=0;o<r;o+=69,a+=7){l+=c=1+~~((s=Math.min(r-o,69))/10);for(i=0;i<c;i++)t[a+i]=0;for(i=0;i<s;i++)if(getBit(e,o+s-i-1))for(n=0;n<c;n++)t[a+n]+=pwr928[i][n+7-c];for(i=c-1;i>0;i--){t[a+i-1]+=~~(t[a+i]/928);t[a+i]%=928}}return l}function makeRange_CCA(e,t){const r=[];let i=0,n=e;for(;i<t;){n>52&&(n%=52);r.push(n);i++;n++}return r}export function findVersionTable_CCA(e,t){for(let r=0,i=e.length;r<i;r++){let i=e[r];const[n,o,s,a,c,l,d]=i,h=o*n;if(t(i={rows:o,cols:n,total:h,ecCws:s,nonEcCw:h-s,bits:a})){i.rowAssignment={left:makeRange_CCA(c,o),right:makeRange_CCA(l,o),center:d?makeRange_CCA(d,o):null};const e=[];let t=0;for(;t<=o;){const r=(c+t-1)%3;e.push(r);t++}i.cluster=e;return i}}return null}export function getVersionVariant_CCA(e,t){return findVersionTable_CCA([[2,5,4,59,39,19],[2,6,4,78,1,33],[2,7,5,88,32,12],[2,8,5,108,8,40],[2,9,6,118,14,46],[2,10,6,138,43,23],[2,12,7,167,20,52],[3,4,4,78,11,23,43],[3,5,5,98,1,13,33],[3,6,6,118,3,17,37],[3,7,7,138,15,27,47],[3,8,7,167,21,33,1],[4,3,4,78,40,52,20],[4,4,5,108,43,3,23],[4,5,6,138,46,6,26],[4,6,7,167,34,46,14],[4,7,8,197,29,41,9]],r=>r.cols===e&&r.bits>=t)}const SupportedUppercaseAlphabetic="BDHIJKLNPQRSTVWZ";export function getSupportedUppercaseAlphabetic(e){const t=SupportedUppercaseAlphabetic.indexOf(e);if(-1===t)return null;const r=Utils.convertRadix(t);return Utils.strPadStart(r,4,"0")}const EncodeMod=GS1GeneralPurposeDataEncodation.EncodeMod;export class GeneralPurposeDataEncodation extends GS1GeneralPurposeDataEncodation{encodeGeneralData(e,t){if(!e)return;const{bitBuffer:r}=this;let i=EncodeMod.Numeric;for(let n=e.length,o=0;n>0;n=e.length-o){const s=e[o];switch(i){case EncodeMod.Numeric:{const a=new NumericEncoder(r),c=s[0].charCodeAt(0);if(1===n)if(NumericEncoder.isNumeric(s)){const e=getVersionVariant_CCA(t,r.length);if(!e)throw new TextTooLongException;const i=e.bits-r.length;if(i>=4&&i<=6){a.encodeOne(s);r.put(0,i-4)}else r.put(11*(c-48)+10+8,7);o++}else{a.AlphanumericLatch();i=EncodeMod.Alphanumeric}else if(NumericEncoder.isNumericOrFNC1(s)&&NumericEncoder.isNumericOrFNC1(e[o+1])&&(s!==Constants.FNC1||e[o+1]!==Constants.FNC1)){a.encode(s,e[o+1]);o+=2}else{a.AlphanumericLatch();i=EncodeMod.Alphanumeric}break}case EncodeMod.Alphanumeric:{const t=new AlphanumericEncoder(r);if(s===Constants.FNC1){t.FNC1NumericLatch();i=EncodeMod.Numeric;o++}else if(NumericEncoder.isNumeric(s)){let r=o+1;for(;r<e.length&&NumericEncoder.isNumericOrFNC1(e[r]);r++);if(r-o>=6||r-o>=4&&r===e.length){t.NumericLatch();i=EncodeMod.Numeric}else{t.encode(s);o++}}else if(ISO646Encoder.isISO646Only(s)){t.ISO646Latch();i=EncodeMod.ISO646}else{t.encode(s);o++}break}case EncodeMod.ISO646:{const t=new ISO646Encoder(r);if(NumericEncoder.isNumericOrFNC1(s)){let r=o+1;for(;r<e.length&&NumericEncoder.isNumericOrFNC1(e[r]);r++);if(r-o>=4){for(;r<e.length&&!ISO646Encoder.isISO646Only(e[r]);r++);if(r==e.length||r-o>10){t.NumericLatch();i=EncodeMod.Numeric;break}}}else{let r=o;for(;r<e.length&&!ISO646Encoder.isISO646Only(e[r]);r++);if(r-o>10){t.AlphanumericLatch();i=EncodeMod.Alphanumeric;break}}if(s===Constants.FNC1){t.FNC1NumericLatch();i=EncodeMod.Numeric;o++}else{t.encode(s);o++}break}}}this.mode=i}}const EccCoefficientTable=[[27,917],[522,568,723,809],[237,308,436,284,646,653,428,379],[274,562,232,755,599,524,801,132,295,116,442,428,295,42,176,65],[361,575,922,525,176,586,640,321,536,742,677,742,687,284,193,517,273,494,263,147,593,800,571,320,803,133,231,390,685,330,63,410],[539,422,6,93,862,771,453,106,610,287,107,505,733,877,381,612,723,476,462,172,430,609,858,822,543,376,511,400,672,762,283,184,440,35,519,31,460,594,225,535,517,352,605,158,651,201,488,502,648,733,717,83,404,97,280,771,840,629,4,381,843,623,264,543],[521,310,864,547,858,580,296,379,53,779,897,444,400,925,749,415,822,93,217,208,928,244,583,620,246,148,447,631,292,908,490,704,516,258,457,907,594,723,674,292,272,96,684,432,686,606,860,569,193,219,129,186,236,287,192,775,278,173,40,379,712,463,646,776,171,491,297,763,156,732,95,270,447,90,507,48,228,821,808,898,784,663,627,378,382,262,380,602,754,336,89,614,87,432,670,616,157,374,242,726,600,269,375,898,845,454,354,130,814,587,804,34,211,330,539,297,827,865,37,517,834,315,550,86,801,4,108,539],[524,894,75,766,882,857,74,204,82,586,708,250,905,786,138,720,858,194,311,913,275,190,375,850,438,733,194,280,201,280,828,757,710,814,919,89,68,569,11,204,796,605,540,913,801,700,799,137,439,418,592,668,353,859,370,694,325,240,216,257,284,549,209,884,315,70,329,793,490,274,877,162,749,812,684,461,334,376,849,521,307,291,803,712,19,358,399,908,103,511,51,8,517,225,289,470,637,731,66,255,917,269,463,830,730,433,848,585,136,538,906,90,2,290,743,199,655,903,329,49,802,580,355,588,188,462,10,134,628,320,479,130,739,71,263,318,374,601,192,605,142,673,687,234,722,384,177,752,607,640,455,193,689,707,805,641,48,60,732,621,895,544,261,852,655,309,697,755,756,60,231,773,434,421,726,528,503,118,49,795,32,144,500,238,836,394,280,566,319,9,647,550,73,914,342,126,32,681,331,792,620,60,609,441,180,791,893,754,605,383,228,749,760,213,54,297,134,54,834,299,922,191,910,532,609,829,189,20,167,29,872,449,83,402,41,656,505,579,481,173,404,251,688,95,497,555,642,543,307,159,924,558,648,55,497,10],[352,77,373,504,35,599,428,207,409,574,118,498,285,380,350,492,197,265,920,155,914,299,229,643,294,871,306,88,87,193,352,781,846,75,327,520,435,543,203,666,249,346,781,621,640,268,794,534,539,781,408,390,644,102,476,499,290,632,545,37,858,916,552,41,542,289,122,272,383,800,485,98,752,472,761,107,784,860,658,741,290,204,681,407,855,85,99,62,482,180,20,297,451,593,913,142,808,684,287,536,561,76,653,899,729,567,744,390,513,192,516,258,240,518,794,395,768,848,51,610,384,168,190,826,328,596,786,303,570,381,415,641,156,237,151,429,531,207,676,710,89,168,304,402,40,708,575,162,864,229,65,861,841,512,164,477,221,92,358,785,288,357,850,836,827,736,707,94,8,494,114,521,2,499,851,543,152,729,771,95,248,361,578,323,856,797,289,51,684,466,533,820,669,45,902,452,167,342,244,173,35,463,651,51,699,591,452,578,37,124,298,332,552,43,427,119,662,777,475,850,764,364,578,911,283,711,472,420,245,288,594,394,511,327,589,777,699,688,43,408,842,383,721,521,560,644,714,559,62,145,873,663,713,159,672,729,624,59,193,417,158,209,563,564,343,693,109,608,563,365,181,772,677,310,248,353,708,410,579,870,617,841,632,860,289,536,35,777,618,586,424,833,77,597,346,269,757,632,695,751,331,247,184,45,787,680,18,66,407,369,54,492,228,613,830,922,437,519,644,905,789,420,305,441,207,300,892,827,141,537,381,662,513,56,252,341,242,797,838,837,720,224,307,631,61,87,560,310,756,665,397,808,851,309,473,795,378,31,647,915,459,806,590,731,425,216,548,249,321,881,699,535,673,782,210,815,905,303,843,922,281,73,469,791,660,162,498,308,155,422,907,817,187,62,16,425,535,336,286,437,375,273,610,296,183,923,116,667,751,353,62,366,691,379,687,842,37,357,720,742,330,5,39,923,311,424,242,749,321,54,669,316,342,299,534,105,667,488,640,672,576,540,316,486,721,610,46,656,447,171,616,464,190,531,297,321,762,752,533,175,134,14,381,433,717,45,111,20,596,284,736,138,646,411,877,669,141,919,45,780,407,164,332,899,165,726,600,325,498,655,357,752,768,223,849,647,63,310,863,251,366,304,282,738,675,410,389,244,31,121,303,263]],MicroEccCoefficientTable=[[890,351,200],[809,723,568,522],[566,155,460,919,427],[766,17,803,19,285,861],[437,691,784,597,537,925,76],[379,428,653,646,284,436,308,237],[205,441,501,362,289,257,622,527,567],[612,266,691,818,841,826,244,64,457,377],[904,602,327,68,15,213,825,708,565,45,462],[851,69,7,388,127,347,684,646,201,757,864,597],[692,394,184,204,678,592,322,583,606,384,342,713,764],[215,105,833,691,915,478,354,274,286,241,187,154,677,669],[642,868,147,575,550,74,80,5,230,664,904,109,476,829,460],[65,176,42,295,428,442,116,295,132,801,524,599,755,232,562,274],[573,760,756,233,321,560,202,312,297,120,739,275,855,37,624,315,577,279],[568,259,193,165,347,691,310,610,624,693,763,716,422,553,681,425,129,534,781,519,108],[169,764,847,131,858,325,454,441,245,699,893,446,830,159,121,269,608,331,760,477,93,788,544,887,284,443],[410,63,330,685,390,231,133,803,320,571,800,593,147,263,494,273,517,193,284,687,742,677,742,536,321,640,586,176,525,922,575,361],[518,117,125,231,289,554,771,920,689,95,229,745,658,284,32,812,233,614,595,245,680,445,684,388,586,738,159,280,322,788,721,529,703,133,848,438,228,234],[285,82,730,339,436,572,271,103,758,231,560,31,213,272,267,569,773,3,21,446,706,413,97,376,60,714,436,417,405,632,25,109,876,470,915,157,840,764,64,678,848,659,36,476],[435,718,820,427,876,920,477,211,244,71,127,246,739,10,146,766,623,579,26,865,593,919,233,264,102,575,96,534,230,637,155,909,535,188,303,205,50,778,416,411,874,257,81,63,706,156,875,576,797,923]];MicroEccCoefficientTable.forEach(e=>e.reverse());function encode(e,t,r){let i=Utils.fillArray(new Array(t),0);e.forEach(e=>{let n,o,s=e+i[t-1];for(let e=t-1;e>0;--e){o=929-(n=s*r[e]%929);i[e]=(i[e-1]+o)%929}o=929-(n=s*r[0]%929);i[0]=o%929});i.forEach((e,t)=>{0!=e&&(i[t]=929-e)});return i.reverse()}export function generateECC(e,t){const r=EccCoefficientTable[t];return encode(e,Math.pow(2,t+1),r)}export function generateECCForMicro(e,t){let r,i=0;for(;i<MicroEccCoefficientTable.length;){const e=MicroEccCoefficientTable[i];if(e.length===t){r=e;break}i++}return encode(e,t,r)}export const SymbolVersion={ColumnPriorAuto:"columnPriorAuto",RowPriorAuto:"rowPriorAuto",V1X11:"1*11",V1X14:"1*14",V1X17:"1*17",V1X20:"1*20",V1X24:"1*24",V1X28:"1*28",V2X8:"2*8",V2X11:"2*11",V2X14:"2*14",V2X17:"2*17",V2X20:"2*20",V2X23:"2*23",V2X26:"2*26",V3X6:"3*6",V3X8:"3*8",V3X10:"3*10",V3X12:"3*12",V3X15:"3*15",V3X20:"3*20",V3X26:"3*26",V3X32:"3*32",V3X38:"3*38",V3X44:"3*44",V4X4:"4*4",V4X6:"4*6",V4X8:"4*8",V4X10:"4*10",V4X12:"4*12",V4X15:"4*15",V4X20:"4*20",V4X26:"4*26",V4X32:"4*32",V4X38:"4*38",V4X44:"4*44"};Utils.makeEnums(SymbolVersion);export const CompactionMode={Auto:"auto",Text:"text",Byte:"byte",Numeric:"numeric"};Utils.makeEnums(CompactionMode);export const CLUSTERS=[[120256,125680,128380,120032,125560,128318,108736,119920,108640,86080,108592,86048,110016,120560,125820,109792,120440,125758,88256,109680,88160,89536,110320,120700,89312,110200,120638,89200,110140,89840,110460,89720,110398,89980,128506,119520,125304,128190,107712,119408,125244,107616,119352,84032,107568,119324,84e3,107544,83984,108256,119672,125374,85184,108144,119612,85088,108088,119582,85040,108060,85728,108408,119742,85616,108348,85560,108318,85880,108478,85820,85790,107200,119152,125116,107104,119096,125086,83008,107056,119068,82976,107032,82960,82952,83648,107376,119228,83552,107320,119198,83504,107292,83480,83468,83824,107452,83768,107422,83740,83900,106848,118968,125022,82496,106800,118940,82464,106776,118926,82448,106764,82440,106758,82784,106936,119006,82736,106908,82712,106894,82700,82694,106974,82830,82240,106672,118876,82208,106648,118862,82192,106636,82184,106630,82180,82352,82328,82316,82080,118830,106572,106566,82050,117472,124280,127678,103616,117360,124220,103520,117304,124190,75840,103472,75808,104160,117624,124350,76992,104048,117564,76896,103992,76848,76824,77536,104312,117694,77424,104252,77368,77340,77688,104382,77628,77758,121536,126320,128700,121440,126264,128670,111680,121392,126236,111648,121368,126222,111632,121356,103104,117104,124092,112320,103008,117048,124062,112224,121656,126366,93248,74784,102936,117006,93216,112152,93200,75456,103280,117180,93888,75360,103224,117150,93792,112440,121758,93744,75288,93720,75632,103356,94064,75576,103326,94008,112542,93980,75708,94140,75678,94110,121184,126136,128606,111168,121136,126108,111136,121112,126094,111120,121100,111112,111108,102752,116920,123998,111456,102704,116892,91712,74272,121244,116878,91680,74256,102668,91664,111372,102662,74244,74592,102840,116958,92e3,74544,102812,91952,111516,102798,91928,74508,74502,74680,102878,92088,74652,92060,74638,92046,92126,110912,121008,126044,110880,120984,126030,110864,120972,110856,120966,110852,110850,74048,102576,116828,90944,74016,102552,116814,90912,111e3,121038,90896,73992,102534,90888,110982,90884,74160,102620,91056,74136,102606,91032,111054,91020,74118,91014,91100,91086,110752,120920,125998,110736,120908,110728,120902,110724,110722,73888,102488,116782,90528,73872,102476,90512,110796,102470,90504,73860,90500,73858,73944,90584,90572,90566,120876,120870,110658,102444,73800,90312,90308,90306,101056,116080,123580,100960,116024,70720,100912,115996,70688,100888,70672,70664,71360,101232,116156,71264,101176,116126,71216,101148,71192,71180,71536,101308,71480,101278,71452,71612,71582,118112,124600,127838,105024,118064,124572,104992,118040,124558,104976,118028,104968,118022,100704,115896,123486,105312,100656,115868,79424,70176,118172,115854,79392,105240,100620,79376,70152,79368,70496,100792,115934,79712,70448,118238,79664,105372,100750,79640,70412,79628,70584,100830,79800,70556,79772,70542,70622,79838,122176,126640,128860,122144,126616,128846,122128,126604,122120,126598,122116,104768,117936,124508,113472,104736,126684,124494,113440,122264,126670,113424,104712,117894,113416,122246,104706,69952,100528,115804,78656,69920,100504,115790,96064,78624,104856,117966,96032,113560,122318,100486,96016,78600,104838,96008,69890,70064,100572,78768,70040,100558,96176,78744,104910,96152,113614,70022,78726,70108,78812,70094,96220,78798,122016,126552,128814,122e3,126540,121992,126534,121988,121986,104608,117848,124462,113056,104592,126574,113040,122060,117830,113032,104580,113028,104578,113026,69792,100440,115758,78240,69776,100428,95136,78224,104652,100422,95120,113100,69764,95112,78212,69762,78210,69848,100462,78296,69836,95192,78284,69830,95180,78278,69870,95214,121936,126508,121928,126502,121924,121922,104528,117804,112848,104520,117798,112840,121958,112836,104514,112834,69712,100396,78032,69704,100390,94672,78024,104550,94664,112870,69698,94660,78018,94658,78060,94700,94694,126486,121890,117782,104484,104482,69672,77928,94440,69666,77922,99680,68160,99632,68128,99608,115342,68112,99596,68104,99590,68448,99768,115422,68400,99740,68376,99726,68364,68358,68536,99806,68508,68494,68574,101696,116400,123740,101664,116376,101648,116364,101640,116358,101636,67904,99504,115292,72512,67872,116444,115278,72480,101784,116430,72464,67848,99462,72456,101766,67842,68016,99548,72624,67992,99534,72600,101838,72588,67974,68060,72668,68046,72654,118432,124760,127918,118416,124748,118408,124742,118404,118402,101536,116312,105888,101520,116300,105872,118476,116294,105864,101508,105860,101506,105858,67744,99416,72096,67728,116334,80800,72080,101580,99398,80784,105932,67716,80776,72068,67714,72066,67800,99438,72152,67788,80856,72140,67782,80844,72134,67822,72174,80878,126800,128940,126792,128934,126788,126786,118352,124716,122576,126828,124710,122568,126822,122564,118338,122562,101456,116268,105680,101448,116262,114128,105672,118374,114120,122598,101442,114116,105666,114114,67664,99372,71888,67656,99366,80336,71880,101478,97232,80328,105702,67650,97224,114150,71874,97220,67692,71916,67686,80364,71910,97260,80358,97254,126760,128918,126756,126754,118312,124694,122472,126774,122468,118306,122466,101416,116246,105576,101412,113896,105572,101410,113892,105570,113890,67624,99350,71784,101430,80104,71780,67618,96744,80100,71778,96740,80098,96738,71798,96758,126738,122420,122418,105524,113780,113778,71732,79988,96500,96498,66880,66848,98968,66832,66824,66820,66992,66968,66956,66950,67036,67022,1e5,99984,115532,99976,115526,99972,99970,66720,98904,69024,100056,98892,69008,100044,69e3,100038,68996,66690,68994,66776,98926,69080,100078,69068,66758,69062,66798,69102,116560,116552,116548,116546,99920,102096,116588,115494,102088,116582,102084,99906,102082,66640,68816,66632,98854,73168,68808,66628,73160,68804,66626,73156,68802,66668,68844,66662,73196,68838,73190,124840,124836,124834,116520,118632,124854,118628,116514,118626,99880,115478,101992,116534,106216,101988,99874,106212,101986,106210,66600,98838,68712,99894,72936,68708,66594,81384,72932,68706,81380,72930,66614,68726,72950,81398,128980,128978,124820,126900,124818,126898,116500,118580,116498,122740,118578,122738,99860,101940,99858,106100,101938,114420],[128352,129720,125504,128304,129692,125472,128280,129678,125456,128268,125448,128262,125444,125792,128440,129758,120384,125744,128412,120352,125720,128398,120336,125708,120328,125702,120324,120672,125880,128478,110144,120624,125852,110112,120600,125838,110096,120588,110088,120582,110084,110432,120760,125918,89664,110384,120732,89632,110360,120718,89616,110348,89608,110342,89952,110520,120798,89904,110492,89880,110478,89868,90040,110558,90012,89998,125248,128176,129628,125216,128152,129614,125200,128140,125192,128134,125188,125186,119616,125360,128220,119584,125336,128206,119568,125324,119560,125318,119556,119554,108352,119728,125404,108320,119704,125390,108304,119692,108296,119686,108292,108290,85824,108464,119772,85792,108440,119758,85776,108428,85768,108422,85764,85936,108508,85912,108494,85900,85894,85980,85966,125088,128088,129582,125072,128076,125064,128070,125060,125058,119200,125144,128110,119184,125132,119176,125126,119172,119170,107424,119256,125166,107408,119244,107400,119238,107396,107394,83872,107480,119278,83856,107468,83848,107462,83844,83842,83928,107502,83916,83910,83950,125008,128044,125e3,128038,124996,124994,118992,125036,118984,125030,118980,118978,106960,119020,106952,119014,106948,106946,82896,106988,82888,106982,82884,82882,82924,82918,124968,128022,124964,124962,118888,124982,118884,118882,106728,118902,106724,106722,82408,106742,82404,82402,124948,124946,118836,118834,106612,106610,124224,127664,129372,124192,127640,129358,124176,127628,124168,127622,124164,124162,117568,124336,127708,117536,124312,127694,117520,124300,117512,124294,117508,117506,104256,117680,124380,104224,117656,124366,104208,117644,104200,117638,104196,104194,77632,104368,117724,77600,104344,117710,77584,104332,77576,104326,77572,77744,104412,77720,104398,77708,77702,77788,77774,128672,129880,93168,128656,129868,92664,128648,129862,92412,128644,128642,124064,127576,129326,126368,124048,129902,126352,128716,127558,126344,124036,126340,124034,126338,117152,124120,127598,121760,117136,124108,121744,126412,124102,121736,117124,121732,117122,121730,103328,117208,124142,112544,103312,117196,112528,121804,117190,112520,103300,112516,103298,112514,75680,103384,117230,94112,75664,103372,94096,112588,103366,94088,75652,94084,75650,75736,103406,94168,75724,94156,75718,94150,75758,128592,129836,91640,128584,129830,91388,128580,91262,128578,123984,127532,126160,123976,127526,126152,128614,126148,123970,126146,116944,124012,121296,116936,124006,121288,126182,121284,116930,121282,102864,116972,111568,102856,116966,111560,121318,111556,102850,111554,74704,102892,92112,74696,102886,92104,111590,92100,74690,92098,74732,92140,74726,92134,128552,129814,90876,128548,90750,128546,123944,127510,126056,128566,126052,123938,126050,116840,123958,121064,116836,121060,116834,121058,102632,116854,111080,121078,111076,102626,111074,74216,102646,91112,74212,91108,74210,91106,74230,91126,128532,90494,128530,123924,126004,123922,126002,116788,120948,116786,120946,102516,110836,102514,110834,73972,90612,73970,90610,128522,123914,125978,116762,120890,102458,110714,123552,127320,129198,123536,127308,123528,127302,123524,123522,116128,123608,127342,116112,123596,116104,123590,116100,116098,101280,116184,123630,101264,116172,101256,116166,101252,101250,71584,101336,116206,71568,101324,71560,101318,71556,71554,71640,101358,71628,71622,71662,127824,129452,79352,127816,129446,79100,127812,78974,127810,123472,127276,124624,123464,127270,124616,127846,124612,123458,124610,115920,123500,118224,115912,123494,118216,124646,118212,115906,118210,100816,115948,105424,100808,115942,105416,118246,105412,100802,105410,70608,100844,79824,70600,100838,79816,105446,79812,70594,79810,70636,79852,70630,79846,129960,95728,113404,129956,95480,113278,129954,95356,95294,127784,129430,78588,128872,129974,95996,78462,128868,127778,95870,128866,123432,127254,124520,123428,126696,128886,123426,126692,124514,126690,115816,123446,117992,115812,122344,117988,115810,122340,117986,122338,100584,115830,104936,100580,113640,104932,100578,113636,104930,113634,70120,100598,78824,70116,96232,78820,70114,96228,78818,96226,70134,78838,129940,94968,113022,129938,94844,94782,127764,78206,128820,127762,95102,128818,123412,124468,123410,126580,124466,126578,115764,117876,115762,122100,117874,122098,100468,104692,100466,113140,104690,113138,69876,78324,69874,95220,78322,95218,129930,94588,94526,127754,128794,123402,124442,126522,115738,117818,121978,100410,104570,112890,69754,78074,94714,94398,123216,127148,123208,127142,123204,123202,115408,123244,115400,123238,115396,115394,99792,115436,99784,115430,99780,99778,68560,99820,68552,99814,68548,68546,68588,68582,127400,129238,72444,127396,72318,127394,123176,127126,123752,123172,123748,123170,123746,115304,123190,116456,115300,116452,115298,116450,99560,115318,101864,99556,101860,99554,101858,68072,99574,72680,68068,72676,68066,72674,68086,72694,129492,80632,105854,129490,80508,80446,127380,72062,127924,127378,80766,127922,123156,123700,123154,124788,123698,124786,115252,116340,115250,118516,116338,118514,99444,101620,99442,105972,101618,105970,67828,72180,67826,80884,72178,80882,97008,114044,96888,113982,96828,96798,129482,80252,130010,97148,80190,97086,127370,127898,128954,123146,123674,124730,126842,115226,116282,118394,122618,99386,101498,105722,114170,67706,71930,80378,96632,113854,96572,96542,80062,96702,96444,96414,96350,123048,123044,123042,115048,123062,115044,115042,99048,115062,99044,99042,67048,99062,67044,67042,67062,127188,68990,127186,123028,123316,123026,123314,114996,115572,114994,115570,98932,100084,98930,100082,66804,69108,66802,69106,129258,73084,73022,127178,127450,123018,123290,123834,114970,115514,116602,98874,99962,102138,66682,68858,73210,81272,106174,81212,81182,72894,81342,97648,114364,97592,114334,97564,97550,81084,97724,81054,97694,97464,114270,97436,97422,80990,97502,97372,97358,97326,114868,114866,98676,98674,66292,66290,123098,114842,115130,98618,99194,66170,67322,69310,73404,73374,81592,106334,81564,81550,73310,81630,97968,114524,97944,114510,97932,97926,81500,98012,81486,97998,97880,114478,97868,97862,81454,97902,97836,97830,69470,73564,73550,81752,106414,81740,81734,73518,81774,81708,81702],[109536,120312,86976,109040,120060,86496,108792,119934,86256,108668,86136,129744,89056,110072,129736,88560,109820,129732,88312,109694,129730,88188,128464,129772,89592,128456,129766,89340,128452,89214,128450,125904,128492,125896,128486,125892,125890,120784,125932,120776,125926,120772,120770,110544,120812,110536,120806,110532,84928,108016,119548,84448,107768,119422,84208,107644,84088,107582,84028,129640,85488,108284,129636,85240,108158,129634,85116,85054,128232,129654,85756,128228,85630,128226,125416,128246,125412,125410,119784,125430,119780,119778,108520,119798,108516,108514,83424,107256,119166,83184,107132,83064,107070,83004,82974,129588,83704,107390,129586,83580,83518,128116,83838,128114,125172,125170,119284,119282,107508,107506,82672,106876,82552,106814,82492,82462,129562,82812,82750,128058,125050,119034,82296,106686,82236,82206,82366,82108,82078,76736,103920,117500,76256,103672,117374,76016,103548,75896,103486,75836,129384,77296,104188,129380,77048,104062,129378,76924,76862,127720,129398,77564,127716,77438,127714,124392,127734,124388,124386,117736,124406,117732,117730,104424,117750,104420,104418,112096,121592,126334,92608,111856,121468,92384,111736,121406,92272,111676,92216,111646,92188,75232,103160,117118,93664,74992,103036,93424,112252,102974,93304,74812,93244,74782,93214,129332,75512,103294,129908,129330,93944,75388,129906,93820,75326,93758,127604,75646,128756,127602,94078,128754,124148,126452,124146,126450,117236,121844,117234,121842,103412,103410,91584,111344,121212,91360,111224,121150,91248,111164,91192,111134,91164,91150,74480,102780,91888,74360,102718,91768,111422,91708,74270,91678,129306,74620,129850,92028,74558,91966,127546,128634,124026,126202,116986,121338,102906,90848,110968,121022,90736,110908,90680,110878,90652,90638,74104,102590,91e3,74044,90940,74014,90910,74174,91070,90480,110780,90424,110750,90396,90382,73916,90556,73886,90526,90296,110686,90268,90254,73822,90334,90204,90190,71136,101112,116094,70896,100988,70776,100926,70716,70686,129204,71416,101246,129202,71292,71230,127348,71550,127346,123636,123634,116212,116210,101364,101362,79296,105200,118140,79072,105080,118078,78960,105020,78904,104990,78876,78862,70384,100732,79600,70264,100670,79480,105278,79420,70174,79390,129178,70524,129466,79740,70462,79678,127290,127866,123514,124666,115962,118266,100858,113376,122232,126654,95424,113264,122172,95328,113208,122142,95280,113180,95256,113166,95244,78560,104824,117950,95968,78448,104764,95856,113468,104734,95800,78364,95772,78350,95758,70008,100542,78712,69948,96120,78652,69918,96060,78622,96030,70078,78782,96190,94912,113008,122044,94816,112952,122014,94768,112924,94744,112910,94732,94726,78192,104636,95088,78136,104606,95032,113054,95004,78094,94990,69820,78268,69790,95164,78238,95134,94560,112824,121950,94512,112796,94488,112782,94476,94470,78008,104542,94648,77980,94620,77966,94606,69726,78046,94686,94384,112732,94360,112718,94348,94342,77916,94428,77902,94414,94296,112686,94284,94278,77870,94318,94252,94246,68336,99708,68216,99646,68156,68126,68476,68414,127162,123258,115450,99834,72416,101752,116414,72304,101692,72248,101662,72220,72206,67960,99518,72568,67900,72508,67870,72478,68030,72638,80576,105840,118460,80480,105784,118430,80432,105756,80408,105742,80396,80390,72048,101564,80752,71992,101534,80696,71964,80668,71950,80654,67772,72124,67742,80828,72094,80798,114016,122552,126814,96832,113968,122524,96800,113944,122510,96784,113932,96776,113926,96772,80224,105656,118366,97120,80176,105628,97072,114076,105614,97048,80140,97036,80134,97030,71864,101470,80312,71836,97208,80284,71822,97180,80270,97166,67678,71902,80350,97246,96576,113840,122460,96544,113816,122446,96528,113804,96520,113798,96516,96514,80048,105564,96688,80024,105550,96664,113870,96652,80006,96646,71772,80092,71758,96732,80078,96718,96416,113752,122414,96400,113740,96392,113734,96388,96386,79960,105518,96472,79948,96460,79942,96454,71726,79982,96494,96336,113708,96328,113702,96324,96322,79916,96364,79910,96358,96296,113686,96292,96290,79894,96310,66936,99006,66876,66846,67006,68976,100028,68920,99998,68892,68878,66748,69052,66718,69022,73056,102072,116574,73008,102044,72984,102030,72972,72966,68792,99934,73144,68764,73116,68750,73102,66654,68830,73182,81216,106160,118620,81184,106136,118606,81168,106124,81160,106118,81156,81154,72880,101980,81328,72856,101966,81304,106190,81292,72838,81286,68700,72924,68686,81372,72910,81358,114336,122712,126894,114320,122700,114312,122694,114308,114306,81056,106072,118574,97696,81040,106060,97680,114380,106054,97672,81028,97668,81026,97666,72792,101934,81112,72780,97752,81100,72774,97740,81094,97734,68654,72814,81134,97774,114256,122668,114248,122662,114244,114242,80976,106028,97488,80968,106022,97480,114278,97476,80962,97474,72748,81004,72742,97516,80998,97510,114216,122646,114212,114210,80936,106006,97384,80932,97380,80930,97378,72726,80950,97398,114196,114194,80916,97332,80914,97330,66236,66206,67256,99166,67228,67214,66142,67294,69296,100188,69272,100174,69260,69254,67164,69340,67150,69326,73376,102232,116654,73360,102220,73352,102214,73348,73346,69208,100142,73432,102254,73420,69190,73414,67118,69230,73454,106320,118700,106312,118694,106308,106306,73296,102188,81616,106348,102182,81608,73284,81604,73282,81602,69164,73324,69158,81644,73318,81638,122792,126934,122788,122786,106280,118678,114536,106276,114532,106274,114530,73256,102166,81512,73252,98024,81508,73250,98020,81506,98018,69142,73270,81526,98038,122772,122770,106260,114484,106258,114482,73236,81460,73234,97908,81458,97906,122762,106250,114458,73226,81434,97850,66396,66382,67416,99246,67404,67398,66350,67438,69456,100268,69448,100262,69444,69442,67372,69484,67366,69478,102312,116694,102308,102306,69416,100246,73576,102326,73572,69410,73570,67350,69430,73590,118740,118738,102292,106420,102290,106418,69396,73524,69394,81780,73522,81778,118730,102282,106394,69386,73498,81722,66476,66470,67496,99286,67492,67490,66454,67510,100308,100306,67476,69556,67474,69554,116714]];const mode_ll=" ",mode_ps=" ",mode_ml=" ",mode_al=" ",mode_pl=" ",mode_as=" ";export const subModeMap={ll:" ",ps:" ",ml:" ",al:" ",pl:" ",as:" "};const TEXT_MAP=["ABCDEFGHIJKLMNOPQRSTUVWXYZ    ","abcdefghijklmnopqrstuvwxyz    ","0123456789&\r\t,:#-.$/+%*=^     ",";<>@[\\]_`~!\r\t,:\n-.$/\"|*()?{}' "];export const MODE_TC=900,MODE_BC=901,MODE_NC=902,MODE_BC6=924,MODE_BC_SHIFT=913;function isAlpha(e){return TEXT_MAP[0].indexOf(e)>-1}function isLower(e){return TEXT_MAP[1].indexOf(e)>-1}function isMixed(e){return TEXT_MAP[2].indexOf(e)>-1}function isPunctuation(e){return TEXT_MAP[3].indexOf(e)>-1}function isTC(e){return isAlpha(e)||isLower(e)||isMixed(e)||isPunctuation(e)}function nextTC(e,t){let r=t,i=e.length,n=0;for(;r<i;){e[r]>="0"&&e[r]<="9"?n++:n=0;if(!isTC(e[r]))break;if(n>=13){r-=--n;break}r++}return e.substring(t,r)}function nextNC(e,t){let r=t,i=e.length;for(;r<i&&!(e[r]<"0"||e[r]>"9");)r++;return e.substring(t,r)}function nextBC(e,t){let r=t,i=e.length,n=0,o=0,s=!1;for(;r<i;){if(e[r]>="0"&&e[r]<="9"){n++;if(s){o=0;s=!1}}else if(isTC(e[r])){o++;if(!s){n=0;s=!0}}if(o>=5){r-=--o;break}if(n>=13){r-=--n;break}r++}return e.substring(t,r)}export function compaction(e,t=CompactionMode.Auto){let r=[];if(t===CompactionMode.Text)r=[{mode:MODE_TC,text:e}];else if(t===CompactionMode.Byte)r=[{mode:e.length%6==0?MODE_BC6:MODE_BC,text:e}];else if(t===CompactionMode.Numeric)r=[{mode:MODE_NC,text:e}];else{let t=0,i=e.length,n={mode:MODE_TC,text:""};for(;t<i;){let i=nextNC(e,t);if(i.length>=13){n={mode:MODE_NC,text:i};r.push(n);t+=i.length}else{let i=nextTC(e,t);if(i.length>=5){n={mode:MODE_TC,text:i};r.push(n);t+=i.length}else{let i=nextBC(e,t);if(1===i.length&&n.mode==MODE_TC){n={mode:MODE_BC_SHIFT,text:i};r.push(n)}else{n=i.length%6==0?{mode:MODE_BC6,text:i}:{mode:MODE_BC,text:i};r.push(n)}t+=i.length}}}}r.forEach(e=>{if(e.mode==MODE_TC){let t={mode:"al",text:""},r=[t];e.subModes=r;for(let i=0,n=e.text.length;i<n;i++){let n=e.text[i];if(isAlpha(n))if(0===i||"al"===t.mode)t.text+=n;else{t=isAlpha(e.text[i+1])?{mode:"al",text:n}:"ll"===t.mode?{mode:"as",text:n}:{mode:"al",text:n};r.push(t)}else if(isLower(n))if("ll"===t.mode)t.text+=n;else{t={mode:"ll",text:n};r.push(t)}else if(isMixed(n))if("pl"===t.mode&&isPunctuation(n))t.text+=n;else if("ml"===t.mode)t.text+=n;else{t={mode:"ml",text:n};r.push(t)}else if(isPunctuation(n))if("pl"===t.mode)t.text+=n;else{t=isPunctuation(e.text[i+1])?{mode:"pl",text:n}:{mode:"ps",text:n};r.push(t)}}}});return r}export function getIndicator(e,t,r,i,n){let o,s=~~(e/3),a=~~((t-1)/3),c=3*r+(t-1)%3,l=i-1;switch(e%3*3){case 0:o=n?l:a;break;case 3:o=n?a:c;break;case 6:o=n?c:l}return 30*s+o}export function getPattern_PDF417(e,t){return CLUSTERS[e%3][t]}export function getTCValue(e,t){let r;switch(t){case"ll":r=TEXT_MAP[1].indexOf(e);break;case"ml":r=TEXT_MAP[2].indexOf(e);break;case"al":case"as":r=TEXT_MAP[0].indexOf(e);break;case"pl":case"ps":r=TEXT_MAP[3].indexOf(e)}return r}const subModeTable={al:{ll:[27],ml:[28],pl:[28,25]},ll:{al:[28,28],ml:[28],pl:[28,25]},ml:{al:[28],ll:[27],pl:[25]},pl:{al:[29],ll:[29,27],ml:[29,28]}};export function getTCSubModeValue(e,t){let r=getTCValue(subModeMap[e],t);return r>-1?[r]:subModeTable[t][e]}export function createModules(e,t){let r=[];for(let i=0;i<e;i++)r.push(Utils.fillArray(new Array(t),null));return r}export function getAutoECL(e){const t=e.length;return t<=40?2:t<=160?3:t<=320?4:5}export function getAutoRowAndCol(e){let t,r,i=31;do{i--;r=(t=Math.ceil(e/i))/i;if(i<2)break}while(r<4);t<3&&(t=3);return{col:i,row:t}}const LRRowAddressPatterns=["221311","311311","312211","222211","213211","214111","223111","313111","322111","412111","421111","331111","241111","232111","231211","321211","411211","411121","411112","321112","312112","311212","311221","311131","311122","311113","221113","221122","221131","221221","222121","312121","321121","231121","231112","222112","213112","212212","212221","212131","212122","212113","211213","211123","211132","211141","211231","211222","211312","211321","211411","212311"],CRowAddressPatterns=["112231","121231","122131","131131","131221","132121","141121","141211","142111","133111","132211","131311","122311","123211","124111","115111","114211","114121","123121","123112","122212","122221","121321","121411","112411","113311","113221","113212","113122","122122","131122","131113","122113","113113","112213","112222","112312","112321","111421","111331","111322","111232","111223","111133","111124","111214","112114","121114","121123","121132","112132","112141"],VersionTable=[[1,11,7,1,9],[1,14,7,8,8],[1,17,7,36,36],[1,20,8,19,19],[1,24,8,9,17],[1,28,8,25,33],[2,8,8,1,1],[2,11,9,1,9],[2,14,9,8,8],[2,17,10,36,36],[2,20,11,19,19],[2,23,13,9,17],[2,26,15,27,35],[3,6,12,1,1,1],[3,8,14,7,7,7],[3,10,16,15,15,15],[3,12,18,25,25,25],[3,15,21,37,37,37],[3,20,26,1,33,17],[3,26,32,1,17,9],[3,32,38,21,37,29],[3,38,44,15,47,31],[3,44,50,1,9,49],[4,4,8,47,43,19],[4,6,12,1,1,1],[4,8,14,7,7,7],[4,10,16,15,15,15],[4,12,18,25,25,25],[4,15,21,37,37,37],[4,20,26,1,33,17],[4,26,32,1,17,9],[4,32,38,21,37,29],[4,38,44,15,47,31],[4,44,50,1,9,49]];function makeRange(e,t){const r=[];let i=0,n=e;for(;i<t;){n>52&&(n%=52);r.push(n);i++;n++}return r}export function findVersionTable(e,t){for(let r=0,i=e.length;r<i;r++){let i=e[r];const[n,o,s,a,c,l]=i,d=o*n,h=o*n-s-2;if(t(i={rows:o,cols:n,total:d,ecCws:s,nonEcCw:d-s,bits:8*(6*~~(h/5)+h%5)})){i.rowAssignment={left:makeRange(a,o),right:makeRange(c,o),center:l?makeRange(l,o):null};const e=[];let t=0;for(;t<=o;){const r=(a+t-1)%3;e.push(r);t++}i.cluster=e;return i}}return null}export function getVersionVariantColPrior(e){let t=1,r=null;for(;t<=4;){const i=findVersionTable(VersionTable,r=>r.cols===t&&r.nonEcCw>=e);r?i&&i.rows>r.rows&&(r=i):r=i;t++}return r}export function getVersionVariantRowPrior(e){return findVersionTable(VersionTable,t=>4===t.cols&&t.nonEcCw>=e)}export function getVersionVariant(e,t){return findVersionTable(VersionTable,r=>r.cols===t&&r.rows===e)}export function getVersionVariantByCol(e,t){return findVersionTable(VersionTable,r=>r.cols===e&&r.nonEcCw>=t)}export function getECCBVersionVariantByCol(e,t){return findVersionTable(VersionTable,r=>r.cols===e&&r.bits>=t)}export function getRowAddressPatterns(e,t,r){let i;switch(t){case"L":i=LRRowAddressPatterns[e.left[r]-1];break;case"R":i=LRRowAddressPatterns[e.right[r]-1];break;default:i=CRowAddressPatterns[e.center[r]-1]}return Utils.toZeroOnePattern(Utils.str2Array(i),!0)}export function getPattern(e,t){return CLUSTERS[e][t]}const testDigit=function(e){return/^\d$/.test(e)},abs=function(e){var t;if(void 0!==e){(t=new BigNumber(e)).sign=1;return t}},isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},isValidType=function(e){return["number"==typeof e,"string"==typeof e&&e.length>0,isArray(e)&&e.length>0,e instanceof BigNumber].some((function(e){return!0===e}))},errors={invalid:"Invalid Number","division by zero":"Invalid Number - Division By Zero"};export class BigNumber{constructor(e){var t;this.number=[];this.sign=1;this.rest=0;if(isValidType(e))if(isArray(e)){if(e.length&&"-"===e[0]||"+"===e[0]){this.sign="+"===e[0]?1:-1;e.shift(0)}for(t=e.length-1;t>=0;t--)if(!this.addDigit(e[t]))return}else{if("-"===(e=e.toString()).charAt(0)||"+"===e.charAt(0)){this.sign="+"===e.charAt(0)?1:-1;e=e.substring(1)}for(t=e.length-1;t>=0;t--)if(!this.addDigit(parseInt(e.charAt(t),10)))return}else this.number=errors.invalid}addDigit(e){if(!testDigit(e)){this.number=errors.invalid;return!1}this.number.push(e);return this}isEven(){return this.number[0]%2==0}_compare(e){var t,r;if(!isValidType(e))return null;t=new BigNumber(e);if(this.sign!==t.sign)return this.sign;if(this.number.length>t.number.length)return this.sign;if(this.number.length<t.number.length)return-1*this.sign;for(r=this.number.length-1;r>=0;r--){if(this.number[r]>t.number[r])return this.sign;if(this.number[r]<t.number[r])return-1*this.sign}return 0}gt(e){return this._compare(e)>0}gte(e){return this._compare(e)>=0}equals(e){return 0===this._compare(e)}lte(e){return this._compare(e)<=0}lt(e){return this._compare(e)<0}add(e){var t;if(void 0===e)return this;t=new BigNumber(e);if(this.sign!==t.sign){if(this.sign>0){t.sign=1;return this.minus(t)}this.sign=1;return t.minus(this)}this.number=BigNumber._add(this,t);return this}minus(e){var t;if(void 0===e)return this;t=new BigNumber(e);if(this.sign!==t.sign){this.number=BigNumber._add(this,t);return this}this.sign=this.lt(t)?-1:1;this.number=abs(this).lt(abs(t))?BigNumber._subtract(t,this):BigNumber._subtract(this,t);return this}static _add(e,t){var r,i=0,n=Math.max(e.number.length,t.number.length);for(r=0;r<n||i>0;r++){e.number[r]=(i+=(e.number[r]||0)+(t.number[r]||0))%10;i=Math.floor(i/10)}return e.number}static _subtract(e,t){var r,i=0,n=e.number.length;for(r=0;r<n;r++){e.number[r]-=(t.number[r]||0)+i;e.number[r]+=10*(i=e.number[r]<0?1:0)}r=0;n=e.number.length-1;for(;0===e.number[n-r]&&n-r>0;)r++;r>0&&e.number.splice(-r);return e.number}multiply(e){if(void 0===e)return this;var t,r,i=new BigNumber(e),n=0,o=[];if(this.isZero()||i.isZero())return new BigNumber(0);this.sign*=i.sign;for(t=0;t<this.number.length;t++)for(n=0,r=0;r<i.number.length||n>0;r++){o[t+r]=(n+=(o[t+r]||0)+this.number[t]*(i.number[r]||0))%10;n=Math.floor(n/10)}this.number=o;return this}divide(e){if(void 0===e)return this;var t,r,i=new BigNumber(e),n=[],o=new BigNumber(0);if(i.isZero()){this.number=errors["division by zero"];return this}if(this.isZero()){this.rest=new BigNumber(0);return this}this.sign*=i.sign;i.sign=1;if(1===i.number.length&&1===i.number[0]){this.rest=new BigNumber(0);return this}for(t=this.number.length-1;t>=0;t--){o.multiply(10);o.number[0]=this.number[t];n[t]=0;for(;i.lte(o);){n[t]++;o.minus(i)}}t=0;r=n.length-1;for(;0===n[r-t]&&r-t>0;)t++;t>0&&n.splice(-t);this.rest=o;this.number=n;return this}mod(e){return this.divide(e).rest}power(e){if(void 0!==e){var t,r;if(isValidType(e)){if((r=new BigNumber(e)).isZero())return new BigNumber(1);if("1"===r.val())return this;t=new BigNumber(this);this.number=[1];for(;r.gt(0);)if(r.isEven()){t.multiply(t);r.div(2)}else{this.multiply(t);r.subtract(1)}return this}this.number=errors.invalid}}abs(){this.sign=1;return this}isZero(){var e;for(e=0;e<this.number.length;e++)if(0!==this.number[e])return!1;return!0}toString(){var e,t="";if("string"==typeof this.number)return this.number;for(e=this.number.length-1;e>=0;e--)t+=this.number[e];return this.sign>0?t:"-"+t}}export class PDF417Base extends TwoDimensionalBarcode{validate(){const{text:e}=this.encodeConfig;if(!/^[\x00-\xFF]+$/.test(e))throw new InvalidTextException(e)}encodeNC(e){let t=e.text,r=[];Utils.sliceString(t,44,e=>{let t=new BigNumber("1"+e);const i=[];for(;;){let e=new BigNumber(t).mod(900);t.divide(new BigNumber(900));i.unshift(+e.toString());if(t.lt(1))break}r=r.concat(i)});r.unshift(MODE_NC);return r}encodeBC(e){let t=e.text,r=[];Utils.sliceString(t,6,e=>{if(6===e.length){let t=5,i=0;const n=[];Utils.sliceString(e,1,e=>{i+=e.charCodeAt(0)*Math.pow(256,t--)});let o=0,s=Math.floor(i/Math.pow(900,o))%900;do{n.unshift(s);s=Math.floor(i/Math.pow(900,++o))%900}while(s>0);for(;n.length<5;)n.unshift(0);r=r.concat(n)}else Utils.sliceString(e,1,e=>{r.push(e.charCodeAt(0))})});r.unshift(e.mode);return r}encodeTC(e){let t=[],r="al";e.subModes.forEach(e=>{r!==e.mode&&(t=t.concat(getTCSubModeValue(e.mode,r)));Utils.sliceString(e.text,1,r=>{t.push(getTCValue(r,e.mode))});"ps"!==e.mode&&"as"!==e.mode&&(r=e.mode)});let i=[MODE_TC];Utils.sliceArray(t,2,e=>{2===e.length?i.push(30*e[0]+e[1]):i.push(30*e[0]+29)});return i}encode(e){let t=[];e.forEach(e=>{switch(e.mode){case MODE_TC:t=t.concat(this.encodeTC(e));break;case MODE_BC:case MODE_BC6:case MODE_BC_SHIFT:t=t.concat(this.encodeBC(e));break;case MODE_NC:t=t.concat(this.encodeNC(e))}});return t}convertToShape(e,t){const{height:r,quietZone:i}=this.encodeConfig,n=r/e.length,o=e[0].reduce((e,t)=>e+=t.length,0)+i.right+i.left,s=e.length*n+i.top+i.bottom,a=new VerticalLayoutArea,c=new MatrixSymbolArea(o,s,n);c.setStyle({padding:{top:i.top,right:i.right,bottom:i.bottom,left:i.left}});a.append(c);if(!t){e.forEach(e=>{e.forEach(e=>{Utils.combineTruthy(e).forEach(e=>{0!==e?c.append(e,n):c.space()})})});this.shapes=a.toShapes()}this.mainArea=a;this.size=a.getSize()}adjustDesiredSize(){const{width:e}=this.size;let{desiredSize:t,containerWidth:r}=this.encodeConfig,i=r/e;t.forceRounding&&(i=(i=~~i)<1?1:i);this.applyDesiredSize(i)}getMainArea(){return this.mainArea}}PDF417Base.PAD=900;export class PDF417Encoder extends PDF417Base{constructor(e){e.merge(PDF417Encoder.DefaultConfig);super(e);let{errorCorrectionLevel:t,columns:r,rows:i,compact:n}=this.config,{text:o}=this.encodeConfig;this.text=o;this.ecl="auto"===t?t:+t;this.columns="auto"===r?r:+r;this.rows="auto"===i?i:+i;this.compact=!!n}validate(){super.validate();const{errorCorrectionLevel:e,rows:t,columns:r}=this.config;if(Utils.isNumberLike(e)&&(e<0||e>8))throw new InvalidOptionsException({errorCorrectionLevel:e},"ErrorCorrectionLevel is from 0 - 8.");if(Utils.isNumberLike(t)&&(t<3||t>90))throw new InvalidOptionsException({rows:t},"Rows is from 3 - 90.");if(Utils.isNumberLike(r)&&(r<1||r>30))throw new InvalidOptionsException({columns:r},"Columns is from 1 - 30.")}genEcc(){let{data:e,ecl:t,columns:r,rows:i}=this;e[0]===MODE_TC&&e.shift();"auto"===t&&(this.ecl=t=getAutoECL(e));let n=Math.pow(2,t+1),o=e.length+1+n;if("auto"===i&&"auto"===r){let{col:e,row:t}=getAutoRowAndCol(o);this.columns=r=e;this.rows=i=t}else if("auto"===i){if((i=Math.ceil(o/r))>90)throw new InvalidOptionsException({columns:r},"Columns is not large enough");i=i<3?3:i;this.rows=i}else if("auto"===r){if((r=Math.ceil(o/i))>30)throw new InvalidOptionsException({rows:i},"Rows is not large enough");this.columns=r}let s=r*i-n;e.unshift(s);if(e.length>PDF417Encoder.MAX_DATA_NUM||e.length>s)throw new TextTooLongException;for(;e.length<s;)e.push(PDF417Base.PAD);this.ecc=generateECC(e,this.ecl)}calculateData(){let e=compaction(this.text);this.data=this.encode(e);this.genEcc();let{data:t,ecc:r,columns:i,rows:n,ecl:o,compact:s}=this,a=t.concat(r),c=createModules(n,i);a.forEach((e,t)=>{let r=Math.floor(t/i),n=t%i;c[r][n]=getPattern_PDF417(r,e)});let l=[];c.forEach((e,t)=>{let r=getPattern_PDF417(t,getIndicator(t,n,o,i)),a=getPattern_PDF417(t,getIndicator(t,n,o,i,!0)),c=[PDF417Encoder.START,r.toString(2)];e.forEach(e=>{c.push(e.toString(2))});if(s)c.push(PDF417Encoder.COMPACT_END);else{c.push(a.toString(2));c.push(PDF417Encoder.END)}l.push(c)});return l}}PDF417Encoder.DefaultConfig={errorCorrectionLevel:"auto",columns:"auto",rows:"auto",compact:!1,height:60,quietZone:{top:2,left:2,right:2,bottom:2}};PDF417Encoder.START="11111111010101000";PDF417Encoder.END="111111101000101001";PDF417Encoder.COMPACT_END="1";PDF417Encoder.MAX_DATA_NUM=925;export class MicroPDF417Encoder extends PDF417Base{constructor(e){e.merge(MicroPDF417Encoder.DefaultConfig);super(e);let{symbolVersion:t,compactionMode:r,segmentIndex:i,fileID:n,structuredAppend:o,optionalFields:s}=this.config,{text:a}=this.encodeConfig;this.text=a;this.symbolVersion=t;this.versionMeta=null;this.compactionMode=r;this.structuredAppendEnabled=o;this.segmentIndex=i;this.fileID=n;this.optionalFields=s;this.segmentCount=0;this.structuredAppendCws=[]}validate(){super.validate();const{compactionMode:e,symbolVersion:t,segmentIndex:r,fileID:i}=this.config,{text:n}=this.encodeConfig;if(e===CompactionMode.Numeric&&!/^[\d]*$/.test(n))throw new InvalidOptionsException({compactionMode:e,text:n},"CompactionMode is numeric, but the text is not.");if(!CompactionMode.has(e))throw new InvalidOptionsException({compactionMode:e});if(!SymbolVersion.has(t))throw new InvalidOptionsException({symbolVersion:t});if(r<0||r>99998||i<0||i>899)throw new InvalidOptionsException({segmentIndex:r},"SegmentIndex should in range 0 - 99998")}_buildRow(e,t){const{columns:r,versionMeta:{rowAssignment:i,cluster:n}}=this;let o=getRowAddressPatterns(i,"L",t),s=getRowAddressPatterns(i,"R",t),a=[o];const c=n[t],l=e.map(e=>getPattern(c,e));switch(r){case 1:a.push(l[0].toString(2));break;case 2:a.push(l[0].toString(2));a.push(l[1].toString(2));break;case 3:a.push(l[0].toString(2));a.push(getRowAddressPatterns(i,"C",t));a.push(l[1].toString(2));a.push(l[2].toString(2));break;default:a.push(l[0].toString(2));a.push(l[1].toString(2));a.push(getRowAddressPatterns(i,"C",t));a.push(l[2].toString(2));a.push(l[3].toString(2))}return a=[...a,s,MicroPDF417Encoder.StopBar]}_buildStructAppend(){const{segmentIndex:e,segmentCount:t,fileID:r,optionalFields:i}=this;let n=[MicroPDF417Encoder.StructuredAppendMarker],o=this.encodeNC({text:Utils.strPadStart(e+"",5,"0")});o.shift();n.push(...o);n.push(r);if(i.segmentCount){n.push(MicroPDF417Encoder.StructuredAppendOptionalFieldsMarker);n.push(MicroPDF417Encoder.StructuredAppendOptionalFieldTags.SegmentCount);let e=this.encodeNC({text:Utils.strPadStart(t+"",5,"0")});e.shift();n.push(...e)}e===t-1&&n.push(MicroPDF417Encoder.StructuredAppendTerminator);return n}_splitStruct(e){let t,{symbolVersion:r,segmentIndex:i}=this;if(r===SymbolVersion.RowPriorAuto||r===SymbolVersion.ColumnPriorAuto)t=getVersionVariant(44,4);else{let[e,i]=r.split("*");t=getVersionVariant(+i,+e)}const n=this._buildStructAppend(),o=t.nonEcCw-n.length;if(o<0)throw new TextTooLongException;let s=Math.ceil(e.length/o);e.length-o*(s-1)===o&&s++;if(i>=s)throw new InvalidOptionsException({segmentIndex:i},`The max segment index is ${s-1}.`);if(s>99999)throw new TextTooLongException;let a;a=i===s-1?e.slice(o*i):e.slice(o*i,o*(i+1));this.segmentCount=s;return a}genEcc(){let e,{data:t,symbolVersion:r,structuredAppendCws:i}=this,n=t.length+i.length;if(r===SymbolVersion.RowPriorAuto)e=getVersionVariantRowPrior(n);else if(r===SymbolVersion.ColumnPriorAuto)e=getVersionVariantColPrior(n);else{let[t,i]=r.split("*");e=getVersionVariant(+i,+t)}const o=e.rows*e.cols-e.ecCws;if(o<n)throw new TextTooLongException;let s=o-n;for(;s>0;){t.push(PDF417Base.PAD);s--}this.versionMeta=e;this.ecc=generateECCForMicro([...t,...i],e.ecCws);this.rows=e.rows;this.columns=e.cols}calculateData(){let e=compaction(this.text,this.compactionMode),t=this.encode(e);if(this.structuredAppendEnabled){this.data=this._splitStruct(t);this.structuredAppendCws=this._buildStructAppend()}else this.data=t;this.genEcc();let{data:r,ecc:i,columns:n,rows:o,structuredAppendCws:s}=this,a=r.concat(s).concat(i),c=createModules(o,n);a.forEach((e,t)=>{let r=Math.floor(t/n),i=t%n;c[r][i]=e});let l=[];c.forEach((e,t)=>{l.push(this._buildRow(e,t))});return l}}MicroPDF417Encoder.DefaultConfig={symbolVersion:SymbolVersion.ColumnPriorAuto,compactionMode:CompactionMode.Auto,structuredAppend:!1,segmentIndex:0,fileID:0,height:60,quietZone:{top:1,left:1,right:1,bottom:1},optionalFields:{segmentCount:!0}};MicroPDF417Encoder.StopBar="1";MicroPDF417Encoder.StructuredAppendMarker=928;MicroPDF417Encoder.StructuredAppendOptionalFieldsMarker=923;MicroPDF417Encoder.StructuredAppendTerminator=922;MicroPDF417Encoder.StructuredAppendOptionalFieldTags={SegmentCount:1};Barcode.registerEncoder("PDF417",PDF417Encoder);Barcode.registerEncoder("MicroPDF417",MicroPDF417Encoder);export class CCA extends PDF417Base{constructor(e,t=4,r=1,i){const n={text:e,unitSize:r,quietZone:{top:0,right:0,left:0,bottom:0}};i&&(n.height=i);super(new Option(n));this.columns=t;let{text:o}=this.encodeConfig;this.text=o.replace(/\(|\)/g,"");this.bitBuffer=new BitBuffer;this._gpdEncodation=new GeneralPurposeDataEncodation(this.bitBuffer);const s=o.split(/\(|\)/);s.shift();let a=0;const c=[];for(;a<s.length;)c.push({ai:s[a++],data:s[a++]});this.aiGroup=c;this.autoHeight=!i}_buildRow(e,t){const{columns:r,versionMeta:{rowAssignment:i,cluster:n}}=this;let o=getRowAddressPatterns(i,"L",t),s=getRowAddressPatterns(i,"R",t),a=3===r?[]:[o];const c=n[t],l=e.map(e=>getPattern(c,e));switch(r){case 2:a.push(l[0].toString(2));a.push(l[1].toString(2));break;case 3:a.push(l[0].toString(2));a.push(getRowAddressPatterns(i,"C",t));a.push(l[1].toString(2));a.push(l[2].toString(2));break;default:a.push(l[0].toString(2));a.push(l[1].toString(2));a.push(getRowAddressPatterns(i,"C",t));a.push(l[2].toString(2));a.push(l[3].toString(2))}return a=[...a,s,MicroPDF417Encoder.StopBar]}_encode_10Date(e){const{bitBuffer:t,text:r}=this,i=384*+e.substr(0,2)+32*(+e.substr(2,2)-1)+ +e.substr(4,2);if(isNaN(i))throw new InvalidTextException(r,"The text doesn't contains a vaild product date or expire date");t.put(i,16)}_getMethod_11Mode(e){let t=0,r=0;for(let i=0,n=e.length;i<n;i++){const n=e[i];if("*,-./".indexOf(n)>-1)return"Alphanumeric";n>="A"&&n<="Z"&&t++;n>="0"&&n<="9"&&r++}return t>r?"Alpha":"Numeric"}_encode_11(){const{bitBuffer:e,aiGroup:t}=this;let r="";const i=t[0];e.putBits("11");const n=/^([1-9][0-9]?[0-9]?)?([A-Z][0-9A-Z*,-./]*)/.exec(i.data);let o=n[1]||"",s=n[2][0];const a=o+s;o=o?+o:0;const c=i.data.substr(a.length);switch(this._getMethod_11Mode(c)){case"Alphanumeric":e.putBits("0");break;case"Alpha":e.putBits("11");break;case"Numeric":e.putBits("10")}const l=t[1];if(l)switch(l.ai){case"21":r=c+Constants.FNC1+l.data;e.putBits("10");break;case"8004":r=c+Constants.FNC1+l.data;e.putBits("11");break;default:r=c+Constants.FNC1+l.ai+l.data;e.putBits("0")}else{r=c;e.putBits("0")}t.length>2&&Utils.loop(e=>{const i=t[e];r=r+Constants.FNC1+i.ai+i.data},{from:2,to:t.length-1});const d=getSupportedUppercaseAlphabetic(s);if(o<31&&d){e.putBit(o,5);e.putBits(d)}else{e.putBits("11111");e.put(o,10);e.put(s.charCodeAt(0)-65,5)}return r}_encode_10(){const{bitBuffer:e,aiGroup:t}=this;let r="";const i=t[0];e.putBits("10");if("11"===i.ai||"17"===i.ai){this._encode_10Date(i.data);e.putBit("17"===i.ai);if(t.length>1){if(t[1]&&"10"===t[1].ai){r=t[1].data;t.length>2&&Utils.loop(e=>{const i=t[e];r=r+Constants.FNC1+i.ai+i.data},{from:2,to:t.length-1})}else{r=Constants.FNC1;Utils.loop(e=>{const i=t[e];r=r+i.ai+i.data},{from:1,to:t.length-1})}}else r=Constants.FNC1}else if("10"===i.ai){e.putBits("11");r=i.data;t.length>1&&Utils.loop(e=>{const i=t[e];r=r+Constants.FNC1+i.ai+i.data},{from:1,to:t.length-1})}return r}_encode_0(){const{bitBuffer:e,aiGroup:t,text:r}=this;e.putBits("0");if(!t.length)return r;let i="";i=t[0].ai+t[0].data;t.length>1&&Utils.loop(e=>{const r=t[e];i=i+Constants.FNC1+r.ai+r.data},{from:1,to:t.length-1});return i}_encodeMethod(){const{text:e,aiGroup:t}=this,r=t[0];if(r)if("10"===r.ai||"11"===r.ai||"17"===r.ai)this.method="10";else if("90"===r.ai){const t=/^90(?:[1-9][0-9]?[0-9]?)?[A-Z]/.test(e);this.method=t?"11":"0"}else this.method="0";else this.method="0"}getVersionVariant(){const{bitBuffer:e,columns:t}=this;this.versionMeta=getVersionVariant_CCA(t,e.length)}_encode(){this._encodeMethod();const{method:e,columns:t}=this;let r="";switch(e){case"10":r=this._encode_10();break;case"11":r=this._encode_11();break;case"0":r=this._encode_0()}this._gpdEncodation.encodeGeneralData(r,t);this.getVersionVariant();if(!this.versionMeta)throw new TextTooLongException;this._gpdEncodation.padTo(this.versionMeta.bits)}genEcc(){const{bitBuffer:e,versionMeta:t}=this,r=[];encode928(e.getGroupedBits(16),r,e.length);this.data=r;this.ecc=generateECCForMicro(r,t.ecCws);this.rows=t.rows;this.autoHeight&&(this.encodeConfig.height=2*t.rows)}calculateData(){this._encode();this.genEcc();let{data:e,ecc:t,columns:r,rows:i}=this,n=e.concat(t),o=createModules(i,r);n.forEach((e,t)=>{let i=Math.floor(t/r),n=t%r;o[i][n]=e});let s=[];o.forEach((e,t)=>{s.push(this._buildRow(e,t))});return s}}class CCBInnerEncoder extends CCA{getVersionVariant(){const{bitBuffer:e,columns:t}=this;this.versionMeta=getECCBVersionVariantByCol(t,e.length)}getBytes(){this._encode();return this.bitBuffer.getGroupedBits(8)}}export class CCB extends MicroPDF417Encoder{constructor(e,t=4,r=1,i){const n={text:e,unitSize:r,compactionMode:"byte",quietZone:{top:0,right:0,left:0,bottom:0}};i&&(n.height=i);super(new Option(n));this.columns=t;const o=new CCBInnerEncoder(e,t,r,i);this.bytes=o.getBytes();this.autoHeight=!i}genEcc(){let{data:e,columns:t}=this,r=e.length;const i=getVersionVariantByCol(t,r),n=i.rows*i.cols-i.ecCws;if(n<r)throw new TextTooLongException;let o=n-r;for(;o>0;){e.push(PDF417Base.PAD);o--}this.versionMeta=i;this.ecc=generateECCForMicro(e,i.ecCws);this.rows=i.rows;this.columns=i.cols;this.autoHeight&&(this.encodeConfig.height=2*i.rows)}encode(){const{bytes:e}=this;let t=[];Utils.sliceArray(e,6,e=>{if(6===e.length){let r=5,i=0;const n=[];e.forEach(e=>{i+=e*Math.pow(256,r--)});let o=0,s=Math.floor(i/Math.pow(900,o))%900;do{n.unshift(s);s=Math.floor(i/Math.pow(900,++o))%900}while(s>0);for(;n.length<5;)n.unshift(0);t=t.concat(n)}else e.forEach(e=>{t.push(e)})});t.unshift(e.length%6==0?MODE_BC6:MODE_BC);t.unshift(920);return t}calculateData(){this.data=this.encode();this.genEcc();let{data:e,ecc:t,columns:r,rows:i}=this,n=e.concat(t),o=createModules(i,r);n.forEach((e,t)=>{let i=Math.floor(t/r),n=t%r;o[i][n]=e});let s=[];o.forEach((e,t)=>{s.push(this._buildRow(e,t))});return s}}const LinkageVersion={CCA:"CCA",CCB:"CCB"};export class GS1DataBarBase extends OneDimensionalBarcode{constructor(e){e.merge(GS1DataBarBase.DefaultConfig);super(e);let{config:{linkage:t,hideLinkageText:r,hideAIText:i}}=this;this.linkageText=t;this.linkage=!!t;this.hideLinkageText=r;this.hideAIText=i}static combins(e,t){let r,i,n,o,s;if(e-t>t){o=t;n=e-t}else{o=e-t;n=t}s=1;i=1;for(r=e;r>n;r--){s*=r;if(i<=o){s/=i;i++}}for(;i<=o;i++)s/=i;return s}static getRSSwidths(e,t,r,i,n){let o,s,a,c,l,d=0;const h=[];for(o=0;o<r-1;o++){for(s=1,d|=1<<o;;s++,d&=~(1<<o)){c=GS1DataBarBase.combins(t-s-1,r-o-2);!n&&0==d&&t-s-(r-o-1)>=r-o-1&&(c-=GS1DataBarBase.combins(t-s-(r-o),r-o-2));if(r-o-1>1){l=0;for(a=t-s-(r-o-2);a>i;a--)l+=GS1DataBarBase.combins(t-s-a-1,r-o-3);c-=l*(r-1-o)}else t-s>i&&c--;if((e-=c)<0)break}e+=c;t-=s;h[o]=s}h[o]=t;return h}static getRSSvalue(e,t,r,i){let n,o,s,a,c,l,d,h=0,u=0;for(n=a=0;a<t;a++)n+=e[a];for(o=0;o<t-1;o++){for(s=1,u|=1<<o;s<e[o];s++,u&=~(1<<o))l=GS1DataBarBase.combins(n-s-1,t-o-2);!i&&0==u&&n-s-(t-o-1)>=t-o-1&&(l-=GS1DataBarBase.combins(n-s-(t-o),t-o-2));if(t-o-1>1){d=0;for(c=n-s-(t-o-2);c>r;c--)d+=GS1DataBarBase.combins(n-s-c-1,t-o-3);l-=d*(t-1-o)}else n-s>r&&(h+=--l);n-=s}return h}static getGroup(e,t){for(let r=0,i=e.length;r<i;r++){const i=e[r];if(t>=i[0]&&t<=i[1])return{range:{from:i[0],to:i[1]},preTotal:i[2],oddModules:i[3],evenModules:i[4],oddElements:i[5],evenElements:i[6],oddTotal:i[7],evenTotal:i[8]}}}static getChecksum(e,t){return e.reduce((e,r,i)=>e+=r*t[i],0)}static makeComplementPattern(e){let t="";Utils.loop(r=>{t+="1"===e[r]?"0":"1"},e.length);return t}static makeAlternatePattern(e,t){let r="",i=!t;Utils.loop(()=>{r+=i?"1":"0";i=!i},e);return r}static makeComplexPattern(e){let t="",r="",i=!1;Utils.loop(n=>{if("0"===e[n]){if(i){t+=Utils.strRepeat("0",r.length);r=""}r+="0";i=!1}else{if(!i){t+=GS1DataBarBase.makeAlternatePattern(r.length);r=""}r+="1";i=!0}},e.length);return t+=i?Utils.strRepeat("0",r.length):GS1DataBarBase.makeAlternatePattern(r.length)}convertToShape(e,t){this.linkage?this._convertToShapeForLinkage(e,t):super.convertToShape(e,t)}getLinkageOffset(e,t){}getLinkageSepPattern(e){}_convertToShapeForLinkage(e,t){let{label:r,encodeConfig:{quietZone:i,isLabelBottom:n,height:o,showLabel:s,fontSizeInUnit:a},style:{textAlign:c,unitValue:l},linkageText:d,config:{linkageVersion:h,linkageHeight:u},linkageColumnCnt:p}=this;const g=h===LinkageVersion.CCA?new CCA(d,p,l,u):new CCB(d,p,l,u);g.toSymbol();const m=g.getMainArea(),f=this.getLinkageSepPattern(e),C=m.getSize();let b=0;r&&s&&(b=a);o=o-C.height-1;const x=e.length,S=o,B=this.getLinkageOffset(e,C.width),E=new VerticalLayoutArea,D=new SymbolArea(x,S),w=new SymbolArea(x,1);E.setStyle({padding:{top:i.top,right:i.right,bottom:i.bottom,left:i.left}});D.setStyle({margin:{left:B.symbolOffset}});w.setStyle({margin:{left:B.symbolOffset}});m.setStyle({margin:{left:B.linkageOffset}});const _=D.getSize(),P=new LabelArea(_.width,b,c);if(n){E.append(m);E.append(w);E.append(D);E.append(P)}else{E.append(P);E.append(m);E.append(w);E.append(D)}if(!t){w.fromPattern(f);D.fromPattern(e);P.append({text:r});this.shapes=E.toShapes()}this.size=E.getSize()}}GS1DataBarBase.DefaultConfig={linkage:"",linkageVersion:"CCA",hideLinkageText:!1,hideAIText:!1};GS1DataBarBase.LinkageVersion=LinkageVersion;export class Expanded extends GS1DataBarBase{constructor(e){super(e);let{encodeConfig:{text:t},linkage:r,hideLinkageText:i,linkageText:n,hideAIText:o}=this;this.text=t.replace(/\(|\)/g,"");this.label=t;r&&!i&&(this.label+=n);o&&(this.label=this.label.replace(/\(\w*\)/g,""));this._bitBuffer=new BitBuffer;this._gpdEncodation=new GS1GeneralPurposeDataEncodation(this._bitBuffer);this.finderPatternSeq=null;this.symbolContentSize=null;this.linkageColumnCnt=4}static getFinderPatternSeq(e){const t=~~((e-3)/2);return Expanded.FinderPatternSeq[t]}static isVersion1Finder(e){return["A1","B1","C1","D1","E1","F1"].indexOf(e)>-1}_getSubsetWidth(e,t=!1){const r=GS1DataBarBase.getGroup(Expanded.Group,e),i=~~((e-r.preTotal)/r.evenTotal),n=(e-r.preTotal)%r.evenTotal,o=GS1DataBarBase.getRSSwidths(i,r.oddModules,4,r.oddElements,!1),s=GS1DataBarBase.getRSSwidths(n,r.evenModules,4,r.evenElements,!0),a=[];Utils.loop(e=>{a.push(o[e]);a.push(s[e])},4);return t?a:a.reverse()}_getChecksum(e){let t=0;e.forEach((e,r)=>{let i,n;if(0===r){i=this.finderPatternSeq[0];n=!1}else{const e=r-1;i=this.finderPatternSeq[1+~~(e/2)];n=Utils.isEven(e)}let o=Expanded.ChecksumWeight[i][n?"left":"right"];o=n?o:o.concat().reverse();t+=GS1DataBarBase.getChecksum(e,o)});return t=t%211+211*(this.symbolContentSize-4)}_getContent(e){const t=[];e.forEach((e,r)=>{if(Utils.isEven(r)){t.push(...e);const i=this.finderPatternSeq[~~(r/2)];t.push(...Expanded.FinderPattern[i])}else t.push(...e)});return t}_addLength(e){const{_bitBuffer:t}=this,r=1+~~((t.length+11)/12);t.putBitAt(!Utils.isEven(r),1+e);t.putBitAt(r>14,2+e)}_encode(){const{text:e}=this;Expanded.MethodReg_0100.test(e)?this._encode_0100():Expanded.MethodReg_0101.test(e)?this._encode_0101():Expanded.MethodReg_0111000_0111111.test(e)?this._encode_0111000_0111111():Expanded.MethodReg_01100.test(e)?this._encode_01100():Expanded.MethodReg_01101.test(e)?this._encode_01101():Expanded.MethodReg_1.test(e)?this._encode_1():this._encode_00()}_encode_1(){const{text:e,_bitBuffer:t,_gpdEncodation:r}=this,i=Expanded.MethodReg_1.exec(e),n=i[2];t.putBits("1");t.putBits("00");t.put(+n[0],4);Utils.sliceString(n.substr(1),3,e=>{t.put(+e,10)});r.encode(i[4]);this._addLength(1)}_encode_0100(){const{text:e,_bitBuffer:t}=this,r=Expanded.MethodReg_0100.exec(e),i=r[2],n=+r[4];if(n>32767)throw new InvalidTextException(e,"With method 0100, the weight should not larger than 32767.");t.putBits("0100");Utils.sliceString(i,3,e=>{t.put(+e,10)});t.put(n,15)}_encode_0101(){const{text:e,_bitBuffer:t}=this,r=Expanded.MethodReg_0101.exec(e),i=r[2],n="2"==r[4][0],o=+r[5];if(n&&o>999||!n&&o>22767)throw new InvalidTextException(e,`With method 0101, the weight should not larger than ${o}.`);t.putBits("0101");Utils.sliceString(i,3,e=>{t.put(+e,10)});t.put(n?o:o+1e4,15)}_encode_0111000_0111111(){const{text:e,_bitBuffer:t}=this,r=Expanded.MethodReg_0111000_0111111.exec(e),i=r[2];let n=+r[6][1];"1"===r[4][1]&&n--;n+=56;t.put(n,7);Utils.sliceString(i,3,e=>{t.put(+e,10)});t.put(+(r[4][3]+r[5]),20);const o=/^(\d{2})(\d{2})(\d{2})$/.exec(r[7]);t.put(384*+o[1]+32*(+o[2]-1)+ +o[3],16)}_encode_01100(){const{text:e,_bitBuffer:t,_gpdEncodation:r}=this,i=Expanded.MethodReg_01100.exec(e),n=i[2];t.putBits("01100");t.putBits("00");Utils.sliceString(n,3,e=>{t.put(+e,10)});t.put(+i[4],2);r.encode(i[5]);this._addLength(5)}_encode_01101(){const{text:e,_bitBuffer:t,_gpdEncodation:r}=this,i=Expanded.MethodReg_01101.exec(e),n=i[2];t.putBits("01101");t.putBits("00");Utils.sliceString(n,3,e=>{t.put(+e,10)});t.put(+i[4],2);t.put(+i[5],10);r.encode(i[6]);this._addLength(5)}_encode_00(){const{text:e,_bitBuffer:t,_gpdEncodation:r}=this;t.putBits("00");t.putBits("00");r.encode(e);this._addLength(2)}makeDataWidth(){const{_bitBuffer:e,linkage:t}=this;e.putBit(t);this._encode();const r=1+~~((e.length+11)/12),i=e.getGroupedBits(12).map((e,t)=>this._getSubsetWidth(e,!Utils.isEven(t)));this.finderPatternSeq=Expanded.getFinderPatternSeq(r);this.symbolContentSize=r;const n=this._getChecksum(i),o=this._getSubsetWidth(n,!0);i.unshift(o);return this._getContent(i)}calculateData(){let e=this.makeDataWidth();e=[...Expanded.Guard,...e,...Expanded.Guard];return Utils.toZeroOnePattern(e)}getLinkageSepPattern(e){const t=e.substr(2,e.length-4);let r="";Utils.sliceString(t,49,(e,t)=>{const i=this.finderPatternSeq[t],n=Expanded.FinderPattern[i];r+=GS1DataBarBase.makeComplementPattern(e.substr(0,17));if(Expanded.isVersion1Finder(i)){const t=n[0]+n[1]+n[2],i=n[3]+n[4];r+=GS1DataBarBase.makeComplexPattern(e.substr(17,t));r+=GS1DataBarBase.makeComplementPattern(e.substr(17+t,i))}else{const t=n[0]+n[1],i=n[2]+n[3]+n[4];r+=GS1DataBarBase.makeComplementPattern(e.substr(17,t));r+=GS1DataBarBase.makeComplexPattern(e.substr(17+t,i))}49===e.length&&(r+=GS1DataBarBase.makeComplementPattern(e.substr(32,17)))});return"0000"+r.substr(2,r.length-4)+"0000"}getLinkageOffset(e){let t=1;for(;"1"===e[t];)t++;return{linkageOffset:t,symbolOffset:0}}}Expanded.Guard=[1,1];Expanded.Group=[[0,347,0,12,5,7,2,87,4],[348,1387,348,10,7,5,4,52,20],[1388,2947,1388,8,9,4,5,30,52],[2948,3987,2948,6,11,3,6,10,104],[3988,4191,3988,4,13,1,8,1,204]];Expanded.FinderPattern={A1:[1,8,4,1,1],B1:[3,6,4,1,1],C1:[3,4,6,1,1],D1:[3,2,8,1,1],E1:[2,6,5,1,1],F1:[2,2,9,1,1],A2:[1,1,4,8,1],B2:[1,1,4,6,3],C2:[1,1,6,4,3],D2:[1,1,8,2,3],E2:[1,1,5,6,2],F2:[1,1,9,2,2]};Expanded.ChecksumWeight={A1:{right:[1,3,9,27,81,32,96,77]},A2:{left:[20,60,180,118,143,7,21,63],right:[189,145,13,39,117,140,209,205]},B1:{left:[193,157,49,147,19,57,171,91],right:[62,186,136,197,169,85,44,132]},B2:{left:[185,133,188,142,4,12,36,108],right:[113,128,173,97,80,29,87,50]},C1:{left:[150,28,84,41,123,158,52,156],right:[46,138,203,187,139,206,196,166]},C2:{left:[76,17,51,153,37,111,122,155],right:[43,129,176,106,107,110,119,146]},D1:{left:[16,48,144,10,30,90,59,177],right:[109,116,137,200,178,112,125,164]},D2:{left:[70,210,208,202,184,130,179,115],right:[134,191,151,31,93,68,204,190]},E1:{left:[148,22,66,198,172,94,71,2],right:[6,18,54,162,64,192,154,40]},E2:{left:[120,149,25,75,14,42,126,167],right:[79,26,78,23,69,207,199,175]},F1:{left:[103,98,83,38,114,131,182,124],right:[161,61,183,127,170,88,53,159]},F2:{left:[55,165,73,8,24,72,5,15],right:[45,135,194,160,58,174,100,89]}};Expanded.FinderPatternSeq=[["A1","A2"],["A1","B2","B1"],["A1","C2","B1","D2"],["A1","E2","B1","D2","C1"],["A1","E2","B1","D2","D1","F2"],["A1","E2","B1","D2","E1","F2","F1"],["A1","A2","B1","B2","C1","C2","D1","D2"],["A1","A2","B1","B2","C1","C2","D1","E2","E1"],["A1","A2","B1","B2","C1","C2","D1","E2","F1","F2"],["A1","A2","B1","B2","C1","C2","D1","E2","E1","F2","F1"]];Expanded.MethodReg_0100=/^([01])19([0-9]{12})(.)3103([0-9]{6})$/;Expanded.MethodReg_0101=/^([01])19([0-9]{12})(.)320([23])0([0-9]{5})$/;Expanded.MethodReg_0111000_0111111=/^([01])19([0-9]{12})(.)(3[12]0[0-9])0([0-9]{5})(1[1357])([0-9]{6})$/;Expanded.MethodReg_01100=/^([01])19([0-9]{12})(.)392([0-3])(.+)$/;Expanded.MethodReg_01101=/^([01])19([0-9]{12})(.)393([0-3])([0-9]{3})(.+)$/;Expanded.MethodReg_1=/([01])1([0-9]{13})(.)(.*)$/;export class GS1DataBarFirstType extends GS1DataBarBase{constructor(e){super(e);let{encodeConfig:{text:t,hideExtraChecksum:r},hideLinkageText:i,linkageText:n,linkage:o,hideAIText:s}=this;this.label=t;if(t.length<18){t+=this._getCheckDigit(t);r||(this.label=t)}o&&!i&&(this.label+=n);s&&(this.label=this.label.replace(/\(\w*\)/g,""));this.text=t;this.linkageColumnCnt=4}validate(){const{text:e}=this.encodeConfig;if(!/^\(01\)(\d{13}|\d{14})$/.test(e))throw new InvalidTextException(e,"Text should be numbers. The length should be 17 or 18.");if(18===e.length){if(this._getCheckDigit(e)!=e[17])throw new InvalidTextException(e,"Check digit is invalid.")}}_getCheckDigit(e){let t=Utils.str2Array(e.substr(4,13)).reduce((e,t,r)=>{t=+t;return e+=Utils.isOdd(r)?t:3*t},0)%10;return 0===t?0:10-t}_getSubsetWidth(e,t){const r=t?GS1DataBarFirstType.Group.InSide:GS1DataBarFirstType.Group.OutSide,i=GS1DataBarBase.getGroup(r,e),n=t?i.oddTotal:i.evenTotal;let o,s;if(t){s=~~((e-i.preTotal)/n);o=(e-i.preTotal)%n}else{o=~~((e-i.preTotal)/n);s=(e-i.preTotal)%n}const a=GS1DataBarBase.getRSSwidths(o,i.oddModules,4,i.oddElements,!t),c=GS1DataBarBase.getRSSwidths(s,i.evenModules,4,i.evenElements,t),l=[];Utils.loop(e=>{l.push(a[e]);l.push(c[e])},4);return l}_getFinderPatternWidth(e){const t=GS1DataBarFirstType.FinderPattern[e];let r="";Utils.loop(e=>{r+=t[e]},5);return Utils.str2Array(r)}_getChecksum({width1:e,width2:t,width3:r,width4:i}){let n=0;n+=GS1DataBarBase.getChecksum(e,GS1DataBarFirstType.ChecksumWeight[0]);n+=GS1DataBarBase.getChecksum(t,GS1DataBarFirstType.ChecksumWeight[1]);n+=GS1DataBarBase.getChecksum(r,GS1DataBarFirstType.ChecksumWeight[2]);n+=GS1DataBarBase.getChecksum(i,GS1DataBarFirstType.ChecksumWeight[3]);(n%=79)>=8&&n++;n>=72&&n++;return n}_getSymbolCharacterWidth(e){const t=~~(e/4537077),r=e%4537077,i=~~(t/1597),n=t%1597,o=~~(r/1597),s=r%1597;return{width1:this._getSubsetWidth(i,!1),width2:this._getSubsetWidth(n,!0),width3:this._getSubsetWidth(o,!1),width4:this._getSubsetWidth(s,!0)}}getSymbolStructure(){const{text:e,linkage:t}=this,r=e.substr(4,13),i=t?+r+1e13:+r,n=this._getSymbolCharacterWidth(i),o=this._getChecksum(n),s=~~(o/9),a=o%9,c=this._getFinderPatternWidth(s),l=this._getFinderPatternWidth(a),{width1:d,width2:h,width3:u,width4:p}=n;return{width1:d,width2:h,width3:u,width4:p,leftFinderPattern:c,rightFinderPattern:l}}getLinkageSepPattern(e){let t="";t+=GS1DataBarBase.makeComplementPattern(e.substr(2,16));t+=GS1DataBarBase.makeComplexPattern(e.substr(18,13));t+=GS1DataBarBase.makeComplementPattern(e.substr(31,34));t+=GS1DataBarBase.makeComplexPattern(e.substr(65,13));return"0000"+(t+=GS1DataBarBase.makeComplementPattern(e.substr(78,16))).substr(2,t.length-2)+"0000"}calculateData(){const{width1:e,width2:t,width3:r,width4:i,leftFinderPattern:n,rightFinderPattern:o}=this.getSymbolStructure(),s=[...e,...n,...t.reverse(),...i,...o.reverse(),...r.reverse()];return GS1DataBarFirstType.LeftGuard+Utils.toZeroOnePattern(s)+GS1DataBarFirstType.RightGuard}}GS1DataBarFirstType.LeftGuard="01";GS1DataBarFirstType.RightGuard="01";GS1DataBarFirstType.Group={OutSide:[[0,160,0,12,4,8,1,161,1],[161,960,161,10,6,6,3,80,10],[961,2014,961,8,8,4,5,31,34],[2015,2714,2015,6,10,3,6,10,70],[2715,2840,2715,4,12,1,8,1,126]],InSide:[[0,335,0,5,10,2,7,4,84],[336,1035,336,7,8,4,5,20,35],[1036,1515,1036,9,6,6,3,48,10],[1516,1596,1516,11,4,8,1,81,1]]};GS1DataBarFirstType.ChecksumWeight=[[1,3,9,27,2,6,18,54],[4,12,36,29,8,24,72,58],[16,48,65,37,32,17,51,74],[64,34,23,69,49,68,46,59]];GS1DataBarFirstType.FinderPattern=[[3,8,2,1,1],[3,5,5,1,1],[3,3,7,1,1],[3,1,9,1,1],[2,7,4,1,1],[2,5,6,1,1],[2,3,8,1,1],[1,5,7,1,1],[1,3,9,1,1]];export class Limited extends GS1DataBarFirstType{constructor(){super(...arguments);this.linkageColumnCnt=3}_getSubsetWidth(e){const t=GS1DataBarBase.getGroup(Limited.Group,e),r=~~((e-t.preTotal)/t.evenTotal),i=(e-t.preTotal)%t.evenTotal,n=GS1DataBarBase.getRSSwidths(r,t.oddModules,7,t.oddElements,!0),o=GS1DataBarBase.getRSSwidths(i,t.evenModules,7,t.evenElements,!1),s=[];Utils.loop(e=>{s.push(n[e]);s.push(o[e])},7);return s}_getChecksum({leftWidth:e,rightWidth:t}){let r=0;r+=GS1DataBarBase.getChecksum(e,Limited.ChecksumWeight[0]);r+=GS1DataBarBase.getChecksum(t,Limited.ChecksumWeight[1]);return r%=89}_getSymbolCharacterWidth(e){const t=~~(e/2013571),r=e%2013571;return{leftWidth:this._getSubsetWidth(t),rightWidth:this._getSubsetWidth(r)}}getLinkageSepPattern(e){e=e.substr(0,e.length-5);const t=GS1DataBarBase.makeComplementPattern(e);return"0000"+t.substr(4,t.length-8)+"0000"}getSymbolStructure(){const{text:e,linkage:t}=this,r=e.substr(4,13),i=t?+r+2015133531096:+r,n=this._getSymbolCharacterWidth(i),o=this._getChecksum(n),s=Limited.ChecksumWidth[o],{leftWidth:a,rightWidth:c}=n;return{leftWidth:a,rightWidth:c,checksumWidth:s}}getLinkageOffset(e,t){let r=e.length-1-5;for(;"1"===e[r];)r--;return{linkageOffset:0,symbolOffset:t-r-1}}calculateData(){const{leftWidth:e,rightWidth:t,checksumWidth:r}=this.getSymbolStructure(),i=[...e,...r,...t];return Limited.LeftGuard+Utils.toZeroOnePattern(i)+Limited.RightGuard}}Limited.LeftGuard="01";Limited.RightGuard="0100000";Limited.Group=[[0,183063,0,17,9,6,3,6538,28],[183064,820063,183064,13,13,5,4,875,728],[820064,1000775,820064,9,17,3,6,28,6454],[1000776,1491020,1000776,15,11,5,4,2415,203],[1491021,1979844,1491021,11,15,4,5,203,2408],[1979845,1996938,1979845,19,7,8,1,17094,1],[1996939,2013570,1996939,7,19,1,8,1,16632]];Limited.ChecksumWeight=[[1,3,9,27,81,65,17,51,64,14,42,37,22,66],[20,60,2,6,18,54,73,41,34,13,39,28,84,74]];Limited.ChecksumWidth=[[1,1,1,1,1,1,1,1,1,1,3,3,1,1],[1,1,1,1,1,1,1,1,1,2,3,2,1,1],[1,1,1,1,1,1,1,1,1,3,3,1,1,1],[1,1,1,1,1,1,1,2,1,1,3,2,1,1],[1,1,1,1,1,1,1,2,1,2,3,1,1,1],[1,1,1,1,1,1,1,3,1,1,3,1,1,1],[1,1,1,1,1,2,1,1,1,1,3,2,1,1],[1,1,1,1,1,2,1,1,1,2,3,1,1,1],[1,1,1,1,1,2,1,2,1,1,3,1,1,1],[1,1,1,1,1,3,1,1,1,1,3,1,1,1],[1,1,1,2,1,1,1,1,1,1,3,2,1,1],[1,1,1,2,1,1,1,1,1,2,3,1,1,1],[1,1,1,2,1,1,1,2,1,1,3,1,1,1],[1,1,1,2,1,2,1,1,1,1,3,1,1,1],[1,1,1,3,1,1,1,1,1,1,3,1,1,1],[1,2,1,1,1,1,1,1,1,1,3,2,1,1],[1,2,1,1,1,1,1,1,1,2,3,1,1,1],[1,2,1,1,1,1,1,2,1,1,3,1,1,1],[1,2,1,1,1,2,1,1,1,1,3,1,1,1],[1,2,1,2,1,1,1,1,1,1,3,1,1,1],[1,3,1,1,1,1,1,1,1,1,3,1,1,1],[1,1,1,1,1,1,1,1,2,1,2,3,1,1],[1,1,1,1,1,1,1,1,2,2,2,2,1,1],[1,1,1,1,1,1,1,1,2,3,2,1,1,1],[1,1,1,1,1,1,1,2,2,1,2,2,1,1],[1,1,1,1,1,1,1,2,2,2,2,1,1,1],[1,1,1,1,1,1,1,3,2,1,2,1,1,1],[1,1,1,1,1,2,1,1,2,1,2,2,1,1],[1,1,1,1,1,2,1,1,2,2,2,1,1,1],[1,1,1,1,1,2,1,2,2,1,2,1,1,1],[1,1,1,1,1,3,1,1,2,1,2,1,1,1],[1,1,1,2,1,1,1,1,2,1,2,2,1,1],[1,1,1,2,1,1,1,1,2,2,2,1,1,1],[1,1,1,2,1,1,1,2,2,1,2,1,1,1],[1,1,1,2,1,2,1,1,2,1,2,1,1,1],[1,1,1,3,1,1,1,1,2,1,2,1,1,1],[1,2,1,1,1,1,1,1,2,1,2,2,1,1],[1,2,1,1,1,1,1,1,2,2,2,1,1,1],[1,2,1,1,1,1,1,2,2,1,2,1,1,1],[1,2,1,1,1,2,1,1,2,1,2,1,1,1],[1,2,1,2,1,1,1,1,2,1,2,1,1,1],[1,3,1,1,1,1,1,1,2,1,2,1,1,1],[1,1,1,1,1,1,1,1,3,1,1,3,1,1],[1,1,1,1,1,1,1,1,3,2,1,2,1,1],[1,1,1,1,1,1,1,2,3,1,1,2,1,1],[1,1,1,2,1,1,1,1,3,1,1,2,1,1],[1,2,1,1,1,1,1,1,3,1,1,2,1,1],[1,1,1,1,1,1,2,1,1,1,2,3,1,1],[1,1,1,1,1,1,2,1,1,2,2,2,1,1],[1,1,1,1,1,1,2,1,1,3,2,1,1,1],[1,1,1,1,1,1,2,2,1,1,2,2,1,1],[1,1,1,2,1,1,2,1,1,1,2,2,1,1],[1,1,1,2,1,1,2,1,1,2,2,1,1,1],[1,1,1,2,1,1,2,2,1,1,2,1,1,1],[1,1,1,2,1,2,2,1,1,1,2,1,1,1],[1,1,1,3,1,1,2,1,1,1,2,1,1,1],[1,2,1,1,1,1,2,1,1,1,2,2,1,1],[1,2,1,1,1,1,2,1,1,2,2,1,1,1],[1,2,1,2,1,1,2,1,1,1,2,1,1,1],[1,1,1,1,2,1,1,1,1,1,2,3,1,1],[1,1,1,1,2,1,1,1,1,2,2,2,1,1],[1,1,1,1,2,1,1,1,1,3,2,1,1,1],[1,1,1,1,2,1,1,2,1,1,2,2,1,1],[1,1,1,1,2,1,1,2,1,2,2,1,1,1],[1,1,1,1,2,2,1,1,1,1,2,2,1,1],[1,2,1,1,2,1,1,1,1,1,2,2,1,1],[1,2,1,1,2,1,1,1,1,2,2,1,1,1],[1,2,1,1,2,1,1,2,1,1,2,1,1,1],[1,2,1,1,2,2,1,1,1,1,2,1,1,1],[1,2,1,2,2,1,1,1,1,1,2,1,1,1],[1,3,1,1,2,1,1,1,1,1,2,1,1,1],[1,1,2,1,1,1,1,1,1,1,2,3,1,1],[1,1,2,1,1,1,1,1,1,2,2,2,1,1],[1,1,2,1,1,1,1,1,1,3,2,1,1,1],[1,1,2,1,1,1,1,2,1,1,2,2,1,1],[1,1,2,1,1,1,1,2,1,2,2,1,1,1],[1,1,2,1,1,1,1,3,1,1,2,1,1,1],[1,1,2,1,1,2,1,1,1,1,2,2,1,1],[1,1,2,1,1,2,1,1,1,2,2,1,1,1],[1,1,2,2,1,1,1,1,1,1,2,2,1,1],[2,1,1,1,1,1,1,1,1,2,2,2,1,1],[2,1,1,1,1,1,1,1,1,3,2,1,1,1],[2,1,1,1,1,1,1,2,1,1,2,2,1,1],[2,1,1,1,1,1,1,2,1,2,2,1,1,1],[2,1,1,1,1,1,1,3,1,1,2,1,1,1],[2,1,1,1,1,2,1,1,1,2,2,1,1,1],[2,1,1,1,1,2,1,2,1,1,2,1,1,1],[2,1,1,2,1,1,1,1,1,2,2,1,1,1],[2,1,1,1,1,1,1,1,2,2,1,2,1,1]];export class StackedBase extends GS1DataBarFirstType{constructor(e){e.merge(StackedBase.DefaultConfig);super(e);this.linkageColumnCnt=2}calculateData(){const{width1:e,width2:t,width3:r,width4:i,leftFinderPattern:n,rightFinderPattern:o}=this.getSymbolStructure();let s=[...e,...n,...t.reverse()],a=[...i,...o.reverse(),...r.reverse()];return{topRow:s=GS1DataBarFirstType.LeftGuard+Utils.toZeroOnePattern(s)+StackedBase.RightGuard,bottomRow:a=StackedBase.LeftGuard+Utils.toZeroOnePattern(a,!0)+GS1DataBarFirstType.RightGuard,separators:this.getSeparator(s,a)}}getLinkageSepPattern(e){let t="";t+=GS1DataBarBase.makeComplementPattern(e.substr(2,16));t+=GS1DataBarBase.makeComplexPattern(e.substr(18,13));return"0000"+(t+=GS1DataBarBase.makeComplementPattern(e.substr(31,15))).substr(2,t.length-2)+"0000"}convertToShape(e,t){this.linkage?this._convertToShapeForLinkage(e,t):this._convertToShape(e,t)}getLinkageOffset(e){let t=0;for(;"1"===e[t];)t++;return{linkageOffset:++t,symbolOffset:0}}_convertToShapeForLinkage(e,t){let{label:r,encodeConfig:{quietZone:i,isLabelBottom:n,height:o,showLabel:s,fontSizeInUnit:a},config:{ratio:c},style:{textAlign:l,unitValue:d},linkageText:h,config:{linkageVersion:u,linkageHeight:p},linkageColumnCnt:g}=this;const m=u===GS1DataBarBase.LinkageVersion.CCA?new CCA(h,g,d,p):new CCB(h,g,d,p);m.toSymbol();const f=m.getMainArea(),C=this.getLinkageSepPattern(e.topRow);let b=0;r&&s&&(b=a);const x=e.separators.length,S=this.getLinkageOffset(e),B=new VerticalLayoutArea,E=new LabelArea(50,b,l),D=new SymbolArea(50,(o-x)*c),w=new SymbolArea(50,(o-x)*(1-c)),_=new SymbolArea(50,1);B.setStyle({padding:{top:i.top,right:i.right,bottom:i.bottom,left:i.left}});f.setStyle({margin:{left:S.linkageOffset}});n||B.append(E);B.append(f);B.append(_);B.append(D);const P=[];e.separators.forEach(()=>{const e=new SymbolArea(50,1);P.push(e);B.append(e)});B.append(w);n&&B.append(E);if(!t){_.fromPattern(C);D.fromPattern(e.topRow);w.fromPattern(e.bottomRow);P.forEach((t,r)=>{t.fromPattern(e.separators[r])});E.append({text:r});this.shapes=B.toShapes()}this.size=B.getSize()}_convertToShape(e,t){let{label:r,encodeConfig:{quietZone:i,isLabelBottom:n,height:o,showLabel:s,fontSizeInUnit:a},config:{ratio:c},style:{textAlign:l}}=this,d=0;r&&s&&(d=a);const h=e.separators.length,u=new VerticalLayoutArea;u.setStyle({padding:{top:i.top,right:i.right,bottom:i.bottom,left:i.left}});const p=new LabelArea(50,d,l),g=new SymbolArea(50,(o-h)*c),m=new SymbolArea(50,(o-h)*(1-c));n||u.append(p);u.append(g);const f=[];e.separators.forEach(()=>{const e=new SymbolArea(50,1);f.push(e);u.append(e)});u.append(m);n&&u.append(p);if(!t){p.append({text:r});g.fromPattern(e.topRow);m.fromPattern(e.bottomRow);f.forEach((t,r)=>{t.fromPattern(e.separators[r])});this.shapes=u.toShapes()}this.size=u.getSize()}}StackedBase.DefaultConfig={showLabel:!1,ratio:.4};StackedBase.RightGuard="10";StackedBase.LeftGuard="10";export class ExpandedStacked extends Expanded{constructor(e){e.merge(ExpandedStacked.DefaultConfig);super(e);let{config:{rowCount:t}}=this;this.rowCount=t;this._hasExtraPadding=!1;this.linkageColumnCnt=4}_makeStacked(e){const t=this.symbolContentSize;if(!this._hasExtraPadding){const r=~~(e.length/ExpandedStacked.SegmentSize);let i;if("auto"===this.rowCount){let e=2;e>r&&(e=r);i=Math.ceil(r/e);this.rowCount=e}else{let e=this.rowCount;i=Math.ceil(r/e)}if(this.rowCount>11)throw new TextTooLongException;const n=t%(2*i);this.rowSegmentCount=i;if(1===n){this._bitBuffer=new BitBuffer;this._gpdEncodation=new GS1GeneralPurposeDataEncodation(this._bitBuffer,!0);this._hasExtraPadding=!0;return this.calculateData()}}const r=this.rowSegmentCount,i=Math.ceil(t%(2*r)/2),n=Utils.isEven(r),o=r*ExpandedStacked.SegmentSize,s=[];Utils.sliceArray(e,o,(e,t)=>{const r=[...Expanded.Guard,...e,...Expanded.Guard];let a;if(Utils.isEven(t))a=Utils.toZeroOnePattern(r);else if(n)if(e.length<o&&Utils.isOdd(i))a="0"+Utils.toZeroOnePattern(r);else{r.reverse();a=Utils.toZeroOnePattern(r,!0)}else a=Utils.toZeroOnePattern(r,!0);s.push({pattern:a,role:"row"})});this.rowCount=s.length;const a=[];let c=1;for(;c<s.length;){const e=s[c-1],t=s[c];a.push(e);const r=this._getSeparators(e.pattern,t.pattern,c-1);a.push(...r);c++}a.push(s[c-1]);return a}_isVersion1Finder(e,t){const r=this.finderPatternSeq[~~((e+1+t)/2)];return["A1","B1","C1","D1","E1","F1"].indexOf(r)>-1}_makeSepPattern(e,t){const r=Math.ceil((e.length-4)/ExpandedStacked.SegmentWidth);e=e.substring(2,e.length-2);let i="",n=0,o=0;for(;n<r;){const r=o,s=o+ExpandedStacked.SegmentWidth;let a=r+17;this._isVersion1Finder(t,n)||(a+=2);i+=GS1DataBarBase.makeComplementPattern(e.substr(r,a-r));i+=GS1DataBarBase.makeComplexPattern(e.substr(a,13));i+=GS1DataBarBase.makeComplementPattern(e.substr(a+13,s-a-13));n++;o=s}return i=i.replace(/^(.){2}|(.){2}$/g,"0000")}_getSeparators(e,t,r){const i=r*((e.length-4)/ExpandedStacked.SegmentWidth);return[{pattern:this._makeSepPattern(e,i)},{pattern:"0000"+StackedBase.makeAlternatePattern(e.length-8,!0)+"0000"},{pattern:this._makeSepPattern(t,i)}]}calculateData(){const e=this.makeDataWidth();return this._makeStacked(e)}getLinkageOffset(e){let t=1;for(;"1"===e[t];)t++;return{linkageOffset:t,symbolOffset:0}}convertToShape(e,t){this.linkage?this._convertToShapeForLinkage(e,t):this._convertToShape(e,t)}_convertToShapeForLinkage(e,t){let{label:r,encodeConfig:{quietZone:i,isLabelBottom:n,height:o,showLabel:s,fontSizeInUnit:a},rowCount:c,style:{textAlign:l,unitValue:d},linkageText:h,config:{linkageVersion:u,linkageHeight:p},linkageColumnCnt:g}=this;const m=u===GS1DataBarBase.LinkageVersion.CCA?new CCA(h,g,d,p):new CCB(h,g,d,p);m.toSymbol();const f=m.getMainArea(),C=this.getLinkageSepPattern(e[0].pattern),b=f.getSize(),x=(o-3*(c-1)-1-b.height)/c,S=e[0].pattern.length;let B=0;r&&s&&(B=a);const E=this.getLinkageOffset(e[0].pattern),D=new VerticalLayoutArea,w=new SymbolArea(S,1),_=new LabelArea(S,B,l);D.setStyle({padding:{top:i.top,right:i.right,bottom:i.bottom,left:i.left}});w.setStyle({margin:{left:E.symbolOffset}});f.setStyle({margin:{left:E.linkageOffset}});n||D.append(_);D.append(f);D.append(w);const P=[];e.forEach(e=>{const t=new SymbolArea(S,"row"===e.role?x:1);D.append(t);P.push({area:t,pattern:e.pattern})});n&&D.append(_);if(!t){w.fromPattern(C);_.append({text:r});P.forEach(e=>{e.area.fromPattern(e.pattern)});this.shapes=D.toShapes()}this.size=D.getSize()}_convertToShape(e,t){let{label:r,encodeConfig:{quietZone:i,isLabelBottom:n,height:o,showLabel:s,fontSizeInUnit:a},rowCount:c,style:{textAlign:l}}=this;const d=(o-3*(c-1))/c,h=e[0].pattern.length;let u=0;r&&s&&(u=a);const p=new VerticalLayoutArea;p.setStyle({padding:{top:i.top,right:i.right,bottom:i.bottom,left:i.left}});const g=new LabelArea(h,u,l);n||p.append(g);const m=[];e.forEach(e=>{const t=new SymbolArea(h,"row"===e.role?d:1);p.append(t);m.push({area:t,pattern:e.pattern})});n&&p.append(g);if(!t){g.append({text:r});m.forEach(e=>{e.area.fromPattern(e.pattern)});this.shapes=p.toShapes()}this.size=p.getSize()}}ExpandedStacked.DefaultConfig={rowCount:"auto"};ExpandedStacked.SegmentWidth=49;ExpandedStacked.SegmentSize=21;export class StackedOmnidirectional extends StackedBase{getSeparator(e,t){const r=[];let i="0000";i+=GS1DataBarBase.makeComplementPattern(e.substr(4,14));i+=GS1DataBarBase.makeComplexPattern(e.substr(18,13));i+=GS1DataBarBase.makeComplementPattern(e.substr(31,15));i+="0000";r.push(i);i="0000";i+=GS1DataBarBase.makeAlternatePattern(42,!0);i+="0000";r.push(i);i="0000";i+=GS1DataBarBase.makeComplementPattern(t.substr(4,15));i+=GS1DataBarBase.makeComplexPattern(t.substr(19,13));i+=GS1DataBarBase.makeComplementPattern(t.substr(32,14));i+="0000";r.push(i);return r}}export class Stacked extends StackedBase{constructor(e){e.merge(Stacked.DefaultConfig);super(e)}getSeparator(e,t){let r="",i=0;Utils.loop(n=>{if(e[n]!==t[n])if(1===i){r+="0";i=0}else{r+="1";i=1}else if("0"===e[n]){r+="1";i=1}else{r+="0";i=0}},{from:4,to:e.length-4});return["0000"+r+"0000"]}}Stacked.DefaultConfig={height:13};export class Omnidirectional extends GS1DataBarFirstType{getLinkageOffset(e,t){let r=e.length-1;for(;"1"===e[r];)r--;return{linkageOffset:0,symbolOffset:t-r-1}}}export class Truncated extends Omnidirectional{constructor(e){e.merge(Truncated.DefaultConfig);super(e)}}Truncated.DefaultConfig={height:13,showLabel:!1};Barcode.registerEncoder("GS1 DataBar Omnidirectional",Omnidirectional);Barcode.registerEncoder("GS1 DataBar Truncated",Truncated);Barcode.registerEncoder("GS1 DataBar Stacked",Stacked);Barcode.registerEncoder("GS1 DataBar StackedOmnidirectional",StackedOmnidirectional);Barcode.registerEncoder("GS1 DataBar Limited",Limited);Barcode.registerEncoder("GS1 DataBar Expanded",Expanded);Barcode.registerEncoder("GS1 DataBar Expanded Stacked",ExpandedStacked);export var Gs1DataBarLinkageVersion;!function(e){e[e.Cca=0]="Cca";e[e.Ccb=1]="Ccb"}(Gs1DataBarLinkageVersion||(Gs1DataBarLinkageVersion={}));export var MicroPdfCompactionMode;!function(e){e[e.Auto=0]="Auto";e[e.Text=1]="Text";e[e.Numeric=2]="Numeric";e[e.Byte=3]="Byte"}(MicroPdfCompactionMode||(MicroPdfCompactionMode={}));export var MicroPdfDimensions;!function(e){e[e.ColumnPriority=0]="ColumnPriority";e[e.RowPriority=1]="RowPriority";e[e.Dim1x11=2]="Dim1x11";e[e.Dim1x14=3]="Dim1x14";e[e.Dim1x17=4]="Dim1x17";e[e.Dim1x20=5]="Dim1x20";e[e.Dim1x24=6]="Dim1x24";e[e.Dim1x28=7]="Dim1x28";e[e.Dim2x8=8]="Dim2x8";e[e.Dim2x11=9]="Dim2x11";e[e.Dim2x14=10]="Dim2x14";e[e.Dim2x17=11]="Dim2x17";e[e.Dim2x20=12]="Dim2x20";e[e.Dim2x23=13]="Dim2x23";e[e.Dim2x26=14]="Dim2x26";e[e.Dim3x6=15]="Dim3x6";e[e.Dim3x8=16]="Dim3x8";e[e.Dim3x10=17]="Dim3x10";e[e.Dim3x12=18]="Dim3x12";e[e.Dim3x15=19]="Dim3x15";e[e.Dim3x20=20]="Dim3x20";e[e.Dim3x26=21]="Dim3x26";e[e.Dim3x32=22]="Dim3x32";e[e.Dim3x38=23]="Dim3x38";e[e.Dim3x44=24]="Dim3x44";e[e.Dim4x4=25]="Dim4x4";e[e.Dim4x6=26]="Dim4x6";e[e.Dim4x8=27]="Dim4x8";e[e.Dim4x10=28]="Dim4x10";e[e.Dim4x12=29]="Dim4x12";e[e.Dim4x15=30]="Dim4x15";e[e.Dim4x20=31]="Dim4x20";e[e.Dim4x26=32]="Dim4x26";e[e.Dim4x32=33]="Dim4x32";e[e.Dim4x38=34]="Dim4x38";e[e.Dim4x44=35]="Dim4x44"}(MicroPdfDimensions||(MicroPdfDimensions={}));export class _LinkageVersionConvertor{static stringToEnum(e){switch(e){case"CCA":return Gs1DataBarLinkageVersion.Cca;case"CCB":return Gs1DataBarLinkageVersion.Ccb}throw`Unknown Barcode internal linkageVersion '${e}'`}static enumToString(e){return Gs1DataBarLinkageVersion[asEnum(e,Gs1DataBarLinkageVersion)].toUpperCase()}}export class _CompactionModeConvertor{static stringToEnum(e){switch(e){case"auto":return MicroPdfCompactionMode.Auto;case"text":return MicroPdfCompactionMode.Text;case"numeric":return MicroPdfCompactionMode.Numeric;case"byte":return MicroPdfCompactionMode.Byte}throw`Unknown Barcode internal compactionMode '${e}'`}static enumToString(e){return MicroPdfCompactionMode[asEnum(e,MicroPdfCompactionMode)].toLowerCase()}}export function _MicroPdfDimensionsConvertor(e){switch(e){case"ColumnPriority":return"columnPriorAuto";case"RowPriority":return"rowPriorAuto";default:return e.substr("Dim".length).replace("x","*")}}export class Gs1DataBarBase extends BarcodeBase{constructor(e,t){super(e,t);addClass(this.hostElement,"wj-barcode-gs1databar")}static _getClassDefaults(){let e=super._getClassDefaults();e.showLabel=!0;return e}get showLabel(){return this._getProp("showLabel")}set showLabel(e){this._setProp("showLabel",e)}get labelPosition(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))}set labelPosition(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))}get linkage(){return this._getProp("linkage")}set linkage(e){this._setProp("linkage",e)}get linkageVersion(){return _LinkageVersionConvertor.stringToEnum(this._getProp("linkageVersion"))}set linkageVersion(e){this._setProp("linkageVersion",_LinkageVersionConvertor.enumToString(e))}get linkageHeight(){return this._getProp("linkageHeight")}set linkageHeight(e){this._setProp("linkageHeight",e)}get hideLinkageText(){return this._getProp("hideLinkageText")}set hideLinkageText(e){this._setProp("hideLinkageText",e)}get hideAiText(){return this._getProp("hideAIText")}set hideAiText(e){this._setProp("hideAIText",e)}}export class Gs1DataBarOmnidirectional extends Gs1DataBarBase{constructor(e,t){super(e,t);addClass(this.hostElement,"wj-barcode-gs1databar-omnidirectional")}}Gs1DataBarOmnidirectional.type="GS1 DataBar Omnidirectional";export class Gs1DataBarTruncated extends Gs1DataBarBase{constructor(e,t){super(e,t);addClass(this.hostElement,"wj-barcode-gs1databar-truncated")}}Gs1DataBarTruncated.type="GS1 DataBar Truncated";export class Gs1DataBarStacked extends Gs1DataBarBase{constructor(e,t){super(e,t);addClass(this.hostElement,"wj-barcode-gs1databar-stacked")}get ratio(){return this._getProp("ratio")}set ratio(e){this._setProp("ratio",e)}}Gs1DataBarStacked.type="GS1 DataBar Stacked";export class Gs1DataBarStackedOmnidirectional extends Gs1DataBarBase{constructor(e,t){super(e,t);addClass(this.hostElement,"wj-barcode-gs1databar-stacked-omnidirectional")}get ratio(){return this._getProp("ratio")}set ratio(e){this._setProp("ratio",e)}}Gs1DataBarStackedOmnidirectional.type="GS1 DataBar StackedOmnidirectional";export class Gs1DataBarLimited extends Gs1DataBarBase{constructor(e,t){super(e,t);addClass(this.hostElement,"wj-barcode-gs1databar-limited")}}Gs1DataBarLimited.type="GS1 DataBar Limited";export class Gs1DataBarExpanded extends Gs1DataBarBase{constructor(e,t){super(e);addClass(this.hostElement,"wj-barcode-gs1databar-expanded");this._setAw(!0);this.initialize(t)}get autoWidth(){return this._getAw()}set autoWidth(e){this._setAw(e)}get autoWidthZoom(){return this._getWzoom()}set autoWidthZoom(e){this._setWzoom(e)}}Gs1DataBarExpanded.type="GS1 DataBar Expanded";export class Gs1DataBarExpandedStacked extends Gs1DataBarBase{constructor(e,t){super(e);addClass(this.hostElement,"wj-barcode-gs1databar-expanded-stacked");this._setAw(!0);this.initialize(t)}get autoWidth(){return this._getAw()}set autoWidth(e){this._setAw(e)}get autoWidthZoom(){return this._getWzoom()}set autoWidthZoom(e){this._setWzoom(e)}get rowCount(){let e=this._getProp("rowCount");return"auto"===e?null:e}set rowCount(e){this._setProp("rowCount",null==e?"auto":e)}}Gs1DataBarExpandedStacked.type="GS1 DataBar Expanded Stacked";export class Pdf417 extends BarcodeBase{constructor(e,t){super(e);addClass(this.hostElement,"wj-barcode-pdf417");this._setAw(!0);this.initialize(t)}get autoWidth(){return this._getAw()}set autoWidth(e){this._setAw(e)}get autoWidthZoom(){return this._getWzoom()}set autoWidthZoom(e){this._setWzoom(e)}get errorCorrectionLevel(){let e=this._getProp("errorCorrectionLevel");return"auto"===e?null:e}set errorCorrectionLevel(e){this._setProp("errorCorrectionLevel",null==e?"auto":e)}get columns(){let e=this._getProp("columns");return"auto"===e?null:e}set columns(e){this._setProp("columns",null==e?"auto":e)}get rows(){let e=this._getProp("rows");return"auto"===e?null:e}set rows(e){this._setProp("rows",null==e?"auto":e)}get compact(){return this._getProp("compact")}set compact(e){this._setProp("compact",e)}}Pdf417.type="PDF417";export class MicroPdf417 extends BarcodeBase{constructor(e,t){MicroPdf417._getEnumDictionary();super(e,t);addClass(this.hostElement,"wj-barcode-micropdf417")}static _getEnumDictionary(){MicroPdf417._dimensionsDictionary||(MicroPdf417._dimensionsDictionary=new _EnumDictionary(MicroPdfDimensions,_MicroPdfDimensionsConvertor))}get dimensions(){return MicroPdf417._dimensionsDictionary.getEnumByString(this._getProp("symbolVersion"))}set dimensions(e){this._setProp("symbolVersion",MicroPdf417._dimensionsDictionary.getStringByEnum(e))}get compactionMode(){return _CompactionModeConvertor.stringToEnum(this._getProp("compactionMode"))}set compactionMode(e){this._setProp("compactionMode",_CompactionModeConvertor.enumToString(e))}get structuredAppend(){return this._getProp("structuredAppend")}set structuredAppend(e){this._setProp("structuredAppend",e)}get segmentIndex(){return this._getProp("segmentIndex")}set segmentIndex(e){this._setProp("segmentIndex",e)}get fileId(){return this._getProp("fileID")}set fileId(e){this._setProp("fileID",e)}get optionalFields(){return this._getProp("optionalFields")}set optionalFields(e){this._setProp("optionalFields",e)}}MicroPdf417.type="MicroPDF417";_registerModule("wijmo.barcode.composite",selfModule);
14
+ import{asEnum,addClass,_registerModule}from"@mescius/wijmo";import{Utils,VerticalLayoutArea,MatrixSymbolArea,InvalidTextException,TwoDimensionalBarcode,InvalidOptionsException,TextTooLongException,MatrixBuilder,Constants,InvalidCharacterException,Option,BitBuffer,OneDimensionalBarcode,LabelArea,SymbolArea,Barcode,BarcodeBase,_LabelPositionConvertor,_EnumDictionary}from"@mescius/wijmo.barcode";import*as selfModule from"@mescius/wijmo.barcode.composite";export class ISO646Encoder{constructor(e){this.bitBuffer=e}static isISO646Only(e){return ISO646Encoder.ISO646.indexOf(e)>-1}encode(e){let t=ISO646Encoder.Table[e];if(t)this.bitBuffer.putBits(t);else{const t=e.charCodeAt(0);if(t>=48&&t<=57)this.bitBuffer.put(t-43,5);else if(e>="A"&&e<="Z")this.bitBuffer.put(t-1,7);else{if(!(e>="a"&&e<="z"))throw new InvalidCharacterException(e);this.bitBuffer.put(t-7,7)}}}FNC1NumericLatch(){this.bitBuffer.putBits(ISO646Encoder.Table.FNC1NumericLatch)}NumericLatch(){this.bitBuffer.putBits(ISO646Encoder.Table.NumericLatch)}AlphanumericLatch(){this.bitBuffer.putBits(ISO646Encoder.Table.AlphanumericLatch)}}ISO646Encoder.Table={"!":"11101000",'"':"11101001","%":"11101010","&":"11101011","'":"11101100","(":"11101101",")":"11101110","*":"11101111","+":"11110000",",":"11110001","-":"11110010",".":"11110011","/":"11110100",":":"11110101",";":"11110110","<":"11110111","=":"11111000",">":"11111001","?":"11111010",_:"11111011"," ":"11111100",FNC1NumericLatch:"01111",NumericLatch:"000",AlphanumericLatch:"00100"};ISO646Encoder.ISO646="abcdefghijklmnopqrstuvwxyz!\"%&'()+:;<=>?_ ";export class AlphanumericEncoder{constructor(e){this.bitBuffer=e}static isUpperCase(e){return e>="A"&&e<="Z"}static isLowerCase(e){return e>="a"&&e<="z"}encode(e){let t=AlphanumericEncoder.Table[e];if(t)this.bitBuffer.putBits(t);else{const t=e.charCodeAt(0);if(t>=48&&t<=57)this.bitBuffer.put(t-43,5);else{if(!AlphanumericEncoder.isUpperCase(e))throw new InvalidCharacterException(e);this.bitBuffer.put(t-33,6)}}}FNC1NumericLatch(){this.bitBuffer.putBits(AlphanumericEncoder.Table.FNC1NumericLatch)}NumericLatch(){this.bitBuffer.putBits(AlphanumericEncoder.Table.NumericLatch)}ISO646Latch(){this.bitBuffer.putBits(AlphanumericEncoder.Table.ISO646Latch)}}AlphanumericEncoder.Table={"*":"111010",",":"111011","-":"111100",".":"111101","/":"111110",FNC1NumericLatch:"01111",NumericLatch:"000",ISO646Latch:"00100"};export class NumericEncoder{static isNumericOrFNC1(e){const t=e.charCodeAt(0);return e===Constants.FNC1||t>=48&&t<=57}static isNumeric(e){const t=e.charCodeAt(0);return t>=48&&t<=57}constructor(e){this.bitBuffer=e}encode(e,t){let i,r;const n=11*(i=e===Constants.FNC1?10:e.charCodeAt(0)-48)+(r=t===Constants.FNC1?10:t.charCodeAt(0)-48)+8;this.bitBuffer.put(n,7)}encodeOne(e){let t;t=e===Constants.FNC1?10:e.charCodeAt(0)-48+1;this.bitBuffer.put(t,4)}AlphanumericLatch(){this.bitBuffer.put(0,4)}}export class GS1GeneralPurposeDataEncodation{constructor(e,t=!1){this.text="";this.mode=GS1GeneralPurposeDataEncodation.EncodeMod.Numeric;this.bitBuffer=e;this.needExtraPadding=t}encodeGeneralData(e){if(!e)return;const{bitBuffer:t}=this;let i=GS1GeneralPurposeDataEncodation.EncodeMod.Numeric;for(let r=e.length,n=0;r>0;r=e.length-n){const o=e[n];switch(i){case GS1GeneralPurposeDataEncodation.EncodeMod.Numeric:{const s=new NumericEncoder(t),a=t.length;if(1===r)if(NumericEncoder.isNumeric(o)){a>24&&a%12<=8&&a%12>5?s.encodeOne(o):s.encode(o,Constants.FNC1);n++}else{s.AlphanumericLatch();i=GS1GeneralPurposeDataEncodation.EncodeMod.Alphanumeric}else if(NumericEncoder.isNumericOrFNC1(o)&&NumericEncoder.isNumericOrFNC1(e[n+1])&&(o!==Constants.FNC1||e[n+1]!==Constants.FNC1)){s.encode(o,e[n+1]);n+=2}else{s.AlphanumericLatch();i=GS1GeneralPurposeDataEncodation.EncodeMod.Alphanumeric}break}case GS1GeneralPurposeDataEncodation.EncodeMod.Alphanumeric:{const r=new AlphanumericEncoder(t);if(o===Constants.FNC1){r.FNC1NumericLatch();i=GS1GeneralPurposeDataEncodation.EncodeMod.Numeric;n++}else if(NumericEncoder.isNumeric(o)){let t=n+1;for(;t<e.length&&NumericEncoder.isNumeric(e[t]);t++);if(t-n>=6||t-n>=4&&t===e.length){r.NumericLatch();i=GS1GeneralPurposeDataEncodation.EncodeMod.Numeric}else{r.encode(o);n++}}else if(ISO646Encoder.isISO646Only(o)){r.ISO646Latch();i=GS1GeneralPurposeDataEncodation.EncodeMod.ISO646}else{r.encode(o);n++}break}case GS1GeneralPurposeDataEncodation.EncodeMod.ISO646:{const r=new ISO646Encoder(t);if(NumericEncoder.isNumericOrFNC1(o)){let t=n+1;for(;t<e.length&&NumericEncoder.isNumericOrFNC1(e[t]);t++);if(t-n>=4){for(;t<e.length&&!ISO646Encoder.isISO646Only(e[t]);t++);if(t==e.length||t-n>10){r.NumericLatch();i=GS1GeneralPurposeDataEncodation.EncodeMod.Numeric;break}}}else{let t=n;for(;t<e.length&&!ISO646Encoder.isISO646Only(e[t]);t++);if(t-n>10){r.AlphanumericLatch();i=GS1GeneralPurposeDataEncodation.EncodeMod.Alphanumeric;break}}if(o===Constants.FNC1){r.FNC1NumericLatch();i=GS1GeneralPurposeDataEncodation.EncodeMod.Numeric;n++}else{r.encode(o);n++}break}}}this.mode=i}padTo(e){const{bitBuffer:t}=this,i=e-t.length;this._pad(i)}_pad(e){const{bitBuffer:t}=this;for(;e>0;)if(this.mode===GS1GeneralPurposeDataEncodation.EncodeMod.Numeric){this.mode=GS1GeneralPurposeDataEncodation.EncodeMod.Alphanumeric;if(e>=4){t.put(0,4);e-=4}else{t.put(0,e);e=0}}else if(e>=5){t.put(4,5);e-=5}else{4===e?t.put(2,e):3===e?t.put(1,e):t.put(0,e);e=0}}encode(e=""){const{bitBuffer:t,needExtraPadding:i}=this;this.encodeGeneralData(e);let r,n=~~((t.length+11)/12);r=12*(n=n<3?3:n)-t.length;i&&(r+=12);this._pad(r)}}GS1GeneralPurposeDataEncodation.EncodeMod={Numeric:"Numeric",Alphanumeric:"Alphanumeric",ISO646:"ISO646"};const mb=new MatrixBuilder(69,7),pwr928=mb.toMatrix();function init928(){let e,t,i,r=Utils.fillArray(new Array(7),0);r[6]=1;for(e=0;e<7;e++)pwr928[0][e]=r[e];for(t=1;t<69;t++){for(i=0,e=6;e>=1;e--){i=2*r[e]+~~(i/928);pwr928[t][e]=r[e]=i%928}pwr928[t][0]=r[0]=2*r[0]+~~(i/928)}}init928();function getBit(e,t){return 0==(e[~~(t/16)]&32768>>t%16)?0:1}export function encode928(e,t,i){let r,n,o,s,a,c,l;for(a=l=o=0;o<i;o+=69,a+=7){l+=c=1+~~((s=Math.min(i-o,69))/10);for(r=0;r<c;r++)t[a+r]=0;for(r=0;r<s;r++)if(getBit(e,o+s-r-1))for(n=0;n<c;n++)t[a+n]+=pwr928[r][n+7-c];for(r=c-1;r>0;r--){t[a+r-1]+=~~(t[a+r]/928);t[a+r]%=928}}return l}function makeRange_CCA(e,t){const i=[];let r=0,n=e;for(;r<t;){n>52&&(n%=52);i.push(n);r++;n++}return i}export function findVersionTable_CCA(e,t){for(let i=0,r=e.length;i<r;i++){let r=e[i];const[n,o,s,a,c,l,d]=r,h=o*n;if(t(r={rows:o,cols:n,total:h,ecCws:s,nonEcCw:h-s,bits:a})){r.rowAssignment={left:makeRange_CCA(c,o),right:makeRange_CCA(l,o),center:d?makeRange_CCA(d,o):null};const e=[];let t=0;for(;t<=o;){const i=(c+t-1)%3;e.push(i);t++}r.cluster=e;return r}}return null}export function getVersionVariant_CCA(e,t){return findVersionTable_CCA([[2,5,4,59,39,19],[2,6,4,78,1,33],[2,7,5,88,32,12],[2,8,5,108,8,40],[2,9,6,118,14,46],[2,10,6,138,43,23],[2,12,7,167,20,52],[3,4,4,78,11,23,43],[3,5,5,98,1,13,33],[3,6,6,118,3,17,37],[3,7,7,138,15,27,47],[3,8,7,167,21,33,1],[4,3,4,78,40,52,20],[4,4,5,108,43,3,23],[4,5,6,138,46,6,26],[4,6,7,167,34,46,14],[4,7,8,197,29,41,9]],i=>i.cols===e&&i.bits>=t)}const SupportedUppercaseAlphabetic="BDHIJKLNPQRSTVWZ";export function getSupportedUppercaseAlphabetic(e){const t=SupportedUppercaseAlphabetic.indexOf(e);if(-1===t)return null;const i=Utils.convertRadix(t);return Utils.strPadStart(i,4,"0")}const EncodeMod=GS1GeneralPurposeDataEncodation.EncodeMod;export class GeneralPurposeDataEncodation extends GS1GeneralPurposeDataEncodation{encodeGeneralData(e,t){if(!e)return;const{bitBuffer:i}=this;let r=EncodeMod.Numeric;for(let n=e.length,o=0;n>0;n=e.length-o){const s=e[o];switch(r){case EncodeMod.Numeric:{const a=new NumericEncoder(i),c=s[0].charCodeAt(0);if(1===n)if(NumericEncoder.isNumeric(s)){const e=getVersionVariant_CCA(t,i.length);if(!e)throw new TextTooLongException;const r=e.bits-i.length;if(r>=4&&r<=6){a.encodeOne(s);i.put(0,r-4)}else i.put(11*(c-48)+10+8,7);o++}else{a.AlphanumericLatch();r=EncodeMod.Alphanumeric}else if(NumericEncoder.isNumericOrFNC1(s)&&NumericEncoder.isNumericOrFNC1(e[o+1])&&(s!==Constants.FNC1||e[o+1]!==Constants.FNC1)){a.encode(s,e[o+1]);o+=2}else{a.AlphanumericLatch();r=EncodeMod.Alphanumeric}break}case EncodeMod.Alphanumeric:{const t=new AlphanumericEncoder(i);if(s===Constants.FNC1){t.FNC1NumericLatch();r=EncodeMod.Numeric;o++}else if(NumericEncoder.isNumeric(s)){let i=o+1;for(;i<e.length&&NumericEncoder.isNumericOrFNC1(e[i]);i++);if(i-o>=6||i-o>=4&&i===e.length){t.NumericLatch();r=EncodeMod.Numeric}else{t.encode(s);o++}}else if(ISO646Encoder.isISO646Only(s)){t.ISO646Latch();r=EncodeMod.ISO646}else{t.encode(s);o++}break}case EncodeMod.ISO646:{const t=new ISO646Encoder(i);if(NumericEncoder.isNumericOrFNC1(s)){let i=o+1;for(;i<e.length&&NumericEncoder.isNumericOrFNC1(e[i]);i++);if(i-o>=4){for(;i<e.length&&!ISO646Encoder.isISO646Only(e[i]);i++);if(i==e.length||i-o>10){t.NumericLatch();r=EncodeMod.Numeric;break}}}else{let i=o;for(;i<e.length&&!ISO646Encoder.isISO646Only(e[i]);i++);if(i-o>10){t.AlphanumericLatch();r=EncodeMod.Alphanumeric;break}}if(s===Constants.FNC1){t.FNC1NumericLatch();r=EncodeMod.Numeric;o++}else{t.encode(s);o++}break}}}this.mode=r}}const EccCoefficientTable=[[27,917],[522,568,723,809],[237,308,436,284,646,653,428,379],[274,562,232,755,599,524,801,132,295,116,442,428,295,42,176,65],[361,575,922,525,176,586,640,321,536,742,677,742,687,284,193,517,273,494,263,147,593,800,571,320,803,133,231,390,685,330,63,410],[539,422,6,93,862,771,453,106,610,287,107,505,733,877,381,612,723,476,462,172,430,609,858,822,543,376,511,400,672,762,283,184,440,35,519,31,460,594,225,535,517,352,605,158,651,201,488,502,648,733,717,83,404,97,280,771,840,629,4,381,843,623,264,543],[521,310,864,547,858,580,296,379,53,779,897,444,400,925,749,415,822,93,217,208,928,244,583,620,246,148,447,631,292,908,490,704,516,258,457,907,594,723,674,292,272,96,684,432,686,606,860,569,193,219,129,186,236,287,192,775,278,173,40,379,712,463,646,776,171,491,297,763,156,732,95,270,447,90,507,48,228,821,808,898,784,663,627,378,382,262,380,602,754,336,89,614,87,432,670,616,157,374,242,726,600,269,375,898,845,454,354,130,814,587,804,34,211,330,539,297,827,865,37,517,834,315,550,86,801,4,108,539],[524,894,75,766,882,857,74,204,82,586,708,250,905,786,138,720,858,194,311,913,275,190,375,850,438,733,194,280,201,280,828,757,710,814,919,89,68,569,11,204,796,605,540,913,801,700,799,137,439,418,592,668,353,859,370,694,325,240,216,257,284,549,209,884,315,70,329,793,490,274,877,162,749,812,684,461,334,376,849,521,307,291,803,712,19,358,399,908,103,511,51,8,517,225,289,470,637,731,66,255,917,269,463,830,730,433,848,585,136,538,906,90,2,290,743,199,655,903,329,49,802,580,355,588,188,462,10,134,628,320,479,130,739,71,263,318,374,601,192,605,142,673,687,234,722,384,177,752,607,640,455,193,689,707,805,641,48,60,732,621,895,544,261,852,655,309,697,755,756,60,231,773,434,421,726,528,503,118,49,795,32,144,500,238,836,394,280,566,319,9,647,550,73,914,342,126,32,681,331,792,620,60,609,441,180,791,893,754,605,383,228,749,760,213,54,297,134,54,834,299,922,191,910,532,609,829,189,20,167,29,872,449,83,402,41,656,505,579,481,173,404,251,688,95,497,555,642,543,307,159,924,558,648,55,497,10],[352,77,373,504,35,599,428,207,409,574,118,498,285,380,350,492,197,265,920,155,914,299,229,643,294,871,306,88,87,193,352,781,846,75,327,520,435,543,203,666,249,346,781,621,640,268,794,534,539,781,408,390,644,102,476,499,290,632,545,37,858,916,552,41,542,289,122,272,383,800,485,98,752,472,761,107,784,860,658,741,290,204,681,407,855,85,99,62,482,180,20,297,451,593,913,142,808,684,287,536,561,76,653,899,729,567,744,390,513,192,516,258,240,518,794,395,768,848,51,610,384,168,190,826,328,596,786,303,570,381,415,641,156,237,151,429,531,207,676,710,89,168,304,402,40,708,575,162,864,229,65,861,841,512,164,477,221,92,358,785,288,357,850,836,827,736,707,94,8,494,114,521,2,499,851,543,152,729,771,95,248,361,578,323,856,797,289,51,684,466,533,820,669,45,902,452,167,342,244,173,35,463,651,51,699,591,452,578,37,124,298,332,552,43,427,119,662,777,475,850,764,364,578,911,283,711,472,420,245,288,594,394,511,327,589,777,699,688,43,408,842,383,721,521,560,644,714,559,62,145,873,663,713,159,672,729,624,59,193,417,158,209,563,564,343,693,109,608,563,365,181,772,677,310,248,353,708,410,579,870,617,841,632,860,289,536,35,777,618,586,424,833,77,597,346,269,757,632,695,751,331,247,184,45,787,680,18,66,407,369,54,492,228,613,830,922,437,519,644,905,789,420,305,441,207,300,892,827,141,537,381,662,513,56,252,341,242,797,838,837,720,224,307,631,61,87,560,310,756,665,397,808,851,309,473,795,378,31,647,915,459,806,590,731,425,216,548,249,321,881,699,535,673,782,210,815,905,303,843,922,281,73,469,791,660,162,498,308,155,422,907,817,187,62,16,425,535,336,286,437,375,273,610,296,183,923,116,667,751,353,62,366,691,379,687,842,37,357,720,742,330,5,39,923,311,424,242,749,321,54,669,316,342,299,534,105,667,488,640,672,576,540,316,486,721,610,46,656,447,171,616,464,190,531,297,321,762,752,533,175,134,14,381,433,717,45,111,20,596,284,736,138,646,411,877,669,141,919,45,780,407,164,332,899,165,726,600,325,498,655,357,752,768,223,849,647,63,310,863,251,366,304,282,738,675,410,389,244,31,121,303,263]],MicroEccCoefficientTable=[[890,351,200],[809,723,568,522],[566,155,460,919,427],[766,17,803,19,285,861],[437,691,784,597,537,925,76],[379,428,653,646,284,436,308,237],[205,441,501,362,289,257,622,527,567],[612,266,691,818,841,826,244,64,457,377],[904,602,327,68,15,213,825,708,565,45,462],[851,69,7,388,127,347,684,646,201,757,864,597],[692,394,184,204,678,592,322,583,606,384,342,713,764],[215,105,833,691,915,478,354,274,286,241,187,154,677,669],[642,868,147,575,550,74,80,5,230,664,904,109,476,829,460],[65,176,42,295,428,442,116,295,132,801,524,599,755,232,562,274],[573,760,756,233,321,560,202,312,297,120,739,275,855,37,624,315,577,279],[568,259,193,165,347,691,310,610,624,693,763,716,422,553,681,425,129,534,781,519,108],[169,764,847,131,858,325,454,441,245,699,893,446,830,159,121,269,608,331,760,477,93,788,544,887,284,443],[410,63,330,685,390,231,133,803,320,571,800,593,147,263,494,273,517,193,284,687,742,677,742,536,321,640,586,176,525,922,575,361],[518,117,125,231,289,554,771,920,689,95,229,745,658,284,32,812,233,614,595,245,680,445,684,388,586,738,159,280,322,788,721,529,703,133,848,438,228,234],[285,82,730,339,436,572,271,103,758,231,560,31,213,272,267,569,773,3,21,446,706,413,97,376,60,714,436,417,405,632,25,109,876,470,915,157,840,764,64,678,848,659,36,476],[435,718,820,427,876,920,477,211,244,71,127,246,739,10,146,766,623,579,26,865,593,919,233,264,102,575,96,534,230,637,155,909,535,188,303,205,50,778,416,411,874,257,81,63,706,156,875,576,797,923]];MicroEccCoefficientTable.forEach(e=>e.reverse());function encode(e,t,i){let r=Utils.fillArray(new Array(t),0);e.forEach(e=>{let n,o,s=e+r[t-1];for(let e=t-1;e>0;--e){o=929-(n=s*i[e]%929);r[e]=(r[e-1]+o)%929}o=929-(n=s*i[0]%929);r[0]=o%929});r.forEach((e,t)=>{0!=e&&(r[t]=929-e)});return r.reverse()}export function generateECC(e,t){const i=EccCoefficientTable[t];return encode(e,Math.pow(2,t+1),i)}export function generateECCForMicro(e,t){let i,r=0;for(;r<MicroEccCoefficientTable.length;){const e=MicroEccCoefficientTable[r];if(e.length===t){i=e;break}r++}return encode(e,t,i)}export const SymbolVersion={ColumnPriorAuto:"columnPriorAuto",RowPriorAuto:"rowPriorAuto",V1X11:"1*11",V1X14:"1*14",V1X17:"1*17",V1X20:"1*20",V1X24:"1*24",V1X28:"1*28",V2X8:"2*8",V2X11:"2*11",V2X14:"2*14",V2X17:"2*17",V2X20:"2*20",V2X23:"2*23",V2X26:"2*26",V3X6:"3*6",V3X8:"3*8",V3X10:"3*10",V3X12:"3*12",V3X15:"3*15",V3X20:"3*20",V3X26:"3*26",V3X32:"3*32",V3X38:"3*38",V3X44:"3*44",V4X4:"4*4",V4X6:"4*6",V4X8:"4*8",V4X10:"4*10",V4X12:"4*12",V4X15:"4*15",V4X20:"4*20",V4X26:"4*26",V4X32:"4*32",V4X38:"4*38",V4X44:"4*44"};Utils.makeEnums(SymbolVersion);export const CompactionMode={Auto:"auto",Text:"text",Byte:"byte",Numeric:"numeric"};Utils.makeEnums(CompactionMode);export const CLUSTERS=[[120256,125680,128380,120032,125560,128318,108736,119920,108640,86080,108592,86048,110016,120560,125820,109792,120440,125758,88256,109680,88160,89536,110320,120700,89312,110200,120638,89200,110140,89840,110460,89720,110398,89980,128506,119520,125304,128190,107712,119408,125244,107616,119352,84032,107568,119324,84e3,107544,83984,108256,119672,125374,85184,108144,119612,85088,108088,119582,85040,108060,85728,108408,119742,85616,108348,85560,108318,85880,108478,85820,85790,107200,119152,125116,107104,119096,125086,83008,107056,119068,82976,107032,82960,82952,83648,107376,119228,83552,107320,119198,83504,107292,83480,83468,83824,107452,83768,107422,83740,83900,106848,118968,125022,82496,106800,118940,82464,106776,118926,82448,106764,82440,106758,82784,106936,119006,82736,106908,82712,106894,82700,82694,106974,82830,82240,106672,118876,82208,106648,118862,82192,106636,82184,106630,82180,82352,82328,82316,82080,118830,106572,106566,82050,117472,124280,127678,103616,117360,124220,103520,117304,124190,75840,103472,75808,104160,117624,124350,76992,104048,117564,76896,103992,76848,76824,77536,104312,117694,77424,104252,77368,77340,77688,104382,77628,77758,121536,126320,128700,121440,126264,128670,111680,121392,126236,111648,121368,126222,111632,121356,103104,117104,124092,112320,103008,117048,124062,112224,121656,126366,93248,74784,102936,117006,93216,112152,93200,75456,103280,117180,93888,75360,103224,117150,93792,112440,121758,93744,75288,93720,75632,103356,94064,75576,103326,94008,112542,93980,75708,94140,75678,94110,121184,126136,128606,111168,121136,126108,111136,121112,126094,111120,121100,111112,111108,102752,116920,123998,111456,102704,116892,91712,74272,121244,116878,91680,74256,102668,91664,111372,102662,74244,74592,102840,116958,92e3,74544,102812,91952,111516,102798,91928,74508,74502,74680,102878,92088,74652,92060,74638,92046,92126,110912,121008,126044,110880,120984,126030,110864,120972,110856,120966,110852,110850,74048,102576,116828,90944,74016,102552,116814,90912,111e3,121038,90896,73992,102534,90888,110982,90884,74160,102620,91056,74136,102606,91032,111054,91020,74118,91014,91100,91086,110752,120920,125998,110736,120908,110728,120902,110724,110722,73888,102488,116782,90528,73872,102476,90512,110796,102470,90504,73860,90500,73858,73944,90584,90572,90566,120876,120870,110658,102444,73800,90312,90308,90306,101056,116080,123580,100960,116024,70720,100912,115996,70688,100888,70672,70664,71360,101232,116156,71264,101176,116126,71216,101148,71192,71180,71536,101308,71480,101278,71452,71612,71582,118112,124600,127838,105024,118064,124572,104992,118040,124558,104976,118028,104968,118022,100704,115896,123486,105312,100656,115868,79424,70176,118172,115854,79392,105240,100620,79376,70152,79368,70496,100792,115934,79712,70448,118238,79664,105372,100750,79640,70412,79628,70584,100830,79800,70556,79772,70542,70622,79838,122176,126640,128860,122144,126616,128846,122128,126604,122120,126598,122116,104768,117936,124508,113472,104736,126684,124494,113440,122264,126670,113424,104712,117894,113416,122246,104706,69952,100528,115804,78656,69920,100504,115790,96064,78624,104856,117966,96032,113560,122318,100486,96016,78600,104838,96008,69890,70064,100572,78768,70040,100558,96176,78744,104910,96152,113614,70022,78726,70108,78812,70094,96220,78798,122016,126552,128814,122e3,126540,121992,126534,121988,121986,104608,117848,124462,113056,104592,126574,113040,122060,117830,113032,104580,113028,104578,113026,69792,100440,115758,78240,69776,100428,95136,78224,104652,100422,95120,113100,69764,95112,78212,69762,78210,69848,100462,78296,69836,95192,78284,69830,95180,78278,69870,95214,121936,126508,121928,126502,121924,121922,104528,117804,112848,104520,117798,112840,121958,112836,104514,112834,69712,100396,78032,69704,100390,94672,78024,104550,94664,112870,69698,94660,78018,94658,78060,94700,94694,126486,121890,117782,104484,104482,69672,77928,94440,69666,77922,99680,68160,99632,68128,99608,115342,68112,99596,68104,99590,68448,99768,115422,68400,99740,68376,99726,68364,68358,68536,99806,68508,68494,68574,101696,116400,123740,101664,116376,101648,116364,101640,116358,101636,67904,99504,115292,72512,67872,116444,115278,72480,101784,116430,72464,67848,99462,72456,101766,67842,68016,99548,72624,67992,99534,72600,101838,72588,67974,68060,72668,68046,72654,118432,124760,127918,118416,124748,118408,124742,118404,118402,101536,116312,105888,101520,116300,105872,118476,116294,105864,101508,105860,101506,105858,67744,99416,72096,67728,116334,80800,72080,101580,99398,80784,105932,67716,80776,72068,67714,72066,67800,99438,72152,67788,80856,72140,67782,80844,72134,67822,72174,80878,126800,128940,126792,128934,126788,126786,118352,124716,122576,126828,124710,122568,126822,122564,118338,122562,101456,116268,105680,101448,116262,114128,105672,118374,114120,122598,101442,114116,105666,114114,67664,99372,71888,67656,99366,80336,71880,101478,97232,80328,105702,67650,97224,114150,71874,97220,67692,71916,67686,80364,71910,97260,80358,97254,126760,128918,126756,126754,118312,124694,122472,126774,122468,118306,122466,101416,116246,105576,101412,113896,105572,101410,113892,105570,113890,67624,99350,71784,101430,80104,71780,67618,96744,80100,71778,96740,80098,96738,71798,96758,126738,122420,122418,105524,113780,113778,71732,79988,96500,96498,66880,66848,98968,66832,66824,66820,66992,66968,66956,66950,67036,67022,1e5,99984,115532,99976,115526,99972,99970,66720,98904,69024,100056,98892,69008,100044,69e3,100038,68996,66690,68994,66776,98926,69080,100078,69068,66758,69062,66798,69102,116560,116552,116548,116546,99920,102096,116588,115494,102088,116582,102084,99906,102082,66640,68816,66632,98854,73168,68808,66628,73160,68804,66626,73156,68802,66668,68844,66662,73196,68838,73190,124840,124836,124834,116520,118632,124854,118628,116514,118626,99880,115478,101992,116534,106216,101988,99874,106212,101986,106210,66600,98838,68712,99894,72936,68708,66594,81384,72932,68706,81380,72930,66614,68726,72950,81398,128980,128978,124820,126900,124818,126898,116500,118580,116498,122740,118578,122738,99860,101940,99858,106100,101938,114420],[128352,129720,125504,128304,129692,125472,128280,129678,125456,128268,125448,128262,125444,125792,128440,129758,120384,125744,128412,120352,125720,128398,120336,125708,120328,125702,120324,120672,125880,128478,110144,120624,125852,110112,120600,125838,110096,120588,110088,120582,110084,110432,120760,125918,89664,110384,120732,89632,110360,120718,89616,110348,89608,110342,89952,110520,120798,89904,110492,89880,110478,89868,90040,110558,90012,89998,125248,128176,129628,125216,128152,129614,125200,128140,125192,128134,125188,125186,119616,125360,128220,119584,125336,128206,119568,125324,119560,125318,119556,119554,108352,119728,125404,108320,119704,125390,108304,119692,108296,119686,108292,108290,85824,108464,119772,85792,108440,119758,85776,108428,85768,108422,85764,85936,108508,85912,108494,85900,85894,85980,85966,125088,128088,129582,125072,128076,125064,128070,125060,125058,119200,125144,128110,119184,125132,119176,125126,119172,119170,107424,119256,125166,107408,119244,107400,119238,107396,107394,83872,107480,119278,83856,107468,83848,107462,83844,83842,83928,107502,83916,83910,83950,125008,128044,125e3,128038,124996,124994,118992,125036,118984,125030,118980,118978,106960,119020,106952,119014,106948,106946,82896,106988,82888,106982,82884,82882,82924,82918,124968,128022,124964,124962,118888,124982,118884,118882,106728,118902,106724,106722,82408,106742,82404,82402,124948,124946,118836,118834,106612,106610,124224,127664,129372,124192,127640,129358,124176,127628,124168,127622,124164,124162,117568,124336,127708,117536,124312,127694,117520,124300,117512,124294,117508,117506,104256,117680,124380,104224,117656,124366,104208,117644,104200,117638,104196,104194,77632,104368,117724,77600,104344,117710,77584,104332,77576,104326,77572,77744,104412,77720,104398,77708,77702,77788,77774,128672,129880,93168,128656,129868,92664,128648,129862,92412,128644,128642,124064,127576,129326,126368,124048,129902,126352,128716,127558,126344,124036,126340,124034,126338,117152,124120,127598,121760,117136,124108,121744,126412,124102,121736,117124,121732,117122,121730,103328,117208,124142,112544,103312,117196,112528,121804,117190,112520,103300,112516,103298,112514,75680,103384,117230,94112,75664,103372,94096,112588,103366,94088,75652,94084,75650,75736,103406,94168,75724,94156,75718,94150,75758,128592,129836,91640,128584,129830,91388,128580,91262,128578,123984,127532,126160,123976,127526,126152,128614,126148,123970,126146,116944,124012,121296,116936,124006,121288,126182,121284,116930,121282,102864,116972,111568,102856,116966,111560,121318,111556,102850,111554,74704,102892,92112,74696,102886,92104,111590,92100,74690,92098,74732,92140,74726,92134,128552,129814,90876,128548,90750,128546,123944,127510,126056,128566,126052,123938,126050,116840,123958,121064,116836,121060,116834,121058,102632,116854,111080,121078,111076,102626,111074,74216,102646,91112,74212,91108,74210,91106,74230,91126,128532,90494,128530,123924,126004,123922,126002,116788,120948,116786,120946,102516,110836,102514,110834,73972,90612,73970,90610,128522,123914,125978,116762,120890,102458,110714,123552,127320,129198,123536,127308,123528,127302,123524,123522,116128,123608,127342,116112,123596,116104,123590,116100,116098,101280,116184,123630,101264,116172,101256,116166,101252,101250,71584,101336,116206,71568,101324,71560,101318,71556,71554,71640,101358,71628,71622,71662,127824,129452,79352,127816,129446,79100,127812,78974,127810,123472,127276,124624,123464,127270,124616,127846,124612,123458,124610,115920,123500,118224,115912,123494,118216,124646,118212,115906,118210,100816,115948,105424,100808,115942,105416,118246,105412,100802,105410,70608,100844,79824,70600,100838,79816,105446,79812,70594,79810,70636,79852,70630,79846,129960,95728,113404,129956,95480,113278,129954,95356,95294,127784,129430,78588,128872,129974,95996,78462,128868,127778,95870,128866,123432,127254,124520,123428,126696,128886,123426,126692,124514,126690,115816,123446,117992,115812,122344,117988,115810,122340,117986,122338,100584,115830,104936,100580,113640,104932,100578,113636,104930,113634,70120,100598,78824,70116,96232,78820,70114,96228,78818,96226,70134,78838,129940,94968,113022,129938,94844,94782,127764,78206,128820,127762,95102,128818,123412,124468,123410,126580,124466,126578,115764,117876,115762,122100,117874,122098,100468,104692,100466,113140,104690,113138,69876,78324,69874,95220,78322,95218,129930,94588,94526,127754,128794,123402,124442,126522,115738,117818,121978,100410,104570,112890,69754,78074,94714,94398,123216,127148,123208,127142,123204,123202,115408,123244,115400,123238,115396,115394,99792,115436,99784,115430,99780,99778,68560,99820,68552,99814,68548,68546,68588,68582,127400,129238,72444,127396,72318,127394,123176,127126,123752,123172,123748,123170,123746,115304,123190,116456,115300,116452,115298,116450,99560,115318,101864,99556,101860,99554,101858,68072,99574,72680,68068,72676,68066,72674,68086,72694,129492,80632,105854,129490,80508,80446,127380,72062,127924,127378,80766,127922,123156,123700,123154,124788,123698,124786,115252,116340,115250,118516,116338,118514,99444,101620,99442,105972,101618,105970,67828,72180,67826,80884,72178,80882,97008,114044,96888,113982,96828,96798,129482,80252,130010,97148,80190,97086,127370,127898,128954,123146,123674,124730,126842,115226,116282,118394,122618,99386,101498,105722,114170,67706,71930,80378,96632,113854,96572,96542,80062,96702,96444,96414,96350,123048,123044,123042,115048,123062,115044,115042,99048,115062,99044,99042,67048,99062,67044,67042,67062,127188,68990,127186,123028,123316,123026,123314,114996,115572,114994,115570,98932,100084,98930,100082,66804,69108,66802,69106,129258,73084,73022,127178,127450,123018,123290,123834,114970,115514,116602,98874,99962,102138,66682,68858,73210,81272,106174,81212,81182,72894,81342,97648,114364,97592,114334,97564,97550,81084,97724,81054,97694,97464,114270,97436,97422,80990,97502,97372,97358,97326,114868,114866,98676,98674,66292,66290,123098,114842,115130,98618,99194,66170,67322,69310,73404,73374,81592,106334,81564,81550,73310,81630,97968,114524,97944,114510,97932,97926,81500,98012,81486,97998,97880,114478,97868,97862,81454,97902,97836,97830,69470,73564,73550,81752,106414,81740,81734,73518,81774,81708,81702],[109536,120312,86976,109040,120060,86496,108792,119934,86256,108668,86136,129744,89056,110072,129736,88560,109820,129732,88312,109694,129730,88188,128464,129772,89592,128456,129766,89340,128452,89214,128450,125904,128492,125896,128486,125892,125890,120784,125932,120776,125926,120772,120770,110544,120812,110536,120806,110532,84928,108016,119548,84448,107768,119422,84208,107644,84088,107582,84028,129640,85488,108284,129636,85240,108158,129634,85116,85054,128232,129654,85756,128228,85630,128226,125416,128246,125412,125410,119784,125430,119780,119778,108520,119798,108516,108514,83424,107256,119166,83184,107132,83064,107070,83004,82974,129588,83704,107390,129586,83580,83518,128116,83838,128114,125172,125170,119284,119282,107508,107506,82672,106876,82552,106814,82492,82462,129562,82812,82750,128058,125050,119034,82296,106686,82236,82206,82366,82108,82078,76736,103920,117500,76256,103672,117374,76016,103548,75896,103486,75836,129384,77296,104188,129380,77048,104062,129378,76924,76862,127720,129398,77564,127716,77438,127714,124392,127734,124388,124386,117736,124406,117732,117730,104424,117750,104420,104418,112096,121592,126334,92608,111856,121468,92384,111736,121406,92272,111676,92216,111646,92188,75232,103160,117118,93664,74992,103036,93424,112252,102974,93304,74812,93244,74782,93214,129332,75512,103294,129908,129330,93944,75388,129906,93820,75326,93758,127604,75646,128756,127602,94078,128754,124148,126452,124146,126450,117236,121844,117234,121842,103412,103410,91584,111344,121212,91360,111224,121150,91248,111164,91192,111134,91164,91150,74480,102780,91888,74360,102718,91768,111422,91708,74270,91678,129306,74620,129850,92028,74558,91966,127546,128634,124026,126202,116986,121338,102906,90848,110968,121022,90736,110908,90680,110878,90652,90638,74104,102590,91e3,74044,90940,74014,90910,74174,91070,90480,110780,90424,110750,90396,90382,73916,90556,73886,90526,90296,110686,90268,90254,73822,90334,90204,90190,71136,101112,116094,70896,100988,70776,100926,70716,70686,129204,71416,101246,129202,71292,71230,127348,71550,127346,123636,123634,116212,116210,101364,101362,79296,105200,118140,79072,105080,118078,78960,105020,78904,104990,78876,78862,70384,100732,79600,70264,100670,79480,105278,79420,70174,79390,129178,70524,129466,79740,70462,79678,127290,127866,123514,124666,115962,118266,100858,113376,122232,126654,95424,113264,122172,95328,113208,122142,95280,113180,95256,113166,95244,78560,104824,117950,95968,78448,104764,95856,113468,104734,95800,78364,95772,78350,95758,70008,100542,78712,69948,96120,78652,69918,96060,78622,96030,70078,78782,96190,94912,113008,122044,94816,112952,122014,94768,112924,94744,112910,94732,94726,78192,104636,95088,78136,104606,95032,113054,95004,78094,94990,69820,78268,69790,95164,78238,95134,94560,112824,121950,94512,112796,94488,112782,94476,94470,78008,104542,94648,77980,94620,77966,94606,69726,78046,94686,94384,112732,94360,112718,94348,94342,77916,94428,77902,94414,94296,112686,94284,94278,77870,94318,94252,94246,68336,99708,68216,99646,68156,68126,68476,68414,127162,123258,115450,99834,72416,101752,116414,72304,101692,72248,101662,72220,72206,67960,99518,72568,67900,72508,67870,72478,68030,72638,80576,105840,118460,80480,105784,118430,80432,105756,80408,105742,80396,80390,72048,101564,80752,71992,101534,80696,71964,80668,71950,80654,67772,72124,67742,80828,72094,80798,114016,122552,126814,96832,113968,122524,96800,113944,122510,96784,113932,96776,113926,96772,80224,105656,118366,97120,80176,105628,97072,114076,105614,97048,80140,97036,80134,97030,71864,101470,80312,71836,97208,80284,71822,97180,80270,97166,67678,71902,80350,97246,96576,113840,122460,96544,113816,122446,96528,113804,96520,113798,96516,96514,80048,105564,96688,80024,105550,96664,113870,96652,80006,96646,71772,80092,71758,96732,80078,96718,96416,113752,122414,96400,113740,96392,113734,96388,96386,79960,105518,96472,79948,96460,79942,96454,71726,79982,96494,96336,113708,96328,113702,96324,96322,79916,96364,79910,96358,96296,113686,96292,96290,79894,96310,66936,99006,66876,66846,67006,68976,100028,68920,99998,68892,68878,66748,69052,66718,69022,73056,102072,116574,73008,102044,72984,102030,72972,72966,68792,99934,73144,68764,73116,68750,73102,66654,68830,73182,81216,106160,118620,81184,106136,118606,81168,106124,81160,106118,81156,81154,72880,101980,81328,72856,101966,81304,106190,81292,72838,81286,68700,72924,68686,81372,72910,81358,114336,122712,126894,114320,122700,114312,122694,114308,114306,81056,106072,118574,97696,81040,106060,97680,114380,106054,97672,81028,97668,81026,97666,72792,101934,81112,72780,97752,81100,72774,97740,81094,97734,68654,72814,81134,97774,114256,122668,114248,122662,114244,114242,80976,106028,97488,80968,106022,97480,114278,97476,80962,97474,72748,81004,72742,97516,80998,97510,114216,122646,114212,114210,80936,106006,97384,80932,97380,80930,97378,72726,80950,97398,114196,114194,80916,97332,80914,97330,66236,66206,67256,99166,67228,67214,66142,67294,69296,100188,69272,100174,69260,69254,67164,69340,67150,69326,73376,102232,116654,73360,102220,73352,102214,73348,73346,69208,100142,73432,102254,73420,69190,73414,67118,69230,73454,106320,118700,106312,118694,106308,106306,73296,102188,81616,106348,102182,81608,73284,81604,73282,81602,69164,73324,69158,81644,73318,81638,122792,126934,122788,122786,106280,118678,114536,106276,114532,106274,114530,73256,102166,81512,73252,98024,81508,73250,98020,81506,98018,69142,73270,81526,98038,122772,122770,106260,114484,106258,114482,73236,81460,73234,97908,81458,97906,122762,106250,114458,73226,81434,97850,66396,66382,67416,99246,67404,67398,66350,67438,69456,100268,69448,100262,69444,69442,67372,69484,67366,69478,102312,116694,102308,102306,69416,100246,73576,102326,73572,69410,73570,67350,69430,73590,118740,118738,102292,106420,102290,106418,69396,73524,69394,81780,73522,81778,118730,102282,106394,69386,73498,81722,66476,66470,67496,99286,67492,67490,66454,67510,100308,100306,67476,69556,67474,69554,116714]];const mode_ll=" ",mode_ps=" ",mode_ml=" ",mode_al=" ",mode_pl=" ",mode_as=" ";export const subModeMap={ll:" ",ps:" ",ml:" ",al:" ",pl:" ",as:" "};const TEXT_MAP=["ABCDEFGHIJKLMNOPQRSTUVWXYZ    ","abcdefghijklmnopqrstuvwxyz    ","0123456789&\r\t,:#-.$/+%*=^     ",";<>@[\\]_`~!\r\t,:\n-.$/\"|*()?{}' "];export const MODE_TC=900,MODE_BC=901,MODE_NC=902,MODE_BC6=924,MODE_BC_SHIFT=913;function isAlpha(e){return TEXT_MAP[0].indexOf(e)>-1}function isLower(e){return TEXT_MAP[1].indexOf(e)>-1}function isMixed(e){return TEXT_MAP[2].indexOf(e)>-1}function isPunctuation(e){return TEXT_MAP[3].indexOf(e)>-1}function isTC(e){return isAlpha(e)||isLower(e)||isMixed(e)||isPunctuation(e)}function nextTC(e,t){let i=t,r=e.length,n=0;for(;i<r;){e[i]>="0"&&e[i]<="9"?n++:n=0;if(!isTC(e[i]))break;if(n>=13){i-=--n;break}i++}return e.substring(t,i)}function nextNC(e,t){let i=t,r=e.length;for(;i<r&&!(e[i]<"0"||e[i]>"9");)i++;return e.substring(t,i)}function nextBC(e,t){let i=t,r=e.length,n=0,o=0,s=!1;for(;i<r;){if(e[i]>="0"&&e[i]<="9"){n++;if(s){o=0;s=!1}}else if(isTC(e[i])){o++;if(!s){n=0;s=!0}}if(o>=5){i-=--o;break}if(n>=13){i-=--n;break}i++}return e.substring(t,i)}export function compaction(e,t=CompactionMode.Auto){let i=[];if(t===CompactionMode.Text)i=[{mode:MODE_TC,text:e}];else if(t===CompactionMode.Byte)i=[{mode:e.length%6==0?MODE_BC6:MODE_BC,text:e}];else if(t===CompactionMode.Numeric)i=[{mode:MODE_NC,text:e}];else{let t=0,r=e.length,n={mode:MODE_TC,text:""};for(;t<r;){let r=nextNC(e,t);if(r.length>=13){n={mode:MODE_NC,text:r};i.push(n);t+=r.length}else{let r=nextTC(e,t);if(r.length>=5){n={mode:MODE_TC,text:r};i.push(n);t+=r.length}else{let r=nextBC(e,t);if(1===r.length&&n.mode==MODE_TC){n={mode:MODE_BC_SHIFT,text:r};i.push(n)}else{n=r.length%6==0?{mode:MODE_BC6,text:r}:{mode:MODE_BC,text:r};i.push(n)}t+=r.length}}}}i.forEach(e=>{if(e.mode==MODE_TC){let t={mode:"al",text:""},i=[t];e.subModes=i;for(let r=0,n=e.text.length;r<n;r++){let n=e.text[r];if(isAlpha(n))if(0===r||"al"===t.mode)t.text+=n;else{t=isAlpha(e.text[r+1])?{mode:"al",text:n}:"ll"===t.mode?{mode:"as",text:n}:{mode:"al",text:n};i.push(t)}else if(isLower(n))if("ll"===t.mode)t.text+=n;else{t={mode:"ll",text:n};i.push(t)}else if(isMixed(n))if("pl"===t.mode&&isPunctuation(n))t.text+=n;else if("ml"===t.mode)t.text+=n;else{t={mode:"ml",text:n};i.push(t)}else if(isPunctuation(n))if("pl"===t.mode)t.text+=n;else{t=isPunctuation(e.text[r+1])?{mode:"pl",text:n}:{mode:"ps",text:n};i.push(t)}}}});return i}export function getIndicator(e,t,i,r,n){let o,s=~~(e/3),a=~~((t-1)/3),c=3*i+(t-1)%3,l=r-1;switch(e%3*3){case 0:o=n?l:a;break;case 3:o=n?a:c;break;case 6:o=n?c:l}return 30*s+o}export function getPattern_PDF417(e,t){return CLUSTERS[e%3][t]}export function getTCValue(e,t){let i;switch(t){case"ll":i=TEXT_MAP[1].indexOf(e);break;case"ml":i=TEXT_MAP[2].indexOf(e);break;case"al":case"as":i=TEXT_MAP[0].indexOf(e);break;case"pl":case"ps":i=TEXT_MAP[3].indexOf(e)}return i}const subModeTable={al:{ll:[27],ml:[28],pl:[28,25]},ll:{al:[28,28],ml:[28],pl:[28,25]},ml:{al:[28],ll:[27],pl:[25]},pl:{al:[29],ll:[29,27],ml:[29,28]}};export function getTCSubModeValue(e,t){let i=getTCValue(subModeMap[e],t);return i>-1?[i]:subModeTable[t][e]}export function createModules(e,t){let i=[];for(let r=0;r<e;r++)i.push(Utils.fillArray(new Array(t),null));return i}export function getAutoECL(e){const t=e.length;return t<=40?2:t<=160?3:t<=320?4:5}export function getAutoRowAndCol(e){let t,i,r=31;do{r--;i=(t=Math.ceil(e/r))/r;if(r<2)break}while(i<4);t<3&&(t=3);return{col:r,row:t}}const LRRowAddressPatterns=["221311","311311","312211","222211","213211","214111","223111","313111","322111","412111","421111","331111","241111","232111","231211","321211","411211","411121","411112","321112","312112","311212","311221","311131","311122","311113","221113","221122","221131","221221","222121","312121","321121","231121","231112","222112","213112","212212","212221","212131","212122","212113","211213","211123","211132","211141","211231","211222","211312","211321","211411","212311"],CRowAddressPatterns=["112231","121231","122131","131131","131221","132121","141121","141211","142111","133111","132211","131311","122311","123211","124111","115111","114211","114121","123121","123112","122212","122221","121321","121411","112411","113311","113221","113212","113122","122122","131122","131113","122113","113113","112213","112222","112312","112321","111421","111331","111322","111232","111223","111133","111124","111214","112114","121114","121123","121132","112132","112141"],VersionTable=[[1,11,7,1,9],[1,14,7,8,8],[1,17,7,36,36],[1,20,8,19,19],[1,24,8,9,17],[1,28,8,25,33],[2,8,8,1,1],[2,11,9,1,9],[2,14,9,8,8],[2,17,10,36,36],[2,20,11,19,19],[2,23,13,9,17],[2,26,15,27,35],[3,6,12,1,1,1],[3,8,14,7,7,7],[3,10,16,15,15,15],[3,12,18,25,25,25],[3,15,21,37,37,37],[3,20,26,1,33,17],[3,26,32,1,17,9],[3,32,38,21,37,29],[3,38,44,15,47,31],[3,44,50,1,9,49],[4,4,8,47,43,19],[4,6,12,1,1,1],[4,8,14,7,7,7],[4,10,16,15,15,15],[4,12,18,25,25,25],[4,15,21,37,37,37],[4,20,26,1,33,17],[4,26,32,1,17,9],[4,32,38,21,37,29],[4,38,44,15,47,31],[4,44,50,1,9,49]];function makeRange(e,t){const i=[];let r=0,n=e;for(;r<t;){n>52&&(n%=52);i.push(n);r++;n++}return i}export function findVersionTable(e,t){for(let i=0,r=e.length;i<r;i++){let r=e[i];const[n,o,s,a,c,l]=r,d=o*n,h=o*n-s-2;if(t(r={rows:o,cols:n,total:d,ecCws:s,nonEcCw:d-s,bits:8*(6*~~(h/5)+h%5)})){r.rowAssignment={left:makeRange(a,o),right:makeRange(c,o),center:l?makeRange(l,o):null};const e=[];let t=0;for(;t<=o;){const i=(a+t-1)%3;e.push(i);t++}r.cluster=e;return r}}return null}export function getVersionVariantColPrior(e){let t=1,i=null;for(;t<=4;){const r=findVersionTable(VersionTable,i=>i.cols===t&&i.nonEcCw>=e);i?r&&r.rows>i.rows&&(i=r):i=r;t++}return i}export function getVersionVariantRowPrior(e){return findVersionTable(VersionTable,t=>4===t.cols&&t.nonEcCw>=e)}export function getVersionVariant(e,t){return findVersionTable(VersionTable,i=>i.cols===t&&i.rows===e)}export function getVersionVariantByCol(e,t){return findVersionTable(VersionTable,i=>i.cols===e&&i.nonEcCw>=t)}export function getECCBVersionVariantByCol(e,t){return findVersionTable(VersionTable,i=>i.cols===e&&i.bits>=t)}export function getRowAddressPatterns(e,t,i){let r;switch(t){case"L":r=LRRowAddressPatterns[e.left[i]-1];break;case"R":r=LRRowAddressPatterns[e.right[i]-1];break;default:r=CRowAddressPatterns[e.center[i]-1]}return Utils.toZeroOnePattern(Utils.str2Array(r),!0)}export function getPattern(e,t){return CLUSTERS[e][t]}const testDigit=function(e){return/^\d$/.test(e)},abs=function(e){var t;if(void 0!==e){(t=new BigNumber(e)).sign=1;return t}},isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},isValidType=function(e){return["number"==typeof e,"string"==typeof e&&e.length>0,isArray(e)&&e.length>0,e instanceof BigNumber].some((function(e){return!0===e}))},errors={invalid:"Invalid Number","division by zero":"Invalid Number - Division By Zero"};export class BigNumber{constructor(e){var t;this.number=[];this.sign=1;this.rest=0;if(isValidType(e))if(isArray(e)){if(e.length&&"-"===e[0]||"+"===e[0]){this.sign="+"===e[0]?1:-1;e.shift(0)}for(t=e.length-1;t>=0;t--)if(!this.addDigit(e[t]))return}else{if("-"===(e=e.toString()).charAt(0)||"+"===e.charAt(0)){this.sign="+"===e.charAt(0)?1:-1;e=e.substring(1)}for(t=e.length-1;t>=0;t--)if(!this.addDigit(parseInt(e.charAt(t),10)))return}else this.number=errors.invalid}addDigit(e){if(!testDigit(e)){this.number=errors.invalid;return!1}this.number.push(e);return this}isEven(){return this.number[0]%2==0}_compare(e){var t,i;if(!isValidType(e))return null;t=new BigNumber(e);if(this.sign!==t.sign)return this.sign;if(this.number.length>t.number.length)return this.sign;if(this.number.length<t.number.length)return-1*this.sign;for(i=this.number.length-1;i>=0;i--){if(this.number[i]>t.number[i])return this.sign;if(this.number[i]<t.number[i])return-1*this.sign}return 0}gt(e){return this._compare(e)>0}gte(e){return this._compare(e)>=0}equals(e){return 0===this._compare(e)}lte(e){return this._compare(e)<=0}lt(e){return this._compare(e)<0}add(e){var t;if(void 0===e)return this;t=new BigNumber(e);if(this.sign!==t.sign){if(this.sign>0){t.sign=1;return this.minus(t)}this.sign=1;return t.minus(this)}this.number=BigNumber._add(this,t);return this}minus(e){var t;if(void 0===e)return this;t=new BigNumber(e);if(this.sign!==t.sign){this.number=BigNumber._add(this,t);return this}this.sign=this.lt(t)?-1:1;this.number=abs(this).lt(abs(t))?BigNumber._subtract(t,this):BigNumber._subtract(this,t);return this}static _add(e,t){var i,r=0,n=Math.max(e.number.length,t.number.length);for(i=0;i<n||r>0;i++){e.number[i]=(r+=(e.number[i]||0)+(t.number[i]||0))%10;r=Math.floor(r/10)}return e.number}static _subtract(e,t){var i,r=0,n=e.number.length;for(i=0;i<n;i++){e.number[i]-=(t.number[i]||0)+r;e.number[i]+=10*(r=e.number[i]<0?1:0)}i=0;n=e.number.length-1;for(;0===e.number[n-i]&&n-i>0;)i++;i>0&&e.number.splice(-i);return e.number}multiply(e){if(void 0===e)return this;var t,i,r=new BigNumber(e),n=0,o=[];if(this.isZero()||r.isZero())return new BigNumber(0);this.sign*=r.sign;for(t=0;t<this.number.length;t++)for(n=0,i=0;i<r.number.length||n>0;i++){o[t+i]=(n+=(o[t+i]||0)+this.number[t]*(r.number[i]||0))%10;n=Math.floor(n/10)}this.number=o;return this}divide(e){if(void 0===e)return this;var t,i,r=new BigNumber(e),n=[],o=new BigNumber(0);if(r.isZero()){this.number=errors["division by zero"];return this}if(this.isZero()){this.rest=new BigNumber(0);return this}this.sign*=r.sign;r.sign=1;if(1===r.number.length&&1===r.number[0]){this.rest=new BigNumber(0);return this}for(t=this.number.length-1;t>=0;t--){o.multiply(10);o.number[0]=this.number[t];n[t]=0;for(;r.lte(o);){n[t]++;o.minus(r)}}t=0;i=n.length-1;for(;0===n[i-t]&&i-t>0;)t++;t>0&&n.splice(-t);this.rest=o;this.number=n;return this}mod(e){return this.divide(e).rest}power(e){if(void 0!==e){var t,i;if(isValidType(e)){if((i=new BigNumber(e)).isZero())return new BigNumber(1);if("1"===i.val())return this;t=new BigNumber(this);this.number=[1];for(;i.gt(0);)if(i.isEven()){t.multiply(t);i.div(2)}else{this.multiply(t);i.subtract(1)}return this}this.number=errors.invalid}}abs(){this.sign=1;return this}isZero(){var e;for(e=0;e<this.number.length;e++)if(0!==this.number[e])return!1;return!0}toString(){var e,t="";if("string"==typeof this.number)return this.number;for(e=this.number.length-1;e>=0;e--)t+=this.number[e];return this.sign>0?t:"-"+t}}export class PDF417Base extends TwoDimensionalBarcode{validate(){const{text:e}=this.encodeConfig;if(!/^[\x00-\xFF]+$/.test(e))throw new InvalidTextException(e)}encodeNC(e){let t=e.text,i=[];Utils.sliceString(t,44,e=>{let t=new BigNumber("1"+e);const r=[];for(;;){let e=new BigNumber(t).mod(900);t.divide(new BigNumber(900));r.unshift(+e.toString());if(t.lt(1))break}i=i.concat(r)});i.unshift(MODE_NC);return i}encodeBC(e){let t=e.text,i=[];Utils.sliceString(t,6,e=>{if(6===e.length){let t=5,r=0;const n=[];Utils.sliceString(e,1,e=>{r+=e.charCodeAt(0)*Math.pow(256,t--)});let o=0,s=Math.floor(r/Math.pow(900,o))%900;do{n.unshift(s);s=Math.floor(r/Math.pow(900,++o))%900}while(s>0);for(;n.length<5;)n.unshift(0);i=i.concat(n)}else Utils.sliceString(e,1,e=>{i.push(e.charCodeAt(0))})});i.unshift(e.mode);return i}encodeTC(e){let t=[],i="al";e.subModes.forEach(e=>{i!==e.mode&&(t=t.concat(getTCSubModeValue(e.mode,i)));Utils.sliceString(e.text,1,i=>{t.push(getTCValue(i,e.mode))});"ps"!==e.mode&&"as"!==e.mode&&(i=e.mode)});let r=[MODE_TC];Utils.sliceArray(t,2,e=>{2===e.length?r.push(30*e[0]+e[1]):r.push(30*e[0]+29)});return r}encode(e){let t=[];e.forEach(e=>{switch(e.mode){case MODE_TC:t=t.concat(this.encodeTC(e));break;case MODE_BC:case MODE_BC6:case MODE_BC_SHIFT:t=t.concat(this.encodeBC(e));break;case MODE_NC:t=t.concat(this.encodeNC(e))}});return t}convertToShape(e,t){const{height:i,quietZone:r}=this.encodeConfig,n=i/e.length,o=e[0].reduce((e,t)=>e+=t.length,0)+r.right+r.left,s=e.length*n+r.top+r.bottom,a=new VerticalLayoutArea,c=new MatrixSymbolArea(o,s,n);c.setStyle({padding:{top:r.top,right:r.right,bottom:r.bottom,left:r.left}});a.append(c);if(!t){e.forEach(e=>{e.forEach(e=>{Utils.combineTruthy(e).forEach(e=>{0!==e?c.append(e,n):c.space()})})});this.shapes=a.toShapes()}this.mainArea=a;this.size=a.getSize()}adjustDesiredSize(){const{width:e}=this.size;let{desiredSize:t,containerWidth:i}=this.encodeConfig,r=i/e;t.forceRounding&&(r=(r=~~r)<1?1:r);this.applyDesiredSize(r)}getMainArea(){return this.mainArea}}PDF417Base.PAD=900;export class PDF417Encoder extends PDF417Base{constructor(e){e.merge(PDF417Encoder.DefaultConfig);super(e);let{errorCorrectionLevel:t,columns:i,rows:r,compact:n}=this.config,{text:o}=this.encodeConfig;this.text=o;this.ecl="auto"===t?t:+t;this.columns="auto"===i?i:+i;this.rows="auto"===r?r:+r;this.compact=!!n}validate(){super.validate();const{errorCorrectionLevel:e,rows:t,columns:i}=this.config;if(Utils.isNumberLike(e)&&(e<0||e>8))throw new InvalidOptionsException({errorCorrectionLevel:e},"ErrorCorrectionLevel is from 0 - 8.");if(Utils.isNumberLike(t)&&(t<3||t>90))throw new InvalidOptionsException({rows:t},"Rows is from 3 - 90.");if(Utils.isNumberLike(i)&&(i<1||i>30))throw new InvalidOptionsException({columns:i},"Columns is from 1 - 30.")}genEcc(){let{data:e,ecl:t,columns:i,rows:r}=this;e[0]===MODE_TC&&e.shift();"auto"===t&&(this.ecl=t=getAutoECL(e));let n=Math.pow(2,t+1),o=e.length+1+n;if("auto"===r&&"auto"===i){let{col:e,row:t}=getAutoRowAndCol(o);this.columns=i=e;this.rows=r=t}else if("auto"===r){if((r=Math.ceil(o/i))>90)throw new InvalidOptionsException({columns:i},"Columns is not large enough");r=r<3?3:r;this.rows=r}else if("auto"===i){if((i=Math.ceil(o/r))>30)throw new InvalidOptionsException({rows:r},"Rows is not large enough");this.columns=i}let s=i*r-n;e.unshift(s);if(e.length>PDF417Encoder.MAX_DATA_NUM||e.length>s)throw new TextTooLongException;for(;e.length<s;)e.push(PDF417Base.PAD);this.ecc=generateECC(e,this.ecl)}calculateData(){let e=compaction(this.text);this.data=this.encode(e);this.genEcc();let{data:t,ecc:i,columns:r,rows:n,ecl:o,compact:s}=this,a=t.concat(i),c=createModules(n,r);a.forEach((e,t)=>{let i=Math.floor(t/r),n=t%r;c[i][n]=getPattern_PDF417(i,e)});let l=[];c.forEach((e,t)=>{let i=getPattern_PDF417(t,getIndicator(t,n,o,r)),a=getPattern_PDF417(t,getIndicator(t,n,o,r,!0)),c=[PDF417Encoder.START,i.toString(2)];e.forEach(e=>{c.push(e.toString(2))});if(s)c.push(PDF417Encoder.COMPACT_END);else{c.push(a.toString(2));c.push(PDF417Encoder.END)}l.push(c)});return l}}PDF417Encoder.DefaultConfig={errorCorrectionLevel:"auto",columns:"auto",rows:"auto",compact:!1,height:60,quietZone:{top:2,left:2,right:2,bottom:2}};PDF417Encoder.START="11111111010101000";PDF417Encoder.END="111111101000101001";PDF417Encoder.COMPACT_END="1";PDF417Encoder.MAX_DATA_NUM=925;export class MicroPDF417Encoder extends PDF417Base{constructor(e){e.merge(MicroPDF417Encoder.DefaultConfig);super(e);let{symbolVersion:t,compactionMode:i,segmentIndex:r,fileID:n,structuredAppend:o,optionalFields:s}=this.config,{text:a}=this.encodeConfig;this.text=a;this.symbolVersion=t;this.versionMeta=null;this.compactionMode=i;this.structuredAppendEnabled=o;this.segmentIndex=r;this.fileID=n;this.optionalFields=s;this.segmentCount=0;this.structuredAppendCws=[]}validate(){super.validate();const{compactionMode:e,symbolVersion:t,segmentIndex:i,fileID:r}=this.config,{text:n}=this.encodeConfig;if(e===CompactionMode.Numeric&&!/^[\d]*$/.test(n))throw new InvalidOptionsException({compactionMode:e,text:n},"CompactionMode is numeric, but the text is not.");if(!CompactionMode.has(e))throw new InvalidOptionsException({compactionMode:e});if(!SymbolVersion.has(t))throw new InvalidOptionsException({symbolVersion:t});if(i<0||i>99998||r<0||r>899)throw new InvalidOptionsException({segmentIndex:i},"SegmentIndex should in range 0 - 99998")}_buildRow(e,t){const{columns:i,versionMeta:{rowAssignment:r,cluster:n}}=this;let o=getRowAddressPatterns(r,"L",t),s=getRowAddressPatterns(r,"R",t),a=[o];const c=n[t],l=e.map(e=>getPattern(c,e));switch(i){case 1:a.push(l[0].toString(2));break;case 2:a.push(l[0].toString(2));a.push(l[1].toString(2));break;case 3:a.push(l[0].toString(2));a.push(getRowAddressPatterns(r,"C",t));a.push(l[1].toString(2));a.push(l[2].toString(2));break;default:a.push(l[0].toString(2));a.push(l[1].toString(2));a.push(getRowAddressPatterns(r,"C",t));a.push(l[2].toString(2));a.push(l[3].toString(2))}return a=[...a,s,MicroPDF417Encoder.StopBar]}_buildStructAppend(){const{segmentIndex:e,segmentCount:t,fileID:i,optionalFields:r}=this;let n=[MicroPDF417Encoder.StructuredAppendMarker],o=this.encodeNC({text:Utils.strPadStart(e+"",5,"0")});o.shift();n.push(...o);n.push(i);if(r.segmentCount){n.push(MicroPDF417Encoder.StructuredAppendOptionalFieldsMarker);n.push(MicroPDF417Encoder.StructuredAppendOptionalFieldTags.SegmentCount);let e=this.encodeNC({text:Utils.strPadStart(t+"",5,"0")});e.shift();n.push(...e)}e===t-1&&n.push(MicroPDF417Encoder.StructuredAppendTerminator);return n}_splitStruct(e){let t,{symbolVersion:i,segmentIndex:r}=this;if(i===SymbolVersion.RowPriorAuto||i===SymbolVersion.ColumnPriorAuto)t=getVersionVariant(44,4);else{let[e,r]=i.split("*");t=getVersionVariant(+r,+e)}const n=this._buildStructAppend(),o=t.nonEcCw-n.length;if(o<0)throw new TextTooLongException;let s=Math.ceil(e.length/o);e.length-o*(s-1)===o&&s++;if(r>=s)throw new InvalidOptionsException({segmentIndex:r},`The max segment index is ${s-1}.`);if(s>99999)throw new TextTooLongException;let a;a=r===s-1?e.slice(o*r):e.slice(o*r,o*(r+1));this.segmentCount=s;return a}genEcc(){let e,{data:t,symbolVersion:i,structuredAppendCws:r}=this,n=t.length+r.length;if(i===SymbolVersion.RowPriorAuto)e=getVersionVariantRowPrior(n);else if(i===SymbolVersion.ColumnPriorAuto)e=getVersionVariantColPrior(n);else{let[t,r]=i.split("*");e=getVersionVariant(+r,+t)}const o=e.rows*e.cols-e.ecCws;if(o<n)throw new TextTooLongException;let s=o-n;for(;s>0;){t.push(PDF417Base.PAD);s--}this.versionMeta=e;this.ecc=generateECCForMicro([...t,...r],e.ecCws);this.rows=e.rows;this.columns=e.cols}calculateData(){let e=compaction(this.text,this.compactionMode),t=this.encode(e);if(this.structuredAppendEnabled){this.data=this._splitStruct(t);this.structuredAppendCws=this._buildStructAppend()}else this.data=t;this.genEcc();let{data:i,ecc:r,columns:n,rows:o,structuredAppendCws:s}=this,a=i.concat(s).concat(r),c=createModules(o,n);a.forEach((e,t)=>{let i=Math.floor(t/n),r=t%n;c[i][r]=e});let l=[];c.forEach((e,t)=>{l.push(this._buildRow(e,t))});return l}}MicroPDF417Encoder.DefaultConfig={symbolVersion:SymbolVersion.ColumnPriorAuto,compactionMode:CompactionMode.Auto,structuredAppend:!1,segmentIndex:0,fileID:0,height:60,quietZone:{top:1,left:1,right:1,bottom:1},optionalFields:{segmentCount:!0}};MicroPDF417Encoder.StopBar="1";MicroPDF417Encoder.StructuredAppendMarker=928;MicroPDF417Encoder.StructuredAppendOptionalFieldsMarker=923;MicroPDF417Encoder.StructuredAppendTerminator=922;MicroPDF417Encoder.StructuredAppendOptionalFieldTags={SegmentCount:1};Barcode.registerEncoder("PDF417",PDF417Encoder);Barcode.registerEncoder("MicroPDF417",MicroPDF417Encoder);export class CCA extends PDF417Base{constructor(e,t=4,i=1,r){const n={text:e,unitSize:i,quietZone:{top:0,right:0,left:0,bottom:0}};r&&(n.height=r);super(new Option(n));this.columns=t;let{text:o}=this.encodeConfig;this.text=o.replace(/\(|\)/g,"");this.bitBuffer=new BitBuffer;this._gpdEncodation=new GeneralPurposeDataEncodation(this.bitBuffer);const s=o.split(/\(|\)/);s.shift();let a=0;const c=[];for(;a<s.length;)c.push({ai:s[a++],data:s[a++]});this.aiGroup=c;this.autoHeight=!r}_buildRow(e,t){const{columns:i,versionMeta:{rowAssignment:r,cluster:n}}=this;let o=getRowAddressPatterns(r,"L",t),s=getRowAddressPatterns(r,"R",t),a=3===i?[]:[o];const c=n[t],l=e.map(e=>getPattern(c,e));switch(i){case 2:a.push(l[0].toString(2));a.push(l[1].toString(2));break;case 3:a.push(l[0].toString(2));a.push(getRowAddressPatterns(r,"C",t));a.push(l[1].toString(2));a.push(l[2].toString(2));break;default:a.push(l[0].toString(2));a.push(l[1].toString(2));a.push(getRowAddressPatterns(r,"C",t));a.push(l[2].toString(2));a.push(l[3].toString(2))}return a=[...a,s,MicroPDF417Encoder.StopBar]}_encode_10Date(e){const{bitBuffer:t,text:i}=this,r=384*+e.substr(0,2)+32*(+e.substr(2,2)-1)+ +e.substr(4,2);if(isNaN(r))throw new InvalidTextException(i,"The text doesn't contains a vaild product date or expire date");t.put(r,16)}_getMethod_11Mode(e){let t=0,i=0;for(let r=0,n=e.length;r<n;r++){const n=e[r];if("*,-./".indexOf(n)>-1)return"Alphanumeric";n>="A"&&n<="Z"&&t++;n>="0"&&n<="9"&&i++}return t>i?"Alpha":"Numeric"}_encode_11(){const{bitBuffer:e,aiGroup:t}=this;let i="";const r=t[0];e.putBits("11");const n=/^([1-9][0-9]?[0-9]?)?([A-Z][0-9A-Z*,-./]*)/.exec(r.data);let o=n[1]||"",s=n[2][0];const a=o+s;o=o?+o:0;const c=r.data.substr(a.length);switch(this._getMethod_11Mode(c)){case"Alphanumeric":e.putBits("0");break;case"Alpha":e.putBits("11");break;case"Numeric":e.putBits("10")}const l=t[1];if(l)switch(l.ai){case"21":i=c+Constants.FNC1+l.data;e.putBits("10");break;case"8004":i=c+Constants.FNC1+l.data;e.putBits("11");break;default:i=c+Constants.FNC1+l.ai+l.data;e.putBits("0")}else{i=c;e.putBits("0")}t.length>2&&Utils.loop(e=>{const r=t[e];i=i+Constants.FNC1+r.ai+r.data},{from:2,to:t.length-1});const d=getSupportedUppercaseAlphabetic(s);if(o<31&&d){e.putBit(o,5);e.putBits(d)}else{e.putBits("11111");e.put(o,10);e.put(s.charCodeAt(0)-65,5)}return i}_encode_10(){const{bitBuffer:e,aiGroup:t}=this;let i="";const r=t[0];e.putBits("10");if("11"===r.ai||"17"===r.ai){this._encode_10Date(r.data);e.putBit("17"===r.ai);if(t.length>1){if(t[1]&&"10"===t[1].ai){i=t[1].data;t.length>2&&Utils.loop(e=>{const r=t[e];i=i+Constants.FNC1+r.ai+r.data},{from:2,to:t.length-1})}else{i=Constants.FNC1;Utils.loop(e=>{const r=t[e];i=i+r.ai+r.data},{from:1,to:t.length-1})}}else i=Constants.FNC1}else if("10"===r.ai){e.putBits("11");i=r.data;t.length>1&&Utils.loop(e=>{const r=t[e];i=i+Constants.FNC1+r.ai+r.data},{from:1,to:t.length-1})}return i}_encode_0(){const{bitBuffer:e,aiGroup:t,text:i}=this;e.putBits("0");if(!t.length)return i;let r="";r=t[0].ai+t[0].data;t.length>1&&Utils.loop(e=>{const i=t[e];r=r+Constants.FNC1+i.ai+i.data},{from:1,to:t.length-1});return r}_encodeMethod(){const{text:e,aiGroup:t}=this,i=t[0];if(i)if("10"===i.ai||"11"===i.ai||"17"===i.ai)this.method="10";else if("90"===i.ai){const t=/^90(?:[1-9][0-9]?[0-9]?)?[A-Z]/.test(e);this.method=t?"11":"0"}else this.method="0";else this.method="0"}getVersionVariant(){const{bitBuffer:e,columns:t}=this;this.versionMeta=getVersionVariant_CCA(t,e.length)}_encode(){this._encodeMethod();const{method:e,columns:t}=this;let i="";switch(e){case"10":i=this._encode_10();break;case"11":i=this._encode_11();break;case"0":i=this._encode_0()}this._gpdEncodation.encodeGeneralData(i,t);this.getVersionVariant();if(!this.versionMeta)throw new TextTooLongException;this._gpdEncodation.padTo(this.versionMeta.bits)}genEcc(){const{bitBuffer:e,versionMeta:t}=this,i=[];encode928(e.getGroupedBits(16),i,e.length);this.data=i;this.ecc=generateECCForMicro(i,t.ecCws);this.rows=t.rows;this.autoHeight&&(this.encodeConfig.height=2*t.rows)}calculateData(){this._encode();this.genEcc();let{data:e,ecc:t,columns:i,rows:r}=this,n=e.concat(t),o=createModules(r,i);n.forEach((e,t)=>{let r=Math.floor(t/i),n=t%i;o[r][n]=e});let s=[];o.forEach((e,t)=>{s.push(this._buildRow(e,t))});return s}}class CCBInnerEncoder extends CCA{getVersionVariant(){const{bitBuffer:e,columns:t}=this;this.versionMeta=getECCBVersionVariantByCol(t,e.length)}getBytes(){this._encode();return this.bitBuffer.getGroupedBits(8)}}export class CCB extends MicroPDF417Encoder{constructor(e,t=4,i=1,r){const n={text:e,unitSize:i,compactionMode:"byte",quietZone:{top:0,right:0,left:0,bottom:0}};r&&(n.height=r);super(new Option(n));this.columns=t;const o=new CCBInnerEncoder(e,t,i,r);this.bytes=o.getBytes();this.autoHeight=!r}genEcc(){let{data:e,columns:t}=this,i=e.length;const r=getVersionVariantByCol(t,i),n=r.rows*r.cols-r.ecCws;if(n<i)throw new TextTooLongException;let o=n-i;for(;o>0;){e.push(PDF417Base.PAD);o--}this.versionMeta=r;this.ecc=generateECCForMicro(e,r.ecCws);this.rows=r.rows;this.columns=r.cols;this.autoHeight&&(this.encodeConfig.height=2*r.rows)}encode(){const{bytes:e}=this;let t=[];Utils.sliceArray(e,6,e=>{if(6===e.length){let i=5,r=0;const n=[];e.forEach(e=>{r+=e*Math.pow(256,i--)});let o=0,s=Math.floor(r/Math.pow(900,o))%900;do{n.unshift(s);s=Math.floor(r/Math.pow(900,++o))%900}while(s>0);for(;n.length<5;)n.unshift(0);t=t.concat(n)}else e.forEach(e=>{t.push(e)})});t.unshift(e.length%6==0?MODE_BC6:MODE_BC);t.unshift(920);return t}calculateData(){this.data=this.encode();this.genEcc();let{data:e,ecc:t,columns:i,rows:r}=this,n=e.concat(t),o=createModules(r,i);n.forEach((e,t)=>{let r=Math.floor(t/i),n=t%i;o[r][n]=e});let s=[];o.forEach((e,t)=>{s.push(this._buildRow(e,t))});return s}}const LinkageVersion={CCA:"CCA",CCB:"CCB"};export class GS1DataBarBase extends OneDimensionalBarcode{constructor(e){e.merge(GS1DataBarBase.DefaultConfig);super(e);let{config:{linkage:t,hideLinkageText:i,hideAIText:r}}=this;this.linkageText=t;this.linkage=!!t;this.hideLinkageText=i;this.hideAIText=r}static combins(e,t){let i,r,n,o,s;if(e-t>t){o=t;n=e-t}else{o=e-t;n=t}s=1;r=1;for(i=e;i>n;i--){s*=i;if(r<=o){s/=r;r++}}for(;r<=o;r++)s/=r;return s}static getRSSwidths(e,t,i,r,n){let o,s,a,c,l,d=0;const h=[];for(o=0;o<i-1;o++){for(s=1,d|=1<<o;;s++,d&=~(1<<o)){c=GS1DataBarBase.combins(t-s-1,i-o-2);!n&&0==d&&t-s-(i-o-1)>=i-o-1&&(c-=GS1DataBarBase.combins(t-s-(i-o),i-o-2));if(i-o-1>1){l=0;for(a=t-s-(i-o-2);a>r;a--)l+=GS1DataBarBase.combins(t-s-a-1,i-o-3);c-=l*(i-1-o)}else t-s>r&&c--;if((e-=c)<0)break}e+=c;t-=s;h[o]=s}h[o]=t;return h}static getRSSvalue(e,t,i,r){let n,o,s,a,c,l,d,h=0,u=0;for(n=a=0;a<t;a++)n+=e[a];for(o=0;o<t-1;o++){for(s=1,u|=1<<o;s<e[o];s++,u&=~(1<<o))l=GS1DataBarBase.combins(n-s-1,t-o-2);!r&&0==u&&n-s-(t-o-1)>=t-o-1&&(l-=GS1DataBarBase.combins(n-s-(t-o),t-o-2));if(t-o-1>1){d=0;for(c=n-s-(t-o-2);c>i;c--)d+=GS1DataBarBase.combins(n-s-c-1,t-o-3);l-=d*(t-1-o)}else n-s>i&&(h+=--l);n-=s}return h}static getGroup(e,t){for(let i=0,r=e.length;i<r;i++){const r=e[i];if(t>=r[0]&&t<=r[1])return{range:{from:r[0],to:r[1]},preTotal:r[2],oddModules:r[3],evenModules:r[4],oddElements:r[5],evenElements:r[6],oddTotal:r[7],evenTotal:r[8]}}}static getChecksum(e,t){return e.reduce((e,i,r)=>e+=i*t[r],0)}static makeComplementPattern(e){let t="";Utils.loop(i=>{t+="1"===e[i]?"0":"1"},e.length);return t}static makeAlternatePattern(e,t){let i="",r=!t;Utils.loop(()=>{i+=r?"1":"0";r=!r},e);return i}static makeComplexPattern(e){let t="",i="",r=!1;Utils.loop(n=>{if("0"===e[n]){if(r){t+=Utils.strRepeat("0",i.length);i=""}i+="0";r=!1}else{if(!r){t+=GS1DataBarBase.makeAlternatePattern(i.length);i=""}i+="1";r=!0}},e.length);return t+=r?Utils.strRepeat("0",i.length):GS1DataBarBase.makeAlternatePattern(i.length)}convertToShape(e,t){this.linkage?this._convertToShapeForLinkage(e,t):super.convertToShape(e,t)}getLinkageOffset(e,t){}getLinkageSepPattern(e){}_convertToShapeForLinkage(e,t){let{label:i,encodeConfig:{quietZone:r,isLabelBottom:n,height:o,showLabel:s,fontSizeInUnit:a},style:{textAlign:c,unitValue:l},linkageText:d,config:{linkageVersion:h,linkageHeight:u},linkageColumnCnt:p}=this;const g=h===LinkageVersion.CCA?new CCA(d,p,l,u):new CCB(d,p,l,u);g.toSymbol();const m=g.getMainArea(),f=this.getLinkageSepPattern(e),C=m.getSize();let b=0;i&&s&&(b=a);o=o-C.height-1;const x=e.length,S=o,B=this.getLinkageOffset(e,C.width),E=new VerticalLayoutArea,D=new SymbolArea(x,S),w=new SymbolArea(x,1);E.setStyle({padding:{top:r.top,right:r.right,bottom:r.bottom,left:r.left}});D.setStyle({margin:{left:B.symbolOffset}});w.setStyle({margin:{left:B.symbolOffset}});m.setStyle({margin:{left:B.linkageOffset}});const _=D.getSize(),P=new LabelArea(_.width,b,c);if(n){E.append(m);E.append(w);E.append(D);E.append(P)}else{E.append(P);E.append(m);E.append(w);E.append(D)}if(!t){w.fromPattern(f);D.fromPattern(e);P.append({text:i});this.shapes=E.toShapes()}this.size=E.getSize()}}GS1DataBarBase.DefaultConfig={linkage:"",linkageVersion:"CCA",hideLinkageText:!1,hideAIText:!1};GS1DataBarBase.LinkageVersion=LinkageVersion;export class Expanded extends GS1DataBarBase{constructor(e){super(e);let{encodeConfig:{text:t},linkage:i,hideLinkageText:r,linkageText:n,hideAIText:o}=this;this.text=t.replace(/\(|\)/g,"");this.label=t;i&&!r&&(this.label+=n);o&&(this.label=this.label.replace(/\(\w*\)/g,""));this._bitBuffer=new BitBuffer;this._gpdEncodation=new GS1GeneralPurposeDataEncodation(this._bitBuffer);this.finderPatternSeq=null;this.symbolContentSize=null;this.linkageColumnCnt=4}static getFinderPatternSeq(e){const t=~~((e-3)/2);return Expanded.FinderPatternSeq[t]}static isVersion1Finder(e){return["A1","B1","C1","D1","E1","F1"].indexOf(e)>-1}_getSubsetWidth(e,t=!1){const i=GS1DataBarBase.getGroup(Expanded.Group,e),r=~~((e-i.preTotal)/i.evenTotal),n=(e-i.preTotal)%i.evenTotal,o=GS1DataBarBase.getRSSwidths(r,i.oddModules,4,i.oddElements,!1),s=GS1DataBarBase.getRSSwidths(n,i.evenModules,4,i.evenElements,!0),a=[];Utils.loop(e=>{a.push(o[e]);a.push(s[e])},4);return t?a:a.reverse()}_getChecksum(e){let t=0;e.forEach((e,i)=>{let r,n;if(0===i){r=this.finderPatternSeq[0];n=!1}else{const e=i-1;r=this.finderPatternSeq[1+~~(e/2)];n=Utils.isEven(e)}let o=Expanded.ChecksumWeight[r][n?"left":"right"];o=n?o:o.concat().reverse();t+=GS1DataBarBase.getChecksum(e,o)});return t=t%211+211*(this.symbolContentSize-4)}_getContent(e){const t=[];e.forEach((e,i)=>{if(Utils.isEven(i)){t.push(...e);const r=this.finderPatternSeq[~~(i/2)];t.push(...Expanded.FinderPattern[r])}else t.push(...e)});return t}_addLength(e){const{_bitBuffer:t}=this,i=1+~~((t.length+11)/12);t.putBitAt(!Utils.isEven(i),1+e);t.putBitAt(i>14,2+e)}_encode(){const{text:e}=this;Expanded.MethodReg_0100.test(e)?this._encode_0100():Expanded.MethodReg_0101.test(e)?this._encode_0101():Expanded.MethodReg_0111000_0111111.test(e)?this._encode_0111000_0111111():Expanded.MethodReg_01100.test(e)?this._encode_01100():Expanded.MethodReg_01101.test(e)?this._encode_01101():Expanded.MethodReg_1.test(e)?this._encode_1():this._encode_00()}_encode_1(){const{text:e,_bitBuffer:t,_gpdEncodation:i}=this,r=Expanded.MethodReg_1.exec(e),n=r[2];t.putBits("1");t.putBits("00");t.put(+n[0],4);Utils.sliceString(n.substr(1),3,e=>{t.put(+e,10)});i.encode(r[4]);this._addLength(1)}_encode_0100(){const{text:e,_bitBuffer:t}=this,i=Expanded.MethodReg_0100.exec(e),r=i[2],n=+i[4];if(n>32767)throw new InvalidTextException(e,"With method 0100, the weight should not larger than 32767.");t.putBits("0100");Utils.sliceString(r,3,e=>{t.put(+e,10)});t.put(n,15)}_encode_0101(){const{text:e,_bitBuffer:t}=this,i=Expanded.MethodReg_0101.exec(e),r=i[2],n="2"==i[4][0],o=+i[5];if(n&&o>999||!n&&o>22767)throw new InvalidTextException(e,`With method 0101, the weight should not larger than ${o}.`);t.putBits("0101");Utils.sliceString(r,3,e=>{t.put(+e,10)});t.put(n?o:o+1e4,15)}_encode_0111000_0111111(){const{text:e,_bitBuffer:t}=this,i=Expanded.MethodReg_0111000_0111111.exec(e),r=i[2];let n=+i[6][1];"1"===i[4][1]&&n--;n+=56;t.put(n,7);Utils.sliceString(r,3,e=>{t.put(+e,10)});t.put(+(i[4][3]+i[5]),20);const o=/^(\d{2})(\d{2})(\d{2})$/.exec(i[7]);t.put(384*+o[1]+32*(+o[2]-1)+ +o[3],16)}_encode_01100(){const{text:e,_bitBuffer:t,_gpdEncodation:i}=this,r=Expanded.MethodReg_01100.exec(e),n=r[2];t.putBits("01100");t.putBits("00");Utils.sliceString(n,3,e=>{t.put(+e,10)});t.put(+r[4],2);i.encode(r[5]);this._addLength(5)}_encode_01101(){const{text:e,_bitBuffer:t,_gpdEncodation:i}=this,r=Expanded.MethodReg_01101.exec(e),n=r[2];t.putBits("01101");t.putBits("00");Utils.sliceString(n,3,e=>{t.put(+e,10)});t.put(+r[4],2);t.put(+r[5],10);i.encode(r[6]);this._addLength(5)}_encode_00(){const{text:e,_bitBuffer:t,_gpdEncodation:i}=this;t.putBits("00");t.putBits("00");i.encode(e);this._addLength(2)}makeDataWidth(){const{_bitBuffer:e,linkage:t}=this;e.putBit(t);this._encode();const i=1+~~((e.length+11)/12),r=e.getGroupedBits(12).map((e,t)=>this._getSubsetWidth(e,!Utils.isEven(t)));this.finderPatternSeq=Expanded.getFinderPatternSeq(i);this.symbolContentSize=i;const n=this._getChecksum(r),o=this._getSubsetWidth(n,!0);r.unshift(o);return this._getContent(r)}calculateData(){let e=this.makeDataWidth();e=[...Expanded.Guard,...e,...Expanded.Guard];return Utils.toZeroOnePattern(e)}getLinkageSepPattern(e){const t=e.substr(2,e.length-4);let i="";Utils.sliceString(t,49,(e,t)=>{const r=this.finderPatternSeq[t],n=Expanded.FinderPattern[r];i+=GS1DataBarBase.makeComplementPattern(e.substr(0,17));if(Expanded.isVersion1Finder(r)){const t=n[0]+n[1]+n[2],r=n[3]+n[4];i+=GS1DataBarBase.makeComplexPattern(e.substr(17,t));i+=GS1DataBarBase.makeComplementPattern(e.substr(17+t,r))}else{const t=n[0]+n[1],r=n[2]+n[3]+n[4];i+=GS1DataBarBase.makeComplementPattern(e.substr(17,t));i+=GS1DataBarBase.makeComplexPattern(e.substr(17+t,r))}49===e.length&&(i+=GS1DataBarBase.makeComplementPattern(e.substr(32,17)))});return"0000"+i.substr(2,i.length-4)+"0000"}getLinkageOffset(e){let t=1;for(;"1"===e[t];)t++;return{linkageOffset:t,symbolOffset:0}}}Expanded.Guard=[1,1];Expanded.Group=[[0,347,0,12,5,7,2,87,4],[348,1387,348,10,7,5,4,52,20],[1388,2947,1388,8,9,4,5,30,52],[2948,3987,2948,6,11,3,6,10,104],[3988,4191,3988,4,13,1,8,1,204]];Expanded.FinderPattern={A1:[1,8,4,1,1],B1:[3,6,4,1,1],C1:[3,4,6,1,1],D1:[3,2,8,1,1],E1:[2,6,5,1,1],F1:[2,2,9,1,1],A2:[1,1,4,8,1],B2:[1,1,4,6,3],C2:[1,1,6,4,3],D2:[1,1,8,2,3],E2:[1,1,5,6,2],F2:[1,1,9,2,2]};Expanded.ChecksumWeight={A1:{right:[1,3,9,27,81,32,96,77]},A2:{left:[20,60,180,118,143,7,21,63],right:[189,145,13,39,117,140,209,205]},B1:{left:[193,157,49,147,19,57,171,91],right:[62,186,136,197,169,85,44,132]},B2:{left:[185,133,188,142,4,12,36,108],right:[113,128,173,97,80,29,87,50]},C1:{left:[150,28,84,41,123,158,52,156],right:[46,138,203,187,139,206,196,166]},C2:{left:[76,17,51,153,37,111,122,155],right:[43,129,176,106,107,110,119,146]},D1:{left:[16,48,144,10,30,90,59,177],right:[109,116,137,200,178,112,125,164]},D2:{left:[70,210,208,202,184,130,179,115],right:[134,191,151,31,93,68,204,190]},E1:{left:[148,22,66,198,172,94,71,2],right:[6,18,54,162,64,192,154,40]},E2:{left:[120,149,25,75,14,42,126,167],right:[79,26,78,23,69,207,199,175]},F1:{left:[103,98,83,38,114,131,182,124],right:[161,61,183,127,170,88,53,159]},F2:{left:[55,165,73,8,24,72,5,15],right:[45,135,194,160,58,174,100,89]}};Expanded.FinderPatternSeq=[["A1","A2"],["A1","B2","B1"],["A1","C2","B1","D2"],["A1","E2","B1","D2","C1"],["A1","E2","B1","D2","D1","F2"],["A1","E2","B1","D2","E1","F2","F1"],["A1","A2","B1","B2","C1","C2","D1","D2"],["A1","A2","B1","B2","C1","C2","D1","E2","E1"],["A1","A2","B1","B2","C1","C2","D1","E2","F1","F2"],["A1","A2","B1","B2","C1","C2","D1","E2","E1","F2","F1"]];Expanded.MethodReg_0100=/^([01])19([0-9]{12})(.)3103([0-9]{6})$/;Expanded.MethodReg_0101=/^([01])19([0-9]{12})(.)320([23])0([0-9]{5})$/;Expanded.MethodReg_0111000_0111111=/^([01])19([0-9]{12})(.)(3[12]0[0-9])0([0-9]{5})(1[1357])([0-9]{6})$/;Expanded.MethodReg_01100=/^([01])19([0-9]{12})(.)392([0-3])(.+)$/;Expanded.MethodReg_01101=/^([01])19([0-9]{12})(.)393([0-3])([0-9]{3})(.+)$/;Expanded.MethodReg_1=/([01])1([0-9]{13})(.)(.*)$/;export class GS1DataBarFirstType extends GS1DataBarBase{constructor(e){super(e);let{encodeConfig:{text:t,hideExtraChecksum:i},hideLinkageText:r,linkageText:n,linkage:o,hideAIText:s}=this;this.label=t;if(t.length<18){t+=this._getCheckDigit(t);i||(this.label=t)}o&&!r&&(this.label+=n);s&&(this.label=this.label.replace(/\(\w*\)/g,""));this.text=t;this.linkageColumnCnt=4}validate(){const{text:e}=this.encodeConfig;if(!/^\(01\)(\d{13}|\d{14})$/.test(e))throw new InvalidTextException(e,"Text should be numbers. The length should be 17 or 18.");if(18===e.length){if(this._getCheckDigit(e)!=e[17])throw new InvalidTextException(e,"Check digit is invalid.")}}_getCheckDigit(e){let t=Utils.str2Array(e.substr(4,13)).reduce((e,t,i)=>{t=+t;return e+=Utils.isOdd(i)?t:3*t},0)%10;return 0===t?0:10-t}_getSubsetWidth(e,t){const i=t?GS1DataBarFirstType.Group.InSide:GS1DataBarFirstType.Group.OutSide,r=GS1DataBarBase.getGroup(i,e),n=t?r.oddTotal:r.evenTotal;let o,s;if(t){s=~~((e-r.preTotal)/n);o=(e-r.preTotal)%n}else{o=~~((e-r.preTotal)/n);s=(e-r.preTotal)%n}const a=GS1DataBarBase.getRSSwidths(o,r.oddModules,4,r.oddElements,!t),c=GS1DataBarBase.getRSSwidths(s,r.evenModules,4,r.evenElements,t),l=[];Utils.loop(e=>{l.push(a[e]);l.push(c[e])},4);return l}_getFinderPatternWidth(e){const t=GS1DataBarFirstType.FinderPattern[e];let i="";Utils.loop(e=>{i+=t[e]},5);return Utils.str2Array(i)}_getChecksum({width1:e,width2:t,width3:i,width4:r}){let n=0;n+=GS1DataBarBase.getChecksum(e,GS1DataBarFirstType.ChecksumWeight[0]);n+=GS1DataBarBase.getChecksum(t,GS1DataBarFirstType.ChecksumWeight[1]);n+=GS1DataBarBase.getChecksum(i,GS1DataBarFirstType.ChecksumWeight[2]);n+=GS1DataBarBase.getChecksum(r,GS1DataBarFirstType.ChecksumWeight[3]);(n%=79)>=8&&n++;n>=72&&n++;return n}_getSymbolCharacterWidth(e){const t=~~(e/4537077),i=e%4537077,r=~~(t/1597),n=t%1597,o=~~(i/1597),s=i%1597;return{width1:this._getSubsetWidth(r,!1),width2:this._getSubsetWidth(n,!0),width3:this._getSubsetWidth(o,!1),width4:this._getSubsetWidth(s,!0)}}getSymbolStructure(){const{text:e,linkage:t}=this,i=e.substr(4,13),r=t?+i+1e13:+i,n=this._getSymbolCharacterWidth(r),o=this._getChecksum(n),s=~~(o/9),a=o%9,c=this._getFinderPatternWidth(s),l=this._getFinderPatternWidth(a),{width1:d,width2:h,width3:u,width4:p}=n;return{width1:d,width2:h,width3:u,width4:p,leftFinderPattern:c,rightFinderPattern:l}}getLinkageSepPattern(e){let t="";t+=GS1DataBarBase.makeComplementPattern(e.substr(2,16));t+=GS1DataBarBase.makeComplexPattern(e.substr(18,13));t+=GS1DataBarBase.makeComplementPattern(e.substr(31,34));t+=GS1DataBarBase.makeComplexPattern(e.substr(65,13));return"0000"+(t+=GS1DataBarBase.makeComplementPattern(e.substr(78,16))).substr(2,t.length-2)+"0000"}calculateData(){const{width1:e,width2:t,width3:i,width4:r,leftFinderPattern:n,rightFinderPattern:o}=this.getSymbolStructure(),s=[...e,...n,...t.reverse(),...r,...o.reverse(),...i.reverse()];return GS1DataBarFirstType.LeftGuard+Utils.toZeroOnePattern(s)+GS1DataBarFirstType.RightGuard}}GS1DataBarFirstType.LeftGuard="01";GS1DataBarFirstType.RightGuard="01";GS1DataBarFirstType.Group={OutSide:[[0,160,0,12,4,8,1,161,1],[161,960,161,10,6,6,3,80,10],[961,2014,961,8,8,4,5,31,34],[2015,2714,2015,6,10,3,6,10,70],[2715,2840,2715,4,12,1,8,1,126]],InSide:[[0,335,0,5,10,2,7,4,84],[336,1035,336,7,8,4,5,20,35],[1036,1515,1036,9,6,6,3,48,10],[1516,1596,1516,11,4,8,1,81,1]]};GS1DataBarFirstType.ChecksumWeight=[[1,3,9,27,2,6,18,54],[4,12,36,29,8,24,72,58],[16,48,65,37,32,17,51,74],[64,34,23,69,49,68,46,59]];GS1DataBarFirstType.FinderPattern=[[3,8,2,1,1],[3,5,5,1,1],[3,3,7,1,1],[3,1,9,1,1],[2,7,4,1,1],[2,5,6,1,1],[2,3,8,1,1],[1,5,7,1,1],[1,3,9,1,1]];export class Limited extends GS1DataBarFirstType{constructor(){super(...arguments);this.linkageColumnCnt=3}_getSubsetWidth(e){const t=GS1DataBarBase.getGroup(Limited.Group,e),i=~~((e-t.preTotal)/t.evenTotal),r=(e-t.preTotal)%t.evenTotal,n=GS1DataBarBase.getRSSwidths(i,t.oddModules,7,t.oddElements,!0),o=GS1DataBarBase.getRSSwidths(r,t.evenModules,7,t.evenElements,!1),s=[];Utils.loop(e=>{s.push(n[e]);s.push(o[e])},7);return s}_getChecksum({leftWidth:e,rightWidth:t}){let i=0;i+=GS1DataBarBase.getChecksum(e,Limited.ChecksumWeight[0]);i+=GS1DataBarBase.getChecksum(t,Limited.ChecksumWeight[1]);return i%=89}_getSymbolCharacterWidth(e){const t=~~(e/2013571),i=e%2013571;return{leftWidth:this._getSubsetWidth(t),rightWidth:this._getSubsetWidth(i)}}getLinkageSepPattern(e){e=e.substr(0,e.length-5);const t=GS1DataBarBase.makeComplementPattern(e);return"0000"+t.substr(4,t.length-8)+"0000"}getSymbolStructure(){const{text:e,linkage:t}=this,i=e.substr(4,13),r=t?+i+2015133531096:+i,n=this._getSymbolCharacterWidth(r),o=this._getChecksum(n),s=Limited.ChecksumWidth[o],{leftWidth:a,rightWidth:c}=n;return{leftWidth:a,rightWidth:c,checksumWidth:s}}getLinkageOffset(e,t){let i=e.length-1-5;for(;"1"===e[i];)i--;return{linkageOffset:0,symbolOffset:t-i-1}}calculateData(){const{leftWidth:e,rightWidth:t,checksumWidth:i}=this.getSymbolStructure(),r=[...e,...i,...t];return Limited.LeftGuard+Utils.toZeroOnePattern(r)+Limited.RightGuard}}Limited.LeftGuard="01";Limited.RightGuard="0100000";Limited.Group=[[0,183063,0,17,9,6,3,6538,28],[183064,820063,183064,13,13,5,4,875,728],[820064,1000775,820064,9,17,3,6,28,6454],[1000776,1491020,1000776,15,11,5,4,2415,203],[1491021,1979844,1491021,11,15,4,5,203,2408],[1979845,1996938,1979845,19,7,8,1,17094,1],[1996939,2013570,1996939,7,19,1,8,1,16632]];Limited.ChecksumWeight=[[1,3,9,27,81,65,17,51,64,14,42,37,22,66],[20,60,2,6,18,54,73,41,34,13,39,28,84,74]];Limited.ChecksumWidth=[[1,1,1,1,1,1,1,1,1,1,3,3,1,1],[1,1,1,1,1,1,1,1,1,2,3,2,1,1],[1,1,1,1,1,1,1,1,1,3,3,1,1,1],[1,1,1,1,1,1,1,2,1,1,3,2,1,1],[1,1,1,1,1,1,1,2,1,2,3,1,1,1],[1,1,1,1,1,1,1,3,1,1,3,1,1,1],[1,1,1,1,1,2,1,1,1,1,3,2,1,1],[1,1,1,1,1,2,1,1,1,2,3,1,1,1],[1,1,1,1,1,2,1,2,1,1,3,1,1,1],[1,1,1,1,1,3,1,1,1,1,3,1,1,1],[1,1,1,2,1,1,1,1,1,1,3,2,1,1],[1,1,1,2,1,1,1,1,1,2,3,1,1,1],[1,1,1,2,1,1,1,2,1,1,3,1,1,1],[1,1,1,2,1,2,1,1,1,1,3,1,1,1],[1,1,1,3,1,1,1,1,1,1,3,1,1,1],[1,2,1,1,1,1,1,1,1,1,3,2,1,1],[1,2,1,1,1,1,1,1,1,2,3,1,1,1],[1,2,1,1,1,1,1,2,1,1,3,1,1,1],[1,2,1,1,1,2,1,1,1,1,3,1,1,1],[1,2,1,2,1,1,1,1,1,1,3,1,1,1],[1,3,1,1,1,1,1,1,1,1,3,1,1,1],[1,1,1,1,1,1,1,1,2,1,2,3,1,1],[1,1,1,1,1,1,1,1,2,2,2,2,1,1],[1,1,1,1,1,1,1,1,2,3,2,1,1,1],[1,1,1,1,1,1,1,2,2,1,2,2,1,1],[1,1,1,1,1,1,1,2,2,2,2,1,1,1],[1,1,1,1,1,1,1,3,2,1,2,1,1,1],[1,1,1,1,1,2,1,1,2,1,2,2,1,1],[1,1,1,1,1,2,1,1,2,2,2,1,1,1],[1,1,1,1,1,2,1,2,2,1,2,1,1,1],[1,1,1,1,1,3,1,1,2,1,2,1,1,1],[1,1,1,2,1,1,1,1,2,1,2,2,1,1],[1,1,1,2,1,1,1,1,2,2,2,1,1,1],[1,1,1,2,1,1,1,2,2,1,2,1,1,1],[1,1,1,2,1,2,1,1,2,1,2,1,1,1],[1,1,1,3,1,1,1,1,2,1,2,1,1,1],[1,2,1,1,1,1,1,1,2,1,2,2,1,1],[1,2,1,1,1,1,1,1,2,2,2,1,1,1],[1,2,1,1,1,1,1,2,2,1,2,1,1,1],[1,2,1,1,1,2,1,1,2,1,2,1,1,1],[1,2,1,2,1,1,1,1,2,1,2,1,1,1],[1,3,1,1,1,1,1,1,2,1,2,1,1,1],[1,1,1,1,1,1,1,1,3,1,1,3,1,1],[1,1,1,1,1,1,1,1,3,2,1,2,1,1],[1,1,1,1,1,1,1,2,3,1,1,2,1,1],[1,1,1,2,1,1,1,1,3,1,1,2,1,1],[1,2,1,1,1,1,1,1,3,1,1,2,1,1],[1,1,1,1,1,1,2,1,1,1,2,3,1,1],[1,1,1,1,1,1,2,1,1,2,2,2,1,1],[1,1,1,1,1,1,2,1,1,3,2,1,1,1],[1,1,1,1,1,1,2,2,1,1,2,2,1,1],[1,1,1,2,1,1,2,1,1,1,2,2,1,1],[1,1,1,2,1,1,2,1,1,2,2,1,1,1],[1,1,1,2,1,1,2,2,1,1,2,1,1,1],[1,1,1,2,1,2,2,1,1,1,2,1,1,1],[1,1,1,3,1,1,2,1,1,1,2,1,1,1],[1,2,1,1,1,1,2,1,1,1,2,2,1,1],[1,2,1,1,1,1,2,1,1,2,2,1,1,1],[1,2,1,2,1,1,2,1,1,1,2,1,1,1],[1,1,1,1,2,1,1,1,1,1,2,3,1,1],[1,1,1,1,2,1,1,1,1,2,2,2,1,1],[1,1,1,1,2,1,1,1,1,3,2,1,1,1],[1,1,1,1,2,1,1,2,1,1,2,2,1,1],[1,1,1,1,2,1,1,2,1,2,2,1,1,1],[1,1,1,1,2,2,1,1,1,1,2,2,1,1],[1,2,1,1,2,1,1,1,1,1,2,2,1,1],[1,2,1,1,2,1,1,1,1,2,2,1,1,1],[1,2,1,1,2,1,1,2,1,1,2,1,1,1],[1,2,1,1,2,2,1,1,1,1,2,1,1,1],[1,2,1,2,2,1,1,1,1,1,2,1,1,1],[1,3,1,1,2,1,1,1,1,1,2,1,1,1],[1,1,2,1,1,1,1,1,1,1,2,3,1,1],[1,1,2,1,1,1,1,1,1,2,2,2,1,1],[1,1,2,1,1,1,1,1,1,3,2,1,1,1],[1,1,2,1,1,1,1,2,1,1,2,2,1,1],[1,1,2,1,1,1,1,2,1,2,2,1,1,1],[1,1,2,1,1,1,1,3,1,1,2,1,1,1],[1,1,2,1,1,2,1,1,1,1,2,2,1,1],[1,1,2,1,1,2,1,1,1,2,2,1,1,1],[1,1,2,2,1,1,1,1,1,1,2,2,1,1],[2,1,1,1,1,1,1,1,1,2,2,2,1,1],[2,1,1,1,1,1,1,1,1,3,2,1,1,1],[2,1,1,1,1,1,1,2,1,1,2,2,1,1],[2,1,1,1,1,1,1,2,1,2,2,1,1,1],[2,1,1,1,1,1,1,3,1,1,2,1,1,1],[2,1,1,1,1,2,1,1,1,2,2,1,1,1],[2,1,1,1,1,2,1,2,1,1,2,1,1,1],[2,1,1,2,1,1,1,1,1,2,2,1,1,1],[2,1,1,1,1,1,1,1,2,2,1,2,1,1]];export class StackedBase extends GS1DataBarFirstType{constructor(e){e.merge(StackedBase.DefaultConfig);super(e);this.linkageColumnCnt=2}calculateData(){const{width1:e,width2:t,width3:i,width4:r,leftFinderPattern:n,rightFinderPattern:o}=this.getSymbolStructure();let s=[...e,...n,...t.reverse()],a=[...r,...o.reverse(),...i.reverse()];return{topRow:s=GS1DataBarFirstType.LeftGuard+Utils.toZeroOnePattern(s)+StackedBase.RightGuard,bottomRow:a=StackedBase.LeftGuard+Utils.toZeroOnePattern(a,!0)+GS1DataBarFirstType.RightGuard,separators:this.getSeparator(s,a)}}getLinkageSepPattern(e){let t="";t+=GS1DataBarBase.makeComplementPattern(e.substr(2,16));t+=GS1DataBarBase.makeComplexPattern(e.substr(18,13));return"0000"+(t+=GS1DataBarBase.makeComplementPattern(e.substr(31,15))).substr(2,t.length-2)+"0000"}convertToShape(e,t){this.linkage?this._convertToShapeForLinkage(e,t):this._convertToShape(e,t)}getLinkageOffset(e){let t=0;for(;"1"===e[t];)t++;return{linkageOffset:++t,symbolOffset:0}}_convertToShapeForLinkage(e,t){let{label:i,encodeConfig:{quietZone:r,isLabelBottom:n,height:o,showLabel:s,fontSizeInUnit:a},config:{ratio:c},style:{textAlign:l,unitValue:d},linkageText:h,config:{linkageVersion:u,linkageHeight:p},linkageColumnCnt:g}=this;const m=u===GS1DataBarBase.LinkageVersion.CCA?new CCA(h,g,d,p):new CCB(h,g,d,p);m.toSymbol();const f=m.getMainArea(),C=this.getLinkageSepPattern(e.topRow);let b=0;i&&s&&(b=a);const x=e.separators.length,S=this.getLinkageOffset(e),B=new VerticalLayoutArea,E=new LabelArea(50,b,l),D=new SymbolArea(50,(o-x)*c),w=new SymbolArea(50,(o-x)*(1-c)),_=new SymbolArea(50,1);B.setStyle({padding:{top:r.top,right:r.right,bottom:r.bottom,left:r.left}});f.setStyle({margin:{left:S.linkageOffset}});n||B.append(E);B.append(f);B.append(_);B.append(D);const P=[];e.separators.forEach(()=>{const e=new SymbolArea(50,1);P.push(e);B.append(e)});B.append(w);n&&B.append(E);if(!t){_.fromPattern(C);D.fromPattern(e.topRow);w.fromPattern(e.bottomRow);P.forEach((t,i)=>{t.fromPattern(e.separators[i])});E.append({text:i});this.shapes=B.toShapes()}this.size=B.getSize()}_convertToShape(e,t){let{label:i,encodeConfig:{quietZone:r,isLabelBottom:n,height:o,showLabel:s,fontSizeInUnit:a},config:{ratio:c},style:{textAlign:l}}=this,d=0;i&&s&&(d=a);const h=e.separators.length,u=new VerticalLayoutArea;u.setStyle({padding:{top:r.top,right:r.right,bottom:r.bottom,left:r.left}});const p=new LabelArea(50,d,l),g=new SymbolArea(50,(o-h)*c),m=new SymbolArea(50,(o-h)*(1-c));n||u.append(p);u.append(g);const f=[];e.separators.forEach(()=>{const e=new SymbolArea(50,1);f.push(e);u.append(e)});u.append(m);n&&u.append(p);if(!t){p.append({text:i});g.fromPattern(e.topRow);m.fromPattern(e.bottomRow);f.forEach((t,i)=>{t.fromPattern(e.separators[i])});this.shapes=u.toShapes()}this.size=u.getSize()}}StackedBase.DefaultConfig={showLabel:!1,ratio:.4};StackedBase.RightGuard="10";StackedBase.LeftGuard="10";export class ExpandedStacked extends Expanded{constructor(e){e.merge(ExpandedStacked.DefaultConfig);super(e);let{config:{rowCount:t}}=this;this.rowCount=t;this._hasExtraPadding=!1;this.linkageColumnCnt=4}_makeStacked(e){const t=this.symbolContentSize;if(!this._hasExtraPadding){const i=~~(e.length/ExpandedStacked.SegmentSize);let r;if("auto"===this.rowCount){let e=2;e>i&&(e=i);r=Math.ceil(i/e);this.rowCount=e}else{let e=this.rowCount;r=Math.ceil(i/e)}if(this.rowCount>11)throw new TextTooLongException;const n=t%(2*r);this.rowSegmentCount=r;if(1===n){this._bitBuffer=new BitBuffer;this._gpdEncodation=new GS1GeneralPurposeDataEncodation(this._bitBuffer,!0);this._hasExtraPadding=!0;return this.calculateData()}}const i=this.rowSegmentCount,r=Math.ceil(t%(2*i)/2),n=Utils.isEven(i),o=i*ExpandedStacked.SegmentSize,s=[];Utils.sliceArray(e,o,(e,t)=>{const i=[...Expanded.Guard,...e,...Expanded.Guard];let a;if(Utils.isEven(t))a=Utils.toZeroOnePattern(i);else if(n)if(e.length<o&&Utils.isOdd(r))a="0"+Utils.toZeroOnePattern(i);else{i.reverse();a=Utils.toZeroOnePattern(i,!0)}else a=Utils.toZeroOnePattern(i,!0);s.push({pattern:a,role:"row"})});this.rowCount=s.length;const a=[];let c=1;for(;c<s.length;){const e=s[c-1],t=s[c];a.push(e);const i=this._getSeparators(e.pattern,t.pattern,c-1);a.push(...i);c++}a.push(s[c-1]);return a}_isVersion1Finder(e,t){const i=this.finderPatternSeq[~~((e+1+t)/2)];return["A1","B1","C1","D1","E1","F1"].indexOf(i)>-1}_makeSepPattern(e,t){const i=Math.ceil((e.length-4)/ExpandedStacked.SegmentWidth);e=e.substring(2,e.length-2);let r="",n=0,o=0;for(;n<i;){const i=o,s=o+ExpandedStacked.SegmentWidth;let a=i+17;this._isVersion1Finder(t,n)||(a+=2);r+=GS1DataBarBase.makeComplementPattern(e.substr(i,a-i));r+=GS1DataBarBase.makeComplexPattern(e.substr(a,13));r+=GS1DataBarBase.makeComplementPattern(e.substr(a+13,s-a-13));n++;o=s}return r=r.replace(/^(.){2}|(.){2}$/g,"0000")}_getSeparators(e,t,i){const r=i*((e.length-4)/ExpandedStacked.SegmentWidth);return[{pattern:this._makeSepPattern(e,r)},{pattern:"0000"+StackedBase.makeAlternatePattern(e.length-8,!0)+"0000"},{pattern:this._makeSepPattern(t,r)}]}calculateData(){const e=this.makeDataWidth();return this._makeStacked(e)}getLinkageOffset(e){let t=1;for(;"1"===e[t];)t++;return{linkageOffset:t,symbolOffset:0}}convertToShape(e,t){this.linkage?this._convertToShapeForLinkage(e,t):this._convertToShape(e,t)}_convertToShapeForLinkage(e,t){let{label:i,encodeConfig:{quietZone:r,isLabelBottom:n,height:o,showLabel:s,fontSizeInUnit:a},rowCount:c,style:{textAlign:l,unitValue:d},linkageText:h,config:{linkageVersion:u,linkageHeight:p},linkageColumnCnt:g}=this;const m=u===GS1DataBarBase.LinkageVersion.CCA?new CCA(h,g,d,p):new CCB(h,g,d,p);m.toSymbol();const f=m.getMainArea(),C=this.getLinkageSepPattern(e[0].pattern),b=f.getSize(),x=(o-3*(c-1)-1-b.height)/c,S=e[0].pattern.length;let B=0;i&&s&&(B=a);const E=this.getLinkageOffset(e[0].pattern),D=new VerticalLayoutArea,w=new SymbolArea(S,1),_=new LabelArea(S,B,l);D.setStyle({padding:{top:r.top,right:r.right,bottom:r.bottom,left:r.left}});w.setStyle({margin:{left:E.symbolOffset}});f.setStyle({margin:{left:E.linkageOffset}});n||D.append(_);D.append(f);D.append(w);const P=[];e.forEach(e=>{const t=new SymbolArea(S,"row"===e.role?x:1);D.append(t);P.push({area:t,pattern:e.pattern})});n&&D.append(_);if(!t){w.fromPattern(C);_.append({text:i});P.forEach(e=>{e.area.fromPattern(e.pattern)});this.shapes=D.toShapes()}this.size=D.getSize()}_convertToShape(e,t){let{label:i,encodeConfig:{quietZone:r,isLabelBottom:n,height:o,showLabel:s,fontSizeInUnit:a},rowCount:c,style:{textAlign:l}}=this;const d=(o-3*(c-1))/c,h=e[0].pattern.length;let u=0;i&&s&&(u=a);const p=new VerticalLayoutArea;p.setStyle({padding:{top:r.top,right:r.right,bottom:r.bottom,left:r.left}});const g=new LabelArea(h,u,l);n||p.append(g);const m=[];e.forEach(e=>{const t=new SymbolArea(h,"row"===e.role?d:1);p.append(t);m.push({area:t,pattern:e.pattern})});n&&p.append(g);if(!t){g.append({text:i});m.forEach(e=>{e.area.fromPattern(e.pattern)});this.shapes=p.toShapes()}this.size=p.getSize()}}ExpandedStacked.DefaultConfig={rowCount:"auto"};ExpandedStacked.SegmentWidth=49;ExpandedStacked.SegmentSize=21;export class StackedOmnidirectional extends StackedBase{getSeparator(e,t){const i=[];let r="0000";r+=GS1DataBarBase.makeComplementPattern(e.substr(4,14));r+=GS1DataBarBase.makeComplexPattern(e.substr(18,13));r+=GS1DataBarBase.makeComplementPattern(e.substr(31,15));r+="0000";i.push(r);r="0000";r+=GS1DataBarBase.makeAlternatePattern(42,!0);r+="0000";i.push(r);r="0000";r+=GS1DataBarBase.makeComplementPattern(t.substr(4,15));r+=GS1DataBarBase.makeComplexPattern(t.substr(19,13));r+=GS1DataBarBase.makeComplementPattern(t.substr(32,14));r+="0000";i.push(r);return i}}export class Stacked extends StackedBase{constructor(e){e.merge(Stacked.DefaultConfig);super(e)}getSeparator(e,t){let i="",r=0;Utils.loop(n=>{if(e[n]!==t[n])if(1===r){i+="0";r=0}else{i+="1";r=1}else if("0"===e[n]){i+="1";r=1}else{i+="0";r=0}},{from:4,to:e.length-4});return["0000"+i+"0000"]}}Stacked.DefaultConfig={height:13};export class Omnidirectional extends GS1DataBarFirstType{getLinkageOffset(e,t){let i=e.length-1;for(;"1"===e[i];)i--;return{linkageOffset:0,symbolOffset:t-i-1}}}export class Truncated extends Omnidirectional{constructor(e){e.merge(Truncated.DefaultConfig);super(e)}}Truncated.DefaultConfig={height:13,showLabel:!1};Barcode.registerEncoder("GS1 DataBar Omnidirectional",Omnidirectional);Barcode.registerEncoder("GS1 DataBar Truncated",Truncated);Barcode.registerEncoder("GS1 DataBar Stacked",Stacked);Barcode.registerEncoder("GS1 DataBar StackedOmnidirectional",StackedOmnidirectional);Barcode.registerEncoder("GS1 DataBar Limited",Limited);Barcode.registerEncoder("GS1 DataBar Expanded",Expanded);Barcode.registerEncoder("GS1 DataBar Expanded Stacked",ExpandedStacked);export var Gs1DataBarLinkageVersion;!function(e){e[e.Cca=0]="Cca";e[e.Ccb=1]="Ccb"}(Gs1DataBarLinkageVersion||(Gs1DataBarLinkageVersion={}));export var MicroPdfCompactionMode;!function(e){e[e.Auto=0]="Auto";e[e.Text=1]="Text";e[e.Numeric=2]="Numeric";e[e.Byte=3]="Byte"}(MicroPdfCompactionMode||(MicroPdfCompactionMode={}));export var MicroPdfDimensions;!function(e){e[e.ColumnPriority=0]="ColumnPriority";e[e.RowPriority=1]="RowPriority";e[e.Dim1x11=2]="Dim1x11";e[e.Dim1x14=3]="Dim1x14";e[e.Dim1x17=4]="Dim1x17";e[e.Dim1x20=5]="Dim1x20";e[e.Dim1x24=6]="Dim1x24";e[e.Dim1x28=7]="Dim1x28";e[e.Dim2x8=8]="Dim2x8";e[e.Dim2x11=9]="Dim2x11";e[e.Dim2x14=10]="Dim2x14";e[e.Dim2x17=11]="Dim2x17";e[e.Dim2x20=12]="Dim2x20";e[e.Dim2x23=13]="Dim2x23";e[e.Dim2x26=14]="Dim2x26";e[e.Dim3x6=15]="Dim3x6";e[e.Dim3x8=16]="Dim3x8";e[e.Dim3x10=17]="Dim3x10";e[e.Dim3x12=18]="Dim3x12";e[e.Dim3x15=19]="Dim3x15";e[e.Dim3x20=20]="Dim3x20";e[e.Dim3x26=21]="Dim3x26";e[e.Dim3x32=22]="Dim3x32";e[e.Dim3x38=23]="Dim3x38";e[e.Dim3x44=24]="Dim3x44";e[e.Dim4x4=25]="Dim4x4";e[e.Dim4x6=26]="Dim4x6";e[e.Dim4x8=27]="Dim4x8";e[e.Dim4x10=28]="Dim4x10";e[e.Dim4x12=29]="Dim4x12";e[e.Dim4x15=30]="Dim4x15";e[e.Dim4x20=31]="Dim4x20";e[e.Dim4x26=32]="Dim4x26";e[e.Dim4x32=33]="Dim4x32";e[e.Dim4x38=34]="Dim4x38";e[e.Dim4x44=35]="Dim4x44"}(MicroPdfDimensions||(MicroPdfDimensions={}));export class _LinkageVersionConvertor{static stringToEnum(e){switch(e){case"CCA":return Gs1DataBarLinkageVersion.Cca;case"CCB":return Gs1DataBarLinkageVersion.Ccb}throw`Unknown Barcode internal linkageVersion '${e}'`}static enumToString(e){return Gs1DataBarLinkageVersion[asEnum(e,Gs1DataBarLinkageVersion)].toUpperCase()}}export class _CompactionModeConvertor{static stringToEnum(e){switch(e){case"auto":return MicroPdfCompactionMode.Auto;case"text":return MicroPdfCompactionMode.Text;case"numeric":return MicroPdfCompactionMode.Numeric;case"byte":return MicroPdfCompactionMode.Byte}throw`Unknown Barcode internal compactionMode '${e}'`}static enumToString(e){return MicroPdfCompactionMode[asEnum(e,MicroPdfCompactionMode)].toLowerCase()}}export function _MicroPdfDimensionsConvertor(e){switch(e){case"ColumnPriority":return"columnPriorAuto";case"RowPriority":return"rowPriorAuto";default:return e.substr("Dim".length).replace("x","*")}}export class Gs1DataBarBase extends BarcodeBase{constructor(e,t){super(e,t);addClass(this.hostElement,"wj-barcode-gs1databar")}static _getClassDefaults(){let e=super._getClassDefaults();e.showLabel=!0;return e}get showLabel(){return this._getProp("showLabel")}set showLabel(e){this._setProp("showLabel",e)}get labelPosition(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))}set labelPosition(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))}get linkage(){return this._getProp("linkage")}set linkage(e){this._setProp("linkage",e)}get linkageVersion(){return _LinkageVersionConvertor.stringToEnum(this._getProp("linkageVersion"))}set linkageVersion(e){this._setProp("linkageVersion",_LinkageVersionConvertor.enumToString(e))}get linkageHeight(){return this._getProp("linkageHeight")}set linkageHeight(e){this._setProp("linkageHeight",e)}get hideLinkageText(){return this._getProp("hideLinkageText")}set hideLinkageText(e){this._setProp("hideLinkageText",e)}get hideAiText(){return this._getProp("hideAIText")}set hideAiText(e){this._setProp("hideAIText",e)}}export class Gs1DataBarOmnidirectional extends Gs1DataBarBase{constructor(e,t){super(e,t);addClass(this.hostElement,"wj-barcode-gs1databar-omnidirectional")}}Gs1DataBarOmnidirectional.type="GS1 DataBar Omnidirectional";export class Gs1DataBarTruncated extends Gs1DataBarBase{constructor(e,t){super(e,t);addClass(this.hostElement,"wj-barcode-gs1databar-truncated")}}Gs1DataBarTruncated.type="GS1 DataBar Truncated";export class Gs1DataBarStacked extends Gs1DataBarBase{constructor(e,t){super(e,t);addClass(this.hostElement,"wj-barcode-gs1databar-stacked")}get ratio(){return this._getProp("ratio")}set ratio(e){this._setProp("ratio",e)}}Gs1DataBarStacked.type="GS1 DataBar Stacked";export class Gs1DataBarStackedOmnidirectional extends Gs1DataBarBase{constructor(e,t){super(e,t);addClass(this.hostElement,"wj-barcode-gs1databar-stacked-omnidirectional")}get ratio(){return this._getProp("ratio")}set ratio(e){this._setProp("ratio",e)}}Gs1DataBarStackedOmnidirectional.type="GS1 DataBar StackedOmnidirectional";export class Gs1DataBarLimited extends Gs1DataBarBase{constructor(e,t){super(e,t);addClass(this.hostElement,"wj-barcode-gs1databar-limited")}}Gs1DataBarLimited.type="GS1 DataBar Limited";export class Gs1DataBarExpanded extends Gs1DataBarBase{constructor(e,t){super(e);addClass(this.hostElement,"wj-barcode-gs1databar-expanded");this._setAw(!0);this.initialize(t)}get autoWidth(){return this._getAw()}set autoWidth(e){this._setAw(e)}get autoWidthZoom(){return this._getWzoom()}set autoWidthZoom(e){this._setWzoom(e)}}Gs1DataBarExpanded.type="GS1 DataBar Expanded";export class Gs1DataBarExpandedStacked extends Gs1DataBarBase{constructor(e,t){super(e);addClass(this.hostElement,"wj-barcode-gs1databar-expanded-stacked");this._setAw(!0);this.initialize(t)}get autoWidth(){return this._getAw()}set autoWidth(e){this._setAw(e)}get autoWidthZoom(){return this._getWzoom()}set autoWidthZoom(e){this._setWzoom(e)}get rowCount(){let e=this._getProp("rowCount");return"auto"===e?null:e}set rowCount(e){this._setProp("rowCount",null==e?"auto":e)}}Gs1DataBarExpandedStacked.type="GS1 DataBar Expanded Stacked";export class Pdf417 extends BarcodeBase{constructor(e,t){super(e);addClass(this.hostElement,"wj-barcode-pdf417");this._setAw(!0);this.initialize(t)}get autoWidth(){return this._getAw()}set autoWidth(e){this._setAw(e)}get autoWidthZoom(){return this._getWzoom()}set autoWidthZoom(e){this._setWzoom(e)}get errorCorrectionLevel(){let e=this._getProp("errorCorrectionLevel");return"auto"===e?null:e}set errorCorrectionLevel(e){this._setProp("errorCorrectionLevel",null==e?"auto":e)}get columns(){let e=this._getProp("columns");return"auto"===e?null:e}set columns(e){this._setProp("columns",null==e?"auto":e)}get rows(){let e=this._getProp("rows");return"auto"===e?null:e}set rows(e){this._setProp("rows",null==e?"auto":e)}get compact(){return this._getProp("compact")}set compact(e){this._setProp("compact",e)}}Pdf417.type="PDF417";export class MicroPdf417 extends BarcodeBase{constructor(e,t){MicroPdf417._getEnumDictionary();super(e,t);addClass(this.hostElement,"wj-barcode-micropdf417")}static _getEnumDictionary(){MicroPdf417._dimensionsDictionary||(MicroPdf417._dimensionsDictionary=new _EnumDictionary(MicroPdfDimensions,_MicroPdfDimensionsConvertor))}get dimensions(){return MicroPdf417._dimensionsDictionary.getEnumByString(this._getProp("symbolVersion"))}set dimensions(e){this._setProp("symbolVersion",MicroPdf417._dimensionsDictionary.getStringByEnum(e))}get compactionMode(){return _CompactionModeConvertor.stringToEnum(this._getProp("compactionMode"))}set compactionMode(e){this._setProp("compactionMode",_CompactionModeConvertor.enumToString(e))}get structuredAppend(){return this._getProp("structuredAppend")}set structuredAppend(e){this._setProp("structuredAppend",e)}get segmentIndex(){return this._getProp("segmentIndex")}set segmentIndex(e){this._setProp("segmentIndex",e)}get fileId(){return this._getProp("fileID")}set fileId(e){this._setProp("fileID",e)}get optionalFields(){return this._getProp("optionalFields")}set optionalFields(e){this._setProp("optionalFields",e)}}MicroPdf417.type="MicroPDF417";_registerModule("wijmo.barcode.composite",selfModule);
package/es5-esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * Wijmo Library 5.20232.939
3
+ * Wijmo Library 5.20241.2
4
4
  * https://developer.mescius.com/wijmo
5
5
  *
6
6
  * Copyright(c) MESCIUS inc. All rights reserved.
package/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * Wijmo Library 5.20232.939
3
+ * Wijmo Library 5.20241.2
4
4
  * https://developer.mescius.com/wijmo
5
5
  *
6
6
  * Copyright(c) MESCIUS inc. All rights reserved.
@@ -22,8 +22,8 @@
22
22
  *
23
23
  */
24
24
  export declare var ___keepComment: any;
25
- import { TwoDimensionalBarcode, OneDimensionalBarcode, BarcodeBase, LabelPosition, IVariableWidthBarcode } from '@grapecity/wijmo.barcode';
26
- import * as selfModule from '@grapecity/wijmo.barcode.composite';
25
+ import { TwoDimensionalBarcode, OneDimensionalBarcode, BarcodeBase, LabelPosition, IVariableWidthBarcode } from '@mescius/wijmo.barcode';
26
+ import * as selfModule from '@mescius/wijmo.barcode.composite';
27
27
  /**
28
28
  * Structured append optional fields. Currently only supports segmentCount.
29
29
  */
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * Wijmo Library 5.20232.939
3
+ * Wijmo Library 5.20241.2
4
4
  * https://developer.mescius.com/wijmo
5
5
  *
6
6
  * Copyright(c) MESCIUS inc. All rights reserved.
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@mescius/wijmo.barcode.composite",
3
- "version": "5.20232.939",
3
+ "version": "5.20241.2-rc",
4
4
  "description": "UI library for pure JS, Angular, React, Vue and more...",
5
5
  "author": "MESCIUS inc",
6
6
  "license": "Commercial",
7
7
  "main": "./index.js",
8
8
  "types": "./index.d.ts",
9
9
  "dependencies": {
10
- "@mescius/wijmo": "5.20232.939",
11
- "@mescius/wijmo.barcode": "5.20232.939"
10
+ "@mescius/wijmo": "5.20241.2-rc",
11
+ "@mescius/wijmo.barcode": "5.20241.2-rc"
12
12
  },
13
13
  "homepage": "https://developer.mescius.com/wijmo",
14
14
  "bugs": {