@mescius/wijmo.barcode.composite 5.20232.939
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/COMMERCIAL-LICENSE.html +485 -0
- package/README.md +363 -0
- package/es2015-commonjs.js +14 -0
- package/es2015-esm.js +14 -0
- package/es5-esm.js +14 -0
- package/index.d.ts +989 -0
- package/index.js +14 -0
- package/package.json +45 -0
package/es2015-esm.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
*
|
|
3
|
+
* Wijmo Library 5.20232.939
|
|
4
|
+
* https://developer.mescius.com/wijmo
|
|
5
|
+
*
|
|
6
|
+
* Copyright(c) MESCIUS inc. All rights reserved.
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the End-User License Agreement For MESCIUS Wijmo Software.
|
|
9
|
+
* us.sales@mescius.com
|
|
10
|
+
* https://developer.mescius.com/wijmo/licensing
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
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);
|
package/es5-esm.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
*
|
|
3
|
+
* Wijmo Library 5.20232.939
|
|
4
|
+
* https://developer.mescius.com/wijmo
|
|
5
|
+
*
|
|
6
|
+
* Copyright(c) MESCIUS inc. All rights reserved.
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the End-User License Agreement For MESCIUS Wijmo Software.
|
|
9
|
+
* us.sales@mescius.com
|
|
10
|
+
* https://developer.mescius.com/wijmo/licensing
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
var __extends=this&&this.__extends||function(){var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};return function(e,t){extendStatics(e,t);function __(){this.constructor=e}e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}}();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";var ISO646Encoder=function(){function ISO646Encoder(e){this.bitBuffer=e}ISO646Encoder.isISO646Only=function(e){return ISO646Encoder.ISO646.indexOf(e)>-1};ISO646Encoder.prototype.encode=function(e){var t=ISO646Encoder.Table[e];if(t)this.bitBuffer.putBits(t);else{var r=e.charCodeAt(0);if(r>=48&&r<=57)this.bitBuffer.put(r-43,5);else if(e>="A"&&e<="Z")this.bitBuffer.put(r-1,7);else{if(!(e>="a"&&e<="z"))throw new InvalidCharacterException(e);this.bitBuffer.put(r-7,7)}}};ISO646Encoder.prototype.FNC1NumericLatch=function(){this.bitBuffer.putBits(ISO646Encoder.Table.FNC1NumericLatch)};ISO646Encoder.prototype.NumericLatch=function(){this.bitBuffer.putBits(ISO646Encoder.Table.NumericLatch)};ISO646Encoder.prototype.AlphanumericLatch=function(){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!\"%&'()+:;<=>?_ ";return ISO646Encoder}();export{ISO646Encoder};var AlphanumericEncoder=function(){function AlphanumericEncoder(e){this.bitBuffer=e}AlphanumericEncoder.isUpperCase=function(e){return e>="A"&&e<="Z"};AlphanumericEncoder.isLowerCase=function(e){return e>="a"&&e<="z"};AlphanumericEncoder.prototype.encode=function(e){var t=AlphanumericEncoder.Table[e];if(t)this.bitBuffer.putBits(t);else{var r=e.charCodeAt(0);if(r>=48&&r<=57)this.bitBuffer.put(r-43,5);else{if(!AlphanumericEncoder.isUpperCase(e))throw new InvalidCharacterException(e);this.bitBuffer.put(r-33,6)}}};AlphanumericEncoder.prototype.FNC1NumericLatch=function(){this.bitBuffer.putBits(AlphanumericEncoder.Table.FNC1NumericLatch)};AlphanumericEncoder.prototype.NumericLatch=function(){this.bitBuffer.putBits(AlphanumericEncoder.Table.NumericLatch)};AlphanumericEncoder.prototype.ISO646Latch=function(){this.bitBuffer.putBits(AlphanumericEncoder.Table.ISO646Latch)};AlphanumericEncoder.Table={"*":"111010",",":"111011","-":"111100",".":"111101","/":"111110",FNC1NumericLatch:"01111",NumericLatch:"000",ISO646Latch:"00100"};return AlphanumericEncoder}();export{AlphanumericEncoder};var NumericEncoder=function(){function NumericEncoder(e){this.bitBuffer=e}NumericEncoder.isNumericOrFNC1=function(e){var t=e.charCodeAt(0);return e===Constants.FNC1||t>=48&&t<=57};NumericEncoder.isNumeric=function(e){var t=e.charCodeAt(0);return t>=48&&t<=57};NumericEncoder.prototype.encode=function(e,t){var r=11*(e===Constants.FNC1?10:e.charCodeAt(0)-48)+(t===Constants.FNC1?10:t.charCodeAt(0)-48)+8;this.bitBuffer.put(r,7)};NumericEncoder.prototype.encodeOne=function(e){var t;t=e===Constants.FNC1?10:e.charCodeAt(0)-48+1;this.bitBuffer.put(t,4)};NumericEncoder.prototype.AlphanumericLatch=function(){this.bitBuffer.put(0,4)};return NumericEncoder}();export{NumericEncoder};var GS1GeneralPurposeDataEncodation=function(){function GS1GeneralPurposeDataEncodation(e,t){void 0===t&&(t=!1);this.text="";this.mode=GS1GeneralPurposeDataEncodation.EncodeMod.Numeric;this.bitBuffer=e;this.needExtraPadding=t}GS1GeneralPurposeDataEncodation.prototype.encodeGeneralData=function(e){if(e){for(var t=this.bitBuffer,r=GS1GeneralPurposeDataEncodation.EncodeMod.Numeric,n=e.length,i=0;n>0;n=e.length-i){var a=e[i];switch(r){case GS1GeneralPurposeDataEncodation.EncodeMod.Numeric:var o=new NumericEncoder(t),s=t.length;if(1===n)if(NumericEncoder.isNumeric(a)){s>24&&s%12<=8&&s%12>5?o.encodeOne(a):o.encode(a,Constants.FNC1);i++}else{o.AlphanumericLatch();r=GS1GeneralPurposeDataEncodation.EncodeMod.Alphanumeric}else if(NumericEncoder.isNumericOrFNC1(a)&&NumericEncoder.isNumericOrFNC1(e[i+1])&&(a!==Constants.FNC1||e[i+1]!==Constants.FNC1)){o.encode(a,e[i+1]);i+=2}else{o.AlphanumericLatch();r=GS1GeneralPurposeDataEncodation.EncodeMod.Alphanumeric}break;case GS1GeneralPurposeDataEncodation.EncodeMod.Alphanumeric:o=new AlphanumericEncoder(t);if(a===Constants.FNC1){o.FNC1NumericLatch();r=GS1GeneralPurposeDataEncodation.EncodeMod.Numeric;i++}else if(NumericEncoder.isNumeric(a)){for(var c=i+1;c<e.length&&NumericEncoder.isNumeric(e[c]);c++);if(c-i>=6||c-i>=4&&c===e.length){o.NumericLatch();r=GS1GeneralPurposeDataEncodation.EncodeMod.Numeric}else{o.encode(a);i++}}else if(ISO646Encoder.isISO646Only(a)){o.ISO646Latch();r=GS1GeneralPurposeDataEncodation.EncodeMod.ISO646}else{o.encode(a);i++}break;case GS1GeneralPurposeDataEncodation.EncodeMod.ISO646:o=new ISO646Encoder(t);if(NumericEncoder.isNumericOrFNC1(a)){for(c=i+1;c<e.length&&NumericEncoder.isNumericOrFNC1(e[c]);c++);if(c-i>=4){for(;c<e.length&&!ISO646Encoder.isISO646Only(e[c]);c++);if(c==e.length||c-i>10){o.NumericLatch();r=GS1GeneralPurposeDataEncodation.EncodeMod.Numeric;break}}}else{for(c=i;c<e.length&&!ISO646Encoder.isISO646Only(e[c]);c++);if(c-i>10){o.AlphanumericLatch();r=GS1GeneralPurposeDataEncodation.EncodeMod.Alphanumeric;break}}if(a===Constants.FNC1){o.FNC1NumericLatch();r=GS1GeneralPurposeDataEncodation.EncodeMod.Numeric;i++}else{o.encode(a);i++}}}this.mode=r}};GS1GeneralPurposeDataEncodation.prototype.padTo=function(e){var t=e-this.bitBuffer.length;this._pad(t)};GS1GeneralPurposeDataEncodation.prototype._pad=function(e){for(var t=this.bitBuffer;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}};GS1GeneralPurposeDataEncodation.prototype.encode=function(e){void 0===e&&(e="");var t,r=this.bitBuffer,n=this.needExtraPadding;this.encodeGeneralData(e);var i=~~((r.length+11)/12);t=12*(i=i<3?3:i)-r.length;n&&(t+=12);this._pad(t)};GS1GeneralPurposeDataEncodation.EncodeMod={Numeric:"Numeric",Alphanumeric:"Alphanumeric",ISO646:"ISO646"};return GS1GeneralPurposeDataEncodation}();export{GS1GeneralPurposeDataEncodation};var mb=new MatrixBuilder(69,7),pwr928=mb.toMatrix();function init928(){var e,t,r,n=Utils.fillArray(new Array(7),0);n[6]=1;for(e=0;e<7;e++)pwr928[0][e]=n[e];for(t=1;t<69;t++){for(r=0,e=6;e>=1;e--){r=2*n[e]+~~(r/928);pwr928[t][e]=n[e]=r%928}pwr928[t][0]=n[0]=2*n[0]+~~(r/928)}}init928();function getBit(e,t){return 0==(e[~~(t/16)]&32768>>t%16)?0:1}export function encode928(e,t,r){var n,i,a,o,s,c,u;for(s=u=a=0;a<r;a+=69,s+=7){u+=c=1+~~((o=Math.min(r-a,69))/10);for(n=0;n<c;n++)t[s+n]=0;for(n=0;n<o;n++)if(getBit(e,a+o-n-1))for(i=0;i<c;i++)t[s+i]+=pwr928[n][i+7-c];for(n=c-1;n>0;n--){t[s+n-1]+=~~(t[s+n]/928);t[s+n]%=928}}return u}function makeRange_CCA(e,t){for(var r=[],n=0,i=e;n<t;){i>52&&(i%=52);r.push(i);n++;i++}return r}export function findVersionTable_CCA(e,t){for(var r=0,n=e.length;r<n;r++){var i=e[r],a=i[0],o=i[1],s=i[2],c=i[3],u=i[4],d=i[5],p=i[6],l=o*a;if(t(i={rows:o,cols:a,total:l,ecCws:s,nonEcCw:l-s,bits:c})){i.rowAssignment={left:makeRange_CCA(u,o),right:makeRange_CCA(d,o),center:p?makeRange_CCA(p,o):null};for(var h=[],f=0;f<=o;){var m=(u+f-1)%3;h.push(m);f++}i.cluster=h;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]],(function(r){return r.cols===e&&r.bits>=t}))}var SupportedUppercaseAlphabetic="BDHIJKLNPQRSTVWZ";export function getSupportedUppercaseAlphabetic(e){var t=SupportedUppercaseAlphabetic.indexOf(e);if(-1===t)return null;var r=Utils.convertRadix(t);return Utils.strPadStart(r,4,"0")}var EncodeMod=GS1GeneralPurposeDataEncodation.EncodeMod,GeneralPurposeDataEncodation=function(e){__extends(GeneralPurposeDataEncodation,e);function GeneralPurposeDataEncodation(){return null!==e&&e.apply(this,arguments)||this}GeneralPurposeDataEncodation.prototype.encodeGeneralData=function(e,t){if(e){for(var r=this.bitBuffer,n=EncodeMod.Numeric,i=e.length,a=0;i>0;i=e.length-a){var o=e[a];switch(n){case EncodeMod.Numeric:var s=new NumericEncoder(r),c=o[0].charCodeAt(0);if(1===i)if(NumericEncoder.isNumeric(o)){var u=getVersionVariant_CCA(t,r.length);if(!u)throw new TextTooLongException;var d=u.bits-r.length;if(d>=4&&d<=6){s.encodeOne(o);r.put(0,d-4)}else r.put(11*(c-48)+10+8,7);a++}else{s.AlphanumericLatch();n=EncodeMod.Alphanumeric}else if(NumericEncoder.isNumericOrFNC1(o)&&NumericEncoder.isNumericOrFNC1(e[a+1])&&(o!==Constants.FNC1||e[a+1]!==Constants.FNC1)){s.encode(o,e[a+1]);a+=2}else{s.AlphanumericLatch();n=EncodeMod.Alphanumeric}break;case EncodeMod.Alphanumeric:s=new AlphanumericEncoder(r);if(o===Constants.FNC1){s.FNC1NumericLatch();n=EncodeMod.Numeric;a++}else if(NumericEncoder.isNumeric(o)){for(var p=a+1;p<e.length&&NumericEncoder.isNumericOrFNC1(e[p]);p++);if(p-a>=6||p-a>=4&&p===e.length){s.NumericLatch();n=EncodeMod.Numeric}else{s.encode(o);a++}}else if(ISO646Encoder.isISO646Only(o)){s.ISO646Latch();n=EncodeMod.ISO646}else{s.encode(o);a++}break;case EncodeMod.ISO646:s=new ISO646Encoder(r);if(NumericEncoder.isNumericOrFNC1(o)){for(p=a+1;p<e.length&&NumericEncoder.isNumericOrFNC1(e[p]);p++);if(p-a>=4){for(;p<e.length&&!ISO646Encoder.isISO646Only(e[p]);p++);if(p==e.length||p-a>10){s.NumericLatch();n=EncodeMod.Numeric;break}}}else{for(p=a;p<e.length&&!ISO646Encoder.isISO646Only(e[p]);p++);if(p-a>10){s.AlphanumericLatch();n=EncodeMod.Alphanumeric;break}}if(o===Constants.FNC1){s.FNC1NumericLatch();n=EncodeMod.Numeric;a++}else{s.encode(o);a++}}}this.mode=n}};return GeneralPurposeDataEncodation}(GS1GeneralPurposeDataEncodation);export{GeneralPurposeDataEncodation};var 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((function(e){return e.reverse()}));function encode(e,t,r){var n=Utils.fillArray(new Array(t),0);e.forEach((function(e){for(var i,a=e+n[t-1],o=t-1;o>0;--o){i=929-a*r[o]%929;n[o]=(n[o-1]+i)%929}i=929-a*r[0]%929;n[0]=i%929}));n.forEach((function(e,t){0!=e&&(n[t]=929-e)}));return n.reverse()}export function generateECC(e,t){var r=EccCoefficientTable[t];return encode(e,Math.pow(2,t+1),r)}export function generateECCForMicro(e,t){for(var r,n=0;n<MicroEccCoefficientTable.length;){var i=MicroEccCoefficientTable[n];if(i.length===t){r=i;break}n++}return encode(e,t,r)}export var 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 var CompactionMode={Auto:"auto",Text:"text",Byte:"byte",Numeric:"numeric"};Utils.makeEnums(CompactionMode);export var 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]];var mode_ll=" ",mode_ps=" ",mode_ml=" ",mode_al=" ",mode_pl=" ",mode_as=" ";export var subModeMap={ll:mode_ll,ps:mode_ps,ml:mode_ml,al:mode_al,pl:mode_pl,as:mode_as};var TEXT_MAP=["ABCDEFGHIJKLMNOPQRSTUVWXYZ "+mode_ll+mode_ml+mode_ps,"abcdefghijklmnopqrstuvwxyz "+mode_as+mode_ml+mode_ps,"0123456789&\r\t,:#-.$/+%*=^ "+mode_ll+mode_al+mode_ps,";<>@[\\]_`~!\r\t,:\n-.$/\"|*()?{}'"+mode_al];export var 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){for(var r=t,n=e.length,i=0;r<n;){e[r]>="0"&&e[r]<="9"?i++:i=0;if(!isTC(e[r]))break;if(i>=13){r-=--i;break}r++}return e.substring(t,r)}function nextNC(e,t){for(var r=t,n=e.length;r<n&&!(e[r]<"0"||e[r]>"9");)r++;return e.substring(t,r)}function nextBC(e,t){for(var r=t,n=e.length,i=0,a=0,o=!1;r<n;){if(e[r]>="0"&&e[r]<="9"){i++;if(o){a=0;o=!1}}else if(isTC(e[r])){a++;if(!o){i=0;o=!0}}if(a>=5){r-=--a;break}if(i>=13){r-=--i;break}r++}return e.substring(t,r)}export function compaction(e,t){void 0===t&&(t=CompactionMode.Auto);var 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 for(var n=0,i=e.length,a={mode:MODE_TC,text:""};n<i;){var o=nextNC(e,n);if(o.length>=13){a={mode:MODE_NC,text:o};r.push(a);n+=o.length}else{var s=nextTC(e,n);if(s.length>=5){a={mode:MODE_TC,text:s};r.push(a);n+=s.length}else{var c=nextBC(e,n);if(1===c.length&&a.mode==MODE_TC){a={mode:MODE_BC_SHIFT,text:c};r.push(a)}else{a=c.length%6==0?{mode:MODE_BC6,text:c}:{mode:MODE_BC,text:c};r.push(a)}n+=c.length}}}r.forEach((function(e){if(e.mode==MODE_TC){var t={mode:"al",text:""},r=[t];e.subModes=r;for(var n=0,i=e.text.length;n<i;n++){var a=e.text[n];if(isAlpha(a))if(0===n||"al"===t.mode)t.text+=a;else{t=isAlpha(e.text[n+1])?{mode:"al",text:a}:"ll"===t.mode?{mode:"as",text:a}:{mode:"al",text:a};r.push(t)}else if(isLower(a))if("ll"===t.mode)t.text+=a;else{t={mode:"ll",text:a};r.push(t)}else if(isMixed(a))if("pl"===t.mode&&isPunctuation(a))t.text+=a;else if("ml"===t.mode)t.text+=a;else{t={mode:"ml",text:a};r.push(t)}else if(isPunctuation(a))if("pl"===t.mode)t.text+=a;else{t=isPunctuation(e.text[n+1])?{mode:"pl",text:a}:{mode:"ps",text:a};r.push(t)}}}}));return r}export function getIndicator(e,t,r,n,i){var a,o=~~(e/3),s=~~((t-1)/3),c=3*r+(t-1)%3,u=n-1;switch(e%3*3){case 0:a=i?u:s;break;case 3:a=i?s:c;break;case 6:a=i?c:u}return 30*o+a}export function getPattern_PDF417(e,t){return CLUSTERS[e%3][t]}export function getTCValue(e,t){var 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}var 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){var r=getTCValue(subModeMap[e],t);return r>-1?[r]:subModeTable[t][e]}export function createModules(e,t){for(var r=[],n=0;n<e;n++)r.push(Utils.fillArray(new Array(t),null));return r}export function getAutoECL(e){var t=e.length;return t<=40?2:t<=160?3:t<=320?4:5}export function getAutoRowAndCol(e){var t,r,n=31;do{n--;r=(t=Math.ceil(e/n))/n;if(n<2)break}while(r<4);t<3&&(t=3);return{col:n,row:t}}var 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){for(var r=[],n=0,i=e;n<t;){i>52&&(i%=52);r.push(i);n++;i++}return r}export function findVersionTable(e,t){for(var r=0,n=e.length;r<n;r++){var i=e[r],a=i[0],o=i[1],s=i[2],c=i[3],u=i[4],d=i[5],p=o*a,l=o*a-s-2;if(t(i={rows:o,cols:a,total:p,ecCws:s,nonEcCw:p-s,bits:8*(6*~~(l/5)+l%5)})){i.rowAssignment={left:makeRange(c,o),right:makeRange(u,o),center:d?makeRange(d,o):null};for(var h=[],f=0;f<=o;){var m=(c+f-1)%3;h.push(m);f++}i.cluster=h;return i}}return null}export function getVersionVariantColPrior(e){for(var t=1,r=null;t<=4;){var n=findVersionTable(VersionTable,(function(r){return r.cols===t&&r.nonEcCw>=e}));r?n&&n.rows>r.rows&&(r=n):r=n;t++}return r}export function getVersionVariantRowPrior(e){return findVersionTable(VersionTable,(function(t){return 4===t.cols&&t.nonEcCw>=e}))}export function getVersionVariant(e,t){return findVersionTable(VersionTable,(function(r){return r.cols===t&&r.rows===e}))}export function getVersionVariantByCol(e,t){return findVersionTable(VersionTable,(function(r){return r.cols===e&&r.nonEcCw>=t}))}export function getECCBVersionVariantByCol(e,t){return findVersionTable(VersionTable,(function(r){return r.cols===e&&r.bits>=t}))}export function getRowAddressPatterns(e,t,r){var n;switch(t){case"L":n=LRRowAddressPatterns[e.left[r]-1];break;case"R":n=LRRowAddressPatterns[e.right[r]-1];break;default:n=CRowAddressPatterns[e.center[r]-1]}return Utils.toZeroOnePattern(Utils.str2Array(n),!0)}export function getPattern(e,t){return CLUSTERS[e][t]}var 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"},BigNumber=function(){function BigNumber(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}BigNumber.prototype.addDigit=function(e){if(!testDigit(e)){this.number=errors.invalid;return!1}this.number.push(e);return this};BigNumber.prototype.isEven=function(){return this.number[0]%2==0};BigNumber.prototype._compare=function(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};BigNumber.prototype.gt=function(e){return this._compare(e)>0};BigNumber.prototype.gte=function(e){return this._compare(e)>=0};BigNumber.prototype.equals=function(e){return 0===this._compare(e)};BigNumber.prototype.lte=function(e){return this._compare(e)<=0};BigNumber.prototype.lt=function(e){return this._compare(e)<0};BigNumber.prototype.add=function(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};BigNumber.prototype.minus=function(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};BigNumber._add=function(e,t){var r,n=0,i=Math.max(e.number.length,t.number.length);for(r=0;r<i||n>0;r++){e.number[r]=(n+=(e.number[r]||0)+(t.number[r]||0))%10;n=Math.floor(n/10)}return e.number};BigNumber._subtract=function(e,t){var r,n=0,i=e.number.length;for(r=0;r<i;r++){e.number[r]-=(t.number[r]||0)+n;e.number[r]+=10*(n=e.number[r]<0?1:0)}r=0;i=e.number.length-1;for(;0===e.number[i-r]&&i-r>0;)r++;r>0&&e.number.splice(-r);return e.number};BigNumber.prototype.multiply=function(e){if(void 0===e)return this;var t,r,n=new BigNumber(e),i=0,a=[];if(this.isZero()||n.isZero())return new BigNumber(0);this.sign*=n.sign;for(t=0;t<this.number.length;t++)for(i=0,r=0;r<n.number.length||i>0;r++){a[t+r]=(i+=(a[t+r]||0)+this.number[t]*(n.number[r]||0))%10;i=Math.floor(i/10)}this.number=a;return this};BigNumber.prototype.divide=function(e){if(void 0===e)return this;var t,r,n=new BigNumber(e),i=[],a=new BigNumber(0);if(n.isZero()){this.number=errors["division by zero"];return this}if(this.isZero()){this.rest=new BigNumber(0);return this}this.sign*=n.sign;n.sign=1;if(1===n.number.length&&1===n.number[0]){this.rest=new BigNumber(0);return this}for(t=this.number.length-1;t>=0;t--){a.multiply(10);a.number[0]=this.number[t];i[t]=0;for(;n.lte(a);){i[t]++;a.minus(n)}}t=0;r=i.length-1;for(;0===i[r-t]&&r-t>0;)t++;t>0&&i.splice(-t);this.rest=a;this.number=i;return this};BigNumber.prototype.mod=function(e){return this.divide(e).rest};BigNumber.prototype.power=function(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}};BigNumber.prototype.abs=function(){this.sign=1;return this};BigNumber.prototype.isZero=function(){var e;for(e=0;e<this.number.length;e++)if(0!==this.number[e])return!1;return!0};BigNumber.prototype.toString=function(){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};return BigNumber}();export{BigNumber};var PDF417Base=function(e){__extends(PDF417Base,e);function PDF417Base(){return null!==e&&e.apply(this,arguments)||this}PDF417Base.prototype.validate=function(){var e=this.encodeConfig.text;if(!/^[\x00-\xFF]+$/.test(e))throw new InvalidTextException(e)};PDF417Base.prototype.encodeNC=function(e){var t=e.text,r=[];Utils.sliceString(t,44,(function(e){for(var t=new BigNumber("1"+e),n=[];;){var i=new BigNumber(t).mod(900);t.divide(new BigNumber(900));n.unshift(+i.toString());if(t.lt(1))break}r=r.concat(n)}));r.unshift(MODE_NC);return r};PDF417Base.prototype.encodeBC=function(e){var t=e.text,r=[];Utils.sliceString(t,6,(function(e){if(6===e.length){var t=5,n=0,i=[];Utils.sliceString(e,1,(function(e){n+=e.charCodeAt(0)*Math.pow(256,t--)}));var a=0,o=Math.floor(n/Math.pow(900,a))%900;do{i.unshift(o);o=Math.floor(n/Math.pow(900,++a))%900}while(o>0);for(;i.length<5;)i.unshift(0);r=r.concat(i)}else Utils.sliceString(e,1,(function(e){r.push(e.charCodeAt(0))}))}));r.unshift(e.mode);return r};PDF417Base.prototype.encodeTC=function(e){var t=[],r="al";e.subModes.forEach((function(e){r!==e.mode&&(t=t.concat(getTCSubModeValue(e.mode,r)));Utils.sliceString(e.text,1,(function(r){t.push(getTCValue(r,e.mode))}));"ps"!==e.mode&&"as"!==e.mode&&(r=e.mode)}));var n=[MODE_TC];Utils.sliceArray(t,2,(function(e){2===e.length?n.push(30*e[0]+e[1]):n.push(30*e[0]+29)}));return n};PDF417Base.prototype.encode=function(e){var t=this,r=[];e.forEach((function(e){switch(e.mode){case MODE_TC:r=r.concat(t.encodeTC(e));break;case MODE_BC:case MODE_BC6:case MODE_BC_SHIFT:r=r.concat(t.encodeBC(e));break;case MODE_NC:r=r.concat(t.encodeNC(e))}}));return r};PDF417Base.prototype.convertToShape=function(e,t){var r=this.encodeConfig,n=r.height,i=r.quietZone,a=n/e.length,o=e[0].reduce((function(e,t){return e+=t.length}),0)+i.right+i.left,s=e.length*a+i.top+i.bottom,c=new VerticalLayoutArea,u=new MatrixSymbolArea(o,s,a);u.setStyle({padding:{top:i.top,right:i.right,bottom:i.bottom,left:i.left}});c.append(u);if(!t){e.forEach((function(e){e.forEach((function(e){Utils.combineTruthy(e).forEach((function(e){0!==e?u.append(e,a):u.space()}))}))}));this.shapes=c.toShapes()}this.mainArea=c;this.size=c.getSize()};PDF417Base.prototype.adjustDesiredSize=function(){var e=this.size.width,t=this.encodeConfig,r=t.desiredSize,n=t.containerWidth/e;r.forceRounding&&(n=(n=~~n)<1?1:n);this.applyDesiredSize(n)};PDF417Base.prototype.getMainArea=function(){return this.mainArea};PDF417Base.PAD=900;return PDF417Base}(TwoDimensionalBarcode);export{PDF417Base};var PDF417Encoder=function(e){__extends(PDF417Encoder,e);function PDF417Encoder(t){var r=this;t.merge(PDF417Encoder.DefaultConfig);var n=(r=e.call(this,t)||this).config,i=n.errorCorrectionLevel,a=n.columns,o=n.rows,s=n.compact,c=r.encodeConfig.text;r.text=c;r.ecl="auto"===i?i:+i;r.columns="auto"===a?a:+a;r.rows="auto"===o?o:+o;r.compact=!!s;return r}PDF417Encoder.prototype.validate=function(){e.prototype.validate.call(this);var t=this.config,r=t.errorCorrectionLevel,n=t.rows,i=t.columns;if(Utils.isNumberLike(r)&&(r<0||r>8))throw new InvalidOptionsException({errorCorrectionLevel:r},"ErrorCorrectionLevel is from 0 - 8.");if(Utils.isNumberLike(n)&&(n<3||n>90))throw new InvalidOptionsException({rows:n},"Rows is from 3 - 90.");if(Utils.isNumberLike(i)&&(i<1||i>30))throw new InvalidOptionsException({columns:i},"Columns is from 1 - 30.")};PDF417Encoder.prototype.genEcc=function(){var e=this.data,t=this.ecl,r=this.columns,n=this.rows;e[0]===MODE_TC&&e.shift();"auto"===t&&(this.ecl=t=getAutoECL(e));var i=Math.pow(2,t+1),a=e.length+1+i;if("auto"===n&&"auto"===r){var o=getAutoRowAndCol(a),s=o.col,c=o.row;this.columns=r=s;this.rows=n=c}else if("auto"===n){if((n=Math.ceil(a/r))>90)throw new InvalidOptionsException({columns:r},"Columns is not large enough");n=n<3?3:n;this.rows=n}else if("auto"===r){if((r=Math.ceil(a/n))>30)throw new InvalidOptionsException({rows:n},"Rows is not large enough");this.columns=r}var u=r*n-i;e.unshift(u);if(e.length>PDF417Encoder.MAX_DATA_NUM||e.length>u)throw new TextTooLongException;for(;e.length<u;)e.push(PDF417Base.PAD);this.ecc=generateECC(e,this.ecl)};PDF417Encoder.prototype.calculateData=function(){var e=compaction(this.text);this.data=this.encode(e);this.genEcc();var t=this,r=t.data,n=t.ecc,i=t.columns,a=t.rows,o=t.ecl,s=t.compact,c=r.concat(n),u=createModules(a,i);c.forEach((function(e,t){var r=Math.floor(t/i),n=t%i;u[r][n]=getPattern_PDF417(r,e)}));var d=[];u.forEach((function(e,t){var r=getPattern_PDF417(t,getIndicator(t,a,o,i)),n=getPattern_PDF417(t,getIndicator(t,a,o,i,!0)),c=[PDF417Encoder.START,r.toString(2)];e.forEach((function(e){c.push(e.toString(2))}));if(s)c.push(PDF417Encoder.COMPACT_END);else{c.push(n.toString(2));c.push(PDF417Encoder.END)}d.push(c)}));return d};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;return PDF417Encoder}(PDF417Base);export{PDF417Encoder};var MicroPDF417Encoder=function(e){__extends(MicroPDF417Encoder,e);function MicroPDF417Encoder(t){var r=this;t.merge(MicroPDF417Encoder.DefaultConfig);var n=(r=e.call(this,t)||this).config,i=n.symbolVersion,a=n.compactionMode,o=n.segmentIndex,s=n.fileID,c=n.structuredAppend,u=n.optionalFields,d=r.encodeConfig.text;r.text=d;r.symbolVersion=i;r.versionMeta=null;r.compactionMode=a;r.structuredAppendEnabled=c;r.segmentIndex=o;r.fileID=s;r.optionalFields=u;r.segmentCount=0;r.structuredAppendCws=[];return r}MicroPDF417Encoder.prototype.validate=function(){e.prototype.validate.call(this);var t=this.config,r=t.compactionMode,n=t.symbolVersion,i=t.segmentIndex,a=t.fileID,o=this.encodeConfig.text;if(r===CompactionMode.Numeric&&!/^[\d]*$/.test(o))throw new InvalidOptionsException({compactionMode:r,text:o},"CompactionMode is numeric, but the text is not.");if(!CompactionMode.has(r))throw new InvalidOptionsException({compactionMode:r});if(!SymbolVersion.has(n))throw new InvalidOptionsException({symbolVersion:n});if(i<0||i>99998||a<0||a>899)throw new InvalidOptionsException({segmentIndex:i},"SegmentIndex should in range 0 - 99998")};MicroPDF417Encoder.prototype._buildRow=function(e,t){var r=this.columns,n=this.versionMeta,i=n.rowAssignment,a=n.cluster,o=getRowAddressPatterns(i,"L",t),s=getRowAddressPatterns(i,"R",t),c=[o],u=a[t],d=e.map((function(e){return getPattern(u,e)}));switch(r){case 1:c.push(d[0].toString(2));break;case 2:c.push(d[0].toString(2));c.push(d[1].toString(2));break;case 3:c.push(d[0].toString(2));c.push(getRowAddressPatterns(i,"C",t));c.push(d[1].toString(2));c.push(d[2].toString(2));break;default:c.push(d[0].toString(2));c.push(d[1].toString(2));c.push(getRowAddressPatterns(i,"C",t));c.push(d[2].toString(2));c.push(d[3].toString(2))}return c=c.concat([s,MicroPDF417Encoder.StopBar])};MicroPDF417Encoder.prototype._buildStructAppend=function(){var e=this.segmentIndex,t=this.segmentCount,r=this.fileID,n=this.optionalFields,i=[MicroPDF417Encoder.StructuredAppendMarker],a=this.encodeNC({text:Utils.strPadStart(e+"",5,"0")});a.shift();i.push.apply(i,a);i.push(r);if(n.segmentCount){i.push(MicroPDF417Encoder.StructuredAppendOptionalFieldsMarker);i.push(MicroPDF417Encoder.StructuredAppendOptionalFieldTags.SegmentCount);var o=this.encodeNC({text:Utils.strPadStart(t+"",5,"0")});o.shift();i.push.apply(i,o)}e===t-1&&i.push(MicroPDF417Encoder.StructuredAppendTerminator);return i};MicroPDF417Encoder.prototype._splitStruct=function(e){var t,r=this.symbolVersion,n=this.segmentIndex;if(r===SymbolVersion.RowPriorAuto||r===SymbolVersion.ColumnPriorAuto)t=getVersionVariant(44,4);else{var i=r.split("*"),a=i[0];t=getVersionVariant(+i[1],+a)}var o=this._buildStructAppend(),s=t.nonEcCw-o.length;if(s<0)throw new TextTooLongException;var c,u=Math.ceil(e.length/s);e.length-s*(u-1)===s&&u++;if(n>=u)throw new InvalidOptionsException({segmentIndex:n},"The max segment index is "+(u-1)+".");if(u>99999)throw new TextTooLongException;c=n===u-1?e.slice(s*n):e.slice(s*n,s*(n+1));this.segmentCount=u;return c};MicroPDF417Encoder.prototype.genEcc=function(){var e,t=this.data,r=this.symbolVersion,n=this.structuredAppendCws,i=t.length+n.length;if(r===SymbolVersion.RowPriorAuto)e=getVersionVariantRowPrior(i);else if(r===SymbolVersion.ColumnPriorAuto)e=getVersionVariantColPrior(i);else{var a=r.split("*"),o=a[0];e=getVersionVariant(+a[1],+o)}var s=e.rows*e.cols-e.ecCws;if(s<i)throw new TextTooLongException;for(var c=s-i;c>0;){t.push(PDF417Base.PAD);c--}this.versionMeta=e;this.ecc=generateECCForMicro(t.concat(n),e.ecCws);this.rows=e.rows;this.columns=e.cols};MicroPDF417Encoder.prototype.calculateData=function(){var e=this,t=compaction(this.text,this.compactionMode),r=this.encode(t);if(this.structuredAppendEnabled){this.data=this._splitStruct(r);this.structuredAppendCws=this._buildStructAppend()}else this.data=r;this.genEcc();var n=this,i=n.data,a=n.ecc,o=n.columns,s=n.rows,c=n.structuredAppendCws,u=i.concat(c).concat(a),d=createModules(s,o);u.forEach((function(e,t){var r=Math.floor(t/o),n=t%o;d[r][n]=e}));var p=[];d.forEach((function(t,r){p.push(e._buildRow(t,r))}));return p};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};return MicroPDF417Encoder}(PDF417Base);export{MicroPDF417Encoder};Barcode.registerEncoder("PDF417",PDF417Encoder);Barcode.registerEncoder("MicroPDF417",MicroPDF417Encoder);var CCA=function(e){__extends(CCA,e);function CCA(t,r,n,i){void 0===r&&(r=4);void 0===n&&(n=1);var a=this,o={text:t,unitSize:n,quietZone:{top:0,right:0,left:0,bottom:0}};i&&(o.height=i);(a=e.call(this,new Option(o))||this).columns=r;var s=a.encodeConfig.text;a.text=s.replace(/\(|\)/g,"");a.bitBuffer=new BitBuffer;a._gpdEncodation=new GeneralPurposeDataEncodation(a.bitBuffer);var c=s.split(/\(|\)/);c.shift();for(var u=0,d=[];u<c.length;)d.push({ai:c[u++],data:c[u++]});a.aiGroup=d;a.autoHeight=!i;return a}CCA.prototype._buildRow=function(e,t){var r=this.columns,n=this.versionMeta,i=n.rowAssignment,a=n.cluster,o=getRowAddressPatterns(i,"L",t),s=getRowAddressPatterns(i,"R",t),c=3===r?[]:[o],u=a[t],d=e.map((function(e){return getPattern(u,e)}));switch(r){case 2:c.push(d[0].toString(2));c.push(d[1].toString(2));break;case 3:c.push(d[0].toString(2));c.push(getRowAddressPatterns(i,"C",t));c.push(d[1].toString(2));c.push(d[2].toString(2));break;default:c.push(d[0].toString(2));c.push(d[1].toString(2));c.push(getRowAddressPatterns(i,"C",t));c.push(d[2].toString(2));c.push(d[3].toString(2))}return c=c.concat([s,MicroPDF417Encoder.StopBar])};CCA.prototype._encode_10Date=function(e){var t=this.bitBuffer,r=this.text,n=384*+e.substr(0,2)+32*(+e.substr(2,2)-1)+ +e.substr(4,2);if(isNaN(n))throw new InvalidTextException(r,"The text doesn't contains a vaild product date or expire date");t.put(n,16)};CCA.prototype._getMethod_11Mode=function(e){for(var t=0,r=0,n=0,i=e.length;n<i;n++){var a=e[n];if("*,-./".indexOf(a)>-1)return"Alphanumeric";a>="A"&&a<="Z"&&t++;a>="0"&&a<="9"&&r++}return t>r?"Alpha":"Numeric"};CCA.prototype._encode_11=function(){var e=this.bitBuffer,t=this.aiGroup,r="",n=t[0];e.putBits("11");var i=/^([1-9][0-9]?[0-9]?)?([A-Z][0-9A-Z*,-./]*)/.exec(n.data),a=i[1]||"",o=i[2][0],s=a+o;a=a?+a:0;var c=n.data.substr(s.length);switch(this._getMethod_11Mode(c)){case"Alphanumeric":e.putBits("0");break;case"Alpha":e.putBits("11");break;case"Numeric":e.putBits("10")}var u=t[1];if(u)switch(u.ai){case"21":r=c+Constants.FNC1+u.data;e.putBits("10");break;case"8004":r=c+Constants.FNC1+u.data;e.putBits("11");break;default:r=c+Constants.FNC1+u.ai+u.data;e.putBits("0")}else{r=c;e.putBits("0")}t.length>2&&Utils.loop((function(e){var n=t[e];r=r+Constants.FNC1+n.ai+n.data}),{from:2,to:t.length-1});var d=getSupportedUppercaseAlphabetic(o);if(a<31&&d){e.putBit(a,5);e.putBits(d)}else{e.putBits("11111");e.put(a,10);e.put(o.charCodeAt(0)-65,5)}return r};CCA.prototype._encode_10=function(){var e=this.bitBuffer,t=this.aiGroup,r="",n=t[0];e.putBits("10");if("11"===n.ai||"17"===n.ai){this._encode_10Date(n.data);e.putBit("17"===n.ai);if(t.length>1){if(t[1]&&"10"===t[1].ai){r=t[1].data;t.length>2&&Utils.loop((function(e){var n=t[e];r=r+Constants.FNC1+n.ai+n.data}),{from:2,to:t.length-1})}else{r=Constants.FNC1;Utils.loop((function(e){var n=t[e];r=r+n.ai+n.data}),{from:1,to:t.length-1})}}else r=Constants.FNC1}else if("10"===n.ai){e.putBits("11");r=n.data;t.length>1&&Utils.loop((function(e){var n=t[e];r=r+Constants.FNC1+n.ai+n.data}),{from:1,to:t.length-1})}return r};CCA.prototype._encode_0=function(){var e=this.bitBuffer,t=this.aiGroup,r=this.text;e.putBits("0");if(!t.length)return r;var n="";n=t[0].ai+t[0].data;t.length>1&&Utils.loop((function(e){var r=t[e];n=n+Constants.FNC1+r.ai+r.data}),{from:1,to:t.length-1});return n};CCA.prototype._encodeMethod=function(){var e=this.text,t=this.aiGroup[0];if(t)if("10"===t.ai||"11"===t.ai||"17"===t.ai)this.method="10";else if("90"===t.ai){var r=/^90(?:[1-9][0-9]?[0-9]?)?[A-Z]/.test(e);this.method=r?"11":"0"}else this.method="0";else this.method="0"};CCA.prototype.getVersionVariant=function(){var e=this.bitBuffer,t=this.columns;this.versionMeta=getVersionVariant_CCA(t,e.length)};CCA.prototype._encode=function(){this._encodeMethod();var e=this.method,t=this.columns,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)};CCA.prototype.genEcc=function(){var e=this.bitBuffer,t=this.versionMeta,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)};CCA.prototype.calculateData=function(){var e=this;this._encode();this.genEcc();var t=this.data,r=this.ecc,n=this.columns,i=this.rows,a=t.concat(r),o=createModules(i,n);a.forEach((function(e,t){var r=Math.floor(t/n),i=t%n;o[r][i]=e}));var s=[];o.forEach((function(t,r){s.push(e._buildRow(t,r))}));return s};return CCA}(PDF417Base);export{CCA};var CCBInnerEncoder=function(e){__extends(CCBInnerEncoder,e);function CCBInnerEncoder(){return null!==e&&e.apply(this,arguments)||this}CCBInnerEncoder.prototype.getVersionVariant=function(){var e=this.bitBuffer,t=this.columns;this.versionMeta=getECCBVersionVariantByCol(t,e.length)};CCBInnerEncoder.prototype.getBytes=function(){this._encode();return this.bitBuffer.getGroupedBits(8)};return CCBInnerEncoder}(CCA),CCB=function(e){__extends(CCB,e);function CCB(t,r,n,i){void 0===r&&(r=4);void 0===n&&(n=1);var a=this,o={text:t,unitSize:n,compactionMode:"byte",quietZone:{top:0,right:0,left:0,bottom:0}};i&&(o.height=i);(a=e.call(this,new Option(o))||this).columns=r;var s=new CCBInnerEncoder(t,r,n,i);a.bytes=s.getBytes();a.autoHeight=!i;return a}CCB.prototype.genEcc=function(){var e=this.data,t=this.columns,r=e.length,n=getVersionVariantByCol(t,r),i=n.rows*n.cols-n.ecCws;if(i<r)throw new TextTooLongException;for(var a=i-r;a>0;){e.push(PDF417Base.PAD);a--}this.versionMeta=n;this.ecc=generateECCForMicro(e,n.ecCws);this.rows=n.rows;this.columns=n.cols;this.autoHeight&&(this.encodeConfig.height=2*n.rows)};CCB.prototype.encode=function(){var e=this.bytes,t=[];Utils.sliceArray(e,6,(function(e){if(6===e.length){var r=5,n=0,i=[];e.forEach((function(e){n+=e*Math.pow(256,r--)}));var a=0,o=Math.floor(n/Math.pow(900,a))%900;do{i.unshift(o);o=Math.floor(n/Math.pow(900,++a))%900}while(o>0);for(;i.length<5;)i.unshift(0);t=t.concat(i)}else e.forEach((function(e){t.push(e)}))}));t.unshift(e.length%6==0?MODE_BC6:MODE_BC);t.unshift(920);return t};CCB.prototype.calculateData=function(){var e=this;this.data=this.encode();this.genEcc();var t=this.data,r=this.ecc,n=this.columns,i=this.rows,a=t.concat(r),o=createModules(i,n);a.forEach((function(e,t){var r=Math.floor(t/n),i=t%n;o[r][i]=e}));var s=[];o.forEach((function(t,r){s.push(e._buildRow(t,r))}));return s};return CCB}(MicroPDF417Encoder);export{CCB};var LinkageVersion={CCA:"CCA",CCB:"CCB"},GS1DataBarBase=function(e){__extends(GS1DataBarBase,e);function GS1DataBarBase(t){var r=this;t.merge(GS1DataBarBase.DefaultConfig);var n=(r=e.call(this,t)||this).config,i=n.linkage,a=n.hideLinkageText,o=n.hideAIText;r.linkageText=i;r.linkage=!!i;r.hideLinkageText=a;r.hideAIText=o;return r}GS1DataBarBase.combins=function(e,t){var r,n,i,a,o;if(e-t>t){a=t;i=e-t}else{a=e-t;i=t}o=1;n=1;for(r=e;r>i;r--){o*=r;if(n<=a){o/=n;n++}}for(;n<=a;n++)o/=n;return o};GS1DataBarBase.getRSSwidths=function(e,t,r,n,i){var a,o,s,c,u,d=0,p=[];for(a=0;a<r-1;a++){for(o=1,d|=1<<a;;o++,d&=~(1<<a)){c=GS1DataBarBase.combins(t-o-1,r-a-2);!i&&0==d&&t-o-(r-a-1)>=r-a-1&&(c-=GS1DataBarBase.combins(t-o-(r-a),r-a-2));if(r-a-1>1){u=0;for(s=t-o-(r-a-2);s>n;s--)u+=GS1DataBarBase.combins(t-o-s-1,r-a-3);c-=u*(r-1-a)}else t-o>n&&c--;if((e-=c)<0)break}e+=c;t-=o;p[a]=o}p[a]=t;return p};GS1DataBarBase.getRSSvalue=function(e,t,r,n){var i,a,o,s,c,u,d,p=0,l=0;for(i=s=0;s<t;s++)i+=e[s];for(a=0;a<t-1;a++){for(o=1,l|=1<<a;o<e[a];o++,l&=~(1<<a))u=GS1DataBarBase.combins(i-o-1,t-a-2);!n&&0==l&&i-o-(t-a-1)>=t-a-1&&(u-=GS1DataBarBase.combins(i-o-(t-a),t-a-2));if(t-a-1>1){d=0;for(c=i-o-(t-a-2);c>r;c--)d+=GS1DataBarBase.combins(i-o-c-1,t-a-3);u-=d*(t-1-a)}else i-o>r&&(p+=--u);i-=o}return p};GS1DataBarBase.getGroup=function(e,t){for(var r=0,n=e.length;r<n;r++){var 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]}}};GS1DataBarBase.getChecksum=function(e,t){return e.reduce((function(e,r,n){return e+=r*t[n]}),0)};GS1DataBarBase.makeComplementPattern=function(e){var t="";Utils.loop((function(r){t+="1"===e[r]?"0":"1"}),e.length);return t};GS1DataBarBase.makeAlternatePattern=function(e,t){var r="",n=!t;Utils.loop((function(){r+=n?"1":"0";n=!n}),e);return r};GS1DataBarBase.makeComplexPattern=function(e){var t="",r="",n=!1;Utils.loop((function(i){if("0"===e[i]){if(n){t+=Utils.strRepeat("0",r.length);r=""}r+="0";n=!1}else{if(!n){t+=GS1DataBarBase.makeAlternatePattern(r.length);r=""}r+="1";n=!0}}),e.length);return t+=n?Utils.strRepeat("0",r.length):GS1DataBarBase.makeAlternatePattern(r.length)};GS1DataBarBase.prototype.convertToShape=function(t,r){this.linkage?this._convertToShapeForLinkage(t,r):e.prototype.convertToShape.call(this,t,r)};GS1DataBarBase.prototype.getLinkageOffset=function(e,t){};GS1DataBarBase.prototype.getLinkageSepPattern=function(e){};GS1DataBarBase.prototype._convertToShapeForLinkage=function(e,t){var r=this,n=r.label,i=r.encodeConfig,a=i.quietZone,o=i.isLabelBottom,s=i.height,c=i.showLabel,u=i.fontSizeInUnit,d=r.style,p=d.textAlign,l=d.unitValue,h=r.linkageText,f=r.config,m=f.linkageVersion,g=f.linkageHeight,B=r.linkageColumnCnt,b=m===LinkageVersion.CCA?new CCA(h,B,l,g):new CCB(h,B,l,g);b.toSymbol();var C=b.getMainArea(),S=this.getLinkageSepPattern(e),E=C.getSize(),D=0;n&&c&&(D=u);s=s-E.height-1;var x=e.length,v=s,_=this.getLinkageOffset(e,E.width),y=new VerticalLayoutArea,P=new SymbolArea(x,v),w=new SymbolArea(x,1);y.setStyle({padding:{top:a.top,right:a.right,bottom:a.bottom,left:a.left}});P.setStyle({margin:{left:_.symbolOffset}});w.setStyle({margin:{left:_.symbolOffset}});C.setStyle({margin:{left:_.linkageOffset}});var k=P.getSize(),G=new LabelArea(k.width,D,p);if(o){y.append(C);y.append(w);y.append(P);y.append(G)}else{y.append(G);y.append(C);y.append(w);y.append(P)}if(!t){w.fromPattern(S);P.fromPattern(e);G.append({text:n});this.shapes=y.toShapes()}this.size=y.getSize()};GS1DataBarBase.DefaultConfig={linkage:"",linkageVersion:"CCA",hideLinkageText:!1,hideAIText:!1};GS1DataBarBase.LinkageVersion=LinkageVersion;return GS1DataBarBase}(OneDimensionalBarcode);export{GS1DataBarBase};var Expanded=function(e){__extends(Expanded,e);function Expanded(t){var r=e.call(this,t)||this,n=r,i=n.encodeConfig.text,a=n.linkage,o=n.hideLinkageText,s=n.linkageText,c=n.hideAIText;r.text=i.replace(/\(|\)/g,"");r.label=i;a&&!o&&(r.label+=s);c&&(r.label=r.label.replace(/\(\w*\)/g,""));r._bitBuffer=new BitBuffer;r._gpdEncodation=new GS1GeneralPurposeDataEncodation(r._bitBuffer);r.finderPatternSeq=null;r.symbolContentSize=null;r.linkageColumnCnt=4;return r}Expanded.getFinderPatternSeq=function(e){var t=~~((e-3)/2);return Expanded.FinderPatternSeq[t]};Expanded.isVersion1Finder=function(e){return["A1","B1","C1","D1","E1","F1"].indexOf(e)>-1};Expanded.prototype._getSubsetWidth=function(e,t){void 0===t&&(t=!1);var r=GS1DataBarBase.getGroup(Expanded.Group,e),n=~~((e-r.preTotal)/r.evenTotal),i=(e-r.preTotal)%r.evenTotal,a=GS1DataBarBase.getRSSwidths(n,r.oddModules,4,r.oddElements,!1),o=GS1DataBarBase.getRSSwidths(i,r.evenModules,4,r.evenElements,!0),s=[];Utils.loop((function(e){s.push(a[e]);s.push(o[e])}),4);return t?s:s.reverse()};Expanded.prototype._getChecksum=function(e){var t=this,r=0;e.forEach((function(e,n){var i,a;if(0===n){i=t.finderPatternSeq[0];a=!1}else{var o=n-1;i=t.finderPatternSeq[1+~~(o/2)];a=Utils.isEven(o)}var s=Expanded.ChecksumWeight[i][a?"left":"right"];s=a?s:s.concat().reverse();r+=GS1DataBarBase.getChecksum(e,s)}));return r=r%211+211*(this.symbolContentSize-4)};Expanded.prototype._getContent=function(e){var t=this,r=[];e.forEach((function(e,n){if(Utils.isEven(n)){r.push.apply(r,e);var i=t.finderPatternSeq[~~(n/2)];r.push.apply(r,Expanded.FinderPattern[i])}else r.push.apply(r,e)}));return r};Expanded.prototype._addLength=function(e){var t=this._bitBuffer,r=1+~~((t.length+11)/12);t.putBitAt(!Utils.isEven(r),1+e);t.putBitAt(r>14,2+e)};Expanded.prototype._encode=function(){var e=this.text;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()};Expanded.prototype._encode_1=function(){var e=this.text,t=this._bitBuffer,r=this._gpdEncodation,n=Expanded.MethodReg_1.exec(e),i=n[2];t.putBits("1");t.putBits("00");t.put(+i[0],4);Utils.sliceString(i.substr(1),3,(function(e){t.put(+e,10)}));r.encode(n[4]);this._addLength(1)};Expanded.prototype._encode_0100=function(){var e=this.text,t=this._bitBuffer,r=Expanded.MethodReg_0100.exec(e),n=r[2],i=+r[4];if(i>32767)throw new InvalidTextException(e,"With method 0100, the weight should not larger than 32767.");t.putBits("0100");Utils.sliceString(n,3,(function(e){t.put(+e,10)}));t.put(i,15)};Expanded.prototype._encode_0101=function(){var e=this.text,t=this._bitBuffer,r=Expanded.MethodReg_0101.exec(e),n=r[2],i="2"==r[4][0],a=+r[5];if(i&&a>999||!i&&a>22767)throw new InvalidTextException(e,"With method 0101, the weight should not larger than "+a+".");t.putBits("0101");Utils.sliceString(n,3,(function(e){t.put(+e,10)}));t.put(i?a:a+1e4,15)};Expanded.prototype._encode_0111000_0111111=function(){var e=this.text,t=this._bitBuffer,r=Expanded.MethodReg_0111000_0111111.exec(e),n=r[2],i=+r[6][1];"1"===r[4][1]&&i--;i+=56;t.put(i,7);Utils.sliceString(n,3,(function(e){t.put(+e,10)}));t.put(+(r[4][3]+r[5]),20);var a=/^(\d{2})(\d{2})(\d{2})$/.exec(r[7]);t.put(384*+a[1]+32*(+a[2]-1)+ +a[3],16)};Expanded.prototype._encode_01100=function(){var e=this.text,t=this._bitBuffer,r=this._gpdEncodation,n=Expanded.MethodReg_01100.exec(e),i=n[2];t.putBits("01100");t.putBits("00");Utils.sliceString(i,3,(function(e){t.put(+e,10)}));t.put(+n[4],2);r.encode(n[5]);this._addLength(5)};Expanded.prototype._encode_01101=function(){var e=this.text,t=this._bitBuffer,r=this._gpdEncodation,n=Expanded.MethodReg_01101.exec(e),i=n[2];t.putBits("01101");t.putBits("00");Utils.sliceString(i,3,(function(e){t.put(+e,10)}));t.put(+n[4],2);t.put(+n[5],10);r.encode(n[6]);this._addLength(5)};Expanded.prototype._encode_00=function(){var e=this.text,t=this._bitBuffer,r=this._gpdEncodation;t.putBits("00");t.putBits("00");r.encode(e);this._addLength(2)};Expanded.prototype.makeDataWidth=function(){var e=this,t=this._bitBuffer,r=this.linkage;t.putBit(r);this._encode();var n=1+~~((t.length+11)/12),i=t.getGroupedBits(12).map((function(t,r){return e._getSubsetWidth(t,!Utils.isEven(r))}));this.finderPatternSeq=Expanded.getFinderPatternSeq(n);this.symbolContentSize=n;var a=this._getChecksum(i),o=this._getSubsetWidth(a,!0);i.unshift(o);return this._getContent(i)};Expanded.prototype.calculateData=function(){var e=this.makeDataWidth();e=Expanded.Guard.concat(e,Expanded.Guard);return Utils.toZeroOnePattern(e)};Expanded.prototype.getLinkageSepPattern=function(e){var t=this,r=e.substr(2,e.length-4),n="";Utils.sliceString(r,49,(function(e,r){var i=t.finderPatternSeq[r],a=Expanded.FinderPattern[i];n+=GS1DataBarBase.makeComplementPattern(e.substr(0,17));if(Expanded.isVersion1Finder(i)){var o=a[0]+a[1]+a[2],s=a[3]+a[4];n+=GS1DataBarBase.makeComplexPattern(e.substr(17,o));n+=GS1DataBarBase.makeComplementPattern(e.substr(17+o,s))}else{o=a[0]+a[1],s=a[2]+a[3]+a[4];n+=GS1DataBarBase.makeComplementPattern(e.substr(17,o));n+=GS1DataBarBase.makeComplexPattern(e.substr(17+o,s))}49===e.length&&(n+=GS1DataBarBase.makeComplementPattern(e.substr(32,17)))}));return"0000"+n.substr(2,n.length-4)+"0000"};Expanded.prototype.getLinkageOffset=function(e){for(var t=1;"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})(.)(.*)$/;return Expanded}(GS1DataBarBase);export{Expanded};var GS1DataBarFirstType=function(e){__extends(GS1DataBarFirstType,e);function GS1DataBarFirstType(t){var r=e.call(this,t)||this,n=r,i=n.encodeConfig,a=i.text,o=i.hideExtraChecksum,s=n.hideLinkageText,c=n.linkageText,u=n.linkage,d=n.hideAIText;r.label=a;if(a.length<18){a+=r._getCheckDigit(a);o||(r.label=a)}u&&!s&&(r.label+=c);d&&(r.label=r.label.replace(/\(\w*\)/g,""));r.text=a;r.linkageColumnCnt=4;return r}GS1DataBarFirstType.prototype.validate=function(){var e=this.encodeConfig.text;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.")}};GS1DataBarFirstType.prototype._getCheckDigit=function(e){var t=Utils.str2Array(e.substr(4,13)).reduce((function(e,t,r){t=+t;return e+=Utils.isOdd(r)?t:3*t}),0)%10;return 0===t?0:10-t};GS1DataBarFirstType.prototype._getSubsetWidth=function(e,t){var r,n,i=t?GS1DataBarFirstType.Group.InSide:GS1DataBarFirstType.Group.OutSide,a=GS1DataBarBase.getGroup(i,e),o=t?a.oddTotal:a.evenTotal;if(t){n=~~((e-a.preTotal)/o);r=(e-a.preTotal)%o}else{r=~~((e-a.preTotal)/o);n=(e-a.preTotal)%o}var s=GS1DataBarBase.getRSSwidths(r,a.oddModules,4,a.oddElements,!t),c=GS1DataBarBase.getRSSwidths(n,a.evenModules,4,a.evenElements,t),u=[];Utils.loop((function(e){u.push(s[e]);u.push(c[e])}),4);return u};GS1DataBarFirstType.prototype._getFinderPatternWidth=function(e){var t=GS1DataBarFirstType.FinderPattern[e],r="";Utils.loop((function(e){r+=t[e]}),5);return Utils.str2Array(r)};GS1DataBarFirstType.prototype._getChecksum=function(e){var t=e.width1,r=e.width2,n=e.width3,i=e.width4,a=0;a+=GS1DataBarBase.getChecksum(t,GS1DataBarFirstType.ChecksumWeight[0]);a+=GS1DataBarBase.getChecksum(r,GS1DataBarFirstType.ChecksumWeight[1]);a+=GS1DataBarBase.getChecksum(n,GS1DataBarFirstType.ChecksumWeight[2]);a+=GS1DataBarBase.getChecksum(i,GS1DataBarFirstType.ChecksumWeight[3]);(a%=79)>=8&&a++;a>=72&&a++;return a};GS1DataBarFirstType.prototype._getSymbolCharacterWidth=function(e){var t=~~(e/4537077),r=e%4537077,n=~~(t/1597),i=t%1597,a=~~(r/1597),o=r%1597;return{width1:this._getSubsetWidth(n,!1),width2:this._getSubsetWidth(i,!0),width3:this._getSubsetWidth(a,!1),width4:this._getSubsetWidth(o,!0)}};GS1DataBarFirstType.prototype.getSymbolStructure=function(){var e=this.text,t=this.linkage,r=e.substr(4,13),n=t?+r+1e13:+r,i=this._getSymbolCharacterWidth(n),a=this._getChecksum(i),o=~~(a/9),s=a%9,c=this._getFinderPatternWidth(o),u=this._getFinderPatternWidth(s);return{width1:i.width1,width2:i.width2,width3:i.width3,width4:i.width4,leftFinderPattern:c,rightFinderPattern:u}};GS1DataBarFirstType.prototype.getLinkageSepPattern=function(e){var 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"};GS1DataBarFirstType.prototype.calculateData=function(){var e=this.getSymbolStructure(),t=e.width1,r=e.width2,n=e.width3,i=e.width4,a=e.leftFinderPattern,o=e.rightFinderPattern,s=t.concat(a,r.reverse(),i,o.reverse(),n.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]];return GS1DataBarFirstType}(GS1DataBarBase);export{GS1DataBarFirstType};var Limited=function(e){__extends(Limited,e);function Limited(){var t=null!==e&&e.apply(this,arguments)||this;t.linkageColumnCnt=3;return t}Limited.prototype._getSubsetWidth=function(e){var t=GS1DataBarBase.getGroup(Limited.Group,e),r=~~((e-t.preTotal)/t.evenTotal),n=(e-t.preTotal)%t.evenTotal,i=GS1DataBarBase.getRSSwidths(r,t.oddModules,7,t.oddElements,!0),a=GS1DataBarBase.getRSSwidths(n,t.evenModules,7,t.evenElements,!1),o=[];Utils.loop((function(e){o.push(i[e]);o.push(a[e])}),7);return o};Limited.prototype._getChecksum=function(e){var t=e.leftWidth,r=e.rightWidth,n=0;n+=GS1DataBarBase.getChecksum(t,Limited.ChecksumWeight[0]);n+=GS1DataBarBase.getChecksum(r,Limited.ChecksumWeight[1]);return n%=89};Limited.prototype._getSymbolCharacterWidth=function(e){var t=~~(e/2013571),r=e%2013571;return{leftWidth:this._getSubsetWidth(t),rightWidth:this._getSubsetWidth(r)}};Limited.prototype.getLinkageSepPattern=function(e){e=e.substr(0,e.length-5);var t=GS1DataBarBase.makeComplementPattern(e);return"0000"+t.substr(4,t.length-8)+"0000"};Limited.prototype.getSymbolStructure=function(){var e=this.text,t=this.linkage,r=e.substr(4,13),n=t?+r+2015133531096:+r,i=this._getSymbolCharacterWidth(n),a=this._getChecksum(i),o=Limited.ChecksumWidth[a];return{leftWidth:i.leftWidth,rightWidth:i.rightWidth,checksumWidth:o}};Limited.prototype.getLinkageOffset=function(e,t){for(var r=e.length-1-5;"1"===e[r];)r--;return{linkageOffset:0,symbolOffset:t-r-1}};Limited.prototype.calculateData=function(){var e=this.getSymbolStructure(),t=e.leftWidth,r=e.rightWidth,n=e.checksumWidth,i=t.concat(n,r);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]];return Limited}(GS1DataBarFirstType);export{Limited};var StackedBase=function(e){__extends(StackedBase,e);function StackedBase(t){var r=this;t.merge(StackedBase.DefaultConfig);(r=e.call(this,t)||this).linkageColumnCnt=2;return r}StackedBase.prototype.calculateData=function(){var e=this.getSymbolStructure(),t=e.width1,r=e.width2,n=e.width3,i=e.width4,a=e.leftFinderPattern,o=e.rightFinderPattern,s=t.concat(a,r.reverse()),c=i.concat(o.reverse(),n.reverse());return{topRow:s=GS1DataBarFirstType.LeftGuard+Utils.toZeroOnePattern(s)+StackedBase.RightGuard,bottomRow:c=StackedBase.LeftGuard+Utils.toZeroOnePattern(c,!0)+GS1DataBarFirstType.RightGuard,separators:this.getSeparator(s,c)}};StackedBase.prototype.getLinkageSepPattern=function(e){var 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"};StackedBase.prototype.convertToShape=function(e,t){this.linkage?this._convertToShapeForLinkage(e,t):this._convertToShape(e,t)};StackedBase.prototype.getLinkageOffset=function(e){for(var t=0;"1"===e[t];)t++;return{linkageOffset:++t,symbolOffset:0}};StackedBase.prototype._convertToShapeForLinkage=function(e,t){var r=this,n=r.label,i=r.encodeConfig,a=i.quietZone,o=i.isLabelBottom,s=i.height,c=i.showLabel,u=i.fontSizeInUnit,d=r.config.ratio,p=r.style,l=p.textAlign,h=p.unitValue,f=r.linkageText,m=r.config,g=m.linkageVersion,B=m.linkageHeight,b=r.linkageColumnCnt,C=g===GS1DataBarBase.LinkageVersion.CCA?new CCA(f,b,h,B):new CCB(f,b,h,B);C.toSymbol();var S=C.getMainArea(),E=this.getLinkageSepPattern(e.topRow),D=0;n&&c&&(D=u);var x=e.separators.length,v=this.getLinkageOffset(e),_=new VerticalLayoutArea,y=new LabelArea(50,D,l),P=new SymbolArea(50,(s-x)*d),w=new SymbolArea(50,(s-x)*(1-d)),k=new SymbolArea(50,1);_.setStyle({padding:{top:a.top,right:a.right,bottom:a.bottom,left:a.left}});S.setStyle({margin:{left:v.linkageOffset}});o||_.append(y);_.append(S);_.append(k);_.append(P);var G=[];e.separators.forEach((function(){var e=new SymbolArea(50,1);G.push(e);_.append(e)}));_.append(w);o&&_.append(y);if(!t){k.fromPattern(E);P.fromPattern(e.topRow);w.fromPattern(e.bottomRow);G.forEach((function(t,r){t.fromPattern(e.separators[r])}));y.append({text:n});this.shapes=_.toShapes()}this.size=_.getSize()};StackedBase.prototype._convertToShape=function(e,t){var r=this.label,n=this.encodeConfig,i=n.quietZone,a=n.isLabelBottom,o=n.height,s=n.showLabel,c=n.fontSizeInUnit,u=this.config.ratio,d=this.style.textAlign,p=0;r&&s&&(p=c);var l=e.separators.length,h=new VerticalLayoutArea;h.setStyle({padding:{top:i.top,right:i.right,bottom:i.bottom,left:i.left}});var f=new LabelArea(50,p,d),m=new SymbolArea(50,(o-l)*u),g=new SymbolArea(50,(o-l)*(1-u));a||h.append(f);h.append(m);var B=[];e.separators.forEach((function(){var e=new SymbolArea(50,1);B.push(e);h.append(e)}));h.append(g);a&&h.append(f);if(!t){f.append({text:r});m.fromPattern(e.topRow);g.fromPattern(e.bottomRow);B.forEach((function(t,r){t.fromPattern(e.separators[r])}));this.shapes=h.toShapes()}this.size=h.getSize()};StackedBase.DefaultConfig={showLabel:!1,ratio:.4};StackedBase.RightGuard="10";StackedBase.LeftGuard="10";return StackedBase}(GS1DataBarFirstType);export{StackedBase};var ExpandedStacked=function(e){__extends(ExpandedStacked,e);function ExpandedStacked(t){var r=this;t.merge(ExpandedStacked.DefaultConfig);var n=(r=e.call(this,t)||this).config.rowCount;r.rowCount=n;r._hasExtraPadding=!1;r.linkageColumnCnt=4;return r}ExpandedStacked.prototype._makeStacked=function(e){var t=this.symbolContentSize;if(!this._hasExtraPadding){var r,n=~~(e.length/ExpandedStacked.SegmentSize);if("auto"===this.rowCount){(i=2)>n&&(i=n);r=Math.ceil(n/i);this.rowCount=i}else{var i=this.rowCount;r=Math.ceil(n/i)}if(this.rowCount>11)throw new TextTooLongException;var a=t%(2*r);this.rowSegmentCount=r;if(1===a){this._bitBuffer=new BitBuffer;this._gpdEncodation=new GS1GeneralPurposeDataEncodation(this._bitBuffer,!0);this._hasExtraPadding=!0;return this.calculateData()}}var o=this.rowSegmentCount,s=Math.ceil(t%(2*o)/2),c=Utils.isEven(o),u=o*ExpandedStacked.SegmentSize,d=[];Utils.sliceArray(e,u,(function(e,t){var r,n=Expanded.Guard.concat(e,Expanded.Guard);if(Utils.isEven(t))r=Utils.toZeroOnePattern(n);else if(c)if(e.length<u&&Utils.isOdd(s))r="0"+Utils.toZeroOnePattern(n);else{n.reverse();r=Utils.toZeroOnePattern(n,!0)}else r=Utils.toZeroOnePattern(n,!0);d.push({pattern:r,role:"row"})}));this.rowCount=d.length;for(var p=[],l=1;l<d.length;){var h=d[l-1],f=d[l];p.push(h);var m=this._getSeparators(h.pattern,f.pattern,l-1);p.push.apply(p,m);l++}p.push(d[l-1]);return p};ExpandedStacked.prototype._isVersion1Finder=function(e,t){var r=this.finderPatternSeq[~~((e+1+t)/2)];return["A1","B1","C1","D1","E1","F1"].indexOf(r)>-1};ExpandedStacked.prototype._makeSepPattern=function(e,t){var r=Math.ceil((e.length-4)/ExpandedStacked.SegmentWidth);e=e.substring(2,e.length-2);for(var n="",i=0,a=0;i<r;){var o=a,s=a+ExpandedStacked.SegmentWidth,c=o+17;this._isVersion1Finder(t,i)||(c+=2);n+=GS1DataBarBase.makeComplementPattern(e.substr(o,c-o));n+=GS1DataBarBase.makeComplexPattern(e.substr(c,13));n+=GS1DataBarBase.makeComplementPattern(e.substr(c+13,s-c-13));i++;a=s}return n=n.replace(/^(.){2}|(.){2}$/g,"0000")};ExpandedStacked.prototype._getSeparators=function(e,t,r){var n=r*((e.length-4)/ExpandedStacked.SegmentWidth);return[{pattern:this._makeSepPattern(e,n)},{pattern:"0000"+StackedBase.makeAlternatePattern(e.length-8,!0)+"0000"},{pattern:this._makeSepPattern(t,n)}]};ExpandedStacked.prototype.calculateData=function(){var e=this.makeDataWidth();return this._makeStacked(e)};ExpandedStacked.prototype.getLinkageOffset=function(e){for(var t=1;"1"===e[t];)t++;return{linkageOffset:t,symbolOffset:0}};ExpandedStacked.prototype.convertToShape=function(e,t){this.linkage?this._convertToShapeForLinkage(e,t):this._convertToShape(e,t)};ExpandedStacked.prototype._convertToShapeForLinkage=function(e,t){var r=this,n=r.label,i=r.encodeConfig,a=i.quietZone,o=i.isLabelBottom,s=i.height,c=i.showLabel,u=i.fontSizeInUnit,d=r.rowCount,p=r.style,l=p.textAlign,h=p.unitValue,f=r.linkageText,m=r.config,g=m.linkageVersion,B=m.linkageHeight,b=r.linkageColumnCnt,C=g===GS1DataBarBase.LinkageVersion.CCA?new CCA(f,b,h,B):new CCB(f,b,h,B);C.toSymbol();var S=C.getMainArea(),E=this.getLinkageSepPattern(e[0].pattern),D=S.getSize(),x=(s-3*(d-1)-1-D.height)/d,v=e[0].pattern.length,_=0;n&&c&&(_=u);var y=this.getLinkageOffset(e[0].pattern),P=new VerticalLayoutArea,w=new SymbolArea(v,1),k=new LabelArea(v,_,l);P.setStyle({padding:{top:a.top,right:a.right,bottom:a.bottom,left:a.left}});w.setStyle({margin:{left:y.symbolOffset}});S.setStyle({margin:{left:y.linkageOffset}});o||P.append(k);P.append(S);P.append(w);var G=[];e.forEach((function(e){var t=new SymbolArea(v,"row"===e.role?x:1);P.append(t);G.push({area:t,pattern:e.pattern})}));o&&P.append(k);if(!t){w.fromPattern(E);k.append({text:n});G.forEach((function(e){e.area.fromPattern(e.pattern)}));this.shapes=P.toShapes()}this.size=P.getSize()};ExpandedStacked.prototype._convertToShape=function(e,t){var r=this.label,n=this.encodeConfig,i=n.quietZone,a=n.isLabelBottom,o=n.height,s=n.showLabel,c=n.fontSizeInUnit,u=this.rowCount,d=this.style.textAlign,p=(o-3*(u-1))/u,l=e[0].pattern.length,h=0;r&&s&&(h=c);var f=new VerticalLayoutArea;f.setStyle({padding:{top:i.top,right:i.right,bottom:i.bottom,left:i.left}});var m=new LabelArea(l,h,d);a||f.append(m);var g=[];e.forEach((function(e){var t=new SymbolArea(l,"row"===e.role?p:1);f.append(t);g.push({area:t,pattern:e.pattern})}));a&&f.append(m);if(!t){m.append({text:r});g.forEach((function(e){e.area.fromPattern(e.pattern)}));this.shapes=f.toShapes()}this.size=f.getSize()};ExpandedStacked.DefaultConfig={rowCount:"auto"};ExpandedStacked.SegmentWidth=49;ExpandedStacked.SegmentSize=21;return ExpandedStacked}(Expanded);export{ExpandedStacked};var StackedOmnidirectional=function(e){__extends(StackedOmnidirectional,e);function StackedOmnidirectional(){return null!==e&&e.apply(this,arguments)||this}StackedOmnidirectional.prototype.getSeparator=function(e,t){var r=[],n="0000";n+=GS1DataBarBase.makeComplementPattern(e.substr(4,14));n+=GS1DataBarBase.makeComplexPattern(e.substr(18,13));n+=GS1DataBarBase.makeComplementPattern(e.substr(31,15));n+="0000";r.push(n);n="0000";n+=GS1DataBarBase.makeAlternatePattern(42,!0);n+="0000";r.push(n);n="0000";n+=GS1DataBarBase.makeComplementPattern(t.substr(4,15));n+=GS1DataBarBase.makeComplexPattern(t.substr(19,13));n+=GS1DataBarBase.makeComplementPattern(t.substr(32,14));n+="0000";r.push(n);return r};return StackedOmnidirectional}(StackedBase);export{StackedOmnidirectional};var Stacked=function(e){__extends(Stacked,e);function Stacked(t){t.merge(Stacked.DefaultConfig);return e.call(this,t)||this}Stacked.prototype.getSeparator=function(e,t){var r="",n=0;Utils.loop((function(i){if(e[i]!==t[i])if(1===n){r+="0";n=0}else{r+="1";n=1}else if("0"===e[i]){r+="1";n=1}else{r+="0";n=0}}),{from:4,to:e.length-4});return["0000"+r+"0000"]};Stacked.DefaultConfig={height:13};return Stacked}(StackedBase);export{Stacked};var Omnidirectional=function(e){__extends(Omnidirectional,e);function Omnidirectional(){return null!==e&&e.apply(this,arguments)||this}Omnidirectional.prototype.getLinkageOffset=function(e,t){for(var r=e.length-1;"1"===e[r];)r--;return{linkageOffset:0,symbolOffset:t-r-1}};return Omnidirectional}(GS1DataBarFirstType);export{Omnidirectional};var Truncated=function(e){__extends(Truncated,e);function Truncated(t){t.merge(Truncated.DefaultConfig);return e.call(this,t)||this}Truncated.DefaultConfig={height:13,showLabel:!1};return Truncated}(Omnidirectional);export{Truncated};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={}));var _LinkageVersionConvertor=function(){function _LinkageVersionConvertor(){}_LinkageVersionConvertor.stringToEnum=function(e){switch(e){case"CCA":return Gs1DataBarLinkageVersion.Cca;case"CCB":return Gs1DataBarLinkageVersion.Ccb}throw"Unknown Barcode internal linkageVersion '"+e+"'"};_LinkageVersionConvertor.enumToString=function(e){return Gs1DataBarLinkageVersion[asEnum(e,Gs1DataBarLinkageVersion)].toUpperCase()};return _LinkageVersionConvertor}();export{_LinkageVersionConvertor};var _CompactionModeConvertor=function(){function _CompactionModeConvertor(){}_CompactionModeConvertor.stringToEnum=function(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+"'"};_CompactionModeConvertor.enumToString=function(e){return MicroPdfCompactionMode[asEnum(e,MicroPdfCompactionMode)].toLowerCase()};return _CompactionModeConvertor}();export{_CompactionModeConvertor};export function _MicroPdfDimensionsConvertor(e){switch(e){case"ColumnPriority":return"columnPriorAuto";case"RowPriority":return"rowPriorAuto";default:return e.substr("Dim".length).replace("x","*")}}var Gs1DataBarBase=function(e){__extends(Gs1DataBarBase,e);function Gs1DataBarBase(t,r){var n=e.call(this,t,r)||this;addClass(n.hostElement,"wj-barcode-gs1databar");return n}Gs1DataBarBase._getClassDefaults=function(){var t=e._getClassDefaults.call(this);t.showLabel=!0;return t};Object.defineProperty(Gs1DataBarBase.prototype,"showLabel",{get:function(){return this._getProp("showLabel")},set:function(e){this._setProp("showLabel",e)},enumerable:!0,configurable:!0});Object.defineProperty(Gs1DataBarBase.prototype,"labelPosition",{get:function(){return _LabelPositionConvertor.stringToEnum(this._getProp("labelPosition"))},set:function(e){this._setProp("labelPosition",_LabelPositionConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(Gs1DataBarBase.prototype,"linkage",{get:function(){return this._getProp("linkage")},set:function(e){this._setProp("linkage",e)},enumerable:!0,configurable:!0});Object.defineProperty(Gs1DataBarBase.prototype,"linkageVersion",{get:function(){return _LinkageVersionConvertor.stringToEnum(this._getProp("linkageVersion"))},set:function(e){this._setProp("linkageVersion",_LinkageVersionConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(Gs1DataBarBase.prototype,"linkageHeight",{get:function(){return this._getProp("linkageHeight")},set:function(e){this._setProp("linkageHeight",e)},enumerable:!0,configurable:!0});Object.defineProperty(Gs1DataBarBase.prototype,"hideLinkageText",{get:function(){return this._getProp("hideLinkageText")},set:function(e){this._setProp("hideLinkageText",e)},enumerable:!0,configurable:!0});Object.defineProperty(Gs1DataBarBase.prototype,"hideAiText",{get:function(){return this._getProp("hideAIText")},set:function(e){this._setProp("hideAIText",e)},enumerable:!0,configurable:!0});return Gs1DataBarBase}(BarcodeBase);export{Gs1DataBarBase};var Gs1DataBarOmnidirectional=function(e){__extends(Gs1DataBarOmnidirectional,e);function Gs1DataBarOmnidirectional(t,r){var n=e.call(this,t,r)||this;addClass(n.hostElement,"wj-barcode-gs1databar-omnidirectional");return n}Gs1DataBarOmnidirectional.type="GS1 DataBar Omnidirectional";return Gs1DataBarOmnidirectional}(Gs1DataBarBase);export{Gs1DataBarOmnidirectional};var Gs1DataBarTruncated=function(e){__extends(Gs1DataBarTruncated,e);function Gs1DataBarTruncated(t,r){var n=e.call(this,t,r)||this;addClass(n.hostElement,"wj-barcode-gs1databar-truncated");return n}Gs1DataBarTruncated.type="GS1 DataBar Truncated";return Gs1DataBarTruncated}(Gs1DataBarBase);export{Gs1DataBarTruncated};var Gs1DataBarStacked=function(e){__extends(Gs1DataBarStacked,e);function Gs1DataBarStacked(t,r){var n=e.call(this,t,r)||this;addClass(n.hostElement,"wj-barcode-gs1databar-stacked");return n}Object.defineProperty(Gs1DataBarStacked.prototype,"ratio",{get:function(){return this._getProp("ratio")},set:function(e){this._setProp("ratio",e)},enumerable:!0,configurable:!0});Gs1DataBarStacked.type="GS1 DataBar Stacked";return Gs1DataBarStacked}(Gs1DataBarBase);export{Gs1DataBarStacked};var Gs1DataBarStackedOmnidirectional=function(e){__extends(Gs1DataBarStackedOmnidirectional,e);function Gs1DataBarStackedOmnidirectional(t,r){var n=e.call(this,t,r)||this;addClass(n.hostElement,"wj-barcode-gs1databar-stacked-omnidirectional");return n}Object.defineProperty(Gs1DataBarStackedOmnidirectional.prototype,"ratio",{get:function(){return this._getProp("ratio")},set:function(e){this._setProp("ratio",e)},enumerable:!0,configurable:!0});Gs1DataBarStackedOmnidirectional.type="GS1 DataBar StackedOmnidirectional";return Gs1DataBarStackedOmnidirectional}(Gs1DataBarBase);export{Gs1DataBarStackedOmnidirectional};var Gs1DataBarLimited=function(e){__extends(Gs1DataBarLimited,e);function Gs1DataBarLimited(t,r){var n=e.call(this,t,r)||this;addClass(n.hostElement,"wj-barcode-gs1databar-limited");return n}Gs1DataBarLimited.type="GS1 DataBar Limited";return Gs1DataBarLimited}(Gs1DataBarBase);export{Gs1DataBarLimited};var Gs1DataBarExpanded=function(e){__extends(Gs1DataBarExpanded,e);function Gs1DataBarExpanded(t,r){var n=e.call(this,t)||this;addClass(n.hostElement,"wj-barcode-gs1databar-expanded");n._setAw(!0);n.initialize(r);return n}Object.defineProperty(Gs1DataBarExpanded.prototype,"autoWidth",{get:function(){return this._getAw()},set:function(e){this._setAw(e)},enumerable:!0,configurable:!0});Object.defineProperty(Gs1DataBarExpanded.prototype,"autoWidthZoom",{get:function(){return this._getWzoom()},set:function(e){this._setWzoom(e)},enumerable:!0,configurable:!0});Gs1DataBarExpanded.type="GS1 DataBar Expanded";return Gs1DataBarExpanded}(Gs1DataBarBase);export{Gs1DataBarExpanded};var Gs1DataBarExpandedStacked=function(e){__extends(Gs1DataBarExpandedStacked,e);function Gs1DataBarExpandedStacked(t,r){var n=e.call(this,t)||this;addClass(n.hostElement,"wj-barcode-gs1databar-expanded-stacked");n._setAw(!0);n.initialize(r);return n}Object.defineProperty(Gs1DataBarExpandedStacked.prototype,"autoWidth",{get:function(){return this._getAw()},set:function(e){this._setAw(e)},enumerable:!0,configurable:!0});Object.defineProperty(Gs1DataBarExpandedStacked.prototype,"autoWidthZoom",{get:function(){return this._getWzoom()},set:function(e){this._setWzoom(e)},enumerable:!0,configurable:!0});Object.defineProperty(Gs1DataBarExpandedStacked.prototype,"rowCount",{get:function(){var e=this._getProp("rowCount");return"auto"===e?null:e},set:function(e){this._setProp("rowCount",null==e?"auto":e)},enumerable:!0,configurable:!0});Gs1DataBarExpandedStacked.type="GS1 DataBar Expanded Stacked";return Gs1DataBarExpandedStacked}(Gs1DataBarBase);export{Gs1DataBarExpandedStacked};var Pdf417=function(e){__extends(Pdf417,e);function Pdf417(t,r){var n=e.call(this,t)||this;addClass(n.hostElement,"wj-barcode-pdf417");n._setAw(!0);n.initialize(r);return n}Object.defineProperty(Pdf417.prototype,"autoWidth",{get:function(){return this._getAw()},set:function(e){this._setAw(e)},enumerable:!0,configurable:!0});Object.defineProperty(Pdf417.prototype,"autoWidthZoom",{get:function(){return this._getWzoom()},set:function(e){this._setWzoom(e)},enumerable:!0,configurable:!0});Object.defineProperty(Pdf417.prototype,"errorCorrectionLevel",{get:function(){var e=this._getProp("errorCorrectionLevel");return"auto"===e?null:e},set:function(e){this._setProp("errorCorrectionLevel",null==e?"auto":e)},enumerable:!0,configurable:!0});Object.defineProperty(Pdf417.prototype,"columns",{get:function(){var e=this._getProp("columns");return"auto"===e?null:e},set:function(e){this._setProp("columns",null==e?"auto":e)},enumerable:!0,configurable:!0});Object.defineProperty(Pdf417.prototype,"rows",{get:function(){var e=this._getProp("rows");return"auto"===e?null:e},set:function(e){this._setProp("rows",null==e?"auto":e)},enumerable:!0,configurable:!0});Object.defineProperty(Pdf417.prototype,"compact",{get:function(){return this._getProp("compact")},set:function(e){this._setProp("compact",e)},enumerable:!0,configurable:!0});Pdf417.type="PDF417";return Pdf417}(BarcodeBase);export{Pdf417};var MicroPdf417=function(e){__extends(MicroPdf417,e);function MicroPdf417(t,r){var n;MicroPdf417._getEnumDictionary();n=e.call(this,t,r)||this;addClass(n.hostElement,"wj-barcode-micropdf417");return n}MicroPdf417._getEnumDictionary=function(){MicroPdf417._dimensionsDictionary||(MicroPdf417._dimensionsDictionary=new _EnumDictionary(MicroPdfDimensions,_MicroPdfDimensionsConvertor))};Object.defineProperty(MicroPdf417.prototype,"dimensions",{get:function(){return MicroPdf417._dimensionsDictionary.getEnumByString(this._getProp("symbolVersion"))},set:function(e){this._setProp("symbolVersion",MicroPdf417._dimensionsDictionary.getStringByEnum(e))},enumerable:!0,configurable:!0});Object.defineProperty(MicroPdf417.prototype,"compactionMode",{get:function(){return _CompactionModeConvertor.stringToEnum(this._getProp("compactionMode"))},set:function(e){this._setProp("compactionMode",_CompactionModeConvertor.enumToString(e))},enumerable:!0,configurable:!0});Object.defineProperty(MicroPdf417.prototype,"structuredAppend",{get:function(){return this._getProp("structuredAppend")},set:function(e){this._setProp("structuredAppend",e)},enumerable:!0,configurable:!0});Object.defineProperty(MicroPdf417.prototype,"segmentIndex",{get:function(){return this._getProp("segmentIndex")},set:function(e){this._setProp("segmentIndex",e)},enumerable:!0,configurable:!0});Object.defineProperty(MicroPdf417.prototype,"fileId",{get:function(){return this._getProp("fileID")},set:function(e){this._setProp("fileID",e)},enumerable:!0,configurable:!0});Object.defineProperty(MicroPdf417.prototype,"optionalFields",{get:function(){return this._getProp("optionalFields")},set:function(e){this._setProp("optionalFields",e)},enumerable:!0,configurable:!0});MicroPdf417.type="MicroPDF417";return MicroPdf417}(BarcodeBase);export{MicroPdf417};_registerModule("wijmo.barcode.composite",selfModule);
|