@agimon-ai/po-cloudflare 0.0.2-alpha.2 → 0.0.2-alpha.21

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.
Files changed (283) hide show
  1. package/README.md +4 -3
  2. package/dist/abort-signals-2GUraIGq.js +34 -0
  3. package/dist/agent-DZ-OKOHn.js +6850 -0
  4. package/dist/anthropic-messages-5ODquUB-.js +14317 -0
  5. package/dist/{apiContracts-CHOiCbS_.js → apiContracts-b33nSAAI.js} +18 -81
  6. package/dist/{approval-BMXqnTYd.js → approval-r3NnI1VC.js} +19 -3
  7. package/dist/{approvalPrompt-Bg1JrEEY.js → approvalPrompt-DWoXxu3S.js} +2 -2
  8. package/dist/artifactFiles-DLCReI0-.js +1 -0
  9. package/dist/assets/assets/{CodeEditorView-BnyZHaYM.js → CodeEditorView-XeNS0L9M.js} +2 -2
  10. package/dist/assets/assets/{abnfDiagram-WEYOIA3C-muME0eCj.js → abnfDiagram-WEYOIA3C-B6ZW0nkR.js} +2 -2
  11. package/dist/assets/assets/{architecture-WOLXFQ4H-DMnhK1WH.js → architecture-WOLXFQ4H-bVR64sHO.js} +1 -1
  12. package/dist/assets/assets/{architectureDiagram-ZHVYKT53-DKn7XGP7.js → architectureDiagram-ZHVYKT53-D7tZz3io.js} +2 -2
  13. package/dist/assets/assets/{blockDiagram-RJAE7QA3-DtDctXZg.js → blockDiagram-RJAE7QA3-DdwScfiX.js} +2 -2
  14. package/dist/assets/assets/{c4Diagram-XDPPPE54-23pGLJeP.js → c4Diagram-XDPPPE54-DgSxZJCV.js} +2 -2
  15. package/dist/assets/assets/channel-TPcVvp_3.js +2 -0
  16. package/dist/assets/assets/{chunk-2E7WHVMD-BZ2nGNPa.js → chunk-2E7WHVMD-D5TXC2SM.js} +2 -2
  17. package/dist/assets/assets/{chunk-4EMNKR2T-Dui1SYFi.js → chunk-4EMNKR2T-BWhOSvo1.js} +2 -2
  18. package/dist/assets/assets/{chunk-55XCU76K-CUB92Evl.js → chunk-55XCU76K-HkkBzLtZ.js} +2 -2
  19. package/dist/assets/assets/{chunk-7S6XSTFO-CVayPHfE.js → chunk-7S6XSTFO-CBnjycLU.js} +2 -2
  20. package/dist/assets/assets/{chunk-AQDTSKZB---wakYqY.js → chunk-AQDTSKZB-75lIIq8T.js} +2 -2
  21. package/dist/assets/assets/{chunk-DSNLSHJZ-DfbdohUR.js → chunk-DSNLSHJZ-D8PpnXMk.js} +2 -2
  22. package/dist/assets/assets/{chunk-HAGFOTED-Dr4KRh-b.js → chunk-HAGFOTED-CXRS2NIN.js} +2 -2
  23. package/dist/assets/assets/{chunk-HNE4Q36P-D06cR91Z.js → chunk-HNE4Q36P-BocUqS94.js} +2 -2
  24. package/dist/assets/assets/{chunk-NQOKRVIF-Ca4gLeDb.js → chunk-NQOKRVIF-CHf_ogYT.js} +2 -2
  25. package/dist/assets/assets/{chunk-UHW7PFBP-DmL638jN.js → chunk-UHW7PFBP-DrW1PaIv.js} +2 -2
  26. package/dist/assets/assets/{chunk-VQ5W62QI-pkxSW5Zj.js → chunk-VQ5W62QI-CLoA7bFm.js} +2 -2
  27. package/dist/assets/assets/{chunk-WQQL4CDK-Dcc8hV4U.js → chunk-WQQL4CDK-BmBsrj9I.js} +2 -2
  28. package/dist/assets/assets/chunk-XXDRQBXY-iFE4Tl8c.js +2 -0
  29. package/dist/assets/assets/{chunk-YZO67HFG-B_HKcFrw.js → chunk-YZO67HFG-DShE_cgv.js} +2 -2
  30. package/dist/assets/assets/{chunk-ZAUX2LTX-DAzZUysS.js → chunk-ZAUX2LTX-B3oLvSXy.js} +2 -2
  31. package/dist/assets/assets/{chunk-ZCHMQSOR-DAVgjymL.js → chunk-ZCHMQSOR-B14vKK7C.js} +2 -2
  32. package/dist/assets/assets/{classDiagram-v2-4MYWR3UA-Fsw8TGPu.js → classDiagram-v2-4MYWR3UA-Da8elIW2.js} +2 -2
  33. package/dist/assets/assets/{cose-bilkent-JH36ORCC-CgUbISYV.js → cose-bilkent-JH36ORCC-Du4tGtiJ.js} +2 -2
  34. package/dist/assets/assets/{cynefin-EF2NZ3EQ-D1LxAU2x.js → cynefin-EF2NZ3EQ-Cyj6i_WI.js} +1 -1
  35. package/dist/assets/assets/{cynefinDiagram-WF24UDRP-D54I1jil.js → cynefinDiagram-WF24UDRP-DFWXwO7A.js} +2 -2
  36. package/dist/assets/assets/{dagre-NK4GIZVX-DC7zL16U.js → dagre-NK4GIZVX-C1wB_cf-.js} +2 -2
  37. package/dist/assets/assets/{diagram-CBK3MWTC-DB0ptUdz.js → diagram-CBK3MWTC-MYCOBYl6.js} +2 -2
  38. package/dist/assets/assets/{diagram-I5XIIV2D-CozSftPJ.js → diagram-I5XIIV2D-BFYbKUFf.js} +2 -2
  39. package/dist/assets/assets/{diagram-ODIL2UCW-g3WOEWDS.js → diagram-ODIL2UCW-6siqTpv_.js} +2 -2
  40. package/dist/assets/assets/{diagram-PFBEJUXE-CFxGeOYi.js → diagram-PFBEJUXE-CaBr9CoB.js} +2 -2
  41. package/dist/assets/assets/{diagram-RJA3I4VV-BQBsLche.js → diagram-RJA3I4VV-DAvmuDpc.js} +2 -2
  42. package/dist/assets/assets/{diagram-TYUNFSNR-DrjpW2yq.js → diagram-TYUNFSNR-CJnhgCpo.js} +2 -2
  43. package/dist/assets/assets/{dist-DjL8d1jZ.js → dist-BQ4W1R18.js} +2 -2
  44. package/dist/assets/assets/{dist-DvgCCshF.js → dist-BnzFckPF.js} +2 -2
  45. package/dist/assets/assets/{dist-gfbb4ygy.js → dist-CFtBpcYL.js} +2 -2
  46. package/dist/assets/assets/{dist-BabjcJ3j.js → dist-CIQX1z4W.js} +2 -2
  47. package/dist/assets/assets/{dist-XIZum9n5.js → dist-ChHYoe9_.js} +2 -2
  48. package/dist/assets/assets/{dist-1-mhYUBH.js → dist-DKxZO8d9.js} +2 -2
  49. package/dist/assets/assets/{dist-h6SOnP8-.js → dist-DL6z28wl.js} +2 -2
  50. package/dist/assets/assets/{dist-B3JXhDWV.js → dist-DNyn1p9Z.js} +2 -2
  51. package/dist/assets/assets/{dist-Izr2SB3q.js → dist-qYlLXIa8.js} +2 -2
  52. package/dist/assets/assets/{ebnfDiagram-V4P3TTPT-BZS_aAve.js → ebnfDiagram-V4P3TTPT-AUcqDTM3.js} +2 -2
  53. package/dist/assets/assets/{elk-QONTBCTQ-B2ksVmMA.js → elk-QONTBCTQ-aA10PEHJ.js} +2 -2
  54. package/dist/assets/assets/{erDiagram-KYQIGQAA-7P6zF-Z-.js → erDiagram-KYQIGQAA-hhYiqA-x.js} +2 -2
  55. package/dist/assets/assets/{eventmodeling-K75KTNOO-RoGQoRq-.js → eventmodeling-K75KTNOO-BQZqbRo5.js} +1 -1
  56. package/dist/assets/assets/flowDiagram-IUGLLWBU-BuyysPYC.js +1 -0
  57. package/dist/assets/assets/{ganttDiagram-R7GPNTJY-CTOlRy7M.js → ganttDiagram-R7GPNTJY-CLON1GpW.js} +2 -2
  58. package/dist/assets/assets/{gitGraph-VSP46ZUC-CPqytIt0.js → gitGraph-VSP46ZUC-DbmvNwR2.js} +1 -1
  59. package/dist/assets/assets/{gitGraphDiagram-PDYL7XHY-BffLxuxg.js → gitGraphDiagram-PDYL7XHY-DJVO0WlL.js} +2 -2
  60. package/dist/assets/assets/index-BiTVAj5E.js +155 -0
  61. package/dist/assets/assets/index-CBNQEGK3.css +1 -0
  62. package/dist/assets/assets/{info-OHQRW6UA-BI8RK0Ow.js → info-OHQRW6UA-CAt3Nt3g.js} +1 -1
  63. package/dist/assets/assets/{infoDiagram-MVDRKAX5-DUIst1FB.js → infoDiagram-MVDRKAX5-DTuqH-Zb.js} +2 -2
  64. package/dist/assets/assets/{ishikawaDiagram-HPEHV2GE-CA17Eho5.js → ishikawaDiagram-HPEHV2GE-BnWvdonT.js} +2 -2
  65. package/dist/assets/assets/{journeyDiagram-BOSHW7O7-CNri5Ap9.js → journeyDiagram-BOSHW7O7-Btxtcgvl.js} +2 -2
  66. package/dist/assets/assets/{kanban-definition-FNSA4HC5-DnXna7jO.js → kanban-definition-FNSA4HC5-q7ek9o_H.js} +2 -2
  67. package/dist/assets/assets/{line-BsXJZn93.js → line-B7yLilmC.js} +2 -2
  68. package/dist/assets/assets/{linear-BHYaD5T0.js → linear-y8aSKEli.js} +2 -2
  69. package/dist/assets/assets/{mermaid-parser.core-B64Eo-8a.js → mermaid-parser.core-B4rH50nD.js} +4 -4
  70. package/dist/assets/assets/{mermaid.core-Zw9qmTzg.js → mermaid.core-DnRVHTjE.js} +5 -5
  71. package/dist/assets/assets/{mindmap-definition-6OY57UG3-E5qz4KNc.js → mindmap-definition-6OY57UG3-DT9Afs2v.js} +2 -2
  72. package/dist/assets/assets/{packet-JDAUHWVQ-DgfizTr3.js → packet-JDAUHWVQ-CnqNbu4p.js} +1 -1
  73. package/dist/assets/assets/{pegDiagram-ECIUJNBX-D0WK_agM.js → pegDiagram-ECIUJNBX-cvxdBBFq.js} +2 -2
  74. package/dist/assets/assets/{pie-XZMESJXO-PJR1sXD4.js → pie-XZMESJXO-etXMNsaL.js} +1 -1
  75. package/dist/assets/assets/{pieDiagram-GNMPY74T-CPuU-NTs.js → pieDiagram-GNMPY74T-CBN-R3_j.js} +2 -2
  76. package/dist/assets/assets/{quadrantDiagram-D57K4MC3-5C9yjM1b.js → quadrantDiagram-D57K4MC3-C5jjVPIH.js} +2 -2
  77. package/dist/assets/assets/{radar-ABXABTNO-BspdXgl0.js → radar-ABXABTNO-CAMd_mrV.js} +1 -1
  78. package/dist/assets/assets/{railroad-I3PHUGI6-Ct0a6hLD.js → railroad-I3PHUGI6-DIs3auoe.js} +1 -1
  79. package/dist/assets/assets/{railroad-abnf-LNEFI6M7-fduYB4SA.js → railroad-abnf-LNEFI6M7-CJXr1qWy.js} +1 -1
  80. package/dist/assets/assets/{railroad-ebnf-DWYD2UWJ-CTQa8Sww.js → railroad-ebnf-DWYD2UWJ-DfwtykqI.js} +1 -1
  81. package/dist/assets/assets/{railroad-peg-JR7BVNR7-DatoH3GJ.js → railroad-peg-JR7BVNR7-B8beAhTs.js} +1 -1
  82. package/dist/assets/assets/{railroadDiagram-Y72NRBL7-C8sWN8l2.js → railroadDiagram-Y72NRBL7-BDcQE-EL.js} +2 -2
  83. package/dist/assets/assets/{requirementDiagram-EQYSW5RA-CqRz4RcT.js → requirementDiagram-EQYSW5RA-KJ4-QjZM.js} +2 -2
  84. package/dist/assets/assets/{sankeyDiagram-SY24JHO5-bdiuKKlX.js → sankeyDiagram-SY24JHO5-VjIB-Ybr.js} +2 -2
  85. package/dist/assets/assets/{sequenceDiagram-BLEHNHQU-Zy-8I0Hy.js → sequenceDiagram-BLEHNHQU-MfMuWq1M.js} +2 -2
  86. package/dist/assets/assets/{src-gihY33R9.js → src-BAxIj8GJ.js} +2 -2
  87. package/dist/assets/assets/{stateDiagram-v2-A6IESKWZ-DXQERPvz.js → stateDiagram-v2-A6IESKWZ-mHwLRRCY.js} +2 -2
  88. package/dist/assets/assets/{swimlanes-B3ENRKFQ-1gjZQElg.js → swimlanes-B3ENRKFQ-PArlYoqV.js} +2 -2
  89. package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-The09-5S.js +9 -0
  90. package/dist/assets/assets/{timeline-definition-JXYKGLGB-CTeYEw-9.js → timeline-definition-JXYKGLGB-B2nKiNFU.js} +2 -2
  91. package/dist/assets/assets/{treeView-D4JQ5SDB-DD-EsLLT.js → treeView-D4JQ5SDB-gU23_RuI.js} +1 -1
  92. package/dist/assets/assets/{treemap-SAJKECNS-BLdFeS5J.js → treemap-SAJKECNS-CiqoMvZa.js} +1 -1
  93. package/dist/assets/assets/{usecaseDiagram-WPOLBNNX-C1GikSSP.js → usecaseDiagram-WPOLBNNX-DpeoWpMK.js} +2 -2
  94. package/dist/assets/assets/{vennDiagram-Q3Y3IDCW-B1FoA3g8.js → vennDiagram-Q3Y3IDCW-C31iGKvM.js} +2 -2
  95. package/dist/assets/assets/{wardley-7MLQ67FV-BrHb5Bjf.js → wardley-7MLQ67FV-CIzHhzNw.js} +1 -1
  96. package/dist/assets/assets/{wardleyDiagram-IVAIDKWA-CmPLD1X4.js → wardleyDiagram-IVAIDKWA-DIIkoezc.js} +2 -2
  97. package/dist/assets/assets/{webpack-BYWDFj_R.js → webpack-RFseiMZW.js} +2 -2
  98. package/dist/assets/assets/{xychartDiagram-4URNHDU4-DR5pfEjl.js → xychartDiagram-4URNHDU4-QiHL91kC.js} +2 -2
  99. package/dist/assets/bundle-asset-policy.json +1 -1
  100. package/dist/assets/index.html +2 -2
  101. package/dist/assets/plugins/assets/base-CKKRZ7-h.css +2 -0
  102. package/dist/assets/plugins/assets/browserCaptureWorklet-Droj0fW0-Droj0fW0.js +13 -0
  103. package/dist/assets/plugins/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2 +0 -0
  104. package/dist/assets/plugins/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2 +0 -0
  105. package/dist/assets/plugins/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2 +0 -0
  106. package/dist/assets/plugins/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2 +0 -0
  107. package/dist/assets/plugins/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2 +0 -0
  108. package/dist/assets/plugins/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2 +0 -0
  109. package/dist/assets/plugins/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2 +0 -0
  110. package/dist/assets/plugins/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  111. package/dist/assets/plugins/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  112. package/dist/assets/plugins/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  113. package/dist/assets/plugins/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  114. package/dist/assets/plugins/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  115. package/dist/assets/plugins/assets/sileroVadWorker-D894njUe-DjN_BMWf.mjs +110 -0
  116. package/dist/assets/plugins/assets/silero_vad_v6.2.1-SjbCxFXk-SjbCxFXk.onnx +0 -0
  117. package/dist/assets/plugins/chunks/po-web-runtime-BJDT6Lbw.js +1 -0
  118. package/dist/assets/plugins/compositions.json +1 -0
  119. package/dist/assets/plugins/slots/approval.293d9a00-BXIhaPlQ.js +2 -0
  120. package/dist/assets/plugins/slots/artifacts.24567664-ZzR0gbvy.js +1 -0
  121. package/dist/assets/plugins/slots/author.0998a880-DAbA-7rb.js +93 -0
  122. package/dist/assets/plugins/slots/autocompact.dd97d013-IVq4Z6qm.js +1 -0
  123. package/dist/assets/plugins/slots/builtin-tools.36d7400b-CpCLjRRN.js +7 -0
  124. package/dist/assets/plugins/slots/codemode.8eaee717-VWt9PqsU.js +10 -0
  125. package/dist/assets/plugins/slots/domain.5e95fc37-5PIUBqDe.js +1 -0
  126. package/dist/assets/plugins/slots/edit.385c9aa9-DNAjPNG5.js +7 -0
  127. package/dist/assets/plugins/slots/files.daf34ed8-CQaTz0i1.js +2 -0
  128. package/dist/assets/plugins/slots/goal.77ec9930-B8EkarBq.js +1 -0
  129. package/dist/assets/plugins/slots/grep.02052cdc-CIRhO2gY.js +1 -0
  130. package/dist/assets/plugins/slots/help.ecd4c0f9-naMF9NN1.js +3 -0
  131. package/dist/assets/plugins/slots/log.a86eb6d0-D5__rAZJ.js +4 -0
  132. package/dist/assets/plugins/slots/mcp.974af249-DPNHn9XH.js +109 -0
  133. package/dist/assets/plugins/slots/plan.bafb8f68-C5GEpybF.js +3 -0
  134. package/dist/assets/plugins/slots/profile.48851a1d-yX6tzV3x.js +1 -0
  135. package/dist/assets/plugins/slots/prompts.723d7748-B7zpPeoF.js +3 -0
  136. package/dist/assets/plugins/slots/read.46bf6536-Cw5Z5z5T.js +1 -0
  137. package/dist/assets/plugins/slots/runner.53e9bd76-CiQR_FPX.js +8 -0
  138. package/dist/assets/plugins/slots/skill.086701a4-CL6h_F-x.js +4 -0
  139. package/dist/assets/plugins/slots/vault.ac9935c8-DKERQYg4.js +1 -0
  140. package/dist/assets/plugins/slots/voice.e85ca7f9-DEgb-U9m.js +1 -0
  141. package/dist/assets/pwa/pwa.js +12 -12
  142. package/dist/assets/pwa/sw.js +4 -4
  143. package/dist/{atomicJson-BJfPFSYF.js → atomicJson-C_7F2zD1.js} +2 -3
  144. package/dist/azure-openai-config-COZUaRzM.js +55 -0
  145. package/dist/azure-openai-responses-Cs4k2HOd.js +183 -0
  146. package/dist/{backgroundWork-CeFrbRnj.js → backgroundWork-B1mPDYlf.js} +1 -1
  147. package/dist/browser-BWf8OMfl.js +3 -0
  148. package/dist/childSession-Cf2-kH4O.js +22 -0
  149. package/dist/classifier-shared-IhSH9hhh.js +106 -0
  150. package/dist/cloudflare-workers-ai-system-one-BNnc8MuH.js +52 -0
  151. package/dist/{codemode-DbPu0yJN.js → codemode-DQFmrosw.js} +5 -2
  152. package/dist/contracts-DD3f1Lpn.js +19 -0
  153. package/dist/diagnostics-1lYFeSJe.js +131 -0
  154. package/dist/{server-D3PQk1Gt.js → dist-B-vqs6tA.js} +1 -546
  155. package/dist/dist-Dvx5mlIR.js +50 -0
  156. package/dist/env-api-keys-Bow6MJe2.js +32 -0
  157. package/dist/error-body-CJk7jMUh.js +102 -0
  158. package/dist/esm-BKJy3O9-.js +1553 -0
  159. package/dist/exports-B0WMEXCP.js +34 -0
  160. package/dist/{remoteMcp-CMqZldeA.js → exports-D09VsUk-.js} +1153 -175
  161. package/dist/{exports-BNZz2DNU.js → exports-nV43ShA7.js} +25 -9
  162. package/dist/{extensionFile-CXOa5G4C.js → extensionFile-DNM4xsje.js} +26 -2
  163. package/dist/github-copilot-headers-D1RedfLn.js +22 -0
  164. package/dist/google-generative-ai-DXTILNT0.js +328 -0
  165. package/dist/google-shared-e4JDCTVP.js +19588 -0
  166. package/dist/google-vertex-a1lzvJfq.js +374 -0
  167. package/dist/{domains-BNjGTOPj.js → harnessState-Dwrk3lfv.js} +175 -16
  168. package/dist/{harnessStore-BT706Ly6.js → harnessStore-Z7yDLO45.js} +4 -5
  169. package/dist/hash-Dt6RIbkn.js +16 -0
  170. package/dist/headers-CwtEVQvr.js +17 -0
  171. package/dist/help-w6vVEZGL.js +101 -0
  172. package/dist/hubChannel-Cm-sxOvU.js +21 -0
  173. package/dist/hubRevisions-58pU2dW5.js +363 -0
  174. package/dist/identity-BgfHobJH.js +165 -0
  175. package/dist/index.edge-COJJ_Dv2.js +937 -0
  176. package/dist/index.edge-ChYa2LU4.js +14 -0
  177. package/dist/index.edge-ClLTmPFz.js +191 -0
  178. package/dist/index.edge-DyYmurS7.js +62 -0
  179. package/dist/index.edge-K0w5auwG.js +56 -0
  180. package/dist/index.edge-Xa5LLtxz.js +67 -0
  181. package/dist/iso-BPQViXM8.js +10 -0
  182. package/dist/{layeredConfig-DPQAnlXD.js → layeredConfig-CUkYUs1f.js} +193 -15
  183. package/dist/{majorModes-DbCfLZH3.js → majorModes-BB0PXgFn.js} +4 -14
  184. package/dist/majorModes-C7vtBs4D.js +1 -0
  185. package/dist/{mcpProjection-BsP0IEnb.js → mcpProjection-BtKzB6oK.js} +2 -2
  186. package/dist/migrations-5gbLIQIc.js +32 -0
  187. package/dist/mistral-conversations-CLwhVDjA.js +689 -0
  188. package/dist/modeDefinition-C3Zbrw48.js +44 -0
  189. package/dist/models-Chzm15vC.js +1511 -0
  190. package/dist/narration-CpRurWLO.js +127 -0
  191. package/dist/node-BT4GsJQp.js +2479 -0
  192. package/dist/node-DytJOfYf.js +23 -0
  193. package/dist/notification-kckG3leF.js +102 -0
  194. package/dist/openai-codex-responses-DRMONxDE.js +1210 -0
  195. package/dist/openai-completions-CcNhAv8l.js +984 -0
  196. package/dist/openai-decisions-BsFjaAGw.js +142 -0
  197. package/dist/openai-kPrtlgjl.js +17357 -0
  198. package/dist/openai-prompt-cache-Bc6qNWt0.js +8 -0
  199. package/dist/openai-responses-C5Gp2UOV.js +281 -0
  200. package/dist/openai-responses-shared-BbSi-wBR.js +661 -0
  201. package/dist/openrouter-cost-CvC52g3b.js +30 -0
  202. package/dist/openrouter-images-BoHl8g8p.js +124 -0
  203. package/dist/{hubChannel-BHQyzcOo.js → packageApi-t1oCjNDU.js} +4 -41
  204. package/dist/photon_rs_bg.wasm +0 -0
  205. package/dist/pi-messages-BXfrZLC7.js +312 -0
  206. package/dist/piConfig-DQzlbPY4.js +126 -0
  207. package/dist/piSettings-Cf1QofNe.js +1 -0
  208. package/dist/platform-BIEiM4TG.js +113 -0
  209. package/dist/pluginContributions-Be9EnCAW.js +16 -0
  210. package/dist/pluginProtocol-BqXXyI4z.js +80 -0
  211. package/dist/{protocol-Xpm_mCNN.js → protocol-DDL8geoS.js} +2 -2
  212. package/dist/provider-env-CxhHUFiF.js +38 -0
  213. package/dist/provider-retry-BUoezuw8.js +79 -0
  214. package/dist/sanitize-unicode-C3Ec8oL6.js +26 -0
  215. package/dist/sealedChannel-BeWNTWys.js +27 -0
  216. package/dist/server-AbXyhXlY.js +217 -0
  217. package/dist/server-B6dqQoh2.js +1518 -0
  218. package/dist/server-BIHo9TFu.js +505 -0
  219. package/dist/{server-BZh1ZXz_.js → server-BJ7DNzCp.js} +8 -19
  220. package/dist/server-BO-j_GbD.js +15106 -0
  221. package/dist/{server-D4W7EdJY.js → server-BQzAiMns.js} +16 -16
  222. package/dist/server-BR7SZtj7.js +3125 -0
  223. package/dist/{server-BE6VqEiA.js → server-BT2ORK83.js} +20 -12
  224. package/dist/server-BbSHYRnY.js +295 -0
  225. package/dist/server-BqoKlEGk.js +1806 -0
  226. package/dist/{server-tvgQ99rv.js → server-Busl0pQI.js} +370 -120
  227. package/dist/server-CIHM4jqu.js +1116 -0
  228. package/dist/server-CgWSSdvd.js +576 -0
  229. package/dist/{server-Dpgh8PDh.js → server-Co_UWKrR.js} +14 -5
  230. package/dist/{server-BAAL9-NA.js → server-CuEPb7u-.js} +3 -10
  231. package/dist/{server-Dt4y1rZD.js → server-D40q2Jpx.js} +47 -27
  232. package/dist/server-DCyf2Asb.js +679 -0
  233. package/dist/server-DH7PfLln.js +148 -0
  234. package/dist/server-DJ8bc89M.js +934 -0
  235. package/dist/server-DYdp0W9v.js +489 -0
  236. package/dist/server-DsdPEYGu.js +639 -0
  237. package/dist/server-DymH4Ucq.js +189 -0
  238. package/dist/server-IqECnUrb.js +834 -0
  239. package/dist/{server-36iuA3MI.js → server-KBgW77zh.js} +3 -3
  240. package/dist/server-RW_9R3R3.js +1522 -0
  241. package/dist/server-aUit8j6r.js +1028 -0
  242. package/dist/{server-DJAanjoI.js → server-gifRriZK.js} +491 -103
  243. package/dist/server-nkUlqnAL.js +2658 -0
  244. package/dist/server-oxyEbv1a.js +1256 -0
  245. package/dist/{server-D8ndq0wL.js → server-ub3s16Mc.js} +11 -9
  246. package/dist/{build-2gFaVEfG.js → serverPlugin-CELT6P0Q.js} +3946 -3
  247. package/dist/{sessionConfig-rBQgzXlT.js → sessionConfig-RQGvfm6E.js} +550 -760
  248. package/dist/simple-options-CFzI5Pd_.js +156 -0
  249. package/dist/streaming-json-BWTHTwz-.js +858 -0
  250. package/dist/system-one-shared-CiIrx29d.js +132 -0
  251. package/dist/{notification-D76PSL7r.js → telemetry-Csv1ZxAn.js} +1 -92
  252. package/dist/transform-messages-D77af7Bx.js +356 -0
  253. package/dist/truncate-M3KbFyVj.js +89 -0
  254. package/dist/{server-A-_GFpPr.js → type-ASYnCGVW.js} +10 -1031
  255. package/dist/typesafe-system-one-DGxeggJh.js +37 -0
  256. package/dist/uuid-B0QJx6Kr.js +31 -0
  257. package/dist/{validation-D77NZBrx.js → validation-BJxVSAwx.js} +8 -3
  258. package/dist/{value-Djvc2foV.js → value-_W31So3B.js} +1 -1
  259. package/dist/vaultSettings-Di3n5YIg.js +328 -0
  260. package/dist/voiceTools-RMn4HvWo.js +246 -0
  261. package/dist/web-DCP7ELJj.js +3 -0
  262. package/dist/worker.js +95288 -49863
  263. package/dist/workflow-B7qx0Vv9.js +79 -0
  264. package/package.json +37 -22
  265. package/wrangler.jsonc +4 -2
  266. package/dist/assets/assets/channel-CMrEzemr.js +0 -2
  267. package/dist/assets/assets/chunk-XXDRQBXY-CFf0S6bN.js +0 -2
  268. package/dist/assets/assets/flowDiagram-IUGLLWBU-BhGbWVf0.js +0 -1
  269. package/dist/assets/assets/index-Bx_K4Joy.js +0 -155
  270. package/dist/assets/assets/index-DZM68mTk.css +0 -1
  271. package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-q91tR8ri.js +0 -9
  272. package/dist/contextProjection-DVP2Vc5j.js +0 -188
  273. package/dist/harnessState-gmzJcPGt.js +0 -88
  274. package/dist/harnessStore-BiH9vSuD.js +0 -1
  275. package/dist/index.edge-BgSx_gRO.js +0 -45
  276. package/dist/majorModes-BvWNqoHt.js +0 -1
  277. package/dist/piSettings-B6fsgIBA.js +0 -1
  278. package/dist/platform-B4AAgwJ0.js +0 -16
  279. package/dist/platformFiles-C_bXo4Ig.js +0 -39
  280. package/dist/server-BZaPPoQp.js +0 -592
  281. package/dist/server-D75MWDhB.js +0 -118
  282. package/dist/server-r358hzQg.js +0 -280
  283. package/dist/serverPlugin-BOI6c6s5.js +0 -3393
@@ -1,13 +1,13 @@
1
- (function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function e(e,t){var n=Object.setPrototypeOf;n?n(e,t):e.__proto__=t}function t(e,t){t===void 0&&(t=e.constructor);var n=Error.captureStackTrace;n&&n(e,t)}var n=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),r=function(r){n(i,r);function i(n,i){var a=this.constructor,o=r.call(this,n,i)||this;return Object.defineProperty(o,"name",{value:a.name,enumerable:!1,configurable:!0}),e(o,a.prototype),t(o),o}return i}(Error),i=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),a=function(e){i(t,e);function t(t){t===void 0&&(t=void 0);var n=e.call(this,t)||this;return n.message=t,n}return t.prototype.getKind=function(){return this.constructor.kind},t.kind=`Exception`,t}(r),o=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),s=function(e){o(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.kind=`ArgumentException`,t}(a),c=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),l=function(e){c(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.kind=`IllegalArgumentException`,t}(a),u=function(){function e(e){if(this.binarizer=e,e===null)throw new l(`Binarizer must be non-null.`)}return e.prototype.getWidth=function(){return this.binarizer.getWidth()},e.prototype.getHeight=function(){return this.binarizer.getHeight()},e.prototype.getBlackRow=function(e,t){return this.binarizer.getBlackRow(e,t)},e.prototype.getBlackMatrix=function(){return(this.matrix===null||this.matrix===void 0)&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},e.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},e.prototype.crop=function(t,n,r,i){var a=this.binarizer.getLuminanceSource().crop(t,n,r,i);return new e(this.binarizer.createBinarizer(a))},e.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},e.prototype.rotateCounterClockwise=function(){var t=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new e(this.binarizer.createBinarizer(t))},e.prototype.rotateCounterClockwise45=function(){var t=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new e(this.binarizer.createBinarizer(t))},e.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch{return``}},e}(),d=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),f=function(e){d(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.getChecksumInstance=function(){return new t},t.kind=`ChecksumException`,t}(a),p=function(){function e(e){this.source=e}return e.prototype.getLuminanceSource=function(){return this.source},e.prototype.getWidth=function(){return this.source.getWidth()},e.prototype.getHeight=function(){return this.source.getHeight()},e}(),m=function(){function e(){}return e.arraycopy=function(e,t,n,r,i){if(e===n&&t<r)for(r+=i-1,t+=i-1;i--;)n[r--]=e[t--];else for(;i--;)n[r++]=e[t++]},e.currentTimeMillis=function(){return Date.now()},e}(),h=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),g=function(e){h(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.kind=`IndexOutOfBoundsException`,t}(a),_=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),v=function(e){_(t,e);function t(t,n){t===void 0&&(t=void 0),n===void 0&&(n=void 0);var r=e.call(this,n)||this;return r.index=t,r.message=n,r}return t.kind=`ArrayIndexOutOfBoundsException`,t}(g),y=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},b=function(){function e(){}return e.fill=function(e,t){for(var n=0,r=e.length;n<r;n++)e[n]=t},e.fillWithin=function(t,n,r,i){e.rangeCheck(t.length,n,r);for(var a=n;a<r;a++)t[a]=i},e.rangeCheck=function(e,t,n){if(t>n)throw new l(`fromIndex(`+t+`) > toIndex(`+n+`)`);if(t<0)throw new v(t);if(n>e)throw new v(n)},e.asList=function(){return[...arguments]},e.create=function(e,t,n){return Array.from({length:e}).map(function(e){return Array.from({length:t}).fill(n)})},e.createInt32Array=function(e,t,n){return Array.from({length:e}).map(function(e){return Int32Array.from({length:t}).fill(n)})},e.equals=function(e,t){if(!e||!t||!e.length||!t.length||e.length!==t.length)return!1;for(var n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0},e.hashCode=function(e){var t,n;if(e===null)return 0;var r=1;try{for(var i=y(e),a=i.next();!a.done;a=i.next()){var o=a.value;r=31*r+o}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},e.fillUint8Array=function(e,t){for(var n=0;n!==e.length;n++)e[n]=t},e.copyOf=function(e,t){return e.slice(0,t)},e.copyOfUint8Array=function(e,t){if(e.length<=t){var n=new Uint8Array(t);return n.set(e),n}return e.slice(0,t)},e.copyOfRange=function(e,t,n){var r=n-t,i=new Int32Array(r);return m.arraycopy(e,t,i,0,r),i},e.binarySearch=function(t,n,r){r===void 0&&(r=e.numberComparator);for(var i=0,a=t.length-1;i<=a;){var o=a+i>>1,s=r(n,t[o]);if(s>0)i=o+1;else if(s<0)a=o-1;else return o}return-i-1},e.numberComparator=function(e,t){return e-t},e}(),x=function(){function e(){}return e.numberOfTrailingZeros=function(e){var t;if(e===0)return 32;var n=31;return t=e<<16,t!==0&&(n-=16,e=t),t=e<<8,t!==0&&(n-=8,e=t),t=e<<4,t!==0&&(n-=4,e=t),t=e<<2,t!==0&&(n-=2,e=t),n-(e<<1>>>31)},e.numberOfLeadingZeros=function(e){if(e===0)return 32;var t=1;return e>>>16||(t+=16,e<<=16),e>>>24||(t+=8,e<<=8),e>>>28||(t+=4,e<<=4),e>>>30||(t+=2,e<<=2),t-=e>>>31,t},e.toHexString=function(e){return e.toString(16)},e.toBinaryString=function(e){return String(parseInt(String(e),2))},e.bitCount=function(e){return e-=e>>>1&1431655765,e=(e&858993459)+(e>>>2&858993459),e=e+(e>>>4)&252645135,e+=e>>>8,e+=e>>>16,e&63},e.truncDivision=function(e,t){return Math.trunc(e/t)},e.parseInt=function(e,t){return t===void 0&&(t=void 0),parseInt(e,t)},e.MIN_VALUE_32_BITS=-2147483648,e.MAX_VALUE=2**53-1,e}(),S=function(){function e(t,n){t===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=t,this.bits=n??e.makeArray(t))}return e.prototype.getSize=function(){return this.size},e.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},e.prototype.ensureCapacity=function(t){if(t>this.bits.length*32){var n=e.makeArray(t);m.arraycopy(this.bits,0,n,0,this.bits.length),this.bits=n}},e.prototype.get=function(e){return!!(this.bits[Math.floor(e/32)]&1<<(e&31))},e.prototype.set=function(e){this.bits[Math.floor(e/32)]|=1<<(e&31)},e.prototype.flip=function(e){this.bits[Math.floor(e/32)]^=1<<(e&31)},e.prototype.getNextSet=function(e){var t=this.size;if(e>=t)return t;var n=this.bits,r=Math.floor(e/32),i=n[r];i&=~((1<<(e&31))-1);for(var a=n.length;i===0;){if(++r===a)return t;i=n[r]}var o=r*32+x.numberOfTrailingZeros(i);return o>t?t:o},e.prototype.getNextUnset=function(e){var t=this.size;if(e>=t)return t;var n=this.bits,r=Math.floor(e/32),i=~n[r];i&=~((1<<(e&31))-1);for(var a=n.length;i===0;){if(++r===a)return t;i=~n[r]}var o=r*32+x.numberOfTrailingZeros(i);return o>t?t:o},e.prototype.setBulk=function(e,t){this.bits[Math.floor(e/32)]=t},e.prototype.setRange=function(e,t){if(t<e||e<0||t>this.size)throw new l;if(t!==e){t--;for(var n=Math.floor(e/32),r=Math.floor(t/32),i=this.bits,a=n;a<=r;a++){var o=a>n?0:e&31,s=(2<<(a<r?31:t&31))-(1<<o);i[a]|=s}}},e.prototype.clear=function(){for(var e=this.bits.length,t=this.bits,n=0;n<e;n++)t[n]=0},e.prototype.isRange=function(e,t,n){if(t<e||e<0||t>this.size)throw new l;if(t===e)return!0;t--;for(var r=Math.floor(e/32),i=Math.floor(t/32),a=this.bits,o=r;o<=i;o++){var s=o>r?0:e&31,c=(2<<(o<i?31:t&31))-(1<<s)|0;if((a[o]&c)!==(n?c:0))return!1}return!0},e.prototype.appendBit=function(e){this.ensureCapacity(this.size+1),e&&(this.bits[Math.floor(this.size/32)]|=1<<(this.size&31)),this.size++},e.prototype.appendBits=function(e,t){if(t<0||t>32)throw new l(`Num bits must be between 0 and 32`);this.ensureCapacity(this.size+t);for(var n=t;n>0;n--)this.appendBit((e>>n-1&1)==1)},e.prototype.appendBitArray=function(e){var t=e.size;this.ensureCapacity(this.size+t);for(var n=0;n<t;n++)this.appendBit(e.get(n))},e.prototype.xor=function(e){if(this.size!==e.size)throw new l(`Sizes don't match`);for(var t=this.bits,n=0,r=t.length;n<r;n++)t[n]^=e.bits[n]},e.prototype.toBytes=function(e,t,n,r){for(var i=0;i<r;i++){for(var a=0,o=0;o<8;o++)this.get(e)&&(a|=1<<7-o),e++;t[n+i]=a}},e.prototype.getBitArray=function(){return this.bits},e.prototype.reverse=function(){for(var e=new Int32Array(this.bits.length),t=Math.floor((this.size-1)/32),n=t+1,r=this.bits,i=0;i<n;i++){var a=r[i];a=a>>1&1431655765|(a&1431655765)<<1,a=a>>2&858993459|(a&858993459)<<2,a=a>>4&252645135|(a&252645135)<<4,a=a>>8&16711935|(a&16711935)<<8,a=a>>16&65535|(a&65535)<<16,e[t-i]=a}if(this.size!==n*32){for(var o=n*32-this.size,s=e[0]>>>o,i=1;i<n;i++){var c=e[i];s|=c<<32-o,e[i-1]=s,s=c>>>o}e[n-1]=s}this.bits=e},e.makeArray=function(e){return new Int32Array(Math.floor((e+31)/32))},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.size===n.size&&b.equals(this.bits,n.bits)},e.prototype.hashCode=function(){return 31*this.size+b.hashCode(this.bits)},e.prototype.toString=function(){for(var e=``,t=0,n=this.size;t<n;t++)t&7||(e+=` `),e+=this.get(t)?`X`:`.`;return e},e.prototype.clone=function(){return new e(this.size,this.bits.slice())},e.prototype.toArray=function(){for(var e=[],t=0,n=this.size;t<n;t++)e.push(this.get(t));return e},e}(),C;(function(e){e[e.OTHER=0]=`OTHER`,e[e.PURE_BARCODE=1]=`PURE_BARCODE`,e[e.POSSIBLE_FORMATS=2]=`POSSIBLE_FORMATS`,e[e.TRY_HARDER=3]=`TRY_HARDER`,e[e.CHARACTER_SET=4]=`CHARACTER_SET`,e[e.ALLOWED_LENGTHS=5]=`ALLOWED_LENGTHS`,e[e.ASSUME_CODE_39_CHECK_DIGIT=6]=`ASSUME_CODE_39_CHECK_DIGIT`,e[e.ENABLE_CODE_39_EXTENDED_MODE=7]=`ENABLE_CODE_39_EXTENDED_MODE`,e[e.ASSUME_GS1=8]=`ASSUME_GS1`,e[e.RETURN_CODABAR_START_END=9]=`RETURN_CODABAR_START_END`,e[e.NEED_RESULT_POINT_CALLBACK=10]=`NEED_RESULT_POINT_CALLBACK`,e[e.ALLOWED_EAN_EXTENSIONS=11]=`ALLOWED_EAN_EXTENSIONS`})(C||={});var w=C,T=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),E=function(e){T(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.getFormatInstance=function(){return new t},t.kind=`FormatException`,t}(a),ee=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},D;(function(e){e[e.Cp437=0]=`Cp437`,e[e.ISO8859_1=1]=`ISO8859_1`,e[e.ISO8859_2=2]=`ISO8859_2`,e[e.ISO8859_3=3]=`ISO8859_3`,e[e.ISO8859_4=4]=`ISO8859_4`,e[e.ISO8859_5=5]=`ISO8859_5`,e[e.ISO8859_6=6]=`ISO8859_6`,e[e.ISO8859_7=7]=`ISO8859_7`,e[e.ISO8859_8=8]=`ISO8859_8`,e[e.ISO8859_9=9]=`ISO8859_9`,e[e.ISO8859_10=10]=`ISO8859_10`,e[e.ISO8859_11=11]=`ISO8859_11`,e[e.ISO8859_13=12]=`ISO8859_13`,e[e.ISO8859_14=13]=`ISO8859_14`,e[e.ISO8859_15=14]=`ISO8859_15`,e[e.ISO8859_16=15]=`ISO8859_16`,e[e.SJIS=16]=`SJIS`,e[e.Cp1250=17]=`Cp1250`,e[e.Cp1251=18]=`Cp1251`,e[e.Cp1252=19]=`Cp1252`,e[e.Cp1256=20]=`Cp1256`,e[e.UnicodeBigUnmarked=21]=`UnicodeBigUnmarked`,e[e.UTF8=22]=`UTF8`,e[e.ASCII=23]=`ASCII`,e[e.Big5=24]=`Big5`,e[e.GB18030=25]=`GB18030`,e[e.EUC_KR=26]=`EUC_KR`})(D||={});var O=function(){function e(t,n,r){for(var i,a,o=[],s=3;s<arguments.length;s++)o[s-3]=arguments[s];this.valueIdentifier=t,this.name=r,this.values=typeof n==`number`?Int32Array.from([n]):n,this.otherEncodingNames=o,e.VALUE_IDENTIFIER_TO_ECI.set(t,this),e.NAME_TO_ECI.set(r,this);for(var c=this.values,l=0,u=c.length;l!==u;l++){var d=c[l];e.VALUES_TO_ECI.set(d,this)}try{for(var f=ee(o),p=f.next();!p.done;p=f.next()){var m=p.value;e.NAME_TO_ECI.set(m,this)}}catch(e){i={error:e}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}}return e.prototype.getValueIdentifier=function(){return this.valueIdentifier},e.prototype.getName=function(){return this.name},e.prototype.getValue=function(){return this.values[0]},e.getCharacterSetECIByValue=function(t){if(t<0||t>=900)throw new E(`incorect value`);var n=e.VALUES_TO_ECI.get(t);if(n===void 0)throw new E(`incorect value`);return n},e.getCharacterSetECIByName=function(t){var n=e.NAME_TO_ECI.get(t);if(n===void 0)throw new E(`incorect value`);return n},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.getName()===n.getName()},e.VALUE_IDENTIFIER_TO_ECI=new Map,e.VALUES_TO_ECI=new Map,e.NAME_TO_ECI=new Map,e.Cp437=new e(D.Cp437,Int32Array.from([0,2]),`Cp437`),e.ISO8859_1=new e(D.ISO8859_1,Int32Array.from([1,3]),`ISO-8859-1`,`ISO88591`,`ISO8859_1`),e.ISO8859_2=new e(D.ISO8859_2,4,`ISO-8859-2`,`ISO88592`,`ISO8859_2`),e.ISO8859_3=new e(D.ISO8859_3,5,`ISO-8859-3`,`ISO88593`,`ISO8859_3`),e.ISO8859_4=new e(D.ISO8859_4,6,`ISO-8859-4`,`ISO88594`,`ISO8859_4`),e.ISO8859_5=new e(D.ISO8859_5,7,`ISO-8859-5`,`ISO88595`,`ISO8859_5`),e.ISO8859_6=new e(D.ISO8859_6,8,`ISO-8859-6`,`ISO88596`,`ISO8859_6`),e.ISO8859_7=new e(D.ISO8859_7,9,`ISO-8859-7`,`ISO88597`,`ISO8859_7`),e.ISO8859_8=new e(D.ISO8859_8,10,`ISO-8859-8`,`ISO88598`,`ISO8859_8`),e.ISO8859_9=new e(D.ISO8859_9,11,`ISO-8859-9`,`ISO88599`,`ISO8859_9`),e.ISO8859_10=new e(D.ISO8859_10,12,`ISO-8859-10`,`ISO885910`,`ISO8859_10`),e.ISO8859_11=new e(D.ISO8859_11,13,`ISO-8859-11`,`ISO885911`,`ISO8859_11`),e.ISO8859_13=new e(D.ISO8859_13,15,`ISO-8859-13`,`ISO885913`,`ISO8859_13`),e.ISO8859_14=new e(D.ISO8859_14,16,`ISO-8859-14`,`ISO885914`,`ISO8859_14`),e.ISO8859_15=new e(D.ISO8859_15,17,`ISO-8859-15`,`ISO885915`,`ISO8859_15`),e.ISO8859_16=new e(D.ISO8859_16,18,`ISO-8859-16`,`ISO885916`,`ISO8859_16`),e.SJIS=new e(D.SJIS,20,`SJIS`,`Shift_JIS`),e.Cp1250=new e(D.Cp1250,21,`Cp1250`,`windows-1250`),e.Cp1251=new e(D.Cp1251,22,`Cp1251`,`windows-1251`),e.Cp1252=new e(D.Cp1252,23,`Cp1252`,`windows-1252`),e.Cp1256=new e(D.Cp1256,24,`Cp1256`,`windows-1256`),e.UnicodeBigUnmarked=new e(D.UnicodeBigUnmarked,25,`UnicodeBigUnmarked`,`UTF-16BE`,`UnicodeBig`),e.UTF8=new e(D.UTF8,26,`UTF8`,`UTF-8`),e.ASCII=new e(D.ASCII,Int32Array.from([27,170]),`ASCII`,`US-ASCII`),e.Big5=new e(D.Big5,28,`Big5`),e.GB18030=new e(D.GB18030,29,`GB18030`,`GB2312`,`EUC_CN`,`GBK`),e.EUC_KR=new e(D.EUC_KR,30,`EUC_KR`,`EUC-KR`),e}(),k=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),te=function(e){k(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.kind=`UnsupportedOperationException`,t}(a),ne=function(){function e(){}return e.decode=function(e,t){var n=this.encodingName(t);return this.customDecoder?this.customDecoder(e,n):typeof TextDecoder>`u`||this.shouldDecodeOnFallback(n)?this.decodeFallback(e,n):new TextDecoder(n).decode(e)},e.shouldDecodeOnFallback=function(e){return!1},e.encode=function(e,t){var n=this.encodingName(t);return this.customEncoder?this.customEncoder(e,n):typeof TextEncoder>`u`?this.encodeFallback(e):new TextEncoder().encode(e)},e.isBrowser=function(){return typeof window<`u`&&{}.toString.call(window)===`[object Window]`},e.encodingName=function(e){return typeof e==`string`?e:e.getName()},e.encodingCharacterSet=function(e){return e instanceof O?e:O.getCharacterSetECIByName(e)},e.decodeFallback=function(t,n){var r=this.encodingCharacterSet(n);if(e.isDecodeFallbackSupported(r)){for(var i=``,a=0,o=t.length;a<o;a++){var s=t[a].toString(16);s.length<2&&(s=`0`+s),i+=`%`+s}return decodeURIComponent(i)}if(r.equals(O.UnicodeBigUnmarked))return String.fromCharCode.apply(null,Array.from(new Uint16Array(t.buffer)));throw new te(`Encoding ${this.encodingName(n)} not supported by fallback.`)},e.isDecodeFallbackSupported=function(e){return e.equals(O.UTF8)||e.equals(O.ISO8859_1)||e.equals(O.ASCII)},e.encodeFallback=function(e){for(var t=btoa(unescape(encodeURIComponent(e))).split(``),n=[],r=0;r<t.length;r++)n.push(t[r].charCodeAt(0));return new Uint8Array(n)},e}(),A=function(){function e(){}return e.castAsNonUtf8Char=function(e,t){t===void 0&&(t=null);var n=t?t.getName():this.ISO88591;return ne.decode(new Uint8Array([e]),n)},e.guessEncoding=function(t,n){if(n!=null&&n.get(w.CHARACTER_SET)!==void 0)return n.get(w.CHARACTER_SET).toString();for(var r=t.length,i=!0,a=!0,o=!0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=t.length>3&&t[0]===239&&t[1]===187&&t[2]===191,y=0;y<r&&(i||a||o);y++){var b=t[y]&255;o&&(s>0?b&128?s--:o=!1:b&128&&(b&64?(s++,b&32?(s++,b&16?(s++,b&8?o=!1:u++):l++):c++):o=!1)),i&&(b>127&&b<160?i=!1:b>159&&(b<192||b===215||b===247)&&_++),a&&(d>0?b<64||b===127||b>252?a=!1:d--:b===128||b===160||b>239?a=!1:b>160&&b<224?(f++,m=0,p++,p>h&&(h=p)):b>127?(d++,p=0,m++,m>g&&(g=m)):(p=0,m=0))}return o&&s>0&&(o=!1),a&&d>0&&(a=!1),o&&(v||c+l+u>0)?e.UTF8:a&&(e.ASSUME_SHIFT_JIS||h>=3||g>=3)?e.SHIFT_JIS:i&&a?h===2&&f===2||_*10>=r?e.SHIFT_JIS:e.ISO88591:i?e.ISO88591:a?e.SHIFT_JIS:o?e.UTF8:e.PLATFORM_DEFAULT_ENCODING},e.format=function(e){var t=[...arguments].slice(1),n=-1;function r(e,r,i,a,o,s){if(e===`%%`)return`%`;if(t[++n]!==void 0){e=a?parseInt(a.substr(1)):void 0;var c=o?parseInt(o.substr(1)):void 0,l;switch(s){case`s`:l=t[n];break;case`c`:l=t[n][0];break;case`f`:l=parseFloat(t[n]).toFixed(e);break;case`p`:l=parseFloat(t[n]).toPrecision(e);break;case`e`:l=parseFloat(t[n]).toExponential(e);break;case`x`:l=parseInt(t[n]).toString(c||16);break;case`d`:l=parseFloat(parseInt(t[n],c||10).toPrecision(e)).toFixed(0)}l=typeof l==`object`?JSON.stringify(l):(+l).toString(c);for(var u=parseInt(i),d=i&&i[0]+``==`0`?`0`:` `;l.length<u;)l=r===void 0?d+l:l+d;return l}}return e.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,r)},e.getBytes=function(e,t){return ne.encode(e,t)},e.getCharCode=function(e,t){return t===void 0&&(t=0),e.charCodeAt(t)},e.getCharAt=function(e){return String.fromCharCode(e)},e.SHIFT_JIS=O.SJIS.getName(),e.GB2312=`GB2312`,e.ISO88591=O.ISO8859_1.getName(),e.EUC_JP=`EUC_JP`,e.UTF8=O.UTF8.getName(),e.PLATFORM_DEFAULT_ENCODING=e.UTF8,e.ASSUME_SHIFT_JIS=!1,e}(),j=function(){function e(e){e===void 0&&(e=``),this.value=e}return e.prototype.enableDecoding=function(e){return this.encoding=e,this},e.prototype.append=function(e){return typeof e==`string`?this.value+=e.toString():this.encoding?this.value+=A.castAsNonUtf8Char(e,this.encoding):this.value+=String.fromCharCode(e),this},e.prototype.appendChars=function(e,t,n){for(var r=t;t<t+n;r++)this.append(e[r]);return this},e.prototype.length=function(){return this.value.length},e.prototype.charAt=function(e){return this.value.charAt(e)},e.prototype.deleteCharAt=function(e){this.value=this.value.substr(0,e)+this.value.substring(e+1)},e.prototype.setCharAt=function(e,t){this.value=this.value.substr(0,e)+t+this.value.substr(e+1)},e.prototype.substring=function(e,t){return this.value.substring(e,t)},e.prototype.setLengthToZero=function(){this.value=``},e.prototype.toString=function(){return this.value},e.prototype.insert=function(e,t){this.value=this.value.substring(0,e)+t+this.value.substring(e)},e}(),re=function(){function e(e,t,n,r){if(this.width=e,this.height=t,this.rowSize=n,this.bits=r,t??=e,this.height=t,e<1||t<1)throw new l(`Both dimensions must be greater than 0`);n??=e+31>>5,this.rowSize=n,r??(this.bits=new Int32Array(this.rowSize*this.height))}return e.parseFromBooleanArray=function(t){for(var n=t.length,r=t[0].length,i=new e(r,n),a=0;a<n;a++)for(var o=t[a],s=0;s<r;s++)o[s]&&i.set(s,a);return i},e.parseFromString=function(t,n,r){if(t===null)throw new l(`stringRepresentation cannot be null`);for(var i=Array(t.length),a=0,o=0,s=-1,c=0,u=0;u<t.length;)if(t.charAt(u)===`
2
- `||t.charAt(u)===`\r`){if(a>o){if(s===-1)s=a-o;else if(a-o!==s)throw new l(`row lengths do not match`);o=a,c++}u++}else if(t.substring(u,u+n.length)===n)u+=n.length,i[a]=!0,a++;else if(t.substring(u,u+r.length)===r)u+=r.length,i[a]=!1,a++;else throw new l(`illegal character encountered: `+t.substring(u));if(a>o){if(s===-1)s=a-o;else if(a-o!==s)throw new l(`row lengths do not match`);c++}for(var d=new e(s,c),f=0;f<a;f++)i[f]&&d.set(Math.floor(f%s),Math.floor(f/s));return d},e.prototype.get=function(e,t){var n=t*this.rowSize+(e>>5);return!!(this.bits[n]>>>(e&31)&1)},e.prototype.set=function(e,t){var n=t*this.rowSize+(e>>5);this.bits[n]|=1<<(e&31)},e.prototype.unset=function(e,t){var n=t*this.rowSize+(e>>5);this.bits[n]&=~(1<<(e&31))},e.prototype.flip=function(e,t){var n=t*this.rowSize+(e>>5);this.bits[n]^=1<<(e&31)},e.prototype.xor=function(e){if(this.width!==e.getWidth()||this.height!==e.getHeight()||this.rowSize!==e.getRowSize())throw new l(`input matrix dimensions do not match`);for(var t=new S((this.width>>5)+1),n=this.rowSize,r=this.bits,i=0,a=this.height;i<a;i++)for(var o=i*n,s=e.getRow(i,t).getBitArray(),c=0;c<n;c++)r[o+c]^=s[c]},e.prototype.clear=function(){this.bits.fill(0)},e.prototype.setRegion=function(e,t,n,r){if(t<0||e<0)throw new l(`Left and top must be nonnegative`);if(r<1||n<1)throw new l(`Height and width must be at least 1`);var i=e+n,a=t+r;if(a>this.height||i>this.width)throw new l(`The region must fit inside the matrix`);for(var o=this.rowSize,s=this.bits,c=t;c<a;c++)for(var u=c*o,d=e;d<i;d++)s[u+(d>>5)]|=1<<(d&31)},e.prototype.getRow=function(e,t){t==null||t.getSize()<this.width?t=new S(this.width):t.clear();for(var n=this.rowSize,r=this.bits,i=e*n,a=0;a<n;a++)t.setBulk(a*32,r[i+a]);return t},e.prototype.setRow=function(e,t){m.arraycopy(t.getBitArray(),0,this.bits,e*this.rowSize,this.rowSize)},e.prototype.rotate180=function(){for(var e=this.getWidth(),t=this.getHeight(),n=new S(e),r=new S(e),i=0,a=Math.floor((t+1)/2);i<a;i++)n=this.getRow(i,n),r=this.getRow(t-1-i,r),n.reverse(),r.reverse(),this.setRow(i,r),this.setRow(t-1-i,n)},e.prototype.getEnclosingRectangle=function(){for(var e=this.width,t=this.height,n=this.rowSize,r=this.bits,i=e,a=t,o=-1,s=-1,c=0;c<t;c++)for(var l=0;l<n;l++){var u=r[c*n+l];if(u!==0){if(c<a&&(a=c),c>s&&(s=c),l*32<i){for(var d=0;!(u<<31-d);)d++;l*32+d<i&&(i=l*32+d)}if(l*32+31>o){for(var d=31;!(u>>>d);)d--;l*32+d>o&&(o=l*32+d)}}}return o<i||s<a?null:Int32Array.from([i,a,o-i+1,s-a+1])},e.prototype.getTopLeftOnBit=function(){for(var e=this.rowSize,t=this.bits,n=0;n<t.length&&t[n]===0;)n++;if(n===t.length)return null;for(var r=n/e,i=n%e*32,a=t[n],o=0;!(a<<31-o);)o++;return i+=o,Int32Array.from([i,r])},e.prototype.getBottomRightOnBit=function(){for(var e=this.rowSize,t=this.bits,n=t.length-1;n>=0&&t[n]===0;)n--;if(n<0)return null;for(var r=Math.floor(n/e),i=Math.floor(n%e)*32,a=t[n],o=31;!(a>>>o);)o--;return i+=o,Int32Array.from([i,r])},e.prototype.getWidth=function(){return this.width},e.prototype.getHeight=function(){return this.height},e.prototype.getRowSize=function(){return this.rowSize},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.width===n.width&&this.height===n.height&&this.rowSize===n.rowSize&&b.equals(this.bits,n.bits)},e.prototype.hashCode=function(){var e=this.width;return e=31*e+this.width,e=31*e+this.height,e=31*e+this.rowSize,e=31*e+b.hashCode(this.bits),e},e.prototype.toString=function(e,t,n){return e===void 0&&(e=`X `),t===void 0&&(t=` `),n===void 0&&(n=`
3
- `),this.buildToString(e,t,n)},e.prototype.buildToString=function(e,t,n){for(var r=new j,i=0,a=this.height;i<a;i++){for(var o=0,s=this.width;o<s;o++)r.append(this.get(o,i)?e:t);r.append(n)}return r.toString()},e.prototype.clone=function(){return new e(this.width,this.height,this.rowSize,this.bits.slice())},e}(),ie=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),M=function(e){ie(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.getNotFoundInstance=function(){return new t},t.kind=`NotFoundException`,t}(a),ae=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),oe=function(e){ae(t,e);function t(n){var r=e.call(this,n)||this;return r.luminances=t.EMPTY,r.buckets=new Int32Array(t.LUMINANCE_BUCKETS),r}return t.prototype.getBlackRow=function(e,n){var r=this.getLuminanceSource(),i=r.getWidth();n==null||n.getSize()<i?n=new S(i):n.clear(),this.initArrays(i);for(var a=r.getRow(e,this.luminances),o=this.buckets,s=0;s<i;s++)o[(a[s]&255)>>t.LUMINANCE_SHIFT]++;var c=t.estimateBlackPoint(o);if(i<3)for(var s=0;s<i;s++)(a[s]&255)<c&&n.set(s);else for(var l=a[0]&255,u=a[1]&255,s=1;s<i-1;s++){var d=a[s+1]&255;(u*4-l-d)/2<c&&n.set(s),l=u,u=d}return n},t.prototype.getBlackMatrix=function(){var e=this.getLuminanceSource(),n=e.getWidth(),r=e.getHeight(),i=new re(n,r);this.initArrays(n);for(var a=this.buckets,o=1;o<5;o++)for(var s=Math.floor(r*o/5),c=e.getRow(s,this.luminances),l=Math.floor(n*4/5),u=Math.floor(n/5);u<l;u++){var d=c[u]&255;a[d>>t.LUMINANCE_SHIFT]++}for(var f=t.estimateBlackPoint(a),p=e.getMatrix(),o=0;o<r;o++)for(var m=o*n,u=0;u<n;u++){var d=p[m+u]&255;d<f&&i.set(u,o)}return i},t.prototype.createBinarizer=function(e){return new t(e)},t.prototype.initArrays=function(e){this.luminances.length<e&&(this.luminances=new Uint8ClampedArray(e)),this.buckets.fill(0)},t.estimateBlackPoint=function(e){for(var n=e.length,r=0,i=0,a=0,o=0;o<n;o++)e[o]>a&&(i=o,a=e[o]),e[o]>r&&(r=e[o]);for(var s=0,c=0,o=0;o<n;o++){var l=o-i,u=e[o]*l*l;u>c&&(s=o,c=u)}if(i>s){var d=i;i=s,s=d}if(s-i<=n/16)throw new M;for(var f=s-1,p=-1,o=s-1;o>i;o--){var m=o-i,u=m*m*(s-o)*(r-e[o]);u>p&&(f=o,p=u)}return f<<t.LUMINANCE_SHIFT},t.LUMINANCE_BITS=5,t.LUMINANCE_SHIFT=8-t.LUMINANCE_BITS,t.LUMINANCE_BUCKETS=1<<t.LUMINANCE_BITS,t.EMPTY=Uint8ClampedArray.from([0]),t}(p),se=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ce=function(e){se(t,e);function t(t){var n=e.call(this,t)||this;return n.matrix=null,n}return t.prototype.getBlackMatrix=function(){if(this.matrix!==null)return this.matrix;var n=this.getLuminanceSource(),r=n.getWidth(),i=n.getHeight();if(r>=t.MINIMUM_DIMENSION&&i>=t.MINIMUM_DIMENSION){var a=n.getMatrix(),o=r>>t.BLOCK_SIZE_POWER;(r&t.BLOCK_SIZE_MASK)!==0&&o++;var s=i>>t.BLOCK_SIZE_POWER;(i&t.BLOCK_SIZE_MASK)!==0&&s++;var c=t.calculateBlackPoints(a,o,s,r,i),l=new re(r,i);t.calculateThresholdForBlock(a,o,s,r,i,c,l),this.matrix=l}else this.matrix=e.prototype.getBlackMatrix.call(this);return this.matrix},t.prototype.createBinarizer=function(e){return new t(e)},t.calculateThresholdForBlock=function(e,n,r,i,a,o,s){for(var c=a-t.BLOCK_SIZE,l=i-t.BLOCK_SIZE,u=0;u<r;u++){var d=u<<t.BLOCK_SIZE_POWER;d>c&&(d=c);for(var f=t.cap(u,2,r-3),p=0;p<n;p++){var m=p<<t.BLOCK_SIZE_POWER;m>l&&(m=l);for(var h=t.cap(p,2,n-3),g=0,_=-2;_<=2;_++){var v=o[f+_];g+=v[h-2]+v[h-1]+v[h]+v[h+1]+v[h+2]}var y=g/25;t.thresholdBlock(e,m,d,y,i,s)}}},t.cap=function(e,t,n){return e<t?t:e>n?n:e},t.thresholdBlock=function(e,n,r,i,a,o){for(var s=0,c=r*a+n;s<t.BLOCK_SIZE;s++,c+=a)for(var l=0;l<t.BLOCK_SIZE;l++)(e[c+l]&255)<=i&&o.set(n+l,r+s)},t.calculateBlackPoints=function(e,n,r,i,a){for(var o=a-t.BLOCK_SIZE,s=i-t.BLOCK_SIZE,c=Array(r),l=0;l<r;l++){c[l]=new Int32Array(n);var u=l<<t.BLOCK_SIZE_POWER;u>o&&(u=o);for(var d=0;d<n;d++){var f=d<<t.BLOCK_SIZE_POWER;f>s&&(f=s);for(var p=0,m=255,h=0,g=0,_=u*i+f;g<t.BLOCK_SIZE;g++,_+=i){for(var v=0;v<t.BLOCK_SIZE;v++){var y=e[_+v]&255;p+=y,y<m&&(m=y),y>h&&(h=y)}if(h-m>t.MIN_DYNAMIC_RANGE)for(g++,_+=i;g<t.BLOCK_SIZE;g++,_+=i)for(var v=0;v<t.BLOCK_SIZE;v++)p+=e[_+v]&255}var b=p>>t.BLOCK_SIZE_POWER*2;if(h-m<=t.MIN_DYNAMIC_RANGE&&(b=m/2,l>0&&d>0)){var x=(c[l-1][d]+2*c[l][d-1]+c[l-1][d-1])/4;m<x&&(b=x)}c[l][d]=b}}return c},t.BLOCK_SIZE_POWER=3,t.BLOCK_SIZE=1<<t.BLOCK_SIZE_POWER,t.BLOCK_SIZE_MASK=t.BLOCK_SIZE-1,t.MINIMUM_DIMENSION=t.BLOCK_SIZE*5,t.MIN_DYNAMIC_RANGE=24,t}(oe),le=function(){function e(e,t){this.width=e,this.height=t}return e.prototype.getWidth=function(){return this.width},e.prototype.getHeight=function(){return this.height},e.prototype.isCropSupported=function(){return!1},e.prototype.crop=function(e,t,n,r){throw new te(`This luminance source does not support cropping.`)},e.prototype.isRotateSupported=function(){return!1},e.prototype.rotateCounterClockwise=function(){throw new te(`This luminance source does not support rotation by 90 degrees.`)},e.prototype.rotateCounterClockwise45=function(){throw new te(`This luminance source does not support rotation by 45 degrees.`)},e.prototype.toString=function(){for(var e=new Uint8ClampedArray(this.width),t=new j,n=0;n<this.height;n++){for(var r=this.getRow(n,e),i=0;i<this.width;i++){var a=r[i]&255,o=void 0;o=a<64?`#`:a<128?`+`:a<192?`.`:` `,t.append(o)}t.append(`
4
- `)}return t.toString()},e}(),ue=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),de=function(e){ue(t,e);function t(t){var n=e.call(this,t.getWidth(),t.getHeight())||this;return n.delegate=t,n}return t.prototype.getRow=function(e,t){for(var n=this.delegate.getRow(e,t),r=this.getWidth(),i=0;i<r;i++)n[i]=255-(n[i]&255);return n},t.prototype.getMatrix=function(){for(var e=this.delegate.getMatrix(),t=this.getWidth()*this.getHeight(),n=new Uint8ClampedArray(t),r=0;r<t;r++)n[r]=255-(e[r]&255);return n},t.prototype.isCropSupported=function(){return this.delegate.isCropSupported()},t.prototype.crop=function(e,n,r,i){return new t(this.delegate.crop(e,n,r,i))},t.prototype.isRotateSupported=function(){return this.delegate.isRotateSupported()},t.prototype.invert=function(){return this.delegate},t.prototype.rotateCounterClockwise=function(){return new t(this.delegate.rotateCounterClockwise())},t.prototype.rotateCounterClockwise45=function(){return new t(this.delegate.rotateCounterClockwise45())},t}(le),fe=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),pe=function(e){fe(t,e);function t(n,r,i){r===void 0&&(r=!1);var a=e.call(this,n.width,n.height)||this;return a.canvas=n,a.tempCanvasElement=null,a.buffer=t.makeBufferFromCanvasImageData(n,r,i),a}return t.makeBufferFromCanvasImageData=function(e,n,r){n===void 0&&(n=!1);var i=e.getContext(`2d`).getImageData(0,0,e.width,e.height);return t.toGrayscaleBuffer(i.data,e.width,e.height,n,r)},t.toGrayscaleBuffer=function(e,n,r,i,a){i===void 0&&(i=!1);var o=n*r,s=a&&a.length>=o?a:new Uint8ClampedArray(o);t.FRAME_INDEX=!t.FRAME_INDEX;for(var c=!t.FRAME_INDEX&&i?255:0,l=0,u=0,d=e.length;l<d;l+=4,u++){var f=void 0;if(e[l+3]===0)f=255;else{var p=e[l],m=e[l+1],h=e[l+2];f=306*p+601*m+117*h+512>>10}s[u]=f^c}return s},t.prototype.getRow=function(e,t){if(e<0||e>=this.getHeight())throw new l(`Requested row is outside the image: `+e);var n=this.getWidth(),r=e*n;return t===null?t=this.buffer.slice(r,r+n):(t.length<n&&(t=new Uint8ClampedArray(n)),t.set(this.buffer.subarray(r,r+n))),t},t.prototype.getMatrix=function(){return this.buffer},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(t,n,r,i){return e.prototype.crop.call(this,t,n,r,i),this},t.prototype.isRotateSupported=function(){return!0},t.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},t.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},t.prototype.getTempCanvasElement=function(){if(this.tempCanvasElement===null){var e=this.canvas.ownerDocument.createElement(`canvas`);e.width=this.canvas.width,e.height=this.canvas.height,this.tempCanvasElement=e}return this.tempCanvasElement},t.prototype.rotate=function(e){var n=this.getTempCanvasElement(),r=n.getContext(`2d`),i=e*t.DEGREE_TO_RADIANS,a=this.canvas.width,o=this.canvas.height,s=Math.ceil(Math.abs(Math.cos(i))*a+Math.abs(Math.sin(i))*o),c=Math.ceil(Math.abs(Math.sin(i))*a+Math.abs(Math.cos(i))*o);return n.width=s,n.height=c,r.translate(s/2,c/2),r.rotate(i),r.drawImage(this.canvas,a/-2,o/-2),this.buffer=t.makeBufferFromCanvasImageData(n),this},t.prototype.invert=function(){return new de(this)},t.DEGREE_TO_RADIANS=Math.PI/180,t.FRAME_INDEX=!0,t}(le),me=function(){function e(e,t,n){this.deviceId=e,this.label=t,this.kind=`videoinput`,this.groupId=n||void 0}return e.prototype.toJSON=function(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}},e}(),he=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},ge=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}},_e=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},ve=function(){function e(e,t,n){t===void 0&&(t=500),this.reader=e,this.timeBetweenScansMillis=t,this._hints=n,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(e.prototype,"hasNavigator",{get:function(){return typeof navigator<`u`},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canEnumerateDevices",{get:function(){return!!(this.isMediaDevicesSuported&&navigator.mediaDevices.enumerateDevices)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(e){this._timeBetweenDecodingAttempts=e<0?0:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hints",{get:function(){return this._hints},set:function(e){this._hints=e||null},enumerable:!1,configurable:!0}),e.prototype.listVideoInputDevices=function(){return he(this,void 0,void 0,function(){var e,t,n,r,i,a,o,s,c,l,u,d;return ge(this,function(f){switch(f.label){case 0:if(!this.hasNavigator)throw Error(`Can't enumerate devices, navigator is not present.`);if(!this.canEnumerateDevices)throw Error(`Can't enumerate devices, method not supported.`);return[4,navigator.mediaDevices.enumerateDevices()];case 1:e=f.sent(),t=[];try{for(n=_e(e),r=n.next();!r.done;r=n.next())i=r.value,a=i.kind===`video`?`videoinput`:i.kind,a===`videoinput`&&(o=i.deviceId||i.id,s=i.label||`Video device ${t.length+1}`,c=i.groupId,l={deviceId:o,label:s,kind:a,groupId:c},t.push(l))}catch(e){u={error:e}}finally{try{r&&!r.done&&(d=n.return)&&d.call(n)}finally{if(u)throw u.error}}return[2,t]}})})},e.prototype.getVideoInputDevices=function(){return he(this,void 0,void 0,function(){var e;return ge(this,function(t){switch(t.label){case 0:return[4,this.listVideoInputDevices()];case 1:return e=t.sent(),[2,e.map(function(e){return new me(e.deviceId,e.label)})]}})})},e.prototype.findDeviceById=function(e){return he(this,void 0,void 0,function(){var t;return ge(this,function(n){switch(n.label){case 0:return[4,this.listVideoInputDevices()];case 1:return t=n.sent(),t?[2,t.find(function(t){return t.deviceId===e})]:[2,null]}})})},e.prototype.decodeFromInputVideoDevice=function(e,t){return he(this,void 0,void 0,function(){return ge(this,function(n){switch(n.label){case 0:return[4,this.decodeOnceFromVideoDevice(e,t)];case 1:return[2,n.sent()]}})})},e.prototype.decodeOnceFromVideoDevice=function(e,t){return he(this,void 0,void 0,function(){var n,r;return ge(this,function(i){switch(i.label){case 0:return this.reset(),n=e?{deviceId:{exact:e}}:{facingMode:`environment`},r={video:n},[4,this.decodeOnceFromConstraints(r,t)];case 1:return[2,i.sent()]}})})},e.prototype.decodeOnceFromConstraints=function(e,t){return he(this,void 0,void 0,function(){var n;return ge(this,function(r){switch(r.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return n=r.sent(),[4,this.decodeOnceFromStream(n,t)];case 2:return[2,r.sent()]}})})},e.prototype.decodeOnceFromStream=function(e,t){return he(this,void 0,void 0,function(){var n,r;return ge(this,function(i){switch(i.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,t)];case 1:return n=i.sent(),[4,this.decodeOnce(n)];case 2:return r=i.sent(),[2,r]}})})},e.prototype.decodeFromInputVideoDeviceContinuously=function(e,t,n){return he(this,void 0,void 0,function(){return ge(this,function(r){switch(r.label){case 0:return[4,this.decodeFromVideoDevice(e,t,n)];case 1:return[2,r.sent()]}})})},e.prototype.decodeFromVideoDevice=function(e,t,n){return he(this,void 0,void 0,function(){var r,i;return ge(this,function(a){switch(a.label){case 0:return r=e?{deviceId:{exact:e}}:{facingMode:`environment`},i={video:r},[4,this.decodeFromConstraints(i,t,n)];case 1:return[2,a.sent()]}})})},e.prototype.decodeFromConstraints=function(e,t,n){return he(this,void 0,void 0,function(){var r;return ge(this,function(i){switch(i.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return r=i.sent(),[4,this.decodeFromStream(r,t,n)];case 2:return[2,i.sent()]}})})},e.prototype.decodeFromStream=function(e,t,n){return he(this,void 0,void 0,function(){var r;return ge(this,function(i){switch(i.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,t)];case 1:return r=i.sent(),[4,this.decodeContinuously(r,n)];case 2:return[2,i.sent()]}})})},e.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},e.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},e.prototype.attachStreamToVideo=function(e,t){return he(this,void 0,void 0,function(){var n;return ge(this,function(r){switch(r.label){case 0:return n=this.prepareVideoElement(t),this.addVideoSource(n,e),this.videoElement=n,this.stream=e,[4,this.playVideoOnLoadAsync(n)];case 1:return r.sent(),[2,n]}})})},e.prototype.playVideoOnLoadAsync=function(e){var t=this;return new Promise(function(n,r){return t.playVideoOnLoad(e,function(){return n()})})},e.prototype.playVideoOnLoad=function(e,t){var n=this;this.videoEndedListener=function(){return n.stopStreams()},this.videoCanPlayListener=function(){return n.tryPlayVideo(e)},e.addEventListener(`ended`,this.videoEndedListener),e.addEventListener(`canplay`,this.videoCanPlayListener),e.addEventListener(`playing`,t),this.tryPlayVideo(e)},e.prototype.isVideoPlaying=function(e){return e.currentTime>0&&!e.paused&&!e.ended&&e.readyState>2},e.prototype.tryPlayVideo=function(e){return he(this,void 0,void 0,function(){return ge(this,function(t){switch(t.label){case 0:if(this.isVideoPlaying(e))return console.warn(`Trying to play video that is already playing.`),[2];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,e.play()];case 2:return t.sent(),[3,4];case 3:return t.sent(),console.warn(`It was not possible to play the video.`),[3,4];case 4:return[2]}})})},e.prototype.getMediaElement=function(e,t){var n=document.getElementById(e);if(!n)throw new s(`element with id '${e}' not found`);if(n.nodeName.toLowerCase()!==t.toLowerCase())throw new s(`element with id '${e}' must be an ${t} element`);return n},e.prototype.decodeFromImage=function(e,t){if(!e&&!t)throw new s(`either imageElement with a src set or an url must be provided`);return t&&!e?this.decodeFromImageUrl(t):this.decodeFromImageElement(e)},e.prototype.decodeFromVideo=function(e,t){if(!e&&!t)throw new s(`Either an element with a src set or an URL must be provided`);return t&&!e?this.decodeFromVideoUrl(t):this.decodeFromVideoElement(e)},e.prototype.decodeFromVideoContinuously=function(e,t,n){if(e===void 0&&t===void 0)throw new s(`Either an element with a src set or an URL must be provided`);return t&&!e?this.decodeFromVideoUrlContinuously(t,n):this.decodeFromVideoElementContinuously(e,n)},e.prototype.decodeFromImageElement=function(e){if(!e)throw new s(`An image element must be provided.`);this.reset();var t=this.prepareImageElement(e);return this.imageElement=t,this.isImageLoaded(t)?this.decodeOnce(t,!1,!0):this._decodeOnLoadImage(t)},e.prototype.decodeFromVideoElement=function(e){var t=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideo(t)},e.prototype.decodeFromVideoElementContinuously=function(e,t){var n=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideoContinuously(n,t)},e.prototype._decodeFromVideoElementSetup=function(e){if(!e)throw new s(`A video element must be provided.`);this.reset();var t=this.prepareVideoElement(e);return this.videoElement=t,t},e.prototype.decodeFromImageUrl=function(e){if(!e)throw new s(`An URL must be provided.`);this.reset();var t=this.prepareImageElement();this.imageElement=t;var n=this._decodeOnLoadImage(t);return t.src=e,n},e.prototype.decodeFromVideoUrl=function(e){if(!e)throw new s(`An URL must be provided.`);this.reset();var t=this.prepareVideoElement(),n=this.decodeFromVideoElement(t);return t.src=e,n},e.prototype.decodeFromVideoUrlContinuously=function(e,t){if(!e)throw new s(`An URL must be provided.`);this.reset();var n=this.prepareVideoElement(),r=this.decodeFromVideoElementContinuously(n,t);return n.src=e,r},e.prototype._decodeOnLoadImage=function(e){var t=this;return new Promise(function(n,r){t.imageLoadedListener=function(){return t.decodeOnce(e,!1,!0).then(n,r)},e.addEventListener(`load`,t.imageLoadedListener)})},e.prototype._decodeOnLoadVideo=function(e){return he(this,void 0,void 0,function(){return ge(this,function(t){switch(t.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return t.sent(),[4,this.decodeOnce(e)];case 2:return[2,t.sent()]}})})},e.prototype._decodeOnLoadVideoContinuously=function(e,t){return he(this,void 0,void 0,function(){return ge(this,function(n){switch(n.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return n.sent(),this.decodeContinuously(e,t),[2]}})})},e.prototype.isImageLoaded=function(e){return!(!e.complete||e.naturalWidth===0)},e.prototype.prepareImageElement=function(e){var t;return e===void 0&&(t=document.createElement(`img`),t.width=200,t.height=200),typeof e==`string`&&(t=this.getMediaElement(e,`img`)),e instanceof HTMLImageElement&&(t=e),t},e.prototype.prepareVideoElement=function(e){var t;return!e&&typeof document<`u`&&(t=document.createElement(`video`),t.width=200,t.height=200),typeof e==`string`&&(t=this.getMediaElement(e,`video`)),e instanceof HTMLVideoElement&&(t=e),t.setAttribute(`autoplay`,`true`),t.setAttribute(`muted`,`true`),t.setAttribute(`playsinline`,`true`),t},e.prototype.decodeOnce=function(e,t,n){var r=this;t===void 0&&(t=!0),n===void 0&&(n=!0),this._stopAsyncDecode=!1;var i=function(a,o){if(r._stopAsyncDecode)o(new M(`Video stream has ended before any code could be detected.`)),r._stopAsyncDecode=void 0;else try{a(r.decode(e))}catch(e){var s=t&&e instanceof M,c=(e instanceof f||e instanceof E)&&n;if(s||c)return setTimeout(i,r._timeBetweenDecodingAttempts,a,o);o(e)}};return new Promise(function(e,t){return i(e,t)})},e.prototype.decodeContinuously=function(e,t){var n=this;this._stopContinuousDecode=!1;var r=function(){if(n._stopContinuousDecode)n._stopContinuousDecode=void 0;else try{t(n.decode(e),null),setTimeout(r,n.timeBetweenScansMillis)}catch(e){t(null,e);var i=e instanceof f||e instanceof E,a=e instanceof M;i||a?setTimeout(r,n._timeBetweenDecodingAttempts):console.error(`BrowserCodeReader: unexpected error during decode, stopping scan loop:`,e)}};r()},e.prototype.decode=function(e){var t=this.createBinaryBitmap(e);try{return this.decodeBitmap(t)}catch(t){if(t instanceof M){var n=new u(new oe(new pe(this.getCaptureCanvas(e),!1)));return this.decodeBitmap(n)}throw t}},e.prototype.createBinaryBitmap=function(e){this.getCaptureCanvasContext(e);var t=!1;e instanceof HTMLVideoElement?(this.drawFrameOnCanvas(e),t=!0):this.drawImageOnCanvas(e);var n=new pe(this.getCaptureCanvas(e),t,this._grayscaleBuffer);return this._grayscaleBuffer=n.getMatrix(),new u(new ce(n))},e.prototype.getCaptureCanvasContext=function(e){if(!this.captureCanvasContext){var t=this.getCaptureCanvas(e),n=void 0;try{n=t.getContext(`2d`,{willReadFrequently:!0})}catch{n=t.getContext(`2d`)}this.captureCanvasContext=n}return this.captureCanvasContext},e.prototype.getCaptureCanvas=function(e){if(!this.captureCanvas){var t=this.createCaptureCanvas(e);this.captureCanvas=t}return this.captureCanvas},e.prototype.drawFrameOnCanvas=function(e,t,n){t===void 0&&(t={sx:0,sy:0,sWidth:e.videoWidth,sHeight:e.videoHeight,dx:0,dy:0,dWidth:e.videoWidth,dHeight:e.videoHeight}),n===void 0&&(n=this.captureCanvasContext),n.drawImage(e,t.sx,t.sy,t.sWidth,t.sHeight,t.dx,t.dy,t.dWidth,t.dHeight)},e.prototype.drawImageOnCanvas=function(e,t,n){t===void 0&&(t={sx:0,sy:0,sWidth:e.naturalWidth,sHeight:e.naturalHeight,dx:0,dy:0,dWidth:e.naturalWidth,dHeight:e.naturalHeight}),n===void 0&&(n=this.captureCanvasContext),n.drawImage(e,t.sx,t.sy,t.sWidth,t.sHeight,t.dx,t.dy,t.dWidth,t.dHeight)},e.prototype.decodeBitmap=function(e){try{return this.reader.decode(e,this._hints)}finally{this.reader.reset()}},e.prototype.createCaptureCanvas=function(e){if(typeof document>`u`)return this._destroyCaptureCanvas(),null;var t=document.createElement(`canvas`),n,r;return e!==void 0&&(e instanceof HTMLVideoElement?(n=e.videoWidth,r=e.videoHeight):e instanceof HTMLImageElement&&(n=e.naturalWidth||e.width,r=e.naturalHeight||e.height)),t.style.width=n+`px`,t.style.height=r+`px`,t.width=n,t.height=r,t},e.prototype.stopStreams=function(){this.stream&&=(this.stream.getVideoTracks().forEach(function(e){return e.stop()}),void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()},e.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},e.prototype._destroyVideoElement=function(){this.videoElement&&=(this.videoEndedListener!==void 0&&this.videoElement.removeEventListener(`ended`,this.videoEndedListener),this.videoPlayingEventListener!==void 0&&this.videoElement.removeEventListener(`playing`,this.videoPlayingEventListener),this.videoCanPlayListener!==void 0&&this.videoElement.removeEventListener(`loadedmetadata`,this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),void 0)},e.prototype._destroyImageElement=function(){this.imageElement&&=(this.imageLoadedListener!==void 0&&this.imageElement.removeEventListener(`load`,this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute(`src`),void 0)},e.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},e.prototype.addVideoSource=function(e,t){try{e.srcObject=t}catch{e.src=URL.createObjectURL(t)}},e.prototype.cleanVideoSource=function(e){try{e.srcObject=null}catch{e.src=``}this.videoElement.removeAttribute(`src`)},e}(),ye=function(){function e(e,t,n,r,i,a){n===void 0&&(n=t==null?0:8*t.length),a===void 0&&(a=m.currentTimeMillis()),this.text=e,this.rawBytes=t,this.numBits=n,this.resultPoints=r,this.format=i,this.timestamp=a,this.text=e,this.rawBytes=t,this.numBits=n??(t==null?0:8*t.length),this.resultPoints=r,this.format=i,this.resultMetadata=null,this.timestamp=a??m.currentTimeMillis()}return e.prototype.getText=function(){return this.text},e.prototype.getRawBytes=function(){return this.rawBytes},e.prototype.getNumBits=function(){return this.numBits},e.prototype.getResultPoints=function(){return this.resultPoints},e.prototype.getBarcodeFormat=function(){return this.format},e.prototype.getResultMetadata=function(){return this.resultMetadata},e.prototype.putMetadata=function(e,t){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(e,t)},e.prototype.putAllMetadata=function(e){e!==null&&(this.resultMetadata=this.resultMetadata===null?e:new Map(e))},e.prototype.addResultPoints=function(e){var t=this.resultPoints;if(t===null)this.resultPoints=e;else if(e!==null&&e.length>0){var n=Array(t.length+e.length);m.arraycopy(t,0,n,0,t.length),m.arraycopy(e,0,n,t.length,e.length),this.resultPoints=n}},e.prototype.getTimestamp=function(){return this.timestamp},e.prototype.toString=function(){return this.text},e}(),be;(function(e){e[e.AZTEC=0]=`AZTEC`,e[e.CODABAR=1]=`CODABAR`,e[e.CODE_39=2]=`CODE_39`,e[e.CODE_93=3]=`CODE_93`,e[e.CODE_128=4]=`CODE_128`,e[e.DATA_MATRIX=5]=`DATA_MATRIX`,e[e.EAN_8=6]=`EAN_8`,e[e.EAN_13=7]=`EAN_13`,e[e.ITF=8]=`ITF`,e[e.MAXICODE=9]=`MAXICODE`,e[e.PDF_417=10]=`PDF_417`,e[e.QR_CODE=11]=`QR_CODE`,e[e.RSS_14=12]=`RSS_14`,e[e.RSS_EXPANDED=13]=`RSS_EXPANDED`,e[e.UPC_A=14]=`UPC_A`,e[e.UPC_E=15]=`UPC_E`,e[e.UPC_EAN_EXTENSION=16]=`UPC_EAN_EXTENSION`,e[e.MICRO_QR_CODE=17]=`MICRO_QR_CODE`})(be||={});var N=be,xe;(function(e){e[e.OTHER=0]=`OTHER`,e[e.ORIENTATION=1]=`ORIENTATION`,e[e.BYTE_SEGMENTS=2]=`BYTE_SEGMENTS`,e[e.ERROR_CORRECTION_LEVEL=3]=`ERROR_CORRECTION_LEVEL`,e[e.ISSUE_NUMBER=4]=`ISSUE_NUMBER`,e[e.SUGGESTED_PRICE=5]=`SUGGESTED_PRICE`,e[e.POSSIBLE_COUNTRY=6]=`POSSIBLE_COUNTRY`,e[e.UPC_EAN_EXTENSION=7]=`UPC_EAN_EXTENSION`,e[e.PDF417_EXTRA_METADATA=8]=`PDF417_EXTRA_METADATA`,e[e.STRUCTURED_APPEND_SEQUENCE=9]=`STRUCTURED_APPEND_SEQUENCE`,e[e.STRUCTURED_APPEND_PARITY=10]=`STRUCTURED_APPEND_PARITY`,e[e.ERRORS_CORRECTED=11]=`ERRORS_CORRECTED`})(xe||={});var P=xe,Se=function(){function e(e,t,n,r,i,a){i===void 0&&(i=-1),a===void 0&&(a=-1),this.rawBytes=e,this.text=t,this.byteSegments=n,this.ecLevel=r,this.structuredAppendSequenceNumber=i,this.structuredAppendParity=a,this.numBits=e==null?0:8*e.length}return e.prototype.getRawBytes=function(){return this.rawBytes},e.prototype.getNumBits=function(){return this.numBits},e.prototype.setNumBits=function(e){this.numBits=e},e.prototype.getText=function(){return this.text},e.prototype.getByteSegments=function(){return this.byteSegments},e.prototype.getECLevel=function(){return this.ecLevel},e.prototype.getErrorsCorrected=function(){return this.errorsCorrected},e.prototype.setErrorsCorrected=function(e){this.errorsCorrected=e},e.prototype.getErasures=function(){return this.erasures},e.prototype.setErasures=function(e){this.erasures=e},e.prototype.getOther=function(){return this.other},e.prototype.setOther=function(e){this.other=e},e.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},e.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},e.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},e}(),Ce=function(){function e(){}return e.prototype.exp=function(e){return this.expTable[e]},e.prototype.log=function(e){if(e===0)throw new l;return this.logTable[e]},e.addOrSubtract=function(e,t){return e^t},e}(),we=function(){function e(e,t){if(t.length===0)throw new l;this.field=e;var n=t.length;if(n>1&&t[0]===0){for(var r=1;r<n&&t[r]===0;)r++;r===n?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(n-r),m.arraycopy(t,r,this.coefficients,0,this.coefficients.length))}else this.coefficients=t}return e.prototype.getCoefficients=function(){return this.coefficients},e.prototype.getDegree=function(){return this.coefficients.length-1},e.prototype.isZero=function(){return this.coefficients[0]===0},e.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},e.prototype.evaluateAt=function(e){if(e===0)return this.getCoefficient(0);var t=this.coefficients,n;if(e===1){n=0;for(var r=0,i=t.length;r!==i;r++){var a=t[r];n=Ce.addOrSubtract(n,a)}return n}n=t[0];for(var o=t.length,s=this.field,r=1;r<o;r++)n=Ce.addOrSubtract(s.multiply(e,n),t[r]);return n},e.prototype.addOrSubtract=function(t){if(!this.field.equals(t.field))throw new l(`GenericGFPolys do not have same GenericGF field`);if(this.isZero())return t;if(t.isZero())return this;var n=this.coefficients,r=t.coefficients;if(n.length>r.length){var i=n;n=r,r=i}var a=new Int32Array(r.length),o=r.length-n.length;m.arraycopy(r,0,a,0,o);for(var s=o;s<r.length;s++)a[s]=Ce.addOrSubtract(n[s-o],r[s]);return new e(this.field,a)},e.prototype.multiply=function(t){if(!this.field.equals(t.field))throw new l(`GenericGFPolys do not have same GenericGF field`);if(this.isZero()||t.isZero())return this.field.getZero();for(var n=this.coefficients,r=n.length,i=t.coefficients,a=i.length,o=new Int32Array(r+a-1),s=this.field,c=0;c<r;c++)for(var u=n[c],d=0;d<a;d++)o[c+d]=Ce.addOrSubtract(o[c+d],s.multiply(u,i[d]));return new e(s,o)},e.prototype.multiplyScalar=function(t){if(t===0)return this.field.getZero();if(t===1)return this;for(var n=this.coefficients.length,r=this.field,i=new Int32Array(n),a=this.coefficients,o=0;o<n;o++)i[o]=r.multiply(a[o],t);return new e(r,i)},e.prototype.multiplyByMonomial=function(t,n){if(t<0)throw new l;if(n===0)return this.field.getZero();for(var r=this.coefficients,i=r.length,a=new Int32Array(i+t),o=this.field,s=0;s<i;s++)a[s]=o.multiply(r[s],n);return new e(o,a)},e.prototype.divide=function(e){if(!this.field.equals(e.field))throw new l(`GenericGFPolys do not have same GenericGF field`);if(e.isZero())throw new l(`Divide by 0`);for(var t=this.field,n=t.getZero(),r=this,i=e.getCoefficient(e.getDegree()),a=t.inverse(i);r.getDegree()>=e.getDegree()&&!r.isZero();){var o=r.getDegree()-e.getDegree(),s=t.multiply(r.getCoefficient(r.getDegree()),a),c=e.multiplyByMonomial(o,s),u=t.buildMonomial(o,s);n=n.addOrSubtract(u),r=r.addOrSubtract(c)}return[n,r]},e.prototype.toString=function(){for(var e=``,t=this.getDegree();t>=0;t--){var n=this.getCoefficient(t);if(n!==0){if(n<0?(e+=` - `,n=-n):e.length>0&&(e+=` + `),t===0||n!==1){var r=this.field.log(n);r===0?e+=`1`:r===1?e+=`a`:(e+=`a^`,e+=r)}t!==0&&(t===1?e+=`x`:(e+=`x^`,e+=t))}}return e},e}(),Te=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ee=function(e){Te(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.kind=`ArithmeticException`,t}(a),De=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Oe=function(e){De(t,e);function t(t,n,r){var i=e.call(this)||this;i.primitive=t,i.size=n,i.generatorBase=r;for(var a=new Int32Array(n),o=1,s=0;s<n;s++)a[s]=o,o*=2,o>=n&&(o^=t,o&=n-1);i.expTable=a;for(var c=new Int32Array(n),s=0;s<n-1;s++)c[a[s]]=s;return i.logTable=c,i.zero=new we(i,Int32Array.from([0])),i.one=new we(i,Int32Array.from([1])),i}return t.prototype.getZero=function(){return this.zero},t.prototype.getOne=function(){return this.one},t.prototype.buildMonomial=function(e,t){if(e<0)throw new l;if(t===0)return this.zero;var n=new Int32Array(e+1);return n[0]=t,new we(this,n)},t.prototype.inverse=function(e){if(e===0)throw new Ee;return this.expTable[this.size-this.logTable[e]-1]},t.prototype.multiply=function(e,t){return e===0||t===0?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.size-1)]},t.prototype.getSize=function(){return this.size},t.prototype.getGeneratorBase=function(){return this.generatorBase},t.prototype.toString=function(){return`GF(0x`+x.toHexString(this.primitive)+`,`+this.size+`)`},t.prototype.equals=function(e){return e===this},t.AZTEC_DATA_12=new t(4201,4096,1),t.AZTEC_DATA_10=new t(1033,1024,1),t.AZTEC_DATA_6=new t(67,64,1),t.AZTEC_PARAM=new t(19,16,1),t.QR_CODE_FIELD_256=new t(285,256,0),t.DATA_MATRIX_FIELD_256=new t(301,256,1),t.AZTEC_DATA_8=t.DATA_MATRIX_FIELD_256,t.MAXICODE_FIELD_64=t.AZTEC_DATA_6,t}(Ce),ke=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ae=function(e){ke(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.kind=`ReedSolomonException`,t}(a),je=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Me=function(e){je(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.kind=`IllegalStateException`,t}(a),Ne=function(){function e(e){this.field=e}return e.prototype.decode=function(e,t){this.decodeWithECCount(e,t)},e.prototype.decodeWithECCount=function(e,t){for(var n=this.field,r=new we(n,e),i=new Int32Array(t),a=!0,o=0;o<t;o++){var s=r.evaluateAt(n.exp(o+n.getGeneratorBase()));i[i.length-1-o]=s,s!==0&&(a=!1)}if(a)return 0;for(var c=new we(n,i),l=this.runEuclideanAlgorithm(n.buildMonomial(t,1),c,t),u=l[0],d=l[1],f=this.findErrorLocations(u),p=this.findErrorMagnitudes(d,f),o=0;o<f.length;o++){var m=e.length-1-n.log(f[o]);if(m<0)throw new Ae(`Bad error location`);e[m]=Oe.addOrSubtract(e[m],p[o])}return f.length},e.prototype.runEuclideanAlgorithm=function(e,t,n){if(e.getDegree()<t.getDegree()){var r=e;e=t,t=r}for(var i=this.field,a=e,o=t,s=i.getZero(),c=i.getOne();o.getDegree()>=(n/2|0);){var l=a,u=s;if(a=o,s=c,a.isZero())throw new Ae(`r_{i-1} was zero`);o=l;for(var d=i.getZero(),f=a.getCoefficient(a.getDegree()),p=i.inverse(f);o.getDegree()>=a.getDegree()&&!o.isZero();){var m=o.getDegree()-a.getDegree(),h=i.multiply(o.getCoefficient(o.getDegree()),p);d=d.addOrSubtract(i.buildMonomial(m,h)),o=o.addOrSubtract(a.multiplyByMonomial(m,h))}if(c=d.multiply(s).addOrSubtract(u),o.getDegree()>=a.getDegree())throw new Me(`Division algorithm failed to reduce polynomial?`)}var g=c.getCoefficient(0);if(g===0)throw new Ae(`sigmaTilde(0) was zero`);var _=i.inverse(g);return[c.multiplyScalar(_),o.multiplyScalar(_)]},e.prototype.findErrorLocations=function(e){var t=e.getDegree();if(t===1)return Int32Array.from([e.getCoefficient(1)]);for(var n=new Int32Array(t),r=0,i=this.field,a=1;a<i.getSize()&&r<t;a++)e.evaluateAt(a)===0&&(n[r]=i.inverse(a),r++);if(r!==t)throw new Ae(`Error locator degree does not match number of roots`);return n},e.prototype.findErrorMagnitudes=function(e,t){for(var n=t.length,r=new Int32Array(n),i=this.field,a=0;a<n;a++){for(var o=i.inverse(t[a]),s=1,c=0;c<n;c++)if(a!==c){var l=i.multiply(t[c],o),u=l&1?l&-2:l|1;s=i.multiply(s,u)}r[a]=i.multiply(e.evaluateAt(o),i.inverse(s)),i.getGeneratorBase()!==0&&(r[a]=i.multiply(r[a],o))}return r},e}(),Pe;(function(e){e[e.UPPER=0]=`UPPER`,e[e.LOWER=1]=`LOWER`,e[e.MIXED=2]=`MIXED`,e[e.DIGIT=3]=`DIGIT`,e[e.PUNCT=4]=`PUNCT`,e[e.BINARY=5]=`BINARY`})(Pe||={});var Fe=function(){function e(){}return e.prototype.decode=function(t){this.ddata=t;var n=t.getBits(),r=this.extractBits(n),i=this.correctBits(r),a=new Se(e.convertBoolArrayToByteArray(i),e.getEncodedData(i),null,null);return a.setNumBits(i.length),a},e.highLevelDecode=function(e){return this.getEncodedData(e)},e.getEncodedData=function(t){for(var n=t.length,r=Pe.UPPER,i=Pe.UPPER,a=``,o=0;o<n;)if(i===Pe.BINARY){if(n-o<5)break;var s=e.readCode(t,o,5);if(o+=5,s===0){if(n-o<11)break;s=e.readCode(t,o,11)+31,o+=11}for(var c=0;c<s;c++){if(n-o<8){o=n;break}var l=e.readCode(t,o,8);a+=A.castAsNonUtf8Char(l),o+=8}i=r}else{var u=i===Pe.DIGIT?4:5;if(n-o<u)break;var l=e.readCode(t,o,u);o+=u;var d=e.getCharacter(i,l);d.startsWith(`CTRL_`)?(r=i,i=e.getTable(d.charAt(5)),d.charAt(6)===`L`&&(r=i)):(a+=d,i=r)}return a},e.getTable=function(e){switch(e){case`L`:return Pe.LOWER;case`P`:return Pe.PUNCT;case`M`:return Pe.MIXED;case`D`:return Pe.DIGIT;case`B`:return Pe.BINARY;default:return Pe.UPPER}},e.getCharacter=function(t,n){switch(t){case Pe.UPPER:return e.UPPER_TABLE[n];case Pe.LOWER:return e.LOWER_TABLE[n];case Pe.MIXED:return e.MIXED_TABLE[n];case Pe.PUNCT:return e.PUNCT_TABLE[n];case Pe.DIGIT:return e.DIGIT_TABLE[n];default:throw new Me(`Bad table`)}},e.prototype.correctBits=function(t){var n,r;this.ddata.getNbLayers()<=2?(r=6,n=Oe.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(r=8,n=Oe.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(r=10,n=Oe.AZTEC_DATA_10):(r=12,n=Oe.AZTEC_DATA_12);var i=this.ddata.getNbDatablocks(),a=t.length/r;if(a<i)throw new E;for(var o=t.length%r,s=new Int32Array(a),c=0;c<a;c++,o+=r)s[c]=e.readCode(t,o,r);try{new Ne(n).decode(s,a-i)}catch(e){throw new E(e)}for(var l=(1<<r)-1,u=0,c=0;c<i;c++){var d=s[c];if(d===0||d===l)throw new E;(d===1||d===l-1)&&u++}for(var f=Array(i*r-u),p=0,c=0;c<i;c++){var d=s[c];if(d===1||d===l-1)f.fill(d>1,p,p+r-1),p+=r-1;else for(var m=r-1;m>=0;--m)f[p++]=!!(d&1<<m)}return f},e.prototype.extractBits=function(e){var t=this.ddata.isCompact(),n=this.ddata.getNbLayers(),r=(t?11:14)+n*4,i=new Int32Array(r),a=Array(this.totalBitsInLayer(n,t));if(t)for(var o=0;o<i.length;o++)i[o]=o;else for(var s=r+1+2*x.truncDivision(x.truncDivision(r,2)-1,15),c=r/2,l=x.truncDivision(s,2),o=0;o<c;o++){var u=o+x.truncDivision(o,15);i[c-o-1]=l-u-1,i[c+o]=l+u+1}for(var o=0,d=0;o<n;o++){for(var f=(n-o)*4+(t?9:12),p=o*2,m=r-1-p,h=0;h<f;h++)for(var g=h*2,_=0;_<2;_++)a[d+g+_]=e.get(i[p+_],i[p+h]),a[d+2*f+g+_]=e.get(i[p+h],i[m-_]),a[d+4*f+g+_]=e.get(i[m-_],i[m-h]),a[d+6*f+g+_]=e.get(i[m-h],i[p+_]);d+=f*8}return a},e.readCode=function(e,t,n){for(var r=0,i=t;i<t+n;i++)r<<=1,e[i]&&(r|=1);return r},e.readByte=function(t,n){var r=t.length-n;return r>=8?e.readCode(t,n,8):e.readCode(t,n,r)<<8-r},e.convertBoolArrayToByteArray=function(t){for(var n=new Uint8Array((t.length+7)/8),r=0;r<n.length;r++)n[r]=e.readByte(t,8*r);return n},e.prototype.totalBitsInLayer=function(e,t){return((t?88:112)+16*e)*e},e.UPPER_TABLE=`CTRL_PS. .A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.CTRL_LL.CTRL_ML.CTRL_DL.CTRL_BS`.split(`.`),e.LOWER_TABLE=`CTRL_PS. .a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.CTRL_US.CTRL_ML.CTRL_DL.CTRL_BS`.split(`.`),e.MIXED_TABLE=`CTRL_PS. .......\x07.\b. .
1
+ (function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=`poClient`,t=64;function n(e){return typeof e==`string`&&/^[A-Za-z0-9_-]{1,64}$/u.test(e)}function r(e){if(typeof e!=`string`)return;let n=e.replaceAll(/[\p{Cc}\p{Cf}]/gu,``).trim(),r=Array.from(n).length;return r>=1&&r<=t?n:void 0}function i(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function a(e){if(!i(e))return{status:`invalid`};if(Number.isSafeInteger(e.version)&&e.version!==1)return{status:`unsupported`};let t=r(e.deviceName);if(e.version!==1||!n(e.deviceId)||e.instanceId!==void 0&&!n(e.instanceId)||typeof e.clientKind!=`string`||![`web`,`desktop`,`ios`,`android`].includes(e.clientKind)||t===void 0||!Number.isSafeInteger(e.nameUpdatedAt)||typeof e.nameUpdatedAt!=`number`||e.nameUpdatedAt<0)return{status:`invalid`};for(let t of[`browser`,`platform`])if(e[t]!==void 0&&(r(e[t])===void 0||r(e[t])!==e[t]))return{status:`invalid`};return{status:`ok`,metadata:{version:1,deviceId:e.deviceId,...e.instanceId===void 0?{}:{instanceId:e.instanceId},clientKind:e.clientKind,deviceName:t,nameUpdatedAt:e.nameUpdatedAt,...e.browser===void 0?{}:{browser:e.browser},...e.platform===void 0?{}:{platform:e.platform}}}}function o(e){let t=new TextEncoder().encode(JSON.stringify(e));return btoa(String.fromCharCode(...t)).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replace(/=+$/u,``)}function s(e){let t=a(e);if(t.status!==`ok`)throw Error(`Invalid Po client metadata`);let n=o(t.metadata);if(n.length>2048)throw Error(`Po client metadata exceeds encoded limit`);return n}function c(t){try{if(`preface`in t)return!i(t.preface)||!Object.hasOwn(t.preface,`poClient`)?{status:`absent`}:Object.keys(t.preface).length!==1||o(t.preface.poClient).length>2048?{status:`invalid`}:a(t.preface.poClient);let n;if(`query`in t){let r=t.query.getAll(e);if(r.length>1)return{status:`invalid`};n=r[0]}else n=t.header;if(n==null)return{status:`absent`};if(n.length>2048||!/^[A-Za-z0-9_-]+$/u.test(n))return{status:`invalid`};let r=atob(n.replaceAll(`-`,`+`).replaceAll(`_`,`/`)),s=Uint8Array.from(r,e=>e.charCodeAt(0)),c=new TextDecoder(`utf-8`,{fatal:!0}).decode(s);return btoa(r).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replace(/=+$/u,``)===n?a(JSON.parse(c)):{status:`invalid`}}catch{return{status:`invalid`}}}var l=[{pattern:/iphone/iu,label:`iPhone`},{pattern:/ipad/iu,label:`iPad`},{pattern:/android/iu,label:`Android`},{pattern:/macintosh|mac os x/iu,label:`Mac`},{pattern:/windows/iu,label:`Windows`},{pattern:/linux/iu,label:`Linux`}],u=[{pattern:/edg\//iu,label:`Edge`},{pattern:/firefox\//iu,label:`Firefox`},{pattern:/chrome\/|crios\//iu,label:`Chrome`},{pattern:/safari\//iu,label:`Safari`}];function d(e){return{platform:l.find(t=>t.pattern.test(e))?.label,browser:u.find(t=>t.pattern.test(e))?.label}}function f(e){let{platform:t,browser:n}=d(e);return t!==void 0&&n!==void 0?`${t} · ${n}`:t??n??`paired device`}var p;function m(e,t){return p=e,()=>{p===e&&(p=void 0)}}function h(){return p?.()}var g=`po.client.device.v1`,_=`po.client.instance.v1`;async function v(e){let t={...e.initial},n=!0,r=new Set;try{await e.exclusive(async()=>{let n=e.parse(await e.read());if(n)t={...n,...t.instanceId?{instanceId:t.instanceId}:{}};else{let{instanceId:n,...r}=t;await e.write(r)}})}catch{n=!1}return{current:()=>({...t}),persistent:()=>n,subscribe(e){return r.add(e),()=>r.delete(e)},async updateName(i,a){let o=e.normalizeName(i);if(!o)throw Error(`Enter a device name from 1 to 64 characters.`);let s=a??Math.max(e.now(),t.nameUpdatedAt+1);if(!Number.isSafeInteger(s)||s<0)throw Error(`Invalid device name timestamp.`);if(s<t.nameUpdatedAt||s===t.nameUpdatedAt&&o===t.deviceName)return;let c=async()=>{let n=e.parse(await e.read());if(n&&n.deviceId===t.deviceId&&n.nameUpdatedAt>t.nameUpdatedAt&&(t={...t,deviceName:n.deviceName,nameUpdatedAt:n.nameUpdatedAt}),s<t.nameUpdatedAt||s===t.nameUpdatedAt&&o===t.deviceName)return;let r={...t,deviceName:o,nameUpdatedAt:s},{instanceId:i,...a}=r;await e.write(a),t=r};if(n)try{await e.exclusive(c)}catch{n=!1,t={...t,deviceName:o,nameUpdatedAt:s}}else t={...t,deviceName:o,nameUpdatedAt:s};for(let e of r)e()}}}async function y(e){let t=e.randomId(),n=!0;try{let n=e.sessionStorage.getItem(_);if(e.isToken(n)&&n&&await e.claimInstance(n))t=n;else if(!await e.claimInstance(t))throw Error(`The tab identity could not be claimed.`);e.sessionStorage.setItem(_,t)}catch{n=!1}let r=await v({...e,initial:{...e.initial,instanceId:t},read:async()=>{let t=e.localStorage.getItem(g);return t===null?void 0:JSON.parse(t)},write:async t=>e.localStorage.setItem(g,JSON.stringify(t)),exclusive:t=>e.exclusive(g,t)}),i=r.current(),a=new Set,o=()=>{for(let e of a)e()},s=r.subscribe(()=>{i=r.current(),o()}),c=e.onStorage(()=>{try{let t=e.localStorage.getItem(g),n=t===null?void 0:e.parse(JSON.parse(t));n&&n.deviceId===i.deviceId&&(n.nameUpdatedAt>i.nameUpdatedAt||n.nameUpdatedAt===i.nameUpdatedAt&&n.deviceName!==i.deviceName)&&(i={...i,deviceName:n.deviceName,nameUpdatedAt:n.nameUpdatedAt},o())}catch{n=!1}});return{current:()=>({...i}),persistent:()=>n&&r.persistent(),async updateName(t,n){await r.updateName(t,n??Math.max(e.now(),i.nameUpdatedAt+1))},subscribe(e){return a.add(e),()=>a.delete(e)},dispose(){c(),s(),a.clear()}}}function b(e,t){if(/[\\\\\u0000-\u0020]/u.test(e)||e.startsWith(`//`))return t;let n=typeof location>`u`?void 0:location,r=n?.origin??`https://po.invalid`;if(!n&&!e.startsWith(`/`))return t;let i=new URL(e,r);if(i.origin!==r||i.username||i.password||!/^\/(?:api(?:\/|$)|hosts\/[^/]+\/api(?:\/|$))/u.test(i.pathname)||/\/api\/web-plugins(?:\/|$)/u.test(i.pathname)||i.pathname.endsWith(`/api/remote/request`))return t;let a=h();if(!a)return t;let o=new Headers(t?.headers);return o.set(`x-po-client-metadata`,a),{...t,headers:o,redirect:`error`}}new TextEncoder,new TextDecoder;var x=new Map;function S(e){return{active:()=>x.get(e)?.active()??!1,async fetch(t,n){n?.signal?.throwIfAborted();let r=x.get(e);if(!r)throw Error(`The host transport is not connected.`);let i=C(t,e);return r.fetch(i.input,n)}}}function C(e,t){let n=t,r=e=>{let t=decodeURIComponent(e),r=t.indexOf(`/`);if(r<1)return e;let i=t.slice(0,r);if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu.test(i))return e;if(n!==void 0&&i!==n)throw Error(`The request spans different hosts.`);return n=i,encodeURIComponent(t.slice(r+1))},i=e.indexOf(`?`),a=(i===-1?e:e.slice(0,i)).replace(/(\/(?:workspaces|sessions)\/)([^/]+)/gu,(e,t,n)=>t+r(n)),o=i===-1?``:e.slice(i).replace(/([?&]session=)([^&]*)/gu,(e,t,n)=>t+r(n));return{hostId:n,input:a+o}}var w={active:()=>x.get(``)?.active()??!1,async fetch(e,t){t?.signal?.throwIfAborted();let n=C(e);if(n.hostId!==void 0)return S(n.hostId).fetch(n.input,t);let r=x.get(``);return r?r.fetch(e,t):fetch(e,b(e,t))}},T=`po-pwa`,E=`state`;function ee(e){return new Promise((t,n)=>{e.addEventListener(`success`,()=>t(e.result),{once:!0}),e.addEventListener(`error`,()=>n(e.error??Error(`The PWA database request failed.`)),{once:!0})})}function te(e){return new Promise((t,n)=>{e.addEventListener(`complete`,()=>t(),{once:!0}),e.addEventListener(`abort`,()=>n(e.error??Error(`The PWA transaction aborted.`)),{once:!0}),e.addEventListener(`error`,()=>n(e.error??Error(`The PWA transaction failed.`)),{once:!0})})}async function ne(){let e=indexedDB.open(T,1);return e.addEventListener(`upgradeneeded`,()=>{let t=e.result;t.objectStoreNames.contains(`state`)||t.createObjectStore(E)}),await ee(e)}async function re(e){let{instanceId:t,...n}=e,r=await ne();try{let e=r.transaction(E,`readwrite`,{durability:`strict`});e.objectStore(E).put(n,`client-device`),await te(e)}finally{r.close()}}var ie,ae;function oe(){return ie??=se()}async function se(){let e=window.poDesktop?.identity;if(e){let t=await e.read(),n=new Set;e.onChange(()=>{e.read().then(e=>{t=e;for(let e of n)e()})}),ae={current:()=>({...t.metadata}),persistent:()=>t.persistent,async updateName(r,i){t=await e.updateName(r,i);for(let e of n)e()},subscribe(e){return n.add(e),()=>n.delete(e)}}}else{let e=e=>({getItem:t=>window[e].getItem(t),setItem:(t,n)=>window[e].setItem(t,n)}),t=new Map;window.addEventListener(`pagehide`,e=>{if(!e.persisted)for(let e of t.values())e()}),ae=await y({initial:{version:1,deviceId:crypto.randomUUID(),clientKind:`web`,deviceName:f(navigator.userAgent),...d(navigator.userAgent),nameUpdatedAt:Date.now()},localStorage:e(`localStorage`),sessionStorage:e(`sessionStorage`),randomId:()=>crypto.randomUUID(),isToken:n,normalizeName:r,now:Date.now,parse(e){let t=c({preface:{poClient:e}});return t.status===`ok`?{...t.metadata,...d(navigator.userAgent)}:void 0},exclusive:(e,t)=>navigator.locks.request(e,t),claimInstance:e=>new Promise((n,r)=>{navigator.locks.request(`po.client.instance:${e}`,{ifAvailable:!0},async r=>{r?(await new Promise(r=>{t.set(e,r),n(!0)}),t.delete(e)):n(!1)}).catch(r)}),onStorage(e){return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)}})}let t=ae;return m(()=>s(t.current()),(e,n)=>t.updateName(e,n)),await re(t.current()).catch(()=>{}),t.subscribe(()=>{re(t.current()).catch(()=>{})}),t}function ce(e,t){var n=Object.setPrototypeOf;n?n(e,t):e.__proto__=t}function le(e,t){t===void 0&&(t=e.constructor);var n=Error.captureStackTrace;n&&n(e,t)}var ue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),de=function(e){ue(t,e);function t(t,n){var r=this.constructor,i=e.call(this,t,n)||this;return Object.defineProperty(i,"name",{value:r.name,enumerable:!1,configurable:!0}),ce(i,r.prototype),le(i),i}return t}(Error),fe=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),pe=function(e){fe(t,e);function t(t){t===void 0&&(t=void 0);var n=e.call(this,t)||this;return n.message=t,n}return t.prototype.getKind=function(){return this.constructor.kind},t.kind=`Exception`,t}(de),me=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),he=function(e){me(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.kind=`ArgumentException`,t}(pe),ge=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),D=function(e){ge(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.kind=`IllegalArgumentException`,t}(pe),_e=function(){function e(e){if(this.binarizer=e,e===null)throw new D(`Binarizer must be non-null.`)}return e.prototype.getWidth=function(){return this.binarizer.getWidth()},e.prototype.getHeight=function(){return this.binarizer.getHeight()},e.prototype.getBlackRow=function(e,t){return this.binarizer.getBlackRow(e,t)},e.prototype.getBlackMatrix=function(){return(this.matrix===null||this.matrix===void 0)&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},e.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},e.prototype.crop=function(t,n,r,i){var a=this.binarizer.getLuminanceSource().crop(t,n,r,i);return new e(this.binarizer.createBinarizer(a))},e.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},e.prototype.rotateCounterClockwise=function(){var t=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new e(this.binarizer.createBinarizer(t))},e.prototype.rotateCounterClockwise45=function(){var t=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new e(this.binarizer.createBinarizer(t))},e.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch{return``}},e}(),ve=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),O=function(e){ve(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.getChecksumInstance=function(){return new t},t.kind=`ChecksumException`,t}(pe),ye=function(){function e(e){this.source=e}return e.prototype.getLuminanceSource=function(){return this.source},e.prototype.getWidth=function(){return this.source.getWidth()},e.prototype.getHeight=function(){return this.source.getHeight()},e}(),k=function(){function e(){}return e.arraycopy=function(e,t,n,r,i){if(e===n&&t<r)for(r+=i-1,t+=i-1;i--;)n[r--]=e[t--];else for(;i--;)n[r++]=e[t++]},e.currentTimeMillis=function(){return Date.now()},e}(),be=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),xe=function(e){be(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.kind=`IndexOutOfBoundsException`,t}(pe),Se=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ce=function(e){Se(t,e);function t(t,n){t===void 0&&(t=void 0),n===void 0&&(n=void 0);var r=e.call(this,n)||this;return r.index=t,r.message=n,r}return t.kind=`ArrayIndexOutOfBoundsException`,t}(xe),we=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Te=function(){function e(){}return e.fill=function(e,t){for(var n=0,r=e.length;n<r;n++)e[n]=t},e.fillWithin=function(t,n,r,i){e.rangeCheck(t.length,n,r);for(var a=n;a<r;a++)t[a]=i},e.rangeCheck=function(e,t,n){if(t>n)throw new D(`fromIndex(`+t+`) > toIndex(`+n+`)`);if(t<0)throw new Ce(t);if(n>e)throw new Ce(n)},e.asList=function(){return[...arguments]},e.create=function(e,t,n){return Array.from({length:e}).map(function(e){return Array.from({length:t}).fill(n)})},e.createInt32Array=function(e,t,n){return Array.from({length:e}).map(function(e){return Int32Array.from({length:t}).fill(n)})},e.equals=function(e,t){if(!e||!t||!e.length||!t.length||e.length!==t.length)return!1;for(var n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0},e.hashCode=function(e){var t,n;if(e===null)return 0;var r=1;try{for(var i=we(e),a=i.next();!a.done;a=i.next()){var o=a.value;r=31*r+o}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},e.fillUint8Array=function(e,t){for(var n=0;n!==e.length;n++)e[n]=t},e.copyOf=function(e,t){return e.slice(0,t)},e.copyOfUint8Array=function(e,t){if(e.length<=t){var n=new Uint8Array(t);return n.set(e),n}return e.slice(0,t)},e.copyOfRange=function(e,t,n){var r=n-t,i=new Int32Array(r);return k.arraycopy(e,t,i,0,r),i},e.binarySearch=function(t,n,r){r===void 0&&(r=e.numberComparator);for(var i=0,a=t.length-1;i<=a;){var o=a+i>>1,s=r(n,t[o]);if(s>0)i=o+1;else if(s<0)a=o-1;else return o}return-i-1},e.numberComparator=function(e,t){return e-t},e}(),A=function(){function e(){}return e.numberOfTrailingZeros=function(e){var t;if(e===0)return 32;var n=31;return t=e<<16,t!==0&&(n-=16,e=t),t=e<<8,t!==0&&(n-=8,e=t),t=e<<4,t!==0&&(n-=4,e=t),t=e<<2,t!==0&&(n-=2,e=t),n-(e<<1>>>31)},e.numberOfLeadingZeros=function(e){if(e===0)return 32;var t=1;return e>>>16||(t+=16,e<<=16),e>>>24||(t+=8,e<<=8),e>>>28||(t+=4,e<<=4),e>>>30||(t+=2,e<<=2),t-=e>>>31,t},e.toHexString=function(e){return e.toString(16)},e.toBinaryString=function(e){return String(parseInt(String(e),2))},e.bitCount=function(e){return e-=e>>>1&1431655765,e=(e&858993459)+(e>>>2&858993459),e=e+(e>>>4)&252645135,e+=e>>>8,e+=e>>>16,e&63},e.truncDivision=function(e,t){return Math.trunc(e/t)},e.parseInt=function(e,t){return t===void 0&&(t=void 0),parseInt(e,t)},e.MIN_VALUE_32_BITS=-2147483648,e.MAX_VALUE=2**53-1,e}(),Ee=function(){function e(t,n){t===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=t,this.bits=n??e.makeArray(t))}return e.prototype.getSize=function(){return this.size},e.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},e.prototype.ensureCapacity=function(t){if(t>this.bits.length*32){var n=e.makeArray(t);k.arraycopy(this.bits,0,n,0,this.bits.length),this.bits=n}},e.prototype.get=function(e){return!!(this.bits[Math.floor(e/32)]&1<<(e&31))},e.prototype.set=function(e){this.bits[Math.floor(e/32)]|=1<<(e&31)},e.prototype.flip=function(e){this.bits[Math.floor(e/32)]^=1<<(e&31)},e.prototype.getNextSet=function(e){var t=this.size;if(e>=t)return t;var n=this.bits,r=Math.floor(e/32),i=n[r];i&=~((1<<(e&31))-1);for(var a=n.length;i===0;){if(++r===a)return t;i=n[r]}var o=r*32+A.numberOfTrailingZeros(i);return o>t?t:o},e.prototype.getNextUnset=function(e){var t=this.size;if(e>=t)return t;var n=this.bits,r=Math.floor(e/32),i=~n[r];i&=~((1<<(e&31))-1);for(var a=n.length;i===0;){if(++r===a)return t;i=~n[r]}var o=r*32+A.numberOfTrailingZeros(i);return o>t?t:o},e.prototype.setBulk=function(e,t){this.bits[Math.floor(e/32)]=t},e.prototype.setRange=function(e,t){if(t<e||e<0||t>this.size)throw new D;if(t!==e){t--;for(var n=Math.floor(e/32),r=Math.floor(t/32),i=this.bits,a=n;a<=r;a++){var o=a>n?0:e&31,s=(2<<(a<r?31:t&31))-(1<<o);i[a]|=s}}},e.prototype.clear=function(){for(var e=this.bits.length,t=this.bits,n=0;n<e;n++)t[n]=0},e.prototype.isRange=function(e,t,n){if(t<e||e<0||t>this.size)throw new D;if(t===e)return!0;t--;for(var r=Math.floor(e/32),i=Math.floor(t/32),a=this.bits,o=r;o<=i;o++){var s=o>r?0:e&31,c=(2<<(o<i?31:t&31))-(1<<s)|0;if((a[o]&c)!==(n?c:0))return!1}return!0},e.prototype.appendBit=function(e){this.ensureCapacity(this.size+1),e&&(this.bits[Math.floor(this.size/32)]|=1<<(this.size&31)),this.size++},e.prototype.appendBits=function(e,t){if(t<0||t>32)throw new D(`Num bits must be between 0 and 32`);this.ensureCapacity(this.size+t);for(var n=t;n>0;n--)this.appendBit((e>>n-1&1)==1)},e.prototype.appendBitArray=function(e){var t=e.size;this.ensureCapacity(this.size+t);for(var n=0;n<t;n++)this.appendBit(e.get(n))},e.prototype.xor=function(e){if(this.size!==e.size)throw new D(`Sizes don't match`);for(var t=this.bits,n=0,r=t.length;n<r;n++)t[n]^=e.bits[n]},e.prototype.toBytes=function(e,t,n,r){for(var i=0;i<r;i++){for(var a=0,o=0;o<8;o++)this.get(e)&&(a|=1<<7-o),e++;t[n+i]=a}},e.prototype.getBitArray=function(){return this.bits},e.prototype.reverse=function(){for(var e=new Int32Array(this.bits.length),t=Math.floor((this.size-1)/32),n=t+1,r=this.bits,i=0;i<n;i++){var a=r[i];a=a>>1&1431655765|(a&1431655765)<<1,a=a>>2&858993459|(a&858993459)<<2,a=a>>4&252645135|(a&252645135)<<4,a=a>>8&16711935|(a&16711935)<<8,a=a>>16&65535|(a&65535)<<16,e[t-i]=a}if(this.size!==n*32){for(var o=n*32-this.size,s=e[0]>>>o,i=1;i<n;i++){var c=e[i];s|=c<<32-o,e[i-1]=s,s=c>>>o}e[n-1]=s}this.bits=e},e.makeArray=function(e){return new Int32Array(Math.floor((e+31)/32))},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.size===n.size&&Te.equals(this.bits,n.bits)},e.prototype.hashCode=function(){return 31*this.size+Te.hashCode(this.bits)},e.prototype.toString=function(){for(var e=``,t=0,n=this.size;t<n;t++)t&7||(e+=` `),e+=this.get(t)?`X`:`.`;return e},e.prototype.clone=function(){return new e(this.size,this.bits.slice())},e.prototype.toArray=function(){for(var e=[],t=0,n=this.size;t<n;t++)e.push(this.get(t));return e},e}(),De;(function(e){e[e.OTHER=0]=`OTHER`,e[e.PURE_BARCODE=1]=`PURE_BARCODE`,e[e.POSSIBLE_FORMATS=2]=`POSSIBLE_FORMATS`,e[e.TRY_HARDER=3]=`TRY_HARDER`,e[e.CHARACTER_SET=4]=`CHARACTER_SET`,e[e.ALLOWED_LENGTHS=5]=`ALLOWED_LENGTHS`,e[e.ASSUME_CODE_39_CHECK_DIGIT=6]=`ASSUME_CODE_39_CHECK_DIGIT`,e[e.ENABLE_CODE_39_EXTENDED_MODE=7]=`ENABLE_CODE_39_EXTENDED_MODE`,e[e.ASSUME_GS1=8]=`ASSUME_GS1`,e[e.RETURN_CODABAR_START_END=9]=`RETURN_CODABAR_START_END`,e[e.NEED_RESULT_POINT_CALLBACK=10]=`NEED_RESULT_POINT_CALLBACK`,e[e.ALLOWED_EAN_EXTENSIONS=11]=`ALLOWED_EAN_EXTENSIONS`})(De||={});var j=De,Oe=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),M=function(e){Oe(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.getFormatInstance=function(){return new t},t.kind=`FormatException`,t}(pe),ke=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},N;(function(e){e[e.Cp437=0]=`Cp437`,e[e.ISO8859_1=1]=`ISO8859_1`,e[e.ISO8859_2=2]=`ISO8859_2`,e[e.ISO8859_3=3]=`ISO8859_3`,e[e.ISO8859_4=4]=`ISO8859_4`,e[e.ISO8859_5=5]=`ISO8859_5`,e[e.ISO8859_6=6]=`ISO8859_6`,e[e.ISO8859_7=7]=`ISO8859_7`,e[e.ISO8859_8=8]=`ISO8859_8`,e[e.ISO8859_9=9]=`ISO8859_9`,e[e.ISO8859_10=10]=`ISO8859_10`,e[e.ISO8859_11=11]=`ISO8859_11`,e[e.ISO8859_13=12]=`ISO8859_13`,e[e.ISO8859_14=13]=`ISO8859_14`,e[e.ISO8859_15=14]=`ISO8859_15`,e[e.ISO8859_16=15]=`ISO8859_16`,e[e.SJIS=16]=`SJIS`,e[e.Cp1250=17]=`Cp1250`,e[e.Cp1251=18]=`Cp1251`,e[e.Cp1252=19]=`Cp1252`,e[e.Cp1256=20]=`Cp1256`,e[e.UnicodeBigUnmarked=21]=`UnicodeBigUnmarked`,e[e.UTF8=22]=`UTF8`,e[e.ASCII=23]=`ASCII`,e[e.Big5=24]=`Big5`,e[e.GB18030=25]=`GB18030`,e[e.EUC_KR=26]=`EUC_KR`})(N||={});var Ae=function(){function e(t,n,r){for(var i,a,o=[],s=3;s<arguments.length;s++)o[s-3]=arguments[s];this.valueIdentifier=t,this.name=r,this.values=typeof n==`number`?Int32Array.from([n]):n,this.otherEncodingNames=o,e.VALUE_IDENTIFIER_TO_ECI.set(t,this),e.NAME_TO_ECI.set(r,this);for(var c=this.values,l=0,u=c.length;l!==u;l++){var d=c[l];e.VALUES_TO_ECI.set(d,this)}try{for(var f=ke(o),p=f.next();!p.done;p=f.next()){var m=p.value;e.NAME_TO_ECI.set(m,this)}}catch(e){i={error:e}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}}return e.prototype.getValueIdentifier=function(){return this.valueIdentifier},e.prototype.getName=function(){return this.name},e.prototype.getValue=function(){return this.values[0]},e.getCharacterSetECIByValue=function(t){if(t<0||t>=900)throw new M(`incorect value`);var n=e.VALUES_TO_ECI.get(t);if(n===void 0)throw new M(`incorect value`);return n},e.getCharacterSetECIByName=function(t){var n=e.NAME_TO_ECI.get(t);if(n===void 0)throw new M(`incorect value`);return n},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.getName()===n.getName()},e.VALUE_IDENTIFIER_TO_ECI=new Map,e.VALUES_TO_ECI=new Map,e.NAME_TO_ECI=new Map,e.Cp437=new e(N.Cp437,Int32Array.from([0,2]),`Cp437`),e.ISO8859_1=new e(N.ISO8859_1,Int32Array.from([1,3]),`ISO-8859-1`,`ISO88591`,`ISO8859_1`),e.ISO8859_2=new e(N.ISO8859_2,4,`ISO-8859-2`,`ISO88592`,`ISO8859_2`),e.ISO8859_3=new e(N.ISO8859_3,5,`ISO-8859-3`,`ISO88593`,`ISO8859_3`),e.ISO8859_4=new e(N.ISO8859_4,6,`ISO-8859-4`,`ISO88594`,`ISO8859_4`),e.ISO8859_5=new e(N.ISO8859_5,7,`ISO-8859-5`,`ISO88595`,`ISO8859_5`),e.ISO8859_6=new e(N.ISO8859_6,8,`ISO-8859-6`,`ISO88596`,`ISO8859_6`),e.ISO8859_7=new e(N.ISO8859_7,9,`ISO-8859-7`,`ISO88597`,`ISO8859_7`),e.ISO8859_8=new e(N.ISO8859_8,10,`ISO-8859-8`,`ISO88598`,`ISO8859_8`),e.ISO8859_9=new e(N.ISO8859_9,11,`ISO-8859-9`,`ISO88599`,`ISO8859_9`),e.ISO8859_10=new e(N.ISO8859_10,12,`ISO-8859-10`,`ISO885910`,`ISO8859_10`),e.ISO8859_11=new e(N.ISO8859_11,13,`ISO-8859-11`,`ISO885911`,`ISO8859_11`),e.ISO8859_13=new e(N.ISO8859_13,15,`ISO-8859-13`,`ISO885913`,`ISO8859_13`),e.ISO8859_14=new e(N.ISO8859_14,16,`ISO-8859-14`,`ISO885914`,`ISO8859_14`),e.ISO8859_15=new e(N.ISO8859_15,17,`ISO-8859-15`,`ISO885915`,`ISO8859_15`),e.ISO8859_16=new e(N.ISO8859_16,18,`ISO-8859-16`,`ISO885916`,`ISO8859_16`),e.SJIS=new e(N.SJIS,20,`SJIS`,`Shift_JIS`),e.Cp1250=new e(N.Cp1250,21,`Cp1250`,`windows-1250`),e.Cp1251=new e(N.Cp1251,22,`Cp1251`,`windows-1251`),e.Cp1252=new e(N.Cp1252,23,`Cp1252`,`windows-1252`),e.Cp1256=new e(N.Cp1256,24,`Cp1256`,`windows-1256`),e.UnicodeBigUnmarked=new e(N.UnicodeBigUnmarked,25,`UnicodeBigUnmarked`,`UTF-16BE`,`UnicodeBig`),e.UTF8=new e(N.UTF8,26,`UTF8`,`UTF-8`),e.ASCII=new e(N.ASCII,Int32Array.from([27,170]),`ASCII`,`US-ASCII`),e.Big5=new e(N.Big5,28,`Big5`),e.GB18030=new e(N.GB18030,29,`GB18030`,`GB2312`,`EUC_CN`,`GBK`),e.EUC_KR=new e(N.EUC_KR,30,`EUC_KR`,`EUC-KR`),e}(),je=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Me=function(e){je(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.kind=`UnsupportedOperationException`,t}(pe),Ne=function(){function e(){}return e.decode=function(e,t){var n=this.encodingName(t);return this.customDecoder?this.customDecoder(e,n):typeof TextDecoder>`u`||this.shouldDecodeOnFallback(n)?this.decodeFallback(e,n):new TextDecoder(n).decode(e)},e.shouldDecodeOnFallback=function(e){return!1},e.encode=function(e,t){var n=this.encodingName(t);return this.customEncoder?this.customEncoder(e,n):typeof TextEncoder>`u`?this.encodeFallback(e):new TextEncoder().encode(e)},e.isBrowser=function(){return typeof window<`u`&&{}.toString.call(window)===`[object Window]`},e.encodingName=function(e){return typeof e==`string`?e:e.getName()},e.encodingCharacterSet=function(e){return e instanceof Ae?e:Ae.getCharacterSetECIByName(e)},e.decodeFallback=function(t,n){var r=this.encodingCharacterSet(n);if(e.isDecodeFallbackSupported(r)){for(var i=``,a=0,o=t.length;a<o;a++){var s=t[a].toString(16);s.length<2&&(s=`0`+s),i+=`%`+s}return decodeURIComponent(i)}if(r.equals(Ae.UnicodeBigUnmarked))return String.fromCharCode.apply(null,Array.from(new Uint16Array(t.buffer)));throw new Me(`Encoding ${this.encodingName(n)} not supported by fallback.`)},e.isDecodeFallbackSupported=function(e){return e.equals(Ae.UTF8)||e.equals(Ae.ISO8859_1)||e.equals(Ae.ASCII)},e.encodeFallback=function(e){for(var t=btoa(unescape(encodeURIComponent(e))).split(``),n=[],r=0;r<t.length;r++)n.push(t[r].charCodeAt(0));return new Uint8Array(n)},e}(),P=function(){function e(){}return e.castAsNonUtf8Char=function(e,t){t===void 0&&(t=null);var n=t?t.getName():this.ISO88591;return Ne.decode(new Uint8Array([e]),n)},e.guessEncoding=function(t,n){if(n!=null&&n.get(j.CHARACTER_SET)!==void 0)return n.get(j.CHARACTER_SET).toString();for(var r=t.length,i=!0,a=!0,o=!0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=t.length>3&&t[0]===239&&t[1]===187&&t[2]===191,y=0;y<r&&(i||a||o);y++){var b=t[y]&255;o&&(s>0?b&128?s--:o=!1:b&128&&(b&64?(s++,b&32?(s++,b&16?(s++,b&8?o=!1:u++):l++):c++):o=!1)),i&&(b>127&&b<160?i=!1:b>159&&(b<192||b===215||b===247)&&_++),a&&(d>0?b<64||b===127||b>252?a=!1:d--:b===128||b===160||b>239?a=!1:b>160&&b<224?(f++,m=0,p++,p>h&&(h=p)):b>127?(d++,p=0,m++,m>g&&(g=m)):(p=0,m=0))}return o&&s>0&&(o=!1),a&&d>0&&(a=!1),o&&(v||c+l+u>0)?e.UTF8:a&&(e.ASSUME_SHIFT_JIS||h>=3||g>=3)?e.SHIFT_JIS:i&&a?h===2&&f===2||_*10>=r?e.SHIFT_JIS:e.ISO88591:i?e.ISO88591:a?e.SHIFT_JIS:o?e.UTF8:e.PLATFORM_DEFAULT_ENCODING},e.format=function(e){var t=[...arguments].slice(1),n=-1;function r(e,r,i,a,o,s){if(e===`%%`)return`%`;if(t[++n]!==void 0){e=a?parseInt(a.substr(1)):void 0;var c=o?parseInt(o.substr(1)):void 0,l;switch(s){case`s`:l=t[n];break;case`c`:l=t[n][0];break;case`f`:l=parseFloat(t[n]).toFixed(e);break;case`p`:l=parseFloat(t[n]).toPrecision(e);break;case`e`:l=parseFloat(t[n]).toExponential(e);break;case`x`:l=parseInt(t[n]).toString(c||16);break;case`d`:l=parseFloat(parseInt(t[n],c||10).toPrecision(e)).toFixed(0)}l=typeof l==`object`?JSON.stringify(l):(+l).toString(c);for(var u=parseInt(i),d=i&&i[0]+``==`0`?`0`:` `;l.length<u;)l=r===void 0?d+l:l+d;return l}}return e.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,r)},e.getBytes=function(e,t){return Ne.encode(e,t)},e.getCharCode=function(e,t){return t===void 0&&(t=0),e.charCodeAt(t)},e.getCharAt=function(e){return String.fromCharCode(e)},e.SHIFT_JIS=Ae.SJIS.getName(),e.GB2312=`GB2312`,e.ISO88591=Ae.ISO8859_1.getName(),e.EUC_JP=`EUC_JP`,e.UTF8=Ae.UTF8.getName(),e.PLATFORM_DEFAULT_ENCODING=e.UTF8,e.ASSUME_SHIFT_JIS=!1,e}(),F=function(){function e(e){e===void 0&&(e=``),this.value=e}return e.prototype.enableDecoding=function(e){return this.encoding=e,this},e.prototype.append=function(e){return typeof e==`string`?this.value+=e.toString():this.encoding?this.value+=P.castAsNonUtf8Char(e,this.encoding):this.value+=String.fromCharCode(e),this},e.prototype.appendChars=function(e,t,n){for(var r=t;t<t+n;r++)this.append(e[r]);return this},e.prototype.length=function(){return this.value.length},e.prototype.charAt=function(e){return this.value.charAt(e)},e.prototype.deleteCharAt=function(e){this.value=this.value.substr(0,e)+this.value.substring(e+1)},e.prototype.setCharAt=function(e,t){this.value=this.value.substr(0,e)+t+this.value.substr(e+1)},e.prototype.substring=function(e,t){return this.value.substring(e,t)},e.prototype.setLengthToZero=function(){this.value=``},e.prototype.toString=function(){return this.value},e.prototype.insert=function(e,t){this.value=this.value.substring(0,e)+t+this.value.substring(e)},e}(),Pe=function(){function e(e,t,n,r){if(this.width=e,this.height=t,this.rowSize=n,this.bits=r,t??=e,this.height=t,e<1||t<1)throw new D(`Both dimensions must be greater than 0`);n??=e+31>>5,this.rowSize=n,r??(this.bits=new Int32Array(this.rowSize*this.height))}return e.parseFromBooleanArray=function(t){for(var n=t.length,r=t[0].length,i=new e(r,n),a=0;a<n;a++)for(var o=t[a],s=0;s<r;s++)o[s]&&i.set(s,a);return i},e.parseFromString=function(t,n,r){if(t===null)throw new D(`stringRepresentation cannot be null`);for(var i=Array(t.length),a=0,o=0,s=-1,c=0,l=0;l<t.length;)if(t.charAt(l)===`
2
+ `||t.charAt(l)===`\r`){if(a>o){if(s===-1)s=a-o;else if(a-o!==s)throw new D(`row lengths do not match`);o=a,c++}l++}else if(t.substring(l,l+n.length)===n)l+=n.length,i[a]=!0,a++;else if(t.substring(l,l+r.length)===r)l+=r.length,i[a]=!1,a++;else throw new D(`illegal character encountered: `+t.substring(l));if(a>o){if(s===-1)s=a-o;else if(a-o!==s)throw new D(`row lengths do not match`);c++}for(var u=new e(s,c),d=0;d<a;d++)i[d]&&u.set(Math.floor(d%s),Math.floor(d/s));return u},e.prototype.get=function(e,t){var n=t*this.rowSize+(e>>5);return!!(this.bits[n]>>>(e&31)&1)},e.prototype.set=function(e,t){var n=t*this.rowSize+(e>>5);this.bits[n]|=1<<(e&31)},e.prototype.unset=function(e,t){var n=t*this.rowSize+(e>>5);this.bits[n]&=~(1<<(e&31))},e.prototype.flip=function(e,t){var n=t*this.rowSize+(e>>5);this.bits[n]^=1<<(e&31)},e.prototype.xor=function(e){if(this.width!==e.getWidth()||this.height!==e.getHeight()||this.rowSize!==e.getRowSize())throw new D(`input matrix dimensions do not match`);for(var t=new Ee((this.width>>5)+1),n=this.rowSize,r=this.bits,i=0,a=this.height;i<a;i++)for(var o=i*n,s=e.getRow(i,t).getBitArray(),c=0;c<n;c++)r[o+c]^=s[c]},e.prototype.clear=function(){this.bits.fill(0)},e.prototype.setRegion=function(e,t,n,r){if(t<0||e<0)throw new D(`Left and top must be nonnegative`);if(r<1||n<1)throw new D(`Height and width must be at least 1`);var i=e+n,a=t+r;if(a>this.height||i>this.width)throw new D(`The region must fit inside the matrix`);for(var o=this.rowSize,s=this.bits,c=t;c<a;c++)for(var l=c*o,u=e;u<i;u++)s[l+(u>>5)]|=1<<(u&31)},e.prototype.getRow=function(e,t){t==null||t.getSize()<this.width?t=new Ee(this.width):t.clear();for(var n=this.rowSize,r=this.bits,i=e*n,a=0;a<n;a++)t.setBulk(a*32,r[i+a]);return t},e.prototype.setRow=function(e,t){k.arraycopy(t.getBitArray(),0,this.bits,e*this.rowSize,this.rowSize)},e.prototype.rotate180=function(){for(var e=this.getWidth(),t=this.getHeight(),n=new Ee(e),r=new Ee(e),i=0,a=Math.floor((t+1)/2);i<a;i++)n=this.getRow(i,n),r=this.getRow(t-1-i,r),n.reverse(),r.reverse(),this.setRow(i,r),this.setRow(t-1-i,n)},e.prototype.getEnclosingRectangle=function(){for(var e=this.width,t=this.height,n=this.rowSize,r=this.bits,i=e,a=t,o=-1,s=-1,c=0;c<t;c++)for(var l=0;l<n;l++){var u=r[c*n+l];if(u!==0){if(c<a&&(a=c),c>s&&(s=c),l*32<i){for(var d=0;!(u<<31-d);)d++;l*32+d<i&&(i=l*32+d)}if(l*32+31>o){for(var d=31;!(u>>>d);)d--;l*32+d>o&&(o=l*32+d)}}}return o<i||s<a?null:Int32Array.from([i,a,o-i+1,s-a+1])},e.prototype.getTopLeftOnBit=function(){for(var e=this.rowSize,t=this.bits,n=0;n<t.length&&t[n]===0;)n++;if(n===t.length)return null;for(var r=n/e,i=n%e*32,a=t[n],o=0;!(a<<31-o);)o++;return i+=o,Int32Array.from([i,r])},e.prototype.getBottomRightOnBit=function(){for(var e=this.rowSize,t=this.bits,n=t.length-1;n>=0&&t[n]===0;)n--;if(n<0)return null;for(var r=Math.floor(n/e),i=Math.floor(n%e)*32,a=t[n],o=31;!(a>>>o);)o--;return i+=o,Int32Array.from([i,r])},e.prototype.getWidth=function(){return this.width},e.prototype.getHeight=function(){return this.height},e.prototype.getRowSize=function(){return this.rowSize},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.width===n.width&&this.height===n.height&&this.rowSize===n.rowSize&&Te.equals(this.bits,n.bits)},e.prototype.hashCode=function(){var e=this.width;return e=31*e+this.width,e=31*e+this.height,e=31*e+this.rowSize,e=31*e+Te.hashCode(this.bits),e},e.prototype.toString=function(e,t,n){return e===void 0&&(e=`X `),t===void 0&&(t=` `),n===void 0&&(n=`
3
+ `),this.buildToString(e,t,n)},e.prototype.buildToString=function(e,t,n){for(var r=new F,i=0,a=this.height;i<a;i++){for(var o=0,s=this.width;o<s;o++)r.append(this.get(o,i)?e:t);r.append(n)}return r.toString()},e.prototype.clone=function(){return new e(this.width,this.height,this.rowSize,this.bits.slice())},e}(),Fe=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),I=function(e){Fe(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.getNotFoundInstance=function(){return new t},t.kind=`NotFoundException`,t}(pe),Ie=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Le=function(e){Ie(t,e);function t(n){var r=e.call(this,n)||this;return r.luminances=t.EMPTY,r.buckets=new Int32Array(t.LUMINANCE_BUCKETS),r}return t.prototype.getBlackRow=function(e,n){var r=this.getLuminanceSource(),i=r.getWidth();n==null||n.getSize()<i?n=new Ee(i):n.clear(),this.initArrays(i);for(var a=r.getRow(e,this.luminances),o=this.buckets,s=0;s<i;s++)o[(a[s]&255)>>t.LUMINANCE_SHIFT]++;var c=t.estimateBlackPoint(o);if(i<3)for(var s=0;s<i;s++)(a[s]&255)<c&&n.set(s);else for(var l=a[0]&255,u=a[1]&255,s=1;s<i-1;s++){var d=a[s+1]&255;(u*4-l-d)/2<c&&n.set(s),l=u,u=d}return n},t.prototype.getBlackMatrix=function(){var e=this.getLuminanceSource(),n=e.getWidth(),r=e.getHeight(),i=new Pe(n,r);this.initArrays(n);for(var a=this.buckets,o=1;o<5;o++)for(var s=Math.floor(r*o/5),c=e.getRow(s,this.luminances),l=Math.floor(n*4/5),u=Math.floor(n/5);u<l;u++){var d=c[u]&255;a[d>>t.LUMINANCE_SHIFT]++}for(var f=t.estimateBlackPoint(a),p=e.getMatrix(),o=0;o<r;o++)for(var m=o*n,u=0;u<n;u++){var d=p[m+u]&255;d<f&&i.set(u,o)}return i},t.prototype.createBinarizer=function(e){return new t(e)},t.prototype.initArrays=function(e){this.luminances.length<e&&(this.luminances=new Uint8ClampedArray(e)),this.buckets.fill(0)},t.estimateBlackPoint=function(e){for(var n=e.length,r=0,i=0,a=0,o=0;o<n;o++)e[o]>a&&(i=o,a=e[o]),e[o]>r&&(r=e[o]);for(var s=0,c=0,o=0;o<n;o++){var l=o-i,u=e[o]*l*l;u>c&&(s=o,c=u)}if(i>s){var d=i;i=s,s=d}if(s-i<=n/16)throw new I;for(var f=s-1,p=-1,o=s-1;o>i;o--){var m=o-i,u=m*m*(s-o)*(r-e[o]);u>p&&(f=o,p=u)}return f<<t.LUMINANCE_SHIFT},t.LUMINANCE_BITS=5,t.LUMINANCE_SHIFT=8-t.LUMINANCE_BITS,t.LUMINANCE_BUCKETS=1<<t.LUMINANCE_BITS,t.EMPTY=Uint8ClampedArray.from([0]),t}(ye),Re=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ze=function(e){Re(t,e);function t(t){var n=e.call(this,t)||this;return n.matrix=null,n}return t.prototype.getBlackMatrix=function(){if(this.matrix!==null)return this.matrix;var n=this.getLuminanceSource(),r=n.getWidth(),i=n.getHeight();if(r>=t.MINIMUM_DIMENSION&&i>=t.MINIMUM_DIMENSION){var a=n.getMatrix(),o=r>>t.BLOCK_SIZE_POWER;(r&t.BLOCK_SIZE_MASK)!==0&&o++;var s=i>>t.BLOCK_SIZE_POWER;(i&t.BLOCK_SIZE_MASK)!==0&&s++;var c=t.calculateBlackPoints(a,o,s,r,i),l=new Pe(r,i);t.calculateThresholdForBlock(a,o,s,r,i,c,l),this.matrix=l}else this.matrix=e.prototype.getBlackMatrix.call(this);return this.matrix},t.prototype.createBinarizer=function(e){return new t(e)},t.calculateThresholdForBlock=function(e,n,r,i,a,o,s){for(var c=a-t.BLOCK_SIZE,l=i-t.BLOCK_SIZE,u=0;u<r;u++){var d=u<<t.BLOCK_SIZE_POWER;d>c&&(d=c);for(var f=t.cap(u,2,r-3),p=0;p<n;p++){var m=p<<t.BLOCK_SIZE_POWER;m>l&&(m=l);for(var h=t.cap(p,2,n-3),g=0,_=-2;_<=2;_++){var v=o[f+_];g+=v[h-2]+v[h-1]+v[h]+v[h+1]+v[h+2]}var y=g/25;t.thresholdBlock(e,m,d,y,i,s)}}},t.cap=function(e,t,n){return e<t?t:e>n?n:e},t.thresholdBlock=function(e,n,r,i,a,o){for(var s=0,c=r*a+n;s<t.BLOCK_SIZE;s++,c+=a)for(var l=0;l<t.BLOCK_SIZE;l++)(e[c+l]&255)<=i&&o.set(n+l,r+s)},t.calculateBlackPoints=function(e,n,r,i,a){for(var o=a-t.BLOCK_SIZE,s=i-t.BLOCK_SIZE,c=Array(r),l=0;l<r;l++){c[l]=new Int32Array(n);var u=l<<t.BLOCK_SIZE_POWER;u>o&&(u=o);for(var d=0;d<n;d++){var f=d<<t.BLOCK_SIZE_POWER;f>s&&(f=s);for(var p=0,m=255,h=0,g=0,_=u*i+f;g<t.BLOCK_SIZE;g++,_+=i){for(var v=0;v<t.BLOCK_SIZE;v++){var y=e[_+v]&255;p+=y,y<m&&(m=y),y>h&&(h=y)}if(h-m>t.MIN_DYNAMIC_RANGE)for(g++,_+=i;g<t.BLOCK_SIZE;g++,_+=i)for(var v=0;v<t.BLOCK_SIZE;v++)p+=e[_+v]&255}var b=p>>t.BLOCK_SIZE_POWER*2;if(h-m<=t.MIN_DYNAMIC_RANGE&&(b=m/2,l>0&&d>0)){var x=(c[l-1][d]+2*c[l][d-1]+c[l-1][d-1])/4;m<x&&(b=x)}c[l][d]=b}}return c},t.BLOCK_SIZE_POWER=3,t.BLOCK_SIZE=1<<t.BLOCK_SIZE_POWER,t.BLOCK_SIZE_MASK=t.BLOCK_SIZE-1,t.MINIMUM_DIMENSION=t.BLOCK_SIZE*5,t.MIN_DYNAMIC_RANGE=24,t}(Le),Be=function(){function e(e,t){this.width=e,this.height=t}return e.prototype.getWidth=function(){return this.width},e.prototype.getHeight=function(){return this.height},e.prototype.isCropSupported=function(){return!1},e.prototype.crop=function(e,t,n,r){throw new Me(`This luminance source does not support cropping.`)},e.prototype.isRotateSupported=function(){return!1},e.prototype.rotateCounterClockwise=function(){throw new Me(`This luminance source does not support rotation by 90 degrees.`)},e.prototype.rotateCounterClockwise45=function(){throw new Me(`This luminance source does not support rotation by 45 degrees.`)},e.prototype.toString=function(){for(var e=new Uint8ClampedArray(this.width),t=new F,n=0;n<this.height;n++){for(var r=this.getRow(n,e),i=0;i<this.width;i++){var a=r[i]&255,o=void 0;o=a<64?`#`:a<128?`+`:a<192?`.`:` `,t.append(o)}t.append(`
4
+ `)}return t.toString()},e}(),Ve=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),He=function(e){Ve(t,e);function t(t){var n=e.call(this,t.getWidth(),t.getHeight())||this;return n.delegate=t,n}return t.prototype.getRow=function(e,t){for(var n=this.delegate.getRow(e,t),r=this.getWidth(),i=0;i<r;i++)n[i]=255-(n[i]&255);return n},t.prototype.getMatrix=function(){for(var e=this.delegate.getMatrix(),t=this.getWidth()*this.getHeight(),n=new Uint8ClampedArray(t),r=0;r<t;r++)n[r]=255-(e[r]&255);return n},t.prototype.isCropSupported=function(){return this.delegate.isCropSupported()},t.prototype.crop=function(e,n,r,i){return new t(this.delegate.crop(e,n,r,i))},t.prototype.isRotateSupported=function(){return this.delegate.isRotateSupported()},t.prototype.invert=function(){return this.delegate},t.prototype.rotateCounterClockwise=function(){return new t(this.delegate.rotateCounterClockwise())},t.prototype.rotateCounterClockwise45=function(){return new t(this.delegate.rotateCounterClockwise45())},t}(Be),Ue=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),We=function(e){Ue(t,e);function t(n,r,i){r===void 0&&(r=!1);var a=e.call(this,n.width,n.height)||this;return a.canvas=n,a.tempCanvasElement=null,a.buffer=t.makeBufferFromCanvasImageData(n,r,i),a}return t.makeBufferFromCanvasImageData=function(e,n,r){n===void 0&&(n=!1);var i=e.getContext(`2d`).getImageData(0,0,e.width,e.height);return t.toGrayscaleBuffer(i.data,e.width,e.height,n,r)},t.toGrayscaleBuffer=function(e,n,r,i,a){i===void 0&&(i=!1);var o=n*r,s=a&&a.length>=o?a:new Uint8ClampedArray(o);t.FRAME_INDEX=!t.FRAME_INDEX;for(var c=!t.FRAME_INDEX&&i?255:0,l=0,u=0,d=e.length;l<d;l+=4,u++){var f=void 0;if(e[l+3]===0)f=255;else{var p=e[l],m=e[l+1],h=e[l+2];f=306*p+601*m+117*h+512>>10}s[u]=f^c}return s},t.prototype.getRow=function(e,t){if(e<0||e>=this.getHeight())throw new D(`Requested row is outside the image: `+e);var n=this.getWidth(),r=e*n;return t===null?t=this.buffer.slice(r,r+n):(t.length<n&&(t=new Uint8ClampedArray(n)),t.set(this.buffer.subarray(r,r+n))),t},t.prototype.getMatrix=function(){return this.buffer},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(t,n,r,i){return e.prototype.crop.call(this,t,n,r,i),this},t.prototype.isRotateSupported=function(){return!0},t.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},t.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},t.prototype.getTempCanvasElement=function(){if(this.tempCanvasElement===null){var e=this.canvas.ownerDocument.createElement(`canvas`);e.width=this.canvas.width,e.height=this.canvas.height,this.tempCanvasElement=e}return this.tempCanvasElement},t.prototype.rotate=function(e){var n=this.getTempCanvasElement(),r=n.getContext(`2d`),i=e*t.DEGREE_TO_RADIANS,a=this.canvas.width,o=this.canvas.height,s=Math.ceil(Math.abs(Math.cos(i))*a+Math.abs(Math.sin(i))*o),c=Math.ceil(Math.abs(Math.sin(i))*a+Math.abs(Math.cos(i))*o);return n.width=s,n.height=c,r.translate(s/2,c/2),r.rotate(i),r.drawImage(this.canvas,a/-2,o/-2),this.buffer=t.makeBufferFromCanvasImageData(n),this},t.prototype.invert=function(){return new He(this)},t.DEGREE_TO_RADIANS=Math.PI/180,t.FRAME_INDEX=!0,t}(Be),Ge=function(){function e(e,t,n){this.deviceId=e,this.label=t,this.kind=`videoinput`,this.groupId=n||void 0}return e.prototype.toJSON=function(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}},e}(),Ke=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},qe=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}},Je=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Ye=function(){function e(e,t,n){t===void 0&&(t=500),this.reader=e,this.timeBetweenScansMillis=t,this._hints=n,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(e.prototype,"hasNavigator",{get:function(){return typeof navigator<`u`},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canEnumerateDevices",{get:function(){return!!(this.isMediaDevicesSuported&&navigator.mediaDevices.enumerateDevices)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(e){this._timeBetweenDecodingAttempts=e<0?0:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hints",{get:function(){return this._hints},set:function(e){this._hints=e||null},enumerable:!1,configurable:!0}),e.prototype.listVideoInputDevices=function(){return Ke(this,void 0,void 0,function(){var e,t,n,r,i,a,o,s,c,l,u,d;return qe(this,function(f){switch(f.label){case 0:if(!this.hasNavigator)throw Error(`Can't enumerate devices, navigator is not present.`);if(!this.canEnumerateDevices)throw Error(`Can't enumerate devices, method not supported.`);return[4,navigator.mediaDevices.enumerateDevices()];case 1:e=f.sent(),t=[];try{for(n=Je(e),r=n.next();!r.done;r=n.next())i=r.value,a=i.kind===`video`?`videoinput`:i.kind,a===`videoinput`&&(o=i.deviceId||i.id,s=i.label||`Video device ${t.length+1}`,c=i.groupId,l={deviceId:o,label:s,kind:a,groupId:c},t.push(l))}catch(e){u={error:e}}finally{try{r&&!r.done&&(d=n.return)&&d.call(n)}finally{if(u)throw u.error}}return[2,t]}})})},e.prototype.getVideoInputDevices=function(){return Ke(this,void 0,void 0,function(){var e;return qe(this,function(t){switch(t.label){case 0:return[4,this.listVideoInputDevices()];case 1:return e=t.sent(),[2,e.map(function(e){return new Ge(e.deviceId,e.label)})]}})})},e.prototype.findDeviceById=function(e){return Ke(this,void 0,void 0,function(){var t;return qe(this,function(n){switch(n.label){case 0:return[4,this.listVideoInputDevices()];case 1:return t=n.sent(),t?[2,t.find(function(t){return t.deviceId===e})]:[2,null]}})})},e.prototype.decodeFromInputVideoDevice=function(e,t){return Ke(this,void 0,void 0,function(){return qe(this,function(n){switch(n.label){case 0:return[4,this.decodeOnceFromVideoDevice(e,t)];case 1:return[2,n.sent()]}})})},e.prototype.decodeOnceFromVideoDevice=function(e,t){return Ke(this,void 0,void 0,function(){var n,r;return qe(this,function(i){switch(i.label){case 0:return this.reset(),n=e?{deviceId:{exact:e}}:{facingMode:`environment`},r={video:n},[4,this.decodeOnceFromConstraints(r,t)];case 1:return[2,i.sent()]}})})},e.prototype.decodeOnceFromConstraints=function(e,t){return Ke(this,void 0,void 0,function(){var n;return qe(this,function(r){switch(r.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return n=r.sent(),[4,this.decodeOnceFromStream(n,t)];case 2:return[2,r.sent()]}})})},e.prototype.decodeOnceFromStream=function(e,t){return Ke(this,void 0,void 0,function(){var n,r;return qe(this,function(i){switch(i.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,t)];case 1:return n=i.sent(),[4,this.decodeOnce(n)];case 2:return r=i.sent(),[2,r]}})})},e.prototype.decodeFromInputVideoDeviceContinuously=function(e,t,n){return Ke(this,void 0,void 0,function(){return qe(this,function(r){switch(r.label){case 0:return[4,this.decodeFromVideoDevice(e,t,n)];case 1:return[2,r.sent()]}})})},e.prototype.decodeFromVideoDevice=function(e,t,n){return Ke(this,void 0,void 0,function(){var r,i;return qe(this,function(a){switch(a.label){case 0:return r=e?{deviceId:{exact:e}}:{facingMode:`environment`},i={video:r},[4,this.decodeFromConstraints(i,t,n)];case 1:return[2,a.sent()]}})})},e.prototype.decodeFromConstraints=function(e,t,n){return Ke(this,void 0,void 0,function(){var r;return qe(this,function(i){switch(i.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return r=i.sent(),[4,this.decodeFromStream(r,t,n)];case 2:return[2,i.sent()]}})})},e.prototype.decodeFromStream=function(e,t,n){return Ke(this,void 0,void 0,function(){var r;return qe(this,function(i){switch(i.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,t)];case 1:return r=i.sent(),[4,this.decodeContinuously(r,n)];case 2:return[2,i.sent()]}})})},e.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},e.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},e.prototype.attachStreamToVideo=function(e,t){return Ke(this,void 0,void 0,function(){var n;return qe(this,function(r){switch(r.label){case 0:return n=this.prepareVideoElement(t),this.addVideoSource(n,e),this.videoElement=n,this.stream=e,[4,this.playVideoOnLoadAsync(n)];case 1:return r.sent(),[2,n]}})})},e.prototype.playVideoOnLoadAsync=function(e){var t=this;return new Promise(function(n,r){return t.playVideoOnLoad(e,function(){return n()})})},e.prototype.playVideoOnLoad=function(e,t){var n=this;this.videoEndedListener=function(){return n.stopStreams()},this.videoCanPlayListener=function(){return n.tryPlayVideo(e)},e.addEventListener(`ended`,this.videoEndedListener),e.addEventListener(`canplay`,this.videoCanPlayListener),e.addEventListener(`playing`,t),this.tryPlayVideo(e)},e.prototype.isVideoPlaying=function(e){return e.currentTime>0&&!e.paused&&!e.ended&&e.readyState>2},e.prototype.tryPlayVideo=function(e){return Ke(this,void 0,void 0,function(){return qe(this,function(t){switch(t.label){case 0:if(this.isVideoPlaying(e))return console.warn(`Trying to play video that is already playing.`),[2];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,e.play()];case 2:return t.sent(),[3,4];case 3:return t.sent(),console.warn(`It was not possible to play the video.`),[3,4];case 4:return[2]}})})},e.prototype.getMediaElement=function(e,t){var n=document.getElementById(e);if(!n)throw new he(`element with id '${e}' not found`);if(n.nodeName.toLowerCase()!==t.toLowerCase())throw new he(`element with id '${e}' must be an ${t} element`);return n},e.prototype.decodeFromImage=function(e,t){if(!e&&!t)throw new he(`either imageElement with a src set or an url must be provided`);return t&&!e?this.decodeFromImageUrl(t):this.decodeFromImageElement(e)},e.prototype.decodeFromVideo=function(e,t){if(!e&&!t)throw new he(`Either an element with a src set or an URL must be provided`);return t&&!e?this.decodeFromVideoUrl(t):this.decodeFromVideoElement(e)},e.prototype.decodeFromVideoContinuously=function(e,t,n){if(e===void 0&&t===void 0)throw new he(`Either an element with a src set or an URL must be provided`);return t&&!e?this.decodeFromVideoUrlContinuously(t,n):this.decodeFromVideoElementContinuously(e,n)},e.prototype.decodeFromImageElement=function(e){if(!e)throw new he(`An image element must be provided.`);this.reset();var t=this.prepareImageElement(e);return this.imageElement=t,this.isImageLoaded(t)?this.decodeOnce(t,!1,!0):this._decodeOnLoadImage(t)},e.prototype.decodeFromVideoElement=function(e){var t=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideo(t)},e.prototype.decodeFromVideoElementContinuously=function(e,t){var n=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideoContinuously(n,t)},e.prototype._decodeFromVideoElementSetup=function(e){if(!e)throw new he(`A video element must be provided.`);this.reset();var t=this.prepareVideoElement(e);return this.videoElement=t,t},e.prototype.decodeFromImageUrl=function(e){if(!e)throw new he(`An URL must be provided.`);this.reset();var t=this.prepareImageElement();this.imageElement=t;var n=this._decodeOnLoadImage(t);return t.src=e,n},e.prototype.decodeFromVideoUrl=function(e){if(!e)throw new he(`An URL must be provided.`);this.reset();var t=this.prepareVideoElement(),n=this.decodeFromVideoElement(t);return t.src=e,n},e.prototype.decodeFromVideoUrlContinuously=function(e,t){if(!e)throw new he(`An URL must be provided.`);this.reset();var n=this.prepareVideoElement(),r=this.decodeFromVideoElementContinuously(n,t);return n.src=e,r},e.prototype._decodeOnLoadImage=function(e){var t=this;return new Promise(function(n,r){t.imageLoadedListener=function(){return t.decodeOnce(e,!1,!0).then(n,r)},e.addEventListener(`load`,t.imageLoadedListener)})},e.prototype._decodeOnLoadVideo=function(e){return Ke(this,void 0,void 0,function(){return qe(this,function(t){switch(t.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return t.sent(),[4,this.decodeOnce(e)];case 2:return[2,t.sent()]}})})},e.prototype._decodeOnLoadVideoContinuously=function(e,t){return Ke(this,void 0,void 0,function(){return qe(this,function(n){switch(n.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return n.sent(),this.decodeContinuously(e,t),[2]}})})},e.prototype.isImageLoaded=function(e){return!(!e.complete||e.naturalWidth===0)},e.prototype.prepareImageElement=function(e){var t;return e===void 0&&(t=document.createElement(`img`),t.width=200,t.height=200),typeof e==`string`&&(t=this.getMediaElement(e,`img`)),e instanceof HTMLImageElement&&(t=e),t},e.prototype.prepareVideoElement=function(e){var t;return!e&&typeof document<`u`&&(t=document.createElement(`video`),t.width=200,t.height=200),typeof e==`string`&&(t=this.getMediaElement(e,`video`)),e instanceof HTMLVideoElement&&(t=e),t.setAttribute(`autoplay`,`true`),t.setAttribute(`muted`,`true`),t.setAttribute(`playsinline`,`true`),t},e.prototype.decodeOnce=function(e,t,n){var r=this;t===void 0&&(t=!0),n===void 0&&(n=!0),this._stopAsyncDecode=!1;var i=function(a,o){if(r._stopAsyncDecode)o(new I(`Video stream has ended before any code could be detected.`)),r._stopAsyncDecode=void 0;else try{a(r.decode(e))}catch(e){var s=t&&e instanceof I,c=(e instanceof O||e instanceof M)&&n;if(s||c)return setTimeout(i,r._timeBetweenDecodingAttempts,a,o);o(e)}};return new Promise(function(e,t){return i(e,t)})},e.prototype.decodeContinuously=function(e,t){var n=this;this._stopContinuousDecode=!1;var r=function(){if(n._stopContinuousDecode)n._stopContinuousDecode=void 0;else try{t(n.decode(e),null),setTimeout(r,n.timeBetweenScansMillis)}catch(e){t(null,e);var i=e instanceof O||e instanceof M,a=e instanceof I;i||a?setTimeout(r,n._timeBetweenDecodingAttempts):console.error(`BrowserCodeReader: unexpected error during decode, stopping scan loop:`,e)}};r()},e.prototype.decode=function(e){var t=this.createBinaryBitmap(e);try{return this.decodeBitmap(t)}catch(t){if(t instanceof I){var n=new _e(new Le(new We(this.getCaptureCanvas(e),!1)));return this.decodeBitmap(n)}throw t}},e.prototype.createBinaryBitmap=function(e){this.getCaptureCanvasContext(e);var t=!1;e instanceof HTMLVideoElement?(this.drawFrameOnCanvas(e),t=!0):this.drawImageOnCanvas(e);var n=new We(this.getCaptureCanvas(e),t,this._grayscaleBuffer);return this._grayscaleBuffer=n.getMatrix(),new _e(new ze(n))},e.prototype.getCaptureCanvasContext=function(e){if(!this.captureCanvasContext){var t=this.getCaptureCanvas(e),n=void 0;try{n=t.getContext(`2d`,{willReadFrequently:!0})}catch{n=t.getContext(`2d`)}this.captureCanvasContext=n}return this.captureCanvasContext},e.prototype.getCaptureCanvas=function(e){if(!this.captureCanvas){var t=this.createCaptureCanvas(e);this.captureCanvas=t}return this.captureCanvas},e.prototype.drawFrameOnCanvas=function(e,t,n){t===void 0&&(t={sx:0,sy:0,sWidth:e.videoWidth,sHeight:e.videoHeight,dx:0,dy:0,dWidth:e.videoWidth,dHeight:e.videoHeight}),n===void 0&&(n=this.captureCanvasContext),n.drawImage(e,t.sx,t.sy,t.sWidth,t.sHeight,t.dx,t.dy,t.dWidth,t.dHeight)},e.prototype.drawImageOnCanvas=function(e,t,n){t===void 0&&(t={sx:0,sy:0,sWidth:e.naturalWidth,sHeight:e.naturalHeight,dx:0,dy:0,dWidth:e.naturalWidth,dHeight:e.naturalHeight}),n===void 0&&(n=this.captureCanvasContext),n.drawImage(e,t.sx,t.sy,t.sWidth,t.sHeight,t.dx,t.dy,t.dWidth,t.dHeight)},e.prototype.decodeBitmap=function(e){try{return this.reader.decode(e,this._hints)}finally{this.reader.reset()}},e.prototype.createCaptureCanvas=function(e){if(typeof document>`u`)return this._destroyCaptureCanvas(),null;var t=document.createElement(`canvas`),n,r;return e!==void 0&&(e instanceof HTMLVideoElement?(n=e.videoWidth,r=e.videoHeight):e instanceof HTMLImageElement&&(n=e.naturalWidth||e.width,r=e.naturalHeight||e.height)),t.style.width=n+`px`,t.style.height=r+`px`,t.width=n,t.height=r,t},e.prototype.stopStreams=function(){this.stream&&=(this.stream.getVideoTracks().forEach(function(e){return e.stop()}),void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()},e.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},e.prototype._destroyVideoElement=function(){this.videoElement&&=(this.videoEndedListener!==void 0&&this.videoElement.removeEventListener(`ended`,this.videoEndedListener),this.videoPlayingEventListener!==void 0&&this.videoElement.removeEventListener(`playing`,this.videoPlayingEventListener),this.videoCanPlayListener!==void 0&&this.videoElement.removeEventListener(`loadedmetadata`,this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),void 0)},e.prototype._destroyImageElement=function(){this.imageElement&&=(this.imageLoadedListener!==void 0&&this.imageElement.removeEventListener(`load`,this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute(`src`),void 0)},e.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},e.prototype.addVideoSource=function(e,t){try{e.srcObject=t}catch{e.src=URL.createObjectURL(t)}},e.prototype.cleanVideoSource=function(e){try{e.srcObject=null}catch{e.src=``}this.videoElement.removeAttribute(`src`)},e}(),Xe=function(){function e(e,t,n,r,i,a){n===void 0&&(n=t==null?0:8*t.length),a===void 0&&(a=k.currentTimeMillis()),this.text=e,this.rawBytes=t,this.numBits=n,this.resultPoints=r,this.format=i,this.timestamp=a,this.text=e,this.rawBytes=t,this.numBits=n??(t==null?0:8*t.length),this.resultPoints=r,this.format=i,this.resultMetadata=null,this.timestamp=a??k.currentTimeMillis()}return e.prototype.getText=function(){return this.text},e.prototype.getRawBytes=function(){return this.rawBytes},e.prototype.getNumBits=function(){return this.numBits},e.prototype.getResultPoints=function(){return this.resultPoints},e.prototype.getBarcodeFormat=function(){return this.format},e.prototype.getResultMetadata=function(){return this.resultMetadata},e.prototype.putMetadata=function(e,t){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(e,t)},e.prototype.putAllMetadata=function(e){e!==null&&(this.resultMetadata=this.resultMetadata===null?e:new Map(e))},e.prototype.addResultPoints=function(e){var t=this.resultPoints;if(t===null)this.resultPoints=e;else if(e!==null&&e.length>0){var n=Array(t.length+e.length);k.arraycopy(t,0,n,0,t.length),k.arraycopy(e,0,n,t.length,e.length),this.resultPoints=n}},e.prototype.getTimestamp=function(){return this.timestamp},e.prototype.toString=function(){return this.text},e}(),Ze;(function(e){e[e.AZTEC=0]=`AZTEC`,e[e.CODABAR=1]=`CODABAR`,e[e.CODE_39=2]=`CODE_39`,e[e.CODE_93=3]=`CODE_93`,e[e.CODE_128=4]=`CODE_128`,e[e.DATA_MATRIX=5]=`DATA_MATRIX`,e[e.EAN_8=6]=`EAN_8`,e[e.EAN_13=7]=`EAN_13`,e[e.ITF=8]=`ITF`,e[e.MAXICODE=9]=`MAXICODE`,e[e.PDF_417=10]=`PDF_417`,e[e.QR_CODE=11]=`QR_CODE`,e[e.RSS_14=12]=`RSS_14`,e[e.RSS_EXPANDED=13]=`RSS_EXPANDED`,e[e.UPC_A=14]=`UPC_A`,e[e.UPC_E=15]=`UPC_E`,e[e.UPC_EAN_EXTENSION=16]=`UPC_EAN_EXTENSION`,e[e.MICRO_QR_CODE=17]=`MICRO_QR_CODE`})(Ze||={});var L=Ze,Qe;(function(e){e[e.OTHER=0]=`OTHER`,e[e.ORIENTATION=1]=`ORIENTATION`,e[e.BYTE_SEGMENTS=2]=`BYTE_SEGMENTS`,e[e.ERROR_CORRECTION_LEVEL=3]=`ERROR_CORRECTION_LEVEL`,e[e.ISSUE_NUMBER=4]=`ISSUE_NUMBER`,e[e.SUGGESTED_PRICE=5]=`SUGGESTED_PRICE`,e[e.POSSIBLE_COUNTRY=6]=`POSSIBLE_COUNTRY`,e[e.UPC_EAN_EXTENSION=7]=`UPC_EAN_EXTENSION`,e[e.PDF417_EXTRA_METADATA=8]=`PDF417_EXTRA_METADATA`,e[e.STRUCTURED_APPEND_SEQUENCE=9]=`STRUCTURED_APPEND_SEQUENCE`,e[e.STRUCTURED_APPEND_PARITY=10]=`STRUCTURED_APPEND_PARITY`,e[e.ERRORS_CORRECTED=11]=`ERRORS_CORRECTED`})(Qe||={});var $e=Qe,et=function(){function e(e,t,n,r,i,a){i===void 0&&(i=-1),a===void 0&&(a=-1),this.rawBytes=e,this.text=t,this.byteSegments=n,this.ecLevel=r,this.structuredAppendSequenceNumber=i,this.structuredAppendParity=a,this.numBits=e==null?0:8*e.length}return e.prototype.getRawBytes=function(){return this.rawBytes},e.prototype.getNumBits=function(){return this.numBits},e.prototype.setNumBits=function(e){this.numBits=e},e.prototype.getText=function(){return this.text},e.prototype.getByteSegments=function(){return this.byteSegments},e.prototype.getECLevel=function(){return this.ecLevel},e.prototype.getErrorsCorrected=function(){return this.errorsCorrected},e.prototype.setErrorsCorrected=function(e){this.errorsCorrected=e},e.prototype.getErasures=function(){return this.erasures},e.prototype.setErasures=function(e){this.erasures=e},e.prototype.getOther=function(){return this.other},e.prototype.setOther=function(e){this.other=e},e.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},e.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},e.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},e}(),tt=function(){function e(){}return e.prototype.exp=function(e){return this.expTable[e]},e.prototype.log=function(e){if(e===0)throw new D;return this.logTable[e]},e.addOrSubtract=function(e,t){return e^t},e}(),nt=function(){function e(e,t){if(t.length===0)throw new D;this.field=e;var n=t.length;if(n>1&&t[0]===0){for(var r=1;r<n&&t[r]===0;)r++;r===n?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(n-r),k.arraycopy(t,r,this.coefficients,0,this.coefficients.length))}else this.coefficients=t}return e.prototype.getCoefficients=function(){return this.coefficients},e.prototype.getDegree=function(){return this.coefficients.length-1},e.prototype.isZero=function(){return this.coefficients[0]===0},e.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},e.prototype.evaluateAt=function(e){if(e===0)return this.getCoefficient(0);var t=this.coefficients,n;if(e===1){n=0;for(var r=0,i=t.length;r!==i;r++){var a=t[r];n=tt.addOrSubtract(n,a)}return n}n=t[0];for(var o=t.length,s=this.field,r=1;r<o;r++)n=tt.addOrSubtract(s.multiply(e,n),t[r]);return n},e.prototype.addOrSubtract=function(t){if(!this.field.equals(t.field))throw new D(`GenericGFPolys do not have same GenericGF field`);if(this.isZero())return t;if(t.isZero())return this;var n=this.coefficients,r=t.coefficients;if(n.length>r.length){var i=n;n=r,r=i}var a=new Int32Array(r.length),o=r.length-n.length;k.arraycopy(r,0,a,0,o);for(var s=o;s<r.length;s++)a[s]=tt.addOrSubtract(n[s-o],r[s]);return new e(this.field,a)},e.prototype.multiply=function(t){if(!this.field.equals(t.field))throw new D(`GenericGFPolys do not have same GenericGF field`);if(this.isZero()||t.isZero())return this.field.getZero();for(var n=this.coefficients,r=n.length,i=t.coefficients,a=i.length,o=new Int32Array(r+a-1),s=this.field,c=0;c<r;c++)for(var l=n[c],u=0;u<a;u++)o[c+u]=tt.addOrSubtract(o[c+u],s.multiply(l,i[u]));return new e(s,o)},e.prototype.multiplyScalar=function(t){if(t===0)return this.field.getZero();if(t===1)return this;for(var n=this.coefficients.length,r=this.field,i=new Int32Array(n),a=this.coefficients,o=0;o<n;o++)i[o]=r.multiply(a[o],t);return new e(r,i)},e.prototype.multiplyByMonomial=function(t,n){if(t<0)throw new D;if(n===0)return this.field.getZero();for(var r=this.coefficients,i=r.length,a=new Int32Array(i+t),o=this.field,s=0;s<i;s++)a[s]=o.multiply(r[s],n);return new e(o,a)},e.prototype.divide=function(e){if(!this.field.equals(e.field))throw new D(`GenericGFPolys do not have same GenericGF field`);if(e.isZero())throw new D(`Divide by 0`);for(var t=this.field,n=t.getZero(),r=this,i=e.getCoefficient(e.getDegree()),a=t.inverse(i);r.getDegree()>=e.getDegree()&&!r.isZero();){var o=r.getDegree()-e.getDegree(),s=t.multiply(r.getCoefficient(r.getDegree()),a),c=e.multiplyByMonomial(o,s),l=t.buildMonomial(o,s);n=n.addOrSubtract(l),r=r.addOrSubtract(c)}return[n,r]},e.prototype.toString=function(){for(var e=``,t=this.getDegree();t>=0;t--){var n=this.getCoefficient(t);if(n!==0){if(n<0?(e+=` - `,n=-n):e.length>0&&(e+=` + `),t===0||n!==1){var r=this.field.log(n);r===0?e+=`1`:r===1?e+=`a`:(e+=`a^`,e+=r)}t!==0&&(t===1?e+=`x`:(e+=`x^`,e+=t))}}return e},e}(),rt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),it=function(e){rt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.kind=`ArithmeticException`,t}(pe),at=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ot=function(e){at(t,e);function t(t,n,r){var i=e.call(this)||this;i.primitive=t,i.size=n,i.generatorBase=r;for(var a=new Int32Array(n),o=1,s=0;s<n;s++)a[s]=o,o*=2,o>=n&&(o^=t,o&=n-1);i.expTable=a;for(var c=new Int32Array(n),s=0;s<n-1;s++)c[a[s]]=s;return i.logTable=c,i.zero=new nt(i,Int32Array.from([0])),i.one=new nt(i,Int32Array.from([1])),i}return t.prototype.getZero=function(){return this.zero},t.prototype.getOne=function(){return this.one},t.prototype.buildMonomial=function(e,t){if(e<0)throw new D;if(t===0)return this.zero;var n=new Int32Array(e+1);return n[0]=t,new nt(this,n)},t.prototype.inverse=function(e){if(e===0)throw new it;return this.expTable[this.size-this.logTable[e]-1]},t.prototype.multiply=function(e,t){return e===0||t===0?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.size-1)]},t.prototype.getSize=function(){return this.size},t.prototype.getGeneratorBase=function(){return this.generatorBase},t.prototype.toString=function(){return`GF(0x`+A.toHexString(this.primitive)+`,`+this.size+`)`},t.prototype.equals=function(e){return e===this},t.AZTEC_DATA_12=new t(4201,4096,1),t.AZTEC_DATA_10=new t(1033,1024,1),t.AZTEC_DATA_6=new t(67,64,1),t.AZTEC_PARAM=new t(19,16,1),t.QR_CODE_FIELD_256=new t(285,256,0),t.DATA_MATRIX_FIELD_256=new t(301,256,1),t.AZTEC_DATA_8=t.DATA_MATRIX_FIELD_256,t.MAXICODE_FIELD_64=t.AZTEC_DATA_6,t}(tt),st=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ct=function(e){st(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.kind=`ReedSolomonException`,t}(pe),lt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ut=function(e){lt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.kind=`IllegalStateException`,t}(pe),dt=function(){function e(e){this.field=e}return e.prototype.decode=function(e,t){this.decodeWithECCount(e,t)},e.prototype.decodeWithECCount=function(e,t){for(var n=this.field,r=new nt(n,e),i=new Int32Array(t),a=!0,o=0;o<t;o++){var s=r.evaluateAt(n.exp(o+n.getGeneratorBase()));i[i.length-1-o]=s,s!==0&&(a=!1)}if(a)return 0;for(var c=new nt(n,i),l=this.runEuclideanAlgorithm(n.buildMonomial(t,1),c,t),u=l[0],d=l[1],f=this.findErrorLocations(u),p=this.findErrorMagnitudes(d,f),o=0;o<f.length;o++){var m=e.length-1-n.log(f[o]);if(m<0)throw new ct(`Bad error location`);e[m]=ot.addOrSubtract(e[m],p[o])}return f.length},e.prototype.runEuclideanAlgorithm=function(e,t,n){if(e.getDegree()<t.getDegree()){var r=e;e=t,t=r}for(var i=this.field,a=e,o=t,s=i.getZero(),c=i.getOne();o.getDegree()>=(n/2|0);){var l=a,u=s;if(a=o,s=c,a.isZero())throw new ct(`r_{i-1} was zero`);o=l;for(var d=i.getZero(),f=a.getCoefficient(a.getDegree()),p=i.inverse(f);o.getDegree()>=a.getDegree()&&!o.isZero();){var m=o.getDegree()-a.getDegree(),h=i.multiply(o.getCoefficient(o.getDegree()),p);d=d.addOrSubtract(i.buildMonomial(m,h)),o=o.addOrSubtract(a.multiplyByMonomial(m,h))}if(c=d.multiply(s).addOrSubtract(u),o.getDegree()>=a.getDegree())throw new ut(`Division algorithm failed to reduce polynomial?`)}var g=c.getCoefficient(0);if(g===0)throw new ct(`sigmaTilde(0) was zero`);var _=i.inverse(g);return[c.multiplyScalar(_),o.multiplyScalar(_)]},e.prototype.findErrorLocations=function(e){var t=e.getDegree();if(t===1)return Int32Array.from([e.getCoefficient(1)]);for(var n=new Int32Array(t),r=0,i=this.field,a=1;a<i.getSize()&&r<t;a++)e.evaluateAt(a)===0&&(n[r]=i.inverse(a),r++);if(r!==t)throw new ct(`Error locator degree does not match number of roots`);return n},e.prototype.findErrorMagnitudes=function(e,t){for(var n=t.length,r=new Int32Array(n),i=this.field,a=0;a<n;a++){for(var o=i.inverse(t[a]),s=1,c=0;c<n;c++)if(a!==c){var l=i.multiply(t[c],o),u=l&1?l&-2:l|1;s=i.multiply(s,u)}r[a]=i.multiply(e.evaluateAt(o),i.inverse(s)),i.getGeneratorBase()!==0&&(r[a]=i.multiply(r[a],o))}return r},e}(),ft;(function(e){e[e.UPPER=0]=`UPPER`,e[e.LOWER=1]=`LOWER`,e[e.MIXED=2]=`MIXED`,e[e.DIGIT=3]=`DIGIT`,e[e.PUNCT=4]=`PUNCT`,e[e.BINARY=5]=`BINARY`})(ft||={});var pt=function(){function e(){}return e.prototype.decode=function(t){this.ddata=t;var n=t.getBits(),r=this.extractBits(n),i=this.correctBits(r),a=new et(e.convertBoolArrayToByteArray(i),e.getEncodedData(i),null,null);return a.setNumBits(i.length),a},e.highLevelDecode=function(e){return this.getEncodedData(e)},e.getEncodedData=function(t){for(var n=t.length,r=ft.UPPER,i=ft.UPPER,a=``,o=0;o<n;)if(i===ft.BINARY){if(n-o<5)break;var s=e.readCode(t,o,5);if(o+=5,s===0){if(n-o<11)break;s=e.readCode(t,o,11)+31,o+=11}for(var c=0;c<s;c++){if(n-o<8){o=n;break}var l=e.readCode(t,o,8);a+=P.castAsNonUtf8Char(l),o+=8}i=r}else{var u=i===ft.DIGIT?4:5;if(n-o<u)break;var l=e.readCode(t,o,u);o+=u;var d=e.getCharacter(i,l);d.startsWith(`CTRL_`)?(r=i,i=e.getTable(d.charAt(5)),d.charAt(6)===`L`&&(r=i)):(a+=d,i=r)}return a},e.getTable=function(e){switch(e){case`L`:return ft.LOWER;case`P`:return ft.PUNCT;case`M`:return ft.MIXED;case`D`:return ft.DIGIT;case`B`:return ft.BINARY;default:return ft.UPPER}},e.getCharacter=function(t,n){switch(t){case ft.UPPER:return e.UPPER_TABLE[n];case ft.LOWER:return e.LOWER_TABLE[n];case ft.MIXED:return e.MIXED_TABLE[n];case ft.PUNCT:return e.PUNCT_TABLE[n];case ft.DIGIT:return e.DIGIT_TABLE[n];default:throw new ut(`Bad table`)}},e.prototype.correctBits=function(t){var n,r;this.ddata.getNbLayers()<=2?(r=6,n=ot.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(r=8,n=ot.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(r=10,n=ot.AZTEC_DATA_10):(r=12,n=ot.AZTEC_DATA_12);var i=this.ddata.getNbDatablocks(),a=t.length/r;if(a<i)throw new M;for(var o=t.length%r,s=new Int32Array(a),c=0;c<a;c++,o+=r)s[c]=e.readCode(t,o,r);try{new dt(n).decode(s,a-i)}catch(e){throw new M(e)}for(var l=(1<<r)-1,u=0,c=0;c<i;c++){var d=s[c];if(d===0||d===l)throw new M;(d===1||d===l-1)&&u++}for(var f=Array(i*r-u),p=0,c=0;c<i;c++){var d=s[c];if(d===1||d===l-1)f.fill(d>1,p,p+r-1),p+=r-1;else for(var m=r-1;m>=0;--m)f[p++]=!!(d&1<<m)}return f},e.prototype.extractBits=function(e){var t=this.ddata.isCompact(),n=this.ddata.getNbLayers(),r=(t?11:14)+n*4,i=new Int32Array(r),a=Array(this.totalBitsInLayer(n,t));if(t)for(var o=0;o<i.length;o++)i[o]=o;else for(var s=r+1+2*A.truncDivision(A.truncDivision(r,2)-1,15),c=r/2,l=A.truncDivision(s,2),o=0;o<c;o++){var u=o+A.truncDivision(o,15);i[c-o-1]=l-u-1,i[c+o]=l+u+1}for(var o=0,d=0;o<n;o++){for(var f=(n-o)*4+(t?9:12),p=o*2,m=r-1-p,h=0;h<f;h++)for(var g=h*2,_=0;_<2;_++)a[d+g+_]=e.get(i[p+_],i[p+h]),a[d+2*f+g+_]=e.get(i[p+h],i[m-_]),a[d+4*f+g+_]=e.get(i[m-_],i[m-h]),a[d+6*f+g+_]=e.get(i[m-h],i[p+_]);d+=f*8}return a},e.readCode=function(e,t,n){for(var r=0,i=t;i<t+n;i++)r<<=1,e[i]&&(r|=1);return r},e.readByte=function(t,n){var r=t.length-n;return r>=8?e.readCode(t,n,8):e.readCode(t,n,r)<<8-r},e.convertBoolArrayToByteArray=function(t){for(var n=new Uint8Array((t.length+7)/8),r=0;r<n.length;r++)n[r]=e.readByte(t,8*r);return n},e.prototype.totalBitsInLayer=function(e,t){return((t?88:112)+16*e)*e},e.UPPER_TABLE=`CTRL_PS. .A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.CTRL_LL.CTRL_ML.CTRL_DL.CTRL_BS`.split(`.`),e.LOWER_TABLE=`CTRL_PS. .a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.CTRL_US.CTRL_ML.CTRL_DL.CTRL_BS`.split(`.`),e.MIXED_TABLE=`CTRL_PS. .......\x07.\b. .
5
5
  .\v.\f.\r.\x1B.....@.\\.^._.\`.|.~..CTRL_LL.CTRL_UL.CTRL_PL.CTRL_BS`.split(`.`),e.PUNCT_TABLE=[``,`\r`,`\r
6
- `,`. `,`, `,`: `,`!`,`"`,`#`,`$`,`%`,`&`,`'`,`(`,`)`,`*`,`+`,`,`,`-`,`.`,`/`,`:`,`;`,`<`,`=`,`>`,`?`,`[`,`]`,`{`,`}`,`CTRL_UL`],e.DIGIT_TABLE=[`CTRL_PS`,` `,`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`,`,`,`.`,`CTRL_UL`,`CTRL_US`],e}(),F=function(){function e(){}return e.round=function(e){return isNaN(e)?0:e<=-(2**53-1)?-(2**53-1):e>=2**53-1?2**53-1:e+(e<0?-.5:.5)|0},e.distance=function(e,t,n,r){var i=e-n,a=t-r;return Math.sqrt(i*i+a*a)},e.sum=function(e){for(var t=0,n=0,r=e.length;n!==r;n++){var i=e[n];t+=i}return t},e}(),Ie=function(){function e(){}return e.floatToIntBits=function(e){return e},e.MAX_VALUE=2**53-1,e}(),I=function(){function e(e,t){this.x=e,this.y=t}return e.prototype.getX=function(){return this.x},e.prototype.getY=function(){return this.y},e.prototype.equals=function(t){if(t instanceof e){var n=t;return this.x===n.x&&this.y===n.y}return!1},e.prototype.hashCode=function(){return 31*Ie.floatToIntBits(this.x)+Ie.floatToIntBits(this.y)},e.prototype.toString=function(){return`(`+this.x+`,`+this.y+`)`},e.orderBestPatterns=function(e){var t=this.distance(e[0],e[1]),n=this.distance(e[1],e[2]),r=this.distance(e[0],e[2]),i,a,o;if(n>=t&&n>=r?(a=e[0],i=e[1],o=e[2]):r>=n&&r>=t?(a=e[1],i=e[0],o=e[2]):(a=e[2],i=e[0],o=e[1]),this.crossProductZ(i,a,o)<0){var s=i;i=o,o=s}e[0]=i,e[1]=a,e[2]=o},e.distance=function(e,t){return F.distance(e.x,e.y,t.x,t.y)},e.crossProductZ=function(e,t,n){var r=t.x,i=t.y;return(n.x-r)*(e.y-i)-(n.y-i)*(e.x-r)},e}(),Le=function(){function e(e,t){this.bits=e,this.points=t}return e.prototype.getBits=function(){return this.bits},e.prototype.getPoints=function(){return this.points},e}(),Re=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ze=function(e){Re(t,e);function t(t,n,r,i,a){var o=e.call(this,t,n)||this;return o.compact=r,o.nbDatablocks=i,o.nbLayers=a,o}return t.prototype.getNbLayers=function(){return this.nbLayers},t.prototype.getNbDatablocks=function(){return this.nbDatablocks},t.prototype.isCompact=function(){return this.compact},t}(Le),Be=function(){function e(t,n,r,i){this.image=t,this.height=t.getHeight(),this.width=t.getWidth(),n??=e.INIT_SIZE,r??=t.getWidth()/2|0,i??=t.getHeight()/2|0;var a=n/2|0;if(this.leftInit=r-a,this.rightInit=r+a,this.upInit=i-a,this.downInit=i+a,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new M}return e.prototype.detect=function(){for(var e=this.leftInit,t=this.rightInit,n=this.upInit,r=this.downInit,i=!1,a=!0,o=!1,s=!1,c=!1,l=!1,u=!1,d=this.width,f=this.height;a;){a=!1;for(var p=!0;(p||!s)&&t<d;)p=this.containsBlackPoint(n,r,t,!1),p?(t++,a=!0,s=!0):s||t++;if(t>=d){i=!0;break}for(var m=!0;(m||!c)&&r<f;)m=this.containsBlackPoint(e,t,r,!0),m?(r++,a=!0,c=!0):c||r++;if(r>=f){i=!0;break}for(var h=!0;(h||!l)&&e>=0;)h=this.containsBlackPoint(n,r,e,!1),h?(e--,a=!0,l=!0):l||e--;if(e<0){i=!0;break}for(var g=!0;(g||!u)&&n>=0;)g=this.containsBlackPoint(e,t,n,!0),g?(n--,a=!0,u=!0):u||n--;if(n<0){i=!0;break}a&&(o=!0)}if(!i&&o){for(var _=t-e,v=null,y=1;v===null&&y<_;y++)v=this.getBlackPointOnSegment(e,r-y,e+y,r);if(v==null)throw new M;for(var b=null,y=1;b===null&&y<_;y++)b=this.getBlackPointOnSegment(e,n+y,e+y,n);if(b==null)throw new M;for(var x=null,y=1;x===null&&y<_;y++)x=this.getBlackPointOnSegment(t,n+y,t-y,n);if(x==null)throw new M;for(var S=null,y=1;S===null&&y<_;y++)S=this.getBlackPointOnSegment(t,r-y,t-y,r);if(S==null)throw new M;return this.centerEdges(S,v,x,b)}throw new M},e.prototype.getBlackPointOnSegment=function(e,t,n,r){for(var i=F.round(F.distance(e,t,n,r)),a=(n-e)/i,o=(r-t)/i,s=this.image,c=0;c<i;c++){var l=F.round(e+c*a),u=F.round(t+c*o);if(s.get(l,u))return new I(l,u)}return null},e.prototype.centerEdges=function(t,n,r,i){var a=t.getX(),o=t.getY(),s=n.getX(),c=n.getY(),l=r.getX(),u=r.getY(),d=i.getX(),f=i.getY(),p=e.CORR;return a<this.width/2?[new I(d-p,f+p),new I(s+p,c+p),new I(l-p,u-p),new I(a+p,o-p)]:[new I(d+p,f+p),new I(s+p,c-p),new I(l-p,u+p),new I(a-p,o-p)]},e.prototype.containsBlackPoint=function(e,t,n,r){var i=this.image;if(r){for(var a=e;a<=t;a++)if(i.get(a,n))return!0}else for(var o=e;o<=t;o++)if(i.get(n,o))return!0;return!1},e.INIT_SIZE=10,e.CORR=1,e}(),Ve=function(){function e(){}return e.checkAndNudgePoints=function(e,t){for(var n=e.getWidth(),r=e.getHeight(),i=!0,a=0;a<t.length&&i;a+=2){var o=Math.floor(t[a]),s=Math.floor(t[a+1]);if(o<-1||o>n||s<-1||s>r)throw new M;i=!1,o===-1?(t[a]=0,i=!0):o===n&&(t[a]=n-1,i=!0),s===-1?(t[a+1]=0,i=!0):s===r&&(t[a+1]=r-1,i=!0)}i=!0;for(var a=t.length-2;a>=0&&i;a-=2){var o=Math.floor(t[a]),s=Math.floor(t[a+1]);if(o<-1||o>n||s<-1||s>r)throw new M;i=!1,o===-1?(t[a]=0,i=!0):o===n&&(t[a]=n-1,i=!0),s===-1?(t[a+1]=0,i=!0):s===r&&(t[a+1]=r-1,i=!0)}},e}(),He=function(){function e(e,t,n,r,i,a,o,s,c){this.a11=e,this.a21=t,this.a31=n,this.a12=r,this.a22=i,this.a32=a,this.a13=o,this.a23=s,this.a33=c}return e.quadrilateralToQuadrilateral=function(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){var _=e.quadrilateralToSquare(t,n,r,i,a,o,s,c);return e.squareToQuadrilateral(l,u,d,f,p,m,h,g).times(_)},e.prototype.transformPoints=function(e){for(var t=e.length,n=this.a11,r=this.a12,i=this.a13,a=this.a21,o=this.a22,s=this.a23,c=this.a31,l=this.a32,u=this.a33,d=0;d<t;d+=2){var f=e[d],p=e[d+1],m=i*f+s*p+u;e[d]=(n*f+a*p+c)/m,e[d+1]=(r*f+o*p+l)/m}},e.prototype.transformPointsWithValues=function(e,t){for(var n=this.a11,r=this.a12,i=this.a13,a=this.a21,o=this.a22,s=this.a23,c=this.a31,l=this.a32,u=this.a33,d=e.length,f=0;f<d;f++){var p=e[f],m=t[f],h=i*p+s*m+u;e[f]=(n*p+a*m+c)/h,t[f]=(r*p+o*m+l)/h}},e.squareToQuadrilateral=function(t,n,r,i,a,o,s,c){var l=t-r+a-s,u=n-i+o-c;if(l===0&&u===0)return new e(r-t,a-r,t,i-n,o-i,n,0,0,1);var d=r-a,f=s-a,p=i-o,m=c-o,h=d*m-f*p,g=(l*m-f*u)/h,_=(d*u-l*p)/h;return new e(r-t+g*r,s-t+_*s,t,i-n+g*i,c-n+_*c,n,g,_,1)},e.quadrilateralToSquare=function(t,n,r,i,a,o,s,c){return e.squareToQuadrilateral(t,n,r,i,a,o,s,c).buildAdjoint()},e.prototype.buildAdjoint=function(){return new e(this.a22*this.a33-this.a23*this.a32,this.a23*this.a31-this.a21*this.a33,this.a21*this.a32-this.a22*this.a31,this.a13*this.a32-this.a12*this.a33,this.a11*this.a33-this.a13*this.a31,this.a12*this.a31-this.a11*this.a32,this.a12*this.a23-this.a13*this.a22,this.a13*this.a21-this.a11*this.a23,this.a11*this.a22-this.a12*this.a21)},e.prototype.times=function(t){return new e(this.a11*t.a11+this.a21*t.a12+this.a31*t.a13,this.a11*t.a21+this.a21*t.a22+this.a31*t.a23,this.a11*t.a31+this.a21*t.a32+this.a31*t.a33,this.a12*t.a11+this.a22*t.a12+this.a32*t.a13,this.a12*t.a21+this.a22*t.a22+this.a32*t.a23,this.a12*t.a31+this.a22*t.a32+this.a32*t.a33,this.a13*t.a11+this.a23*t.a12+this.a33*t.a13,this.a13*t.a21+this.a23*t.a22+this.a33*t.a23,this.a13*t.a31+this.a23*t.a32+this.a33*t.a33)},e}(),Ue=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),We=function(e){Ue(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.sampleGrid=function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){var y=He.quadrilateralToQuadrilateral(r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v);return this.sampleGridWithTransform(e,t,n,y)},t.prototype.sampleGridWithTransform=function(e,t,n,r){if(t<=0||n<=0)throw new M;for(var i=new re(t,n),a=new Float32Array(2*t),o=0;o<n;o++){for(var s=a.length,c=o+.5,l=0;l<s;l+=2)a[l]=l/2+.5,a[l+1]=c;r.transformPoints(a),Ve.checkAndNudgePoints(e,a);try{for(var l=0;l<s;l+=2)e.get(a[l]|0,a[l+1]|0)&&i.set(l/2,o)}catch{throw new M}}return i},t}(Ve),Ge=function(){function e(){}return e.setGridSampler=function(t){e.gridSampler=t},e.getInstance=function(){return e.gridSampler},e.gridSampler=new We,e}(),Ke=function(){function e(e,t){this.x=e,this.y=t}return e.prototype.toResultPoint=function(){return new I(this.getX(),this.getY())},e.prototype.getX=function(){return this.x},e.prototype.getY=function(){return this.y},e}(),qe=function(){function e(e){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=e}return e.prototype.detect=function(){return this.detectMirror(!1)},e.prototype.detectMirror=function(e){var t=this.getMatrixCenter(),n=this.getBullsEyeCorners(t);if(e){var r=n[0];n[0]=n[2],n[2]=r}return this.extractParameters(n),new ze(this.sampleGrid(this.image,n[this.shift%4],n[(this.shift+1)%4],n[(this.shift+2)%4],n[(this.shift+3)%4]),this.getMatrixCornerPoints(n),this.compact,this.nbDataBlocks,this.nbLayers)},e.prototype.extractParameters=function(e){if(!this.isValidPoint(e[0])||!this.isValidPoint(e[1])||!this.isValidPoint(e[2])||!this.isValidPoint(e[3]))throw new M;var t=2*this.nbCenterLayers,n=new Int32Array([this.sampleLine(e[0],e[1],t),this.sampleLine(e[1],e[2],t),this.sampleLine(e[2],e[3],t),this.sampleLine(e[3],e[0],t)]);this.shift=this.getRotation(n,t);for(var r=0,i=0;i<4;i++){var a=n[(this.shift+i)%4];this.compact?(r<<=7,r+=a>>1&127):(r<<=10,r+=(a>>2&992)+(a>>1&31))}var o=this.getCorrectedParameterData(r,this.compact);this.compact?(this.nbLayers=(o>>6)+1,this.nbDataBlocks=(o&63)+1):(this.nbLayers=(o>>11)+1,this.nbDataBlocks=(o&2047)+1)},e.prototype.getRotation=function(e,t){var n=0;e.forEach(function(e,r,i){var a=(e>>t-2<<1)+(e&1);n=(n<<3)+a}),n=((n&1)<<11)+(n>>1);for(var r=0;r<4;r++)if(x.bitCount(n^this.EXPECTED_CORNER_BITS[r])<=2)return r;throw new M},e.prototype.getCorrectedParameterData=function(e,t){var n,r;t?(n=7,r=2):(n=10,r=4);for(var i=n-r,a=new Int32Array(n),o=n-1;o>=0;--o)a[o]=e&15,e>>=4;try{new Ne(Oe.AZTEC_PARAM).decode(a,i)}catch{throw new M}for(var s=0,o=0;o<r;o++)s=(s<<4)+a[o];return s},e.prototype.getBullsEyeCorners=function(e){var t=e,n=e,r=e,i=e,a=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){var o=this.getFirstDifferent(t,a,1,-1),s=this.getFirstDifferent(n,a,1,1),c=this.getFirstDifferent(r,a,-1,1),l=this.getFirstDifferent(i,a,-1,-1);if(this.nbCenterLayers>2){var u=this.distancePoint(l,o)*this.nbCenterLayers/(this.distancePoint(i,t)*(this.nbCenterLayers+2));if(u<.75||u>1.25||!this.isWhiteOrBlackRectangle(o,s,c,l))break}t=o,n=s,r=c,i=l,a=!a}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new M;this.compact=this.nbCenterLayers===5;var d=new I(t.getX()+.5,t.getY()-.5),f=new I(n.getX()+.5,n.getY()+.5),p=new I(r.getX()-.5,r.getY()+.5),m=new I(i.getX()-.5,i.getY()-.5);return this.expandSquare([d,f,p,m],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},e.prototype.getMatrixCenter=function(){var e,t,n,r;try{var i=new Be(this.image).detect();e=i[0],t=i[1],n=i[2],r=i[3]}catch{var a=this.image.getWidth()/2,o=this.image.getHeight()/2;e=this.getFirstDifferent(new Ke(a+7,o-7),!1,1,-1).toResultPoint(),t=this.getFirstDifferent(new Ke(a+7,o+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new Ke(a-7,o+7),!1,-1,1).toResultPoint(),r=this.getFirstDifferent(new Ke(a-7,o-7),!1,-1,-1).toResultPoint()}var s=F.round((e.getX()+r.getX()+t.getX()+n.getX())/4),c=F.round((e.getY()+r.getY()+t.getY()+n.getY())/4);try{var i=new Be(this.image,15,s,c).detect();e=i[0],t=i[1],n=i[2],r=i[3]}catch{e=this.getFirstDifferent(new Ke(s+7,c-7),!1,1,-1).toResultPoint(),t=this.getFirstDifferent(new Ke(s+7,c+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new Ke(s-7,c+7),!1,-1,1).toResultPoint(),r=this.getFirstDifferent(new Ke(s-7,c-7),!1,-1,-1).toResultPoint()}return s=F.round((e.getX()+r.getX()+t.getX()+n.getX())/4),c=F.round((e.getY()+r.getY()+t.getY()+n.getY())/4),new Ke(s,c)},e.prototype.getMatrixCornerPoints=function(e){return this.expandSquare(e,2*this.nbCenterLayers,this.getDimension())},e.prototype.sampleGrid=function(e,t,n,r,i){var a=Ge.getInstance(),o=this.getDimension(),s=o/2-this.nbCenterLayers,c=o/2+this.nbCenterLayers;return a.sampleGrid(e,o,o,s,s,c,s,c,c,s,c,t.getX(),t.getY(),n.getX(),n.getY(),r.getX(),r.getY(),i.getX(),i.getY())},e.prototype.sampleLine=function(e,t,n){for(var r=0,i=this.distanceResultPoint(e,t),a=i/n,o=e.getX(),s=e.getY(),c=a*(t.getX()-e.getX())/i,l=a*(t.getY()-e.getY())/i,u=0;u<n;u++)this.image.get(F.round(o+u*c),F.round(s+u*l))&&(r|=1<<n-u-1);return r},e.prototype.isWhiteOrBlackRectangle=function(e,t,n,r){var i=3;e=new Ke(e.getX()-i,e.getY()+i),t=new Ke(t.getX()-i,t.getY()-i),n=new Ke(n.getX()+i,n.getY()-i),r=new Ke(r.getX()+i,r.getY()+i);var a=this.getColor(r,e);if(a===0)return!1;var o=this.getColor(e,t);return o!==a||(o=this.getColor(t,n),o!==a)?!1:(o=this.getColor(n,r),o===a)},e.prototype.getColor=function(e,t){for(var n=this.distancePoint(e,t),r=(t.getX()-e.getX())/n,i=(t.getY()-e.getY())/n,a=0,o=e.getX(),s=e.getY(),c=this.image.get(e.getX(),e.getY()),l=Math.ceil(n),u=0;u<l;u++)o+=r,s+=i,this.image.get(F.round(o),F.round(s))!==c&&a++;var d=a/n;return d>.1&&d<.9?0:d<=.1===c?1:-1},e.prototype.getFirstDifferent=function(e,t,n,r){for(var i=e.getX()+n,a=e.getY()+r;this.isValid(i,a)&&this.image.get(i,a)===t;)i+=n,a+=r;for(i-=n,a-=r;this.isValid(i,a)&&this.image.get(i,a)===t;)i+=n;for(i-=n;this.isValid(i,a)&&this.image.get(i,a)===t;)a+=r;return a-=r,new Ke(i,a)},e.prototype.expandSquare=function(e,t,n){var r=n/(2*t),i=e[0].getX()-e[2].getX(),a=e[0].getY()-e[2].getY(),o=(e[0].getX()+e[2].getX())/2,s=(e[0].getY()+e[2].getY())/2,c=new I(o+r*i,s+r*a),l=new I(o-r*i,s-r*a);return i=e[1].getX()-e[3].getX(),a=e[1].getY()-e[3].getY(),o=(e[1].getX()+e[3].getX())/2,s=(e[1].getY()+e[3].getY())/2,[c,new I(o+r*i,s+r*a),l,new I(o-r*i,s-r*a)]},e.prototype.isValid=function(e,t){return e>=0&&e<this.image.getWidth()&&t>0&&t<this.image.getHeight()},e.prototype.isValidPoint=function(e){var t=F.round(e.getX()),n=F.round(e.getY());return this.isValid(t,n)},e.prototype.distancePoint=function(e,t){return F.distance(e.getX(),e.getY(),t.getX(),t.getY())},e.prototype.distanceResultPoint=function(e,t){return F.distance(e.getX(),e.getY(),t.getX(),t.getY())},e.prototype.getDimension=function(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(x.truncDivision(this.nbLayers-4,8)+1)+15},e}(),Je=function(){function e(){}return e.prototype.decode=function(e,t){t===void 0&&(t=null);var n=null,r=new qe(e.getBlackMatrix()),i=null,a=null;try{var o=r.detectMirror(!1);i=o.getPoints(),this.reportFoundResultPoints(t,i),a=new Fe().decode(o)}catch(e){n=e}if(a==null)try{var o=r.detectMirror(!0);i=o.getPoints(),this.reportFoundResultPoints(t,i),a=new Fe().decode(o)}catch(e){throw n??e}var s=new ye(a.getText(),a.getRawBytes(),a.getNumBits(),i,N.AZTEC,m.currentTimeMillis()),c=a.getByteSegments();c!=null&&s.putMetadata(P.BYTE_SEGMENTS,c);var l=a.getECLevel();return l!=null&&s.putMetadata(P.ERROR_CORRECTION_LEVEL,l),s},e.prototype.reportFoundResultPoints=function(e,t){if(e!=null){var n=e.get(w.NEED_RESULT_POINT_CALLBACK);n!=null&&t.forEach(function(e,t,r){n.foundPossibleResultPoint(e)})}},e.prototype.reset=function(){},e}(),Ye=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){Ye(t,e);function t(t){return t===void 0&&(t=500),e.call(this,new Je,t)||this}return t})(ve);var L=function(){function e(){}return e.prototype.decode=function(e,t){try{return this.doDecode(e,t)}catch{if(t&&t.get(w.TRY_HARDER)===!0&&e.isRotateSupported()){var n=e.rotateCounterClockwise(),r=this.doDecode(n,t),i=r.getResultMetadata(),a=270;i!==null&&i.get(P.ORIENTATION)===!0&&(a+=i.get(P.ORIENTATION)%360),r.putMetadata(P.ORIENTATION,a);var o=r.getResultPoints();if(o!==null)for(var s=n.getHeight(),c=0;c<o.length;c++)o[c]=new I(s-o[c].getY()-1,o[c].getX());return r}throw new M}},e.prototype.reset=function(){},e.prototype.doDecode=function(e,t){for(var n=e.getWidth(),r=e.getHeight(),i=new S(n),a=t&&t.get(w.TRY_HARDER)===!0,o=Math.max(1,r>>(a?8:5)),s=a?r:25,c=Math.trunc(r/2),l=0;l<s;l++){var u=Math.trunc((l+1)/2),d=c+o*(l&1?-u:u);if(d<0||d>=r)break;try{i=e.getBlackRow(d,i)}catch{continue}for(var f=function(e){if(e===1&&(i.reverse(),t&&t.get(w.NEED_RESULT_POINT_CALLBACK)===!0)){var r=new Map;t.forEach(function(e,t){return r.set(t,e)}),r.delete(w.NEED_RESULT_POINT_CALLBACK),t=r}try{var a=p.decodeRow(d,i,t);if(e===1){a.putMetadata(P.ORIENTATION,180);var o=a.getResultPoints();o!==null&&(o[0]=new I(n-o[0].getX()-1,o[0].getY()),o[1]=new I(n-o[1].getX()-1,o[1].getY()))}return{value:a}}catch{}},p=this,m=0;m<2;m++){var h=f(m);if(typeof h==`object`)return h.value}}throw new M},e.recordPattern=function(e,t,n){for(var r=n.length,i=0;i<r;i++)n[i]=0;var a=e.getSize();if(t>=a)throw new M;for(var o=!e.get(t),s=0,c=t;c<a;){if(e.get(c)!==o)n[s]++;else if(++s===r)break;else n[s]=1,o=!o;c++}if(!(s===r||s===r-1&&c===a))throw new M},e.recordPatternInReverse=function(t,n,r){for(var i=r.length,a=t.get(n);n>0&&i>=0;)t.get(--n)!==a&&(i--,a=!a);if(i>=0)throw new M;e.recordPattern(t,n+1,r)},e.patternMatchVariance=function(e,t,n){for(var r=e.length,i=0,a=0,o=0;o<r;o++)i+=e[o],a+=t[o];if(i<a)return 1/0;var s=i/a;n*=s;for(var c=0,l=0;l<r;l++){var u=e[l],d=t[l]*s,f=u>d?u-d:d-u;if(f>n)return 1/0;c+=f}return c/i},e}(),Xe=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ze=function(e){Xe(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.findStartPattern=function(e){for(var n=e.getSize(),r=e.getNextSet(0),i=0,a=Int32Array.from([0,0,0,0,0,0]),o=r,s=!1,c=6,l=r;l<n;l++)if(e.get(l)!==s)a[i]++;else{if(i===c-1){for(var u=t.MAX_AVG_VARIANCE,d=-1,f=t.CODE_START_A;f<=t.CODE_START_C;f++){var p=L.patternMatchVariance(a,t.CODE_PATTERNS[f],t.MAX_INDIVIDUAL_VARIANCE);p<u&&(u=p,d=f)}if(d>=0&&e.isRange(Math.max(0,o-(l-o)/2),o,!1))return Int32Array.from([o,l,d]);o+=a[0]+a[1],a=a.slice(2,a.length),a[i-1]=0,a[i]=0,i--}else i++;a[i]=1,s=!s}throw new M},t.decodeCode=function(e,n,r){L.recordPattern(e,r,n);for(var i=t.MAX_AVG_VARIANCE,a=-1,o=0;o<t.CODE_PATTERNS.length;o++){var s=t.CODE_PATTERNS[o],c=this.patternMatchVariance(n,s,t.MAX_INDIVIDUAL_VARIANCE);c<i&&(i=c,a=o)}if(a>=0)return a;throw new M},t.prototype.decodeRow=function(e,n,r){var i=r&&r.get(w.ASSUME_GS1)===!0,a=t.findStartPattern(n),o=a[2],s=0,c=new Uint8Array(20);c[s++]=o;var l;switch(o){case t.CODE_START_A:l=t.CODE_CODE_A;break;case t.CODE_START_B:l=t.CODE_CODE_B;break;case t.CODE_START_C:l=t.CODE_CODE_C;break;default:throw new E}for(var u=!1,d=!1,p=``,m=a[0],h=a[1],g=Int32Array.from([0,0,0,0,0,0]),_=0,v=0,y=o,b=0,x=!0,S=!1,C=!1;!u;){var T=d;switch(d=!1,_=v,v=t.decodeCode(n,g,h),c[s++]=v,v!==t.CODE_STOP&&(x=!0),v!==t.CODE_STOP&&(b++,y+=b*v),m=h,h+=g.reduce(function(e,t){return e+t},0),v){case t.CODE_START_A:case t.CODE_START_B:case t.CODE_START_C:throw new E}switch(l){case t.CODE_CODE_A:if(v<64)p+=C===S?String.fromCharCode(32+v):String.fromCharCode(32+v+128),C=!1;else if(v<96)p+=C===S?String.fromCharCode(v-64):String.fromCharCode(v+64),C=!1;else switch(v!==t.CODE_STOP&&(x=!1),v){case t.CODE_FNC_1:i&&(p.length===0?p+=`]C1`:p+=``);break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_A:!S&&C?(S=!0,C=!1):S&&C?(S=!1,C=!1):C=!0;break;case t.CODE_SHIFT:d=!0,l=t.CODE_CODE_B;break;case t.CODE_CODE_B:l=t.CODE_CODE_B;break;case t.CODE_CODE_C:l=t.CODE_CODE_C;break;case t.CODE_STOP:u=!0}break;case t.CODE_CODE_B:if(v<96)p+=C===S?String.fromCharCode(32+v):String.fromCharCode(32+v+128),C=!1;else switch(v!==t.CODE_STOP&&(x=!1),v){case t.CODE_FNC_1:i&&(p.length===0?p+=`]C1`:p+=``);break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_B:!S&&C?(S=!0,C=!1):S&&C?(S=!1,C=!1):C=!0;break;case t.CODE_SHIFT:d=!0,l=t.CODE_CODE_A;break;case t.CODE_CODE_A:l=t.CODE_CODE_A;break;case t.CODE_CODE_C:l=t.CODE_CODE_C;break;case t.CODE_STOP:u=!0}break;case t.CODE_CODE_C:if(v<100)v<10&&(p+=`0`),p+=v;else switch(v!==t.CODE_STOP&&(x=!1),v){case t.CODE_FNC_1:i&&(p.length===0?p+=`]C1`:p+=``);break;case t.CODE_CODE_A:l=t.CODE_CODE_A;break;case t.CODE_CODE_B:l=t.CODE_CODE_B;break;case t.CODE_STOP:u=!0}}T&&(l=l===t.CODE_CODE_A?t.CODE_CODE_B:t.CODE_CODE_A)}var ee=h-m;if(h=n.getNextUnset(h),!n.isRange(h,Math.min(n.getSize(),h+(h-m)/2),!1))throw new M;if(y-=b*_,y%103!==_)throw new f;var D=p.length;if(D===0)throw new M;D>0&&x&&(p=l===t.CODE_CODE_C?p.substring(0,D-2):p.substring(0,D-1));for(var O=(a[1]+a[0])/2,k=m+ee/2,te=c.length,ne=new Uint8Array(te),A=0;A<te;A++)ne[A]=c[A];var j=[new I(O,e),new I(k,e)];return new ye(p,ne,0,j,N.CODE_128,new Date().getTime())},t.CODE_PATTERNS=[Int32Array.from([2,1,2,2,2,2]),Int32Array.from([2,2,2,1,2,2]),Int32Array.from([2,2,2,2,2,1]),Int32Array.from([1,2,1,2,2,3]),Int32Array.from([1,2,1,3,2,2]),Int32Array.from([1,3,1,2,2,2]),Int32Array.from([1,2,2,2,1,3]),Int32Array.from([1,2,2,3,1,2]),Int32Array.from([1,3,2,2,1,2]),Int32Array.from([2,2,1,2,1,3]),Int32Array.from([2,2,1,3,1,2]),Int32Array.from([2,3,1,2,1,2]),Int32Array.from([1,1,2,2,3,2]),Int32Array.from([1,2,2,1,3,2]),Int32Array.from([1,2,2,2,3,1]),Int32Array.from([1,1,3,2,2,2]),Int32Array.from([1,2,3,1,2,2]),Int32Array.from([1,2,3,2,2,1]),Int32Array.from([2,2,3,2,1,1]),Int32Array.from([2,2,1,1,3,2]),Int32Array.from([2,2,1,2,3,1]),Int32Array.from([2,1,3,2,1,2]),Int32Array.from([2,2,3,1,1,2]),Int32Array.from([3,1,2,1,3,1]),Int32Array.from([3,1,1,2,2,2]),Int32Array.from([3,2,1,1,2,2]),Int32Array.from([3,2,1,2,2,1]),Int32Array.from([3,1,2,2,1,2]),Int32Array.from([3,2,2,1,1,2]),Int32Array.from([3,2,2,2,1,1]),Int32Array.from([2,1,2,1,2,3]),Int32Array.from([2,1,2,3,2,1]),Int32Array.from([2,3,2,1,2,1]),Int32Array.from([1,1,1,3,2,3]),Int32Array.from([1,3,1,1,2,3]),Int32Array.from([1,3,1,3,2,1]),Int32Array.from([1,1,2,3,1,3]),Int32Array.from([1,3,2,1,1,3]),Int32Array.from([1,3,2,3,1,1]),Int32Array.from([2,1,1,3,1,3]),Int32Array.from([2,3,1,1,1,3]),Int32Array.from([2,3,1,3,1,1]),Int32Array.from([1,1,2,1,3,3]),Int32Array.from([1,1,2,3,3,1]),Int32Array.from([1,3,2,1,3,1]),Int32Array.from([1,1,3,1,2,3]),Int32Array.from([1,1,3,3,2,1]),Int32Array.from([1,3,3,1,2,1]),Int32Array.from([3,1,3,1,2,1]),Int32Array.from([2,1,1,3,3,1]),Int32Array.from([2,3,1,1,3,1]),Int32Array.from([2,1,3,1,1,3]),Int32Array.from([2,1,3,3,1,1]),Int32Array.from([2,1,3,1,3,1]),Int32Array.from([3,1,1,1,2,3]),Int32Array.from([3,1,1,3,2,1]),Int32Array.from([3,3,1,1,2,1]),Int32Array.from([3,1,2,1,1,3]),Int32Array.from([3,1,2,3,1,1]),Int32Array.from([3,3,2,1,1,1]),Int32Array.from([3,1,4,1,1,1]),Int32Array.from([2,2,1,4,1,1]),Int32Array.from([4,3,1,1,1,1]),Int32Array.from([1,1,1,2,2,4]),Int32Array.from([1,1,1,4,2,2]),Int32Array.from([1,2,1,1,2,4]),Int32Array.from([1,2,1,4,2,1]),Int32Array.from([1,4,1,1,2,2]),Int32Array.from([1,4,1,2,2,1]),Int32Array.from([1,1,2,2,1,4]),Int32Array.from([1,1,2,4,1,2]),Int32Array.from([1,2,2,1,1,4]),Int32Array.from([1,2,2,4,1,1]),Int32Array.from([1,4,2,1,1,2]),Int32Array.from([1,4,2,2,1,1]),Int32Array.from([2,4,1,2,1,1]),Int32Array.from([2,2,1,1,1,4]),Int32Array.from([4,1,3,1,1,1]),Int32Array.from([2,4,1,1,1,2]),Int32Array.from([1,3,4,1,1,1]),Int32Array.from([1,1,1,2,4,2]),Int32Array.from([1,2,1,1,4,2]),Int32Array.from([1,2,1,2,4,1]),Int32Array.from([1,1,4,2,1,2]),Int32Array.from([1,2,4,1,1,2]),Int32Array.from([1,2,4,2,1,1]),Int32Array.from([4,1,1,2,1,2]),Int32Array.from([4,2,1,1,1,2]),Int32Array.from([4,2,1,2,1,1]),Int32Array.from([2,1,2,1,4,1]),Int32Array.from([2,1,4,1,2,1]),Int32Array.from([4,1,2,1,2,1]),Int32Array.from([1,1,1,1,4,3]),Int32Array.from([1,1,1,3,4,1]),Int32Array.from([1,3,1,1,4,1]),Int32Array.from([1,1,4,1,1,3]),Int32Array.from([1,1,4,3,1,1]),Int32Array.from([4,1,1,1,1,3]),Int32Array.from([4,1,1,3,1,1]),Int32Array.from([1,1,3,1,4,1]),Int32Array.from([1,1,4,1,3,1]),Int32Array.from([3,1,1,1,4,1]),Int32Array.from([4,1,1,1,3,1]),Int32Array.from([2,1,1,4,1,2]),Int32Array.from([2,1,1,2,1,4]),Int32Array.from([2,1,1,2,3,2]),Int32Array.from([2,3,3,1,1,1,2])],t.MAX_AVG_VARIANCE=.25,t.MAX_INDIVIDUAL_VARIANCE=.7,t.CODE_SHIFT=98,t.CODE_CODE_C=99,t.CODE_CODE_B=100,t.CODE_CODE_A=101,t.CODE_FNC_1=102,t.CODE_FNC_2=97,t.CODE_FNC_3=96,t.CODE_FNC_4_A=101,t.CODE_FNC_4_B=100,t.CODE_START_A=103,t.CODE_START_B=104,t.CODE_START_C=105,t.CODE_STOP=106,t}(L),Qe=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),$e=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},et=function(e){Qe(t,e);function t(t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.call(this)||this;return r.usingCheckDigit=t,r.extendedMode=n,r.decodeRowResult=``,r.counters=new Int32Array(9),r}return t.prototype.decodeRow=function(e,n,r){var i,a,o,s,c=this.counters;c.fill(0),this.decodeRowResult=``;var l=t.findAsteriskPattern(n,c),u=n.getNextSet(l[1]),d=n.getSize(),p,m;do{t.recordPattern(n,u,c);var h=t.toNarrowWidePattern(c);if(h<0)throw new M;p=t.patternToChar(h),this.decodeRowResult+=p,m=u;try{for(var g=(i=void 0,$e(c)),_=g.next();!_.done;_=g.next()){var v=_.value;u+=v}}catch(e){i={error:e}}finally{try{_&&!_.done&&(a=g.return)&&a.call(g)}finally{if(i)throw i.error}}u=n.getNextSet(u)}while(p!==`*`);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var y=0;try{for(var b=$e(c),x=b.next();!x.done;x=b.next()){var v=x.value;y+=v}}catch(e){o={error:e}}finally{try{x&&!x.done&&(s=b.return)&&s.call(b)}finally{if(o)throw o.error}}var S=u-m-y;if(u!==d&&S*2<y)throw new M;if(this.usingCheckDigit){for(var C=this.decodeRowResult.length-1,w=0,T=0;T<C;T++)w+=t.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(T));if(this.decodeRowResult.charAt(C)!==t.ALPHABET_STRING.charAt(w%43))throw new f;this.decodeRowResult=this.decodeRowResult.substring(0,C)}if(this.decodeRowResult.length===0)throw new M;var E=this.extendedMode?t.decodeExtended(this.decodeRowResult):this.decodeRowResult,ee=(l[1]+l[0])/2,D=m+y/2;return new ye(E,null,0,[new I(ee,e),new I(D,e)],N.CODE_39,new Date().getTime())},t.findAsteriskPattern=function(e,n){for(var r=e.getSize(),i=e.getNextSet(0),a=0,o=i,s=!1,c=n.length,l=i;l<r;l++)if(e.get(l)!==s)n[a]++;else{if(a===c-1){if(this.toNarrowWidePattern(n)===t.ASTERISK_ENCODING&&e.isRange(Math.max(0,o-Math.floor((l-o)/2)),o,!1))return[o,l];o+=n[0]+n[1],n.copyWithin(0,2,2+a-1),n[a-1]=0,n[a]=0,a--}else a++;n[a]=1,s=!s}throw new M},t.toNarrowWidePattern=function(e){var t,n,r=e.length,i=0,a;do{var o=2147483647;try{for(var s=(t=void 0,$e(e)),c=s.next();!c.done;c=s.next()){var l=c.value;l<o&&l>i&&(o=l)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}i=o,a=0;for(var u=0,d=0,f=0;f<r;f++){var l=e[f];l>i&&(d|=1<<r-1-f,a++,u+=l)}if(a===3){for(var f=0;f<r&&a>0;f++){var l=e[f];if(l>i&&(a--,l*2>=u))return-1}return d}}while(a>3);return-1},t.patternToChar=function(e){for(var n=0;n<t.CHARACTER_ENCODINGS.length;n++)if(t.CHARACTER_ENCODINGS[n]===e)return t.ALPHABET_STRING.charAt(n);if(e===t.ASTERISK_ENCODING)return`*`;throw new M},t.decodeExtended=function(e){for(var t=e.length,n=``,r=0;r<t;r++){var i=e.charAt(r);if(i===`+`||i===`$`||i===`%`||i===`/`){var a=e.charAt(r+1),o=`\0`;switch(i){case`+`:if(a>=`A`&&a<=`Z`)o=String.fromCharCode(a.charCodeAt(0)+32);else throw new E;break;case`$`:if(a>=`A`&&a<=`Z`)o=String.fromCharCode(a.charCodeAt(0)-64);else throw new E;break;case`%`:if(a>=`A`&&a<=`E`)o=String.fromCharCode(a.charCodeAt(0)-38);else if(a>=`F`&&a<=`J`)o=String.fromCharCode(a.charCodeAt(0)-11);else if(a>=`K`&&a<=`O`)o=String.fromCharCode(a.charCodeAt(0)+16);else if(a>=`P`&&a<=`T`)o=String.fromCharCode(a.charCodeAt(0)+43);else if(a===`U`)o=`\0`;else if(a===`V`)o=`@`;else if(a===`W`)o="`";else if(a===`X`||a===`Y`||a===`Z`)o=``;else throw new E;break;case`/`:if(a>=`A`&&a<=`O`)o=String.fromCharCode(a.charCodeAt(0)-32);else if(a===`Z`)o=`:`;else throw new E}n+=o,r++}else n+=i}return n},t.ALPHABET_STRING=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%`,t.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],t.ASTERISK_ENCODING=148,t}(L),tt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),nt=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},rt=function(e){tt(t,e);function t(){var t=e.call(this)||this;return t.decodeRowResult=``,t.counters=new Int32Array(6),t}return t.prototype.decodeRow=function(e,n,r){var i,a,o,s,c=this.findAsteriskPattern(n),l=n.getNextSet(c[1]),u=n.getSize(),d=this.counters;d.fill(0),this.decodeRowResult=``;var f,p;do{t.recordPattern(n,l,d);var m=this.toPattern(d);if(m<0)throw new M;f=this.patternToChar(m),this.decodeRowResult+=f,p=l;try{for(var h=(i=void 0,nt(d)),g=h.next();!g.done;g=h.next()){var _=g.value;l+=_}}catch(e){i={error:e}}finally{try{g&&!g.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}l=n.getNextSet(l)}while(f!==`*`);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var v=0;try{for(var y=nt(d),b=y.next();!b.done;b=y.next()){var _=b.value;v+=_}}catch(e){o={error:e}}finally{try{b&&!b.done&&(s=y.return)&&s.call(y)}finally{if(o)throw o.error}}if(l===u||!n.get(l)||this.decodeRowResult.length<2)throw new M;this.checkChecksums(this.decodeRowResult),this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-2);var x=this.decodeExtended(this.decodeRowResult),S=(c[1]+c[0])/2,C=p+v/2;return new ye(x,null,0,[new I(S,e),new I(C,e)],N.CODE_93,new Date().getTime())},t.prototype.findAsteriskPattern=function(e){var n=e.getSize(),r=e.getNextSet(0);this.counters.fill(0);for(var i=this.counters,a=r,o=!1,s=i.length,c=0,l=r;l<n;l++)if(e.get(l)!==o)i[c]++;else{if(c===s-1){if(this.toPattern(i)===t.ASTERISK_ENCODING)return new Int32Array([a,l]);a+=i[0]+i[1],i.copyWithin(0,2,2+c-1),i[c-1]=0,i[c]=0,c--}else c++;i[c]=1,o=!o}throw new M},t.prototype.toPattern=function(e){var t,n,r=0;try{for(var i=nt(e),a=i.next();!a.done;a=i.next()){var o=a.value;r+=o}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}for(var s=0,c=e.length,l=0;l<c;l++){var u=Math.round(e[l]*9/r);if(u<1||u>4)return-1;if(l&1)s<<=u;else for(var d=0;d<u;d++)s=s<<1|1}return s},t.prototype.patternToChar=function(e){for(var n=0;n<t.CHARACTER_ENCODINGS.length;n++)if(t.CHARACTER_ENCODINGS[n]===e)return t.ALPHABET_STRING.charAt(n);throw new M},t.prototype.decodeExtended=function(e){for(var t=e.length,n=``,r=0;r<t;r++){var i=e.charAt(r);if(i>=`a`&&i<=`d`){if(r>=t-1)throw new E;var a=e.charAt(r+1),o=`\0`;switch(i){case`d`:if(a>=`A`&&a<=`Z`)o=String.fromCharCode(a.charCodeAt(0)+32);else throw new E;break;case`a`:if(a>=`A`&&a<=`Z`)o=String.fromCharCode(a.charCodeAt(0)-64);else throw new E;break;case`b`:if(a>=`A`&&a<=`E`)o=String.fromCharCode(a.charCodeAt(0)-38);else if(a>=`F`&&a<=`J`)o=String.fromCharCode(a.charCodeAt(0)-11);else if(a>=`K`&&a<=`O`)o=String.fromCharCode(a.charCodeAt(0)+16);else if(a>=`P`&&a<=`T`)o=String.fromCharCode(a.charCodeAt(0)+43);else if(a===`U`)o=`\0`;else if(a===`V`)o=`@`;else if(a===`W`)o="`";else if(a>=`X`&&a<=`Z`)o=``;else throw new E;break;case`c`:if(a>=`A`&&a<=`O`)o=String.fromCharCode(a.charCodeAt(0)-32);else if(a===`Z`)o=`:`;else throw new E}n+=o,r++}else n+=i}return n},t.prototype.checkChecksums=function(e){var t=e.length;this.checkOneChecksum(e,t-2,20),this.checkOneChecksum(e,t-1,15)},t.prototype.checkOneChecksum=function(e,n,r){for(var i=1,a=0,o=n-1;o>=0;o--)a+=i*t.ALPHABET_STRING.indexOf(e.charAt(o)),++i>r&&(i=1);if(e.charAt(n)!==t.ALPHABET_STRING[a%47])throw new f},t.ALPHABET_STRING=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*`,t.CHARACTER_ENCODINGS=[276,328,324,322,296,292,290,336,274,266,424,420,418,404,402,394,360,356,354,308,282,344,332,326,300,278,436,434,428,422,406,410,364,358,310,314,302,468,466,458,366,374,430,294,474,470,306,350],t.ASTERISK_ENCODING=t.CHARACTER_ENCODINGS[47],t}(L),it=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),at=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},ot=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},st=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},ct=function(e){it(t,e);function t(){var t=e.apply(this,ot([],at(arguments),!1))||this;return t.narrowLineWidth=-1,t}return t.prototype.decodeRow=function(e,n,r){var i,a,o=this.decodeStart(n),s=this.decodeEnd(n),c=new j;t.decodeMiddle(n,o[1],s[0],c);var l=c.toString(),u=null;r!=null&&(u=r.get(w.ALLOWED_LENGTHS)),u??=t.DEFAULT_ALLOWED_LENGTHS;var d=l.length,f=!1,p=0;try{for(var m=st(u),h=m.next();!h.done;h=m.next()){var g=h.value;if(d===g){f=!0;break}g>p&&(p=g)}}catch(e){i={error:e}}finally{try{h&&!h.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}if(!f&&d>p&&(f=!0),!f)throw new E;return new ye(l,null,0,[new I(o[1],e),new I(s[0],e)],N.ITF,new Date().getTime())},t.decodeMiddle=function(e,n,r,i){var a=new Int32Array(10),o=new Int32Array(5),s=new Int32Array(5);for(a.fill(0),o.fill(0),s.fill(0);n<r;){L.recordPattern(e,n,a);for(var c=0;c<5;c++){var l=2*c;o[c]=a[l],s[c]=a[l+1]}var u=t.decodeDigit(o);i.append(u.toString()),u=this.decodeDigit(s),i.append(u.toString()),a.forEach(function(e){n+=e})}},t.prototype.decodeStart=function(e){var n=t.skipWhiteSpace(e),r=t.findGuardPattern(e,n,t.START_PATTERN);return this.narrowLineWidth=(r[1]-r[0])/4,this.validateQuietZone(e,r[0]),r},t.prototype.validateQuietZone=function(e,t){var n=this.narrowLineWidth*10;n=n<t?n:t;for(var r=t-1;n>0&&r>=0&&!e.get(r);r--)n--;if(n!==0)throw new M},t.skipWhiteSpace=function(e){var t=e.getSize(),n=e.getNextSet(0);if(n===t)throw new M;return n},t.prototype.decodeEnd=function(e){e.reverse();try{var n=t.skipWhiteSpace(e),r=void 0;try{r=t.findGuardPattern(e,n,t.END_PATTERN_REVERSED[0])}catch(i){i instanceof M&&(r=t.findGuardPattern(e,n,t.END_PATTERN_REVERSED[1]))}this.validateQuietZone(e,r[0]);var i=r[0];return r[0]=e.getSize()-r[1],r[1]=e.getSize()-i,r}finally{e.reverse()}},t.findGuardPattern=function(e,n,r){var i=r.length,a=new Int32Array(i),o=e.getSize(),s=!1,c=0,l=n;a.fill(0);for(var u=n;u<o;u++)if(e.get(u)!==s)a[c]++;else{if(c===i-1){if(L.patternMatchVariance(a,r,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return[l,u];l+=a[0]+a[1],m.arraycopy(a,2,a,0,c-1),a[c-1]=0,a[c]=0,c--}else c++;a[c]=1,s=!s}throw new M},t.decodeDigit=function(e){for(var n=t.MAX_AVG_VARIANCE,r=-1,i=t.PATTERNS.length,a=0;a<i;a++){var o=t.PATTERNS[a],s=L.patternMatchVariance(e,o,t.MAX_INDIVIDUAL_VARIANCE);s<n?(n=s,r=a):s===n&&(r=-1)}if(r>=0)return r%10;throw new M},t.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],t.MAX_AVG_VARIANCE=.38,t.MAX_INDIVIDUAL_VARIANCE=.5,t.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],t.START_PATTERN=Int32Array.from([1,1,1,1]),t.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],t}(L),lt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ut=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},dt=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},ft=function(e){lt(t,e);function t(){var t=e.apply(this,dt([],ut(arguments),!1))||this;return t.decodeRowStringBuffer=``,t}return t.findStartGuardPattern=function(e){for(var n=!1,r,i=0,a=Int32Array.from([0,0,0]);!n;){a=Int32Array.from([0,0,0]),r=t.findGuardPattern(e,i,!1,this.START_END_PATTERN,a);var o=r[0];i=r[1];var s=o-(i-o);s>=0&&(n=e.isRange(s,o,!1))}return r},t.checkChecksum=function(e){return t.checkStandardUPCEANChecksum(e)},t.checkStandardUPCEANChecksum=function(e){var n=e.length;if(n===0)return!1;var r=parseInt(e.charAt(n-1),10);return t.getStandardUPCEANChecksum(e.substring(0,n-1))===r},t.getStandardUPCEANChecksum=function(e){for(var t=e.length,n=0,r=t-1;r>=0;r-=2){var i=e.charAt(r).charCodeAt(0)-48;if(i<0||i>9)throw new E;n+=i}n*=3;for(var r=t-2;r>=0;r-=2){var i=e.charAt(r).charCodeAt(0)-48;if(i<0||i>9)throw new E;n+=i}return(1e3-n)%10},t.decodeEnd=function(e,n){return t.findGuardPattern(e,n,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t.findGuardPatternWithoutCounters=function(e,t,n,r){return this.findGuardPattern(e,t,n,r,new Int32Array(r.length))},t.findGuardPattern=function(e,n,r,i,a){var o=e.getSize();n=r?e.getNextUnset(n):e.getNextSet(n);for(var s=0,c=n,l=i.length,u=r,d=n;d<o;d++)if(e.get(d)!==u)a[s]++;else{if(s===l-1){if(L.patternMatchVariance(a,i,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return Int32Array.from([c,d]);c+=a[0]+a[1];for(var f=a.slice(2,a.length),p=0;p<s-1;p++)a[p]=f[p];a[s-1]=0,a[s]=0,s--}else s++;a[s]=1,u=!u}throw new M},t.decodeDigit=function(e,n,r,i){this.recordPattern(e,r,n);for(var a=this.MAX_AVG_VARIANCE,o=-1,s=i.length,c=0;c<s;c++){var l=i[c],u=L.patternMatchVariance(n,l,t.MAX_INDIVIDUAL_VARIANCE);u<a&&(a=u,o=c)}if(o>=0)return o;throw new M},t.MAX_AVG_VARIANCE=.48,t.MAX_INDIVIDUAL_VARIANCE=.7,t.START_END_PATTERN=Int32Array.from([1,1,1]),t.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),t.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),t.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])],t}(L),pt=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},mt=function(){function e(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=``}return e.prototype.decodeRow=function(t,n,r){var i=this.decodeRowStringBuffer,a=this.decodeMiddle(n,r,i),o=i.toString(),s=e.parseExtensionString(o),c=new ye(o,null,0,[new I((r[0]+r[1])/2,t),new I(a,t)],N.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&c.putAllMetadata(s),c},e.prototype.decodeMiddle=function(t,n,r){var i,a,o=this.decodeMiddleCounters;o[0]=0,o[1]=0,o[2]=0,o[3]=0;for(var s=t.getSize(),c=n[1],l=0,u=0;u<5&&c<s;u++){var d=ft.decodeDigit(t,o,c,ft.L_AND_G_PATTERNS);r+=String.fromCharCode(48+d%10);try{for(var f=(i=void 0,pt(o)),p=f.next();!p.done;p=f.next()){var m=p.value;c+=m}}catch(e){i={error:e}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}d>=10&&(l|=1<<4-u),u!==4&&(c=t.getNextSet(c),c=t.getNextUnset(c))}if(r.length!==5)throw new M;var h=this.determineCheckDigit(l);if(e.extensionChecksum(r.toString())!==h)throw new M;return c},e.extensionChecksum=function(e){for(var t=e.length,n=0,r=t-2;r>=0;r-=2)n+=e.charAt(r).charCodeAt(0)-48;n*=3;for(var r=t-1;r>=0;r-=2)n+=e.charAt(r).charCodeAt(0)-48;return n*=3,n%10},e.prototype.determineCheckDigit=function(e){for(var t=0;t<10;t++)if(e===this.CHECK_DIGIT_ENCODINGS[t])return t;throw new M},e.parseExtensionString=function(t){if(t.length!==5)return null;var n=e.parseExtension5String(t);return n==null?null:new Map([[P.SUGGESTED_PRICE,n]])},e.parseExtension5String=function(e){var t;switch(e.charAt(0)){case`0`:t=`£`;break;case`5`:t=`$`;break;case`9`:switch(e){case`90000`:return null;case`99991`:return`0.00`;case`99990`:return`Used`}t=``;break;default:t=``}var n=parseInt(e.substring(1)),r=(n/100).toString(),i=n%100,a=i<10?`0`+i:i.toString();return t+r+`.`+a},e}(),ht=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},gt=function(){function e(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=``}return e.prototype.decodeRow=function(t,n,r){var i=this.decodeRowStringBuffer,a=this.decodeMiddle(n,r,i),o=i.toString(),s=e.parseExtensionString(o),c=new ye(o,null,0,[new I((r[0]+r[1])/2,t),new I(a,t)],N.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&c.putAllMetadata(s),c},e.prototype.decodeMiddle=function(e,t,n){var r,i,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var o=e.getSize(),s=t[1],c=0,l=0;l<2&&s<o;l++){var u=ft.decodeDigit(e,a,s,ft.L_AND_G_PATTERNS);n+=String.fromCharCode(48+u%10);try{for(var d=(r=void 0,ht(a)),f=d.next();!f.done;f=d.next()){var p=f.value;s+=p}}catch(e){r={error:e}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}u>=10&&(c|=1<<1-l),l!==1&&(s=e.getNextSet(s),s=e.getNextUnset(s))}if(n.length!==2||parseInt(n.toString())%4!==c)throw new M;return s},e.parseExtensionString=function(e){return e.length===2?new Map([[P.ISSUE_NUMBER,parseInt(e)]]):null},e}(),_t=function(){function e(){}return e.decodeRow=function(e,t,n){var r=ft.findGuardPattern(t,n,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return new mt().decodeRow(e,t,r)}catch{return new gt().decodeRow(e,t,r)}},e.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),e}(),vt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),R=function(e){vt(t,e);function t(){var n=e.call(this)||this;n.decodeRowStringBuffer=``,t.L_AND_G_PATTERNS=t.L_PATTERNS.map(function(e){return Int32Array.from(e)});for(var r=10;r<20;r++){for(var i=t.L_PATTERNS[r-10],a=new Int32Array(i.length),o=0;o<i.length;o++)a[o]=i[i.length-o-1];t.L_AND_G_PATTERNS[r]=a}return n}return t.prototype.decodeRow=function(e,n,r){var i=t.findStartGuardPattern(n),a=r==null?null:r.get(w.NEED_RESULT_POINT_CALLBACK);if(a!=null){var o=new I((i[0]+i[1])/2,e);a.foundPossibleResultPoint(o)}var s=this.decodeMiddle(n,i,this.decodeRowStringBuffer),c=s.rowOffset,l=s.resultString;if(a!=null){var u=new I(c,e);a.foundPossibleResultPoint(u)}var d=t.decodeEnd(n,c);if(a!=null){var p=new I((d[0]+d[1])/2,e);a.foundPossibleResultPoint(p)}var m=d[1],h=m+(m-d[0]);if(h>=n.getSize()||!n.isRange(m,h,!1))throw new M;var g=l.toString();if(g.length<8)throw new E;if(!t.checkChecksum(g))throw new f;var _=(i[1]+i[0])/2,v=(d[1]+d[0])/2,y=this.getBarcodeFormat(),b=new ye(g,null,0,[new I(_,e),new I(v,e)],y,new Date().getTime()),x=0;try{var S=_t.decodeRow(e,n,d[1]);b.putMetadata(P.UPC_EAN_EXTENSION,S.getText()),b.putAllMetadata(S.getResultMetadata()),b.addResultPoints(S.getResultPoints()),x=S.getText().length}catch{}var C=r==null?null:r.get(w.ALLOWED_EAN_EXTENSIONS);if(C!=null){var T=!1;for(var ee in C)if(x.toString()===ee){T=!0;break}if(!T)throw new M}return y===N.EAN_13||N.UPC_A,b},t.checkChecksum=function(e){return t.checkStandardUPCEANChecksum(e)},t.checkStandardUPCEANChecksum=function(e){var n=e.length;if(n===0)return!1;var r=parseInt(e.charAt(n-1),10);return t.getStandardUPCEANChecksum(e.substring(0,n-1))===r},t.getStandardUPCEANChecksum=function(e){for(var t=e.length,n=0,r=t-1;r>=0;r-=2){var i=e.charAt(r).charCodeAt(0)-48;if(i<0||i>9)throw new E;n+=i}n*=3;for(var r=t-2;r>=0;r-=2){var i=e.charAt(r).charCodeAt(0)-48;if(i<0||i>9)throw new E;n+=i}return(1e3-n)%10},t.decodeEnd=function(e,n){return t.findGuardPattern(e,n,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t}(ft),yt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),bt=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},xt=function(e){yt(t,e);function t(){var t=e.call(this)||this;return t.decodeMiddleCounters=Int32Array.from([0,0,0,0]),t}return t.prototype.decodeMiddle=function(e,n,r){var i,a,o,s,c=this.decodeMiddleCounters;c[0]=0,c[1]=0,c[2]=0,c[3]=0;for(var l=e.getSize(),u=n[1],d=0,f=0;f<6&&u<l;f++){var p=R.decodeDigit(e,c,u,R.L_AND_G_PATTERNS);r+=String.fromCharCode(48+p%10);try{for(var m=(i=void 0,bt(c)),h=m.next();!h.done;h=m.next()){var g=h.value;u+=g}}catch(e){i={error:e}}finally{try{h&&!h.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}p>=10&&(d|=1<<5-f)}r=t.determineFirstDigit(r,d),u=R.findGuardPattern(e,u,!0,R.MIDDLE_PATTERN,new Int32Array(R.MIDDLE_PATTERN.length).fill(0))[1];for(var f=0;f<6&&u<l;f++){var p=R.decodeDigit(e,c,u,R.L_PATTERNS);r+=String.fromCharCode(48+p);try{for(var _=(o=void 0,bt(c)),v=_.next();!v.done;v=_.next()){var g=v.value;u+=g}}catch(e){o={error:e}}finally{try{v&&!v.done&&(s=_.return)&&s.call(_)}finally{if(o)throw o.error}}}return{rowOffset:u,resultString:r}},t.prototype.getBarcodeFormat=function(){return N.EAN_13},t.determineFirstDigit=function(e,t){for(var n=0;n<10;n++)if(t===this.FIRST_DIGIT_ENCODINGS[n])return e=String.fromCharCode(48+n)+e,e;throw new M},t.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26],t}(R),St=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ct=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},wt=function(e){St(t,e);function t(){var t=e.call(this)||this;return t.decodeMiddleCounters=Int32Array.from([0,0,0,0]),t}return t.prototype.decodeMiddle=function(e,t,n){var r,i,a,o,s=this.decodeMiddleCounters;s[0]=0,s[1]=0,s[2]=0,s[3]=0;for(var c=e.getSize(),l=t[1],u=0;u<4&&l<c;u++){var d=R.decodeDigit(e,s,l,R.L_PATTERNS);n+=String.fromCharCode(48+d);try{for(var f=(r=void 0,Ct(s)),p=f.next();!p.done;p=f.next()){var m=p.value;l+=m}}catch(e){r={error:e}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}l=R.findGuardPattern(e,l,!0,R.MIDDLE_PATTERN,new Int32Array(R.MIDDLE_PATTERN.length).fill(0))[1];for(var u=0;u<4&&l<c;u++){var d=R.decodeDigit(e,s,l,R.L_PATTERNS);n+=String.fromCharCode(48+d);try{for(var h=(a=void 0,Ct(s)),g=h.next();!g.done;g=h.next()){var m=g.value;l+=m}}catch(e){a={error:e}}finally{try{g&&!g.done&&(o=h.return)&&o.call(h)}finally{if(a)throw a.error}}}return{rowOffset:l,resultString:n}},t.prototype.getBarcodeFormat=function(){return N.EAN_8},t}(R),Tt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Et=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Dt=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},Ot=function(e){Tt(t,e);function t(){var t=e.apply(this,Dt([],Et(arguments),!1))||this;return t.ean13Reader=new xt,t}return t.prototype.getBarcodeFormat=function(){return N.UPC_A},t.prototype.decode=function(e,t){return this.maybeReturnResult(this.ean13Reader.decode(e))},t.prototype.decodeRow=function(e,t,n){return this.maybeReturnResult(this.ean13Reader.decodeRow(e,t,n))},t.prototype.decodeMiddle=function(e,t,n){return this.ean13Reader.decodeMiddle(e,t,n)},t.prototype.maybeReturnResult=function(e){var t=e.getText();if(t.charAt(0)===`0`){var n=new ye(t.substring(1),null,null,e.getResultPoints(),N.UPC_A);return e.getResultMetadata()!=null&&n.putAllMetadata(e.getResultMetadata()),n}throw new M},t.prototype.reset=function(){this.ean13Reader.reset()},t}(R),kt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),At=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},jt=function(e){kt(t,e);function t(){var t=e.call(this)||this;return t.decodeMiddleCounters=new Int32Array(4),t}return t.prototype.decodeMiddle=function(e,n,r){var i,a,o=this.decodeMiddleCounters.map(function(e){return e});o[0]=0,o[1]=0,o[2]=0,o[3]=0;for(var s=e.getSize(),c=n[1],l=0,u=0;u<6&&c<s;u++){var d=t.decodeDigit(e,o,c,t.L_AND_G_PATTERNS);r+=String.fromCharCode(48+d%10);try{for(var f=(i=void 0,At(o)),p=f.next();!p.done;p=f.next()){var m=p.value;c+=m}}catch(e){i={error:e}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}d>=10&&(l|=1<<5-u)}return t.determineNumSysAndCheckDigit(new j(r),l),c},t.prototype.decodeEnd=function(e,n){return t.findGuardPatternWithoutCounters(e,n,!0,t.MIDDLE_END_PATTERN)},t.prototype.checkChecksum=function(e){return R.checkChecksum(t.convertUPCEtoUPCA(e))},t.determineNumSysAndCheckDigit=function(e,t){for(var n=0;n<=1;n++)for(var r=0;r<10;r++)if(t===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[n][r]){e.insert(0,`0`+n),e.append(`0`+r);return}throw M.getNotFoundInstance()},t.prototype.getBarcodeFormat=function(){return N.UPC_E},t.convertUPCEtoUPCA=function(e){var t=e.slice(1,7).split(``).map(function(e){return e.charCodeAt(0)}),n=new j;n.append(e.charAt(0));var r=t[5];switch(r){case 0:case 1:case 2:n.appendChars(t,0,2),n.append(r),n.append(`0000`),n.appendChars(t,2,3);break;case 3:n.appendChars(t,0,3),n.append(`00000`),n.appendChars(t,3,2);break;case 4:n.appendChars(t,0,4),n.append(`00000`),n.append(t[4]);break;default:n.appendChars(t,0,5),n.append(`0000`),n.append(r)}return e.length>=8&&n.append(e.charAt(7)),n.toString()},t.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),t.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])],t}(R),Mt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Nt=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Pt=function(e){Mt(t,e);function t(t){var n=e.call(this)||this,r=t==null?null:t.get(w.POSSIBLE_FORMATS),i=[];return r!=null&&(r.indexOf(N.EAN_13)>-1&&i.push(new xt),r.indexOf(N.UPC_A)>-1&&i.push(new Ot),r.indexOf(N.EAN_8)>-1&&i.push(new wt),r.indexOf(N.UPC_E)>-1&&i.push(new jt)),i.length===0&&(i.push(new xt),i.push(new Ot),i.push(new wt),i.push(new jt)),n.readers=i,n}return t.prototype.decodeRow=function(e,t,n){var r,i;try{for(var a=Nt(this.readers),o=a.next();!o.done;o=a.next()){var s=o.value;try{var c=s.decodeRow(e,t,n),l=c.getBarcodeFormat()===N.EAN_13&&c.getText().charAt(0)===`0`,u=n==null?null:n.get(w.POSSIBLE_FORMATS),d=u==null||u.includes(N.UPC_A);if(l&&d){var f=c.getRawBytes(),p=new ye(c.getText().substring(1),f,f?f.length:null,c.getResultPoints(),N.UPC_A);return p.putAllMetadata(c.getResultMetadata()),p}return c}catch{}}}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}throw new M},t.prototype.reset=function(){var e,t;try{for(var n=Nt(this.readers),r=n.next();!r.done;r=n.next())r.value.reset()}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},t}(L),Ft=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),It=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Lt=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},Rt=function(e){Ft(t,e);function t(){var t=e.apply(this,Lt([],It(arguments),!1))||this;return t.CODA_BAR_CHAR_SET={nnnnnww:`0`,nnnnwwn:`1`,nnnwnnw:`2`,wwnnnnn:`3`,nnwnnwn:`4`,wnnnnwn:`5`,nwnnnnw:`6`,nwnnwnn:`7`,nwwnnnn:`8`,wnnwnnn:`9`,nnnwwnn:`-`,nnwwnnn:`$`,wnnnwnw:`:`,wnwnnnw:`/`,wnwnwnn:`.`,nnwwwww:`+`,nnwwnwn:`A`,nwnwnnw:`B`,nnnwnww:`C`,nnnwwwn:`D`},t}return t.prototype.decodeRow=function(e,t,n){var r=this.getValidRowData(t);if(!r)throw new M;var i=this.codaBarDecodeRow(r.row);if(!i)throw new M;return new ye(i,null,0,[new I(r.left,e),new I(r.right,e)],N.CODABAR,new Date().getTime())},t.prototype.getValidRowData=function(e){var t=e.toArray(),n=t.indexOf(!0);if(n===-1)return null;var r=t.lastIndexOf(!0);if(r<=n)return null;t=t.slice(n,r+1);for(var i=[],a=t[0],o=1,s=1;s<t.length;s++)t[s]===a?o++:(a=t[s],i.push(o),o=1);return i.push(o),i.length<23&&(i.length+1)%8!=0?null:{row:i,left:n,right:r}},t.prototype.codaBarDecodeRow=function(e){for(var t=[],n=Math.ceil(e.reduce(function(e,t){return(e+t)/2},0));e.length>0;){var r=e.splice(0,8).splice(0,7).map(function(e){return e<n?`n`:`w`}).join(``);if(this.CODA_BAR_CHAR_SET[r]===void 0)return null;t.push(this.CODA_BAR_CHAR_SET[r])}var i=t.join(``);return this.validCodaBarString(i)?i:null},t.prototype.validCodaBarString=function(e){return/^[A-D].{1,}[A-D]$/.test(e)},t}(L),zt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Bt=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Vt=function(e){zt(t,e);function t(){var t=e.call(this)||this;return t.decodeFinderCounters=new Int32Array(4),t.dataCharacterCounters=new Int32Array(8),t.oddRoundingErrors=[,,,,],t.evenRoundingErrors=[,,,,],t.oddCounts=Array(Math.trunc(t.dataCharacterCounters.length/2)),t.evenCounts=Array(Math.trunc(t.dataCharacterCounters.length/2)),t}return t.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters},t.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters},t.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors},t.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors},t.prototype.getOddCounts=function(){return this.oddCounts},t.prototype.getEvenCounts=function(){return this.evenCounts},t.prototype.parseFinderValue=function(e,n){for(var r=0;r<n.length;r++)if(L.patternMatchVariance(e,n[r],t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return r;throw new M},t.count=function(e){return F.sum(new Int32Array(e))},t.increment=function(e,t){for(var n=0,r=t[0],i=1;i<e.length;i++)t[i]>r&&(r=t[i],n=i);e[n]++},t.decrement=function(e,t){for(var n=0,r=t[0],i=1;i<e.length;i++)t[i]<r&&(r=t[i],n=i);e[n]--},t.isFinderPattern=function(e){var n,r,i=e[0]+e[1],a=i/(i+e[2]+e[3]);if(a>=t.MIN_FINDER_PATTERN_RATIO&&a<=t.MAX_FINDER_PATTERN_RATIO){var o=2**53-1,s=-(2**53-1);try{for(var c=Bt(e),l=c.next();!l.done;l=c.next()){var u=l.value;u>s&&(s=u),u<o&&(o=u)}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return s<10*o}return!1},t.MAX_AVG_VARIANCE=.2,t.MAX_INDIVIDUAL_VARIANCE=.45,t.MIN_FINDER_PATTERN_RATIO=9.5/12,t.MAX_FINDER_PATTERN_RATIO=12.5/14,t}(L),Ht=function(){function e(e,t){this.value=e,this.checksumPortion=t}return e.prototype.getValue=function(){return this.value},e.prototype.getChecksumPortion=function(){return this.checksumPortion},e.prototype.toString=function(){return this.value+`(`+this.checksumPortion+`)`},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.value===n.value&&this.checksumPortion===n.checksumPortion},e.prototype.hashCode=function(){return this.value^this.checksumPortion},e}(),Ut=function(){function e(e,t,n,r,i){this.value=e,this.startEnd=t,this.resultPoints=[],this.resultPoints.push(new I(n,i)),this.resultPoints.push(new I(r,i))}return e.prototype.getValue=function(){return this.value},e.prototype.getStartEnd=function(){return this.startEnd},e.prototype.getResultPoints=function(){return this.resultPoints},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.value===n.value},e.prototype.hashCode=function(){return this.value},e}(),Wt=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Gt=function(){function e(){}return e.getRSSvalue=function(t,n,r){var i,a,o=0;try{for(var s=Wt(t),c=s.next();!c.done;c=s.next()){var l=c.value;o+=l}}catch(e){i={error:e}}finally{try{c&&!c.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}for(var u=0,d=0,f=t.length,p=0;p<f-1;p++){var m=void 0;for(m=1,d|=1<<p;m<t[p];m++,d&=~(1<<p)){var h=e.combins(o-m-1,f-p-2);if(r&&d===0&&o-m-(f-p-1)>=f-p-1&&(h-=e.combins(o-m-(f-p),f-p-2)),f-p-1>1){for(var g=0,_=o-m-(f-p-2);_>n;_--)g+=e.combins(o-m-_-1,f-p-3);h-=g*(f-1-p)}else o-m>n&&h--;u+=h}o-=m}return u},e.combins=function(e,t){var n=0,r=0;e-t>t?(r=t,n=e-t):(r=e-t,n=t);for(var i=1,a=1,o=e;o>n;o--)i*=o,a<=r&&(i=Math.trunc(i/a),a++);for(;a<=r;)i=Math.trunc(i/a),a++;return i},e}(),Kt=function(){function e(){}return e.buildBitArray=function(e){var t=e.length*2-1;e[e.length-1].getRightChar()===null&&--t;for(var n=new S(12*t),r=0,i=e[0].getRightChar().getValue(),a=11;a>=0;--a)i&1<<a&&n.set(r),r++;for(var a=1;a<e.length;++a){for(var o=e[a],s=o.getLeftChar().getValue(),c=11;c>=0;--c)s&1<<c&&n.set(r),r++;if(o.getRightChar()!==null)for(var l=o.getRightChar().getValue(),c=11;c>=0;--c)l&1<<c&&n.set(r),r++}return n},e}(),qt=function(){function e(e,t){this.decodedInformation=e||null,this.finished=!!t}return e.prototype.getDecodedInformation=function(){return this.decodedInformation},e.prototype.isFinished=function(){return this.finished},e}(),Jt;(function(e){e[e.NUMERIC=0]=`NUMERIC`,e[e.ALPHA=1]=`ALPHA`,e[e.ISO_IEC_646=2]=`ISO_IEC_646`})(Jt||={});var Yt=function(){function e(){this.position=0,this.encoding=Jt.NUMERIC}return e.prototype.getPosition=function(){return this.position},e.prototype.setPosition=function(e){this.position=e},e.prototype.incrementPosition=function(e){this.position+=e},e.prototype.isAlpha=function(){return this.encoding===Jt.ALPHA},e.prototype.isNumeric=function(){return this.encoding===Jt.NUMERIC},e.prototype.isIsoIec646=function(){return this.encoding===Jt.ISO_IEC_646},e.prototype.setNumeric=function(){this.encoding=Jt.NUMERIC},e.prototype.setAlpha=function(){this.encoding=Jt.ALPHA},e.prototype.setIsoIec646=function(){this.encoding=Jt.ISO_IEC_646},e}(),Xt=function(){function e(e){this.newPosition=e}return e.prototype.getNewPosition=function(){return this.newPosition},e}(),Zt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Qt=function(e){Zt(t,e);function t(t,n){var r=e.call(this,t)||this;return r.value=n,r}return t.prototype.getValue=function(){return this.value},t.prototype.isFNC1=function(){return this.value===t.FNC1},t.FNC1=`$`,t}(Xt),$t=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),en=function(e){$t(t,e);function t(t,n,r){var i=e.call(this,t)||this;return i.newString=n,r===void 0?(i.remaining=!1,i.remainingValue=0):(i.remaining=!0,i.remainingValue=r),i}return t.prototype.getNewString=function(){return this.newString},t.prototype.isRemaining=function(){return this.remaining},t.prototype.getRemainingValue=function(){return this.remainingValue},t}(Xt),tn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),nn=function(e){tn(t,e);function t(t,n,r){var i=e.call(this,t)||this;if(n<0||n>10||r<0||r>10)throw new E;return i.firstDigit=n,i.secondDigit=r,i}return t.prototype.getFirstDigit=function(){return this.firstDigit},t.prototype.getSecondDigit=function(){return this.secondDigit},t.prototype.getValue=function(){return this.firstDigit*10+this.secondDigit},t.prototype.isFirstDigitFNC1=function(){return this.firstDigit===t.FNC1},t.prototype.isSecondDigitFNC1=function(){return this.secondDigit===t.FNC1},t.FNC1=10,t}(Xt),rn=function(){function e(){}return e.fixed=function(t,n){return function(r){return e.processFixedAI(t,n,r)}},e.variable=function(t,n){return function(r){return e.processVariableAI(t,n,r)}},e.parseFieldsInGeneralPurpose=function(e){if(!e)return null;if(e.length<2)throw new M;var t=e.substring(0,2),n=this.TWO_DIGIT_DATA_LENGTH.get(t);if(n)return n(e);if(e.length<3)throw new M;var r=e.substring(0,3),i=this.THREE_DIGIT_DATA_LENGTH.get(r);if(i)return i(e);var a=this.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH.get(r);if(a)return a(e);if(e.length<4)throw new M;var o=e.substring(0,4),s=this.FOUR_DIGIT_DATA_LENGTH.get(o);if(s)return s(e);throw new M},e.processFixedAI=function(t,n,r){if(r.length<t)throw new M;var i=r.substring(0,t);if(r.length<t+n)throw new M;var a=r.substring(t,t+n),o=r.substring(t+n),s=`(`+i+`)`+a,c=e.parseFieldsInGeneralPurpose(o);return c===null?s:s+c},e.processVariableAI=function(t,n,r){var i=r.substring(0,t),a=r.length<t+n?r.length:t+n,o=r.substring(t,a),s=r.substring(a),c=`(`+i+`)`+o,l=e.parseFieldsInGeneralPurpose(s);return l===null?c:c+l},e.TWO_DIGIT_DATA_LENGTH=(function(){var t=new Map;t.set(`00`,e.fixed(2,18)),t.set(`01`,e.fixed(2,14)),t.set(`02`,e.fixed(2,14)),t.set(`10`,e.variable(2,20)),t.set(`11`,e.fixed(2,6)),t.set(`12`,e.fixed(2,6)),t.set(`13`,e.fixed(2,6)),t.set(`15`,e.fixed(2,6)),t.set(`16`,e.fixed(2,6)),t.set(`17`,e.fixed(2,6)),t.set(`20`,e.fixed(2,2)),t.set(`21`,e.variable(2,20)),t.set(`22`,e.variable(2,29)),t.set(`30`,e.variable(2,8)),t.set(`37`,e.variable(2,8));for(var n=90;n<=99;n++)t.set(String(n),e.variable(2,30));return t})(),e.THREE_DIGIT_DATA_LENGTH=new Map([[`235`,e.variable(3,28)],[`240`,e.variable(3,30)],[`241`,e.variable(3,30)],[`242`,e.variable(3,6)],[`243`,e.variable(3,20)],[`250`,e.variable(3,30)],[`251`,e.variable(3,30)],[`253`,e.variable(3,30)],[`254`,e.variable(3,20)],[`255`,e.variable(3,25)],[`400`,e.variable(3,30)],[`401`,e.variable(3,30)],[`402`,e.fixed(3,17)],[`403`,e.variable(3,30)],[`410`,e.fixed(3,13)],[`411`,e.fixed(3,13)],[`412`,e.fixed(3,13)],[`413`,e.fixed(3,13)],[`414`,e.fixed(3,13)],[`415`,e.fixed(3,13)],[`416`,e.fixed(3,13)],[`417`,e.fixed(3,13)],[`420`,e.variable(3,20)],[`421`,e.variable(3,15)],[`422`,e.fixed(3,3)],[`423`,e.variable(3,15)],[`424`,e.fixed(3,3)],[`425`,e.variable(3,15)],[`426`,e.fixed(3,3)],[`427`,e.variable(3,3)],[`710`,e.variable(3,20)],[`711`,e.variable(3,20)],[`712`,e.variable(3,20)],[`713`,e.variable(3,20)],[`714`,e.variable(3,20)],[`715`,e.variable(3,20)]]),e.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH=(function(){for(var t=new Map,n=310;n<=316;n++)t.set(String(n),e.fixed(4,6));for(var n=320;n<=337;n++)t.set(String(n),e.fixed(4,6));for(var n=340;n<=357;n++)t.set(String(n),e.fixed(4,6));for(var n=360;n<=369;n++)t.set(String(n),e.fixed(4,6));return t.set(`390`,e.variable(4,15)),t.set(`391`,e.variable(4,18)),t.set(`392`,e.variable(4,15)),t.set(`393`,e.variable(4,18)),t.set(`394`,e.fixed(4,4)),t.set(`395`,e.fixed(4,6)),t.set(`703`,e.variable(4,30)),t.set(`723`,e.variable(4,30)),t})(),e.FOUR_DIGIT_DATA_LENGTH=(function(){var t=new Map;return t.set(`4300`,e.variable(4,35)),t.set(`4301`,e.variable(4,35)),t.set(`4302`,e.variable(4,70)),t.set(`4303`,e.variable(4,70)),t.set(`4304`,e.variable(4,70)),t.set(`4305`,e.variable(4,70)),t.set(`4306`,e.variable(4,70)),t.set(`4307`,e.fixed(4,2)),t.set(`4308`,e.variable(4,30)),t.set(`4309`,e.fixed(4,20)),t.set(`4310`,e.variable(4,35)),t.set(`4311`,e.variable(4,35)),t.set(`4312`,e.variable(4,70)),t.set(`4313`,e.variable(4,70)),t.set(`4314`,e.variable(4,70)),t.set(`4315`,e.variable(4,70)),t.set(`4316`,e.variable(4,70)),t.set(`4317`,e.fixed(4,2)),t.set(`4318`,e.variable(4,20)),t.set(`4319`,e.variable(4,30)),t.set(`4320`,e.variable(4,35)),t.set(`4321`,e.fixed(4,1)),t.set(`4322`,e.fixed(4,1)),t.set(`4323`,e.fixed(4,1)),t.set(`4324`,e.fixed(4,10)),t.set(`4325`,e.fixed(4,10)),t.set(`4326`,e.fixed(4,6)),t.set(`7001`,e.fixed(4,13)),t.set(`7002`,e.variable(4,30)),t.set(`7003`,e.fixed(4,10)),t.set(`7004`,e.variable(4,4)),t.set(`7005`,e.variable(4,12)),t.set(`7006`,e.fixed(4,6)),t.set(`7007`,e.variable(4,12)),t.set(`7008`,e.variable(4,3)),t.set(`7009`,e.variable(4,10)),t.set(`7010`,e.variable(4,2)),t.set(`7011`,e.variable(4,10)),t.set(`7020`,e.variable(4,20)),t.set(`7021`,e.variable(4,20)),t.set(`7022`,e.variable(4,20)),t.set(`7023`,e.variable(4,30)),t.set(`7040`,e.fixed(4,4)),t.set(`7240`,e.variable(4,20)),t.set(`8001`,e.fixed(4,14)),t.set(`8002`,e.variable(4,20)),t.set(`8003`,e.variable(4,30)),t.set(`8004`,e.variable(4,30)),t.set(`8005`,e.fixed(4,6)),t.set(`8006`,e.fixed(4,18)),t.set(`8007`,e.variable(4,34)),t.set(`8008`,e.variable(4,12)),t.set(`8009`,e.variable(4,50)),t.set(`8010`,e.variable(4,30)),t.set(`8011`,e.variable(4,12)),t.set(`8012`,e.variable(4,20)),t.set(`8013`,e.variable(4,25)),t.set(`8017`,e.fixed(4,18)),t.set(`8018`,e.fixed(4,18)),t.set(`8019`,e.variable(4,10)),t.set(`8020`,e.variable(4,25)),t.set(`8026`,e.fixed(4,18)),t.set(`8100`,e.fixed(4,6)),t.set(`8101`,e.fixed(4,10)),t.set(`8102`,e.fixed(4,2)),t.set(`8110`,e.variable(4,70)),t.set(`8111`,e.fixed(4,4)),t.set(`8112`,e.variable(4,70)),t.set(`8200`,e.variable(4,70)),t})(),e}(),an=function(){function e(e){this.current=new Yt,this.buffer=new j,this.information=e}return e.prototype.decodeAllCodes=function(e,t){var n=t,r=null;do{var i=this.decodeGeneralPurposeField(n,r),a=rn.parseFieldsInGeneralPurpose(i.getNewString());if(a!==null&&e.append(a),r=i.isRemaining()?``+i.getRemainingValue():null,n===i.getNewPosition())break;n=i.getNewPosition()}while(1);return e.toString()},e.prototype.isStillNumeric=function(e){if(e+7>this.information.getSize())return e+4<=this.information.getSize();for(var t=e;t<e+3;++t)if(this.information.get(t))return!0;return this.information.get(e+3)},e.prototype.decodeNumeric=function(e){if(e+7>this.information.getSize()){var t=this.extractNumericValueFromBitArray(e,4);return t===0?new nn(this.information.getSize(),nn.FNC1,nn.FNC1):new nn(this.information.getSize(),t-1,nn.FNC1)}var n=this.extractNumericValueFromBitArray(e,7),r=Math.trunc((n-8)/11),i=(n-8)%11;return new nn(e+7,r,i)},e.prototype.extractNumericValueFromBitArray=function(t,n){return e.extractNumericValueFromBitArray(this.information,t,n)},e.extractNumericValueFromBitArray=function(e,t,n){for(var r=0,i=0;i<n;++i)e.get(t+i)&&(r|=1<<n-i-1);return r},e.prototype.decodeGeneralPurposeField=function(e,t){this.buffer.setLengthToZero(),t!==null&&this.buffer.append(t),this.current.setPosition(e);var n=this.parseBlocks();return n!==null&&n.isRemaining()?new en(this.current.getPosition(),this.buffer.toString(),n.getRemainingValue()):new en(this.current.getPosition(),this.buffer.toString())},e.prototype.parseBlocks=function(){var e=!1,t;do{var n=this.current.getPosition();if(this.current.isAlpha()?(t=this.parseAlphaBlock(),e=t.isFinished()):this.current.isIsoIec646()?(t=this.parseIsoIec646Block(),e=t.isFinished()):(t=this.parseNumericBlock(),e=t.isFinished()),n===this.current.getPosition()&&!e)break}while(!e);return t.getDecodedInformation()},e.prototype.parseNumericBlock=function(){for(;this.isStillNumeric(this.current.getPosition());){var e=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFirstDigitFNC1()){var t=void 0;return t=e.isSecondDigitFNC1()?new en(this.current.getPosition(),this.buffer.toString()):new en(this.current.getPosition(),this.buffer.toString(),e.getSecondDigit()),new qt(t,!0)}if(this.buffer.append(``+e.getFirstDigit()),e.isSecondDigitFNC1()){var t=new en(this.current.getPosition(),this.buffer.toString());return new qt(t,!0)}this.buffer.append(``+e.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new qt},e.prototype.parseIsoIec646Block=function(){for(;this.isStillIsoIec646(this.current.getPosition());){var e=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFNC1())return new qt(new en(this.current.getPosition(),this.buffer.toString()),!0);this.buffer.append(e.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setAlpha()),new qt},e.prototype.parseAlphaBlock=function(){for(;this.isStillAlpha(this.current.getPosition());){var e=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFNC1())return new qt(new en(this.current.getPosition(),this.buffer.toString()),!0);this.buffer.append(e.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setIsoIec646()),new qt},e.prototype.isStillIsoIec646=function(e){if(e+5>this.information.getSize())return!1;var t=this.extractNumericValueFromBitArray(e,5);if(t>=5&&t<16)return!0;if(e+7>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(e,7);if(n>=64&&n<116)return!0;if(e+8>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(e,8);return r>=232&&r<253},e.prototype.decodeIsoIec646=function(e){var t=this.extractNumericValueFromBitArray(e,5);if(t===15)return new Qt(e+5,Qt.FNC1);if(t>=5&&t<15)return new Qt(e+5,String.fromCharCode(48+t-5));var n=this.extractNumericValueFromBitArray(e,7);if(n>=64&&n<90)return new Qt(e+7,String.fromCharCode(n+1));if(n>=90&&n<116)return new Qt(e+7,String.fromCharCode(n+7));var r=this.extractNumericValueFromBitArray(e,8),i;switch(r){case 232:i=`!`;break;case 233:i=`"`;break;case 234:i=`%`;break;case 235:i=`&`;break;case 236:i=`'`;break;case 237:i=`(`;break;case 238:i=`)`;break;case 239:i=`*`;break;case 240:i=`+`;break;case 241:i=`,`;break;case 242:i=`-`;break;case 243:i=`.`;break;case 244:i=`/`;break;case 245:i=`:`;break;case 246:i=`;`;break;case 247:i=`<`;break;case 248:i=`=`;break;case 249:i=`>`;break;case 250:i=`?`;break;case 251:i=`_`;break;case 252:i=` `;break;default:throw new E}return new Qt(e+8,i)},e.prototype.isStillAlpha=function(e){if(e+5>this.information.getSize())return!1;var t=this.extractNumericValueFromBitArray(e,5);if(t>=5&&t<16)return!0;if(e+6>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(e,6);return n>=16&&n<63},e.prototype.decodeAlphanumeric=function(e){var t=this.extractNumericValueFromBitArray(e,5);if(t===15)return new Qt(e+5,Qt.FNC1);if(t>=5&&t<15)return new Qt(e+5,String.fromCharCode(48+t-5));var n=this.extractNumericValueFromBitArray(e,6);if(n>=32&&n<58)return new Qt(e+6,String.fromCharCode(n+33));var r;switch(n){case 58:r=`*`;break;case 59:r=`,`;break;case 60:r=`-`;break;case 61:r=`.`;break;case 62:r=`/`;break;default:throw new Me(`Decoding invalid alphanumeric value: `+n)}return new Qt(e+6,r)},e.prototype.isAlphaTo646ToAlphaLatch=function(e){if(e+1>this.information.getSize())return!1;for(var t=0;t<5&&t+e<this.information.getSize();++t)if(t===2){if(!this.information.get(e+2))return!1}else if(this.information.get(e+t))return!1;return!0},e.prototype.isAlphaOr646ToNumericLatch=function(e){if(e+3>this.information.getSize())return!1;for(var t=e;t<e+3;++t)if(this.information.get(t))return!1;return!0},e.prototype.isNumericToAlphaNumericLatch=function(e){if(e+1>this.information.getSize())return!1;for(var t=0;t<4&&t+e<this.information.getSize();++t)if(this.information.get(e+t))return!1;return!0},e}(),on=function(){function e(e){this.information=e,this.generalDecoder=new an(e)}return e.prototype.getInformation=function(){return this.information},e.prototype.getGeneralDecoder=function(){return this.generalDecoder},e}(),sn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),cn=function(e){sn(t,e);function t(t){return e.call(this,t)||this}return t.prototype.encodeCompressedGtin=function(e,t){e.append(`(01)`);var n=e.length();e.append(`9`),this.encodeCompressedGtinWithoutAI(e,t,n)},t.prototype.encodeCompressedGtinWithoutAI=function(e,n,r){for(var i=0;i<4;++i){var a=this.getGeneralDecoder().extractNumericValueFromBitArray(n+10*i,10);a<100&&e.append(`0`),a<10&&e.append(`0`),e.append(``+a)}t.appendCheckDigit(e,r)},t.appendCheckDigit=function(e,t){for(var n=0,r=0;r<13;r++){var i=e.charAt(r+t).charCodeAt(0)-48;n+=r&1?i:3*i}n=10-n%10,n===10&&(n=0),e.append(``+n)},t.GTIN_SIZE=40,t}(on),ln=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),un=function(e){ln(t,e);function t(t){return e.call(this,t)||this}return t.prototype.parseInformation=function(){var e=new j;e.append(`(01)`);var n=e.length(),r=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE,4);return e.append(``+r),this.encodeCompressedGtinWithoutAI(e,t.HEADER_SIZE+4,n),this.getGeneralDecoder().decodeAllCodes(e,t.HEADER_SIZE+44)},t.HEADER_SIZE=4,t}(cn),dn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),fn=function(e){dn(t,e);function t(t){return e.call(this,t)||this}return t.prototype.parseInformation=function(){var e=new j;return this.getGeneralDecoder().decodeAllCodes(e,t.HEADER_SIZE)},t.HEADER_SIZE=5,t}(on),pn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),mn=function(e){pn(t,e);function t(t){return e.call(this,t)||this}return t.prototype.encodeCompressedWeight=function(e,t,n){var r=this.getGeneralDecoder().extractNumericValueFromBitArray(t,n);this.addWeightCode(e,r);for(var i=this.checkWeight(r),a=1e5,o=0;o<5;++o)i<a&&e.append(`0`),a=Math.trunc(a/10);e.append(``+i)},t}(cn),hn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),gn=function(e){hn(t,e);function t(t){return e.call(this,t)||this}return t.prototype.parseInformation=function(){if(this.getInformation().getSize()!==t.HEADER_SIZE+mn.GTIN_SIZE+t.WEIGHT_SIZE)throw new M;var e=new j;return this.encodeCompressedGtin(e,t.HEADER_SIZE),this.encodeCompressedWeight(e,t.HEADER_SIZE+mn.GTIN_SIZE,t.WEIGHT_SIZE),e.toString()},t.HEADER_SIZE=5,t.WEIGHT_SIZE=15,t}(mn),_n=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),vn=function(e){_n(t,e);function t(t){return e.call(this,t)||this}return t.prototype.addWeightCode=function(e,t){e.append(`(3103)`)},t.prototype.checkWeight=function(e){return e},t}(gn),yn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),bn=function(e){yn(t,e);function t(t){return e.call(this,t)||this}return t.prototype.addWeightCode=function(e,t){t<1e4?e.append(`(3202)`):e.append(`(3203)`)},t.prototype.checkWeight=function(e){return e<1e4?e:e-1e4},t}(gn),xn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Sn=function(e){xn(t,e);function t(t){return e.call(this,t)||this}return t.prototype.parseInformation=function(){if(this.getInformation().getSize()<t.HEADER_SIZE+cn.GTIN_SIZE)throw new M;var e=new j;this.encodeCompressedGtin(e,t.HEADER_SIZE);var n=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+cn.GTIN_SIZE,t.LAST_DIGIT_SIZE);e.append(`(392`),e.append(``+n),e.append(`)`);var r=this.getGeneralDecoder().decodeGeneralPurposeField(t.HEADER_SIZE+cn.GTIN_SIZE+t.LAST_DIGIT_SIZE,null);return e.append(r.getNewString()),e.toString()},t.HEADER_SIZE=8,t.LAST_DIGIT_SIZE=2,t}(cn),Cn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),wn=function(e){Cn(t,e);function t(t){return e.call(this,t)||this}return t.prototype.parseInformation=function(){if(this.getInformation().getSize()<t.HEADER_SIZE+cn.GTIN_SIZE)throw new M;var e=new j;this.encodeCompressedGtin(e,t.HEADER_SIZE);var n=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+cn.GTIN_SIZE,t.LAST_DIGIT_SIZE);e.append(`(393`),e.append(``+n),e.append(`)`);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+cn.GTIN_SIZE+t.LAST_DIGIT_SIZE,t.FIRST_THREE_DIGITS_SIZE);r<100&&e.append(`0`),r<10&&e.append(`0`),e.append(``+r);var i=this.getGeneralDecoder().decodeGeneralPurposeField(t.HEADER_SIZE+cn.GTIN_SIZE+t.LAST_DIGIT_SIZE+t.FIRST_THREE_DIGITS_SIZE,null);return e.append(i.getNewString()),e.toString()},t.HEADER_SIZE=8,t.LAST_DIGIT_SIZE=2,t.FIRST_THREE_DIGITS_SIZE=10,t}(cn),Tn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),En=function(e){Tn(t,e);function t(t,n,r){var i=e.call(this,t)||this;return i.dateCode=r,i.firstAIdigits=n,i}return t.prototype.parseInformation=function(){if(this.getInformation().getSize()!==t.HEADER_SIZE+t.GTIN_SIZE+t.WEIGHT_SIZE+t.DATE_SIZE)throw new M;var e=new j;return this.encodeCompressedGtin(e,t.HEADER_SIZE),this.encodeCompressedWeight(e,t.HEADER_SIZE+t.GTIN_SIZE,t.WEIGHT_SIZE),this.encodeCompressedDate(e,t.HEADER_SIZE+t.GTIN_SIZE+t.WEIGHT_SIZE),e.toString()},t.prototype.encodeCompressedDate=function(e,n){var r=this.getGeneralDecoder().extractNumericValueFromBitArray(n,t.DATE_SIZE);if(r!==38400){e.append(`(`),e.append(this.dateCode),e.append(`)`);var i=r%32;r=Math.trunc(r/32);var a=r%12+1;r=Math.trunc(r/12);var o=r;o<10&&e.append(`0`),e.append(``+o),a<10&&e.append(`0`),e.append(``+a),i<10&&e.append(`0`),e.append(``+i)}},t.prototype.addWeightCode=function(e,t){e.append(`(`),e.append(this.firstAIdigits),e.append(``+Math.trunc(t/1e5)),e.append(`)`)},t.prototype.checkWeight=function(e){return e%1e5},t.HEADER_SIZE=8,t.WEIGHT_SIZE=20,t.DATE_SIZE=16,t}(mn);function Dn(e){if(e.get(1))return new un(e);if(!e.get(2))return new fn(e);switch(an.extractNumericValueFromBitArray(e,1,4)){case 4:return new vn(e);case 5:return new bn(e)}switch(an.extractNumericValueFromBitArray(e,1,5)){case 12:return new Sn(e);case 13:return new wn(e)}switch(an.extractNumericValueFromBitArray(e,1,7)){case 56:return new En(e,`310`,`11`);case 57:return new En(e,`320`,`11`);case 58:return new En(e,`310`,`13`);case 59:return new En(e,`320`,`13`);case 60:return new En(e,`310`,`15`);case 61:return new En(e,`320`,`15`);case 62:return new En(e,`310`,`17`);case 63:return new En(e,`320`,`17`)}throw new Me(`unknown decoder: `+e)}var On=function(){function e(e,t,n){this.leftChar=e,this.rightChar=t,this.finderPattern=n}return e.prototype.getLeftChar=function(){return this.leftChar},e.prototype.getRightChar=function(){return this.rightChar},e.prototype.getFinderPattern=function(){return this.finderPattern},e.prototype.mustBeLast=function(){return this.rightChar===null},e.prototype.toString=function(){return`[ `+this.leftChar+`, `+this.rightChar+` : `+(this.finderPattern===null?`null`:this.finderPattern.getValue())+` ]`},e.equals=function(t,n){return n===null?t===null:n instanceof e&&(t.leftChar===null?n.leftChar===null:t.leftChar.equals(n.leftChar))&&(t.rightChar===null?n.rightChar===null:t.rightChar.equals(n.rightChar))&&(t.finderPattern===null?n.finderPattern===null:t.finderPattern.equals(n.finderPattern))},e.prototype.hashCode=function(){return e.hashNotNull(this.leftChar)^e.hashNotNull(this.rightChar)^e.hashNotNull(this.finderPattern)},e.hashNotNull=function(e){return e===null?0:e.hashCode()},e}(),kn=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},An=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},jn=function(){function e(e,t){this.pairs=An([],kn(e),!1),this.rowNumber=t}return e.prototype.getPairs=function(){return this.pairs},e.prototype.getRowNumber=function(){return this.rowNumber},e.prototype.isEquivalent=function(t){return e.listEquals(this.getPairs(),t)},e.prototype.toString=function(){return`{ `+this.pairs+` }`},e.equals=function(t,n){return t===null?n===null:n instanceof e&&e.listEquals(t.pairs,n.getPairs())},e.listEquals=function(e,t){return e.length===t.length&&e.every(function(e,n){var r=t[n];return On.equals(e,r)})},e}(),Mn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Nn=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Pn=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},Fn=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},In=function(e){Mn(t,e);function t(){var n=e.apply(this,Pn([],Nn(arguments),!1))||this;return n.pairs=Array(t.MAX_PAIRS),n.rows=[],n.startEnd=[0,0],n.startFromEven=!1,n}return t.prototype.decodeRow=function(e,n,r){this.startFromEven=!1;try{return t.constructResult(this.decodeRow2pairs(e,n))}catch(e){if(!(e instanceof M))throw e}return this.startFromEven=!0,t.constructResult(this.decodeRow2pairs(e,n))},t.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},t.prototype.decodeRow2pairs=function(e,n){this.pairs.length=0;for(var r=!1;!r;)try{this.pairs.push(this.retrieveNextPair(n,this.pairs,e))}catch(e){if(e instanceof M){if(this.pairs.length===0)throw e;r=!0}else throw e}if(this.checkChecksum()&&t.isValidSequence(this.pairs,!0))return this.pairs;var i=this.rows.length>0;if(this.storeRow(e),i){var a=this.checkRowsBoolean(!1);if(a!==null||(a=this.checkRowsBoolean(!0),a!==null))return a}throw new M},t.prototype.checkRowsBoolean=function(e){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,e&&this.rows.reverse();var t=null;try{t=this.checkRows([],0)}catch(e){if(!(e instanceof M))throw e}return e&&this.rows.reverse(),t},t.prototype.checkRows=function(e,n){for(var r,i=n;i<this.rows.length;i++){var a=this.rows[i];(r=this.pairs).push.apply(r,Pn([],Nn(a.getPairs()),!1));var o=a.getPairs().length;if(t.isValidSequence(this.pairs,!1)){if(this.checkChecksum())return this.pairs;e.push(a);try{return this.checkRows(e,i+1)}catch(t){if(t instanceof M)e.pop(),this.pairs.splice(this.pairs.length-o,o);else throw t}}else this.pairs.splice(this.pairs.length-o,o)}throw new M},t.isValidSequence=function(e,n){var r,i;try{for(var a=Fn(t.FINDER_PATTERN_SEQUENCES),o=a.next();!o.done;o=a.next()){var s=o.value;if(n?e.length===s.length:e.length<=s.length){for(var c=!0,l=0;l<e.length;l++)if(e[l].getFinderPattern().getValue()!==s[l]){c=!1;break}if(c)return!0}}}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return!1},t.mayFollow=function(e,t){var n,r;if(e.length===0)return!0;try{for(var i=Fn(this.FINDER_PATTERN_SEQUENCES),a=i.next();!a.done;a=i.next()){var o=a.value;if(e.length+1<=o.length){for(var s=e.length;s<o.length;s++)if(o[s]===t){for(var c=!0,l=0;l<e.length;l++)if(o[s-l-1]!==e[e.length-l-1].getFinderPattern().getValue()){c=!1;break}if(c)return!0}}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1},t.prototype.storeRow=function(e){for(var n=0,r=!1,i=!1;n<this.rows.length;){var a=this.rows[n];if(a.getRowNumber()>e){i=a.isEquivalent(this.pairs);break}r=a.isEquivalent(this.pairs),n++}i||r||t.isPartialRow(this.pairs,this.rows)||(this.rows.splice(n,0,new jn(this.pairs,e)),this.removePartialRows(this.pairs,this.rows))},t.prototype.removePartialRows=function(e,t){for(var n,r,i=t.length-1;i>=0;i--){var a=t[i];if(a.getPairs().length!==e.length){var o=!0,s=function(t){if(!e.some(function(e){return On.equals(t,e)}))return o=!1,`break`};try{for(var c=(n=void 0,Fn(a.getPairs())),l=c.next();!l.done;l=c.next()){var u=l.value;if(s(u)===`break`)break}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}o&&t.splice(i,1)}}},t.isPartialRow=function(e,t){var n,r,i,a,o,s;try{for(var c=Fn(t),l=c.next();!l.done;l=c.next()){var u=l.value,d=!0;try{for(var f=(i=void 0,Fn(e)),p=f.next();!p.done;p=f.next()){var m=p.value,h=!1;try{for(var g=(o=void 0,Fn(u.getPairs())),_=g.next();!_.done;_=g.next()){var v=_.value;if(On.equals(m,v)){h=!0;break}}}catch(e){o={error:e}}finally{try{_&&!_.done&&(s=g.return)&&s.call(g)}finally{if(o)throw o.error}}if(!h){d=!1;break}}}catch(e){i={error:e}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}if(d)return!0}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return!1},t.prototype.getRows=function(){return this.rows},t.constructResult=function(e){var t=Dn(Kt.buildBitArray(e)).parseInformation(),n=e[0].getFinderPattern().getResultPoints(),r=e[e.length-1].getFinderPattern().getResultPoints();return new ye(t,null,null,[n[0],n[1],r[0],r[1]],N.RSS_EXPANDED,null)},t.prototype.checkChecksum=function(){var e=this.pairs[0],t=e.getLeftChar(),n=e.getRightChar();if(n===null)return!1;for(var r=n.getChecksumPortion(),i=2,a=1;a<this.pairs.length;++a){var o=this.pairs[a];r+=o.getLeftChar().getChecksumPortion(),i++;var s=o.getRightChar();s!==null&&(r+=s.getChecksumPortion(),i++)}return r%=211,211*(i-4)+r===t.getValue()},t.getNextSecondBar=function(e,t){var n=0;return e.get(t)?(n=e.getNextUnset(t),n=e.getNextSet(n)):(n=e.getNextSet(t),n=e.getNextUnset(n)),n},t.prototype.retrieveNextPair=function(e,n,r){var i=n.length%2==0;this.startFromEven&&(i=!i);var a=null,o=null,s=!0,c=-1;do if(this.findNextPair(e,n,c),a=this.parseFoundFinderPattern(e,r,i,n),a===null)c=t.getNextSecondBar(e,this.startEnd[0]);else try{o=this.decodeDataCharacter(e,a,i,!0),s=!1}catch(n){if(n instanceof M)c=t.getNextSecondBar(e,this.startEnd[0]);else throw n}while(s);if(n.length>0&&n[n.length-1].mustBeLast())throw new M;var l=null;try{l=this.decodeDataCharacter(e,a,i,!1)}catch(e){if(e instanceof M)l=null;else throw e}return new On(o,l,a)},t.prototype.findNextPair=function(e,n,r){var i=this.getDecodeFinderCounters();i[0]=0,i[1]=0,i[2]=0,i[3]=0;var a=e.getSize(),o=0;o=r>=0?r:n.length===0?0:n[n.length-1].getFinderPattern().getStartEnd()[1];var s=n.length%2!=0;this.startFromEven&&(s=!s);for(var c=!1;o<a&&(c=!e.get(o),c);)o++;for(var l=0,u=o,d=o;d<a;d++)if(e.get(d)!==c)i[l]++;else{if(l===3){if(s&&t.reverseCounters(i),t.isFinderPattern(i)){this.startEnd[0]=u,this.startEnd[1]=d;return}s&&t.reverseCounters(i),u+=i[0]+i[1],i[0]=i[2],i[1]=i[3],i[2]=0,i[3]=0,l--}else l++;i[l]=1,c=!c}throw new M},t.reverseCounters=function(e){for(var t=e.length,n=0;n<Math.trunc(t/2);++n){var r=e[n];e[n]=e[t-n-1],e[t-n-1]=r}},t.prototype.parseFoundFinderPattern=function(e,n,r,i){var a=0,o=0,s=0;if(r){for(var c=this.startEnd[0]-1;c>=0&&!e.get(c);)c--;c++,a=this.startEnd[0]-c,o=c,s=this.startEnd[1]}else o=this.startEnd[0],s=e.getNextUnset(this.startEnd[1]+1),a=s-this.startEnd[1];var l=this.getDecodeFinderCounters();m.arraycopy(l,0,l,1,l.length-1),l[0]=a;var u=0;try{u=this.parseFinderValue(l,t.FINDER_PATTERNS)}catch(e){if(e instanceof M)return null;throw e}if(!t.mayFollow(i,u))return null;if(i.length>0){var d=i[i.length-1],f=d.getFinderPattern().getStartEnd()[0],p=d.getFinderPattern().getStartEnd()[1],h=(p-f)/t.FINDER_PATTERN_MODULES*t.DATA_CHARACTER_MODULES,g=p+2*h*(1-t.MAX_FINDER_PATTERN_DISTANCE_VARIANCE),_=p+2*h*(1+t.MAX_FINDER_PATTERN_DISTANCE_VARIANCE);if(o<g||o>_)return null}return new Ut(u,[o,s],o,s,n)},t.prototype.decodeDataCharacter=function(e,n,r,i){for(var a=this.getDataCharacterCounters(),o=0;o<a.length;o++)a[o]=0;if(i)t.recordPatternInReverse(e,n.getStartEnd()[0],a);else{t.recordPattern(e,n.getStartEnd()[1],a);for(var s=0,c=a.length-1;s<c;s++,c--){var l=a[s];a[s]=a[c],a[c]=l}}var u=17,d=F.sum(new Int32Array(a))/u,f=(n.getStartEnd()[1]-n.getStartEnd()[0])/15;if(Math.abs(d-f)/f>.3)throw new M;for(var p=this.getOddCounts(),m=this.getEvenCounts(),h=this.getOddRoundingErrors(),g=this.getEvenRoundingErrors(),s=0;s<a.length;s++){var _=1*a[s]/d,v=Math.trunc(_+.5);if(v<1){if(_<.3)throw new M;v=1}else if(v>8){if(_>8.7)throw new M;v=8}var y=Math.trunc(s/2);s&1?(m[y]=v,g[y]=_-v):(p[y]=v,h[y]=_-v)}this.adjustOddEvenCounts(u);for(var b=4*n.getValue()+(r?0:2)+ +!i-1,x=0,S=0,s=p.length-1;s>=0;s--){if(t.isNotA1left(n,r,i)){var C=t.WEIGHTS[b][2*s];S+=p[s]*C}x+=p[s]}for(var w=0,s=m.length-1;s>=0;s--)if(t.isNotA1left(n,r,i)){var C=t.WEIGHTS[b][2*s+1];w+=m[s]*C}var T=S+w;if(x&1||x>13||x<4)throw new M;var E=Math.trunc((13-x)/2),ee=t.SYMBOL_WIDEST[E],D=9-ee,O=Gt.getRSSvalue(p,ee,!0),k=Gt.getRSSvalue(m,D,!1),te=t.EVEN_TOTAL_SUBSET[E],ne=t.GSUM[E];return new Ht(O*te+k+ne,T)},t.isNotA1left=function(e,t,n){return!(e.getValue()===0&&t&&n)},t.prototype.adjustOddEvenCounts=function(e){var n=F.sum(new Int32Array(this.getOddCounts())),r=F.sum(new Int32Array(this.getEvenCounts())),i=!1,a=!1;n>13?a=!0:n<4&&(i=!0);var o=!1,s=!1;r>13?s=!0:r<4&&(o=!0);var c=n+r-e,l=(n&1)==1,u=!(r&1);if(c===1){if(l){if(u)throw new M;a=!0}else{if(!u)throw new M;s=!0}}else if(c===-1){if(l){if(u)throw new M;i=!0}else{if(!u)throw new M;o=!0}}else if(c===0){if(l){if(!u)throw new M;n<r?(i=!0,s=!0):(a=!0,o=!0)}else if(u)throw new M}else throw new M;if(i){if(a)throw new M;t.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(a&&t.decrement(this.getOddCounts(),this.getOddRoundingErrors()),o){if(s)throw new M;t.increment(this.getEvenCounts(),this.getOddRoundingErrors())}s&&t.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},t.SYMBOL_WIDEST=[7,5,4,3,1],t.EVEN_TOTAL_SUBSET=[4,20,52,104,204],t.GSUM=[0,348,1388,2948,3988],t.FINDER_PATTERNS=[Int32Array.from([1,8,4,1]),Int32Array.from([3,6,4,1]),Int32Array.from([3,4,6,1]),Int32Array.from([3,2,8,1]),Int32Array.from([2,6,5,1]),Int32Array.from([2,2,9,1])],t.WEIGHTS=[[1,3,9,27,81,32,96,77],[20,60,180,118,143,7,21,63],[189,145,13,39,117,140,209,205],[193,157,49,147,19,57,171,91],[62,186,136,197,169,85,44,132],[185,133,188,142,4,12,36,108],[113,128,173,97,80,29,87,50],[150,28,84,41,123,158,52,156],[46,138,203,187,139,206,196,166],[76,17,51,153,37,111,122,155],[43,129,176,106,107,110,119,146],[16,48,144,10,30,90,59,177],[109,116,137,200,178,112,125,164],[70,210,208,202,184,130,179,115],[134,191,151,31,93,68,204,190],[148,22,66,198,172,94,71,2],[6,18,54,162,64,192,154,40],[120,149,25,75,14,42,126,167],[79,26,78,23,69,207,199,175],[103,98,83,38,114,131,182,124],[161,61,183,127,170,88,53,159],[55,165,73,8,24,72,5,15],[45,135,194,160,58,174,100,89]],t.FINDER_PAT_A=0,t.FINDER_PAT_B=1,t.FINDER_PAT_C=2,t.FINDER_PAT_D=3,t.FINDER_PAT_E=4,t.FINDER_PAT_F=5,t.FINDER_PATTERN_SEQUENCES=[[t.FINDER_PAT_A,t.FINDER_PAT_A],[t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B],[t.FINDER_PAT_A,t.FINDER_PAT_C,t.FINDER_PAT_B,t.FINDER_PAT_D],[t.FINDER_PAT_A,t.FINDER_PAT_E,t.FINDER_PAT_B,t.FINDER_PAT_D,t.FINDER_PAT_C],[t.FINDER_PAT_A,t.FINDER_PAT_E,t.FINDER_PAT_B,t.FINDER_PAT_D,t.FINDER_PAT_D,t.FINDER_PAT_F],[t.FINDER_PAT_A,t.FINDER_PAT_E,t.FINDER_PAT_B,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_F,t.FINDER_PAT_F],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_D],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_E],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_F,t.FINDER_PAT_F],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_E,t.FINDER_PAT_F,t.FINDER_PAT_F]],t.MAX_PAIRS=11,t.FINDER_PATTERN_MODULES=15,t.DATA_CHARACTER_MODULES=17,t.MAX_FINDER_PATTERN_DISTANCE_VARIANCE=.1,t}(Vt),Ln=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Rn=function(e){Ln(t,e);function t(t,n,r){var i=e.call(this,t,n)||this;return i.count=0,i.finderPattern=r,i}return t.prototype.getFinderPattern=function(){return this.finderPattern},t.prototype.getCount=function(){return this.count},t.prototype.incrementCount=function(){this.count++},t}(Ht),zn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Bn=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Vn=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},Hn=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Un=function(e){zn(t,e);function t(){var t=e.apply(this,Vn([],Bn(arguments),!1))||this;return t.possibleLeftPairs=[],t.possibleRightPairs=[],t}return t.prototype.decodeRow=function(e,n,r){var i,a,o,s,c=this.decodePair(n,!1,e,r);t.addOrTally(this.possibleLeftPairs,c),n.reverse();var l=this.decodePair(n,!0,e,r);t.addOrTally(this.possibleRightPairs,l),n.reverse();try{for(var u=Hn(this.possibleLeftPairs),d=u.next();!d.done;d=u.next()){var f=d.value;if(f.getCount()>1)try{for(var p=(o=void 0,Hn(this.possibleRightPairs)),m=p.next();!m.done;m=p.next()){var h=m.value;if(h.getCount()>1&&t.checkChecksum(f,h))return t.constructResult(f,h)}}catch(e){o={error:e}}finally{try{m&&!m.done&&(s=p.return)&&s.call(p)}finally{if(o)throw o.error}}}}catch(e){i={error:e}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(i)throw i.error}}throw new M},t.addOrTally=function(e,t){var n,r;if(t!==null){var i=!1;try{for(var a=Hn(e),o=a.next();!o.done;o=a.next()){var s=o.value;if(s.getValue()===t.getValue()){s.incrementCount(),i=!0;break}}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}i||e.push(t)}},t.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},t.constructResult=function(e,t){for(var n=4537077*e.getValue()+t.getValue(),r=String(n),i=new j,a=13-r.length;a>0;a--)i.append(`0`);i.append(r);for(var o=0,a=0;a<13;a++){var s=i.charAt(a).charCodeAt(0)-48;o+=a&1?s:3*s}o=10-o%10,o===10&&(o=0),i.append(o.toString());var c=e.getFinderPattern().getResultPoints(),l=t.getFinderPattern().getResultPoints();return new ye(i.toString(),null,0,[c[0],c[1],l[0],l[1]],N.RSS_14,new Date().getTime())},t.checkChecksum=function(e,t){var n=(e.getChecksumPortion()+16*t.getChecksumPortion())%79,r=9*e.getFinderPattern().getValue()+t.getFinderPattern().getValue();return r>72&&r--,r>8&&r--,n===r},t.prototype.decodePair=function(e,t,n,r){try{var i=this.findFinderPattern(e,t),a=this.parseFoundFinderPattern(e,n,t,i),o=r==null?null:r.get(w.NEED_RESULT_POINT_CALLBACK);if(o!=null){var s=(i[0]+i[1]-1)/2;t&&(s=e.getSize()-1-s),o.foundPossibleResultPoint(new I(s,n))}var c=this.decodeDataCharacter(e,a,!0),l=this.decodeDataCharacter(e,a,!1);return new Rn(1597*c.getValue()+l.getValue(),c.getChecksumPortion()+4*l.getChecksumPortion(),a)}catch(e){if(e instanceof M)return null;throw e}},t.prototype.decodeDataCharacter=function(e,n,r){for(var i=this.getDataCharacterCounters(),a=0;a<i.length;a++)i[a]=0;if(r)L.recordPatternInReverse(e,n.getStartEnd()[0],i);else{L.recordPattern(e,n.getStartEnd()[1],i);for(var o=0,s=i.length-1;o<s;o++,s--){var c=i[o];i[o]=i[s],i[s]=c}}for(var l=r?16:15,u=F.sum(new Int32Array(i))/l,d=this.getOddCounts(),f=this.getEvenCounts(),p=this.getOddRoundingErrors(),m=this.getEvenRoundingErrors(),o=0;o<i.length;o++){var h=i[o]/u,g=Math.floor(h+.5);g<1?g=1:g>8&&(g=8);var _=Math.floor(o/2);o&1?(f[_]=g,m[_]=h-g):(d[_]=g,p[_]=h-g)}this.adjustOddEvenCounts(r,l);for(var v=0,y=0,o=d.length-1;o>=0;o--)y*=9,y+=d[o],v+=d[o];for(var b=0,x=0,o=f.length-1;o>=0;o--)b*=9,b+=f[o],x+=f[o];var S=y+3*b;if(r){if(v&1||v>12||v<4)throw new M;var C=(12-v)/2,w=t.OUTSIDE_ODD_WIDEST[C],T=9-w,E=Gt.getRSSvalue(d,w,!1),ee=Gt.getRSSvalue(f,T,!0),D=t.OUTSIDE_EVEN_TOTAL_SUBSET[C],O=t.OUTSIDE_GSUM[C];return new Ht(E*D+ee+O,S)}if(x&1||x>10||x<4)throw new M;var C=(10-x)/2,w=t.INSIDE_ODD_WIDEST[C],T=9-w,E=Gt.getRSSvalue(d,w,!0),ee=Gt.getRSSvalue(f,T,!1),k=t.INSIDE_ODD_TOTAL_SUBSET[C],O=t.INSIDE_GSUM[C];return new Ht(ee*k+E+O,S)},t.prototype.findFinderPattern=function(e,t){var n=this.getDecodeFinderCounters();n[0]=0,n[1]=0,n[2]=0,n[3]=0;for(var r=e.getSize(),i=!1,a=0;a<r&&(i=!e.get(a),t!==i);)a++;for(var o=0,s=a,c=a;c<r;c++)if(e.get(c)!==i)n[o]++;else{if(o===3){if(Vt.isFinderPattern(n))return[s,c];s+=n[0]+n[1],n[0]=n[2],n[1]=n[3],n[2]=0,n[3]=0,o--}else o++;n[o]=1,i=!i}throw new M},t.prototype.parseFoundFinderPattern=function(e,n,r,i){for(var a=e.get(i[0]),o=i[0]-1;o>=0&&a!==e.get(o);)o--;o++;var s=i[0]-o,c=this.getDecodeFinderCounters(),l=new Int32Array(c.length);m.arraycopy(c,0,l,1,c.length-1),l[0]=s;var u=this.parseFinderValue(l,t.FINDER_PATTERNS),d=o,f=i[1];return r&&(d=e.getSize()-1-d,f=e.getSize()-1-f),new Ut(u,[o,i[1]],d,f,n)},t.prototype.adjustOddEvenCounts=function(e,t){var n=F.sum(new Int32Array(this.getOddCounts())),r=F.sum(new Int32Array(this.getEvenCounts())),i=!1,a=!1,o=!1,s=!1;e?(n>12?a=!0:n<4&&(i=!0),r>12?s=!0:r<4&&(o=!0)):(n>11?a=!0:n<5&&(i=!0),r>10?s=!0:r<4&&(o=!0));var c=n+r-t,l=(n&1)==+!!e,u=(r&1)==1;if(c===1){if(l){if(u)throw new M;a=!0}else{if(!u)throw new M;s=!0}}else if(c===-1){if(l){if(u)throw new M;i=!0}else{if(!u)throw new M;o=!0}}else if(c===0){if(l){if(!u)throw new M;n<r?(i=!0,s=!0):(a=!0,o=!0)}else if(u)throw new M}else throw new M;if(i){if(a)throw new M;Vt.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(a&&Vt.decrement(this.getOddCounts(),this.getOddRoundingErrors()),o){if(s)throw new M;Vt.increment(this.getEvenCounts(),this.getOddRoundingErrors())}s&&Vt.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},t.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],t.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],t.OUTSIDE_GSUM=[0,161,961,2015,2715],t.INSIDE_GSUM=[0,336,1036,1516],t.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],t.INSIDE_ODD_WIDEST=[2,4,6,8],t.FINDER_PATTERNS=[Int32Array.from([3,8,2,1]),Int32Array.from([3,5,5,1]),Int32Array.from([3,3,7,1]),Int32Array.from([3,1,9,1]),Int32Array.from([2,7,4,1]),Int32Array.from([2,5,6,1]),Int32Array.from([2,3,8,1]),Int32Array.from([1,5,7,1]),Int32Array.from([1,3,9,1])],t}(Vt),Wn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Gn=function(e){Wn(t,e);function t(t){var n=e.call(this)||this;n.readers=[];var r=t?t.get(w.POSSIBLE_FORMATS):null,i=t&&t.get(w.ASSUME_CODE_39_CHECK_DIGIT)!==void 0,a=t&&t.get(w.ENABLE_CODE_39_EXTENDED_MODE)!==void 0;return r&&((r.includes(N.EAN_13)||r.includes(N.UPC_A)||r.includes(N.EAN_8)||r.includes(N.UPC_E))&&n.readers.push(new Pt(t)),r.includes(N.CODE_39)&&n.readers.push(new et(i,a)),r.includes(N.CODE_93)&&n.readers.push(new rt),r.includes(N.CODE_128)&&n.readers.push(new Ze),r.includes(N.ITF)&&n.readers.push(new ct),r.includes(N.CODABAR)&&n.readers.push(new Rt),r.includes(N.RSS_14)&&n.readers.push(new Un),r.includes(N.RSS_EXPANDED)&&(console.warn(`RSS Expanded reader IS NOT ready for production yet! use at your own risk.`),n.readers.push(new In))),n.readers.length===0&&(n.readers.push(new Pt(t)),n.readers.push(new et),n.readers.push(new rt),n.readers.push(new Pt(t)),n.readers.push(new Ze),n.readers.push(new ct),n.readers.push(new Un),n.readers.push(new In)),n}return t.prototype.decodeRow=function(e,t,n){for(var r=0;r<this.readers.length;r++)try{return this.readers[r].decodeRow(e,t,n)}catch{}throw new M},t.prototype.reset=function(){this.readers.forEach(function(e){return e.reset()})},t}(L),Kn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){Kn(t,e);function t(t,n){return t===void 0&&(t=500),e.call(this,new Gn(n),t,n)||this}return t})(ve);var qn=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},z=function(){function e(e,t,n){this.ecCodewords=e,this.ecBlocks=[t],n&&this.ecBlocks.push(n)}return e.prototype.getECCodewords=function(){return this.ecCodewords},e.prototype.getECBlocks=function(){return this.ecBlocks},e}(),B=function(){function e(e,t){this.count=e,this.dataCodewords=t}return e.prototype.getCount=function(){return this.count},e.prototype.getDataCodewords=function(){return this.dataCodewords},e}(),Jn=function(){function e(e,t,n,r,i,a){var o,s;this.versionNumber=e,this.symbolSizeRows=t,this.symbolSizeColumns=n,this.dataRegionSizeRows=r,this.dataRegionSizeColumns=i,this.ecBlocks=a;var c=0,l=a.getECCodewords(),u=a.getECBlocks();try{for(var d=qn(u),f=d.next();!f.done;f=d.next()){var p=f.value;c+=p.getCount()*(p.getDataCodewords()+l)}}catch(e){o={error:e}}finally{try{f&&!f.done&&(s=d.return)&&s.call(d)}finally{if(o)throw o.error}}this.totalCodewords=c}return e.prototype.getVersionNumber=function(){return this.versionNumber},e.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},e.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},e.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},e.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},e.prototype.getTotalCodewords=function(){return this.totalCodewords},e.prototype.getECBlocks=function(){return this.ecBlocks},e.getVersionForDimensions=function(t,n){var r,i;if(t&1||n&1)throw new E;try{for(var a=qn(e.VERSIONS),o=a.next();!o.done;o=a.next()){var s=o.value;if(s.symbolSizeRows===t&&s.symbolSizeColumns===n)return s}}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}throw new E},e.prototype.toString=function(){return``+this.versionNumber},e.buildVersions=function(){return[new e(1,10,10,8,8,new z(5,new B(1,3))),new e(2,12,12,10,10,new z(7,new B(1,5))),new e(3,14,14,12,12,new z(10,new B(1,8))),new e(4,16,16,14,14,new z(12,new B(1,12))),new e(5,18,18,16,16,new z(14,new B(1,18))),new e(6,20,20,18,18,new z(18,new B(1,22))),new e(7,22,22,20,20,new z(20,new B(1,30))),new e(8,24,24,22,22,new z(24,new B(1,36))),new e(9,26,26,24,24,new z(28,new B(1,44))),new e(10,32,32,14,14,new z(36,new B(1,62))),new e(11,36,36,16,16,new z(42,new B(1,86))),new e(12,40,40,18,18,new z(48,new B(1,114))),new e(13,44,44,20,20,new z(56,new B(1,144))),new e(14,48,48,22,22,new z(68,new B(1,174))),new e(15,52,52,24,24,new z(42,new B(2,102))),new e(16,64,64,14,14,new z(56,new B(2,140))),new e(17,72,72,16,16,new z(36,new B(4,92))),new e(18,80,80,18,18,new z(48,new B(4,114))),new e(19,88,88,20,20,new z(56,new B(4,144))),new e(20,96,96,22,22,new z(68,new B(4,174))),new e(21,104,104,24,24,new z(56,new B(6,136))),new e(22,120,120,18,18,new z(68,new B(6,175))),new e(23,132,132,20,20,new z(62,new B(8,163))),new e(24,144,144,22,22,new z(62,new B(8,156),new B(2,155))),new e(25,8,18,6,16,new z(7,new B(1,5))),new e(26,8,32,6,14,new z(11,new B(1,10))),new e(27,12,26,10,24,new z(14,new B(1,16))),new e(28,12,36,10,16,new z(18,new B(1,22))),new e(29,16,36,14,16,new z(24,new B(1,32))),new e(30,16,48,14,22,new z(28,new B(1,49)))]},e.VERSIONS=e.buildVersions(),e}(),Yn=function(){function e(t){var n=t.getHeight();if(n<8||n>144||n&1)throw new E;this.version=e.readVersion(t),this.mappingBitMatrix=this.extractDataRegion(t),this.readMappingMatrix=new re(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return e.prototype.getVersion=function(){return this.version},e.readVersion=function(e){var t=e.getHeight(),n=e.getWidth();return Jn.getVersionForDimensions(t,n)},e.prototype.readCodewords=function(){var e=new Int8Array(this.version.getTotalCodewords()),t=0,n=4,r=0,i=this.mappingBitMatrix.getHeight(),a=this.mappingBitMatrix.getWidth(),o=!1,s=!1,c=!1,l=!1;do if(n===i&&r===0&&!o)e[t++]=this.readCorner1(i,a)&255,n-=2,r+=2,o=!0;else if(n===i-2&&r===0&&a&3&&!s)e[t++]=this.readCorner2(i,a)&255,n-=2,r+=2,s=!0;else if(n===i+4&&r===2&&!(a&7)&&!c)e[t++]=this.readCorner3(i,a)&255,n-=2,r+=2,c=!0;else if(n===i-2&&r===0&&(a&7)==4&&!l)e[t++]=this.readCorner4(i,a)&255,n-=2,r+=2,l=!0;else{do n<i&&r>=0&&!this.readMappingMatrix.get(r,n)&&(e[t++]=this.readUtah(n,r,i,a)&255),n-=2,r+=2;while(n>=0&&r<a);n+=1,r+=3;do n>=0&&r<a&&!this.readMappingMatrix.get(r,n)&&(e[t++]=this.readUtah(n,r,i,a)&255),n+=2,r-=2;while(n<i&&r>=0);n+=3,r+=1}while(n<i||r<a);if(t!==this.version.getTotalCodewords())throw new E;return e},e.prototype.readModule=function(e,t,n,r){return e<0&&(e+=n,t+=4-(n+4&7)),t<0&&(t+=r,e+=4-(r+4&7)),this.readMappingMatrix.set(t,e),this.mappingBitMatrix.get(t,e)},e.prototype.readUtah=function(e,t,n,r){var i=0;return this.readModule(e-2,t-2,n,r)&&(i|=1),i<<=1,this.readModule(e-2,t-1,n,r)&&(i|=1),i<<=1,this.readModule(e-1,t-2,n,r)&&(i|=1),i<<=1,this.readModule(e-1,t-1,n,r)&&(i|=1),i<<=1,this.readModule(e-1,t,n,r)&&(i|=1),i<<=1,this.readModule(e,t-2,n,r)&&(i|=1),i<<=1,this.readModule(e,t-1,n,r)&&(i|=1),i<<=1,this.readModule(e,t,n,r)&&(i|=1),i},e.prototype.readCorner1=function(e,t){var n=0;return this.readModule(e-1,0,e,t)&&(n|=1),n<<=1,this.readModule(e-1,1,e,t)&&(n|=1),n<<=1,this.readModule(e-1,2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-1,e,t)&&(n|=1),n<<=1,this.readModule(1,t-1,e,t)&&(n|=1),n<<=1,this.readModule(2,t-1,e,t)&&(n|=1),n<<=1,this.readModule(3,t-1,e,t)&&(n|=1),n},e.prototype.readCorner2=function(e,t){var n=0;return this.readModule(e-3,0,e,t)&&(n|=1),n<<=1,this.readModule(e-2,0,e,t)&&(n|=1),n<<=1,this.readModule(e-1,0,e,t)&&(n|=1),n<<=1,this.readModule(0,t-4,e,t)&&(n|=1),n<<=1,this.readModule(0,t-3,e,t)&&(n|=1),n<<=1,this.readModule(0,t-2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-1,e,t)&&(n|=1),n<<=1,this.readModule(1,t-1,e,t)&&(n|=1),n},e.prototype.readCorner3=function(e,t){var n=0;return this.readModule(e-1,0,e,t)&&(n|=1),n<<=1,this.readModule(e-1,t-1,e,t)&&(n|=1),n<<=1,this.readModule(0,t-3,e,t)&&(n|=1),n<<=1,this.readModule(0,t-2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-1,e,t)&&(n|=1),n<<=1,this.readModule(1,t-3,e,t)&&(n|=1),n<<=1,this.readModule(1,t-2,e,t)&&(n|=1),n<<=1,this.readModule(1,t-1,e,t)&&(n|=1),n},e.prototype.readCorner4=function(e,t){var n=0;return this.readModule(e-3,0,e,t)&&(n|=1),n<<=1,this.readModule(e-2,0,e,t)&&(n|=1),n<<=1,this.readModule(e-1,0,e,t)&&(n|=1),n<<=1,this.readModule(0,t-2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-1,e,t)&&(n|=1),n<<=1,this.readModule(1,t-1,e,t)&&(n|=1),n<<=1,this.readModule(2,t-1,e,t)&&(n|=1),n<<=1,this.readModule(3,t-1,e,t)&&(n|=1),n},e.prototype.extractDataRegion=function(e){var t=this.version.getSymbolSizeRows(),n=this.version.getSymbolSizeColumns();if(e.getHeight()!==t)throw new l(`Dimension of bitMatrix must match the version size`);for(var r=this.version.getDataRegionSizeRows(),i=this.version.getDataRegionSizeColumns(),a=t/r|0,o=n/i|0,s=a*r,c=new re(o*i,s),u=0;u<a;++u)for(var d=u*r,f=0;f<o;++f)for(var p=f*i,m=0;m<r;++m)for(var h=u*(r+2)+1+m,g=d+m,_=0;_<i;++_){var v=f*(i+2)+1+_;if(e.get(v,h)){var y=p+_;c.set(y,g)}}return c},e}(),Xn=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Zn=function(){function e(e,t){this.numDataCodewords=e,this.codewords=t}return e.getDataBlocks=function(t,n){var r,i,a,o,s=n.getECBlocks(),c=0,u=s.getECBlocks();try{for(var d=Xn(u),f=d.next();!f.done;f=d.next()){var p=f.value;c+=p.getCount()}}catch(e){r={error:e}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}var m=Array(c),h=0;try{for(var g=Xn(u),_=g.next();!_.done;_=g.next())for(var p=_.value,v=0;v<p.getCount();v++){var y=p.getDataCodewords(),b=s.getECCodewords()+y;m[h++]=new e(y,new Uint8Array(b))}}catch(e){a={error:e}}finally{try{_&&!_.done&&(o=g.return)&&o.call(g)}finally{if(a)throw a.error}}for(var x=m[0].codewords.length-s.getECCodewords(),S=x-1,C=0,v=0;v<S;v++)for(var w=0;w<h;w++)m[w].codewords[v]=t[C++];for(var T=n.getVersionNumber()===24,E=T?8:h,w=0;w<E;w++)m[w].codewords[x-1]=t[C++];for(var ee=m[0].codewords.length,v=x;v<ee;v++)for(var w=0;w<h;w++){var D=T?(w+8)%h:w,O=T&&D>7?v-1:v;m[D].codewords[O]=t[C++]}if(C!==t.length)throw new l;return m},e.prototype.getNumDataCodewords=function(){return this.numDataCodewords},e.prototype.getCodewords=function(){return this.codewords},e}(),Qn=function(){function e(e){this.bytes=e,this.byteOffset=0,this.bitOffset=0}return e.prototype.getBitOffset=function(){return this.bitOffset},e.prototype.getByteOffset=function(){return this.byteOffset},e.prototype.readBits=function(e){if(e<1||e>32||e>this.available())throw new l(``+e);var t=0,n=this.bitOffset,r=this.byteOffset,i=this.bytes;if(n>0){var a=8-n,o=e<a?e:a,s=a-o,c=255>>8-o<<s;t=(i[r]&c)>>s,e-=o,n+=o,n===8&&(n=0,r++)}if(e>0){for(;e>=8;)t=t<<8|i[r]&255,r++,e-=8;if(e>0){var s=8-e,c=255>>s<<s;t=t<<e|(i[r]&c)>>s,n+=e}}return this.bitOffset=n,this.byteOffset=r,t},e.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},e}(),V;(function(e){e[e.PAD_ENCODE=0]=`PAD_ENCODE`,e[e.ASCII_ENCODE=1]=`ASCII_ENCODE`,e[e.C40_ENCODE=2]=`C40_ENCODE`,e[e.TEXT_ENCODE=3]=`TEXT_ENCODE`,e[e.ANSIX12_ENCODE=4]=`ANSIX12_ENCODE`,e[e.EDIFACT_ENCODE=5]=`EDIFACT_ENCODE`,e[e.BASE256_ENCODE=6]=`BASE256_ENCODE`})(V||={});var $n=function(){function e(){}return e.decode=function(e){var t=new Qn(e),n=new j,r=new j,i=[],a=V.ASCII_ENCODE;do if(a===V.ASCII_ENCODE)a=this.decodeAsciiSegment(t,n,r);else{switch(a){case V.C40_ENCODE:this.decodeC40Segment(t,n);break;case V.TEXT_ENCODE:this.decodeTextSegment(t,n);break;case V.ANSIX12_ENCODE:this.decodeAnsiX12Segment(t,n);break;case V.EDIFACT_ENCODE:this.decodeEdifactSegment(t,n);break;case V.BASE256_ENCODE:this.decodeBase256Segment(t,n,i);break;default:throw new E}a=V.ASCII_ENCODE}while(a!==V.PAD_ENCODE&&t.available()>0);return r.length()>0&&n.append(r.toString()),new Se(e,n.toString(),i.length===0?null:i,null)},e.decodeAsciiSegment=function(e,t,n){var r=!1;do{var i=e.readBits(8);if(i===0)throw new E;if(i<=128)return r&&(i+=128),t.append(String.fromCharCode(i-1)),V.ASCII_ENCODE;if(i===129)return V.PAD_ENCODE;if(i<=229){var a=i-130;a<10&&t.append(`0`),t.append(``+a)}else switch(i){case 230:return V.C40_ENCODE;case 231:return V.BASE256_ENCODE;case 232:t.append(``);break;case 233:case 234:break;case 235:r=!0;break;case 236:t.append(`[)>05`),n.insert(0,``);break;case 237:t.append(`[)>06`),n.insert(0,``);break;case 238:return V.ANSIX12_ENCODE;case 239:return V.TEXT_ENCODE;case 240:return V.EDIFACT_ENCODE;case 241:break;default:if(i!==254||e.available()!==0)throw new E}}while(e.available()>0);return V.ASCII_ENCODE},e.decodeC40Segment=function(e,t){var n=!1,r=[],i=0;do{if(e.available()===8)return;var a=e.readBits(8);if(a===254)return;this.parseTwoBytes(a,e.readBits(8),r);for(var o=0;o<3;o++){var s=r[o];switch(i){case 0:if(s<3)i=s+1;else if(s<this.C40_BASIC_SET_CHARS.length){var c=this.C40_BASIC_SET_CHARS[s];n?(t.append(String.fromCharCode(c.charCodeAt(0)+128)),n=!1):t.append(c)}else throw new E;break;case 1:n?(t.append(String.fromCharCode(s+128)),n=!1):t.append(String.fromCharCode(s)),i=0;break;case 2:if(s<this.C40_SHIFT2_SET_CHARS.length){var c=this.C40_SHIFT2_SET_CHARS[s];n?(t.append(String.fromCharCode(c.charCodeAt(0)+128)),n=!1):t.append(c)}else switch(s){case 27:t.append(``);break;case 30:n=!0;break;default:throw new E}i=0;break;case 3:n?(t.append(String.fromCharCode(s+224)),n=!1):t.append(String.fromCharCode(s+96)),i=0;break;default:throw new E}}}while(e.available()>0)},e.decodeTextSegment=function(e,t){var n=!1,r=[],i=0;do{if(e.available()===8)return;var a=e.readBits(8);if(a===254)return;this.parseTwoBytes(a,e.readBits(8),r);for(var o=0;o<3;o++){var s=r[o];switch(i){case 0:if(s<3)i=s+1;else if(s<this.TEXT_BASIC_SET_CHARS.length){var c=this.TEXT_BASIC_SET_CHARS[s];n?(t.append(String.fromCharCode(c.charCodeAt(0)+128)),n=!1):t.append(c)}else throw new E;break;case 1:n?(t.append(String.fromCharCode(s+128)),n=!1):t.append(String.fromCharCode(s)),i=0;break;case 2:if(s<this.TEXT_SHIFT2_SET_CHARS.length){var c=this.TEXT_SHIFT2_SET_CHARS[s];n?(t.append(String.fromCharCode(c.charCodeAt(0)+128)),n=!1):t.append(c)}else switch(s){case 27:t.append(``);break;case 30:n=!0;break;default:throw new E}i=0;break;case 3:if(s<this.TEXT_SHIFT3_SET_CHARS.length){var c=this.TEXT_SHIFT3_SET_CHARS[s];n?(t.append(String.fromCharCode(c.charCodeAt(0)+128)),n=!1):t.append(c),i=0}else throw new E;break;default:throw new E}}}while(e.available()>0)},e.decodeAnsiX12Segment=function(e,t){var n=[];do{if(e.available()===8)return;var r=e.readBits(8);if(r===254)return;this.parseTwoBytes(r,e.readBits(8),n);for(var i=0;i<3;i++){var a=n[i];switch(a){case 0:t.append(`\r`);break;case 1:t.append(`*`);break;case 2:t.append(`>`);break;case 3:t.append(` `);break;default:if(a<14)t.append(String.fromCharCode(a+44));else if(a<40)t.append(String.fromCharCode(a+51));else throw new E}}}while(e.available()>0)},e.parseTwoBytes=function(e,t,n){var r=(e<<8)+t-1,i=Math.floor(r/1600);n[0]=i,r-=i*1600,i=Math.floor(r/40),n[1]=i,n[2]=r-i*40},e.decodeEdifactSegment=function(e,t){do{if(e.available()<=16)return;for(var n=0;n<4;n++){var r=e.readBits(6);if(r===31){var i=8-e.getBitOffset();i!==8&&e.readBits(i);return}r&32||(r|=64),t.append(String.fromCharCode(r))}}while(e.available()>0)},e.decodeBase256Segment=function(e,t,n){var r=1+e.getByteOffset(),i=this.unrandomize255State(e.readBits(8),r++),a=i===0?e.available()/8|0:i<250?i:250*(i-249)+this.unrandomize255State(e.readBits(8),r++);if(a<0)throw new E;for(var o=new Uint8Array(a),s=0;s<a;s++){if(e.available()<8)throw new E;o[s]=this.unrandomize255State(e.readBits(8),r++)}n.push(o);try{t.append(ne.decode(o,A.ISO88591))}catch(e){throw new Me(`Platform does not support required encoding: `+e.message)}},e.unrandomize255State=function(e,t){var n=e-(149*t%255+1);return n>=0?n:n+256},e.C40_BASIC_SET_CHARS=`*** 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ`.split(``),e.C40_SHIFT2_SET_CHARS=`!"#$%&'()*+,-./:;<=>?@[\\]^_`.split(``),e.TEXT_BASIC_SET_CHARS=`*** 0123456789abcdefghijklmnopqrstuvwxyz`.split(``),e.TEXT_SHIFT2_SET_CHARS=e.C40_SHIFT2_SET_CHARS,e.TEXT_SHIFT3_SET_CHARS="`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~".split(``),e}(),er=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},tr=function(){function e(){this.rsDecoder=new Ne(Oe.DATA_MATRIX_FIELD_256)}return e.prototype.decode=function(e){var t,n,r=new Yn(e),i=r.getVersion(),a=r.readCodewords(),o=Zn.getDataBlocks(a,i),s=0;try{for(var c=er(o),l=c.next();!l.done;l=c.next()){var u=l.value;s+=u.getNumDataCodewords()}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}for(var d=new Uint8Array(s),f=o.length,p=0;p<f;p++){var m=o[p],h=m.getCodewords(),g=m.getNumDataCodewords();this.correctErrors(h,g);for(var _=0;_<g;_++)d[_*f+p]=h[_]}return $n.decode(d)},e.prototype.correctErrors=function(e,t){var n=new Int32Array(e);try{this.rsDecoder.decode(n,e.length-t)}catch{throw new f}for(var r=0;r<t;r++)e[r]=n[r]},e}(),nr=function(){function e(e){this.image=e,this.rectangleDetector=new Be(this.image)}return e.prototype.detect=function(){var t=this.rectangleDetector.detect(),n=this.detectSolid1(t);if(n=this.detectSolid2(n),n[3]=this.correctTopRight(n),!n[3])throw new M;n=this.shiftToModuleCenter(n);var r=n[0],i=n[1],a=n[2],o=n[3],s=this.transitionsBetween(r,o)+1,c=this.transitionsBetween(a,o)+1;return(s&1)==1&&(s+=1),(c&1)==1&&(c+=1),4*s<7*c&&4*c<7*s&&(s=c=Math.max(s,c)),new Le(e.sampleGrid(this.image,r,i,a,o,s,c),[r,i,a,o])},e.shiftPoint=function(e,t,n){var r=(t.getX()-e.getX())/(n+1),i=(t.getY()-e.getY())/(n+1);return new I(e.getX()+r,e.getY()+i)},e.moveAway=function(e,t,n){var r=e.getX(),i=e.getY();return r<t?--r:r+=1,i<n?--i:i+=1,new I(r,i)},e.prototype.detectSolid1=function(e){var t=e[0],n=e[1],r=e[3],i=e[2],a=this.transitionsBetween(t,n),o=this.transitionsBetween(n,r),s=this.transitionsBetween(r,i),c=this.transitionsBetween(i,t),l=a,u=[i,t,n,r];return l>o&&(l=o,u[0]=t,u[1]=n,u[2]=r,u[3]=i),l>s&&(l=s,u[0]=n,u[1]=r,u[2]=i,u[3]=t),l>c&&(u[0]=r,u[1]=i,u[2]=t,u[3]=n),u},e.prototype.detectSolid2=function(t){var n=t[0],r=t[1],i=t[2],a=t[3],o=this.transitionsBetween(n,a),s=e.shiftPoint(r,i,(o+1)*4),c=e.shiftPoint(i,r,(o+1)*4);return this.transitionsBetween(s,n)<this.transitionsBetween(c,a)?(t[0]=n,t[1]=r,t[2]=i,t[3]=a):(t[0]=r,t[1]=i,t[2]=a,t[3]=n),t},e.prototype.correctTopRight=function(t){var n=t[0],r=t[1],i=t[2],a=t[3],o=this.transitionsBetween(n,a),s=this.transitionsBetween(r,a),c=e.shiftPoint(n,r,(s+1)*4),l=e.shiftPoint(i,r,(o+1)*4);o=this.transitionsBetween(c,a),s=this.transitionsBetween(l,a);var u=new I(a.getX()+(i.getX()-r.getX())/(o+1),a.getY()+(i.getY()-r.getY())/(o+1)),d=new I(a.getX()+(n.getX()-r.getX())/(s+1),a.getY()+(n.getY()-r.getY())/(s+1));return this.isValid(u)?!this.isValid(d)||this.transitionsBetween(c,u)+this.transitionsBetween(l,u)>this.transitionsBetween(c,d)+this.transitionsBetween(l,d)?u:d:this.isValid(d)?d:null},e.prototype.shiftToModuleCenter=function(t){var n=t[0],r=t[1],i=t[2],a=t[3],o=this.transitionsBetween(n,a)+1,s=this.transitionsBetween(i,a)+1,c=e.shiftPoint(n,r,s*4),l=e.shiftPoint(i,r,o*4);o=this.transitionsBetween(c,a)+1,s=this.transitionsBetween(l,a)+1,(o&1)==1&&(o+=1),(s&1)==1&&(s+=1);var u=(n.getX()+r.getX()+i.getX()+a.getX())/4,d=(n.getY()+r.getY()+i.getY()+a.getY())/4;n=e.moveAway(n,u,d),r=e.moveAway(r,u,d),i=e.moveAway(i,u,d),a=e.moveAway(a,u,d);var f,p;return c=e.shiftPoint(n,r,s*4),c=e.shiftPoint(c,a,o*4),f=e.shiftPoint(r,n,s*4),f=e.shiftPoint(f,i,o*4),l=e.shiftPoint(i,a,s*4),l=e.shiftPoint(l,r,o*4),p=e.shiftPoint(a,i,s*4),p=e.shiftPoint(p,n,o*4),[c,f,l,p]},e.prototype.isValid=function(e){return e.getX()>=0&&e.getX()<this.image.getWidth()&&e.getY()>0&&e.getY()<this.image.getHeight()},e.sampleGrid=function(e,t,n,r,i,a,o){return Ge.getInstance().sampleGrid(e,a,o,.5,.5,a-.5,.5,a-.5,o-.5,.5,o-.5,t.getX(),t.getY(),i.getX(),i.getY(),r.getX(),r.getY(),n.getX(),n.getY())},e.prototype.transitionsBetween=function(e,t){var n=Math.trunc(e.getX()),r=Math.trunc(e.getY()),i=Math.trunc(t.getX()),a=Math.trunc(t.getY()),o=Math.abs(a-r)>Math.abs(i-n);if(o){var s=n;n=r,r=s,s=i,i=a,a=s}for(var c=Math.abs(i-n),l=Math.abs(a-r),u=-c/2,d=r<a?1:-1,f=n<i?1:-1,p=0,m=this.image.get(o?r:n,o?n:r),h=n,g=r;h!==i;h+=f){var _=this.image.get(o?g:h,o?h:g);if(_!==m&&(p++,m=_),u+=l,u>0){if(g===a)break;g+=d,u-=c}}return p},e}(),rr=function(){function e(){this.decoder=new tr}return e.prototype.decode=function(t,n){n===void 0&&(n=null);var r,i;if(n!=null&&n.has(w.PURE_BARCODE)){var a=e.extractPureBits(t.getBlackMatrix());r=this.decoder.decode(a),i=e.NO_POINTS}else{var o=new nr(t.getBlackMatrix()).detect();r=this.decoder.decode(o.getBits()),i=o.getPoints()}var s=r.getRawBytes(),c=new ye(r.getText(),s,8*s.length,i,N.DATA_MATRIX,m.currentTimeMillis()),l=r.getByteSegments();l!=null&&c.putMetadata(P.BYTE_SEGMENTS,l);var u=r.getECLevel();return u!=null&&c.putMetadata(P.ERROR_CORRECTION_LEVEL,u),c},e.prototype.reset=function(){},e.extractPureBits=function(e){var t=e.getTopLeftOnBit(),n=e.getBottomRightOnBit();if(t==null||n==null)throw new M;var r=this.moduleSize(t,e),i=t[1],a=n[1],o=t[0],s=(n[0]-o+1)/r,c=(a-i+1)/r;if(s<=0||c<=0)throw new M;var l=r/2;i+=l,o+=l;for(var u=new re(s,c),d=0;d<c;d++)for(var f=i+d*r,p=0;p<s;p++)e.get(o+p*r,f)&&u.set(p,d);return u},e.moduleSize=function(e,t){for(var n=t.getWidth(),r=e[0],i=e[1];r<n&&t.get(r,i);)r++;if(r===n)throw new M;var a=r-e[0];if(a===0)throw new M;return a},e.NO_POINTS=[],e}(),ir=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){ir(t,e);function t(t){return t===void 0&&(t=500),e.call(this,new rr,t)||this}return t})(ve);var ar;(function(e){e[e.L=0]=`L`,e[e.M=1]=`M`,e[e.Q=2]=`Q`,e[e.H=3]=`H`})(ar||={});var or=function(){function e(t,n,r){this.value=t,this.stringValue=n,this.bits=r,e.FOR_BITS.set(r,this),e.FOR_VALUE.set(t,this)}return e.prototype.getValue=function(){return this.value},e.prototype.getBits=function(){return this.bits},e.fromString=function(t){switch(t){case`L`:return e.L;case`M`:return e.M;case`Q`:return e.Q;case`H`:return e.H;default:throw new s(t+`not available`)}},e.prototype.toString=function(){return this.stringValue},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.value===n.value},e.forBits=function(t){if(t<0||t>=e.FOR_BITS.size)throw new l;return e.FOR_BITS.get(t)},e.FOR_BITS=new Map,e.FOR_VALUE=new Map,e.L=new e(ar.L,`L`,1),e.M=new e(ar.M,`M`,0),e.Q=new e(ar.Q,`Q`,3),e.H=new e(ar.H,`H`,2),e}(),sr=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},cr=function(){function e(e){this.errorCorrectionLevel=or.forBits(e>>3&3),this.dataMask=e&7}return e.numBitsDiffering=function(e,t){return x.bitCount(e^t)},e.decodeFormatInformation=function(t,n){var r=e.doDecodeFormatInformation(t,n);return r===null?e.doDecodeFormatInformation(t^e.FORMAT_INFO_MASK_QR,n^e.FORMAT_INFO_MASK_QR):r},e.doDecodeFormatInformation=function(t,n){var r,i,a=2**53-1,o=0;try{for(var s=sr(e.FORMAT_INFO_DECODE_LOOKUP),c=s.next();!c.done;c=s.next()){var l=c.value,u=l[0];if(u===t||u===n)return new e(l[1]);var d=e.numBitsDiffering(t,u);d<a&&(o=l[1],a=d),t!==n&&(d=e.numBitsDiffering(n,u),d<a&&(o=l[1],a=d))}}catch(e){r={error:e}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return a<=3?new e(o):null},e.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},e.prototype.getDataMask=function(){return this.dataMask},e.prototype.hashCode=function(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.errorCorrectionLevel===n.errorCorrectionLevel&&this.dataMask===n.dataMask},e.FORMAT_INFO_MASK_QR=21522,e.FORMAT_INFO_DECODE_LOOKUP=[Int32Array.from([21522,0]),Int32Array.from([20773,1]),Int32Array.from([24188,2]),Int32Array.from([23371,3]),Int32Array.from([17913,4]),Int32Array.from([16590,5]),Int32Array.from([20375,6]),Int32Array.from([19104,7]),Int32Array.from([30660,8]),Int32Array.from([29427,9]),Int32Array.from([32170,10]),Int32Array.from([30877,11]),Int32Array.from([26159,12]),Int32Array.from([25368,13]),Int32Array.from([27713,14]),Int32Array.from([26998,15]),Int32Array.from([5769,16]),Int32Array.from([5054,17]),Int32Array.from([7399,18]),Int32Array.from([6608,19]),Int32Array.from([1890,20]),Int32Array.from([597,21]),Int32Array.from([3340,22]),Int32Array.from([2107,23]),Int32Array.from([13663,24]),Int32Array.from([12392,25]),Int32Array.from([16177,26]),Int32Array.from([14854,27]),Int32Array.from([9396,28]),Int32Array.from([8579,29]),Int32Array.from([11994,30]),Int32Array.from([11245,31])],e}(),lr=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},H=function(){function e(e){var t=[...arguments].slice(1);this.ecCodewordsPerBlock=e,this.ecBlocks=t}return e.prototype.getECCodewordsPerBlock=function(){return this.ecCodewordsPerBlock},e.prototype.getNumBlocks=function(){var e,t,n=0,r=this.ecBlocks;try{for(var i=lr(r),a=i.next();!a.done;a=i.next()){var o=a.value;n+=o.getCount()}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return n},e.prototype.getTotalECCodewords=function(){return this.ecCodewordsPerBlock*this.getNumBlocks()},e.prototype.getECBlocks=function(){return this.ecBlocks},e}(),U=function(){function e(e,t){this.count=e,this.dataCodewords=t}return e.prototype.getCount=function(){return this.count},e.prototype.getDataCodewords=function(){return this.dataCodewords},e}(),ur=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},dr=function(){function e(e,t){for(var n,r,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];this.versionNumber=e,this.alignmentPatternCenters=t,this.ecBlocks=i;var o=0,s=i[0].getECCodewordsPerBlock(),c=i[0].getECBlocks();try{for(var l=ur(c),u=l.next();!u.done;u=l.next()){var d=u.value;o+=d.getCount()*(d.getDataCodewords()+s)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}this.totalCodewords=o}return e.prototype.getVersionNumber=function(){return this.versionNumber},e.prototype.getAlignmentPatternCenters=function(){return this.alignmentPatternCenters},e.prototype.getTotalCodewords=function(){return this.totalCodewords},e.prototype.getDimensionForVersion=function(){return 17+4*this.versionNumber},e.prototype.getECBlocksForLevel=function(e){return this.ecBlocks[e.getValue()]},e.getProvisionalVersionForDimension=function(e){if(e%4!=1)throw new E;try{return this.getVersionForNumber((e-17)/4)}catch{throw new E}},e.getVersionForNumber=function(t){if(t<1||t>40)throw new l;return e.VERSIONS[t-1]},e.decodeVersionInformation=function(t){for(var n=2**53-1,r=0,i=0;i<e.VERSION_DECODE_INFO.length;i++){var a=e.VERSION_DECODE_INFO[i];if(a===t)return e.getVersionForNumber(i+7);var o=cr.numBitsDiffering(t,a);o<n&&(r=i+7,n=o)}return n<=3?e.getVersionForNumber(r):null},e.prototype.buildFunctionPattern=function(){var e=this.getDimensionForVersion(),t=new re(e);t.setRegion(0,0,9,9),t.setRegion(e-8,0,8,9),t.setRegion(0,e-8,9,8);for(var n=this.alignmentPatternCenters.length,r=0;r<n;r++)for(var i=this.alignmentPatternCenters[r]-2,a=0;a<n;a++)r===0&&(a===0||a===n-1)||r===n-1&&a===0||t.setRegion(this.alignmentPatternCenters[a]-2,i,5,5);return t.setRegion(6,9,1,e-17),t.setRegion(9,6,e-17,1),this.versionNumber>6&&(t.setRegion(e-11,0,3,6),t.setRegion(0,e-11,6,3)),t},e.prototype.toString=function(){return``+this.versionNumber},e.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),e.VERSIONS=[new e(1,new Int32Array,new H(7,new U(1,19)),new H(10,new U(1,16)),new H(13,new U(1,13)),new H(17,new U(1,9))),new e(2,Int32Array.from([6,18]),new H(10,new U(1,34)),new H(16,new U(1,28)),new H(22,new U(1,22)),new H(28,new U(1,16))),new e(3,Int32Array.from([6,22]),new H(15,new U(1,55)),new H(26,new U(1,44)),new H(18,new U(2,17)),new H(22,new U(2,13))),new e(4,Int32Array.from([6,26]),new H(20,new U(1,80)),new H(18,new U(2,32)),new H(26,new U(2,24)),new H(16,new U(4,9))),new e(5,Int32Array.from([6,30]),new H(26,new U(1,108)),new H(24,new U(2,43)),new H(18,new U(2,15),new U(2,16)),new H(22,new U(2,11),new U(2,12))),new e(6,Int32Array.from([6,34]),new H(18,new U(2,68)),new H(16,new U(4,27)),new H(24,new U(4,19)),new H(28,new U(4,15))),new e(7,Int32Array.from([6,22,38]),new H(20,new U(2,78)),new H(18,new U(4,31)),new H(18,new U(2,14),new U(4,15)),new H(26,new U(4,13),new U(1,14))),new e(8,Int32Array.from([6,24,42]),new H(24,new U(2,97)),new H(22,new U(2,38),new U(2,39)),new H(22,new U(4,18),new U(2,19)),new H(26,new U(4,14),new U(2,15))),new e(9,Int32Array.from([6,26,46]),new H(30,new U(2,116)),new H(22,new U(3,36),new U(2,37)),new H(20,new U(4,16),new U(4,17)),new H(24,new U(4,12),new U(4,13))),new e(10,Int32Array.from([6,28,50]),new H(18,new U(2,68),new U(2,69)),new H(26,new U(4,43),new U(1,44)),new H(24,new U(6,19),new U(2,20)),new H(28,new U(6,15),new U(2,16))),new e(11,Int32Array.from([6,30,54]),new H(20,new U(4,81)),new H(30,new U(1,50),new U(4,51)),new H(28,new U(4,22),new U(4,23)),new H(24,new U(3,12),new U(8,13))),new e(12,Int32Array.from([6,32,58]),new H(24,new U(2,92),new U(2,93)),new H(22,new U(6,36),new U(2,37)),new H(26,new U(4,20),new U(6,21)),new H(28,new U(7,14),new U(4,15))),new e(13,Int32Array.from([6,34,62]),new H(26,new U(4,107)),new H(22,new U(8,37),new U(1,38)),new H(24,new U(8,20),new U(4,21)),new H(22,new U(12,11),new U(4,12))),new e(14,Int32Array.from([6,26,46,66]),new H(30,new U(3,115),new U(1,116)),new H(24,new U(4,40),new U(5,41)),new H(20,new U(11,16),new U(5,17)),new H(24,new U(11,12),new U(5,13))),new e(15,Int32Array.from([6,26,48,70]),new H(22,new U(5,87),new U(1,88)),new H(24,new U(5,41),new U(5,42)),new H(30,new U(5,24),new U(7,25)),new H(24,new U(11,12),new U(7,13))),new e(16,Int32Array.from([6,26,50,74]),new H(24,new U(5,98),new U(1,99)),new H(28,new U(7,45),new U(3,46)),new H(24,new U(15,19),new U(2,20)),new H(30,new U(3,15),new U(13,16))),new e(17,Int32Array.from([6,30,54,78]),new H(28,new U(1,107),new U(5,108)),new H(28,new U(10,46),new U(1,47)),new H(28,new U(1,22),new U(15,23)),new H(28,new U(2,14),new U(17,15))),new e(18,Int32Array.from([6,30,56,82]),new H(30,new U(5,120),new U(1,121)),new H(26,new U(9,43),new U(4,44)),new H(28,new U(17,22),new U(1,23)),new H(28,new U(2,14),new U(19,15))),new e(19,Int32Array.from([6,30,58,86]),new H(28,new U(3,113),new U(4,114)),new H(26,new U(3,44),new U(11,45)),new H(26,new U(17,21),new U(4,22)),new H(26,new U(9,13),new U(16,14))),new e(20,Int32Array.from([6,34,62,90]),new H(28,new U(3,107),new U(5,108)),new H(26,new U(3,41),new U(13,42)),new H(30,new U(15,24),new U(5,25)),new H(28,new U(15,15),new U(10,16))),new e(21,Int32Array.from([6,28,50,72,94]),new H(28,new U(4,116),new U(4,117)),new H(26,new U(17,42)),new H(28,new U(17,22),new U(6,23)),new H(30,new U(19,16),new U(6,17))),new e(22,Int32Array.from([6,26,50,74,98]),new H(28,new U(2,111),new U(7,112)),new H(28,new U(17,46)),new H(30,new U(7,24),new U(16,25)),new H(24,new U(34,13))),new e(23,Int32Array.from([6,30,54,78,102]),new H(30,new U(4,121),new U(5,122)),new H(28,new U(4,47),new U(14,48)),new H(30,new U(11,24),new U(14,25)),new H(30,new U(16,15),new U(14,16))),new e(24,Int32Array.from([6,28,54,80,106]),new H(30,new U(6,117),new U(4,118)),new H(28,new U(6,45),new U(14,46)),new H(30,new U(11,24),new U(16,25)),new H(30,new U(30,16),new U(2,17))),new e(25,Int32Array.from([6,32,58,84,110]),new H(26,new U(8,106),new U(4,107)),new H(28,new U(8,47),new U(13,48)),new H(30,new U(7,24),new U(22,25)),new H(30,new U(22,15),new U(13,16))),new e(26,Int32Array.from([6,30,58,86,114]),new H(28,new U(10,114),new U(2,115)),new H(28,new U(19,46),new U(4,47)),new H(28,new U(28,22),new U(6,23)),new H(30,new U(33,16),new U(4,17))),new e(27,Int32Array.from([6,34,62,90,118]),new H(30,new U(8,122),new U(4,123)),new H(28,new U(22,45),new U(3,46)),new H(30,new U(8,23),new U(26,24)),new H(30,new U(12,15),new U(28,16))),new e(28,Int32Array.from([6,26,50,74,98,122]),new H(30,new U(3,117),new U(10,118)),new H(28,new U(3,45),new U(23,46)),new H(30,new U(4,24),new U(31,25)),new H(30,new U(11,15),new U(31,16))),new e(29,Int32Array.from([6,30,54,78,102,126]),new H(30,new U(7,116),new U(7,117)),new H(28,new U(21,45),new U(7,46)),new H(30,new U(1,23),new U(37,24)),new H(30,new U(19,15),new U(26,16))),new e(30,Int32Array.from([6,26,52,78,104,130]),new H(30,new U(5,115),new U(10,116)),new H(28,new U(19,47),new U(10,48)),new H(30,new U(15,24),new U(25,25)),new H(30,new U(23,15),new U(25,16))),new e(31,Int32Array.from([6,30,56,82,108,134]),new H(30,new U(13,115),new U(3,116)),new H(28,new U(2,46),new U(29,47)),new H(30,new U(42,24),new U(1,25)),new H(30,new U(23,15),new U(28,16))),new e(32,Int32Array.from([6,34,60,86,112,138]),new H(30,new U(17,115)),new H(28,new U(10,46),new U(23,47)),new H(30,new U(10,24),new U(35,25)),new H(30,new U(19,15),new U(35,16))),new e(33,Int32Array.from([6,30,58,86,114,142]),new H(30,new U(17,115),new U(1,116)),new H(28,new U(14,46),new U(21,47)),new H(30,new U(29,24),new U(19,25)),new H(30,new U(11,15),new U(46,16))),new e(34,Int32Array.from([6,34,62,90,118,146]),new H(30,new U(13,115),new U(6,116)),new H(28,new U(14,46),new U(23,47)),new H(30,new U(44,24),new U(7,25)),new H(30,new U(59,16),new U(1,17))),new e(35,Int32Array.from([6,30,54,78,102,126,150]),new H(30,new U(12,121),new U(7,122)),new H(28,new U(12,47),new U(26,48)),new H(30,new U(39,24),new U(14,25)),new H(30,new U(22,15),new U(41,16))),new e(36,Int32Array.from([6,24,50,76,102,128,154]),new H(30,new U(6,121),new U(14,122)),new H(28,new U(6,47),new U(34,48)),new H(30,new U(46,24),new U(10,25)),new H(30,new U(2,15),new U(64,16))),new e(37,Int32Array.from([6,28,54,80,106,132,158]),new H(30,new U(17,122),new U(4,123)),new H(28,new U(29,46),new U(14,47)),new H(30,new U(49,24),new U(10,25)),new H(30,new U(24,15),new U(46,16))),new e(38,Int32Array.from([6,32,58,84,110,136,162]),new H(30,new U(4,122),new U(18,123)),new H(28,new U(13,46),new U(32,47)),new H(30,new U(48,24),new U(14,25)),new H(30,new U(42,15),new U(32,16))),new e(39,Int32Array.from([6,26,54,82,110,138,166]),new H(30,new U(20,117),new U(4,118)),new H(28,new U(40,47),new U(7,48)),new H(30,new U(43,24),new U(22,25)),new H(30,new U(10,15),new U(67,16))),new e(40,Int32Array.from([6,30,58,86,114,142,170]),new H(30,new U(19,118),new U(6,119)),new H(28,new U(18,47),new U(31,48)),new H(30,new U(34,24),new U(34,25)),new H(30,new U(20,15),new U(61,16)))],e}(),fr;(function(e){e[e.DATA_MASK_000=0]=`DATA_MASK_000`,e[e.DATA_MASK_001=1]=`DATA_MASK_001`,e[e.DATA_MASK_010=2]=`DATA_MASK_010`,e[e.DATA_MASK_011=3]=`DATA_MASK_011`,e[e.DATA_MASK_100=4]=`DATA_MASK_100`,e[e.DATA_MASK_101=5]=`DATA_MASK_101`,e[e.DATA_MASK_110=6]=`DATA_MASK_110`,e[e.DATA_MASK_111=7]=`DATA_MASK_111`})(fr||={});var pr=function(){function e(e,t){this.value=e,this.isMasked=t}return e.prototype.unmaskBitMatrix=function(e,t){for(var n=0;n<t;n++)for(var r=0;r<t;r++)this.isMasked(n,r)&&e.flip(r,n)},e.values=new Map([[fr.DATA_MASK_000,new e(fr.DATA_MASK_000,function(e,t){return!(e+t&1)})],[fr.DATA_MASK_001,new e(fr.DATA_MASK_001,function(e,t){return!(e&1)})],[fr.DATA_MASK_010,new e(fr.DATA_MASK_010,function(e,t){return t%3==0})],[fr.DATA_MASK_011,new e(fr.DATA_MASK_011,function(e,t){return(e+t)%3==0})],[fr.DATA_MASK_100,new e(fr.DATA_MASK_100,function(e,t){return!(Math.floor(e/2)+Math.floor(t/3)&1)})],[fr.DATA_MASK_101,new e(fr.DATA_MASK_101,function(e,t){return e*t%6==0})],[fr.DATA_MASK_110,new e(fr.DATA_MASK_110,function(e,t){return e*t%6<3})],[fr.DATA_MASK_111,new e(fr.DATA_MASK_111,function(e,t){return!(e+t+e*t%3&1)})]]),e}(),mr=function(){function e(e){var t=e.getHeight();if(t<21||(t&3)!=1)throw new E;this.bitMatrix=e}return e.prototype.readFormatInformation=function(){if(this.parsedFormatInfo!==null&&this.parsedFormatInfo!==void 0)return this.parsedFormatInfo;for(var e=0,t=0;t<6;t++)e=this.copyBit(t,8,e);e=this.copyBit(7,8,e),e=this.copyBit(8,8,e),e=this.copyBit(8,7,e);for(var n=5;n>=0;n--)e=this.copyBit(8,n,e);for(var r=this.bitMatrix.getHeight(),i=0,a=r-7,n=r-1;n>=a;n--)i=this.copyBit(8,n,i);for(var t=r-8;t<r;t++)i=this.copyBit(t,8,i);if(this.parsedFormatInfo=cr.decodeFormatInformation(e,i),this.parsedFormatInfo!==null)return this.parsedFormatInfo;throw new E},e.prototype.readVersion=function(){if(this.parsedVersion!==null&&this.parsedVersion!==void 0)return this.parsedVersion;var e=this.bitMatrix.getHeight(),t=Math.floor((e-17)/4);if(t<=6)return dr.getVersionForNumber(t);for(var n=0,r=e-11,i=5;i>=0;i--)for(var a=e-9;a>=r;a--)n=this.copyBit(a,i,n);var o=dr.decodeVersionInformation(n);if(o!==null&&o.getDimensionForVersion()===e)return this.parsedVersion=o,o;n=0;for(var a=5;a>=0;a--)for(var i=e-9;i>=r;i--)n=this.copyBit(a,i,n);if(o=dr.decodeVersionInformation(n),o!==null&&o.getDimensionForVersion()===e)return this.parsedVersion=o,o;throw new E},e.prototype.copyBit=function(e,t,n){return(this.isMirror?this.bitMatrix.get(t,e):this.bitMatrix.get(e,t))?n<<1|1:n<<1},e.prototype.readCodewords=function(){var e=this.readFormatInformation(),t=this.readVersion(),n=pr.values.get(e.getDataMask()),r=this.bitMatrix.getHeight();n.unmaskBitMatrix(this.bitMatrix,r);for(var i=t.buildFunctionPattern(),a=!0,o=new Uint8Array(t.getTotalCodewords()),s=0,c=0,l=0,u=r-1;u>0;u-=2){u===6&&u--;for(var d=0;d<r;d++)for(var f=a?r-1-d:d,p=0;p<2;p++)i.get(u-p,f)||(l++,c<<=1,this.bitMatrix.get(u-p,f)&&(c|=1),l===8&&(o[s++]=c,l=0,c=0));a=!a}if(s!==t.getTotalCodewords())throw new E;return o},e.prototype.remask=function(){if(this.parsedFormatInfo!==null){var e=pr.values.get(this.parsedFormatInfo.getDataMask()),t=this.bitMatrix.getHeight();e.unmaskBitMatrix(this.bitMatrix,t)}},e.prototype.setMirror=function(e){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=e},e.prototype.mirror=function(){for(var e=this.bitMatrix,t=0,n=e.getWidth();t<n;t++)for(var r=t+1,i=e.getHeight();r<i;r++)e.get(t,r)!==e.get(r,t)&&(e.flip(r,t),e.flip(t,r))},e}(),hr=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},gr=function(){function e(e,t){this.numDataCodewords=e,this.codewords=t}return e.getDataBlocks=function(t,n,r){var i,a,o,s;if(t.length!==n.getTotalCodewords())throw new l;var c=n.getECBlocksForLevel(r),u=0,d=c.getECBlocks();try{for(var f=hr(d),p=f.next();!p.done;p=f.next()){var m=p.value;u+=m.getCount()}}catch(e){i={error:e}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}var h=Array(u),g=0;try{for(var _=hr(d),v=_.next();!v.done;v=_.next())for(var m=v.value,y=0;y<m.getCount();y++){var b=m.getDataCodewords(),x=c.getECCodewordsPerBlock()+b;h[g++]=new e(b,new Uint8Array(x))}}catch(e){o={error:e}}finally{try{v&&!v.done&&(s=_.return)&&s.call(_)}finally{if(o)throw o.error}}for(var S=h[0].codewords.length,C=h.length-1;C>=0&&h[C].codewords.length!==S;)C--;C++;for(var w=S-c.getECCodewordsPerBlock(),T=0,y=0;y<w;y++)for(var E=0;E<g;E++)h[E].codewords[y]=t[T++];for(var E=C;E<g;E++)h[E].codewords[w]=t[T++];for(var ee=h[0].codewords.length,y=w;y<ee;y++)for(var E=0;E<g;E++){var D=E<C?y:y+1;h[E].codewords[D]=t[T++]}return h},e.prototype.getNumDataCodewords=function(){return this.numDataCodewords},e.prototype.getCodewords=function(){return this.codewords},e}(),_r;(function(e){e[e.TERMINATOR=0]=`TERMINATOR`,e[e.NUMERIC=1]=`NUMERIC`,e[e.ALPHANUMERIC=2]=`ALPHANUMERIC`,e[e.STRUCTURED_APPEND=3]=`STRUCTURED_APPEND`,e[e.BYTE=4]=`BYTE`,e[e.ECI=5]=`ECI`,e[e.KANJI=6]=`KANJI`,e[e.FNC1_FIRST_POSITION=7]=`FNC1_FIRST_POSITION`,e[e.FNC1_SECOND_POSITION=8]=`FNC1_SECOND_POSITION`,e[e.HANZI=9]=`HANZI`})(_r||={});var W=function(){function e(t,n,r,i){this.value=t,this.stringValue=n,this.characterCountBitsForVersions=r,this.bits=i,e.FOR_BITS.set(i,this),e.FOR_VALUE.set(t,this)}return e.forBits=function(t){var n=e.FOR_BITS.get(t);if(n===void 0)throw new l;return n},e.prototype.getCharacterCountBits=function(e){var t=e.getVersionNumber(),n=t<=9?0:t<=26?1:2;return this.characterCountBitsForVersions[n]},e.prototype.getValue=function(){return this.value},e.prototype.getBits=function(){return this.bits},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.value===n.value},e.prototype.toString=function(){return this.stringValue},e.FOR_BITS=new Map,e.FOR_VALUE=new Map,e.TERMINATOR=new e(_r.TERMINATOR,`TERMINATOR`,Int32Array.from([0,0,0]),0),e.NUMERIC=new e(_r.NUMERIC,`NUMERIC`,Int32Array.from([10,12,14]),1),e.ALPHANUMERIC=new e(_r.ALPHANUMERIC,`ALPHANUMERIC`,Int32Array.from([9,11,13]),2),e.STRUCTURED_APPEND=new e(_r.STRUCTURED_APPEND,`STRUCTURED_APPEND`,Int32Array.from([0,0,0]),3),e.BYTE=new e(_r.BYTE,`BYTE`,Int32Array.from([8,16,16]),4),e.ECI=new e(_r.ECI,`ECI`,Int32Array.from([0,0,0]),7),e.KANJI=new e(_r.KANJI,`KANJI`,Int32Array.from([8,10,12]),8),e.FNC1_FIRST_POSITION=new e(_r.FNC1_FIRST_POSITION,`FNC1_FIRST_POSITION`,Int32Array.from([0,0,0]),5),e.FNC1_SECOND_POSITION=new e(_r.FNC1_SECOND_POSITION,`FNC1_SECOND_POSITION`,Int32Array.from([0,0,0]),9),e.HANZI=new e(_r.HANZI,`HANZI`,Int32Array.from([8,10,12]),13),e}(),vr=function(){function e(){}return e.decode=function(t,n,r,i){var a=new Qn(t),o=new j,s=[],c=-1,l=-1;try{var u=null,d=!1,f=void 0;do{if(a.available()<4)f=W.TERMINATOR;else{var p=a.readBits(4);f=W.forBits(p)}switch(f){case W.TERMINATOR:break;case W.FNC1_FIRST_POSITION:case W.FNC1_SECOND_POSITION:d=!0;break;case W.STRUCTURED_APPEND:if(a.available()<16)throw new E;c=a.readBits(8),l=a.readBits(8);break;case W.ECI:var m=e.parseECIValue(a);if(u=O.getCharacterSetECIByValue(m),u===null)throw new E;break;case W.HANZI:var h=a.readBits(4),g=a.readBits(f.getCharacterCountBits(n));h===e.GB2312_SUBSET&&e.decodeHanziSegment(a,o,g);break;default:var _=a.readBits(f.getCharacterCountBits(n));switch(f){case W.NUMERIC:e.decodeNumericSegment(a,o,_);break;case W.ALPHANUMERIC:e.decodeAlphanumericSegment(a,o,_,d);break;case W.BYTE:e.decodeByteSegment(a,o,_,u,s,i);break;case W.KANJI:e.decodeKanjiSegment(a,o,_);break;default:throw new E}}}while(f!==W.TERMINATOR)}catch{throw new E}return new Se(t,o.toString(),s.length===0?null:s,r===null?null:r.toString(),c,l)},e.decodeHanziSegment=function(e,t,n){if(n*13>e.available())throw new E;for(var r=new Uint8Array(2*n),i=0;n>0;){var a=e.readBits(13),o=a/96<<8|a%96;o+=o<959?41377:42657,r[i]=o>>8&255,r[i+1]=o&255,i+=2,n--}try{t.append(ne.decode(r,A.GB2312))}catch(e){throw new E(e)}},e.decodeKanjiSegment=function(e,t,n){if(n*13>e.available())throw new E;for(var r=new Uint8Array(2*n),i=0;n>0;){var a=e.readBits(13),o=a/192<<8|a%192;o+=o<7936?33088:49472,r[i]=o>>8,r[i+1]=o,i+=2,n--}try{t.append(ne.decode(r,A.SHIFT_JIS))}catch(e){throw new E(e)}},e.decodeByteSegment=function(e,t,n,r,i,a){if(8*n>e.available())throw new E;for(var o=new Uint8Array(n),s=0;s<n;s++)o[s]=e.readBits(8);var c=r===null?A.guessEncoding(o,a):r.getName();try{t.append(ne.decode(o,c))}catch(e){throw new E(e)}i.push(o)},e.toAlphaNumericChar=function(t){if(t>=e.ALPHANUMERIC_CHARS.length)throw new E;return e.ALPHANUMERIC_CHARS[t]},e.decodeAlphanumericSegment=function(t,n,r,i){for(var a=n.length();r>1;){if(t.available()<11)throw new E;var o=t.readBits(11);n.append(e.toAlphaNumericChar(Math.floor(o/45))),n.append(e.toAlphaNumericChar(o%45)),r-=2}if(r===1){if(t.available()<6)throw new E;n.append(e.toAlphaNumericChar(t.readBits(6)))}if(i)for(var s=a;s<n.length();s++)n.charAt(s)===`%`&&(s<n.length()-1&&n.charAt(s+1)===`%`?n.deleteCharAt(s+1):n.setCharAt(s,``))},e.decodeNumericSegment=function(t,n,r){for(;r>=3;){if(t.available()<10)throw new E;var i=t.readBits(10);if(i>=1e3)throw new E;n.append(e.toAlphaNumericChar(Math.floor(i/100))),n.append(e.toAlphaNumericChar(Math.floor(i/10)%10)),n.append(e.toAlphaNumericChar(i%10)),r-=3}if(r===2){if(t.available()<7)throw new E;var a=t.readBits(7);if(a>=100)throw new E;n.append(e.toAlphaNumericChar(Math.floor(a/10))),n.append(e.toAlphaNumericChar(a%10))}else if(r===1){if(t.available()<4)throw new E;var o=t.readBits(4);if(o>=10)throw new E;n.append(e.toAlphaNumericChar(o))}},e.parseECIValue=function(e){var t=e.readBits(8);if(!(t&128))return t&127;if((t&192)==128){var n=e.readBits(8);return(t&63)<<8|n}if((t&224)==192){var r=e.readBits(16);return(t&31)<<16|r}throw new E},e.ALPHANUMERIC_CHARS=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`,e.GB2312_SUBSET=1,e}(),yr=function(){function e(e){this.mirrored=e}return e.prototype.isMirrored=function(){return this.mirrored},e.prototype.applyMirroredCorrection=function(e){if(!(!this.mirrored||e===null||e.length<3)){var t=e[0];e[0]=e[2],e[2]=t}},e}(),br=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},xr=function(){function e(){this.rsDecoder=new Ne(Oe.QR_CODE_FIELD_256)}return e.prototype.decodeBooleanArray=function(e,t){return this.decodeBitMatrix(re.parseFromBooleanArray(e),t)},e.prototype.decodeBitMatrix=function(e,t){var n=new mr(e),r=null;try{return this.decodeBitMatrixParser(n,t)}catch(e){r=e}try{n.remask(),n.setMirror(!0),n.readVersion(),n.readFormatInformation(),n.mirror();var i=this.decodeBitMatrixParser(n,t);return i.setOther(new yr(!0)),i}catch(e){throw r===null?e:r}},e.prototype.decodeBitMatrixParser=function(e,t){var n,r,i,a,o=e.readVersion(),s=e.readFormatInformation().getErrorCorrectionLevel(),c=e.readCodewords(),l=gr.getDataBlocks(c,o,s),u=0;try{for(var d=br(l),f=d.next();!f.done;f=d.next()){var p=f.value;u+=p.getNumDataCodewords()}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}var m=new Uint8Array(u),h=0;try{for(var g=br(l),_=g.next();!_.done;_=g.next()){var p=_.value,v=p.getCodewords(),y=p.getNumDataCodewords();this.correctErrors(v,y);for(var b=0;b<y;b++)m[h++]=v[b]}}catch(e){i={error:e}}finally{try{_&&!_.done&&(a=g.return)&&a.call(g)}finally{if(i)throw i.error}}return vr.decode(m,o,s,t)},e.prototype.correctErrors=function(e,t){var n=new Int32Array(e);try{this.rsDecoder.decode(n,e.length-t)}catch{throw new f}for(var r=0;r<t;r++)e[r]=n[r]},e}(),Sr=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Cr=function(e){Sr(t,e);function t(t,n,r){var i=e.call(this,t,n)||this;return i.estimatedModuleSize=r,i}return t.prototype.aboutEquals=function(e,t,n){if(Math.abs(t-this.getY())<=e&&Math.abs(n-this.getX())<=e){var r=Math.abs(e-this.estimatedModuleSize);return r<=1||r<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(e,n,r){return new t((this.getX()+n)/2,(this.getY()+e)/2,(this.estimatedModuleSize+r)/2)},t}(I),wr=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Tr=function(){function e(e,t,n,r,i,a,o){this.image=e,this.startX=t,this.startY=n,this.width=r,this.height=i,this.moduleSize=a,this.resultPointCallback=o,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return e.prototype.find=function(){for(var e=this.startX,t=this.height,n=e+this.width,r=this.startY+t/2,i=new Int32Array(3),a=this.image,o=0;o<t;o++){var s=r+(o&1?-Math.floor((o+1)/2):Math.floor((o+1)/2));i[0]=0,i[1]=0,i[2]=0;for(var c=e;c<n&&!a.get(c,s);)c++;for(var l=0;c<n;){if(a.get(c,s)){if(l===1)i[1]++;else if(l===2){if(this.foundPatternCross(i)){var u=this.handlePossibleCenter(i,s,c);if(u!==null)return u}i[0]=i[2],i[1]=1,i[2]=0,l=1}else i[++l]++}else l===1&&l++,i[l]++;c++}if(this.foundPatternCross(i)){var u=this.handlePossibleCenter(i,s,n);if(u!==null)return u}}if(this.possibleCenters.length!==0)return this.possibleCenters[0];throw new M},e.centerFromEnd=function(e,t){return t-e[2]-e[1]/2},e.prototype.foundPatternCross=function(e){for(var t=this.moduleSize,n=t/2,r=0;r<3;r++)if(Math.abs(t-e[r])>=n)return!1;return!0},e.prototype.crossCheckVertical=function(t,n,r,i){var a=this.image,o=a.getHeight(),s=this.crossCheckStateCount;s[0]=0,s[1]=0,s[2]=0;for(var c=t;c>=0&&a.get(n,c)&&s[1]<=r;)s[1]++,c--;if(c<0||s[1]>r)return NaN;for(;c>=0&&!a.get(n,c)&&s[0]<=r;)s[0]++,c--;if(s[0]>r)return NaN;for(c=t+1;c<o&&a.get(n,c)&&s[1]<=r;)s[1]++,c++;if(c===o||s[1]>r)return NaN;for(;c<o&&!a.get(n,c)&&s[2]<=r;)s[2]++,c++;if(s[2]>r)return NaN;var l=s[0]+s[1]+s[2];return 5*Math.abs(l-i)>=2*i?NaN:this.foundPatternCross(s)?e.centerFromEnd(s,c):NaN},e.prototype.handlePossibleCenter=function(t,n,r){var i,a,o=t[0]+t[1]+t[2],s=e.centerFromEnd(t,r),c=this.crossCheckVertical(n,s,2*t[1],o);if(!isNaN(c)){var l=(t[0]+t[1]+t[2])/3;try{for(var u=wr(this.possibleCenters),d=u.next();!d.done;d=u.next()){var f=d.value;if(f.aboutEquals(l,c,s))return f.combineEstimate(c,s,l)}}catch(e){i={error:e}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(i)throw i.error}}var p=new Cr(s,c,l);this.possibleCenters.push(p),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(p)}return null},e}(),Er=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Dr=function(e){Er(t,e);function t(t,n,r,i){var a=e.call(this,t,n)||this;return a.estimatedModuleSize=r,a.count=i,i===void 0&&(a.count=1),a}return t.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},t.prototype.getCount=function(){return this.count},t.prototype.aboutEquals=function(e,t,n){if(Math.abs(t-this.getY())<=e&&Math.abs(n-this.getX())<=e){var r=Math.abs(e-this.estimatedModuleSize);return r<=1||r<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(e,n,r){var i=this.count+1;return new t((this.count*this.getX()+n)/i,(this.count*this.getY()+e)/i,(this.count*this.estimatedModuleSize+r)/i,i)},t}(I),Or=function(){function e(e){this.bottomLeft=e[0],this.topLeft=e[1],this.topRight=e[2]}return e.prototype.getBottomLeft=function(){return this.bottomLeft},e.prototype.getTopLeft=function(){return this.topLeft},e.prototype.getTopRight=function(){return this.topRight},e}(),kr=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Ar=function(){function e(e,t){this.image=e,this.resultPointCallback=t,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=t}return e.prototype.getImage=function(){return this.image},e.prototype.getPossibleCenters=function(){return this.possibleCenters},e.prototype.find=function(t){var n=t!=null&&t.get(w.TRY_HARDER)!==void 0,r=t!=null&&t.get(w.PURE_BARCODE)!==void 0,i=this.image,a=i.getHeight(),o=i.getWidth(),s=Math.floor(3*a/(4*e.MAX_MODULES));(s<e.MIN_SKIP||n)&&(s=e.MIN_SKIP);for(var c=!1,l=new Int32Array(5),u=s-1;u<a&&!c;u+=s){l.fill(0);for(var d=0,f=0;f<o;f++)if(i.get(f,u))(d&1)==1&&d++,l[d]++;else if(d&1)l[d]++;else if(d===4){if(e.foundPatternCross(l)){var p=this.handlePossibleCenter(l,u,f,r);if(p===!0){if(s=2,this.hasSkipped===!0)c=this.haveMultiplyConfirmedCenters();else{var m=this.findRowSkip();m>l[2]&&(u+=m-l[2]-s,f=o-1)}}else{l[0]=l[2],l[1]=l[3],l[2]=l[4],l[3]=1,l[4]=0,d=3;continue}d=0,l.fill(0)}else l[0]=l[2],l[1]=l[3],l[2]=l[4],l[3]=1,l[4]=0,d=3}else l[++d]++;if(e.foundPatternCross(l)){var p=this.handlePossibleCenter(l,u,o,r);p===!0&&(s=l[0],this.hasSkipped&&(c=this.haveMultiplyConfirmedCenters()))}}var h=this.selectBestPatterns();return I.orderBestPatterns(h),new Or(h)},e.centerFromEnd=function(e,t){return t-e[4]-e[3]-e[2]/2},e.foundPatternCross=function(e){for(var t=0,n=0;n<5;n++){var r=e[n];if(r===0)return!1;t+=r}if(t<7)return!1;var i=t/7,a=i/2;return Math.abs(i-e[0])<a&&Math.abs(i-e[1])<a&&Math.abs(3*i-e[2])<3*a&&Math.abs(i-e[3])<a&&Math.abs(i-e[4])<a},e.prototype.getCrossCheckStateCount=function(){return this.crossCheckStateCount.fill(0),this.crossCheckStateCount},e.prototype.crossCheckDiagonal=function(t,n,r,i){for(var a=this.getCrossCheckStateCount(),o=0,s=this.image;t>=o&&n>=o&&s.get(n-o,t-o);)a[2]++,o++;if(t<o||n<o)return!1;for(;t>=o&&n>=o&&!s.get(n-o,t-o)&&a[1]<=r;)a[1]++,o++;if(t<o||n<o||a[1]>r)return!1;for(;t>=o&&n>=o&&s.get(n-o,t-o)&&a[0]<=r;)a[0]++,o++;if(a[0]>r)return!1;var c=s.getHeight(),l=s.getWidth();for(o=1;t+o<c&&n+o<l&&s.get(n+o,t+o);)a[2]++,o++;if(t+o>=c||n+o>=l)return!1;for(;t+o<c&&n+o<l&&!s.get(n+o,t+o)&&a[3]<r;)a[3]++,o++;if(t+o>=c||n+o>=l||a[3]>=r)return!1;for(;t+o<c&&n+o<l&&s.get(n+o,t+o)&&a[4]<r;)a[4]++,o++;if(a[4]>=r)return!1;var u=a[0]+a[1]+a[2]+a[3]+a[4];return Math.abs(u-i)<2*i&&e.foundPatternCross(a)},e.prototype.crossCheckVertical=function(t,n,r,i){for(var a=this.image,o=a.getHeight(),s=this.getCrossCheckStateCount(),c=t;c>=0&&a.get(n,c);)s[2]++,c--;if(c<0)return NaN;for(;c>=0&&!a.get(n,c)&&s[1]<=r;)s[1]++,c--;if(c<0||s[1]>r)return NaN;for(;c>=0&&a.get(n,c)&&s[0]<=r;)s[0]++,c--;if(s[0]>r)return NaN;for(c=t+1;c<o&&a.get(n,c);)s[2]++,c++;if(c===o)return NaN;for(;c<o&&!a.get(n,c)&&s[3]<r;)s[3]++,c++;if(c===o||s[3]>=r)return NaN;for(;c<o&&a.get(n,c)&&s[4]<r;)s[4]++,c++;if(s[4]>=r)return NaN;var l=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(l-i)>=2*i?NaN:e.foundPatternCross(s)?e.centerFromEnd(s,c):NaN},e.prototype.crossCheckHorizontal=function(t,n,r,i){for(var a=this.image,o=a.getWidth(),s=this.getCrossCheckStateCount(),c=t;c>=0&&a.get(c,n);)s[2]++,c--;if(c<0)return NaN;for(;c>=0&&!a.get(c,n)&&s[1]<=r;)s[1]++,c--;if(c<0||s[1]>r)return NaN;for(;c>=0&&a.get(c,n)&&s[0]<=r;)s[0]++,c--;if(s[0]>r)return NaN;for(c=t+1;c<o&&a.get(c,n);)s[2]++,c++;if(c===o)return NaN;for(;c<o&&!a.get(c,n)&&s[3]<r;)s[3]++,c++;if(c===o||s[3]>=r)return NaN;for(;c<o&&a.get(c,n)&&s[4]<r;)s[4]++,c++;if(s[4]>=r)return NaN;var l=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(l-i)>=i?NaN:e.foundPatternCross(s)?e.centerFromEnd(s,c):NaN},e.prototype.handlePossibleCenter=function(t,n,r,i){var a=t[0]+t[1]+t[2]+t[3]+t[4],o=e.centerFromEnd(t,r),s=this.crossCheckVertical(n,Math.floor(o),t[2],a);if(!isNaN(s)&&(o=this.crossCheckHorizontal(Math.floor(o),Math.floor(s),t[2],a),!isNaN(o)&&(!i||this.crossCheckDiagonal(Math.floor(s),Math.floor(o),t[2],a)))){for(var c=a/7,l=!1,u=this.possibleCenters,d=0,f=u.length;d<f;d++){var p=u[d];if(p.aboutEquals(c,s,o)){u[d]=p.combineEstimate(s,o,c),l=!0;break}}if(!l){var m=new Dr(o,s,c);u.push(m),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(m)}return!0}return!1},e.prototype.findRowSkip=function(){var t,n;if(this.possibleCenters.length<=1)return 0;var r=null;try{for(var i=kr(this.possibleCenters),a=i.next();!a.done;a=i.next()){var o=a.value;if(o.getCount()>=e.CENTER_QUORUM){if(r==null)r=o;else return this.hasSkipped=!0,Math.floor((Math.abs(r.getX()-o.getX())-Math.abs(r.getY()-o.getY()))/2)}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return 0},e.prototype.haveMultiplyConfirmedCenters=function(){var t,n,r,i,a=0,o=0,s=this.possibleCenters.length;try{for(var c=kr(this.possibleCenters),l=c.next();!l.done;l=c.next()){var u=l.value;u.getCount()>=e.CENTER_QUORUM&&(a++,o+=u.getEstimatedModuleSize())}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}if(a<3)return!1;var d=o/s,f=0;try{for(var p=kr(this.possibleCenters),m=p.next();!m.done;m=p.next()){var u=m.value;f+=Math.abs(u.getEstimatedModuleSize()-d)}}catch(e){r={error:e}}finally{try{m&&!m.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}return f<=.05*o},e.prototype.selectBestPatterns=function(){var e,t,n,r,i=this.possibleCenters.length;if(i<3)throw new M;var a=this.possibleCenters,o;if(i>3){var s=0,c=0;try{for(var l=kr(this.possibleCenters),u=l.next();!u.done;u=l.next()){var d=u.value.getEstimatedModuleSize();s+=d,c+=d*d}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}o=s/i;var f=Math.sqrt(c/i-o*o);a.sort(function(e,t){var n=Math.abs(t.getEstimatedModuleSize()-o),r=Math.abs(e.getEstimatedModuleSize()-o);return n<r?-1:+(n>r)});for(var p=Math.max(.2*o,f),m=0;m<a.length&&a.length>3;m++){var h=a[m];Math.abs(h.getEstimatedModuleSize()-o)>p&&(a.splice(m,1),m--)}}if(a.length>3){var s=0;try{for(var g=kr(a),_=g.next();!_.done;_=g.next()){var v=_.value;s+=v.getEstimatedModuleSize()}}catch(e){n={error:e}}finally{try{_&&!_.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}o=s/a.length,a.sort(function(e,t){if(t.getCount()===e.getCount()){var n=Math.abs(t.getEstimatedModuleSize()-o),r=Math.abs(e.getEstimatedModuleSize()-o);return n<r?1:n>r?-1:0}return t.getCount()-e.getCount()}),a.splice(3)}return[a[0],a[1],a[2]]},e.CENTER_QUORUM=2,e.MIN_SKIP=3,e.MAX_MODULES=57,e}(),jr=function(){function e(e){this.image=e}return e.prototype.getImage=function(){return this.image},e.prototype.getResultPointCallback=function(){return this.resultPointCallback},e.prototype.detect=function(e){this.resultPointCallback=e==null?null:e.get(w.NEED_RESULT_POINT_CALLBACK);var t=new Ar(this.image,this.resultPointCallback).find(e);return this.processFinderPatternInfo(t)},e.prototype.processFinderPatternInfo=function(t){var n=t.getTopLeft(),r=t.getTopRight(),i=t.getBottomLeft(),a=this.calculateModuleSize(n,r,i);if(a<1)throw new M(`No pattern found in proccess finder.`);var o=e.computeDimension(n,r,i,a),s=dr.getProvisionalVersionForDimension(o),c=s.getDimensionForVersion()-7,l=null;if(s.getAlignmentPatternCenters().length>0)for(var u=r.getX()-n.getX()+i.getX(),d=r.getY()-n.getY()+i.getY(),f=1-3/c,p=Math.floor(n.getX()+f*(u-n.getX())),m=Math.floor(n.getY()+f*(d-n.getY())),h=4;h<=16;h<<=1)try{l=this.findAlignmentInRegion(a,p,m,h);break}catch(e){if(!(e instanceof M))throw e}var g=e.createTransform(n,r,i,l,o);return new Le(e.sampleGrid(this.image,g,o),l===null?[i,n,r]:[i,n,r,l])},e.createTransform=function(e,t,n,r,i){var a=i-3.5,o,s,c,l;return r===null?(o=t.getX()-e.getX()+n.getX(),s=t.getY()-e.getY()+n.getY(),c=a,l=a):(o=r.getX(),s=r.getY(),c=a-3,l=c),He.quadrilateralToQuadrilateral(3.5,3.5,a,3.5,c,l,3.5,a,e.getX(),e.getY(),t.getX(),t.getY(),o,s,n.getX(),n.getY())},e.sampleGrid=function(e,t,n){return Ge.getInstance().sampleGridWithTransform(e,n,n,t)},e.computeDimension=function(e,t,n,r){var i=F.round(I.distance(e,t)/r),a=F.round(I.distance(e,n)/r),o=Math.floor((i+a)/2)+7;switch(o&3){case 0:o++;break;case 2:o--;break;case 3:throw new M(`Dimensions could be not found.`)}return o},e.prototype.calculateModuleSize=function(e,t,n){return(this.calculateModuleSizeOneWay(e,t)+this.calculateModuleSizeOneWay(e,n))/2},e.prototype.calculateModuleSizeOneWay=function(e,t){var n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY())),r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY()));return isNaN(n)?r/7:isNaN(r)?n/7:(n+r)/14},e.prototype.sizeOfBlackWhiteBlackRunBothWays=function(e,t,n,r){var i=this.sizeOfBlackWhiteBlackRun(e,t,n,r),a=1,o=e-(n-e);o<0?(a=e/(e-o),o=0):o>=this.image.getWidth()&&(a=(this.image.getWidth()-1-e)/(o-e),o=this.image.getWidth()-1);var s=Math.floor(t-(r-t)*a);return a=1,s<0?(a=t/(t-s),s=0):s>=this.image.getHeight()&&(a=(this.image.getHeight()-1-t)/(s-t),s=this.image.getHeight()-1),o=Math.floor(e+(o-e)*a),i+=this.sizeOfBlackWhiteBlackRun(e,t,o,s),i-1},e.prototype.sizeOfBlackWhiteBlackRun=function(e,t,n,r){var i=Math.abs(r-t)>Math.abs(n-e);if(i){var a=e;e=t,t=a,a=n,n=r,r=a}for(var o=Math.abs(n-e),s=Math.abs(r-t),c=-o/2,l=e<n?1:-1,u=t<r?1:-1,d=0,f=n+l,p=e,m=t;p!==f;p+=l){var h=i?m:p,g=i?p:m;if(d===1===this.image.get(h,g)){if(d===2)return F.distance(p,m,e,t);d++}if(c+=s,c>0){if(m===r)break;m+=u,c-=o}}return d===2?F.distance(n+l,r,e,t):NaN},e.prototype.findAlignmentInRegion=function(e,t,n,r){var i=Math.floor(r*e),a=Math.max(0,t-i),o=Math.min(this.image.getWidth()-1,t+i);if(o-a<e*3)throw new M(`Alignment top exceeds estimated module size.`);var s=Math.max(0,n-i),c=Math.min(this.image.getHeight()-1,n+i);if(c-s<e*3)throw new M(`Alignment bottom exceeds estimated module size.`);return new Tr(this.image,a,s,o-a,c-s,e,this.resultPointCallback).find()},e}(),Mr=function(){function e(){this.decoder=new xr}return e.prototype.getDecoder=function(){return this.decoder},e.prototype.decode=function(t,n){var r,i;if(n!=null&&n.get(w.PURE_BARCODE)!==void 0){var a=e.extractPureBits(t.getBlackMatrix());r=this.decoder.decodeBitMatrix(a,n),i=e.NO_POINTS}else{var o=new jr(t.getBlackMatrix()).detect(n);r=this.decoder.decodeBitMatrix(o.getBits(),n),i=o.getPoints()}r.getOther()instanceof yr&&r.getOther().applyMirroredCorrection(i);var s=new ye(r.getText(),r.getRawBytes(),void 0,i,N.QR_CODE,void 0),c=r.getByteSegments();c!==null&&s.putMetadata(P.BYTE_SEGMENTS,c);var l=r.getECLevel();return l!==null&&s.putMetadata(P.ERROR_CORRECTION_LEVEL,l),r.hasStructuredAppend()&&(s.putMetadata(P.STRUCTURED_APPEND_SEQUENCE,r.getStructuredAppendSequenceNumber()),s.putMetadata(P.STRUCTURED_APPEND_PARITY,r.getStructuredAppendParity())),s},e.prototype.reset=function(){},e.extractPureBits=function(e){var t=e.getTopLeftOnBit(),n=e.getBottomRightOnBit();if(t===null||n===null)throw new M;var r=this.moduleSize(t,e),i=t[1],a=n[1],o=t[0],s=n[0];if(o>=s||i>=a||a-i!==s-o&&(s=o+(a-i),s>=e.getWidth()))throw new M;var c=Math.round((s-o+1)/r),l=Math.round((a-i+1)/r);if(c<=0||l<=0||l!==c)throw new M;var u=Math.floor(r/2);i+=u,o+=u;var d=o+Math.floor((c-1)*r)-s;if(d>0){if(d>u)throw new M;o-=d}var f=i+Math.floor((l-1)*r)-a;if(f>0){if(f>u)throw new M;i-=f}for(var p=new re(c,l),m=0;m<l;m++)for(var h=i+Math.floor(m*r),g=0;g<c;g++)e.get(o+Math.floor(g*r),h)&&p.set(g,m);return p},e.moduleSize=function(e,t){for(var n=t.getHeight(),r=t.getWidth(),i=e[0],a=e[1],o=!0,s=0;i<r&&a<n;){if(o!==t.get(i,a)){if(++s===5)break;o=!o}i++,a++}if(i===r||a===n)throw new M;return(i-e[0])/7},e.NO_POINTS=[],e}(),Nr=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Pr=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Fr=function(){function e(e){this.versionIndicator=e>>2&7,this.dataMask=e&3}return e.computeBCHFormatWord=function(t){for(var n=t<<10,r=4;r>=0;r--)n>>r+10&1&&(n^=e.BCH_GENERATOR<<r);return t<<10|n&1023},e.buildLookupTable=function(){for(var t=[],n=0;n<32;n++){var r=e.computeBCHFormatWord(n)^e.FORMAT_INFO_MASK_MICRO_QR;t.push([r,n])}return t},e.numBitsDiffering=function(e,t){return x.bitCount(e^t)},e.decodeFormatInformation=function(t){var n,r,i,a;try{for(var o=Nr(e.FORMAT_INFO_DECODE_LOOKUP),s=o.next();!s.done;s=o.next()){var c=Pr(s.value,2),l=c[0],u=c[1];if(l===t)return new e(u)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}var d=2**53-1,f=0;try{for(var p=Nr(e.FORMAT_INFO_DECODE_LOOKUP),m=p.next();!m.done;m=p.next()){var h=Pr(m.value,2),l=h[0],u=h[1],g=e.numBitsDiffering(t,l);g<d&&(d=g,f=u)}}catch(e){i={error:e}}finally{try{m&&!m.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}return d<=3?new e(f):null},e.prototype.getVersionIndicator=function(){return this.versionIndicator},e.prototype.getDataMask=function(){return this.dataMask},e.prototype.getMicroQRVersionNumber=function(){return this.versionIndicator===0?1:this.versionIndicator<=2?2:this.versionIndicator<=4?3:4},e.prototype.getECLevelLabel=function(){switch(this.versionIndicator){case 0:return null;case 1:case 3:case 5:return`L`;case 2:case 4:case 6:return`M`;case 7:return`Q`;default:return null}},e.FORMAT_INFO_MASK_MICRO_QR=17477,e.BCH_GENERATOR=1335,e.FORMAT_INFO_DECODE_LOOKUP=e.buildLookupTable(),e}(),Ir=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Lr=function(){function e(e,t,n){this.versionNumber=e,this.versionIndicator=t,this.ecBlocks=n;var r=n,i=r.getECBlocks()[0];this.totalCodewords=i.getCount()*(i.getDataCodewords()+r.getECCodewordsPerBlock())}return e.prototype.getVersionNumber=function(){return this.versionNumber},e.prototype.getVersionIndicator=function(){return this.versionIndicator},e.prototype.getDimensionForVersion=function(){return 9+2*this.versionNumber},e.prototype.getTotalCodewords=function(){return this.totalCodewords},e.prototype.getNumDataCodewords=function(){return this.ecBlocks.getECBlocks()[0].getDataCodewords()},e.prototype.getNumECCodewords=function(){return this.totalCodewords-this.getNumDataCodewords()},e.prototype.getECBlocks=function(){return this.ecBlocks},e.prototype.getECLevelLabel=function(){return e.VERSION_INFO[this.versionIndicator][1]},e.prototype.getModeIndicatorBits=function(){return e.MODE_INDICATOR_BITS[this.versionNumber-1]},e.prototype.buildFunctionPattern=function(){var e=this.getDimensionForVersion(),t=new re(e);return t.setRegion(0,0,9,9),e>9&&(t.setRegion(9,0,e-9,1),t.setRegion(0,9,1,e-9)),t},e.getVersionForIndicator=function(t){if(t<0||t>7)throw new E;var n=Ir(e.VERSION_INFO[t],1)[0];return new e(n,t,e.EC_BLOCKS[t])},e.getVersionForDimension=function(t){switch(t){case 11:return e.getVersionForIndicator(0);case 13:return e.getVersionForIndicator(1);case 15:return e.getVersionForIndicator(3);case 17:return e.getVersionForIndicator(5);default:throw new E}},e.prototype.toString=function(){return`M`+this.versionNumber},e.VERSION_INFO=[[1,null],[2,`L`],[2,`M`],[3,`L`],[3,`M`],[4,`L`],[4,`M`],[4,`Q`]],e.EC_BLOCKS=[new H(2,new U(1,3)),new H(5,new U(1,5)),new H(6,new U(1,4)),new H(6,new U(1,11)),new H(8,new U(1,9)),new H(8,new U(1,16)),new H(10,new U(1,14)),new H(14,new U(1,10))],e.MODE_INDICATOR_BITS=[0,1,2,3],e}(),Rr=function(){function e(e,t){this.maskIndex=e,this.isMasked=t}return e.forIndex=function(t){if(t<0||t>=e.MASKS.length)throw Error(`Invalid Micro QR mask index: `+t);return e.MASKS[t]},e.prototype.unmaskBitMatrix=function(e,t){for(var n=0;n<t;n++)for(var r=0;r<t;r++)this.isMasked(n,r)&&e.flip(r,n)},e.MASKS=[new e(0,function(e,t){return!(e&1)}),new e(1,function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2==0}),new e(2,function(e,t){var n=e*t;return((n&1)+n%3)%2==0}),new e(3,function(e,t){return((e+t&1)+e*t%3)%2==0})],e}(),zr=function(){function e(e){this.bitMatrix=e,this.parsedFormatInfo=null,this.parsedVersion=null;var t=e.getHeight();if(t<11||t>17||t%2!=1)throw new E}return e.prototype.readFormatInformation=function(){if(this.parsedFormatInfo!==null)return this.parsedFormatInfo;for(var e=0,t=1;t<=8;t++)e=this.copyBit(t,8,e);for(var n=7;n>=1;n--)e=this.copyBit(8,n,e);var r=Fr.decodeFormatInformation(e);if(r!==null)return this.parsedFormatInfo=r,this.parsedVersion=Lr.getVersionForIndicator(r.getVersionIndicator()),r;throw new E},e.prototype.copyBit=function(e,t,n){return this.bitMatrix.get(e,t)?n<<1|1:n<<1},e.prototype.readCodewords=function(){var e=this.readFormatInformation(),t=this.parsedVersion,n=Rr.forIndex(e.getDataMask()),r=this.bitMatrix.getHeight();n.unmaskBitMatrix(this.bitMatrix,r);for(var i=t.buildFunctionPattern(),a=t.getNumDataCodewords(),o=t.getVersionNumber()===1||t.getVersionNumber()===3,s=!0,c=new Uint8Array(t.getTotalCodewords()),l=0,u=0,d=0,f=r-1;f>0;f-=2){for(var p=0;p<r;p++)for(var m=s?r-1-p:p,h=0;h<2;h++){var g=f-h;if(!i.get(g,m)){d++,u<<=1,this.bitMatrix.get(g,m)&&(u|=1);var _=o&&l===a-1;d===(_?4:8)&&(c[l++]=_?u<<4&255:u&255,d=0,u=0)}}s=!s}if(l!==t.getTotalCodewords())throw new E;return c},e}(),Br=function(){function e(){}return e.decode=function(t,n,r){var i=new Qn(t),a=new j,o=[],s=n.getVersionNumber(),c=n.getModeIndicatorBits();try{for(;;){var l=void 0;if(c===0)l=e.MODE_NUMERIC;else{if(i.available()<c)break;var u=i.readBits(c);l=e.decodeMode(u,s)}var d=e.charCountBits(l,s);if(i.available()<d)break;var f=i.readBits(d);if(f===0)break;switch(l){case e.MODE_NUMERIC:e.decodeNumeric(i,a,f);break;case e.MODE_ALPHA:e.decodeAlphanumeric(i,a,f);break;case e.MODE_BYTE:e.decodeByte(i,a,o,f,r);break;case e.MODE_KANJI:e.decodeKanji(i,a,f);break;default:throw new E}}}catch(e){throw e instanceof E?e:new E}return new Se(t,a.toString(),o.length===0?null:o,n.getECLevelLabel(),-1,-1)},e.decodeMode=function(t,n){switch(n){case 2:return t===0?e.MODE_NUMERIC:e.MODE_ALPHA;case 3:switch(t){case 0:return e.MODE_NUMERIC;case 1:return e.MODE_ALPHA;case 2:return e.MODE_BYTE;case 3:return e.MODE_KANJI}break;case 4:switch(t){case 0:return e.MODE_NUMERIC;case 1:return e.MODE_ALPHA;case 2:return e.MODE_BYTE;case 4:return e.MODE_KANJI}}throw new E},e.charCountBits=function(t,n){switch(t){case e.MODE_NUMERIC:return n+2;case e.MODE_ALPHA:return n+1;case e.MODE_BYTE:return n+1;case e.MODE_KANJI:return n;default:throw new E}},e.decodeNumeric=function(t,n,r){for(var i=r;i>=3;){if(t.available()<10)throw new E;var a=t.readBits(10);if(a>=1e3)throw new E;n.append(e.toChar(Math.floor(a/100))),n.append(e.toChar(Math.floor(a/10)%10)),n.append(e.toChar(a%10)),i-=3}if(i===2){if(t.available()<7)throw new E;var o=t.readBits(7);if(o>=100)throw new E;n.append(e.toChar(Math.floor(o/10))),n.append(e.toChar(o%10))}else if(i===1){if(t.available()<4)throw new E;var s=t.readBits(4);if(s>=10)throw new E;n.append(e.toChar(s))}},e.decodeAlphanumeric=function(t,n,r){for(var i=r;i>1;){if(t.available()<11)throw new E;var a=t.readBits(11);n.append(e.toAlphaNum(Math.floor(a/45))),n.append(e.toAlphaNum(a%45)),i-=2}if(i===1){if(t.available()<6)throw new E;n.append(e.toAlphaNum(t.readBits(6)))}},e.decodeByte=function(e,t,n,r,i){if(8*r>e.available())throw new E;for(var a=new Uint8Array(r),o=0;o<r;o++)a[o]=e.readBits(8)&255;var s=A.guessEncoding(a,i);try{t.append(ne.decode(a,s))}catch{throw new E}n.push(a)},e.decodeKanji=function(e,t,n){if(13*n>e.available())throw new E;for(var r=new Uint8Array(2*n),i=0,a=0;a<n;a++){var o=e.readBits(13),s=Math.floor(o/192)<<8|o%192;s+=s<7936?33088:49472,r[i++]=s>>8&255,r[i++]=s&255}try{t.append(ne.decode(r,A.SHIFT_JIS))}catch{throw new E}},e.toChar=function(t){if(t>=e.ALPHANUMERIC_CHARS.length)throw new E;return e.ALPHANUMERIC_CHARS[t]},e.toAlphaNum=function(t){if(t>=e.ALPHANUMERIC_CHARS.length)throw new E;return e.ALPHANUMERIC_CHARS[t]},e.ALPHANUMERIC_CHARS=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`,e.MODE_NUMERIC=0,e.MODE_ALPHA=1,e.MODE_BYTE=2,e.MODE_KANJI=3,e}(),Vr=function(){function e(){this.rsDecoder=new Ne(Oe.QR_CODE_FIELD_256)}return e.prototype.decodeBitMatrix=function(e,t){var n=new zr(e),r=n.readFormatInformation(),i=Lr.getVersionForIndicator(r.getVersionIndicator()),a=n.readCodewords(),o=i.getNumDataCodewords();return i.getNumECCodewords(),i.getVersionNumber()===1||this.correctErrors(a,o),Br.decode(a.subarray(0,o),i,t??null)},e.prototype.correctErrors=function(e,t){var n=new Int32Array(e);try{this.rsDecoder.decode(n,e.length-t)}catch{throw new f}for(var r=0;r<t;r++)e[r]=n[r]&255},e}(),Hr=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ur=function(e){Hr(t,e);function t(t,n,r,i){i===void 0&&(i=1);var a=e.call(this,t,n)||this;return a.estimatedModuleSize=r,a.count=i,a}return t.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},t.prototype.getCount=function(){return this.count},t.prototype.aboutEquals=function(e,t,n){if(Math.abs(t-this.getY())<=e&&Math.abs(n-this.getX())<=e){var r=Math.abs(e-this.estimatedModuleSize);return r<=1||r<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(e,n,r){var i=this.count+1;return new t((this.count*this.getX()+n)/i,(this.count*this.getY()+e)/i,(this.count*this.estimatedModuleSize+r)/i,i)},t}(I),Wr=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Gr=function(){function e(e){this.image=e}return e.prototype.detect=function(e){this.resultPointCallback=e==null?null:e.get(w.NEED_RESULT_POINT_CALLBACK)??null;var t=this.findFinderPattern(e);return this.processFinderPattern(t)},e.prototype.findFinderPattern=function(e){for(var t=this.image,n=t.getHeight(),r=t.getWidth(),i=e!=null&&e.get(w.TRY_HARDER)!==void 0?1:Math.max(1,Math.floor(n/64)),a=new Int32Array(5),o=[],s=i-1;s<n;s+=i){a.fill(0);for(var c=0,l=0;l<r;l++)if(t.get(l,s))(c&1)==1&&c++,a[c]++;else if(c&1)a[c]++;else{if(c===4){if(this.foundPatternCross(a)&&this.handlePossibleCenter(a,s,l,o)){a.fill(0),c=0;continue}a[0]=a[2],a[1]=a[3],a[2]=a[4],a[3]=1,a[4]=0,c=3;continue}a[++c]++}this.foundPatternCross(a)&&this.handlePossibleCenter(a,s,r,o)}if(o.length===0)throw new M(`No Micro QR finder pattern found.`);return o.sort(function(e,t){return t.getCount()-e.getCount()}),o[0]},e.prototype.foundPatternCross=function(e){for(var t=0,n=0;n<5;n++){var r=e[n];if(r===0)return!1;t+=r}if(t<7)return!1;var i=t/7,a=i/2;return Math.abs(i-e[0])<a&&Math.abs(i-e[1])<a&&Math.abs(3*i-e[2])<3*a&&Math.abs(i-e[3])<a&&Math.abs(i-e[4])<a},e.prototype.handlePossibleCenter=function(e,t,n,r){var i=e[0]+e[1]+e[2]+e[3]+e[4],a=this.centerFromEnd(e,n),o=this.crossCheckVertical(t,Math.floor(a),e[2],i);if(isNaN(o))return!1;for(var s=(e[0]+e[1]+e[2]+e[3]+e[4])/7,c=0;c<r.length;c++){var l=r[c];if(l.aboutEquals(s,o,a))return r[c]=l.combineEstimate(o,a,s),!0}return r.push(new Ur(a,o,s)),this.resultPointCallback!==null&&this.resultPointCallback.foundPossibleResultPoint(r[r.length-1]),!1},e.prototype.centerFromEnd=function(e,t){return t-e[4]-e[3]-e[2]/2},e.prototype.crossCheckVertical=function(e,t,n,r){for(var i=this.image,a=i.getHeight(),o=new Int32Array(5),s=e;s>=0&&i.get(t,s);)o[2]++,s--;if(s<0)return NaN;for(;s>=0&&!i.get(t,s)&&o[1]<=r;)o[1]++,s--;if(s<0||o[1]>r)return NaN;for(;s>=0&&i.get(t,s)&&o[0]<=r;)o[0]++,s--;if(o[0]>r)return NaN;for(s=e+1;s<a&&i.get(t,s);)o[2]++,s++;if(s===a)return NaN;for(;s<a&&!i.get(t,s)&&o[3]<r;)o[3]++,s++;if(s===a||o[3]>=r)return NaN;for(;s<a&&i.get(t,s)&&o[4]<r;)o[4]++,s++;if(o[4]>=r)return NaN;var c=o[0]+o[1]+o[2]+o[3]+o[4];return 5*Math.abs(c-r)>=2*r?NaN:this.foundPatternCross(o)?this.centerFromEnd(o,s):NaN},e.prototype.processFinderPattern=function(t){var n=t.getX(),r=t.getY(),i=t.getEstimatedModuleSize();if(i<1)throw new M(`Module size too small.`);var a=this.determineDimension(n,r,i);if(a===null)throw new M(`Cannot determine Micro QR symbol dimension.`);var o=a.dim,s=a.orientation,c=(o-7)*i,l=[c,0,-c,0][s],u=[0,c,0,-c][s],d=[0,-c,0,c][s],f=[c,0,-c,0][s],p=n+l,m=r+u,h=n+d,g=r+f,_=e.createTransform(n,r,p,m,h,g,o);return new Le(e.sampleGrid(this.image,_,o),[new I(n,r),new I(p,m),new I(h,g)])},e.prototype.determineDimension=function(e,t,n){for(var r=[[5,-3,1,0,-3,5,0,1],[3,5,0,1,-5,-3,-1,0],[-5,3,-1,0,3,-5,0,-1],[-3,-5,0,-1,5,3,1,0]],i=null,a=0;a<4;a++){var o=Wr(r[a],8),s=o[0],c=o[1],l=o[2],u=o[3],d=o[4],f=o[5],p=o[6],m=o[7],h=this.probeTimingLine(e+s*n,t+c*n,l,u,n),g=this.probeTimingLine(e+d*n,t+f*n,p,m,n);if(h!==null&&g!==null){var _=this.snapDimension(h,g);if(_!==null)return{dim:_,orientation:a}}else if(i===null&&(h!==null||g!==null)){var _=this.snapDimension(h,g);_!==null&&(i={dim:_,orientation:a})}}return i},e.prototype.snapDimension=function(e,t){if(e===null)return t;if(t===null||e===t)return e;var n=Math.round((e+t)/2);return[11,13,15,17].reduce(function(e,t){return Math.abs(t-n)<Math.abs(e-n)?t:e})},e.prototype.probeTimingLine=function(e,t,n,r,i){for(var a=0,o=0;o<10;o++){var s=8+o,c=Math.round(e+n*o*i),l=Math.round(t+r*o*i);if(c<0||c>=this.image.getWidth()||l<0||l>=this.image.getHeight())break;var u=this.image.get(c,l),d=s%2==0;if(u!==d)break;d&&a++}if(a<2)return null;var f=8+2*a-1;if(f===11||f===13||f===15||f===17)return f;var p=[11,13,15,17].reduce(function(e,t){return Math.abs(t-f)<Math.abs(e-f)?t:e});return Math.abs(p-f)<=2?p:null},e.createTransform=function(e,t,n,r,i,a,o){var s=o-3.5;return He.quadrilateralToQuadrilateral(3.5,3.5,s,3.5,3.5,s,s,s,e,t,n,r,i,a,n+(i-e),r+(a-t))},e.sampleGrid=function(e,t,n){return Ge.getInstance().sampleGridWithTransform(e,n,n,t)},e}(),Kr=function(){function e(){this.decoder=new Vr}return e.prototype.decode=function(e,t){var n,r;if(t!=null&&t.get(w.PURE_BARCODE)!==void 0){var i=e.getBlackMatrix();n=this.decoder.decodeBitMatrix(i,t??void 0),r=[]}else{var a=new Gr(e.getBlackMatrix()).detect(t??void 0);r=a.getPoints(),n=this.decoder.decodeBitMatrix(a.getBits(),t??void 0)}var o=new ye(n.getText(),n.getRawBytes(),n.getNumBits(),r,N.MICRO_QR_CODE,m.currentTimeMillis()),s=n.getByteSegments();s!==null&&o.putMetadata(P.BYTE_SEGMENTS,s);var c=n.getECLevel();return c!==null&&o.putMetadata(P.ERROR_CORRECTION_LEVEL,c),o},e.prototype.reset=function(){},e}(),qr=function(){function e(e){this.bitMatrix=e}return e.prototype.readCodewords=function(){for(var t=new Uint8Array(144),n=this.bitMatrix.getHeight(),r=this.bitMatrix.getWidth(),i=0;i<n;i++)for(var a=e.BITNR[i],o=0;o<r;o++){var s=a[o];s>=0&&this.bitMatrix.get(o,i)&&(t[Math.floor(s/6)]|=1<<5-s%6)}return t},e.BITNR=[[121,120,127,126,133,132,139,138,145,144,151,150,157,156,163,162,169,168,175,174,181,180,187,186,193,192,199,198,-2,-2],[123,122,129,128,135,134,141,140,147,146,153,152,159,158,165,164,171,170,177,176,183,182,189,188,195,194,201,200,816,-3],[125,124,131,130,137,136,143,142,149,148,155,154,161,160,167,166,173,172,179,178,185,184,191,190,197,196,203,202,818,817],[283,282,277,276,271,270,265,264,259,258,253,252,247,246,241,240,235,234,229,228,223,222,217,216,211,210,205,204,819,-3],[285,284,279,278,273,272,267,266,261,260,255,254,249,248,243,242,237,236,231,230,225,224,219,218,213,212,207,206,821,820],[287,286,281,280,275,274,269,268,263,262,257,256,251,250,245,244,239,238,233,232,227,226,221,220,215,214,209,208,822,-3],[289,288,295,294,301,300,307,306,313,312,319,318,325,324,331,330,337,336,343,342,349,348,355,354,361,360,367,366,824,823],[291,290,297,296,303,302,309,308,315,314,321,320,327,326,333,332,339,338,345,344,351,350,357,356,363,362,369,368,825,-3],[293,292,299,298,305,304,311,310,317,316,323,322,329,328,335,334,341,340,347,346,353,352,359,358,365,364,371,370,827,826],[409,408,403,402,397,396,391,390,79,78,-2,-2,13,12,37,36,2,-1,44,43,109,108,385,384,379,378,373,372,828,-3],[411,410,405,404,399,398,393,392,81,80,40,-2,15,14,39,38,3,-1,-1,45,111,110,387,386,381,380,375,374,830,829],[413,412,407,406,401,400,395,394,83,82,41,-3,-3,-3,-3,-3,5,4,47,46,113,112,389,388,383,382,377,376,831,-3],[415,414,421,420,427,426,103,102,55,54,16,-3,-3,-3,-3,-3,-3,-3,20,19,85,84,433,432,439,438,445,444,833,832],[417,416,423,422,429,428,105,104,57,56,-3,-3,-3,-3,-3,-3,-3,-3,22,21,87,86,435,434,441,440,447,446,834,-3],[419,418,425,424,431,430,107,106,59,58,-3,-3,-3,-3,-3,-3,-3,-3,-3,23,89,88,437,436,443,442,449,448,836,835],[481,480,475,474,469,468,48,-2,30,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,0,53,52,463,462,457,456,451,450,837,-3],[483,482,477,476,471,470,49,-1,-2,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-2,-1,465,464,459,458,453,452,839,838],[485,484,479,478,473,472,51,50,31,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,1,-2,42,467,466,461,460,455,454,840,-3],[487,486,493,492,499,498,97,96,61,60,-3,-3,-3,-3,-3,-3,-3,-3,-3,26,91,90,505,504,511,510,517,516,842,841],[489,488,495,494,501,500,99,98,63,62,-3,-3,-3,-3,-3,-3,-3,-3,28,27,93,92,507,506,513,512,519,518,843,-3],[491,490,497,496,503,502,101,100,65,64,17,-3,-3,-3,-3,-3,-3,-3,18,29,95,94,509,508,515,514,521,520,845,844],[559,558,553,552,547,546,541,540,73,72,32,-3,-3,-3,-3,-3,-3,10,67,66,115,114,535,534,529,528,523,522,846,-3],[561,560,555,554,549,548,543,542,75,74,-2,-1,7,6,35,34,11,-2,69,68,117,116,537,536,531,530,525,524,848,847],[563,562,557,556,551,550,545,544,77,76,-2,33,9,8,25,24,-1,-2,71,70,119,118,539,538,533,532,527,526,849,-3],[565,564,571,570,577,576,583,582,589,588,595,594,601,600,607,606,613,612,619,618,625,624,631,630,637,636,643,642,851,850],[567,566,573,572,579,578,585,584,591,590,597,596,603,602,609,608,615,614,621,620,627,626,633,632,639,638,645,644,852,-3],[569,568,575,574,581,580,587,586,593,592,599,598,605,604,611,610,617,616,623,622,629,628,635,634,641,640,647,646,854,853],[727,726,721,720,715,714,709,708,703,702,697,696,691,690,685,684,679,678,673,672,667,666,661,660,655,654,649,648,855,-3],[729,728,723,722,717,716,711,710,705,704,699,698,693,692,687,686,681,680,675,674,669,668,663,662,657,656,651,650,857,856],[731,730,725,724,719,718,713,712,707,706,701,700,695,694,689,688,683,682,677,676,671,670,665,664,659,658,653,652,858,-3],[733,732,739,738,745,744,751,750,757,756,763,762,769,768,775,774,781,780,787,786,793,792,799,798,805,804,811,810,860,859],[735,734,741,740,747,746,753,752,759,758,765,764,771,770,777,776,783,782,789,788,795,794,801,800,807,806,813,812,861,-3],[737,736,743,742,749,748,755,754,761,760,767,766,773,772,779,778,785,784,791,790,797,796,803,802,809,808,815,814,863,862]],e}(),Jr=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Yr=function(){function e(){}return e.decode=function(t,n){var r=[];switch(n){case 2:case 3:var i=void 0;if(n===2){var a=e.getPostCode2(t),o=e.getPostCode2Length(t);if(o>10)throw E.getFormatInstance();i=String(a).padStart(o,`0`)}else i=e.getPostCode3(t);var s=String(e.getCountry(t)).padStart(3,`0`),c=String(e.getServiceClass(t)).padStart(3,`0`),l=e.getMessage(t,10,84);r.push(l),r.join(``).startsWith(`[)>`+e.RS+`01`+e.GS)?(r.splice(0,r.length),r.push(l.substring(0,9)),r.push(i+e.GS+s+e.GS+c+e.GS),r.push(l.substring(9))):(r.splice(0,r.length),r.push(i+e.GS+s+e.GS+c+e.GS),r.push(l));break;case 4:r.push(e.getMessage(t,1,93));break;case 5:r.push(e.getMessage(t,1,77))}return new Se(t,r.join(``),null,String(n))},e.getBit=function(e,t){return e--,t[Math.floor(e/6)]&1<<5-e%6?1:0},e.getInt=function(t,n){for(var r=0,i=0;i<n.length;i++)r+=e.getBit(n[i],t)<<n.length-i-1;return r},e.getCountry=function(t){return e.getInt(t,e.COUNTRY_BYTES)},e.getServiceClass=function(t){return e.getInt(t,e.SERVICE_CLASS_BYTES)},e.getPostCode2Length=function(t){return e.getInt(t,e.POSTCODE_2_LENGTH_BYTES)},e.getPostCode2=function(t){return e.getInt(t,e.POSTCODE_2_BYTES)},e.getPostCode3=function(t){var n,r,i=[];try{for(var a=Jr(e.POSTCODE_3_BYTES),o=a.next();!o.done;o=a.next()){var s=o.value;i.push(e.SETS[0].charAt(e.getInt(t,s)))}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i.join(``)},e.getMessage=function(t,n,r){for(var i=[],a=-1,o=0,s=0,c=n;c<n+r;c++){var l=e.SETS[o].charAt(t[c]);switch(l){case e.LATCHA:o=0,a=-1;break;case e.LATCHB:o=1,a=-1;break;case e.SHIFTA:case e.SHIFTB:case e.SHIFTC:case e.SHIFTD:case e.SHIFTE:s=o,o=l.charCodeAt(0)-e.SHIFTA.charCodeAt(0),a=1;break;case e.TWOSHIFTA:s=o,o=0,a=2;break;case e.THREESHIFTA:s=o,o=0,a=3;break;case e.NS:var u=(t[++c]<<24)+(t[++c]<<18)+(t[++c]<<12)+(t[++c]<<6)+t[++c];i.push(String(u).padStart(9,`0`));break;case e.LOCK:a=-1;break;default:i.push(l)}a--===0&&(o=s)}for(;i.length>0&&i[i.length-1]===e.PAD;)i.pop();return i.join(``)},e.SHIFTA=`￰`,e.SHIFTB=`￱`,e.SHIFTC=`￲`,e.SHIFTD=`￳`,e.SHIFTE=`￴`,e.TWOSHIFTA=`￵`,e.THREESHIFTA=`￶`,e.LATCHA=`￷`,e.LATCHB=`￸`,e.LOCK=``,e.ECI=``,e.NS=``,e.PAD=``,e.FS=``,e.GS=``,e.RS=``,e.COUNTRY_BYTES=[53,54,43,44,45,46,47,48,37,38],e.SERVICE_CLASS_BYTES=[55,56,57,58,59,60,49,50,51,52],e.POSTCODE_2_LENGTH_BYTES=[39,40,41,42,31,32],e.POSTCODE_2_BYTES=[33,34,35,36,25,26,27,28,29,30,19,20,21,22,23,24,13,14,15,16,17,18,7,8,9,10,11,12,1,2],e.POSTCODE_3_BYTES=[[39,40,41,42,31,32],[33,34,35,36,25,26],[27,28,29,30,19,20],[21,22,23,24,13,14],[15,16,17,18,7,8],[9,10,11,12,1,2]],e.SETS=[`\rABCDEFGHIJKLMNOPQRSTUVWXYZ`+e.ECI+e.FS+e.GS+e.RS+e.NS+` `+e.PAD+`"#$%&'()*+,-./0123456789:`+e.SHIFTB+e.SHIFTC+e.SHIFTD+e.SHIFTE+e.LATCHB,"`abcdefghijklmnopqrstuvwxyz"+e.ECI+e.FS+e.GS+e.RS+e.NS+`{`+e.PAD+`}~;<=>?[\\]^_ ,./:@!|`+e.PAD+e.TWOSHIFTA+e.THREESHIFTA+e.PAD+e.SHIFTA+e.SHIFTC+e.SHIFTD+e.SHIFTE+e.LATCHA,`ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚ`+e.ECI+e.FS+e.GS+e.RS+e.NS+`ÛÜÝÞߪ¬±²³µ¹º¼½¾€‚ƒ„…†‡ˆ‰`+e.LATCHA+` `+e.LOCK+e.SHIFTD+e.SHIFTE+e.LATCHB,`àáâãäåæçèéêëìíîïðñòóôõö÷øùú`+e.ECI+e.FS+e.GS+e.RS+e.NS+`ûüýþÿ¡¨«¯°´·¸»¿Š‹ŒŽ‘’“”`+e.LATCHA+` `+e.SHIFTC+e.LOCK+e.SHIFTE+e.LATCHB,`\0\x07\b
7
- \v\f\r`+e.ECI+e.PAD+e.PAD+`\x1B`+e.NS+e.FS+e.GS+e.RS+`Ÿ\xA0¢£¤¥¦§©­®¶•–—˜™š›œž`+e.LATCHA+` `+e.SHIFTC+e.SHIFTD+e.LOCK+e.LATCHB],e}(),Xr=function(){function e(){this.rsDecoder=new Ne(Oe.MAXICODE_FIELD_64)}return e.prototype.decode=function(t,n){var r=new qr(t).readCodewords(),i=this.correctErrors(r,0,10,10,e.ALL),a=r[0]&15,o;switch(a){case 2:case 3:case 4:i+=this.correctErrors(r,20,84,40,e.EVEN),i+=this.correctErrors(r,20,84,40,e.ODD),o=new Uint8Array(94);break;case 5:i+=this.correctErrors(r,20,68,56,e.EVEN),i+=this.correctErrors(r,20,68,56,e.ODD),o=new Uint8Array(78);break;default:throw E.getFormatInstance()}for(var s=0;s<10;s++)o[s]=r[s];for(var s=0;s<o.length-10;s++)o[s+10]=r[s+20];var c=Yr.decode(o,a);return c.setErrorsCorrected(i),c},e.prototype.correctErrors=function(t,n,r,i,a){for(var o=r+i,s=a===e.ALL?1:2,c=new Int32Array(Math.floor(o/s)),l=0;l<o;l++)(a===e.ALL||l%2==a-1)&&(c[Math.floor(l/s)]=t[l+n]&255);var u=0;try{u=this.rsDecoder.decodeWithECCount(c,Math.floor(i/s))}catch(e){throw e instanceof Ae?f.getChecksumInstance():e}for(var l=0;l<r;l++)(a===e.ALL||l%2==a-1)&&(t[l+n]=c[Math.floor(l/s)]);return u},e.ALL=0,e.EVEN=1,e.ODD=2,e}(),Zr=function(){function e(){this.decoder=new Xr}return e.prototype.decode=function(t,n){n===void 0&&(n=null);var r=e.extractPureBits(t.getBlackMatrix()),i=this.decoder.decode(r,n),a=new ye(i.getText(),i.getRawBytes(),8*i.getRawBytes().length,e.NO_POINTS,N.MAXICODE,m.currentTimeMillis());a.putMetadata(P.ERRORS_CORRECTED,i.getErrorsCorrected());var o=i.getECLevel();return o!=null&&a.putMetadata(P.ERROR_CORRECTION_LEVEL,o),a},e.prototype.reset=function(){},e.extractPureBits=function(t){var n=t.getEnclosingRectangle();if(n==null)throw new M;for(var r=n[0],i=n[1],a=n[2],o=n[3],s=new re(e.MATRIX_WIDTH,e.MATRIX_HEIGHT),c=0;c<e.MATRIX_HEIGHT;c++)for(var l=i+Math.min(Math.floor((c*o+o/2)/e.MATRIX_HEIGHT),o-1),u=0;u<e.MATRIX_WIDTH;u++){var d=r+Math.min(Math.floor((u*a+a/2+(c&1)*Math.floor(a/2))/e.MATRIX_WIDTH),a-1);t.get(d,l)&&s.set(u,c)}return s},e.NO_POINTS=[],e.MATRIX_WIDTH=30,e.MATRIX_HEIGHT=33,e}(),Qr=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},G=function(){function e(){}return e.prototype.PDF417Common=function(){},e.getBitCountSum=function(e){return F.sum(e)},e.toIntArray=function(t){var n,r;if(t==null||!t.length)return e.EMPTY_INT_ARRAY;var i=new Int32Array(t.length),a=0;try{for(var o=Qr(t),s=o.next();!s.done;s=o.next()){var c=s.value;i[a++]=c}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},e.getCodeword=function(t){var n=b.binarySearch(e.SYMBOL_TABLE,t&262143);return n<0?-1:(e.CODEWORD_TABLE[n]-1)%e.NUMBER_OF_CODEWORDS},e.NUMBER_OF_CODEWORDS=929,e.MAX_CODEWORDS_IN_BARCODE=e.NUMBER_OF_CODEWORDS-1,e.MIN_ROWS_IN_BARCODE=3,e.MAX_ROWS_IN_BARCODE=90,e.MODULES_IN_CODEWORD=17,e.MODULES_IN_STOP_PATTERN=18,e.BARS_IN_MODULE=8,e.EMPTY_INT_ARRAY=new Int32Array([]),e.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),e.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]),e}(),$r=function(){function e(e,t){this.bits=e,this.points=t}return e.prototype.getBits=function(){return this.bits},e.prototype.getPoints=function(){return this.points},e}(),ei=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},ti=function(){function e(){}return e.detectMultiple=function(t,n,r){var i=t.getBlackMatrix(),a=e.detect(r,i);return a.length||(i=i.clone(),i.rotate180(),a=e.detect(r,i)),new $r(i,a)},e.detect=function(t,n){for(var r,i,a=[],o=0,s=0,c=!1;o<n.getHeight();){var l=e.findVertices(n,o,s);if(l[0]==null&&l[3]==null){if(!c)break;c=!1,s=0;try{for(var u=(r=void 0,ei(a)),d=u.next();!d.done;d=u.next()){var f=d.value;f[1]!=null&&(o=Math.trunc(Math.max(o,f[1].getY()))),f[3]!=null&&(o=Math.max(o,Math.trunc(f[3].getY())))}}catch(e){r={error:e}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}o+=e.ROW_STEP}else{if(c=!0,a.push(l),!t)break;l[2]==null?(s=Math.trunc(l[4].getX()),o=Math.trunc(l[4].getY())):(s=Math.trunc(l[2].getX()),o=Math.trunc(l[2].getY()))}}return a},e.findVertices=function(t,n,r){var i=t.getHeight(),a=t.getWidth(),o=Array(8);return e.copyToResult(o,e.findRowsWithPattern(t,i,a,n,r,e.START_PATTERN),e.INDEXES_START_PATTERN),o[4]!=null&&(r=Math.trunc(o[4].getX()),n=Math.trunc(o[4].getY())),e.copyToResult(o,e.findRowsWithPattern(t,i,a,n,r,e.STOP_PATTERN),e.INDEXES_STOP_PATTERN),o},e.copyToResult=function(e,t,n){for(var r=0;r<n.length;r++)e[n[r]]=t[r]},e.findRowsWithPattern=function(t,n,r,i,a,o){for(var s=[,,,,],c=!1,l=new Int32Array(o.length);i<n;i+=e.ROW_STEP){var u=e.findGuardPattern(t,a,i,r,!1,o,l);if(u!=null){for(;i>0;){var d=e.findGuardPattern(t,a,--i,r,!1,o,l);if(d!=null)u=d;else{i++;break}}s[0]=new I(u[0],i),s[1]=new I(u[1],i),c=!0;break}}var f=i+1;if(c){for(var p=0,d=Int32Array.from([Math.trunc(s[0].getX()),Math.trunc(s[1].getX())]);f<n;f++){var u=e.findGuardPattern(t,d[0],f,r,!1,o,l);if(u!=null&&Math.abs(d[0]-u[0])<e.MAX_PATTERN_DRIFT&&Math.abs(d[1]-u[1])<e.MAX_PATTERN_DRIFT)d=u,p=0;else if(p>e.SKIPPED_ROW_COUNT_MAX)break;else p++}f-=p+1,s[2]=new I(d[0],f),s[3]=new I(d[1],f)}return f-i<e.BARCODE_MIN_HEIGHT&&b.fill(s,null),s},e.findGuardPattern=function(t,n,r,i,a,o,s){b.fillWithin(s,0,s.length,0);for(var c=n,l=0;t.get(c,r)&&c>0&&l++<e.MAX_PIXEL_DRIFT;)c--;for(var u=c,d=0,f=o.length,p=a;u<i;u++)if(t.get(u,r)!==p)s[d]++;else{if(d===f-1){if(e.patternMatchVariance(s,o,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return new Int32Array([c,u]);c+=s[0]+s[1],m.arraycopy(s,2,s,0,d-1),s[d-1]=0,s[d]=0,d--}else d++;s[d]=1,p=!p}return d===f-1&&e.patternMatchVariance(s,o,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE?new Int32Array([c,u-1]):null},e.patternMatchVariance=function(e,t,n){for(var r=e.length,i=0,a=0,o=0;o<r;o++)i+=e[o],a+=t[o];if(i<a)return 1/0;var s=i/a;n*=s;for(var c=0,l=0;l<r;l++){var u=e[l],d=t[l]*s,f=u>d?u-d:d-u;if(f>n)return 1/0;c+=f}return c/i},e.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),e.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),e.MAX_AVG_VARIANCE=.42,e.MAX_INDIVIDUAL_VARIANCE=.8,e.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),e.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),e.MAX_PIXEL_DRIFT=3,e.MAX_PATTERN_DRIFT=5,e.SKIPPED_ROW_COUNT_MAX=25,e.ROW_STEP=5,e.BARCODE_MIN_HEIGHT=10,e}(),ni=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},ri=function(){function e(e,t){if(t.length===0)throw new l;this.field=e;var n=t.length;if(n>1&&t[0]===0){for(var r=1;r<n&&t[r]===0;)r++;r===n?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(n-r),m.arraycopy(t,r,this.coefficients,0,this.coefficients.length))}else this.coefficients=t}return e.prototype.getCoefficients=function(){return this.coefficients},e.prototype.getDegree=function(){return this.coefficients.length-1},e.prototype.isZero=function(){return this.coefficients[0]===0},e.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},e.prototype.evaluateAt=function(e){var t,n;if(e===0)return this.getCoefficient(0);if(e===1){var r=0;try{for(var i=ni(this.coefficients),a=i.next();!a.done;a=i.next()){var o=a.value;r=this.field.add(r,o)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}for(var s=this.coefficients[0],c=this.coefficients.length,l=1;l<c;l++)s=this.field.add(this.field.multiply(e,s),this.coefficients[l]);return s},e.prototype.add=function(t){if(!this.field.equals(t.field))throw new l(`ModulusPolys do not have same ModulusGF field`);if(this.isZero())return t;if(t.isZero())return this;var n=this.coefficients,r=t.coefficients;if(n.length>r.length){var i=n;n=r,r=i}var a=new Int32Array(r.length),o=r.length-n.length;m.arraycopy(r,0,a,0,o);for(var s=o;s<r.length;s++)a[s]=this.field.add(n[s-o],r[s]);return new e(this.field,a)},e.prototype.subtract=function(e){if(!this.field.equals(e.field))throw new l(`ModulusPolys do not have same ModulusGF field`);return e.isZero()?this:this.add(e.negative())},e.prototype.multiply=function(t){return t instanceof e?this.multiplyOther(t):this.multiplyScalar(t)},e.prototype.multiplyOther=function(t){if(!this.field.equals(t.field))throw new l(`ModulusPolys do not have same ModulusGF field`);if(this.isZero()||t.isZero())return new e(this.field,new Int32Array([0]));for(var n=this.coefficients,r=n.length,i=t.coefficients,a=i.length,o=new Int32Array(r+a-1),s=0;s<r;s++)for(var c=n[s],u=0;u<a;u++)o[s+u]=this.field.add(o[s+u],this.field.multiply(c,i[u]));return new e(this.field,o)},e.prototype.negative=function(){for(var t=this.coefficients.length,n=new Int32Array(t),r=0;r<t;r++)n[r]=this.field.subtract(0,this.coefficients[r]);return new e(this.field,n)},e.prototype.multiplyScalar=function(t){if(t===0)return new e(this.field,new Int32Array([0]));if(t===1)return this;for(var n=this.coefficients.length,r=new Int32Array(n),i=0;i<n;i++)r[i]=this.field.multiply(this.coefficients[i],t);return new e(this.field,r)},e.prototype.multiplyByMonomial=function(t,n){if(t<0)throw new l;if(n===0)return new e(this.field,new Int32Array([0]));for(var r=this.coefficients.length,i=new Int32Array(r+t),a=0;a<r;a++)i[a]=this.field.multiply(this.coefficients[a],n);return new e(this.field,i)},e.prototype.toString=function(){for(var e=new j,t=this.getDegree();t>=0;t--){var n=this.getCoefficient(t);n!==0&&(n<0?(e.append(` - `),n=-n):e.length()>0&&e.append(` + `),(t===0||n!==1)&&e.append(n),t!==0&&(t===1?e.append(`x`):(e.append(`x^`),e.append(t))))}return e.toString()},e}(),ii=function(){function e(){}return e.prototype.add=function(e,t){return(e+t)%this.modulus},e.prototype.subtract=function(e,t){return(this.modulus+e-t)%this.modulus},e.prototype.exp=function(e){return this.expTable[e]},e.prototype.log=function(e){if(e===0)throw new l;return this.logTable[e]},e.prototype.inverse=function(e){if(e===0)throw new Ee;return this.expTable[this.modulus-this.logTable[e]-1]},e.prototype.multiply=function(e,t){return e===0||t===0?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.modulus-1)]},e.prototype.getSize=function(){return this.modulus},e.prototype.equals=function(e){return e===this},e}(),ai=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),oi=function(e){ai(t,e);function t(t,n){var r=e.call(this)||this;r.modulus=t,r.expTable=new Int32Array(t),r.logTable=new Int32Array(t);for(var i=1,a=0;a<t;a++)r.expTable[a]=i,i=i*n%t;for(var a=0;a<t-1;a++)r.logTable[r.expTable[a]]=a;return r.zero=new ri(r,new Int32Array([0])),r.one=new ri(r,new Int32Array([1])),r}return t.prototype.getZero=function(){return this.zero},t.prototype.getOne=function(){return this.one},t.prototype.buildMonomial=function(e,t){if(e<0)throw new l;if(t===0)return this.zero;var n=new Int32Array(e+1);return n[0]=t,new ri(this,n)},t.PDF417_GF=new t(G.NUMBER_OF_CODEWORDS,3),t}(ii),si=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},ci=function(){function e(){this.field=oi.PDF417_GF}return e.prototype.decode=function(e,t,n){for(var r,i,a=new ri(this.field,e),o=new Int32Array(t),s=!1,c=t;c>0;c--){var l=a.evaluateAt(this.field.exp(c));o[t-c]=l,l!==0&&(s=!0)}if(!s)return 0;var u=this.field.getOne();if(n!=null)try{for(var d=si(n),p=d.next();!p.done;p=d.next()){var m=p.value,h=this.field.exp(e.length-1-m),g=new ri(this.field,new Int32Array([this.field.subtract(0,h),1]));u=u.multiply(g)}}catch(e){r={error:e}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}for(var _=new ri(this.field,o),v=this.runEuclideanAlgorithm(this.field.buildMonomial(t,1),_,t),y=v[0],b=v[1],x=this.findErrorLocations(y),S=this.findErrorMagnitudes(b,y,x),c=0;c<x.length;c++){var C=e.length-1-this.field.log(x[c]);if(C<0)throw f.getChecksumInstance();e[C]=this.field.subtract(e[C],S[c])}return x.length},e.prototype.runEuclideanAlgorithm=function(e,t,n){if(e.getDegree()<t.getDegree()){var r=e;e=t,t=r}for(var i=e,a=t,o=this.field.getZero(),s=this.field.getOne();a.getDegree()>=Math.round(n/2);){var c=i,l=o;if(i=a,o=s,i.isZero())throw f.getChecksumInstance();a=c;for(var u=this.field.getZero(),d=i.getCoefficient(i.getDegree()),p=this.field.inverse(d);a.getDegree()>=i.getDegree()&&!a.isZero();){var m=a.getDegree()-i.getDegree(),h=this.field.multiply(a.getCoefficient(a.getDegree()),p);u=u.add(this.field.buildMonomial(m,h)),a=a.subtract(i.multiplyByMonomial(m,h))}s=u.multiply(o).subtract(l).negative()}var g=s.getCoefficient(0);if(g===0)throw f.getChecksumInstance();var _=this.field.inverse(g);return[s.multiply(_),a.multiply(_)]},e.prototype.findErrorLocations=function(e){for(var t=e.getDegree(),n=new Int32Array(t),r=0,i=1;i<this.field.getSize()&&r<t;i++)e.evaluateAt(i)===0&&(n[r]=this.field.inverse(i),r++);if(r!==t)throw f.getChecksumInstance();return n},e.prototype.findErrorMagnitudes=function(e,t,n){for(var r=t.getDegree(),i=new Int32Array(r),a=1;a<=r;a++)i[r-a]=this.field.multiply(a,t.getCoefficient(a));for(var o=new ri(this.field,i),s=n.length,c=new Int32Array(s),a=0;a<s;a++){var l=this.field.inverse(n[a]),u=this.field.subtract(0,e.evaluateAt(l)),d=this.field.inverse(o.evaluateAt(l));c[a]=this.field.multiply(u,d)}return c},e}(),li=function(){function e(t,n,r,i,a){t instanceof e?this.constructor_2(t):this.constructor_1(t,n,r,i,a)}return e.prototype.constructor_1=function(e,t,n,r,i){var a=t==null||n==null,o=r==null||i==null;if(a&&o)throw new M;a?(t=new I(0,r.getY()),n=new I(0,i.getY())):o&&(r=new I(e.getWidth()-1,t.getY()),i=new I(e.getWidth()-1,n.getY())),this.image=e,this.topLeft=t,this.bottomLeft=n,this.topRight=r,this.bottomRight=i,this.minX=Math.trunc(Math.min(t.getX(),n.getX())),this.maxX=Math.trunc(Math.max(r.getX(),i.getX())),this.minY=Math.trunc(Math.min(t.getY(),r.getY())),this.maxY=Math.trunc(Math.max(n.getY(),i.getY()))},e.prototype.constructor_2=function(e){this.image=e.image,this.topLeft=e.getTopLeft(),this.bottomLeft=e.getBottomLeft(),this.topRight=e.getTopRight(),this.bottomRight=e.getBottomRight(),this.minX=e.getMinX(),this.maxX=e.getMaxX(),this.minY=e.getMinY(),this.maxY=e.getMaxY()},e.merge=function(t,n){return t==null?n:n==null?t:new e(t.image,t.topLeft,t.bottomLeft,n.topRight,n.bottomRight)},e.prototype.addMissingRows=function(t,n,r){var i=this.topLeft,a=this.bottomLeft,o=this.topRight,s=this.bottomRight;if(t>0){var c=r?this.topLeft:this.topRight,l=Math.trunc(c.getY()-t);l<0&&(l=0);var u=new I(c.getX(),l);r?i=u:o=u}if(n>0){var d=r?this.bottomLeft:this.bottomRight,f=Math.trunc(d.getY()+n);f>=this.image.getHeight()&&(f=this.image.getHeight()-1);var p=new I(d.getX(),f);r?a=p:s=p}return new e(this.image,i,a,o,s)},e.prototype.getMinX=function(){return this.minX},e.prototype.getMaxX=function(){return this.maxX},e.prototype.getMinY=function(){return this.minY},e.prototype.getMaxY=function(){return this.maxY},e.prototype.getTopLeft=function(){return this.topLeft},e.prototype.getTopRight=function(){return this.topRight},e.prototype.getBottomLeft=function(){return this.bottomLeft},e.prototype.getBottomRight=function(){return this.bottomRight},e}(),ui=function(){function e(e,t,n,r){this.columnCount=e,this.errorCorrectionLevel=r,this.rowCountUpperPart=t,this.rowCountLowerPart=n,this.rowCount=t+n}return e.prototype.getColumnCount=function(){return this.columnCount},e.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},e.prototype.getRowCount=function(){return this.rowCount},e.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},e.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},e}(),di=function(){function e(){this.buffer=``}return e.form=function(e,t){var n=-1;function r(e,r,i,a,o,s){if(e===`%%`)return`%`;if(t[++n]!==void 0){e=a?parseInt(a.substr(1)):void 0;var c=o?parseInt(o.substr(1)):void 0,l;switch(s){case`s`:l=t[n];break;case`c`:l=t[n][0];break;case`f`:l=parseFloat(t[n]).toFixed(e);break;case`p`:l=parseFloat(t[n]).toPrecision(e);break;case`e`:l=parseFloat(t[n]).toExponential(e);break;case`x`:l=parseInt(t[n]).toString(c||16);break;case`d`:l=parseFloat(parseInt(t[n],c||10).toPrecision(e)).toFixed(0)}l=typeof l==`object`?JSON.stringify(l):(+l).toString(c);for(var u=parseInt(i),d=i&&i[0]+``==`0`?`0`:` `;l.length<u;)l=r===void 0?d+l:l+d;return l}}return e.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,r)},e.prototype.format=function(t){var n=[...arguments].slice(1);this.buffer+=e.form(t,n)},e.prototype.toString=function(){return this.buffer},e}(),fi=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},pi=function(){function e(e){this.boundingBox=new li(e),this.codewords=Array(e.getMaxY()-e.getMinY()+1)}return e.prototype.getCodewordNearby=function(t){var n=this.getCodeword(t);if(n!=null)return n;for(var r=1;r<e.MAX_NEARBY_DISTANCE;r++){var i=this.imageRowToCodewordIndex(t)-r;if(i>=0&&(n=this.codewords[i],n!=null)||(i=this.imageRowToCodewordIndex(t)+r,i<this.codewords.length&&(n=this.codewords[i],n!=null)))return n}return null},e.prototype.imageRowToCodewordIndex=function(e){return e-this.boundingBox.getMinY()},e.prototype.setCodeword=function(e,t){this.codewords[this.imageRowToCodewordIndex(e)]=t},e.prototype.getCodeword=function(e){return this.codewords[this.imageRowToCodewordIndex(e)]},e.prototype.getBoundingBox=function(){return this.boundingBox},e.prototype.getCodewords=function(){return this.codewords},e.prototype.toString=function(){var e,t,n=new di,r=0;try{for(var i=fi(this.codewords),a=i.next();!a.done;a=i.next()){var o=a.value;o==null?n.format(`%3d: | %n`,r++):n.format(`%3d: %3d|%3d%n`,r++,o.getRowNumber(),o.getValue())}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return n.toString()},e.MAX_NEARBY_DISTANCE=5,e}(),mi=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},hi=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},gi=function(){function e(){this.values=new Map}return e.prototype.setValue=function(e){e=Math.trunc(e);var t=this.values.get(e);t??=0,t++,this.values.set(e,t)},e.prototype.getValue=function(){var e,t,n=-1,r=[],i=function(e,t){var i={getKey:function(){return e},getValue:function(){return t}};i.getValue()>n?(n=i.getValue(),r=[],r.push(i.getKey())):i.getValue()===n&&r.push(i.getKey())};try{for(var a=mi(this.values.entries()),o=a.next();!o.done;o=a.next()){var s=hi(o.value,2),c=s[0],l=s[1];i(c,l)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return G.toIntArray(r)},e.prototype.getConfidence=function(e){return this.values.get(e)},e}(),_i=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),vi=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},yi=function(e){_i(t,e);function t(t,n){var r=e.call(this,t)||this;return r._isLeft=n,r}return t.prototype.setRowNumbers=function(){var e,t;try{for(var n=vi(this.getCodewords()),r=n.next();!r.done;r=n.next())r.value?.setRowNumberAsRowIndicatorColumn()}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},t.prototype.adjustCompleteIndicatorColumnRowNumbers=function(e){var t=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(t,e);for(var n=this.getBoundingBox(),r=this._isLeft?n.getTopLeft():n.getTopRight(),i=this._isLeft?n.getBottomLeft():n.getBottomRight(),a=this.imageRowToCodewordIndex(Math.trunc(r.getY())),o=this.imageRowToCodewordIndex(Math.trunc(i.getY())),s=-1,c=1,l=0,u=a;u<o;u++)if(t[u]!=null){var d=t[u],f=d.getRowNumber()-s;if(f===0)l++;else if(f===1)c=Math.max(c,l),l=1,s=d.getRowNumber();else if(f<0||d.getRowNumber()>=e.getRowCount()||f>u)t[u]=null;else{var p=void 0;p=c>2?(c-2)*f:f;for(var m=p>=u,h=1;h<=p&&!m;h++)m=t[u-h]!=null;m?t[u]=null:(s=d.getRowNumber(),l=1)}}},t.prototype.getRowHeights=function(){var e,t,n=this.getBarcodeMetadata();if(n==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(n);var r=new Int32Array(n.getRowCount());try{for(var i=vi(this.getCodewords()),a=i.next();!a.done;a=i.next()){var o=a.value;if(o!=null){var s=o.getRowNumber();if(s>=r.length)continue;r[s]++}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return r},t.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(e){for(var t=this.getBoundingBox(),n=this._isLeft?t.getTopLeft():t.getTopRight(),r=this._isLeft?t.getBottomLeft():t.getBottomRight(),i=this.imageRowToCodewordIndex(Math.trunc(n.getY())),a=this.imageRowToCodewordIndex(Math.trunc(r.getY())),o=this.getCodewords(),s=-1,c=1,l=0,u=i;u<a;u++)if(o[u]!=null){var d=o[u];d.setRowNumberAsRowIndicatorColumn();var f=d.getRowNumber()-s;f===0?l++:f===1?(c=Math.max(c,l),l=1,s=d.getRowNumber()):d.getRowNumber()>=e.getRowCount()?o[u]=null:(s=d.getRowNumber(),l=1)}},t.prototype.getBarcodeMetadata=function(){var e,t,n=this.getCodewords(),r=new gi,i=new gi,a=new gi,o=new gi;try{for(var s=vi(n),c=s.next();!c.done;c=s.next()){var l=c.value;if(l!=null){l.setRowNumberAsRowIndicatorColumn();var u=l.getValue()%30,d=l.getRowNumber();switch(this._isLeft||(d+=2),d%3){case 0:i.setValue(u*3+1);break;case 1:o.setValue(u/3),a.setValue(u%3);break;case 2:r.setValue(u+1)}}}}catch(t){e={error:t}}finally{try{c&&!c.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}if(r.getValue().length===0||i.getValue().length===0||a.getValue().length===0||o.getValue().length===0||r.getValue()[0]<1||i.getValue()[0]+a.getValue()[0]<G.MIN_ROWS_IN_BARCODE||i.getValue()[0]+a.getValue()[0]>G.MAX_ROWS_IN_BARCODE)return null;var f=new ui(r.getValue()[0],i.getValue()[0],a.getValue()[0],o.getValue()[0]);return this.removeIncorrectCodewords(n,f),f},t.prototype.removeIncorrectCodewords=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(e[n]!=null){var i=r.getValue()%30,a=r.getRowNumber();if(a>t.getRowCount())e[n]=null;else switch(this._isLeft||(a+=2),a%3){case 0:i*3+1!==t.getRowCountUpperPart()&&(e[n]=null);break;case 1:(Math.trunc(i/3)!==t.getErrorCorrectionLevel()||i%3!==t.getRowCountLowerPart())&&(e[n]=null);break;case 2:i+1!==t.getColumnCount()&&(e[n]=null)}}}},t.prototype.isLeft=function(){return this._isLeft},t.prototype.toString=function(){return`IsLeft: `+this._isLeft+`
8
- `+e.prototype.toString.call(this)},t}(pi),bi=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},xi=function(){function e(e,t){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=e,this.barcodeColumnCount=e.getColumnCount(),this.boundingBox=t,this.detectionResultColumns=Array(this.barcodeColumnCount+2)}return e.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var e=G.MAX_CODEWORDS_IN_BARCODE,t;do t=e,e=this.adjustRowNumbersAndGetCount();while(e>0&&e<t);return this.detectionResultColumns},e.prototype.adjustIndicatorColumnRowNumbers=function(e){e?.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)},e.prototype.adjustRowNumbersAndGetCount=function(){var e=this.adjustRowNumbersByRow();if(e===0)return 0;for(var t=1;t<this.barcodeColumnCount+1;t++)for(var n=this.detectionResultColumns[t].getCodewords(),r=0;r<n.length;r++)n[r]!=null&&(n[r].hasValidRowNumber()||this.adjustRowNumbers(t,r,n));return e},e.prototype.adjustRowNumbersByRow=function(){return this.adjustRowNumbersFromBothRI(),this.adjustRowNumbersFromLRI()+this.adjustRowNumbersFromRRI()},e.prototype.adjustRowNumbersFromBothRI=function(){if(this.detectionResultColumns[0]!=null&&this.detectionResultColumns[this.barcodeColumnCount+1]!=null){for(var e=this.detectionResultColumns[0].getCodewords(),t=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),n=0;n<e.length;n++)if(e[n]!=null&&t[n]!=null&&e[n].getRowNumber()===t[n].getRowNumber())for(var r=1;r<=this.barcodeColumnCount;r++){var i=this.detectionResultColumns[r].getCodewords()[n];i!=null&&(i.setRowNumber(e[n].getRowNumber()),i.hasValidRowNumber()||(this.detectionResultColumns[r].getCodewords()[n]=null))}}},e.prototype.adjustRowNumbersFromRRI=function(){if(this.detectionResultColumns[this.barcodeColumnCount+1]==null)return 0;for(var t=0,n=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),r=0;r<n.length;r++)if(n[r]!=null)for(var i=n[r].getRowNumber(),a=0,o=this.barcodeColumnCount+1;o>0&&a<this.ADJUST_ROW_NUMBER_SKIP;o--){var s=this.detectionResultColumns[o].getCodewords()[r];s!=null&&(a=e.adjustRowNumberIfValid(i,a,s),s.hasValidRowNumber()||t++)}return t},e.prototype.adjustRowNumbersFromLRI=function(){if(this.detectionResultColumns[0]==null)return 0;for(var t=0,n=this.detectionResultColumns[0].getCodewords(),r=0;r<n.length;r++)if(n[r]!=null)for(var i=n[r].getRowNumber(),a=0,o=1;o<this.barcodeColumnCount+1&&a<this.ADJUST_ROW_NUMBER_SKIP;o++){var s=this.detectionResultColumns[o].getCodewords()[r];s!=null&&(a=e.adjustRowNumberIfValid(i,a,s),s.hasValidRowNumber()||t++)}return t},e.adjustRowNumberIfValid=function(e,t,n){return n==null||n.hasValidRowNumber()||(n.isValidRowNumber(e)?(n.setRowNumber(e),t=0):++t),t},e.prototype.adjustRowNumbers=function(t,n,r){var i,a;if(this.detectionResultColumns[t-1]!=null){var o=r[n],s=this.detectionResultColumns[t-1].getCodewords(),c=s;this.detectionResultColumns[t+1]!=null&&(c=this.detectionResultColumns[t+1].getCodewords());var l=Array(14);l[2]=s[n],l[3]=c[n],n>0&&(l[0]=r[n-1],l[4]=s[n-1],l[5]=c[n-1]),n>1&&(l[8]=r[n-2],l[10]=s[n-2],l[11]=c[n-2]),n<r.length-1&&(l[1]=r[n+1],l[6]=s[n+1],l[7]=c[n+1]),n<r.length-2&&(l[9]=r[n+2],l[12]=s[n+2],l[13]=c[n+2]);try{for(var u=bi(l),d=u.next();!d.done;d=u.next()){var f=d.value;if(e.adjustRowNumber(o,f))return}}catch(e){i={error:e}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(i)throw i.error}}}},e.adjustRowNumber=function(e,t){return t==null?!1:t.hasValidRowNumber()&&t.getBucket()===e.getBucket()?(e.setRowNumber(t.getRowNumber()),!0):!1},e.prototype.getBarcodeColumnCount=function(){return this.barcodeColumnCount},e.prototype.getBarcodeRowCount=function(){return this.barcodeMetadata.getRowCount()},e.prototype.getBarcodeECLevel=function(){return this.barcodeMetadata.getErrorCorrectionLevel()},e.prototype.setBoundingBox=function(e){this.boundingBox=e},e.prototype.getBoundingBox=function(){return this.boundingBox},e.prototype.setDetectionResultColumn=function(e,t){this.detectionResultColumns[e]=t},e.prototype.getDetectionResultColumn=function(e){return this.detectionResultColumns[e]},e.prototype.toString=function(){var e=this.detectionResultColumns[0];e??=this.detectionResultColumns[this.barcodeColumnCount+1];for(var t=new di,n=0;n<e.getCodewords().length;n++){t.format(`CW %3d:`,n);for(var r=0;r<this.barcodeColumnCount+2;r++)if(this.detectionResultColumns[r]==null)t.format(` | `);else{var i=this.detectionResultColumns[r].getCodewords()[n];i==null?t.format(` | `):t.format(` %3d|%3d`,i.getRowNumber(),i.getValue())}t.format(`%n`)}return t.toString()},e}(),Si=function(){function e(t,n,r,i){this.rowNumber=e.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(t),this.endX=Math.trunc(n),this.bucket=Math.trunc(r),this.value=Math.trunc(i)}return e.prototype.hasValidRowNumber=function(){return this.isValidRowNumber(this.rowNumber)},e.prototype.isValidRowNumber=function(t){return t!==e.BARCODE_ROW_UNKNOWN&&this.bucket===t%3*3},e.prototype.setRowNumberAsRowIndicatorColumn=function(){this.rowNumber=Math.trunc(Math.trunc(this.value/30)*3+Math.trunc(this.bucket/3))},e.prototype.getWidth=function(){return this.endX-this.startX},e.prototype.getStartX=function(){return this.startX},e.prototype.getEndX=function(){return this.endX},e.prototype.getBucket=function(){return this.bucket},e.prototype.getValue=function(){return this.value},e.prototype.getRowNumber=function(){return this.rowNumber},e.prototype.setRowNumber=function(e){this.rowNumber=e},e.prototype.toString=function(){return this.rowNumber+`|`+this.value},e.BARCODE_ROW_UNKNOWN=-1,e}(),Ci=function(){function e(){}return e.initialize=function(){for(var t=0;t<G.SYMBOL_TABLE.length;t++)for(var n=G.SYMBOL_TABLE[t],r=n&1,i=0;i<G.BARS_IN_MODULE;i++){for(var a=0;(n&1)===r;)a+=1,n>>=1;r=n&1,e.RATIOS_TABLE[t]||(e.RATIOS_TABLE[t]=Array(G.BARS_IN_MODULE)),e.RATIOS_TABLE[t][G.BARS_IN_MODULE-i-1]=Math.fround(a/G.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},e.getDecodedValue=function(t){var n=e.getDecodedCodewordValue(e.sampleBitCounts(t));return n===-1?e.getClosestDecodedValue(t):n},e.sampleBitCounts=function(e){for(var t=F.sum(e),n=new Int32Array(G.BARS_IN_MODULE),r=0,i=0,a=0;a<G.MODULES_IN_CODEWORD;a++){var o=t/(2*G.MODULES_IN_CODEWORD)+a*t/G.MODULES_IN_CODEWORD;i+e[r]<=o&&(i+=e[r],r++),n[r]++}return n},e.getDecodedCodewordValue=function(t){var n=e.getBitValue(t);return G.getCodeword(n)===-1?-1:n},e.getBitValue=function(e){for(var t=0,n=0;n<e.length;n++)for(var r=0;r<e[n];r++)t=t<<1|n%2==0;return Math.trunc(t)},e.getClosestDecodedValue=function(t){var n=F.sum(t),r=Array(G.BARS_IN_MODULE);if(n>1)for(var i=0;i<r.length;i++)r[i]=Math.fround(t[i]/n);var a=Ie.MAX_VALUE,o=-1;this.bSymbolTableReady||e.initialize();for(var s=0;s<e.RATIOS_TABLE.length;s++){for(var c=0,l=e.RATIOS_TABLE[s],u=0;u<G.BARS_IN_MODULE;u++){var d=Math.fround(l[u]-r[u]);if(c+=Math.fround(d*d),c>=a)break}c<a&&(a=c,o=G.SYMBOL_TABLE[s])}return o},e.bSymbolTableReady=!1,e.RATIOS_TABLE=Array(G.SYMBOL_TABLE.length).map(function(e){return e=Array(G.BARS_IN_MODULE)}),e}(),wi=function(){function e(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}return e.prototype.getSegmentIndex=function(){return this.segmentIndex},e.prototype.setSegmentIndex=function(e){this.segmentIndex=e},e.prototype.getFileId=function(){return this.fileId},e.prototype.setFileId=function(e){this.fileId=e},e.prototype.getOptionalData=function(){return this.optionalData},e.prototype.setOptionalData=function(e){this.optionalData=e},e.prototype.isLastSegment=function(){return this.lastSegment},e.prototype.setLastSegment=function(e){this.lastSegment=e},e.prototype.getSegmentCount=function(){return this.segmentCount},e.prototype.setSegmentCount=function(e){this.segmentCount=e},e.prototype.getSender=function(){return this.sender||null},e.prototype.setSender=function(e){this.sender=e},e.prototype.getAddressee=function(){return this.addressee||null},e.prototype.setAddressee=function(e){this.addressee=e},e.prototype.getFileName=function(){return this.fileName},e.prototype.setFileName=function(e){this.fileName=e},e.prototype.getFileSize=function(){return this.fileSize},e.prototype.setFileSize=function(e){this.fileSize=e},e.prototype.getChecksum=function(){return this.checksum},e.prototype.setChecksum=function(e){this.checksum=e},e.prototype.getTimestamp=function(){return this.timestamp},e.prototype.setTimestamp=function(e){this.timestamp=e},e}(),Ti=function(){function e(){}return e.parseLong=function(e,t){return t===void 0&&(t=void 0),parseInt(e,t)},e}(),Ei=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Di=function(e){Ei(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.kind=`NullPointerException`,t}(a),Oi=function(){function e(){}return e.prototype.writeBytes=function(e){this.writeBytesOffset(e,0,e.length)},e.prototype.writeBytesOffset=function(e,t,n){if(e==null)throw new Di;if(t<0||t>e.length||n<0||t+n>e.length||t+n<0)throw new g;if(n!==0)for(var r=0;r<n;r++)this.write(e[t+r])},e.prototype.flush=function(){},e.prototype.close=function(){},e}(),ki=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ai=function(e){ki(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(a),ji=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Mi=function(e){ji(t,e);function t(t){t===void 0&&(t=32);var n=e.call(this)||this;if(n.count=0,t<0)throw new l(`Negative initial size: `+t);return n.buf=new Uint8Array(t),n}return t.prototype.ensureCapacity=function(e){e-this.buf.length>0&&this.grow(e)},t.prototype.grow=function(e){var t=this.buf.length<<1;if(t-e<0&&(t=e),t<0){if(e<0)throw new Ai;t=x.MAX_VALUE}this.buf=b.copyOfUint8Array(this.buf,t)},t.prototype.write=function(e){this.ensureCapacity(this.count+1),this.buf[this.count]=e,this.count+=1},t.prototype.writeBytesOffset=function(e,t,n){if(t<0||t>e.length||n<0||t+n-e.length>0)throw new g;this.ensureCapacity(this.count+n),m.arraycopy(e,t,this.buf,this.count,n),this.count+=n},t.prototype.writeTo=function(e){e.writeBytesOffset(this.buf,0,this.count)},t.prototype.reset=function(){this.count=0},t.prototype.toByteArray=function(){return b.copyOfUint8Array(this.buf,this.count)},t.prototype.size=function(){return this.count},t.prototype.toString=function(e){return e?typeof e==`string`?this.toString_string(e):this.toString_number(e):this.toString_void()},t.prototype.toString_void=function(){return new String(this.buf).toString()},t.prototype.toString_string=function(e){return new String(this.buf).toString()},t.prototype.toString_number=function(e){return new String(this.buf).toString()},t.prototype.close=function(){},t}(Oi),K;(function(e){e[e.ALPHA=0]=`ALPHA`,e[e.LOWER=1]=`LOWER`,e[e.MIXED=2]=`MIXED`,e[e.PUNCT=3]=`PUNCT`,e[e.ALPHA_SHIFT=4]=`ALPHA_SHIFT`,e[e.PUNCT_SHIFT=5]=`PUNCT_SHIFT`})(K||={});function Ni(){if(typeof window<`u`)return window.BigInt||null;if(typeof globalThis<`u`)return globalThis.BigInt||null;if(typeof self<`u`)return self.BigInt||null;throw Error(`Can't search globals for BigInt!`)}var Pi;function Fi(e){if(Pi===void 0&&(Pi=Ni()),Pi===null)throw Error(`BigInt is not supported!`);return Pi(e)}function Ii(){var e=[];e[0]=Fi(1);var t=Fi(900);e[1]=t;for(var n=2;n<16;n++)e[n]=e[n-1]*t;return e}var Li=function(){function e(){}return e.decode=function(t,n){var r=new j(``),i=O.ISO8859_1;r.enableDecoding(i);for(var a=1,o=t[a++],s=new wi;a<t[0];){switch(o){case e.TEXT_COMPACTION_MODE_LATCH:a=e.textCompaction(t,a,r);break;case e.BYTE_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH_6:a=e.byteCompaction(o,t,i,a,r);break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(t[a++]);break;case e.NUMERIC_COMPACTION_MODE_LATCH:a=e.numericCompaction(t,a,r);break;case e.ECI_CHARSET:O.getCharacterSetECIByValue(t[a++]);break;case e.ECI_GENERAL_PURPOSE:a+=2;break;case e.ECI_USER_DEFINED:a++;break;case e.BEGIN_MACRO_PDF417_CONTROL_BLOCK:a=e.decodeMacroBlock(t,a,s);break;case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case e.MACRO_PDF417_TERMINATOR:throw new E;default:a--,a=e.textCompaction(t,a,r)}if(a<t.length)o=t[a++];else throw E.getFormatInstance()}if(r.length()===0)throw E.getFormatInstance();var c=new Se(null,r.toString(),null,n);return c.setOther(s),c},e.decodeMacroBlock=function(t,n,r){if(n+e.NUMBER_OF_SEQUENCE_CODEWORDS>t[0])throw E.getFormatInstance();for(var i=new Int32Array(e.NUMBER_OF_SEQUENCE_CODEWORDS),a=0;a<e.NUMBER_OF_SEQUENCE_CODEWORDS;a++,n++)i[a]=t[n];r.setSegmentIndex(x.parseInt(e.decodeBase900toBase10(i,e.NUMBER_OF_SEQUENCE_CODEWORDS)));var o=new j;n=e.textCompaction(t,n,o),r.setFileId(o.toString());var s=-1;for(t[n]===e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(s=n+1);n<t[0];)switch(t[n]){case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(n++,t[n]){case e.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:var c=new j;n=e.textCompaction(t,n+1,c),r.setFileName(c.toString());break;case e.MACRO_PDF417_OPTIONAL_FIELD_SENDER:var l=new j;n=e.textCompaction(t,n+1,l),r.setSender(l.toString());break;case e.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:var u=new j;n=e.textCompaction(t,n+1,u),r.setAddressee(u.toString());break;case e.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:var d=new j;n=e.numericCompaction(t,n+1,d),r.setSegmentCount(x.parseInt(d.toString()));break;case e.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:var f=new j;n=e.numericCompaction(t,n+1,f),r.setTimestamp(Ti.parseLong(f.toString()));break;case e.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:var p=new j;n=e.numericCompaction(t,n+1,p),r.setChecksum(x.parseInt(p.toString()));break;case e.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:var m=new j;n=e.numericCompaction(t,n+1,m),r.setFileSize(Ti.parseLong(m.toString()));break;default:throw E.getFormatInstance()}break;case e.MACRO_PDF417_TERMINATOR:n++,r.setLastSegment(!0);break;default:throw E.getFormatInstance()}if(s!==-1){var h=n-s;r.isLastSegment()&&h--,r.setOptionalData(b.copyOfRange(t,s,s+h))}return n},e.textCompaction=function(t,n,r){for(var i=new Int32Array((t[0]-n)*2),a=new Int32Array((t[0]-n)*2),o=0,s=!1;n<t[0]&&!s;){var c=t[n++];if(c<e.TEXT_COMPACTION_MODE_LATCH)i[o]=c/30,i[o+1]=c%30,o+=2;else switch(c){case e.TEXT_COMPACTION_MODE_LATCH:i[o++]=e.TEXT_COMPACTION_MODE_LATCH;break;case e.BYTE_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH_6:case e.NUMERIC_COMPACTION_MODE_LATCH:case e.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case e.MACRO_PDF417_TERMINATOR:n--,s=!0;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i[o]=e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,c=t[n++],a[o]=c,o++}}return e.decodeTextCompaction(i,a,o,r),n},e.decodeTextCompaction=function(t,n,r,i){for(var a=K.ALPHA,o=K.ALPHA,s=0;s<r;){var c=t[s],l=``;switch(a){case K.ALPHA:if(c<26)l=String.fromCharCode(65+c);else switch(c){case 26:l=` `;break;case e.LL:a=K.LOWER;break;case e.ML:a=K.MIXED;break;case e.PS:o=a,a=K.PUNCT_SHIFT;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(n[s]);break;case e.TEXT_COMPACTION_MODE_LATCH:a=K.ALPHA}break;case K.LOWER:if(c<26)l=String.fromCharCode(97+c);else switch(c){case 26:l=` `;break;case e.AS:o=a,a=K.ALPHA_SHIFT;break;case e.ML:a=K.MIXED;break;case e.PS:o=a,a=K.PUNCT_SHIFT;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(n[s]);break;case e.TEXT_COMPACTION_MODE_LATCH:a=K.ALPHA}break;case K.MIXED:if(c<e.PL)l=e.MIXED_CHARS[c];else switch(c){case e.PL:a=K.PUNCT;break;case 26:l=` `;break;case e.LL:a=K.LOWER;break;case e.AL:a=K.ALPHA;break;case e.PS:o=a,a=K.PUNCT_SHIFT;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(n[s]);break;case e.TEXT_COMPACTION_MODE_LATCH:a=K.ALPHA}break;case K.PUNCT:if(c<e.PAL)l=e.PUNCT_CHARS[c];else switch(c){case e.PAL:a=K.ALPHA;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(n[s]);break;case e.TEXT_COMPACTION_MODE_LATCH:a=K.ALPHA}break;case K.ALPHA_SHIFT:if(a=o,c<26)l=String.fromCharCode(65+c);else switch(c){case 26:l=` `;break;case e.TEXT_COMPACTION_MODE_LATCH:a=K.ALPHA}break;case K.PUNCT_SHIFT:if(a=o,c<e.PAL)l=e.PUNCT_CHARS[c];else switch(c){case e.PAL:a=K.ALPHA;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(n[s]);break;case e.TEXT_COMPACTION_MODE_LATCH:a=K.ALPHA}}l!==``&&i.append(l),s++}},e.byteCompaction=function(t,n,r,i,a){var o=new Mi,s=0,c=0,l=!1;switch(t){case e.BYTE_COMPACTION_MODE_LATCH:for(var u=new Int32Array(6),d=n[i++];i<n[0]&&!l;)switch(u[s++]=d,c=900*c+d,d=n[i++],d){case e.TEXT_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH:case e.NUMERIC_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH_6:case e.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case e.MACRO_PDF417_TERMINATOR:i--,l=!0;break;default:if(s%5==0&&s>0){for(var f=0;f<6;++f)o.write(Number(Fi(c)>>Fi(8*(5-f))));c=0,s=0}}i===n[0]&&d<e.TEXT_COMPACTION_MODE_LATCH&&(u[s++]=d);for(var p=0;p<s;p++)o.write(u[p]);break;case e.BYTE_COMPACTION_MODE_LATCH_6:for(;i<n[0]&&!l;){var m=n[i++];if(m<e.TEXT_COMPACTION_MODE_LATCH)s++,c=900*c+m;else switch(m){case e.TEXT_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH:case e.NUMERIC_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH_6:case e.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case e.MACRO_PDF417_TERMINATOR:i--,l=!0}if(s%5==0&&s>0){for(var f=0;f<6;++f)o.write(Number(Fi(c)>>Fi(8*(5-f))));c=0,s=0}}}return a.append(ne.decode(o.toByteArray(),r)),i},e.numericCompaction=function(t,n,r){for(var i=0,a=!1,o=new Int32Array(e.MAX_NUMERIC_CODEWORDS);n<t[0]&&!a;){var s=t[n++];if(n===t[0]&&(a=!0),s<e.TEXT_COMPACTION_MODE_LATCH)o[i]=s,i++;else switch(s){case e.TEXT_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH_6:case e.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case e.MACRO_PDF417_TERMINATOR:n--,a=!0}(i%e.MAX_NUMERIC_CODEWORDS===0||s===e.NUMERIC_COMPACTION_MODE_LATCH||a)&&i>0&&(r.append(e.decodeBase900toBase10(o,i)),i=0)}return n},e.decodeBase900toBase10=function(t,n){for(var r=Fi(0),i=0;i<n;i++)r+=e.EXP900[n-i-1]*Fi(t[i]);var a=r.toString();if(a.charAt(0)!==`1`)throw new E;return a.substring(1)},e.TEXT_COMPACTION_MODE_LATCH=900,e.BYTE_COMPACTION_MODE_LATCH=901,e.NUMERIC_COMPACTION_MODE_LATCH=902,e.BYTE_COMPACTION_MODE_LATCH_6=924,e.ECI_USER_DEFINED=925,e.ECI_GENERAL_PURPOSE=926,e.ECI_CHARSET=927,e.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,e.MACRO_PDF417_TERMINATOR=922,e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,e.MAX_NUMERIC_CODEWORDS=15,e.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,e.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,e.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,e.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,e.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,e.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,e.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,e.PL=25,e.LL=27,e.AS=27,e.ML=28,e.AL=28,e.PS=29,e.PAL=29,e.PUNCT_CHARS=`;<>@[\\]_\`~!\r ,:
9
- -.$/"|*()?{}'`,e.MIXED_CHARS=`0123456789&\r ,:#-.$/+%*=^`,e.EXP900=Ni()?Ii():[],e.NUMBER_OF_SEQUENCE_CODEWORDS=2,e}(),Ri=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},zi=function(){function e(){}return e.decode=function(t,n,r,i,a,o,s){for(var c=new li(t,n,r,i,a),l=null,u=null,d,f=!0;;f=!1){if(n!=null&&(l=e.getRowIndicatorColumn(t,c,n,!0,o,s)),i!=null&&(u=e.getRowIndicatorColumn(t,c,i,!1,o,s)),d=e.merge(l,u),d==null)throw M.getNotFoundInstance();var p=d.getBoundingBox();if(f&&p!=null&&(p.getMinY()<c.getMinY()||p.getMaxY()>c.getMaxY()))c=p;else break}d.setBoundingBox(c);var m=d.getBarcodeColumnCount()+1;d.setDetectionResultColumn(0,l),d.setDetectionResultColumn(m,u);for(var h=l!=null,g=1;g<=m;g++){var _=h?g:m-g;if(d.getDetectionResultColumn(_)===void 0){var v=void 0;v=_===0||_===m?new yi(c,_===0):new pi(c),d.setDetectionResultColumn(_,v);for(var y=-1,b=y,x=c.getMinY();x<=c.getMaxY();x++){if(y=e.getStartColumn(d,_,x,h),y<0||y>c.getMaxX()){if(b===-1)continue;y=b}var S=e.detectCodeword(t,c.getMinX(),c.getMaxX(),h,y,x,o,s);S!=null&&(v.setCodeword(x,S),b=y,o=Math.min(o,S.getWidth()),s=Math.max(s,S.getWidth()))}}}return e.createDecoderResult(d)},e.merge=function(t,n){if(t==null&&n==null)return null;var r=e.getBarcodeMetadata(t,n);return r==null?null:new xi(r,li.merge(e.adjustBoundingBox(t),e.adjustBoundingBox(n)))},e.adjustBoundingBox=function(t){var n,r;if(t==null)return null;var i=t.getRowHeights();if(i==null)return null;var a=e.getMax(i),o=0;try{for(var s=Ri(i),c=s.next();!c.done;c=s.next()){var l=c.value;if(o+=a-l,l>0)break}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}for(var u=t.getCodewords(),d=0;o>0&&u[d]==null;d++)o--;for(var f=0,d=i.length-1;d>=0&&(f+=a-i[d],!(i[d]>0));d--);for(var d=u.length-1;f>0&&u[d]==null;d--)f--;return t.getBoundingBox().addMissingRows(o,f,t.isLeft())},e.getMax=function(e){var t,n,r=-1;try{for(var i=Ri(e),a=i.next();!a.done;a=i.next()){var o=a.value;r=Math.max(r,o)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},e.getBarcodeMetadata=function(e,t){var n;if(e==null||(n=e.getBarcodeMetadata())==null)return t==null?null:t.getBarcodeMetadata();var r;return t==null||(r=t.getBarcodeMetadata())==null?n:n.getColumnCount()!==r.getColumnCount()&&n.getErrorCorrectionLevel()!==r.getErrorCorrectionLevel()&&n.getRowCount()!==r.getRowCount()?null:n},e.getRowIndicatorColumn=function(t,n,r,i,a,o){for(var s=new yi(n,i),c=0;c<2;c++)for(var l=c===0?1:-1,u=Math.trunc(Math.trunc(r.getX())),d=Math.trunc(Math.trunc(r.getY()));d<=n.getMaxY()&&d>=n.getMinY();d+=l){var f=e.detectCodeword(t,0,t.getWidth(),i,u,d,a,o);f!=null&&(s.setCodeword(d,f),u=i?f.getStartX():f.getEndX())}return s},e.adjustCodewordCount=function(t,n){var r=n[0][1],i=r.getValue(),a=t.getBarcodeColumnCount()*t.getBarcodeRowCount()-e.getNumberOfECCodeWords(t.getBarcodeECLevel());if(i.length===0){if(a<1||a>G.MAX_CODEWORDS_IN_BARCODE)throw M.getNotFoundInstance();r.setValue(a)}else i[0]!==a&&r.setValue(a)},e.createDecoderResult=function(t){var n=e.createBarcodeMatrix(t);e.adjustCodewordCount(t,n);for(var r=[],i=new Int32Array(t.getBarcodeRowCount()*t.getBarcodeColumnCount()),a=[],o=[],s=0;s<t.getBarcodeRowCount();s++)for(var c=0;c<t.getBarcodeColumnCount();c++){var l=n[s][c+1].getValue(),u=s*t.getBarcodeColumnCount()+c;l.length===0?r.push(u):l.length===1?i[u]=l[0]:(o.push(u),a.push(l))}for(var d=Array(a.length),f=0;f<d.length;f++)d[f]=a[f];return e.createDecoderResultFromAmbiguousValues(t.getBarcodeECLevel(),i,G.toIntArray(r),G.toIntArray(o),d)},e.createDecoderResultFromAmbiguousValues=function(t,n,r,i,a){for(var o=new Int32Array(i.length),s=100;s-->0;){for(var c=0;c<o.length;c++)n[i[c]]=a[c][o[c]];try{return e.decodeCodewords(n,t,r)}catch(e){if(!(e instanceof f))throw e}if(o.length===0)throw f.getChecksumInstance();for(var c=0;c<o.length;c++)if(o[c]<a[c].length-1){o[c]++;break}else if(o[c]=0,c===o.length-1)throw f.getChecksumInstance()}throw f.getChecksumInstance()},e.createBarcodeMatrix=function(e){for(var t,n,r,i,a=Array.from({length:e.getBarcodeRowCount()},function(){return Array(e.getBarcodeColumnCount()+2)}),o=0;o<a.length;o++)for(var s=0;s<a[o].length;s++)a[o][s]=new gi;var c=0;try{for(var l=Ri(e.getDetectionResultColumns()),u=l.next();!u.done;u=l.next()){var d=u.value;if(d!=null)try{for(var f=(r=void 0,Ri(d.getCodewords())),p=f.next();!p.done;p=f.next()){var m=p.value;if(m!=null){var h=m.getRowNumber();if(h>=0){if(h>=a.length)continue;a[h][c].setValue(m.getValue())}}}}catch(e){r={error:e}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}c++}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return a},e.isValidBarcodeColumn=function(e,t){return t>=0&&t<=e.getBarcodeColumnCount()+1},e.getStartColumn=function(t,n,r,i){var a,o,s=i?1:-1,c=null;if(e.isValidBarcodeColumn(t,n-s)&&(c=t.getDetectionResultColumn(n-s).getCodeword(r)),c!=null)return i?c.getEndX():c.getStartX();if(c=t.getDetectionResultColumn(n).getCodewordNearby(r),c!=null)return i?c.getStartX():c.getEndX();if(e.isValidBarcodeColumn(t,n-s)&&(c=t.getDetectionResultColumn(n-s).getCodewordNearby(r)),c!=null)return i?c.getEndX():c.getStartX();for(var l=0;e.isValidBarcodeColumn(t,n-s);){n-=s;try{for(var u=(a=void 0,Ri(t.getDetectionResultColumn(n).getCodewords())),d=u.next();!d.done;d=u.next()){var f=d.value;if(f!=null)return(i?f.getEndX():f.getStartX())+s*l*(f.getEndX()-f.getStartX())}}catch(e){a={error:e}}finally{try{d&&!d.done&&(o=u.return)&&o.call(u)}finally{if(a)throw a.error}}l++}return i?t.getBoundingBox().getMinX():t.getBoundingBox().getMaxX()},e.detectCodeword=function(t,n,r,i,a,o,s,c){a=e.adjustCodewordStartColumn(t,n,r,i,a,o);var l=e.getModuleBitCount(t,n,r,i,a,o);if(l==null)return null;var u,d=F.sum(l);if(i)u=a+d;else{for(var f=0;f<l.length/2;f++){var p=l[f];l[f]=l[l.length-1-f],l[l.length-1-f]=p}u=a,a=u-d}if(!e.checkCodewordSkew(d,s,c))return null;var m=Ci.getDecodedValue(l),h=G.getCodeword(m);return h===-1?null:new Si(a,u,e.getCodewordBucketNumber(m),h)},e.getModuleBitCount=function(e,t,n,r,i,a){for(var o=i,s=new Int32Array(8),c=0,l=r?1:-1,u=r;(r?o<n:o>=t)&&c<s.length;)e.get(o,a)===u?(s[c]++,o+=l):(c++,u=!u);return c===s.length||o===(r?n:t)&&c===s.length-1?s:null},e.getNumberOfECCodeWords=function(e){return 2<<e},e.adjustCodewordStartColumn=function(t,n,r,i,a,o){for(var s=a,c=i?-1:1,l=0;l<2;l++){for(;(i?s>=n:s<r)&&i===t.get(s,o);){if(Math.abs(a-s)>e.CODEWORD_SKEW_SIZE)return a;s+=c}c=-c,i=!i}return s},e.checkCodewordSkew=function(t,n,r){return n-e.CODEWORD_SKEW_SIZE<=t&&t<=r+e.CODEWORD_SKEW_SIZE},e.decodeCodewords=function(t,n,r){if(t.length===0)throw E.getFormatInstance();var i=1<<n+1,a=e.correctErrors(t,r,i);e.verifyCodewordCount(t,i);var o=Li.decode(t,``+n);return o.setErrorsCorrected(a),o.setErasures(r.length),o},e.correctErrors=function(t,n,r){if(n!=null&&n.length>r/2+e.MAX_ERRORS||r<0||r>e.MAX_EC_CODEWORDS)throw f.getChecksumInstance();return e.errorCorrection.decode(t,r,n)},e.verifyCodewordCount=function(e,t){if(e.length<4)throw E.getFormatInstance();var n=e[0];if(n>e.length)throw E.getFormatInstance();if(n===0){if(t<e.length)e[0]=e.length-t;else throw E.getFormatInstance()}},e.getBitCountForCodeword=function(e){for(var t=new Int32Array(8),n=0,r=t.length-1;!((e&1)!==n&&(n=e&1,r--,r<0));)t[r]++,e>>=1;return t},e.getCodewordBucketNumber=function(e){return e instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(e):this.getCodewordBucketNumber_number(e)},e.getCodewordBucketNumber_number=function(t){return e.getCodewordBucketNumber(e.getBitCountForCodeword(t))},e.getCodewordBucketNumber_Int32Array=function(e){return(e[0]-e[2]+e[4]-e[6]+9)%9},e.toString=function(e){for(var t=new di,n=0;n<e.length;n++){t.format(`Row %2d: `,n);for(var r=0;r<e[n].length;r++){var i=e[n][r];i.getValue().length===0?t.format(` `,null):t.format(`%4d(%2d)`,i.getValue()[0],i.getConfidence(i.getValue()[0]))}t.format(`%n`)}return t.toString()},e.CODEWORD_SKEW_SIZE=2,e.MAX_ERRORS=3,e.MAX_EC_CODEWORDS=512,e.errorCorrection=new ci,e}(),Bi=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Vi=function(){function e(){}return e.prototype.decode=function(t,n){n===void 0&&(n=null);var r=e.decode(t,n,!1);if(r==null||r.length===0||r[0]==null)throw M.getNotFoundInstance();return r[0]},e.prototype.decodeMultiple=function(t,n){n===void 0&&(n=null);try{return e.decode(t,n,!0)}catch(e){throw e instanceof E||e instanceof f?M.getNotFoundInstance():e}},e.decode=function(t,n,r){var i,a,o=[],s=ti.detectMultiple(t,n,r);try{for(var c=Bi(s.getPoints()),l=c.next();!l.done;l=c.next()){var u=l.value,d=zi.decode(s.getBits(),u[4],u[5],u[6],u[7],e.getMinCodewordWidth(u),e.getMaxCodewordWidth(u)),f=new ye(d.getText(),d.getRawBytes(),void 0,u,N.PDF_417);f.putMetadata(P.ERROR_CORRECTION_LEVEL,d.getECLevel());var p=d.getOther();p!=null&&f.putMetadata(P.PDF417_EXTRA_METADATA,p),o.push(f)}}catch(e){i={error:e}}finally{try{l&&!l.done&&(a=c.return)&&a.call(c)}finally{if(i)throw i.error}}return o.map(function(e){return e})},e.getMaxWidth=function(e,t){return e==null||t==null?0:Math.trunc(Math.abs(e.getX()-t.getX()))},e.getMinWidth=function(e,t){return e==null||t==null?x.MAX_VALUE:Math.trunc(Math.abs(e.getX()-t.getX()))},e.getMaxCodewordWidth=function(t){return Math.floor(Math.max(Math.max(e.getMaxWidth(t[0],t[4]),e.getMaxWidth(t[6],t[2])*G.MODULES_IN_CODEWORD/G.MODULES_IN_STOP_PATTERN),Math.max(e.getMaxWidth(t[1],t[5]),e.getMaxWidth(t[7],t[3])*G.MODULES_IN_CODEWORD/G.MODULES_IN_STOP_PATTERN)))},e.getMinCodewordWidth=function(t){return Math.floor(Math.min(Math.min(e.getMinWidth(t[0],t[4]),e.getMinWidth(t[6],t[2])*G.MODULES_IN_CODEWORD/G.MODULES_IN_STOP_PATTERN),Math.min(e.getMinWidth(t[1],t[5]),e.getMinWidth(t[7],t[3])*G.MODULES_IN_CODEWORD/G.MODULES_IN_STOP_PATTERN)))},e.prototype.reset=function(){},e}(),Hi=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ui=function(e){Hi(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.kind=`ReaderException`,t}(a),Wi=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Gi=function(){function e(){}return e.prototype.decode=function(e,t){return this.hints!==t&&this.setHints(t),this.decodeInternal(e)},e.prototype.decodeWithState=function(e){return(this.readers===null||this.readers===void 0)&&this.setHints(null),this.decodeInternal(e)},e.prototype.setHints=function(e){this.hints=e;var t=e!=null&&e.get(w.TRY_HARDER)!==void 0,n=e==null?null:e.get(w.POSSIBLE_FORMATS),r=[];if(n!=null){var i=n.some(function(e){return e===N.UPC_A||e===N.UPC_E||e===N.EAN_13||e===N.EAN_8||e===N.CODABAR||e===N.CODE_39||e===N.CODE_93||e===N.CODE_128||e===N.ITF||e===N.RSS_14||e===N.RSS_EXPANDED});i&&!t&&r.push(new Gn(e)),n.includes(N.QR_CODE)&&r.push(new Mr),n.includes(N.MICRO_QR_CODE)&&r.push(new Kr),n.includes(N.DATA_MATRIX)&&r.push(new rr),n.includes(N.AZTEC)&&r.push(new Je),n.includes(N.PDF_417)&&r.push(new Vi),n.includes(N.MAXICODE)&&r.push(new Zr),i&&t&&r.push(new Gn(e))}r.length===0&&(t||r.push(new Gn(e)),r.push(new Mr),r.push(new Kr),r.push(new rr),r.push(new Je),r.push(new Vi),r.push(new Zr),t&&r.push(new Gn(e))),this.readers=r},e.prototype.reset=function(){var e,t;if(this.readers!==null)try{for(var n=Wi(this.readers),r=n.next();!r.done;r=n.next())r.value.reset()}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},e.prototype.decodeInternal=function(e){var t,n;if(this.readers===null)throw new Ui(`No readers where selected, nothing can be read.`);try{for(var r=Wi(this.readers),i=r.next();!i.done;i=r.next()){var a=i.value;try{return a.decode(e,this.hints)}catch(e){if(e instanceof Ui)continue;console.warn(`MultiFormatReader: non-ReaderException from reader:`,e);continue}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}throw new M(`No MultiFormat Readers were able to detect the code.`)},e}(),Ki=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){Ki(t,e);function t(t,n){t===void 0&&(t=null),n===void 0&&(n=500);var r=new Gi;return r.setHints(t),e.call(this,r,n)||this}return Object.defineProperty(t.prototype,"hints",{set:function(e){this._hints=e||null,this.reader.setHints(e)},enumerable:!1,configurable:!0}),t.prototype.decodeBitmap=function(e){try{return this.reader.decodeWithState(e)}finally{this.reader.reset()}},t})(ve);var qi=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){qi(t,e);function t(t){return t===void 0&&(t=500),e.call(this,new Vi,t)||this}return t})(ve);var Ji=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){Ji(t,e);function t(t){return t===void 0&&(t=500),e.call(this,new Mr,t)||this}return t})(ve);var Yi;(function(e){e[e.ERROR_CORRECTION=0]=`ERROR_CORRECTION`,e[e.CHARACTER_SET=1]=`CHARACTER_SET`,e[e.DATA_MATRIX_SHAPE=2]=`DATA_MATRIX_SHAPE`,e[e.DATA_MATRIX_COMPACT=3]=`DATA_MATRIX_COMPACT`,e[e.MIN_SIZE=4]=`MIN_SIZE`,e[e.MAX_SIZE=5]=`MAX_SIZE`,e[e.MARGIN=6]=`MARGIN`,e[e.PDF417_COMPACT=7]=`PDF417_COMPACT`,e[e.PDF417_COMPACTION=8]=`PDF417_COMPACTION`,e[e.PDF417_DIMENSIONS=9]=`PDF417_DIMENSIONS`,e[e.AZTEC_LAYERS=10]=`AZTEC_LAYERS`,e[e.QR_VERSION=11]=`QR_VERSION`,e[e.GS1_FORMAT=12]=`GS1_FORMAT`,e[e.FORCE_C40=13]=`FORCE_C40`})(Yi||={});var q=Yi,Xi=function(){function e(e){this.field=e,this.cachedGenerators=[],this.cachedGenerators.push(new we(e,Int32Array.from([1])))}return e.prototype.buildGenerator=function(e){var t=this.cachedGenerators;if(e>=t.length)for(var n=t[t.length-1],r=this.field,i=t.length;i<=e;i++){var a=n.multiply(new we(r,Int32Array.from([1,r.exp(i-1+r.getGeneratorBase())])));t.push(a),n=a}return t[e]},e.prototype.encode=function(e,t){if(t===0)throw new l(`No error correction bytes`);var n=e.length-t;if(n<=0)throw new l(`No data bytes provided`);var r=this.buildGenerator(t),i=new Int32Array(n);m.arraycopy(e,0,i,0,n);var a=new we(this.field,i);a=a.multiplyByMonomial(t,1);for(var o=a.divide(r)[1].getCoefficients(),s=t-o.length,c=0;c<s;c++)e[n+c]=0;m.arraycopy(o,0,e,n+s,o.length)},e}(),Zi=function(){function e(){}return e.applyMaskPenaltyRule1=function(t){return e.applyMaskPenaltyRule1Internal(t,!0)+e.applyMaskPenaltyRule1Internal(t,!1)},e.applyMaskPenaltyRule2=function(t){for(var n=0,r=t.getArray(),i=t.getWidth(),a=t.getHeight(),o=0;o<a-1;o++)for(var s=r[o],c=0;c<i-1;c++){var l=s[c];l===s[c+1]&&l===r[o+1][c]&&l===r[o+1][c+1]&&n++}return e.N2*n},e.applyMaskPenaltyRule3=function(t){for(var n=0,r=t.getArray(),i=t.getWidth(),a=t.getHeight(),o=0;o<a;o++)for(var s=0;s<i;s++){var c=r[o];s+6<i&&c[s]===1&&c[s+1]===0&&c[s+2]===1&&c[s+3]===1&&c[s+4]===1&&c[s+5]===0&&c[s+6]===1&&(e.isWhiteHorizontal(c,s-4,s)||e.isWhiteHorizontal(c,s+7,s+11))&&n++,o+6<a&&r[o][s]===1&&r[o+1][s]===0&&r[o+2][s]===1&&r[o+3][s]===1&&r[o+4][s]===1&&r[o+5][s]===0&&r[o+6][s]===1&&(e.isWhiteVertical(r,s,o-4,o)||e.isWhiteVertical(r,s,o+7,o+11))&&n++}return n*e.N3},e.isWhiteHorizontal=function(e,t,n){t=Math.max(t,0),n=Math.min(n,e.length);for(var r=t;r<n;r++)if(e[r]===1)return!1;return!0},e.isWhiteVertical=function(e,t,n,r){n=Math.max(n,0),r=Math.min(r,e.length);for(var i=n;i<r;i++)if(e[i][t]===1)return!1;return!0},e.applyMaskPenaltyRule4=function(t){for(var n=0,r=t.getArray(),i=t.getWidth(),a=t.getHeight(),o=0;o<a;o++)for(var s=r[o],c=0;c<i;c++)s[c]===1&&n++;var l=t.getHeight()*t.getWidth();return Math.floor(Math.abs(n*2-l)*10/l)*e.N4},e.getDataMaskBit=function(e,t,n){var r,i;switch(e){case 0:r=n+t&1;break;case 1:r=n&1;break;case 2:r=t%3;break;case 3:r=(n+t)%3;break;case 4:r=Math.floor(n/2)+Math.floor(t/3)&1;break;case 5:i=n*t,r=(i&1)+i%3;break;case 6:i=n*t,r=(i&1)+i%3&1;break;case 7:i=n*t,r=i%3+(n+t&1)&1;break;default:throw new l(`Invalid mask pattern: `+e)}return r===0},e.applyMaskPenaltyRule1Internal=function(t,n){for(var r=0,i=n?t.getHeight():t.getWidth(),a=n?t.getWidth():t.getHeight(),o=t.getArray(),s=0;s<i;s++){for(var c=0,l=-1,u=0;u<a;u++){var d=n?o[s][u]:o[u][s];d===l?c++:(c>=5&&(r+=e.N1+(c-5)),c=1,l=d)}c>=5&&(r+=e.N1+(c-5))}return r},e.N1=3,e.N2=3,e.N3=40,e.N4=10,e}(),Qi=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},$i=function(){function e(e,t){this.width=e,this.height=t;for(var n=Array(t),r=0;r!==t;r++)n[r]=new Uint8Array(e);this.bytes=n}return e.prototype.getHeight=function(){return this.height},e.prototype.getWidth=function(){return this.width},e.prototype.get=function(e,t){return this.bytes[t][e]},e.prototype.getArray=function(){return this.bytes},e.prototype.setNumber=function(e,t,n){this.bytes[t][e]=n},e.prototype.setBoolean=function(e,t,n){this.bytes[t][e]=+!!n},e.prototype.clear=function(e){var t,n;try{for(var r=Qi(this.bytes),i=r.next();!i.done;i=r.next()){var a=i.value;b.fill(a,e)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;if(this.width!==n.width||this.height!==n.height)return!1;for(var r=0,i=this.height;r<i;++r)for(var a=this.bytes[r],o=n.bytes[r],s=0,c=this.width;s<c;++s)if(a[s]!==o[s])return!1;return!0},e.prototype.toString=function(){for(var e=new j,t=0,n=this.height;t<n;++t){for(var r=this.bytes[t],i=0,a=this.width;i<a;++i)switch(r[i]){case 0:e.append(` 0`);break;case 1:e.append(` 1`);break;default:e.append(` `)}e.append(`
10
- `)}return e.toString()},e}(),ea=function(){function e(){this.maskPattern=-1}return e.prototype.getMode=function(){return this.mode},e.prototype.getECLevel=function(){return this.ecLevel},e.prototype.getVersion=function(){return this.version},e.prototype.getMaskPattern=function(){return this.maskPattern},e.prototype.getMatrix=function(){return this.matrix},e.prototype.toString=function(){var e=new j;return e.append(`<<
6
+ `,`. `,`, `,`: `,`!`,`"`,`#`,`$`,`%`,`&`,`'`,`(`,`)`,`*`,`+`,`,`,`-`,`.`,`/`,`:`,`;`,`<`,`=`,`>`,`?`,`[`,`]`,`{`,`}`,`CTRL_UL`],e.DIGIT_TABLE=[`CTRL_PS`,` `,`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`,`,`,`.`,`CTRL_UL`,`CTRL_US`],e}(),R=function(){function e(){}return e.round=function(e){return isNaN(e)?0:e<=-(2**53-1)?-(2**53-1):e>=2**53-1?2**53-1:e+(e<0?-.5:.5)|0},e.distance=function(e,t,n,r){var i=e-n,a=t-r;return Math.sqrt(i*i+a*a)},e.sum=function(e){for(var t=0,n=0,r=e.length;n!==r;n++){var i=e[n];t+=i}return t},e}(),mt=function(){function e(){}return e.floatToIntBits=function(e){return e},e.MAX_VALUE=2**53-1,e}(),z=function(){function e(e,t){this.x=e,this.y=t}return e.prototype.getX=function(){return this.x},e.prototype.getY=function(){return this.y},e.prototype.equals=function(t){if(t instanceof e){var n=t;return this.x===n.x&&this.y===n.y}return!1},e.prototype.hashCode=function(){return 31*mt.floatToIntBits(this.x)+mt.floatToIntBits(this.y)},e.prototype.toString=function(){return`(`+this.x+`,`+this.y+`)`},e.orderBestPatterns=function(e){var t=this.distance(e[0],e[1]),n=this.distance(e[1],e[2]),r=this.distance(e[0],e[2]),i,a,o;if(n>=t&&n>=r?(a=e[0],i=e[1],o=e[2]):r>=n&&r>=t?(a=e[1],i=e[0],o=e[2]):(a=e[2],i=e[0],o=e[1]),this.crossProductZ(i,a,o)<0){var s=i;i=o,o=s}e[0]=i,e[1]=a,e[2]=o},e.distance=function(e,t){return R.distance(e.x,e.y,t.x,t.y)},e.crossProductZ=function(e,t,n){var r=t.x,i=t.y;return(n.x-r)*(e.y-i)-(n.y-i)*(e.x-r)},e}(),ht=function(){function e(e,t){this.bits=e,this.points=t}return e.prototype.getBits=function(){return this.bits},e.prototype.getPoints=function(){return this.points},e}(),gt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),_t=function(e){gt(t,e);function t(t,n,r,i,a){var o=e.call(this,t,n)||this;return o.compact=r,o.nbDatablocks=i,o.nbLayers=a,o}return t.prototype.getNbLayers=function(){return this.nbLayers},t.prototype.getNbDatablocks=function(){return this.nbDatablocks},t.prototype.isCompact=function(){return this.compact},t}(ht),vt=function(){function e(t,n,r,i){this.image=t,this.height=t.getHeight(),this.width=t.getWidth(),n??=e.INIT_SIZE,r??=t.getWidth()/2|0,i??=t.getHeight()/2|0;var a=n/2|0;if(this.leftInit=r-a,this.rightInit=r+a,this.upInit=i-a,this.downInit=i+a,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new I}return e.prototype.detect=function(){for(var e=this.leftInit,t=this.rightInit,n=this.upInit,r=this.downInit,i=!1,a=!0,o=!1,s=!1,c=!1,l=!1,u=!1,d=this.width,f=this.height;a;){a=!1;for(var p=!0;(p||!s)&&t<d;)p=this.containsBlackPoint(n,r,t,!1),p?(t++,a=!0,s=!0):s||t++;if(t>=d){i=!0;break}for(var m=!0;(m||!c)&&r<f;)m=this.containsBlackPoint(e,t,r,!0),m?(r++,a=!0,c=!0):c||r++;if(r>=f){i=!0;break}for(var h=!0;(h||!l)&&e>=0;)h=this.containsBlackPoint(n,r,e,!1),h?(e--,a=!0,l=!0):l||e--;if(e<0){i=!0;break}for(var g=!0;(g||!u)&&n>=0;)g=this.containsBlackPoint(e,t,n,!0),g?(n--,a=!0,u=!0):u||n--;if(n<0){i=!0;break}a&&(o=!0)}if(!i&&o){for(var _=t-e,v=null,y=1;v===null&&y<_;y++)v=this.getBlackPointOnSegment(e,r-y,e+y,r);if(v==null)throw new I;for(var b=null,y=1;b===null&&y<_;y++)b=this.getBlackPointOnSegment(e,n+y,e+y,n);if(b==null)throw new I;for(var x=null,y=1;x===null&&y<_;y++)x=this.getBlackPointOnSegment(t,n+y,t-y,n);if(x==null)throw new I;for(var S=null,y=1;S===null&&y<_;y++)S=this.getBlackPointOnSegment(t,r-y,t-y,r);if(S==null)throw new I;return this.centerEdges(S,v,x,b)}throw new I},e.prototype.getBlackPointOnSegment=function(e,t,n,r){for(var i=R.round(R.distance(e,t,n,r)),a=(n-e)/i,o=(r-t)/i,s=this.image,c=0;c<i;c++){var l=R.round(e+c*a),u=R.round(t+c*o);if(s.get(l,u))return new z(l,u)}return null},e.prototype.centerEdges=function(t,n,r,i){var a=t.getX(),o=t.getY(),s=n.getX(),c=n.getY(),l=r.getX(),u=r.getY(),d=i.getX(),f=i.getY(),p=e.CORR;return a<this.width/2?[new z(d-p,f+p),new z(s+p,c+p),new z(l-p,u-p),new z(a+p,o-p)]:[new z(d+p,f+p),new z(s+p,c-p),new z(l-p,u+p),new z(a-p,o-p)]},e.prototype.containsBlackPoint=function(e,t,n,r){var i=this.image;if(r){for(var a=e;a<=t;a++)if(i.get(a,n))return!0}else for(var o=e;o<=t;o++)if(i.get(n,o))return!0;return!1},e.INIT_SIZE=10,e.CORR=1,e}(),yt=function(){function e(){}return e.checkAndNudgePoints=function(e,t){for(var n=e.getWidth(),r=e.getHeight(),i=!0,a=0;a<t.length&&i;a+=2){var o=Math.floor(t[a]),s=Math.floor(t[a+1]);if(o<-1||o>n||s<-1||s>r)throw new I;i=!1,o===-1?(t[a]=0,i=!0):o===n&&(t[a]=n-1,i=!0),s===-1?(t[a+1]=0,i=!0):s===r&&(t[a+1]=r-1,i=!0)}i=!0;for(var a=t.length-2;a>=0&&i;a-=2){var o=Math.floor(t[a]),s=Math.floor(t[a+1]);if(o<-1||o>n||s<-1||s>r)throw new I;i=!1,o===-1?(t[a]=0,i=!0):o===n&&(t[a]=n-1,i=!0),s===-1?(t[a+1]=0,i=!0):s===r&&(t[a+1]=r-1,i=!0)}},e}(),bt=function(){function e(e,t,n,r,i,a,o,s,c){this.a11=e,this.a21=t,this.a31=n,this.a12=r,this.a22=i,this.a32=a,this.a13=o,this.a23=s,this.a33=c}return e.quadrilateralToQuadrilateral=function(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){var _=e.quadrilateralToSquare(t,n,r,i,a,o,s,c);return e.squareToQuadrilateral(l,u,d,f,p,m,h,g).times(_)},e.prototype.transformPoints=function(e){for(var t=e.length,n=this.a11,r=this.a12,i=this.a13,a=this.a21,o=this.a22,s=this.a23,c=this.a31,l=this.a32,u=this.a33,d=0;d<t;d+=2){var f=e[d],p=e[d+1],m=i*f+s*p+u;e[d]=(n*f+a*p+c)/m,e[d+1]=(r*f+o*p+l)/m}},e.prototype.transformPointsWithValues=function(e,t){for(var n=this.a11,r=this.a12,i=this.a13,a=this.a21,o=this.a22,s=this.a23,c=this.a31,l=this.a32,u=this.a33,d=e.length,f=0;f<d;f++){var p=e[f],m=t[f],h=i*p+s*m+u;e[f]=(n*p+a*m+c)/h,t[f]=(r*p+o*m+l)/h}},e.squareToQuadrilateral=function(t,n,r,i,a,o,s,c){var l=t-r+a-s,u=n-i+o-c;if(l===0&&u===0)return new e(r-t,a-r,t,i-n,o-i,n,0,0,1);var d=r-a,f=s-a,p=i-o,m=c-o,h=d*m-f*p,g=(l*m-f*u)/h,_=(d*u-l*p)/h;return new e(r-t+g*r,s-t+_*s,t,i-n+g*i,c-n+_*c,n,g,_,1)},e.quadrilateralToSquare=function(t,n,r,i,a,o,s,c){return e.squareToQuadrilateral(t,n,r,i,a,o,s,c).buildAdjoint()},e.prototype.buildAdjoint=function(){return new e(this.a22*this.a33-this.a23*this.a32,this.a23*this.a31-this.a21*this.a33,this.a21*this.a32-this.a22*this.a31,this.a13*this.a32-this.a12*this.a33,this.a11*this.a33-this.a13*this.a31,this.a12*this.a31-this.a11*this.a32,this.a12*this.a23-this.a13*this.a22,this.a13*this.a21-this.a11*this.a23,this.a11*this.a22-this.a12*this.a21)},e.prototype.times=function(t){return new e(this.a11*t.a11+this.a21*t.a12+this.a31*t.a13,this.a11*t.a21+this.a21*t.a22+this.a31*t.a23,this.a11*t.a31+this.a21*t.a32+this.a31*t.a33,this.a12*t.a11+this.a22*t.a12+this.a32*t.a13,this.a12*t.a21+this.a22*t.a22+this.a32*t.a23,this.a12*t.a31+this.a22*t.a32+this.a32*t.a33,this.a13*t.a11+this.a23*t.a12+this.a33*t.a13,this.a13*t.a21+this.a23*t.a22+this.a33*t.a23,this.a13*t.a31+this.a23*t.a32+this.a33*t.a33)},e}(),xt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),St=function(e){xt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.sampleGrid=function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){var y=bt.quadrilateralToQuadrilateral(r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v);return this.sampleGridWithTransform(e,t,n,y)},t.prototype.sampleGridWithTransform=function(e,t,n,r){if(t<=0||n<=0)throw new I;for(var i=new Pe(t,n),a=new Float32Array(2*t),o=0;o<n;o++){for(var s=a.length,c=o+.5,l=0;l<s;l+=2)a[l]=l/2+.5,a[l+1]=c;r.transformPoints(a),yt.checkAndNudgePoints(e,a);try{for(var l=0;l<s;l+=2)e.get(a[l]|0,a[l+1]|0)&&i.set(l/2,o)}catch{throw new I}}return i},t}(yt),Ct=function(){function e(){}return e.setGridSampler=function(t){e.gridSampler=t},e.getInstance=function(){return e.gridSampler},e.gridSampler=new St,e}(),wt=function(){function e(e,t){this.x=e,this.y=t}return e.prototype.toResultPoint=function(){return new z(this.getX(),this.getY())},e.prototype.getX=function(){return this.x},e.prototype.getY=function(){return this.y},e}(),Tt=function(){function e(e){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=e}return e.prototype.detect=function(){return this.detectMirror(!1)},e.prototype.detectMirror=function(e){var t=this.getMatrixCenter(),n=this.getBullsEyeCorners(t);if(e){var r=n[0];n[0]=n[2],n[2]=r}return this.extractParameters(n),new _t(this.sampleGrid(this.image,n[this.shift%4],n[(this.shift+1)%4],n[(this.shift+2)%4],n[(this.shift+3)%4]),this.getMatrixCornerPoints(n),this.compact,this.nbDataBlocks,this.nbLayers)},e.prototype.extractParameters=function(e){if(!this.isValidPoint(e[0])||!this.isValidPoint(e[1])||!this.isValidPoint(e[2])||!this.isValidPoint(e[3]))throw new I;var t=2*this.nbCenterLayers,n=new Int32Array([this.sampleLine(e[0],e[1],t),this.sampleLine(e[1],e[2],t),this.sampleLine(e[2],e[3],t),this.sampleLine(e[3],e[0],t)]);this.shift=this.getRotation(n,t);for(var r=0,i=0;i<4;i++){var a=n[(this.shift+i)%4];this.compact?(r<<=7,r+=a>>1&127):(r<<=10,r+=(a>>2&992)+(a>>1&31))}var o=this.getCorrectedParameterData(r,this.compact);this.compact?(this.nbLayers=(o>>6)+1,this.nbDataBlocks=(o&63)+1):(this.nbLayers=(o>>11)+1,this.nbDataBlocks=(o&2047)+1)},e.prototype.getRotation=function(e,t){var n=0;e.forEach(function(e,r,i){var a=(e>>t-2<<1)+(e&1);n=(n<<3)+a}),n=((n&1)<<11)+(n>>1);for(var r=0;r<4;r++)if(A.bitCount(n^this.EXPECTED_CORNER_BITS[r])<=2)return r;throw new I},e.prototype.getCorrectedParameterData=function(e,t){var n,r;t?(n=7,r=2):(n=10,r=4);for(var i=n-r,a=new Int32Array(n),o=n-1;o>=0;--o)a[o]=e&15,e>>=4;try{new dt(ot.AZTEC_PARAM).decode(a,i)}catch{throw new I}for(var s=0,o=0;o<r;o++)s=(s<<4)+a[o];return s},e.prototype.getBullsEyeCorners=function(e){var t=e,n=e,r=e,i=e,a=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){var o=this.getFirstDifferent(t,a,1,-1),s=this.getFirstDifferent(n,a,1,1),c=this.getFirstDifferent(r,a,-1,1),l=this.getFirstDifferent(i,a,-1,-1);if(this.nbCenterLayers>2){var u=this.distancePoint(l,o)*this.nbCenterLayers/(this.distancePoint(i,t)*(this.nbCenterLayers+2));if(u<.75||u>1.25||!this.isWhiteOrBlackRectangle(o,s,c,l))break}t=o,n=s,r=c,i=l,a=!a}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new I;this.compact=this.nbCenterLayers===5;var d=new z(t.getX()+.5,t.getY()-.5),f=new z(n.getX()+.5,n.getY()+.5),p=new z(r.getX()-.5,r.getY()+.5),m=new z(i.getX()-.5,i.getY()-.5);return this.expandSquare([d,f,p,m],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},e.prototype.getMatrixCenter=function(){var e,t,n,r;try{var i=new vt(this.image).detect();e=i[0],t=i[1],n=i[2],r=i[3]}catch{var a=this.image.getWidth()/2,o=this.image.getHeight()/2;e=this.getFirstDifferent(new wt(a+7,o-7),!1,1,-1).toResultPoint(),t=this.getFirstDifferent(new wt(a+7,o+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new wt(a-7,o+7),!1,-1,1).toResultPoint(),r=this.getFirstDifferent(new wt(a-7,o-7),!1,-1,-1).toResultPoint()}var s=R.round((e.getX()+r.getX()+t.getX()+n.getX())/4),c=R.round((e.getY()+r.getY()+t.getY()+n.getY())/4);try{var i=new vt(this.image,15,s,c).detect();e=i[0],t=i[1],n=i[2],r=i[3]}catch{e=this.getFirstDifferent(new wt(s+7,c-7),!1,1,-1).toResultPoint(),t=this.getFirstDifferent(new wt(s+7,c+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new wt(s-7,c+7),!1,-1,1).toResultPoint(),r=this.getFirstDifferent(new wt(s-7,c-7),!1,-1,-1).toResultPoint()}return s=R.round((e.getX()+r.getX()+t.getX()+n.getX())/4),c=R.round((e.getY()+r.getY()+t.getY()+n.getY())/4),new wt(s,c)},e.prototype.getMatrixCornerPoints=function(e){return this.expandSquare(e,2*this.nbCenterLayers,this.getDimension())},e.prototype.sampleGrid=function(e,t,n,r,i){var a=Ct.getInstance(),o=this.getDimension(),s=o/2-this.nbCenterLayers,c=o/2+this.nbCenterLayers;return a.sampleGrid(e,o,o,s,s,c,s,c,c,s,c,t.getX(),t.getY(),n.getX(),n.getY(),r.getX(),r.getY(),i.getX(),i.getY())},e.prototype.sampleLine=function(e,t,n){for(var r=0,i=this.distanceResultPoint(e,t),a=i/n,o=e.getX(),s=e.getY(),c=a*(t.getX()-e.getX())/i,l=a*(t.getY()-e.getY())/i,u=0;u<n;u++)this.image.get(R.round(o+u*c),R.round(s+u*l))&&(r|=1<<n-u-1);return r},e.prototype.isWhiteOrBlackRectangle=function(e,t,n,r){var i=3;e=new wt(e.getX()-i,e.getY()+i),t=new wt(t.getX()-i,t.getY()-i),n=new wt(n.getX()+i,n.getY()-i),r=new wt(r.getX()+i,r.getY()+i);var a=this.getColor(r,e);if(a===0)return!1;var o=this.getColor(e,t);return o!==a||(o=this.getColor(t,n),o!==a)?!1:(o=this.getColor(n,r),o===a)},e.prototype.getColor=function(e,t){for(var n=this.distancePoint(e,t),r=(t.getX()-e.getX())/n,i=(t.getY()-e.getY())/n,a=0,o=e.getX(),s=e.getY(),c=this.image.get(e.getX(),e.getY()),l=Math.ceil(n),u=0;u<l;u++)o+=r,s+=i,this.image.get(R.round(o),R.round(s))!==c&&a++;var d=a/n;return d>.1&&d<.9?0:d<=.1===c?1:-1},e.prototype.getFirstDifferent=function(e,t,n,r){for(var i=e.getX()+n,a=e.getY()+r;this.isValid(i,a)&&this.image.get(i,a)===t;)i+=n,a+=r;for(i-=n,a-=r;this.isValid(i,a)&&this.image.get(i,a)===t;)i+=n;for(i-=n;this.isValid(i,a)&&this.image.get(i,a)===t;)a+=r;return a-=r,new wt(i,a)},e.prototype.expandSquare=function(e,t,n){var r=n/(2*t),i=e[0].getX()-e[2].getX(),a=e[0].getY()-e[2].getY(),o=(e[0].getX()+e[2].getX())/2,s=(e[0].getY()+e[2].getY())/2,c=new z(o+r*i,s+r*a),l=new z(o-r*i,s-r*a);return i=e[1].getX()-e[3].getX(),a=e[1].getY()-e[3].getY(),o=(e[1].getX()+e[3].getX())/2,s=(e[1].getY()+e[3].getY())/2,[c,new z(o+r*i,s+r*a),l,new z(o-r*i,s-r*a)]},e.prototype.isValid=function(e,t){return e>=0&&e<this.image.getWidth()&&t>0&&t<this.image.getHeight()},e.prototype.isValidPoint=function(e){var t=R.round(e.getX()),n=R.round(e.getY());return this.isValid(t,n)},e.prototype.distancePoint=function(e,t){return R.distance(e.getX(),e.getY(),t.getX(),t.getY())},e.prototype.distanceResultPoint=function(e,t){return R.distance(e.getX(),e.getY(),t.getX(),t.getY())},e.prototype.getDimension=function(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(A.truncDivision(this.nbLayers-4,8)+1)+15},e}(),Et=function(){function e(){}return e.prototype.decode=function(e,t){t===void 0&&(t=null);var n=null,r=new Tt(e.getBlackMatrix()),i=null,a=null;try{var o=r.detectMirror(!1);i=o.getPoints(),this.reportFoundResultPoints(t,i),a=new pt().decode(o)}catch(e){n=e}if(a==null)try{var o=r.detectMirror(!0);i=o.getPoints(),this.reportFoundResultPoints(t,i),a=new pt().decode(o)}catch(e){throw n??e}var s=new Xe(a.getText(),a.getRawBytes(),a.getNumBits(),i,L.AZTEC,k.currentTimeMillis()),c=a.getByteSegments();c!=null&&s.putMetadata($e.BYTE_SEGMENTS,c);var l=a.getECLevel();return l!=null&&s.putMetadata($e.ERROR_CORRECTION_LEVEL,l),s},e.prototype.reportFoundResultPoints=function(e,t){if(e!=null){var n=e.get(j.NEED_RESULT_POINT_CALLBACK);n!=null&&t.forEach(function(e,t,r){n.foundPossibleResultPoint(e)})}},e.prototype.reset=function(){},e}(),Dt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){Dt(t,e);function t(t){return t===void 0&&(t=500),e.call(this,new Et,t)||this}return t})(Ye);var Ot=function(){function e(){}return e.prototype.decode=function(e,t){try{return this.doDecode(e,t)}catch{if(t&&t.get(j.TRY_HARDER)===!0&&e.isRotateSupported()){var n=e.rotateCounterClockwise(),r=this.doDecode(n,t),i=r.getResultMetadata(),a=270;i!==null&&i.get($e.ORIENTATION)===!0&&(a+=i.get($e.ORIENTATION)%360),r.putMetadata($e.ORIENTATION,a);var o=r.getResultPoints();if(o!==null)for(var s=n.getHeight(),c=0;c<o.length;c++)o[c]=new z(s-o[c].getY()-1,o[c].getX());return r}throw new I}},e.prototype.reset=function(){},e.prototype.doDecode=function(e,t){for(var n=e.getWidth(),r=e.getHeight(),i=new Ee(n),a=t&&t.get(j.TRY_HARDER)===!0,o=Math.max(1,r>>(a?8:5)),s=a?r:25,c=Math.trunc(r/2),l=0;l<s;l++){var u=Math.trunc((l+1)/2),d=c+o*(l&1?-u:u);if(d<0||d>=r)break;try{i=e.getBlackRow(d,i)}catch{continue}for(var f=function(e){if(e===1&&(i.reverse(),t&&t.get(j.NEED_RESULT_POINT_CALLBACK)===!0)){var r=new Map;t.forEach(function(e,t){return r.set(t,e)}),r.delete(j.NEED_RESULT_POINT_CALLBACK),t=r}try{var a=p.decodeRow(d,i,t);if(e===1){a.putMetadata($e.ORIENTATION,180);var o=a.getResultPoints();o!==null&&(o[0]=new z(n-o[0].getX()-1,o[0].getY()),o[1]=new z(n-o[1].getX()-1,o[1].getY()))}return{value:a}}catch{}},p=this,m=0;m<2;m++){var h=f(m);if(typeof h==`object`)return h.value}}throw new I},e.recordPattern=function(e,t,n){for(var r=n.length,i=0;i<r;i++)n[i]=0;var a=e.getSize();if(t>=a)throw new I;for(var o=!e.get(t),s=0,c=t;c<a;){if(e.get(c)!==o)n[s]++;else if(++s===r)break;else n[s]=1,o=!o;c++}if(!(s===r||s===r-1&&c===a))throw new I},e.recordPatternInReverse=function(t,n,r){for(var i=r.length,a=t.get(n);n>0&&i>=0;)t.get(--n)!==a&&(i--,a=!a);if(i>=0)throw new I;e.recordPattern(t,n+1,r)},e.patternMatchVariance=function(e,t,n){for(var r=e.length,i=0,a=0,o=0;o<r;o++)i+=e[o],a+=t[o];if(i<a)return 1/0;var s=i/a;n*=s;for(var c=0,l=0;l<r;l++){var u=e[l],d=t[l]*s,f=u>d?u-d:d-u;if(f>n)return 1/0;c+=f}return c/i},e}(),kt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),At=function(e){kt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.findStartPattern=function(e){for(var n=e.getSize(),r=e.getNextSet(0),i=0,a=Int32Array.from([0,0,0,0,0,0]),o=r,s=!1,c=6,l=r;l<n;l++)if(e.get(l)!==s)a[i]++;else{if(i===c-1){for(var u=t.MAX_AVG_VARIANCE,d=-1,f=t.CODE_START_A;f<=t.CODE_START_C;f++){var p=Ot.patternMatchVariance(a,t.CODE_PATTERNS[f],t.MAX_INDIVIDUAL_VARIANCE);p<u&&(u=p,d=f)}if(d>=0&&e.isRange(Math.max(0,o-(l-o)/2),o,!1))return Int32Array.from([o,l,d]);o+=a[0]+a[1],a=a.slice(2,a.length),a[i-1]=0,a[i]=0,i--}else i++;a[i]=1,s=!s}throw new I},t.decodeCode=function(e,n,r){Ot.recordPattern(e,r,n);for(var i=t.MAX_AVG_VARIANCE,a=-1,o=0;o<t.CODE_PATTERNS.length;o++){var s=t.CODE_PATTERNS[o],c=this.patternMatchVariance(n,s,t.MAX_INDIVIDUAL_VARIANCE);c<i&&(i=c,a=o)}if(a>=0)return a;throw new I},t.prototype.decodeRow=function(e,n,r){var i=r&&r.get(j.ASSUME_GS1)===!0,a=t.findStartPattern(n),o=a[2],s=0,c=new Uint8Array(20);c[s++]=o;var l;switch(o){case t.CODE_START_A:l=t.CODE_CODE_A;break;case t.CODE_START_B:l=t.CODE_CODE_B;break;case t.CODE_START_C:l=t.CODE_CODE_C;break;default:throw new M}for(var u=!1,d=!1,f=``,p=a[0],m=a[1],h=Int32Array.from([0,0,0,0,0,0]),g=0,_=0,v=o,y=0,b=!0,x=!1,S=!1;!u;){var C=d;switch(d=!1,g=_,_=t.decodeCode(n,h,m),c[s++]=_,_!==t.CODE_STOP&&(b=!0),_!==t.CODE_STOP&&(y++,v+=y*_),p=m,m+=h.reduce(function(e,t){return e+t},0),_){case t.CODE_START_A:case t.CODE_START_B:case t.CODE_START_C:throw new M}switch(l){case t.CODE_CODE_A:if(_<64)f+=S===x?String.fromCharCode(32+_):String.fromCharCode(32+_+128),S=!1;else if(_<96)f+=S===x?String.fromCharCode(_-64):String.fromCharCode(_+64),S=!1;else switch(_!==t.CODE_STOP&&(b=!1),_){case t.CODE_FNC_1:i&&(f.length===0?f+=`]C1`:f+=``);break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_A:!x&&S?(x=!0,S=!1):x&&S?(x=!1,S=!1):S=!0;break;case t.CODE_SHIFT:d=!0,l=t.CODE_CODE_B;break;case t.CODE_CODE_B:l=t.CODE_CODE_B;break;case t.CODE_CODE_C:l=t.CODE_CODE_C;break;case t.CODE_STOP:u=!0}break;case t.CODE_CODE_B:if(_<96)f+=S===x?String.fromCharCode(32+_):String.fromCharCode(32+_+128),S=!1;else switch(_!==t.CODE_STOP&&(b=!1),_){case t.CODE_FNC_1:i&&(f.length===0?f+=`]C1`:f+=``);break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_B:!x&&S?(x=!0,S=!1):x&&S?(x=!1,S=!1):S=!0;break;case t.CODE_SHIFT:d=!0,l=t.CODE_CODE_A;break;case t.CODE_CODE_A:l=t.CODE_CODE_A;break;case t.CODE_CODE_C:l=t.CODE_CODE_C;break;case t.CODE_STOP:u=!0}break;case t.CODE_CODE_C:if(_<100)_<10&&(f+=`0`),f+=_;else switch(_!==t.CODE_STOP&&(b=!1),_){case t.CODE_FNC_1:i&&(f.length===0?f+=`]C1`:f+=``);break;case t.CODE_CODE_A:l=t.CODE_CODE_A;break;case t.CODE_CODE_B:l=t.CODE_CODE_B;break;case t.CODE_STOP:u=!0}}C&&(l=l===t.CODE_CODE_A?t.CODE_CODE_B:t.CODE_CODE_A)}var w=m-p;if(m=n.getNextUnset(m),!n.isRange(m,Math.min(n.getSize(),m+(m-p)/2),!1))throw new I;if(v-=y*g,v%103!==g)throw new O;var T=f.length;if(T===0)throw new I;T>0&&b&&(f=l===t.CODE_CODE_C?f.substring(0,T-2):f.substring(0,T-1));for(var E=(a[1]+a[0])/2,ee=p+w/2,te=c.length,ne=new Uint8Array(te),re=0;re<te;re++)ne[re]=c[re];var ie=[new z(E,e),new z(ee,e)];return new Xe(f,ne,0,ie,L.CODE_128,new Date().getTime())},t.CODE_PATTERNS=[Int32Array.from([2,1,2,2,2,2]),Int32Array.from([2,2,2,1,2,2]),Int32Array.from([2,2,2,2,2,1]),Int32Array.from([1,2,1,2,2,3]),Int32Array.from([1,2,1,3,2,2]),Int32Array.from([1,3,1,2,2,2]),Int32Array.from([1,2,2,2,1,3]),Int32Array.from([1,2,2,3,1,2]),Int32Array.from([1,3,2,2,1,2]),Int32Array.from([2,2,1,2,1,3]),Int32Array.from([2,2,1,3,1,2]),Int32Array.from([2,3,1,2,1,2]),Int32Array.from([1,1,2,2,3,2]),Int32Array.from([1,2,2,1,3,2]),Int32Array.from([1,2,2,2,3,1]),Int32Array.from([1,1,3,2,2,2]),Int32Array.from([1,2,3,1,2,2]),Int32Array.from([1,2,3,2,2,1]),Int32Array.from([2,2,3,2,1,1]),Int32Array.from([2,2,1,1,3,2]),Int32Array.from([2,2,1,2,3,1]),Int32Array.from([2,1,3,2,1,2]),Int32Array.from([2,2,3,1,1,2]),Int32Array.from([3,1,2,1,3,1]),Int32Array.from([3,1,1,2,2,2]),Int32Array.from([3,2,1,1,2,2]),Int32Array.from([3,2,1,2,2,1]),Int32Array.from([3,1,2,2,1,2]),Int32Array.from([3,2,2,1,1,2]),Int32Array.from([3,2,2,2,1,1]),Int32Array.from([2,1,2,1,2,3]),Int32Array.from([2,1,2,3,2,1]),Int32Array.from([2,3,2,1,2,1]),Int32Array.from([1,1,1,3,2,3]),Int32Array.from([1,3,1,1,2,3]),Int32Array.from([1,3,1,3,2,1]),Int32Array.from([1,1,2,3,1,3]),Int32Array.from([1,3,2,1,1,3]),Int32Array.from([1,3,2,3,1,1]),Int32Array.from([2,1,1,3,1,3]),Int32Array.from([2,3,1,1,1,3]),Int32Array.from([2,3,1,3,1,1]),Int32Array.from([1,1,2,1,3,3]),Int32Array.from([1,1,2,3,3,1]),Int32Array.from([1,3,2,1,3,1]),Int32Array.from([1,1,3,1,2,3]),Int32Array.from([1,1,3,3,2,1]),Int32Array.from([1,3,3,1,2,1]),Int32Array.from([3,1,3,1,2,1]),Int32Array.from([2,1,1,3,3,1]),Int32Array.from([2,3,1,1,3,1]),Int32Array.from([2,1,3,1,1,3]),Int32Array.from([2,1,3,3,1,1]),Int32Array.from([2,1,3,1,3,1]),Int32Array.from([3,1,1,1,2,3]),Int32Array.from([3,1,1,3,2,1]),Int32Array.from([3,3,1,1,2,1]),Int32Array.from([3,1,2,1,1,3]),Int32Array.from([3,1,2,3,1,1]),Int32Array.from([3,3,2,1,1,1]),Int32Array.from([3,1,4,1,1,1]),Int32Array.from([2,2,1,4,1,1]),Int32Array.from([4,3,1,1,1,1]),Int32Array.from([1,1,1,2,2,4]),Int32Array.from([1,1,1,4,2,2]),Int32Array.from([1,2,1,1,2,4]),Int32Array.from([1,2,1,4,2,1]),Int32Array.from([1,4,1,1,2,2]),Int32Array.from([1,4,1,2,2,1]),Int32Array.from([1,1,2,2,1,4]),Int32Array.from([1,1,2,4,1,2]),Int32Array.from([1,2,2,1,1,4]),Int32Array.from([1,2,2,4,1,1]),Int32Array.from([1,4,2,1,1,2]),Int32Array.from([1,4,2,2,1,1]),Int32Array.from([2,4,1,2,1,1]),Int32Array.from([2,2,1,1,1,4]),Int32Array.from([4,1,3,1,1,1]),Int32Array.from([2,4,1,1,1,2]),Int32Array.from([1,3,4,1,1,1]),Int32Array.from([1,1,1,2,4,2]),Int32Array.from([1,2,1,1,4,2]),Int32Array.from([1,2,1,2,4,1]),Int32Array.from([1,1,4,2,1,2]),Int32Array.from([1,2,4,1,1,2]),Int32Array.from([1,2,4,2,1,1]),Int32Array.from([4,1,1,2,1,2]),Int32Array.from([4,2,1,1,1,2]),Int32Array.from([4,2,1,2,1,1]),Int32Array.from([2,1,2,1,4,1]),Int32Array.from([2,1,4,1,2,1]),Int32Array.from([4,1,2,1,2,1]),Int32Array.from([1,1,1,1,4,3]),Int32Array.from([1,1,1,3,4,1]),Int32Array.from([1,3,1,1,4,1]),Int32Array.from([1,1,4,1,1,3]),Int32Array.from([1,1,4,3,1,1]),Int32Array.from([4,1,1,1,1,3]),Int32Array.from([4,1,1,3,1,1]),Int32Array.from([1,1,3,1,4,1]),Int32Array.from([1,1,4,1,3,1]),Int32Array.from([3,1,1,1,4,1]),Int32Array.from([4,1,1,1,3,1]),Int32Array.from([2,1,1,4,1,2]),Int32Array.from([2,1,1,2,1,4]),Int32Array.from([2,1,1,2,3,2]),Int32Array.from([2,3,3,1,1,1,2])],t.MAX_AVG_VARIANCE=.25,t.MAX_INDIVIDUAL_VARIANCE=.7,t.CODE_SHIFT=98,t.CODE_CODE_C=99,t.CODE_CODE_B=100,t.CODE_CODE_A=101,t.CODE_FNC_1=102,t.CODE_FNC_2=97,t.CODE_FNC_3=96,t.CODE_FNC_4_A=101,t.CODE_FNC_4_B=100,t.CODE_START_A=103,t.CODE_START_B=104,t.CODE_START_C=105,t.CODE_STOP=106,t}(Ot),jt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Mt=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Nt=function(e){jt(t,e);function t(t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.call(this)||this;return r.usingCheckDigit=t,r.extendedMode=n,r.decodeRowResult=``,r.counters=new Int32Array(9),r}return t.prototype.decodeRow=function(e,n,r){var i,a,o,s,c=this.counters;c.fill(0),this.decodeRowResult=``;var l=t.findAsteriskPattern(n,c),u=n.getNextSet(l[1]),d=n.getSize(),f,p;do{t.recordPattern(n,u,c);var m=t.toNarrowWidePattern(c);if(m<0)throw new I;f=t.patternToChar(m),this.decodeRowResult+=f,p=u;try{for(var h=(i=void 0,Mt(c)),g=h.next();!g.done;g=h.next()){var _=g.value;u+=_}}catch(e){i={error:e}}finally{try{g&&!g.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}u=n.getNextSet(u)}while(f!==`*`);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var v=0;try{for(var y=Mt(c),b=y.next();!b.done;b=y.next()){var _=b.value;v+=_}}catch(e){o={error:e}}finally{try{b&&!b.done&&(s=y.return)&&s.call(y)}finally{if(o)throw o.error}}var x=u-p-v;if(u!==d&&x*2<v)throw new I;if(this.usingCheckDigit){for(var S=this.decodeRowResult.length-1,C=0,w=0;w<S;w++)C+=t.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(w));if(this.decodeRowResult.charAt(S)!==t.ALPHABET_STRING.charAt(C%43))throw new O;this.decodeRowResult=this.decodeRowResult.substring(0,S)}if(this.decodeRowResult.length===0)throw new I;var T=this.extendedMode?t.decodeExtended(this.decodeRowResult):this.decodeRowResult,E=(l[1]+l[0])/2,ee=p+v/2;return new Xe(T,null,0,[new z(E,e),new z(ee,e)],L.CODE_39,new Date().getTime())},t.findAsteriskPattern=function(e,n){for(var r=e.getSize(),i=e.getNextSet(0),a=0,o=i,s=!1,c=n.length,l=i;l<r;l++)if(e.get(l)!==s)n[a]++;else{if(a===c-1){if(this.toNarrowWidePattern(n)===t.ASTERISK_ENCODING&&e.isRange(Math.max(0,o-Math.floor((l-o)/2)),o,!1))return[o,l];o+=n[0]+n[1],n.copyWithin(0,2,2+a-1),n[a-1]=0,n[a]=0,a--}else a++;n[a]=1,s=!s}throw new I},t.toNarrowWidePattern=function(e){var t,n,r=e.length,i=0,a;do{var o=2147483647;try{for(var s=(t=void 0,Mt(e)),c=s.next();!c.done;c=s.next()){var l=c.value;l<o&&l>i&&(o=l)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}i=o,a=0;for(var u=0,d=0,f=0;f<r;f++){var l=e[f];l>i&&(d|=1<<r-1-f,a++,u+=l)}if(a===3){for(var f=0;f<r&&a>0;f++){var l=e[f];if(l>i&&(a--,l*2>=u))return-1}return d}}while(a>3);return-1},t.patternToChar=function(e){for(var n=0;n<t.CHARACTER_ENCODINGS.length;n++)if(t.CHARACTER_ENCODINGS[n]===e)return t.ALPHABET_STRING.charAt(n);if(e===t.ASTERISK_ENCODING)return`*`;throw new I},t.decodeExtended=function(e){for(var t=e.length,n=``,r=0;r<t;r++){var i=e.charAt(r);if(i===`+`||i===`$`||i===`%`||i===`/`){var a=e.charAt(r+1),o=`\0`;switch(i){case`+`:if(a>=`A`&&a<=`Z`)o=String.fromCharCode(a.charCodeAt(0)+32);else throw new M;break;case`$`:if(a>=`A`&&a<=`Z`)o=String.fromCharCode(a.charCodeAt(0)-64);else throw new M;break;case`%`:if(a>=`A`&&a<=`E`)o=String.fromCharCode(a.charCodeAt(0)-38);else if(a>=`F`&&a<=`J`)o=String.fromCharCode(a.charCodeAt(0)-11);else if(a>=`K`&&a<=`O`)o=String.fromCharCode(a.charCodeAt(0)+16);else if(a>=`P`&&a<=`T`)o=String.fromCharCode(a.charCodeAt(0)+43);else if(a===`U`)o=`\0`;else if(a===`V`)o=`@`;else if(a===`W`)o="`";else if(a===`X`||a===`Y`||a===`Z`)o=``;else throw new M;break;case`/`:if(a>=`A`&&a<=`O`)o=String.fromCharCode(a.charCodeAt(0)-32);else if(a===`Z`)o=`:`;else throw new M}n+=o,r++}else n+=i}return n},t.ALPHABET_STRING=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%`,t.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],t.ASTERISK_ENCODING=148,t}(Ot),Pt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ft=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},It=function(e){Pt(t,e);function t(){var t=e.call(this)||this;return t.decodeRowResult=``,t.counters=new Int32Array(6),t}return t.prototype.decodeRow=function(e,n,r){var i,a,o,s,c=this.findAsteriskPattern(n),l=n.getNextSet(c[1]),u=n.getSize(),d=this.counters;d.fill(0),this.decodeRowResult=``;var f,p;do{t.recordPattern(n,l,d);var m=this.toPattern(d);if(m<0)throw new I;f=this.patternToChar(m),this.decodeRowResult+=f,p=l;try{for(var h=(i=void 0,Ft(d)),g=h.next();!g.done;g=h.next()){var _=g.value;l+=_}}catch(e){i={error:e}}finally{try{g&&!g.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}l=n.getNextSet(l)}while(f!==`*`);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var v=0;try{for(var y=Ft(d),b=y.next();!b.done;b=y.next()){var _=b.value;v+=_}}catch(e){o={error:e}}finally{try{b&&!b.done&&(s=y.return)&&s.call(y)}finally{if(o)throw o.error}}if(l===u||!n.get(l)||this.decodeRowResult.length<2)throw new I;this.checkChecksums(this.decodeRowResult),this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-2);var x=this.decodeExtended(this.decodeRowResult),S=(c[1]+c[0])/2,C=p+v/2;return new Xe(x,null,0,[new z(S,e),new z(C,e)],L.CODE_93,new Date().getTime())},t.prototype.findAsteriskPattern=function(e){var n=e.getSize(),r=e.getNextSet(0);this.counters.fill(0);for(var i=this.counters,a=r,o=!1,s=i.length,c=0,l=r;l<n;l++)if(e.get(l)!==o)i[c]++;else{if(c===s-1){if(this.toPattern(i)===t.ASTERISK_ENCODING)return new Int32Array([a,l]);a+=i[0]+i[1],i.copyWithin(0,2,2+c-1),i[c-1]=0,i[c]=0,c--}else c++;i[c]=1,o=!o}throw new I},t.prototype.toPattern=function(e){var t,n,r=0;try{for(var i=Ft(e),a=i.next();!a.done;a=i.next()){var o=a.value;r+=o}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}for(var s=0,c=e.length,l=0;l<c;l++){var u=Math.round(e[l]*9/r);if(u<1||u>4)return-1;if(l&1)s<<=u;else for(var d=0;d<u;d++)s=s<<1|1}return s},t.prototype.patternToChar=function(e){for(var n=0;n<t.CHARACTER_ENCODINGS.length;n++)if(t.CHARACTER_ENCODINGS[n]===e)return t.ALPHABET_STRING.charAt(n);throw new I},t.prototype.decodeExtended=function(e){for(var t=e.length,n=``,r=0;r<t;r++){var i=e.charAt(r);if(i>=`a`&&i<=`d`){if(r>=t-1)throw new M;var a=e.charAt(r+1),o=`\0`;switch(i){case`d`:if(a>=`A`&&a<=`Z`)o=String.fromCharCode(a.charCodeAt(0)+32);else throw new M;break;case`a`:if(a>=`A`&&a<=`Z`)o=String.fromCharCode(a.charCodeAt(0)-64);else throw new M;break;case`b`:if(a>=`A`&&a<=`E`)o=String.fromCharCode(a.charCodeAt(0)-38);else if(a>=`F`&&a<=`J`)o=String.fromCharCode(a.charCodeAt(0)-11);else if(a>=`K`&&a<=`O`)o=String.fromCharCode(a.charCodeAt(0)+16);else if(a>=`P`&&a<=`T`)o=String.fromCharCode(a.charCodeAt(0)+43);else if(a===`U`)o=`\0`;else if(a===`V`)o=`@`;else if(a===`W`)o="`";else if(a>=`X`&&a<=`Z`)o=``;else throw new M;break;case`c`:if(a>=`A`&&a<=`O`)o=String.fromCharCode(a.charCodeAt(0)-32);else if(a===`Z`)o=`:`;else throw new M}n+=o,r++}else n+=i}return n},t.prototype.checkChecksums=function(e){var t=e.length;this.checkOneChecksum(e,t-2,20),this.checkOneChecksum(e,t-1,15)},t.prototype.checkOneChecksum=function(e,n,r){for(var i=1,a=0,o=n-1;o>=0;o--)a+=i*t.ALPHABET_STRING.indexOf(e.charAt(o)),++i>r&&(i=1);if(e.charAt(n)!==t.ALPHABET_STRING[a%47])throw new O},t.ALPHABET_STRING=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*`,t.CHARACTER_ENCODINGS=[276,328,324,322,296,292,290,336,274,266,424,420,418,404,402,394,360,356,354,308,282,344,332,326,300,278,436,434,428,422,406,410,364,358,310,314,302,468,466,458,366,374,430,294,474,470,306,350],t.ASTERISK_ENCODING=t.CHARACTER_ENCODINGS[47],t}(Ot),Lt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Rt=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},zt=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},Bt=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Vt=function(e){Lt(t,e);function t(){var t=e.apply(this,zt([],Rt(arguments),!1))||this;return t.narrowLineWidth=-1,t}return t.prototype.decodeRow=function(e,n,r){var i,a,o=this.decodeStart(n),s=this.decodeEnd(n),c=new F;t.decodeMiddle(n,o[1],s[0],c);var l=c.toString(),u=null;r!=null&&(u=r.get(j.ALLOWED_LENGTHS)),u??=t.DEFAULT_ALLOWED_LENGTHS;var d=l.length,f=!1,p=0;try{for(var m=Bt(u),h=m.next();!h.done;h=m.next()){var g=h.value;if(d===g){f=!0;break}g>p&&(p=g)}}catch(e){i={error:e}}finally{try{h&&!h.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}if(!f&&d>p&&(f=!0),!f)throw new M;return new Xe(l,null,0,[new z(o[1],e),new z(s[0],e)],L.ITF,new Date().getTime())},t.decodeMiddle=function(e,n,r,i){var a=new Int32Array(10),o=new Int32Array(5),s=new Int32Array(5);for(a.fill(0),o.fill(0),s.fill(0);n<r;){Ot.recordPattern(e,n,a);for(var c=0;c<5;c++){var l=2*c;o[c]=a[l],s[c]=a[l+1]}var u=t.decodeDigit(o);i.append(u.toString()),u=this.decodeDigit(s),i.append(u.toString()),a.forEach(function(e){n+=e})}},t.prototype.decodeStart=function(e){var n=t.skipWhiteSpace(e),r=t.findGuardPattern(e,n,t.START_PATTERN);return this.narrowLineWidth=(r[1]-r[0])/4,this.validateQuietZone(e,r[0]),r},t.prototype.validateQuietZone=function(e,t){var n=this.narrowLineWidth*10;n=n<t?n:t;for(var r=t-1;n>0&&r>=0&&!e.get(r);r--)n--;if(n!==0)throw new I},t.skipWhiteSpace=function(e){var t=e.getSize(),n=e.getNextSet(0);if(n===t)throw new I;return n},t.prototype.decodeEnd=function(e){e.reverse();try{var n=t.skipWhiteSpace(e),r=void 0;try{r=t.findGuardPattern(e,n,t.END_PATTERN_REVERSED[0])}catch(i){i instanceof I&&(r=t.findGuardPattern(e,n,t.END_PATTERN_REVERSED[1]))}this.validateQuietZone(e,r[0]);var i=r[0];return r[0]=e.getSize()-r[1],r[1]=e.getSize()-i,r}finally{e.reverse()}},t.findGuardPattern=function(e,n,r){var i=r.length,a=new Int32Array(i),o=e.getSize(),s=!1,c=0,l=n;a.fill(0);for(var u=n;u<o;u++)if(e.get(u)!==s)a[c]++;else{if(c===i-1){if(Ot.patternMatchVariance(a,r,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return[l,u];l+=a[0]+a[1],k.arraycopy(a,2,a,0,c-1),a[c-1]=0,a[c]=0,c--}else c++;a[c]=1,s=!s}throw new I},t.decodeDigit=function(e){for(var n=t.MAX_AVG_VARIANCE,r=-1,i=t.PATTERNS.length,a=0;a<i;a++){var o=t.PATTERNS[a],s=Ot.patternMatchVariance(e,o,t.MAX_INDIVIDUAL_VARIANCE);s<n?(n=s,r=a):s===n&&(r=-1)}if(r>=0)return r%10;throw new I},t.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],t.MAX_AVG_VARIANCE=.38,t.MAX_INDIVIDUAL_VARIANCE=.5,t.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],t.START_PATTERN=Int32Array.from([1,1,1,1]),t.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],t}(Ot),Ht=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ut=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Wt=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},Gt=function(e){Ht(t,e);function t(){var t=e.apply(this,Wt([],Ut(arguments),!1))||this;return t.decodeRowStringBuffer=``,t}return t.findStartGuardPattern=function(e){for(var n=!1,r,i=0,a=Int32Array.from([0,0,0]);!n;){a=Int32Array.from([0,0,0]),r=t.findGuardPattern(e,i,!1,this.START_END_PATTERN,a);var o=r[0];i=r[1];var s=o-(i-o);s>=0&&(n=e.isRange(s,o,!1))}return r},t.checkChecksum=function(e){return t.checkStandardUPCEANChecksum(e)},t.checkStandardUPCEANChecksum=function(e){var n=e.length;if(n===0)return!1;var r=parseInt(e.charAt(n-1),10);return t.getStandardUPCEANChecksum(e.substring(0,n-1))===r},t.getStandardUPCEANChecksum=function(e){for(var t=e.length,n=0,r=t-1;r>=0;r-=2){var i=e.charAt(r).charCodeAt(0)-48;if(i<0||i>9)throw new M;n+=i}n*=3;for(var r=t-2;r>=0;r-=2){var i=e.charAt(r).charCodeAt(0)-48;if(i<0||i>9)throw new M;n+=i}return(1e3-n)%10},t.decodeEnd=function(e,n){return t.findGuardPattern(e,n,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t.findGuardPatternWithoutCounters=function(e,t,n,r){return this.findGuardPattern(e,t,n,r,new Int32Array(r.length))},t.findGuardPattern=function(e,n,r,i,a){var o=e.getSize();n=r?e.getNextUnset(n):e.getNextSet(n);for(var s=0,c=n,l=i.length,u=r,d=n;d<o;d++)if(e.get(d)!==u)a[s]++;else{if(s===l-1){if(Ot.patternMatchVariance(a,i,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return Int32Array.from([c,d]);c+=a[0]+a[1];for(var f=a.slice(2,a.length),p=0;p<s-1;p++)a[p]=f[p];a[s-1]=0,a[s]=0,s--}else s++;a[s]=1,u=!u}throw new I},t.decodeDigit=function(e,n,r,i){this.recordPattern(e,r,n);for(var a=this.MAX_AVG_VARIANCE,o=-1,s=i.length,c=0;c<s;c++){var l=i[c],u=Ot.patternMatchVariance(n,l,t.MAX_INDIVIDUAL_VARIANCE);u<a&&(a=u,o=c)}if(o>=0)return o;throw new I},t.MAX_AVG_VARIANCE=.48,t.MAX_INDIVIDUAL_VARIANCE=.7,t.START_END_PATTERN=Int32Array.from([1,1,1]),t.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),t.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),t.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])],t}(Ot),Kt=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},qt=function(){function e(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=``}return e.prototype.decodeRow=function(t,n,r){var i=this.decodeRowStringBuffer,a=this.decodeMiddle(n,r,i),o=i.toString(),s=e.parseExtensionString(o),c=new Xe(o,null,0,[new z((r[0]+r[1])/2,t),new z(a,t)],L.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&c.putAllMetadata(s),c},e.prototype.decodeMiddle=function(t,n,r){var i,a,o=this.decodeMiddleCounters;o[0]=0,o[1]=0,o[2]=0,o[3]=0;for(var s=t.getSize(),c=n[1],l=0,u=0;u<5&&c<s;u++){var d=Gt.decodeDigit(t,o,c,Gt.L_AND_G_PATTERNS);r+=String.fromCharCode(48+d%10);try{for(var f=(i=void 0,Kt(o)),p=f.next();!p.done;p=f.next()){var m=p.value;c+=m}}catch(e){i={error:e}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}d>=10&&(l|=1<<4-u),u!==4&&(c=t.getNextSet(c),c=t.getNextUnset(c))}if(r.length!==5)throw new I;var h=this.determineCheckDigit(l);if(e.extensionChecksum(r.toString())!==h)throw new I;return c},e.extensionChecksum=function(e){for(var t=e.length,n=0,r=t-2;r>=0;r-=2)n+=e.charAt(r).charCodeAt(0)-48;n*=3;for(var r=t-1;r>=0;r-=2)n+=e.charAt(r).charCodeAt(0)-48;return n*=3,n%10},e.prototype.determineCheckDigit=function(e){for(var t=0;t<10;t++)if(e===this.CHECK_DIGIT_ENCODINGS[t])return t;throw new I},e.parseExtensionString=function(t){if(t.length!==5)return null;var n=e.parseExtension5String(t);return n==null?null:new Map([[$e.SUGGESTED_PRICE,n]])},e.parseExtension5String=function(e){var t;switch(e.charAt(0)){case`0`:t=`£`;break;case`5`:t=`$`;break;case`9`:switch(e){case`90000`:return null;case`99991`:return`0.00`;case`99990`:return`Used`}t=``;break;default:t=``}var n=parseInt(e.substring(1)),r=(n/100).toString(),i=n%100,a=i<10?`0`+i:i.toString();return t+r+`.`+a},e}(),Jt=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Yt=function(){function e(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=``}return e.prototype.decodeRow=function(t,n,r){var i=this.decodeRowStringBuffer,a=this.decodeMiddle(n,r,i),o=i.toString(),s=e.parseExtensionString(o),c=new Xe(o,null,0,[new z((r[0]+r[1])/2,t),new z(a,t)],L.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&c.putAllMetadata(s),c},e.prototype.decodeMiddle=function(e,t,n){var r,i,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var o=e.getSize(),s=t[1],c=0,l=0;l<2&&s<o;l++){var u=Gt.decodeDigit(e,a,s,Gt.L_AND_G_PATTERNS);n+=String.fromCharCode(48+u%10);try{for(var d=(r=void 0,Jt(a)),f=d.next();!f.done;f=d.next()){var p=f.value;s+=p}}catch(e){r={error:e}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}u>=10&&(c|=1<<1-l),l!==1&&(s=e.getNextSet(s),s=e.getNextUnset(s))}if(n.length!==2||parseInt(n.toString())%4!==c)throw new I;return s},e.parseExtensionString=function(e){return e.length===2?new Map([[$e.ISSUE_NUMBER,parseInt(e)]]):null},e}(),Xt=function(){function e(){}return e.decodeRow=function(e,t,n){var r=Gt.findGuardPattern(t,n,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return new qt().decodeRow(e,t,r)}catch{return new Yt().decodeRow(e,t,r)}},e.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),e}(),Zt=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Qt=function(e){Zt(t,e);function t(){var n=e.call(this)||this;n.decodeRowStringBuffer=``,t.L_AND_G_PATTERNS=t.L_PATTERNS.map(function(e){return Int32Array.from(e)});for(var r=10;r<20;r++){for(var i=t.L_PATTERNS[r-10],a=new Int32Array(i.length),o=0;o<i.length;o++)a[o]=i[i.length-o-1];t.L_AND_G_PATTERNS[r]=a}return n}return t.prototype.decodeRow=function(e,n,r){var i=t.findStartGuardPattern(n),a=r==null?null:r.get(j.NEED_RESULT_POINT_CALLBACK);if(a!=null){var o=new z((i[0]+i[1])/2,e);a.foundPossibleResultPoint(o)}var s=this.decodeMiddle(n,i,this.decodeRowStringBuffer),c=s.rowOffset,l=s.resultString;if(a!=null){var u=new z(c,e);a.foundPossibleResultPoint(u)}var d=t.decodeEnd(n,c);if(a!=null){var f=new z((d[0]+d[1])/2,e);a.foundPossibleResultPoint(f)}var p=d[1],m=p+(p-d[0]);if(m>=n.getSize()||!n.isRange(p,m,!1))throw new I;var h=l.toString();if(h.length<8)throw new M;if(!t.checkChecksum(h))throw new O;var g=(i[1]+i[0])/2,_=(d[1]+d[0])/2,v=this.getBarcodeFormat(),y=new Xe(h,null,0,[new z(g,e),new z(_,e)],v,new Date().getTime()),b=0;try{var x=Xt.decodeRow(e,n,d[1]);y.putMetadata($e.UPC_EAN_EXTENSION,x.getText()),y.putAllMetadata(x.getResultMetadata()),y.addResultPoints(x.getResultPoints()),b=x.getText().length}catch{}var S=r==null?null:r.get(j.ALLOWED_EAN_EXTENSIONS);if(S!=null){var C=!1;for(var w in S)if(b.toString()===w){C=!0;break}if(!C)throw new I}return v===L.EAN_13||L.UPC_A,y},t.checkChecksum=function(e){return t.checkStandardUPCEANChecksum(e)},t.checkStandardUPCEANChecksum=function(e){var n=e.length;if(n===0)return!1;var r=parseInt(e.charAt(n-1),10);return t.getStandardUPCEANChecksum(e.substring(0,n-1))===r},t.getStandardUPCEANChecksum=function(e){for(var t=e.length,n=0,r=t-1;r>=0;r-=2){var i=e.charAt(r).charCodeAt(0)-48;if(i<0||i>9)throw new M;n+=i}n*=3;for(var r=t-2;r>=0;r-=2){var i=e.charAt(r).charCodeAt(0)-48;if(i<0||i>9)throw new M;n+=i}return(1e3-n)%10},t.decodeEnd=function(e,n){return t.findGuardPattern(e,n,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t}(Gt),$t=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),en=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},tn=function(e){$t(t,e);function t(){var t=e.call(this)||this;return t.decodeMiddleCounters=Int32Array.from([0,0,0,0]),t}return t.prototype.decodeMiddle=function(e,n,r){var i,a,o,s,c=this.decodeMiddleCounters;c[0]=0,c[1]=0,c[2]=0,c[3]=0;for(var l=e.getSize(),u=n[1],d=0,f=0;f<6&&u<l;f++){var p=Qt.decodeDigit(e,c,u,Qt.L_AND_G_PATTERNS);r+=String.fromCharCode(48+p%10);try{for(var m=(i=void 0,en(c)),h=m.next();!h.done;h=m.next()){var g=h.value;u+=g}}catch(e){i={error:e}}finally{try{h&&!h.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}p>=10&&(d|=1<<5-f)}r=t.determineFirstDigit(r,d),u=Qt.findGuardPattern(e,u,!0,Qt.MIDDLE_PATTERN,new Int32Array(Qt.MIDDLE_PATTERN.length).fill(0))[1];for(var f=0;f<6&&u<l;f++){var p=Qt.decodeDigit(e,c,u,Qt.L_PATTERNS);r+=String.fromCharCode(48+p);try{for(var _=(o=void 0,en(c)),v=_.next();!v.done;v=_.next()){var g=v.value;u+=g}}catch(e){o={error:e}}finally{try{v&&!v.done&&(s=_.return)&&s.call(_)}finally{if(o)throw o.error}}}return{rowOffset:u,resultString:r}},t.prototype.getBarcodeFormat=function(){return L.EAN_13},t.determineFirstDigit=function(e,t){for(var n=0;n<10;n++)if(t===this.FIRST_DIGIT_ENCODINGS[n])return e=String.fromCharCode(48+n)+e,e;throw new I},t.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26],t}(Qt),nn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),rn=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},an=function(e){nn(t,e);function t(){var t=e.call(this)||this;return t.decodeMiddleCounters=Int32Array.from([0,0,0,0]),t}return t.prototype.decodeMiddle=function(e,t,n){var r,i,a,o,s=this.decodeMiddleCounters;s[0]=0,s[1]=0,s[2]=0,s[3]=0;for(var c=e.getSize(),l=t[1],u=0;u<4&&l<c;u++){var d=Qt.decodeDigit(e,s,l,Qt.L_PATTERNS);n+=String.fromCharCode(48+d);try{for(var f=(r=void 0,rn(s)),p=f.next();!p.done;p=f.next()){var m=p.value;l+=m}}catch(e){r={error:e}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}l=Qt.findGuardPattern(e,l,!0,Qt.MIDDLE_PATTERN,new Int32Array(Qt.MIDDLE_PATTERN.length).fill(0))[1];for(var u=0;u<4&&l<c;u++){var d=Qt.decodeDigit(e,s,l,Qt.L_PATTERNS);n+=String.fromCharCode(48+d);try{for(var h=(a=void 0,rn(s)),g=h.next();!g.done;g=h.next()){var m=g.value;l+=m}}catch(e){a={error:e}}finally{try{g&&!g.done&&(o=h.return)&&o.call(h)}finally{if(a)throw a.error}}}return{rowOffset:l,resultString:n}},t.prototype.getBarcodeFormat=function(){return L.EAN_8},t}(Qt),on=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),sn=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},cn=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},ln=function(e){on(t,e);function t(){var t=e.apply(this,cn([],sn(arguments),!1))||this;return t.ean13Reader=new tn,t}return t.prototype.getBarcodeFormat=function(){return L.UPC_A},t.prototype.decode=function(e,t){return this.maybeReturnResult(this.ean13Reader.decode(e))},t.prototype.decodeRow=function(e,t,n){return this.maybeReturnResult(this.ean13Reader.decodeRow(e,t,n))},t.prototype.decodeMiddle=function(e,t,n){return this.ean13Reader.decodeMiddle(e,t,n)},t.prototype.maybeReturnResult=function(e){var t=e.getText();if(t.charAt(0)===`0`){var n=new Xe(t.substring(1),null,null,e.getResultPoints(),L.UPC_A);return e.getResultMetadata()!=null&&n.putAllMetadata(e.getResultMetadata()),n}throw new I},t.prototype.reset=function(){this.ean13Reader.reset()},t}(Qt),un=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),dn=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},fn=function(e){un(t,e);function t(){var t=e.call(this)||this;return t.decodeMiddleCounters=new Int32Array(4),t}return t.prototype.decodeMiddle=function(e,n,r){var i,a,o=this.decodeMiddleCounters.map(function(e){return e});o[0]=0,o[1]=0,o[2]=0,o[3]=0;for(var s=e.getSize(),c=n[1],l=0,u=0;u<6&&c<s;u++){var d=t.decodeDigit(e,o,c,t.L_AND_G_PATTERNS);r+=String.fromCharCode(48+d%10);try{for(var f=(i=void 0,dn(o)),p=f.next();!p.done;p=f.next()){var m=p.value;c+=m}}catch(e){i={error:e}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}d>=10&&(l|=1<<5-u)}return t.determineNumSysAndCheckDigit(new F(r),l),c},t.prototype.decodeEnd=function(e,n){return t.findGuardPatternWithoutCounters(e,n,!0,t.MIDDLE_END_PATTERN)},t.prototype.checkChecksum=function(e){return Qt.checkChecksum(t.convertUPCEtoUPCA(e))},t.determineNumSysAndCheckDigit=function(e,t){for(var n=0;n<=1;n++)for(var r=0;r<10;r++)if(t===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[n][r]){e.insert(0,`0`+n),e.append(`0`+r);return}throw I.getNotFoundInstance()},t.prototype.getBarcodeFormat=function(){return L.UPC_E},t.convertUPCEtoUPCA=function(e){var t=e.slice(1,7).split(``).map(function(e){return e.charCodeAt(0)}),n=new F;n.append(e.charAt(0));var r=t[5];switch(r){case 0:case 1:case 2:n.appendChars(t,0,2),n.append(r),n.append(`0000`),n.appendChars(t,2,3);break;case 3:n.appendChars(t,0,3),n.append(`00000`),n.appendChars(t,3,2);break;case 4:n.appendChars(t,0,4),n.append(`00000`),n.append(t[4]);break;default:n.appendChars(t,0,5),n.append(`0000`),n.append(r)}return e.length>=8&&n.append(e.charAt(7)),n.toString()},t.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),t.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])],t}(Qt),pn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),mn=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},hn=function(e){pn(t,e);function t(t){var n=e.call(this)||this,r=t==null?null:t.get(j.POSSIBLE_FORMATS),i=[];return r!=null&&(r.indexOf(L.EAN_13)>-1&&i.push(new tn),r.indexOf(L.UPC_A)>-1&&i.push(new ln),r.indexOf(L.EAN_8)>-1&&i.push(new an),r.indexOf(L.UPC_E)>-1&&i.push(new fn)),i.length===0&&(i.push(new tn),i.push(new ln),i.push(new an),i.push(new fn)),n.readers=i,n}return t.prototype.decodeRow=function(e,t,n){var r,i;try{for(var a=mn(this.readers),o=a.next();!o.done;o=a.next()){var s=o.value;try{var c=s.decodeRow(e,t,n),l=c.getBarcodeFormat()===L.EAN_13&&c.getText().charAt(0)===`0`,u=n==null?null:n.get(j.POSSIBLE_FORMATS),d=u==null||u.includes(L.UPC_A);if(l&&d){var f=c.getRawBytes(),p=new Xe(c.getText().substring(1),f,f?f.length:null,c.getResultPoints(),L.UPC_A);return p.putAllMetadata(c.getResultMetadata()),p}return c}catch{}}}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}throw new I},t.prototype.reset=function(){var e,t;try{for(var n=mn(this.readers),r=n.next();!r.done;r=n.next())r.value.reset()}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},t}(Ot),gn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),_n=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},vn=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},yn=function(e){gn(t,e);function t(){var t=e.apply(this,vn([],_n(arguments),!1))||this;return t.CODA_BAR_CHAR_SET={nnnnnww:`0`,nnnnwwn:`1`,nnnwnnw:`2`,wwnnnnn:`3`,nnwnnwn:`4`,wnnnnwn:`5`,nwnnnnw:`6`,nwnnwnn:`7`,nwwnnnn:`8`,wnnwnnn:`9`,nnnwwnn:`-`,nnwwnnn:`$`,wnnnwnw:`:`,wnwnnnw:`/`,wnwnwnn:`.`,nnwwwww:`+`,nnwwnwn:`A`,nwnwnnw:`B`,nnnwnww:`C`,nnnwwwn:`D`},t}return t.prototype.decodeRow=function(e,t,n){var r=this.getValidRowData(t);if(!r)throw new I;var i=this.codaBarDecodeRow(r.row);if(!i)throw new I;return new Xe(i,null,0,[new z(r.left,e),new z(r.right,e)],L.CODABAR,new Date().getTime())},t.prototype.getValidRowData=function(e){var t=e.toArray(),n=t.indexOf(!0);if(n===-1)return null;var r=t.lastIndexOf(!0);if(r<=n)return null;t=t.slice(n,r+1);for(var i=[],a=t[0],o=1,s=1;s<t.length;s++)t[s]===a?o++:(a=t[s],i.push(o),o=1);return i.push(o),i.length<23&&(i.length+1)%8!=0?null:{row:i,left:n,right:r}},t.prototype.codaBarDecodeRow=function(e){for(var t=[],n=Math.ceil(e.reduce(function(e,t){return(e+t)/2},0));e.length>0;){var r=e.splice(0,8).splice(0,7).map(function(e){return e<n?`n`:`w`}).join(``);if(this.CODA_BAR_CHAR_SET[r]===void 0)return null;t.push(this.CODA_BAR_CHAR_SET[r])}var i=t.join(``);return this.validCodaBarString(i)?i:null},t.prototype.validCodaBarString=function(e){return/^[A-D].{1,}[A-D]$/.test(e)},t}(Ot),bn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),xn=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Sn=function(e){bn(t,e);function t(){var t=e.call(this)||this;return t.decodeFinderCounters=new Int32Array(4),t.dataCharacterCounters=new Int32Array(8),t.oddRoundingErrors=[,,,,],t.evenRoundingErrors=[,,,,],t.oddCounts=Array(Math.trunc(t.dataCharacterCounters.length/2)),t.evenCounts=Array(Math.trunc(t.dataCharacterCounters.length/2)),t}return t.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters},t.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters},t.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors},t.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors},t.prototype.getOddCounts=function(){return this.oddCounts},t.prototype.getEvenCounts=function(){return this.evenCounts},t.prototype.parseFinderValue=function(e,n){for(var r=0;r<n.length;r++)if(Ot.patternMatchVariance(e,n[r],t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return r;throw new I},t.count=function(e){return R.sum(new Int32Array(e))},t.increment=function(e,t){for(var n=0,r=t[0],i=1;i<e.length;i++)t[i]>r&&(r=t[i],n=i);e[n]++},t.decrement=function(e,t){for(var n=0,r=t[0],i=1;i<e.length;i++)t[i]<r&&(r=t[i],n=i);e[n]--},t.isFinderPattern=function(e){var n,r,i=e[0]+e[1],a=i/(i+e[2]+e[3]);if(a>=t.MIN_FINDER_PATTERN_RATIO&&a<=t.MAX_FINDER_PATTERN_RATIO){var o=2**53-1,s=-(2**53-1);try{for(var c=xn(e),l=c.next();!l.done;l=c.next()){var u=l.value;u>s&&(s=u),u<o&&(o=u)}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return s<10*o}return!1},t.MAX_AVG_VARIANCE=.2,t.MAX_INDIVIDUAL_VARIANCE=.45,t.MIN_FINDER_PATTERN_RATIO=9.5/12,t.MAX_FINDER_PATTERN_RATIO=12.5/14,t}(Ot),Cn=function(){function e(e,t){this.value=e,this.checksumPortion=t}return e.prototype.getValue=function(){return this.value},e.prototype.getChecksumPortion=function(){return this.checksumPortion},e.prototype.toString=function(){return this.value+`(`+this.checksumPortion+`)`},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.value===n.value&&this.checksumPortion===n.checksumPortion},e.prototype.hashCode=function(){return this.value^this.checksumPortion},e}(),wn=function(){function e(e,t,n,r,i){this.value=e,this.startEnd=t,this.resultPoints=[],this.resultPoints.push(new z(n,i)),this.resultPoints.push(new z(r,i))}return e.prototype.getValue=function(){return this.value},e.prototype.getStartEnd=function(){return this.startEnd},e.prototype.getResultPoints=function(){return this.resultPoints},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.value===n.value},e.prototype.hashCode=function(){return this.value},e}(),Tn=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},En=function(){function e(){}return e.getRSSvalue=function(t,n,r){var i,a,o=0;try{for(var s=Tn(t),c=s.next();!c.done;c=s.next()){var l=c.value;o+=l}}catch(e){i={error:e}}finally{try{c&&!c.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}for(var u=0,d=0,f=t.length,p=0;p<f-1;p++){var m=void 0;for(m=1,d|=1<<p;m<t[p];m++,d&=~(1<<p)){var h=e.combins(o-m-1,f-p-2);if(r&&d===0&&o-m-(f-p-1)>=f-p-1&&(h-=e.combins(o-m-(f-p),f-p-2)),f-p-1>1){for(var g=0,_=o-m-(f-p-2);_>n;_--)g+=e.combins(o-m-_-1,f-p-3);h-=g*(f-1-p)}else o-m>n&&h--;u+=h}o-=m}return u},e.combins=function(e,t){var n=0,r=0;e-t>t?(r=t,n=e-t):(r=e-t,n=t);for(var i=1,a=1,o=e;o>n;o--)i*=o,a<=r&&(i=Math.trunc(i/a),a++);for(;a<=r;)i=Math.trunc(i/a),a++;return i},e}(),Dn=function(){function e(){}return e.buildBitArray=function(e){var t=e.length*2-1;e[e.length-1].getRightChar()===null&&--t;for(var n=new Ee(12*t),r=0,i=e[0].getRightChar().getValue(),a=11;a>=0;--a)i&1<<a&&n.set(r),r++;for(var a=1;a<e.length;++a){for(var o=e[a],s=o.getLeftChar().getValue(),c=11;c>=0;--c)s&1<<c&&n.set(r),r++;if(o.getRightChar()!==null)for(var l=o.getRightChar().getValue(),c=11;c>=0;--c)l&1<<c&&n.set(r),r++}return n},e}(),On=function(){function e(e,t){this.decodedInformation=e||null,this.finished=!!t}return e.prototype.getDecodedInformation=function(){return this.decodedInformation},e.prototype.isFinished=function(){return this.finished},e}(),kn;(function(e){e[e.NUMERIC=0]=`NUMERIC`,e[e.ALPHA=1]=`ALPHA`,e[e.ISO_IEC_646=2]=`ISO_IEC_646`})(kn||={});var An=function(){function e(){this.position=0,this.encoding=kn.NUMERIC}return e.prototype.getPosition=function(){return this.position},e.prototype.setPosition=function(e){this.position=e},e.prototype.incrementPosition=function(e){this.position+=e},e.prototype.isAlpha=function(){return this.encoding===kn.ALPHA},e.prototype.isNumeric=function(){return this.encoding===kn.NUMERIC},e.prototype.isIsoIec646=function(){return this.encoding===kn.ISO_IEC_646},e.prototype.setNumeric=function(){this.encoding=kn.NUMERIC},e.prototype.setAlpha=function(){this.encoding=kn.ALPHA},e.prototype.setIsoIec646=function(){this.encoding=kn.ISO_IEC_646},e}(),jn=function(){function e(e){this.newPosition=e}return e.prototype.getNewPosition=function(){return this.newPosition},e}(),Mn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Nn=function(e){Mn(t,e);function t(t,n){var r=e.call(this,t)||this;return r.value=n,r}return t.prototype.getValue=function(){return this.value},t.prototype.isFNC1=function(){return this.value===t.FNC1},t.FNC1=`$`,t}(jn),Pn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Fn=function(e){Pn(t,e);function t(t,n,r){var i=e.call(this,t)||this;return i.newString=n,r===void 0?(i.remaining=!1,i.remainingValue=0):(i.remaining=!0,i.remainingValue=r),i}return t.prototype.getNewString=function(){return this.newString},t.prototype.isRemaining=function(){return this.remaining},t.prototype.getRemainingValue=function(){return this.remainingValue},t}(jn),In=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ln=function(e){In(t,e);function t(t,n,r){var i=e.call(this,t)||this;if(n<0||n>10||r<0||r>10)throw new M;return i.firstDigit=n,i.secondDigit=r,i}return t.prototype.getFirstDigit=function(){return this.firstDigit},t.prototype.getSecondDigit=function(){return this.secondDigit},t.prototype.getValue=function(){return this.firstDigit*10+this.secondDigit},t.prototype.isFirstDigitFNC1=function(){return this.firstDigit===t.FNC1},t.prototype.isSecondDigitFNC1=function(){return this.secondDigit===t.FNC1},t.FNC1=10,t}(jn),Rn=function(){function e(){}return e.fixed=function(t,n){return function(r){return e.processFixedAI(t,n,r)}},e.variable=function(t,n){return function(r){return e.processVariableAI(t,n,r)}},e.parseFieldsInGeneralPurpose=function(e){if(!e)return null;if(e.length<2)throw new I;var t=e.substring(0,2),n=this.TWO_DIGIT_DATA_LENGTH.get(t);if(n)return n(e);if(e.length<3)throw new I;var r=e.substring(0,3),i=this.THREE_DIGIT_DATA_LENGTH.get(r);if(i)return i(e);var a=this.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH.get(r);if(a)return a(e);if(e.length<4)throw new I;var o=e.substring(0,4),s=this.FOUR_DIGIT_DATA_LENGTH.get(o);if(s)return s(e);throw new I},e.processFixedAI=function(t,n,r){if(r.length<t)throw new I;var i=r.substring(0,t);if(r.length<t+n)throw new I;var a=r.substring(t,t+n),o=r.substring(t+n),s=`(`+i+`)`+a,c=e.parseFieldsInGeneralPurpose(o);return c===null?s:s+c},e.processVariableAI=function(t,n,r){var i=r.substring(0,t),a=r.length<t+n?r.length:t+n,o=r.substring(t,a),s=r.substring(a),c=`(`+i+`)`+o,l=e.parseFieldsInGeneralPurpose(s);return l===null?c:c+l},e.TWO_DIGIT_DATA_LENGTH=(function(){var t=new Map;t.set(`00`,e.fixed(2,18)),t.set(`01`,e.fixed(2,14)),t.set(`02`,e.fixed(2,14)),t.set(`10`,e.variable(2,20)),t.set(`11`,e.fixed(2,6)),t.set(`12`,e.fixed(2,6)),t.set(`13`,e.fixed(2,6)),t.set(`15`,e.fixed(2,6)),t.set(`16`,e.fixed(2,6)),t.set(`17`,e.fixed(2,6)),t.set(`20`,e.fixed(2,2)),t.set(`21`,e.variable(2,20)),t.set(`22`,e.variable(2,29)),t.set(`30`,e.variable(2,8)),t.set(`37`,e.variable(2,8));for(var n=90;n<=99;n++)t.set(String(n),e.variable(2,30));return t})(),e.THREE_DIGIT_DATA_LENGTH=new Map([[`235`,e.variable(3,28)],[`240`,e.variable(3,30)],[`241`,e.variable(3,30)],[`242`,e.variable(3,6)],[`243`,e.variable(3,20)],[`250`,e.variable(3,30)],[`251`,e.variable(3,30)],[`253`,e.variable(3,30)],[`254`,e.variable(3,20)],[`255`,e.variable(3,25)],[`400`,e.variable(3,30)],[`401`,e.variable(3,30)],[`402`,e.fixed(3,17)],[`403`,e.variable(3,30)],[`410`,e.fixed(3,13)],[`411`,e.fixed(3,13)],[`412`,e.fixed(3,13)],[`413`,e.fixed(3,13)],[`414`,e.fixed(3,13)],[`415`,e.fixed(3,13)],[`416`,e.fixed(3,13)],[`417`,e.fixed(3,13)],[`420`,e.variable(3,20)],[`421`,e.variable(3,15)],[`422`,e.fixed(3,3)],[`423`,e.variable(3,15)],[`424`,e.fixed(3,3)],[`425`,e.variable(3,15)],[`426`,e.fixed(3,3)],[`427`,e.variable(3,3)],[`710`,e.variable(3,20)],[`711`,e.variable(3,20)],[`712`,e.variable(3,20)],[`713`,e.variable(3,20)],[`714`,e.variable(3,20)],[`715`,e.variable(3,20)]]),e.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH=(function(){for(var t=new Map,n=310;n<=316;n++)t.set(String(n),e.fixed(4,6));for(var n=320;n<=337;n++)t.set(String(n),e.fixed(4,6));for(var n=340;n<=357;n++)t.set(String(n),e.fixed(4,6));for(var n=360;n<=369;n++)t.set(String(n),e.fixed(4,6));return t.set(`390`,e.variable(4,15)),t.set(`391`,e.variable(4,18)),t.set(`392`,e.variable(4,15)),t.set(`393`,e.variable(4,18)),t.set(`394`,e.fixed(4,4)),t.set(`395`,e.fixed(4,6)),t.set(`703`,e.variable(4,30)),t.set(`723`,e.variable(4,30)),t})(),e.FOUR_DIGIT_DATA_LENGTH=(function(){var t=new Map;return t.set(`4300`,e.variable(4,35)),t.set(`4301`,e.variable(4,35)),t.set(`4302`,e.variable(4,70)),t.set(`4303`,e.variable(4,70)),t.set(`4304`,e.variable(4,70)),t.set(`4305`,e.variable(4,70)),t.set(`4306`,e.variable(4,70)),t.set(`4307`,e.fixed(4,2)),t.set(`4308`,e.variable(4,30)),t.set(`4309`,e.fixed(4,20)),t.set(`4310`,e.variable(4,35)),t.set(`4311`,e.variable(4,35)),t.set(`4312`,e.variable(4,70)),t.set(`4313`,e.variable(4,70)),t.set(`4314`,e.variable(4,70)),t.set(`4315`,e.variable(4,70)),t.set(`4316`,e.variable(4,70)),t.set(`4317`,e.fixed(4,2)),t.set(`4318`,e.variable(4,20)),t.set(`4319`,e.variable(4,30)),t.set(`4320`,e.variable(4,35)),t.set(`4321`,e.fixed(4,1)),t.set(`4322`,e.fixed(4,1)),t.set(`4323`,e.fixed(4,1)),t.set(`4324`,e.fixed(4,10)),t.set(`4325`,e.fixed(4,10)),t.set(`4326`,e.fixed(4,6)),t.set(`7001`,e.fixed(4,13)),t.set(`7002`,e.variable(4,30)),t.set(`7003`,e.fixed(4,10)),t.set(`7004`,e.variable(4,4)),t.set(`7005`,e.variable(4,12)),t.set(`7006`,e.fixed(4,6)),t.set(`7007`,e.variable(4,12)),t.set(`7008`,e.variable(4,3)),t.set(`7009`,e.variable(4,10)),t.set(`7010`,e.variable(4,2)),t.set(`7011`,e.variable(4,10)),t.set(`7020`,e.variable(4,20)),t.set(`7021`,e.variable(4,20)),t.set(`7022`,e.variable(4,20)),t.set(`7023`,e.variable(4,30)),t.set(`7040`,e.fixed(4,4)),t.set(`7240`,e.variable(4,20)),t.set(`8001`,e.fixed(4,14)),t.set(`8002`,e.variable(4,20)),t.set(`8003`,e.variable(4,30)),t.set(`8004`,e.variable(4,30)),t.set(`8005`,e.fixed(4,6)),t.set(`8006`,e.fixed(4,18)),t.set(`8007`,e.variable(4,34)),t.set(`8008`,e.variable(4,12)),t.set(`8009`,e.variable(4,50)),t.set(`8010`,e.variable(4,30)),t.set(`8011`,e.variable(4,12)),t.set(`8012`,e.variable(4,20)),t.set(`8013`,e.variable(4,25)),t.set(`8017`,e.fixed(4,18)),t.set(`8018`,e.fixed(4,18)),t.set(`8019`,e.variable(4,10)),t.set(`8020`,e.variable(4,25)),t.set(`8026`,e.fixed(4,18)),t.set(`8100`,e.fixed(4,6)),t.set(`8101`,e.fixed(4,10)),t.set(`8102`,e.fixed(4,2)),t.set(`8110`,e.variable(4,70)),t.set(`8111`,e.fixed(4,4)),t.set(`8112`,e.variable(4,70)),t.set(`8200`,e.variable(4,70)),t})(),e}(),zn=function(){function e(e){this.current=new An,this.buffer=new F,this.information=e}return e.prototype.decodeAllCodes=function(e,t){var n=t,r=null;do{var i=this.decodeGeneralPurposeField(n,r),a=Rn.parseFieldsInGeneralPurpose(i.getNewString());if(a!==null&&e.append(a),r=i.isRemaining()?``+i.getRemainingValue():null,n===i.getNewPosition())break;n=i.getNewPosition()}while(1);return e.toString()},e.prototype.isStillNumeric=function(e){if(e+7>this.information.getSize())return e+4<=this.information.getSize();for(var t=e;t<e+3;++t)if(this.information.get(t))return!0;return this.information.get(e+3)},e.prototype.decodeNumeric=function(e){if(e+7>this.information.getSize()){var t=this.extractNumericValueFromBitArray(e,4);return t===0?new Ln(this.information.getSize(),Ln.FNC1,Ln.FNC1):new Ln(this.information.getSize(),t-1,Ln.FNC1)}var n=this.extractNumericValueFromBitArray(e,7),r=Math.trunc((n-8)/11),i=(n-8)%11;return new Ln(e+7,r,i)},e.prototype.extractNumericValueFromBitArray=function(t,n){return e.extractNumericValueFromBitArray(this.information,t,n)},e.extractNumericValueFromBitArray=function(e,t,n){for(var r=0,i=0;i<n;++i)e.get(t+i)&&(r|=1<<n-i-1);return r},e.prototype.decodeGeneralPurposeField=function(e,t){this.buffer.setLengthToZero(),t!==null&&this.buffer.append(t),this.current.setPosition(e);var n=this.parseBlocks();return n!==null&&n.isRemaining()?new Fn(this.current.getPosition(),this.buffer.toString(),n.getRemainingValue()):new Fn(this.current.getPosition(),this.buffer.toString())},e.prototype.parseBlocks=function(){var e=!1,t;do{var n=this.current.getPosition();if(this.current.isAlpha()?(t=this.parseAlphaBlock(),e=t.isFinished()):this.current.isIsoIec646()?(t=this.parseIsoIec646Block(),e=t.isFinished()):(t=this.parseNumericBlock(),e=t.isFinished()),n===this.current.getPosition()&&!e)break}while(!e);return t.getDecodedInformation()},e.prototype.parseNumericBlock=function(){for(;this.isStillNumeric(this.current.getPosition());){var e=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFirstDigitFNC1()){var t=void 0;return t=e.isSecondDigitFNC1()?new Fn(this.current.getPosition(),this.buffer.toString()):new Fn(this.current.getPosition(),this.buffer.toString(),e.getSecondDigit()),new On(t,!0)}if(this.buffer.append(``+e.getFirstDigit()),e.isSecondDigitFNC1()){var t=new Fn(this.current.getPosition(),this.buffer.toString());return new On(t,!0)}this.buffer.append(``+e.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new On},e.prototype.parseIsoIec646Block=function(){for(;this.isStillIsoIec646(this.current.getPosition());){var e=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFNC1())return new On(new Fn(this.current.getPosition(),this.buffer.toString()),!0);this.buffer.append(e.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setAlpha()),new On},e.prototype.parseAlphaBlock=function(){for(;this.isStillAlpha(this.current.getPosition());){var e=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFNC1())return new On(new Fn(this.current.getPosition(),this.buffer.toString()),!0);this.buffer.append(e.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setIsoIec646()),new On},e.prototype.isStillIsoIec646=function(e){if(e+5>this.information.getSize())return!1;var t=this.extractNumericValueFromBitArray(e,5);if(t>=5&&t<16)return!0;if(e+7>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(e,7);if(n>=64&&n<116)return!0;if(e+8>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(e,8);return r>=232&&r<253},e.prototype.decodeIsoIec646=function(e){var t=this.extractNumericValueFromBitArray(e,5);if(t===15)return new Nn(e+5,Nn.FNC1);if(t>=5&&t<15)return new Nn(e+5,String.fromCharCode(48+t-5));var n=this.extractNumericValueFromBitArray(e,7);if(n>=64&&n<90)return new Nn(e+7,String.fromCharCode(n+1));if(n>=90&&n<116)return new Nn(e+7,String.fromCharCode(n+7));var r=this.extractNumericValueFromBitArray(e,8),i;switch(r){case 232:i=`!`;break;case 233:i=`"`;break;case 234:i=`%`;break;case 235:i=`&`;break;case 236:i=`'`;break;case 237:i=`(`;break;case 238:i=`)`;break;case 239:i=`*`;break;case 240:i=`+`;break;case 241:i=`,`;break;case 242:i=`-`;break;case 243:i=`.`;break;case 244:i=`/`;break;case 245:i=`:`;break;case 246:i=`;`;break;case 247:i=`<`;break;case 248:i=`=`;break;case 249:i=`>`;break;case 250:i=`?`;break;case 251:i=`_`;break;case 252:i=` `;break;default:throw new M}return new Nn(e+8,i)},e.prototype.isStillAlpha=function(e){if(e+5>this.information.getSize())return!1;var t=this.extractNumericValueFromBitArray(e,5);if(t>=5&&t<16)return!0;if(e+6>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(e,6);return n>=16&&n<63},e.prototype.decodeAlphanumeric=function(e){var t=this.extractNumericValueFromBitArray(e,5);if(t===15)return new Nn(e+5,Nn.FNC1);if(t>=5&&t<15)return new Nn(e+5,String.fromCharCode(48+t-5));var n=this.extractNumericValueFromBitArray(e,6);if(n>=32&&n<58)return new Nn(e+6,String.fromCharCode(n+33));var r;switch(n){case 58:r=`*`;break;case 59:r=`,`;break;case 60:r=`-`;break;case 61:r=`.`;break;case 62:r=`/`;break;default:throw new ut(`Decoding invalid alphanumeric value: `+n)}return new Nn(e+6,r)},e.prototype.isAlphaTo646ToAlphaLatch=function(e){if(e+1>this.information.getSize())return!1;for(var t=0;t<5&&t+e<this.information.getSize();++t)if(t===2){if(!this.information.get(e+2))return!1}else if(this.information.get(e+t))return!1;return!0},e.prototype.isAlphaOr646ToNumericLatch=function(e){if(e+3>this.information.getSize())return!1;for(var t=e;t<e+3;++t)if(this.information.get(t))return!1;return!0},e.prototype.isNumericToAlphaNumericLatch=function(e){if(e+1>this.information.getSize())return!1;for(var t=0;t<4&&t+e<this.information.getSize();++t)if(this.information.get(e+t))return!1;return!0},e}(),Bn=function(){function e(e){this.information=e,this.generalDecoder=new zn(e)}return e.prototype.getInformation=function(){return this.information},e.prototype.getGeneralDecoder=function(){return this.generalDecoder},e}(),Vn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Hn=function(e){Vn(t,e);function t(t){return e.call(this,t)||this}return t.prototype.encodeCompressedGtin=function(e,t){e.append(`(01)`);var n=e.length();e.append(`9`),this.encodeCompressedGtinWithoutAI(e,t,n)},t.prototype.encodeCompressedGtinWithoutAI=function(e,n,r){for(var i=0;i<4;++i){var a=this.getGeneralDecoder().extractNumericValueFromBitArray(n+10*i,10);a<100&&e.append(`0`),a<10&&e.append(`0`),e.append(``+a)}t.appendCheckDigit(e,r)},t.appendCheckDigit=function(e,t){for(var n=0,r=0;r<13;r++){var i=e.charAt(r+t).charCodeAt(0)-48;n+=r&1?i:3*i}n=10-n%10,n===10&&(n=0),e.append(``+n)},t.GTIN_SIZE=40,t}(Bn),Un=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Wn=function(e){Un(t,e);function t(t){return e.call(this,t)||this}return t.prototype.parseInformation=function(){var e=new F;e.append(`(01)`);var n=e.length(),r=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE,4);return e.append(``+r),this.encodeCompressedGtinWithoutAI(e,t.HEADER_SIZE+4,n),this.getGeneralDecoder().decodeAllCodes(e,t.HEADER_SIZE+44)},t.HEADER_SIZE=4,t}(Hn),Gn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Kn=function(e){Gn(t,e);function t(t){return e.call(this,t)||this}return t.prototype.parseInformation=function(){var e=new F;return this.getGeneralDecoder().decodeAllCodes(e,t.HEADER_SIZE)},t.HEADER_SIZE=5,t}(Bn),qn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Jn=function(e){qn(t,e);function t(t){return e.call(this,t)||this}return t.prototype.encodeCompressedWeight=function(e,t,n){var r=this.getGeneralDecoder().extractNumericValueFromBitArray(t,n);this.addWeightCode(e,r);for(var i=this.checkWeight(r),a=1e5,o=0;o<5;++o)i<a&&e.append(`0`),a=Math.trunc(a/10);e.append(``+i)},t}(Hn),Yn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Xn=function(e){Yn(t,e);function t(t){return e.call(this,t)||this}return t.prototype.parseInformation=function(){if(this.getInformation().getSize()!==t.HEADER_SIZE+Jn.GTIN_SIZE+t.WEIGHT_SIZE)throw new I;var e=new F;return this.encodeCompressedGtin(e,t.HEADER_SIZE),this.encodeCompressedWeight(e,t.HEADER_SIZE+Jn.GTIN_SIZE,t.WEIGHT_SIZE),e.toString()},t.HEADER_SIZE=5,t.WEIGHT_SIZE=15,t}(Jn),Zn=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Qn=function(e){Zn(t,e);function t(t){return e.call(this,t)||this}return t.prototype.addWeightCode=function(e,t){e.append(`(3103)`)},t.prototype.checkWeight=function(e){return e},t}(Xn),$n=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),er=function(e){$n(t,e);function t(t){return e.call(this,t)||this}return t.prototype.addWeightCode=function(e,t){t<1e4?e.append(`(3202)`):e.append(`(3203)`)},t.prototype.checkWeight=function(e){return e<1e4?e:e-1e4},t}(Xn),tr=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),nr=function(e){tr(t,e);function t(t){return e.call(this,t)||this}return t.prototype.parseInformation=function(){if(this.getInformation().getSize()<t.HEADER_SIZE+Hn.GTIN_SIZE)throw new I;var e=new F;this.encodeCompressedGtin(e,t.HEADER_SIZE);var n=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+Hn.GTIN_SIZE,t.LAST_DIGIT_SIZE);e.append(`(392`),e.append(``+n),e.append(`)`);var r=this.getGeneralDecoder().decodeGeneralPurposeField(t.HEADER_SIZE+Hn.GTIN_SIZE+t.LAST_DIGIT_SIZE,null);return e.append(r.getNewString()),e.toString()},t.HEADER_SIZE=8,t.LAST_DIGIT_SIZE=2,t}(Hn),rr=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ir=function(e){rr(t,e);function t(t){return e.call(this,t)||this}return t.prototype.parseInformation=function(){if(this.getInformation().getSize()<t.HEADER_SIZE+Hn.GTIN_SIZE)throw new I;var e=new F;this.encodeCompressedGtin(e,t.HEADER_SIZE);var n=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+Hn.GTIN_SIZE,t.LAST_DIGIT_SIZE);e.append(`(393`),e.append(``+n),e.append(`)`);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+Hn.GTIN_SIZE+t.LAST_DIGIT_SIZE,t.FIRST_THREE_DIGITS_SIZE);r<100&&e.append(`0`),r<10&&e.append(`0`),e.append(``+r);var i=this.getGeneralDecoder().decodeGeneralPurposeField(t.HEADER_SIZE+Hn.GTIN_SIZE+t.LAST_DIGIT_SIZE+t.FIRST_THREE_DIGITS_SIZE,null);return e.append(i.getNewString()),e.toString()},t.HEADER_SIZE=8,t.LAST_DIGIT_SIZE=2,t.FIRST_THREE_DIGITS_SIZE=10,t}(Hn),ar=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),or=function(e){ar(t,e);function t(t,n,r){var i=e.call(this,t)||this;return i.dateCode=r,i.firstAIdigits=n,i}return t.prototype.parseInformation=function(){if(this.getInformation().getSize()!==t.HEADER_SIZE+t.GTIN_SIZE+t.WEIGHT_SIZE+t.DATE_SIZE)throw new I;var e=new F;return this.encodeCompressedGtin(e,t.HEADER_SIZE),this.encodeCompressedWeight(e,t.HEADER_SIZE+t.GTIN_SIZE,t.WEIGHT_SIZE),this.encodeCompressedDate(e,t.HEADER_SIZE+t.GTIN_SIZE+t.WEIGHT_SIZE),e.toString()},t.prototype.encodeCompressedDate=function(e,n){var r=this.getGeneralDecoder().extractNumericValueFromBitArray(n,t.DATE_SIZE);if(r!==38400){e.append(`(`),e.append(this.dateCode),e.append(`)`);var i=r%32;r=Math.trunc(r/32);var a=r%12+1;r=Math.trunc(r/12);var o=r;o<10&&e.append(`0`),e.append(``+o),a<10&&e.append(`0`),e.append(``+a),i<10&&e.append(`0`),e.append(``+i)}},t.prototype.addWeightCode=function(e,t){e.append(`(`),e.append(this.firstAIdigits),e.append(``+Math.trunc(t/1e5)),e.append(`)`)},t.prototype.checkWeight=function(e){return e%1e5},t.HEADER_SIZE=8,t.WEIGHT_SIZE=20,t.DATE_SIZE=16,t}(Jn);function sr(e){if(e.get(1))return new Wn(e);if(!e.get(2))return new Kn(e);switch(zn.extractNumericValueFromBitArray(e,1,4)){case 4:return new Qn(e);case 5:return new er(e)}switch(zn.extractNumericValueFromBitArray(e,1,5)){case 12:return new nr(e);case 13:return new ir(e)}switch(zn.extractNumericValueFromBitArray(e,1,7)){case 56:return new or(e,`310`,`11`);case 57:return new or(e,`320`,`11`);case 58:return new or(e,`310`,`13`);case 59:return new or(e,`320`,`13`);case 60:return new or(e,`310`,`15`);case 61:return new or(e,`320`,`15`);case 62:return new or(e,`310`,`17`);case 63:return new or(e,`320`,`17`)}throw new ut(`unknown decoder: `+e)}var cr=function(){function e(e,t,n){this.leftChar=e,this.rightChar=t,this.finderPattern=n}return e.prototype.getLeftChar=function(){return this.leftChar},e.prototype.getRightChar=function(){return this.rightChar},e.prototype.getFinderPattern=function(){return this.finderPattern},e.prototype.mustBeLast=function(){return this.rightChar===null},e.prototype.toString=function(){return`[ `+this.leftChar+`, `+this.rightChar+` : `+(this.finderPattern===null?`null`:this.finderPattern.getValue())+` ]`},e.equals=function(t,n){return n===null?t===null:n instanceof e&&(t.leftChar===null?n.leftChar===null:t.leftChar.equals(n.leftChar))&&(t.rightChar===null?n.rightChar===null:t.rightChar.equals(n.rightChar))&&(t.finderPattern===null?n.finderPattern===null:t.finderPattern.equals(n.finderPattern))},e.prototype.hashCode=function(){return e.hashNotNull(this.leftChar)^e.hashNotNull(this.rightChar)^e.hashNotNull(this.finderPattern)},e.hashNotNull=function(e){return e===null?0:e.hashCode()},e}(),lr=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},ur=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},dr=function(){function e(e,t){this.pairs=ur([],lr(e),!1),this.rowNumber=t}return e.prototype.getPairs=function(){return this.pairs},e.prototype.getRowNumber=function(){return this.rowNumber},e.prototype.isEquivalent=function(t){return e.listEquals(this.getPairs(),t)},e.prototype.toString=function(){return`{ `+this.pairs+` }`},e.equals=function(t,n){return t===null?n===null:n instanceof e&&e.listEquals(t.pairs,n.getPairs())},e.listEquals=function(e,t){return e.length===t.length&&e.every(function(e,n){var r=t[n];return cr.equals(e,r)})},e}(),fr=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),pr=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},mr=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},hr=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},gr=function(e){fr(t,e);function t(){var n=e.apply(this,mr([],pr(arguments),!1))||this;return n.pairs=Array(t.MAX_PAIRS),n.rows=[],n.startEnd=[0,0],n.startFromEven=!1,n}return t.prototype.decodeRow=function(e,n,r){this.startFromEven=!1;try{return t.constructResult(this.decodeRow2pairs(e,n))}catch(e){if(!(e instanceof I))throw e}return this.startFromEven=!0,t.constructResult(this.decodeRow2pairs(e,n))},t.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},t.prototype.decodeRow2pairs=function(e,n){this.pairs.length=0;for(var r=!1;!r;)try{this.pairs.push(this.retrieveNextPair(n,this.pairs,e))}catch(e){if(e instanceof I){if(this.pairs.length===0)throw e;r=!0}else throw e}if(this.checkChecksum()&&t.isValidSequence(this.pairs,!0))return this.pairs;var i=this.rows.length>0;if(this.storeRow(e),i){var a=this.checkRowsBoolean(!1);if(a!==null||(a=this.checkRowsBoolean(!0),a!==null))return a}throw new I},t.prototype.checkRowsBoolean=function(e){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,e&&this.rows.reverse();var t=null;try{t=this.checkRows([],0)}catch(e){if(!(e instanceof I))throw e}return e&&this.rows.reverse(),t},t.prototype.checkRows=function(e,n){for(var r,i=n;i<this.rows.length;i++){var a=this.rows[i];(r=this.pairs).push.apply(r,mr([],pr(a.getPairs()),!1));var o=a.getPairs().length;if(t.isValidSequence(this.pairs,!1)){if(this.checkChecksum())return this.pairs;e.push(a);try{return this.checkRows(e,i+1)}catch(t){if(t instanceof I)e.pop(),this.pairs.splice(this.pairs.length-o,o);else throw t}}else this.pairs.splice(this.pairs.length-o,o)}throw new I},t.isValidSequence=function(e,n){var r,i;try{for(var a=hr(t.FINDER_PATTERN_SEQUENCES),o=a.next();!o.done;o=a.next()){var s=o.value;if(n?e.length===s.length:e.length<=s.length){for(var c=!0,l=0;l<e.length;l++)if(e[l].getFinderPattern().getValue()!==s[l]){c=!1;break}if(c)return!0}}}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return!1},t.mayFollow=function(e,t){var n,r;if(e.length===0)return!0;try{for(var i=hr(this.FINDER_PATTERN_SEQUENCES),a=i.next();!a.done;a=i.next()){var o=a.value;if(e.length+1<=o.length){for(var s=e.length;s<o.length;s++)if(o[s]===t){for(var c=!0,l=0;l<e.length;l++)if(o[s-l-1]!==e[e.length-l-1].getFinderPattern().getValue()){c=!1;break}if(c)return!0}}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1},t.prototype.storeRow=function(e){for(var n=0,r=!1,i=!1;n<this.rows.length;){var a=this.rows[n];if(a.getRowNumber()>e){i=a.isEquivalent(this.pairs);break}r=a.isEquivalent(this.pairs),n++}i||r||t.isPartialRow(this.pairs,this.rows)||(this.rows.splice(n,0,new dr(this.pairs,e)),this.removePartialRows(this.pairs,this.rows))},t.prototype.removePartialRows=function(e,t){for(var n,r,i=t.length-1;i>=0;i--){var a=t[i];if(a.getPairs().length!==e.length){var o=!0,s=function(t){if(!e.some(function(e){return cr.equals(t,e)}))return o=!1,`break`};try{for(var c=(n=void 0,hr(a.getPairs())),l=c.next();!l.done;l=c.next()){var u=l.value;if(s(u)===`break`)break}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}o&&t.splice(i,1)}}},t.isPartialRow=function(e,t){var n,r,i,a,o,s;try{for(var c=hr(t),l=c.next();!l.done;l=c.next()){var u=l.value,d=!0;try{for(var f=(i=void 0,hr(e)),p=f.next();!p.done;p=f.next()){var m=p.value,h=!1;try{for(var g=(o=void 0,hr(u.getPairs())),_=g.next();!_.done;_=g.next()){var v=_.value;if(cr.equals(m,v)){h=!0;break}}}catch(e){o={error:e}}finally{try{_&&!_.done&&(s=g.return)&&s.call(g)}finally{if(o)throw o.error}}if(!h){d=!1;break}}}catch(e){i={error:e}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}if(d)return!0}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return!1},t.prototype.getRows=function(){return this.rows},t.constructResult=function(e){var t=sr(Dn.buildBitArray(e)).parseInformation(),n=e[0].getFinderPattern().getResultPoints(),r=e[e.length-1].getFinderPattern().getResultPoints();return new Xe(t,null,null,[n[0],n[1],r[0],r[1]],L.RSS_EXPANDED,null)},t.prototype.checkChecksum=function(){var e=this.pairs[0],t=e.getLeftChar(),n=e.getRightChar();if(n===null)return!1;for(var r=n.getChecksumPortion(),i=2,a=1;a<this.pairs.length;++a){var o=this.pairs[a];r+=o.getLeftChar().getChecksumPortion(),i++;var s=o.getRightChar();s!==null&&(r+=s.getChecksumPortion(),i++)}return r%=211,211*(i-4)+r===t.getValue()},t.getNextSecondBar=function(e,t){var n=0;return e.get(t)?(n=e.getNextUnset(t),n=e.getNextSet(n)):(n=e.getNextSet(t),n=e.getNextUnset(n)),n},t.prototype.retrieveNextPair=function(e,n,r){var i=n.length%2==0;this.startFromEven&&(i=!i);var a=null,o=null,s=!0,c=-1;do if(this.findNextPair(e,n,c),a=this.parseFoundFinderPattern(e,r,i,n),a===null)c=t.getNextSecondBar(e,this.startEnd[0]);else try{o=this.decodeDataCharacter(e,a,i,!0),s=!1}catch(n){if(n instanceof I)c=t.getNextSecondBar(e,this.startEnd[0]);else throw n}while(s);if(n.length>0&&n[n.length-1].mustBeLast())throw new I;var l=null;try{l=this.decodeDataCharacter(e,a,i,!1)}catch(e){if(e instanceof I)l=null;else throw e}return new cr(o,l,a)},t.prototype.findNextPair=function(e,n,r){var i=this.getDecodeFinderCounters();i[0]=0,i[1]=0,i[2]=0,i[3]=0;var a=e.getSize(),o=0;o=r>=0?r:n.length===0?0:n[n.length-1].getFinderPattern().getStartEnd()[1];var s=n.length%2!=0;this.startFromEven&&(s=!s);for(var c=!1;o<a&&(c=!e.get(o),c);)o++;for(var l=0,u=o,d=o;d<a;d++)if(e.get(d)!==c)i[l]++;else{if(l===3){if(s&&t.reverseCounters(i),t.isFinderPattern(i)){this.startEnd[0]=u,this.startEnd[1]=d;return}s&&t.reverseCounters(i),u+=i[0]+i[1],i[0]=i[2],i[1]=i[3],i[2]=0,i[3]=0,l--}else l++;i[l]=1,c=!c}throw new I},t.reverseCounters=function(e){for(var t=e.length,n=0;n<Math.trunc(t/2);++n){var r=e[n];e[n]=e[t-n-1],e[t-n-1]=r}},t.prototype.parseFoundFinderPattern=function(e,n,r,i){var a=0,o=0,s=0;if(r){for(var c=this.startEnd[0]-1;c>=0&&!e.get(c);)c--;c++,a=this.startEnd[0]-c,o=c,s=this.startEnd[1]}else o=this.startEnd[0],s=e.getNextUnset(this.startEnd[1]+1),a=s-this.startEnd[1];var l=this.getDecodeFinderCounters();k.arraycopy(l,0,l,1,l.length-1),l[0]=a;var u=0;try{u=this.parseFinderValue(l,t.FINDER_PATTERNS)}catch(e){if(e instanceof I)return null;throw e}if(!t.mayFollow(i,u))return null;if(i.length>0){var d=i[i.length-1],f=d.getFinderPattern().getStartEnd()[0],p=d.getFinderPattern().getStartEnd()[1],m=(p-f)/t.FINDER_PATTERN_MODULES*t.DATA_CHARACTER_MODULES,h=p+2*m*(1-t.MAX_FINDER_PATTERN_DISTANCE_VARIANCE),g=p+2*m*(1+t.MAX_FINDER_PATTERN_DISTANCE_VARIANCE);if(o<h||o>g)return null}return new wn(u,[o,s],o,s,n)},t.prototype.decodeDataCharacter=function(e,n,r,i){for(var a=this.getDataCharacterCounters(),o=0;o<a.length;o++)a[o]=0;if(i)t.recordPatternInReverse(e,n.getStartEnd()[0],a);else{t.recordPattern(e,n.getStartEnd()[1],a);for(var s=0,c=a.length-1;s<c;s++,c--){var l=a[s];a[s]=a[c],a[c]=l}}var u=17,d=R.sum(new Int32Array(a))/u,f=(n.getStartEnd()[1]-n.getStartEnd()[0])/15;if(Math.abs(d-f)/f>.3)throw new I;for(var p=this.getOddCounts(),m=this.getEvenCounts(),h=this.getOddRoundingErrors(),g=this.getEvenRoundingErrors(),s=0;s<a.length;s++){var _=1*a[s]/d,v=Math.trunc(_+.5);if(v<1){if(_<.3)throw new I;v=1}else if(v>8){if(_>8.7)throw new I;v=8}var y=Math.trunc(s/2);s&1?(m[y]=v,g[y]=_-v):(p[y]=v,h[y]=_-v)}this.adjustOddEvenCounts(u);for(var b=4*n.getValue()+(r?0:2)+ +!i-1,x=0,S=0,s=p.length-1;s>=0;s--){if(t.isNotA1left(n,r,i)){var C=t.WEIGHTS[b][2*s];S+=p[s]*C}x+=p[s]}for(var w=0,s=m.length-1;s>=0;s--)if(t.isNotA1left(n,r,i)){var C=t.WEIGHTS[b][2*s+1];w+=m[s]*C}var T=S+w;if(x&1||x>13||x<4)throw new I;var E=Math.trunc((13-x)/2),ee=t.SYMBOL_WIDEST[E],te=9-ee,ne=En.getRSSvalue(p,ee,!0),re=En.getRSSvalue(m,te,!1),ie=t.EVEN_TOTAL_SUBSET[E],ae=t.GSUM[E];return new Cn(ne*ie+re+ae,T)},t.isNotA1left=function(e,t,n){return!(e.getValue()===0&&t&&n)},t.prototype.adjustOddEvenCounts=function(e){var n=R.sum(new Int32Array(this.getOddCounts())),r=R.sum(new Int32Array(this.getEvenCounts())),i=!1,a=!1;n>13?a=!0:n<4&&(i=!0);var o=!1,s=!1;r>13?s=!0:r<4&&(o=!0);var c=n+r-e,l=(n&1)==1,u=!(r&1);if(c===1){if(l){if(u)throw new I;a=!0}else{if(!u)throw new I;s=!0}}else if(c===-1){if(l){if(u)throw new I;i=!0}else{if(!u)throw new I;o=!0}}else if(c===0){if(l){if(!u)throw new I;n<r?(i=!0,s=!0):(a=!0,o=!0)}else if(u)throw new I}else throw new I;if(i){if(a)throw new I;t.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(a&&t.decrement(this.getOddCounts(),this.getOddRoundingErrors()),o){if(s)throw new I;t.increment(this.getEvenCounts(),this.getOddRoundingErrors())}s&&t.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},t.SYMBOL_WIDEST=[7,5,4,3,1],t.EVEN_TOTAL_SUBSET=[4,20,52,104,204],t.GSUM=[0,348,1388,2948,3988],t.FINDER_PATTERNS=[Int32Array.from([1,8,4,1]),Int32Array.from([3,6,4,1]),Int32Array.from([3,4,6,1]),Int32Array.from([3,2,8,1]),Int32Array.from([2,6,5,1]),Int32Array.from([2,2,9,1])],t.WEIGHTS=[[1,3,9,27,81,32,96,77],[20,60,180,118,143,7,21,63],[189,145,13,39,117,140,209,205],[193,157,49,147,19,57,171,91],[62,186,136,197,169,85,44,132],[185,133,188,142,4,12,36,108],[113,128,173,97,80,29,87,50],[150,28,84,41,123,158,52,156],[46,138,203,187,139,206,196,166],[76,17,51,153,37,111,122,155],[43,129,176,106,107,110,119,146],[16,48,144,10,30,90,59,177],[109,116,137,200,178,112,125,164],[70,210,208,202,184,130,179,115],[134,191,151,31,93,68,204,190],[148,22,66,198,172,94,71,2],[6,18,54,162,64,192,154,40],[120,149,25,75,14,42,126,167],[79,26,78,23,69,207,199,175],[103,98,83,38,114,131,182,124],[161,61,183,127,170,88,53,159],[55,165,73,8,24,72,5,15],[45,135,194,160,58,174,100,89]],t.FINDER_PAT_A=0,t.FINDER_PAT_B=1,t.FINDER_PAT_C=2,t.FINDER_PAT_D=3,t.FINDER_PAT_E=4,t.FINDER_PAT_F=5,t.FINDER_PATTERN_SEQUENCES=[[t.FINDER_PAT_A,t.FINDER_PAT_A],[t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B],[t.FINDER_PAT_A,t.FINDER_PAT_C,t.FINDER_PAT_B,t.FINDER_PAT_D],[t.FINDER_PAT_A,t.FINDER_PAT_E,t.FINDER_PAT_B,t.FINDER_PAT_D,t.FINDER_PAT_C],[t.FINDER_PAT_A,t.FINDER_PAT_E,t.FINDER_PAT_B,t.FINDER_PAT_D,t.FINDER_PAT_D,t.FINDER_PAT_F],[t.FINDER_PAT_A,t.FINDER_PAT_E,t.FINDER_PAT_B,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_F,t.FINDER_PAT_F],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_D],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_E],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_F,t.FINDER_PAT_F],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_E,t.FINDER_PAT_F,t.FINDER_PAT_F]],t.MAX_PAIRS=11,t.FINDER_PATTERN_MODULES=15,t.DATA_CHARACTER_MODULES=17,t.MAX_FINDER_PATTERN_DISTANCE_VARIANCE=.1,t}(Sn),_r=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),vr=function(e){_r(t,e);function t(t,n,r){var i=e.call(this,t,n)||this;return i.count=0,i.finderPattern=r,i}return t.prototype.getFinderPattern=function(){return this.finderPattern},t.prototype.getCount=function(){return this.count},t.prototype.incrementCount=function(){this.count++},t}(Cn),yr=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),br=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},xr=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},Sr=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Cr=function(e){yr(t,e);function t(){var t=e.apply(this,xr([],br(arguments),!1))||this;return t.possibleLeftPairs=[],t.possibleRightPairs=[],t}return t.prototype.decodeRow=function(e,n,r){var i,a,o,s,c=this.decodePair(n,!1,e,r);t.addOrTally(this.possibleLeftPairs,c),n.reverse();var l=this.decodePair(n,!0,e,r);t.addOrTally(this.possibleRightPairs,l),n.reverse();try{for(var u=Sr(this.possibleLeftPairs),d=u.next();!d.done;d=u.next()){var f=d.value;if(f.getCount()>1)try{for(var p=(o=void 0,Sr(this.possibleRightPairs)),m=p.next();!m.done;m=p.next()){var h=m.value;if(h.getCount()>1&&t.checkChecksum(f,h))return t.constructResult(f,h)}}catch(e){o={error:e}}finally{try{m&&!m.done&&(s=p.return)&&s.call(p)}finally{if(o)throw o.error}}}}catch(e){i={error:e}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(i)throw i.error}}throw new I},t.addOrTally=function(e,t){var n,r;if(t!==null){var i=!1;try{for(var a=Sr(e),o=a.next();!o.done;o=a.next()){var s=o.value;if(s.getValue()===t.getValue()){s.incrementCount(),i=!0;break}}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}i||e.push(t)}},t.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},t.constructResult=function(e,t){for(var n=4537077*e.getValue()+t.getValue(),r=String(n),i=new F,a=13-r.length;a>0;a--)i.append(`0`);i.append(r);for(var o=0,a=0;a<13;a++){var s=i.charAt(a).charCodeAt(0)-48;o+=a&1?s:3*s}o=10-o%10,o===10&&(o=0),i.append(o.toString());var c=e.getFinderPattern().getResultPoints(),l=t.getFinderPattern().getResultPoints();return new Xe(i.toString(),null,0,[c[0],c[1],l[0],l[1]],L.RSS_14,new Date().getTime())},t.checkChecksum=function(e,t){var n=(e.getChecksumPortion()+16*t.getChecksumPortion())%79,r=9*e.getFinderPattern().getValue()+t.getFinderPattern().getValue();return r>72&&r--,r>8&&r--,n===r},t.prototype.decodePair=function(e,t,n,r){try{var i=this.findFinderPattern(e,t),a=this.parseFoundFinderPattern(e,n,t,i),o=r==null?null:r.get(j.NEED_RESULT_POINT_CALLBACK);if(o!=null){var s=(i[0]+i[1]-1)/2;t&&(s=e.getSize()-1-s),o.foundPossibleResultPoint(new z(s,n))}var c=this.decodeDataCharacter(e,a,!0),l=this.decodeDataCharacter(e,a,!1);return new vr(1597*c.getValue()+l.getValue(),c.getChecksumPortion()+4*l.getChecksumPortion(),a)}catch(e){if(e instanceof I)return null;throw e}},t.prototype.decodeDataCharacter=function(e,n,r){for(var i=this.getDataCharacterCounters(),a=0;a<i.length;a++)i[a]=0;if(r)Ot.recordPatternInReverse(e,n.getStartEnd()[0],i);else{Ot.recordPattern(e,n.getStartEnd()[1],i);for(var o=0,s=i.length-1;o<s;o++,s--){var c=i[o];i[o]=i[s],i[s]=c}}for(var l=r?16:15,u=R.sum(new Int32Array(i))/l,d=this.getOddCounts(),f=this.getEvenCounts(),p=this.getOddRoundingErrors(),m=this.getEvenRoundingErrors(),o=0;o<i.length;o++){var h=i[o]/u,g=Math.floor(h+.5);g<1?g=1:g>8&&(g=8);var _=Math.floor(o/2);o&1?(f[_]=g,m[_]=h-g):(d[_]=g,p[_]=h-g)}this.adjustOddEvenCounts(r,l);for(var v=0,y=0,o=d.length-1;o>=0;o--)y*=9,y+=d[o],v+=d[o];for(var b=0,x=0,o=f.length-1;o>=0;o--)b*=9,b+=f[o],x+=f[o];var S=y+3*b;if(r){if(v&1||v>12||v<4)throw new I;var C=(12-v)/2,w=t.OUTSIDE_ODD_WIDEST[C],T=9-w,E=En.getRSSvalue(d,w,!1),ee=En.getRSSvalue(f,T,!0),te=t.OUTSIDE_EVEN_TOTAL_SUBSET[C],ne=t.OUTSIDE_GSUM[C];return new Cn(E*te+ee+ne,S)}if(x&1||x>10||x<4)throw new I;var C=(10-x)/2,w=t.INSIDE_ODD_WIDEST[C],T=9-w,E=En.getRSSvalue(d,w,!0),ee=En.getRSSvalue(f,T,!1),re=t.INSIDE_ODD_TOTAL_SUBSET[C],ne=t.INSIDE_GSUM[C];return new Cn(ee*re+E+ne,S)},t.prototype.findFinderPattern=function(e,t){var n=this.getDecodeFinderCounters();n[0]=0,n[1]=0,n[2]=0,n[3]=0;for(var r=e.getSize(),i=!1,a=0;a<r&&(i=!e.get(a),t!==i);)a++;for(var o=0,s=a,c=a;c<r;c++)if(e.get(c)!==i)n[o]++;else{if(o===3){if(Sn.isFinderPattern(n))return[s,c];s+=n[0]+n[1],n[0]=n[2],n[1]=n[3],n[2]=0,n[3]=0,o--}else o++;n[o]=1,i=!i}throw new I},t.prototype.parseFoundFinderPattern=function(e,n,r,i){for(var a=e.get(i[0]),o=i[0]-1;o>=0&&a!==e.get(o);)o--;o++;var s=i[0]-o,c=this.getDecodeFinderCounters(),l=new Int32Array(c.length);k.arraycopy(c,0,l,1,c.length-1),l[0]=s;var u=this.parseFinderValue(l,t.FINDER_PATTERNS),d=o,f=i[1];return r&&(d=e.getSize()-1-d,f=e.getSize()-1-f),new wn(u,[o,i[1]],d,f,n)},t.prototype.adjustOddEvenCounts=function(e,t){var n=R.sum(new Int32Array(this.getOddCounts())),r=R.sum(new Int32Array(this.getEvenCounts())),i=!1,a=!1,o=!1,s=!1;e?(n>12?a=!0:n<4&&(i=!0),r>12?s=!0:r<4&&(o=!0)):(n>11?a=!0:n<5&&(i=!0),r>10?s=!0:r<4&&(o=!0));var c=n+r-t,l=(n&1)==+!!e,u=(r&1)==1;if(c===1){if(l){if(u)throw new I;a=!0}else{if(!u)throw new I;s=!0}}else if(c===-1){if(l){if(u)throw new I;i=!0}else{if(!u)throw new I;o=!0}}else if(c===0){if(l){if(!u)throw new I;n<r?(i=!0,s=!0):(a=!0,o=!0)}else if(u)throw new I}else throw new I;if(i){if(a)throw new I;Sn.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(a&&Sn.decrement(this.getOddCounts(),this.getOddRoundingErrors()),o){if(s)throw new I;Sn.increment(this.getEvenCounts(),this.getOddRoundingErrors())}s&&Sn.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},t.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],t.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],t.OUTSIDE_GSUM=[0,161,961,2015,2715],t.INSIDE_GSUM=[0,336,1036,1516],t.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],t.INSIDE_ODD_WIDEST=[2,4,6,8],t.FINDER_PATTERNS=[Int32Array.from([3,8,2,1]),Int32Array.from([3,5,5,1]),Int32Array.from([3,3,7,1]),Int32Array.from([3,1,9,1]),Int32Array.from([2,7,4,1]),Int32Array.from([2,5,6,1]),Int32Array.from([2,3,8,1]),Int32Array.from([1,5,7,1]),Int32Array.from([1,3,9,1])],t}(Sn),wr=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Tr=function(e){wr(t,e);function t(t){var n=e.call(this)||this;n.readers=[];var r=t?t.get(j.POSSIBLE_FORMATS):null,i=t&&t.get(j.ASSUME_CODE_39_CHECK_DIGIT)!==void 0,a=t&&t.get(j.ENABLE_CODE_39_EXTENDED_MODE)!==void 0;return r&&((r.includes(L.EAN_13)||r.includes(L.UPC_A)||r.includes(L.EAN_8)||r.includes(L.UPC_E))&&n.readers.push(new hn(t)),r.includes(L.CODE_39)&&n.readers.push(new Nt(i,a)),r.includes(L.CODE_93)&&n.readers.push(new It),r.includes(L.CODE_128)&&n.readers.push(new At),r.includes(L.ITF)&&n.readers.push(new Vt),r.includes(L.CODABAR)&&n.readers.push(new yn),r.includes(L.RSS_14)&&n.readers.push(new Cr),r.includes(L.RSS_EXPANDED)&&(console.warn(`RSS Expanded reader IS NOT ready for production yet! use at your own risk.`),n.readers.push(new gr))),n.readers.length===0&&(n.readers.push(new hn(t)),n.readers.push(new Nt),n.readers.push(new It),n.readers.push(new hn(t)),n.readers.push(new At),n.readers.push(new Vt),n.readers.push(new Cr),n.readers.push(new gr)),n}return t.prototype.decodeRow=function(e,t,n){for(var r=0;r<this.readers.length;r++)try{return this.readers[r].decodeRow(e,t,n)}catch{}throw new I},t.prototype.reset=function(){this.readers.forEach(function(e){return e.reset()})},t}(Ot),Er=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){Er(t,e);function t(t,n){return t===void 0&&(t=500),e.call(this,new Tr(n),t,n)||this}return t})(Ye);var Dr=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},B=function(){function e(e,t,n){this.ecCodewords=e,this.ecBlocks=[t],n&&this.ecBlocks.push(n)}return e.prototype.getECCodewords=function(){return this.ecCodewords},e.prototype.getECBlocks=function(){return this.ecBlocks},e}(),V=function(){function e(e,t){this.count=e,this.dataCodewords=t}return e.prototype.getCount=function(){return this.count},e.prototype.getDataCodewords=function(){return this.dataCodewords},e}(),Or=function(){function e(e,t,n,r,i,a){var o,s;this.versionNumber=e,this.symbolSizeRows=t,this.symbolSizeColumns=n,this.dataRegionSizeRows=r,this.dataRegionSizeColumns=i,this.ecBlocks=a;var c=0,l=a.getECCodewords(),u=a.getECBlocks();try{for(var d=Dr(u),f=d.next();!f.done;f=d.next()){var p=f.value;c+=p.getCount()*(p.getDataCodewords()+l)}}catch(e){o={error:e}}finally{try{f&&!f.done&&(s=d.return)&&s.call(d)}finally{if(o)throw o.error}}this.totalCodewords=c}return e.prototype.getVersionNumber=function(){return this.versionNumber},e.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},e.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},e.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},e.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},e.prototype.getTotalCodewords=function(){return this.totalCodewords},e.prototype.getECBlocks=function(){return this.ecBlocks},e.getVersionForDimensions=function(t,n){var r,i;if(t&1||n&1)throw new M;try{for(var a=Dr(e.VERSIONS),o=a.next();!o.done;o=a.next()){var s=o.value;if(s.symbolSizeRows===t&&s.symbolSizeColumns===n)return s}}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}throw new M},e.prototype.toString=function(){return``+this.versionNumber},e.buildVersions=function(){return[new e(1,10,10,8,8,new B(5,new V(1,3))),new e(2,12,12,10,10,new B(7,new V(1,5))),new e(3,14,14,12,12,new B(10,new V(1,8))),new e(4,16,16,14,14,new B(12,new V(1,12))),new e(5,18,18,16,16,new B(14,new V(1,18))),new e(6,20,20,18,18,new B(18,new V(1,22))),new e(7,22,22,20,20,new B(20,new V(1,30))),new e(8,24,24,22,22,new B(24,new V(1,36))),new e(9,26,26,24,24,new B(28,new V(1,44))),new e(10,32,32,14,14,new B(36,new V(1,62))),new e(11,36,36,16,16,new B(42,new V(1,86))),new e(12,40,40,18,18,new B(48,new V(1,114))),new e(13,44,44,20,20,new B(56,new V(1,144))),new e(14,48,48,22,22,new B(68,new V(1,174))),new e(15,52,52,24,24,new B(42,new V(2,102))),new e(16,64,64,14,14,new B(56,new V(2,140))),new e(17,72,72,16,16,new B(36,new V(4,92))),new e(18,80,80,18,18,new B(48,new V(4,114))),new e(19,88,88,20,20,new B(56,new V(4,144))),new e(20,96,96,22,22,new B(68,new V(4,174))),new e(21,104,104,24,24,new B(56,new V(6,136))),new e(22,120,120,18,18,new B(68,new V(6,175))),new e(23,132,132,20,20,new B(62,new V(8,163))),new e(24,144,144,22,22,new B(62,new V(8,156),new V(2,155))),new e(25,8,18,6,16,new B(7,new V(1,5))),new e(26,8,32,6,14,new B(11,new V(1,10))),new e(27,12,26,10,24,new B(14,new V(1,16))),new e(28,12,36,10,16,new B(18,new V(1,22))),new e(29,16,36,14,16,new B(24,new V(1,32))),new e(30,16,48,14,22,new B(28,new V(1,49)))]},e.VERSIONS=e.buildVersions(),e}(),kr=function(){function e(t){var n=t.getHeight();if(n<8||n>144||n&1)throw new M;this.version=e.readVersion(t),this.mappingBitMatrix=this.extractDataRegion(t),this.readMappingMatrix=new Pe(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return e.prototype.getVersion=function(){return this.version},e.readVersion=function(e){var t=e.getHeight(),n=e.getWidth();return Or.getVersionForDimensions(t,n)},e.prototype.readCodewords=function(){var e=new Int8Array(this.version.getTotalCodewords()),t=0,n=4,r=0,i=this.mappingBitMatrix.getHeight(),a=this.mappingBitMatrix.getWidth(),o=!1,s=!1,c=!1,l=!1;do if(n===i&&r===0&&!o)e[t++]=this.readCorner1(i,a)&255,n-=2,r+=2,o=!0;else if(n===i-2&&r===0&&a&3&&!s)e[t++]=this.readCorner2(i,a)&255,n-=2,r+=2,s=!0;else if(n===i+4&&r===2&&!(a&7)&&!c)e[t++]=this.readCorner3(i,a)&255,n-=2,r+=2,c=!0;else if(n===i-2&&r===0&&(a&7)==4&&!l)e[t++]=this.readCorner4(i,a)&255,n-=2,r+=2,l=!0;else{do n<i&&r>=0&&!this.readMappingMatrix.get(r,n)&&(e[t++]=this.readUtah(n,r,i,a)&255),n-=2,r+=2;while(n>=0&&r<a);n+=1,r+=3;do n>=0&&r<a&&!this.readMappingMatrix.get(r,n)&&(e[t++]=this.readUtah(n,r,i,a)&255),n+=2,r-=2;while(n<i&&r>=0);n+=3,r+=1}while(n<i||r<a);if(t!==this.version.getTotalCodewords())throw new M;return e},e.prototype.readModule=function(e,t,n,r){return e<0&&(e+=n,t+=4-(n+4&7)),t<0&&(t+=r,e+=4-(r+4&7)),this.readMappingMatrix.set(t,e),this.mappingBitMatrix.get(t,e)},e.prototype.readUtah=function(e,t,n,r){var i=0;return this.readModule(e-2,t-2,n,r)&&(i|=1),i<<=1,this.readModule(e-2,t-1,n,r)&&(i|=1),i<<=1,this.readModule(e-1,t-2,n,r)&&(i|=1),i<<=1,this.readModule(e-1,t-1,n,r)&&(i|=1),i<<=1,this.readModule(e-1,t,n,r)&&(i|=1),i<<=1,this.readModule(e,t-2,n,r)&&(i|=1),i<<=1,this.readModule(e,t-1,n,r)&&(i|=1),i<<=1,this.readModule(e,t,n,r)&&(i|=1),i},e.prototype.readCorner1=function(e,t){var n=0;return this.readModule(e-1,0,e,t)&&(n|=1),n<<=1,this.readModule(e-1,1,e,t)&&(n|=1),n<<=1,this.readModule(e-1,2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-1,e,t)&&(n|=1),n<<=1,this.readModule(1,t-1,e,t)&&(n|=1),n<<=1,this.readModule(2,t-1,e,t)&&(n|=1),n<<=1,this.readModule(3,t-1,e,t)&&(n|=1),n},e.prototype.readCorner2=function(e,t){var n=0;return this.readModule(e-3,0,e,t)&&(n|=1),n<<=1,this.readModule(e-2,0,e,t)&&(n|=1),n<<=1,this.readModule(e-1,0,e,t)&&(n|=1),n<<=1,this.readModule(0,t-4,e,t)&&(n|=1),n<<=1,this.readModule(0,t-3,e,t)&&(n|=1),n<<=1,this.readModule(0,t-2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-1,e,t)&&(n|=1),n<<=1,this.readModule(1,t-1,e,t)&&(n|=1),n},e.prototype.readCorner3=function(e,t){var n=0;return this.readModule(e-1,0,e,t)&&(n|=1),n<<=1,this.readModule(e-1,t-1,e,t)&&(n|=1),n<<=1,this.readModule(0,t-3,e,t)&&(n|=1),n<<=1,this.readModule(0,t-2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-1,e,t)&&(n|=1),n<<=1,this.readModule(1,t-3,e,t)&&(n|=1),n<<=1,this.readModule(1,t-2,e,t)&&(n|=1),n<<=1,this.readModule(1,t-1,e,t)&&(n|=1),n},e.prototype.readCorner4=function(e,t){var n=0;return this.readModule(e-3,0,e,t)&&(n|=1),n<<=1,this.readModule(e-2,0,e,t)&&(n|=1),n<<=1,this.readModule(e-1,0,e,t)&&(n|=1),n<<=1,this.readModule(0,t-2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-1,e,t)&&(n|=1),n<<=1,this.readModule(1,t-1,e,t)&&(n|=1),n<<=1,this.readModule(2,t-1,e,t)&&(n|=1),n<<=1,this.readModule(3,t-1,e,t)&&(n|=1),n},e.prototype.extractDataRegion=function(e){var t=this.version.getSymbolSizeRows(),n=this.version.getSymbolSizeColumns();if(e.getHeight()!==t)throw new D(`Dimension of bitMatrix must match the version size`);for(var r=this.version.getDataRegionSizeRows(),i=this.version.getDataRegionSizeColumns(),a=t/r|0,o=n/i|0,s=a*r,c=new Pe(o*i,s),l=0;l<a;++l)for(var u=l*r,d=0;d<o;++d)for(var f=d*i,p=0;p<r;++p)for(var m=l*(r+2)+1+p,h=u+p,g=0;g<i;++g){var _=d*(i+2)+1+g;if(e.get(_,m)){var v=f+g;c.set(v,h)}}return c},e}(),Ar=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},jr=function(){function e(e,t){this.numDataCodewords=e,this.codewords=t}return e.getDataBlocks=function(t,n){var r,i,a,o,s=n.getECBlocks(),c=0,l=s.getECBlocks();try{for(var u=Ar(l),d=u.next();!d.done;d=u.next()){var f=d.value;c+=f.getCount()}}catch(e){r={error:e}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}var p=Array(c),m=0;try{for(var h=Ar(l),g=h.next();!g.done;g=h.next())for(var f=g.value,_=0;_<f.getCount();_++){var v=f.getDataCodewords(),y=s.getECCodewords()+v;p[m++]=new e(v,new Uint8Array(y))}}catch(e){a={error:e}}finally{try{g&&!g.done&&(o=h.return)&&o.call(h)}finally{if(a)throw a.error}}for(var b=p[0].codewords.length-s.getECCodewords(),x=b-1,S=0,_=0;_<x;_++)for(var C=0;C<m;C++)p[C].codewords[_]=t[S++];for(var w=n.getVersionNumber()===24,T=w?8:m,C=0;C<T;C++)p[C].codewords[b-1]=t[S++];for(var E=p[0].codewords.length,_=b;_<E;_++)for(var C=0;C<m;C++){var ee=w?(C+8)%m:C,te=w&&ee>7?_-1:_;p[ee].codewords[te]=t[S++]}if(S!==t.length)throw new D;return p},e.prototype.getNumDataCodewords=function(){return this.numDataCodewords},e.prototype.getCodewords=function(){return this.codewords},e}(),Mr=function(){function e(e){this.bytes=e,this.byteOffset=0,this.bitOffset=0}return e.prototype.getBitOffset=function(){return this.bitOffset},e.prototype.getByteOffset=function(){return this.byteOffset},e.prototype.readBits=function(e){if(e<1||e>32||e>this.available())throw new D(``+e);var t=0,n=this.bitOffset,r=this.byteOffset,i=this.bytes;if(n>0){var a=8-n,o=e<a?e:a,s=a-o,c=255>>8-o<<s;t=(i[r]&c)>>s,e-=o,n+=o,n===8&&(n=0,r++)}if(e>0){for(;e>=8;)t=t<<8|i[r]&255,r++,e-=8;if(e>0){var s=8-e,c=255>>s<<s;t=t<<e|(i[r]&c)>>s,n+=e}}return this.bitOffset=n,this.byteOffset=r,t},e.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},e}(),Nr;(function(e){e[e.PAD_ENCODE=0]=`PAD_ENCODE`,e[e.ASCII_ENCODE=1]=`ASCII_ENCODE`,e[e.C40_ENCODE=2]=`C40_ENCODE`,e[e.TEXT_ENCODE=3]=`TEXT_ENCODE`,e[e.ANSIX12_ENCODE=4]=`ANSIX12_ENCODE`,e[e.EDIFACT_ENCODE=5]=`EDIFACT_ENCODE`,e[e.BASE256_ENCODE=6]=`BASE256_ENCODE`})(Nr||={});var Pr=function(){function e(){}return e.decode=function(e){var t=new Mr(e),n=new F,r=new F,i=[],a=Nr.ASCII_ENCODE;do if(a===Nr.ASCII_ENCODE)a=this.decodeAsciiSegment(t,n,r);else{switch(a){case Nr.C40_ENCODE:this.decodeC40Segment(t,n);break;case Nr.TEXT_ENCODE:this.decodeTextSegment(t,n);break;case Nr.ANSIX12_ENCODE:this.decodeAnsiX12Segment(t,n);break;case Nr.EDIFACT_ENCODE:this.decodeEdifactSegment(t,n);break;case Nr.BASE256_ENCODE:this.decodeBase256Segment(t,n,i);break;default:throw new M}a=Nr.ASCII_ENCODE}while(a!==Nr.PAD_ENCODE&&t.available()>0);return r.length()>0&&n.append(r.toString()),new et(e,n.toString(),i.length===0?null:i,null)},e.decodeAsciiSegment=function(e,t,n){var r=!1;do{var i=e.readBits(8);if(i===0)throw new M;if(i<=128)return r&&(i+=128),t.append(String.fromCharCode(i-1)),Nr.ASCII_ENCODE;if(i===129)return Nr.PAD_ENCODE;if(i<=229){var a=i-130;a<10&&t.append(`0`),t.append(``+a)}else switch(i){case 230:return Nr.C40_ENCODE;case 231:return Nr.BASE256_ENCODE;case 232:t.append(``);break;case 233:case 234:break;case 235:r=!0;break;case 236:t.append(`[)>05`),n.insert(0,``);break;case 237:t.append(`[)>06`),n.insert(0,``);break;case 238:return Nr.ANSIX12_ENCODE;case 239:return Nr.TEXT_ENCODE;case 240:return Nr.EDIFACT_ENCODE;case 241:break;default:if(i!==254||e.available()!==0)throw new M}}while(e.available()>0);return Nr.ASCII_ENCODE},e.decodeC40Segment=function(e,t){var n=!1,r=[],i=0;do{if(e.available()===8)return;var a=e.readBits(8);if(a===254)return;this.parseTwoBytes(a,e.readBits(8),r);for(var o=0;o<3;o++){var s=r[o];switch(i){case 0:if(s<3)i=s+1;else if(s<this.C40_BASIC_SET_CHARS.length){var c=this.C40_BASIC_SET_CHARS[s];n?(t.append(String.fromCharCode(c.charCodeAt(0)+128)),n=!1):t.append(c)}else throw new M;break;case 1:n?(t.append(String.fromCharCode(s+128)),n=!1):t.append(String.fromCharCode(s)),i=0;break;case 2:if(s<this.C40_SHIFT2_SET_CHARS.length){var c=this.C40_SHIFT2_SET_CHARS[s];n?(t.append(String.fromCharCode(c.charCodeAt(0)+128)),n=!1):t.append(c)}else switch(s){case 27:t.append(``);break;case 30:n=!0;break;default:throw new M}i=0;break;case 3:n?(t.append(String.fromCharCode(s+224)),n=!1):t.append(String.fromCharCode(s+96)),i=0;break;default:throw new M}}}while(e.available()>0)},e.decodeTextSegment=function(e,t){var n=!1,r=[],i=0;do{if(e.available()===8)return;var a=e.readBits(8);if(a===254)return;this.parseTwoBytes(a,e.readBits(8),r);for(var o=0;o<3;o++){var s=r[o];switch(i){case 0:if(s<3)i=s+1;else if(s<this.TEXT_BASIC_SET_CHARS.length){var c=this.TEXT_BASIC_SET_CHARS[s];n?(t.append(String.fromCharCode(c.charCodeAt(0)+128)),n=!1):t.append(c)}else throw new M;break;case 1:n?(t.append(String.fromCharCode(s+128)),n=!1):t.append(String.fromCharCode(s)),i=0;break;case 2:if(s<this.TEXT_SHIFT2_SET_CHARS.length){var c=this.TEXT_SHIFT2_SET_CHARS[s];n?(t.append(String.fromCharCode(c.charCodeAt(0)+128)),n=!1):t.append(c)}else switch(s){case 27:t.append(``);break;case 30:n=!0;break;default:throw new M}i=0;break;case 3:if(s<this.TEXT_SHIFT3_SET_CHARS.length){var c=this.TEXT_SHIFT3_SET_CHARS[s];n?(t.append(String.fromCharCode(c.charCodeAt(0)+128)),n=!1):t.append(c),i=0}else throw new M;break;default:throw new M}}}while(e.available()>0)},e.decodeAnsiX12Segment=function(e,t){var n=[];do{if(e.available()===8)return;var r=e.readBits(8);if(r===254)return;this.parseTwoBytes(r,e.readBits(8),n);for(var i=0;i<3;i++){var a=n[i];switch(a){case 0:t.append(`\r`);break;case 1:t.append(`*`);break;case 2:t.append(`>`);break;case 3:t.append(` `);break;default:if(a<14)t.append(String.fromCharCode(a+44));else if(a<40)t.append(String.fromCharCode(a+51));else throw new M}}}while(e.available()>0)},e.parseTwoBytes=function(e,t,n){var r=(e<<8)+t-1,i=Math.floor(r/1600);n[0]=i,r-=i*1600,i=Math.floor(r/40),n[1]=i,n[2]=r-i*40},e.decodeEdifactSegment=function(e,t){do{if(e.available()<=16)return;for(var n=0;n<4;n++){var r=e.readBits(6);if(r===31){var i=8-e.getBitOffset();i!==8&&e.readBits(i);return}r&32||(r|=64),t.append(String.fromCharCode(r))}}while(e.available()>0)},e.decodeBase256Segment=function(e,t,n){var r=1+e.getByteOffset(),i=this.unrandomize255State(e.readBits(8),r++),a=i===0?e.available()/8|0:i<250?i:250*(i-249)+this.unrandomize255State(e.readBits(8),r++);if(a<0)throw new M;for(var o=new Uint8Array(a),s=0;s<a;s++){if(e.available()<8)throw new M;o[s]=this.unrandomize255State(e.readBits(8),r++)}n.push(o);try{t.append(Ne.decode(o,P.ISO88591))}catch(e){throw new ut(`Platform does not support required encoding: `+e.message)}},e.unrandomize255State=function(e,t){var n=e-(149*t%255+1);return n>=0?n:n+256},e.C40_BASIC_SET_CHARS=`*** 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ`.split(``),e.C40_SHIFT2_SET_CHARS=`!"#$%&'()*+,-./:;<=>?@[\\]^_`.split(``),e.TEXT_BASIC_SET_CHARS=`*** 0123456789abcdefghijklmnopqrstuvwxyz`.split(``),e.TEXT_SHIFT2_SET_CHARS=e.C40_SHIFT2_SET_CHARS,e.TEXT_SHIFT3_SET_CHARS="`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~".split(``),e}(),Fr=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Ir=function(){function e(){this.rsDecoder=new dt(ot.DATA_MATRIX_FIELD_256)}return e.prototype.decode=function(e){var t,n,r=new kr(e),i=r.getVersion(),a=r.readCodewords(),o=jr.getDataBlocks(a,i),s=0;try{for(var c=Fr(o),l=c.next();!l.done;l=c.next()){var u=l.value;s+=u.getNumDataCodewords()}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}for(var d=new Uint8Array(s),f=o.length,p=0;p<f;p++){var m=o[p],h=m.getCodewords(),g=m.getNumDataCodewords();this.correctErrors(h,g);for(var _=0;_<g;_++)d[_*f+p]=h[_]}return Pr.decode(d)},e.prototype.correctErrors=function(e,t){var n=new Int32Array(e);try{this.rsDecoder.decode(n,e.length-t)}catch{throw new O}for(var r=0;r<t;r++)e[r]=n[r]},e}(),Lr=function(){function e(e){this.image=e,this.rectangleDetector=new vt(this.image)}return e.prototype.detect=function(){var t=this.rectangleDetector.detect(),n=this.detectSolid1(t);if(n=this.detectSolid2(n),n[3]=this.correctTopRight(n),!n[3])throw new I;n=this.shiftToModuleCenter(n);var r=n[0],i=n[1],a=n[2],o=n[3],s=this.transitionsBetween(r,o)+1,c=this.transitionsBetween(a,o)+1;return(s&1)==1&&(s+=1),(c&1)==1&&(c+=1),4*s<7*c&&4*c<7*s&&(s=c=Math.max(s,c)),new ht(e.sampleGrid(this.image,r,i,a,o,s,c),[r,i,a,o])},e.shiftPoint=function(e,t,n){var r=(t.getX()-e.getX())/(n+1),i=(t.getY()-e.getY())/(n+1);return new z(e.getX()+r,e.getY()+i)},e.moveAway=function(e,t,n){var r=e.getX(),i=e.getY();return r<t?--r:r+=1,i<n?--i:i+=1,new z(r,i)},e.prototype.detectSolid1=function(e){var t=e[0],n=e[1],r=e[3],i=e[2],a=this.transitionsBetween(t,n),o=this.transitionsBetween(n,r),s=this.transitionsBetween(r,i),c=this.transitionsBetween(i,t),l=a,u=[i,t,n,r];return l>o&&(l=o,u[0]=t,u[1]=n,u[2]=r,u[3]=i),l>s&&(l=s,u[0]=n,u[1]=r,u[2]=i,u[3]=t),l>c&&(u[0]=r,u[1]=i,u[2]=t,u[3]=n),u},e.prototype.detectSolid2=function(t){var n=t[0],r=t[1],i=t[2],a=t[3],o=this.transitionsBetween(n,a),s=e.shiftPoint(r,i,(o+1)*4),c=e.shiftPoint(i,r,(o+1)*4);return this.transitionsBetween(s,n)<this.transitionsBetween(c,a)?(t[0]=n,t[1]=r,t[2]=i,t[3]=a):(t[0]=r,t[1]=i,t[2]=a,t[3]=n),t},e.prototype.correctTopRight=function(t){var n=t[0],r=t[1],i=t[2],a=t[3],o=this.transitionsBetween(n,a),s=this.transitionsBetween(r,a),c=e.shiftPoint(n,r,(s+1)*4),l=e.shiftPoint(i,r,(o+1)*4);o=this.transitionsBetween(c,a),s=this.transitionsBetween(l,a);var u=new z(a.getX()+(i.getX()-r.getX())/(o+1),a.getY()+(i.getY()-r.getY())/(o+1)),d=new z(a.getX()+(n.getX()-r.getX())/(s+1),a.getY()+(n.getY()-r.getY())/(s+1));return this.isValid(u)?!this.isValid(d)||this.transitionsBetween(c,u)+this.transitionsBetween(l,u)>this.transitionsBetween(c,d)+this.transitionsBetween(l,d)?u:d:this.isValid(d)?d:null},e.prototype.shiftToModuleCenter=function(t){var n=t[0],r=t[1],i=t[2],a=t[3],o=this.transitionsBetween(n,a)+1,s=this.transitionsBetween(i,a)+1,c=e.shiftPoint(n,r,s*4),l=e.shiftPoint(i,r,o*4);o=this.transitionsBetween(c,a)+1,s=this.transitionsBetween(l,a)+1,(o&1)==1&&(o+=1),(s&1)==1&&(s+=1);var u=(n.getX()+r.getX()+i.getX()+a.getX())/4,d=(n.getY()+r.getY()+i.getY()+a.getY())/4;n=e.moveAway(n,u,d),r=e.moveAway(r,u,d),i=e.moveAway(i,u,d),a=e.moveAway(a,u,d);var f,p;return c=e.shiftPoint(n,r,s*4),c=e.shiftPoint(c,a,o*4),f=e.shiftPoint(r,n,s*4),f=e.shiftPoint(f,i,o*4),l=e.shiftPoint(i,a,s*4),l=e.shiftPoint(l,r,o*4),p=e.shiftPoint(a,i,s*4),p=e.shiftPoint(p,n,o*4),[c,f,l,p]},e.prototype.isValid=function(e){return e.getX()>=0&&e.getX()<this.image.getWidth()&&e.getY()>0&&e.getY()<this.image.getHeight()},e.sampleGrid=function(e,t,n,r,i,a,o){return Ct.getInstance().sampleGrid(e,a,o,.5,.5,a-.5,.5,a-.5,o-.5,.5,o-.5,t.getX(),t.getY(),i.getX(),i.getY(),r.getX(),r.getY(),n.getX(),n.getY())},e.prototype.transitionsBetween=function(e,t){var n=Math.trunc(e.getX()),r=Math.trunc(e.getY()),i=Math.trunc(t.getX()),a=Math.trunc(t.getY()),o=Math.abs(a-r)>Math.abs(i-n);if(o){var s=n;n=r,r=s,s=i,i=a,a=s}for(var c=Math.abs(i-n),l=Math.abs(a-r),u=-c/2,d=r<a?1:-1,f=n<i?1:-1,p=0,m=this.image.get(o?r:n,o?n:r),h=n,g=r;h!==i;h+=f){var _=this.image.get(o?g:h,o?h:g);if(_!==m&&(p++,m=_),u+=l,u>0){if(g===a)break;g+=d,u-=c}}return p},e}(),Rr=function(){function e(){this.decoder=new Ir}return e.prototype.decode=function(t,n){n===void 0&&(n=null);var r,i;if(n!=null&&n.has(j.PURE_BARCODE)){var a=e.extractPureBits(t.getBlackMatrix());r=this.decoder.decode(a),i=e.NO_POINTS}else{var o=new Lr(t.getBlackMatrix()).detect();r=this.decoder.decode(o.getBits()),i=o.getPoints()}var s=r.getRawBytes(),c=new Xe(r.getText(),s,8*s.length,i,L.DATA_MATRIX,k.currentTimeMillis()),l=r.getByteSegments();l!=null&&c.putMetadata($e.BYTE_SEGMENTS,l);var u=r.getECLevel();return u!=null&&c.putMetadata($e.ERROR_CORRECTION_LEVEL,u),c},e.prototype.reset=function(){},e.extractPureBits=function(e){var t=e.getTopLeftOnBit(),n=e.getBottomRightOnBit();if(t==null||n==null)throw new I;var r=this.moduleSize(t,e),i=t[1],a=n[1],o=t[0],s=(n[0]-o+1)/r,c=(a-i+1)/r;if(s<=0||c<=0)throw new I;var l=r/2;i+=l,o+=l;for(var u=new Pe(s,c),d=0;d<c;d++)for(var f=i+d*r,p=0;p<s;p++)e.get(o+p*r,f)&&u.set(p,d);return u},e.moduleSize=function(e,t){for(var n=t.getWidth(),r=e[0],i=e[1];r<n&&t.get(r,i);)r++;if(r===n)throw new I;var a=r-e[0];if(a===0)throw new I;return a},e.NO_POINTS=[],e}(),zr=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){zr(t,e);function t(t){return t===void 0&&(t=500),e.call(this,new Rr,t)||this}return t})(Ye);var Br;(function(e){e[e.L=0]=`L`,e[e.M=1]=`M`,e[e.Q=2]=`Q`,e[e.H=3]=`H`})(Br||={});var Vr=function(){function e(t,n,r){this.value=t,this.stringValue=n,this.bits=r,e.FOR_BITS.set(r,this),e.FOR_VALUE.set(t,this)}return e.prototype.getValue=function(){return this.value},e.prototype.getBits=function(){return this.bits},e.fromString=function(t){switch(t){case`L`:return e.L;case`M`:return e.M;case`Q`:return e.Q;case`H`:return e.H;default:throw new he(t+`not available`)}},e.prototype.toString=function(){return this.stringValue},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.value===n.value},e.forBits=function(t){if(t<0||t>=e.FOR_BITS.size)throw new D;return e.FOR_BITS.get(t)},e.FOR_BITS=new Map,e.FOR_VALUE=new Map,e.L=new e(Br.L,`L`,1),e.M=new e(Br.M,`M`,0),e.Q=new e(Br.Q,`Q`,3),e.H=new e(Br.H,`H`,2),e}(),Hr=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Ur=function(){function e(e){this.errorCorrectionLevel=Vr.forBits(e>>3&3),this.dataMask=e&7}return e.numBitsDiffering=function(e,t){return A.bitCount(e^t)},e.decodeFormatInformation=function(t,n){var r=e.doDecodeFormatInformation(t,n);return r===null?e.doDecodeFormatInformation(t^e.FORMAT_INFO_MASK_QR,n^e.FORMAT_INFO_MASK_QR):r},e.doDecodeFormatInformation=function(t,n){var r,i,a=2**53-1,o=0;try{for(var s=Hr(e.FORMAT_INFO_DECODE_LOOKUP),c=s.next();!c.done;c=s.next()){var l=c.value,u=l[0];if(u===t||u===n)return new e(l[1]);var d=e.numBitsDiffering(t,u);d<a&&(o=l[1],a=d),t!==n&&(d=e.numBitsDiffering(n,u),d<a&&(o=l[1],a=d))}}catch(e){r={error:e}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return a<=3?new e(o):null},e.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},e.prototype.getDataMask=function(){return this.dataMask},e.prototype.hashCode=function(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.errorCorrectionLevel===n.errorCorrectionLevel&&this.dataMask===n.dataMask},e.FORMAT_INFO_MASK_QR=21522,e.FORMAT_INFO_DECODE_LOOKUP=[Int32Array.from([21522,0]),Int32Array.from([20773,1]),Int32Array.from([24188,2]),Int32Array.from([23371,3]),Int32Array.from([17913,4]),Int32Array.from([16590,5]),Int32Array.from([20375,6]),Int32Array.from([19104,7]),Int32Array.from([30660,8]),Int32Array.from([29427,9]),Int32Array.from([32170,10]),Int32Array.from([30877,11]),Int32Array.from([26159,12]),Int32Array.from([25368,13]),Int32Array.from([27713,14]),Int32Array.from([26998,15]),Int32Array.from([5769,16]),Int32Array.from([5054,17]),Int32Array.from([7399,18]),Int32Array.from([6608,19]),Int32Array.from([1890,20]),Int32Array.from([597,21]),Int32Array.from([3340,22]),Int32Array.from([2107,23]),Int32Array.from([13663,24]),Int32Array.from([12392,25]),Int32Array.from([16177,26]),Int32Array.from([14854,27]),Int32Array.from([9396,28]),Int32Array.from([8579,29]),Int32Array.from([11994,30]),Int32Array.from([11245,31])],e}(),Wr=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},H=function(){function e(e){var t=[...arguments].slice(1);this.ecCodewordsPerBlock=e,this.ecBlocks=t}return e.prototype.getECCodewordsPerBlock=function(){return this.ecCodewordsPerBlock},e.prototype.getNumBlocks=function(){var e,t,n=0,r=this.ecBlocks;try{for(var i=Wr(r),a=i.next();!a.done;a=i.next()){var o=a.value;n+=o.getCount()}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return n},e.prototype.getTotalECCodewords=function(){return this.ecCodewordsPerBlock*this.getNumBlocks()},e.prototype.getECBlocks=function(){return this.ecBlocks},e}(),U=function(){function e(e,t){this.count=e,this.dataCodewords=t}return e.prototype.getCount=function(){return this.count},e.prototype.getDataCodewords=function(){return this.dataCodewords},e}(),Gr=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Kr=function(){function e(e,t){for(var n,r,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];this.versionNumber=e,this.alignmentPatternCenters=t,this.ecBlocks=i;var o=0,s=i[0].getECCodewordsPerBlock(),c=i[0].getECBlocks();try{for(var l=Gr(c),u=l.next();!u.done;u=l.next()){var d=u.value;o+=d.getCount()*(d.getDataCodewords()+s)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}this.totalCodewords=o}return e.prototype.getVersionNumber=function(){return this.versionNumber},e.prototype.getAlignmentPatternCenters=function(){return this.alignmentPatternCenters},e.prototype.getTotalCodewords=function(){return this.totalCodewords},e.prototype.getDimensionForVersion=function(){return 17+4*this.versionNumber},e.prototype.getECBlocksForLevel=function(e){return this.ecBlocks[e.getValue()]},e.getProvisionalVersionForDimension=function(e){if(e%4!=1)throw new M;try{return this.getVersionForNumber((e-17)/4)}catch{throw new M}},e.getVersionForNumber=function(t){if(t<1||t>40)throw new D;return e.VERSIONS[t-1]},e.decodeVersionInformation=function(t){for(var n=2**53-1,r=0,i=0;i<e.VERSION_DECODE_INFO.length;i++){var a=e.VERSION_DECODE_INFO[i];if(a===t)return e.getVersionForNumber(i+7);var o=Ur.numBitsDiffering(t,a);o<n&&(r=i+7,n=o)}return n<=3?e.getVersionForNumber(r):null},e.prototype.buildFunctionPattern=function(){var e=this.getDimensionForVersion(),t=new Pe(e);t.setRegion(0,0,9,9),t.setRegion(e-8,0,8,9),t.setRegion(0,e-8,9,8);for(var n=this.alignmentPatternCenters.length,r=0;r<n;r++)for(var i=this.alignmentPatternCenters[r]-2,a=0;a<n;a++)r===0&&(a===0||a===n-1)||r===n-1&&a===0||t.setRegion(this.alignmentPatternCenters[a]-2,i,5,5);return t.setRegion(6,9,1,e-17),t.setRegion(9,6,e-17,1),this.versionNumber>6&&(t.setRegion(e-11,0,3,6),t.setRegion(0,e-11,6,3)),t},e.prototype.toString=function(){return``+this.versionNumber},e.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),e.VERSIONS=[new e(1,new Int32Array,new H(7,new U(1,19)),new H(10,new U(1,16)),new H(13,new U(1,13)),new H(17,new U(1,9))),new e(2,Int32Array.from([6,18]),new H(10,new U(1,34)),new H(16,new U(1,28)),new H(22,new U(1,22)),new H(28,new U(1,16))),new e(3,Int32Array.from([6,22]),new H(15,new U(1,55)),new H(26,new U(1,44)),new H(18,new U(2,17)),new H(22,new U(2,13))),new e(4,Int32Array.from([6,26]),new H(20,new U(1,80)),new H(18,new U(2,32)),new H(26,new U(2,24)),new H(16,new U(4,9))),new e(5,Int32Array.from([6,30]),new H(26,new U(1,108)),new H(24,new U(2,43)),new H(18,new U(2,15),new U(2,16)),new H(22,new U(2,11),new U(2,12))),new e(6,Int32Array.from([6,34]),new H(18,new U(2,68)),new H(16,new U(4,27)),new H(24,new U(4,19)),new H(28,new U(4,15))),new e(7,Int32Array.from([6,22,38]),new H(20,new U(2,78)),new H(18,new U(4,31)),new H(18,new U(2,14),new U(4,15)),new H(26,new U(4,13),new U(1,14))),new e(8,Int32Array.from([6,24,42]),new H(24,new U(2,97)),new H(22,new U(2,38),new U(2,39)),new H(22,new U(4,18),new U(2,19)),new H(26,new U(4,14),new U(2,15))),new e(9,Int32Array.from([6,26,46]),new H(30,new U(2,116)),new H(22,new U(3,36),new U(2,37)),new H(20,new U(4,16),new U(4,17)),new H(24,new U(4,12),new U(4,13))),new e(10,Int32Array.from([6,28,50]),new H(18,new U(2,68),new U(2,69)),new H(26,new U(4,43),new U(1,44)),new H(24,new U(6,19),new U(2,20)),new H(28,new U(6,15),new U(2,16))),new e(11,Int32Array.from([6,30,54]),new H(20,new U(4,81)),new H(30,new U(1,50),new U(4,51)),new H(28,new U(4,22),new U(4,23)),new H(24,new U(3,12),new U(8,13))),new e(12,Int32Array.from([6,32,58]),new H(24,new U(2,92),new U(2,93)),new H(22,new U(6,36),new U(2,37)),new H(26,new U(4,20),new U(6,21)),new H(28,new U(7,14),new U(4,15))),new e(13,Int32Array.from([6,34,62]),new H(26,new U(4,107)),new H(22,new U(8,37),new U(1,38)),new H(24,new U(8,20),new U(4,21)),new H(22,new U(12,11),new U(4,12))),new e(14,Int32Array.from([6,26,46,66]),new H(30,new U(3,115),new U(1,116)),new H(24,new U(4,40),new U(5,41)),new H(20,new U(11,16),new U(5,17)),new H(24,new U(11,12),new U(5,13))),new e(15,Int32Array.from([6,26,48,70]),new H(22,new U(5,87),new U(1,88)),new H(24,new U(5,41),new U(5,42)),new H(30,new U(5,24),new U(7,25)),new H(24,new U(11,12),new U(7,13))),new e(16,Int32Array.from([6,26,50,74]),new H(24,new U(5,98),new U(1,99)),new H(28,new U(7,45),new U(3,46)),new H(24,new U(15,19),new U(2,20)),new H(30,new U(3,15),new U(13,16))),new e(17,Int32Array.from([6,30,54,78]),new H(28,new U(1,107),new U(5,108)),new H(28,new U(10,46),new U(1,47)),new H(28,new U(1,22),new U(15,23)),new H(28,new U(2,14),new U(17,15))),new e(18,Int32Array.from([6,30,56,82]),new H(30,new U(5,120),new U(1,121)),new H(26,new U(9,43),new U(4,44)),new H(28,new U(17,22),new U(1,23)),new H(28,new U(2,14),new U(19,15))),new e(19,Int32Array.from([6,30,58,86]),new H(28,new U(3,113),new U(4,114)),new H(26,new U(3,44),new U(11,45)),new H(26,new U(17,21),new U(4,22)),new H(26,new U(9,13),new U(16,14))),new e(20,Int32Array.from([6,34,62,90]),new H(28,new U(3,107),new U(5,108)),new H(26,new U(3,41),new U(13,42)),new H(30,new U(15,24),new U(5,25)),new H(28,new U(15,15),new U(10,16))),new e(21,Int32Array.from([6,28,50,72,94]),new H(28,new U(4,116),new U(4,117)),new H(26,new U(17,42)),new H(28,new U(17,22),new U(6,23)),new H(30,new U(19,16),new U(6,17))),new e(22,Int32Array.from([6,26,50,74,98]),new H(28,new U(2,111),new U(7,112)),new H(28,new U(17,46)),new H(30,new U(7,24),new U(16,25)),new H(24,new U(34,13))),new e(23,Int32Array.from([6,30,54,78,102]),new H(30,new U(4,121),new U(5,122)),new H(28,new U(4,47),new U(14,48)),new H(30,new U(11,24),new U(14,25)),new H(30,new U(16,15),new U(14,16))),new e(24,Int32Array.from([6,28,54,80,106]),new H(30,new U(6,117),new U(4,118)),new H(28,new U(6,45),new U(14,46)),new H(30,new U(11,24),new U(16,25)),new H(30,new U(30,16),new U(2,17))),new e(25,Int32Array.from([6,32,58,84,110]),new H(26,new U(8,106),new U(4,107)),new H(28,new U(8,47),new U(13,48)),new H(30,new U(7,24),new U(22,25)),new H(30,new U(22,15),new U(13,16))),new e(26,Int32Array.from([6,30,58,86,114]),new H(28,new U(10,114),new U(2,115)),new H(28,new U(19,46),new U(4,47)),new H(28,new U(28,22),new U(6,23)),new H(30,new U(33,16),new U(4,17))),new e(27,Int32Array.from([6,34,62,90,118]),new H(30,new U(8,122),new U(4,123)),new H(28,new U(22,45),new U(3,46)),new H(30,new U(8,23),new U(26,24)),new H(30,new U(12,15),new U(28,16))),new e(28,Int32Array.from([6,26,50,74,98,122]),new H(30,new U(3,117),new U(10,118)),new H(28,new U(3,45),new U(23,46)),new H(30,new U(4,24),new U(31,25)),new H(30,new U(11,15),new U(31,16))),new e(29,Int32Array.from([6,30,54,78,102,126]),new H(30,new U(7,116),new U(7,117)),new H(28,new U(21,45),new U(7,46)),new H(30,new U(1,23),new U(37,24)),new H(30,new U(19,15),new U(26,16))),new e(30,Int32Array.from([6,26,52,78,104,130]),new H(30,new U(5,115),new U(10,116)),new H(28,new U(19,47),new U(10,48)),new H(30,new U(15,24),new U(25,25)),new H(30,new U(23,15),new U(25,16))),new e(31,Int32Array.from([6,30,56,82,108,134]),new H(30,new U(13,115),new U(3,116)),new H(28,new U(2,46),new U(29,47)),new H(30,new U(42,24),new U(1,25)),new H(30,new U(23,15),new U(28,16))),new e(32,Int32Array.from([6,34,60,86,112,138]),new H(30,new U(17,115)),new H(28,new U(10,46),new U(23,47)),new H(30,new U(10,24),new U(35,25)),new H(30,new U(19,15),new U(35,16))),new e(33,Int32Array.from([6,30,58,86,114,142]),new H(30,new U(17,115),new U(1,116)),new H(28,new U(14,46),new U(21,47)),new H(30,new U(29,24),new U(19,25)),new H(30,new U(11,15),new U(46,16))),new e(34,Int32Array.from([6,34,62,90,118,146]),new H(30,new U(13,115),new U(6,116)),new H(28,new U(14,46),new U(23,47)),new H(30,new U(44,24),new U(7,25)),new H(30,new U(59,16),new U(1,17))),new e(35,Int32Array.from([6,30,54,78,102,126,150]),new H(30,new U(12,121),new U(7,122)),new H(28,new U(12,47),new U(26,48)),new H(30,new U(39,24),new U(14,25)),new H(30,new U(22,15),new U(41,16))),new e(36,Int32Array.from([6,24,50,76,102,128,154]),new H(30,new U(6,121),new U(14,122)),new H(28,new U(6,47),new U(34,48)),new H(30,new U(46,24),new U(10,25)),new H(30,new U(2,15),new U(64,16))),new e(37,Int32Array.from([6,28,54,80,106,132,158]),new H(30,new U(17,122),new U(4,123)),new H(28,new U(29,46),new U(14,47)),new H(30,new U(49,24),new U(10,25)),new H(30,new U(24,15),new U(46,16))),new e(38,Int32Array.from([6,32,58,84,110,136,162]),new H(30,new U(4,122),new U(18,123)),new H(28,new U(13,46),new U(32,47)),new H(30,new U(48,24),new U(14,25)),new H(30,new U(42,15),new U(32,16))),new e(39,Int32Array.from([6,26,54,82,110,138,166]),new H(30,new U(20,117),new U(4,118)),new H(28,new U(40,47),new U(7,48)),new H(30,new U(43,24),new U(22,25)),new H(30,new U(10,15),new U(67,16))),new e(40,Int32Array.from([6,30,58,86,114,142,170]),new H(30,new U(19,118),new U(6,119)),new H(28,new U(18,47),new U(31,48)),new H(30,new U(34,24),new U(34,25)),new H(30,new U(20,15),new U(61,16)))],e}(),qr;(function(e){e[e.DATA_MASK_000=0]=`DATA_MASK_000`,e[e.DATA_MASK_001=1]=`DATA_MASK_001`,e[e.DATA_MASK_010=2]=`DATA_MASK_010`,e[e.DATA_MASK_011=3]=`DATA_MASK_011`,e[e.DATA_MASK_100=4]=`DATA_MASK_100`,e[e.DATA_MASK_101=5]=`DATA_MASK_101`,e[e.DATA_MASK_110=6]=`DATA_MASK_110`,e[e.DATA_MASK_111=7]=`DATA_MASK_111`})(qr||={});var Jr=function(){function e(e,t){this.value=e,this.isMasked=t}return e.prototype.unmaskBitMatrix=function(e,t){for(var n=0;n<t;n++)for(var r=0;r<t;r++)this.isMasked(n,r)&&e.flip(r,n)},e.values=new Map([[qr.DATA_MASK_000,new e(qr.DATA_MASK_000,function(e,t){return!(e+t&1)})],[qr.DATA_MASK_001,new e(qr.DATA_MASK_001,function(e,t){return!(e&1)})],[qr.DATA_MASK_010,new e(qr.DATA_MASK_010,function(e,t){return t%3==0})],[qr.DATA_MASK_011,new e(qr.DATA_MASK_011,function(e,t){return(e+t)%3==0})],[qr.DATA_MASK_100,new e(qr.DATA_MASK_100,function(e,t){return!(Math.floor(e/2)+Math.floor(t/3)&1)})],[qr.DATA_MASK_101,new e(qr.DATA_MASK_101,function(e,t){return e*t%6==0})],[qr.DATA_MASK_110,new e(qr.DATA_MASK_110,function(e,t){return e*t%6<3})],[qr.DATA_MASK_111,new e(qr.DATA_MASK_111,function(e,t){return!(e+t+e*t%3&1)})]]),e}(),Yr=function(){function e(e){var t=e.getHeight();if(t<21||(t&3)!=1)throw new M;this.bitMatrix=e}return e.prototype.readFormatInformation=function(){if(this.parsedFormatInfo!==null&&this.parsedFormatInfo!==void 0)return this.parsedFormatInfo;for(var e=0,t=0;t<6;t++)e=this.copyBit(t,8,e);e=this.copyBit(7,8,e),e=this.copyBit(8,8,e),e=this.copyBit(8,7,e);for(var n=5;n>=0;n--)e=this.copyBit(8,n,e);for(var r=this.bitMatrix.getHeight(),i=0,a=r-7,n=r-1;n>=a;n--)i=this.copyBit(8,n,i);for(var t=r-8;t<r;t++)i=this.copyBit(t,8,i);if(this.parsedFormatInfo=Ur.decodeFormatInformation(e,i),this.parsedFormatInfo!==null)return this.parsedFormatInfo;throw new M},e.prototype.readVersion=function(){if(this.parsedVersion!==null&&this.parsedVersion!==void 0)return this.parsedVersion;var e=this.bitMatrix.getHeight(),t=Math.floor((e-17)/4);if(t<=6)return Kr.getVersionForNumber(t);for(var n=0,r=e-11,i=5;i>=0;i--)for(var a=e-9;a>=r;a--)n=this.copyBit(a,i,n);var o=Kr.decodeVersionInformation(n);if(o!==null&&o.getDimensionForVersion()===e)return this.parsedVersion=o,o;n=0;for(var a=5;a>=0;a--)for(var i=e-9;i>=r;i--)n=this.copyBit(a,i,n);if(o=Kr.decodeVersionInformation(n),o!==null&&o.getDimensionForVersion()===e)return this.parsedVersion=o,o;throw new M},e.prototype.copyBit=function(e,t,n){return(this.isMirror?this.bitMatrix.get(t,e):this.bitMatrix.get(e,t))?n<<1|1:n<<1},e.prototype.readCodewords=function(){var e=this.readFormatInformation(),t=this.readVersion(),n=Jr.values.get(e.getDataMask()),r=this.bitMatrix.getHeight();n.unmaskBitMatrix(this.bitMatrix,r);for(var i=t.buildFunctionPattern(),a=!0,o=new Uint8Array(t.getTotalCodewords()),s=0,c=0,l=0,u=r-1;u>0;u-=2){u===6&&u--;for(var d=0;d<r;d++)for(var f=a?r-1-d:d,p=0;p<2;p++)i.get(u-p,f)||(l++,c<<=1,this.bitMatrix.get(u-p,f)&&(c|=1),l===8&&(o[s++]=c,l=0,c=0));a=!a}if(s!==t.getTotalCodewords())throw new M;return o},e.prototype.remask=function(){if(this.parsedFormatInfo!==null){var e=Jr.values.get(this.parsedFormatInfo.getDataMask()),t=this.bitMatrix.getHeight();e.unmaskBitMatrix(this.bitMatrix,t)}},e.prototype.setMirror=function(e){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=e},e.prototype.mirror=function(){for(var e=this.bitMatrix,t=0,n=e.getWidth();t<n;t++)for(var r=t+1,i=e.getHeight();r<i;r++)e.get(t,r)!==e.get(r,t)&&(e.flip(r,t),e.flip(t,r))},e}(),Xr=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Zr=function(){function e(e,t){this.numDataCodewords=e,this.codewords=t}return e.getDataBlocks=function(t,n,r){var i,a,o,s;if(t.length!==n.getTotalCodewords())throw new D;var c=n.getECBlocksForLevel(r),l=0,u=c.getECBlocks();try{for(var d=Xr(u),f=d.next();!f.done;f=d.next()){var p=f.value;l+=p.getCount()}}catch(e){i={error:e}}finally{try{f&&!f.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}var m=Array(l),h=0;try{for(var g=Xr(u),_=g.next();!_.done;_=g.next())for(var p=_.value,v=0;v<p.getCount();v++){var y=p.getDataCodewords(),b=c.getECCodewordsPerBlock()+y;m[h++]=new e(y,new Uint8Array(b))}}catch(e){o={error:e}}finally{try{_&&!_.done&&(s=g.return)&&s.call(g)}finally{if(o)throw o.error}}for(var x=m[0].codewords.length,S=m.length-1;S>=0&&m[S].codewords.length!==x;)S--;S++;for(var C=x-c.getECCodewordsPerBlock(),w=0,v=0;v<C;v++)for(var T=0;T<h;T++)m[T].codewords[v]=t[w++];for(var T=S;T<h;T++)m[T].codewords[C]=t[w++];for(var E=m[0].codewords.length,v=C;v<E;v++)for(var T=0;T<h;T++){var ee=T<S?v:v+1;m[T].codewords[ee]=t[w++]}return m},e.prototype.getNumDataCodewords=function(){return this.numDataCodewords},e.prototype.getCodewords=function(){return this.codewords},e}(),Qr;(function(e){e[e.TERMINATOR=0]=`TERMINATOR`,e[e.NUMERIC=1]=`NUMERIC`,e[e.ALPHANUMERIC=2]=`ALPHANUMERIC`,e[e.STRUCTURED_APPEND=3]=`STRUCTURED_APPEND`,e[e.BYTE=4]=`BYTE`,e[e.ECI=5]=`ECI`,e[e.KANJI=6]=`KANJI`,e[e.FNC1_FIRST_POSITION=7]=`FNC1_FIRST_POSITION`,e[e.FNC1_SECOND_POSITION=8]=`FNC1_SECOND_POSITION`,e[e.HANZI=9]=`HANZI`})(Qr||={});var W=function(){function e(t,n,r,i){this.value=t,this.stringValue=n,this.characterCountBitsForVersions=r,this.bits=i,e.FOR_BITS.set(i,this),e.FOR_VALUE.set(t,this)}return e.forBits=function(t){var n=e.FOR_BITS.get(t);if(n===void 0)throw new D;return n},e.prototype.getCharacterCountBits=function(e){var t=e.getVersionNumber(),n=t<=9?0:t<=26?1:2;return this.characterCountBitsForVersions[n]},e.prototype.getValue=function(){return this.value},e.prototype.getBits=function(){return this.bits},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;return this.value===n.value},e.prototype.toString=function(){return this.stringValue},e.FOR_BITS=new Map,e.FOR_VALUE=new Map,e.TERMINATOR=new e(Qr.TERMINATOR,`TERMINATOR`,Int32Array.from([0,0,0]),0),e.NUMERIC=new e(Qr.NUMERIC,`NUMERIC`,Int32Array.from([10,12,14]),1),e.ALPHANUMERIC=new e(Qr.ALPHANUMERIC,`ALPHANUMERIC`,Int32Array.from([9,11,13]),2),e.STRUCTURED_APPEND=new e(Qr.STRUCTURED_APPEND,`STRUCTURED_APPEND`,Int32Array.from([0,0,0]),3),e.BYTE=new e(Qr.BYTE,`BYTE`,Int32Array.from([8,16,16]),4),e.ECI=new e(Qr.ECI,`ECI`,Int32Array.from([0,0,0]),7),e.KANJI=new e(Qr.KANJI,`KANJI`,Int32Array.from([8,10,12]),8),e.FNC1_FIRST_POSITION=new e(Qr.FNC1_FIRST_POSITION,`FNC1_FIRST_POSITION`,Int32Array.from([0,0,0]),5),e.FNC1_SECOND_POSITION=new e(Qr.FNC1_SECOND_POSITION,`FNC1_SECOND_POSITION`,Int32Array.from([0,0,0]),9),e.HANZI=new e(Qr.HANZI,`HANZI`,Int32Array.from([8,10,12]),13),e}(),$r=function(){function e(){}return e.decode=function(t,n,r,i){var a=new Mr(t),o=new F,s=[],c=-1,l=-1;try{var u=null,d=!1,f=void 0;do{if(a.available()<4)f=W.TERMINATOR;else{var p=a.readBits(4);f=W.forBits(p)}switch(f){case W.TERMINATOR:break;case W.FNC1_FIRST_POSITION:case W.FNC1_SECOND_POSITION:d=!0;break;case W.STRUCTURED_APPEND:if(a.available()<16)throw new M;c=a.readBits(8),l=a.readBits(8);break;case W.ECI:var m=e.parseECIValue(a);if(u=Ae.getCharacterSetECIByValue(m),u===null)throw new M;break;case W.HANZI:var h=a.readBits(4),g=a.readBits(f.getCharacterCountBits(n));h===e.GB2312_SUBSET&&e.decodeHanziSegment(a,o,g);break;default:var _=a.readBits(f.getCharacterCountBits(n));switch(f){case W.NUMERIC:e.decodeNumericSegment(a,o,_);break;case W.ALPHANUMERIC:e.decodeAlphanumericSegment(a,o,_,d);break;case W.BYTE:e.decodeByteSegment(a,o,_,u,s,i);break;case W.KANJI:e.decodeKanjiSegment(a,o,_);break;default:throw new M}}}while(f!==W.TERMINATOR)}catch{throw new M}return new et(t,o.toString(),s.length===0?null:s,r===null?null:r.toString(),c,l)},e.decodeHanziSegment=function(e,t,n){if(n*13>e.available())throw new M;for(var r=new Uint8Array(2*n),i=0;n>0;){var a=e.readBits(13),o=a/96<<8|a%96;o+=o<959?41377:42657,r[i]=o>>8&255,r[i+1]=o&255,i+=2,n--}try{t.append(Ne.decode(r,P.GB2312))}catch(e){throw new M(e)}},e.decodeKanjiSegment=function(e,t,n){if(n*13>e.available())throw new M;for(var r=new Uint8Array(2*n),i=0;n>0;){var a=e.readBits(13),o=a/192<<8|a%192;o+=o<7936?33088:49472,r[i]=o>>8,r[i+1]=o,i+=2,n--}try{t.append(Ne.decode(r,P.SHIFT_JIS))}catch(e){throw new M(e)}},e.decodeByteSegment=function(e,t,n,r,i,a){if(8*n>e.available())throw new M;for(var o=new Uint8Array(n),s=0;s<n;s++)o[s]=e.readBits(8);var c=r===null?P.guessEncoding(o,a):r.getName();try{t.append(Ne.decode(o,c))}catch(e){throw new M(e)}i.push(o)},e.toAlphaNumericChar=function(t){if(t>=e.ALPHANUMERIC_CHARS.length)throw new M;return e.ALPHANUMERIC_CHARS[t]},e.decodeAlphanumericSegment=function(t,n,r,i){for(var a=n.length();r>1;){if(t.available()<11)throw new M;var o=t.readBits(11);n.append(e.toAlphaNumericChar(Math.floor(o/45))),n.append(e.toAlphaNumericChar(o%45)),r-=2}if(r===1){if(t.available()<6)throw new M;n.append(e.toAlphaNumericChar(t.readBits(6)))}if(i)for(var s=a;s<n.length();s++)n.charAt(s)===`%`&&(s<n.length()-1&&n.charAt(s+1)===`%`?n.deleteCharAt(s+1):n.setCharAt(s,``))},e.decodeNumericSegment=function(t,n,r){for(;r>=3;){if(t.available()<10)throw new M;var i=t.readBits(10);if(i>=1e3)throw new M;n.append(e.toAlphaNumericChar(Math.floor(i/100))),n.append(e.toAlphaNumericChar(Math.floor(i/10)%10)),n.append(e.toAlphaNumericChar(i%10)),r-=3}if(r===2){if(t.available()<7)throw new M;var a=t.readBits(7);if(a>=100)throw new M;n.append(e.toAlphaNumericChar(Math.floor(a/10))),n.append(e.toAlphaNumericChar(a%10))}else if(r===1){if(t.available()<4)throw new M;var o=t.readBits(4);if(o>=10)throw new M;n.append(e.toAlphaNumericChar(o))}},e.parseECIValue=function(e){var t=e.readBits(8);if(!(t&128))return t&127;if((t&192)==128){var n=e.readBits(8);return(t&63)<<8|n}if((t&224)==192){var r=e.readBits(16);return(t&31)<<16|r}throw new M},e.ALPHANUMERIC_CHARS=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`,e.GB2312_SUBSET=1,e}(),ei=function(){function e(e){this.mirrored=e}return e.prototype.isMirrored=function(){return this.mirrored},e.prototype.applyMirroredCorrection=function(e){if(!(!this.mirrored||e===null||e.length<3)){var t=e[0];e[0]=e[2],e[2]=t}},e}(),ti=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},ni=function(){function e(){this.rsDecoder=new dt(ot.QR_CODE_FIELD_256)}return e.prototype.decodeBooleanArray=function(e,t){return this.decodeBitMatrix(Pe.parseFromBooleanArray(e),t)},e.prototype.decodeBitMatrix=function(e,t){var n=new Yr(e),r=null;try{return this.decodeBitMatrixParser(n,t)}catch(e){r=e}try{n.remask(),n.setMirror(!0),n.readVersion(),n.readFormatInformation(),n.mirror();var i=this.decodeBitMatrixParser(n,t);return i.setOther(new ei(!0)),i}catch(e){throw r===null?e:r}},e.prototype.decodeBitMatrixParser=function(e,t){var n,r,i,a,o=e.readVersion(),s=e.readFormatInformation().getErrorCorrectionLevel(),c=e.readCodewords(),l=Zr.getDataBlocks(c,o,s),u=0;try{for(var d=ti(l),f=d.next();!f.done;f=d.next()){var p=f.value;u+=p.getNumDataCodewords()}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}var m=new Uint8Array(u),h=0;try{for(var g=ti(l),_=g.next();!_.done;_=g.next()){var p=_.value,v=p.getCodewords(),y=p.getNumDataCodewords();this.correctErrors(v,y);for(var b=0;b<y;b++)m[h++]=v[b]}}catch(e){i={error:e}}finally{try{_&&!_.done&&(a=g.return)&&a.call(g)}finally{if(i)throw i.error}}return $r.decode(m,o,s,t)},e.prototype.correctErrors=function(e,t){var n=new Int32Array(e);try{this.rsDecoder.decode(n,e.length-t)}catch{throw new O}for(var r=0;r<t;r++)e[r]=n[r]},e}(),ri=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ii=function(e){ri(t,e);function t(t,n,r){var i=e.call(this,t,n)||this;return i.estimatedModuleSize=r,i}return t.prototype.aboutEquals=function(e,t,n){if(Math.abs(t-this.getY())<=e&&Math.abs(n-this.getX())<=e){var r=Math.abs(e-this.estimatedModuleSize);return r<=1||r<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(e,n,r){return new t((this.getX()+n)/2,(this.getY()+e)/2,(this.estimatedModuleSize+r)/2)},t}(z),ai=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},oi=function(){function e(e,t,n,r,i,a,o){this.image=e,this.startX=t,this.startY=n,this.width=r,this.height=i,this.moduleSize=a,this.resultPointCallback=o,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return e.prototype.find=function(){for(var e=this.startX,t=this.height,n=e+this.width,r=this.startY+t/2,i=new Int32Array(3),a=this.image,o=0;o<t;o++){var s=r+(o&1?-Math.floor((o+1)/2):Math.floor((o+1)/2));i[0]=0,i[1]=0,i[2]=0;for(var c=e;c<n&&!a.get(c,s);)c++;for(var l=0;c<n;){if(a.get(c,s)){if(l===1)i[1]++;else if(l===2){if(this.foundPatternCross(i)){var u=this.handlePossibleCenter(i,s,c);if(u!==null)return u}i[0]=i[2],i[1]=1,i[2]=0,l=1}else i[++l]++}else l===1&&l++,i[l]++;c++}if(this.foundPatternCross(i)){var u=this.handlePossibleCenter(i,s,n);if(u!==null)return u}}if(this.possibleCenters.length!==0)return this.possibleCenters[0];throw new I},e.centerFromEnd=function(e,t){return t-e[2]-e[1]/2},e.prototype.foundPatternCross=function(e){for(var t=this.moduleSize,n=t/2,r=0;r<3;r++)if(Math.abs(t-e[r])>=n)return!1;return!0},e.prototype.crossCheckVertical=function(t,n,r,i){var a=this.image,o=a.getHeight(),s=this.crossCheckStateCount;s[0]=0,s[1]=0,s[2]=0;for(var c=t;c>=0&&a.get(n,c)&&s[1]<=r;)s[1]++,c--;if(c<0||s[1]>r)return NaN;for(;c>=0&&!a.get(n,c)&&s[0]<=r;)s[0]++,c--;if(s[0]>r)return NaN;for(c=t+1;c<o&&a.get(n,c)&&s[1]<=r;)s[1]++,c++;if(c===o||s[1]>r)return NaN;for(;c<o&&!a.get(n,c)&&s[2]<=r;)s[2]++,c++;if(s[2]>r)return NaN;var l=s[0]+s[1]+s[2];return 5*Math.abs(l-i)>=2*i?NaN:this.foundPatternCross(s)?e.centerFromEnd(s,c):NaN},e.prototype.handlePossibleCenter=function(t,n,r){var i,a,o=t[0]+t[1]+t[2],s=e.centerFromEnd(t,r),c=this.crossCheckVertical(n,s,2*t[1],o);if(!isNaN(c)){var l=(t[0]+t[1]+t[2])/3;try{for(var u=ai(this.possibleCenters),d=u.next();!d.done;d=u.next()){var f=d.value;if(f.aboutEquals(l,c,s))return f.combineEstimate(c,s,l)}}catch(e){i={error:e}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(i)throw i.error}}var p=new ii(s,c,l);this.possibleCenters.push(p),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(p)}return null},e}(),si=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ci=function(e){si(t,e);function t(t,n,r,i){var a=e.call(this,t,n)||this;return a.estimatedModuleSize=r,a.count=i,i===void 0&&(a.count=1),a}return t.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},t.prototype.getCount=function(){return this.count},t.prototype.aboutEquals=function(e,t,n){if(Math.abs(t-this.getY())<=e&&Math.abs(n-this.getX())<=e){var r=Math.abs(e-this.estimatedModuleSize);return r<=1||r<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(e,n,r){var i=this.count+1;return new t((this.count*this.getX()+n)/i,(this.count*this.getY()+e)/i,(this.count*this.estimatedModuleSize+r)/i,i)},t}(z),li=function(){function e(e){this.bottomLeft=e[0],this.topLeft=e[1],this.topRight=e[2]}return e.prototype.getBottomLeft=function(){return this.bottomLeft},e.prototype.getTopLeft=function(){return this.topLeft},e.prototype.getTopRight=function(){return this.topRight},e}(),ui=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},di=function(){function e(e,t){this.image=e,this.resultPointCallback=t,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=t}return e.prototype.getImage=function(){return this.image},e.prototype.getPossibleCenters=function(){return this.possibleCenters},e.prototype.find=function(t){var n=t!=null&&t.get(j.TRY_HARDER)!==void 0,r=t!=null&&t.get(j.PURE_BARCODE)!==void 0,i=this.image,a=i.getHeight(),o=i.getWidth(),s=Math.floor(3*a/(4*e.MAX_MODULES));(s<e.MIN_SKIP||n)&&(s=e.MIN_SKIP);for(var c=!1,l=new Int32Array(5),u=s-1;u<a&&!c;u+=s){l.fill(0);for(var d=0,f=0;f<o;f++)if(i.get(f,u))(d&1)==1&&d++,l[d]++;else if(d&1)l[d]++;else if(d===4){if(e.foundPatternCross(l)){var p=this.handlePossibleCenter(l,u,f,r);if(p===!0){if(s=2,this.hasSkipped===!0)c=this.haveMultiplyConfirmedCenters();else{var m=this.findRowSkip();m>l[2]&&(u+=m-l[2]-s,f=o-1)}}else{l[0]=l[2],l[1]=l[3],l[2]=l[4],l[3]=1,l[4]=0,d=3;continue}d=0,l.fill(0)}else l[0]=l[2],l[1]=l[3],l[2]=l[4],l[3]=1,l[4]=0,d=3}else l[++d]++;if(e.foundPatternCross(l)){var p=this.handlePossibleCenter(l,u,o,r);p===!0&&(s=l[0],this.hasSkipped&&(c=this.haveMultiplyConfirmedCenters()))}}var h=this.selectBestPatterns();return z.orderBestPatterns(h),new li(h)},e.centerFromEnd=function(e,t){return t-e[4]-e[3]-e[2]/2},e.foundPatternCross=function(e){for(var t=0,n=0;n<5;n++){var r=e[n];if(r===0)return!1;t+=r}if(t<7)return!1;var i=t/7,a=i/2;return Math.abs(i-e[0])<a&&Math.abs(i-e[1])<a&&Math.abs(3*i-e[2])<3*a&&Math.abs(i-e[3])<a&&Math.abs(i-e[4])<a},e.prototype.getCrossCheckStateCount=function(){return this.crossCheckStateCount.fill(0),this.crossCheckStateCount},e.prototype.crossCheckDiagonal=function(t,n,r,i){for(var a=this.getCrossCheckStateCount(),o=0,s=this.image;t>=o&&n>=o&&s.get(n-o,t-o);)a[2]++,o++;if(t<o||n<o)return!1;for(;t>=o&&n>=o&&!s.get(n-o,t-o)&&a[1]<=r;)a[1]++,o++;if(t<o||n<o||a[1]>r)return!1;for(;t>=o&&n>=o&&s.get(n-o,t-o)&&a[0]<=r;)a[0]++,o++;if(a[0]>r)return!1;var c=s.getHeight(),l=s.getWidth();for(o=1;t+o<c&&n+o<l&&s.get(n+o,t+o);)a[2]++,o++;if(t+o>=c||n+o>=l)return!1;for(;t+o<c&&n+o<l&&!s.get(n+o,t+o)&&a[3]<r;)a[3]++,o++;if(t+o>=c||n+o>=l||a[3]>=r)return!1;for(;t+o<c&&n+o<l&&s.get(n+o,t+o)&&a[4]<r;)a[4]++,o++;if(a[4]>=r)return!1;var u=a[0]+a[1]+a[2]+a[3]+a[4];return Math.abs(u-i)<2*i&&e.foundPatternCross(a)},e.prototype.crossCheckVertical=function(t,n,r,i){for(var a=this.image,o=a.getHeight(),s=this.getCrossCheckStateCount(),c=t;c>=0&&a.get(n,c);)s[2]++,c--;if(c<0)return NaN;for(;c>=0&&!a.get(n,c)&&s[1]<=r;)s[1]++,c--;if(c<0||s[1]>r)return NaN;for(;c>=0&&a.get(n,c)&&s[0]<=r;)s[0]++,c--;if(s[0]>r)return NaN;for(c=t+1;c<o&&a.get(n,c);)s[2]++,c++;if(c===o)return NaN;for(;c<o&&!a.get(n,c)&&s[3]<r;)s[3]++,c++;if(c===o||s[3]>=r)return NaN;for(;c<o&&a.get(n,c)&&s[4]<r;)s[4]++,c++;if(s[4]>=r)return NaN;var l=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(l-i)>=2*i?NaN:e.foundPatternCross(s)?e.centerFromEnd(s,c):NaN},e.prototype.crossCheckHorizontal=function(t,n,r,i){for(var a=this.image,o=a.getWidth(),s=this.getCrossCheckStateCount(),c=t;c>=0&&a.get(c,n);)s[2]++,c--;if(c<0)return NaN;for(;c>=0&&!a.get(c,n)&&s[1]<=r;)s[1]++,c--;if(c<0||s[1]>r)return NaN;for(;c>=0&&a.get(c,n)&&s[0]<=r;)s[0]++,c--;if(s[0]>r)return NaN;for(c=t+1;c<o&&a.get(c,n);)s[2]++,c++;if(c===o)return NaN;for(;c<o&&!a.get(c,n)&&s[3]<r;)s[3]++,c++;if(c===o||s[3]>=r)return NaN;for(;c<o&&a.get(c,n)&&s[4]<r;)s[4]++,c++;if(s[4]>=r)return NaN;var l=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(l-i)>=i?NaN:e.foundPatternCross(s)?e.centerFromEnd(s,c):NaN},e.prototype.handlePossibleCenter=function(t,n,r,i){var a=t[0]+t[1]+t[2]+t[3]+t[4],o=e.centerFromEnd(t,r),s=this.crossCheckVertical(n,Math.floor(o),t[2],a);if(!isNaN(s)&&(o=this.crossCheckHorizontal(Math.floor(o),Math.floor(s),t[2],a),!isNaN(o)&&(!i||this.crossCheckDiagonal(Math.floor(s),Math.floor(o),t[2],a)))){for(var c=a/7,l=!1,u=this.possibleCenters,d=0,f=u.length;d<f;d++){var p=u[d];if(p.aboutEquals(c,s,o)){u[d]=p.combineEstimate(s,o,c),l=!0;break}}if(!l){var m=new ci(o,s,c);u.push(m),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(m)}return!0}return!1},e.prototype.findRowSkip=function(){var t,n;if(this.possibleCenters.length<=1)return 0;var r=null;try{for(var i=ui(this.possibleCenters),a=i.next();!a.done;a=i.next()){var o=a.value;if(o.getCount()>=e.CENTER_QUORUM){if(r==null)r=o;else return this.hasSkipped=!0,Math.floor((Math.abs(r.getX()-o.getX())-Math.abs(r.getY()-o.getY()))/2)}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return 0},e.prototype.haveMultiplyConfirmedCenters=function(){var t,n,r,i,a=0,o=0,s=this.possibleCenters.length;try{for(var c=ui(this.possibleCenters),l=c.next();!l.done;l=c.next()){var u=l.value;u.getCount()>=e.CENTER_QUORUM&&(a++,o+=u.getEstimatedModuleSize())}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}if(a<3)return!1;var d=o/s,f=0;try{for(var p=ui(this.possibleCenters),m=p.next();!m.done;m=p.next()){var u=m.value;f+=Math.abs(u.getEstimatedModuleSize()-d)}}catch(e){r={error:e}}finally{try{m&&!m.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}return f<=.05*o},e.prototype.selectBestPatterns=function(){var e,t,n,r,i=this.possibleCenters.length;if(i<3)throw new I;var a=this.possibleCenters,o;if(i>3){var s=0,c=0;try{for(var l=ui(this.possibleCenters),u=l.next();!u.done;u=l.next()){var d=u.value.getEstimatedModuleSize();s+=d,c+=d*d}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}o=s/i;var f=Math.sqrt(c/i-o*o);a.sort(function(e,t){var n=Math.abs(t.getEstimatedModuleSize()-o),r=Math.abs(e.getEstimatedModuleSize()-o);return n<r?-1:+(n>r)});for(var p=Math.max(.2*o,f),m=0;m<a.length&&a.length>3;m++){var h=a[m];Math.abs(h.getEstimatedModuleSize()-o)>p&&(a.splice(m,1),m--)}}if(a.length>3){var s=0;try{for(var g=ui(a),_=g.next();!_.done;_=g.next()){var v=_.value;s+=v.getEstimatedModuleSize()}}catch(e){n={error:e}}finally{try{_&&!_.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}o=s/a.length,a.sort(function(e,t){if(t.getCount()===e.getCount()){var n=Math.abs(t.getEstimatedModuleSize()-o),r=Math.abs(e.getEstimatedModuleSize()-o);return n<r?1:n>r?-1:0}return t.getCount()-e.getCount()}),a.splice(3)}return[a[0],a[1],a[2]]},e.CENTER_QUORUM=2,e.MIN_SKIP=3,e.MAX_MODULES=57,e}(),fi=function(){function e(e){this.image=e}return e.prototype.getImage=function(){return this.image},e.prototype.getResultPointCallback=function(){return this.resultPointCallback},e.prototype.detect=function(e){this.resultPointCallback=e==null?null:e.get(j.NEED_RESULT_POINT_CALLBACK);var t=new di(this.image,this.resultPointCallback).find(e);return this.processFinderPatternInfo(t)},e.prototype.processFinderPatternInfo=function(t){var n=t.getTopLeft(),r=t.getTopRight(),i=t.getBottomLeft(),a=this.calculateModuleSize(n,r,i);if(a<1)throw new I(`No pattern found in proccess finder.`);var o=e.computeDimension(n,r,i,a),s=Kr.getProvisionalVersionForDimension(o),c=s.getDimensionForVersion()-7,l=null;if(s.getAlignmentPatternCenters().length>0)for(var u=r.getX()-n.getX()+i.getX(),d=r.getY()-n.getY()+i.getY(),f=1-3/c,p=Math.floor(n.getX()+f*(u-n.getX())),m=Math.floor(n.getY()+f*(d-n.getY())),h=4;h<=16;h<<=1)try{l=this.findAlignmentInRegion(a,p,m,h);break}catch(e){if(!(e instanceof I))throw e}var g=e.createTransform(n,r,i,l,o);return new ht(e.sampleGrid(this.image,g,o),l===null?[i,n,r]:[i,n,r,l])},e.createTransform=function(e,t,n,r,i){var a=i-3.5,o,s,c,l;return r===null?(o=t.getX()-e.getX()+n.getX(),s=t.getY()-e.getY()+n.getY(),c=a,l=a):(o=r.getX(),s=r.getY(),c=a-3,l=c),bt.quadrilateralToQuadrilateral(3.5,3.5,a,3.5,c,l,3.5,a,e.getX(),e.getY(),t.getX(),t.getY(),o,s,n.getX(),n.getY())},e.sampleGrid=function(e,t,n){return Ct.getInstance().sampleGridWithTransform(e,n,n,t)},e.computeDimension=function(e,t,n,r){var i=R.round(z.distance(e,t)/r),a=R.round(z.distance(e,n)/r),o=Math.floor((i+a)/2)+7;switch(o&3){case 0:o++;break;case 2:o--;break;case 3:throw new I(`Dimensions could be not found.`)}return o},e.prototype.calculateModuleSize=function(e,t,n){return(this.calculateModuleSizeOneWay(e,t)+this.calculateModuleSizeOneWay(e,n))/2},e.prototype.calculateModuleSizeOneWay=function(e,t){var n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY())),r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY()));return isNaN(n)?r/7:isNaN(r)?n/7:(n+r)/14},e.prototype.sizeOfBlackWhiteBlackRunBothWays=function(e,t,n,r){var i=this.sizeOfBlackWhiteBlackRun(e,t,n,r),a=1,o=e-(n-e);o<0?(a=e/(e-o),o=0):o>=this.image.getWidth()&&(a=(this.image.getWidth()-1-e)/(o-e),o=this.image.getWidth()-1);var s=Math.floor(t-(r-t)*a);return a=1,s<0?(a=t/(t-s),s=0):s>=this.image.getHeight()&&(a=(this.image.getHeight()-1-t)/(s-t),s=this.image.getHeight()-1),o=Math.floor(e+(o-e)*a),i+=this.sizeOfBlackWhiteBlackRun(e,t,o,s),i-1},e.prototype.sizeOfBlackWhiteBlackRun=function(e,t,n,r){var i=Math.abs(r-t)>Math.abs(n-e);if(i){var a=e;e=t,t=a,a=n,n=r,r=a}for(var o=Math.abs(n-e),s=Math.abs(r-t),c=-o/2,l=e<n?1:-1,u=t<r?1:-1,d=0,f=n+l,p=e,m=t;p!==f;p+=l){var h=i?m:p,g=i?p:m;if(d===1===this.image.get(h,g)){if(d===2)return R.distance(p,m,e,t);d++}if(c+=s,c>0){if(m===r)break;m+=u,c-=o}}return d===2?R.distance(n+l,r,e,t):NaN},e.prototype.findAlignmentInRegion=function(e,t,n,r){var i=Math.floor(r*e),a=Math.max(0,t-i),o=Math.min(this.image.getWidth()-1,t+i);if(o-a<e*3)throw new I(`Alignment top exceeds estimated module size.`);var s=Math.max(0,n-i),c=Math.min(this.image.getHeight()-1,n+i);if(c-s<e*3)throw new I(`Alignment bottom exceeds estimated module size.`);return new oi(this.image,a,s,o-a,c-s,e,this.resultPointCallback).find()},e}(),pi=function(){function e(){this.decoder=new ni}return e.prototype.getDecoder=function(){return this.decoder},e.prototype.decode=function(t,n){var r,i;if(n!=null&&n.get(j.PURE_BARCODE)!==void 0){var a=e.extractPureBits(t.getBlackMatrix());r=this.decoder.decodeBitMatrix(a,n),i=e.NO_POINTS}else{var o=new fi(t.getBlackMatrix()).detect(n);r=this.decoder.decodeBitMatrix(o.getBits(),n),i=o.getPoints()}r.getOther()instanceof ei&&r.getOther().applyMirroredCorrection(i);var s=new Xe(r.getText(),r.getRawBytes(),void 0,i,L.QR_CODE,void 0),c=r.getByteSegments();c!==null&&s.putMetadata($e.BYTE_SEGMENTS,c);var l=r.getECLevel();return l!==null&&s.putMetadata($e.ERROR_CORRECTION_LEVEL,l),r.hasStructuredAppend()&&(s.putMetadata($e.STRUCTURED_APPEND_SEQUENCE,r.getStructuredAppendSequenceNumber()),s.putMetadata($e.STRUCTURED_APPEND_PARITY,r.getStructuredAppendParity())),s},e.prototype.reset=function(){},e.extractPureBits=function(e){var t=e.getTopLeftOnBit(),n=e.getBottomRightOnBit();if(t===null||n===null)throw new I;var r=this.moduleSize(t,e),i=t[1],a=n[1],o=t[0],s=n[0];if(o>=s||i>=a||a-i!==s-o&&(s=o+(a-i),s>=e.getWidth()))throw new I;var c=Math.round((s-o+1)/r),l=Math.round((a-i+1)/r);if(c<=0||l<=0||l!==c)throw new I;var u=Math.floor(r/2);i+=u,o+=u;var d=o+Math.floor((c-1)*r)-s;if(d>0){if(d>u)throw new I;o-=d}var f=i+Math.floor((l-1)*r)-a;if(f>0){if(f>u)throw new I;i-=f}for(var p=new Pe(c,l),m=0;m<l;m++)for(var h=i+Math.floor(m*r),g=0;g<c;g++)e.get(o+Math.floor(g*r),h)&&p.set(g,m);return p},e.moduleSize=function(e,t){for(var n=t.getHeight(),r=t.getWidth(),i=e[0],a=e[1],o=!0,s=0;i<r&&a<n;){if(o!==t.get(i,a)){if(++s===5)break;o=!o}i++,a++}if(i===r||a===n)throw new I;return(i-e[0])/7},e.NO_POINTS=[],e}(),mi=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},hi=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},gi=function(){function e(e){this.versionIndicator=e>>2&7,this.dataMask=e&3}return e.computeBCHFormatWord=function(t){for(var n=t<<10,r=4;r>=0;r--)n>>r+10&1&&(n^=e.BCH_GENERATOR<<r);return t<<10|n&1023},e.buildLookupTable=function(){for(var t=[],n=0;n<32;n++){var r=e.computeBCHFormatWord(n)^e.FORMAT_INFO_MASK_MICRO_QR;t.push([r,n])}return t},e.numBitsDiffering=function(e,t){return A.bitCount(e^t)},e.decodeFormatInformation=function(t){var n,r,i,a;try{for(var o=mi(e.FORMAT_INFO_DECODE_LOOKUP),s=o.next();!s.done;s=o.next()){var c=hi(s.value,2),l=c[0],u=c[1];if(l===t)return new e(u)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}var d=2**53-1,f=0;try{for(var p=mi(e.FORMAT_INFO_DECODE_LOOKUP),m=p.next();!m.done;m=p.next()){var h=hi(m.value,2),l=h[0],u=h[1],g=e.numBitsDiffering(t,l);g<d&&(d=g,f=u)}}catch(e){i={error:e}}finally{try{m&&!m.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}return d<=3?new e(f):null},e.prototype.getVersionIndicator=function(){return this.versionIndicator},e.prototype.getDataMask=function(){return this.dataMask},e.prototype.getMicroQRVersionNumber=function(){return this.versionIndicator===0?1:this.versionIndicator<=2?2:this.versionIndicator<=4?3:4},e.prototype.getECLevelLabel=function(){switch(this.versionIndicator){case 0:return null;case 1:case 3:case 5:return`L`;case 2:case 4:case 6:return`M`;case 7:return`Q`;default:return null}},e.FORMAT_INFO_MASK_MICRO_QR=17477,e.BCH_GENERATOR=1335,e.FORMAT_INFO_DECODE_LOOKUP=e.buildLookupTable(),e}(),_i=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},vi=function(){function e(e,t,n){this.versionNumber=e,this.versionIndicator=t,this.ecBlocks=n;var r=n,i=r.getECBlocks()[0];this.totalCodewords=i.getCount()*(i.getDataCodewords()+r.getECCodewordsPerBlock())}return e.prototype.getVersionNumber=function(){return this.versionNumber},e.prototype.getVersionIndicator=function(){return this.versionIndicator},e.prototype.getDimensionForVersion=function(){return 9+2*this.versionNumber},e.prototype.getTotalCodewords=function(){return this.totalCodewords},e.prototype.getNumDataCodewords=function(){return this.ecBlocks.getECBlocks()[0].getDataCodewords()},e.prototype.getNumECCodewords=function(){return this.totalCodewords-this.getNumDataCodewords()},e.prototype.getECBlocks=function(){return this.ecBlocks},e.prototype.getECLevelLabel=function(){return e.VERSION_INFO[this.versionIndicator][1]},e.prototype.getModeIndicatorBits=function(){return e.MODE_INDICATOR_BITS[this.versionNumber-1]},e.prototype.buildFunctionPattern=function(){var e=this.getDimensionForVersion(),t=new Pe(e);return t.setRegion(0,0,9,9),e>9&&(t.setRegion(9,0,e-9,1),t.setRegion(0,9,1,e-9)),t},e.getVersionForIndicator=function(t){if(t<0||t>7)throw new M;var n=_i(e.VERSION_INFO[t],1)[0];return new e(n,t,e.EC_BLOCKS[t])},e.getVersionForDimension=function(t){switch(t){case 11:return e.getVersionForIndicator(0);case 13:return e.getVersionForIndicator(1);case 15:return e.getVersionForIndicator(3);case 17:return e.getVersionForIndicator(5);default:throw new M}},e.prototype.toString=function(){return`M`+this.versionNumber},e.VERSION_INFO=[[1,null],[2,`L`],[2,`M`],[3,`L`],[3,`M`],[4,`L`],[4,`M`],[4,`Q`]],e.EC_BLOCKS=[new H(2,new U(1,3)),new H(5,new U(1,5)),new H(6,new U(1,4)),new H(6,new U(1,11)),new H(8,new U(1,9)),new H(8,new U(1,16)),new H(10,new U(1,14)),new H(14,new U(1,10))],e.MODE_INDICATOR_BITS=[0,1,2,3],e}(),yi=function(){function e(e,t){this.maskIndex=e,this.isMasked=t}return e.forIndex=function(t){if(t<0||t>=e.MASKS.length)throw Error(`Invalid Micro QR mask index: `+t);return e.MASKS[t]},e.prototype.unmaskBitMatrix=function(e,t){for(var n=0;n<t;n++)for(var r=0;r<t;r++)this.isMasked(n,r)&&e.flip(r,n)},e.MASKS=[new e(0,function(e,t){return!(e&1)}),new e(1,function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2==0}),new e(2,function(e,t){var n=e*t;return((n&1)+n%3)%2==0}),new e(3,function(e,t){return((e+t&1)+e*t%3)%2==0})],e}(),bi=function(){function e(e){this.bitMatrix=e,this.parsedFormatInfo=null,this.parsedVersion=null;var t=e.getHeight();if(t<11||t>17||t%2!=1)throw new M}return e.prototype.readFormatInformation=function(){if(this.parsedFormatInfo!==null)return this.parsedFormatInfo;for(var e=0,t=1;t<=8;t++)e=this.copyBit(t,8,e);for(var n=7;n>=1;n--)e=this.copyBit(8,n,e);var r=gi.decodeFormatInformation(e);if(r!==null)return this.parsedFormatInfo=r,this.parsedVersion=vi.getVersionForIndicator(r.getVersionIndicator()),r;throw new M},e.prototype.copyBit=function(e,t,n){return this.bitMatrix.get(e,t)?n<<1|1:n<<1},e.prototype.readCodewords=function(){var e=this.readFormatInformation(),t=this.parsedVersion,n=yi.forIndex(e.getDataMask()),r=this.bitMatrix.getHeight();n.unmaskBitMatrix(this.bitMatrix,r);for(var i=t.buildFunctionPattern(),a=t.getNumDataCodewords(),o=t.getVersionNumber()===1||t.getVersionNumber()===3,s=!0,c=new Uint8Array(t.getTotalCodewords()),l=0,u=0,d=0,f=r-1;f>0;f-=2){for(var p=0;p<r;p++)for(var m=s?r-1-p:p,h=0;h<2;h++){var g=f-h;if(!i.get(g,m)){d++,u<<=1,this.bitMatrix.get(g,m)&&(u|=1);var _=o&&l===a-1;d===(_?4:8)&&(c[l++]=_?u<<4&255:u&255,d=0,u=0)}}s=!s}if(l!==t.getTotalCodewords())throw new M;return c},e}(),xi=function(){function e(){}return e.decode=function(t,n,r){var i=new Mr(t),a=new F,o=[],s=n.getVersionNumber(),c=n.getModeIndicatorBits();try{for(;;){var l=void 0;if(c===0)l=e.MODE_NUMERIC;else{if(i.available()<c)break;var u=i.readBits(c);l=e.decodeMode(u,s)}var d=e.charCountBits(l,s);if(i.available()<d)break;var f=i.readBits(d);if(f===0)break;switch(l){case e.MODE_NUMERIC:e.decodeNumeric(i,a,f);break;case e.MODE_ALPHA:e.decodeAlphanumeric(i,a,f);break;case e.MODE_BYTE:e.decodeByte(i,a,o,f,r);break;case e.MODE_KANJI:e.decodeKanji(i,a,f);break;default:throw new M}}}catch(e){throw e instanceof M?e:new M}return new et(t,a.toString(),o.length===0?null:o,n.getECLevelLabel(),-1,-1)},e.decodeMode=function(t,n){switch(n){case 2:return t===0?e.MODE_NUMERIC:e.MODE_ALPHA;case 3:switch(t){case 0:return e.MODE_NUMERIC;case 1:return e.MODE_ALPHA;case 2:return e.MODE_BYTE;case 3:return e.MODE_KANJI}break;case 4:switch(t){case 0:return e.MODE_NUMERIC;case 1:return e.MODE_ALPHA;case 2:return e.MODE_BYTE;case 4:return e.MODE_KANJI}}throw new M},e.charCountBits=function(t,n){switch(t){case e.MODE_NUMERIC:return n+2;case e.MODE_ALPHA:return n+1;case e.MODE_BYTE:return n+1;case e.MODE_KANJI:return n;default:throw new M}},e.decodeNumeric=function(t,n,r){for(var i=r;i>=3;){if(t.available()<10)throw new M;var a=t.readBits(10);if(a>=1e3)throw new M;n.append(e.toChar(Math.floor(a/100))),n.append(e.toChar(Math.floor(a/10)%10)),n.append(e.toChar(a%10)),i-=3}if(i===2){if(t.available()<7)throw new M;var o=t.readBits(7);if(o>=100)throw new M;n.append(e.toChar(Math.floor(o/10))),n.append(e.toChar(o%10))}else if(i===1){if(t.available()<4)throw new M;var s=t.readBits(4);if(s>=10)throw new M;n.append(e.toChar(s))}},e.decodeAlphanumeric=function(t,n,r){for(var i=r;i>1;){if(t.available()<11)throw new M;var a=t.readBits(11);n.append(e.toAlphaNum(Math.floor(a/45))),n.append(e.toAlphaNum(a%45)),i-=2}if(i===1){if(t.available()<6)throw new M;n.append(e.toAlphaNum(t.readBits(6)))}},e.decodeByte=function(e,t,n,r,i){if(8*r>e.available())throw new M;for(var a=new Uint8Array(r),o=0;o<r;o++)a[o]=e.readBits(8)&255;var s=P.guessEncoding(a,i);try{t.append(Ne.decode(a,s))}catch{throw new M}n.push(a)},e.decodeKanji=function(e,t,n){if(13*n>e.available())throw new M;for(var r=new Uint8Array(2*n),i=0,a=0;a<n;a++){var o=e.readBits(13),s=Math.floor(o/192)<<8|o%192;s+=s<7936?33088:49472,r[i++]=s>>8&255,r[i++]=s&255}try{t.append(Ne.decode(r,P.SHIFT_JIS))}catch{throw new M}},e.toChar=function(t){if(t>=e.ALPHANUMERIC_CHARS.length)throw new M;return e.ALPHANUMERIC_CHARS[t]},e.toAlphaNum=function(t){if(t>=e.ALPHANUMERIC_CHARS.length)throw new M;return e.ALPHANUMERIC_CHARS[t]},e.ALPHANUMERIC_CHARS=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`,e.MODE_NUMERIC=0,e.MODE_ALPHA=1,e.MODE_BYTE=2,e.MODE_KANJI=3,e}(),Si=function(){function e(){this.rsDecoder=new dt(ot.QR_CODE_FIELD_256)}return e.prototype.decodeBitMatrix=function(e,t){var n=new bi(e),r=n.readFormatInformation(),i=vi.getVersionForIndicator(r.getVersionIndicator()),a=n.readCodewords(),o=i.getNumDataCodewords();return i.getNumECCodewords(),i.getVersionNumber()===1||this.correctErrors(a,o),xi.decode(a.subarray(0,o),i,t??null)},e.prototype.correctErrors=function(e,t){var n=new Int32Array(e);try{this.rsDecoder.decode(n,e.length-t)}catch{throw new O}for(var r=0;r<t;r++)e[r]=n[r]&255},e}(),Ci=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),wi=function(e){Ci(t,e);function t(t,n,r,i){i===void 0&&(i=1);var a=e.call(this,t,n)||this;return a.estimatedModuleSize=r,a.count=i,a}return t.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},t.prototype.getCount=function(){return this.count},t.prototype.aboutEquals=function(e,t,n){if(Math.abs(t-this.getY())<=e&&Math.abs(n-this.getX())<=e){var r=Math.abs(e-this.estimatedModuleSize);return r<=1||r<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(e,n,r){var i=this.count+1;return new t((this.count*this.getX()+n)/i,(this.count*this.getY()+e)/i,(this.count*this.estimatedModuleSize+r)/i,i)},t}(z),Ti=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Ei=function(){function e(e){this.image=e}return e.prototype.detect=function(e){this.resultPointCallback=e==null?null:e.get(j.NEED_RESULT_POINT_CALLBACK)??null;var t=this.findFinderPattern(e);return this.processFinderPattern(t)},e.prototype.findFinderPattern=function(e){for(var t=this.image,n=t.getHeight(),r=t.getWidth(),i=e!=null&&e.get(j.TRY_HARDER)!==void 0?1:Math.max(1,Math.floor(n/64)),a=new Int32Array(5),o=[],s=i-1;s<n;s+=i){a.fill(0);for(var c=0,l=0;l<r;l++)if(t.get(l,s))(c&1)==1&&c++,a[c]++;else if(c&1)a[c]++;else{if(c===4){if(this.foundPatternCross(a)&&this.handlePossibleCenter(a,s,l,o)){a.fill(0),c=0;continue}a[0]=a[2],a[1]=a[3],a[2]=a[4],a[3]=1,a[4]=0,c=3;continue}a[++c]++}this.foundPatternCross(a)&&this.handlePossibleCenter(a,s,r,o)}if(o.length===0)throw new I(`No Micro QR finder pattern found.`);return o.sort(function(e,t){return t.getCount()-e.getCount()}),o[0]},e.prototype.foundPatternCross=function(e){for(var t=0,n=0;n<5;n++){var r=e[n];if(r===0)return!1;t+=r}if(t<7)return!1;var i=t/7,a=i/2;return Math.abs(i-e[0])<a&&Math.abs(i-e[1])<a&&Math.abs(3*i-e[2])<3*a&&Math.abs(i-e[3])<a&&Math.abs(i-e[4])<a},e.prototype.handlePossibleCenter=function(e,t,n,r){var i=e[0]+e[1]+e[2]+e[3]+e[4],a=this.centerFromEnd(e,n),o=this.crossCheckVertical(t,Math.floor(a),e[2],i);if(isNaN(o))return!1;for(var s=(e[0]+e[1]+e[2]+e[3]+e[4])/7,c=0;c<r.length;c++){var l=r[c];if(l.aboutEquals(s,o,a))return r[c]=l.combineEstimate(o,a,s),!0}return r.push(new wi(a,o,s)),this.resultPointCallback!==null&&this.resultPointCallback.foundPossibleResultPoint(r[r.length-1]),!1},e.prototype.centerFromEnd=function(e,t){return t-e[4]-e[3]-e[2]/2},e.prototype.crossCheckVertical=function(e,t,n,r){for(var i=this.image,a=i.getHeight(),o=new Int32Array(5),s=e;s>=0&&i.get(t,s);)o[2]++,s--;if(s<0)return NaN;for(;s>=0&&!i.get(t,s)&&o[1]<=r;)o[1]++,s--;if(s<0||o[1]>r)return NaN;for(;s>=0&&i.get(t,s)&&o[0]<=r;)o[0]++,s--;if(o[0]>r)return NaN;for(s=e+1;s<a&&i.get(t,s);)o[2]++,s++;if(s===a)return NaN;for(;s<a&&!i.get(t,s)&&o[3]<r;)o[3]++,s++;if(s===a||o[3]>=r)return NaN;for(;s<a&&i.get(t,s)&&o[4]<r;)o[4]++,s++;if(o[4]>=r)return NaN;var c=o[0]+o[1]+o[2]+o[3]+o[4];return 5*Math.abs(c-r)>=2*r?NaN:this.foundPatternCross(o)?this.centerFromEnd(o,s):NaN},e.prototype.processFinderPattern=function(t){var n=t.getX(),r=t.getY(),i=t.getEstimatedModuleSize();if(i<1)throw new I(`Module size too small.`);var a=this.determineDimension(n,r,i);if(a===null)throw new I(`Cannot determine Micro QR symbol dimension.`);var o=a.dim,s=a.orientation,c=(o-7)*i,l=[c,0,-c,0][s],u=[0,c,0,-c][s],d=[0,-c,0,c][s],f=[c,0,-c,0][s],p=n+l,m=r+u,h=n+d,g=r+f,_=e.createTransform(n,r,p,m,h,g,o);return new ht(e.sampleGrid(this.image,_,o),[new z(n,r),new z(p,m),new z(h,g)])},e.prototype.determineDimension=function(e,t,n){for(var r=[[5,-3,1,0,-3,5,0,1],[3,5,0,1,-5,-3,-1,0],[-5,3,-1,0,3,-5,0,-1],[-3,-5,0,-1,5,3,1,0]],i=null,a=0;a<4;a++){var o=Ti(r[a],8),s=o[0],c=o[1],l=o[2],u=o[3],d=o[4],f=o[5],p=o[6],m=o[7],h=this.probeTimingLine(e+s*n,t+c*n,l,u,n),g=this.probeTimingLine(e+d*n,t+f*n,p,m,n);if(h!==null&&g!==null){var _=this.snapDimension(h,g);if(_!==null)return{dim:_,orientation:a}}else if(i===null&&(h!==null||g!==null)){var _=this.snapDimension(h,g);_!==null&&(i={dim:_,orientation:a})}}return i},e.prototype.snapDimension=function(e,t){if(e===null)return t;if(t===null||e===t)return e;var n=Math.round((e+t)/2);return[11,13,15,17].reduce(function(e,t){return Math.abs(t-n)<Math.abs(e-n)?t:e})},e.prototype.probeTimingLine=function(e,t,n,r,i){for(var a=0,o=0;o<10;o++){var s=8+o,c=Math.round(e+n*o*i),l=Math.round(t+r*o*i);if(c<0||c>=this.image.getWidth()||l<0||l>=this.image.getHeight())break;var u=this.image.get(c,l),d=s%2==0;if(u!==d)break;d&&a++}if(a<2)return null;var f=8+2*a-1;if(f===11||f===13||f===15||f===17)return f;var p=[11,13,15,17].reduce(function(e,t){return Math.abs(t-f)<Math.abs(e-f)?t:e});return Math.abs(p-f)<=2?p:null},e.createTransform=function(e,t,n,r,i,a,o){var s=o-3.5;return bt.quadrilateralToQuadrilateral(3.5,3.5,s,3.5,3.5,s,s,s,e,t,n,r,i,a,n+(i-e),r+(a-t))},e.sampleGrid=function(e,t,n){return Ct.getInstance().sampleGridWithTransform(e,n,n,t)},e}(),Di=function(){function e(){this.decoder=new Si}return e.prototype.decode=function(e,t){var n,r;if(t!=null&&t.get(j.PURE_BARCODE)!==void 0){var i=e.getBlackMatrix();n=this.decoder.decodeBitMatrix(i,t??void 0),r=[]}else{var a=new Ei(e.getBlackMatrix()).detect(t??void 0);r=a.getPoints(),n=this.decoder.decodeBitMatrix(a.getBits(),t??void 0)}var o=new Xe(n.getText(),n.getRawBytes(),n.getNumBits(),r,L.MICRO_QR_CODE,k.currentTimeMillis()),s=n.getByteSegments();s!==null&&o.putMetadata($e.BYTE_SEGMENTS,s);var c=n.getECLevel();return c!==null&&o.putMetadata($e.ERROR_CORRECTION_LEVEL,c),o},e.prototype.reset=function(){},e}(),Oi=function(){function e(e){this.bitMatrix=e}return e.prototype.readCodewords=function(){for(var t=new Uint8Array(144),n=this.bitMatrix.getHeight(),r=this.bitMatrix.getWidth(),i=0;i<n;i++)for(var a=e.BITNR[i],o=0;o<r;o++){var s=a[o];s>=0&&this.bitMatrix.get(o,i)&&(t[Math.floor(s/6)]|=1<<5-s%6)}return t},e.BITNR=[[121,120,127,126,133,132,139,138,145,144,151,150,157,156,163,162,169,168,175,174,181,180,187,186,193,192,199,198,-2,-2],[123,122,129,128,135,134,141,140,147,146,153,152,159,158,165,164,171,170,177,176,183,182,189,188,195,194,201,200,816,-3],[125,124,131,130,137,136,143,142,149,148,155,154,161,160,167,166,173,172,179,178,185,184,191,190,197,196,203,202,818,817],[283,282,277,276,271,270,265,264,259,258,253,252,247,246,241,240,235,234,229,228,223,222,217,216,211,210,205,204,819,-3],[285,284,279,278,273,272,267,266,261,260,255,254,249,248,243,242,237,236,231,230,225,224,219,218,213,212,207,206,821,820],[287,286,281,280,275,274,269,268,263,262,257,256,251,250,245,244,239,238,233,232,227,226,221,220,215,214,209,208,822,-3],[289,288,295,294,301,300,307,306,313,312,319,318,325,324,331,330,337,336,343,342,349,348,355,354,361,360,367,366,824,823],[291,290,297,296,303,302,309,308,315,314,321,320,327,326,333,332,339,338,345,344,351,350,357,356,363,362,369,368,825,-3],[293,292,299,298,305,304,311,310,317,316,323,322,329,328,335,334,341,340,347,346,353,352,359,358,365,364,371,370,827,826],[409,408,403,402,397,396,391,390,79,78,-2,-2,13,12,37,36,2,-1,44,43,109,108,385,384,379,378,373,372,828,-3],[411,410,405,404,399,398,393,392,81,80,40,-2,15,14,39,38,3,-1,-1,45,111,110,387,386,381,380,375,374,830,829],[413,412,407,406,401,400,395,394,83,82,41,-3,-3,-3,-3,-3,5,4,47,46,113,112,389,388,383,382,377,376,831,-3],[415,414,421,420,427,426,103,102,55,54,16,-3,-3,-3,-3,-3,-3,-3,20,19,85,84,433,432,439,438,445,444,833,832],[417,416,423,422,429,428,105,104,57,56,-3,-3,-3,-3,-3,-3,-3,-3,22,21,87,86,435,434,441,440,447,446,834,-3],[419,418,425,424,431,430,107,106,59,58,-3,-3,-3,-3,-3,-3,-3,-3,-3,23,89,88,437,436,443,442,449,448,836,835],[481,480,475,474,469,468,48,-2,30,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,0,53,52,463,462,457,456,451,450,837,-3],[483,482,477,476,471,470,49,-1,-2,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-2,-1,465,464,459,458,453,452,839,838],[485,484,479,478,473,472,51,50,31,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,1,-2,42,467,466,461,460,455,454,840,-3],[487,486,493,492,499,498,97,96,61,60,-3,-3,-3,-3,-3,-3,-3,-3,-3,26,91,90,505,504,511,510,517,516,842,841],[489,488,495,494,501,500,99,98,63,62,-3,-3,-3,-3,-3,-3,-3,-3,28,27,93,92,507,506,513,512,519,518,843,-3],[491,490,497,496,503,502,101,100,65,64,17,-3,-3,-3,-3,-3,-3,-3,18,29,95,94,509,508,515,514,521,520,845,844],[559,558,553,552,547,546,541,540,73,72,32,-3,-3,-3,-3,-3,-3,10,67,66,115,114,535,534,529,528,523,522,846,-3],[561,560,555,554,549,548,543,542,75,74,-2,-1,7,6,35,34,11,-2,69,68,117,116,537,536,531,530,525,524,848,847],[563,562,557,556,551,550,545,544,77,76,-2,33,9,8,25,24,-1,-2,71,70,119,118,539,538,533,532,527,526,849,-3],[565,564,571,570,577,576,583,582,589,588,595,594,601,600,607,606,613,612,619,618,625,624,631,630,637,636,643,642,851,850],[567,566,573,572,579,578,585,584,591,590,597,596,603,602,609,608,615,614,621,620,627,626,633,632,639,638,645,644,852,-3],[569,568,575,574,581,580,587,586,593,592,599,598,605,604,611,610,617,616,623,622,629,628,635,634,641,640,647,646,854,853],[727,726,721,720,715,714,709,708,703,702,697,696,691,690,685,684,679,678,673,672,667,666,661,660,655,654,649,648,855,-3],[729,728,723,722,717,716,711,710,705,704,699,698,693,692,687,686,681,680,675,674,669,668,663,662,657,656,651,650,857,856],[731,730,725,724,719,718,713,712,707,706,701,700,695,694,689,688,683,682,677,676,671,670,665,664,659,658,653,652,858,-3],[733,732,739,738,745,744,751,750,757,756,763,762,769,768,775,774,781,780,787,786,793,792,799,798,805,804,811,810,860,859],[735,734,741,740,747,746,753,752,759,758,765,764,771,770,777,776,783,782,789,788,795,794,801,800,807,806,813,812,861,-3],[737,736,743,742,749,748,755,754,761,760,767,766,773,772,779,778,785,784,791,790,797,796,803,802,809,808,815,814,863,862]],e}(),ki=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Ai=function(){function e(){}return e.decode=function(t,n){var r=[];switch(n){case 2:case 3:var i=void 0;if(n===2){var a=e.getPostCode2(t),o=e.getPostCode2Length(t);if(o>10)throw M.getFormatInstance();i=String(a).padStart(o,`0`)}else i=e.getPostCode3(t);var s=String(e.getCountry(t)).padStart(3,`0`),c=String(e.getServiceClass(t)).padStart(3,`0`),l=e.getMessage(t,10,84);r.push(l),r.join(``).startsWith(`[)>`+e.RS+`01`+e.GS)?(r.splice(0,r.length),r.push(l.substring(0,9)),r.push(i+e.GS+s+e.GS+c+e.GS),r.push(l.substring(9))):(r.splice(0,r.length),r.push(i+e.GS+s+e.GS+c+e.GS),r.push(l));break;case 4:r.push(e.getMessage(t,1,93));break;case 5:r.push(e.getMessage(t,1,77))}return new et(t,r.join(``),null,String(n))},e.getBit=function(e,t){return e--,t[Math.floor(e/6)]&1<<5-e%6?1:0},e.getInt=function(t,n){for(var r=0,i=0;i<n.length;i++)r+=e.getBit(n[i],t)<<n.length-i-1;return r},e.getCountry=function(t){return e.getInt(t,e.COUNTRY_BYTES)},e.getServiceClass=function(t){return e.getInt(t,e.SERVICE_CLASS_BYTES)},e.getPostCode2Length=function(t){return e.getInt(t,e.POSTCODE_2_LENGTH_BYTES)},e.getPostCode2=function(t){return e.getInt(t,e.POSTCODE_2_BYTES)},e.getPostCode3=function(t){var n,r,i=[];try{for(var a=ki(e.POSTCODE_3_BYTES),o=a.next();!o.done;o=a.next()){var s=o.value;i.push(e.SETS[0].charAt(e.getInt(t,s)))}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i.join(``)},e.getMessage=function(t,n,r){for(var i=[],a=-1,o=0,s=0,c=n;c<n+r;c++){var l=e.SETS[o].charAt(t[c]);switch(l){case e.LATCHA:o=0,a=-1;break;case e.LATCHB:o=1,a=-1;break;case e.SHIFTA:case e.SHIFTB:case e.SHIFTC:case e.SHIFTD:case e.SHIFTE:s=o,o=l.charCodeAt(0)-e.SHIFTA.charCodeAt(0),a=1;break;case e.TWOSHIFTA:s=o,o=0,a=2;break;case e.THREESHIFTA:s=o,o=0,a=3;break;case e.NS:var u=(t[++c]<<24)+(t[++c]<<18)+(t[++c]<<12)+(t[++c]<<6)+t[++c];i.push(String(u).padStart(9,`0`));break;case e.LOCK:a=-1;break;default:i.push(l)}a--===0&&(o=s)}for(;i.length>0&&i[i.length-1]===e.PAD;)i.pop();return i.join(``)},e.SHIFTA=`￰`,e.SHIFTB=`￱`,e.SHIFTC=`￲`,e.SHIFTD=`￳`,e.SHIFTE=`￴`,e.TWOSHIFTA=`￵`,e.THREESHIFTA=`￶`,e.LATCHA=`￷`,e.LATCHB=`￸`,e.LOCK=``,e.ECI=``,e.NS=``,e.PAD=``,e.FS=``,e.GS=``,e.RS=``,e.COUNTRY_BYTES=[53,54,43,44,45,46,47,48,37,38],e.SERVICE_CLASS_BYTES=[55,56,57,58,59,60,49,50,51,52],e.POSTCODE_2_LENGTH_BYTES=[39,40,41,42,31,32],e.POSTCODE_2_BYTES=[33,34,35,36,25,26,27,28,29,30,19,20,21,22,23,24,13,14,15,16,17,18,7,8,9,10,11,12,1,2],e.POSTCODE_3_BYTES=[[39,40,41,42,31,32],[33,34,35,36,25,26],[27,28,29,30,19,20],[21,22,23,24,13,14],[15,16,17,18,7,8],[9,10,11,12,1,2]],e.SETS=[`\rABCDEFGHIJKLMNOPQRSTUVWXYZ`+e.ECI+e.FS+e.GS+e.RS+e.NS+` `+e.PAD+`"#$%&'()*+,-./0123456789:`+e.SHIFTB+e.SHIFTC+e.SHIFTD+e.SHIFTE+e.LATCHB,"`abcdefghijklmnopqrstuvwxyz"+e.ECI+e.FS+e.GS+e.RS+e.NS+`{`+e.PAD+`}~;<=>?[\\]^_ ,./:@!|`+e.PAD+e.TWOSHIFTA+e.THREESHIFTA+e.PAD+e.SHIFTA+e.SHIFTC+e.SHIFTD+e.SHIFTE+e.LATCHA,`ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚ`+e.ECI+e.FS+e.GS+e.RS+e.NS+`ÛÜÝÞߪ¬±²³µ¹º¼½¾€‚ƒ„…†‡ˆ‰`+e.LATCHA+` `+e.LOCK+e.SHIFTD+e.SHIFTE+e.LATCHB,`àáâãäåæçèéêëìíîïðñòóôõö÷øùú`+e.ECI+e.FS+e.GS+e.RS+e.NS+`ûüýþÿ¡¨«¯°´·¸»¿Š‹ŒŽ‘’“”`+e.LATCHA+` `+e.SHIFTC+e.LOCK+e.SHIFTE+e.LATCHB,`\0\x07\b
7
+ \v\f\r`+e.ECI+e.PAD+e.PAD+`\x1B`+e.NS+e.FS+e.GS+e.RS+`Ÿ\xA0¢£¤¥¦§©­®¶•–—˜™š›œž`+e.LATCHA+` `+e.SHIFTC+e.SHIFTD+e.LOCK+e.LATCHB],e}(),ji=function(){function e(){this.rsDecoder=new dt(ot.MAXICODE_FIELD_64)}return e.prototype.decode=function(t,n){var r=new Oi(t).readCodewords(),i=this.correctErrors(r,0,10,10,e.ALL),a=r[0]&15,o;switch(a){case 2:case 3:case 4:i+=this.correctErrors(r,20,84,40,e.EVEN),i+=this.correctErrors(r,20,84,40,e.ODD),o=new Uint8Array(94);break;case 5:i+=this.correctErrors(r,20,68,56,e.EVEN),i+=this.correctErrors(r,20,68,56,e.ODD),o=new Uint8Array(78);break;default:throw M.getFormatInstance()}for(var s=0;s<10;s++)o[s]=r[s];for(var s=0;s<o.length-10;s++)o[s+10]=r[s+20];var c=Ai.decode(o,a);return c.setErrorsCorrected(i),c},e.prototype.correctErrors=function(t,n,r,i,a){for(var o=r+i,s=a===e.ALL?1:2,c=new Int32Array(Math.floor(o/s)),l=0;l<o;l++)(a===e.ALL||l%2==a-1)&&(c[Math.floor(l/s)]=t[l+n]&255);var u=0;try{u=this.rsDecoder.decodeWithECCount(c,Math.floor(i/s))}catch(e){throw e instanceof ct?O.getChecksumInstance():e}for(var l=0;l<r;l++)(a===e.ALL||l%2==a-1)&&(t[l+n]=c[Math.floor(l/s)]);return u},e.ALL=0,e.EVEN=1,e.ODD=2,e}(),Mi=function(){function e(){this.decoder=new ji}return e.prototype.decode=function(t,n){n===void 0&&(n=null);var r=e.extractPureBits(t.getBlackMatrix()),i=this.decoder.decode(r,n),a=new Xe(i.getText(),i.getRawBytes(),8*i.getRawBytes().length,e.NO_POINTS,L.MAXICODE,k.currentTimeMillis());a.putMetadata($e.ERRORS_CORRECTED,i.getErrorsCorrected());var o=i.getECLevel();return o!=null&&a.putMetadata($e.ERROR_CORRECTION_LEVEL,o),a},e.prototype.reset=function(){},e.extractPureBits=function(t){var n=t.getEnclosingRectangle();if(n==null)throw new I;for(var r=n[0],i=n[1],a=n[2],o=n[3],s=new Pe(e.MATRIX_WIDTH,e.MATRIX_HEIGHT),c=0;c<e.MATRIX_HEIGHT;c++)for(var l=i+Math.min(Math.floor((c*o+o/2)/e.MATRIX_HEIGHT),o-1),u=0;u<e.MATRIX_WIDTH;u++){var d=r+Math.min(Math.floor((u*a+a/2+(c&1)*Math.floor(a/2))/e.MATRIX_WIDTH),a-1);t.get(d,l)&&s.set(u,c)}return s},e.NO_POINTS=[],e.MATRIX_WIDTH=30,e.MATRIX_HEIGHT=33,e}(),Ni=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},G=function(){function e(){}return e.prototype.PDF417Common=function(){},e.getBitCountSum=function(e){return R.sum(e)},e.toIntArray=function(t){var n,r;if(t==null||!t.length)return e.EMPTY_INT_ARRAY;var i=new Int32Array(t.length),a=0;try{for(var o=Ni(t),s=o.next();!s.done;s=o.next()){var c=s.value;i[a++]=c}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},e.getCodeword=function(t){var n=Te.binarySearch(e.SYMBOL_TABLE,t&262143);return n<0?-1:(e.CODEWORD_TABLE[n]-1)%e.NUMBER_OF_CODEWORDS},e.NUMBER_OF_CODEWORDS=929,e.MAX_CODEWORDS_IN_BARCODE=e.NUMBER_OF_CODEWORDS-1,e.MIN_ROWS_IN_BARCODE=3,e.MAX_ROWS_IN_BARCODE=90,e.MODULES_IN_CODEWORD=17,e.MODULES_IN_STOP_PATTERN=18,e.BARS_IN_MODULE=8,e.EMPTY_INT_ARRAY=new Int32Array([]),e.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),e.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]),e}(),Pi=function(){function e(e,t){this.bits=e,this.points=t}return e.prototype.getBits=function(){return this.bits},e.prototype.getPoints=function(){return this.points},e}(),Fi=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Ii=function(){function e(){}return e.detectMultiple=function(t,n,r){var i=t.getBlackMatrix(),a=e.detect(r,i);return a.length||(i=i.clone(),i.rotate180(),a=e.detect(r,i)),new Pi(i,a)},e.detect=function(t,n){for(var r,i,a=[],o=0,s=0,c=!1;o<n.getHeight();){var l=e.findVertices(n,o,s);if(l[0]==null&&l[3]==null){if(!c)break;c=!1,s=0;try{for(var u=(r=void 0,Fi(a)),d=u.next();!d.done;d=u.next()){var f=d.value;f[1]!=null&&(o=Math.trunc(Math.max(o,f[1].getY()))),f[3]!=null&&(o=Math.max(o,Math.trunc(f[3].getY())))}}catch(e){r={error:e}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}o+=e.ROW_STEP}else{if(c=!0,a.push(l),!t)break;l[2]==null?(s=Math.trunc(l[4].getX()),o=Math.trunc(l[4].getY())):(s=Math.trunc(l[2].getX()),o=Math.trunc(l[2].getY()))}}return a},e.findVertices=function(t,n,r){var i=t.getHeight(),a=t.getWidth(),o=Array(8);return e.copyToResult(o,e.findRowsWithPattern(t,i,a,n,r,e.START_PATTERN),e.INDEXES_START_PATTERN),o[4]!=null&&(r=Math.trunc(o[4].getX()),n=Math.trunc(o[4].getY())),e.copyToResult(o,e.findRowsWithPattern(t,i,a,n,r,e.STOP_PATTERN),e.INDEXES_STOP_PATTERN),o},e.copyToResult=function(e,t,n){for(var r=0;r<n.length;r++)e[n[r]]=t[r]},e.findRowsWithPattern=function(t,n,r,i,a,o){for(var s=[,,,,],c=!1,l=new Int32Array(o.length);i<n;i+=e.ROW_STEP){var u=e.findGuardPattern(t,a,i,r,!1,o,l);if(u!=null){for(;i>0;){var d=e.findGuardPattern(t,a,--i,r,!1,o,l);if(d!=null)u=d;else{i++;break}}s[0]=new z(u[0],i),s[1]=new z(u[1],i),c=!0;break}}var f=i+1;if(c){for(var p=0,d=Int32Array.from([Math.trunc(s[0].getX()),Math.trunc(s[1].getX())]);f<n;f++){var u=e.findGuardPattern(t,d[0],f,r,!1,o,l);if(u!=null&&Math.abs(d[0]-u[0])<e.MAX_PATTERN_DRIFT&&Math.abs(d[1]-u[1])<e.MAX_PATTERN_DRIFT)d=u,p=0;else if(p>e.SKIPPED_ROW_COUNT_MAX)break;else p++}f-=p+1,s[2]=new z(d[0],f),s[3]=new z(d[1],f)}return f-i<e.BARCODE_MIN_HEIGHT&&Te.fill(s,null),s},e.findGuardPattern=function(t,n,r,i,a,o,s){Te.fillWithin(s,0,s.length,0);for(var c=n,l=0;t.get(c,r)&&c>0&&l++<e.MAX_PIXEL_DRIFT;)c--;for(var u=c,d=0,f=o.length,p=a;u<i;u++)if(t.get(u,r)!==p)s[d]++;else{if(d===f-1){if(e.patternMatchVariance(s,o,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return new Int32Array([c,u]);c+=s[0]+s[1],k.arraycopy(s,2,s,0,d-1),s[d-1]=0,s[d]=0,d--}else d++;s[d]=1,p=!p}return d===f-1&&e.patternMatchVariance(s,o,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE?new Int32Array([c,u-1]):null},e.patternMatchVariance=function(e,t,n){for(var r=e.length,i=0,a=0,o=0;o<r;o++)i+=e[o],a+=t[o];if(i<a)return 1/0;var s=i/a;n*=s;for(var c=0,l=0;l<r;l++){var u=e[l],d=t[l]*s,f=u>d?u-d:d-u;if(f>n)return 1/0;c+=f}return c/i},e.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),e.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),e.MAX_AVG_VARIANCE=.42,e.MAX_INDIVIDUAL_VARIANCE=.8,e.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),e.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),e.MAX_PIXEL_DRIFT=3,e.MAX_PATTERN_DRIFT=5,e.SKIPPED_ROW_COUNT_MAX=25,e.ROW_STEP=5,e.BARCODE_MIN_HEIGHT=10,e}(),Li=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Ri=function(){function e(e,t){if(t.length===0)throw new D;this.field=e;var n=t.length;if(n>1&&t[0]===0){for(var r=1;r<n&&t[r]===0;)r++;r===n?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(n-r),k.arraycopy(t,r,this.coefficients,0,this.coefficients.length))}else this.coefficients=t}return e.prototype.getCoefficients=function(){return this.coefficients},e.prototype.getDegree=function(){return this.coefficients.length-1},e.prototype.isZero=function(){return this.coefficients[0]===0},e.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},e.prototype.evaluateAt=function(e){var t,n;if(e===0)return this.getCoefficient(0);if(e===1){var r=0;try{for(var i=Li(this.coefficients),a=i.next();!a.done;a=i.next()){var o=a.value;r=this.field.add(r,o)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}for(var s=this.coefficients[0],c=this.coefficients.length,l=1;l<c;l++)s=this.field.add(this.field.multiply(e,s),this.coefficients[l]);return s},e.prototype.add=function(t){if(!this.field.equals(t.field))throw new D(`ModulusPolys do not have same ModulusGF field`);if(this.isZero())return t;if(t.isZero())return this;var n=this.coefficients,r=t.coefficients;if(n.length>r.length){var i=n;n=r,r=i}var a=new Int32Array(r.length),o=r.length-n.length;k.arraycopy(r,0,a,0,o);for(var s=o;s<r.length;s++)a[s]=this.field.add(n[s-o],r[s]);return new e(this.field,a)},e.prototype.subtract=function(e){if(!this.field.equals(e.field))throw new D(`ModulusPolys do not have same ModulusGF field`);return e.isZero()?this:this.add(e.negative())},e.prototype.multiply=function(t){return t instanceof e?this.multiplyOther(t):this.multiplyScalar(t)},e.prototype.multiplyOther=function(t){if(!this.field.equals(t.field))throw new D(`ModulusPolys do not have same ModulusGF field`);if(this.isZero()||t.isZero())return new e(this.field,new Int32Array([0]));for(var n=this.coefficients,r=n.length,i=t.coefficients,a=i.length,o=new Int32Array(r+a-1),s=0;s<r;s++)for(var c=n[s],l=0;l<a;l++)o[s+l]=this.field.add(o[s+l],this.field.multiply(c,i[l]));return new e(this.field,o)},e.prototype.negative=function(){for(var t=this.coefficients.length,n=new Int32Array(t),r=0;r<t;r++)n[r]=this.field.subtract(0,this.coefficients[r]);return new e(this.field,n)},e.prototype.multiplyScalar=function(t){if(t===0)return new e(this.field,new Int32Array([0]));if(t===1)return this;for(var n=this.coefficients.length,r=new Int32Array(n),i=0;i<n;i++)r[i]=this.field.multiply(this.coefficients[i],t);return new e(this.field,r)},e.prototype.multiplyByMonomial=function(t,n){if(t<0)throw new D;if(n===0)return new e(this.field,new Int32Array([0]));for(var r=this.coefficients.length,i=new Int32Array(r+t),a=0;a<r;a++)i[a]=this.field.multiply(this.coefficients[a],n);return new e(this.field,i)},e.prototype.toString=function(){for(var e=new F,t=this.getDegree();t>=0;t--){var n=this.getCoefficient(t);n!==0&&(n<0?(e.append(` - `),n=-n):e.length()>0&&e.append(` + `),(t===0||n!==1)&&e.append(n),t!==0&&(t===1?e.append(`x`):(e.append(`x^`),e.append(t))))}return e.toString()},e}(),zi=function(){function e(){}return e.prototype.add=function(e,t){return(e+t)%this.modulus},e.prototype.subtract=function(e,t){return(this.modulus+e-t)%this.modulus},e.prototype.exp=function(e){return this.expTable[e]},e.prototype.log=function(e){if(e===0)throw new D;return this.logTable[e]},e.prototype.inverse=function(e){if(e===0)throw new it;return this.expTable[this.modulus-this.logTable[e]-1]},e.prototype.multiply=function(e,t){return e===0||t===0?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.modulus-1)]},e.prototype.getSize=function(){return this.modulus},e.prototype.equals=function(e){return e===this},e}(),Bi=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Vi=function(e){Bi(t,e);function t(t,n){var r=e.call(this)||this;r.modulus=t,r.expTable=new Int32Array(t),r.logTable=new Int32Array(t);for(var i=1,a=0;a<t;a++)r.expTable[a]=i,i=i*n%t;for(var a=0;a<t-1;a++)r.logTable[r.expTable[a]]=a;return r.zero=new Ri(r,new Int32Array([0])),r.one=new Ri(r,new Int32Array([1])),r}return t.prototype.getZero=function(){return this.zero},t.prototype.getOne=function(){return this.one},t.prototype.buildMonomial=function(e,t){if(e<0)throw new D;if(t===0)return this.zero;var n=new Int32Array(e+1);return n[0]=t,new Ri(this,n)},t.PDF417_GF=new t(G.NUMBER_OF_CODEWORDS,3),t}(zi),Hi=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Ui=function(){function e(){this.field=Vi.PDF417_GF}return e.prototype.decode=function(e,t,n){for(var r,i,a=new Ri(this.field,e),o=new Int32Array(t),s=!1,c=t;c>0;c--){var l=a.evaluateAt(this.field.exp(c));o[t-c]=l,l!==0&&(s=!0)}if(!s)return 0;var u=this.field.getOne();if(n!=null)try{for(var d=Hi(n),f=d.next();!f.done;f=d.next()){var p=f.value,m=this.field.exp(e.length-1-p),h=new Ri(this.field,new Int32Array([this.field.subtract(0,m),1]));u=u.multiply(h)}}catch(e){r={error:e}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}for(var g=new Ri(this.field,o),_=this.runEuclideanAlgorithm(this.field.buildMonomial(t,1),g,t),v=_[0],y=_[1],b=this.findErrorLocations(v),x=this.findErrorMagnitudes(y,v,b),c=0;c<b.length;c++){var S=e.length-1-this.field.log(b[c]);if(S<0)throw O.getChecksumInstance();e[S]=this.field.subtract(e[S],x[c])}return b.length},e.prototype.runEuclideanAlgorithm=function(e,t,n){if(e.getDegree()<t.getDegree()){var r=e;e=t,t=r}for(var i=e,a=t,o=this.field.getZero(),s=this.field.getOne();a.getDegree()>=Math.round(n/2);){var c=i,l=o;if(i=a,o=s,i.isZero())throw O.getChecksumInstance();a=c;for(var u=this.field.getZero(),d=i.getCoefficient(i.getDegree()),f=this.field.inverse(d);a.getDegree()>=i.getDegree()&&!a.isZero();){var p=a.getDegree()-i.getDegree(),m=this.field.multiply(a.getCoefficient(a.getDegree()),f);u=u.add(this.field.buildMonomial(p,m)),a=a.subtract(i.multiplyByMonomial(p,m))}s=u.multiply(o).subtract(l).negative()}var h=s.getCoefficient(0);if(h===0)throw O.getChecksumInstance();var g=this.field.inverse(h);return[s.multiply(g),a.multiply(g)]},e.prototype.findErrorLocations=function(e){for(var t=e.getDegree(),n=new Int32Array(t),r=0,i=1;i<this.field.getSize()&&r<t;i++)e.evaluateAt(i)===0&&(n[r]=this.field.inverse(i),r++);if(r!==t)throw O.getChecksumInstance();return n},e.prototype.findErrorMagnitudes=function(e,t,n){for(var r=t.getDegree(),i=new Int32Array(r),a=1;a<=r;a++)i[r-a]=this.field.multiply(a,t.getCoefficient(a));for(var o=new Ri(this.field,i),s=n.length,c=new Int32Array(s),a=0;a<s;a++){var l=this.field.inverse(n[a]),u=this.field.subtract(0,e.evaluateAt(l)),d=this.field.inverse(o.evaluateAt(l));c[a]=this.field.multiply(u,d)}return c},e}(),Wi=function(){function e(t,n,r,i,a){t instanceof e?this.constructor_2(t):this.constructor_1(t,n,r,i,a)}return e.prototype.constructor_1=function(e,t,n,r,i){var a=t==null||n==null,o=r==null||i==null;if(a&&o)throw new I;a?(t=new z(0,r.getY()),n=new z(0,i.getY())):o&&(r=new z(e.getWidth()-1,t.getY()),i=new z(e.getWidth()-1,n.getY())),this.image=e,this.topLeft=t,this.bottomLeft=n,this.topRight=r,this.bottomRight=i,this.minX=Math.trunc(Math.min(t.getX(),n.getX())),this.maxX=Math.trunc(Math.max(r.getX(),i.getX())),this.minY=Math.trunc(Math.min(t.getY(),r.getY())),this.maxY=Math.trunc(Math.max(n.getY(),i.getY()))},e.prototype.constructor_2=function(e){this.image=e.image,this.topLeft=e.getTopLeft(),this.bottomLeft=e.getBottomLeft(),this.topRight=e.getTopRight(),this.bottomRight=e.getBottomRight(),this.minX=e.getMinX(),this.maxX=e.getMaxX(),this.minY=e.getMinY(),this.maxY=e.getMaxY()},e.merge=function(t,n){return t==null?n:n==null?t:new e(t.image,t.topLeft,t.bottomLeft,n.topRight,n.bottomRight)},e.prototype.addMissingRows=function(t,n,r){var i=this.topLeft,a=this.bottomLeft,o=this.topRight,s=this.bottomRight;if(t>0){var c=r?this.topLeft:this.topRight,l=Math.trunc(c.getY()-t);l<0&&(l=0);var u=new z(c.getX(),l);r?i=u:o=u}if(n>0){var d=r?this.bottomLeft:this.bottomRight,f=Math.trunc(d.getY()+n);f>=this.image.getHeight()&&(f=this.image.getHeight()-1);var p=new z(d.getX(),f);r?a=p:s=p}return new e(this.image,i,a,o,s)},e.prototype.getMinX=function(){return this.minX},e.prototype.getMaxX=function(){return this.maxX},e.prototype.getMinY=function(){return this.minY},e.prototype.getMaxY=function(){return this.maxY},e.prototype.getTopLeft=function(){return this.topLeft},e.prototype.getTopRight=function(){return this.topRight},e.prototype.getBottomLeft=function(){return this.bottomLeft},e.prototype.getBottomRight=function(){return this.bottomRight},e}(),Gi=function(){function e(e,t,n,r){this.columnCount=e,this.errorCorrectionLevel=r,this.rowCountUpperPart=t,this.rowCountLowerPart=n,this.rowCount=t+n}return e.prototype.getColumnCount=function(){return this.columnCount},e.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},e.prototype.getRowCount=function(){return this.rowCount},e.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},e.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},e}(),Ki=function(){function e(){this.buffer=``}return e.form=function(e,t){var n=-1;function r(e,r,i,a,o,s){if(e===`%%`)return`%`;if(t[++n]!==void 0){e=a?parseInt(a.substr(1)):void 0;var c=o?parseInt(o.substr(1)):void 0,l;switch(s){case`s`:l=t[n];break;case`c`:l=t[n][0];break;case`f`:l=parseFloat(t[n]).toFixed(e);break;case`p`:l=parseFloat(t[n]).toPrecision(e);break;case`e`:l=parseFloat(t[n]).toExponential(e);break;case`x`:l=parseInt(t[n]).toString(c||16);break;case`d`:l=parseFloat(parseInt(t[n],c||10).toPrecision(e)).toFixed(0)}l=typeof l==`object`?JSON.stringify(l):(+l).toString(c);for(var u=parseInt(i),d=i&&i[0]+``==`0`?`0`:` `;l.length<u;)l=r===void 0?d+l:l+d;return l}}return e.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,r)},e.prototype.format=function(t){var n=[...arguments].slice(1);this.buffer+=e.form(t,n)},e.prototype.toString=function(){return this.buffer},e}(),qi=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Ji=function(){function e(e){this.boundingBox=new Wi(e),this.codewords=Array(e.getMaxY()-e.getMinY()+1)}return e.prototype.getCodewordNearby=function(t){var n=this.getCodeword(t);if(n!=null)return n;for(var r=1;r<e.MAX_NEARBY_DISTANCE;r++){var i=this.imageRowToCodewordIndex(t)-r;if(i>=0&&(n=this.codewords[i],n!=null)||(i=this.imageRowToCodewordIndex(t)+r,i<this.codewords.length&&(n=this.codewords[i],n!=null)))return n}return null},e.prototype.imageRowToCodewordIndex=function(e){return e-this.boundingBox.getMinY()},e.prototype.setCodeword=function(e,t){this.codewords[this.imageRowToCodewordIndex(e)]=t},e.prototype.getCodeword=function(e){return this.codewords[this.imageRowToCodewordIndex(e)]},e.prototype.getBoundingBox=function(){return this.boundingBox},e.prototype.getCodewords=function(){return this.codewords},e.prototype.toString=function(){var e,t,n=new Ki,r=0;try{for(var i=qi(this.codewords),a=i.next();!a.done;a=i.next()){var o=a.value;o==null?n.format(`%3d: | %n`,r++):n.format(`%3d: %3d|%3d%n`,r++,o.getRowNumber(),o.getValue())}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return n.toString()},e.MAX_NEARBY_DISTANCE=5,e}(),Yi=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Xi=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Zi=function(){function e(){this.values=new Map}return e.prototype.setValue=function(e){e=Math.trunc(e);var t=this.values.get(e);t??=0,t++,this.values.set(e,t)},e.prototype.getValue=function(){var e,t,n=-1,r=[],i=function(e,t){var i={getKey:function(){return e},getValue:function(){return t}};i.getValue()>n?(n=i.getValue(),r=[],r.push(i.getKey())):i.getValue()===n&&r.push(i.getKey())};try{for(var a=Yi(this.values.entries()),o=a.next();!o.done;o=a.next()){var s=Xi(o.value,2),c=s[0],l=s[1];i(c,l)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return G.toIntArray(r)},e.prototype.getConfidence=function(e){return this.values.get(e)},e}(),Qi=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),$i=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},ea=function(e){Qi(t,e);function t(t,n){var r=e.call(this,t)||this;return r._isLeft=n,r}return t.prototype.setRowNumbers=function(){var e,t;try{for(var n=$i(this.getCodewords()),r=n.next();!r.done;r=n.next())r.value?.setRowNumberAsRowIndicatorColumn()}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},t.prototype.adjustCompleteIndicatorColumnRowNumbers=function(e){var t=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(t,e);for(var n=this.getBoundingBox(),r=this._isLeft?n.getTopLeft():n.getTopRight(),i=this._isLeft?n.getBottomLeft():n.getBottomRight(),a=this.imageRowToCodewordIndex(Math.trunc(r.getY())),o=this.imageRowToCodewordIndex(Math.trunc(i.getY())),s=-1,c=1,l=0,u=a;u<o;u++)if(t[u]!=null){var d=t[u],f=d.getRowNumber()-s;if(f===0)l++;else if(f===1)c=Math.max(c,l),l=1,s=d.getRowNumber();else if(f<0||d.getRowNumber()>=e.getRowCount()||f>u)t[u]=null;else{var p=void 0;p=c>2?(c-2)*f:f;for(var m=p>=u,h=1;h<=p&&!m;h++)m=t[u-h]!=null;m?t[u]=null:(s=d.getRowNumber(),l=1)}}},t.prototype.getRowHeights=function(){var e,t,n=this.getBarcodeMetadata();if(n==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(n);var r=new Int32Array(n.getRowCount());try{for(var i=$i(this.getCodewords()),a=i.next();!a.done;a=i.next()){var o=a.value;if(o!=null){var s=o.getRowNumber();if(s>=r.length)continue;r[s]++}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return r},t.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(e){for(var t=this.getBoundingBox(),n=this._isLeft?t.getTopLeft():t.getTopRight(),r=this._isLeft?t.getBottomLeft():t.getBottomRight(),i=this.imageRowToCodewordIndex(Math.trunc(n.getY())),a=this.imageRowToCodewordIndex(Math.trunc(r.getY())),o=this.getCodewords(),s=-1,c=1,l=0,u=i;u<a;u++)if(o[u]!=null){var d=o[u];d.setRowNumberAsRowIndicatorColumn();var f=d.getRowNumber()-s;f===0?l++:f===1?(c=Math.max(c,l),l=1,s=d.getRowNumber()):d.getRowNumber()>=e.getRowCount()?o[u]=null:(s=d.getRowNumber(),l=1)}},t.prototype.getBarcodeMetadata=function(){var e,t,n=this.getCodewords(),r=new Zi,i=new Zi,a=new Zi,o=new Zi;try{for(var s=$i(n),c=s.next();!c.done;c=s.next()){var l=c.value;if(l!=null){l.setRowNumberAsRowIndicatorColumn();var u=l.getValue()%30,d=l.getRowNumber();switch(this._isLeft||(d+=2),d%3){case 0:i.setValue(u*3+1);break;case 1:o.setValue(u/3),a.setValue(u%3);break;case 2:r.setValue(u+1)}}}}catch(t){e={error:t}}finally{try{c&&!c.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}if(r.getValue().length===0||i.getValue().length===0||a.getValue().length===0||o.getValue().length===0||r.getValue()[0]<1||i.getValue()[0]+a.getValue()[0]<G.MIN_ROWS_IN_BARCODE||i.getValue()[0]+a.getValue()[0]>G.MAX_ROWS_IN_BARCODE)return null;var f=new Gi(r.getValue()[0],i.getValue()[0],a.getValue()[0],o.getValue()[0]);return this.removeIncorrectCodewords(n,f),f},t.prototype.removeIncorrectCodewords=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(e[n]!=null){var i=r.getValue()%30,a=r.getRowNumber();if(a>t.getRowCount())e[n]=null;else switch(this._isLeft||(a+=2),a%3){case 0:i*3+1!==t.getRowCountUpperPart()&&(e[n]=null);break;case 1:(Math.trunc(i/3)!==t.getErrorCorrectionLevel()||i%3!==t.getRowCountLowerPart())&&(e[n]=null);break;case 2:i+1!==t.getColumnCount()&&(e[n]=null)}}}},t.prototype.isLeft=function(){return this._isLeft},t.prototype.toString=function(){return`IsLeft: `+this._isLeft+`
8
+ `+e.prototype.toString.call(this)},t}(Ji),ta=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},na=function(){function e(e,t){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=e,this.barcodeColumnCount=e.getColumnCount(),this.boundingBox=t,this.detectionResultColumns=Array(this.barcodeColumnCount+2)}return e.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var e=G.MAX_CODEWORDS_IN_BARCODE,t;do t=e,e=this.adjustRowNumbersAndGetCount();while(e>0&&e<t);return this.detectionResultColumns},e.prototype.adjustIndicatorColumnRowNumbers=function(e){e?.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)},e.prototype.adjustRowNumbersAndGetCount=function(){var e=this.adjustRowNumbersByRow();if(e===0)return 0;for(var t=1;t<this.barcodeColumnCount+1;t++)for(var n=this.detectionResultColumns[t].getCodewords(),r=0;r<n.length;r++)n[r]!=null&&(n[r].hasValidRowNumber()||this.adjustRowNumbers(t,r,n));return e},e.prototype.adjustRowNumbersByRow=function(){return this.adjustRowNumbersFromBothRI(),this.adjustRowNumbersFromLRI()+this.adjustRowNumbersFromRRI()},e.prototype.adjustRowNumbersFromBothRI=function(){if(this.detectionResultColumns[0]!=null&&this.detectionResultColumns[this.barcodeColumnCount+1]!=null){for(var e=this.detectionResultColumns[0].getCodewords(),t=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),n=0;n<e.length;n++)if(e[n]!=null&&t[n]!=null&&e[n].getRowNumber()===t[n].getRowNumber())for(var r=1;r<=this.barcodeColumnCount;r++){var i=this.detectionResultColumns[r].getCodewords()[n];i!=null&&(i.setRowNumber(e[n].getRowNumber()),i.hasValidRowNumber()||(this.detectionResultColumns[r].getCodewords()[n]=null))}}},e.prototype.adjustRowNumbersFromRRI=function(){if(this.detectionResultColumns[this.barcodeColumnCount+1]==null)return 0;for(var t=0,n=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),r=0;r<n.length;r++)if(n[r]!=null)for(var i=n[r].getRowNumber(),a=0,o=this.barcodeColumnCount+1;o>0&&a<this.ADJUST_ROW_NUMBER_SKIP;o--){var s=this.detectionResultColumns[o].getCodewords()[r];s!=null&&(a=e.adjustRowNumberIfValid(i,a,s),s.hasValidRowNumber()||t++)}return t},e.prototype.adjustRowNumbersFromLRI=function(){if(this.detectionResultColumns[0]==null)return 0;for(var t=0,n=this.detectionResultColumns[0].getCodewords(),r=0;r<n.length;r++)if(n[r]!=null)for(var i=n[r].getRowNumber(),a=0,o=1;o<this.barcodeColumnCount+1&&a<this.ADJUST_ROW_NUMBER_SKIP;o++){var s=this.detectionResultColumns[o].getCodewords()[r];s!=null&&(a=e.adjustRowNumberIfValid(i,a,s),s.hasValidRowNumber()||t++)}return t},e.adjustRowNumberIfValid=function(e,t,n){return n==null||n.hasValidRowNumber()||(n.isValidRowNumber(e)?(n.setRowNumber(e),t=0):++t),t},e.prototype.adjustRowNumbers=function(t,n,r){var i,a;if(this.detectionResultColumns[t-1]!=null){var o=r[n],s=this.detectionResultColumns[t-1].getCodewords(),c=s;this.detectionResultColumns[t+1]!=null&&(c=this.detectionResultColumns[t+1].getCodewords());var l=Array(14);l[2]=s[n],l[3]=c[n],n>0&&(l[0]=r[n-1],l[4]=s[n-1],l[5]=c[n-1]),n>1&&(l[8]=r[n-2],l[10]=s[n-2],l[11]=c[n-2]),n<r.length-1&&(l[1]=r[n+1],l[6]=s[n+1],l[7]=c[n+1]),n<r.length-2&&(l[9]=r[n+2],l[12]=s[n+2],l[13]=c[n+2]);try{for(var u=ta(l),d=u.next();!d.done;d=u.next()){var f=d.value;if(e.adjustRowNumber(o,f))return}}catch(e){i={error:e}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(i)throw i.error}}}},e.adjustRowNumber=function(e,t){return t==null?!1:t.hasValidRowNumber()&&t.getBucket()===e.getBucket()?(e.setRowNumber(t.getRowNumber()),!0):!1},e.prototype.getBarcodeColumnCount=function(){return this.barcodeColumnCount},e.prototype.getBarcodeRowCount=function(){return this.barcodeMetadata.getRowCount()},e.prototype.getBarcodeECLevel=function(){return this.barcodeMetadata.getErrorCorrectionLevel()},e.prototype.setBoundingBox=function(e){this.boundingBox=e},e.prototype.getBoundingBox=function(){return this.boundingBox},e.prototype.setDetectionResultColumn=function(e,t){this.detectionResultColumns[e]=t},e.prototype.getDetectionResultColumn=function(e){return this.detectionResultColumns[e]},e.prototype.toString=function(){var e=this.detectionResultColumns[0];e??=this.detectionResultColumns[this.barcodeColumnCount+1];for(var t=new Ki,n=0;n<e.getCodewords().length;n++){t.format(`CW %3d:`,n);for(var r=0;r<this.barcodeColumnCount+2;r++)if(this.detectionResultColumns[r]==null)t.format(` | `);else{var i=this.detectionResultColumns[r].getCodewords()[n];i==null?t.format(` | `):t.format(` %3d|%3d`,i.getRowNumber(),i.getValue())}t.format(`%n`)}return t.toString()},e}(),ra=function(){function e(t,n,r,i){this.rowNumber=e.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(t),this.endX=Math.trunc(n),this.bucket=Math.trunc(r),this.value=Math.trunc(i)}return e.prototype.hasValidRowNumber=function(){return this.isValidRowNumber(this.rowNumber)},e.prototype.isValidRowNumber=function(t){return t!==e.BARCODE_ROW_UNKNOWN&&this.bucket===t%3*3},e.prototype.setRowNumberAsRowIndicatorColumn=function(){this.rowNumber=Math.trunc(Math.trunc(this.value/30)*3+Math.trunc(this.bucket/3))},e.prototype.getWidth=function(){return this.endX-this.startX},e.prototype.getStartX=function(){return this.startX},e.prototype.getEndX=function(){return this.endX},e.prototype.getBucket=function(){return this.bucket},e.prototype.getValue=function(){return this.value},e.prototype.getRowNumber=function(){return this.rowNumber},e.prototype.setRowNumber=function(e){this.rowNumber=e},e.prototype.toString=function(){return this.rowNumber+`|`+this.value},e.BARCODE_ROW_UNKNOWN=-1,e}(),ia=function(){function e(){}return e.initialize=function(){for(var t=0;t<G.SYMBOL_TABLE.length;t++)for(var n=G.SYMBOL_TABLE[t],r=n&1,i=0;i<G.BARS_IN_MODULE;i++){for(var a=0;(n&1)===r;)a+=1,n>>=1;r=n&1,e.RATIOS_TABLE[t]||(e.RATIOS_TABLE[t]=Array(G.BARS_IN_MODULE)),e.RATIOS_TABLE[t][G.BARS_IN_MODULE-i-1]=Math.fround(a/G.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},e.getDecodedValue=function(t){var n=e.getDecodedCodewordValue(e.sampleBitCounts(t));return n===-1?e.getClosestDecodedValue(t):n},e.sampleBitCounts=function(e){for(var t=R.sum(e),n=new Int32Array(G.BARS_IN_MODULE),r=0,i=0,a=0;a<G.MODULES_IN_CODEWORD;a++){var o=t/(2*G.MODULES_IN_CODEWORD)+a*t/G.MODULES_IN_CODEWORD;i+e[r]<=o&&(i+=e[r],r++),n[r]++}return n},e.getDecodedCodewordValue=function(t){var n=e.getBitValue(t);return G.getCodeword(n)===-1?-1:n},e.getBitValue=function(e){for(var t=0,n=0;n<e.length;n++)for(var r=0;r<e[n];r++)t=t<<1|n%2==0;return Math.trunc(t)},e.getClosestDecodedValue=function(t){var n=R.sum(t),r=Array(G.BARS_IN_MODULE);if(n>1)for(var i=0;i<r.length;i++)r[i]=Math.fround(t[i]/n);var a=mt.MAX_VALUE,o=-1;this.bSymbolTableReady||e.initialize();for(var s=0;s<e.RATIOS_TABLE.length;s++){for(var c=0,l=e.RATIOS_TABLE[s],u=0;u<G.BARS_IN_MODULE;u++){var d=Math.fround(l[u]-r[u]);if(c+=Math.fround(d*d),c>=a)break}c<a&&(a=c,o=G.SYMBOL_TABLE[s])}return o},e.bSymbolTableReady=!1,e.RATIOS_TABLE=Array(G.SYMBOL_TABLE.length).map(function(e){return e=Array(G.BARS_IN_MODULE)}),e}(),aa=function(){function e(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}return e.prototype.getSegmentIndex=function(){return this.segmentIndex},e.prototype.setSegmentIndex=function(e){this.segmentIndex=e},e.prototype.getFileId=function(){return this.fileId},e.prototype.setFileId=function(e){this.fileId=e},e.prototype.getOptionalData=function(){return this.optionalData},e.prototype.setOptionalData=function(e){this.optionalData=e},e.prototype.isLastSegment=function(){return this.lastSegment},e.prototype.setLastSegment=function(e){this.lastSegment=e},e.prototype.getSegmentCount=function(){return this.segmentCount},e.prototype.setSegmentCount=function(e){this.segmentCount=e},e.prototype.getSender=function(){return this.sender||null},e.prototype.setSender=function(e){this.sender=e},e.prototype.getAddressee=function(){return this.addressee||null},e.prototype.setAddressee=function(e){this.addressee=e},e.prototype.getFileName=function(){return this.fileName},e.prototype.setFileName=function(e){this.fileName=e},e.prototype.getFileSize=function(){return this.fileSize},e.prototype.setFileSize=function(e){this.fileSize=e},e.prototype.getChecksum=function(){return this.checksum},e.prototype.setChecksum=function(e){this.checksum=e},e.prototype.getTimestamp=function(){return this.timestamp},e.prototype.setTimestamp=function(e){this.timestamp=e},e}(),oa=function(){function e(){}return e.parseLong=function(e,t){return t===void 0&&(t=void 0),parseInt(e,t)},e}(),sa=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ca=function(e){sa(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.kind=`NullPointerException`,t}(pe),la=function(){function e(){}return e.prototype.writeBytes=function(e){this.writeBytesOffset(e,0,e.length)},e.prototype.writeBytesOffset=function(e,t,n){if(e==null)throw new ca;if(t<0||t>e.length||n<0||t+n>e.length||t+n<0)throw new xe;if(n!==0)for(var r=0;r<n;r++)this.write(e[t+r])},e.prototype.flush=function(){},e.prototype.close=function(){},e}(),ua=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),da=function(e){ua(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(pe),fa=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),pa=function(e){fa(t,e);function t(t){t===void 0&&(t=32);var n=e.call(this)||this;if(n.count=0,t<0)throw new D(`Negative initial size: `+t);return n.buf=new Uint8Array(t),n}return t.prototype.ensureCapacity=function(e){e-this.buf.length>0&&this.grow(e)},t.prototype.grow=function(e){var t=this.buf.length<<1;if(t-e<0&&(t=e),t<0){if(e<0)throw new da;t=A.MAX_VALUE}this.buf=Te.copyOfUint8Array(this.buf,t)},t.prototype.write=function(e){this.ensureCapacity(this.count+1),this.buf[this.count]=e,this.count+=1},t.prototype.writeBytesOffset=function(e,t,n){if(t<0||t>e.length||n<0||t+n-e.length>0)throw new xe;this.ensureCapacity(this.count+n),k.arraycopy(e,t,this.buf,this.count,n),this.count+=n},t.prototype.writeTo=function(e){e.writeBytesOffset(this.buf,0,this.count)},t.prototype.reset=function(){this.count=0},t.prototype.toByteArray=function(){return Te.copyOfUint8Array(this.buf,this.count)},t.prototype.size=function(){return this.count},t.prototype.toString=function(e){return e?typeof e==`string`?this.toString_string(e):this.toString_number(e):this.toString_void()},t.prototype.toString_void=function(){return new String(this.buf).toString()},t.prototype.toString_string=function(e){return new String(this.buf).toString()},t.prototype.toString_number=function(e){return new String(this.buf).toString()},t.prototype.close=function(){},t}(la),K;(function(e){e[e.ALPHA=0]=`ALPHA`,e[e.LOWER=1]=`LOWER`,e[e.MIXED=2]=`MIXED`,e[e.PUNCT=3]=`PUNCT`,e[e.ALPHA_SHIFT=4]=`ALPHA_SHIFT`,e[e.PUNCT_SHIFT=5]=`PUNCT_SHIFT`})(K||={});function ma(){if(typeof window<`u`)return window.BigInt||null;if(typeof globalThis<`u`)return globalThis.BigInt||null;if(typeof self<`u`)return self.BigInt||null;throw Error(`Can't search globals for BigInt!`)}var ha;function ga(e){if(ha===void 0&&(ha=ma()),ha===null)throw Error(`BigInt is not supported!`);return ha(e)}function _a(){var e=[];e[0]=ga(1);var t=ga(900);e[1]=t;for(var n=2;n<16;n++)e[n]=e[n-1]*t;return e}var va=function(){function e(){}return e.decode=function(t,n){var r=new F(``),i=Ae.ISO8859_1;r.enableDecoding(i);for(var a=1,o=t[a++],s=new aa;a<t[0];){switch(o){case e.TEXT_COMPACTION_MODE_LATCH:a=e.textCompaction(t,a,r);break;case e.BYTE_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH_6:a=e.byteCompaction(o,t,i,a,r);break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(t[a++]);break;case e.NUMERIC_COMPACTION_MODE_LATCH:a=e.numericCompaction(t,a,r);break;case e.ECI_CHARSET:Ae.getCharacterSetECIByValue(t[a++]);break;case e.ECI_GENERAL_PURPOSE:a+=2;break;case e.ECI_USER_DEFINED:a++;break;case e.BEGIN_MACRO_PDF417_CONTROL_BLOCK:a=e.decodeMacroBlock(t,a,s);break;case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case e.MACRO_PDF417_TERMINATOR:throw new M;default:a--,a=e.textCompaction(t,a,r)}if(a<t.length)o=t[a++];else throw M.getFormatInstance()}if(r.length()===0)throw M.getFormatInstance();var c=new et(null,r.toString(),null,n);return c.setOther(s),c},e.decodeMacroBlock=function(t,n,r){if(n+e.NUMBER_OF_SEQUENCE_CODEWORDS>t[0])throw M.getFormatInstance();for(var i=new Int32Array(e.NUMBER_OF_SEQUENCE_CODEWORDS),a=0;a<e.NUMBER_OF_SEQUENCE_CODEWORDS;a++,n++)i[a]=t[n];r.setSegmentIndex(A.parseInt(e.decodeBase900toBase10(i,e.NUMBER_OF_SEQUENCE_CODEWORDS)));var o=new F;n=e.textCompaction(t,n,o),r.setFileId(o.toString());var s=-1;for(t[n]===e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(s=n+1);n<t[0];)switch(t[n]){case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(n++,t[n]){case e.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:var c=new F;n=e.textCompaction(t,n+1,c),r.setFileName(c.toString());break;case e.MACRO_PDF417_OPTIONAL_FIELD_SENDER:var l=new F;n=e.textCompaction(t,n+1,l),r.setSender(l.toString());break;case e.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:var u=new F;n=e.textCompaction(t,n+1,u),r.setAddressee(u.toString());break;case e.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:var d=new F;n=e.numericCompaction(t,n+1,d),r.setSegmentCount(A.parseInt(d.toString()));break;case e.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:var f=new F;n=e.numericCompaction(t,n+1,f),r.setTimestamp(oa.parseLong(f.toString()));break;case e.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:var p=new F;n=e.numericCompaction(t,n+1,p),r.setChecksum(A.parseInt(p.toString()));break;case e.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:var m=new F;n=e.numericCompaction(t,n+1,m),r.setFileSize(oa.parseLong(m.toString()));break;default:throw M.getFormatInstance()}break;case e.MACRO_PDF417_TERMINATOR:n++,r.setLastSegment(!0);break;default:throw M.getFormatInstance()}if(s!==-1){var h=n-s;r.isLastSegment()&&h--,r.setOptionalData(Te.copyOfRange(t,s,s+h))}return n},e.textCompaction=function(t,n,r){for(var i=new Int32Array((t[0]-n)*2),a=new Int32Array((t[0]-n)*2),o=0,s=!1;n<t[0]&&!s;){var c=t[n++];if(c<e.TEXT_COMPACTION_MODE_LATCH)i[o]=c/30,i[o+1]=c%30,o+=2;else switch(c){case e.TEXT_COMPACTION_MODE_LATCH:i[o++]=e.TEXT_COMPACTION_MODE_LATCH;break;case e.BYTE_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH_6:case e.NUMERIC_COMPACTION_MODE_LATCH:case e.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case e.MACRO_PDF417_TERMINATOR:n--,s=!0;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i[o]=e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,c=t[n++],a[o]=c,o++}}return e.decodeTextCompaction(i,a,o,r),n},e.decodeTextCompaction=function(t,n,r,i){for(var a=K.ALPHA,o=K.ALPHA,s=0;s<r;){var c=t[s],l=``;switch(a){case K.ALPHA:if(c<26)l=String.fromCharCode(65+c);else switch(c){case 26:l=` `;break;case e.LL:a=K.LOWER;break;case e.ML:a=K.MIXED;break;case e.PS:o=a,a=K.PUNCT_SHIFT;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(n[s]);break;case e.TEXT_COMPACTION_MODE_LATCH:a=K.ALPHA}break;case K.LOWER:if(c<26)l=String.fromCharCode(97+c);else switch(c){case 26:l=` `;break;case e.AS:o=a,a=K.ALPHA_SHIFT;break;case e.ML:a=K.MIXED;break;case e.PS:o=a,a=K.PUNCT_SHIFT;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(n[s]);break;case e.TEXT_COMPACTION_MODE_LATCH:a=K.ALPHA}break;case K.MIXED:if(c<e.PL)l=e.MIXED_CHARS[c];else switch(c){case e.PL:a=K.PUNCT;break;case 26:l=` `;break;case e.LL:a=K.LOWER;break;case e.AL:a=K.ALPHA;break;case e.PS:o=a,a=K.PUNCT_SHIFT;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(n[s]);break;case e.TEXT_COMPACTION_MODE_LATCH:a=K.ALPHA}break;case K.PUNCT:if(c<e.PAL)l=e.PUNCT_CHARS[c];else switch(c){case e.PAL:a=K.ALPHA;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(n[s]);break;case e.TEXT_COMPACTION_MODE_LATCH:a=K.ALPHA}break;case K.ALPHA_SHIFT:if(a=o,c<26)l=String.fromCharCode(65+c);else switch(c){case 26:l=` `;break;case e.TEXT_COMPACTION_MODE_LATCH:a=K.ALPHA}break;case K.PUNCT_SHIFT:if(a=o,c<e.PAL)l=e.PUNCT_CHARS[c];else switch(c){case e.PAL:a=K.ALPHA;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(n[s]);break;case e.TEXT_COMPACTION_MODE_LATCH:a=K.ALPHA}}l!==``&&i.append(l),s++}},e.byteCompaction=function(t,n,r,i,a){var o=new pa,s=0,c=0,l=!1;switch(t){case e.BYTE_COMPACTION_MODE_LATCH:for(var u=new Int32Array(6),d=n[i++];i<n[0]&&!l;)switch(u[s++]=d,c=900*c+d,d=n[i++],d){case e.TEXT_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH:case e.NUMERIC_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH_6:case e.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case e.MACRO_PDF417_TERMINATOR:i--,l=!0;break;default:if(s%5==0&&s>0){for(var f=0;f<6;++f)o.write(Number(ga(c)>>ga(8*(5-f))));c=0,s=0}}i===n[0]&&d<e.TEXT_COMPACTION_MODE_LATCH&&(u[s++]=d);for(var p=0;p<s;p++)o.write(u[p]);break;case e.BYTE_COMPACTION_MODE_LATCH_6:for(;i<n[0]&&!l;){var m=n[i++];if(m<e.TEXT_COMPACTION_MODE_LATCH)s++,c=900*c+m;else switch(m){case e.TEXT_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH:case e.NUMERIC_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH_6:case e.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case e.MACRO_PDF417_TERMINATOR:i--,l=!0}if(s%5==0&&s>0){for(var f=0;f<6;++f)o.write(Number(ga(c)>>ga(8*(5-f))));c=0,s=0}}}return a.append(Ne.decode(o.toByteArray(),r)),i},e.numericCompaction=function(t,n,r){for(var i=0,a=!1,o=new Int32Array(e.MAX_NUMERIC_CODEWORDS);n<t[0]&&!a;){var s=t[n++];if(n===t[0]&&(a=!0),s<e.TEXT_COMPACTION_MODE_LATCH)o[i]=s,i++;else switch(s){case e.TEXT_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH_6:case e.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case e.MACRO_PDF417_TERMINATOR:n--,a=!0}(i%e.MAX_NUMERIC_CODEWORDS===0||s===e.NUMERIC_COMPACTION_MODE_LATCH||a)&&i>0&&(r.append(e.decodeBase900toBase10(o,i)),i=0)}return n},e.decodeBase900toBase10=function(t,n){for(var r=ga(0),i=0;i<n;i++)r+=e.EXP900[n-i-1]*ga(t[i]);var a=r.toString();if(a.charAt(0)!==`1`)throw new M;return a.substring(1)},e.TEXT_COMPACTION_MODE_LATCH=900,e.BYTE_COMPACTION_MODE_LATCH=901,e.NUMERIC_COMPACTION_MODE_LATCH=902,e.BYTE_COMPACTION_MODE_LATCH_6=924,e.ECI_USER_DEFINED=925,e.ECI_GENERAL_PURPOSE=926,e.ECI_CHARSET=927,e.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,e.MACRO_PDF417_TERMINATOR=922,e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,e.MAX_NUMERIC_CODEWORDS=15,e.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,e.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,e.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,e.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,e.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,e.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,e.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,e.PL=25,e.LL=27,e.AS=27,e.ML=28,e.AL=28,e.PS=29,e.PAL=29,e.PUNCT_CHARS=`;<>@[\\]_\`~!\r ,:
9
+ -.$/"|*()?{}'`,e.MIXED_CHARS=`0123456789&\r ,:#-.$/+%*=^`,e.EXP900=ma()?_a():[],e.NUMBER_OF_SEQUENCE_CODEWORDS=2,e}(),ya=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},ba=function(){function e(){}return e.decode=function(t,n,r,i,a,o,s){for(var c=new Wi(t,n,r,i,a),l=null,u=null,d,f=!0;;f=!1){if(n!=null&&(l=e.getRowIndicatorColumn(t,c,n,!0,o,s)),i!=null&&(u=e.getRowIndicatorColumn(t,c,i,!1,o,s)),d=e.merge(l,u),d==null)throw I.getNotFoundInstance();var p=d.getBoundingBox();if(f&&p!=null&&(p.getMinY()<c.getMinY()||p.getMaxY()>c.getMaxY()))c=p;else break}d.setBoundingBox(c);var m=d.getBarcodeColumnCount()+1;d.setDetectionResultColumn(0,l),d.setDetectionResultColumn(m,u);for(var h=l!=null,g=1;g<=m;g++){var _=h?g:m-g;if(d.getDetectionResultColumn(_)===void 0){var v=void 0;v=_===0||_===m?new ea(c,_===0):new Ji(c),d.setDetectionResultColumn(_,v);for(var y=-1,b=y,x=c.getMinY();x<=c.getMaxY();x++){if(y=e.getStartColumn(d,_,x,h),y<0||y>c.getMaxX()){if(b===-1)continue;y=b}var S=e.detectCodeword(t,c.getMinX(),c.getMaxX(),h,y,x,o,s);S!=null&&(v.setCodeword(x,S),b=y,o=Math.min(o,S.getWidth()),s=Math.max(s,S.getWidth()))}}}return e.createDecoderResult(d)},e.merge=function(t,n){if(t==null&&n==null)return null;var r=e.getBarcodeMetadata(t,n);return r==null?null:new na(r,Wi.merge(e.adjustBoundingBox(t),e.adjustBoundingBox(n)))},e.adjustBoundingBox=function(t){var n,r;if(t==null)return null;var i=t.getRowHeights();if(i==null)return null;var a=e.getMax(i),o=0;try{for(var s=ya(i),c=s.next();!c.done;c=s.next()){var l=c.value;if(o+=a-l,l>0)break}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}for(var u=t.getCodewords(),d=0;o>0&&u[d]==null;d++)o--;for(var f=0,d=i.length-1;d>=0&&(f+=a-i[d],!(i[d]>0));d--);for(var d=u.length-1;f>0&&u[d]==null;d--)f--;return t.getBoundingBox().addMissingRows(o,f,t.isLeft())},e.getMax=function(e){var t,n,r=-1;try{for(var i=ya(e),a=i.next();!a.done;a=i.next()){var o=a.value;r=Math.max(r,o)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},e.getBarcodeMetadata=function(e,t){var n;if(e==null||(n=e.getBarcodeMetadata())==null)return t==null?null:t.getBarcodeMetadata();var r;return t==null||(r=t.getBarcodeMetadata())==null?n:n.getColumnCount()!==r.getColumnCount()&&n.getErrorCorrectionLevel()!==r.getErrorCorrectionLevel()&&n.getRowCount()!==r.getRowCount()?null:n},e.getRowIndicatorColumn=function(t,n,r,i,a,o){for(var s=new ea(n,i),c=0;c<2;c++)for(var l=c===0?1:-1,u=Math.trunc(Math.trunc(r.getX())),d=Math.trunc(Math.trunc(r.getY()));d<=n.getMaxY()&&d>=n.getMinY();d+=l){var f=e.detectCodeword(t,0,t.getWidth(),i,u,d,a,o);f!=null&&(s.setCodeword(d,f),u=i?f.getStartX():f.getEndX())}return s},e.adjustCodewordCount=function(t,n){var r=n[0][1],i=r.getValue(),a=t.getBarcodeColumnCount()*t.getBarcodeRowCount()-e.getNumberOfECCodeWords(t.getBarcodeECLevel());if(i.length===0){if(a<1||a>G.MAX_CODEWORDS_IN_BARCODE)throw I.getNotFoundInstance();r.setValue(a)}else i[0]!==a&&r.setValue(a)},e.createDecoderResult=function(t){var n=e.createBarcodeMatrix(t);e.adjustCodewordCount(t,n);for(var r=[],i=new Int32Array(t.getBarcodeRowCount()*t.getBarcodeColumnCount()),a=[],o=[],s=0;s<t.getBarcodeRowCount();s++)for(var c=0;c<t.getBarcodeColumnCount();c++){var l=n[s][c+1].getValue(),u=s*t.getBarcodeColumnCount()+c;l.length===0?r.push(u):l.length===1?i[u]=l[0]:(o.push(u),a.push(l))}for(var d=Array(a.length),f=0;f<d.length;f++)d[f]=a[f];return e.createDecoderResultFromAmbiguousValues(t.getBarcodeECLevel(),i,G.toIntArray(r),G.toIntArray(o),d)},e.createDecoderResultFromAmbiguousValues=function(t,n,r,i,a){for(var o=new Int32Array(i.length),s=100;s-->0;){for(var c=0;c<o.length;c++)n[i[c]]=a[c][o[c]];try{return e.decodeCodewords(n,t,r)}catch(e){if(!(e instanceof O))throw e}if(o.length===0)throw O.getChecksumInstance();for(var c=0;c<o.length;c++)if(o[c]<a[c].length-1){o[c]++;break}else if(o[c]=0,c===o.length-1)throw O.getChecksumInstance()}throw O.getChecksumInstance()},e.createBarcodeMatrix=function(e){for(var t,n,r,i,a=Array.from({length:e.getBarcodeRowCount()},function(){return Array(e.getBarcodeColumnCount()+2)}),o=0;o<a.length;o++)for(var s=0;s<a[o].length;s++)a[o][s]=new Zi;var c=0;try{for(var l=ya(e.getDetectionResultColumns()),u=l.next();!u.done;u=l.next()){var d=u.value;if(d!=null)try{for(var f=(r=void 0,ya(d.getCodewords())),p=f.next();!p.done;p=f.next()){var m=p.value;if(m!=null){var h=m.getRowNumber();if(h>=0){if(h>=a.length)continue;a[h][c].setValue(m.getValue())}}}}catch(e){r={error:e}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}c++}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return a},e.isValidBarcodeColumn=function(e,t){return t>=0&&t<=e.getBarcodeColumnCount()+1},e.getStartColumn=function(t,n,r,i){var a,o,s=i?1:-1,c=null;if(e.isValidBarcodeColumn(t,n-s)&&(c=t.getDetectionResultColumn(n-s).getCodeword(r)),c!=null)return i?c.getEndX():c.getStartX();if(c=t.getDetectionResultColumn(n).getCodewordNearby(r),c!=null)return i?c.getStartX():c.getEndX();if(e.isValidBarcodeColumn(t,n-s)&&(c=t.getDetectionResultColumn(n-s).getCodewordNearby(r)),c!=null)return i?c.getEndX():c.getStartX();for(var l=0;e.isValidBarcodeColumn(t,n-s);){n-=s;try{for(var u=(a=void 0,ya(t.getDetectionResultColumn(n).getCodewords())),d=u.next();!d.done;d=u.next()){var f=d.value;if(f!=null)return(i?f.getEndX():f.getStartX())+s*l*(f.getEndX()-f.getStartX())}}catch(e){a={error:e}}finally{try{d&&!d.done&&(o=u.return)&&o.call(u)}finally{if(a)throw a.error}}l++}return i?t.getBoundingBox().getMinX():t.getBoundingBox().getMaxX()},e.detectCodeword=function(t,n,r,i,a,o,s,c){a=e.adjustCodewordStartColumn(t,n,r,i,a,o);var l=e.getModuleBitCount(t,n,r,i,a,o);if(l==null)return null;var u,d=R.sum(l);if(i)u=a+d;else{for(var f=0;f<l.length/2;f++){var p=l[f];l[f]=l[l.length-1-f],l[l.length-1-f]=p}u=a,a=u-d}if(!e.checkCodewordSkew(d,s,c))return null;var m=ia.getDecodedValue(l),h=G.getCodeword(m);return h===-1?null:new ra(a,u,e.getCodewordBucketNumber(m),h)},e.getModuleBitCount=function(e,t,n,r,i,a){for(var o=i,s=new Int32Array(8),c=0,l=r?1:-1,u=r;(r?o<n:o>=t)&&c<s.length;)e.get(o,a)===u?(s[c]++,o+=l):(c++,u=!u);return c===s.length||o===(r?n:t)&&c===s.length-1?s:null},e.getNumberOfECCodeWords=function(e){return 2<<e},e.adjustCodewordStartColumn=function(t,n,r,i,a,o){for(var s=a,c=i?-1:1,l=0;l<2;l++){for(;(i?s>=n:s<r)&&i===t.get(s,o);){if(Math.abs(a-s)>e.CODEWORD_SKEW_SIZE)return a;s+=c}c=-c,i=!i}return s},e.checkCodewordSkew=function(t,n,r){return n-e.CODEWORD_SKEW_SIZE<=t&&t<=r+e.CODEWORD_SKEW_SIZE},e.decodeCodewords=function(t,n,r){if(t.length===0)throw M.getFormatInstance();var i=1<<n+1,a=e.correctErrors(t,r,i);e.verifyCodewordCount(t,i);var o=va.decode(t,``+n);return o.setErrorsCorrected(a),o.setErasures(r.length),o},e.correctErrors=function(t,n,r){if(n!=null&&n.length>r/2+e.MAX_ERRORS||r<0||r>e.MAX_EC_CODEWORDS)throw O.getChecksumInstance();return e.errorCorrection.decode(t,r,n)},e.verifyCodewordCount=function(e,t){if(e.length<4)throw M.getFormatInstance();var n=e[0];if(n>e.length)throw M.getFormatInstance();if(n===0){if(t<e.length)e[0]=e.length-t;else throw M.getFormatInstance()}},e.getBitCountForCodeword=function(e){for(var t=new Int32Array(8),n=0,r=t.length-1;!((e&1)!==n&&(n=e&1,r--,r<0));)t[r]++,e>>=1;return t},e.getCodewordBucketNumber=function(e){return e instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(e):this.getCodewordBucketNumber_number(e)},e.getCodewordBucketNumber_number=function(t){return e.getCodewordBucketNumber(e.getBitCountForCodeword(t))},e.getCodewordBucketNumber_Int32Array=function(e){return(e[0]-e[2]+e[4]-e[6]+9)%9},e.toString=function(e){for(var t=new Ki,n=0;n<e.length;n++){t.format(`Row %2d: `,n);for(var r=0;r<e[n].length;r++){var i=e[n][r];i.getValue().length===0?t.format(` `,null):t.format(`%4d(%2d)`,i.getValue()[0],i.getConfidence(i.getValue()[0]))}t.format(`%n`)}return t.toString()},e.CODEWORD_SKEW_SIZE=2,e.MAX_ERRORS=3,e.MAX_EC_CODEWORDS=512,e.errorCorrection=new Ui,e}(),xa=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Sa=function(){function e(){}return e.prototype.decode=function(t,n){n===void 0&&(n=null);var r=e.decode(t,n,!1);if(r==null||r.length===0||r[0]==null)throw I.getNotFoundInstance();return r[0]},e.prototype.decodeMultiple=function(t,n){n===void 0&&(n=null);try{return e.decode(t,n,!0)}catch(e){throw e instanceof M||e instanceof O?I.getNotFoundInstance():e}},e.decode=function(t,n,r){var i,a,o=[],s=Ii.detectMultiple(t,n,r);try{for(var c=xa(s.getPoints()),l=c.next();!l.done;l=c.next()){var u=l.value,d=ba.decode(s.getBits(),u[4],u[5],u[6],u[7],e.getMinCodewordWidth(u),e.getMaxCodewordWidth(u)),f=new Xe(d.getText(),d.getRawBytes(),void 0,u,L.PDF_417);f.putMetadata($e.ERROR_CORRECTION_LEVEL,d.getECLevel());var p=d.getOther();p!=null&&f.putMetadata($e.PDF417_EXTRA_METADATA,p),o.push(f)}}catch(e){i={error:e}}finally{try{l&&!l.done&&(a=c.return)&&a.call(c)}finally{if(i)throw i.error}}return o.map(function(e){return e})},e.getMaxWidth=function(e,t){return e==null||t==null?0:Math.trunc(Math.abs(e.getX()-t.getX()))},e.getMinWidth=function(e,t){return e==null||t==null?A.MAX_VALUE:Math.trunc(Math.abs(e.getX()-t.getX()))},e.getMaxCodewordWidth=function(t){return Math.floor(Math.max(Math.max(e.getMaxWidth(t[0],t[4]),e.getMaxWidth(t[6],t[2])*G.MODULES_IN_CODEWORD/G.MODULES_IN_STOP_PATTERN),Math.max(e.getMaxWidth(t[1],t[5]),e.getMaxWidth(t[7],t[3])*G.MODULES_IN_CODEWORD/G.MODULES_IN_STOP_PATTERN)))},e.getMinCodewordWidth=function(t){return Math.floor(Math.min(Math.min(e.getMinWidth(t[0],t[4]),e.getMinWidth(t[6],t[2])*G.MODULES_IN_CODEWORD/G.MODULES_IN_STOP_PATTERN),Math.min(e.getMinWidth(t[1],t[5]),e.getMinWidth(t[7],t[3])*G.MODULES_IN_CODEWORD/G.MODULES_IN_STOP_PATTERN)))},e.prototype.reset=function(){},e}(),Ca=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),wa=function(e){Ca(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.kind=`ReaderException`,t}(pe),Ta=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Ea=function(){function e(){}return e.prototype.decode=function(e,t){return this.hints!==t&&this.setHints(t),this.decodeInternal(e)},e.prototype.decodeWithState=function(e){return(this.readers===null||this.readers===void 0)&&this.setHints(null),this.decodeInternal(e)},e.prototype.setHints=function(e){this.hints=e;var t=e!=null&&e.get(j.TRY_HARDER)!==void 0,n=e==null?null:e.get(j.POSSIBLE_FORMATS),r=[];if(n!=null){var i=n.some(function(e){return e===L.UPC_A||e===L.UPC_E||e===L.EAN_13||e===L.EAN_8||e===L.CODABAR||e===L.CODE_39||e===L.CODE_93||e===L.CODE_128||e===L.ITF||e===L.RSS_14||e===L.RSS_EXPANDED});i&&!t&&r.push(new Tr(e)),n.includes(L.QR_CODE)&&r.push(new pi),n.includes(L.MICRO_QR_CODE)&&r.push(new Di),n.includes(L.DATA_MATRIX)&&r.push(new Rr),n.includes(L.AZTEC)&&r.push(new Et),n.includes(L.PDF_417)&&r.push(new Sa),n.includes(L.MAXICODE)&&r.push(new Mi),i&&t&&r.push(new Tr(e))}r.length===0&&(t||r.push(new Tr(e)),r.push(new pi),r.push(new Di),r.push(new Rr),r.push(new Et),r.push(new Sa),r.push(new Mi),t&&r.push(new Tr(e))),this.readers=r},e.prototype.reset=function(){var e,t;if(this.readers!==null)try{for(var n=Ta(this.readers),r=n.next();!r.done;r=n.next())r.value.reset()}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},e.prototype.decodeInternal=function(e){var t,n;if(this.readers===null)throw new wa(`No readers where selected, nothing can be read.`);try{for(var r=Ta(this.readers),i=r.next();!i.done;i=r.next()){var a=i.value;try{return a.decode(e,this.hints)}catch(e){if(e instanceof wa)continue;console.warn(`MultiFormatReader: non-ReaderException from reader:`,e);continue}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}throw new I(`No MultiFormat Readers were able to detect the code.`)},e}(),Da=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){Da(t,e);function t(t,n){t===void 0&&(t=null),n===void 0&&(n=500);var r=new Ea;return r.setHints(t),e.call(this,r,n)||this}return Object.defineProperty(t.prototype,"hints",{set:function(e){this._hints=e||null,this.reader.setHints(e)},enumerable:!1,configurable:!0}),t.prototype.decodeBitmap=function(e){try{return this.reader.decodeWithState(e)}finally{this.reader.reset()}},t})(Ye);var Oa=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){Oa(t,e);function t(t){return t===void 0&&(t=500),e.call(this,new Sa,t)||this}return t})(Ye);var ka=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){ka(t,e);function t(t){return t===void 0&&(t=500),e.call(this,new pi,t)||this}return t})(Ye);var Aa;(function(e){e[e.ERROR_CORRECTION=0]=`ERROR_CORRECTION`,e[e.CHARACTER_SET=1]=`CHARACTER_SET`,e[e.DATA_MATRIX_SHAPE=2]=`DATA_MATRIX_SHAPE`,e[e.DATA_MATRIX_COMPACT=3]=`DATA_MATRIX_COMPACT`,e[e.MIN_SIZE=4]=`MIN_SIZE`,e[e.MAX_SIZE=5]=`MAX_SIZE`,e[e.MARGIN=6]=`MARGIN`,e[e.PDF417_COMPACT=7]=`PDF417_COMPACT`,e[e.PDF417_COMPACTION=8]=`PDF417_COMPACTION`,e[e.PDF417_DIMENSIONS=9]=`PDF417_DIMENSIONS`,e[e.AZTEC_LAYERS=10]=`AZTEC_LAYERS`,e[e.QR_VERSION=11]=`QR_VERSION`,e[e.GS1_FORMAT=12]=`GS1_FORMAT`,e[e.FORCE_C40=13]=`FORCE_C40`})(Aa||={});var q=Aa,ja=function(){function e(e){this.field=e,this.cachedGenerators=[],this.cachedGenerators.push(new nt(e,Int32Array.from([1])))}return e.prototype.buildGenerator=function(e){var t=this.cachedGenerators;if(e>=t.length)for(var n=t[t.length-1],r=this.field,i=t.length;i<=e;i++){var a=n.multiply(new nt(r,Int32Array.from([1,r.exp(i-1+r.getGeneratorBase())])));t.push(a),n=a}return t[e]},e.prototype.encode=function(e,t){if(t===0)throw new D(`No error correction bytes`);var n=e.length-t;if(n<=0)throw new D(`No data bytes provided`);var r=this.buildGenerator(t),i=new Int32Array(n);k.arraycopy(e,0,i,0,n);var a=new nt(this.field,i);a=a.multiplyByMonomial(t,1);for(var o=a.divide(r)[1].getCoefficients(),s=t-o.length,c=0;c<s;c++)e[n+c]=0;k.arraycopy(o,0,e,n+s,o.length)},e}(),Ma=function(){function e(){}return e.applyMaskPenaltyRule1=function(t){return e.applyMaskPenaltyRule1Internal(t,!0)+e.applyMaskPenaltyRule1Internal(t,!1)},e.applyMaskPenaltyRule2=function(t){for(var n=0,r=t.getArray(),i=t.getWidth(),a=t.getHeight(),o=0;o<a-1;o++)for(var s=r[o],c=0;c<i-1;c++){var l=s[c];l===s[c+1]&&l===r[o+1][c]&&l===r[o+1][c+1]&&n++}return e.N2*n},e.applyMaskPenaltyRule3=function(t){for(var n=0,r=t.getArray(),i=t.getWidth(),a=t.getHeight(),o=0;o<a;o++)for(var s=0;s<i;s++){var c=r[o];s+6<i&&c[s]===1&&c[s+1]===0&&c[s+2]===1&&c[s+3]===1&&c[s+4]===1&&c[s+5]===0&&c[s+6]===1&&(e.isWhiteHorizontal(c,s-4,s)||e.isWhiteHorizontal(c,s+7,s+11))&&n++,o+6<a&&r[o][s]===1&&r[o+1][s]===0&&r[o+2][s]===1&&r[o+3][s]===1&&r[o+4][s]===1&&r[o+5][s]===0&&r[o+6][s]===1&&(e.isWhiteVertical(r,s,o-4,o)||e.isWhiteVertical(r,s,o+7,o+11))&&n++}return n*e.N3},e.isWhiteHorizontal=function(e,t,n){t=Math.max(t,0),n=Math.min(n,e.length);for(var r=t;r<n;r++)if(e[r]===1)return!1;return!0},e.isWhiteVertical=function(e,t,n,r){n=Math.max(n,0),r=Math.min(r,e.length);for(var i=n;i<r;i++)if(e[i][t]===1)return!1;return!0},e.applyMaskPenaltyRule4=function(t){for(var n=0,r=t.getArray(),i=t.getWidth(),a=t.getHeight(),o=0;o<a;o++)for(var s=r[o],c=0;c<i;c++)s[c]===1&&n++;var l=t.getHeight()*t.getWidth();return Math.floor(Math.abs(n*2-l)*10/l)*e.N4},e.getDataMaskBit=function(e,t,n){var r,i;switch(e){case 0:r=n+t&1;break;case 1:r=n&1;break;case 2:r=t%3;break;case 3:r=(n+t)%3;break;case 4:r=Math.floor(n/2)+Math.floor(t/3)&1;break;case 5:i=n*t,r=(i&1)+i%3;break;case 6:i=n*t,r=(i&1)+i%3&1;break;case 7:i=n*t,r=i%3+(n+t&1)&1;break;default:throw new D(`Invalid mask pattern: `+e)}return r===0},e.applyMaskPenaltyRule1Internal=function(t,n){for(var r=0,i=n?t.getHeight():t.getWidth(),a=n?t.getWidth():t.getHeight(),o=t.getArray(),s=0;s<i;s++){for(var c=0,l=-1,u=0;u<a;u++){var d=n?o[s][u]:o[u][s];d===l?c++:(c>=5&&(r+=e.N1+(c-5)),c=1,l=d)}c>=5&&(r+=e.N1+(c-5))}return r},e.N1=3,e.N2=3,e.N3=40,e.N4=10,e}(),Na=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Pa=function(){function e(e,t){this.width=e,this.height=t;for(var n=Array(t),r=0;r!==t;r++)n[r]=new Uint8Array(e);this.bytes=n}return e.prototype.getHeight=function(){return this.height},e.prototype.getWidth=function(){return this.width},e.prototype.get=function(e,t){return this.bytes[t][e]},e.prototype.getArray=function(){return this.bytes},e.prototype.setNumber=function(e,t,n){this.bytes[t][e]=n},e.prototype.setBoolean=function(e,t,n){this.bytes[t][e]=+!!n},e.prototype.clear=function(e){var t,n;try{for(var r=Na(this.bytes),i=r.next();!i.done;i=r.next()){var a=i.value;Te.fill(a,e)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;if(this.width!==n.width||this.height!==n.height)return!1;for(var r=0,i=this.height;r<i;++r)for(var a=this.bytes[r],o=n.bytes[r],s=0,c=this.width;s<c;++s)if(a[s]!==o[s])return!1;return!0},e.prototype.toString=function(){for(var e=new F,t=0,n=this.height;t<n;++t){for(var r=this.bytes[t],i=0,a=this.width;i<a;++i)switch(r[i]){case 0:e.append(` 0`);break;case 1:e.append(` 1`);break;default:e.append(` `)}e.append(`
10
+ `)}return e.toString()},e}(),Fa=function(){function e(){this.maskPattern=-1}return e.prototype.getMode=function(){return this.mode},e.prototype.getECLevel=function(){return this.ecLevel},e.prototype.getVersion=function(){return this.version},e.prototype.getMaskPattern=function(){return this.maskPattern},e.prototype.getMatrix=function(){return this.matrix},e.prototype.toString=function(){var e=new F;return e.append(`<<
11
11
  `),e.append(` mode: `),e.append(this.mode?this.mode.toString():`null`),e.append(`
12
12
  ecLevel: `),e.append(this.ecLevel?this.ecLevel.toString():`null`),e.append(`
13
13
  version: `),e.append(this.version?this.version.toString():`null`),e.append(`
@@ -16,6 +16,6 @@
16
16
  `),e.append(this.matrix.toString())):e.append(`
17
17
  matrix: null
18
18
  `),e.append(`>>
19
- `),e.toString()},e.prototype.setMode=function(e){this.mode=e},e.prototype.setECLevel=function(e){this.ecLevel=e},e.prototype.setVersion=function(e){this.version=e},e.prototype.setMaskPattern=function(e){this.maskPattern=e},e.prototype.setMatrix=function(e){this.matrix=e},e.isValidMaskPattern=function(t){return t>=0&&t<e.NUM_MASK_PATTERNS},e.NUM_MASK_PATTERNS=8,e}(),ta=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),J=function(e){ta(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.kind=`WriterException`,t}(a),na=function(){function e(){}return e.clearMatrix=function(e){e.clear(255)},e.buildMatrix=function(t,n,r,i,a){e.clearMatrix(a),e.embedBasicPatterns(r,a),e.embedTypeInfo(n,i,a),e.maybeEmbedVersionInfo(r,a),e.embedDataBits(t,i,a)},e.embedBasicPatterns=function(t,n){e.embedPositionDetectionPatternsAndSeparators(n),e.embedDarkDotAtLeftBottomCorner(n),e.maybeEmbedPositionAdjustmentPatterns(t,n),e.embedTimingPatterns(n)},e.embedTypeInfo=function(t,n,r){var i=new S;e.makeTypeInfoBits(t,n,i);for(var a=0,o=i.getSize();a<o;++a){var s=i.get(i.getSize()-1-a),c=e.TYPE_INFO_COORDINATES[a],l=c[0],u=c[1];if(r.setBoolean(l,u,s),a<8){var d=r.getWidth()-a-1,f=8;r.setBoolean(d,f,s)}else{var d=8,f=r.getHeight()-7+(a-8);r.setBoolean(d,f,s)}}},e.maybeEmbedVersionInfo=function(t,n){if(!(t.getVersionNumber()<7)){var r=new S;e.makeVersionInfoBits(t,r);for(var i=17,a=0;a<6;++a)for(var o=0;o<3;++o){var s=r.get(i);i--,n.setBoolean(a,n.getHeight()-11+o,s),n.setBoolean(n.getHeight()-11+o,a,s)}}},e.embedDataBits=function(t,n,r){for(var i=0,a=-1,o=r.getWidth()-1,s=r.getHeight()-1;o>0;){for(o===6&&--o;s>=0&&s<r.getHeight();){for(var c=0;c<2;++c){var l=o-c;if(e.isEmpty(r.get(l,s))){var u=void 0;i<t.getSize()?(u=t.get(i),++i):u=!1,n!==255&&Zi.getDataMaskBit(n,l,s)&&(u=!u),r.setBoolean(l,s,u)}}s+=a}a=-a,s+=a,o-=2}if(i!==t.getSize())throw new J(`Not all bits consumed: `+i+`/`+t.getSize())},e.findMSBSet=function(e){return 32-x.numberOfLeadingZeros(e)},e.calculateBCHCode=function(t,n){if(n===0)throw new l(`0 polynomial`);var r=e.findMSBSet(n);for(t<<=r-1;e.findMSBSet(t)>=r;)t^=n<<e.findMSBSet(t)-r;return t},e.makeTypeInfoBits=function(t,n,r){if(!ea.isValidMaskPattern(n))throw new J(`Invalid mask pattern`);var i=t.getBits()<<3|n;r.appendBits(i,5);var a=e.calculateBCHCode(i,e.TYPE_INFO_POLY);r.appendBits(a,10);var o=new S;if(o.appendBits(e.TYPE_INFO_MASK_PATTERN,15),r.xor(o),r.getSize()!==15)throw new J(`should not happen but we got: `+r.getSize())},e.makeVersionInfoBits=function(t,n){n.appendBits(t.getVersionNumber(),6);var r=e.calculateBCHCode(t.getVersionNumber(),e.VERSION_INFO_POLY);if(n.appendBits(r,12),n.getSize()!==18)throw new J(`should not happen but we got: `+n.getSize())},e.isEmpty=function(e){return e===255},e.embedTimingPatterns=function(t){for(var n=8;n<t.getWidth()-8;++n){var r=(n+1)%2;e.isEmpty(t.get(n,6))&&t.setNumber(n,6,r),e.isEmpty(t.get(6,n))&&t.setNumber(6,n,r)}},e.embedDarkDotAtLeftBottomCorner=function(e){if(e.get(8,e.getHeight()-8)===0)throw new J;e.setNumber(8,e.getHeight()-8,1)},e.embedHorizontalSeparationPattern=function(t,n,r){for(var i=0;i<8;++i){if(!e.isEmpty(r.get(t+i,n)))throw new J;r.setNumber(t+i,n,0)}},e.embedVerticalSeparationPattern=function(t,n,r){for(var i=0;i<7;++i){if(!e.isEmpty(r.get(t,n+i)))throw new J;r.setNumber(t,n+i,0)}},e.embedPositionAdjustmentPattern=function(t,n,r){for(var i=0;i<5;++i)for(var a=e.POSITION_ADJUSTMENT_PATTERN[i],o=0;o<5;++o)r.setNumber(t+o,n+i,a[o])},e.embedPositionDetectionPattern=function(t,n,r){for(var i=0;i<7;++i)for(var a=e.POSITION_DETECTION_PATTERN[i],o=0;o<7;++o)r.setNumber(t+o,n+i,a[o])},e.embedPositionDetectionPatternsAndSeparators=function(t){var n=e.POSITION_DETECTION_PATTERN[0].length;e.embedPositionDetectionPattern(0,0,t),e.embedPositionDetectionPattern(t.getWidth()-n,0,t),e.embedPositionDetectionPattern(0,t.getWidth()-n,t);var r=8;e.embedHorizontalSeparationPattern(0,r-1,t),e.embedHorizontalSeparationPattern(t.getWidth()-r,r-1,t),e.embedHorizontalSeparationPattern(0,t.getWidth()-r,t);var i=7;e.embedVerticalSeparationPattern(i,0,t),e.embedVerticalSeparationPattern(t.getHeight()-i-1,0,t),e.embedVerticalSeparationPattern(i,t.getHeight()-i,t)},e.maybeEmbedPositionAdjustmentPatterns=function(t,n){if(!(t.getVersionNumber()<2))for(var r=t.getVersionNumber()-1,i=e.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[r],a=0,o=i.length;a!==o;a++){var s=i[a];if(s>=0)for(var c=0;c!==o;c++){var l=i[c];l>=0&&e.isEmpty(n.get(l,s))&&e.embedPositionAdjustmentPattern(l-2,s-2,n)}}},e.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),e.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),e.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),e.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),e.VERSION_INFO_POLY=7973,e.TYPE_INFO_POLY=1335,e.TYPE_INFO_MASK_PATTERN=21522,e}(),ra=function(){function e(e,t){this.dataBytes=e,this.errorCorrectionBytes=t}return e.prototype.getDataBytes=function(){return this.dataBytes},e.prototype.getErrorCorrectionBytes=function(){return this.errorCorrectionBytes},e}(),ia=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},aa=function(){function e(){}return e.calculateMaskPenalty=function(e){return Zi.applyMaskPenaltyRule1(e)+Zi.applyMaskPenaltyRule2(e)+Zi.applyMaskPenaltyRule3(e)+Zi.applyMaskPenaltyRule4(e)},e.encode=function(t,n,r){r===void 0&&(r=null);var i=e.DEFAULT_BYTE_MODE_ENCODING,a=r!==null&&r.get(q.CHARACTER_SET)!==void 0;a&&(i=r.get(q.CHARACTER_SET).toString());var o=this.chooseMode(t,i),s=new S;if(o===W.BYTE&&(a||e.DEFAULT_BYTE_MODE_ENCODING!==i)){var c=O.getCharacterSetECIByName(i);c!==void 0&&this.appendECI(c,s)}this.appendModeInfo(o,s);var l=new S;this.appendBytes(t,o,l,i);var u;if(r!==null&&r.get(q.QR_VERSION)!==void 0){var d=Number.parseInt(r.get(q.QR_VERSION).toString(),10);u=dr.getVersionForNumber(d);var f=this.calculateBitsNeeded(o,s,l,u);if(!this.willFit(f,u,n))throw new J(`Data too big for requested version`)}else u=this.recommendVersion(n,o,s,l);var p=new S;p.appendBitArray(s);var m=o===W.BYTE?l.getSizeInBytes():t.length;this.appendLengthInfo(m,u,o,p),p.appendBitArray(l);var h=u.getECBlocksForLevel(n),g=u.getTotalCodewords()-h.getTotalECCodewords();this.terminateBits(g,p);var _=this.interleaveWithECBytes(p,u.getTotalCodewords(),g,h.getNumBlocks()),v=new ea;v.setECLevel(n),v.setMode(o),v.setVersion(u);var y=u.getDimensionForVersion(),b=new $i(y,y),x=this.chooseMaskPattern(_,n,u,b);return v.setMaskPattern(x),na.buildMatrix(_,n,u,x,b),v.setMatrix(b),v},e.recommendVersion=function(e,t,n,r){var i=this.calculateBitsNeeded(t,n,r,dr.getVersionForNumber(1)),a=this.chooseVersion(i,e),o=this.calculateBitsNeeded(t,n,r,a);return this.chooseVersion(o,e)},e.calculateBitsNeeded=function(e,t,n,r){return t.getSize()+e.getCharacterCountBits(r)+n.getSize()},e.getAlphanumericCode=function(t){return t<e.ALPHANUMERIC_TABLE.length?e.ALPHANUMERIC_TABLE[t]:-1},e.chooseMode=function(t,n){if(n===void 0&&(n=null),O.SJIS.getName()===n&&this.isOnlyDoubleByteKanji(t))return W.KANJI;for(var r=!1,i=!1,a=0,o=t.length;a<o;++a){var s=t.charAt(a);if(e.isDigit(s))r=!0;else if(this.getAlphanumericCode(s.charCodeAt(0))!==-1)i=!0;else return W.BYTE}return i?W.ALPHANUMERIC:r?W.NUMERIC:W.BYTE},e.isOnlyDoubleByteKanji=function(e){var t;try{t=ne.encode(e,O.SJIS)}catch{return!1}var n=t.length;if(n%2!=0)return!1;for(var r=0;r<n;r+=2){var i=t[r]&255;if((i<129||i>159)&&(i<224||i>235))return!1}return!0},e.chooseMaskPattern=function(e,t,n,r){for(var i=2**53-1,a=-1,o=0;o<ea.NUM_MASK_PATTERNS;o++){na.buildMatrix(e,t,n,o,r);var s=this.calculateMaskPenalty(r);s<i&&(i=s,a=o)}return a},e.chooseVersion=function(t,n){for(var r=1;r<=40;r++){var i=dr.getVersionForNumber(r);if(e.willFit(t,i,n))return i}throw new J(`Data too big`)},e.willFit=function(e,t,n){return t.getTotalCodewords()-t.getECBlocksForLevel(n).getTotalECCodewords()>=(e+7)/8},e.terminateBits=function(e,t){var n=e*8;if(t.getSize()>n)throw new J(`data bits cannot fit in the QR Code`+t.getSize()+` > `+n);for(var r=0;r<4&&t.getSize()<n;++r)t.appendBit(!1);var i=t.getSize()&7;if(i>0)for(var r=i;r<8;r++)t.appendBit(!1);for(var a=e-t.getSizeInBytes(),r=0;r<a;++r)t.appendBits(r&1?17:236,8);if(t.getSize()!==n)throw new J(`Bits size does not equal capacity`)},e.getNumDataBytesAndNumECBytesForBlockID=function(e,t,n,r,i,a){if(r>=n)throw new J(`Block ID too large`);var o=e%n,s=n-o,c=Math.floor(e/n),l=c+1,u=Math.floor(t/n),d=u+1,f=c-u,p=l-d;if(f!==p)throw new J(`EC bytes mismatch`);if(n!==s+o)throw new J(`RS blocks mismatch`);if(e!==(u+f)*s+(d+p)*o)throw new J(`Total bytes mismatch`);r<s?(i[0]=u,a[0]=f):(i[0]=d,a[0]=p)},e.interleaveWithECBytes=function(t,n,r,i){var a,o,s,c;if(t.getSizeInBytes()!==r)throw new J(`Number of bits and data bytes does not match`);for(var l=0,u=0,d=0,f=[],p=0;p<i;++p){var m=new Int32Array(1),h=new Int32Array(1);e.getNumDataBytesAndNumECBytesForBlockID(n,r,i,p,m,h);var g=m[0],_=new Uint8Array(g);t.toBytes(8*l,_,0,g);var v=e.generateECBytes(_,h[0]);f.push(new ra(_,v)),u=Math.max(u,g),d=Math.max(d,v.length),l+=m[0]}if(r!==l)throw new J(`Data bytes does not match offset`);for(var y=new S,p=0;p<u;++p)try{for(var b=(a=void 0,ia(f)),x=b.next();!x.done;x=b.next()){var C=x.value,_=C.getDataBytes();p<_.length&&y.appendBits(_[p],8)}}catch(e){a={error:e}}finally{try{x&&!x.done&&(o=b.return)&&o.call(b)}finally{if(a)throw a.error}}for(var p=0;p<d;++p)try{for(var w=(s=void 0,ia(f)),T=w.next();!T.done;T=w.next()){var C=T.value,v=C.getErrorCorrectionBytes();p<v.length&&y.appendBits(v[p],8)}}catch(e){s={error:e}}finally{try{T&&!T.done&&(c=w.return)&&c.call(w)}finally{if(s)throw s.error}}if(n!==y.getSizeInBytes())throw new J(`Interleaving error: `+n+` and `+y.getSizeInBytes()+` differ.`);return y},e.generateECBytes=function(e,t){for(var n=e.length,r=new Int32Array(n+t),i=0;i<n;i++)r[i]=e[i]&255;new Xi(Oe.QR_CODE_FIELD_256).encode(r,t);for(var a=new Uint8Array(t),i=0;i<t;i++)a[i]=r[n+i];return a},e.appendModeInfo=function(e,t){t.appendBits(e.getBits(),4)},e.appendLengthInfo=function(e,t,n,r){var i=n.getCharacterCountBits(t);if(e>=1<<i)throw new J(e+` is bigger than `+((1<<i)-1));r.appendBits(e,i)},e.appendBytes=function(t,n,r,i){switch(n){case W.NUMERIC:e.appendNumericBytes(t,r);break;case W.ALPHANUMERIC:e.appendAlphanumericBytes(t,r);break;case W.BYTE:e.append8BitBytes(t,r,i);break;case W.KANJI:e.appendKanjiBytes(t,r);break;default:throw new J(`Invalid mode: `+n)}},e.getDigit=function(e){return e.charCodeAt(0)-48},e.isDigit=function(t){var n=e.getDigit(t);return n>=0&&n<=9},e.appendNumericBytes=function(t,n){for(var r=t.length,i=0;i<r;){var a=e.getDigit(t.charAt(i));if(i+2<r){var o=e.getDigit(t.charAt(i+1)),s=e.getDigit(t.charAt(i+2));n.appendBits(a*100+o*10+s,10),i+=3}else if(i+1<r){var o=e.getDigit(t.charAt(i+1));n.appendBits(a*10+o,7),i+=2}else n.appendBits(a,4),i++}},e.appendAlphanumericBytes=function(t,n){for(var r=t.length,i=0;i<r;){var a=e.getAlphanumericCode(t.charCodeAt(i));if(a===-1)throw new J;if(i+1<r){var o=e.getAlphanumericCode(t.charCodeAt(i+1));if(o===-1)throw new J;n.appendBits(a*45+o,11),i+=2}else n.appendBits(a,6),i++}},e.append8BitBytes=function(e,t,n){var r;try{r=ne.encode(e,n)}catch(e){throw new J(e)}for(var i=0,a=r.length;i!==a;i++){var o=r[i];t.appendBits(o,8)}},e.appendKanjiBytes=function(e,t){var n;try{n=ne.encode(e,O.SJIS)}catch(e){throw new J(e)}for(var r=n.length,i=0;i<r;i+=2){var a=n[i]&255,o=n[i+1]&255,s=a<<8|o,c=-1;if(s>=33088&&s<=40956?c=s-33088:s>=57408&&s<=60351&&(c=s-49472),c===-1)throw new J(`Invalid byte sequence`);var l=(c>>8)*192+(c&255);t.appendBits(l,13)}},e.appendECI=function(e,t){t.appendBits(W.ECI.getBits(),4),t.appendBits(e.getValue(),8)},e.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),e.DEFAULT_BYTE_MODE_ENCODING=O.UTF8.getName(),e}();(function(){function e(){}return e.prototype.write=function(t,n,r,i){if(i===void 0&&(i=null),t.length===0)throw new l(`Found empty contents`);if(n<0||r<0)throw new l(`Requested dimensions are too small: `+n+`x`+r);var a=or.L,o=e.QUIET_ZONE_SIZE;i!==null&&(i.get(q.ERROR_CORRECTION)!==void 0&&(a=or.fromString(i.get(q.ERROR_CORRECTION).toString())),i.get(q.MARGIN)!==void 0&&(o=Number.parseInt(i.get(q.MARGIN).toString(),10)));var s=aa.encode(t,a,i);return this.renderResult(s,n,r,o)},e.prototype.writeToDom=function(e,t,n,r,i){i===void 0&&(i=null),typeof e==`string`&&(e=document.querySelector(e));var a=this.write(t,n,r,i);e&&e.appendChild(a)},e.prototype.renderResult=function(e,t,n,r){var i=e.getMatrix();if(i===null)throw new Me;for(var a=i.getWidth(),o=i.getHeight(),s=a+r*2,c=o+r*2,l=Math.max(t,s),u=Math.max(n,c),d=Math.min(Math.floor(l/s),Math.floor(u/c)),f=Math.floor((l-a*d)/2),p=Math.floor((u-o*d)/2),m=this.createSVGElement(l,u),h=0,g=p;h<o;h++,g+=d)for(var _=0,v=f;_<a;_++,v+=d)if(i.get(_,h)===1){var y=this.createSvgRectElement(v,g,d,d);m.appendChild(y)}return m},e.prototype.createSVGElement=function(t,n){var r=document.createElementNS(e.SVG_NS,`svg`);return r.setAttributeNS(null,`height`,t.toString()),r.setAttributeNS(null,`width`,n.toString()),r},e.prototype.createSvgRectElement=function(t,n,r,i){var a=document.createElementNS(e.SVG_NS,`rect`);return a.setAttributeNS(null,`x`,t.toString()),a.setAttributeNS(null,`y`,n.toString()),a.setAttributeNS(null,`height`,r.toString()),a.setAttributeNS(null,`width`,i.toString()),a.setAttributeNS(null,`fill`,`#000000`),a},e.QUIET_ZONE_SIZE=4,e.SVG_NS=`http://www.w3.org/2000/svg`,e})();var oa=function(){function e(){}return e.prototype.encode=function(t,n,r,i,a){if(t.length===0)throw new l(`Found empty contents`);if(n!==N.QR_CODE)throw new l(`Can only encode QR_CODE, but got `+n);if(r<0||i<0)throw new l(`Requested dimensions are too small: ${r}x${i}`);var o=or.L,s=e.QUIET_ZONE_SIZE;a!==null&&(a.get(q.ERROR_CORRECTION)!==void 0&&(o=or.fromString(a.get(q.ERROR_CORRECTION).toString())),a.get(q.MARGIN)!==void 0&&(s=Number.parseInt(a.get(q.MARGIN).toString(),10)));var c=aa.encode(t,o,a);return e.renderResult(c,r,i,s)},e.renderResult=function(e,t,n,r){var i=e.getMatrix();if(i===null)throw new Me;for(var a=i.getWidth(),o=i.getHeight(),s=a+r*2,c=o+r*2,l=Math.max(t,s),u=Math.max(n,c),d=Math.min(Math.floor(l/s),Math.floor(u/c)),f=Math.floor((l-a*d)/2),p=Math.floor((u-o*d)/2),m=new re(l,u),h=0,g=p;h<o;h++,g+=d)for(var _=0,v=f;_<a;_++,v+=d)i.get(_,h)===1&&m.setRegion(v,g,d,d);return m},e.QUIET_ZONE_SIZE=4,e}();(function(){function e(){}return e.prototype.encode=function(e,t,n,r,i){var a;switch(t){case N.QR_CODE:a=new oa;break;default:throw new l(`No encoder available for format `+t)}return a.encode(e,t,n,r,i)},e})();var sa=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){sa(t,e);function t(t,n,r,i,a,o,s,c){var u=e.call(this,o,s)||this;if(u.yuvData=t,u.dataWidth=n,u.dataHeight=r,u.left=i,u.top=a,i+o>n||a+s>r)throw new l(`Crop rectangle does not fit within image data.`);return c&&u.reverseHorizontal(o,s),u}return t.prototype.getRow=function(e,t){if(e<0||e>=this.getHeight())throw new l(`Requested row is outside the image: `+e);var n=this.getWidth();(t==null||t.length<n)&&(t=new Uint8ClampedArray(n));var r=(e+this.top)*this.dataWidth+this.left;return m.arraycopy(this.yuvData,r,t,0,n),t},t.prototype.getMatrix=function(){var e=this.getWidth(),t=this.getHeight();if(e===this.dataWidth&&t===this.dataHeight)return this.yuvData;var n=e*t,r=new Uint8ClampedArray(n),i=this.top*this.dataWidth+this.left;if(e===this.dataWidth)return m.arraycopy(this.yuvData,i,r,0,n),r;for(var a=0;a<t;a++){var o=a*e;m.arraycopy(this.yuvData,i,r,o,e),i+=this.dataWidth}return r},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,n,r,i){return new t(this.yuvData,this.dataWidth,this.dataHeight,this.left+e,this.top+n,r,i,!1)},t.prototype.renderThumbnail=function(){for(var e=this.getWidth()/t.THUMBNAIL_SCALE_FACTOR,n=this.getHeight()/t.THUMBNAIL_SCALE_FACTOR,r=new Int32Array(e*n),i=this.yuvData,a=this.top*this.dataWidth+this.left,o=0;o<n;o++){for(var s=o*e,c=0;c<e;c++){var l=i[a+c*t.THUMBNAIL_SCALE_FACTOR]&255;r[s+c]=4278190080|l*65793}a+=this.dataWidth*t.THUMBNAIL_SCALE_FACTOR}return r},t.prototype.getThumbnailWidth=function(){return this.getWidth()/t.THUMBNAIL_SCALE_FACTOR},t.prototype.getThumbnailHeight=function(){return this.getHeight()/t.THUMBNAIL_SCALE_FACTOR},t.prototype.reverseHorizontal=function(e,t){for(var n=this.yuvData,r=0,i=this.top*this.dataWidth+this.left;r<t;r++,i+=this.dataWidth)for(var a=i+e/2,o=i,s=i+e-1;o<a;o++,s--){var c=n[o];n[o]=n[s],n[s]=c}},t.prototype.invert=function(){return new de(this)},t.THUMBNAIL_SCALE_FACTOR=2,t})(le);var ca=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){ca(t,e);function t(t,n,r,i,a,o,s){var c=e.call(this,n,r)||this;if(c.dataWidth=i,c.dataHeight=a,c.left=o,c.top=s,t.BYTES_PER_ELEMENT===4){for(var u=n*r,d=new Uint8ClampedArray(u),f=0;f<u;f++){var p=t[f],m=p>>16&255,h=p>>7&510,g=p&255;d[f]=(m+h+g)/4&255}c.luminances=d}else c.luminances=t;if(i===void 0&&(c.dataWidth=n),a===void 0&&(c.dataHeight=r),o===void 0&&(c.left=0),s===void 0&&(c.top=0),c.left+n>c.dataWidth||c.top+r>c.dataHeight)throw new l(`Crop rectangle does not fit within image data.`);return c}return t.prototype.getRow=function(e,t){if(e<0||e>=this.getHeight())throw new l(`Requested row is outside the image: `+e);var n=this.getWidth();(t==null||t.length<n)&&(t=new Uint8ClampedArray(n));var r=(e+this.top)*this.dataWidth+this.left;return m.arraycopy(this.luminances,r,t,0,n),t},t.prototype.getMatrix=function(){var e=this.getWidth(),t=this.getHeight();if(e===this.dataWidth&&t===this.dataHeight)return this.luminances;var n=e*t,r=new Uint8ClampedArray(n),i=this.top*this.dataWidth+this.left;if(e===this.dataWidth)return m.arraycopy(this.luminances,i,r,0,n),r;for(var a=0;a<t;a++){var o=a*e;m.arraycopy(this.luminances,i,r,o,e),i+=this.dataWidth}return r},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,n,r,i){return new t(this.luminances,r,i,this.dataWidth,this.dataHeight,this.left+e,this.top+n)},t.prototype.invert=function(){return new de(this)},t})(le);var la=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ua=function(e){la(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.forName=function(e){return this.getCharacterSetECIByName(e)},t}(O),da=function(){function e(){}return e.ISO_8859_1=O.ISO8859_1,e}(),fa=function(){function e(e,t,n){this.codewords=e,this.numcols=t,this.numrows=n,this.bits=new Uint8Array(t*n),b.fill(this.bits,2)}return e.prototype.getNumrows=function(){return this.numrows},e.prototype.getNumcols=function(){return this.numcols},e.prototype.getBits=function(){return this.bits},e.prototype.getBit=function(e,t){return this.bits[t*this.numcols+e]===1},e.prototype.setBit=function(e,t,n){this.bits[t*this.numcols+e]=+!!n},e.prototype.noBit=function(e,t){return this.bits[t*this.numcols+e]===2},e.prototype.place=function(){var e=0,t=4,n=0;do{t===this.numrows&&n===0&&this.corner1(e++),t===this.numrows-2&&n===0&&this.numcols%4!=0&&this.corner2(e++),t===this.numrows-2&&n===0&&this.numcols%8==4&&this.corner3(e++),t===this.numrows+4&&n===2&&this.numcols%8==0&&this.corner4(e++);do t<this.numrows&&n>=0&&this.noBit(n,t)&&this.utah(t,n,e++),t-=2,n+=2;while(t>=0&&n<this.numcols);t++,n+=3;do t>=0&&n<this.numcols&&this.noBit(n,t)&&this.utah(t,n,e++),t+=2,n-=2;while(t<this.numrows&&n>=0);t+=3,n++}while(t<this.numrows||n<this.numcols);this.noBit(this.numcols-1,this.numrows-1)&&(this.setBit(this.numcols-1,this.numrows-1,!0),this.setBit(this.numcols-2,this.numrows-2,!0))},e.prototype.module=function(e,t,n,r){e<0&&(e+=this.numrows,t+=4-(this.numrows+4)%8),t<0&&(t+=this.numcols,e+=4-(this.numcols+4)%8);var i=this.codewords.charCodeAt(n);i&=1<<8-r,this.setBit(t,e,i!==0)},e.prototype.utah=function(e,t,n){this.module(e-2,t-2,n,1),this.module(e-2,t-1,n,2),this.module(e-1,t-2,n,3),this.module(e-1,t-1,n,4),this.module(e-1,t,n,5),this.module(e,t-2,n,6),this.module(e,t-1,n,7),this.module(e,t,n,8)},e.prototype.corner1=function(e){this.module(this.numrows-1,0,e,1),this.module(this.numrows-1,1,e,2),this.module(this.numrows-1,2,e,3),this.module(0,this.numcols-2,e,4),this.module(0,this.numcols-1,e,5),this.module(1,this.numcols-1,e,6),this.module(2,this.numcols-1,e,7),this.module(3,this.numcols-1,e,8)},e.prototype.corner2=function(e){this.module(this.numrows-3,0,e,1),this.module(this.numrows-2,0,e,2),this.module(this.numrows-1,0,e,3),this.module(0,this.numcols-4,e,4),this.module(0,this.numcols-3,e,5),this.module(0,this.numcols-2,e,6),this.module(0,this.numcols-1,e,7),this.module(1,this.numcols-1,e,8)},e.prototype.corner3=function(e){this.module(this.numrows-3,0,e,1),this.module(this.numrows-2,0,e,2),this.module(this.numrows-1,0,e,3),this.module(0,this.numcols-2,e,4),this.module(0,this.numcols-1,e,5),this.module(1,this.numcols-1,e,6),this.module(2,this.numcols-1,e,7),this.module(3,this.numcols-1,e,8)},e.prototype.corner4=function(e){this.module(this.numrows-1,0,e,1),this.module(this.numrows-1,this.numcols-1,e,2),this.module(0,this.numcols-3,e,3),this.module(0,this.numcols-2,e,4),this.module(0,this.numcols-1,e,5),this.module(1,this.numcols-3,e,6),this.module(1,this.numcols-2,e,7),this.module(1,this.numcols-1,e,8)},e}(),pa,ma=[5,7,10,11,12,14,18,20,24,28,36,42,48,56,62,68],ha=[[228,48,15,111,62],[23,68,144,134,240,92,254],[28,24,185,166,223,248,116,255,110,61],[175,138,205,12,194,168,39,245,60,97,120],[41,153,158,91,61,42,142,213,97,178,100,242],[156,97,192,252,95,9,157,119,138,45,18,186,83,185],[83,195,100,39,188,75,66,61,241,213,109,129,94,254,225,48,90,188],[15,195,244,9,233,71,168,2,188,160,153,145,253,79,108,82,27,174,186,172],[52,190,88,205,109,39,176,21,155,197,251,223,155,21,5,172,254,124,12,181,184,96,50,193],[211,231,43,97,71,96,103,174,37,151,170,53,75,34,249,121,17,138,110,213,141,136,120,151,233,168,93,255],[245,127,242,218,130,250,162,181,102,120,84,179,220,251,80,182,229,18,2,4,68,33,101,137,95,119,115,44,175,184,59,25,225,98,81,112],[77,193,137,31,19,38,22,153,247,105,122,2,245,133,242,8,175,95,100,9,167,105,214,111,57,121,21,1,253,57,54,101,248,202,69,50,150,177,226,5,9,5],[245,132,172,223,96,32,117,22,238,133,238,231,205,188,237,87,191,106,16,147,118,23,37,90,170,205,131,88,120,100,66,138,186,240,82,44,176,87,187,147,160,175,69,213,92,253,225,19],[175,9,223,238,12,17,220,208,100,29,175,170,230,192,215,235,150,159,36,223,38,200,132,54,228,146,218,234,117,203,29,232,144,238,22,150,201,117,62,207,164,13,137,245,127,67,247,28,155,43,203,107,233,53,143,46],[242,93,169,50,144,210,39,118,202,188,201,189,143,108,196,37,185,112,134,230,245,63,197,190,250,106,185,221,175,64,114,71,161,44,147,6,27,218,51,63,87,10,40,130,188,17,163,31,176,170,4,107,232,7,94,166,224,124,86,47,11,204],[220,228,173,89,251,149,159,56,89,33,147,244,154,36,73,127,213,136,248,180,234,197,158,177,68,122,93,213,15,160,227,236,66,139,153,185,202,167,179,25,220,232,96,210,231,136,223,239,181,241,59,52,172,25,49,232,211,189,64,54,108,153,132,63,96,103,82,186]],ga=(pa=function(e,t){for(var n=1,r=0;r<255;r++)t[r]=n,e[n]=r,n*=2,n>=256&&(n^=301);return{LOG:e,ALOG:t}}([],[]),pa.LOG),_a=pa.ALOG,va;(function(e){e[e.FORCE_NONE=0]=`FORCE_NONE`,e[e.FORCE_SQUARE=1]=`FORCE_SQUARE`,e[e.FORCE_RECTANGLE=2]=`FORCE_RECTANGLE`})(va||={});var ya=`[)>05`,ba=`[)>06`,xa=function(){function e(){}return e.encodeECC200=function(e,t){if(e.length!==t.getDataCapacity())throw Error(`The number of codewords does not match the selected symbol`);var n=new j;n.append(e);var r=t.getInterleavedBlockCount();if(r===1){var i=this.createECCBlock(e,t.getErrorCodewords());n.append(i)}else{for(var a=[],o=[],s=0;s<r;s++)a[s]=t.getDataLengthForInterleavedBlock(s+1),o[s]=t.getErrorLengthForInterleavedBlock(s+1);for(var c=0;c<r;c++){for(var l=new j,u=c;u<t.getDataCapacity();u+=r)l.append(e.charAt(u));for(var i=this.createECCBlock(l.toString(),o[c]),d=0,f=c;f<o[c]*r;f+=r)n.setCharAt(t.getDataCapacity()+f,i.charAt(d++))}}return n.toString()},e.createECCBlock=function(e,t){for(var n=-1,r=0;r<ma.length;r++)if(ma[r]===t){n=r;break}if(n<0)throw Error(`Illegal number of error correction codewords specified: `+t);for(var i=ha[n],a=[],r=0;r<t;r++)a[r]=0;for(var r=0;r<e.length;r++){for(var o=a[t-1]^e.charAt(r).charCodeAt(0),s=t-1;s>0;s--)o!==0&&i[s]!==0?a[s]=a[s-1]^_a[(ga[o]+ga[i[s]])%255]:a[s]=a[s-1];a[0]=o!==0&&i[0]!==0?_a[(ga[o]+ga[i[0]])%255]:0}for(var c=[],r=0;r<t;r++)c[r]=a[t-r-1];return c.map(function(e){return String.fromCharCode(e)}).join(``)},e}(),Sa=function(){function e(){}return e.prototype.getEncodingMode=function(){return 0},e.prototype.encode=function(e){if(X.determineConsecutiveDigitCount(e.getMessage(),e.pos)>=2)e.writeCodeword(this.encodeASCIIDigits(e.getMessage().charCodeAt(e.pos),e.getMessage().charCodeAt(e.pos+1))),e.pos+=2;else{var t=e.getCurrentChar(),n=X.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode());if(n!==this.getEncodingMode())switch(n){case 5:e.writeCodeword(231),e.signalEncoderChange(5);return;case 1:e.writeCodeword(230),e.signalEncoderChange(1);return;case 3:e.writeCodeword(238),e.signalEncoderChange(3);break;case 2:e.writeCodeword(239),e.signalEncoderChange(2);break;case 4:e.writeCodeword(240),e.signalEncoderChange(4);break;default:throw Error(`Illegal mode: `+n)}else X.isExtendedASCII(t)?(e.writeCodeword(235),e.writeCodeword(t-128+1),e.pos++):(e.writeCodeword(t+1),e.pos++)}},e.prototype.encodeASCIIDigits=function(e,t){if(X.isDigit(e)&&X.isDigit(t))return(e-48)*10+(t-48)+130;throw Error(`not digits: `+e+t)},e}(),Ca=function(){function e(){}return e.prototype.getEncodingMode=function(){return 5},e.prototype.encode=function(e){var t=new j;for(t.append(0);e.hasMoreCharacters();){var n=e.getCurrentChar();if(t.append(n),e.pos++,X.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode())!==this.getEncodingMode()){e.signalEncoderChange(0);break}}var r=t.length()-1,i=e.getCodewordCount()+r+1;e.updateSymbolInfo(i);var a=e.getSymbolInfo().getDataCapacity()-i>0;if(e.hasMoreCharacters()||a){if(r<=249)t.setCharAt(0,A.getCharAt(r));else if(r<=1555)t.setCharAt(0,A.getCharAt(Math.floor(r/250)+249)),t.insert(1,A.getCharAt(r%250));else throw Error(`Message length not in valid ranges: `+r)}for(var o=0,n=t.length();o<n;o++)e.writeCodeword(this.randomize255State(t.charAt(o).charCodeAt(0),e.getCodewordCount()+1))},e.prototype.randomize255State=function(e,t){var n=e+(149*t%255+1);return n<=255?n:n-256},e}(),wa=function(){function e(){}return e.prototype.getEncodingMode=function(){return 1},e.prototype.encodeMaximal=function(e){for(var t=new j,n=0,r=e.pos,i=0;e.hasMoreCharacters();){var a=e.getCurrentChar();e.pos++,n=this.encodeChar(a,t),t.length()%3==0&&(r=e.pos,i=t.length())}if(i!==t.length()){var o=Math.floor(t.length()/3*2),s=Math.floor(e.getCodewordCount()+o+1);e.updateSymbolInfo(s);var c=e.getSymbolInfo().getDataCapacity()-s,l=Math.floor(t.length()%3);(l===2&&c!==2||l===1&&(n>3||c!==1))&&(e.pos=r)}t.length()>0&&e.writeCodeword(230),this.handleEOD(e,t)},e.prototype.encode=function(e){for(var t=new j;e.hasMoreCharacters();){var n=e.getCurrentChar();e.pos++;var r=this.encodeChar(n,t),i=Math.floor(t.length()/3)*2,a=e.getCodewordCount()+i;e.updateSymbolInfo(a);var o=e.getSymbolInfo().getDataCapacity()-a;if(!e.hasMoreCharacters()){var s=new j;for(t.length()%3==2&&o!==2&&(r=this.backtrackOneCharacter(e,t,s,r));t.length()%3==1&&(r>3||o!==1);)r=this.backtrackOneCharacter(e,t,s,r);break}if(t.length()%3==0&&X.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode())!==this.getEncodingMode()){e.signalEncoderChange(0);break}}this.handleEOD(e,t)},e.prototype.backtrackOneCharacter=function(e,t,n,r){var i=t.length(),a=t.toString().substring(0,i-r);t.setLengthToZero(),t.append(a),e.pos--;var o=e.getCurrentChar();return r=this.encodeChar(o,n),e.resetSymbolInfo(),r},e.prototype.writeNextTriplet=function(e,t){e.writeCodewords(this.encodeToCodewords(t.toString()));var n=t.toString().substring(3);t.setLengthToZero(),t.append(n)},e.prototype.handleEOD=function(e,t){var n=Math.floor(t.length()/3*2),r=t.length()%3,i=e.getCodewordCount()+n;e.updateSymbolInfo(i);var a=e.getSymbolInfo().getDataCapacity()-i;if(r===2){for(t.append(`\0`);t.length()>=3;)this.writeNextTriplet(e,t);e.hasMoreCharacters()&&e.writeCodeword(254)}else if(a===1&&r===1){for(;t.length()>=3;)this.writeNextTriplet(e,t);e.hasMoreCharacters()&&e.writeCodeword(254),e.pos--}else if(r===0){for(;t.length()>=3;)this.writeNextTriplet(e,t);(a>0||e.hasMoreCharacters())&&e.writeCodeword(254)}else throw Error(`Unexpected case. Please report!`);e.signalEncoderChange(0)},e.prototype.encodeChar=function(e,t){if(e===32)return t.append(3),1;if(e>=48&&e<=57)return t.append(e-48+4),1;if(e>=65&&e<=90)return t.append(e-65+14),1;if(e<32)return t.append(0),t.append(e),2;if(e<=47)return t.append(1),t.append(e-33),2;if(e<=64)return t.append(1),t.append(e-58+15),2;if(e<=95)return t.append(1),t.append(e-91+22),2;if(e<=127)return t.append(2),t.append(e-96),2;t.append(`1`);var n=2;return n+=this.encodeChar(e-128,t),n},e.prototype.encodeToCodewords=function(e){var t=1600*e.charCodeAt(0)+40*e.charCodeAt(1)+e.charCodeAt(2)+1,n=t/256,r=t%256,i=new j;return i.append(n),i.append(r),i.toString()},e}(),Ta=function(){function e(){}return e.prototype.getEncodingMode=function(){return 4},e.prototype.encode=function(e){for(var t=new j;e.hasMoreCharacters();){var n=e.getCurrentChar();if(this.encodeChar(n,t),e.pos++,t.length()>=4){e.writeCodewords(this.encodeToCodewords(t.toString()));var r=t.toString().substring(4);if(t.setLengthToZero(),t.append(r),X.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode())!==this.getEncodingMode()){e.signalEncoderChange(0);break}}}t.append(A.getCharAt(31)),this.handleEOD(e,t)},e.prototype.handleEOD=function(e,t){try{var n=t.length();if(n===0)return;if(n===1){e.updateSymbolInfo();var r=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount(),i=e.getRemainingCharacters();if(i>r&&(e.updateSymbolInfo(e.getCodewordCount()+1),r=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount()),i<=r&&r<=2)return}if(n>4)throw Error(`Count must not exceed 4`);var a=n-1,o=this.encodeToCodewords(t.toString()),s=!e.hasMoreCharacters()&&a<=2;if(a<=2){e.updateSymbolInfo(e.getCodewordCount()+a);var r=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount();r>=3&&(s=!1,e.updateSymbolInfo(e.getCodewordCount()+o.length))}s?(e.resetSymbolInfo(),e.pos-=a):e.writeCodewords(o)}finally{e.signalEncoderChange(0)}},e.prototype.encodeChar=function(e,t){e>=32&&e<=63?t.append(e):e>=64&&e<=94?t.append(A.getCharAt(e-64)):X.illegalCharacter(A.getCharAt(e))},e.prototype.encodeToCodewords=function(e){var t=e.length;if(t===0)throw Error(`StringBuilder must not be empty`);var n=e.charAt(0).charCodeAt(0),r=t>=2?e.charAt(1).charCodeAt(0):0,i=t>=3?e.charAt(2).charCodeAt(0):0,a=t>=4?e.charAt(3).charCodeAt(0):0,o=(n<<18)+(r<<12)+(i<<6)+a,s=o>>16&255,c=o>>8&255,l=o&255,u=new j;return u.append(s),t>=2&&u.append(c),t>=3&&u.append(l),u.toString()},e}(),Ea=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Da=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Y=function(){function e(e,t,n,r,i,a,o,s){o===void 0&&(o=0),s===void 0&&(s=0),this.rectangular=e,this.dataCapacity=t,this.errorCodewords=n,this.matrixWidth=r,this.matrixHeight=i,this.dataRegions=a,this.rsBlockData=o,this.rsBlockError=s}return e.lookup=function(e,t,n,r,i){var a,o;t===void 0&&(t=0),n===void 0&&(n=null),r===void 0&&(r=null),i===void 0&&(i=!0);try{for(var s=Da(ka),c=s.next();!c.done;c=s.next()){var l=c.value;if(!(t===1&&l.rectangular)&&(t!==2||l.rectangular)&&!(n!=null&&(l.getSymbolWidth()<n.getWidth()||l.getSymbolHeight()<n.getHeight()))&&!(r!=null&&(l.getSymbolWidth()>r.getWidth()||l.getSymbolHeight()>r.getHeight()))&&e<=l.dataCapacity)return l}}catch(e){a={error:e}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(a)throw a.error}}if(i)throw Error(`Can't find a symbol arrangement that matches the message. Data codewords: `+e);return null},e.prototype.getHorizontalDataRegions=function(){switch(this.dataRegions){case 1:return 1;case 2:case 4:return 2;case 16:return 4;case 36:return 6;default:throw Error(`Cannot handle this number of data regions`)}},e.prototype.getVerticalDataRegions=function(){switch(this.dataRegions){case 1:case 2:return 1;case 4:return 2;case 16:return 4;case 36:return 6;default:throw Error(`Cannot handle this number of data regions`)}},e.prototype.getSymbolDataWidth=function(){return this.getHorizontalDataRegions()*this.matrixWidth},e.prototype.getSymbolDataHeight=function(){return this.getVerticalDataRegions()*this.matrixHeight},e.prototype.getSymbolWidth=function(){return this.getSymbolDataWidth()+this.getHorizontalDataRegions()*2},e.prototype.getSymbolHeight=function(){return this.getSymbolDataHeight()+this.getVerticalDataRegions()*2},e.prototype.getCodewordCount=function(){return this.dataCapacity+this.errorCodewords},e.prototype.getInterleavedBlockCount=function(){return this.rsBlockData?this.dataCapacity/this.rsBlockData:1},e.prototype.getDataCapacity=function(){return this.dataCapacity},e.prototype.getErrorCodewords=function(){return this.errorCodewords},e.prototype.getDataLengthForInterleavedBlock=function(e){return this.rsBlockData},e.prototype.getErrorLengthForInterleavedBlock=function(e){return this.rsBlockError},e}(),Oa=function(e){Ea(t,e);function t(){return e.call(this,!1,1558,620,22,22,36,-1,62)||this}return t.prototype.getInterleavedBlockCount=function(){return 10},t.prototype.getDataLengthForInterleavedBlock=function(e){return e<=8?156:155},t}(Y),ka=[new Y(!1,3,5,8,8,1),new Y(!1,5,7,10,10,1),new Y(!0,5,7,16,6,1),new Y(!1,8,10,12,12,1),new Y(!0,10,11,14,6,2),new Y(!1,12,12,14,14,1),new Y(!0,16,14,24,10,1),new Y(!1,18,14,16,16,1),new Y(!1,22,18,18,18,1),new Y(!0,22,18,16,10,2),new Y(!1,30,20,20,20,1),new Y(!0,32,24,16,14,2),new Y(!1,36,24,22,22,1),new Y(!1,44,28,24,24,1),new Y(!0,49,28,22,14,2),new Y(!1,62,36,14,14,4),new Y(!1,86,42,16,16,4),new Y(!1,114,48,18,18,4),new Y(!1,144,56,20,20,4),new Y(!1,174,68,22,22,4),new Y(!1,204,84,24,24,4,102,42),new Y(!1,280,112,14,14,16,140,56),new Y(!1,368,144,16,16,16,92,36),new Y(!1,456,192,18,18,16,114,48),new Y(!1,576,224,20,20,16,144,56),new Y(!1,696,272,22,22,16,174,68),new Y(!1,816,336,24,24,16,136,56),new Y(!1,1050,408,18,18,36,175,68),new Y(!1,1304,496,20,20,36,163,62),new Oa],Aa=function(){function e(e){this.msg=e,this.pos=0,this.skipAtEnd=0;for(var t=e.split(``).map(function(e){return e.charCodeAt(0)}),n=new j,r=0,i=t.length;r<i;r++){var a=String.fromCharCode(t[r]&255);if(a===`?`&&e.charAt(r)!==`?`)throw Error(`Message contains characters outside ISO-8859-1 encoding.`);n.append(a)}this.msg=n.toString(),this.shape=0,this.codewords=new j,this.newEncoding=-1}return e.prototype.setSymbolShape=function(e){this.shape=e},e.prototype.setSizeConstraints=function(e,t){this.minSize=e,this.maxSize=t},e.prototype.getMessage=function(){return this.msg},e.prototype.setSkipAtEnd=function(e){this.skipAtEnd=e},e.prototype.getCurrentChar=function(){return this.msg.charCodeAt(this.pos)},e.prototype.getCurrent=function(){return this.msg.charCodeAt(this.pos)},e.prototype.getCodewords=function(){return this.codewords},e.prototype.writeCodewords=function(e){this.codewords.append(e)},e.prototype.writeCodeword=function(e){this.codewords.append(e)},e.prototype.getCodewordCount=function(){return this.codewords.length()},e.prototype.getNewEncoding=function(){return this.newEncoding},e.prototype.signalEncoderChange=function(e){this.newEncoding=e},e.prototype.resetEncoderSignal=function(){this.newEncoding=-1},e.prototype.hasMoreCharacters=function(){return this.pos<this.getTotalMessageCharCount()},e.prototype.getTotalMessageCharCount=function(){return this.msg.length-this.skipAtEnd},e.prototype.getRemainingCharacters=function(){return this.getTotalMessageCharCount()-this.pos},e.prototype.getSymbolInfo=function(){return this.symbolInfo},e.prototype.updateSymbolInfo=function(e){e===void 0&&(e=this.getCodewordCount()),(this.symbolInfo==null||e>this.symbolInfo.getDataCapacity())&&(this.symbolInfo=Y.lookup(e,this.shape,this.minSize,this.maxSize,!0))},e.prototype.resetSymbolInfo=function(){this.symbolInfo=null},e}(),ja=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ma=function(e){ja(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getEncodingMode=function(){return 3},t.prototype.encode=function(e){for(var t=new j;e.hasMoreCharacters();){var n=e.getCurrentChar();if(e.pos++,this.encodeChar(n,t),t.length()%3==0&&(this.writeNextTriplet(e,t),X.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode())!==this.getEncodingMode())){e.signalEncoderChange(0);break}}this.handleEOD(e,t)},t.prototype.encodeChar=function(e,t){switch(e){case 13:t.append(0);break;case 42:t.append(1);break;case 62:t.append(2);break;case 32:t.append(3);break;default:e>=48&&e<=57?t.append(e-48+4):e>=65&&e<=90?t.append(e-65+14):X.illegalCharacter(A.getCharAt(e))}return 1},t.prototype.handleEOD=function(e,t){e.updateSymbolInfo();var n=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount(),r=t.length();e.pos-=r,(e.getRemainingCharacters()>1||n>1||e.getRemainingCharacters()!==n)&&e.writeCodeword(254),e.getNewEncoding()<0&&e.signalEncoderChange(0)},t}(wa),Na=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Pa=function(e){Na(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getEncodingMode=function(){return 2},t.prototype.encodeChar=function(e,t){if(e===32)return t.append(3),1;if(e>=48&&e<=57)return t.append(e-48+4),1;if(e>=97&&e<=122)return t.append(e-97+14),1;if(e<32)return t.append(0),t.append(e),2;if(e<=47)return t.append(1),t.append(e-33),2;if(e<=64)return t.append(1),t.append(e-58+15),2;if(e>=91&&e<=95)return t.append(1),t.append(e-91+22),2;if(e===96)return t.append(2),t.append(0),2;if(e<=90)return t.append(2),t.append(e-65+1),2;if(e<=127)return t.append(2),t.append(e-123+27),2;t.append(`1`);var n=2;return n+=this.encodeChar(e-128,t),n},t}(wa),X=function(){function e(){}return e.randomize253State=function(e){var t=129+(149*e%253+1);return t<=254?t:t-254},e.encodeHighLevel=function(e,t,n,r,i){t===void 0&&(t=0),n===void 0&&(n=null),r===void 0&&(r=null),i===void 0&&(i=!1);var a=new wa,o=[new Sa,a,new Pa,new Ma,new Ta,new Ca],s=new Aa(e);s.setSymbolShape(t),s.setSizeConstraints(n,r),e.startsWith(`[)>05`)&&e.endsWith(``)?(s.writeCodeword(236),s.setSkipAtEnd(2),s.pos+=ya.length):e.startsWith(`[)>06`)&&e.endsWith(``)&&(s.writeCodeword(237),s.setSkipAtEnd(2),s.pos+=ba.length);var c=0;for(i&&(a.encodeMaximal(s),c=s.getNewEncoding(),s.resetEncoderSignal());s.hasMoreCharacters();)o[c].encode(s),s.getNewEncoding()>=0&&(c=s.getNewEncoding(),s.resetEncoderSignal());var l=s.getCodewordCount();s.updateSymbolInfo();var u=s.getSymbolInfo().getDataCapacity();l<u&&c!==0&&c!==5&&c!==4&&s.writeCodeword(`þ`);var d=s.getCodewords();for(d.length()<u&&d.append(129);d.length()<u;)d.append(this.randomize253State(d.length()+1));return s.getCodewords().toString()},e.lookAheadTest=function(e,t,n){var r=this.lookAheadTestIntern(e,t,n);if(n===3&&r===3){for(var i=Math.min(t+3,e.length),a=t;a<i;a++)if(!this.isNativeX12(e.charCodeAt(a)))return 0}else if(n===4&&r===4){for(var i=Math.min(t+4,e.length),a=t;a<i;a++)if(!this.isNativeEDIFACT(e.charCodeAt(a)))return 0}return r},e.lookAheadTestIntern=function(e,t,n){if(t>=e.length)return n;var r;n===0?r=[0,1,1,1,1,1.25]:(r=[1,2,2,2,2,2.25],r[n]=0);for(var i=0,a=new Uint8Array(6),o=[];;){if(t+i===e.length){b.fill(a,0),b.fill(o,0);var s=this.findMinimums(r,o,x.MAX_VALUE,a),c=this.getMinimumCount(a);if(o[0]===s)return 0;if(c===1){if(a[5]>0)return 5;if(a[4]>0)return 4;if(a[2]>0)return 2;if(a[3]>0)return 3}return 1}var l=e.charCodeAt(t+i);if(i++,this.isDigit(l)?r[0]+=.5:this.isExtendedASCII(l)?(r[0]=Math.ceil(r[0]),r[0]+=2):(r[0]=Math.ceil(r[0]),r[0]++),this.isNativeC40(l)?r[1]+=2/3:this.isExtendedASCII(l)?r[1]+=8/3:r[1]+=4/3,this.isNativeText(l)?r[2]+=2/3:this.isExtendedASCII(l)?r[2]+=8/3:r[2]+=4/3,this.isNativeX12(l)?r[3]+=2/3:this.isExtendedASCII(l)?r[3]+=13/3:r[3]+=10/3,this.isNativeEDIFACT(l)?r[4]+=3/4:this.isExtendedASCII(l)?r[4]+=17/4:r[4]+=13/4,this.isSpecialB256(l)?r[5]+=4:r[5]++,i>=4){if(b.fill(a,0),b.fill(o,0),this.findMinimums(r,o,x.MAX_VALUE,a),o[0]<this.min(o[5],o[1],o[2],o[3],o[4]))return 0;if(o[5]<o[0]||o[5]+1<this.min(o[1],o[2],o[3],o[4]))return 5;if(o[4]+1<this.min(o[5],o[1],o[2],o[3],o[0]))return 4;if(o[2]+1<this.min(o[5],o[1],o[4],o[3],o[0]))return 2;if(o[3]+1<this.min(o[5],o[1],o[4],o[2],o[0]))return 3;if(o[1]+1<this.min(o[0],o[5],o[4],o[2])){if(o[1]<o[3])return 1;if(o[1]===o[3]){for(var u=t+i+1;u<e.length;){var d=e.charCodeAt(u);if(this.isX12TermSep(d))return 3;if(!this.isNativeX12(d))break;u++}return 1}}}}},e.min=function(e,t,n,r,i){var a=Math.min(e,Math.min(t,Math.min(n,r)));return i===void 0?a:Math.min(a,i)},e.findMinimums=function(e,t,n,r){for(var i=0;i<6;i++){var a=t[i]=Math.ceil(e[i]);n>a&&(n=a,b.fill(r,0)),n===a&&(r[i]=r[i]+1)}return n},e.getMinimumCount=function(e){for(var t=0,n=0;n<6;n++)t+=e[n];return t||0},e.isDigit=function(e){return e>=48&&e<=57},e.isExtendedASCII=function(e){return e>=128&&e<=255},e.isNativeC40=function(e){return e===32||e>=48&&e<=57||e>=65&&e<=90},e.isNativeText=function(e){return e===32||e>=48&&e<=57||e>=97&&e<=122},e.isNativeX12=function(e){return this.isX12TermSep(e)||e===32||e>=48&&e<=57||e>=65&&e<=90},e.isX12TermSep=function(e){return e===13||e===42||e===62},e.isNativeEDIFACT=function(e){return e>=32&&e<=94},e.isSpecialB256=function(e){return!1},e.determineConsecutiveDigitCount=function(e,t){t===void 0&&(t=0);for(var n=e.length,r=t;r<n&&this.isDigit(e.charCodeAt(r));)r++;return r-t},e.illegalCharacter=function(e){var t=x.toHexString(e.charCodeAt(0));throw t=`0000`.substring(0,4-t.length)+t,Error(`Illegal character: `+e+` (0x`+t+`)`)},e}(),Fa=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Ia=function(){function e(e){this.charset=e,this.name=e.name}return e.prototype.canEncode=function(e){try{return ne.encode(e,this.charset)!=null}catch{return!1}},e}(),La=function(){function e(e,t,n){var r,i,a,o,s,c;this.ENCODERS=[`IBM437`,`ISO-8859-2`,`ISO-8859-3`,`ISO-8859-4`,`ISO-8859-5`,`ISO-8859-6`,`ISO-8859-7`,`ISO-8859-8`,`ISO-8859-9`,`ISO-8859-10`,`ISO-8859-11`,`ISO-8859-13`,`ISO-8859-14`,`ISO-8859-15`,`ISO-8859-16`,`windows-1250`,`windows-1251`,`windows-1252`,`windows-1256`,`Shift_JIS`].map(function(e){return new Ia(ua.forName(e))}),this.encoders=[];var l=[];l.push(new Ia(da.ISO_8859_1));for(var u=t!=null&&t.name.startsWith(`UTF`),d=0;d<e.length;d++){var f=!1;try{for(var p=(r=void 0,Fa(l)),m=p.next();!m.done;m=p.next()){var h=m.value,g=e.charAt(d);if(g.charCodeAt(0)===n||h.canEncode(g)){f=!0;break}}}catch(e){r={error:e}}finally{try{m&&!m.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}if(!f)try{for(var _=(a=void 0,Fa(this.ENCODERS)),v=_.next();!v.done;v=_.next()){var h=v.value;if(h.canEncode(e.charAt(d))){l.push(h),f=!0;break}}}catch(e){a={error:e}}finally{try{v&&!v.done&&(o=_.return)&&o.call(_)}finally{if(a)throw a.error}}f||(u=!0)}if(l.length===1&&!u)this.encoders=[l[0]];else{this.encoders=[];var y=0;try{for(var b=Fa(l),x=b.next();!x.done;x=b.next()){var h=x.value;this.encoders[y++]=h}}catch(e){s={error:e}}finally{try{x&&!x.done&&(c=b.return)&&c.call(b)}finally{if(s)throw s.error}}}var S=-1;if(t!=null){for(var d=0;d<this.encoders.length;d++)if(this.encoders[d]!=null&&t.name===this.encoders[d].name){S=d;break}}this.priorityEncoderIndex=S}return e.prototype.length=function(){return this.encoders.length},e.prototype.getCharsetName=function(e){if(!(e<this.length()))throw Error(`index must be less than length`);return this.encoders[e].name},e.prototype.getCharset=function(e){if(!(e<this.length()))throw Error(`index must be less than length`);return this.encoders[e].charset},e.prototype.getECIValue=function(e){return this.encoders[e].charset.getValueIdentifier()},e.prototype.getPriorityEncoderIndex=function(){return this.priorityEncoderIndex},e.prototype.canEncode=function(e,t){if(!(t<this.length()))throw Error(`index must be less than length`);return!0},e.prototype.encode=function(e,t){if(!(t<this.length()))throw Error(`index must be less than length`);return ne.encode(A.getCharAt(e),this.encoders[t].name)},e}(),Ra=3,za=function(){function e(e,t,n){this.fnc1=n;var r=new La(e,t,n);if(r.length()===1)for(var i=0;i<this.bytes.length;i++){var a=e.charAt(i).charCodeAt(0);this.bytes[i]=a===n?1e3:a}else this.bytes=this.encodeMinimally(e,r,n)}return e.prototype.getFNC1Character=function(){return this.fnc1},e.prototype.length=function(){return this.bytes.length},e.prototype.haveNCharacters=function(e,t){if(e+t-1>=this.bytes.length)return!1;for(var n=0;n<t;n++)if(this.isECI(e+n))return!1;return!0},e.prototype.charAt=function(e){if(e<0||e>=this.length())throw Error(``+e);if(this.isECI(e))throw Error(`value at `+e+` is not a character but an ECI`);return this.isFNC1(e)?this.fnc1:this.bytes[e]},e.prototype.subSequence=function(e,t){if(e<0||e>t||t>this.length())throw Error(``+e);for(var n=new j,r=e;r<t;r++){if(this.isECI(r))throw Error(`value at `+r+` is not a character but an ECI`);n.append(this.charAt(r))}return n.toString()},e.prototype.isECI=function(e){if(e<0||e>=this.length())throw Error(``+e);return this.bytes[e]>255&&this.bytes[e]<=999},e.prototype.isFNC1=function(e){if(e<0||e>=this.length())throw Error(``+e);return this.bytes[e]===1e3},e.prototype.getECIValue=function(e){if(e<0||e>=this.length())throw Error(``+e);if(!this.isECI(e))throw Error(`value at `+e+` is not an ECI but a character`);return this.bytes[e]-256},e.prototype.addEdge=function(e,t,n){(e[t][n.encoderIndex]==null||e[t][n.encoderIndex].cachedTotalSize>n.cachedTotalSize)&&(e[t][n.encoderIndex]=n)},e.prototype.addEdges=function(e,t,n,r,i,a){var o=e.charAt(r).charCodeAt(0),s=0,c=t.length();t.getPriorityEncoderIndex()>=0&&(o===a||t.canEncode(o,t.getPriorityEncoderIndex()))&&(s=t.getPriorityEncoderIndex(),c=s+1);for(var l=s;l<c;l++)(o===a||t.canEncode(o,l))&&this.addEdge(n,r+1,new Ba(o,t,l,i,a))},e.prototype.encodeMinimally=function(e,t,n){var r=e.length,i=new Ba[r+1][t.length()];this.addEdges(e,t,i,0,null,n);for(var a=1;a<=r;a++){for(var o=0;o<t.length();o++)i[a][o]!=null&&a<r&&this.addEdges(e,t,i,a,i[a][o],n);for(var o=0;o<t.length();o++)i[a-1][o]=null}for(var s=-1,c=x.MAX_VALUE,o=0;o<t.length();o++)if(i[r][o]!=null){var l=i[r][o];l.cachedTotalSize<c&&(c=l.cachedTotalSize,s=o)}if(s<0)throw Error(`Failed to encode "`+e+`"`);for(var u=[],d=i[r][s];d!=null;){if(d.isFNC1())u.unshift(1e3);else for(var f=t.encode(d.c,d.encoderIndex),a=f.length-1;a>=0;a--)u.unshift(f[a]&255);(d.previous===null?0:d.previous.encoderIndex)!==d.encoderIndex&&u.unshift(256+t.getECIValue(d.encoderIndex)),d=d.previous}for(var p=[],a=0;a<p.length;a++)p[a]=u[a];return p},e}(),Ba=function(){function e(e,t,n,r,i){this.c=e,this.encoderSet=t,this.encoderIndex=n,this.previous=r,this.fnc1=i,this.c=e===i?1e3:e;var a=this.isFNC1()?1:t.encode(e,n).length;(r===null?0:r.encoderIndex)!==n&&(a+=Ra),r!=null&&(a+=r.cachedTotalSize),this.cachedTotalSize=a}return e.prototype.isFNC1=function(){return this.c===1e3},e}(),Va=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ha=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Ua=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Wa=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},Z;(function(e){e[e.ASCII=0]=`ASCII`,e[e.C40=1]=`C40`,e[e.TEXT=2]=`TEXT`,e[e.X12=3]=`X12`,e[e.EDF=4]=`EDF`,e[e.B256=5]=`B256`})(Z||={});var Ga=`!"#$%&'()*+,-./:;<=>?@[\\]^_`.split(``),Ka=function(){function e(){}return e.isExtendedASCII=function(e,t){return e!==t&&e>=128&&e<=255},e.isInC40Shift1Set=function(e){return e<=31},e.isInC40Shift2Set=function(e,t){var n,r;try{for(var i=Ha(Ga),a=i.next();!a.done;a=i.next())if(a.value.charCodeAt(0)===e)return!0}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e===t},e.isInTextShift1Set=function(e){return this.isInC40Shift1Set(e)},e.isInTextShift2Set=function(e,t){return this.isInC40Shift2Set(e,t)},e.encodeHighLevel=function(e,t,n,r){t===void 0&&(t=null),n===void 0&&(n=-1),r===void 0&&(r=0);var i=0;return e.startsWith(`[)>05`)&&e.endsWith(``)?(i=5,e=e.substring(ya.length,e.length-2)):e.startsWith(`[)>06`)&&e.endsWith(``)&&(i=6,e=e.substring(ba.length,e.length-2)),decodeURIComponent(escape(String.fromCharCode.apply(String,Wa([],Ua(this.encode(e,t,n,r,i)),!1))))},e.encode=function(e,t,n,r,i){return this.encodeMinimally(new Ya(e,t,n,r,i)).getBytes()},e.addEdge=function(e,t){var n=t.fromPosition+t.characterLength;(e[n][t.getEndMode()]===null||e[n][t.getEndMode()].cachedTotalSize>t.cachedTotalSize)&&(e[n][t.getEndMode()]=t)},e.getNumberOfC40Words=function(t,n,r,i){for(var a=0,o=n;o<t.length();o++){if(t.isECI(o))return i[0]=0,0;var s=t.charAt(o);if(r&&X.isNativeC40(s)||!r&&X.isNativeText(s))a++;else if(!e.isExtendedASCII(s,t.getFNC1Character()))a+=2;else{var c=s&255;c>=128&&(r&&X.isNativeC40(c-128)||!r&&X.isNativeText(c-128))?a+=3:a+=4}if(a%3==0||(a-2)%3==0&&o+1===t.length())return i[0]=o-n+1,Math.ceil(a/3)}return i[0]=0,0},e.addEdges=function(t,n,r,i){var a,o;if(t.isECI(r))this.addEdge(n,new Ja(t,Z.ASCII,r,1,i));else{var s=t.charAt(r);if(i===null||i.getEndMode()!==Z.EDF){X.isDigit(s)&&t.haveNCharacters(r,2)&&X.isDigit(t.charAt(r+1))?this.addEdge(n,new Ja(t,Z.ASCII,r,2,i)):this.addEdge(n,new Ja(t,Z.ASCII,r,1,i));var c=[Z.C40,Z.TEXT];try{for(var l=Ha(c),u=l.next();!u.done;u=l.next()){var d=u.value,f=[];e.getNumberOfC40Words(t,r,d===Z.C40,f)>0&&this.addEdge(n,new Ja(t,d,r,f[0],i))}}catch(e){a={error:e}}finally{try{u&&!u.done&&(o=l.return)&&o.call(l)}finally{if(a)throw a.error}}t.haveNCharacters(r,3)&&X.isNativeX12(t.charAt(r))&&X.isNativeX12(t.charAt(r+1))&&X.isNativeX12(t.charAt(r+2))&&this.addEdge(n,new Ja(t,Z.X12,r,3,i)),this.addEdge(n,new Ja(t,Z.B256,r,1,i))}for(var p=0;p<3;p++){var m=r+p;if(t.haveNCharacters(m,1)&&X.isNativeEDIFACT(t.charAt(m)))this.addEdge(n,new Ja(t,Z.EDF,r,p+1,i));else break}p===3&&t.haveNCharacters(r,4)&&X.isNativeEDIFACT(t.charAt(r+3))&&this.addEdge(n,new Ja(t,Z.EDF,r,4,i))}},e.encodeMinimally=function(e){var t=e.length(),n=Array(t+1).fill(null).map(function(){return[,,,,,,].fill(0)});this.addEdges(e,n,0,null);for(var r=1;r<=t;r++){for(var i=0;i<6;i++)n[r][i]!==null&&r<t&&this.addEdges(e,n,r,n[r][i]);for(var i=0;i<6;i++)n[r-1][i]=null}for(var a=-1,o=x.MAX_VALUE,i=0;i<6;i++)if(n[t][i]!==null){var s=n[t][i],c=i>=1&&i<=3?s.cachedTotalSize+1:s.cachedTotalSize;c<o&&(o=c,a=i)}if(a<0)throw Error(`Failed to encode "`+e+`"`);return new qa(n[t][a])},e}(),qa=function(){function e(e){var t=e.input,n=0,r=[],i=[],a=[];(e.mode===Z.C40||e.mode===Z.TEXT||e.mode===Z.X12)&&e.getEndMode()!==Z.ASCII&&(n+=this.prepend(Ja.getBytes(254),r));for(var o=e;o!==null;)n+=this.prepend(o.getDataBytes(),r),(o.previous===null||o.getPreviousStartMode()!==o.getMode())&&(o.getMode()===Z.B256&&(n<=249?(r.unshift(n),n++):(r.unshift(n%250),r.unshift(n/250+249),n+=2),i.push(r.length),a.push(n)),this.prepend(o.getLatchBytes(),r),n=0),o=o.previous;t.getMacroId()===5?n+=this.prepend(Ja.getBytes(236),r):t.getMacroId()===6&&(n+=this.prepend(Ja.getBytes(237),r)),t.getFNC1Character()>0&&(n+=this.prepend(Ja.getBytes(232),r));for(var s=0;s<i.length;s++)this.applyRandomPattern(r,r.length-i[s],a[s]);var c=e.getMinSymbolSize(r.length);for(r.length<c&&r.push(129);r.length<c;)r.push(this.randomize253State(r.length+1));this.bytes=new Uint8Array(r.length);for(var s=0;s<this.bytes.length;s++)this.bytes[s]=r[s]}return e.prototype.prepend=function(e,t){for(var n=e.length-1;n>=0;n--)t.unshift(e[n]);return e.length},e.prototype.randomize253State=function(e){var t=129+(149*e%253+1);return t<=254?t:t-254},e.prototype.applyRandomPattern=function(e,t,n){for(var r=0;r<n;r++){var i=t+r,a=(e[i]&255)+(149*(i+1)%255+1);e[i]=a<=255?a:a-256}},e.prototype.getBytes=function(){return this.bytes},e}(),Ja=function(){function e(e,t,n,r,i){if(this.input=e,this.mode=t,this.fromPosition=n,this.characterLength=r,this.previous=i,this.allCodewordCapacities=[3,5,8,10,12,16,18,22,30,32,36,44,49,62,86,114,144,174,204,280,368,456,576,696,816,1050,1304,1558],this.squareCodewordCapacities=[3,5,8,12,18,22,30,36,44,62,86,114,144,174,204,280,368,456,576,696,816,1050,1304,1558],this.rectangularCodewordCapacities=[5,10,16,33,32,49],!(n+r<=e.length()))throw Error(`Invalid edge`);var a=i===null?0:i.cachedTotalSize,o=this.getPreviousMode();switch(t){case Z.ASCII:a++,(e.isECI(n)||Ka.isExtendedASCII(e.charAt(n),e.getFNC1Character()))&&a++,(o===Z.C40||o===Z.TEXT||o===Z.X12)&&a++;break;case Z.B256:a++,o===Z.B256?this.getB256Size()===250&&a++:a++,o===Z.ASCII?a++:(o===Z.C40||o===Z.TEXT||o===Z.X12)&&(a+=2);break;case Z.C40:case Z.TEXT:case Z.X12:t===Z.X12?a+=2:a+=Ka.getNumberOfC40Words(e,n,t===Z.C40,[])*2,o===Z.ASCII||o===Z.B256?a++:o!==t&&(o===Z.C40||o===Z.TEXT||o===Z.X12)&&(a+=2);break;case Z.EDF:a+=3,o===Z.ASCII||o===Z.B256?a++:(o===Z.C40||o===Z.TEXT||o===Z.X12)&&(a+=2)}this.cachedTotalSize=a}return e.prototype.getB256Size=function(){for(var e=0,t=this;t!==null&&t.mode===Z.B256&&e<=250;)e++,t=t.previous;return e},e.prototype.getPreviousStartMode=function(){return this.previous===null?Z.ASCII:this.previous.mode},e.prototype.getPreviousMode=function(){return this.previous===null?Z.ASCII:this.previous.getEndMode()},e.prototype.getEndMode=function(){if(this.mode===Z.EDF){if(this.characterLength<4)return Z.ASCII;var e=this.getLastASCII();if(e>0&&this.getCodewordsRemaining(this.cachedTotalSize+e)<=2-e)return Z.ASCII}if(this.mode===Z.C40||this.mode===Z.TEXT||this.mode===Z.X12){if(this.fromPosition+this.characterLength>=this.input.length()&&this.getCodewordsRemaining(this.cachedTotalSize)===0)return Z.ASCII;var e=this.getLastASCII();if(e===1&&this.getCodewordsRemaining(this.cachedTotalSize+1)===0)return Z.ASCII}return this.mode},e.prototype.getMode=function(){return this.mode},e.prototype.getLastASCII=function(){var e=this.input.length(),t=this.fromPosition+this.characterLength;return e-t>4||t>=e?0:e-t===1?+!Ka.isExtendedASCII(this.input.charAt(t),this.input.getFNC1Character()):e-t===2?Ka.isExtendedASCII(this.input.charAt(t),this.input.getFNC1Character())||Ka.isExtendedASCII(this.input.charAt(t+1),this.input.getFNC1Character())?0:X.isDigit(this.input.charAt(t))&&X.isDigit(this.input.charAt(t+1))?1:2:e-t===3?X.isDigit(this.input.charAt(t))&&X.isDigit(this.input.charAt(t+1))&&!Ka.isExtendedASCII(this.input.charAt(t+2),this.input.getFNC1Character())||X.isDigit(this.input.charAt(t+1))&&X.isDigit(this.input.charAt(t+2))&&!Ka.isExtendedASCII(this.input.charAt(t),this.input.getFNC1Character())?2:0:X.isDigit(this.input.charAt(t))&&X.isDigit(this.input.charAt(t+1))&&X.isDigit(this.input.charAt(t+2))&&X.isDigit(this.input.charAt(t+3))?2:0},e.prototype.getMinSymbolSize=function(e){var t,n,r,i,a,o;switch(this.input.getShapeHint()){case 1:try{for(var s=Ha(this.squareCodewordCapacities),c=s.next();!c.done;c=s.next()){var l=c.value;if(l>=e)return l}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}break;case 2:try{for(var u=Ha(this.rectangularCodewordCapacities),d=u.next();!d.done;d=u.next()){var l=d.value;if(l>=e)return l}}catch(e){r={error:e}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}try{for(var f=Ha(this.allCodewordCapacities),p=f.next();!p.done;p=f.next()){var l=p.value;if(l>=e)return l}}catch(e){a={error:e}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(a)throw a.error}}return this.allCodewordCapacities[this.allCodewordCapacities.length-1]},e.prototype.getCodewordsRemaining=function(e){return this.getMinSymbolSize(e)-e},e.getBytes=function(e,t){var n=new Uint8Array(t?2:1);return n[0]=e,t&&(n[1]=t),n},e.prototype.setC40Word=function(e,t,n,r,i){var a=1600*(n&255)+40*(r&255)+(i&255)+1;e[t]=a/256,e[t+1]=a%256},e.prototype.getX12Value=function(e){return e===13?0:e===42?1:e===62?2:e===32?3:e>=48&&e<=57?e-44:e>=65&&e<=90?e-51:e},e.prototype.getX12Words=function(){if(this.characterLength%3!=0)throw Error(`X12 words must be a multiple of 3`);for(var e=new Uint8Array(this.characterLength/3*2),t=0;t<e.length;t+=2)this.setC40Word(e,t,this.getX12Value(this.input.charAt(this.fromPosition+t/2*3)),this.getX12Value(this.input.charAt(this.fromPosition+t/2*3+1)),this.getX12Value(this.input.charAt(this.fromPosition+t/2*3+2)));return e},e.prototype.getShiftValue=function(e,t,n){return t&&Ka.isInC40Shift1Set(e)||!t&&Ka.isInTextShift1Set(e)?0:t&&Ka.isInC40Shift2Set(e,n)||!t&&Ka.isInTextShift2Set(e,n)?1:2},e.prototype.getC40Value=function(e,t,n,r){if(n===r){if(t!==2)throw Error(`FNC1 cannot be used in C40 shift 2`);return 27}return e?n<=31?n:n===32?3:n<=47?n-33:n<=57?n-44:n<=64?n-43:n<=90?n-51:n<=95?n-69:n<=127?n-96:n:n===0?0:t===0&&n<=3?n-1:t===1&&n<=31?n:n===32?3:n>=33&&n<=47?n-33:n>=48&&n<=57?n-44:n>=58&&n<=64?n-43:n>=65&&n<=90?n-64:n>=91&&n<=95?n-69:n===96?0:n>=97&&n<=122?n-83:n>=123&&n<=127?n-96:n},e.prototype.getC40Words=function(e,t){for(var n=[],r=0;r<this.characterLength;r++){var i=this.input.charAt(this.fromPosition+r);if(e&&X.isNativeC40(i)||!e&&X.isNativeText(i))n.push(this.getC40Value(e,0,i,t));else if(Ka.isExtendedASCII(i,t)){var a=(i&255)-128;if(e&&X.isNativeC40(a)||!e&&X.isNativeText(a))n.push(1),n.push(30),n.push(this.getC40Value(e,0,a,t));else{n.push(1),n.push(30);var o=this.getShiftValue(a,e,t);n.push(o),n.push(this.getC40Value(e,o,a,t))}}else{var o=this.getShiftValue(i,e,t);n.push(o),n.push(this.getC40Value(e,o,i,t))}}if(n.length%3!=0){if((n.length-2)%3!=0||this.fromPosition+this.characterLength!==this.input.length())throw Error(`C40 words must be a multiple of 3`);n.push(0)}for(var s=new Uint8Array(n.length/3*2),c=0,r=0;r<n.length;r+=3)this.setC40Word(s,c,n[r]&255,n[r+1]&255,n[r+2]&255),c+=2;return s},e.prototype.getEDFBytes=function(){for(var e=Math.ceil(this.characterLength/4),t=new Uint8Array(e*3),n=this.fromPosition,r=Math.min(this.fromPosition+this.characterLength-1,this.input.length()-1),i=0;i<e;i+=3){for(var a=[],o=0;o<4;o++)n<=r?a[o]=this.input.charAt(n++)&63:a[o]=n===r+1?31:0;var s=a[0]<<18;s|=a[1]<<12,s|=a[2]<<6,s|=a[3],t[i]=s>>16&255,t[i+1]=s>>8&255,t[i+2]=s&255}return t},e.prototype.getLatchBytes=function(){switch(this.getPreviousMode()){case Z.ASCII:case Z.B256:switch(this.mode){case Z.B256:return e.getBytes(231);case Z.C40:return e.getBytes(230);case Z.TEXT:return e.getBytes(239);case Z.X12:return e.getBytes(238);case Z.EDF:return e.getBytes(240)}break;case Z.C40:case Z.TEXT:case Z.X12:if(this.mode!==this.getPreviousMode())switch(this.mode){case Z.ASCII:return e.getBytes(254);case Z.B256:return e.getBytes(254,231);case Z.C40:return e.getBytes(254,230);case Z.TEXT:return e.getBytes(254,239);case Z.X12:return e.getBytes(254,238);case Z.EDF:return e.getBytes(254,240)}break;case Z.EDF:if(this.mode!==Z.EDF)throw Error(`Cannot switch from EDF to `+this.mode)}return new Uint8Array},e.prototype.getDataBytes=function(){switch(this.mode){case Z.ASCII:return this.input.isECI(this.fromPosition)?e.getBytes(241,this.input.getECIValue(this.fromPosition)+1):Ka.isExtendedASCII(this.input.charAt(this.fromPosition),this.input.getFNC1Character())?e.getBytes(235,this.input.charAt(this.fromPosition)-127):this.characterLength===2?e.getBytes(this.input.charAt(this.fromPosition)*10+this.input.charAt(this.fromPosition+1)+130):this.input.isFNC1(this.fromPosition)?e.getBytes(232):e.getBytes(this.input.charAt(this.fromPosition)+1);case Z.B256:return e.getBytes(this.input.charAt(this.fromPosition));case Z.C40:return this.getC40Words(!0,this.input.getFNC1Character());case Z.TEXT:return this.getC40Words(!1,this.input.getFNC1Character());case Z.X12:return this.getX12Words();case Z.EDF:return this.getEDFBytes()}},e}(),Ya=function(e){Va(t,e);function t(t,n,r,i,a){var o=e.call(this,t,n,r)||this;return o.shape=i,o.macroId=a,o}return t.prototype.getMacroId=function(){return this.macroId},t.prototype.getShapeHint=function(){return this.shape},t}(za);(function(){function e(){}return e.prototype.encode=function(e,t,n,r,i){if(i===void 0&&(i=null),e.trim()===``)throw Error(`Found empty contents`);if(t!==N.DATA_MATRIX)throw Error(`Can only encode DATA_MATRIX, but got `+t);if(n<0||r<0)throw Error(`Requested dimensions can't be negative: `+n+`x`+r);var a=0,o=null,s=null;if(i!=null){var c=i.get(q.DATA_MATRIX_SHAPE);c!=null&&(a=c);var l=i.get(q.MIN_SIZE);l!=null&&(o=l);var u=i.get(q.MAX_SIZE);u!=null&&(s=u)}var d;if(i!=null&&i.has(q.DATA_MATRIX_COMPACT)&&i.get(q.DATA_MATRIX_COMPACT).toString()){var f=i.has(q.GS1_FORMAT)&&!!i.get(q.GS1_FORMAT).toString(),p=null;i.has(q.CHARACTER_SET)&&(p=ua.forName(i.get(q.CHARACTER_SET).toString())),d=Ka.encodeHighLevel(e,p,f?29:-1,a)}else{var m=i!=null&&i.has(q.FORCE_C40)&&!!i.get(q.FORCE_C40).toString();d=X.encodeHighLevel(e,a,o,s,m)}var h=Y.lookup(d.length,a,o,s,!0),g=new fa(xa.encodeECC200(d,h),h.getSymbolDataWidth(),h.getSymbolDataHeight());return g.place(),this.encodeLowLevel(g,h,n,r)},e.prototype.encodeLowLevel=function(e,t,n,r){for(var i=t.getSymbolDataWidth(),a=t.getSymbolDataHeight(),o=new $i(t.getSymbolWidth(),t.getSymbolHeight()),s=0,c=0;c<a;c++){var l=void 0;if(c%t.matrixHeight===0){l=0;for(var u=0;u<t.getSymbolWidth();u++)o.setBoolean(l,s,u%2==0),l++;s++}l=0;for(var u=0;u<i;u++)u%t.matrixWidth===0&&(o.setBoolean(l,s,!0),l++),o.setBoolean(l,s,e.getBit(u,c)),l++,u%t.matrixWidth===t.matrixWidth-1&&(o.setBoolean(l,s,c%2==0),l++);if(s++,c%t.matrixHeight===t.matrixHeight-1){l=0;for(var u=0;u<t.getSymbolWidth();u++)o.setBoolean(l,s,!0),l++;s++}}return this.convertByteMatrixToBitMatrix(o,n,r)},e.prototype.convertByteMatrixToBitMatrix=function(e,t,n){var r=e.getWidth(),i=e.getHeight(),a=Math.max(t,r),o=Math.max(n,i),s=Math.min(a/r,o/i),c=(a-r*s)/2,l=(o-i*s)/2,u;n<i||t<r?(c=0,l=0,u=new re(r,i)):u=new re(t,n),u.clear();for(var d=0,f=l;d<i;d++,f+=s)for(var p=0,m=c;p<r;p++,m+=s)e.get(p,d)===1&&u.setRegion(m,f,s,s);return u},e})();var Xa=function(){function e(){}return e.prototype.isCompact=function(){return this.compact},e.prototype.setCompact=function(e){this.compact=e},e.prototype.getSize=function(){return this.size},e.prototype.setSize=function(e){this.size=e},e.prototype.getLayers=function(){return this.layers},e.prototype.setLayers=function(e){this.layers=e},e.prototype.getCodeWords=function(){return this.codeWords},e.prototype.setCodeWords=function(e){this.codeWords=e},e.prototype.getMatrix=function(){return this.matrix},e.prototype.setMatrix=function(e){this.matrix=e},e}(),Za=function(){function e(){}return e.singletonList=function(e){return[e]},e.min=function(e,t){return e.sort(t)[0]},e}(),Qa=function(){function e(e){this.previous=e}return e.prototype.getPrevious=function(){return this.previous},e}(),$a=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),eo=function(e){$a(t,e);function t(t,n,r){var i=e.call(this,t)||this;return i.value=n,i.bitCount=r,i}return t.prototype.appendTo=function(e,t){e.appendBits(this.value,this.bitCount)},t.prototype.add=function(e,n){return new t(this,e,n)},t.prototype.addBinaryShift=function(e,n){return console.warn(`addBinaryShift on SimpleToken, this simply returns a copy of this token`),new t(this,e,n)},t.prototype.toString=function(){var e=this.value&(1<<this.bitCount)-1;return e|=1<<this.bitCount,`<`+x.toBinaryString(e|1<<this.bitCount).substring(1)+`>`},t}(Qa),to=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),no=function(e){to(t,e);function t(t,n,r){var i=e.call(this,t,0,0)||this;return i.binaryShiftStart=n,i.binaryShiftByteCount=r,i}return t.prototype.appendTo=function(e,t){for(var n=0;n<this.binaryShiftByteCount;n++)(n===0||n===31&&this.binaryShiftByteCount<=62)&&(e.appendBits(31,5),this.binaryShiftByteCount>62?e.appendBits(this.binaryShiftByteCount-31,16):n===0?e.appendBits(Math.min(this.binaryShiftByteCount,31),5):e.appendBits(this.binaryShiftByteCount-31,5)),e.appendBits(t[this.binaryShiftStart+n],8)},t.prototype.addBinaryShift=function(e,n){return new t(this,e,n)},t.prototype.toString=function(){return`<`+this.binaryShiftStart+`::`+(this.binaryShiftStart+this.binaryShiftByteCount-1)+`>`},t}(eo);function ro(e,t,n){return new no(e,t,n)}function io(e,t,n){return new eo(e,t,n)}var ao=[`UPPER`,`LOWER`,`DIGIT`,`MIXED`,`PUNCT`],oo=new eo(null,0,0),so=[Int32Array.from([0,327708,327710,327709,656318]),Int32Array.from([590318,0,327710,327709,656318]),Int32Array.from([262158,590300,0,590301,932798]),Int32Array.from([327709,327708,656318,0,327710]),Int32Array.from([327711,656380,656382,656381,0])],co=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};function lo(e){var t,n;try{for(var r=co(e),i=r.next();!i.done;i=r.next()){var a=i.value;b.fill(a,-1)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return e[0][4]=0,e[1][4]=0,e[1][0]=28,e[3][4]=0,e[2][4]=0,e[2][0]=15,e}var uo=lo(b.createInt32Array(6,6)),fo=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},po=function(){function e(e,t,n,r){this.token=e,this.mode=t,this.binaryShiftByteCount=n,this.bitCount=r}return e.prototype.getMode=function(){return this.mode},e.prototype.getToken=function(){return this.token},e.prototype.getBinaryShiftByteCount=function(){return this.binaryShiftByteCount},e.prototype.getBitCount=function(){return this.bitCount},e.prototype.latchAndAppend=function(t,n){var r=this.bitCount,i=this.token;if(t!==this.mode){var a=so[this.mode][t];i=io(i,a&65535,a>>16),r+=a>>16}var o=t===2?4:5;return i=io(i,n,o),new e(i,t,0,r+o)},e.prototype.shiftAndAppend=function(t,n){var r=this.token,i=this.mode===2?4:5;return r=io(r,uo[this.mode][t],i),r=io(r,n,5),new e(r,this.mode,0,this.bitCount+i+5)},e.prototype.addBinaryShiftChar=function(t){var n=this.token,r=this.mode,i=this.bitCount;if(this.mode===4||this.mode===2){var a=so[r][0];n=io(n,a&65535,a>>16),i+=a>>16,r=0}var o=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,s=new e(n,r,this.binaryShiftByteCount+1,i+o);return s.binaryShiftByteCount===2078&&(s=s.endBinaryShift(t+1)),s},e.prototype.endBinaryShift=function(t){if(this.binaryShiftByteCount===0)return this;var n=this.token;return n=ro(n,t-this.binaryShiftByteCount,this.binaryShiftByteCount),new e(n,this.mode,0,this.bitCount)},e.prototype.isBetterThanOrEqualTo=function(t){var n=this.bitCount+(so[this.mode][t.mode]>>16);return this.binaryShiftByteCount<t.binaryShiftByteCount?n+=e.calculateBinaryShiftCost(t)-e.calculateBinaryShiftCost(this):this.binaryShiftByteCount>t.binaryShiftByteCount&&t.binaryShiftByteCount>0&&(n+=10),n<=t.bitCount},e.prototype.toBitArray=function(e){for(var t,n,r=[],i=this.endBinaryShift(e.length).token;i!==null;i=i.getPrevious())r.unshift(i);var a=new S;try{for(var o=fo(r),s=o.next();!s.done;s=o.next())s.value.appendTo(a,e)}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return a},e.prototype.toString=function(){return A.format(`%s bits=%d bytes=%d`,ao[this.mode],this.bitCount,this.binaryShiftByteCount)},e.calculateBinaryShiftCost=function(e){return e.binaryShiftByteCount>62?21:e.binaryShiftByteCount>31?20:e.binaryShiftByteCount>0?10:0},e.INITIAL_STATE=new e(oo,0,0,0),e}();function mo(e){var t=A.getCharCode(` `),n=A.getCharCode(`.`),r=A.getCharCode(`,`);e[0][t]=1;for(var i=A.getCharCode(`Z`),a=A.getCharCode(`A`),o=a;o<=i;o++)e[0][o]=o-a+2;e[1][t]=1;for(var s=A.getCharCode(`z`),c=A.getCharCode(`a`),o=c;o<=s;o++)e[1][o]=o-c+2;e[2][t]=1;for(var l=A.getCharCode(`9`),u=A.getCharCode(`0`),o=u;o<=l;o++)e[2][o]=o-u+2;e[2][r]=12,e[2][n]=13;for(var d=`\0 \x07\b
20
- \v\f\r\x1B@\\^_\`|~`.split(``),f=0;f<d.length;f++)e[3][A.getCharCode(d[f])]=f;for(var p=`\0\r\0\0\0\0!'#$%&'()*+,-./:;<=>?[]{}`.split(``),f=0;f<p.length;f++)A.getCharCode(p[f])>0&&(e[4][A.getCharCode(p[f])]=f);return e}var ho=mo(b.createInt32Array(5,256)),go=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},_o=function(){function e(e){this.text=e}return e.prototype.encode=function(){for(var t=A.getCharCode(` `),n=A.getCharCode(`
21
- `),r=Za.singletonList(po.INITIAL_STATE),i=0;i<this.text.length;i++){var a=void 0,o=i+1<this.text.length?this.text[i+1]:0;switch(this.text[i]){case A.getCharCode(`\r`):a=o===n?2:0;break;case A.getCharCode(`.`):a=o===t?3:0;break;case A.getCharCode(`,`):a=o===t?4:0;break;case A.getCharCode(`:`):a=o===t?5:0;break;default:a=0}a>0?(r=e.updateStateListForPair(r,i,a),i++):r=this.updateStateListForChar(r,i)}return Za.min(r,function(e,t){return e.getBitCount()-t.getBitCount()}).toBitArray(this.text)},e.prototype.updateStateListForChar=function(t,n){var r,i,a=[];try{for(var o=go(t),s=o.next();!s.done;s=o.next()){var c=s.value;this.updateStateForChar(c,n,a)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return e.simplifyStates(a)},e.prototype.updateStateForChar=function(e,t,n){for(var r=this.text[t]&255,i=ho[e.getMode()][r]>0,a=null,o=0;o<=4;o++){var s=ho[o][r];if(s>0){if(a??=e.endBinaryShift(t),!i||o===e.getMode()||o===2){var c=a.latchAndAppend(o,s);n.push(c)}if(!i&&uo[e.getMode()][o]>=0){var l=a.shiftAndAppend(o,s);n.push(l)}}}if(e.getBinaryShiftByteCount()>0||ho[e.getMode()][r]===0){var u=e.addBinaryShiftChar(t);n.push(u)}},e.updateStateListForPair=function(e,t,n){var r,i,a=[];try{for(var o=go(e),s=o.next();!s.done;s=o.next()){var c=s.value;this.updateStateForPair(c,t,n,a)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return this.simplifyStates(a)},e.updateStateForPair=function(e,t,n,r){var i=e.endBinaryShift(t);if(r.push(i.latchAndAppend(4,n)),e.getMode()!==4&&r.push(i.shiftAndAppend(4,n)),n===3||n===4){var a=i.latchAndAppend(2,16-n).latchAndAppend(2,1);r.push(a)}if(e.getBinaryShiftByteCount()>0){var o=e.addBinaryShiftChar(t).addBinaryShiftChar(t+1);r.push(o)}},e.simplifyStates=function(e){var t,n,r,i,a=[];try{for(var o=go(e),s=o.next();!s.done;s=o.next()){var c=s.value,l=!0,u=function(e){if(e.isBetterThanOrEqualTo(c))return l=!1,`break`;c.isBetterThanOrEqualTo(e)&&(a=a.filter(function(t){return t!==e}))};try{for(var d=(r=void 0,go(a)),f=d.next();!f.done;f=d.next()){var p=f.value;if(u(p)===`break`)break}}catch(e){r={error:e}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}l&&a.push(c)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return a},e}(),vo=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},yo=function(){function e(){}return e.encodeBytes=function(t){return e.encode(t,e.DEFAULT_EC_PERCENT,e.DEFAULT_AZTEC_LAYERS)},e.encode=function(t,n,r){var i=new _o(t).encode(),a=x.truncDivision(i.getSize()*n,100)+11,o=i.getSize()+a,s,c,u,d,f;if(r!==e.DEFAULT_AZTEC_LAYERS){if(s=r<0,c=Math.abs(r),c>(s?e.MAX_NB_BITS_COMPACT:e.MAX_NB_BITS))throw new l(A.format(`Illegal value %s for layers`,r));u=e.totalBitsInLayer(c,s),d=e.WORD_SIZE[c];var p=u-u%d;if(f=e.stuffBits(i,d),f.getSize()+a>p||s&&f.getSize()>d*64)throw new l(`Data to large for user specified layer`)}else{d=0,f=null;for(var m=0;;m++){if(m>e.MAX_NB_BITS)throw new l(`Data too large for an Aztec code`);if(s=m<=3,c=s?m+1:m,u=e.totalBitsInLayer(c,s),!(o>u)){(f==null||d!==e.WORD_SIZE[c])&&(d=e.WORD_SIZE[c],f=e.stuffBits(i,d));var p=u-u%d;if(!(s&&f.getSize()>d*64)&&f.getSize()+a<=p)break}}}var h=e.generateCheckWords(f,u,d),g=f.getSize()/d,_=e.generateModeMessage(s,c,g),v=(s?11:14)+c*4,y=new Int32Array(v),b;if(s){b=v;for(var m=0;m<y.length;m++)y[m]=m}else{b=v+1+2*x.truncDivision(x.truncDivision(v,2)-1,15);for(var S=x.truncDivision(v,2),C=x.truncDivision(b,2),m=0;m<S;m++){var w=m+x.truncDivision(m,15);y[S-m-1]=C-w-1,y[S+m]=C+w+1}}for(var T=new re(b),m=0,E=0;m<c;m++){for(var ee=(c-m)*4+(s?9:12),D=0;D<ee;D++)for(var O=D*2,k=0;k<2;k++)h.get(E+O+k)&&T.set(y[m*2+k],y[m*2+D]),h.get(E+ee*2+O+k)&&T.set(y[m*2+D],y[v-1-m*2-k]),h.get(E+ee*4+O+k)&&T.set(y[v-1-m*2-k],y[v-1-m*2-D]),h.get(E+ee*6+O+k)&&T.set(y[v-1-m*2-D],y[m*2+k]);E+=ee*8}if(e.drawModeMessage(T,s,b,_),s)e.drawBullsEye(T,x.truncDivision(b,2),5);else{e.drawBullsEye(T,x.truncDivision(b,2),7);for(var m=0,D=0;m<x.truncDivision(v,2)-1;m+=15,D+=16)for(var k=x.truncDivision(b,2)&1;k<b;k+=2)T.set(x.truncDivision(b,2)-D,k),T.set(x.truncDivision(b,2)+D,k),T.set(k,x.truncDivision(b,2)-D),T.set(k,x.truncDivision(b,2)+D)}var te=new Xa;return te.setCompact(s),te.setSize(b),te.setLayers(c),te.setCodeWords(g),te.setMatrix(T),te},e.drawBullsEye=function(e,t,n){for(var r=0;r<n;r+=2)for(var i=t-r;i<=t+r;i++)e.set(i,t-r),e.set(i,t+r),e.set(t-r,i),e.set(t+r,i);e.set(t-n,t-n),e.set(t-n+1,t-n),e.set(t-n,t-n+1),e.set(t+n,t-n),e.set(t+n,t-n+1),e.set(t+n,t+n-1)},e.generateModeMessage=function(t,n,r){var i=new S;return t?(i.appendBits(n-1,2),i.appendBits(r-1,6),i=e.generateCheckWords(i,28,4)):(i.appendBits(n-1,5),i.appendBits(r-1,11),i=e.generateCheckWords(i,40,4)),i},e.drawModeMessage=function(e,t,n,r){var i=x.truncDivision(n,2);if(t)for(var a=0;a<7;a++){var o=i-3+a;r.get(a)&&e.set(o,i-5),r.get(a+7)&&e.set(i+5,o),r.get(20-a)&&e.set(o,i+5),r.get(27-a)&&e.set(i-5,o)}else for(var a=0;a<10;a++){var o=i-5+a+x.truncDivision(a,5);r.get(a)&&e.set(o,i-7),r.get(a+10)&&e.set(i+7,o),r.get(29-a)&&e.set(o,i+7),r.get(39-a)&&e.set(i-7,o)}},e.generateCheckWords=function(t,n,r){var i,a,o=t.getSize()/r,s=new Xi(e.getGF(r)),c=x.truncDivision(n,r),l=e.bitsToWords(t,r,c);s.encode(l,c-o);var u=n%r,d=new S;d.appendBits(0,u);try{for(var f=vo(Array.from(l)),p=f.next();!p.done;p=f.next()){var m=p.value;d.appendBits(m,r)}}catch(e){i={error:e}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}return d},e.bitsToWords=function(e,t,n){for(var r=new Int32Array(n),i=0,a=e.getSize()/t;i<a;i++){for(var o=0,s=0;s<t;s++)o|=e.get(i*t+s)?1<<t-s-1:0;r[i]=o}return r},e.getGF=function(e){switch(e){case 4:return Oe.AZTEC_PARAM;case 6:return Oe.AZTEC_DATA_6;case 8:return Oe.AZTEC_DATA_8;case 10:return Oe.AZTEC_DATA_10;case 12:return Oe.AZTEC_DATA_12;default:throw new l(`Unsupported word size `+e)}},e.stuffBits=function(e,t){for(var n=new S,r=e.getSize(),i=(1<<t)-2,a=0;a<r;a+=t){for(var o=0,s=0;s<t;s++)(a+s>=r||e.get(a+s))&&(o|=1<<t-1-s);(o&i)===i?(n.appendBits(o&i,t),a--):(o&i)===0?(n.appendBits(o|1,t),a--):n.appendBits(o,t)}return n},e.totalBitsInLayer=function(e,t){return((t?88:112)+16*e)*e},e.DEFAULT_EC_PERCENT=33,e.DEFAULT_AZTEC_LAYERS=0,e.MAX_NB_BITS=32,e.MAX_NB_BITS_COMPACT=4,e.WORD_SIZE=Int32Array.from([4,6,6,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12]),e}();(function(){function e(){}return e.prototype.encode=function(e,t,n,r){return this.encodeWithHints(e,t,n,r,null)},e.prototype.encodeWithHints=function(t,n,r,i,a){var o=da.ISO_8859_1,s=yo.DEFAULT_EC_PERCENT,c=yo.DEFAULT_AZTEC_LAYERS;return a!=null&&(a.has(q.CHARACTER_SET)&&(o=ua.forName(a.get(q.CHARACTER_SET).toString())),a.has(q.ERROR_CORRECTION)&&(s=x.parseInt(a.get(q.ERROR_CORRECTION).toString())),a.has(q.AZTEC_LAYERS)&&(c=x.parseInt(a.get(q.AZTEC_LAYERS).toString()))),e.encodeLayers(t,n,r,i,o,s,c)},e.encodeLayers=function(t,n,r,i,a,o,s){if(n!==N.AZTEC)throw new l(`Can only encode AZTEC, but got `+n);var c=yo.encode(A.getBytes(t,a),o,s);return e.renderResult(c,r,i)},e.renderResult=function(e,t,n){var r=e.getMatrix();if(r==null)throw new Me;for(var i=r.getWidth(),a=r.getHeight(),o=Math.max(t,i),s=Math.max(n,a),c=Math.min(o/i,s/a),l=(o-i*c)/2,u=(s-a*c)/2,d=new re(o,s),f=0,p=u;f<a;f++,p+=c)for(var m=0,h=l;m<i;m++,h+=c)r.get(m,f)&&d.setRegion(h,p,c,c);return d},e})();var bo=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),xo=function(e){bo(t,e);function t(n){var r=e.call(this,n.width,n.height)||this;return r.canvas=n,r.buffer=t.makeBufferFromCanvasImageData(n),r}return t.makeBufferFromCanvasImageData=function(e){var n;try{n=e.getContext(`2d`,{willReadFrequently:!0})}catch{n=e.getContext(`2d`)}if(!n)throw Error(`Couldn't get canvas context.`);var r=n.getImageData(0,0,e.width,e.height);return t.toGrayscaleBuffer(r.data,e.width,e.height)},t.toGrayscaleBuffer=function(e,t,n){for(var r=new Uint8ClampedArray(t*n),i=0,a=0,o=e.length;i<o;i+=4,a++){var s=void 0;if(e[i+3]===0)s=255;else{var c=e[i],l=e[i+1],u=e[i+2];s=306*c+601*l+117*u+512>>10}r[a]=s}return r},t.prototype.getRow=function(e,t){if(e<0||e>=this.getHeight())throw new l(`Requested row is outside the image: `+e);var n=this.getWidth(),r=e*n;return t===null?t=this.buffer.slice(r,r+n):(t.length<n&&(t=new Uint8ClampedArray(n)),t.set(this.buffer.slice(r,r+n))),t},t.prototype.getMatrix=function(){return this.buffer},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(t,n,r,i){return e.prototype.crop.call(this,t,n,r,i),this},t.prototype.isRotateSupported=function(){return!0},t.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},t.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},t.prototype.invert=function(){return new de(this)},t.prototype.getTempCanvasElement=function(){if(this.tempCanvasElement===null){var e=this.canvas.ownerDocument.createElement(`canvas`);e.width=this.canvas.width,e.height=this.canvas.height,this.tempCanvasElement=e}return this.tempCanvasElement},t.prototype.rotate=function(e){var n=this.getTempCanvasElement();if(!n)throw Error(`Could not create a Canvas element.`);var r=e*t.DEGREE_TO_RADIANS,i=this.canvas.width,a=this.canvas.height,o=Math.ceil(Math.abs(Math.cos(r))*i+Math.abs(Math.sin(r))*a),s=Math.ceil(Math.abs(Math.sin(r))*i+Math.abs(Math.cos(r))*a);n.width=o,n.height=s;var c=n.getContext(`2d`);if(!c)throw Error(`Could not create a Canvas Context element.`);return c.translate(o/2,s/2),c.rotate(r),c.drawImage(this.canvas,i/-2,a/-2),this.buffer=t.makeBufferFromCanvasImageData(n),this},t.DEGREE_TO_RADIANS=Math.PI/180,t}(le);function So(){return typeof navigator<`u`}function Co(){return So()&&!!navigator.mediaDevices}function wo(){return!!(Co()&&navigator.mediaDevices.enumerateDevices)}var To=function(){return To=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},To.apply(this,arguments)},Q=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},$=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}},Eo=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Do={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},Oo=function(){function e(e,t,n){t===void 0&&(t=new Map),n===void 0&&(n={}),this.reader=e,this.hints=t,this.options=To(To({},Do),n)}return Object.defineProperty(e.prototype,"possibleFormats",{set:function(e){this.hints.set(w.POSSIBLE_FORMATS,e)},enumerable:!1,configurable:!0}),e.addVideoSource=function(e,t){try{e.srcObject=t}catch{console.error(`got interrupted by new loading request`)}},e.mediaStreamSetTorch=function(e,t){return Q(this,void 0,void 0,function(){return $(this,function(n){switch(n.label){case 0:return[4,e.applyConstraints({advanced:[{fillLightMode:t?`flash`:`off`,torch:t}]})];case 1:return n.sent(),[2]}})})},e.mediaStreamIsTorchCompatible=function(t){var n,r,i=t.getVideoTracks();try{for(var a=Eo(i),o=a.next();!o.done;o=a.next()){var s=o.value;if(e.mediaStreamIsTorchCompatibleTrack(s))return!0}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return!1},e.mediaStreamIsTorchCompatibleTrack=function(e){try{return`torch`in e.getCapabilities()}catch(e){return console.error(e),console.warn(`Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available.`),!1}},e.isVideoPlaying=function(e){return e.currentTime>0&&!e.paused&&e.readyState>2},e.getMediaElement=function(e,t){var n=document.getElementById(e);if(!n)throw new s(`element with id '${e}' not found`);if(n.nodeName.toLowerCase()!==t.toLowerCase())throw new s(`element with id '${e}' must be an ${t} element`);return n},e.createVideoElement=function(t){if(t instanceof HTMLVideoElement)return t;if(typeof t==`string`)return e.getMediaElement(t,`video`);if(!t&&typeof document<`u`){var n=document.createElement(`video`);return n.width=200,n.height=200,n}throw Error(`Couldn't get videoElement from videoSource!`)},e.prepareImageElement=function(t){if(t instanceof HTMLImageElement)return t;if(typeof t==`string`)return e.getMediaElement(t,`img`);if(t===void 0){var n=document.createElement(`img`);return n.width=200,n.height=200,n}throw Error(`Couldn't get imageElement from imageSource!`)},e.prepareVideoElement=function(t){var n=e.createVideoElement(t);return n.setAttribute(`autoplay`,`true`),n.setAttribute(`muted`,`true`),n.setAttribute(`playsinline`,`true`),n},e.isImageLoaded=function(e){return!(!e.complete||e.naturalWidth===0)},e.createBinaryBitmapFromCanvas=function(e){return new u(new ce(new xo(e)))},e.drawImageOnCanvas=function(e,t){e.drawImage(t,0,0)},e.getMediaElementDimensions=function(e){if(e instanceof HTMLVideoElement)return{height:e.videoHeight,width:e.videoWidth};if(e instanceof HTMLImageElement)return{height:e.naturalHeight||e.height,width:e.naturalWidth||e.width};throw Error(`Couldn't find the Source's dimensions!`)},e.createCaptureCanvas=function(t){if(!t)throw new s(`Cannot create a capture canvas without a media element.`);if(typeof document>`u`)throw Error(`The page "Document" is undefined, make sure you're running in a browser.`);var n=document.createElement(`canvas`),r=e.getMediaElementDimensions(t),i=r.width,a=r.height;return n.style.width=i+`px`,n.style.height=a+`px`,n.width=i,n.height=a,n},e.tryPlayVideo=function(t){return Q(this,void 0,void 0,function(){var n;return $(this,function(r){switch(r.label){case 0:if(t?.ended)return console.error(`Trying to play video that has ended.`),[2,!1];if(e.isVideoPlaying(t))return console.warn(`Trying to play video that is already playing.`),[2,!0];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,t.play()];case 2:return r.sent(),[2,!0];case 3:return n=r.sent(),console.warn(`It was not possible to play the video.`,n),[2,!1];case 4:return[2]}})})},e.createCanvasFromMediaElement=function(t){var n=e.createCaptureCanvas(t),r=n.getContext(`2d`);if(!r)throw Error(`Couldn't find Canvas 2D Context.`);return e.drawImageOnCanvas(r,t),n},e.createBinaryBitmapFromMediaElem=function(t){var n=e.createCanvasFromMediaElement(t);return e.createBinaryBitmapFromCanvas(n)},e.destroyImageElement=function(e){e.src=``,e.removeAttribute(`src`)},e.listVideoInputDevices=function(){return Q(this,void 0,void 0,function(){var e,t,n,r,i,a,o,s,c,l,u,d;return $(this,function(f){switch(f.label){case 0:if(!So())throw Error(`Can't enumerate devices, navigator is not present.`);if(!wo())throw Error(`Can't enumerate devices, method not supported.`);return[4,navigator.mediaDevices.enumerateDevices()];case 1:e=f.sent(),t=[];try{for(n=Eo(e),r=n.next();!r.done;r=n.next())i=r.value,a=i.kind===`video`?`videoinput`:i.kind,a===`videoinput`&&(o=i.deviceId||i.id,s=i.label||`Video device ${t.length+1}`,c=i.groupId,l={deviceId:o,label:s,kind:a,groupId:c},t.push(l))}catch(e){u={error:e}}finally{try{r&&!r.done&&(d=n.return)&&d.call(n)}finally{if(u)throw u.error}}return[2,t]}})})},e.findDeviceById=function(t){return Q(this,void 0,void 0,function(){var n;return $(this,function(r){switch(r.label){case 0:return[4,e.listVideoInputDevices()];case 1:return n=r.sent(),n?[2,n.find(function(e){return e.deviceId===t})]:[2]}})})},e.cleanVideoSource=function(e){if(e){try{e.srcObject=null}catch{e.src=``}e&&e.removeAttribute(`src`)}},e.releaseAllStreams=function(){e.streamTracker.length!==0&&e.streamTracker.forEach(function(e){e.getTracks().forEach(function(e){return e.stop()})}),e.streamTracker=[]},e.playVideoOnLoadAsync=function(t,n){return Q(this,void 0,void 0,function(){var r;return $(this,function(i){switch(i.label){case 0:return[4,e.tryPlayVideo(t)];case 1:return r=i.sent(),r?[2,!0]:[2,new Promise(function(r,i){var a=setTimeout(function(){e.isVideoPlaying(t)||(i(!1),t.removeEventListener(`canplay`,o))},n),o=function(){e.tryPlayVideo(t).then(function(e){clearTimeout(a),t.removeEventListener(`canplay`,o),r(e)})};t.addEventListener(`canplay`,o)})]}})})},e.attachStreamToVideo=function(t,n){return Q(this,arguments,void 0,function(t,n,r){var i;return r===void 0&&(r=5e3),$(this,function(a){switch(a.label){case 0:return i=e.prepareVideoElement(n),e.addVideoSource(i,t),[4,e.playVideoOnLoadAsync(i,r)];case 1:return a.sent(),[2,i]}})})},e._waitImageLoad=function(t){return new Promise(function(n,r){var i=setTimeout(function(){e.isImageLoaded(t)||(t.removeEventListener(`load`,a),r())},1e4),a=function(){clearTimeout(i),t.removeEventListener(`load`,a),n()};t.addEventListener(`load`,a)})},e.checkCallbackFnOrThrow=function(e){if(!e)throw new s("`callbackFn` is a required parameter, you cannot capture results without it.")},e.disposeMediaStream=function(e){e.getVideoTracks().forEach(function(e){return e.stop()})},e.prototype.decode=function(t){var n=e.createCanvasFromMediaElement(t);return this.decodeFromCanvas(n)},e.prototype.decodeBitmap=function(e){return this.reader.decode(e,this.hints)},e.prototype.decodeFromCanvas=function(t){var n=e.createBinaryBitmapFromCanvas(t);return this.decodeBitmap(n)},e.prototype.decodeFromImageElement=function(t){return Q(this,void 0,void 0,function(){var n;return $(this,function(r){switch(r.label){case 0:if(!t)throw new s(`An image element must be provided.`);return n=e.prepareImageElement(t),[4,this._decodeOnLoadImage(n)];case 1:return[2,r.sent()]}})})},e.prototype.decodeFromImageUrl=function(t){return Q(this,void 0,void 0,function(){var n;return $(this,function(r){switch(r.label){case 0:if(!t)throw new s(`An URL must be provided.`);n=e.prepareImageElement(),n.src=t,r.label=1;case 1:return r.trys.push([1,,3,4]),[4,this.decodeFromImageElement(n)];case 2:return[2,r.sent()];case 3:return e.destroyImageElement(n),[7];case 4:return[2]}})})},e.prototype.decodeFromConstraints=function(t,n,r){return Q(this,void 0,void 0,function(){var i,a;return $(this,function(o){switch(o.label){case 0:return e.checkCallbackFnOrThrow(r),[4,this.getUserMedia(t)];case 1:i=o.sent(),o.label=2;case 2:return o.trys.push([2,4,,5]),[4,this.decodeFromStream(i,n,r)];case 3:return[2,o.sent()];case 4:throw a=o.sent(),e.disposeMediaStream(i),a;case 5:return[2]}})})},e.prototype.decodeFromStream=function(t,n,r){return Q(this,void 0,void 0,function(){var i,a,o,s,c,l,u,d,f,p=this;return $(this,function(m){switch(m.label){case 0:return e.checkCallbackFnOrThrow(r),i=this.options.tryPlayVideoTimeout,[4,e.attachStreamToVideo(t,n,i)];case 1:return a=m.sent(),o=function(){e.disposeMediaStream(t),e.cleanVideoSource(a)},s=this.scan(a,r,o),c=t.getVideoTracks(),l=To(To({},s),{stop:function(){s.stop()},streamVideoConstraintsApply:function(e,t){return Q(this,void 0,void 0,function(){var n,r,i,a,o,s,l;return $(this,function(u){switch(u.label){case 0:n=t?c.filter(t):c,u.label=1;case 1:u.trys.push([1,6,7,8]),r=Eo(n),i=r.next(),u.label=2;case 2:return i.done?[3,5]:(a=i.value,[4,a.applyConstraints(e)]);case 3:u.sent(),u.label=4;case 4:return i=r.next(),[3,2];case 5:return[3,8];case 6:return o=u.sent(),s={error:o},[3,8];case 7:try{i&&!i.done&&(l=r.return)&&l.call(r)}finally{if(s)throw s.error}return[7];case 8:return[2]}})})},streamVideoConstraintsGet:function(e){return c.find(e).getConstraints()},streamVideoSettingsGet:function(e){return c.find(e).getSettings()},streamVideoCapabilitiesGet:function(e){return c.find(e).getCapabilities()}}),u=e.mediaStreamIsTorchCompatible(t),u&&(d=c?.find(function(t){return e.mediaStreamIsTorchCompatibleTrack(t)}),f=function(t){return Q(p,void 0,void 0,function(){return $(this,function(n){switch(n.label){case 0:return[4,e.mediaStreamSetTorch(d,t)];case 1:return n.sent(),[2]}})})},l.switchTorch=f,l.stop=function(){return Q(p,void 0,void 0,function(){return $(this,function(e){switch(e.label){case 0:return s.stop(),[4,f(!1)];case 1:return e.sent(),[2]}})})}),[2,l]}})})},e.prototype.decodeFromVideoDevice=function(t,n,r){return Q(this,void 0,void 0,function(){var i,a;return $(this,function(o){switch(o.label){case 0:return e.checkCallbackFnOrThrow(r),i=t?{deviceId:{exact:t}}:{facingMode:`environment`},a={video:i},[4,this.decodeFromConstraints(a,n,r)];case 1:return[2,o.sent()]}})})},e.prototype.decodeFromVideoElement=function(t,n){return Q(this,void 0,void 0,function(){var r,i;return $(this,function(a){switch(a.label){case 0:if(e.checkCallbackFnOrThrow(n),!t)throw new s(`A video element must be provided.`);return r=e.prepareVideoElement(t),i=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(r,i)];case 1:return a.sent(),[2,this.scan(r,n)]}})})},e.prototype.decodeFromVideoUrl=function(t,n){return Q(this,void 0,void 0,function(){var r,i,a,o;return $(this,function(c){switch(c.label){case 0:if(e.checkCallbackFnOrThrow(n),!t)throw new s(`An URL must be provided.`);return r=e.prepareVideoElement(),r.src=t,i=function(){e.cleanVideoSource(r)},a=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(r,a)];case 1:return c.sent(),o=this.scan(r,n,i),[2,o]}})})},e.prototype.decodeOnceFromConstraints=function(e,t){return Q(this,void 0,void 0,function(){var n;return $(this,function(r){switch(r.label){case 0:return[4,this.getUserMedia(e)];case 1:return n=r.sent(),[4,this.decodeOnceFromStream(n,t)];case 2:return[2,r.sent()]}})})},e.prototype.decodeOnceFromStream=function(t,n){return Q(this,void 0,void 0,function(){var r,i,a;return $(this,function(o){switch(o.label){case 0:return r=!!n,[4,e.attachStreamToVideo(t,n)];case 1:i=o.sent(),o.label=2;case 2:return o.trys.push([2,,4,5]),[4,this.scanOneResult(i)];case 3:return a=o.sent(),[2,a];case 4:return r||e.cleanVideoSource(i),[7];case 5:return[2]}})})},e.prototype.decodeOnceFromVideoDevice=function(e,t){return Q(this,void 0,void 0,function(){var n,r;return $(this,function(i){switch(i.label){case 0:return n=e?{deviceId:{exact:e}}:{facingMode:`environment`},r={video:n},[4,this.decodeOnceFromConstraints(r,t)];case 1:return[2,i.sent()]}})})},e.prototype.decodeOnceFromVideoElement=function(t){return Q(this,void 0,void 0,function(){var n,r;return $(this,function(i){switch(i.label){case 0:if(!t)throw new s(`A video element must be provided.`);return n=e.prepareVideoElement(t),r=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(n,r)];case 1:return i.sent(),[4,this.scanOneResult(n)];case 2:return[2,i.sent()]}})})},e.prototype.decodeOnceFromVideoUrl=function(t){return Q(this,void 0,void 0,function(){var n,r;return $(this,function(i){switch(i.label){case 0:if(!t)throw new s(`An URL must be provided.`);n=e.prepareVideoElement(),n.src=t,r=this.decodeOnceFromVideoElement(n),i.label=1;case 1:return i.trys.push([1,,3,4]),[4,r];case 2:return[2,i.sent()];case 3:return e.cleanVideoSource(n),[7];case 4:return[2]}})})},e.prototype.scanOneResult=function(e,t,n,r){var i=this;return t===void 0&&(t=!0),n===void 0&&(n=!0),r===void 0&&(r=!0),new Promise(function(a,o){i.scan(e,function(e,i,s){if(e)a(e),s.stop();else if(i){if(i instanceof M&&t||i instanceof f&&n||i instanceof E&&r)return;s.stop(),o(i)}})})},e.prototype.scan=function(t,n,r){var i=this;e.checkCallbackFnOrThrow(n);var a=e.createCaptureCanvas(t),o;try{o=a.getContext(`2d`,{willReadFrequently:!0})}catch{o=a.getContext(`2d`)}if(!o)throw Error(`Couldn't create canvas for visual element scan.`);var s=function(){o=void 0,a=void 0},c=!1,l,u={stop:function(){c=!0,clearTimeout(l),s(),r&&r()}},d=function(){if(!c)try{e.drawImageOnCanvas(o,t),n(i.decodeFromCanvas(a),void 0,u),l=setTimeout(d,i.options.delayBetweenScanSuccess)}catch(e){n(void 0,e,u);var p=e instanceof f,m=e instanceof E,h=e instanceof M;if(p||m||h){l=setTimeout(d,i.options.delayBetweenScanAttempts);return}s(),r&&r(e)}};return d(),u},e.prototype._decodeOnLoadImage=function(t){return Q(this,void 0,void 0,function(){var n;return $(this,function(r){switch(r.label){case 0:return n=e.isImageLoaded(t),n?[3,2]:[4,e._waitImageLoad(t)];case 1:r.sent(),r.label=2;case 2:return[2,this.decode(t)]}})})},e.prototype.getUserMedia=function(t){return Q(this,void 0,void 0,function(){var n;return $(this,function(r){switch(r.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return n=r.sent(),e.streamTracker.push(n),[2,n]}})})},e.streamTracker=[],e}(),ko=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){ko(t,e);function t(t,n){return e.call(this,new Je,t,n)||this}return t})(Oo);var Ao=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){Ao(t,e);function t(t,n){return e.call(this,new Gn(t),t,n)||this}return t})(Oo);var jo=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){jo(t,e);function t(t,n){return e.call(this,new rr,t,n)||this}return t})(Oo);var Mo=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){Mo(t,e);function t(t,n){var r=this,i=new Gi;return i.setHints(t),r=e.call(this,i,t,n)||this,r.reader=i,r}return Object.defineProperty(t.prototype,"possibleFormats",{set:function(e){this.hints.set(w.POSSIBLE_FORMATS,e),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),t.prototype.decodeBitmap=function(e){return this.reader.decodeWithState(e)},t.prototype.setHints=function(e){this.hints=e,this.reader.setHints(this.hints)},t})(Oo);var No=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){No(t,e);function t(t,n){return e.call(this,new Vi,t,n)||this}return t})(Oo);var Po=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Fo=function(e){Po(t,e);function t(t,n){return e.call(this,new Mr,t,n)||this}return t}(Oo),Io=`http://www.w3.org/2000/svg`;(function(){function e(e){if(typeof e==`string`){var t=document.getElementById(e);if(!t)throw Error(`Could not find a Container element with '${e}'.`);this.containerElement=t}else this.containerElement=e}return e.prototype.write=function(t,n,r,i){if(t.length===0)throw new l(`Found empty contents`);if(n<0||r<0)throw new l(`Requested dimensions are too small: `+n+`x`+r);var a=i&&i.get(q.MARGIN)!==void 0?Number.parseInt(i.get(q.MARGIN).toString(),10):e.QUIET_ZONE_SIZE,o=this.encode(i,t);return this.renderResult(o,n,r,a)},e.prototype.createSVGElement=function(t,n){var r=document.createElementNS(e.SVG_NS,`svg`);return r.setAttributeNS(Io,`width`,n.toString()),r.setAttributeNS(Io,`height`,t.toString()),r},e.prototype.createSvgPathPlaceholderElement=function(t,n){var r=document.createElementNS(e.SVG_NS,`path`);return r.setAttributeNS(Io,`d`,`M0 0h${t}v${n}H0z`),r.setAttributeNS(Io,`fill`,`none`),r},e.prototype.createSvgRectElement=function(t,n,r,i){var a=document.createElementNS(e.SVG_NS,`rect`);return a.setAttributeNS(Io,`x`,t.toString()),a.setAttributeNS(Io,`y`,n.toString()),a.setAttributeNS(Io,`height`,r.toString()),a.setAttributeNS(Io,`width`,i.toString()),a.setAttributeNS(Io,`fill`,`#000000`),a},e.prototype.encode=function(e,t){var n=or.L;if(e&&e.get(q.ERROR_CORRECTION)!==void 0){var r=e.get(q.ERROR_CORRECTION).toString();n=or.fromString(r)}return aa.encode(t,n,e)},e.prototype.renderResult=function(e,t,n,r){var i=e.getMatrix();if(i===null)throw new Me;var a=i.getWidth(),o=i.getHeight(),s=a+r*2,c=o+r*2,l=Math.max(t,s),u=Math.max(n,c),d=Math.min(Math.floor(l/s),Math.floor(u/c)),f=Math.floor((l-a*d)/2),p=Math.floor((u-o*d)/2),m=this.createSVGElement(l,u),h=this.createSvgPathPlaceholderElement(t,n);m.appendChild(h),this.containerElement.appendChild(m);for(var g=0,_=p;g<o;g++,_+=d)for(var v=0,y=f;v<a;v++,y+=d)if(i.get(v,g)===1){var b=this.createSvgRectElement(y,_,d,d);m.appendChild(b)}return m},e.QUIET_ZONE_SIZE=4,e.SVG_NS=`http://www.w3.org/2000/svg`,e})();var Lo=`http://www.w3.org/2000/svg`;(function(){function e(){}return e.prototype.write=function(t,n,r,i){if(t.length===0)throw new l(`Found empty contents`);if(n<0||r<0)throw new l(`Requested dimensions are too small: `+n+`x`+r);var a=or.L,o=e.QUIET_ZONE_SIZE;if(i){if(i.get(q.ERROR_CORRECTION)!==void 0){var s=i.get(q.ERROR_CORRECTION).toString();a=or.fromString(s)}i.get(q.MARGIN)!==void 0&&(o=Number.parseInt(i.get(q.MARGIN).toString(),10))}var c=aa.encode(t,a,i);return this.renderResult(c,n,r,o)},e.prototype.writeToDom=function(e,t,n,r,i){if(typeof e==`string`){var a=document.querySelector(e);if(!a)throw Error(`Could no find the target HTML element.`);e=a}var o=this.write(t,n,r,i);e instanceof HTMLElement&&e.appendChild(o)},e.prototype.renderResult=function(e,t,n,r){var i=e.getMatrix();if(i===null)throw new Me;for(var a=i.getWidth(),o=i.getHeight(),s=a+r*2,c=o+r*2,l=Math.max(t,s),u=Math.max(n,c),d=Math.min(Math.floor(l/s),Math.floor(u/c)),f=Math.floor((l-a*d)/2),p=Math.floor((u-o*d)/2),m=this.createSVGElement(l,u),h=0,g=p;h<o;h++,g+=d)for(var _=0,v=f;_<a;_++,v+=d)if(i.get(_,h)===1){var y=this.createSvgRectElement(v,g,d,d);m.appendChild(y)}return m},e.prototype.createSVGElement=function(e,t){var n=document.createElementNS(Lo,`svg`),r=e.toString(),i=t.toString();return n.setAttribute(`height`,i),n.setAttribute(`width`,r),n.setAttribute(`viewBox`,`0 0 `+r+` `+i),n},e.prototype.createSvgRectElement=function(e,t,n,r){var i=document.createElementNS(Lo,`rect`);return i.setAttribute(`x`,e.toString()),i.setAttribute(`y`,t.toString()),i.setAttribute(`height`,n.toString()),i.setAttribute(`width`,r.toString()),i.setAttribute(`fill`,`#000000`),i},e.QUIET_ZONE_SIZE=4,e})();var Ro=new Set([`NotFoundException`,`ChecksumException`,`FormatException`]),zo={audio:!1,video:{facingMode:{ideal:`environment`},width:{ideal:1920},height:{ideal:1080}}};function Bo(e,t){t?.stop();let n=e.srcObject;if(n instanceof MediaStream)for(let e of n.getTracks())e.stop();e.srcObject=null}async function Vo(e,t,n){e.playsInline=!0,e.muted=!0;let r=new Fo,i,a=!1,o=()=>{a||(a=!0,Bo(e,i))};try{i=await r.decodeFromConstraints(zo,e,(e,r,s)=>{if(i??=s,!a){if(e!==void 0){let n=e.getText();o(),t(n)}else r!==void 0&&!Ro.has(r.getKind())&&(o(),n(r instanceof Error?r:Error(String(r))))}})}catch(e){throw o(),e instanceof Error?e:Error(String(e))}return{stop:o}}new TextEncoder,new TextDecoder;var Ho=new Map;function Uo(e){return{active:()=>Ho.get(e)?.active()??!1,async fetch(t,n){n?.signal?.throwIfAborted();let r=Ho.get(e);if(!r)throw Error(`The host transport is not connected.`);let i=Wo(t,e);return r.fetch(i.input,n)}}}function Wo(e,t){let n=t,r=e=>{let t=decodeURIComponent(e),r=t.indexOf(`/`);if(r<1)return e;let i=t.slice(0,r);if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu.test(i))return e;if(n!==void 0&&i!==n)throw Error(`The request spans different hosts.`);return n=i,encodeURIComponent(t.slice(r+1))},i=e.indexOf(`?`),a=(i===-1?e:e.slice(0,i)).replace(/(\/(?:workspaces|sessions)\/)([^/]+)/gu,(e,t,n)=>t+r(n)),o=i===-1?``:e.slice(i).replace(/([?&]session=)([^&]*)/gu,(e,t,n)=>t+r(n));return{hostId:n,input:a+o}}var Go={active:()=>Ho.get(``)?.active()??!1,async fetch(e,t){t?.signal?.throwIfAborted();let n=Wo(e);if(n.hostId!==void 0)return Uo(n.hostId).fetch(n.input,t);let r=Ho.get(``);return r?r.fetch(e,t):fetch(e,t)}},Ko=`po:plugin-fetch`,qo=`po:plugin-fetch-result`;function Jo(e){if(typeof e!=`object`||!e)return;let t=e;if(t.type===Ko&&Number.isSafeInteger(t.requestId)&&typeof t.path==`string`&&t.path.startsWith(`/api/web-plugins/`))return t}async function Yo(e,t){try{let n=await Go.fetch(t.path,{cache:`no-store`,credentials:`include`}),r=await n.arrayBuffer();e.postMessage({type:qo,requestId:t.requestId,ok:!0,status:n.status,headers:[...n.headers.entries()],body:r},[r])}catch(n){e.postMessage({type:qo,requestId:t.requestId,ok:!1,message:n instanceof Error?n.message:String(n)})}}function Xo(e){return typeof e!=`object`||!e||!(`ok`in e)||typeof e.ok!=`boolean`?!1:e.ok?!(`revision`in e)||typeof e.revision==`number`:`code`in e&&typeof e.code==`string`&&`message`in e&&typeof e.message==`string`}async function Zo(){if(!(`serviceWorker`in navigator))throw Error(`The trusted service worker is unavailable.`);let e,t=await Promise.race([navigator.serviceWorker.ready,new Promise((t,n)=>{e=setTimeout(()=>n(Error(`The trusted service worker is not ready.`)),1e4)})]).finally(()=>clearTimeout(e)),n=t.active??t.waiting??t.installing;if(n===null)throw Error(`The trusted service worker is unavailable.`);return n}async function Qo(e){let t=await Zo(),n=new MessageChannel;return await new Promise(r=>{let i=window.setTimeout(()=>{n.port1.close(),r({ok:!1,code:`worker-timeout`,message:`The trusted service worker did not answer.`})},12e4);n.port1.addEventListener(`message`,e=>{if(typeof e.data==`object`&&e.data!==null&&e.data.type===Ko){let t=Jo(e.data);if(t!==void 0)Yo(n.port1,t);else{let t=e.data.requestId;n.port1.postMessage({type:qo,requestId:Number.isSafeInteger(t)?t:-1,ok:!1,message:`The trusted service worker requested an invalid plugin path.`})}}else window.clearTimeout(i),n.port1.close(),r(Xo(e.data)?e.data:{ok:!1,code:`invalid-worker-response`,message:`The trusted service worker returned invalid data.`})}),n.port1.start(),t.postMessage(e,[n.port2])})}async function $o(e){return await Qo({type:`po:activate-bundle`,...e})}var es=`/pair`,ts=[`c`,`k`,`s`,`r`];function ns(e){let t=document.getElementById(e);if(!(t instanceof HTMLElement))throw Error(`The PWA shell is missing #${e}.`);return t}function rs(e){if(!/^[1-9][0-9]*$/u.test(e))return;let t=Number(e);return Number.isSafeInteger(t)?t:void 0}function is(e,t=window.location.origin){let n;try{n=new URL(e)}catch{return}if(n.origin!==t||n.pathname!==es||n.search!==``)return;let r=new URLSearchParams(n.hash.slice(1));if(ts.some(e=>r.get(e)===null))return;let i=r.get(`c`)??``,a=r.get(`k`)??``,o=r.get(`s`)??``,s=rs(r.get(`r`)??``);if(/^[A-Za-z0-9_-]{20,512}$/u.test(i)&&/^[A-Za-z0-9_-]{40,512}$/u.test(a)&&/^[A-Za-z0-9_-]{80,512}$/u.test(o)&&s!==void 0)return{code:i,channelPublicKey:a,signerPublicKey:o,minimumRevision:s,url:n}}function as(){if(!(`serviceWorker`in navigator))return`This browser does not support service workers.`;if(!(`crypto`in globalThis)||globalThis.crypto.subtle===void 0)return`This browser does not support WebCrypto.`;if(!(`indexedDB`in globalThis))return`This browser does not support durable PWA state.`;if(!(`caches`in globalThis))return`This browser does not support verified application caches.`;if(!navigator.mediaDevices?.getUserMedia)return`This browser does not support camera access.`}async function os(){let e=await navigator.serviceWorker.register(`/sw.js`,{scope:`/`});return await navigator.serviceWorker.ready,e}function ss(e,t=`normal`){let n=ns(`pwa-status`);n.textContent=e,n.dataset.tone=t}async function cs(){let e=ns(`scan`),t=ns(`cancel`),n=ns(`camera`),r=as();if(r!==void 0){e.disabled=!0,ss(r,`bad`);return}try{await os()}catch{e.disabled=!0,ss(`The trusted service worker could not be installed.`,`bad`);return}window.addEventListener(`po:activate-bundle`,e=>{if(!(e instanceof CustomEvent))return;let t=e.detail;typeof t==`object`&&t&&`publicKey`in t&&typeof t.publicKey==`string`&&`minimumRevision`in t&&typeof t.minimumRevision==`number`&&$o({publicKey:t.publicKey,minimumRevision:t.minimumRevision}).then(e=>{window.dispatchEvent(new CustomEvent(`po:bundle-activation-result`,{detail:e}))})});let i,a=()=>{i?.stop(),i=void 0,n.hidden=!0,t.hidden=!0,e.hidden=!1};e.addEventListener(`click`,async()=>{e.hidden=!0,t.hidden=!1,n.hidden=!1,ss(`Point the camera at the QR code shown by Po.`);try{i=await Vo(n,e=>{let t=is(e);a(),t===void 0?ss(`That QR code is not a pairing link for this Po origin.`,`bad`):(ss(`Pairing link accepted. Opening secure setup.`,`good`),window.location.assign(t.url.href))},()=>{a(),ss(`The QR code could not be read. Try again.`,`bad`)})}catch(e){a(),ss(e instanceof DOMException&&e.name===`NotAllowedError`?`Camera permission was not granted.`:`The camera could not be started.`,`bad`)}}),t.addEventListener(`click`,()=>{a(),ss(`Scanning cancelled.`)}),window.addEventListener(`pagehide`,a),document.addEventListener(`visibilitychange`,()=>{document.hidden&&a()}),ss(`Ready to scan the pairing QR code.`)}cs();
19
+ `),e.toString()},e.prototype.setMode=function(e){this.mode=e},e.prototype.setECLevel=function(e){this.ecLevel=e},e.prototype.setVersion=function(e){this.version=e},e.prototype.setMaskPattern=function(e){this.maskPattern=e},e.prototype.setMatrix=function(e){this.matrix=e},e.isValidMaskPattern=function(t){return t>=0&&t<e.NUM_MASK_PATTERNS},e.NUM_MASK_PATTERNS=8,e}(),Ia=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),J=function(e){Ia(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.kind=`WriterException`,t}(pe),La=function(){function e(){}return e.clearMatrix=function(e){e.clear(255)},e.buildMatrix=function(t,n,r,i,a){e.clearMatrix(a),e.embedBasicPatterns(r,a),e.embedTypeInfo(n,i,a),e.maybeEmbedVersionInfo(r,a),e.embedDataBits(t,i,a)},e.embedBasicPatterns=function(t,n){e.embedPositionDetectionPatternsAndSeparators(n),e.embedDarkDotAtLeftBottomCorner(n),e.maybeEmbedPositionAdjustmentPatterns(t,n),e.embedTimingPatterns(n)},e.embedTypeInfo=function(t,n,r){var i=new Ee;e.makeTypeInfoBits(t,n,i);for(var a=0,o=i.getSize();a<o;++a){var s=i.get(i.getSize()-1-a),c=e.TYPE_INFO_COORDINATES[a],l=c[0],u=c[1];if(r.setBoolean(l,u,s),a<8){var d=r.getWidth()-a-1,f=8;r.setBoolean(d,f,s)}else{var d=8,f=r.getHeight()-7+(a-8);r.setBoolean(d,f,s)}}},e.maybeEmbedVersionInfo=function(t,n){if(!(t.getVersionNumber()<7)){var r=new Ee;e.makeVersionInfoBits(t,r);for(var i=17,a=0;a<6;++a)for(var o=0;o<3;++o){var s=r.get(i);i--,n.setBoolean(a,n.getHeight()-11+o,s),n.setBoolean(n.getHeight()-11+o,a,s)}}},e.embedDataBits=function(t,n,r){for(var i=0,a=-1,o=r.getWidth()-1,s=r.getHeight()-1;o>0;){for(o===6&&--o;s>=0&&s<r.getHeight();){for(var c=0;c<2;++c){var l=o-c;if(e.isEmpty(r.get(l,s))){var u=void 0;i<t.getSize()?(u=t.get(i),++i):u=!1,n!==255&&Ma.getDataMaskBit(n,l,s)&&(u=!u),r.setBoolean(l,s,u)}}s+=a}a=-a,s+=a,o-=2}if(i!==t.getSize())throw new J(`Not all bits consumed: `+i+`/`+t.getSize())},e.findMSBSet=function(e){return 32-A.numberOfLeadingZeros(e)},e.calculateBCHCode=function(t,n){if(n===0)throw new D(`0 polynomial`);var r=e.findMSBSet(n);for(t<<=r-1;e.findMSBSet(t)>=r;)t^=n<<e.findMSBSet(t)-r;return t},e.makeTypeInfoBits=function(t,n,r){if(!Fa.isValidMaskPattern(n))throw new J(`Invalid mask pattern`);var i=t.getBits()<<3|n;r.appendBits(i,5);var a=e.calculateBCHCode(i,e.TYPE_INFO_POLY);r.appendBits(a,10);var o=new Ee;if(o.appendBits(e.TYPE_INFO_MASK_PATTERN,15),r.xor(o),r.getSize()!==15)throw new J(`should not happen but we got: `+r.getSize())},e.makeVersionInfoBits=function(t,n){n.appendBits(t.getVersionNumber(),6);var r=e.calculateBCHCode(t.getVersionNumber(),e.VERSION_INFO_POLY);if(n.appendBits(r,12),n.getSize()!==18)throw new J(`should not happen but we got: `+n.getSize())},e.isEmpty=function(e){return e===255},e.embedTimingPatterns=function(t){for(var n=8;n<t.getWidth()-8;++n){var r=(n+1)%2;e.isEmpty(t.get(n,6))&&t.setNumber(n,6,r),e.isEmpty(t.get(6,n))&&t.setNumber(6,n,r)}},e.embedDarkDotAtLeftBottomCorner=function(e){if(e.get(8,e.getHeight()-8)===0)throw new J;e.setNumber(8,e.getHeight()-8,1)},e.embedHorizontalSeparationPattern=function(t,n,r){for(var i=0;i<8;++i){if(!e.isEmpty(r.get(t+i,n)))throw new J;r.setNumber(t+i,n,0)}},e.embedVerticalSeparationPattern=function(t,n,r){for(var i=0;i<7;++i){if(!e.isEmpty(r.get(t,n+i)))throw new J;r.setNumber(t,n+i,0)}},e.embedPositionAdjustmentPattern=function(t,n,r){for(var i=0;i<5;++i)for(var a=e.POSITION_ADJUSTMENT_PATTERN[i],o=0;o<5;++o)r.setNumber(t+o,n+i,a[o])},e.embedPositionDetectionPattern=function(t,n,r){for(var i=0;i<7;++i)for(var a=e.POSITION_DETECTION_PATTERN[i],o=0;o<7;++o)r.setNumber(t+o,n+i,a[o])},e.embedPositionDetectionPatternsAndSeparators=function(t){var n=e.POSITION_DETECTION_PATTERN[0].length;e.embedPositionDetectionPattern(0,0,t),e.embedPositionDetectionPattern(t.getWidth()-n,0,t),e.embedPositionDetectionPattern(0,t.getWidth()-n,t);var r=8;e.embedHorizontalSeparationPattern(0,r-1,t),e.embedHorizontalSeparationPattern(t.getWidth()-r,r-1,t),e.embedHorizontalSeparationPattern(0,t.getWidth()-r,t);var i=7;e.embedVerticalSeparationPattern(i,0,t),e.embedVerticalSeparationPattern(t.getHeight()-i-1,0,t),e.embedVerticalSeparationPattern(i,t.getHeight()-i,t)},e.maybeEmbedPositionAdjustmentPatterns=function(t,n){if(!(t.getVersionNumber()<2))for(var r=t.getVersionNumber()-1,i=e.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[r],a=0,o=i.length;a!==o;a++){var s=i[a];if(s>=0)for(var c=0;c!==o;c++){var l=i[c];l>=0&&e.isEmpty(n.get(l,s))&&e.embedPositionAdjustmentPattern(l-2,s-2,n)}}},e.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),e.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),e.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),e.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),e.VERSION_INFO_POLY=7973,e.TYPE_INFO_POLY=1335,e.TYPE_INFO_MASK_PATTERN=21522,e}(),Ra=function(){function e(e,t){this.dataBytes=e,this.errorCorrectionBytes=t}return e.prototype.getDataBytes=function(){return this.dataBytes},e.prototype.getErrorCorrectionBytes=function(){return this.errorCorrectionBytes},e}(),za=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Ba=function(){function e(){}return e.calculateMaskPenalty=function(e){return Ma.applyMaskPenaltyRule1(e)+Ma.applyMaskPenaltyRule2(e)+Ma.applyMaskPenaltyRule3(e)+Ma.applyMaskPenaltyRule4(e)},e.encode=function(t,n,r){r===void 0&&(r=null);var i=e.DEFAULT_BYTE_MODE_ENCODING,a=r!==null&&r.get(q.CHARACTER_SET)!==void 0;a&&(i=r.get(q.CHARACTER_SET).toString());var o=this.chooseMode(t,i),s=new Ee;if(o===W.BYTE&&(a||e.DEFAULT_BYTE_MODE_ENCODING!==i)){var c=Ae.getCharacterSetECIByName(i);c!==void 0&&this.appendECI(c,s)}this.appendModeInfo(o,s);var l=new Ee;this.appendBytes(t,o,l,i);var u;if(r!==null&&r.get(q.QR_VERSION)!==void 0){var d=Number.parseInt(r.get(q.QR_VERSION).toString(),10);u=Kr.getVersionForNumber(d);var f=this.calculateBitsNeeded(o,s,l,u);if(!this.willFit(f,u,n))throw new J(`Data too big for requested version`)}else u=this.recommendVersion(n,o,s,l);var p=new Ee;p.appendBitArray(s);var m=o===W.BYTE?l.getSizeInBytes():t.length;this.appendLengthInfo(m,u,o,p),p.appendBitArray(l);var h=u.getECBlocksForLevel(n),g=u.getTotalCodewords()-h.getTotalECCodewords();this.terminateBits(g,p);var _=this.interleaveWithECBytes(p,u.getTotalCodewords(),g,h.getNumBlocks()),v=new Fa;v.setECLevel(n),v.setMode(o),v.setVersion(u);var y=u.getDimensionForVersion(),b=new Pa(y,y),x=this.chooseMaskPattern(_,n,u,b);return v.setMaskPattern(x),La.buildMatrix(_,n,u,x,b),v.setMatrix(b),v},e.recommendVersion=function(e,t,n,r){var i=this.calculateBitsNeeded(t,n,r,Kr.getVersionForNumber(1)),a=this.chooseVersion(i,e),o=this.calculateBitsNeeded(t,n,r,a);return this.chooseVersion(o,e)},e.calculateBitsNeeded=function(e,t,n,r){return t.getSize()+e.getCharacterCountBits(r)+n.getSize()},e.getAlphanumericCode=function(t){return t<e.ALPHANUMERIC_TABLE.length?e.ALPHANUMERIC_TABLE[t]:-1},e.chooseMode=function(t,n){if(n===void 0&&(n=null),Ae.SJIS.getName()===n&&this.isOnlyDoubleByteKanji(t))return W.KANJI;for(var r=!1,i=!1,a=0,o=t.length;a<o;++a){var s=t.charAt(a);if(e.isDigit(s))r=!0;else if(this.getAlphanumericCode(s.charCodeAt(0))!==-1)i=!0;else return W.BYTE}return i?W.ALPHANUMERIC:r?W.NUMERIC:W.BYTE},e.isOnlyDoubleByteKanji=function(e){var t;try{t=Ne.encode(e,Ae.SJIS)}catch{return!1}var n=t.length;if(n%2!=0)return!1;for(var r=0;r<n;r+=2){var i=t[r]&255;if((i<129||i>159)&&(i<224||i>235))return!1}return!0},e.chooseMaskPattern=function(e,t,n,r){for(var i=2**53-1,a=-1,o=0;o<Fa.NUM_MASK_PATTERNS;o++){La.buildMatrix(e,t,n,o,r);var s=this.calculateMaskPenalty(r);s<i&&(i=s,a=o)}return a},e.chooseVersion=function(t,n){for(var r=1;r<=40;r++){var i=Kr.getVersionForNumber(r);if(e.willFit(t,i,n))return i}throw new J(`Data too big`)},e.willFit=function(e,t,n){return t.getTotalCodewords()-t.getECBlocksForLevel(n).getTotalECCodewords()>=(e+7)/8},e.terminateBits=function(e,t){var n=e*8;if(t.getSize()>n)throw new J(`data bits cannot fit in the QR Code`+t.getSize()+` > `+n);for(var r=0;r<4&&t.getSize()<n;++r)t.appendBit(!1);var i=t.getSize()&7;if(i>0)for(var r=i;r<8;r++)t.appendBit(!1);for(var a=e-t.getSizeInBytes(),r=0;r<a;++r)t.appendBits(r&1?17:236,8);if(t.getSize()!==n)throw new J(`Bits size does not equal capacity`)},e.getNumDataBytesAndNumECBytesForBlockID=function(e,t,n,r,i,a){if(r>=n)throw new J(`Block ID too large`);var o=e%n,s=n-o,c=Math.floor(e/n),l=c+1,u=Math.floor(t/n),d=u+1,f=c-u,p=l-d;if(f!==p)throw new J(`EC bytes mismatch`);if(n!==s+o)throw new J(`RS blocks mismatch`);if(e!==(u+f)*s+(d+p)*o)throw new J(`Total bytes mismatch`);r<s?(i[0]=u,a[0]=f):(i[0]=d,a[0]=p)},e.interleaveWithECBytes=function(t,n,r,i){var a,o,s,c;if(t.getSizeInBytes()!==r)throw new J(`Number of bits and data bytes does not match`);for(var l=0,u=0,d=0,f=[],p=0;p<i;++p){var m=new Int32Array(1),h=new Int32Array(1);e.getNumDataBytesAndNumECBytesForBlockID(n,r,i,p,m,h);var g=m[0],_=new Uint8Array(g);t.toBytes(8*l,_,0,g);var v=e.generateECBytes(_,h[0]);f.push(new Ra(_,v)),u=Math.max(u,g),d=Math.max(d,v.length),l+=m[0]}if(r!==l)throw new J(`Data bytes does not match offset`);for(var y=new Ee,p=0;p<u;++p)try{for(var b=(a=void 0,za(f)),x=b.next();!x.done;x=b.next()){var S=x.value,_=S.getDataBytes();p<_.length&&y.appendBits(_[p],8)}}catch(e){a={error:e}}finally{try{x&&!x.done&&(o=b.return)&&o.call(b)}finally{if(a)throw a.error}}for(var p=0;p<d;++p)try{for(var C=(s=void 0,za(f)),w=C.next();!w.done;w=C.next()){var S=w.value,v=S.getErrorCorrectionBytes();p<v.length&&y.appendBits(v[p],8)}}catch(e){s={error:e}}finally{try{w&&!w.done&&(c=C.return)&&c.call(C)}finally{if(s)throw s.error}}if(n!==y.getSizeInBytes())throw new J(`Interleaving error: `+n+` and `+y.getSizeInBytes()+` differ.`);return y},e.generateECBytes=function(e,t){for(var n=e.length,r=new Int32Array(n+t),i=0;i<n;i++)r[i]=e[i]&255;new ja(ot.QR_CODE_FIELD_256).encode(r,t);for(var a=new Uint8Array(t),i=0;i<t;i++)a[i]=r[n+i];return a},e.appendModeInfo=function(e,t){t.appendBits(e.getBits(),4)},e.appendLengthInfo=function(e,t,n,r){var i=n.getCharacterCountBits(t);if(e>=1<<i)throw new J(e+` is bigger than `+((1<<i)-1));r.appendBits(e,i)},e.appendBytes=function(t,n,r,i){switch(n){case W.NUMERIC:e.appendNumericBytes(t,r);break;case W.ALPHANUMERIC:e.appendAlphanumericBytes(t,r);break;case W.BYTE:e.append8BitBytes(t,r,i);break;case W.KANJI:e.appendKanjiBytes(t,r);break;default:throw new J(`Invalid mode: `+n)}},e.getDigit=function(e){return e.charCodeAt(0)-48},e.isDigit=function(t){var n=e.getDigit(t);return n>=0&&n<=9},e.appendNumericBytes=function(t,n){for(var r=t.length,i=0;i<r;){var a=e.getDigit(t.charAt(i));if(i+2<r){var o=e.getDigit(t.charAt(i+1)),s=e.getDigit(t.charAt(i+2));n.appendBits(a*100+o*10+s,10),i+=3}else if(i+1<r){var o=e.getDigit(t.charAt(i+1));n.appendBits(a*10+o,7),i+=2}else n.appendBits(a,4),i++}},e.appendAlphanumericBytes=function(t,n){for(var r=t.length,i=0;i<r;){var a=e.getAlphanumericCode(t.charCodeAt(i));if(a===-1)throw new J;if(i+1<r){var o=e.getAlphanumericCode(t.charCodeAt(i+1));if(o===-1)throw new J;n.appendBits(a*45+o,11),i+=2}else n.appendBits(a,6),i++}},e.append8BitBytes=function(e,t,n){var r;try{r=Ne.encode(e,n)}catch(e){throw new J(e)}for(var i=0,a=r.length;i!==a;i++){var o=r[i];t.appendBits(o,8)}},e.appendKanjiBytes=function(e,t){var n;try{n=Ne.encode(e,Ae.SJIS)}catch(e){throw new J(e)}for(var r=n.length,i=0;i<r;i+=2){var a=n[i]&255,o=n[i+1]&255,s=a<<8|o,c=-1;if(s>=33088&&s<=40956?c=s-33088:s>=57408&&s<=60351&&(c=s-49472),c===-1)throw new J(`Invalid byte sequence`);var l=(c>>8)*192+(c&255);t.appendBits(l,13)}},e.appendECI=function(e,t){t.appendBits(W.ECI.getBits(),4),t.appendBits(e.getValue(),8)},e.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),e.DEFAULT_BYTE_MODE_ENCODING=Ae.UTF8.getName(),e}();(function(){function e(){}return e.prototype.write=function(t,n,r,i){if(i===void 0&&(i=null),t.length===0)throw new D(`Found empty contents`);if(n<0||r<0)throw new D(`Requested dimensions are too small: `+n+`x`+r);var a=Vr.L,o=e.QUIET_ZONE_SIZE;i!==null&&(i.get(q.ERROR_CORRECTION)!==void 0&&(a=Vr.fromString(i.get(q.ERROR_CORRECTION).toString())),i.get(q.MARGIN)!==void 0&&(o=Number.parseInt(i.get(q.MARGIN).toString(),10)));var s=Ba.encode(t,a,i);return this.renderResult(s,n,r,o)},e.prototype.writeToDom=function(e,t,n,r,i){i===void 0&&(i=null),typeof e==`string`&&(e=document.querySelector(e));var a=this.write(t,n,r,i);e&&e.appendChild(a)},e.prototype.renderResult=function(e,t,n,r){var i=e.getMatrix();if(i===null)throw new ut;for(var a=i.getWidth(),o=i.getHeight(),s=a+r*2,c=o+r*2,l=Math.max(t,s),u=Math.max(n,c),d=Math.min(Math.floor(l/s),Math.floor(u/c)),f=Math.floor((l-a*d)/2),p=Math.floor((u-o*d)/2),m=this.createSVGElement(l,u),h=0,g=p;h<o;h++,g+=d)for(var _=0,v=f;_<a;_++,v+=d)if(i.get(_,h)===1){var y=this.createSvgRectElement(v,g,d,d);m.appendChild(y)}return m},e.prototype.createSVGElement=function(t,n){var r=document.createElementNS(e.SVG_NS,`svg`);return r.setAttributeNS(null,`height`,t.toString()),r.setAttributeNS(null,`width`,n.toString()),r},e.prototype.createSvgRectElement=function(t,n,r,i){var a=document.createElementNS(e.SVG_NS,`rect`);return a.setAttributeNS(null,`x`,t.toString()),a.setAttributeNS(null,`y`,n.toString()),a.setAttributeNS(null,`height`,r.toString()),a.setAttributeNS(null,`width`,i.toString()),a.setAttributeNS(null,`fill`,`#000000`),a},e.QUIET_ZONE_SIZE=4,e.SVG_NS=`http://www.w3.org/2000/svg`,e})();var Va=function(){function e(){}return e.prototype.encode=function(t,n,r,i,a){if(t.length===0)throw new D(`Found empty contents`);if(n!==L.QR_CODE)throw new D(`Can only encode QR_CODE, but got `+n);if(r<0||i<0)throw new D(`Requested dimensions are too small: ${r}x${i}`);var o=Vr.L,s=e.QUIET_ZONE_SIZE;a!==null&&(a.get(q.ERROR_CORRECTION)!==void 0&&(o=Vr.fromString(a.get(q.ERROR_CORRECTION).toString())),a.get(q.MARGIN)!==void 0&&(s=Number.parseInt(a.get(q.MARGIN).toString(),10)));var c=Ba.encode(t,o,a);return e.renderResult(c,r,i,s)},e.renderResult=function(e,t,n,r){var i=e.getMatrix();if(i===null)throw new ut;for(var a=i.getWidth(),o=i.getHeight(),s=a+r*2,c=o+r*2,l=Math.max(t,s),u=Math.max(n,c),d=Math.min(Math.floor(l/s),Math.floor(u/c)),f=Math.floor((l-a*d)/2),p=Math.floor((u-o*d)/2),m=new Pe(l,u),h=0,g=p;h<o;h++,g+=d)for(var _=0,v=f;_<a;_++,v+=d)i.get(_,h)===1&&m.setRegion(v,g,d,d);return m},e.QUIET_ZONE_SIZE=4,e}();(function(){function e(){}return e.prototype.encode=function(e,t,n,r,i){var a;switch(t){case L.QR_CODE:a=new Va;break;default:throw new D(`No encoder available for format `+t)}return a.encode(e,t,n,r,i)},e})();var Ha=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){Ha(t,e);function t(t,n,r,i,a,o,s,c){var l=e.call(this,o,s)||this;if(l.yuvData=t,l.dataWidth=n,l.dataHeight=r,l.left=i,l.top=a,i+o>n||a+s>r)throw new D(`Crop rectangle does not fit within image data.`);return c&&l.reverseHorizontal(o,s),l}return t.prototype.getRow=function(e,t){if(e<0||e>=this.getHeight())throw new D(`Requested row is outside the image: `+e);var n=this.getWidth();(t==null||t.length<n)&&(t=new Uint8ClampedArray(n));var r=(e+this.top)*this.dataWidth+this.left;return k.arraycopy(this.yuvData,r,t,0,n),t},t.prototype.getMatrix=function(){var e=this.getWidth(),t=this.getHeight();if(e===this.dataWidth&&t===this.dataHeight)return this.yuvData;var n=e*t,r=new Uint8ClampedArray(n),i=this.top*this.dataWidth+this.left;if(e===this.dataWidth)return k.arraycopy(this.yuvData,i,r,0,n),r;for(var a=0;a<t;a++){var o=a*e;k.arraycopy(this.yuvData,i,r,o,e),i+=this.dataWidth}return r},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,n,r,i){return new t(this.yuvData,this.dataWidth,this.dataHeight,this.left+e,this.top+n,r,i,!1)},t.prototype.renderThumbnail=function(){for(var e=this.getWidth()/t.THUMBNAIL_SCALE_FACTOR,n=this.getHeight()/t.THUMBNAIL_SCALE_FACTOR,r=new Int32Array(e*n),i=this.yuvData,a=this.top*this.dataWidth+this.left,o=0;o<n;o++){for(var s=o*e,c=0;c<e;c++){var l=i[a+c*t.THUMBNAIL_SCALE_FACTOR]&255;r[s+c]=4278190080|l*65793}a+=this.dataWidth*t.THUMBNAIL_SCALE_FACTOR}return r},t.prototype.getThumbnailWidth=function(){return this.getWidth()/t.THUMBNAIL_SCALE_FACTOR},t.prototype.getThumbnailHeight=function(){return this.getHeight()/t.THUMBNAIL_SCALE_FACTOR},t.prototype.reverseHorizontal=function(e,t){for(var n=this.yuvData,r=0,i=this.top*this.dataWidth+this.left;r<t;r++,i+=this.dataWidth)for(var a=i+e/2,o=i,s=i+e-1;o<a;o++,s--){var c=n[o];n[o]=n[s],n[s]=c}},t.prototype.invert=function(){return new He(this)},t.THUMBNAIL_SCALE_FACTOR=2,t})(Be);var Ua=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){Ua(t,e);function t(t,n,r,i,a,o,s){var c=e.call(this,n,r)||this;if(c.dataWidth=i,c.dataHeight=a,c.left=o,c.top=s,t.BYTES_PER_ELEMENT===4){for(var l=n*r,u=new Uint8ClampedArray(l),d=0;d<l;d++){var f=t[d],p=f>>16&255,m=f>>7&510,h=f&255;u[d]=(p+m+h)/4&255}c.luminances=u}else c.luminances=t;if(i===void 0&&(c.dataWidth=n),a===void 0&&(c.dataHeight=r),o===void 0&&(c.left=0),s===void 0&&(c.top=0),c.left+n>c.dataWidth||c.top+r>c.dataHeight)throw new D(`Crop rectangle does not fit within image data.`);return c}return t.prototype.getRow=function(e,t){if(e<0||e>=this.getHeight())throw new D(`Requested row is outside the image: `+e);var n=this.getWidth();(t==null||t.length<n)&&(t=new Uint8ClampedArray(n));var r=(e+this.top)*this.dataWidth+this.left;return k.arraycopy(this.luminances,r,t,0,n),t},t.prototype.getMatrix=function(){var e=this.getWidth(),t=this.getHeight();if(e===this.dataWidth&&t===this.dataHeight)return this.luminances;var n=e*t,r=new Uint8ClampedArray(n),i=this.top*this.dataWidth+this.left;if(e===this.dataWidth)return k.arraycopy(this.luminances,i,r,0,n),r;for(var a=0;a<t;a++){var o=a*e;k.arraycopy(this.luminances,i,r,o,e),i+=this.dataWidth}return r},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,n,r,i){return new t(this.luminances,r,i,this.dataWidth,this.dataHeight,this.left+e,this.top+n)},t.prototype.invert=function(){return new He(this)},t})(Be);var Wa=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ga=function(e){Wa(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.forName=function(e){return this.getCharacterSetECIByName(e)},t}(Ae),Ka=function(){function e(){}return e.ISO_8859_1=Ae.ISO8859_1,e}(),qa=function(){function e(e,t,n){this.codewords=e,this.numcols=t,this.numrows=n,this.bits=new Uint8Array(t*n),Te.fill(this.bits,2)}return e.prototype.getNumrows=function(){return this.numrows},e.prototype.getNumcols=function(){return this.numcols},e.prototype.getBits=function(){return this.bits},e.prototype.getBit=function(e,t){return this.bits[t*this.numcols+e]===1},e.prototype.setBit=function(e,t,n){this.bits[t*this.numcols+e]=+!!n},e.prototype.noBit=function(e,t){return this.bits[t*this.numcols+e]===2},e.prototype.place=function(){var e=0,t=4,n=0;do{t===this.numrows&&n===0&&this.corner1(e++),t===this.numrows-2&&n===0&&this.numcols%4!=0&&this.corner2(e++),t===this.numrows-2&&n===0&&this.numcols%8==4&&this.corner3(e++),t===this.numrows+4&&n===2&&this.numcols%8==0&&this.corner4(e++);do t<this.numrows&&n>=0&&this.noBit(n,t)&&this.utah(t,n,e++),t-=2,n+=2;while(t>=0&&n<this.numcols);t++,n+=3;do t>=0&&n<this.numcols&&this.noBit(n,t)&&this.utah(t,n,e++),t+=2,n-=2;while(t<this.numrows&&n>=0);t+=3,n++}while(t<this.numrows||n<this.numcols);this.noBit(this.numcols-1,this.numrows-1)&&(this.setBit(this.numcols-1,this.numrows-1,!0),this.setBit(this.numcols-2,this.numrows-2,!0))},e.prototype.module=function(e,t,n,r){e<0&&(e+=this.numrows,t+=4-(this.numrows+4)%8),t<0&&(t+=this.numcols,e+=4-(this.numcols+4)%8);var i=this.codewords.charCodeAt(n);i&=1<<8-r,this.setBit(t,e,i!==0)},e.prototype.utah=function(e,t,n){this.module(e-2,t-2,n,1),this.module(e-2,t-1,n,2),this.module(e-1,t-2,n,3),this.module(e-1,t-1,n,4),this.module(e-1,t,n,5),this.module(e,t-2,n,6),this.module(e,t-1,n,7),this.module(e,t,n,8)},e.prototype.corner1=function(e){this.module(this.numrows-1,0,e,1),this.module(this.numrows-1,1,e,2),this.module(this.numrows-1,2,e,3),this.module(0,this.numcols-2,e,4),this.module(0,this.numcols-1,e,5),this.module(1,this.numcols-1,e,6),this.module(2,this.numcols-1,e,7),this.module(3,this.numcols-1,e,8)},e.prototype.corner2=function(e){this.module(this.numrows-3,0,e,1),this.module(this.numrows-2,0,e,2),this.module(this.numrows-1,0,e,3),this.module(0,this.numcols-4,e,4),this.module(0,this.numcols-3,e,5),this.module(0,this.numcols-2,e,6),this.module(0,this.numcols-1,e,7),this.module(1,this.numcols-1,e,8)},e.prototype.corner3=function(e){this.module(this.numrows-3,0,e,1),this.module(this.numrows-2,0,e,2),this.module(this.numrows-1,0,e,3),this.module(0,this.numcols-2,e,4),this.module(0,this.numcols-1,e,5),this.module(1,this.numcols-1,e,6),this.module(2,this.numcols-1,e,7),this.module(3,this.numcols-1,e,8)},e.prototype.corner4=function(e){this.module(this.numrows-1,0,e,1),this.module(this.numrows-1,this.numcols-1,e,2),this.module(0,this.numcols-3,e,3),this.module(0,this.numcols-2,e,4),this.module(0,this.numcols-1,e,5),this.module(1,this.numcols-3,e,6),this.module(1,this.numcols-2,e,7),this.module(1,this.numcols-1,e,8)},e}(),Ja,Ya=[5,7,10,11,12,14,18,20,24,28,36,42,48,56,62,68],Xa=[[228,48,15,111,62],[23,68,144,134,240,92,254],[28,24,185,166,223,248,116,255,110,61],[175,138,205,12,194,168,39,245,60,97,120],[41,153,158,91,61,42,142,213,97,178,100,242],[156,97,192,252,95,9,157,119,138,45,18,186,83,185],[83,195,100,39,188,75,66,61,241,213,109,129,94,254,225,48,90,188],[15,195,244,9,233,71,168,2,188,160,153,145,253,79,108,82,27,174,186,172],[52,190,88,205,109,39,176,21,155,197,251,223,155,21,5,172,254,124,12,181,184,96,50,193],[211,231,43,97,71,96,103,174,37,151,170,53,75,34,249,121,17,138,110,213,141,136,120,151,233,168,93,255],[245,127,242,218,130,250,162,181,102,120,84,179,220,251,80,182,229,18,2,4,68,33,101,137,95,119,115,44,175,184,59,25,225,98,81,112],[77,193,137,31,19,38,22,153,247,105,122,2,245,133,242,8,175,95,100,9,167,105,214,111,57,121,21,1,253,57,54,101,248,202,69,50,150,177,226,5,9,5],[245,132,172,223,96,32,117,22,238,133,238,231,205,188,237,87,191,106,16,147,118,23,37,90,170,205,131,88,120,100,66,138,186,240,82,44,176,87,187,147,160,175,69,213,92,253,225,19],[175,9,223,238,12,17,220,208,100,29,175,170,230,192,215,235,150,159,36,223,38,200,132,54,228,146,218,234,117,203,29,232,144,238,22,150,201,117,62,207,164,13,137,245,127,67,247,28,155,43,203,107,233,53,143,46],[242,93,169,50,144,210,39,118,202,188,201,189,143,108,196,37,185,112,134,230,245,63,197,190,250,106,185,221,175,64,114,71,161,44,147,6,27,218,51,63,87,10,40,130,188,17,163,31,176,170,4,107,232,7,94,166,224,124,86,47,11,204],[220,228,173,89,251,149,159,56,89,33,147,244,154,36,73,127,213,136,248,180,234,197,158,177,68,122,93,213,15,160,227,236,66,139,153,185,202,167,179,25,220,232,96,210,231,136,223,239,181,241,59,52,172,25,49,232,211,189,64,54,108,153,132,63,96,103,82,186]],Za=(Ja=function(e,t){for(var n=1,r=0;r<255;r++)t[r]=n,e[n]=r,n*=2,n>=256&&(n^=301);return{LOG:e,ALOG:t}}([],[]),Ja.LOG),Qa=Ja.ALOG,$a;(function(e){e[e.FORCE_NONE=0]=`FORCE_NONE`,e[e.FORCE_SQUARE=1]=`FORCE_SQUARE`,e[e.FORCE_RECTANGLE=2]=`FORCE_RECTANGLE`})($a||={});var eo=`[)>05`,to=`[)>06`,no=function(){function e(){}return e.encodeECC200=function(e,t){if(e.length!==t.getDataCapacity())throw Error(`The number of codewords does not match the selected symbol`);var n=new F;n.append(e);var r=t.getInterleavedBlockCount();if(r===1){var i=this.createECCBlock(e,t.getErrorCodewords());n.append(i)}else{for(var a=[],o=[],s=0;s<r;s++)a[s]=t.getDataLengthForInterleavedBlock(s+1),o[s]=t.getErrorLengthForInterleavedBlock(s+1);for(var c=0;c<r;c++){for(var l=new F,u=c;u<t.getDataCapacity();u+=r)l.append(e.charAt(u));for(var i=this.createECCBlock(l.toString(),o[c]),d=0,f=c;f<o[c]*r;f+=r)n.setCharAt(t.getDataCapacity()+f,i.charAt(d++))}}return n.toString()},e.createECCBlock=function(e,t){for(var n=-1,r=0;r<Ya.length;r++)if(Ya[r]===t){n=r;break}if(n<0)throw Error(`Illegal number of error correction codewords specified: `+t);for(var i=Xa[n],a=[],r=0;r<t;r++)a[r]=0;for(var r=0;r<e.length;r++){for(var o=a[t-1]^e.charAt(r).charCodeAt(0),s=t-1;s>0;s--)o!==0&&i[s]!==0?a[s]=a[s-1]^Qa[(Za[o]+Za[i[s]])%255]:a[s]=a[s-1];a[0]=o!==0&&i[0]!==0?Qa[(Za[o]+Za[i[0]])%255]:0}for(var c=[],r=0;r<t;r++)c[r]=a[t-r-1];return c.map(function(e){return String.fromCharCode(e)}).join(``)},e}(),ro=function(){function e(){}return e.prototype.getEncodingMode=function(){return 0},e.prototype.encode=function(e){if(X.determineConsecutiveDigitCount(e.getMessage(),e.pos)>=2)e.writeCodeword(this.encodeASCIIDigits(e.getMessage().charCodeAt(e.pos),e.getMessage().charCodeAt(e.pos+1))),e.pos+=2;else{var t=e.getCurrentChar(),n=X.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode());if(n!==this.getEncodingMode())switch(n){case 5:e.writeCodeword(231),e.signalEncoderChange(5);return;case 1:e.writeCodeword(230),e.signalEncoderChange(1);return;case 3:e.writeCodeword(238),e.signalEncoderChange(3);break;case 2:e.writeCodeword(239),e.signalEncoderChange(2);break;case 4:e.writeCodeword(240),e.signalEncoderChange(4);break;default:throw Error(`Illegal mode: `+n)}else X.isExtendedASCII(t)?(e.writeCodeword(235),e.writeCodeword(t-128+1),e.pos++):(e.writeCodeword(t+1),e.pos++)}},e.prototype.encodeASCIIDigits=function(e,t){if(X.isDigit(e)&&X.isDigit(t))return(e-48)*10+(t-48)+130;throw Error(`not digits: `+e+t)},e}(),io=function(){function e(){}return e.prototype.getEncodingMode=function(){return 5},e.prototype.encode=function(e){var t=new F;for(t.append(0);e.hasMoreCharacters();){var n=e.getCurrentChar();if(t.append(n),e.pos++,X.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode())!==this.getEncodingMode()){e.signalEncoderChange(0);break}}var r=t.length()-1,i=e.getCodewordCount()+r+1;e.updateSymbolInfo(i);var a=e.getSymbolInfo().getDataCapacity()-i>0;if(e.hasMoreCharacters()||a){if(r<=249)t.setCharAt(0,P.getCharAt(r));else if(r<=1555)t.setCharAt(0,P.getCharAt(Math.floor(r/250)+249)),t.insert(1,P.getCharAt(r%250));else throw Error(`Message length not in valid ranges: `+r)}for(var o=0,n=t.length();o<n;o++)e.writeCodeword(this.randomize255State(t.charAt(o).charCodeAt(0),e.getCodewordCount()+1))},e.prototype.randomize255State=function(e,t){var n=e+(149*t%255+1);return n<=255?n:n-256},e}(),ao=function(){function e(){}return e.prototype.getEncodingMode=function(){return 1},e.prototype.encodeMaximal=function(e){for(var t=new F,n=0,r=e.pos,i=0;e.hasMoreCharacters();){var a=e.getCurrentChar();e.pos++,n=this.encodeChar(a,t),t.length()%3==0&&(r=e.pos,i=t.length())}if(i!==t.length()){var o=Math.floor(t.length()/3*2),s=Math.floor(e.getCodewordCount()+o+1);e.updateSymbolInfo(s);var c=e.getSymbolInfo().getDataCapacity()-s,l=Math.floor(t.length()%3);(l===2&&c!==2||l===1&&(n>3||c!==1))&&(e.pos=r)}t.length()>0&&e.writeCodeword(230),this.handleEOD(e,t)},e.prototype.encode=function(e){for(var t=new F;e.hasMoreCharacters();){var n=e.getCurrentChar();e.pos++;var r=this.encodeChar(n,t),i=Math.floor(t.length()/3)*2,a=e.getCodewordCount()+i;e.updateSymbolInfo(a);var o=e.getSymbolInfo().getDataCapacity()-a;if(!e.hasMoreCharacters()){var s=new F;for(t.length()%3==2&&o!==2&&(r=this.backtrackOneCharacter(e,t,s,r));t.length()%3==1&&(r>3||o!==1);)r=this.backtrackOneCharacter(e,t,s,r);break}if(t.length()%3==0&&X.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode())!==this.getEncodingMode()){e.signalEncoderChange(0);break}}this.handleEOD(e,t)},e.prototype.backtrackOneCharacter=function(e,t,n,r){var i=t.length(),a=t.toString().substring(0,i-r);t.setLengthToZero(),t.append(a),e.pos--;var o=e.getCurrentChar();return r=this.encodeChar(o,n),e.resetSymbolInfo(),r},e.prototype.writeNextTriplet=function(e,t){e.writeCodewords(this.encodeToCodewords(t.toString()));var n=t.toString().substring(3);t.setLengthToZero(),t.append(n)},e.prototype.handleEOD=function(e,t){var n=Math.floor(t.length()/3*2),r=t.length()%3,i=e.getCodewordCount()+n;e.updateSymbolInfo(i);var a=e.getSymbolInfo().getDataCapacity()-i;if(r===2){for(t.append(`\0`);t.length()>=3;)this.writeNextTriplet(e,t);e.hasMoreCharacters()&&e.writeCodeword(254)}else if(a===1&&r===1){for(;t.length()>=3;)this.writeNextTriplet(e,t);e.hasMoreCharacters()&&e.writeCodeword(254),e.pos--}else if(r===0){for(;t.length()>=3;)this.writeNextTriplet(e,t);(a>0||e.hasMoreCharacters())&&e.writeCodeword(254)}else throw Error(`Unexpected case. Please report!`);e.signalEncoderChange(0)},e.prototype.encodeChar=function(e,t){if(e===32)return t.append(3),1;if(e>=48&&e<=57)return t.append(e-48+4),1;if(e>=65&&e<=90)return t.append(e-65+14),1;if(e<32)return t.append(0),t.append(e),2;if(e<=47)return t.append(1),t.append(e-33),2;if(e<=64)return t.append(1),t.append(e-58+15),2;if(e<=95)return t.append(1),t.append(e-91+22),2;if(e<=127)return t.append(2),t.append(e-96),2;t.append(`1`);var n=2;return n+=this.encodeChar(e-128,t),n},e.prototype.encodeToCodewords=function(e){var t=1600*e.charCodeAt(0)+40*e.charCodeAt(1)+e.charCodeAt(2)+1,n=t/256,r=t%256,i=new F;return i.append(n),i.append(r),i.toString()},e}(),oo=function(){function e(){}return e.prototype.getEncodingMode=function(){return 4},e.prototype.encode=function(e){for(var t=new F;e.hasMoreCharacters();){var n=e.getCurrentChar();if(this.encodeChar(n,t),e.pos++,t.length()>=4){e.writeCodewords(this.encodeToCodewords(t.toString()));var r=t.toString().substring(4);if(t.setLengthToZero(),t.append(r),X.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode())!==this.getEncodingMode()){e.signalEncoderChange(0);break}}}t.append(P.getCharAt(31)),this.handleEOD(e,t)},e.prototype.handleEOD=function(e,t){try{var n=t.length();if(n===0)return;if(n===1){e.updateSymbolInfo();var r=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount(),i=e.getRemainingCharacters();if(i>r&&(e.updateSymbolInfo(e.getCodewordCount()+1),r=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount()),i<=r&&r<=2)return}if(n>4)throw Error(`Count must not exceed 4`);var a=n-1,o=this.encodeToCodewords(t.toString()),s=!e.hasMoreCharacters()&&a<=2;if(a<=2){e.updateSymbolInfo(e.getCodewordCount()+a);var r=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount();r>=3&&(s=!1,e.updateSymbolInfo(e.getCodewordCount()+o.length))}s?(e.resetSymbolInfo(),e.pos-=a):e.writeCodewords(o)}finally{e.signalEncoderChange(0)}},e.prototype.encodeChar=function(e,t){e>=32&&e<=63?t.append(e):e>=64&&e<=94?t.append(P.getCharAt(e-64)):X.illegalCharacter(P.getCharAt(e))},e.prototype.encodeToCodewords=function(e){var t=e.length;if(t===0)throw Error(`StringBuilder must not be empty`);var n=e.charAt(0).charCodeAt(0),r=t>=2?e.charAt(1).charCodeAt(0):0,i=t>=3?e.charAt(2).charCodeAt(0):0,a=t>=4?e.charAt(3).charCodeAt(0):0,o=(n<<18)+(r<<12)+(i<<6)+a,s=o>>16&255,c=o>>8&255,l=o&255,u=new F;return u.append(s),t>=2&&u.append(c),t>=3&&u.append(l),u.toString()},e}(),so=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),co=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Y=function(){function e(e,t,n,r,i,a,o,s){o===void 0&&(o=0),s===void 0&&(s=0),this.rectangular=e,this.dataCapacity=t,this.errorCodewords=n,this.matrixWidth=r,this.matrixHeight=i,this.dataRegions=a,this.rsBlockData=o,this.rsBlockError=s}return e.lookup=function(e,t,n,r,i){var a,o;t===void 0&&(t=0),n===void 0&&(n=null),r===void 0&&(r=null),i===void 0&&(i=!0);try{for(var s=co(uo),c=s.next();!c.done;c=s.next()){var l=c.value;if(!(t===1&&l.rectangular)&&(t!==2||l.rectangular)&&!(n!=null&&(l.getSymbolWidth()<n.getWidth()||l.getSymbolHeight()<n.getHeight()))&&!(r!=null&&(l.getSymbolWidth()>r.getWidth()||l.getSymbolHeight()>r.getHeight()))&&e<=l.dataCapacity)return l}}catch(e){a={error:e}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(a)throw a.error}}if(i)throw Error(`Can't find a symbol arrangement that matches the message. Data codewords: `+e);return null},e.prototype.getHorizontalDataRegions=function(){switch(this.dataRegions){case 1:return 1;case 2:case 4:return 2;case 16:return 4;case 36:return 6;default:throw Error(`Cannot handle this number of data regions`)}},e.prototype.getVerticalDataRegions=function(){switch(this.dataRegions){case 1:case 2:return 1;case 4:return 2;case 16:return 4;case 36:return 6;default:throw Error(`Cannot handle this number of data regions`)}},e.prototype.getSymbolDataWidth=function(){return this.getHorizontalDataRegions()*this.matrixWidth},e.prototype.getSymbolDataHeight=function(){return this.getVerticalDataRegions()*this.matrixHeight},e.prototype.getSymbolWidth=function(){return this.getSymbolDataWidth()+this.getHorizontalDataRegions()*2},e.prototype.getSymbolHeight=function(){return this.getSymbolDataHeight()+this.getVerticalDataRegions()*2},e.prototype.getCodewordCount=function(){return this.dataCapacity+this.errorCodewords},e.prototype.getInterleavedBlockCount=function(){return this.rsBlockData?this.dataCapacity/this.rsBlockData:1},e.prototype.getDataCapacity=function(){return this.dataCapacity},e.prototype.getErrorCodewords=function(){return this.errorCodewords},e.prototype.getDataLengthForInterleavedBlock=function(e){return this.rsBlockData},e.prototype.getErrorLengthForInterleavedBlock=function(e){return this.rsBlockError},e}(),lo=function(e){so(t,e);function t(){return e.call(this,!1,1558,620,22,22,36,-1,62)||this}return t.prototype.getInterleavedBlockCount=function(){return 10},t.prototype.getDataLengthForInterleavedBlock=function(e){return e<=8?156:155},t}(Y),uo=[new Y(!1,3,5,8,8,1),new Y(!1,5,7,10,10,1),new Y(!0,5,7,16,6,1),new Y(!1,8,10,12,12,1),new Y(!0,10,11,14,6,2),new Y(!1,12,12,14,14,1),new Y(!0,16,14,24,10,1),new Y(!1,18,14,16,16,1),new Y(!1,22,18,18,18,1),new Y(!0,22,18,16,10,2),new Y(!1,30,20,20,20,1),new Y(!0,32,24,16,14,2),new Y(!1,36,24,22,22,1),new Y(!1,44,28,24,24,1),new Y(!0,49,28,22,14,2),new Y(!1,62,36,14,14,4),new Y(!1,86,42,16,16,4),new Y(!1,114,48,18,18,4),new Y(!1,144,56,20,20,4),new Y(!1,174,68,22,22,4),new Y(!1,204,84,24,24,4,102,42),new Y(!1,280,112,14,14,16,140,56),new Y(!1,368,144,16,16,16,92,36),new Y(!1,456,192,18,18,16,114,48),new Y(!1,576,224,20,20,16,144,56),new Y(!1,696,272,22,22,16,174,68),new Y(!1,816,336,24,24,16,136,56),new Y(!1,1050,408,18,18,36,175,68),new Y(!1,1304,496,20,20,36,163,62),new lo],fo=function(){function e(e){this.msg=e,this.pos=0,this.skipAtEnd=0;for(var t=e.split(``).map(function(e){return e.charCodeAt(0)}),n=new F,r=0,i=t.length;r<i;r++){var a=String.fromCharCode(t[r]&255);if(a===`?`&&e.charAt(r)!==`?`)throw Error(`Message contains characters outside ISO-8859-1 encoding.`);n.append(a)}this.msg=n.toString(),this.shape=0,this.codewords=new F,this.newEncoding=-1}return e.prototype.setSymbolShape=function(e){this.shape=e},e.prototype.setSizeConstraints=function(e,t){this.minSize=e,this.maxSize=t},e.prototype.getMessage=function(){return this.msg},e.prototype.setSkipAtEnd=function(e){this.skipAtEnd=e},e.prototype.getCurrentChar=function(){return this.msg.charCodeAt(this.pos)},e.prototype.getCurrent=function(){return this.msg.charCodeAt(this.pos)},e.prototype.getCodewords=function(){return this.codewords},e.prototype.writeCodewords=function(e){this.codewords.append(e)},e.prototype.writeCodeword=function(e){this.codewords.append(e)},e.prototype.getCodewordCount=function(){return this.codewords.length()},e.prototype.getNewEncoding=function(){return this.newEncoding},e.prototype.signalEncoderChange=function(e){this.newEncoding=e},e.prototype.resetEncoderSignal=function(){this.newEncoding=-1},e.prototype.hasMoreCharacters=function(){return this.pos<this.getTotalMessageCharCount()},e.prototype.getTotalMessageCharCount=function(){return this.msg.length-this.skipAtEnd},e.prototype.getRemainingCharacters=function(){return this.getTotalMessageCharCount()-this.pos},e.prototype.getSymbolInfo=function(){return this.symbolInfo},e.prototype.updateSymbolInfo=function(e){e===void 0&&(e=this.getCodewordCount()),(this.symbolInfo==null||e>this.symbolInfo.getDataCapacity())&&(this.symbolInfo=Y.lookup(e,this.shape,this.minSize,this.maxSize,!0))},e.prototype.resetSymbolInfo=function(){this.symbolInfo=null},e}(),po=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),mo=function(e){po(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getEncodingMode=function(){return 3},t.prototype.encode=function(e){for(var t=new F;e.hasMoreCharacters();){var n=e.getCurrentChar();if(e.pos++,this.encodeChar(n,t),t.length()%3==0&&(this.writeNextTriplet(e,t),X.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode())!==this.getEncodingMode())){e.signalEncoderChange(0);break}}this.handleEOD(e,t)},t.prototype.encodeChar=function(e,t){switch(e){case 13:t.append(0);break;case 42:t.append(1);break;case 62:t.append(2);break;case 32:t.append(3);break;default:e>=48&&e<=57?t.append(e-48+4):e>=65&&e<=90?t.append(e-65+14):X.illegalCharacter(P.getCharAt(e))}return 1},t.prototype.handleEOD=function(e,t){e.updateSymbolInfo();var n=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount(),r=t.length();e.pos-=r,(e.getRemainingCharacters()>1||n>1||e.getRemainingCharacters()!==n)&&e.writeCodeword(254),e.getNewEncoding()<0&&e.signalEncoderChange(0)},t}(ao),ho=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),go=function(e){ho(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getEncodingMode=function(){return 2},t.prototype.encodeChar=function(e,t){if(e===32)return t.append(3),1;if(e>=48&&e<=57)return t.append(e-48+4),1;if(e>=97&&e<=122)return t.append(e-97+14),1;if(e<32)return t.append(0),t.append(e),2;if(e<=47)return t.append(1),t.append(e-33),2;if(e<=64)return t.append(1),t.append(e-58+15),2;if(e>=91&&e<=95)return t.append(1),t.append(e-91+22),2;if(e===96)return t.append(2),t.append(0),2;if(e<=90)return t.append(2),t.append(e-65+1),2;if(e<=127)return t.append(2),t.append(e-123+27),2;t.append(`1`);var n=2;return n+=this.encodeChar(e-128,t),n},t}(ao),X=function(){function e(){}return e.randomize253State=function(e){var t=129+(149*e%253+1);return t<=254?t:t-254},e.encodeHighLevel=function(e,t,n,r,i){t===void 0&&(t=0),n===void 0&&(n=null),r===void 0&&(r=null),i===void 0&&(i=!1);var a=new ao,o=[new ro,a,new go,new mo,new oo,new io],s=new fo(e);s.setSymbolShape(t),s.setSizeConstraints(n,r),e.startsWith(`[)>05`)&&e.endsWith(``)?(s.writeCodeword(236),s.setSkipAtEnd(2),s.pos+=eo.length):e.startsWith(`[)>06`)&&e.endsWith(``)&&(s.writeCodeword(237),s.setSkipAtEnd(2),s.pos+=to.length);var c=0;for(i&&(a.encodeMaximal(s),c=s.getNewEncoding(),s.resetEncoderSignal());s.hasMoreCharacters();)o[c].encode(s),s.getNewEncoding()>=0&&(c=s.getNewEncoding(),s.resetEncoderSignal());var l=s.getCodewordCount();s.updateSymbolInfo();var u=s.getSymbolInfo().getDataCapacity();l<u&&c!==0&&c!==5&&c!==4&&s.writeCodeword(`þ`);var d=s.getCodewords();for(d.length()<u&&d.append(129);d.length()<u;)d.append(this.randomize253State(d.length()+1));return s.getCodewords().toString()},e.lookAheadTest=function(e,t,n){var r=this.lookAheadTestIntern(e,t,n);if(n===3&&r===3){for(var i=Math.min(t+3,e.length),a=t;a<i;a++)if(!this.isNativeX12(e.charCodeAt(a)))return 0}else if(n===4&&r===4){for(var i=Math.min(t+4,e.length),a=t;a<i;a++)if(!this.isNativeEDIFACT(e.charCodeAt(a)))return 0}return r},e.lookAheadTestIntern=function(e,t,n){if(t>=e.length)return n;var r;n===0?r=[0,1,1,1,1,1.25]:(r=[1,2,2,2,2,2.25],r[n]=0);for(var i=0,a=new Uint8Array(6),o=[];;){if(t+i===e.length){Te.fill(a,0),Te.fill(o,0);var s=this.findMinimums(r,o,A.MAX_VALUE,a),c=this.getMinimumCount(a);if(o[0]===s)return 0;if(c===1){if(a[5]>0)return 5;if(a[4]>0)return 4;if(a[2]>0)return 2;if(a[3]>0)return 3}return 1}var l=e.charCodeAt(t+i);if(i++,this.isDigit(l)?r[0]+=.5:this.isExtendedASCII(l)?(r[0]=Math.ceil(r[0]),r[0]+=2):(r[0]=Math.ceil(r[0]),r[0]++),this.isNativeC40(l)?r[1]+=2/3:this.isExtendedASCII(l)?r[1]+=8/3:r[1]+=4/3,this.isNativeText(l)?r[2]+=2/3:this.isExtendedASCII(l)?r[2]+=8/3:r[2]+=4/3,this.isNativeX12(l)?r[3]+=2/3:this.isExtendedASCII(l)?r[3]+=13/3:r[3]+=10/3,this.isNativeEDIFACT(l)?r[4]+=3/4:this.isExtendedASCII(l)?r[4]+=17/4:r[4]+=13/4,this.isSpecialB256(l)?r[5]+=4:r[5]++,i>=4){if(Te.fill(a,0),Te.fill(o,0),this.findMinimums(r,o,A.MAX_VALUE,a),o[0]<this.min(o[5],o[1],o[2],o[3],o[4]))return 0;if(o[5]<o[0]||o[5]+1<this.min(o[1],o[2],o[3],o[4]))return 5;if(o[4]+1<this.min(o[5],o[1],o[2],o[3],o[0]))return 4;if(o[2]+1<this.min(o[5],o[1],o[4],o[3],o[0]))return 2;if(o[3]+1<this.min(o[5],o[1],o[4],o[2],o[0]))return 3;if(o[1]+1<this.min(o[0],o[5],o[4],o[2])){if(o[1]<o[3])return 1;if(o[1]===o[3]){for(var u=t+i+1;u<e.length;){var d=e.charCodeAt(u);if(this.isX12TermSep(d))return 3;if(!this.isNativeX12(d))break;u++}return 1}}}}},e.min=function(e,t,n,r,i){var a=Math.min(e,Math.min(t,Math.min(n,r)));return i===void 0?a:Math.min(a,i)},e.findMinimums=function(e,t,n,r){for(var i=0;i<6;i++){var a=t[i]=Math.ceil(e[i]);n>a&&(n=a,Te.fill(r,0)),n===a&&(r[i]=r[i]+1)}return n},e.getMinimumCount=function(e){for(var t=0,n=0;n<6;n++)t+=e[n];return t||0},e.isDigit=function(e){return e>=48&&e<=57},e.isExtendedASCII=function(e){return e>=128&&e<=255},e.isNativeC40=function(e){return e===32||e>=48&&e<=57||e>=65&&e<=90},e.isNativeText=function(e){return e===32||e>=48&&e<=57||e>=97&&e<=122},e.isNativeX12=function(e){return this.isX12TermSep(e)||e===32||e>=48&&e<=57||e>=65&&e<=90},e.isX12TermSep=function(e){return e===13||e===42||e===62},e.isNativeEDIFACT=function(e){return e>=32&&e<=94},e.isSpecialB256=function(e){return!1},e.determineConsecutiveDigitCount=function(e,t){t===void 0&&(t=0);for(var n=e.length,r=t;r<n&&this.isDigit(e.charCodeAt(r));)r++;return r-t},e.illegalCharacter=function(e){var t=A.toHexString(e.charCodeAt(0));throw t=`0000`.substring(0,4-t.length)+t,Error(`Illegal character: `+e+` (0x`+t+`)`)},e}(),_o=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},vo=function(){function e(e){this.charset=e,this.name=e.name}return e.prototype.canEncode=function(e){try{return Ne.encode(e,this.charset)!=null}catch{return!1}},e}(),yo=function(){function e(e,t,n){var r,i,a,o,s,c;this.ENCODERS=[`IBM437`,`ISO-8859-2`,`ISO-8859-3`,`ISO-8859-4`,`ISO-8859-5`,`ISO-8859-6`,`ISO-8859-7`,`ISO-8859-8`,`ISO-8859-9`,`ISO-8859-10`,`ISO-8859-11`,`ISO-8859-13`,`ISO-8859-14`,`ISO-8859-15`,`ISO-8859-16`,`windows-1250`,`windows-1251`,`windows-1252`,`windows-1256`,`Shift_JIS`].map(function(e){return new vo(Ga.forName(e))}),this.encoders=[];var l=[];l.push(new vo(Ka.ISO_8859_1));for(var u=t!=null&&t.name.startsWith(`UTF`),d=0;d<e.length;d++){var f=!1;try{for(var p=(r=void 0,_o(l)),m=p.next();!m.done;m=p.next()){var h=m.value,g=e.charAt(d);if(g.charCodeAt(0)===n||h.canEncode(g)){f=!0;break}}}catch(e){r={error:e}}finally{try{m&&!m.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}if(!f)try{for(var _=(a=void 0,_o(this.ENCODERS)),v=_.next();!v.done;v=_.next()){var h=v.value;if(h.canEncode(e.charAt(d))){l.push(h),f=!0;break}}}catch(e){a={error:e}}finally{try{v&&!v.done&&(o=_.return)&&o.call(_)}finally{if(a)throw a.error}}f||(u=!0)}if(l.length===1&&!u)this.encoders=[l[0]];else{this.encoders=[];var y=0;try{for(var b=_o(l),x=b.next();!x.done;x=b.next()){var h=x.value;this.encoders[y++]=h}}catch(e){s={error:e}}finally{try{x&&!x.done&&(c=b.return)&&c.call(b)}finally{if(s)throw s.error}}}var S=-1;if(t!=null){for(var d=0;d<this.encoders.length;d++)if(this.encoders[d]!=null&&t.name===this.encoders[d].name){S=d;break}}this.priorityEncoderIndex=S}return e.prototype.length=function(){return this.encoders.length},e.prototype.getCharsetName=function(e){if(!(e<this.length()))throw Error(`index must be less than length`);return this.encoders[e].name},e.prototype.getCharset=function(e){if(!(e<this.length()))throw Error(`index must be less than length`);return this.encoders[e].charset},e.prototype.getECIValue=function(e){return this.encoders[e].charset.getValueIdentifier()},e.prototype.getPriorityEncoderIndex=function(){return this.priorityEncoderIndex},e.prototype.canEncode=function(e,t){if(!(t<this.length()))throw Error(`index must be less than length`);return!0},e.prototype.encode=function(e,t){if(!(t<this.length()))throw Error(`index must be less than length`);return Ne.encode(P.getCharAt(e),this.encoders[t].name)},e}(),bo=3,xo=function(){function e(e,t,n){this.fnc1=n;var r=new yo(e,t,n);if(r.length()===1)for(var i=0;i<this.bytes.length;i++){var a=e.charAt(i).charCodeAt(0);this.bytes[i]=a===n?1e3:a}else this.bytes=this.encodeMinimally(e,r,n)}return e.prototype.getFNC1Character=function(){return this.fnc1},e.prototype.length=function(){return this.bytes.length},e.prototype.haveNCharacters=function(e,t){if(e+t-1>=this.bytes.length)return!1;for(var n=0;n<t;n++)if(this.isECI(e+n))return!1;return!0},e.prototype.charAt=function(e){if(e<0||e>=this.length())throw Error(``+e);if(this.isECI(e))throw Error(`value at `+e+` is not a character but an ECI`);return this.isFNC1(e)?this.fnc1:this.bytes[e]},e.prototype.subSequence=function(e,t){if(e<0||e>t||t>this.length())throw Error(``+e);for(var n=new F,r=e;r<t;r++){if(this.isECI(r))throw Error(`value at `+r+` is not a character but an ECI`);n.append(this.charAt(r))}return n.toString()},e.prototype.isECI=function(e){if(e<0||e>=this.length())throw Error(``+e);return this.bytes[e]>255&&this.bytes[e]<=999},e.prototype.isFNC1=function(e){if(e<0||e>=this.length())throw Error(``+e);return this.bytes[e]===1e3},e.prototype.getECIValue=function(e){if(e<0||e>=this.length())throw Error(``+e);if(!this.isECI(e))throw Error(`value at `+e+` is not an ECI but a character`);return this.bytes[e]-256},e.prototype.addEdge=function(e,t,n){(e[t][n.encoderIndex]==null||e[t][n.encoderIndex].cachedTotalSize>n.cachedTotalSize)&&(e[t][n.encoderIndex]=n)},e.prototype.addEdges=function(e,t,n,r,i,a){var o=e.charAt(r).charCodeAt(0),s=0,c=t.length();t.getPriorityEncoderIndex()>=0&&(o===a||t.canEncode(o,t.getPriorityEncoderIndex()))&&(s=t.getPriorityEncoderIndex(),c=s+1);for(var l=s;l<c;l++)(o===a||t.canEncode(o,l))&&this.addEdge(n,r+1,new So(o,t,l,i,a))},e.prototype.encodeMinimally=function(e,t,n){var r=e.length,i=new So[r+1][t.length()];this.addEdges(e,t,i,0,null,n);for(var a=1;a<=r;a++){for(var o=0;o<t.length();o++)i[a][o]!=null&&a<r&&this.addEdges(e,t,i,a,i[a][o],n);for(var o=0;o<t.length();o++)i[a-1][o]=null}for(var s=-1,c=A.MAX_VALUE,o=0;o<t.length();o++)if(i[r][o]!=null){var l=i[r][o];l.cachedTotalSize<c&&(c=l.cachedTotalSize,s=o)}if(s<0)throw Error(`Failed to encode "`+e+`"`);for(var u=[],d=i[r][s];d!=null;){if(d.isFNC1())u.unshift(1e3);else for(var f=t.encode(d.c,d.encoderIndex),a=f.length-1;a>=0;a--)u.unshift(f[a]&255);(d.previous===null?0:d.previous.encoderIndex)!==d.encoderIndex&&u.unshift(256+t.getECIValue(d.encoderIndex)),d=d.previous}for(var p=[],a=0;a<p.length;a++)p[a]=u[a];return p},e}(),So=function(){function e(e,t,n,r,i){this.c=e,this.encoderSet=t,this.encoderIndex=n,this.previous=r,this.fnc1=i,this.c=e===i?1e3:e;var a=this.isFNC1()?1:t.encode(e,n).length;(r===null?0:r.encoderIndex)!==n&&(a+=bo),r!=null&&(a+=r.cachedTotalSize),this.cachedTotalSize=a}return e.prototype.isFNC1=function(){return this.c===1e3},e}(),Co=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),wo=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},To=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},Eo=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))},Z;(function(e){e[e.ASCII=0]=`ASCII`,e[e.C40=1]=`C40`,e[e.TEXT=2]=`TEXT`,e[e.X12=3]=`X12`,e[e.EDF=4]=`EDF`,e[e.B256=5]=`B256`})(Z||={});var Do=`!"#$%&'()*+,-./:;<=>?@[\\]^_`.split(``),Oo=function(){function e(){}return e.isExtendedASCII=function(e,t){return e!==t&&e>=128&&e<=255},e.isInC40Shift1Set=function(e){return e<=31},e.isInC40Shift2Set=function(e,t){var n,r;try{for(var i=wo(Do),a=i.next();!a.done;a=i.next())if(a.value.charCodeAt(0)===e)return!0}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e===t},e.isInTextShift1Set=function(e){return this.isInC40Shift1Set(e)},e.isInTextShift2Set=function(e,t){return this.isInC40Shift2Set(e,t)},e.encodeHighLevel=function(e,t,n,r){t===void 0&&(t=null),n===void 0&&(n=-1),r===void 0&&(r=0);var i=0;return e.startsWith(`[)>05`)&&e.endsWith(``)?(i=5,e=e.substring(eo.length,e.length-2)):e.startsWith(`[)>06`)&&e.endsWith(``)&&(i=6,e=e.substring(to.length,e.length-2)),decodeURIComponent(escape(String.fromCharCode.apply(String,Eo([],To(this.encode(e,t,n,r,i)),!1))))},e.encode=function(e,t,n,r,i){return this.encodeMinimally(new jo(e,t,n,r,i)).getBytes()},e.addEdge=function(e,t){var n=t.fromPosition+t.characterLength;(e[n][t.getEndMode()]===null||e[n][t.getEndMode()].cachedTotalSize>t.cachedTotalSize)&&(e[n][t.getEndMode()]=t)},e.getNumberOfC40Words=function(t,n,r,i){for(var a=0,o=n;o<t.length();o++){if(t.isECI(o))return i[0]=0,0;var s=t.charAt(o);if(r&&X.isNativeC40(s)||!r&&X.isNativeText(s))a++;else if(!e.isExtendedASCII(s,t.getFNC1Character()))a+=2;else{var c=s&255;c>=128&&(r&&X.isNativeC40(c-128)||!r&&X.isNativeText(c-128))?a+=3:a+=4}if(a%3==0||(a-2)%3==0&&o+1===t.length())return i[0]=o-n+1,Math.ceil(a/3)}return i[0]=0,0},e.addEdges=function(t,n,r,i){var a,o;if(t.isECI(r))this.addEdge(n,new Ao(t,Z.ASCII,r,1,i));else{var s=t.charAt(r);if(i===null||i.getEndMode()!==Z.EDF){X.isDigit(s)&&t.haveNCharacters(r,2)&&X.isDigit(t.charAt(r+1))?this.addEdge(n,new Ao(t,Z.ASCII,r,2,i)):this.addEdge(n,new Ao(t,Z.ASCII,r,1,i));var c=[Z.C40,Z.TEXT];try{for(var l=wo(c),u=l.next();!u.done;u=l.next()){var d=u.value,f=[];e.getNumberOfC40Words(t,r,d===Z.C40,f)>0&&this.addEdge(n,new Ao(t,d,r,f[0],i))}}catch(e){a={error:e}}finally{try{u&&!u.done&&(o=l.return)&&o.call(l)}finally{if(a)throw a.error}}t.haveNCharacters(r,3)&&X.isNativeX12(t.charAt(r))&&X.isNativeX12(t.charAt(r+1))&&X.isNativeX12(t.charAt(r+2))&&this.addEdge(n,new Ao(t,Z.X12,r,3,i)),this.addEdge(n,new Ao(t,Z.B256,r,1,i))}for(var p=0;p<3;p++){var m=r+p;if(t.haveNCharacters(m,1)&&X.isNativeEDIFACT(t.charAt(m)))this.addEdge(n,new Ao(t,Z.EDF,r,p+1,i));else break}p===3&&t.haveNCharacters(r,4)&&X.isNativeEDIFACT(t.charAt(r+3))&&this.addEdge(n,new Ao(t,Z.EDF,r,4,i))}},e.encodeMinimally=function(e){var t=e.length(),n=Array(t+1).fill(null).map(function(){return[,,,,,,].fill(0)});this.addEdges(e,n,0,null);for(var r=1;r<=t;r++){for(var i=0;i<6;i++)n[r][i]!==null&&r<t&&this.addEdges(e,n,r,n[r][i]);for(var i=0;i<6;i++)n[r-1][i]=null}for(var a=-1,o=A.MAX_VALUE,i=0;i<6;i++)if(n[t][i]!==null){var s=n[t][i],c=i>=1&&i<=3?s.cachedTotalSize+1:s.cachedTotalSize;c<o&&(o=c,a=i)}if(a<0)throw Error(`Failed to encode "`+e+`"`);return new ko(n[t][a])},e}(),ko=function(){function e(e){var t=e.input,n=0,r=[],i=[],a=[];(e.mode===Z.C40||e.mode===Z.TEXT||e.mode===Z.X12)&&e.getEndMode()!==Z.ASCII&&(n+=this.prepend(Ao.getBytes(254),r));for(var o=e;o!==null;)n+=this.prepend(o.getDataBytes(),r),(o.previous===null||o.getPreviousStartMode()!==o.getMode())&&(o.getMode()===Z.B256&&(n<=249?(r.unshift(n),n++):(r.unshift(n%250),r.unshift(n/250+249),n+=2),i.push(r.length),a.push(n)),this.prepend(o.getLatchBytes(),r),n=0),o=o.previous;t.getMacroId()===5?n+=this.prepend(Ao.getBytes(236),r):t.getMacroId()===6&&(n+=this.prepend(Ao.getBytes(237),r)),t.getFNC1Character()>0&&(n+=this.prepend(Ao.getBytes(232),r));for(var s=0;s<i.length;s++)this.applyRandomPattern(r,r.length-i[s],a[s]);var c=e.getMinSymbolSize(r.length);for(r.length<c&&r.push(129);r.length<c;)r.push(this.randomize253State(r.length+1));this.bytes=new Uint8Array(r.length);for(var s=0;s<this.bytes.length;s++)this.bytes[s]=r[s]}return e.prototype.prepend=function(e,t){for(var n=e.length-1;n>=0;n--)t.unshift(e[n]);return e.length},e.prototype.randomize253State=function(e){var t=129+(149*e%253+1);return t<=254?t:t-254},e.prototype.applyRandomPattern=function(e,t,n){for(var r=0;r<n;r++){var i=t+r,a=(e[i]&255)+(149*(i+1)%255+1);e[i]=a<=255?a:a-256}},e.prototype.getBytes=function(){return this.bytes},e}(),Ao=function(){function e(e,t,n,r,i){if(this.input=e,this.mode=t,this.fromPosition=n,this.characterLength=r,this.previous=i,this.allCodewordCapacities=[3,5,8,10,12,16,18,22,30,32,36,44,49,62,86,114,144,174,204,280,368,456,576,696,816,1050,1304,1558],this.squareCodewordCapacities=[3,5,8,12,18,22,30,36,44,62,86,114,144,174,204,280,368,456,576,696,816,1050,1304,1558],this.rectangularCodewordCapacities=[5,10,16,33,32,49],!(n+r<=e.length()))throw Error(`Invalid edge`);var a=i===null?0:i.cachedTotalSize,o=this.getPreviousMode();switch(t){case Z.ASCII:a++,(e.isECI(n)||Oo.isExtendedASCII(e.charAt(n),e.getFNC1Character()))&&a++,(o===Z.C40||o===Z.TEXT||o===Z.X12)&&a++;break;case Z.B256:a++,o===Z.B256?this.getB256Size()===250&&a++:a++,o===Z.ASCII?a++:(o===Z.C40||o===Z.TEXT||o===Z.X12)&&(a+=2);break;case Z.C40:case Z.TEXT:case Z.X12:t===Z.X12?a+=2:a+=Oo.getNumberOfC40Words(e,n,t===Z.C40,[])*2,o===Z.ASCII||o===Z.B256?a++:o!==t&&(o===Z.C40||o===Z.TEXT||o===Z.X12)&&(a+=2);break;case Z.EDF:a+=3,o===Z.ASCII||o===Z.B256?a++:(o===Z.C40||o===Z.TEXT||o===Z.X12)&&(a+=2)}this.cachedTotalSize=a}return e.prototype.getB256Size=function(){for(var e=0,t=this;t!==null&&t.mode===Z.B256&&e<=250;)e++,t=t.previous;return e},e.prototype.getPreviousStartMode=function(){return this.previous===null?Z.ASCII:this.previous.mode},e.prototype.getPreviousMode=function(){return this.previous===null?Z.ASCII:this.previous.getEndMode()},e.prototype.getEndMode=function(){if(this.mode===Z.EDF){if(this.characterLength<4)return Z.ASCII;var e=this.getLastASCII();if(e>0&&this.getCodewordsRemaining(this.cachedTotalSize+e)<=2-e)return Z.ASCII}if(this.mode===Z.C40||this.mode===Z.TEXT||this.mode===Z.X12){if(this.fromPosition+this.characterLength>=this.input.length()&&this.getCodewordsRemaining(this.cachedTotalSize)===0)return Z.ASCII;var e=this.getLastASCII();if(e===1&&this.getCodewordsRemaining(this.cachedTotalSize+1)===0)return Z.ASCII}return this.mode},e.prototype.getMode=function(){return this.mode},e.prototype.getLastASCII=function(){var e=this.input.length(),t=this.fromPosition+this.characterLength;return e-t>4||t>=e?0:e-t===1?+!Oo.isExtendedASCII(this.input.charAt(t),this.input.getFNC1Character()):e-t===2?Oo.isExtendedASCII(this.input.charAt(t),this.input.getFNC1Character())||Oo.isExtendedASCII(this.input.charAt(t+1),this.input.getFNC1Character())?0:X.isDigit(this.input.charAt(t))&&X.isDigit(this.input.charAt(t+1))?1:2:e-t===3?X.isDigit(this.input.charAt(t))&&X.isDigit(this.input.charAt(t+1))&&!Oo.isExtendedASCII(this.input.charAt(t+2),this.input.getFNC1Character())||X.isDigit(this.input.charAt(t+1))&&X.isDigit(this.input.charAt(t+2))&&!Oo.isExtendedASCII(this.input.charAt(t),this.input.getFNC1Character())?2:0:X.isDigit(this.input.charAt(t))&&X.isDigit(this.input.charAt(t+1))&&X.isDigit(this.input.charAt(t+2))&&X.isDigit(this.input.charAt(t+3))?2:0},e.prototype.getMinSymbolSize=function(e){var t,n,r,i,a,o;switch(this.input.getShapeHint()){case 1:try{for(var s=wo(this.squareCodewordCapacities),c=s.next();!c.done;c=s.next()){var l=c.value;if(l>=e)return l}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}break;case 2:try{for(var u=wo(this.rectangularCodewordCapacities),d=u.next();!d.done;d=u.next()){var l=d.value;if(l>=e)return l}}catch(e){r={error:e}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}try{for(var f=wo(this.allCodewordCapacities),p=f.next();!p.done;p=f.next()){var l=p.value;if(l>=e)return l}}catch(e){a={error:e}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(a)throw a.error}}return this.allCodewordCapacities[this.allCodewordCapacities.length-1]},e.prototype.getCodewordsRemaining=function(e){return this.getMinSymbolSize(e)-e},e.getBytes=function(e,t){var n=new Uint8Array(t?2:1);return n[0]=e,t&&(n[1]=t),n},e.prototype.setC40Word=function(e,t,n,r,i){var a=1600*(n&255)+40*(r&255)+(i&255)+1;e[t]=a/256,e[t+1]=a%256},e.prototype.getX12Value=function(e){return e===13?0:e===42?1:e===62?2:e===32?3:e>=48&&e<=57?e-44:e>=65&&e<=90?e-51:e},e.prototype.getX12Words=function(){if(this.characterLength%3!=0)throw Error(`X12 words must be a multiple of 3`);for(var e=new Uint8Array(this.characterLength/3*2),t=0;t<e.length;t+=2)this.setC40Word(e,t,this.getX12Value(this.input.charAt(this.fromPosition+t/2*3)),this.getX12Value(this.input.charAt(this.fromPosition+t/2*3+1)),this.getX12Value(this.input.charAt(this.fromPosition+t/2*3+2)));return e},e.prototype.getShiftValue=function(e,t,n){return t&&Oo.isInC40Shift1Set(e)||!t&&Oo.isInTextShift1Set(e)?0:t&&Oo.isInC40Shift2Set(e,n)||!t&&Oo.isInTextShift2Set(e,n)?1:2},e.prototype.getC40Value=function(e,t,n,r){if(n===r){if(t!==2)throw Error(`FNC1 cannot be used in C40 shift 2`);return 27}return e?n<=31?n:n===32?3:n<=47?n-33:n<=57?n-44:n<=64?n-43:n<=90?n-51:n<=95?n-69:n<=127?n-96:n:n===0?0:t===0&&n<=3?n-1:t===1&&n<=31?n:n===32?3:n>=33&&n<=47?n-33:n>=48&&n<=57?n-44:n>=58&&n<=64?n-43:n>=65&&n<=90?n-64:n>=91&&n<=95?n-69:n===96?0:n>=97&&n<=122?n-83:n>=123&&n<=127?n-96:n},e.prototype.getC40Words=function(e,t){for(var n=[],r=0;r<this.characterLength;r++){var i=this.input.charAt(this.fromPosition+r);if(e&&X.isNativeC40(i)||!e&&X.isNativeText(i))n.push(this.getC40Value(e,0,i,t));else if(Oo.isExtendedASCII(i,t)){var a=(i&255)-128;if(e&&X.isNativeC40(a)||!e&&X.isNativeText(a))n.push(1),n.push(30),n.push(this.getC40Value(e,0,a,t));else{n.push(1),n.push(30);var o=this.getShiftValue(a,e,t);n.push(o),n.push(this.getC40Value(e,o,a,t))}}else{var o=this.getShiftValue(i,e,t);n.push(o),n.push(this.getC40Value(e,o,i,t))}}if(n.length%3!=0){if((n.length-2)%3!=0||this.fromPosition+this.characterLength!==this.input.length())throw Error(`C40 words must be a multiple of 3`);n.push(0)}for(var s=new Uint8Array(n.length/3*2),c=0,r=0;r<n.length;r+=3)this.setC40Word(s,c,n[r]&255,n[r+1]&255,n[r+2]&255),c+=2;return s},e.prototype.getEDFBytes=function(){for(var e=Math.ceil(this.characterLength/4),t=new Uint8Array(e*3),n=this.fromPosition,r=Math.min(this.fromPosition+this.characterLength-1,this.input.length()-1),i=0;i<e;i+=3){for(var a=[],o=0;o<4;o++)n<=r?a[o]=this.input.charAt(n++)&63:a[o]=n===r+1?31:0;var s=a[0]<<18;s|=a[1]<<12,s|=a[2]<<6,s|=a[3],t[i]=s>>16&255,t[i+1]=s>>8&255,t[i+2]=s&255}return t},e.prototype.getLatchBytes=function(){switch(this.getPreviousMode()){case Z.ASCII:case Z.B256:switch(this.mode){case Z.B256:return e.getBytes(231);case Z.C40:return e.getBytes(230);case Z.TEXT:return e.getBytes(239);case Z.X12:return e.getBytes(238);case Z.EDF:return e.getBytes(240)}break;case Z.C40:case Z.TEXT:case Z.X12:if(this.mode!==this.getPreviousMode())switch(this.mode){case Z.ASCII:return e.getBytes(254);case Z.B256:return e.getBytes(254,231);case Z.C40:return e.getBytes(254,230);case Z.TEXT:return e.getBytes(254,239);case Z.X12:return e.getBytes(254,238);case Z.EDF:return e.getBytes(254,240)}break;case Z.EDF:if(this.mode!==Z.EDF)throw Error(`Cannot switch from EDF to `+this.mode)}return new Uint8Array},e.prototype.getDataBytes=function(){switch(this.mode){case Z.ASCII:return this.input.isECI(this.fromPosition)?e.getBytes(241,this.input.getECIValue(this.fromPosition)+1):Oo.isExtendedASCII(this.input.charAt(this.fromPosition),this.input.getFNC1Character())?e.getBytes(235,this.input.charAt(this.fromPosition)-127):this.characterLength===2?e.getBytes(this.input.charAt(this.fromPosition)*10+this.input.charAt(this.fromPosition+1)+130):this.input.isFNC1(this.fromPosition)?e.getBytes(232):e.getBytes(this.input.charAt(this.fromPosition)+1);case Z.B256:return e.getBytes(this.input.charAt(this.fromPosition));case Z.C40:return this.getC40Words(!0,this.input.getFNC1Character());case Z.TEXT:return this.getC40Words(!1,this.input.getFNC1Character());case Z.X12:return this.getX12Words();case Z.EDF:return this.getEDFBytes()}},e}(),jo=function(e){Co(t,e);function t(t,n,r,i,a){var o=e.call(this,t,n,r)||this;return o.shape=i,o.macroId=a,o}return t.prototype.getMacroId=function(){return this.macroId},t.prototype.getShapeHint=function(){return this.shape},t}(xo);(function(){function e(){}return e.prototype.encode=function(e,t,n,r,i){if(i===void 0&&(i=null),e.trim()===``)throw Error(`Found empty contents`);if(t!==L.DATA_MATRIX)throw Error(`Can only encode DATA_MATRIX, but got `+t);if(n<0||r<0)throw Error(`Requested dimensions can't be negative: `+n+`x`+r);var a=0,o=null,s=null;if(i!=null){var c=i.get(q.DATA_MATRIX_SHAPE);c!=null&&(a=c);var l=i.get(q.MIN_SIZE);l!=null&&(o=l);var u=i.get(q.MAX_SIZE);u!=null&&(s=u)}var d;if(i!=null&&i.has(q.DATA_MATRIX_COMPACT)&&i.get(q.DATA_MATRIX_COMPACT).toString()){var f=i.has(q.GS1_FORMAT)&&!!i.get(q.GS1_FORMAT).toString(),p=null;i.has(q.CHARACTER_SET)&&(p=Ga.forName(i.get(q.CHARACTER_SET).toString())),d=Oo.encodeHighLevel(e,p,f?29:-1,a)}else{var m=i!=null&&i.has(q.FORCE_C40)&&!!i.get(q.FORCE_C40).toString();d=X.encodeHighLevel(e,a,o,s,m)}var h=Y.lookup(d.length,a,o,s,!0),g=new qa(no.encodeECC200(d,h),h.getSymbolDataWidth(),h.getSymbolDataHeight());return g.place(),this.encodeLowLevel(g,h,n,r)},e.prototype.encodeLowLevel=function(e,t,n,r){for(var i=t.getSymbolDataWidth(),a=t.getSymbolDataHeight(),o=new Pa(t.getSymbolWidth(),t.getSymbolHeight()),s=0,c=0;c<a;c++){var l=void 0;if(c%t.matrixHeight===0){l=0;for(var u=0;u<t.getSymbolWidth();u++)o.setBoolean(l,s,u%2==0),l++;s++}l=0;for(var u=0;u<i;u++)u%t.matrixWidth===0&&(o.setBoolean(l,s,!0),l++),o.setBoolean(l,s,e.getBit(u,c)),l++,u%t.matrixWidth===t.matrixWidth-1&&(o.setBoolean(l,s,c%2==0),l++);if(s++,c%t.matrixHeight===t.matrixHeight-1){l=0;for(var u=0;u<t.getSymbolWidth();u++)o.setBoolean(l,s,!0),l++;s++}}return this.convertByteMatrixToBitMatrix(o,n,r)},e.prototype.convertByteMatrixToBitMatrix=function(e,t,n){var r=e.getWidth(),i=e.getHeight(),a=Math.max(t,r),o=Math.max(n,i),s=Math.min(a/r,o/i),c=(a-r*s)/2,l=(o-i*s)/2,u;n<i||t<r?(c=0,l=0,u=new Pe(r,i)):u=new Pe(t,n),u.clear();for(var d=0,f=l;d<i;d++,f+=s)for(var p=0,m=c;p<r;p++,m+=s)e.get(p,d)===1&&u.setRegion(m,f,s,s);return u},e})();var Mo=function(){function e(){}return e.prototype.isCompact=function(){return this.compact},e.prototype.setCompact=function(e){this.compact=e},e.prototype.getSize=function(){return this.size},e.prototype.setSize=function(e){this.size=e},e.prototype.getLayers=function(){return this.layers},e.prototype.setLayers=function(e){this.layers=e},e.prototype.getCodeWords=function(){return this.codeWords},e.prototype.setCodeWords=function(e){this.codeWords=e},e.prototype.getMatrix=function(){return this.matrix},e.prototype.setMatrix=function(e){this.matrix=e},e}(),No=function(){function e(){}return e.singletonList=function(e){return[e]},e.min=function(e,t){return e.sort(t)[0]},e}(),Po=function(){function e(e){this.previous=e}return e.prototype.getPrevious=function(){return this.previous},e}(),Fo=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Io=function(e){Fo(t,e);function t(t,n,r){var i=e.call(this,t)||this;return i.value=n,i.bitCount=r,i}return t.prototype.appendTo=function(e,t){e.appendBits(this.value,this.bitCount)},t.prototype.add=function(e,n){return new t(this,e,n)},t.prototype.addBinaryShift=function(e,n){return console.warn(`addBinaryShift on SimpleToken, this simply returns a copy of this token`),new t(this,e,n)},t.prototype.toString=function(){var e=this.value&(1<<this.bitCount)-1;return e|=1<<this.bitCount,`<`+A.toBinaryString(e|1<<this.bitCount).substring(1)+`>`},t}(Po),Lo=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ro=function(e){Lo(t,e);function t(t,n,r){var i=e.call(this,t,0,0)||this;return i.binaryShiftStart=n,i.binaryShiftByteCount=r,i}return t.prototype.appendTo=function(e,t){for(var n=0;n<this.binaryShiftByteCount;n++)(n===0||n===31&&this.binaryShiftByteCount<=62)&&(e.appendBits(31,5),this.binaryShiftByteCount>62?e.appendBits(this.binaryShiftByteCount-31,16):n===0?e.appendBits(Math.min(this.binaryShiftByteCount,31),5):e.appendBits(this.binaryShiftByteCount-31,5)),e.appendBits(t[this.binaryShiftStart+n],8)},t.prototype.addBinaryShift=function(e,n){return new t(this,e,n)},t.prototype.toString=function(){return`<`+this.binaryShiftStart+`::`+(this.binaryShiftStart+this.binaryShiftByteCount-1)+`>`},t}(Io);function zo(e,t,n){return new Ro(e,t,n)}function Bo(e,t,n){return new Io(e,t,n)}var Vo=[`UPPER`,`LOWER`,`DIGIT`,`MIXED`,`PUNCT`],Ho=new Io(null,0,0),Uo=[Int32Array.from([0,327708,327710,327709,656318]),Int32Array.from([590318,0,327710,327709,656318]),Int32Array.from([262158,590300,0,590301,932798]),Int32Array.from([327709,327708,656318,0,327710]),Int32Array.from([327711,656380,656382,656381,0])],Wo=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)};function Go(e){var t,n;try{for(var r=Wo(e),i=r.next();!i.done;i=r.next()){var a=i.value;Te.fill(a,-1)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return e[0][4]=0,e[1][4]=0,e[1][0]=28,e[3][4]=0,e[2][4]=0,e[2][0]=15,e}var Ko=Go(Te.createInt32Array(6,6)),qo=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Jo=function(){function e(e,t,n,r){this.token=e,this.mode=t,this.binaryShiftByteCount=n,this.bitCount=r}return e.prototype.getMode=function(){return this.mode},e.prototype.getToken=function(){return this.token},e.prototype.getBinaryShiftByteCount=function(){return this.binaryShiftByteCount},e.prototype.getBitCount=function(){return this.bitCount},e.prototype.latchAndAppend=function(t,n){var r=this.bitCount,i=this.token;if(t!==this.mode){var a=Uo[this.mode][t];i=Bo(i,a&65535,a>>16),r+=a>>16}var o=t===2?4:5;return i=Bo(i,n,o),new e(i,t,0,r+o)},e.prototype.shiftAndAppend=function(t,n){var r=this.token,i=this.mode===2?4:5;return r=Bo(r,Ko[this.mode][t],i),r=Bo(r,n,5),new e(r,this.mode,0,this.bitCount+i+5)},e.prototype.addBinaryShiftChar=function(t){var n=this.token,r=this.mode,i=this.bitCount;if(this.mode===4||this.mode===2){var a=Uo[r][0];n=Bo(n,a&65535,a>>16),i+=a>>16,r=0}var o=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,s=new e(n,r,this.binaryShiftByteCount+1,i+o);return s.binaryShiftByteCount===2078&&(s=s.endBinaryShift(t+1)),s},e.prototype.endBinaryShift=function(t){if(this.binaryShiftByteCount===0)return this;var n=this.token;return n=zo(n,t-this.binaryShiftByteCount,this.binaryShiftByteCount),new e(n,this.mode,0,this.bitCount)},e.prototype.isBetterThanOrEqualTo=function(t){var n=this.bitCount+(Uo[this.mode][t.mode]>>16);return this.binaryShiftByteCount<t.binaryShiftByteCount?n+=e.calculateBinaryShiftCost(t)-e.calculateBinaryShiftCost(this):this.binaryShiftByteCount>t.binaryShiftByteCount&&t.binaryShiftByteCount>0&&(n+=10),n<=t.bitCount},e.prototype.toBitArray=function(e){for(var t,n,r=[],i=this.endBinaryShift(e.length).token;i!==null;i=i.getPrevious())r.unshift(i);var a=new Ee;try{for(var o=qo(r),s=o.next();!s.done;s=o.next())s.value.appendTo(a,e)}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return a},e.prototype.toString=function(){return P.format(`%s bits=%d bytes=%d`,Vo[this.mode],this.bitCount,this.binaryShiftByteCount)},e.calculateBinaryShiftCost=function(e){return e.binaryShiftByteCount>62?21:e.binaryShiftByteCount>31?20:e.binaryShiftByteCount>0?10:0},e.INITIAL_STATE=new e(Ho,0,0,0),e}();function Yo(e){var t=P.getCharCode(` `),n=P.getCharCode(`.`),r=P.getCharCode(`,`);e[0][t]=1;for(var i=P.getCharCode(`Z`),a=P.getCharCode(`A`),o=a;o<=i;o++)e[0][o]=o-a+2;e[1][t]=1;for(var s=P.getCharCode(`z`),c=P.getCharCode(`a`),o=c;o<=s;o++)e[1][o]=o-c+2;e[2][t]=1;for(var l=P.getCharCode(`9`),u=P.getCharCode(`0`),o=u;o<=l;o++)e[2][o]=o-u+2;e[2][r]=12,e[2][n]=13;for(var d=`\0 \x07\b
20
+ \v\f\r\x1B@\\^_\`|~`.split(``),f=0;f<d.length;f++)e[3][P.getCharCode(d[f])]=f;for(var p=`\0\r\0\0\0\0!'#$%&'()*+,-./:;<=>?[]{}`.split(``),f=0;f<p.length;f++)P.getCharCode(p[f])>0&&(e[4][P.getCharCode(p[f])]=f);return e}var Xo=Yo(Te.createInt32Array(5,256)),Zo=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Qo=function(){function e(e){this.text=e}return e.prototype.encode=function(){for(var t=P.getCharCode(` `),n=P.getCharCode(`
21
+ `),r=No.singletonList(Jo.INITIAL_STATE),i=0;i<this.text.length;i++){var a=void 0,o=i+1<this.text.length?this.text[i+1]:0;switch(this.text[i]){case P.getCharCode(`\r`):a=o===n?2:0;break;case P.getCharCode(`.`):a=o===t?3:0;break;case P.getCharCode(`,`):a=o===t?4:0;break;case P.getCharCode(`:`):a=o===t?5:0;break;default:a=0}a>0?(r=e.updateStateListForPair(r,i,a),i++):r=this.updateStateListForChar(r,i)}return No.min(r,function(e,t){return e.getBitCount()-t.getBitCount()}).toBitArray(this.text)},e.prototype.updateStateListForChar=function(t,n){var r,i,a=[];try{for(var o=Zo(t),s=o.next();!s.done;s=o.next()){var c=s.value;this.updateStateForChar(c,n,a)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return e.simplifyStates(a)},e.prototype.updateStateForChar=function(e,t,n){for(var r=this.text[t]&255,i=Xo[e.getMode()][r]>0,a=null,o=0;o<=4;o++){var s=Xo[o][r];if(s>0){if(a??=e.endBinaryShift(t),!i||o===e.getMode()||o===2){var c=a.latchAndAppend(o,s);n.push(c)}if(!i&&Ko[e.getMode()][o]>=0){var l=a.shiftAndAppend(o,s);n.push(l)}}}if(e.getBinaryShiftByteCount()>0||Xo[e.getMode()][r]===0){var u=e.addBinaryShiftChar(t);n.push(u)}},e.updateStateListForPair=function(e,t,n){var r,i,a=[];try{for(var o=Zo(e),s=o.next();!s.done;s=o.next()){var c=s.value;this.updateStateForPair(c,t,n,a)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return this.simplifyStates(a)},e.updateStateForPair=function(e,t,n,r){var i=e.endBinaryShift(t);if(r.push(i.latchAndAppend(4,n)),e.getMode()!==4&&r.push(i.shiftAndAppend(4,n)),n===3||n===4){var a=i.latchAndAppend(2,16-n).latchAndAppend(2,1);r.push(a)}if(e.getBinaryShiftByteCount()>0){var o=e.addBinaryShiftChar(t).addBinaryShiftChar(t+1);r.push(o)}},e.simplifyStates=function(e){var t,n,r,i,a=[];try{for(var o=Zo(e),s=o.next();!s.done;s=o.next()){var c=s.value,l=!0,u=function(e){if(e.isBetterThanOrEqualTo(c))return l=!1,`break`;c.isBetterThanOrEqualTo(e)&&(a=a.filter(function(t){return t!==e}))};try{for(var d=(r=void 0,Zo(a)),f=d.next();!f.done;f=d.next()){var p=f.value;if(u(p)===`break`)break}}catch(e){r={error:e}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}l&&a.push(c)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return a},e}(),$o=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},es=function(){function e(){}return e.encodeBytes=function(t){return e.encode(t,e.DEFAULT_EC_PERCENT,e.DEFAULT_AZTEC_LAYERS)},e.encode=function(t,n,r){var i=new Qo(t).encode(),a=A.truncDivision(i.getSize()*n,100)+11,o=i.getSize()+a,s,c,l,u,d;if(r!==e.DEFAULT_AZTEC_LAYERS){if(s=r<0,c=Math.abs(r),c>(s?e.MAX_NB_BITS_COMPACT:e.MAX_NB_BITS))throw new D(P.format(`Illegal value %s for layers`,r));l=e.totalBitsInLayer(c,s),u=e.WORD_SIZE[c];var f=l-l%u;if(d=e.stuffBits(i,u),d.getSize()+a>f||s&&d.getSize()>u*64)throw new D(`Data to large for user specified layer`)}else{u=0,d=null;for(var p=0;;p++){if(p>e.MAX_NB_BITS)throw new D(`Data too large for an Aztec code`);if(s=p<=3,c=s?p+1:p,l=e.totalBitsInLayer(c,s),!(o>l)){(d==null||u!==e.WORD_SIZE[c])&&(u=e.WORD_SIZE[c],d=e.stuffBits(i,u));var f=l-l%u;if(!(s&&d.getSize()>u*64)&&d.getSize()+a<=f)break}}}var m=e.generateCheckWords(d,l,u),h=d.getSize()/u,g=e.generateModeMessage(s,c,h),_=(s?11:14)+c*4,v=new Int32Array(_),y;if(s){y=_;for(var p=0;p<v.length;p++)v[p]=p}else{y=_+1+2*A.truncDivision(A.truncDivision(_,2)-1,15);for(var b=A.truncDivision(_,2),x=A.truncDivision(y,2),p=0;p<b;p++){var S=p+A.truncDivision(p,15);v[b-p-1]=x-S-1,v[b+p]=x+S+1}}for(var C=new Pe(y),p=0,w=0;p<c;p++){for(var T=(c-p)*4+(s?9:12),E=0;E<T;E++)for(var ee=E*2,te=0;te<2;te++)m.get(w+ee+te)&&C.set(v[p*2+te],v[p*2+E]),m.get(w+T*2+ee+te)&&C.set(v[p*2+E],v[_-1-p*2-te]),m.get(w+T*4+ee+te)&&C.set(v[_-1-p*2-te],v[_-1-p*2-E]),m.get(w+T*6+ee+te)&&C.set(v[_-1-p*2-E],v[p*2+te]);w+=T*8}if(e.drawModeMessage(C,s,y,g),s)e.drawBullsEye(C,A.truncDivision(y,2),5);else{e.drawBullsEye(C,A.truncDivision(y,2),7);for(var p=0,E=0;p<A.truncDivision(_,2)-1;p+=15,E+=16)for(var te=A.truncDivision(y,2)&1;te<y;te+=2)C.set(A.truncDivision(y,2)-E,te),C.set(A.truncDivision(y,2)+E,te),C.set(te,A.truncDivision(y,2)-E),C.set(te,A.truncDivision(y,2)+E)}var ne=new Mo;return ne.setCompact(s),ne.setSize(y),ne.setLayers(c),ne.setCodeWords(h),ne.setMatrix(C),ne},e.drawBullsEye=function(e,t,n){for(var r=0;r<n;r+=2)for(var i=t-r;i<=t+r;i++)e.set(i,t-r),e.set(i,t+r),e.set(t-r,i),e.set(t+r,i);e.set(t-n,t-n),e.set(t-n+1,t-n),e.set(t-n,t-n+1),e.set(t+n,t-n),e.set(t+n,t-n+1),e.set(t+n,t+n-1)},e.generateModeMessage=function(t,n,r){var i=new Ee;return t?(i.appendBits(n-1,2),i.appendBits(r-1,6),i=e.generateCheckWords(i,28,4)):(i.appendBits(n-1,5),i.appendBits(r-1,11),i=e.generateCheckWords(i,40,4)),i},e.drawModeMessage=function(e,t,n,r){var i=A.truncDivision(n,2);if(t)for(var a=0;a<7;a++){var o=i-3+a;r.get(a)&&e.set(o,i-5),r.get(a+7)&&e.set(i+5,o),r.get(20-a)&&e.set(o,i+5),r.get(27-a)&&e.set(i-5,o)}else for(var a=0;a<10;a++){var o=i-5+a+A.truncDivision(a,5);r.get(a)&&e.set(o,i-7),r.get(a+10)&&e.set(i+7,o),r.get(29-a)&&e.set(o,i+7),r.get(39-a)&&e.set(i-7,o)}},e.generateCheckWords=function(t,n,r){var i,a,o=t.getSize()/r,s=new ja(e.getGF(r)),c=A.truncDivision(n,r),l=e.bitsToWords(t,r,c);s.encode(l,c-o);var u=n%r,d=new Ee;d.appendBits(0,u);try{for(var f=$o(Array.from(l)),p=f.next();!p.done;p=f.next()){var m=p.value;d.appendBits(m,r)}}catch(e){i={error:e}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}return d},e.bitsToWords=function(e,t,n){for(var r=new Int32Array(n),i=0,a=e.getSize()/t;i<a;i++){for(var o=0,s=0;s<t;s++)o|=e.get(i*t+s)?1<<t-s-1:0;r[i]=o}return r},e.getGF=function(e){switch(e){case 4:return ot.AZTEC_PARAM;case 6:return ot.AZTEC_DATA_6;case 8:return ot.AZTEC_DATA_8;case 10:return ot.AZTEC_DATA_10;case 12:return ot.AZTEC_DATA_12;default:throw new D(`Unsupported word size `+e)}},e.stuffBits=function(e,t){for(var n=new Ee,r=e.getSize(),i=(1<<t)-2,a=0;a<r;a+=t){for(var o=0,s=0;s<t;s++)(a+s>=r||e.get(a+s))&&(o|=1<<t-1-s);(o&i)===i?(n.appendBits(o&i,t),a--):(o&i)===0?(n.appendBits(o|1,t),a--):n.appendBits(o,t)}return n},e.totalBitsInLayer=function(e,t){return((t?88:112)+16*e)*e},e.DEFAULT_EC_PERCENT=33,e.DEFAULT_AZTEC_LAYERS=0,e.MAX_NB_BITS=32,e.MAX_NB_BITS_COMPACT=4,e.WORD_SIZE=Int32Array.from([4,6,6,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12]),e}();(function(){function e(){}return e.prototype.encode=function(e,t,n,r){return this.encodeWithHints(e,t,n,r,null)},e.prototype.encodeWithHints=function(t,n,r,i,a){var o=Ka.ISO_8859_1,s=es.DEFAULT_EC_PERCENT,c=es.DEFAULT_AZTEC_LAYERS;return a!=null&&(a.has(q.CHARACTER_SET)&&(o=Ga.forName(a.get(q.CHARACTER_SET).toString())),a.has(q.ERROR_CORRECTION)&&(s=A.parseInt(a.get(q.ERROR_CORRECTION).toString())),a.has(q.AZTEC_LAYERS)&&(c=A.parseInt(a.get(q.AZTEC_LAYERS).toString()))),e.encodeLayers(t,n,r,i,o,s,c)},e.encodeLayers=function(t,n,r,i,a,o,s){if(n!==L.AZTEC)throw new D(`Can only encode AZTEC, but got `+n);var c=es.encode(P.getBytes(t,a),o,s);return e.renderResult(c,r,i)},e.renderResult=function(e,t,n){var r=e.getMatrix();if(r==null)throw new ut;for(var i=r.getWidth(),a=r.getHeight(),o=Math.max(t,i),s=Math.max(n,a),c=Math.min(o/i,s/a),l=(o-i*c)/2,u=(s-a*c)/2,d=new Pe(o,s),f=0,p=u;f<a;f++,p+=c)for(var m=0,h=l;m<i;m++,h+=c)r.get(m,f)&&d.setRegion(h,p,c,c);return d},e})();var ts=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ns=function(e){ts(t,e);function t(n){var r=e.call(this,n.width,n.height)||this;return r.canvas=n,r.buffer=t.makeBufferFromCanvasImageData(n),r}return t.makeBufferFromCanvasImageData=function(e){var n;try{n=e.getContext(`2d`,{willReadFrequently:!0})}catch{n=e.getContext(`2d`)}if(!n)throw Error(`Couldn't get canvas context.`);var r=n.getImageData(0,0,e.width,e.height);return t.toGrayscaleBuffer(r.data,e.width,e.height)},t.toGrayscaleBuffer=function(e,t,n){for(var r=new Uint8ClampedArray(t*n),i=0,a=0,o=e.length;i<o;i+=4,a++){var s=void 0;if(e[i+3]===0)s=255;else{var c=e[i],l=e[i+1],u=e[i+2];s=306*c+601*l+117*u+512>>10}r[a]=s}return r},t.prototype.getRow=function(e,t){if(e<0||e>=this.getHeight())throw new D(`Requested row is outside the image: `+e);var n=this.getWidth(),r=e*n;return t===null?t=this.buffer.slice(r,r+n):(t.length<n&&(t=new Uint8ClampedArray(n)),t.set(this.buffer.slice(r,r+n))),t},t.prototype.getMatrix=function(){return this.buffer},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(t,n,r,i){return e.prototype.crop.call(this,t,n,r,i),this},t.prototype.isRotateSupported=function(){return!0},t.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},t.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},t.prototype.invert=function(){return new He(this)},t.prototype.getTempCanvasElement=function(){if(this.tempCanvasElement===null){var e=this.canvas.ownerDocument.createElement(`canvas`);e.width=this.canvas.width,e.height=this.canvas.height,this.tempCanvasElement=e}return this.tempCanvasElement},t.prototype.rotate=function(e){var n=this.getTempCanvasElement();if(!n)throw Error(`Could not create a Canvas element.`);var r=e*t.DEGREE_TO_RADIANS,i=this.canvas.width,a=this.canvas.height,o=Math.ceil(Math.abs(Math.cos(r))*i+Math.abs(Math.sin(r))*a),s=Math.ceil(Math.abs(Math.sin(r))*i+Math.abs(Math.cos(r))*a);n.width=o,n.height=s;var c=n.getContext(`2d`);if(!c)throw Error(`Could not create a Canvas Context element.`);return c.translate(o/2,s/2),c.rotate(r),c.drawImage(this.canvas,i/-2,a/-2),this.buffer=t.makeBufferFromCanvasImageData(n),this},t.DEGREE_TO_RADIANS=Math.PI/180,t}(Be);function rs(){return typeof navigator<`u`}function is(){return rs()&&!!navigator.mediaDevices}function as(){return!!(is()&&navigator.mediaDevices.enumerateDevices)}var os=function(){return os=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},os.apply(this,arguments)},Q=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},$=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}},ss=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},cs={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},ls=function(){function e(e,t,n){t===void 0&&(t=new Map),n===void 0&&(n={}),this.reader=e,this.hints=t,this.options=os(os({},cs),n)}return Object.defineProperty(e.prototype,"possibleFormats",{set:function(e){this.hints.set(j.POSSIBLE_FORMATS,e)},enumerable:!1,configurable:!0}),e.addVideoSource=function(e,t){try{e.srcObject=t}catch{console.error(`got interrupted by new loading request`)}},e.mediaStreamSetTorch=function(e,t){return Q(this,void 0,void 0,function(){return $(this,function(n){switch(n.label){case 0:return[4,e.applyConstraints({advanced:[{fillLightMode:t?`flash`:`off`,torch:t}]})];case 1:return n.sent(),[2]}})})},e.mediaStreamIsTorchCompatible=function(t){var n,r,i=t.getVideoTracks();try{for(var a=ss(i),o=a.next();!o.done;o=a.next()){var s=o.value;if(e.mediaStreamIsTorchCompatibleTrack(s))return!0}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return!1},e.mediaStreamIsTorchCompatibleTrack=function(e){try{return`torch`in e.getCapabilities()}catch(e){return console.error(e),console.warn(`Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available.`),!1}},e.isVideoPlaying=function(e){return e.currentTime>0&&!e.paused&&e.readyState>2},e.getMediaElement=function(e,t){var n=document.getElementById(e);if(!n)throw new he(`element with id '${e}' not found`);if(n.nodeName.toLowerCase()!==t.toLowerCase())throw new he(`element with id '${e}' must be an ${t} element`);return n},e.createVideoElement=function(t){if(t instanceof HTMLVideoElement)return t;if(typeof t==`string`)return e.getMediaElement(t,`video`);if(!t&&typeof document<`u`){var n=document.createElement(`video`);return n.width=200,n.height=200,n}throw Error(`Couldn't get videoElement from videoSource!`)},e.prepareImageElement=function(t){if(t instanceof HTMLImageElement)return t;if(typeof t==`string`)return e.getMediaElement(t,`img`);if(t===void 0){var n=document.createElement(`img`);return n.width=200,n.height=200,n}throw Error(`Couldn't get imageElement from imageSource!`)},e.prepareVideoElement=function(t){var n=e.createVideoElement(t);return n.setAttribute(`autoplay`,`true`),n.setAttribute(`muted`,`true`),n.setAttribute(`playsinline`,`true`),n},e.isImageLoaded=function(e){return!(!e.complete||e.naturalWidth===0)},e.createBinaryBitmapFromCanvas=function(e){return new _e(new ze(new ns(e)))},e.drawImageOnCanvas=function(e,t){e.drawImage(t,0,0)},e.getMediaElementDimensions=function(e){if(e instanceof HTMLVideoElement)return{height:e.videoHeight,width:e.videoWidth};if(e instanceof HTMLImageElement)return{height:e.naturalHeight||e.height,width:e.naturalWidth||e.width};throw Error(`Couldn't find the Source's dimensions!`)},e.createCaptureCanvas=function(t){if(!t)throw new he(`Cannot create a capture canvas without a media element.`);if(typeof document>`u`)throw Error(`The page "Document" is undefined, make sure you're running in a browser.`);var n=document.createElement(`canvas`),r=e.getMediaElementDimensions(t),i=r.width,a=r.height;return n.style.width=i+`px`,n.style.height=a+`px`,n.width=i,n.height=a,n},e.tryPlayVideo=function(t){return Q(this,void 0,void 0,function(){var n;return $(this,function(r){switch(r.label){case 0:if(t?.ended)return console.error(`Trying to play video that has ended.`),[2,!1];if(e.isVideoPlaying(t))return console.warn(`Trying to play video that is already playing.`),[2,!0];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,t.play()];case 2:return r.sent(),[2,!0];case 3:return n=r.sent(),console.warn(`It was not possible to play the video.`,n),[2,!1];case 4:return[2]}})})},e.createCanvasFromMediaElement=function(t){var n=e.createCaptureCanvas(t),r=n.getContext(`2d`);if(!r)throw Error(`Couldn't find Canvas 2D Context.`);return e.drawImageOnCanvas(r,t),n},e.createBinaryBitmapFromMediaElem=function(t){var n=e.createCanvasFromMediaElement(t);return e.createBinaryBitmapFromCanvas(n)},e.destroyImageElement=function(e){e.src=``,e.removeAttribute(`src`)},e.listVideoInputDevices=function(){return Q(this,void 0,void 0,function(){var e,t,n,r,i,a,o,s,c,l,u,d;return $(this,function(f){switch(f.label){case 0:if(!rs())throw Error(`Can't enumerate devices, navigator is not present.`);if(!as())throw Error(`Can't enumerate devices, method not supported.`);return[4,navigator.mediaDevices.enumerateDevices()];case 1:e=f.sent(),t=[];try{for(n=ss(e),r=n.next();!r.done;r=n.next())i=r.value,a=i.kind===`video`?`videoinput`:i.kind,a===`videoinput`&&(o=i.deviceId||i.id,s=i.label||`Video device ${t.length+1}`,c=i.groupId,l={deviceId:o,label:s,kind:a,groupId:c},t.push(l))}catch(e){u={error:e}}finally{try{r&&!r.done&&(d=n.return)&&d.call(n)}finally{if(u)throw u.error}}return[2,t]}})})},e.findDeviceById=function(t){return Q(this,void 0,void 0,function(){var n;return $(this,function(r){switch(r.label){case 0:return[4,e.listVideoInputDevices()];case 1:return n=r.sent(),n?[2,n.find(function(e){return e.deviceId===t})]:[2]}})})},e.cleanVideoSource=function(e){if(e){try{e.srcObject=null}catch{e.src=``}e&&e.removeAttribute(`src`)}},e.releaseAllStreams=function(){e.streamTracker.length!==0&&e.streamTracker.forEach(function(e){e.getTracks().forEach(function(e){return e.stop()})}),e.streamTracker=[]},e.playVideoOnLoadAsync=function(t,n){return Q(this,void 0,void 0,function(){var r;return $(this,function(i){switch(i.label){case 0:return[4,e.tryPlayVideo(t)];case 1:return r=i.sent(),r?[2,!0]:[2,new Promise(function(r,i){var a=setTimeout(function(){e.isVideoPlaying(t)||(i(!1),t.removeEventListener(`canplay`,o))},n),o=function(){e.tryPlayVideo(t).then(function(e){clearTimeout(a),t.removeEventListener(`canplay`,o),r(e)})};t.addEventListener(`canplay`,o)})]}})})},e.attachStreamToVideo=function(t,n){return Q(this,arguments,void 0,function(t,n,r){var i;return r===void 0&&(r=5e3),$(this,function(a){switch(a.label){case 0:return i=e.prepareVideoElement(n),e.addVideoSource(i,t),[4,e.playVideoOnLoadAsync(i,r)];case 1:return a.sent(),[2,i]}})})},e._waitImageLoad=function(t){return new Promise(function(n,r){var i=setTimeout(function(){e.isImageLoaded(t)||(t.removeEventListener(`load`,a),r())},1e4),a=function(){clearTimeout(i),t.removeEventListener(`load`,a),n()};t.addEventListener(`load`,a)})},e.checkCallbackFnOrThrow=function(e){if(!e)throw new he("`callbackFn` is a required parameter, you cannot capture results without it.")},e.disposeMediaStream=function(e){e.getVideoTracks().forEach(function(e){return e.stop()})},e.prototype.decode=function(t){var n=e.createCanvasFromMediaElement(t);return this.decodeFromCanvas(n)},e.prototype.decodeBitmap=function(e){return this.reader.decode(e,this.hints)},e.prototype.decodeFromCanvas=function(t){var n=e.createBinaryBitmapFromCanvas(t);return this.decodeBitmap(n)},e.prototype.decodeFromImageElement=function(t){return Q(this,void 0,void 0,function(){var n;return $(this,function(r){switch(r.label){case 0:if(!t)throw new he(`An image element must be provided.`);return n=e.prepareImageElement(t),[4,this._decodeOnLoadImage(n)];case 1:return[2,r.sent()]}})})},e.prototype.decodeFromImageUrl=function(t){return Q(this,void 0,void 0,function(){var n;return $(this,function(r){switch(r.label){case 0:if(!t)throw new he(`An URL must be provided.`);n=e.prepareImageElement(),n.src=t,r.label=1;case 1:return r.trys.push([1,,3,4]),[4,this.decodeFromImageElement(n)];case 2:return[2,r.sent()];case 3:return e.destroyImageElement(n),[7];case 4:return[2]}})})},e.prototype.decodeFromConstraints=function(t,n,r){return Q(this,void 0,void 0,function(){var i,a;return $(this,function(o){switch(o.label){case 0:return e.checkCallbackFnOrThrow(r),[4,this.getUserMedia(t)];case 1:i=o.sent(),o.label=2;case 2:return o.trys.push([2,4,,5]),[4,this.decodeFromStream(i,n,r)];case 3:return[2,o.sent()];case 4:throw a=o.sent(),e.disposeMediaStream(i),a;case 5:return[2]}})})},e.prototype.decodeFromStream=function(t,n,r){return Q(this,void 0,void 0,function(){var i,a,o,s,c,l,u,d,f,p=this;return $(this,function(m){switch(m.label){case 0:return e.checkCallbackFnOrThrow(r),i=this.options.tryPlayVideoTimeout,[4,e.attachStreamToVideo(t,n,i)];case 1:return a=m.sent(),o=function(){e.disposeMediaStream(t),e.cleanVideoSource(a)},s=this.scan(a,r,o),c=t.getVideoTracks(),l=os(os({},s),{stop:function(){s.stop()},streamVideoConstraintsApply:function(e,t){return Q(this,void 0,void 0,function(){var n,r,i,a,o,s,l;return $(this,function(u){switch(u.label){case 0:n=t?c.filter(t):c,u.label=1;case 1:u.trys.push([1,6,7,8]),r=ss(n),i=r.next(),u.label=2;case 2:return i.done?[3,5]:(a=i.value,[4,a.applyConstraints(e)]);case 3:u.sent(),u.label=4;case 4:return i=r.next(),[3,2];case 5:return[3,8];case 6:return o=u.sent(),s={error:o},[3,8];case 7:try{i&&!i.done&&(l=r.return)&&l.call(r)}finally{if(s)throw s.error}return[7];case 8:return[2]}})})},streamVideoConstraintsGet:function(e){return c.find(e).getConstraints()},streamVideoSettingsGet:function(e){return c.find(e).getSettings()},streamVideoCapabilitiesGet:function(e){return c.find(e).getCapabilities()}}),u=e.mediaStreamIsTorchCompatible(t),u&&(d=c?.find(function(t){return e.mediaStreamIsTorchCompatibleTrack(t)}),f=function(t){return Q(p,void 0,void 0,function(){return $(this,function(n){switch(n.label){case 0:return[4,e.mediaStreamSetTorch(d,t)];case 1:return n.sent(),[2]}})})},l.switchTorch=f,l.stop=function(){return Q(p,void 0,void 0,function(){return $(this,function(e){switch(e.label){case 0:return s.stop(),[4,f(!1)];case 1:return e.sent(),[2]}})})}),[2,l]}})})},e.prototype.decodeFromVideoDevice=function(t,n,r){return Q(this,void 0,void 0,function(){var i,a;return $(this,function(o){switch(o.label){case 0:return e.checkCallbackFnOrThrow(r),i=t?{deviceId:{exact:t}}:{facingMode:`environment`},a={video:i},[4,this.decodeFromConstraints(a,n,r)];case 1:return[2,o.sent()]}})})},e.prototype.decodeFromVideoElement=function(t,n){return Q(this,void 0,void 0,function(){var r,i;return $(this,function(a){switch(a.label){case 0:if(e.checkCallbackFnOrThrow(n),!t)throw new he(`A video element must be provided.`);return r=e.prepareVideoElement(t),i=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(r,i)];case 1:return a.sent(),[2,this.scan(r,n)]}})})},e.prototype.decodeFromVideoUrl=function(t,n){return Q(this,void 0,void 0,function(){var r,i,a,o;return $(this,function(s){switch(s.label){case 0:if(e.checkCallbackFnOrThrow(n),!t)throw new he(`An URL must be provided.`);return r=e.prepareVideoElement(),r.src=t,i=function(){e.cleanVideoSource(r)},a=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(r,a)];case 1:return s.sent(),o=this.scan(r,n,i),[2,o]}})})},e.prototype.decodeOnceFromConstraints=function(e,t){return Q(this,void 0,void 0,function(){var n;return $(this,function(r){switch(r.label){case 0:return[4,this.getUserMedia(e)];case 1:return n=r.sent(),[4,this.decodeOnceFromStream(n,t)];case 2:return[2,r.sent()]}})})},e.prototype.decodeOnceFromStream=function(t,n){return Q(this,void 0,void 0,function(){var r,i,a;return $(this,function(o){switch(o.label){case 0:return r=!!n,[4,e.attachStreamToVideo(t,n)];case 1:i=o.sent(),o.label=2;case 2:return o.trys.push([2,,4,5]),[4,this.scanOneResult(i)];case 3:return a=o.sent(),[2,a];case 4:return r||e.cleanVideoSource(i),[7];case 5:return[2]}})})},e.prototype.decodeOnceFromVideoDevice=function(e,t){return Q(this,void 0,void 0,function(){var n,r;return $(this,function(i){switch(i.label){case 0:return n=e?{deviceId:{exact:e}}:{facingMode:`environment`},r={video:n},[4,this.decodeOnceFromConstraints(r,t)];case 1:return[2,i.sent()]}})})},e.prototype.decodeOnceFromVideoElement=function(t){return Q(this,void 0,void 0,function(){var n,r;return $(this,function(i){switch(i.label){case 0:if(!t)throw new he(`A video element must be provided.`);return n=e.prepareVideoElement(t),r=this.options.tryPlayVideoTimeout,[4,e.playVideoOnLoadAsync(n,r)];case 1:return i.sent(),[4,this.scanOneResult(n)];case 2:return[2,i.sent()]}})})},e.prototype.decodeOnceFromVideoUrl=function(t){return Q(this,void 0,void 0,function(){var n,r;return $(this,function(i){switch(i.label){case 0:if(!t)throw new he(`An URL must be provided.`);n=e.prepareVideoElement(),n.src=t,r=this.decodeOnceFromVideoElement(n),i.label=1;case 1:return i.trys.push([1,,3,4]),[4,r];case 2:return[2,i.sent()];case 3:return e.cleanVideoSource(n),[7];case 4:return[2]}})})},e.prototype.scanOneResult=function(e,t,n,r){var i=this;return t===void 0&&(t=!0),n===void 0&&(n=!0),r===void 0&&(r=!0),new Promise(function(a,o){i.scan(e,function(e,i,s){if(e)a(e),s.stop();else if(i){if(i instanceof I&&t||i instanceof O&&n||i instanceof M&&r)return;s.stop(),o(i)}})})},e.prototype.scan=function(t,n,r){var i=this;e.checkCallbackFnOrThrow(n);var a=e.createCaptureCanvas(t),o;try{o=a.getContext(`2d`,{willReadFrequently:!0})}catch{o=a.getContext(`2d`)}if(!o)throw Error(`Couldn't create canvas for visual element scan.`);var s=function(){o=void 0,a=void 0},c=!1,l,u={stop:function(){c=!0,clearTimeout(l),s(),r&&r()}},d=function(){if(!c)try{e.drawImageOnCanvas(o,t),n(i.decodeFromCanvas(a),void 0,u),l=setTimeout(d,i.options.delayBetweenScanSuccess)}catch(e){n(void 0,e,u);var f=e instanceof O,p=e instanceof M,m=e instanceof I;if(f||p||m){l=setTimeout(d,i.options.delayBetweenScanAttempts);return}s(),r&&r(e)}};return d(),u},e.prototype._decodeOnLoadImage=function(t){return Q(this,void 0,void 0,function(){var n;return $(this,function(r){switch(r.label){case 0:return n=e.isImageLoaded(t),n?[3,2]:[4,e._waitImageLoad(t)];case 1:r.sent(),r.label=2;case 2:return[2,this.decode(t)]}})})},e.prototype.getUserMedia=function(t){return Q(this,void 0,void 0,function(){var n;return $(this,function(r){switch(r.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return n=r.sent(),e.streamTracker.push(n),[2,n]}})})},e.streamTracker=[],e}(),us=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){us(t,e);function t(t,n){return e.call(this,new Et,t,n)||this}return t})(ls);var ds=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){ds(t,e);function t(t,n){return e.call(this,new Tr(t),t,n)||this}return t})(ls);var fs=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){fs(t,e);function t(t,n){return e.call(this,new Rr,t,n)||this}return t})(ls);var ps=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){ps(t,e);function t(t,n){var r=this,i=new Ea;return i.setHints(t),r=e.call(this,i,t,n)||this,r.reader=i,r}return Object.defineProperty(t.prototype,"possibleFormats",{set:function(e){this.hints.set(j.POSSIBLE_FORMATS,e),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),t.prototype.decodeBitmap=function(e){return this.reader.decodeWithState(e)},t.prototype.setHints=function(e){this.hints=e,this.reader.setHints(this.hints)},t})(ls);var ms=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(e){ms(t,e);function t(t,n){return e.call(this,new Sa,t,n)||this}return t})(ls);var hs=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),gs=function(e){hs(t,e);function t(t,n){return e.call(this,new pi,t,n)||this}return t}(ls),_s=`http://www.w3.org/2000/svg`;(function(){function e(e){if(typeof e==`string`){var t=document.getElementById(e);if(!t)throw Error(`Could not find a Container element with '${e}'.`);this.containerElement=t}else this.containerElement=e}return e.prototype.write=function(t,n,r,i){if(t.length===0)throw new D(`Found empty contents`);if(n<0||r<0)throw new D(`Requested dimensions are too small: `+n+`x`+r);var a=i&&i.get(q.MARGIN)!==void 0?Number.parseInt(i.get(q.MARGIN).toString(),10):e.QUIET_ZONE_SIZE,o=this.encode(i,t);return this.renderResult(o,n,r,a)},e.prototype.createSVGElement=function(t,n){var r=document.createElementNS(e.SVG_NS,`svg`);return r.setAttributeNS(_s,`width`,n.toString()),r.setAttributeNS(_s,`height`,t.toString()),r},e.prototype.createSvgPathPlaceholderElement=function(t,n){var r=document.createElementNS(e.SVG_NS,`path`);return r.setAttributeNS(_s,`d`,`M0 0h${t}v${n}H0z`),r.setAttributeNS(_s,`fill`,`none`),r},e.prototype.createSvgRectElement=function(t,n,r,i){var a=document.createElementNS(e.SVG_NS,`rect`);return a.setAttributeNS(_s,`x`,t.toString()),a.setAttributeNS(_s,`y`,n.toString()),a.setAttributeNS(_s,`height`,r.toString()),a.setAttributeNS(_s,`width`,i.toString()),a.setAttributeNS(_s,`fill`,`#000000`),a},e.prototype.encode=function(e,t){var n=Vr.L;if(e&&e.get(q.ERROR_CORRECTION)!==void 0){var r=e.get(q.ERROR_CORRECTION).toString();n=Vr.fromString(r)}return Ba.encode(t,n,e)},e.prototype.renderResult=function(e,t,n,r){var i=e.getMatrix();if(i===null)throw new ut;var a=i.getWidth(),o=i.getHeight(),s=a+r*2,c=o+r*2,l=Math.max(t,s),u=Math.max(n,c),d=Math.min(Math.floor(l/s),Math.floor(u/c)),f=Math.floor((l-a*d)/2),p=Math.floor((u-o*d)/2),m=this.createSVGElement(l,u),h=this.createSvgPathPlaceholderElement(t,n);m.appendChild(h),this.containerElement.appendChild(m);for(var g=0,_=p;g<o;g++,_+=d)for(var v=0,y=f;v<a;v++,y+=d)if(i.get(v,g)===1){var b=this.createSvgRectElement(y,_,d,d);m.appendChild(b)}return m},e.QUIET_ZONE_SIZE=4,e.SVG_NS=`http://www.w3.org/2000/svg`,e})();var vs=`http://www.w3.org/2000/svg`;(function(){function e(){}return e.prototype.write=function(t,n,r,i){if(t.length===0)throw new D(`Found empty contents`);if(n<0||r<0)throw new D(`Requested dimensions are too small: `+n+`x`+r);var a=Vr.L,o=e.QUIET_ZONE_SIZE;if(i){if(i.get(q.ERROR_CORRECTION)!==void 0){var s=i.get(q.ERROR_CORRECTION).toString();a=Vr.fromString(s)}i.get(q.MARGIN)!==void 0&&(o=Number.parseInt(i.get(q.MARGIN).toString(),10))}var c=Ba.encode(t,a,i);return this.renderResult(c,n,r,o)},e.prototype.writeToDom=function(e,t,n,r,i){if(typeof e==`string`){var a=document.querySelector(e);if(!a)throw Error(`Could no find the target HTML element.`);e=a}var o=this.write(t,n,r,i);e instanceof HTMLElement&&e.appendChild(o)},e.prototype.renderResult=function(e,t,n,r){var i=e.getMatrix();if(i===null)throw new ut;for(var a=i.getWidth(),o=i.getHeight(),s=a+r*2,c=o+r*2,l=Math.max(t,s),u=Math.max(n,c),d=Math.min(Math.floor(l/s),Math.floor(u/c)),f=Math.floor((l-a*d)/2),p=Math.floor((u-o*d)/2),m=this.createSVGElement(l,u),h=0,g=p;h<o;h++,g+=d)for(var _=0,v=f;_<a;_++,v+=d)if(i.get(_,h)===1){var y=this.createSvgRectElement(v,g,d,d);m.appendChild(y)}return m},e.prototype.createSVGElement=function(e,t){var n=document.createElementNS(vs,`svg`),r=e.toString(),i=t.toString();return n.setAttribute(`height`,i),n.setAttribute(`width`,r),n.setAttribute(`viewBox`,`0 0 `+r+` `+i),n},e.prototype.createSvgRectElement=function(e,t,n,r){var i=document.createElementNS(vs,`rect`);return i.setAttribute(`x`,e.toString()),i.setAttribute(`y`,t.toString()),i.setAttribute(`height`,n.toString()),i.setAttribute(`width`,r.toString()),i.setAttribute(`fill`,`#000000`),i},e.QUIET_ZONE_SIZE=4,e})();var ys=new Set([`NotFoundException`,`ChecksumException`,`FormatException`]),bs={audio:!1,video:{facingMode:{ideal:`environment`},width:{ideal:1920},height:{ideal:1080}}};function xs(e,t){t?.stop();let n=e.srcObject;if(n instanceof MediaStream)for(let e of n.getTracks())e.stop();e.srcObject=null}async function Ss(e,t,n){e.playsInline=!0,e.muted=!0;let r=new gs,i,a=!1,o=()=>{a||(a=!0,xs(e,i))};try{i=await r.decodeFromConstraints(bs,e,(e,r,s)=>{if(i??=s,!a){if(e!==void 0){let n=e.getText();o(),t(n)}else r!==void 0&&!ys.has(r.getKind())&&(o(),n(r instanceof Error?r:Error(String(r))))}})}catch(e){throw o(),e instanceof Error?e:Error(String(e))}return{stop:o}}var Cs=`po:plugin-fetch`,ws=`po:plugin-fetch-result`;function Ts(e){if(typeof e!=`object`||!e)return;let t=e;if(t.type===Cs&&Number.isSafeInteger(t.requestId)&&typeof t.path==`string`&&t.path.startsWith(`/api/web-plugins/`))return t}async function Es(e,t){try{let n=await w.fetch(t.path,{cache:`no-store`,credentials:`include`}),r=await n.arrayBuffer();e.postMessage({type:ws,requestId:t.requestId,ok:!0,status:n.status,headers:[...n.headers.entries()],body:r},[r])}catch(n){e.postMessage({type:ws,requestId:t.requestId,ok:!1,message:n instanceof Error?n.message:String(n)})}}function Ds(e){return typeof e!=`object`||!e||!(`ok`in e)||typeof e.ok!=`boolean`?!1:e.ok?!(`revision`in e)||typeof e.revision==`number`:`code`in e&&typeof e.code==`string`&&`message`in e&&typeof e.message==`string`}async function Os(){if(!(`serviceWorker`in navigator))throw Error(`The trusted service worker is unavailable.`);let e,t=await Promise.race([navigator.serviceWorker.ready,new Promise((t,n)=>{e=setTimeout(()=>n(Error(`The trusted service worker is not ready.`)),1e4)})]).finally(()=>clearTimeout(e)),n=t.active??t.waiting??t.installing;if(n===null)throw Error(`The trusted service worker is unavailable.`);return n}async function ks(e){let t=await Os(),n=new MessageChannel;return await new Promise(r=>{let i=window.setTimeout(()=>{n.port1.close(),r({ok:!1,code:`worker-timeout`,message:`The trusted service worker did not answer.`})},12e4);n.port1.addEventListener(`message`,e=>{if(typeof e.data==`object`&&e.data!==null&&e.data.type===Cs){let t=Ts(e.data);if(t!==void 0)Es(n.port1,t);else{let t=e.data.requestId;n.port1.postMessage({type:ws,requestId:Number.isSafeInteger(t)?t:-1,ok:!1,message:`The trusted service worker requested an invalid plugin path.`})}}else window.clearTimeout(i),n.port1.close(),r(Ds(e.data)?e.data:{ok:!1,code:`invalid-worker-response`,message:`The trusted service worker returned invalid data.`})}),n.port1.start(),t.postMessage(e,[n.port2])})}async function As(e){return await ks({type:`po:activate-bundle`,...e})}var js=`/pair`,Ms=[`c`,`k`,`s`,`r`];function Ns(e){let t=document.getElementById(e);if(!(t instanceof HTMLElement))throw Error(`The PWA shell is missing #${e}.`);return t}function Ps(e){if(!/^[1-9][0-9]*$/u.test(e))return;let t=Number(e);return Number.isSafeInteger(t)?t:void 0}function Fs(e,t=window.location.origin){let n;try{n=new URL(e)}catch{return}if(n.origin!==t||n.pathname!==js||n.search!==``)return;let r=new URLSearchParams(n.hash.slice(1));if(Ms.some(e=>r.get(e)===null))return;let i=r.get(`c`)??``,a=r.get(`k`)??``,o=r.get(`s`)??``,s=Ps(r.get(`r`)??``);if(/^[A-Za-z0-9_-]{20,512}$/u.test(i)&&/^[A-Za-z0-9_-]{40,512}$/u.test(a)&&/^[A-Za-z0-9_-]{80,512}$/u.test(o)&&s!==void 0)return{code:i,channelPublicKey:a,signerPublicKey:o,minimumRevision:s,url:n}}function Is(){if(!(`serviceWorker`in navigator))return`This browser does not support service workers.`;if(!(`crypto`in globalThis)||globalThis.crypto.subtle===void 0)return`This browser does not support WebCrypto.`;if(!(`indexedDB`in globalThis))return`This browser does not support durable PWA state.`;if(!(`caches`in globalThis))return`This browser does not support verified application caches.`;if(!navigator.mediaDevices?.getUserMedia)return`This browser does not support camera access.`}async function Ls(){let e=await navigator.serviceWorker.register(`/sw.js`,{scope:`/`});return await navigator.serviceWorker.ready,e}function Rs(e,t=`normal`){let n=Ns(`pwa-status`);n.textContent=e,n.dataset.tone=t}async function zs(){let e=Ns(`scan`),t=Ns(`cancel`),n=Ns(`camera`),r=Is();if(r!==void 0){e.disabled=!0,Rs(r,`bad`);return}try{await oe(),await Ls()}catch{e.disabled=!0,Rs(`The trusted service worker could not be installed.`,`bad`);return}window.addEventListener(`po:activate-bundle`,e=>{if(!(e instanceof CustomEvent))return;let t=e.detail;typeof t==`object`&&t&&`publicKey`in t&&typeof t.publicKey==`string`&&`minimumRevision`in t&&typeof t.minimumRevision==`number`&&As({publicKey:t.publicKey,minimumRevision:t.minimumRevision}).then(e=>{window.dispatchEvent(new CustomEvent(`po:bundle-activation-result`,{detail:e}))})});let i,a=()=>{i?.stop(),i=void 0,n.hidden=!0,t.hidden=!0,e.hidden=!1};e.addEventListener(`click`,async()=>{e.hidden=!0,t.hidden=!1,n.hidden=!1,Rs(`Point the camera at the QR code shown by Po.`);try{i=await Ss(n,e=>{let t=Fs(e);a(),t===void 0?Rs(`That QR code is not a pairing link for this Po origin.`,`bad`):(Rs(`Pairing link accepted. Opening secure setup.`,`good`),window.location.assign(t.url.href))},()=>{a(),Rs(`The QR code could not be read. Try again.`,`bad`)})}catch(e){a(),Rs(e instanceof DOMException&&e.name===`NotAllowedError`?`Camera permission was not granted.`:`The camera could not be started.`,`bad`)}}),t.addEventListener(`click`,()=>{a(),Rs(`Scanning cancelled.`)}),window.addEventListener(`pagehide`,a),document.addEventListener(`visibilitychange`,()=>{document.hidden&&a()}),Rs(`Ready to scan the pairing QR code.`)}zs();