9remote 3.0.34 → 3.0.40

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 (478) hide show
  1. package/dist/cli.cjs +163 -161
  2. package/dist/extension/background.js +137 -88
  3. package/dist/extension/manifest.json +6 -5
  4. package/dist/extension/runner.js +606 -0
  5. package/dist/ptyDaemon.cjs +2 -2
  6. package/dist/server.cjs +725 -517
  7. package/dist/ui/assets/index-D_C1NTm1.js +8 -0
  8. package/dist/ui/index.html +1 -1
  9. package/dist/web/404.html +1 -1
  10. package/dist/web/__next.__PAGE__.txt +4 -4
  11. package/dist/web/__next._full.txt +17 -17
  12. package/dist/web/__next._head.txt +4 -4
  13. package/dist/web/__next._index.txt +10 -10
  14. package/dist/web/__next._tree.txt +3 -3
  15. package/dist/web/_next/static/chunks/{0fb7b532.2e7a08a3edb2d789.js → 025762a4.c49f8207624e1667.js} +1 -1
  16. package/dist/web/_next/static/chunks/101.bfb3898573e4245d.js +1 -0
  17. package/dist/web/_next/static/chunks/1342.3d5707800ea67dcb.js +1 -0
  18. package/dist/web/_next/static/chunks/153.d7a869e0874f32e0.js +1 -0
  19. package/dist/web/_next/static/chunks/1561.8d395206716b3967.js +1 -0
  20. package/dist/web/_next/static/chunks/{4314.6bbd89507909cad1.js → 1599.ed9aa4b461112c1a.js} +1 -1
  21. package/dist/web/_next/static/chunks/1694.7c4e72f21d4ce34c.js +1 -0
  22. package/dist/web/_next/static/chunks/1772-ef73c166e83f5eff.js +1 -0
  23. package/dist/web/_next/static/chunks/1878.724a4af779f951aa.js +138 -0
  24. package/dist/web/_next/static/chunks/1879.0252e2bd9153348f.js +1 -0
  25. package/dist/web/_next/static/chunks/1920-5ead25286846df83.js +1 -0
  26. package/dist/web/_next/static/chunks/1968-4d2969f0b7112e0b.js +32 -0
  27. package/dist/web/_next/static/chunks/2004.f975891d8a569296.js +24 -0
  28. package/dist/web/_next/static/chunks/2094.05efbc3414828946.js +1 -0
  29. package/dist/web/_next/static/chunks/2209.2ee6023fed2ac7a5.js +1 -0
  30. package/dist/web/_next/static/chunks/236.88ef102773dd3a91.js +1 -0
  31. package/dist/web/_next/static/chunks/2369.22023f63f0eaf8db.js +1 -0
  32. package/dist/web/_next/static/chunks/{6420.bfa7bc86d03dcefc.js → 2401.73a0315a75c7b051.js} +1 -1
  33. package/dist/web/_next/static/chunks/2427.3a468cdfabd25124.js +1 -0
  34. package/dist/web/_next/static/chunks/2436.da0ef064f744b8af.js +115 -0
  35. package/dist/web/_next/static/chunks/2488.87361126358794fd.js +1 -0
  36. package/dist/web/_next/static/chunks/2561.6c8eb8cf71429d5d.js +36 -0
  37. package/dist/web/_next/static/chunks/2581.d09a7f19c64e4b97.js +1 -0
  38. package/dist/web/_next/static/chunks/{8044.5f87392585c9f3e4.js → 2615.86c58079ec7c597c.js} +1 -1
  39. package/dist/web/_next/static/chunks/2934.0caeb8b2d8b67139.js +1 -0
  40. package/dist/web/_next/static/chunks/{6274.a3795ca6dacb3d62.js → 3011.fc80a2aad3ef8778.js} +2 -2
  41. package/dist/web/_next/static/chunks/3255.3c96f02d5eb06783.js +23 -0
  42. package/dist/web/_next/static/chunks/3284.e56b0102fb9a3920.js +62 -0
  43. package/dist/web/_next/static/chunks/329-15d3e36af1b2827f.js +1 -0
  44. package/dist/web/_next/static/chunks/3301.1f7e2bd5ccb55064.js +1 -0
  45. package/dist/web/_next/static/chunks/3314.b5b5b3cca99d832e.js +1 -0
  46. package/dist/web/_next/static/chunks/{20154aaa.868648f838e03bf1.js → 33d0405b.71576a1f83124ecd.js} +1 -1
  47. package/dist/web/_next/static/chunks/3428.8818e0ef88c0e743.js +1 -0
  48. package/dist/web/_next/static/chunks/3443.8d771dadb470603c.js +1 -0
  49. package/dist/web/_next/static/chunks/3704.bf80aa0d55f950d0.js +1 -0
  50. package/dist/web/_next/static/chunks/3916.141fb720bd1eee40.js +148 -0
  51. package/dist/web/_next/static/chunks/3973.e5c2013e2abeefd3.js +93 -0
  52. package/dist/web/_next/static/chunks/4065.7616cbd8f37a68e6.js +1 -0
  53. package/dist/web/_next/static/chunks/4129.a93c19870036f647.js +1 -0
  54. package/dist/web/_next/static/chunks/{6730.88fc6f2ccc49496c.js → 4171.b0e5c6dc86bc8a5f.js} +1 -1
  55. package/dist/web/_next/static/chunks/4330.a8740b63075e6886.js +1 -0
  56. package/dist/web/_next/static/chunks/4378.a0629cfcbc20c406.js +1 -0
  57. package/dist/web/_next/static/chunks/4553.cad71717d538a2e5.js +1 -0
  58. package/dist/web/_next/static/chunks/4589.9bd287581ccd378b.js +1 -0
  59. package/dist/web/_next/static/chunks/4594.53636acacf285911.js +34 -0
  60. package/dist/web/_next/static/chunks/466.908e4592c2b93997.js +77 -0
  61. package/dist/web/_next/static/chunks/468.2e48222bf3517040.js +1 -0
  62. package/dist/web/_next/static/chunks/4712.b7062faa67f544b5.js +1 -0
  63. package/dist/web/_next/static/chunks/{9675.be4a175f92aa2f26.js → 4724.e0dffedb6972b738.js} +1 -1
  64. package/dist/web/_next/static/chunks/482.a0b5af31d7354a82.js +1 -0
  65. package/dist/web/_next/static/chunks/4929.fce0c23972476c66.js +1 -0
  66. package/dist/web/_next/static/chunks/4964.5a41b2d776aee556.js +1 -0
  67. package/dist/web/_next/static/chunks/499.cf81a39b9e6ce4a4.js +94 -0
  68. package/dist/web/_next/static/chunks/{0a7753a9.4cb02a98e2e453b9.js → 4ff7191e.d68cdd8504937de5.js} +1 -1
  69. package/dist/web/_next/static/chunks/5035.f7175d1037807b62.js +90 -0
  70. package/dist/web/_next/static/chunks/5198.b8e3a08cb60bc349.js +1 -0
  71. package/dist/web/_next/static/chunks/5421.430fa3a5488e15a9.js +21 -0
  72. package/dist/web/_next/static/chunks/{9871-c277aedb0437cb82.js → 556-a8f04c41c5663ee8.js} +1 -1
  73. package/dist/web/_next/static/chunks/5587-fc5af8c76df14222.js +1 -0
  74. package/dist/web/_next/static/chunks/5710.b055a101d6b51ff3.js +27 -0
  75. package/dist/web/_next/static/chunks/5714.122f8cb7296bc9e1.js +1 -0
  76. package/dist/web/_next/static/chunks/5757.2c157c0924cea1c2.js +1 -0
  77. package/dist/web/_next/static/chunks/{3346-23aafd4add63869a.js → 5957-3d5d92b58dcc7d4e.js} +1 -1
  78. package/dist/web/_next/static/chunks/{565f33a6-fd3410bd29f39fdf.js → 5b8e7b36-a2678128cd5bdf5e.js} +1 -1
  79. package/dist/web/_next/static/chunks/6141-132d206408947c60.js +1 -0
  80. package/dist/web/_next/static/chunks/{7424.c8c9f85c8ea65885.js → 6181.6bdde6f59e3f2cea.js} +1 -1
  81. package/dist/web/_next/static/chunks/6221-cf883148bf8a4c1e.js +11 -0
  82. package/dist/web/_next/static/chunks/{3552.8dd9a3d2c3bcef65.js → 6372.51e578b15d566c0e.js} +2 -2
  83. package/dist/web/_next/static/chunks/6405.39e8b42a56b88bb5.js +1 -0
  84. package/dist/web/_next/static/chunks/641.7b1b12ccc56b3b3c.js +1 -0
  85. package/dist/web/_next/static/chunks/{6647.740ec32a32201eab.js → 6418.a86ca6012f0867ff.js} +1 -1
  86. package/dist/web/_next/static/chunks/{4924.3f5c77a103ac69a9.js → 6435.6aef0f9f1cc65be6.js} +1 -1
  87. package/dist/web/_next/static/chunks/6439.f02105d3687113e7.js +1 -0
  88. package/dist/web/_next/static/chunks/647.527b9a09373aab91.js +1 -0
  89. package/dist/web/_next/static/chunks/{8115.68d46fb961c724e0.js → 6470.7057ef6894a7f625.js} +16 -16
  90. package/dist/web/_next/static/chunks/6485.6ae2f3966cc25c9e.js +1 -0
  91. package/dist/web/_next/static/chunks/{6987.743a63813c6288ce.js → 6512.cc81f46437639a0e.js} +2 -2
  92. package/dist/web/_next/static/chunks/6520.73f10855f9d4b5a8.js +1 -0
  93. package/dist/web/_next/static/chunks/668.1ddcf2e38071ae57.js +24 -0
  94. package/dist/web/_next/static/chunks/6815.8126ae5481c3bfd8.js +1 -0
  95. package/dist/web/_next/static/chunks/6925-af784cffb03dd330.js +1 -0
  96. package/dist/web/_next/static/chunks/6e6d0562.6ebb8f7db67bd943.js +122 -0
  97. package/dist/web/_next/static/chunks/7058.affbacca3457f5a7.js +41 -0
  98. package/dist/web/_next/static/chunks/7207.72d8a01e77112af2.js +1 -0
  99. package/dist/web/_next/static/chunks/{4090.441fa61655da9b38.js → 7359.b09680f38f75e105.js} +1 -1
  100. package/dist/web/_next/static/chunks/7369.a824cc623274cf63.js +1 -0
  101. package/dist/web/_next/static/chunks/7489.24938d89538cd03e.js +1 -0
  102. package/dist/web/_next/static/chunks/{9641.f6f2982fc4b4735f.js → 7576.273c3d0faf5c3d02.js} +1 -1
  103. package/dist/web/_next/static/chunks/7620.5c5935fd937c0e84.js +1 -0
  104. package/dist/web/_next/static/chunks/7646.1c26e96ee36bc317.js +1 -0
  105. package/dist/web/_next/static/chunks/7712.cd8c3dc2d794d714.js +1 -0
  106. package/dist/web/_next/static/chunks/7812.aabc856212c93434.js +1 -0
  107. package/dist/web/_next/static/chunks/804.38f05d79313a8dcc.js +104 -0
  108. package/dist/web/_next/static/chunks/8126-0279fc9e17c08aff.js +1 -0
  109. package/dist/web/_next/static/chunks/820-99036fb63c5462c8.js +1 -0
  110. package/dist/web/_next/static/chunks/8304.936a74abe6f0a288.js +1 -0
  111. package/dist/web/_next/static/chunks/8314.7ff9d72cd8613f75.js +226 -0
  112. package/dist/web/_next/static/chunks/8390.5eda620e73ea6c5c.js +74 -0
  113. package/dist/web/_next/static/chunks/860.f7885efc630bcfd7.js +1 -0
  114. package/dist/web/_next/static/chunks/87c73c54-e11922cda838f8cc.js +1 -0
  115. package/dist/web/_next/static/chunks/887.15090f9a6a142a10.js +1 -0
  116. package/dist/web/_next/static/chunks/8977.1ab6ed8e2c098cf0.js +1 -0
  117. package/dist/web/_next/static/chunks/9121-3d281debd0f3e659.js +1 -0
  118. package/dist/web/_next/static/chunks/9491-6dc334192080d071.js +86 -0
  119. package/dist/web/_next/static/chunks/951ed0e8.98070dce91103a63.js +1 -0
  120. package/dist/web/_next/static/chunks/9651.d199fbbbc3de43b8.js +215 -0
  121. package/dist/web/_next/static/chunks/9692.dd07a90166f5e6ff.js +1 -0
  122. package/dist/web/_next/static/chunks/{6075.a6b8434732056526.js → 9700.c47024f592537718.js} +1 -1
  123. package/dist/web/_next/static/chunks/9711.cf7aaa7fa6ec7dd7.js +287 -0
  124. package/dist/web/_next/static/chunks/9736.63b4a559c8a23186.js +1 -0
  125. package/dist/web/_next/static/chunks/{bbfbfb6c.069db3c4cc981ed3.js → 98f82933.0c4f9e5e83926351.js} +1 -1
  126. package/dist/web/_next/static/chunks/{da9a53d6.df25e193f1f5bcae.js → a36ae3fc.d666935373d1f579.js} +4 -4
  127. package/dist/web/_next/static/chunks/{adcd17ec-9a2791632136b67b.js → ab6c8a12-9dac45de556d8a8d.js} +1 -1
  128. package/dist/web/_next/static/chunks/app/_global-error/page-2ece09c883187d82.js +1 -0
  129. package/dist/web/_next/static/chunks/app/_not-found/page-9f829d2c4beb1840.js +1 -0
  130. package/dist/web/_next/static/chunks/app/admin/access/page-45f45ad529e5b691.js +5 -0
  131. package/dist/web/_next/static/chunks/app/admin/login/page-382072b5b43d3c29.js +1 -0
  132. package/dist/web/_next/static/chunks/app/admin/ota/page-293c0743bd60f454.js +5 -0
  133. package/dist/web/_next/static/chunks/app/admin/page-fc676dae451dd646.js +5 -0
  134. package/dist/web/_next/static/chunks/app/admin/turn/page-2ab33033fc7f0919.js +5 -0
  135. package/dist/web/_next/static/chunks/app/dev/question/page-bafce0c9fd4e8488.js +1 -0
  136. package/dist/web/_next/static/chunks/app/download/{page-2811ea822a1e586a.js → page-a65d1c7fcf6397af.js} +1 -1
  137. package/dist/web/_next/static/chunks/app/layout-f1429d22e935695f.js +1 -0
  138. package/dist/web/_next/static/chunks/app/login/page-a5dd37d1cbbb394e.js +1 -0
  139. package/dist/web/_next/static/chunks/app/page-1e67d8a5f3775276.js +22 -0
  140. package/dist/web/_next/static/chunks/app/workspace/browse/page-2ece09c883187d82.js +1 -0
  141. package/dist/web/_next/static/chunks/app/workspace/editor/page-2ece09c883187d82.js +1 -0
  142. package/dist/web/_next/static/chunks/app/workspace/files/page-2ece09c883187d82.js +1 -0
  143. package/dist/web/_next/static/chunks/app/workspace/git/page-2ece09c883187d82.js +1 -0
  144. package/dist/web/_next/static/chunks/app/workspace/layout-d8bb677fa1caa5a7.js +20 -0
  145. package/dist/web/_next/static/chunks/app/workspace/mobile/page-2ece09c883187d82.js +1 -0
  146. package/dist/web/_next/static/chunks/app/workspace/page-2ece09c883187d82.js +1 -0
  147. package/dist/web/_next/static/chunks/app/workspace/pair/page-2ece09c883187d82.js +1 -0
  148. package/dist/web/_next/static/chunks/app/workspace/remote/page-2ece09c883187d82.js +1 -0
  149. package/dist/web/_next/static/chunks/app/workspace/terminal/[sessionId]/page-2ece09c883187d82.js +1 -0
  150. package/dist/web/_next/static/chunks/app/workspace/welcome/page-2ece09c883187d82.js +1 -0
  151. package/dist/web/_next/static/chunks/app/workspace/workspaces/page-2ece09c883187d82.js +1 -0
  152. package/dist/web/_next/static/chunks/b2b4fb58.d2a067fe7df4a0d0.js +1 -0
  153. package/dist/web/_next/static/chunks/baeaa4ff-8eac34d2e07d1bb3.js +1 -0
  154. package/dist/web/_next/static/chunks/{7c89255b.f727562586fa21cc.js → c2d9a0c9.b4e0bb73c2ed317c.js} +1 -1
  155. package/dist/web/_next/static/chunks/{a012e9f0.7dbb2fe05ec0b816.js → ccfb6294.add4177b76c37868.js} +11 -11
  156. package/dist/web/_next/static/chunks/{c7ea4e13.6153499d4c2fb1f2.js → db261188.134a04dd616706a4.js} +1 -1
  157. package/dist/web/_next/static/chunks/framework-59d2d1720fc2b396.js +1 -0
  158. package/dist/web/_next/static/chunks/main-app-72391b47e9393c1b.js +1 -0
  159. package/dist/web/_next/static/chunks/main-e10b0dbebb4de0a8.js +5 -0
  160. package/dist/web/_next/static/chunks/next/dist/client/components/builtin/app-error-2ece09c883187d82.js +1 -0
  161. package/dist/web/_next/static/chunks/next/dist/client/components/builtin/forbidden-2ece09c883187d82.js +1 -0
  162. package/dist/web/_next/static/chunks/next/dist/client/components/builtin/global-error-48f06b4c48a1eef3.js +1 -0
  163. package/dist/web/_next/static/chunks/next/dist/client/components/builtin/not-found-2ece09c883187d82.js +1 -0
  164. package/dist/web/_next/static/chunks/next/dist/client/components/builtin/unauthorized-2ece09c883187d82.js +1 -0
  165. package/dist/web/_next/static/chunks/webpack-dd1f7a5ae02e5d84.js +1 -0
  166. package/dist/web/_next/static/css/{b496025c9cd768cc.css → 15730e9f7c5c55ef.css} +1 -1
  167. package/dist/web/_next/static/css/1c2cca827fa36d54.css +1 -0
  168. package/dist/web/_not-found/__next._full.txt +15 -15
  169. package/dist/web/_not-found/__next._head.txt +4 -4
  170. package/dist/web/_not-found/__next._index.txt +10 -10
  171. package/dist/web/_not-found/__next._not-found.__PAGE__.txt +2 -2
  172. package/dist/web/_not-found/__next._not-found.txt +3 -3
  173. package/dist/web/_not-found/__next._tree.txt +3 -3
  174. package/dist/web/_not-found.html +1 -1
  175. package/dist/web/_not-found.txt +15 -15
  176. package/dist/web/admin/__next._full.txt +17 -17
  177. package/dist/web/admin/__next._head.txt +4 -4
  178. package/dist/web/admin/__next._index.txt +10 -10
  179. package/dist/web/admin/__next._tree.txt +3 -3
  180. package/dist/web/admin/__next.admin.__PAGE__.txt +4 -4
  181. package/dist/web/admin/__next.admin.txt +3 -3
  182. package/dist/web/admin/access/__next._full.txt +17 -17
  183. package/dist/web/admin/access/__next._head.txt +4 -4
  184. package/dist/web/admin/access/__next._index.txt +10 -10
  185. package/dist/web/admin/access/__next._tree.txt +3 -3
  186. package/dist/web/admin/access/__next.admin.access.__PAGE__.txt +4 -4
  187. package/dist/web/admin/access/__next.admin.access.txt +3 -3
  188. package/dist/web/admin/access/__next.admin.txt +3 -3
  189. package/dist/web/admin/access.html +1 -1
  190. package/dist/web/admin/access.txt +17 -17
  191. package/dist/web/admin/login/__next._full.txt +17 -17
  192. package/dist/web/admin/login/__next._head.txt +4 -4
  193. package/dist/web/admin/login/__next._index.txt +10 -10
  194. package/dist/web/admin/login/__next._tree.txt +3 -3
  195. package/dist/web/admin/login/__next.admin.login.__PAGE__.txt +4 -4
  196. package/dist/web/admin/login/__next.admin.login.txt +3 -3
  197. package/dist/web/admin/login/__next.admin.txt +3 -3
  198. package/dist/web/admin/login.html +1 -1
  199. package/dist/web/admin/login.txt +17 -17
  200. package/dist/web/admin/ota/__next._full.txt +17 -17
  201. package/dist/web/admin/ota/__next._head.txt +4 -4
  202. package/dist/web/admin/ota/__next._index.txt +10 -10
  203. package/dist/web/admin/ota/__next._tree.txt +3 -3
  204. package/dist/web/admin/ota/__next.admin.ota.__PAGE__.txt +4 -4
  205. package/dist/web/admin/ota/__next.admin.ota.txt +3 -3
  206. package/dist/web/admin/ota/__next.admin.txt +3 -3
  207. package/dist/web/admin/ota.html +1 -1
  208. package/dist/web/admin/ota.txt +17 -17
  209. package/dist/web/admin/turn/__next._full.txt +17 -17
  210. package/dist/web/admin/turn/__next._head.txt +4 -4
  211. package/dist/web/admin/turn/__next._index.txt +10 -10
  212. package/dist/web/admin/turn/__next._tree.txt +3 -3
  213. package/dist/web/admin/turn/__next.admin.turn.__PAGE__.txt +4 -4
  214. package/dist/web/admin/turn/__next.admin.turn.txt +3 -3
  215. package/dist/web/admin/turn/__next.admin.txt +3 -3
  216. package/dist/web/admin/turn.html +1 -1
  217. package/dist/web/admin/turn.txt +17 -17
  218. package/dist/web/admin.html +1 -1
  219. package/dist/web/admin.txt +17 -17
  220. package/dist/web/dev/question/__next._full.txt +17 -17
  221. package/dist/web/dev/question/__next._head.txt +4 -4
  222. package/dist/web/dev/question/__next._index.txt +10 -10
  223. package/dist/web/dev/question/__next._tree.txt +3 -3
  224. package/dist/web/dev/question/__next.dev.question.__PAGE__.txt +4 -4
  225. package/dist/web/dev/question/__next.dev.question.txt +3 -3
  226. package/dist/web/dev/question/__next.dev.txt +3 -3
  227. package/dist/web/dev/question.html +1 -1
  228. package/dist/web/dev/question.txt +17 -17
  229. package/dist/web/download/__next._full.txt +16 -16
  230. package/dist/web/download/__next._head.txt +4 -4
  231. package/dist/web/download/__next._index.txt +10 -10
  232. package/dist/web/download/__next._tree.txt +3 -3
  233. package/dist/web/download/__next.download.__PAGE__.txt +3 -3
  234. package/dist/web/download/__next.download.txt +3 -3
  235. package/dist/web/download.html +1 -1
  236. package/dist/web/download.txt +16 -16
  237. package/dist/web/index.html +1 -1
  238. package/dist/web/index.txt +17 -17
  239. package/dist/web/login/__next._full.txt +17 -17
  240. package/dist/web/login/__next._head.txt +4 -4
  241. package/dist/web/login/__next._index.txt +10 -10
  242. package/dist/web/login/__next._tree.txt +3 -3
  243. package/dist/web/login/__next.login.__PAGE__.txt +4 -4
  244. package/dist/web/login/__next.login.txt +3 -3
  245. package/dist/web/login.html +1 -1
  246. package/dist/web/login.txt +17 -17
  247. package/dist/web/workspace/__next._full.txt +17 -17
  248. package/dist/web/workspace/__next._head.txt +4 -4
  249. package/dist/web/workspace/__next._index.txt +10 -10
  250. package/dist/web/workspace/__next._tree.txt +3 -3
  251. package/dist/web/workspace/__next.workspace.__PAGE__.txt +2 -2
  252. package/dist/web/workspace/__next.workspace.txt +5 -5
  253. package/dist/web/workspace/browse/__next._full.txt +17 -17
  254. package/dist/web/workspace/browse/__next._head.txt +4 -4
  255. package/dist/web/workspace/browse/__next._index.txt +10 -10
  256. package/dist/web/workspace/browse/__next._tree.txt +3 -3
  257. package/dist/web/workspace/browse/__next.workspace.browse.__PAGE__.txt +2 -2
  258. package/dist/web/workspace/browse/__next.workspace.browse.txt +3 -3
  259. package/dist/web/workspace/browse/__next.workspace.txt +5 -5
  260. package/dist/web/workspace/browse.html +1 -1
  261. package/dist/web/workspace/browse.txt +17 -17
  262. package/dist/web/workspace/editor/__next._full.txt +17 -17
  263. package/dist/web/workspace/editor/__next._head.txt +4 -4
  264. package/dist/web/workspace/editor/__next._index.txt +10 -10
  265. package/dist/web/workspace/editor/__next._tree.txt +3 -3
  266. package/dist/web/workspace/editor/__next.workspace.editor.__PAGE__.txt +2 -2
  267. package/dist/web/workspace/editor/__next.workspace.editor.txt +3 -3
  268. package/dist/web/workspace/editor/__next.workspace.txt +5 -5
  269. package/dist/web/workspace/editor.html +1 -1
  270. package/dist/web/workspace/editor.txt +17 -17
  271. package/dist/web/workspace/files/__next._full.txt +17 -17
  272. package/dist/web/workspace/files/__next._head.txt +4 -4
  273. package/dist/web/workspace/files/__next._index.txt +10 -10
  274. package/dist/web/workspace/files/__next._tree.txt +3 -3
  275. package/dist/web/workspace/files/__next.workspace.files.__PAGE__.txt +2 -2
  276. package/dist/web/workspace/files/__next.workspace.files.txt +3 -3
  277. package/dist/web/workspace/files/__next.workspace.txt +5 -5
  278. package/dist/web/workspace/files.html +1 -1
  279. package/dist/web/workspace/files.txt +17 -17
  280. package/dist/web/workspace/git/__next._full.txt +17 -17
  281. package/dist/web/workspace/git/__next._head.txt +4 -4
  282. package/dist/web/workspace/git/__next._index.txt +10 -10
  283. package/dist/web/workspace/git/__next._tree.txt +3 -3
  284. package/dist/web/workspace/git/__next.workspace.git.__PAGE__.txt +2 -2
  285. package/dist/web/workspace/git/__next.workspace.git.txt +3 -3
  286. package/dist/web/workspace/git/__next.workspace.txt +5 -5
  287. package/dist/web/workspace/git.html +1 -1
  288. package/dist/web/workspace/git.txt +17 -17
  289. package/dist/web/workspace/mobile/__next._full.txt +17 -17
  290. package/dist/web/workspace/mobile/__next._head.txt +4 -4
  291. package/dist/web/workspace/mobile/__next._index.txt +10 -10
  292. package/dist/web/workspace/mobile/__next._tree.txt +3 -3
  293. package/dist/web/workspace/mobile/__next.workspace.mobile.__PAGE__.txt +2 -2
  294. package/dist/web/workspace/mobile/__next.workspace.mobile.txt +3 -3
  295. package/dist/web/workspace/mobile/__next.workspace.txt +5 -5
  296. package/dist/web/workspace/mobile.html +1 -1
  297. package/dist/web/workspace/mobile.txt +17 -17
  298. package/dist/web/workspace/pair/__next._full.txt +17 -17
  299. package/dist/web/workspace/pair/__next._head.txt +4 -4
  300. package/dist/web/workspace/pair/__next._index.txt +10 -10
  301. package/dist/web/workspace/pair/__next._tree.txt +3 -3
  302. package/dist/web/workspace/pair/__next.workspace.pair.__PAGE__.txt +2 -2
  303. package/dist/web/workspace/pair/__next.workspace.pair.txt +3 -3
  304. package/dist/web/workspace/pair/__next.workspace.txt +5 -5
  305. package/dist/web/workspace/pair.html +1 -1
  306. package/dist/web/workspace/pair.txt +17 -17
  307. package/dist/web/workspace/remote/__next._full.txt +17 -17
  308. package/dist/web/workspace/remote/__next._head.txt +4 -4
  309. package/dist/web/workspace/remote/__next._index.txt +10 -10
  310. package/dist/web/workspace/remote/__next._tree.txt +3 -3
  311. package/dist/web/workspace/remote/__next.workspace.remote.__PAGE__.txt +2 -2
  312. package/dist/web/workspace/remote/__next.workspace.remote.txt +3 -3
  313. package/dist/web/workspace/remote/__next.workspace.txt +5 -5
  314. package/dist/web/workspace/remote.html +1 -1
  315. package/dist/web/workspace/remote.txt +17 -17
  316. package/dist/web/workspace/terminal/default/__next._full.txt +26 -25
  317. package/dist/web/workspace/terminal/default/__next._head.txt +4 -4
  318. package/dist/web/workspace/terminal/default/__next._index.txt +10 -10
  319. package/dist/web/workspace/terminal/default/__next._tree.txt +3 -3
  320. package/dist/web/workspace/terminal/default/__next.workspace.terminal.$d$sessionId.__PAGE__.txt +2 -2
  321. package/dist/web/workspace/terminal/default/__next.workspace.terminal.$d$sessionId.txt +3 -3
  322. package/dist/web/workspace/terminal/default/__next.workspace.terminal.txt +3 -3
  323. package/dist/web/workspace/terminal/default/__next.workspace.txt +5 -5
  324. package/dist/web/workspace/terminal/default.html +1 -1
  325. package/dist/web/workspace/terminal/default.txt +26 -25
  326. package/dist/web/workspace/welcome/__next._full.txt +17 -17
  327. package/dist/web/workspace/welcome/__next._head.txt +4 -4
  328. package/dist/web/workspace/welcome/__next._index.txt +10 -10
  329. package/dist/web/workspace/welcome/__next._tree.txt +3 -3
  330. package/dist/web/workspace/welcome/__next.workspace.txt +5 -5
  331. package/dist/web/workspace/welcome/__next.workspace.welcome.__PAGE__.txt +2 -2
  332. package/dist/web/workspace/welcome/__next.workspace.welcome.txt +3 -3
  333. package/dist/web/workspace/welcome.html +1 -1
  334. package/dist/web/workspace/welcome.txt +17 -17
  335. package/dist/web/workspace/workspaces/__next._full.txt +17 -17
  336. package/dist/web/workspace/workspaces/__next._head.txt +4 -4
  337. package/dist/web/workspace/workspaces/__next._index.txt +10 -10
  338. package/dist/web/workspace/workspaces/__next._tree.txt +3 -3
  339. package/dist/web/workspace/workspaces/__next.workspace.txt +5 -5
  340. package/dist/web/workspace/workspaces/__next.workspace.workspaces.__PAGE__.txt +2 -2
  341. package/dist/web/workspace/workspaces/__next.workspace.workspaces.txt +3 -3
  342. package/dist/web/workspace/workspaces.html +1 -1
  343. package/dist/web/workspace/workspaces.txt +17 -17
  344. package/dist/web/workspace.html +1 -1
  345. package/dist/web/workspace.txt +17 -17
  346. package/package.json +1 -1
  347. package/dist/ui/assets/index-DbuftNJF.js +0 -8
  348. package/dist/web/_next/static/chunks/1050-b9af41e8856b58c0.js +0 -1
  349. package/dist/web/_next/static/chunks/1222.a2ce7d7f04241e2a.js +0 -1
  350. package/dist/web/_next/static/chunks/1228.046ad5fd038f5192.js +0 -1
  351. package/dist/web/_next/static/chunks/1243.1d11020940b8a88b.js +0 -1
  352. package/dist/web/_next/static/chunks/132.1ed2fce3a4b6f7ee.js +0 -1
  353. package/dist/web/_next/static/chunks/133.1106654a28b5afda.js +0 -1
  354. package/dist/web/_next/static/chunks/1385.086b560acb0d7a68.js +0 -115
  355. package/dist/web/_next/static/chunks/1642.cac26d30ac331cb4.js +0 -1
  356. package/dist/web/_next/static/chunks/1733.f06c240b3ef8a428.js +0 -77
  357. package/dist/web/_next/static/chunks/1750.09ca4eade7a6e5d3.js +0 -1
  358. package/dist/web/_next/static/chunks/1763.28beedca593b5e19.js +0 -138
  359. package/dist/web/_next/static/chunks/179.b9e8f385bd414d1c.js +0 -62
  360. package/dist/web/_next/static/chunks/1838.7c8990f903e3524a.js +0 -215
  361. package/dist/web/_next/static/chunks/2038.b7c72b442a1b2d92.js +0 -1
  362. package/dist/web/_next/static/chunks/2112.d72eefbdf81659b3.js +0 -23
  363. package/dist/web/_next/static/chunks/2125.61c6e4a3541e30ad.js +0 -1
  364. package/dist/web/_next/static/chunks/2129.61afb2f4ff59e46a.js +0 -24
  365. package/dist/web/_next/static/chunks/213.f07a816120a320ba.js +0 -1
  366. package/dist/web/_next/static/chunks/2179.3f55be0b79e3cca7.js +0 -1
  367. package/dist/web/_next/static/chunks/2180.23585bd3f3308f3a.js +0 -1
  368. package/dist/web/_next/static/chunks/2264.0fc1474d26067a01.js +0 -1
  369. package/dist/web/_next/static/chunks/2376.ed6302a91a9de1ae.js +0 -36
  370. package/dist/web/_next/static/chunks/2545.3ff192a933baf11e.js +0 -1
  371. package/dist/web/_next/static/chunks/2620.d17f4fac0eec88a5.js +0 -1
  372. package/dist/web/_next/static/chunks/2847.d3124853ca727b78.js +0 -1
  373. package/dist/web/_next/static/chunks/2849.360e2c64521fa795.js +0 -1
  374. package/dist/web/_next/static/chunks/3189.64c6546d621eec0b.js +0 -1
  375. package/dist/web/_next/static/chunks/3348-9ef29f9cedf6c0df.js +0 -1
  376. package/dist/web/_next/static/chunks/3429.98d7e79ff6d2a6ce.js +0 -1
  377. package/dist/web/_next/static/chunks/3514.9079bf49bb3e05c9.js +0 -1
  378. package/dist/web/_next/static/chunks/3606.b59e695fd05b4eb3.js +0 -74
  379. package/dist/web/_next/static/chunks/3736.4a5662ceeecc6acb.js +0 -94
  380. package/dist/web/_next/static/chunks/392.842b338137824bb8.js +0 -1
  381. package/dist/web/_next/static/chunks/4136-d7c1ff2da0833b42.js +0 -86
  382. package/dist/web/_next/static/chunks/4300-7d6c9b3328075562.js +0 -1
  383. package/dist/web/_next/static/chunks/4303.54c4aa0b89834fc6.js +0 -1
  384. package/dist/web/_next/static/chunks/4551.d0d6723cacfb90b9.js +0 -226
  385. package/dist/web/_next/static/chunks/4566.d8e009823b8647d1.js +0 -90
  386. package/dist/web/_next/static/chunks/4643.ddf3ea3a760e73a5.js +0 -1
  387. package/dist/web/_next/static/chunks/4930.42e564644c94a93b.js +0 -1
  388. package/dist/web/_next/static/chunks/5155.d7e8db52ab4c95e0.js +0 -27
  389. package/dist/web/_next/static/chunks/5158-267908d069475cdc.js +0 -32
  390. package/dist/web/_next/static/chunks/543.5636e97aa68eb9c8.js +0 -41
  391. package/dist/web/_next/static/chunks/5506.98304a1821200439.js +0 -1
  392. package/dist/web/_next/static/chunks/5622.5ead5e748ecedbd1.js +0 -1
  393. package/dist/web/_next/static/chunks/5708.22b4531ceebf3eca.js +0 -1
  394. package/dist/web/_next/static/chunks/5788-d4b8dc2ab68396b6.js +0 -1
  395. package/dist/web/_next/static/chunks/5804.ff72a927135eb74c.js +0 -93
  396. package/dist/web/_next/static/chunks/588.78e2528ff24df85c.js +0 -287
  397. package/dist/web/_next/static/chunks/6001.e5bcb28bb9ce6571.js +0 -1
  398. package/dist/web/_next/static/chunks/6180.82fa683aa16f21df.js +0 -1
  399. package/dist/web/_next/static/chunks/6276.aa48f74970f7ef3d.js +0 -1
  400. package/dist/web/_next/static/chunks/6419.99aa173d83f20370.js +0 -1
  401. package/dist/web/_next/static/chunks/6552-cebe84e4399a184f.js +0 -1
  402. package/dist/web/_next/static/chunks/6739.22a05398bfd34922.js +0 -1
  403. package/dist/web/_next/static/chunks/674.97a7237f011fb986.js +0 -1
  404. package/dist/web/_next/static/chunks/6742.bc3783b9784ead96.js +0 -1
  405. package/dist/web/_next/static/chunks/7202.dad90ce4a1d78f67.js +0 -1
  406. package/dist/web/_next/static/chunks/7233.0f252f6c1cce8058.js +0 -1
  407. package/dist/web/_next/static/chunks/7248.d89bf328a0dc1b4c.js +0 -1
  408. package/dist/web/_next/static/chunks/7263.6f224c3924155294.js +0 -1
  409. package/dist/web/_next/static/chunks/7341.6958eac888a96823.js +0 -34
  410. package/dist/web/_next/static/chunks/7507.28a3807b5d02a5c1.js +0 -1
  411. package/dist/web/_next/static/chunks/7811.19082afa63eb73ba.js +0 -1
  412. package/dist/web/_next/static/chunks/7853.d01982fa0afc1ee2.js +0 -24
  413. package/dist/web/_next/static/chunks/7908.432ab9feeb9ae756.js +0 -1
  414. package/dist/web/_next/static/chunks/7960.026e07028dd25edb.js +0 -1
  415. package/dist/web/_next/static/chunks/7967.6c62be01fad1603c.js +0 -1
  416. package/dist/web/_next/static/chunks/8054.feeb01b8acdb31d4.js +0 -1
  417. package/dist/web/_next/static/chunks/817.cd0f4d221eca4c8b.js +0 -104
  418. package/dist/web/_next/static/chunks/8207-45554e2570bc59e6.js +0 -1
  419. package/dist/web/_next/static/chunks/8467.290e9bde34b58e7c.js +0 -1
  420. package/dist/web/_next/static/chunks/8495.d6cea1be03635fa8.js +0 -148
  421. package/dist/web/_next/static/chunks/8638.237712645dcdcb8a.js +0 -1
  422. package/dist/web/_next/static/chunks/8669-8d1fb8dce08c886d.js +0 -11
  423. package/dist/web/_next/static/chunks/8716.1ad6febb58e8560e.js +0 -1
  424. package/dist/web/_next/static/chunks/8762-cb470d05070f5ead.js +0 -1
  425. package/dist/web/_next/static/chunks/8839.1ad64faf06fb4a33.js +0 -1
  426. package/dist/web/_next/static/chunks/8922-8660f73e9cd42406.js +0 -1
  427. package/dist/web/_next/static/chunks/910.43be9c3be85c7fa0.js +0 -21
  428. package/dist/web/_next/static/chunks/925.fe600c6039a3201d.js +0 -1
  429. package/dist/web/_next/static/chunks/9259.c450f561db04037d.js +0 -1
  430. package/dist/web/_next/static/chunks/9299.83236781dfa74eb0.js +0 -1
  431. package/dist/web/_next/static/chunks/9387.96263a2d1602a078.js +0 -1
  432. package/dist/web/_next/static/chunks/9568-0bfadca4fcb105aa.js +0 -1
  433. package/dist/web/_next/static/chunks/9860.05fa134ae44699e0.js +0 -1
  434. package/dist/web/_next/static/chunks/9b87412a.d2cfae4121762dec.js +0 -122
  435. package/dist/web/_next/static/chunks/a096f98a-5a93977f5f5de413.js +0 -1
  436. package/dist/web/_next/static/chunks/ab1da478.d051e56375dab6d8.js +0 -1
  437. package/dist/web/_next/static/chunks/app/_global-error/page-e656bb9bc0f3fd3d.js +0 -1
  438. package/dist/web/_next/static/chunks/app/_not-found/page-877523282abd5a7c.js +0 -1
  439. package/dist/web/_next/static/chunks/app/admin/access/page-65febd13b3d1fc91.js +0 -5
  440. package/dist/web/_next/static/chunks/app/admin/login/page-8ff8150184b7ccaa.js +0 -1
  441. package/dist/web/_next/static/chunks/app/admin/ota/page-d8766baa3680522d.js +0 -5
  442. package/dist/web/_next/static/chunks/app/admin/page-6237b1487c05f33e.js +0 -5
  443. package/dist/web/_next/static/chunks/app/admin/turn/page-6a6b695b67d59451.js +0 -5
  444. package/dist/web/_next/static/chunks/app/dev/question/page-bdedfcfce7a3c516.js +0 -1
  445. package/dist/web/_next/static/chunks/app/layout-a0e78c8427f97e4f.js +0 -1
  446. package/dist/web/_next/static/chunks/app/login/page-edc7457ddecf9262.js +0 -1
  447. package/dist/web/_next/static/chunks/app/page-b76772608a876c23.js +0 -22
  448. package/dist/web/_next/static/chunks/app/workspace/browse/page-e656bb9bc0f3fd3d.js +0 -1
  449. package/dist/web/_next/static/chunks/app/workspace/editor/page-e656bb9bc0f3fd3d.js +0 -1
  450. package/dist/web/_next/static/chunks/app/workspace/files/page-e656bb9bc0f3fd3d.js +0 -1
  451. package/dist/web/_next/static/chunks/app/workspace/git/page-e656bb9bc0f3fd3d.js +0 -1
  452. package/dist/web/_next/static/chunks/app/workspace/layout-0fd9ea03182e9c89.js +0 -15
  453. package/dist/web/_next/static/chunks/app/workspace/mobile/page-e656bb9bc0f3fd3d.js +0 -1
  454. package/dist/web/_next/static/chunks/app/workspace/page-e656bb9bc0f3fd3d.js +0 -1
  455. package/dist/web/_next/static/chunks/app/workspace/pair/page-e656bb9bc0f3fd3d.js +0 -1
  456. package/dist/web/_next/static/chunks/app/workspace/remote/page-e656bb9bc0f3fd3d.js +0 -1
  457. package/dist/web/_next/static/chunks/app/workspace/terminal/[sessionId]/page-e656bb9bc0f3fd3d.js +0 -1
  458. package/dist/web/_next/static/chunks/app/workspace/welcome/page-e656bb9bc0f3fd3d.js +0 -1
  459. package/dist/web/_next/static/chunks/app/workspace/workspaces/page-e656bb9bc0f3fd3d.js +0 -1
  460. package/dist/web/_next/static/chunks/c7879cf7-0d16fce1674078f9.js +0 -1
  461. package/dist/web/_next/static/chunks/cdcce140.7a440644c3dd52b8.js +0 -1
  462. package/dist/web/_next/static/chunks/framework-42053c69543a55f9.js +0 -1
  463. package/dist/web/_next/static/chunks/main-255c95c36766ce86.js +0 -5
  464. package/dist/web/_next/static/chunks/main-app-1831d4f902c3fcb9.js +0 -1
  465. package/dist/web/_next/static/chunks/next/dist/client/components/builtin/app-error-e656bb9bc0f3fd3d.js +0 -1
  466. package/dist/web/_next/static/chunks/next/dist/client/components/builtin/forbidden-e656bb9bc0f3fd3d.js +0 -1
  467. package/dist/web/_next/static/chunks/next/dist/client/components/builtin/global-error-76800531999827bd.js +0 -1
  468. package/dist/web/_next/static/chunks/next/dist/client/components/builtin/not-found-e656bb9bc0f3fd3d.js +0 -1
  469. package/dist/web/_next/static/chunks/next/dist/client/components/builtin/unauthorized-e656bb9bc0f3fd3d.js +0 -1
  470. package/dist/web/_next/static/chunks/webpack-f3500fd1fae71c88.js +0 -1
  471. package/dist/web/_next/static/css/1b307dedbb687210.css +0 -1
  472. package/dist/web/proxy.html +0 -179
  473. package/dist/web/sw-site.js +0 -283
  474. package/dist/web/swBridgeClaim.js +0 -57
  475. /package/dist/web/_next/static/{DdbafQkcX_ZaKRMjMeNKp → 55Oo1FQxj9HIxB7QE1XWG}/_buildManifest.js +0 -0
  476. /package/dist/web/_next/static/{DdbafQkcX_ZaKRMjMeNKp → 55Oo1FQxj9HIxB7QE1XWG}/_ssgManifest.js +0 -0
  477. /package/dist/web/_next/static/chunks/{1311.8c6b8930e22ceea0.js → 6153.8c6b8930e22ceea0.js} +0 -0
  478. /package/dist/web/_next/static/chunks/{3692.8c6b8930e22ceea0.js → 8534.8c6b8930e22ceea0.js} +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6075],{16075:(e,t,n)=>{n.r(t),n.d(t,{Html5Qrcode:()=>et,Html5QrcodeScanType:()=>p,Html5QrcodeScanner:()=>eI,Html5QrcodeScannerState:()=>g,Html5QrcodeSupportedFormats:()=>h}),(l=h||(h={}))[l.QR_CODE=0]="QR_CODE",l[l.AZTEC=1]="AZTEC",l[l.CODABAR=2]="CODABAR",l[l.CODE_39=3]="CODE_39",l[l.CODE_93=4]="CODE_93",l[l.CODE_128=5]="CODE_128",l[l.DATA_MATRIX=6]="DATA_MATRIX",l[l.MAXICODE=7]="MAXICODE",l[l.ITF=8]="ITF",l[l.EAN_13=9]="EAN_13",l[l.EAN_8=10]="EAN_8",l[l.PDF_417=11]="PDF_417",l[l.RSS_14=12]="RSS_14",l[l.RSS_EXPANDED=13]="RSS_EXPANDED",l[l.UPC_A=14]="UPC_A",l[l.UPC_E=15]="UPC_E",l[l.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION";var r,o,i,a,s,c,u,l,h,d,p,f,g,y,m=new Map([[h.QR_CODE,"QR_CODE"],[h.AZTEC,"AZTEC"],[h.CODABAR,"CODABAR"],[h.CODE_39,"CODE_39"],[h.CODE_93,"CODE_93"],[h.CODE_128,"CODE_128"],[h.DATA_MATRIX,"DATA_MATRIX"],[h.MAXICODE,"MAXICODE"],[h.ITF,"ITF"],[h.EAN_13,"EAN_13"],[h.EAN_8,"EAN_8"],[h.PDF_417,"PDF_417"],[h.RSS_14,"RSS_14"],[h.RSS_EXPANDED,"RSS_EXPANDED"],[h.UPC_A,"UPC_A"],[h.UPC_E,"UPC_E"],[h.UPC_EAN_EXTENSION,"UPC_EAN_EXTENSION"]]);(r=d||(d={}))[r.UNKNOWN=0]="UNKNOWN",r[r.URL=1]="URL",(o=p||(p={}))[o.SCAN_TYPE_CAMERA=0]="SCAN_TYPE_CAMERA",o[o.SCAN_TYPE_FILE=1]="SCAN_TYPE_FILE";var S=function(){function e(){}return e.GITHUB_PROJECT_URL="https://github.com/mebjas/html5-qrcode",e.SCAN_DEFAULT_FPS=2,e.DEFAULT_DISABLE_FLIP=!1,e.DEFAULT_REMEMBER_LAST_CAMERA_USED=!0,e.DEFAULT_SUPPORTED_SCAN_TYPE=[p.SCAN_TYPE_CAMERA,p.SCAN_TYPE_FILE],e}(),T=function(){function e(e,t){this.format=e,this.formatName=t}return e.prototype.toString=function(){return this.formatName},e.create=function(t){if(!m.has(t))throw"".concat(t," not in html5QrcodeSupportedFormatsTextMap");return new e(t,m.get(t))},e}(),M=function(){function e(){}return e.createFromText=function(e){return{decodedText:e,result:{text:e}}},e.createFromQrcodeResult=function(e){return{decodedText:e.text,result:e}},e}();(i=f||(f={}))[i.UNKWOWN_ERROR=0]="UNKWOWN_ERROR",i[i.IMPLEMENTATION_ERROR=1]="IMPLEMENTATION_ERROR",i[i.NO_CODE_FOUND_ERROR=2]="NO_CODE_FOUND_ERROR";var C=function(){function e(){}return e.createFrom=function(e){return{errorMessage:e,type:f.UNKWOWN_ERROR}},e}(),E=function(){function e(e){this.verbose=e}return e.prototype.log=function(e){this.verbose&&console.log(e)},e.prototype.warn=function(e){this.verbose&&console.warn(e)},e.prototype.logError=function(e,t){(this.verbose||!0===t)&&console.error(e)},e.prototype.logErrors=function(e){if(0===e.length)throw"Logger#logError called without arguments";this.verbose&&console.error(e)},e}();function I(e){return null==e}var A=function(){function e(){}return e.codeParseError=function(e){return"QR code parse error, error = ".concat(e)},e.errorGettingUserMedia=function(e){return"Error getting userMedia, error = ".concat(e)},e.onlyDeviceSupportedError=function(){return"The device doesn't support navigator.mediaDevices , only supported cameraIdOrConfig in this case is deviceId parameter (string)."},e.cameraStreamingNotSupported=function(){return"Camera streaming not supported by the browser."},e.unableToQuerySupportedDevices=function(){return"Unable to query supported devices, unknown error."},e.insecureContextCameraQueryError=function(){return"Camera access is only supported in secure context like https or localhost."},e.scannerPaused=function(){return"Scanner paused"},e}(),D=function(){function e(){}return e.scanningStatus=function(){return"Scanning"},e.idleStatus=function(){return"Idle"},e.errorStatus=function(){return"Error"},e.permissionStatus=function(){return"Permission"},e.noCameraFoundErrorStatus=function(){return"No Cameras"},e.lastMatch=function(e){return"Last Match: ".concat(e)},e.codeScannerTitle=function(){return"Code Scanner"},e.cameraPermissionTitle=function(){return"Request Camera Permissions"},e.cameraPermissionRequesting=function(){return"Requesting camera permissions..."},e.noCameraFound=function(){return"No camera found"},e.scanButtonStopScanningText=function(){return"Stop Scanning"},e.scanButtonStartScanningText=function(){return"Start Scanning"},e.torchOnButton=function(){return"Switch On Torch"},e.torchOffButton=function(){return"Switch Off Torch"},e.torchOnFailedMessage=function(){return"Failed to turn on torch"},e.torchOffFailedMessage=function(){return"Failed to turn off torch"},e.scanButtonScanningStarting=function(){return"Launching Camera..."},e.textIfCameraScanSelected=function(){return"Scan an Image File"},e.textIfFileScanSelected=function(){return"Scan using camera directly"},e.selectCamera=function(){return"Select Camera"},e.fileSelectionChooseImage=function(){return"Choose Image"},e.fileSelectionChooseAnother=function(){return"Choose Another"},e.fileSelectionNoImageSelected=function(){return"No image choosen"},e.anonymousCameraPrefix=function(){return"Anonymous Camera"},e.dragAndDropMessage=function(){return"Or drop an image to scan"},e.dragAndDropMessageOnlyImages=function(){return"Or drop an image to scan (other files not supported)"},e.zoom=function(){return"zoom"},e.loadingImage=function(){return"Loading image..."},e.cameraScanAltText=function(){return"Camera based scan"},e.fileScanAltText=function(){return"Fule based scan"},e}(),v=function(){function e(){}return e.poweredBy=function(){return"Powered by "},e.reportIssues=function(){return"Report issues"},e}(),N=function(){function e(){}return e.isMediaStreamConstraintsValid=function(e,t){if("object"!=typeof e){var n=typeof e;return t.logError("videoConstraints should be of type object, the "+"object passed is of type ".concat(n,"."),!0),!1}for(var r=new Set(["autoGainControl","channelCount","echoCancellation","latency","noiseSuppression","sampleRate","sampleSize","volume"]),o=Object.keys(e),i=0;i<o.length;i++){var a=o[i];if(r.has(a))return t.logError("".concat(a," is not supported videoConstaints."),!0),!1}return!0},e}(),b=n(29296),w=function(){function e(e,t,n){if(this.formatMap=new Map([[h.QR_CODE,b.BarcodeFormat.QR_CODE],[h.AZTEC,b.BarcodeFormat.AZTEC],[h.CODABAR,b.BarcodeFormat.CODABAR],[h.CODE_39,b.BarcodeFormat.CODE_39],[h.CODE_93,b.BarcodeFormat.CODE_93],[h.CODE_128,b.BarcodeFormat.CODE_128],[h.DATA_MATRIX,b.BarcodeFormat.DATA_MATRIX],[h.MAXICODE,b.BarcodeFormat.MAXICODE],[h.ITF,b.BarcodeFormat.ITF],[h.EAN_13,b.BarcodeFormat.EAN_13],[h.EAN_8,b.BarcodeFormat.EAN_8],[h.PDF_417,b.BarcodeFormat.PDF_417],[h.RSS_14,b.BarcodeFormat.RSS_14],[h.RSS_EXPANDED,b.BarcodeFormat.RSS_EXPANDED],[h.UPC_A,b.BarcodeFormat.UPC_A],[h.UPC_E,b.BarcodeFormat.UPC_E],[h.UPC_EAN_EXTENSION,b.BarcodeFormat.UPC_EAN_EXTENSION]]),this.reverseFormatMap=this.createReverseFormatMap(),!b)throw"Use html5qrcode.min.js without edit, ZXing not found.";this.verbose=t,this.logger=n;var r=this.createZXingFormats(e),o=new Map;o.set(b.DecodeHintType.POSSIBLE_FORMATS,r),o.set(b.DecodeHintType.TRY_HARDER,!1),this.hints=o}return e.prototype.decodeAsync=function(e){var t=this;return new Promise(function(n,r){try{n(t.decode(e))}catch(e){r(e)}})},e.prototype.decode=function(e){var t=new b.MultiFormatReader(this.verbose,this.hints),n=new b.HTMLCanvasElementLuminanceSource(e),r=new b.BinaryBitmap(new b.HybridBinarizer(n)),o=t.decode(r);return{text:o.text,format:T.create(this.toHtml5QrcodeSupportedFormats(o.format)),debugData:this.createDebugData()}},e.prototype.createReverseFormatMap=function(){var e=new Map;return this.formatMap.forEach(function(t,n,r){e.set(t,n)}),e},e.prototype.toHtml5QrcodeSupportedFormats=function(e){if(!this.reverseFormatMap.has(e))throw"reverseFormatMap doesn't have ".concat(e);return this.reverseFormatMap.get(e)},e.prototype.createZXingFormats=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];this.formatMap.has(r)?t.push(this.formatMap.get(r)):this.logger.logError("".concat(r," is not supported by")+"ZXingHtml5QrcodeShim")}return t},e.prototype.createDebugData=function(){return{decoderName:"zxing-js"}},e}(),L=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){var u=[s,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},O=function(){function e(t,n,r){if(this.formatMap=new Map([[h.QR_CODE,"qr_code"],[h.AZTEC,"aztec"],[h.CODABAR,"codabar"],[h.CODE_39,"code_39"],[h.CODE_93,"code_93"],[h.CODE_128,"code_128"],[h.DATA_MATRIX,"data_matrix"],[h.ITF,"itf"],[h.EAN_13,"ean_13"],[h.EAN_8,"ean_8"],[h.PDF_417,"pdf417"],[h.UPC_A,"upc_a"],[h.UPC_E,"upc_e"]]),this.reverseFormatMap=this.createReverseFormatMap(),!e.isSupported())throw"Use html5qrcode.min.js without edit, Use BarcodeDetectorDelegate only if it isSupported();";this.verbose=n,this.logger=r;var o=this.createBarcodeDetectorFormats(t);if(this.detector=new BarcodeDetector(o),!this.detector)throw"BarcodeDetector detector not supported"}return e.isSupported=function(){return"BarcodeDetector"in window&&(new BarcodeDetector({formats:["qr_code"]}),!0)},e.prototype.decodeAsync=function(e){var t,n,r,o;return t=this,n=void 0,r=void 0,o=function(){var t,n;return L(this,function(r){switch(r.label){case 0:return[4,this.detector.detect(e)];case 1:if(!(t=r.sent())||0===t.length)throw"No barcode or QR code detected.";return[2,{text:(n=this.selectLargestBarcode(t)).rawValue,format:T.create(this.toHtml5QrcodeSupportedFormats(n.format)),debugData:this.createDebugData()}]}})},new(r||(r=Promise))(function(e,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(t){var n;t.done?e(t.value):((n=t.value)instanceof r?n:new r(function(e){e(n)})).then(a,s)}c((o=o.apply(t,n||[])).next())})},e.prototype.selectLargestBarcode=function(e){for(var t=null,n=0,r=0;r<e.length;r++){var o=e[r],i=o.boundingBox.width*o.boundingBox.height;i>n&&(n=i,t=o)}if(!t)throw"No largest barcode found";return t},e.prototype.createBarcodeDetectorFormats=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];this.formatMap.has(r)?t.push(this.formatMap.get(r)):this.logger.warn("".concat(r," is not supported by")+"BarcodeDetectorDelegate")}return{formats:t}},e.prototype.toHtml5QrcodeSupportedFormats=function(e){if(!this.reverseFormatMap.has(e))throw"reverseFormatMap doesn't have ".concat(e);return this.reverseFormatMap.get(e)},e.prototype.createReverseFormatMap=function(){var e=new Map;return this.formatMap.forEach(function(t,n,r){e.set(t,n)}),e},e.prototype.createDebugData=function(){return{decoderName:"BarcodeDetector"}},e}(),_=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},x=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){var u=[s,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},R=function(){function e(e,t,n,r){this.EXECUTIONS_TO_REPORT_PERFORMANCE=100,this.executions=0,this.executionResults=[],this.wasPrimaryDecoderUsedInLastDecode=!1,this.verbose=n,t&&O.isSupported()?(this.primaryDecoder=new O(e,n,r),this.secondaryDecoder=new w(e,n,r)):this.primaryDecoder=new w(e,n,r)}return e.prototype.decodeAsync=function(e){return _(this,void 0,void 0,function(){var t;return x(this,function(n){switch(n.label){case 0:t=performance.now(),n.label=1;case 1:return n.trys.push([1,,3,4]),[4,this.getDecoder().decodeAsync(e)];case 2:return[2,n.sent()];case 3:return this.possiblyLogPerformance(t),[7];case 4:return[2]}})})},e.prototype.decodeRobustlyAsync=function(e){return _(this,void 0,void 0,function(){var t,n;return x(this,function(r){switch(r.label){case 0:t=performance.now(),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,this.primaryDecoder.decodeAsync(e)];case 2:return[2,r.sent()];case 3:if(n=r.sent(),this.secondaryDecoder)return[2,this.secondaryDecoder.decodeAsync(e)];throw n;case 4:return this.possiblyLogPerformance(t),[7];case 5:return[2]}})})},e.prototype.getDecoder=function(){return this.secondaryDecoder?!1===this.wasPrimaryDecoderUsedInLastDecode?(this.wasPrimaryDecoderUsedInLastDecode=!0,this.primaryDecoder):(this.wasPrimaryDecoderUsedInLastDecode=!1,this.secondaryDecoder):this.primaryDecoder},e.prototype.possiblyLogPerformance=function(e){if(this.verbose){var t=performance.now()-e;this.executionResults.push(t),this.executions++,this.possiblyFlushPerformanceReport()}},e.prototype.possiblyFlushPerformanceReport=function(){if(!(this.executions<this.EXECUTIONS_TO_REPORT_PERFORMANCE)){for(var e=0,t=0,n=this.executionResults;t<n.length;t++)e+=n[t];var r=e/this.executionResults.length;console.log("".concat(r," ms for ").concat(this.executionResults.length," last runs.")),this.executions=0,this.executionResults=[]}},e}(),U=(a=function(e,t){return(a=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)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),j=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},B=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){var u=[s,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},F=function(){function e(e,t){this.name=e,this.track=t}return e.prototype.isSupported=function(){return!!this.track.getCapabilities&&this.name in this.track.getCapabilities()},e.prototype.apply=function(e){var t={};return t[this.name]=e,this.track.applyConstraints({advanced:[t]})},e.prototype.value=function(){var e=this.track.getSettings();return this.name in e?e[this.name]:null},e}(),z=function(e){function t(t){return e.call(this,"zoom",t)||this}return U(t,e),t}(function(e){function t(t,n){return e.call(this,t,n)||this}return U(t,e),t.prototype.min=function(){return this.getCapabilities().min},t.prototype.max=function(){return this.getCapabilities().max},t.prototype.step=function(){return this.getCapabilities().step},t.prototype.apply=function(e){var t={};return t[this.name]=e,this.track.applyConstraints({advanced:[t]})},t.prototype.getCapabilities=function(){this.failIfNotSupported();var e=this.track.getCapabilities()[this.name];return{min:e.min,max:e.max,step:e.step}},t.prototype.failIfNotSupported=function(){if(!this.isSupported())throw Error("".concat(this.name," capability not supported"))},t}(F)),k=function(e){function t(t){return e.call(this,"torch",t)||this}return U(t,e),t}(F),P=function(){function e(e){this.track=e}return e.prototype.zoomFeature=function(){return new z(this.track)},e.prototype.torchFeature=function(){return new k(this.track)},e}(),Q=function(){function e(e,t,n){this.isClosed=!1,this.parentElement=e,this.mediaStream=t,this.callbacks=n,this.surface=this.createVideoElement(this.parentElement.clientWidth),e.append(this.surface)}return e.prototype.createVideoElement=function(e){var t=document.createElement("video");return t.style.width="".concat(e,"px"),t.style.display="block",t.muted=!0,t.setAttribute("muted","true"),t.playsInline=!0,t},e.prototype.setupSurface=function(){var e=this;this.surface.onabort=function(){throw"RenderedCameraImpl video surface onabort() called"},this.surface.onerror=function(){throw"RenderedCameraImpl video surface onerror() called"};var t=function(){var n=e.surface.clientWidth,r=e.surface.clientHeight;e.callbacks.onRenderSurfaceReady(n,r),e.surface.removeEventListener("playing",t)};this.surface.addEventListener("playing",t),this.surface.srcObject=this.mediaStream,this.surface.play()},e.create=function(t,n,r,o){return j(this,void 0,void 0,function(){var i,a;return B(this,function(s){switch(s.label){case 0:if(i=new e(t,n,o),!r.aspectRatio)return[3,2];return a={aspectRatio:r.aspectRatio},[4,i.getFirstTrackOrFail().applyConstraints(a)];case 1:s.sent(),s.label=2;case 2:return i.setupSurface(),[2,i]}})})},e.prototype.failIfClosed=function(){if(this.isClosed)throw"The RenderedCamera has already been closed."},e.prototype.getFirstTrackOrFail=function(){if(this.failIfClosed(),0===this.mediaStream.getVideoTracks().length)throw"No video tracks found";return this.mediaStream.getVideoTracks()[0]},e.prototype.pause=function(){this.failIfClosed(),this.surface.pause()},e.prototype.resume=function(e){this.failIfClosed();var t=this,n=function(){setTimeout(e,200),t.surface.removeEventListener("playing",n)};this.surface.addEventListener("playing",n),this.surface.play()},e.prototype.isPaused=function(){return this.failIfClosed(),this.surface.paused},e.prototype.getSurface=function(){return this.failIfClosed(),this.surface},e.prototype.getRunningTrackCapabilities=function(){return this.getFirstTrackOrFail().getCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getFirstTrackOrFail().getSettings()},e.prototype.applyVideoConstraints=function(e){return j(this,void 0,void 0,function(){return B(this,function(t){if("aspectRatio"in e)throw"Changing 'aspectRatio' in run-time is not yet supported.";return[2,this.getFirstTrackOrFail().applyConstraints(e)]})})},e.prototype.close=function(){if(this.isClosed)return Promise.resolve();var e=this;return new Promise(function(t,n){var r=e.mediaStream.getVideoTracks().length,o=0;e.mediaStream.getVideoTracks().forEach(function(n){e.mediaStream.removeTrack(n),n.stop(),++o>=r&&(e.isClosed=!0,e.parentElement.removeChild(e.surface),t())})})},e.prototype.getCapabilities=function(){return new P(this.getFirstTrackOrFail())},e}(),H=function(){function e(e){this.mediaStream=e}return e.prototype.render=function(e,t,n){return j(this,void 0,void 0,function(){return B(this,function(r){return[2,Q.create(e,this.mediaStream,t,n)]})})},e.create=function(t){return j(this,void 0,void 0,function(){var n;return B(this,function(r){switch(r.label){case 0:if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return n={audio:!1,video:t},[4,navigator.mediaDevices.getUserMedia(n)];case 1:return[2,new e(r.sent())]}})})},e}(),Y=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},V=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){var u=[s,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},q=function(){function e(){}return e.failIfNotSupported=function(){return Y(this,void 0,void 0,function(){return V(this,function(t){if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return[2,new e]})})},e.prototype.create=function(e){return Y(this,void 0,void 0,function(){return V(this,function(t){return[2,H.create(e)]})})},e}(),W=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){var u=[s,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},G=function(){function e(){}return e.retrieve=function(){if(navigator.mediaDevices)return e.getCamerasFromMediaDevices();var t=MediaStreamTrack;return MediaStreamTrack&&t.getSources?e.getCamerasFromMediaStreamTrack():e.rejectWithError()},e.rejectWithError=function(){var t=A.unableToQuerySupportedDevices();return e.isHttpsOrLocalhost()||(t=A.insecureContextCameraQueryError()),Promise.reject(t)},e.isHttpsOrLocalhost=function(){if("https:"===location.protocol)return!0;var e=location.host.split(":")[0];return"127.0.0.1"===e||"localhost"===e},e.getCamerasFromMediaDevices=function(){var e,t,n,r;return e=this,t=void 0,n=void 0,r=function(){var e,t,n,r,o,i,a;return W(this,function(s){switch(s.label){case 0:return e=function(e){for(var t=e.getVideoTracks(),n=0;n<t.length;n++){var r=t[n];r.enabled=!1,r.stop(),e.removeTrack(r)}},[4,navigator.mediaDevices.getUserMedia({audio:!1,video:!0})];case 1:return t=s.sent(),[4,navigator.mediaDevices.enumerateDevices()];case 2:for(o=0,n=s.sent(),r=[],i=n;o<i.length;o++)"videoinput"===(a=i[o]).kind&&r.push({id:a.deviceId,label:a.label});return e(t),[2,r]}})},new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},e.getCamerasFromMediaStreamTrack=function(){return new Promise(function(e,t){MediaStreamTrack.getSources(function(t){for(var n=[],r=0;r<t.length;r++){var o=t[r];"video"===o.kind&&n.push({id:o.id,label:o.label})}e(n)})})},e}();(s=g||(g={}))[s.UNKNOWN=0]="UNKNOWN",s[s.NOT_STARTED=1]="NOT_STARTED",s[s.SCANNING=2]="SCANNING",s[s.PAUSED=3]="PAUSED";var X=function(){function e(){this.state=g.NOT_STARTED,this.onGoingTransactionNewState=g.UNKNOWN}return e.prototype.directTransition=function(e){this.failIfTransitionOngoing(),this.validateTransition(e),this.state=e},e.prototype.startTransition=function(e){return this.failIfTransitionOngoing(),this.validateTransition(e),this.onGoingTransactionNewState=e,this},e.prototype.execute=function(){if(this.onGoingTransactionNewState===g.UNKNOWN)throw"Transaction is already cancelled, cannot execute().";var e=this.onGoingTransactionNewState;this.onGoingTransactionNewState=g.UNKNOWN,this.directTransition(e)},e.prototype.cancel=function(){if(this.onGoingTransactionNewState===g.UNKNOWN)throw"Transaction is already cancelled, cannot cancel().";this.onGoingTransactionNewState=g.UNKNOWN},e.prototype.getState=function(){return this.state},e.prototype.failIfTransitionOngoing=function(){if(this.onGoingTransactionNewState!==g.UNKNOWN)throw"Cannot transition to a new state, already under transition"},e.prototype.validateTransition=function(e){switch(this.state){case g.UNKNOWN:throw"Transition from unknown is not allowed";case g.NOT_STARTED:this.failIfNewStateIs(e,[g.PAUSED]);case g.SCANNING:case g.PAUSED:}},e.prototype.failIfNewStateIs=function(e,t){for(var n=0;n<t.length;n++)if(e===t[n])throw"Cannot transition from ".concat(this.state," to ").concat(e)},e}(),Z=function(){function e(e){this.stateManager=e}return e.prototype.startTransition=function(e){return this.stateManager.startTransition(e)},e.prototype.directTransition=function(e){this.stateManager.directTransition(e)},e.prototype.getState=function(){return this.stateManager.getState()},e.prototype.canScanFile=function(){return this.stateManager.getState()===g.NOT_STARTED},e.prototype.isScanning=function(){return this.stateManager.getState()!==g.NOT_STARTED},e.prototype.isStrictlyScanning=function(){return this.stateManager.getState()===g.SCANNING},e.prototype.isPaused=function(){return this.stateManager.getState()===g.PAUSED},e}(),K=function(){function e(){}return e.create=function(){return new Z(new X)},e}(),J=(c=function(e,t){return(c=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)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}c(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),$=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return J(t,e),t.DEFAULT_WIDTH=300,t.DEFAULT_WIDTH_OFFSET=2,t.FILE_SCAN_MIN_HEIGHT=300,t.FILE_SCAN_HIDDEN_CANVAS_PADDING=100,t.MIN_QR_BOX_SIZE=50,t.SHADED_LEFT=1,t.SHADED_RIGHT=2,t.SHADED_TOP=3,t.SHADED_BOTTOM=4,t.SHADED_REGION_ELEMENT_ID="qr-shaded-region",t.VERBOSE=!1,t.BORDER_SHADER_DEFAULT_COLOR="#ffffff",t.BORDER_SHADER_MATCH_COLOR="rgb(90, 193, 56)",t}(S),ee=function(){function e(e,t){this.logger=t,this.fps=$.SCAN_DEFAULT_FPS,e?(e.fps&&(this.fps=e.fps),this.disableFlip=!0===e.disableFlip,this.qrbox=e.qrbox,this.aspectRatio=e.aspectRatio,this.videoConstraints=e.videoConstraints):this.disableFlip=$.DEFAULT_DISABLE_FLIP}return e.prototype.isMediaStreamConstraintsValid=function(){return this.videoConstraints?N.isMediaStreamConstraintsValid(this.videoConstraints,this.logger):(this.logger.logError("Empty videoConstraints",!0),!1)},e.prototype.isShadedBoxEnabled=function(){return!I(this.qrbox)},e.create=function(t,n){return new e(t,n)},e}(),et=function(){function e(e,t){var n;if(this.element=null,this.canvasElement=null,this.scannerPausedUiElement=null,this.hasBorderShaders=null,this.borderShaders=null,this.qrMatch=null,this.renderedCamera=null,this.qrRegion=null,this.context=null,this.lastScanImageFile=null,this.isScanning=!1,!document.getElementById(e))throw"HTML Element with id=".concat(e," not found");this.elementId=e,this.verbose=!1,"boolean"==typeof t?this.verbose=!0===t:t&&(n=t,this.verbose=!0===n.verbose,n.experimentalFeatures),this.logger=new E(this.verbose),this.qrcode=new R(this.getSupportedFormats(t),this.getUseBarCodeDetectorIfSupported(n),this.verbose,this.logger),this.foreverScanTimeout,this.shouldScan=!0,this.stateManagerProxy=K.create()}return e.prototype.start=function(e,t,n,r){var o,i=this;if(!e)throw"cameraIdOrConfig is required";if(!n||"function"!=typeof n)throw"qrCodeSuccessCallback is required and should be a function.";o=r||(this.verbose?this.logger.log:function(){});var a=ee.create(t,this.logger);this.clearElement();var s=!1;a.videoConstraints&&(a.isMediaStreamConstraintsValid()?s=!0:this.logger.logError("'videoConstraints' is not valid 'MediaStreamConstraints, it will be ignored.'",!0));var c=s,u=document.getElementById(this.elementId);u.clientWidth?u.clientWidth:$.DEFAULT_WIDTH,u.style.position="relative",this.shouldScan=!0,this.element=u;var l=this,h=this.stateManagerProxy.startTransition(g.SCANNING);return new Promise(function(t,r){var s=c?a.videoConstraints:l.createVideoConstraints(e);if(!s){h.cancel(),r("videoConstraints should be defined");return}var u={};(!c||a.aspectRatio)&&(u.aspectRatio=a.aspectRatio);var d={onRenderSurfaceReady:function(e,t){l.setupUi(e,t,a),l.isScanning=!0,l.foreverScan(a,n,o)}};q.failIfNotSupported().then(function(e){e.create(s).then(function(e){return e.render(i.element,u,d).then(function(e){l.renderedCamera=e,h.execute(),t(null)}).catch(function(e){h.cancel(),r(e)})}).catch(function(e){h.cancel(),r(A.errorGettingUserMedia(e))})}).catch(function(e){h.cancel(),r(A.cameraStreamingNotSupported())})})},e.prototype.pause=function(e){if(!this.stateManagerProxy.isStrictlyScanning())throw"Cannot pause, scanner is not scanning.";this.stateManagerProxy.directTransition(g.PAUSED),this.showPausedState(),(I(e)||!0!==e)&&(e=!1),e&&this.renderedCamera&&this.renderedCamera.pause()},e.prototype.resume=function(){if(!this.stateManagerProxy.isPaused())throw"Cannot result, scanner is not paused.";if(!this.renderedCamera)throw"renderedCamera doesn't exist while trying resume()";var e=this,t=function(){e.stateManagerProxy.directTransition(g.SCANNING),e.hidePausedState()};this.renderedCamera.isPaused()?this.renderedCamera.resume(function(){t()}):t()},e.prototype.getState=function(){return this.stateManagerProxy.getState()},e.prototype.stop=function(){var e=this;if(!this.stateManagerProxy.isScanning())throw"Cannot stop, scanner is not running or paused.";var t=this.stateManagerProxy.startTransition(g.NOT_STARTED);this.shouldScan=!1,this.foreverScanTimeout&&clearTimeout(this.foreverScanTimeout);var n=function(){if(e.element){var t=document.getElementById($.SHADED_REGION_ELEMENT_ID);t&&e.element.removeChild(t)}},r=this;return this.renderedCamera.close().then(function(){return r.renderedCamera=null,r.element&&(r.element.removeChild(r.canvasElement),r.canvasElement=null),n(),r.qrRegion&&(r.qrRegion=null),r.context&&(r.context=null),t.execute(),r.hidePausedState(),r.isScanning=!1,Promise.resolve()})},e.prototype.scanFile=function(e,t){return this.scanFileV2(e,t).then(function(e){return e.decodedText})},e.prototype.scanFileV2=function(e,t){var n=this;if(!e||!(e instanceof File))throw"imageFile argument is mandatory and should be instance of File. Use 'event.target.files[0]'.";if(I(t)&&(t=!0),!this.stateManagerProxy.canScanFile())throw"Cannot start file scan - ongoing camera scan";return new Promise(function(r,o){n.possiblyCloseLastScanImageFile(),n.clearElement(),n.lastScanImageFile=URL.createObjectURL(e);var i=new Image;i.onload=function(){var e=i.width,a=i.height,s=document.getElementById(n.elementId),c=s.clientWidth?s.clientWidth:$.DEFAULT_WIDTH,u=Math.max(s.clientHeight?s.clientHeight:a,$.FILE_SCAN_MIN_HEIGHT),l=n.computeCanvasDrawConfig(e,a,c,u);if(t){var h=n.createCanvasElement(c,u,"qr-canvas-visible");h.style.display="inline-block",s.appendChild(h);var d=h.getContext("2d");if(!d)throw"Unable to get 2d context from canvas";d.canvas.width=c,d.canvas.height=u,d.drawImage(i,0,0,e,a,l.x,l.y,l.width,l.height)}var p=$.FILE_SCAN_HIDDEN_CANVAS_PADDING,f=Math.max(i.width,l.width),g=Math.max(i.height,l.height),y=f+2*p,m=g+2*p,S=n.createCanvasElement(y,m);s.appendChild(S);var T=S.getContext("2d");if(!T)throw"Unable to get 2d context from canvas";T.canvas.width=y,T.canvas.height=m,T.drawImage(i,0,0,e,a,p,p,f,g);try{n.qrcode.decodeRobustlyAsync(S).then(function(e){r(M.createFromQrcodeResult(e))}).catch(o)}catch(e){o("QR code parse error, error = ".concat(e))}},i.onerror=o,i.onabort=o,i.onstalled=o,i.onsuspend=o,i.src=URL.createObjectURL(e)})},e.prototype.clear=function(){this.clearElement()},e.getCameras=function(){return G.retrieve()},e.prototype.getRunningTrackCapabilities=function(){return this.getRenderedCameraOrFail().getRunningTrackCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getRenderedCameraOrFail().getRunningTrackSettings()},e.prototype.getRunningTrackCameraCapabilities=function(){return this.getRenderedCameraOrFail().getCapabilities()},e.prototype.applyVideoConstraints=function(e){if(e){if(!N.isMediaStreamConstraintsValid(e,this.logger))throw"invalid videoConstaints passed, check logs for more details"}else throw"videoConstaints is required argument.";return this.getRenderedCameraOrFail().applyVideoConstraints(e)},e.prototype.getRenderedCameraOrFail=function(){if(null==this.renderedCamera)throw"Scanning is not in running state, call this API only when QR code scanning using camera is in running state.";return this.renderedCamera},e.prototype.getSupportedFormats=function(e){var t=[h.QR_CODE,h.AZTEC,h.CODABAR,h.CODE_39,h.CODE_93,h.CODE_128,h.DATA_MATRIX,h.MAXICODE,h.ITF,h.EAN_13,h.EAN_8,h.PDF_417,h.RSS_14,h.RSS_EXPANDED,h.UPC_A,h.UPC_E,h.UPC_EAN_EXTENSION];if(!e||"boolean"==typeof e||!e.formatsToSupport)return t;if(!Array.isArray(e.formatsToSupport))throw"configOrVerbosityFlag.formatsToSupport should be undefined or an array.";if(0===e.formatsToSupport.length)throw"Atleast 1 formatsToSupport is needed.";for(var n=[],r=0,o=e.formatsToSupport;r<o.length;r++){var i=o[r];Object.values(h).includes(i)?n.push(i):this.logger.warn("Invalid format: ".concat(i," passed in config, ignoring."))}if(0===n.length)throw"None of formatsToSupport match supported values.";return n},e.prototype.getUseBarCodeDetectorIfSupported=function(e){if(I(e))return!0;if(!I(e.useBarCodeDetectorIfSupported))return!1!==e.useBarCodeDetectorIfSupported;if(I(e.experimentalFeatures))return!0;var t=e.experimentalFeatures;return!!I(t.useBarCodeDetectorIfSupported)||!1!==t.useBarCodeDetectorIfSupported},e.prototype.validateQrboxSize=function(e,t,n){var r,o=n.qrbox;this.validateQrboxConfig(o);var i=this.toQrdimensions(e,t,o),a=function(e){if(e<$.MIN_QR_BOX_SIZE)throw"minimum size of 'config.qrbox' dimension value is"+" ".concat($.MIN_QR_BOX_SIZE,"px.")};a(i.width),a(i.height),(r=i.width)>e&&(this.logger.warn("`qrbox.width` or `qrbox` is larger than the width of the root element. The width will be truncated to the width of root element."),r=e),i.width=r},e.prototype.validateQrboxConfig=function(e){if("number"!=typeof e&&"function"!=typeof e&&(void 0===e.width||void 0===e.height))throw"Invalid instance of QrDimensions passed for 'config.qrbox'. Both 'width' and 'height' should be set."},e.prototype.toQrdimensions=function(e,t,n){if("number"==typeof n)return{width:n,height:n};if("function"==typeof n)try{return n(e,t)}catch(e){throw Error("qrbox config was passed as a function but it failed with unknown error"+e)}return n},e.prototype.setupUi=function(e,t,n){n.isShadedBoxEnabled()&&this.validateQrboxSize(e,t,n);var r=I(n.qrbox)?{width:e,height:t}:n.qrbox;this.validateQrboxConfig(r);var o=this.toQrdimensions(e,t,r);o.height>t&&this.logger.warn("[Html5Qrcode] config.qrbox has height that isgreater than the height of the video stream. Shading will be ignored");var i=n.isShadedBoxEnabled()&&o.height<=t,a=i?this.getShadedRegionBounds(e,t,o):{x:0,y:0,width:e,height:t},s=this.createCanvasElement(a.width,a.height),c=s.getContext("2d",{willReadFrequently:!0});c.canvas.width=a.width,c.canvas.height=a.height,this.element.append(s),i&&this.possiblyInsertShadingElement(this.element,e,t,o),this.createScannerPausedUiElement(this.element),this.qrRegion=a,this.context=c,this.canvasElement=s},e.prototype.createScannerPausedUiElement=function(e){var t=document.createElement("div");t.innerText=A.scannerPaused(),t.style.display="none",t.style.position="absolute",t.style.top="0px",t.style.zIndex="1",t.style.background="rgba(9, 9, 9, 0.46)",t.style.color="#FFECEC",t.style.textAlign="center",t.style.width="100%",e.appendChild(t),this.scannerPausedUiElement=t},e.prototype.scanContext=function(e,t){var n=this;return this.stateManagerProxy.isPaused()?Promise.resolve(!1):this.qrcode.decodeAsync(this.canvasElement).then(function(t){return e(t.text,M.createFromQrcodeResult(t)),n.possiblyUpdateShaders(!0),!0}).catch(function(e){n.possiblyUpdateShaders(!1);var r=A.codeParseError(e);return t(r,C.createFrom(r)),!1})},e.prototype.foreverScan=function(e,t,n){var r=this;if(this.shouldScan&&this.renderedCamera){var o=this.renderedCamera.getSurface(),i=o.videoWidth/o.clientWidth,a=o.videoHeight/o.clientHeight;if(!this.qrRegion)throw"qrRegion undefined when localMediaStream is ready.";var s=this.qrRegion.width*i,c=this.qrRegion.height*a,u=this.qrRegion.x*i,l=this.qrRegion.y*a;this.context.drawImage(o,u,l,s,c,0,0,this.qrRegion.width,this.qrRegion.height);var h=function(){r.foreverScanTimeout=setTimeout(function(){r.foreverScan(e,t,n)},r.getTimeoutFps(e.fps))};this.scanContext(t,n).then(function(o){o||!0===e.disableFlip?h():(r.context.translate(r.context.canvas.width,0),r.context.scale(-1,1),r.scanContext(t,n).finally(function(){h()}))}).catch(function(e){r.logger.logError("Error happend while scanning context",e),h()})}},e.prototype.createVideoConstraints=function(e){if("string"==typeof e)return{deviceId:{exact:e}};if("object"==typeof e){var t="facingMode",n="deviceId",r={user:!0,environment:!0},o="exact",i=function(e){if(e in r)return!0;throw"config has invalid 'facingMode' value = "+"'".concat(e,"'")},a=Object.keys(e);if(1!==a.length)throw"'cameraIdOrConfig' object should have exactly 1 key,"+" if passed as an object, found ".concat(a.length," keys");var s=Object.keys(e)[0];if(s!==t&&s!==n)throw"Only '".concat(t,"' and '").concat(n,"' ")+" are supported for 'cameraIdOrConfig'";if(s===t){var c=e.facingMode;if("string"==typeof c){if(i(c))return{facingMode:c}}else if("object"==typeof c)if(o in c){if(i(c["".concat(o)]))return{facingMode:{exact:c["".concat(o)]}}}else throw"'facingMode' should be string or object with"+" ".concat(o," as key.");else{var u=typeof c;throw"Invalid type of 'facingMode' = ".concat(u)}}else{var l=e.deviceId;if("string"==typeof l)return{deviceId:l};if("object"==typeof l)if(o in l)return{deviceId:{exact:l["".concat(o)]}};else throw"'deviceId' should be string or object with"+" ".concat(o," as key.");var h=typeof l;throw"Invalid type of 'deviceId' = ".concat(h)}}var d=typeof e;throw"Invalid type of 'cameraIdOrConfig' = ".concat(d)},e.prototype.computeCanvasDrawConfig=function(e,t,n,r){if(e<=n&&t<=r)return{x:(n-e)/2,y:(r-t)/2,width:e,height:t};var o=e,i=t;return e>n&&(t=n/e*t,e=n),t>r&&(e=r/t*e,t=r),this.logger.log("Image downsampled from "+"".concat(o,"X").concat(i)+" to ".concat(e,"X").concat(t,".")),this.computeCanvasDrawConfig(e,t,n,r)},e.prototype.clearElement=function(){if(this.stateManagerProxy.isScanning())throw"Cannot clear while scan is ongoing, close it first.";var e=document.getElementById(this.elementId);e&&(e.innerHTML="")},e.prototype.possiblyUpdateShaders=function(e){this.qrMatch!==e&&(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(t){t.style.backgroundColor=e?$.BORDER_SHADER_MATCH_COLOR:$.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=e)},e.prototype.possiblyCloseLastScanImageFile=function(){this.lastScanImageFile&&(URL.revokeObjectURL(this.lastScanImageFile),this.lastScanImageFile=null)},e.prototype.createCanvasElement=function(e,t,n){var r=document.createElement("canvas");return r.style.width="".concat(e,"px"),r.style.height="".concat(t,"px"),r.style.display="none",r.id=I(n)?"qr-canvas":n,r},e.prototype.getShadedRegionBounds=function(e,t,n){if(n.width>e||n.height>t)throw"'config.qrbox' dimensions should not be greater than the dimensions of the root HTML element.";return{x:(e-n.width)/2,y:(t-n.height)/2,width:n.width,height:n.height}},e.prototype.possiblyInsertShadingElement=function(e,t,n,r){if(!(t-r.width<1)&&!(n-r.height<1)){var o=document.createElement("div");o.style.position="absolute";var i=(t-r.width)/2,a=(n-r.height)/2;o.style.borderLeft="".concat(i,"px solid rgba(0, 0, 0, 0.48)"),o.style.borderRight="".concat(i,"px solid rgba(0, 0, 0, 0.48)"),o.style.borderTop="".concat(a,"px solid rgba(0, 0, 0, 0.48)"),o.style.borderBottom="".concat(a,"px solid rgba(0, 0, 0, 0.48)"),o.style.boxSizing="border-box",o.style.top="0px",o.style.bottom="0px",o.style.left="0px",o.style.right="0px",o.id="".concat($.SHADED_REGION_ELEMENT_ID),t-r.width<11||n-r.height<11?this.hasBorderShaders=!1:(this.insertShaderBorders(o,40,5,-5,null,0,!0),this.insertShaderBorders(o,40,5,-5,null,0,!1),this.insertShaderBorders(o,40,5,null,-5,0,!0),this.insertShaderBorders(o,40,5,null,-5,0,!1),this.insertShaderBorders(o,5,45,-5,null,-5,!0),this.insertShaderBorders(o,5,45,null,-5,-5,!0),this.insertShaderBorders(o,5,45,-5,null,-5,!1),this.insertShaderBorders(o,5,45,null,-5,-5,!1),this.hasBorderShaders=!0),e.append(o)}},e.prototype.insertShaderBorders=function(e,t,n,r,o,i,a){var s=document.createElement("div");s.style.position="absolute",s.style.backgroundColor=$.BORDER_SHADER_DEFAULT_COLOR,s.style.width="".concat(t,"px"),s.style.height="".concat(n,"px"),null!==r&&(s.style.top="".concat(r,"px")),null!==o&&(s.style.bottom="".concat(o,"px")),a?s.style.left="".concat(i,"px"):s.style.right="".concat(i,"px"),this.borderShaders||(this.borderShaders=[]),this.borderShaders.push(s),e.appendChild(s)},e.prototype.showPausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="block"},e.prototype.hidePausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="none"},e.prototype.getTimeoutFps=function(e){return 1e3/e},e}(),en="data:image/svg+xml;base64,",er=en+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzNzEuNjQzIDM3MS42NDMiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDM3MS42NDMgMzcxLjY0MyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBhdGggZD0iTTEwNS4wODQgMzguMjcxaDE2My43Njh2MjBIMTA1LjA4NHoiLz48cGF0aCBkPSJNMzExLjU5NiAxOTAuMTg5Yy03LjQ0MS05LjM0Ny0xOC40MDMtMTYuMjA2LTMyLjc0My0yMC41MjJWMzBjMC0xNi41NDItMTMuNDU4LTMwLTMwLTMwSDEyNS4wODRjLTE2LjU0MiAwLTMwIDEzLjQ1OC0zMCAzMHYxMjAuMTQzaC04LjI5NmMtMTYuNTQyIDAtMzAgMTMuNDU4LTMwIDMwdjEuMzMzYTI5LjgwNCAyOS44MDQgMCAwIDAgNC42MDMgMTUuOTM5Yy03LjM0IDUuNDc0LTEyLjEwMyAxNC4yMjEtMTIuMTAzIDI0LjA2MXYxLjMzM2MwIDkuODQgNC43NjMgMTguNTg3IDEyLjEwMyAyNC4wNjJhMjkuODEgMjkuODEgMCAwIDAtNC42MDMgMTUuOTM4djEuMzMzYzAgMTYuNTQyIDEzLjQ1OCAzMCAzMCAzMGg4LjMyNGMuNDI3IDExLjYzMSA3LjUwMyAyMS41ODcgMTcuNTM0IDI2LjE3Ny45MzEgMTAuNTAzIDQuMDg0IDMwLjE4NyAxNC43NjggNDUuNTM3YTkuOTg4IDkuOTg4IDAgMCAwIDguMjE2IDQuMjg4IDkuOTU4IDkuOTU4IDAgMCAwIDUuNzA0LTEuNzkzYzQuNTMzLTMuMTU1IDUuNjUtOS4zODggMi40OTUtMTMuOTIxLTYuNzk4LTkuNzY3LTkuNjAyLTIyLjYwOC0xMC43Ni0zMS40aDgyLjY4NWMuMjcyLjQxNC41NDUuODE4LjgxNSAxLjIxIDMuMTQyIDQuNTQxIDkuMzcyIDUuNjc5IDEzLjkxMyAyLjUzNCA0LjU0Mi0zLjE0MiA1LjY3Ny05LjM3MSAyLjUzNS0xMy45MTMtMTEuOTE5LTE3LjIyOS04Ljc4Ny0zNS44ODQgOS41ODEtNTcuMDEyIDMuMDY3LTIuNjUyIDEyLjMwNy0xMS43MzIgMTEuMjE3LTI0LjAzMy0uODI4LTkuMzQzLTcuMTA5LTE3LjE5NC0xOC42NjktMjMuMzM3YTkuODU3IDkuODU3IDAgMCAwLTEuMDYxLS40ODZjLS40NjYtLjE4Mi0xMS40MDMtNC41NzktOS43NDEtMTUuNzA2IDEuMDA3LTYuNzM3IDE0Ljc2OC04LjI3MyAyMy43NjYtNy42NjYgMjMuMTU2IDEuNTY5IDM5LjY5OCA3LjgwMyA0Ny44MzYgMTguMDI2IDUuNzUyIDcuMjI1IDcuNjA3IDE2LjYyMyA1LjY3MyAyOC43MzMtLjQxMyAyLjU4NS0uODI0IDUuMjQxLTEuMjQ1IDcuOTU5LTUuNzU2IDM3LjE5NC0xMi45MTkgODMuNDgzLTQ5Ljg3IDExNC42NjEtNC4yMjEgMy41NjEtNC43NTYgOS44Ny0xLjE5NCAxNC4wOTJhOS45OCA5Ljk4IDAgMCAwIDcuNjQ4IDMuNTUxIDkuOTU1IDkuOTU1IDAgMCAwIDYuNDQ0LTIuMzU4YzQyLjY3Mi0zNi4wMDUgNTAuODAyLTg4LjUzMyA1Ni43MzctMTI2Ljg4OC40MTUtMi42ODQuODIxLTUuMzA5IDEuMjI5LTcuODYzIDIuODM0LTE3LjcyMS0uNDU1LTMyLjY0MS05Ljc3Mi00NC4zNDV6bS0yMzIuMzA4IDQyLjYyYy01LjUxNCAwLTEwLTQuNDg2LTEwLTEwdi0xLjMzM2MwLTUuNTE0IDQuNDg2LTEwIDEwLTEwaDE1djIxLjMzM2gtMTV6bS0yLjUtNTIuNjY2YzAtNS41MTQgNC40ODYtMTAgMTAtMTBoNy41djIxLjMzM2gtNy41Yy01LjUxNCAwLTEwLTQuNDg2LTEwLTEwdi0xLjMzM3ptMTcuNSA5My45OTloLTcuNWMtNS41MTQgMC0xMC00LjQ4Ni0xMC0xMHYtMS4zMzNjMC01LjUxNCA0LjQ4Ni0xMCAxMC0xMGg3LjV2MjEuMzMzem0zMC43OTYgMjguODg3Yy01LjUxNCAwLTEwLTQuNDg2LTEwLTEwdi04LjI3MWg5MS40NTdjLS44NTEgNi42NjgtLjQzNyAxMi43ODcuNzMxIDE4LjI3MWgtODIuMTg4em03OS40ODItMTEzLjY5OGMtMy4xMjQgMjAuOTA2IDEyLjQyNyAzMy4xODQgMjEuNjI1IDM3LjA0IDUuNDQxIDIuOTY4IDcuNTUxIDUuNjQ3IDcuNzAxIDcuMTg4LjIxIDIuMTUtMi41NTMgNS42ODQtNC40NzcgNy4yNTEtLjQ4Mi4zNzgtLjkyOS44LTEuMzM1IDEuMjYxLTYuOTg3IDcuOTM2LTExLjk4MiAxNS41Mi0xNS40MzIgMjIuNjg4aC05Ny41NjRWMzBjMC01LjUxNCA0LjQ4Ni0xMCAxMC0xMGgxMjMuNzY5YzUuNTE0IDAgMTAgNC40ODYgMTAgMTB2MTM1LjU3OWMtMy4wMzItLjM4MS02LjE1LS42OTQtOS4zODktLjkxNC0yNS4xNTktMS42OTQtNDIuMzcgNy43NDgtNDQuODk4IDI0LjY2NnoiLz48cGF0aCBkPSJNMTc5LjEyOSA4My4xNjdoLTI0LjA2YTUgNSAwIDAgMC01IDV2MjQuMDYxYTUgNSAwIDAgMCA1IDVoMjQuMDZhNSA1IDAgMCAwIDUtNVY4OC4xNjdhNSA1IDAgMCAwLTUtNXpNMTcyLjYyOSAxNDIuODZoLTEyLjU2VjEzMC44YTUgNSAwIDEgMC0xMCAwdjE3LjA2MWE1IDUgMCAwIDAgNSA1aDE3LjU2YTUgNSAwIDEgMCAwLTEwLjAwMXpNMjE2LjU2OCA4My4xNjdoLTI0LjA2YTUgNSAwIDAgMC01IDV2MjQuMDYxYTUgNSAwIDAgMCA1IDVoMjQuMDZhNSA1IDAgMCAwIDUtNVY4OC4xNjdhNSA1IDAgMCAwLTUtNXptLTUgMjQuMDYxaC0xNC4wNlY5My4xNjdoMTQuMDZ2MTQuMDYxek0yMTEuNjY5IDEyNS45MzZIMTk3LjQxYTUgNSAwIDAgMC01IDV2MTQuMjU3YTUgNSAwIDAgMCA1IDVoMTQuMjU5YTUgNSAwIDAgMCA1LTV2LTE0LjI1N2E1IDUgMCAwIDAtNS01eiIvPjwvc3ZnPg==",eo=en+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1OS4wMTggNTkuMDE4IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1OS4wMTggNTkuMDE4IiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBkPSJtNTguNzQxIDU0LjgwOS01Ljk2OS02LjI0NGExMC43NCAxMC43NCAwIDAgMCAyLjgyLTcuMjVjMC01Ljk1My00Ljg0My0xMC43OTYtMTAuNzk2LTEwLjc5NlMzNCAzNS4zNjEgMzQgNDEuMzE0IDM4Ljg0MyA1Mi4xMSA0NC43OTYgNTIuMTFjMi40NDEgMCA0LjY4OC0uODI0IDYuNDk5LTIuMTk2bDYuMDAxIDYuMjc3YS45OTguOTk4IDAgMCAwIDEuNDE0LjAzMiAxIDEgMCAwIDAgLjAzMS0xLjQxNHpNMzYgNDEuMzE0YzAtNC44NSAzLjk0Ni04Ljc5NiA4Ljc5Ni04Ljc5NnM4Ljc5NiAzLjk0NiA4Ljc5NiA4Ljc5Ni0zLjk0NiA4Ljc5Ni04Ljc5NiA4Ljc5NlMzNiA0Ni4xNjQgMzYgNDEuMzE0ek0xMC40MzEgMTYuMDg4YzAgMy4wNyAyLjQ5OCA1LjU2OCA1LjU2OSA1LjU2OHM1LjU2OS0yLjQ5OCA1LjU2OS01LjU2OGMwLTMuMDcxLTIuNDk4LTUuNTY5LTUuNTY5LTUuNTY5cy01LjU2OSAyLjQ5OC01LjU2OSA1LjU2OXptOS4xMzggMGMwIDEuOTY4LTEuNjAyIDMuNTY4LTMuNTY5IDMuNTY4cy0zLjU2OS0xLjYwMS0zLjU2OS0zLjU2OCAxLjYwMi0zLjU2OSAzLjU2OS0zLjU2OSAzLjU2OSAxLjYwMSAzLjU2OSAzLjU2OXoiLz48cGF0aCBkPSJtMzAuODgyIDI4Ljk4NyA5LjE4LTEwLjA1NCAxMS4yNjIgMTAuMzIzYTEgMSAwIDAgMCAxLjM1MS0xLjQ3NWwtMTItMTFhMSAxIDAgMCAwLTEuNDE0LjA2M2wtOS43OTQgMTAuNzI3LTQuNzQzLTQuNzQzYTEuMDAzIDEuMDAzIDAgMCAwLTEuMzY4LS4wNDRMNi4zMzkgMzcuNzY4YTEgMSAwIDEgMCAxLjMyMiAxLjUwMWwxNi4zMTMtMTQuMzYyIDcuMzE5IDcuMzE4YS45OTkuOTk5IDAgMSAwIDEuNDE0LTEuNDE0bC0xLjgyNS0xLjgyNHoiLz48cGF0aCBkPSJNMzAgNDYuNTE4SDJ2LTQyaDU0djI4YTEgMSAwIDEgMCAyIDB2LTI5YTEgMSAwIDAgMC0xLTFIMWExIDEgMCAwIDAtMSAxdjQ0YTEgMSAwIDAgMCAxIDFoMjlhMSAxIDAgMSAwIDAtMnoiLz48L3N2Zz4=",ei=en+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0NjAgNDYwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA0NjAgNDYwIiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBkPSJNMjMwIDBDMTAyLjk3NSAwIDAgMTAyLjk3NSAwIDIzMHMxMDIuOTc1IDIzMCAyMzAgMjMwIDIzMC0xMDIuOTc0IDIzMC0yMzBTMzU3LjAyNSAwIDIzMCAwem0zOC4zMzMgMzc3LjM2YzAgOC42NzYtNy4wMzQgMTUuNzEtMTUuNzEgMTUuNzFoLTQzLjEwMWMtOC42NzYgMC0xNS43MS03LjAzNC0xNS43MS0xNS43MVYyMDIuNDc3YzAtOC42NzYgNy4wMzMtMTUuNzEgMTUuNzEtMTUuNzFoNDMuMTAxYzguNjc2IDAgMTUuNzEgNy4wMzMgMTUuNzEgMTUuNzFWMzc3LjM2ek0yMzAgMTU3Yy0yMS41MzkgMC0zOS0xNy40NjEtMzktMzlzMTcuNDYxLTM5IDM5LTM5IDM5IDE3LjQ2MSAzOSAzOS0xNy40NjEgMzktMzkgMzl6Ii8+PC9zdmc+",ea=function(){function e(){}return e.createDefault=function(){return{hasPermission:!1,lastUsedCameraId:null}},e}(),es=function(){function e(){this.data=ea.createDefault();var t=localStorage.getItem(e.LOCAL_STORAGE_KEY);t?this.data=JSON.parse(t):this.reset()}return e.prototype.hasCameraPermissions=function(){return this.data.hasPermission},e.prototype.getLastUsedCameraId=function(){return this.data.lastUsedCameraId},e.prototype.setHasPermission=function(e){this.data.hasPermission=e,this.flush()},e.prototype.setLastUsedCameraId=function(e){this.data.lastUsedCameraId=e,this.flush()},e.prototype.resetLastUsedCameraId=function(){this.data.lastUsedCameraId=null,this.flush()},e.prototype.reset=function(){this.data=ea.createDefault(),this.flush()},e.prototype.flush=function(){localStorage.setItem(e.LOCAL_STORAGE_KEY,JSON.stringify(this.data))},e.LOCAL_STORAGE_KEY="HTML5_QRCODE_DATA",e}(),ec=function(){function e(){this.infoDiv=document.createElement("div")}return e.prototype.renderInto=function(e){this.infoDiv.style.position="absolute",this.infoDiv.style.top="10px",this.infoDiv.style.right="10px",this.infoDiv.style.zIndex="2",this.infoDiv.style.display="none",this.infoDiv.style.padding="5pt",this.infoDiv.style.border="1px solid #171717",this.infoDiv.style.fontSize="10pt",this.infoDiv.style.background="rgb(0 0 0 / 69%)",this.infoDiv.style.borderRadius="5px",this.infoDiv.style.textAlign="center",this.infoDiv.style.fontWeight="400",this.infoDiv.style.color="white",this.infoDiv.innerText=v.poweredBy();var t=document.createElement("a");t.innerText="ScanApp",t.href="https://scanapp.org",t.target="new",t.style.color="white",this.infoDiv.appendChild(t);var n=document.createElement("br"),r=document.createElement("br");this.infoDiv.appendChild(n),this.infoDiv.appendChild(r);var o=document.createElement("a");o.innerText=v.reportIssues(),o.href="https://github.com/mebjas/html5-qrcode/issues",o.target="new",o.style.color="white",this.infoDiv.appendChild(o),e.appendChild(this.infoDiv)},e.prototype.show=function(){this.infoDiv.style.display="block"},e.prototype.hide=function(){this.infoDiv.style.display="none"},e}(),eu=function(){function e(e,t){this.isShowingInfoIcon=!0,this.onTapIn=e,this.onTapOut=t,this.infoIcon=document.createElement("img")}return e.prototype.renderInto=function(e){var t=this;this.infoIcon.alt="Info icon",this.infoIcon.src=ei,this.infoIcon.style.position="absolute",this.infoIcon.style.top="4px",this.infoIcon.style.right="4px",this.infoIcon.style.opacity="0.6",this.infoIcon.style.cursor="pointer",this.infoIcon.style.zIndex="2",this.infoIcon.style.width="16px",this.infoIcon.style.height="16px",this.infoIcon.onmouseover=function(e){return t.onHoverIn()},this.infoIcon.onmouseout=function(e){return t.onHoverOut()},this.infoIcon.onclick=function(e){return t.onClick()},e.appendChild(this.infoIcon)},e.prototype.onHoverIn=function(){this.isShowingInfoIcon&&(this.infoIcon.style.opacity="1")},e.prototype.onHoverOut=function(){this.isShowingInfoIcon&&(this.infoIcon.style.opacity="0.6")},e.prototype.onClick=function(){this.isShowingInfoIcon?(this.isShowingInfoIcon=!1,this.onTapIn(),this.infoIcon.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAQgAAAEIBarqQRAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAE1SURBVDiNfdI7S0NBEAXgLya1otFgpbYSbISAgpXYi6CmiH9KCAiChaVga6OiWPgfRDQ+0itaGVNosXtluWwcuMzePfM4M3sq8lbHBubwg1dc4m1E/J/N4ghDPOIsfk/4xiEao5KX0McFljN4C9d4QTPXuY99jP3DsIoDPGM6BY5i5yI5R7O4q+ImFkJY2DCh3cAH2klyB+9J1xUMMAG7eCh1a+Mr+k48b5diXrFVwwLuS+BJ9MfR7+G0FHOHhTHhnXNWS87VDF4pcnfQK4Ep7XScNLmPTZgURNKKYENYWDpzW1BhscS1WHS8CDgURFJQrWcoF3c13KKbgg1BYQfy8xZWEzTTw1QZbAoKu8FqJnktdu5hcVSHmchiILzzuaDQvjBzV2m8yohCE1jHfPx/xhU+y4G/D75ELlRJsSYAAAAASUVORK5CYII=",this.infoIcon.style.opacity="1"):(this.isShowingInfoIcon=!0,this.onTapOut(),this.infoIcon.src=ei,this.infoIcon.style.opacity="0.6")},e}(),el=function(){function e(){var e=this;this.infoDiv=new ec,this.infoIcon=new eu(function(){e.infoDiv.show()},function(){e.infoDiv.hide()})}return e.prototype.renderInto=function(e){this.infoDiv.renderInto(e),this.infoIcon.renderInto(e)},e}(),eh=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){var u=[s,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},ed=function(){function e(){}return e.hasPermissions=function(){var e,t,n,r;return e=this,t=void 0,n=void 0,r=function(){var e,t,n;return eh(this,function(r){switch(r.label){case 0:return[4,navigator.mediaDevices.enumerateDevices()];case 1:for(e=0,t=r.sent();e<t.length;e++)if("videoinput"===(n=t[e]).kind&&n.label)return[2,!0];return[2,!1]}})},new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},e}(),ep=function(){function e(e){this.supportedScanTypes=this.validateAndReturnScanTypes(e)}return e.prototype.getDefaultScanType=function(){return this.supportedScanTypes[0]},e.prototype.hasMoreThanOneScanType=function(){return this.supportedScanTypes.length>1},e.prototype.isCameraScanRequired=function(){for(var t=0,n=this.supportedScanTypes;t<n.length;t++){var r=n[t];if(e.isCameraScanType(r))return!0}return!1},e.isCameraScanType=function(e){return e===p.SCAN_TYPE_CAMERA},e.isFileScanType=function(e){return e===p.SCAN_TYPE_FILE},e.prototype.validateAndReturnScanTypes=function(e){if(!e||0===e.length)return S.DEFAULT_SUPPORTED_SCAN_TYPE;var t=S.DEFAULT_SUPPORTED_SCAN_TYPE.length;if(e.length>t)throw"Max ".concat(t," values expected for ")+"supportedScanTypes";for(var n=0;n<e.length;n++){var r=e[n];if(!S.DEFAULT_SUPPORTED_SCAN_TYPE.includes(r))throw"Unsupported scan type ".concat(r)}return e},e}(),ef=function(){function e(){}return e.ALL_ELEMENT_CLASS="html5-qrcode-element",e.CAMERA_PERMISSION_BUTTON_ID="html5-qrcode-button-camera-permission",e.CAMERA_START_BUTTON_ID="html5-qrcode-button-camera-start",e.CAMERA_STOP_BUTTON_ID="html5-qrcode-button-camera-stop",e.TORCH_BUTTON_ID="html5-qrcode-button-torch",e.CAMERA_SELECTION_SELECT_ID="html5-qrcode-select-camera",e.FILE_SELECTION_BUTTON_ID="html5-qrcode-button-file-selection",e.ZOOM_SLIDER_ID="html5-qrcode-input-range-zoom",e.SCAN_TYPE_CHANGE_ANCHOR_ID="html5-qrcode-anchor-scan-type-change",e.TORCH_BUTTON_CLASS_TORCH_ON="html5-qrcode-button-torch-on",e.TORCH_BUTTON_CLASS_TORCH_OFF="html5-qrcode-button-torch-off",e}(),eg=function(){function e(){}return e.createElement=function(e,t){var n=document.createElement(e);return n.id=t,n.classList.add(ef.ALL_ELEMENT_CLASS),"button"===e&&n.setAttribute("type","button"),n},e}(),ey=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},em=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){var u=[s,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},eS=function(){function e(e,t,n){this.isTorchOn=!1,this.torchCapability=e,this.buttonController=t,this.onTorchActionFailureCallback=n}return e.prototype.isTorchEnabled=function(){return this.isTorchOn},e.prototype.flipState=function(){return ey(this,void 0,void 0,function(){var e,t;return em(this,function(n){switch(n.label){case 0:this.buttonController.disable(),e=!this.isTorchOn,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.torchCapability.apply(e)];case 2:return n.sent(),this.updateUiBasedOnLatestSettings(this.torchCapability.value(),e),[3,4];case 3:return t=n.sent(),this.propagateFailure(e,t),this.buttonController.enable(),[3,4];case 4:return[2]}})})},e.prototype.updateUiBasedOnLatestSettings=function(e,t){e===t?(this.buttonController.setText(t?D.torchOffButton():D.torchOnButton()),this.isTorchOn=t):this.propagateFailure(t),this.buttonController.enable()},e.prototype.propagateFailure=function(e,t){var n=e?D.torchOnFailedMessage():D.torchOffFailedMessage();t&&(n+="; Error = "+t),this.onTorchActionFailureCallback(n)},e.prototype.reset=function(){this.isTorchOn=!1},e}(),eT=function(){function e(e,t){this.onTorchActionFailureCallback=t,this.torchButton=eg.createElement("button",ef.TORCH_BUTTON_ID),this.torchController=new eS(e,this,t)}return e.prototype.render=function(e,t){var n=this;this.torchButton.innerText=D.torchOnButton(),this.torchButton.style.display=t.display,this.torchButton.style.marginLeft=t.marginLeft;var r=this;this.torchButton.addEventListener("click",function(e){return ey(n,void 0,void 0,function(){return em(this,function(e){switch(e.label){case 0:return[4,r.torchController.flipState()];case 1:return e.sent(),r.torchController.isTorchEnabled()?(r.torchButton.classList.remove(ef.TORCH_BUTTON_CLASS_TORCH_OFF),r.torchButton.classList.add(ef.TORCH_BUTTON_CLASS_TORCH_ON)):(r.torchButton.classList.remove(ef.TORCH_BUTTON_CLASS_TORCH_ON),r.torchButton.classList.add(ef.TORCH_BUTTON_CLASS_TORCH_OFF)),[2]}})})}),e.appendChild(this.torchButton)},e.prototype.updateTorchCapability=function(e){this.torchController=new eS(e,this,this.onTorchActionFailureCallback)},e.prototype.getTorchButton=function(){return this.torchButton},e.prototype.hide=function(){this.torchButton.style.display="none"},e.prototype.show=function(){this.torchButton.style.display="inline-block"},e.prototype.disable=function(){this.torchButton.disabled=!0},e.prototype.enable=function(){this.torchButton.disabled=!1},e.prototype.setText=function(e){this.torchButton.innerText=e},e.prototype.reset=function(){this.torchButton.innerText=D.torchOnButton(),this.torchController.reset()},e.create=function(t,n,r,o){var i=new e(n,o);return i.render(t,r),i},e}(),eM=function(){function e(e,t,n){this.fileBasedScanRegion=this.createFileBasedScanRegion(),this.fileBasedScanRegion.style.display=t?"block":"none",e.appendChild(this.fileBasedScanRegion);var r=document.createElement("label");r.setAttribute("for",this.getFileScanInputId()),r.style.display="inline-block",this.fileBasedScanRegion.appendChild(r),this.fileSelectionButton=eg.createElement("button",ef.FILE_SELECTION_BUTTON_ID),this.setInitialValueToButton(),this.fileSelectionButton.addEventListener("click",function(e){r.click()}),r.append(this.fileSelectionButton),this.fileScanInput=eg.createElement("input",this.getFileScanInputId()),this.fileScanInput.type="file",this.fileScanInput.accept="image/*",this.fileScanInput.style.display="none",r.appendChild(this.fileScanInput);var o=this;this.fileScanInput.addEventListener("change",function(e){if(null!=e&&null!=e.target){var t=e.target;if(!t.files||0!==t.files.length){var r=t.files[0],i=r.name;o.setImageNameToButton(i),n(r)}}});var i=this.createDragAndDropMessage();this.fileBasedScanRegion.appendChild(i),this.fileBasedScanRegion.addEventListener("dragenter",function(e){o.fileBasedScanRegion.style.border=o.fileBasedScanRegionActiveBorder(),e.stopPropagation(),e.preventDefault()}),this.fileBasedScanRegion.addEventListener("dragleave",function(e){o.fileBasedScanRegion.style.border=o.fileBasedScanRegionDefaultBorder(),e.stopPropagation(),e.preventDefault()}),this.fileBasedScanRegion.addEventListener("dragover",function(e){o.fileBasedScanRegion.style.border=o.fileBasedScanRegionActiveBorder(),e.stopPropagation(),e.preventDefault()}),this.fileBasedScanRegion.addEventListener("drop",function(e){e.stopPropagation(),e.preventDefault(),o.fileBasedScanRegion.style.border=o.fileBasedScanRegionDefaultBorder();var t=e.dataTransfer;if(t){var r=t.files;if(!r||0===r.length)return;for(var a=!1,s=0;s<r.length;++s){var c=r.item(s);if(c){var u=/image.*/;if(c.type.match(u)){a=!0;var l=c.name;o.setImageNameToButton(l),n(c),i.innerText=D.dragAndDropMessage();break}}}a||(i.innerText=D.dragAndDropMessageOnlyImages())}})}return e.prototype.hide=function(){this.fileBasedScanRegion.style.display="none",this.fileScanInput.disabled=!0},e.prototype.show=function(){this.fileBasedScanRegion.style.display="block",this.fileScanInput.disabled=!1},e.prototype.isShowing=function(){return"block"===this.fileBasedScanRegion.style.display},e.prototype.resetValue=function(){this.fileScanInput.value="",this.setInitialValueToButton()},e.prototype.createFileBasedScanRegion=function(){var e=document.createElement("div");return e.style.textAlign="center",e.style.margin="auto",e.style.width="80%",e.style.maxWidth="600px",e.style.border=this.fileBasedScanRegionDefaultBorder(),e.style.padding="10px",e.style.marginBottom="10px",e},e.prototype.fileBasedScanRegionDefaultBorder=function(){return"6px dashed #ebebeb"},e.prototype.fileBasedScanRegionActiveBorder=function(){return"6px dashed rgb(153 151 151)"},e.prototype.createDragAndDropMessage=function(){var e=document.createElement("div");return e.innerText=D.dragAndDropMessage(),e.style.fontWeight="400",e},e.prototype.setImageNameToButton=function(e){if(e.length>20){var t=e.substring(0,8),n=e.length,r=e.substring(n-8,n);e="".concat(t,"....").concat(r)}var o=D.fileSelectionChooseAnother()+" - "+e;this.fileSelectionButton.innerText=o},e.prototype.setInitialValueToButton=function(){var e=D.fileSelectionChooseImage()+" - "+D.fileSelectionNoImageSelected();this.fileSelectionButton.innerText=e},e.prototype.getFileScanInputId=function(){return"html5-qrcode-private-filescan-input"},e.create=function(t,n,r){return new e(t,n,r)},e}(),eC=function(){function e(e){this.selectElement=eg.createElement("select",ef.CAMERA_SELECTION_SELECT_ID),this.cameras=e,this.options=[]}return e.prototype.render=function(e){var t=document.createElement("span");t.style.marginRight="10px";var n=this.cameras.length;if(0===n)throw Error("No cameras found");if(1===n)t.style.display="none";else{var r=D.selectCamera();t.innerText="".concat(r," (").concat(this.cameras.length,") ")}for(var o=1,i=0,a=this.cameras;i<a.length;i++){var s=a[i],c=s.id,u=null==s.label?c:s.label;u&&""!==u||(u=[D.anonymousCameraPrefix(),o++].join(" "));var l=document.createElement("option");l.value=c,l.innerText=u,this.options.push(l),this.selectElement.appendChild(l)}t.appendChild(this.selectElement),e.appendChild(t)},e.prototype.disable=function(){this.selectElement.disabled=!0},e.prototype.isDisabled=function(){return!0===this.selectElement.disabled},e.prototype.enable=function(){this.selectElement.disabled=!1},e.prototype.getValue=function(){return this.selectElement.value},e.prototype.hasValue=function(e){for(var t=0,n=this.options;t<n.length;t++)if(n[t].value===e)return!0;return!1},e.prototype.setValue=function(e){if(!this.hasValue(e))throw Error("".concat(e," is not present in the camera list."));this.selectElement.value=e},e.prototype.hasSingleItem=function(){return 1===this.cameras.length},e.prototype.numCameras=function(){return this.cameras.length},e.create=function(t,n){var r=new e(n);return r.render(t),r},e}(),eE=function(){function e(){this.onChangeCallback=null,this.zoomElementContainer=document.createElement("div"),this.rangeInput=eg.createElement("input",ef.ZOOM_SLIDER_ID),this.rangeInput.type="range",this.rangeText=document.createElement("span"),this.rangeInput.min="1",this.rangeInput.max="5",this.rangeInput.value="1",this.rangeInput.step="0.1"}return e.prototype.render=function(e,t){this.zoomElementContainer.style.display=t?"block":"none",this.zoomElementContainer.style.padding="5px 10px",this.zoomElementContainer.style.textAlign="center",e.appendChild(this.zoomElementContainer),this.rangeInput.style.display="inline-block",this.rangeInput.style.width="50%",this.rangeInput.style.height="5px",this.rangeInput.style.background="#d3d3d3",this.rangeInput.style.outline="none",this.rangeInput.style.opacity="0.7";var n=D.zoom();this.rangeText.innerText="".concat(this.rangeInput.value,"x ").concat(n),this.rangeText.style.marginRight="10px";var r=this;this.rangeInput.addEventListener("input",function(){return r.onValueChange()}),this.rangeInput.addEventListener("change",function(){return r.onValueChange()}),this.zoomElementContainer.appendChild(this.rangeInput),this.zoomElementContainer.appendChild(this.rangeText)},e.prototype.onValueChange=function(){var e=D.zoom();this.rangeText.innerText="".concat(this.rangeInput.value,"x ").concat(e),this.onChangeCallback&&this.onChangeCallback(parseFloat(this.rangeInput.value))},e.prototype.setValues=function(e,t,n,r){this.rangeInput.min=e.toString(),this.rangeInput.max=t.toString(),this.rangeInput.step=r.toString(),this.rangeInput.value=n.toString(),this.onValueChange()},e.prototype.show=function(){this.zoomElementContainer.style.display="block"},e.prototype.hide=function(){this.zoomElementContainer.style.display="none"},e.prototype.setOnCameraZoomValueChangeCallback=function(e){this.onChangeCallback=e},e.prototype.removeOnCameraZoomValueChangeCallback=function(){this.onChangeCallback=null},e.create=function(t,n){var r=new e;return r.render(t,n),r},e}();(u=y||(y={}))[u.STATUS_DEFAULT=0]="STATUS_DEFAULT",u[u.STATUS_SUCCESS=1]="STATUS_SUCCESS",u[u.STATUS_WARNING=2]="STATUS_WARNING",u[u.STATUS_REQUESTING_PERMISSION=3]="STATUS_REQUESTING_PERMISSION";var eI=function(){function e(e,t,n){if(this.lastMatchFound=null,this.cameraScanImage=null,this.fileScanImage=null,this.fileSelectionUi=null,this.elementId=e,this.config=this.createConfig(t),this.verbose=!0===n,!document.getElementById(e))throw"HTML Element with id=".concat(e," not found");this.scanTypeSelector=new ep(this.config.supportedScanTypes),this.currentScanType=this.scanTypeSelector.getDefaultScanType(),this.sectionSwapAllowed=!0,this.logger=new E(this.verbose),this.persistedDataManager=new es,!0!==t.rememberLastUsedCamera&&this.persistedDataManager.reset()}return e.prototype.render=function(e,t){var n,r,o=this;this.lastMatchFound=null,this.qrCodeSuccessCallback=function(t,n){if(e)e(t,n);else{if(o.lastMatchFound===t)return;o.lastMatchFound=t,o.setHeaderMessage(D.lastMatch(t),y.STATUS_SUCCESS)}},this.qrCodeErrorCallback=function(e,n){t&&t(e,n)};var i=document.getElementById(this.elementId);if(!i)throw"HTML Element with id=".concat(this.elementId," not found");i.innerHTML="",this.createBasicLayout(i),this.html5Qrcode=new et(this.getScanRegionId(),(n=this.config,r=this.verbose,{formatsToSupport:n.formatsToSupport,useBarCodeDetectorIfSupported:n.useBarCodeDetectorIfSupported,experimentalFeatures:n.experimentalFeatures,verbose:r}))},e.prototype.pause=function(e){(I(e)||!0!==e)&&(e=!1),this.getHtml5QrcodeOrFail().pause(e)},e.prototype.resume=function(){this.getHtml5QrcodeOrFail().resume()},e.prototype.getState=function(){return this.getHtml5QrcodeOrFail().getState()},e.prototype.clear=function(){var e=this,t=function(){var t=document.getElementById(e.elementId);t&&(t.innerHTML="",e.resetBasicLayout(t))};return this.html5Qrcode?new Promise(function(n,r){e.html5Qrcode?e.html5Qrcode.isScanning?e.html5Qrcode.stop().then(function(r){e.html5Qrcode&&(e.html5Qrcode.clear(),t()),n()}).catch(function(t){e.verbose&&e.logger.logError("Unable to stop qrcode scanner",t),r(t)}):(e.html5Qrcode.clear(),t(),n()):n()}):Promise.resolve()},e.prototype.getRunningTrackCapabilities=function(){return this.getHtml5QrcodeOrFail().getRunningTrackCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getHtml5QrcodeOrFail().getRunningTrackSettings()},e.prototype.applyVideoConstraints=function(e){return this.getHtml5QrcodeOrFail().applyVideoConstraints(e)},e.prototype.getHtml5QrcodeOrFail=function(){if(!this.html5Qrcode)throw"Code scanner not initialized.";return this.html5Qrcode},e.prototype.createConfig=function(e){return e?(e.fps||(e.fps=S.SCAN_DEFAULT_FPS),!S.DEFAULT_REMEMBER_LAST_CAMERA_USED!==e.rememberLastUsedCamera&&(e.rememberLastUsedCamera=S.DEFAULT_REMEMBER_LAST_CAMERA_USED),e.supportedScanTypes||(e.supportedScanTypes=S.DEFAULT_SUPPORTED_SCAN_TYPE),e):{fps:S.SCAN_DEFAULT_FPS,rememberLastUsedCamera:S.DEFAULT_REMEMBER_LAST_CAMERA_USED,supportedScanTypes:S.DEFAULT_SUPPORTED_SCAN_TYPE}},e.prototype.createBasicLayout=function(e){e.style.position="relative",e.style.padding="0px",e.style.border="1px solid silver",this.createHeader(e);var t=document.createElement("div");t.id=this.getScanRegionId(),t.style.width="100%",t.style.minHeight="100px",t.style.textAlign="center",e.appendChild(t),ep.isCameraScanType(this.currentScanType)?this.insertCameraScanImageToScanRegion():this.insertFileScanImageToScanRegion();var n=document.createElement("div");n.id=this.getDashboardId(),n.style.width="100%",e.appendChild(n),this.setupInitialDashboard(n)},e.prototype.resetBasicLayout=function(e){e.style.border="none"},e.prototype.setupInitialDashboard=function(e){this.createSection(e),this.createSectionControlPanel(),this.scanTypeSelector.hasMoreThanOneScanType()&&this.createSectionSwap()},e.prototype.createHeader=function(e){var t=document.createElement("div");t.style.textAlign="left",t.style.margin="0px",e.appendChild(t),new el().renderInto(t);var n=document.createElement("div");n.id=this.getHeaderMessageContainerId(),n.style.display="none",n.style.textAlign="center",n.style.fontSize="14px",n.style.padding="2px 10px",n.style.margin="4px",n.style.borderTop="1px solid #f6f6f6",t.appendChild(n)},e.prototype.createSection=function(e){var t=document.createElement("div");t.id=this.getDashboardSectionId(),t.style.width="100%",t.style.padding="10px 0px 10px 0px",t.style.textAlign="left",e.appendChild(t)},e.prototype.createCameraListUi=function(e,t,n){var r=this;r.showHideScanTypeSwapLink(!1),r.setHeaderMessage(D.cameraPermissionRequesting());var o=function(){n||r.createPermissionButton(e,t)};et.getCameras().then(function(n){r.persistedDataManager.setHasPermission(!0),r.showHideScanTypeSwapLink(!0),r.resetHeaderMessage(),n&&n.length>0?(e.removeChild(t),r.renderCameraSelection(n)):(r.setHeaderMessage(D.noCameraFound(),y.STATUS_WARNING),o())}).catch(function(e){r.persistedDataManager.setHasPermission(!1),n?n.disabled=!1:o(),r.setHeaderMessage(e,y.STATUS_WARNING),r.showHideScanTypeSwapLink(!0)})},e.prototype.createPermissionButton=function(e,t){var n=this,r=eg.createElement("button",this.getCameraPermissionButtonId());r.innerText=D.cameraPermissionTitle(),r.addEventListener("click",function(){r.disabled=!0,n.createCameraListUi(e,t,r)}),t.appendChild(r)},e.prototype.createPermissionsUi=function(e,t){var n=this;ep.isCameraScanType(this.currentScanType)&&this.persistedDataManager.hasCameraPermissions()?ed.hasPermissions().then(function(r){r?n.createCameraListUi(e,t):(n.persistedDataManager.setHasPermission(!1),n.createPermissionButton(e,t))}).catch(function(r){n.persistedDataManager.setHasPermission(!1),n.createPermissionButton(e,t)}):this.createPermissionButton(e,t)},e.prototype.createSectionControlPanel=function(){var e=document.getElementById(this.getDashboardSectionId()),t=document.createElement("div");e.appendChild(t);var n=document.createElement("div");n.id=this.getDashboardSectionCameraScanRegionId(),n.style.display=ep.isCameraScanType(this.currentScanType)?"block":"none",t.appendChild(n);var r=document.createElement("div");r.style.textAlign="center",n.appendChild(r),this.scanTypeSelector.isCameraScanRequired()&&this.createPermissionsUi(n,r),this.renderFileScanUi(t)},e.prototype.renderFileScanUi=function(e){var t=ep.isFileScanType(this.currentScanType),n=this;this.fileSelectionUi=eM.create(e,t,function(e){if(!n.html5Qrcode)throw"html5Qrcode not defined";ep.isFileScanType(n.currentScanType)&&(n.setHeaderMessage(D.loadingImage()),n.html5Qrcode.scanFileV2(e,!0).then(function(e){n.resetHeaderMessage(),n.qrCodeSuccessCallback(e.decodedText,e)}).catch(function(e){n.setHeaderMessage(e,y.STATUS_WARNING),n.qrCodeErrorCallback(e,C.createFrom(e))}))})},e.prototype.renderCameraSelection=function(e){var t,n=this,r=this,o=document.getElementById(this.getDashboardSectionCameraScanRegionId());o.style.textAlign="center";var i=eE.create(o,!1),a=function(e){var t=e.zoomFeature();if(t.isSupported()){i.setOnCameraZoomValueChangeCallback(function(e){t.apply(e)});var r,o,a,s=1;n.config.defaultZoomValueIfSupported&&(s=n.config.defaultZoomValueIfSupported),r=s,o=t.min(),s=r>(a=t.max())?a:r<o?o:r,i.setValues(t.min(),t.max(),s,t.step()),i.show()}},s=eC.create(o,e),c=document.createElement("span"),u=eg.createElement("button",ef.CAMERA_START_BUTTON_ID);u.innerText=D.scanButtonStartScanningText(),c.appendChild(u);var l=eg.createElement("button",ef.CAMERA_STOP_BUTTON_ID);l.innerText=D.scanButtonStopScanningText(),l.style.display="none",l.disabled=!0,c.appendChild(l);var h=function(e){if(!e.torchFeature().isSupported()){t&&t.hide();return}t?t.updateTorchCapability(e.torchFeature()):t=eT.create(c,e.torchFeature(),{display:"none",marginLeft:"5px"},function(e){r.setHeaderMessage(e,y.STATUS_WARNING)}),t.show()};o.appendChild(c);var d=function(e){e||(u.style.display="none"),u.innerText=D.scanButtonStartScanningText(),u.style.opacity="1",u.disabled=!1,e&&(u.style.display="inline-block")};if(u.addEventListener("click",function(e){u.innerText=D.scanButtonScanningStarting(),s.disable(),u.disabled=!0,u.style.opacity="0.5",n.scanTypeSelector.hasMoreThanOneScanType()&&r.showHideScanTypeSwapLink(!1),r.resetHeaderMessage();var t,o=s.getValue();r.persistedDataManager.setLastUsedCameraId(o),r.html5Qrcode.start(o,{fps:(t=r.config).fps,qrbox:t.qrbox,aspectRatio:t.aspectRatio,disableFlip:t.disableFlip,videoConstraints:t.videoConstraints},r.qrCodeSuccessCallback,r.qrCodeErrorCallback).then(function(e){l.disabled=!1,l.style.display="inline-block",d(!1);var t=r.html5Qrcode.getRunningTrackCameraCapabilities();!0===n.config.showTorchButtonIfSupported&&h(t),!0===n.config.showZoomSliderIfSupported&&a(t)}).catch(function(e){r.showHideScanTypeSwapLink(!0),s.enable(),d(!0),r.setHeaderMessage(e,y.STATUS_WARNING)})}),s.hasSingleItem()&&u.click(),l.addEventListener("click",function(e){if(!r.html5Qrcode)throw"html5Qrcode not defined";l.disabled=!0,r.html5Qrcode.stop().then(function(e){n.scanTypeSelector.hasMoreThanOneScanType()&&r.showHideScanTypeSwapLink(!0),s.enable(),u.disabled=!1,l.style.display="none",u.style.display="inline-block",t&&(t.reset(),t.hide()),i.removeOnCameraZoomValueChangeCallback(),i.hide(),r.insertCameraScanImageToScanRegion()}).catch(function(e){l.disabled=!1,r.setHeaderMessage(e,y.STATUS_WARNING)})}),r.persistedDataManager.getLastUsedCameraId()){var p=r.persistedDataManager.getLastUsedCameraId();s.hasValue(p)?(s.setValue(p),u.click()):r.persistedDataManager.resetLastUsedCameraId()}},e.prototype.createSectionSwap=function(){var e=this,t=D.textIfCameraScanSelected(),n=D.textIfFileScanSelected(),r=document.getElementById(this.getDashboardSectionId()),o=document.createElement("div");o.style.textAlign="center";var i=eg.createElement("span",this.getDashboardSectionSwapLinkId());i.style.textDecoration="underline",i.style.cursor="pointer",i.innerText=ep.isCameraScanType(this.currentScanType)?t:n,i.addEventListener("click",function(){if(!e.sectionSwapAllowed){e.verbose&&e.logger.logError("Section swap called when not allowed");return}e.resetHeaderMessage(),e.fileSelectionUi.resetValue(),e.sectionSwapAllowed=!1,ep.isCameraScanType(e.currentScanType)?(e.clearScanRegion(),e.getCameraScanRegion().style.display="none",e.fileSelectionUi.show(),i.innerText=n,e.currentScanType=p.SCAN_TYPE_FILE,e.insertFileScanImageToScanRegion()):(e.clearScanRegion(),e.getCameraScanRegion().style.display="block",e.fileSelectionUi.hide(),i.innerText=t,e.currentScanType=p.SCAN_TYPE_CAMERA,e.insertCameraScanImageToScanRegion(),e.startCameraScanIfPermissionExistsOnSwap()),e.sectionSwapAllowed=!0}),o.appendChild(i),r.appendChild(o)},e.prototype.startCameraScanIfPermissionExistsOnSwap=function(){var e=this,t=this;if(this.persistedDataManager.hasCameraPermissions())return void ed.hasPermissions().then(function(n){if(n){var r=document.getElementById(t.getCameraPermissionButtonId());if(!r)throw e.logger.logError("Permission button not found, fail;"),"Permission button not found";r.click()}else t.persistedDataManager.setHasPermission(!1)}).catch(function(e){t.persistedDataManager.setHasPermission(!1)})},e.prototype.resetHeaderMessage=function(){document.getElementById(this.getHeaderMessageContainerId()).style.display="none"},e.prototype.setHeaderMessage=function(e,t){t||(t=y.STATUS_DEFAULT);var n=this.getHeaderMessageDiv();switch(n.innerText=e,n.style.display="block",t){case y.STATUS_SUCCESS:n.style.background="rgba(106, 175, 80, 0.26)",n.style.color="#477735";break;case y.STATUS_WARNING:n.style.background="rgba(203, 36, 49, 0.14)",n.style.color="#cb2431";break;case y.STATUS_DEFAULT:default:n.style.background="rgba(0, 0, 0, 0)",n.style.color="rgb(17, 17, 17)"}},e.prototype.showHideScanTypeSwapLink=function(e){this.scanTypeSelector.hasMoreThanOneScanType()&&(!0!==e&&(e=!1),this.sectionSwapAllowed=e,this.getDashboardSectionSwapLink().style.display=e?"inline-block":"none")},e.prototype.insertCameraScanImageToScanRegion=function(){var e=this,t=document.getElementById(this.getScanRegionId());if(this.cameraScanImage){t.innerHTML="<br>",t.appendChild(this.cameraScanImage);return}this.cameraScanImage=new Image,this.cameraScanImage.onload=function(n){t.innerHTML="<br>",t.appendChild(e.cameraScanImage)},this.cameraScanImage.width=64,this.cameraScanImage.style.opacity="0.8",this.cameraScanImage.src=er,this.cameraScanImage.alt=D.cameraScanAltText()},e.prototype.insertFileScanImageToScanRegion=function(){var e=this,t=document.getElementById(this.getScanRegionId());if(this.fileScanImage){t.innerHTML="<br>",t.appendChild(this.fileScanImage);return}this.fileScanImage=new Image,this.fileScanImage.onload=function(n){t.innerHTML="<br>",t.appendChild(e.fileScanImage)},this.fileScanImage.width=64,this.fileScanImage.style.opacity="0.8",this.fileScanImage.src=eo,this.fileScanImage.alt=D.fileScanAltText()},e.prototype.clearScanRegion=function(){document.getElementById(this.getScanRegionId()).innerHTML=""},e.prototype.getDashboardSectionId=function(){return"".concat(this.elementId,"__dashboard_section")},e.prototype.getDashboardSectionCameraScanRegionId=function(){return"".concat(this.elementId,"__dashboard_section_csr")},e.prototype.getDashboardSectionSwapLinkId=function(){return ef.SCAN_TYPE_CHANGE_ANCHOR_ID},e.prototype.getScanRegionId=function(){return"".concat(this.elementId,"__scan_region")},e.prototype.getDashboardId=function(){return"".concat(this.elementId,"__dashboard")},e.prototype.getHeaderMessageContainerId=function(){return"".concat(this.elementId,"__header_message")},e.prototype.getCameraPermissionButtonId=function(){return ef.CAMERA_PERMISSION_BUTTON_ID},e.prototype.getCameraScanRegion=function(){return document.getElementById(this.getDashboardSectionCameraScanRegionId())},e.prototype.getDashboardSectionSwapLink=function(){return document.getElementById(this.getDashboardSectionSwapLinkId())},e.prototype.getHeaderMessageDiv=function(){return document.getElementById(this.getHeaderMessageContainerId())},e}()}}]);
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9700],{89700:(e,t,n)=>{n.r(t),n.d(t,{Html5Qrcode:()=>et,Html5QrcodeScanType:()=>p,Html5QrcodeScanner:()=>eI,Html5QrcodeScannerState:()=>g,Html5QrcodeSupportedFormats:()=>h}),(l=h||(h={}))[l.QR_CODE=0]="QR_CODE",l[l.AZTEC=1]="AZTEC",l[l.CODABAR=2]="CODABAR",l[l.CODE_39=3]="CODE_39",l[l.CODE_93=4]="CODE_93",l[l.CODE_128=5]="CODE_128",l[l.DATA_MATRIX=6]="DATA_MATRIX",l[l.MAXICODE=7]="MAXICODE",l[l.ITF=8]="ITF",l[l.EAN_13=9]="EAN_13",l[l.EAN_8=10]="EAN_8",l[l.PDF_417=11]="PDF_417",l[l.RSS_14=12]="RSS_14",l[l.RSS_EXPANDED=13]="RSS_EXPANDED",l[l.UPC_A=14]="UPC_A",l[l.UPC_E=15]="UPC_E",l[l.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION";var r,o,i,a,s,c,u,l,h,d,p,f,g,y,m=new Map([[h.QR_CODE,"QR_CODE"],[h.AZTEC,"AZTEC"],[h.CODABAR,"CODABAR"],[h.CODE_39,"CODE_39"],[h.CODE_93,"CODE_93"],[h.CODE_128,"CODE_128"],[h.DATA_MATRIX,"DATA_MATRIX"],[h.MAXICODE,"MAXICODE"],[h.ITF,"ITF"],[h.EAN_13,"EAN_13"],[h.EAN_8,"EAN_8"],[h.PDF_417,"PDF_417"],[h.RSS_14,"RSS_14"],[h.RSS_EXPANDED,"RSS_EXPANDED"],[h.UPC_A,"UPC_A"],[h.UPC_E,"UPC_E"],[h.UPC_EAN_EXTENSION,"UPC_EAN_EXTENSION"]]);(r=d||(d={}))[r.UNKNOWN=0]="UNKNOWN",r[r.URL=1]="URL",(o=p||(p={}))[o.SCAN_TYPE_CAMERA=0]="SCAN_TYPE_CAMERA",o[o.SCAN_TYPE_FILE=1]="SCAN_TYPE_FILE";var S=function(){function e(){}return e.GITHUB_PROJECT_URL="https://github.com/mebjas/html5-qrcode",e.SCAN_DEFAULT_FPS=2,e.DEFAULT_DISABLE_FLIP=!1,e.DEFAULT_REMEMBER_LAST_CAMERA_USED=!0,e.DEFAULT_SUPPORTED_SCAN_TYPE=[p.SCAN_TYPE_CAMERA,p.SCAN_TYPE_FILE],e}(),T=function(){function e(e,t){this.format=e,this.formatName=t}return e.prototype.toString=function(){return this.formatName},e.create=function(t){if(!m.has(t))throw"".concat(t," not in html5QrcodeSupportedFormatsTextMap");return new e(t,m.get(t))},e}(),M=function(){function e(){}return e.createFromText=function(e){return{decodedText:e,result:{text:e}}},e.createFromQrcodeResult=function(e){return{decodedText:e.text,result:e}},e}();(i=f||(f={}))[i.UNKWOWN_ERROR=0]="UNKWOWN_ERROR",i[i.IMPLEMENTATION_ERROR=1]="IMPLEMENTATION_ERROR",i[i.NO_CODE_FOUND_ERROR=2]="NO_CODE_FOUND_ERROR";var C=function(){function e(){}return e.createFrom=function(e){return{errorMessage:e,type:f.UNKWOWN_ERROR}},e}(),E=function(){function e(e){this.verbose=e}return e.prototype.log=function(e){this.verbose&&console.log(e)},e.prototype.warn=function(e){this.verbose&&console.warn(e)},e.prototype.logError=function(e,t){(this.verbose||!0===t)&&console.error(e)},e.prototype.logErrors=function(e){if(0===e.length)throw"Logger#logError called without arguments";this.verbose&&console.error(e)},e}();function I(e){return null==e}var A=function(){function e(){}return e.codeParseError=function(e){return"QR code parse error, error = ".concat(e)},e.errorGettingUserMedia=function(e){return"Error getting userMedia, error = ".concat(e)},e.onlyDeviceSupportedError=function(){return"The device doesn't support navigator.mediaDevices , only supported cameraIdOrConfig in this case is deviceId parameter (string)."},e.cameraStreamingNotSupported=function(){return"Camera streaming not supported by the browser."},e.unableToQuerySupportedDevices=function(){return"Unable to query supported devices, unknown error."},e.insecureContextCameraQueryError=function(){return"Camera access is only supported in secure context like https or localhost."},e.scannerPaused=function(){return"Scanner paused"},e}(),D=function(){function e(){}return e.scanningStatus=function(){return"Scanning"},e.idleStatus=function(){return"Idle"},e.errorStatus=function(){return"Error"},e.permissionStatus=function(){return"Permission"},e.noCameraFoundErrorStatus=function(){return"No Cameras"},e.lastMatch=function(e){return"Last Match: ".concat(e)},e.codeScannerTitle=function(){return"Code Scanner"},e.cameraPermissionTitle=function(){return"Request Camera Permissions"},e.cameraPermissionRequesting=function(){return"Requesting camera permissions..."},e.noCameraFound=function(){return"No camera found"},e.scanButtonStopScanningText=function(){return"Stop Scanning"},e.scanButtonStartScanningText=function(){return"Start Scanning"},e.torchOnButton=function(){return"Switch On Torch"},e.torchOffButton=function(){return"Switch Off Torch"},e.torchOnFailedMessage=function(){return"Failed to turn on torch"},e.torchOffFailedMessage=function(){return"Failed to turn off torch"},e.scanButtonScanningStarting=function(){return"Launching Camera..."},e.textIfCameraScanSelected=function(){return"Scan an Image File"},e.textIfFileScanSelected=function(){return"Scan using camera directly"},e.selectCamera=function(){return"Select Camera"},e.fileSelectionChooseImage=function(){return"Choose Image"},e.fileSelectionChooseAnother=function(){return"Choose Another"},e.fileSelectionNoImageSelected=function(){return"No image choosen"},e.anonymousCameraPrefix=function(){return"Anonymous Camera"},e.dragAndDropMessage=function(){return"Or drop an image to scan"},e.dragAndDropMessageOnlyImages=function(){return"Or drop an image to scan (other files not supported)"},e.zoom=function(){return"zoom"},e.loadingImage=function(){return"Loading image..."},e.cameraScanAltText=function(){return"Camera based scan"},e.fileScanAltText=function(){return"Fule based scan"},e}(),v=function(){function e(){}return e.poweredBy=function(){return"Powered by "},e.reportIssues=function(){return"Report issues"},e}(),N=function(){function e(){}return e.isMediaStreamConstraintsValid=function(e,t){if("object"!=typeof e){var n=typeof e;return t.logError("videoConstraints should be of type object, the "+"object passed is of type ".concat(n,"."),!0),!1}for(var r=new Set(["autoGainControl","channelCount","echoCancellation","latency","noiseSuppression","sampleRate","sampleSize","volume"]),o=Object.keys(e),i=0;i<o.length;i++){var a=o[i];if(r.has(a))return t.logError("".concat(a," is not supported videoConstaints."),!0),!1}return!0},e}(),b=n(81595),w=function(){function e(e,t,n){if(this.formatMap=new Map([[h.QR_CODE,b.BarcodeFormat.QR_CODE],[h.AZTEC,b.BarcodeFormat.AZTEC],[h.CODABAR,b.BarcodeFormat.CODABAR],[h.CODE_39,b.BarcodeFormat.CODE_39],[h.CODE_93,b.BarcodeFormat.CODE_93],[h.CODE_128,b.BarcodeFormat.CODE_128],[h.DATA_MATRIX,b.BarcodeFormat.DATA_MATRIX],[h.MAXICODE,b.BarcodeFormat.MAXICODE],[h.ITF,b.BarcodeFormat.ITF],[h.EAN_13,b.BarcodeFormat.EAN_13],[h.EAN_8,b.BarcodeFormat.EAN_8],[h.PDF_417,b.BarcodeFormat.PDF_417],[h.RSS_14,b.BarcodeFormat.RSS_14],[h.RSS_EXPANDED,b.BarcodeFormat.RSS_EXPANDED],[h.UPC_A,b.BarcodeFormat.UPC_A],[h.UPC_E,b.BarcodeFormat.UPC_E],[h.UPC_EAN_EXTENSION,b.BarcodeFormat.UPC_EAN_EXTENSION]]),this.reverseFormatMap=this.createReverseFormatMap(),!b)throw"Use html5qrcode.min.js without edit, ZXing not found.";this.verbose=t,this.logger=n;var r=this.createZXingFormats(e),o=new Map;o.set(b.DecodeHintType.POSSIBLE_FORMATS,r),o.set(b.DecodeHintType.TRY_HARDER,!1),this.hints=o}return e.prototype.decodeAsync=function(e){var t=this;return new Promise(function(n,r){try{n(t.decode(e))}catch(e){r(e)}})},e.prototype.decode=function(e){var t=new b.MultiFormatReader(this.verbose,this.hints),n=new b.HTMLCanvasElementLuminanceSource(e),r=new b.BinaryBitmap(new b.HybridBinarizer(n)),o=t.decode(r);return{text:o.text,format:T.create(this.toHtml5QrcodeSupportedFormats(o.format)),debugData:this.createDebugData()}},e.prototype.createReverseFormatMap=function(){var e=new Map;return this.formatMap.forEach(function(t,n,r){e.set(t,n)}),e},e.prototype.toHtml5QrcodeSupportedFormats=function(e){if(!this.reverseFormatMap.has(e))throw"reverseFormatMap doesn't have ".concat(e);return this.reverseFormatMap.get(e)},e.prototype.createZXingFormats=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];this.formatMap.has(r)?t.push(this.formatMap.get(r)):this.logger.logError("".concat(r," is not supported by")+"ZXingHtml5QrcodeShim")}return t},e.prototype.createDebugData=function(){return{decoderName:"zxing-js"}},e}(),L=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){var u=[s,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},O=function(){function e(t,n,r){if(this.formatMap=new Map([[h.QR_CODE,"qr_code"],[h.AZTEC,"aztec"],[h.CODABAR,"codabar"],[h.CODE_39,"code_39"],[h.CODE_93,"code_93"],[h.CODE_128,"code_128"],[h.DATA_MATRIX,"data_matrix"],[h.ITF,"itf"],[h.EAN_13,"ean_13"],[h.EAN_8,"ean_8"],[h.PDF_417,"pdf417"],[h.UPC_A,"upc_a"],[h.UPC_E,"upc_e"]]),this.reverseFormatMap=this.createReverseFormatMap(),!e.isSupported())throw"Use html5qrcode.min.js without edit, Use BarcodeDetectorDelegate only if it isSupported();";this.verbose=n,this.logger=r;var o=this.createBarcodeDetectorFormats(t);if(this.detector=new BarcodeDetector(o),!this.detector)throw"BarcodeDetector detector not supported"}return e.isSupported=function(){return"BarcodeDetector"in window&&(new BarcodeDetector({formats:["qr_code"]}),!0)},e.prototype.decodeAsync=function(e){var t,n,r,o;return t=this,n=void 0,r=void 0,o=function(){var t,n;return L(this,function(r){switch(r.label){case 0:return[4,this.detector.detect(e)];case 1:if(!(t=r.sent())||0===t.length)throw"No barcode or QR code detected.";return[2,{text:(n=this.selectLargestBarcode(t)).rawValue,format:T.create(this.toHtml5QrcodeSupportedFormats(n.format)),debugData:this.createDebugData()}]}})},new(r||(r=Promise))(function(e,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(t){var n;t.done?e(t.value):((n=t.value)instanceof r?n:new r(function(e){e(n)})).then(a,s)}c((o=o.apply(t,n||[])).next())})},e.prototype.selectLargestBarcode=function(e){for(var t=null,n=0,r=0;r<e.length;r++){var o=e[r],i=o.boundingBox.width*o.boundingBox.height;i>n&&(n=i,t=o)}if(!t)throw"No largest barcode found";return t},e.prototype.createBarcodeDetectorFormats=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];this.formatMap.has(r)?t.push(this.formatMap.get(r)):this.logger.warn("".concat(r," is not supported by")+"BarcodeDetectorDelegate")}return{formats:t}},e.prototype.toHtml5QrcodeSupportedFormats=function(e){if(!this.reverseFormatMap.has(e))throw"reverseFormatMap doesn't have ".concat(e);return this.reverseFormatMap.get(e)},e.prototype.createReverseFormatMap=function(){var e=new Map;return this.formatMap.forEach(function(t,n,r){e.set(t,n)}),e},e.prototype.createDebugData=function(){return{decoderName:"BarcodeDetector"}},e}(),_=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},x=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){var u=[s,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},R=function(){function e(e,t,n,r){this.EXECUTIONS_TO_REPORT_PERFORMANCE=100,this.executions=0,this.executionResults=[],this.wasPrimaryDecoderUsedInLastDecode=!1,this.verbose=n,t&&O.isSupported()?(this.primaryDecoder=new O(e,n,r),this.secondaryDecoder=new w(e,n,r)):this.primaryDecoder=new w(e,n,r)}return e.prototype.decodeAsync=function(e){return _(this,void 0,void 0,function(){var t;return x(this,function(n){switch(n.label){case 0:t=performance.now(),n.label=1;case 1:return n.trys.push([1,,3,4]),[4,this.getDecoder().decodeAsync(e)];case 2:return[2,n.sent()];case 3:return this.possiblyLogPerformance(t),[7];case 4:return[2]}})})},e.prototype.decodeRobustlyAsync=function(e){return _(this,void 0,void 0,function(){var t,n;return x(this,function(r){switch(r.label){case 0:t=performance.now(),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,this.primaryDecoder.decodeAsync(e)];case 2:return[2,r.sent()];case 3:if(n=r.sent(),this.secondaryDecoder)return[2,this.secondaryDecoder.decodeAsync(e)];throw n;case 4:return this.possiblyLogPerformance(t),[7];case 5:return[2]}})})},e.prototype.getDecoder=function(){return this.secondaryDecoder?!1===this.wasPrimaryDecoderUsedInLastDecode?(this.wasPrimaryDecoderUsedInLastDecode=!0,this.primaryDecoder):(this.wasPrimaryDecoderUsedInLastDecode=!1,this.secondaryDecoder):this.primaryDecoder},e.prototype.possiblyLogPerformance=function(e){if(this.verbose){var t=performance.now()-e;this.executionResults.push(t),this.executions++,this.possiblyFlushPerformanceReport()}},e.prototype.possiblyFlushPerformanceReport=function(){if(!(this.executions<this.EXECUTIONS_TO_REPORT_PERFORMANCE)){for(var e=0,t=0,n=this.executionResults;t<n.length;t++)e+=n[t];var r=e/this.executionResults.length;console.log("".concat(r," ms for ").concat(this.executionResults.length," last runs.")),this.executions=0,this.executionResults=[]}},e}(),U=(a=function(e,t){return(a=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)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),j=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},B=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){var u=[s,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},F=function(){function e(e,t){this.name=e,this.track=t}return e.prototype.isSupported=function(){return!!this.track.getCapabilities&&this.name in this.track.getCapabilities()},e.prototype.apply=function(e){var t={};return t[this.name]=e,this.track.applyConstraints({advanced:[t]})},e.prototype.value=function(){var e=this.track.getSettings();return this.name in e?e[this.name]:null},e}(),z=function(e){function t(t){return e.call(this,"zoom",t)||this}return U(t,e),t}(function(e){function t(t,n){return e.call(this,t,n)||this}return U(t,e),t.prototype.min=function(){return this.getCapabilities().min},t.prototype.max=function(){return this.getCapabilities().max},t.prototype.step=function(){return this.getCapabilities().step},t.prototype.apply=function(e){var t={};return t[this.name]=e,this.track.applyConstraints({advanced:[t]})},t.prototype.getCapabilities=function(){this.failIfNotSupported();var e=this.track.getCapabilities()[this.name];return{min:e.min,max:e.max,step:e.step}},t.prototype.failIfNotSupported=function(){if(!this.isSupported())throw Error("".concat(this.name," capability not supported"))},t}(F)),k=function(e){function t(t){return e.call(this,"torch",t)||this}return U(t,e),t}(F),P=function(){function e(e){this.track=e}return e.prototype.zoomFeature=function(){return new z(this.track)},e.prototype.torchFeature=function(){return new k(this.track)},e}(),Q=function(){function e(e,t,n){this.isClosed=!1,this.parentElement=e,this.mediaStream=t,this.callbacks=n,this.surface=this.createVideoElement(this.parentElement.clientWidth),e.append(this.surface)}return e.prototype.createVideoElement=function(e){var t=document.createElement("video");return t.style.width="".concat(e,"px"),t.style.display="block",t.muted=!0,t.setAttribute("muted","true"),t.playsInline=!0,t},e.prototype.setupSurface=function(){var e=this;this.surface.onabort=function(){throw"RenderedCameraImpl video surface onabort() called"},this.surface.onerror=function(){throw"RenderedCameraImpl video surface onerror() called"};var t=function(){var n=e.surface.clientWidth,r=e.surface.clientHeight;e.callbacks.onRenderSurfaceReady(n,r),e.surface.removeEventListener("playing",t)};this.surface.addEventListener("playing",t),this.surface.srcObject=this.mediaStream,this.surface.play()},e.create=function(t,n,r,o){return j(this,void 0,void 0,function(){var i,a;return B(this,function(s){switch(s.label){case 0:if(i=new e(t,n,o),!r.aspectRatio)return[3,2];return a={aspectRatio:r.aspectRatio},[4,i.getFirstTrackOrFail().applyConstraints(a)];case 1:s.sent(),s.label=2;case 2:return i.setupSurface(),[2,i]}})})},e.prototype.failIfClosed=function(){if(this.isClosed)throw"The RenderedCamera has already been closed."},e.prototype.getFirstTrackOrFail=function(){if(this.failIfClosed(),0===this.mediaStream.getVideoTracks().length)throw"No video tracks found";return this.mediaStream.getVideoTracks()[0]},e.prototype.pause=function(){this.failIfClosed(),this.surface.pause()},e.prototype.resume=function(e){this.failIfClosed();var t=this,n=function(){setTimeout(e,200),t.surface.removeEventListener("playing",n)};this.surface.addEventListener("playing",n),this.surface.play()},e.prototype.isPaused=function(){return this.failIfClosed(),this.surface.paused},e.prototype.getSurface=function(){return this.failIfClosed(),this.surface},e.prototype.getRunningTrackCapabilities=function(){return this.getFirstTrackOrFail().getCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getFirstTrackOrFail().getSettings()},e.prototype.applyVideoConstraints=function(e){return j(this,void 0,void 0,function(){return B(this,function(t){if("aspectRatio"in e)throw"Changing 'aspectRatio' in run-time is not yet supported.";return[2,this.getFirstTrackOrFail().applyConstraints(e)]})})},e.prototype.close=function(){if(this.isClosed)return Promise.resolve();var e=this;return new Promise(function(t,n){var r=e.mediaStream.getVideoTracks().length,o=0;e.mediaStream.getVideoTracks().forEach(function(n){e.mediaStream.removeTrack(n),n.stop(),++o>=r&&(e.isClosed=!0,e.parentElement.removeChild(e.surface),t())})})},e.prototype.getCapabilities=function(){return new P(this.getFirstTrackOrFail())},e}(),H=function(){function e(e){this.mediaStream=e}return e.prototype.render=function(e,t,n){return j(this,void 0,void 0,function(){return B(this,function(r){return[2,Q.create(e,this.mediaStream,t,n)]})})},e.create=function(t){return j(this,void 0,void 0,function(){var n;return B(this,function(r){switch(r.label){case 0:if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return n={audio:!1,video:t},[4,navigator.mediaDevices.getUserMedia(n)];case 1:return[2,new e(r.sent())]}})})},e}(),Y=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},V=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){var u=[s,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},q=function(){function e(){}return e.failIfNotSupported=function(){return Y(this,void 0,void 0,function(){return V(this,function(t){if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return[2,new e]})})},e.prototype.create=function(e){return Y(this,void 0,void 0,function(){return V(this,function(t){return[2,H.create(e)]})})},e}(),W=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){var u=[s,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},G=function(){function e(){}return e.retrieve=function(){if(navigator.mediaDevices)return e.getCamerasFromMediaDevices();var t=MediaStreamTrack;return MediaStreamTrack&&t.getSources?e.getCamerasFromMediaStreamTrack():e.rejectWithError()},e.rejectWithError=function(){var t=A.unableToQuerySupportedDevices();return e.isHttpsOrLocalhost()||(t=A.insecureContextCameraQueryError()),Promise.reject(t)},e.isHttpsOrLocalhost=function(){if("https:"===location.protocol)return!0;var e=location.host.split(":")[0];return"127.0.0.1"===e||"localhost"===e},e.getCamerasFromMediaDevices=function(){var e,t,n,r;return e=this,t=void 0,n=void 0,r=function(){var e,t,n,r,o,i,a;return W(this,function(s){switch(s.label){case 0:return e=function(e){for(var t=e.getVideoTracks(),n=0;n<t.length;n++){var r=t[n];r.enabled=!1,r.stop(),e.removeTrack(r)}},[4,navigator.mediaDevices.getUserMedia({audio:!1,video:!0})];case 1:return t=s.sent(),[4,navigator.mediaDevices.enumerateDevices()];case 2:for(o=0,n=s.sent(),r=[],i=n;o<i.length;o++)"videoinput"===(a=i[o]).kind&&r.push({id:a.deviceId,label:a.label});return e(t),[2,r]}})},new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},e.getCamerasFromMediaStreamTrack=function(){return new Promise(function(e,t){MediaStreamTrack.getSources(function(t){for(var n=[],r=0;r<t.length;r++){var o=t[r];"video"===o.kind&&n.push({id:o.id,label:o.label})}e(n)})})},e}();(s=g||(g={}))[s.UNKNOWN=0]="UNKNOWN",s[s.NOT_STARTED=1]="NOT_STARTED",s[s.SCANNING=2]="SCANNING",s[s.PAUSED=3]="PAUSED";var X=function(){function e(){this.state=g.NOT_STARTED,this.onGoingTransactionNewState=g.UNKNOWN}return e.prototype.directTransition=function(e){this.failIfTransitionOngoing(),this.validateTransition(e),this.state=e},e.prototype.startTransition=function(e){return this.failIfTransitionOngoing(),this.validateTransition(e),this.onGoingTransactionNewState=e,this},e.prototype.execute=function(){if(this.onGoingTransactionNewState===g.UNKNOWN)throw"Transaction is already cancelled, cannot execute().";var e=this.onGoingTransactionNewState;this.onGoingTransactionNewState=g.UNKNOWN,this.directTransition(e)},e.prototype.cancel=function(){if(this.onGoingTransactionNewState===g.UNKNOWN)throw"Transaction is already cancelled, cannot cancel().";this.onGoingTransactionNewState=g.UNKNOWN},e.prototype.getState=function(){return this.state},e.prototype.failIfTransitionOngoing=function(){if(this.onGoingTransactionNewState!==g.UNKNOWN)throw"Cannot transition to a new state, already under transition"},e.prototype.validateTransition=function(e){switch(this.state){case g.UNKNOWN:throw"Transition from unknown is not allowed";case g.NOT_STARTED:this.failIfNewStateIs(e,[g.PAUSED]);case g.SCANNING:case g.PAUSED:}},e.prototype.failIfNewStateIs=function(e,t){for(var n=0;n<t.length;n++)if(e===t[n])throw"Cannot transition from ".concat(this.state," to ").concat(e)},e}(),Z=function(){function e(e){this.stateManager=e}return e.prototype.startTransition=function(e){return this.stateManager.startTransition(e)},e.prototype.directTransition=function(e){this.stateManager.directTransition(e)},e.prototype.getState=function(){return this.stateManager.getState()},e.prototype.canScanFile=function(){return this.stateManager.getState()===g.NOT_STARTED},e.prototype.isScanning=function(){return this.stateManager.getState()!==g.NOT_STARTED},e.prototype.isStrictlyScanning=function(){return this.stateManager.getState()===g.SCANNING},e.prototype.isPaused=function(){return this.stateManager.getState()===g.PAUSED},e}(),K=function(){function e(){}return e.create=function(){return new Z(new X)},e}(),J=(c=function(e,t){return(c=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)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}c(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),$=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return J(t,e),t.DEFAULT_WIDTH=300,t.DEFAULT_WIDTH_OFFSET=2,t.FILE_SCAN_MIN_HEIGHT=300,t.FILE_SCAN_HIDDEN_CANVAS_PADDING=100,t.MIN_QR_BOX_SIZE=50,t.SHADED_LEFT=1,t.SHADED_RIGHT=2,t.SHADED_TOP=3,t.SHADED_BOTTOM=4,t.SHADED_REGION_ELEMENT_ID="qr-shaded-region",t.VERBOSE=!1,t.BORDER_SHADER_DEFAULT_COLOR="#ffffff",t.BORDER_SHADER_MATCH_COLOR="rgb(90, 193, 56)",t}(S),ee=function(){function e(e,t){this.logger=t,this.fps=$.SCAN_DEFAULT_FPS,e?(e.fps&&(this.fps=e.fps),this.disableFlip=!0===e.disableFlip,this.qrbox=e.qrbox,this.aspectRatio=e.aspectRatio,this.videoConstraints=e.videoConstraints):this.disableFlip=$.DEFAULT_DISABLE_FLIP}return e.prototype.isMediaStreamConstraintsValid=function(){return this.videoConstraints?N.isMediaStreamConstraintsValid(this.videoConstraints,this.logger):(this.logger.logError("Empty videoConstraints",!0),!1)},e.prototype.isShadedBoxEnabled=function(){return!I(this.qrbox)},e.create=function(t,n){return new e(t,n)},e}(),et=function(){function e(e,t){var n;if(this.element=null,this.canvasElement=null,this.scannerPausedUiElement=null,this.hasBorderShaders=null,this.borderShaders=null,this.qrMatch=null,this.renderedCamera=null,this.qrRegion=null,this.context=null,this.lastScanImageFile=null,this.isScanning=!1,!document.getElementById(e))throw"HTML Element with id=".concat(e," not found");this.elementId=e,this.verbose=!1,"boolean"==typeof t?this.verbose=!0===t:t&&(n=t,this.verbose=!0===n.verbose,n.experimentalFeatures),this.logger=new E(this.verbose),this.qrcode=new R(this.getSupportedFormats(t),this.getUseBarCodeDetectorIfSupported(n),this.verbose,this.logger),this.foreverScanTimeout,this.shouldScan=!0,this.stateManagerProxy=K.create()}return e.prototype.start=function(e,t,n,r){var o,i=this;if(!e)throw"cameraIdOrConfig is required";if(!n||"function"!=typeof n)throw"qrCodeSuccessCallback is required and should be a function.";o=r||(this.verbose?this.logger.log:function(){});var a=ee.create(t,this.logger);this.clearElement();var s=!1;a.videoConstraints&&(a.isMediaStreamConstraintsValid()?s=!0:this.logger.logError("'videoConstraints' is not valid 'MediaStreamConstraints, it will be ignored.'",!0));var c=s,u=document.getElementById(this.elementId);u.clientWidth?u.clientWidth:$.DEFAULT_WIDTH,u.style.position="relative",this.shouldScan=!0,this.element=u;var l=this,h=this.stateManagerProxy.startTransition(g.SCANNING);return new Promise(function(t,r){var s=c?a.videoConstraints:l.createVideoConstraints(e);if(!s){h.cancel(),r("videoConstraints should be defined");return}var u={};(!c||a.aspectRatio)&&(u.aspectRatio=a.aspectRatio);var d={onRenderSurfaceReady:function(e,t){l.setupUi(e,t,a),l.isScanning=!0,l.foreverScan(a,n,o)}};q.failIfNotSupported().then(function(e){e.create(s).then(function(e){return e.render(i.element,u,d).then(function(e){l.renderedCamera=e,h.execute(),t(null)}).catch(function(e){h.cancel(),r(e)})}).catch(function(e){h.cancel(),r(A.errorGettingUserMedia(e))})}).catch(function(e){h.cancel(),r(A.cameraStreamingNotSupported())})})},e.prototype.pause=function(e){if(!this.stateManagerProxy.isStrictlyScanning())throw"Cannot pause, scanner is not scanning.";this.stateManagerProxy.directTransition(g.PAUSED),this.showPausedState(),(I(e)||!0!==e)&&(e=!1),e&&this.renderedCamera&&this.renderedCamera.pause()},e.prototype.resume=function(){if(!this.stateManagerProxy.isPaused())throw"Cannot result, scanner is not paused.";if(!this.renderedCamera)throw"renderedCamera doesn't exist while trying resume()";var e=this,t=function(){e.stateManagerProxy.directTransition(g.SCANNING),e.hidePausedState()};this.renderedCamera.isPaused()?this.renderedCamera.resume(function(){t()}):t()},e.prototype.getState=function(){return this.stateManagerProxy.getState()},e.prototype.stop=function(){var e=this;if(!this.stateManagerProxy.isScanning())throw"Cannot stop, scanner is not running or paused.";var t=this.stateManagerProxy.startTransition(g.NOT_STARTED);this.shouldScan=!1,this.foreverScanTimeout&&clearTimeout(this.foreverScanTimeout);var n=function(){if(e.element){var t=document.getElementById($.SHADED_REGION_ELEMENT_ID);t&&e.element.removeChild(t)}},r=this;return this.renderedCamera.close().then(function(){return r.renderedCamera=null,r.element&&(r.element.removeChild(r.canvasElement),r.canvasElement=null),n(),r.qrRegion&&(r.qrRegion=null),r.context&&(r.context=null),t.execute(),r.hidePausedState(),r.isScanning=!1,Promise.resolve()})},e.prototype.scanFile=function(e,t){return this.scanFileV2(e,t).then(function(e){return e.decodedText})},e.prototype.scanFileV2=function(e,t){var n=this;if(!e||!(e instanceof File))throw"imageFile argument is mandatory and should be instance of File. Use 'event.target.files[0]'.";if(I(t)&&(t=!0),!this.stateManagerProxy.canScanFile())throw"Cannot start file scan - ongoing camera scan";return new Promise(function(r,o){n.possiblyCloseLastScanImageFile(),n.clearElement(),n.lastScanImageFile=URL.createObjectURL(e);var i=new Image;i.onload=function(){var e=i.width,a=i.height,s=document.getElementById(n.elementId),c=s.clientWidth?s.clientWidth:$.DEFAULT_WIDTH,u=Math.max(s.clientHeight?s.clientHeight:a,$.FILE_SCAN_MIN_HEIGHT),l=n.computeCanvasDrawConfig(e,a,c,u);if(t){var h=n.createCanvasElement(c,u,"qr-canvas-visible");h.style.display="inline-block",s.appendChild(h);var d=h.getContext("2d");if(!d)throw"Unable to get 2d context from canvas";d.canvas.width=c,d.canvas.height=u,d.drawImage(i,0,0,e,a,l.x,l.y,l.width,l.height)}var p=$.FILE_SCAN_HIDDEN_CANVAS_PADDING,f=Math.max(i.width,l.width),g=Math.max(i.height,l.height),y=f+2*p,m=g+2*p,S=n.createCanvasElement(y,m);s.appendChild(S);var T=S.getContext("2d");if(!T)throw"Unable to get 2d context from canvas";T.canvas.width=y,T.canvas.height=m,T.drawImage(i,0,0,e,a,p,p,f,g);try{n.qrcode.decodeRobustlyAsync(S).then(function(e){r(M.createFromQrcodeResult(e))}).catch(o)}catch(e){o("QR code parse error, error = ".concat(e))}},i.onerror=o,i.onabort=o,i.onstalled=o,i.onsuspend=o,i.src=URL.createObjectURL(e)})},e.prototype.clear=function(){this.clearElement()},e.getCameras=function(){return G.retrieve()},e.prototype.getRunningTrackCapabilities=function(){return this.getRenderedCameraOrFail().getRunningTrackCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getRenderedCameraOrFail().getRunningTrackSettings()},e.prototype.getRunningTrackCameraCapabilities=function(){return this.getRenderedCameraOrFail().getCapabilities()},e.prototype.applyVideoConstraints=function(e){if(e){if(!N.isMediaStreamConstraintsValid(e,this.logger))throw"invalid videoConstaints passed, check logs for more details"}else throw"videoConstaints is required argument.";return this.getRenderedCameraOrFail().applyVideoConstraints(e)},e.prototype.getRenderedCameraOrFail=function(){if(null==this.renderedCamera)throw"Scanning is not in running state, call this API only when QR code scanning using camera is in running state.";return this.renderedCamera},e.prototype.getSupportedFormats=function(e){var t=[h.QR_CODE,h.AZTEC,h.CODABAR,h.CODE_39,h.CODE_93,h.CODE_128,h.DATA_MATRIX,h.MAXICODE,h.ITF,h.EAN_13,h.EAN_8,h.PDF_417,h.RSS_14,h.RSS_EXPANDED,h.UPC_A,h.UPC_E,h.UPC_EAN_EXTENSION];if(!e||"boolean"==typeof e||!e.formatsToSupport)return t;if(!Array.isArray(e.formatsToSupport))throw"configOrVerbosityFlag.formatsToSupport should be undefined or an array.";if(0===e.formatsToSupport.length)throw"Atleast 1 formatsToSupport is needed.";for(var n=[],r=0,o=e.formatsToSupport;r<o.length;r++){var i=o[r];Object.values(h).includes(i)?n.push(i):this.logger.warn("Invalid format: ".concat(i," passed in config, ignoring."))}if(0===n.length)throw"None of formatsToSupport match supported values.";return n},e.prototype.getUseBarCodeDetectorIfSupported=function(e){if(I(e))return!0;if(!I(e.useBarCodeDetectorIfSupported))return!1!==e.useBarCodeDetectorIfSupported;if(I(e.experimentalFeatures))return!0;var t=e.experimentalFeatures;return!!I(t.useBarCodeDetectorIfSupported)||!1!==t.useBarCodeDetectorIfSupported},e.prototype.validateQrboxSize=function(e,t,n){var r,o=n.qrbox;this.validateQrboxConfig(o);var i=this.toQrdimensions(e,t,o),a=function(e){if(e<$.MIN_QR_BOX_SIZE)throw"minimum size of 'config.qrbox' dimension value is"+" ".concat($.MIN_QR_BOX_SIZE,"px.")};a(i.width),a(i.height),(r=i.width)>e&&(this.logger.warn("`qrbox.width` or `qrbox` is larger than the width of the root element. The width will be truncated to the width of root element."),r=e),i.width=r},e.prototype.validateQrboxConfig=function(e){if("number"!=typeof e&&"function"!=typeof e&&(void 0===e.width||void 0===e.height))throw"Invalid instance of QrDimensions passed for 'config.qrbox'. Both 'width' and 'height' should be set."},e.prototype.toQrdimensions=function(e,t,n){if("number"==typeof n)return{width:n,height:n};if("function"==typeof n)try{return n(e,t)}catch(e){throw Error("qrbox config was passed as a function but it failed with unknown error"+e)}return n},e.prototype.setupUi=function(e,t,n){n.isShadedBoxEnabled()&&this.validateQrboxSize(e,t,n);var r=I(n.qrbox)?{width:e,height:t}:n.qrbox;this.validateQrboxConfig(r);var o=this.toQrdimensions(e,t,r);o.height>t&&this.logger.warn("[Html5Qrcode] config.qrbox has height that isgreater than the height of the video stream. Shading will be ignored");var i=n.isShadedBoxEnabled()&&o.height<=t,a=i?this.getShadedRegionBounds(e,t,o):{x:0,y:0,width:e,height:t},s=this.createCanvasElement(a.width,a.height),c=s.getContext("2d",{willReadFrequently:!0});c.canvas.width=a.width,c.canvas.height=a.height,this.element.append(s),i&&this.possiblyInsertShadingElement(this.element,e,t,o),this.createScannerPausedUiElement(this.element),this.qrRegion=a,this.context=c,this.canvasElement=s},e.prototype.createScannerPausedUiElement=function(e){var t=document.createElement("div");t.innerText=A.scannerPaused(),t.style.display="none",t.style.position="absolute",t.style.top="0px",t.style.zIndex="1",t.style.background="rgba(9, 9, 9, 0.46)",t.style.color="#FFECEC",t.style.textAlign="center",t.style.width="100%",e.appendChild(t),this.scannerPausedUiElement=t},e.prototype.scanContext=function(e,t){var n=this;return this.stateManagerProxy.isPaused()?Promise.resolve(!1):this.qrcode.decodeAsync(this.canvasElement).then(function(t){return e(t.text,M.createFromQrcodeResult(t)),n.possiblyUpdateShaders(!0),!0}).catch(function(e){n.possiblyUpdateShaders(!1);var r=A.codeParseError(e);return t(r,C.createFrom(r)),!1})},e.prototype.foreverScan=function(e,t,n){var r=this;if(this.shouldScan&&this.renderedCamera){var o=this.renderedCamera.getSurface(),i=o.videoWidth/o.clientWidth,a=o.videoHeight/o.clientHeight;if(!this.qrRegion)throw"qrRegion undefined when localMediaStream is ready.";var s=this.qrRegion.width*i,c=this.qrRegion.height*a,u=this.qrRegion.x*i,l=this.qrRegion.y*a;this.context.drawImage(o,u,l,s,c,0,0,this.qrRegion.width,this.qrRegion.height);var h=function(){r.foreverScanTimeout=setTimeout(function(){r.foreverScan(e,t,n)},r.getTimeoutFps(e.fps))};this.scanContext(t,n).then(function(o){o||!0===e.disableFlip?h():(r.context.translate(r.context.canvas.width,0),r.context.scale(-1,1),r.scanContext(t,n).finally(function(){h()}))}).catch(function(e){r.logger.logError("Error happend while scanning context",e),h()})}},e.prototype.createVideoConstraints=function(e){if("string"==typeof e)return{deviceId:{exact:e}};if("object"==typeof e){var t="facingMode",n="deviceId",r={user:!0,environment:!0},o="exact",i=function(e){if(e in r)return!0;throw"config has invalid 'facingMode' value = "+"'".concat(e,"'")},a=Object.keys(e);if(1!==a.length)throw"'cameraIdOrConfig' object should have exactly 1 key,"+" if passed as an object, found ".concat(a.length," keys");var s=Object.keys(e)[0];if(s!==t&&s!==n)throw"Only '".concat(t,"' and '").concat(n,"' ")+" are supported for 'cameraIdOrConfig'";if(s===t){var c=e.facingMode;if("string"==typeof c){if(i(c))return{facingMode:c}}else if("object"==typeof c)if(o in c){if(i(c["".concat(o)]))return{facingMode:{exact:c["".concat(o)]}}}else throw"'facingMode' should be string or object with"+" ".concat(o," as key.");else{var u=typeof c;throw"Invalid type of 'facingMode' = ".concat(u)}}else{var l=e.deviceId;if("string"==typeof l)return{deviceId:l};if("object"==typeof l)if(o in l)return{deviceId:{exact:l["".concat(o)]}};else throw"'deviceId' should be string or object with"+" ".concat(o," as key.");var h=typeof l;throw"Invalid type of 'deviceId' = ".concat(h)}}var d=typeof e;throw"Invalid type of 'cameraIdOrConfig' = ".concat(d)},e.prototype.computeCanvasDrawConfig=function(e,t,n,r){if(e<=n&&t<=r)return{x:(n-e)/2,y:(r-t)/2,width:e,height:t};var o=e,i=t;return e>n&&(t=n/e*t,e=n),t>r&&(e=r/t*e,t=r),this.logger.log("Image downsampled from "+"".concat(o,"X").concat(i)+" to ".concat(e,"X").concat(t,".")),this.computeCanvasDrawConfig(e,t,n,r)},e.prototype.clearElement=function(){if(this.stateManagerProxy.isScanning())throw"Cannot clear while scan is ongoing, close it first.";var e=document.getElementById(this.elementId);e&&(e.innerHTML="")},e.prototype.possiblyUpdateShaders=function(e){this.qrMatch!==e&&(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(t){t.style.backgroundColor=e?$.BORDER_SHADER_MATCH_COLOR:$.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=e)},e.prototype.possiblyCloseLastScanImageFile=function(){this.lastScanImageFile&&(URL.revokeObjectURL(this.lastScanImageFile),this.lastScanImageFile=null)},e.prototype.createCanvasElement=function(e,t,n){var r=document.createElement("canvas");return r.style.width="".concat(e,"px"),r.style.height="".concat(t,"px"),r.style.display="none",r.id=I(n)?"qr-canvas":n,r},e.prototype.getShadedRegionBounds=function(e,t,n){if(n.width>e||n.height>t)throw"'config.qrbox' dimensions should not be greater than the dimensions of the root HTML element.";return{x:(e-n.width)/2,y:(t-n.height)/2,width:n.width,height:n.height}},e.prototype.possiblyInsertShadingElement=function(e,t,n,r){if(!(t-r.width<1)&&!(n-r.height<1)){var o=document.createElement("div");o.style.position="absolute";var i=(t-r.width)/2,a=(n-r.height)/2;o.style.borderLeft="".concat(i,"px solid rgba(0, 0, 0, 0.48)"),o.style.borderRight="".concat(i,"px solid rgba(0, 0, 0, 0.48)"),o.style.borderTop="".concat(a,"px solid rgba(0, 0, 0, 0.48)"),o.style.borderBottom="".concat(a,"px solid rgba(0, 0, 0, 0.48)"),o.style.boxSizing="border-box",o.style.top="0px",o.style.bottom="0px",o.style.left="0px",o.style.right="0px",o.id="".concat($.SHADED_REGION_ELEMENT_ID),t-r.width<11||n-r.height<11?this.hasBorderShaders=!1:(this.insertShaderBorders(o,40,5,-5,null,0,!0),this.insertShaderBorders(o,40,5,-5,null,0,!1),this.insertShaderBorders(o,40,5,null,-5,0,!0),this.insertShaderBorders(o,40,5,null,-5,0,!1),this.insertShaderBorders(o,5,45,-5,null,-5,!0),this.insertShaderBorders(o,5,45,null,-5,-5,!0),this.insertShaderBorders(o,5,45,-5,null,-5,!1),this.insertShaderBorders(o,5,45,null,-5,-5,!1),this.hasBorderShaders=!0),e.append(o)}},e.prototype.insertShaderBorders=function(e,t,n,r,o,i,a){var s=document.createElement("div");s.style.position="absolute",s.style.backgroundColor=$.BORDER_SHADER_DEFAULT_COLOR,s.style.width="".concat(t,"px"),s.style.height="".concat(n,"px"),null!==r&&(s.style.top="".concat(r,"px")),null!==o&&(s.style.bottom="".concat(o,"px")),a?s.style.left="".concat(i,"px"):s.style.right="".concat(i,"px"),this.borderShaders||(this.borderShaders=[]),this.borderShaders.push(s),e.appendChild(s)},e.prototype.showPausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="block"},e.prototype.hidePausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="none"},e.prototype.getTimeoutFps=function(e){return 1e3/e},e}(),en="data:image/svg+xml;base64,",er=en+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzNzEuNjQzIDM3MS42NDMiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDM3MS42NDMgMzcxLjY0MyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBhdGggZD0iTTEwNS4wODQgMzguMjcxaDE2My43Njh2MjBIMTA1LjA4NHoiLz48cGF0aCBkPSJNMzExLjU5NiAxOTAuMTg5Yy03LjQ0MS05LjM0Ny0xOC40MDMtMTYuMjA2LTMyLjc0My0yMC41MjJWMzBjMC0xNi41NDItMTMuNDU4LTMwLTMwLTMwSDEyNS4wODRjLTE2LjU0MiAwLTMwIDEzLjQ1OC0zMCAzMHYxMjAuMTQzaC04LjI5NmMtMTYuNTQyIDAtMzAgMTMuNDU4LTMwIDMwdjEuMzMzYTI5LjgwNCAyOS44MDQgMCAwIDAgNC42MDMgMTUuOTM5Yy03LjM0IDUuNDc0LTEyLjEwMyAxNC4yMjEtMTIuMTAzIDI0LjA2MXYxLjMzM2MwIDkuODQgNC43NjMgMTguNTg3IDEyLjEwMyAyNC4wNjJhMjkuODEgMjkuODEgMCAwIDAtNC42MDMgMTUuOTM4djEuMzMzYzAgMTYuNTQyIDEzLjQ1OCAzMCAzMCAzMGg4LjMyNGMuNDI3IDExLjYzMSA3LjUwMyAyMS41ODcgMTcuNTM0IDI2LjE3Ny45MzEgMTAuNTAzIDQuMDg0IDMwLjE4NyAxNC43NjggNDUuNTM3YTkuOTg4IDkuOTg4IDAgMCAwIDguMjE2IDQuMjg4IDkuOTU4IDkuOTU4IDAgMCAwIDUuNzA0LTEuNzkzYzQuNTMzLTMuMTU1IDUuNjUtOS4zODggMi40OTUtMTMuOTIxLTYuNzk4LTkuNzY3LTkuNjAyLTIyLjYwOC0xMC43Ni0zMS40aDgyLjY4NWMuMjcyLjQxNC41NDUuODE4LjgxNSAxLjIxIDMuMTQyIDQuNTQxIDkuMzcyIDUuNjc5IDEzLjkxMyAyLjUzNCA0LjU0Mi0zLjE0MiA1LjY3Ny05LjM3MSAyLjUzNS0xMy45MTMtMTEuOTE5LTE3LjIyOS04Ljc4Ny0zNS44ODQgOS41ODEtNTcuMDEyIDMuMDY3LTIuNjUyIDEyLjMwNy0xMS43MzIgMTEuMjE3LTI0LjAzMy0uODI4LTkuMzQzLTcuMTA5LTE3LjE5NC0xOC42NjktMjMuMzM3YTkuODU3IDkuODU3IDAgMCAwLTEuMDYxLS40ODZjLS40NjYtLjE4Mi0xMS40MDMtNC41NzktOS43NDEtMTUuNzA2IDEuMDA3LTYuNzM3IDE0Ljc2OC04LjI3MyAyMy43NjYtNy42NjYgMjMuMTU2IDEuNTY5IDM5LjY5OCA3LjgwMyA0Ny44MzYgMTguMDI2IDUuNzUyIDcuMjI1IDcuNjA3IDE2LjYyMyA1LjY3MyAyOC43MzMtLjQxMyAyLjU4NS0uODI0IDUuMjQxLTEuMjQ1IDcuOTU5LTUuNzU2IDM3LjE5NC0xMi45MTkgODMuNDgzLTQ5Ljg3IDExNC42NjEtNC4yMjEgMy41NjEtNC43NTYgOS44Ny0xLjE5NCAxNC4wOTJhOS45OCA5Ljk4IDAgMCAwIDcuNjQ4IDMuNTUxIDkuOTU1IDkuOTU1IDAgMCAwIDYuNDQ0LTIuMzU4YzQyLjY3Mi0zNi4wMDUgNTAuODAyLTg4LjUzMyA1Ni43MzctMTI2Ljg4OC40MTUtMi42ODQuODIxLTUuMzA5IDEuMjI5LTcuODYzIDIuODM0LTE3LjcyMS0uNDU1LTMyLjY0MS05Ljc3Mi00NC4zNDV6bS0yMzIuMzA4IDQyLjYyYy01LjUxNCAwLTEwLTQuNDg2LTEwLTEwdi0xLjMzM2MwLTUuNTE0IDQuNDg2LTEwIDEwLTEwaDE1djIxLjMzM2gtMTV6bS0yLjUtNTIuNjY2YzAtNS41MTQgNC40ODYtMTAgMTAtMTBoNy41djIxLjMzM2gtNy41Yy01LjUxNCAwLTEwLTQuNDg2LTEwLTEwdi0xLjMzM3ptMTcuNSA5My45OTloLTcuNWMtNS41MTQgMC0xMC00LjQ4Ni0xMC0xMHYtMS4zMzNjMC01LjUxNCA0LjQ4Ni0xMCAxMC0xMGg3LjV2MjEuMzMzem0zMC43OTYgMjguODg3Yy01LjUxNCAwLTEwLTQuNDg2LTEwLTEwdi04LjI3MWg5MS40NTdjLS44NTEgNi42NjgtLjQzNyAxMi43ODcuNzMxIDE4LjI3MWgtODIuMTg4em03OS40ODItMTEzLjY5OGMtMy4xMjQgMjAuOTA2IDEyLjQyNyAzMy4xODQgMjEuNjI1IDM3LjA0IDUuNDQxIDIuOTY4IDcuNTUxIDUuNjQ3IDcuNzAxIDcuMTg4LjIxIDIuMTUtMi41NTMgNS42ODQtNC40NzcgNy4yNTEtLjQ4Mi4zNzgtLjkyOS44LTEuMzM1IDEuMjYxLTYuOTg3IDcuOTM2LTExLjk4MiAxNS41Mi0xNS40MzIgMjIuNjg4aC05Ny41NjRWMzBjMC01LjUxNCA0LjQ4Ni0xMCAxMC0xMGgxMjMuNzY5YzUuNTE0IDAgMTAgNC40ODYgMTAgMTB2MTM1LjU3OWMtMy4wMzItLjM4MS02LjE1LS42OTQtOS4zODktLjkxNC0yNS4xNTktMS42OTQtNDIuMzcgNy43NDgtNDQuODk4IDI0LjY2NnoiLz48cGF0aCBkPSJNMTc5LjEyOSA4My4xNjdoLTI0LjA2YTUgNSAwIDAgMC01IDV2MjQuMDYxYTUgNSAwIDAgMCA1IDVoMjQuMDZhNSA1IDAgMCAwIDUtNVY4OC4xNjdhNSA1IDAgMCAwLTUtNXpNMTcyLjYyOSAxNDIuODZoLTEyLjU2VjEzMC44YTUgNSAwIDEgMC0xMCAwdjE3LjA2MWE1IDUgMCAwIDAgNSA1aDE3LjU2YTUgNSAwIDEgMCAwLTEwLjAwMXpNMjE2LjU2OCA4My4xNjdoLTI0LjA2YTUgNSAwIDAgMC01IDV2MjQuMDYxYTUgNSAwIDAgMCA1IDVoMjQuMDZhNSA1IDAgMCAwIDUtNVY4OC4xNjdhNSA1IDAgMCAwLTUtNXptLTUgMjQuMDYxaC0xNC4wNlY5My4xNjdoMTQuMDZ2MTQuMDYxek0yMTEuNjY5IDEyNS45MzZIMTk3LjQxYTUgNSAwIDAgMC01IDV2MTQuMjU3YTUgNSAwIDAgMCA1IDVoMTQuMjU5YTUgNSAwIDAgMCA1LTV2LTE0LjI1N2E1IDUgMCAwIDAtNS01eiIvPjwvc3ZnPg==",eo=en+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1OS4wMTggNTkuMDE4IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1OS4wMTggNTkuMDE4IiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBkPSJtNTguNzQxIDU0LjgwOS01Ljk2OS02LjI0NGExMC43NCAxMC43NCAwIDAgMCAyLjgyLTcuMjVjMC01Ljk1My00Ljg0My0xMC43OTYtMTAuNzk2LTEwLjc5NlMzNCAzNS4zNjEgMzQgNDEuMzE0IDM4Ljg0MyA1Mi4xMSA0NC43OTYgNTIuMTFjMi40NDEgMCA0LjY4OC0uODI0IDYuNDk5LTIuMTk2bDYuMDAxIDYuMjc3YS45OTguOTk4IDAgMCAwIDEuNDE0LjAzMiAxIDEgMCAwIDAgLjAzMS0xLjQxNHpNMzYgNDEuMzE0YzAtNC44NSAzLjk0Ni04Ljc5NiA4Ljc5Ni04Ljc5NnM4Ljc5NiAzLjk0NiA4Ljc5NiA4Ljc5Ni0zLjk0NiA4Ljc5Ni04Ljc5NiA4Ljc5NlMzNiA0Ni4xNjQgMzYgNDEuMzE0ek0xMC40MzEgMTYuMDg4YzAgMy4wNyAyLjQ5OCA1LjU2OCA1LjU2OSA1LjU2OHM1LjU2OS0yLjQ5OCA1LjU2OS01LjU2OGMwLTMuMDcxLTIuNDk4LTUuNTY5LTUuNTY5LTUuNTY5cy01LjU2OSAyLjQ5OC01LjU2OSA1LjU2OXptOS4xMzggMGMwIDEuOTY4LTEuNjAyIDMuNTY4LTMuNTY5IDMuNTY4cy0zLjU2OS0xLjYwMS0zLjU2OS0zLjU2OCAxLjYwMi0zLjU2OSAzLjU2OS0zLjU2OSAzLjU2OSAxLjYwMSAzLjU2OSAzLjU2OXoiLz48cGF0aCBkPSJtMzAuODgyIDI4Ljk4NyA5LjE4LTEwLjA1NCAxMS4yNjIgMTAuMzIzYTEgMSAwIDAgMCAxLjM1MS0xLjQ3NWwtMTItMTFhMSAxIDAgMCAwLTEuNDE0LjA2M2wtOS43OTQgMTAuNzI3LTQuNzQzLTQuNzQzYTEuMDAzIDEuMDAzIDAgMCAwLTEuMzY4LS4wNDRMNi4zMzkgMzcuNzY4YTEgMSAwIDEgMCAxLjMyMiAxLjUwMWwxNi4zMTMtMTQuMzYyIDcuMzE5IDcuMzE4YS45OTkuOTk5IDAgMSAwIDEuNDE0LTEuNDE0bC0xLjgyNS0xLjgyNHoiLz48cGF0aCBkPSJNMzAgNDYuNTE4SDJ2LTQyaDU0djI4YTEgMSAwIDEgMCAyIDB2LTI5YTEgMSAwIDAgMC0xLTFIMWExIDEgMCAwIDAtMSAxdjQ0YTEgMSAwIDAgMCAxIDFoMjlhMSAxIDAgMSAwIDAtMnoiLz48L3N2Zz4=",ei=en+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0NjAgNDYwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA0NjAgNDYwIiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBkPSJNMjMwIDBDMTAyLjk3NSAwIDAgMTAyLjk3NSAwIDIzMHMxMDIuOTc1IDIzMCAyMzAgMjMwIDIzMC0xMDIuOTc0IDIzMC0yMzBTMzU3LjAyNSAwIDIzMCAwem0zOC4zMzMgMzc3LjM2YzAgOC42NzYtNy4wMzQgMTUuNzEtMTUuNzEgMTUuNzFoLTQzLjEwMWMtOC42NzYgMC0xNS43MS03LjAzNC0xNS43MS0xNS43MVYyMDIuNDc3YzAtOC42NzYgNy4wMzMtMTUuNzEgMTUuNzEtMTUuNzFoNDMuMTAxYzguNjc2IDAgMTUuNzEgNy4wMzMgMTUuNzEgMTUuNzFWMzc3LjM2ek0yMzAgMTU3Yy0yMS41MzkgMC0zOS0xNy40NjEtMzktMzlzMTcuNDYxLTM5IDM5LTM5IDM5IDE3LjQ2MSAzOSAzOS0xNy40NjEgMzktMzkgMzl6Ii8+PC9zdmc+",ea=function(){function e(){}return e.createDefault=function(){return{hasPermission:!1,lastUsedCameraId:null}},e}(),es=function(){function e(){this.data=ea.createDefault();var t=localStorage.getItem(e.LOCAL_STORAGE_KEY);t?this.data=JSON.parse(t):this.reset()}return e.prototype.hasCameraPermissions=function(){return this.data.hasPermission},e.prototype.getLastUsedCameraId=function(){return this.data.lastUsedCameraId},e.prototype.setHasPermission=function(e){this.data.hasPermission=e,this.flush()},e.prototype.setLastUsedCameraId=function(e){this.data.lastUsedCameraId=e,this.flush()},e.prototype.resetLastUsedCameraId=function(){this.data.lastUsedCameraId=null,this.flush()},e.prototype.reset=function(){this.data=ea.createDefault(),this.flush()},e.prototype.flush=function(){localStorage.setItem(e.LOCAL_STORAGE_KEY,JSON.stringify(this.data))},e.LOCAL_STORAGE_KEY="HTML5_QRCODE_DATA",e}(),ec=function(){function e(){this.infoDiv=document.createElement("div")}return e.prototype.renderInto=function(e){this.infoDiv.style.position="absolute",this.infoDiv.style.top="10px",this.infoDiv.style.right="10px",this.infoDiv.style.zIndex="2",this.infoDiv.style.display="none",this.infoDiv.style.padding="5pt",this.infoDiv.style.border="1px solid #171717",this.infoDiv.style.fontSize="10pt",this.infoDiv.style.background="rgb(0 0 0 / 69%)",this.infoDiv.style.borderRadius="5px",this.infoDiv.style.textAlign="center",this.infoDiv.style.fontWeight="400",this.infoDiv.style.color="white",this.infoDiv.innerText=v.poweredBy();var t=document.createElement("a");t.innerText="ScanApp",t.href="https://scanapp.org",t.target="new",t.style.color="white",this.infoDiv.appendChild(t);var n=document.createElement("br"),r=document.createElement("br");this.infoDiv.appendChild(n),this.infoDiv.appendChild(r);var o=document.createElement("a");o.innerText=v.reportIssues(),o.href="https://github.com/mebjas/html5-qrcode/issues",o.target="new",o.style.color="white",this.infoDiv.appendChild(o),e.appendChild(this.infoDiv)},e.prototype.show=function(){this.infoDiv.style.display="block"},e.prototype.hide=function(){this.infoDiv.style.display="none"},e}(),eu=function(){function e(e,t){this.isShowingInfoIcon=!0,this.onTapIn=e,this.onTapOut=t,this.infoIcon=document.createElement("img")}return e.prototype.renderInto=function(e){var t=this;this.infoIcon.alt="Info icon",this.infoIcon.src=ei,this.infoIcon.style.position="absolute",this.infoIcon.style.top="4px",this.infoIcon.style.right="4px",this.infoIcon.style.opacity="0.6",this.infoIcon.style.cursor="pointer",this.infoIcon.style.zIndex="2",this.infoIcon.style.width="16px",this.infoIcon.style.height="16px",this.infoIcon.onmouseover=function(e){return t.onHoverIn()},this.infoIcon.onmouseout=function(e){return t.onHoverOut()},this.infoIcon.onclick=function(e){return t.onClick()},e.appendChild(this.infoIcon)},e.prototype.onHoverIn=function(){this.isShowingInfoIcon&&(this.infoIcon.style.opacity="1")},e.prototype.onHoverOut=function(){this.isShowingInfoIcon&&(this.infoIcon.style.opacity="0.6")},e.prototype.onClick=function(){this.isShowingInfoIcon?(this.isShowingInfoIcon=!1,this.onTapIn(),this.infoIcon.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAQgAAAEIBarqQRAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAE1SURBVDiNfdI7S0NBEAXgLya1otFgpbYSbISAgpXYi6CmiH9KCAiChaVga6OiWPgfRDQ+0itaGVNosXtluWwcuMzePfM4M3sq8lbHBubwg1dc4m1E/J/N4ghDPOIsfk/4xiEao5KX0McFljN4C9d4QTPXuY99jP3DsIoDPGM6BY5i5yI5R7O4q+ImFkJY2DCh3cAH2klyB+9J1xUMMAG7eCh1a+Mr+k48b5diXrFVwwLuS+BJ9MfR7+G0FHOHhTHhnXNWS87VDF4pcnfQK4Ep7XScNLmPTZgURNKKYENYWDpzW1BhscS1WHS8CDgURFJQrWcoF3c13KKbgg1BYQfy8xZWEzTTw1QZbAoKu8FqJnktdu5hcVSHmchiILzzuaDQvjBzV2m8yohCE1jHfPx/xhU+y4G/D75ELlRJsSYAAAAASUVORK5CYII=",this.infoIcon.style.opacity="1"):(this.isShowingInfoIcon=!0,this.onTapOut(),this.infoIcon.src=ei,this.infoIcon.style.opacity="0.6")},e}(),el=function(){function e(){var e=this;this.infoDiv=new ec,this.infoIcon=new eu(function(){e.infoDiv.show()},function(){e.infoDiv.hide()})}return e.prototype.renderInto=function(e){this.infoDiv.renderInto(e),this.infoIcon.renderInto(e)},e}(),eh=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){var u=[s,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},ed=function(){function e(){}return e.hasPermissions=function(){var e,t,n,r;return e=this,t=void 0,n=void 0,r=function(){var e,t,n;return eh(this,function(r){switch(r.label){case 0:return[4,navigator.mediaDevices.enumerateDevices()];case 1:for(e=0,t=r.sent();e<t.length;e++)if("videoinput"===(n=t[e]).kind&&n.label)return[2,!0];return[2,!1]}})},new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},e}(),ep=function(){function e(e){this.supportedScanTypes=this.validateAndReturnScanTypes(e)}return e.prototype.getDefaultScanType=function(){return this.supportedScanTypes[0]},e.prototype.hasMoreThanOneScanType=function(){return this.supportedScanTypes.length>1},e.prototype.isCameraScanRequired=function(){for(var t=0,n=this.supportedScanTypes;t<n.length;t++){var r=n[t];if(e.isCameraScanType(r))return!0}return!1},e.isCameraScanType=function(e){return e===p.SCAN_TYPE_CAMERA},e.isFileScanType=function(e){return e===p.SCAN_TYPE_FILE},e.prototype.validateAndReturnScanTypes=function(e){if(!e||0===e.length)return S.DEFAULT_SUPPORTED_SCAN_TYPE;var t=S.DEFAULT_SUPPORTED_SCAN_TYPE.length;if(e.length>t)throw"Max ".concat(t," values expected for ")+"supportedScanTypes";for(var n=0;n<e.length;n++){var r=e[n];if(!S.DEFAULT_SUPPORTED_SCAN_TYPE.includes(r))throw"Unsupported scan type ".concat(r)}return e},e}(),ef=function(){function e(){}return e.ALL_ELEMENT_CLASS="html5-qrcode-element",e.CAMERA_PERMISSION_BUTTON_ID="html5-qrcode-button-camera-permission",e.CAMERA_START_BUTTON_ID="html5-qrcode-button-camera-start",e.CAMERA_STOP_BUTTON_ID="html5-qrcode-button-camera-stop",e.TORCH_BUTTON_ID="html5-qrcode-button-torch",e.CAMERA_SELECTION_SELECT_ID="html5-qrcode-select-camera",e.FILE_SELECTION_BUTTON_ID="html5-qrcode-button-file-selection",e.ZOOM_SLIDER_ID="html5-qrcode-input-range-zoom",e.SCAN_TYPE_CHANGE_ANCHOR_ID="html5-qrcode-anchor-scan-type-change",e.TORCH_BUTTON_CLASS_TORCH_ON="html5-qrcode-button-torch-on",e.TORCH_BUTTON_CLASS_TORCH_OFF="html5-qrcode-button-torch-off",e}(),eg=function(){function e(){}return e.createElement=function(e,t){var n=document.createElement(e);return n.id=t,n.classList.add(ef.ALL_ELEMENT_CLASS),"button"===e&&n.setAttribute("type","button"),n},e}(),ey=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},em=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){var u=[s,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},eS=function(){function e(e,t,n){this.isTorchOn=!1,this.torchCapability=e,this.buttonController=t,this.onTorchActionFailureCallback=n}return e.prototype.isTorchEnabled=function(){return this.isTorchOn},e.prototype.flipState=function(){return ey(this,void 0,void 0,function(){var e,t;return em(this,function(n){switch(n.label){case 0:this.buttonController.disable(),e=!this.isTorchOn,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.torchCapability.apply(e)];case 2:return n.sent(),this.updateUiBasedOnLatestSettings(this.torchCapability.value(),e),[3,4];case 3:return t=n.sent(),this.propagateFailure(e,t),this.buttonController.enable(),[3,4];case 4:return[2]}})})},e.prototype.updateUiBasedOnLatestSettings=function(e,t){e===t?(this.buttonController.setText(t?D.torchOffButton():D.torchOnButton()),this.isTorchOn=t):this.propagateFailure(t),this.buttonController.enable()},e.prototype.propagateFailure=function(e,t){var n=e?D.torchOnFailedMessage():D.torchOffFailedMessage();t&&(n+="; Error = "+t),this.onTorchActionFailureCallback(n)},e.prototype.reset=function(){this.isTorchOn=!1},e}(),eT=function(){function e(e,t){this.onTorchActionFailureCallback=t,this.torchButton=eg.createElement("button",ef.TORCH_BUTTON_ID),this.torchController=new eS(e,this,t)}return e.prototype.render=function(e,t){var n=this;this.torchButton.innerText=D.torchOnButton(),this.torchButton.style.display=t.display,this.torchButton.style.marginLeft=t.marginLeft;var r=this;this.torchButton.addEventListener("click",function(e){return ey(n,void 0,void 0,function(){return em(this,function(e){switch(e.label){case 0:return[4,r.torchController.flipState()];case 1:return e.sent(),r.torchController.isTorchEnabled()?(r.torchButton.classList.remove(ef.TORCH_BUTTON_CLASS_TORCH_OFF),r.torchButton.classList.add(ef.TORCH_BUTTON_CLASS_TORCH_ON)):(r.torchButton.classList.remove(ef.TORCH_BUTTON_CLASS_TORCH_ON),r.torchButton.classList.add(ef.TORCH_BUTTON_CLASS_TORCH_OFF)),[2]}})})}),e.appendChild(this.torchButton)},e.prototype.updateTorchCapability=function(e){this.torchController=new eS(e,this,this.onTorchActionFailureCallback)},e.prototype.getTorchButton=function(){return this.torchButton},e.prototype.hide=function(){this.torchButton.style.display="none"},e.prototype.show=function(){this.torchButton.style.display="inline-block"},e.prototype.disable=function(){this.torchButton.disabled=!0},e.prototype.enable=function(){this.torchButton.disabled=!1},e.prototype.setText=function(e){this.torchButton.innerText=e},e.prototype.reset=function(){this.torchButton.innerText=D.torchOnButton(),this.torchController.reset()},e.create=function(t,n,r,o){var i=new e(n,o);return i.render(t,r),i},e}(),eM=function(){function e(e,t,n){this.fileBasedScanRegion=this.createFileBasedScanRegion(),this.fileBasedScanRegion.style.display=t?"block":"none",e.appendChild(this.fileBasedScanRegion);var r=document.createElement("label");r.setAttribute("for",this.getFileScanInputId()),r.style.display="inline-block",this.fileBasedScanRegion.appendChild(r),this.fileSelectionButton=eg.createElement("button",ef.FILE_SELECTION_BUTTON_ID),this.setInitialValueToButton(),this.fileSelectionButton.addEventListener("click",function(e){r.click()}),r.append(this.fileSelectionButton),this.fileScanInput=eg.createElement("input",this.getFileScanInputId()),this.fileScanInput.type="file",this.fileScanInput.accept="image/*",this.fileScanInput.style.display="none",r.appendChild(this.fileScanInput);var o=this;this.fileScanInput.addEventListener("change",function(e){if(null!=e&&null!=e.target){var t=e.target;if(!t.files||0!==t.files.length){var r=t.files[0],i=r.name;o.setImageNameToButton(i),n(r)}}});var i=this.createDragAndDropMessage();this.fileBasedScanRegion.appendChild(i),this.fileBasedScanRegion.addEventListener("dragenter",function(e){o.fileBasedScanRegion.style.border=o.fileBasedScanRegionActiveBorder(),e.stopPropagation(),e.preventDefault()}),this.fileBasedScanRegion.addEventListener("dragleave",function(e){o.fileBasedScanRegion.style.border=o.fileBasedScanRegionDefaultBorder(),e.stopPropagation(),e.preventDefault()}),this.fileBasedScanRegion.addEventListener("dragover",function(e){o.fileBasedScanRegion.style.border=o.fileBasedScanRegionActiveBorder(),e.stopPropagation(),e.preventDefault()}),this.fileBasedScanRegion.addEventListener("drop",function(e){e.stopPropagation(),e.preventDefault(),o.fileBasedScanRegion.style.border=o.fileBasedScanRegionDefaultBorder();var t=e.dataTransfer;if(t){var r=t.files;if(!r||0===r.length)return;for(var a=!1,s=0;s<r.length;++s){var c=r.item(s);if(c){var u=/image.*/;if(c.type.match(u)){a=!0;var l=c.name;o.setImageNameToButton(l),n(c),i.innerText=D.dragAndDropMessage();break}}}a||(i.innerText=D.dragAndDropMessageOnlyImages())}})}return e.prototype.hide=function(){this.fileBasedScanRegion.style.display="none",this.fileScanInput.disabled=!0},e.prototype.show=function(){this.fileBasedScanRegion.style.display="block",this.fileScanInput.disabled=!1},e.prototype.isShowing=function(){return"block"===this.fileBasedScanRegion.style.display},e.prototype.resetValue=function(){this.fileScanInput.value="",this.setInitialValueToButton()},e.prototype.createFileBasedScanRegion=function(){var e=document.createElement("div");return e.style.textAlign="center",e.style.margin="auto",e.style.width="80%",e.style.maxWidth="600px",e.style.border=this.fileBasedScanRegionDefaultBorder(),e.style.padding="10px",e.style.marginBottom="10px",e},e.prototype.fileBasedScanRegionDefaultBorder=function(){return"6px dashed #ebebeb"},e.prototype.fileBasedScanRegionActiveBorder=function(){return"6px dashed rgb(153 151 151)"},e.prototype.createDragAndDropMessage=function(){var e=document.createElement("div");return e.innerText=D.dragAndDropMessage(),e.style.fontWeight="400",e},e.prototype.setImageNameToButton=function(e){if(e.length>20){var t=e.substring(0,8),n=e.length,r=e.substring(n-8,n);e="".concat(t,"....").concat(r)}var o=D.fileSelectionChooseAnother()+" - "+e;this.fileSelectionButton.innerText=o},e.prototype.setInitialValueToButton=function(){var e=D.fileSelectionChooseImage()+" - "+D.fileSelectionNoImageSelected();this.fileSelectionButton.innerText=e},e.prototype.getFileScanInputId=function(){return"html5-qrcode-private-filescan-input"},e.create=function(t,n,r){return new e(t,n,r)},e}(),eC=function(){function e(e){this.selectElement=eg.createElement("select",ef.CAMERA_SELECTION_SELECT_ID),this.cameras=e,this.options=[]}return e.prototype.render=function(e){var t=document.createElement("span");t.style.marginRight="10px";var n=this.cameras.length;if(0===n)throw Error("No cameras found");if(1===n)t.style.display="none";else{var r=D.selectCamera();t.innerText="".concat(r," (").concat(this.cameras.length,") ")}for(var o=1,i=0,a=this.cameras;i<a.length;i++){var s=a[i],c=s.id,u=null==s.label?c:s.label;u&&""!==u||(u=[D.anonymousCameraPrefix(),o++].join(" "));var l=document.createElement("option");l.value=c,l.innerText=u,this.options.push(l),this.selectElement.appendChild(l)}t.appendChild(this.selectElement),e.appendChild(t)},e.prototype.disable=function(){this.selectElement.disabled=!0},e.prototype.isDisabled=function(){return!0===this.selectElement.disabled},e.prototype.enable=function(){this.selectElement.disabled=!1},e.prototype.getValue=function(){return this.selectElement.value},e.prototype.hasValue=function(e){for(var t=0,n=this.options;t<n.length;t++)if(n[t].value===e)return!0;return!1},e.prototype.setValue=function(e){if(!this.hasValue(e))throw Error("".concat(e," is not present in the camera list."));this.selectElement.value=e},e.prototype.hasSingleItem=function(){return 1===this.cameras.length},e.prototype.numCameras=function(){return this.cameras.length},e.create=function(t,n){var r=new e(n);return r.render(t),r},e}(),eE=function(){function e(){this.onChangeCallback=null,this.zoomElementContainer=document.createElement("div"),this.rangeInput=eg.createElement("input",ef.ZOOM_SLIDER_ID),this.rangeInput.type="range",this.rangeText=document.createElement("span"),this.rangeInput.min="1",this.rangeInput.max="5",this.rangeInput.value="1",this.rangeInput.step="0.1"}return e.prototype.render=function(e,t){this.zoomElementContainer.style.display=t?"block":"none",this.zoomElementContainer.style.padding="5px 10px",this.zoomElementContainer.style.textAlign="center",e.appendChild(this.zoomElementContainer),this.rangeInput.style.display="inline-block",this.rangeInput.style.width="50%",this.rangeInput.style.height="5px",this.rangeInput.style.background="#d3d3d3",this.rangeInput.style.outline="none",this.rangeInput.style.opacity="0.7";var n=D.zoom();this.rangeText.innerText="".concat(this.rangeInput.value,"x ").concat(n),this.rangeText.style.marginRight="10px";var r=this;this.rangeInput.addEventListener("input",function(){return r.onValueChange()}),this.rangeInput.addEventListener("change",function(){return r.onValueChange()}),this.zoomElementContainer.appendChild(this.rangeInput),this.zoomElementContainer.appendChild(this.rangeText)},e.prototype.onValueChange=function(){var e=D.zoom();this.rangeText.innerText="".concat(this.rangeInput.value,"x ").concat(e),this.onChangeCallback&&this.onChangeCallback(parseFloat(this.rangeInput.value))},e.prototype.setValues=function(e,t,n,r){this.rangeInput.min=e.toString(),this.rangeInput.max=t.toString(),this.rangeInput.step=r.toString(),this.rangeInput.value=n.toString(),this.onValueChange()},e.prototype.show=function(){this.zoomElementContainer.style.display="block"},e.prototype.hide=function(){this.zoomElementContainer.style.display="none"},e.prototype.setOnCameraZoomValueChangeCallback=function(e){this.onChangeCallback=e},e.prototype.removeOnCameraZoomValueChangeCallback=function(){this.onChangeCallback=null},e.create=function(t,n){var r=new e;return r.render(t,n),r},e}();(u=y||(y={}))[u.STATUS_DEFAULT=0]="STATUS_DEFAULT",u[u.STATUS_SUCCESS=1]="STATUS_SUCCESS",u[u.STATUS_WARNING=2]="STATUS_WARNING",u[u.STATUS_REQUESTING_PERMISSION=3]="STATUS_REQUESTING_PERMISSION";var eI=function(){function e(e,t,n){if(this.lastMatchFound=null,this.cameraScanImage=null,this.fileScanImage=null,this.fileSelectionUi=null,this.elementId=e,this.config=this.createConfig(t),this.verbose=!0===n,!document.getElementById(e))throw"HTML Element with id=".concat(e," not found");this.scanTypeSelector=new ep(this.config.supportedScanTypes),this.currentScanType=this.scanTypeSelector.getDefaultScanType(),this.sectionSwapAllowed=!0,this.logger=new E(this.verbose),this.persistedDataManager=new es,!0!==t.rememberLastUsedCamera&&this.persistedDataManager.reset()}return e.prototype.render=function(e,t){var n,r,o=this;this.lastMatchFound=null,this.qrCodeSuccessCallback=function(t,n){if(e)e(t,n);else{if(o.lastMatchFound===t)return;o.lastMatchFound=t,o.setHeaderMessage(D.lastMatch(t),y.STATUS_SUCCESS)}},this.qrCodeErrorCallback=function(e,n){t&&t(e,n)};var i=document.getElementById(this.elementId);if(!i)throw"HTML Element with id=".concat(this.elementId," not found");i.innerHTML="",this.createBasicLayout(i),this.html5Qrcode=new et(this.getScanRegionId(),(n=this.config,r=this.verbose,{formatsToSupport:n.formatsToSupport,useBarCodeDetectorIfSupported:n.useBarCodeDetectorIfSupported,experimentalFeatures:n.experimentalFeatures,verbose:r}))},e.prototype.pause=function(e){(I(e)||!0!==e)&&(e=!1),this.getHtml5QrcodeOrFail().pause(e)},e.prototype.resume=function(){this.getHtml5QrcodeOrFail().resume()},e.prototype.getState=function(){return this.getHtml5QrcodeOrFail().getState()},e.prototype.clear=function(){var e=this,t=function(){var t=document.getElementById(e.elementId);t&&(t.innerHTML="",e.resetBasicLayout(t))};return this.html5Qrcode?new Promise(function(n,r){e.html5Qrcode?e.html5Qrcode.isScanning?e.html5Qrcode.stop().then(function(r){e.html5Qrcode&&(e.html5Qrcode.clear(),t()),n()}).catch(function(t){e.verbose&&e.logger.logError("Unable to stop qrcode scanner",t),r(t)}):(e.html5Qrcode.clear(),t(),n()):n()}):Promise.resolve()},e.prototype.getRunningTrackCapabilities=function(){return this.getHtml5QrcodeOrFail().getRunningTrackCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getHtml5QrcodeOrFail().getRunningTrackSettings()},e.prototype.applyVideoConstraints=function(e){return this.getHtml5QrcodeOrFail().applyVideoConstraints(e)},e.prototype.getHtml5QrcodeOrFail=function(){if(!this.html5Qrcode)throw"Code scanner not initialized.";return this.html5Qrcode},e.prototype.createConfig=function(e){return e?(e.fps||(e.fps=S.SCAN_DEFAULT_FPS),!S.DEFAULT_REMEMBER_LAST_CAMERA_USED!==e.rememberLastUsedCamera&&(e.rememberLastUsedCamera=S.DEFAULT_REMEMBER_LAST_CAMERA_USED),e.supportedScanTypes||(e.supportedScanTypes=S.DEFAULT_SUPPORTED_SCAN_TYPE),e):{fps:S.SCAN_DEFAULT_FPS,rememberLastUsedCamera:S.DEFAULT_REMEMBER_LAST_CAMERA_USED,supportedScanTypes:S.DEFAULT_SUPPORTED_SCAN_TYPE}},e.prototype.createBasicLayout=function(e){e.style.position="relative",e.style.padding="0px",e.style.border="1px solid silver",this.createHeader(e);var t=document.createElement("div");t.id=this.getScanRegionId(),t.style.width="100%",t.style.minHeight="100px",t.style.textAlign="center",e.appendChild(t),ep.isCameraScanType(this.currentScanType)?this.insertCameraScanImageToScanRegion():this.insertFileScanImageToScanRegion();var n=document.createElement("div");n.id=this.getDashboardId(),n.style.width="100%",e.appendChild(n),this.setupInitialDashboard(n)},e.prototype.resetBasicLayout=function(e){e.style.border="none"},e.prototype.setupInitialDashboard=function(e){this.createSection(e),this.createSectionControlPanel(),this.scanTypeSelector.hasMoreThanOneScanType()&&this.createSectionSwap()},e.prototype.createHeader=function(e){var t=document.createElement("div");t.style.textAlign="left",t.style.margin="0px",e.appendChild(t),new el().renderInto(t);var n=document.createElement("div");n.id=this.getHeaderMessageContainerId(),n.style.display="none",n.style.textAlign="center",n.style.fontSize="14px",n.style.padding="2px 10px",n.style.margin="4px",n.style.borderTop="1px solid #f6f6f6",t.appendChild(n)},e.prototype.createSection=function(e){var t=document.createElement("div");t.id=this.getDashboardSectionId(),t.style.width="100%",t.style.padding="10px 0px 10px 0px",t.style.textAlign="left",e.appendChild(t)},e.prototype.createCameraListUi=function(e,t,n){var r=this;r.showHideScanTypeSwapLink(!1),r.setHeaderMessage(D.cameraPermissionRequesting());var o=function(){n||r.createPermissionButton(e,t)};et.getCameras().then(function(n){r.persistedDataManager.setHasPermission(!0),r.showHideScanTypeSwapLink(!0),r.resetHeaderMessage(),n&&n.length>0?(e.removeChild(t),r.renderCameraSelection(n)):(r.setHeaderMessage(D.noCameraFound(),y.STATUS_WARNING),o())}).catch(function(e){r.persistedDataManager.setHasPermission(!1),n?n.disabled=!1:o(),r.setHeaderMessage(e,y.STATUS_WARNING),r.showHideScanTypeSwapLink(!0)})},e.prototype.createPermissionButton=function(e,t){var n=this,r=eg.createElement("button",this.getCameraPermissionButtonId());r.innerText=D.cameraPermissionTitle(),r.addEventListener("click",function(){r.disabled=!0,n.createCameraListUi(e,t,r)}),t.appendChild(r)},e.prototype.createPermissionsUi=function(e,t){var n=this;ep.isCameraScanType(this.currentScanType)&&this.persistedDataManager.hasCameraPermissions()?ed.hasPermissions().then(function(r){r?n.createCameraListUi(e,t):(n.persistedDataManager.setHasPermission(!1),n.createPermissionButton(e,t))}).catch(function(r){n.persistedDataManager.setHasPermission(!1),n.createPermissionButton(e,t)}):this.createPermissionButton(e,t)},e.prototype.createSectionControlPanel=function(){var e=document.getElementById(this.getDashboardSectionId()),t=document.createElement("div");e.appendChild(t);var n=document.createElement("div");n.id=this.getDashboardSectionCameraScanRegionId(),n.style.display=ep.isCameraScanType(this.currentScanType)?"block":"none",t.appendChild(n);var r=document.createElement("div");r.style.textAlign="center",n.appendChild(r),this.scanTypeSelector.isCameraScanRequired()&&this.createPermissionsUi(n,r),this.renderFileScanUi(t)},e.prototype.renderFileScanUi=function(e){var t=ep.isFileScanType(this.currentScanType),n=this;this.fileSelectionUi=eM.create(e,t,function(e){if(!n.html5Qrcode)throw"html5Qrcode not defined";ep.isFileScanType(n.currentScanType)&&(n.setHeaderMessage(D.loadingImage()),n.html5Qrcode.scanFileV2(e,!0).then(function(e){n.resetHeaderMessage(),n.qrCodeSuccessCallback(e.decodedText,e)}).catch(function(e){n.setHeaderMessage(e,y.STATUS_WARNING),n.qrCodeErrorCallback(e,C.createFrom(e))}))})},e.prototype.renderCameraSelection=function(e){var t,n=this,r=this,o=document.getElementById(this.getDashboardSectionCameraScanRegionId());o.style.textAlign="center";var i=eE.create(o,!1),a=function(e){var t=e.zoomFeature();if(t.isSupported()){i.setOnCameraZoomValueChangeCallback(function(e){t.apply(e)});var r,o,a,s=1;n.config.defaultZoomValueIfSupported&&(s=n.config.defaultZoomValueIfSupported),r=s,o=t.min(),s=r>(a=t.max())?a:r<o?o:r,i.setValues(t.min(),t.max(),s,t.step()),i.show()}},s=eC.create(o,e),c=document.createElement("span"),u=eg.createElement("button",ef.CAMERA_START_BUTTON_ID);u.innerText=D.scanButtonStartScanningText(),c.appendChild(u);var l=eg.createElement("button",ef.CAMERA_STOP_BUTTON_ID);l.innerText=D.scanButtonStopScanningText(),l.style.display="none",l.disabled=!0,c.appendChild(l);var h=function(e){if(!e.torchFeature().isSupported()){t&&t.hide();return}t?t.updateTorchCapability(e.torchFeature()):t=eT.create(c,e.torchFeature(),{display:"none",marginLeft:"5px"},function(e){r.setHeaderMessage(e,y.STATUS_WARNING)}),t.show()};o.appendChild(c);var d=function(e){e||(u.style.display="none"),u.innerText=D.scanButtonStartScanningText(),u.style.opacity="1",u.disabled=!1,e&&(u.style.display="inline-block")};if(u.addEventListener("click",function(e){u.innerText=D.scanButtonScanningStarting(),s.disable(),u.disabled=!0,u.style.opacity="0.5",n.scanTypeSelector.hasMoreThanOneScanType()&&r.showHideScanTypeSwapLink(!1),r.resetHeaderMessage();var t,o=s.getValue();r.persistedDataManager.setLastUsedCameraId(o),r.html5Qrcode.start(o,{fps:(t=r.config).fps,qrbox:t.qrbox,aspectRatio:t.aspectRatio,disableFlip:t.disableFlip,videoConstraints:t.videoConstraints},r.qrCodeSuccessCallback,r.qrCodeErrorCallback).then(function(e){l.disabled=!1,l.style.display="inline-block",d(!1);var t=r.html5Qrcode.getRunningTrackCameraCapabilities();!0===n.config.showTorchButtonIfSupported&&h(t),!0===n.config.showZoomSliderIfSupported&&a(t)}).catch(function(e){r.showHideScanTypeSwapLink(!0),s.enable(),d(!0),r.setHeaderMessage(e,y.STATUS_WARNING)})}),s.hasSingleItem()&&u.click(),l.addEventListener("click",function(e){if(!r.html5Qrcode)throw"html5Qrcode not defined";l.disabled=!0,r.html5Qrcode.stop().then(function(e){n.scanTypeSelector.hasMoreThanOneScanType()&&r.showHideScanTypeSwapLink(!0),s.enable(),u.disabled=!1,l.style.display="none",u.style.display="inline-block",t&&(t.reset(),t.hide()),i.removeOnCameraZoomValueChangeCallback(),i.hide(),r.insertCameraScanImageToScanRegion()}).catch(function(e){l.disabled=!1,r.setHeaderMessage(e,y.STATUS_WARNING)})}),r.persistedDataManager.getLastUsedCameraId()){var p=r.persistedDataManager.getLastUsedCameraId();s.hasValue(p)?(s.setValue(p),u.click()):r.persistedDataManager.resetLastUsedCameraId()}},e.prototype.createSectionSwap=function(){var e=this,t=D.textIfCameraScanSelected(),n=D.textIfFileScanSelected(),r=document.getElementById(this.getDashboardSectionId()),o=document.createElement("div");o.style.textAlign="center";var i=eg.createElement("span",this.getDashboardSectionSwapLinkId());i.style.textDecoration="underline",i.style.cursor="pointer",i.innerText=ep.isCameraScanType(this.currentScanType)?t:n,i.addEventListener("click",function(){if(!e.sectionSwapAllowed){e.verbose&&e.logger.logError("Section swap called when not allowed");return}e.resetHeaderMessage(),e.fileSelectionUi.resetValue(),e.sectionSwapAllowed=!1,ep.isCameraScanType(e.currentScanType)?(e.clearScanRegion(),e.getCameraScanRegion().style.display="none",e.fileSelectionUi.show(),i.innerText=n,e.currentScanType=p.SCAN_TYPE_FILE,e.insertFileScanImageToScanRegion()):(e.clearScanRegion(),e.getCameraScanRegion().style.display="block",e.fileSelectionUi.hide(),i.innerText=t,e.currentScanType=p.SCAN_TYPE_CAMERA,e.insertCameraScanImageToScanRegion(),e.startCameraScanIfPermissionExistsOnSwap()),e.sectionSwapAllowed=!0}),o.appendChild(i),r.appendChild(o)},e.prototype.startCameraScanIfPermissionExistsOnSwap=function(){var e=this,t=this;if(this.persistedDataManager.hasCameraPermissions())return void ed.hasPermissions().then(function(n){if(n){var r=document.getElementById(t.getCameraPermissionButtonId());if(!r)throw e.logger.logError("Permission button not found, fail;"),"Permission button not found";r.click()}else t.persistedDataManager.setHasPermission(!1)}).catch(function(e){t.persistedDataManager.setHasPermission(!1)})},e.prototype.resetHeaderMessage=function(){document.getElementById(this.getHeaderMessageContainerId()).style.display="none"},e.prototype.setHeaderMessage=function(e,t){t||(t=y.STATUS_DEFAULT);var n=this.getHeaderMessageDiv();switch(n.innerText=e,n.style.display="block",t){case y.STATUS_SUCCESS:n.style.background="rgba(106, 175, 80, 0.26)",n.style.color="#477735";break;case y.STATUS_WARNING:n.style.background="rgba(203, 36, 49, 0.14)",n.style.color="#cb2431";break;case y.STATUS_DEFAULT:default:n.style.background="rgba(0, 0, 0, 0)",n.style.color="rgb(17, 17, 17)"}},e.prototype.showHideScanTypeSwapLink=function(e){this.scanTypeSelector.hasMoreThanOneScanType()&&(!0!==e&&(e=!1),this.sectionSwapAllowed=e,this.getDashboardSectionSwapLink().style.display=e?"inline-block":"none")},e.prototype.insertCameraScanImageToScanRegion=function(){var e=this,t=document.getElementById(this.getScanRegionId());if(this.cameraScanImage){t.innerHTML="<br>",t.appendChild(this.cameraScanImage);return}this.cameraScanImage=new Image,this.cameraScanImage.onload=function(n){t.innerHTML="<br>",t.appendChild(e.cameraScanImage)},this.cameraScanImage.width=64,this.cameraScanImage.style.opacity="0.8",this.cameraScanImage.src=er,this.cameraScanImage.alt=D.cameraScanAltText()},e.prototype.insertFileScanImageToScanRegion=function(){var e=this,t=document.getElementById(this.getScanRegionId());if(this.fileScanImage){t.innerHTML="<br>",t.appendChild(this.fileScanImage);return}this.fileScanImage=new Image,this.fileScanImage.onload=function(n){t.innerHTML="<br>",t.appendChild(e.fileScanImage)},this.fileScanImage.width=64,this.fileScanImage.style.opacity="0.8",this.fileScanImage.src=eo,this.fileScanImage.alt=D.fileScanAltText()},e.prototype.clearScanRegion=function(){document.getElementById(this.getScanRegionId()).innerHTML=""},e.prototype.getDashboardSectionId=function(){return"".concat(this.elementId,"__dashboard_section")},e.prototype.getDashboardSectionCameraScanRegionId=function(){return"".concat(this.elementId,"__dashboard_section_csr")},e.prototype.getDashboardSectionSwapLinkId=function(){return ef.SCAN_TYPE_CHANGE_ANCHOR_ID},e.prototype.getScanRegionId=function(){return"".concat(this.elementId,"__scan_region")},e.prototype.getDashboardId=function(){return"".concat(this.elementId,"__dashboard")},e.prototype.getHeaderMessageContainerId=function(){return"".concat(this.elementId,"__header_message")},e.prototype.getCameraPermissionButtonId=function(){return ef.CAMERA_PERMISSION_BUTTON_ID},e.prototype.getCameraScanRegion=function(){return document.getElementById(this.getDashboardSectionCameraScanRegionId())},e.prototype.getDashboardSectionSwapLink=function(){return document.getElementById(this.getDashboardSectionSwapLinkId())},e.prototype.getHeaderMessageDiv=function(){return document.getElementById(this.getHeaderMessageContainerId())},e}()}}]);