agentroam-runtime-darwin-arm64 0.2.0-preview.74 → 0.2.0-preview.75

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 (255) hide show
  1. package/manifest.json +2 -2
  2. package/package.json +1 -1
  3. package/runtime/.next/BUILD_ID +1 -1
  4. package/runtime/.next/app-build-manifest.json +8 -8
  5. package/runtime/.next/app-path-routes-manifest.json +1 -1
  6. package/runtime/.next/build-manifest.json +5 -5
  7. package/runtime/.next/prerender-manifest.json +1 -1
  8. package/runtime/.next/required-server-files.json +1 -1
  9. package/runtime/.next/server/app/_not-found/page.js +1 -1
  10. package/runtime/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  11. package/runtime/.next/server/app/_not-found.html +1 -1
  12. package/runtime/.next/server/app/_not-found.rsc +1 -1
  13. package/runtime/.next/server/app/api/agent/abort/route.js +1 -1
  14. package/runtime/.next/server/app/api/agent/answer/route.js +1 -1
  15. package/runtime/.next/server/app/api/agent/codex-sharing/route.js +1 -1
  16. package/runtime/.next/server/app/api/agent/harness/status/route.js +1 -1
  17. package/runtime/.next/server/app/api/agent/model/route.js +1 -1
  18. package/runtime/.next/server/app/api/agent/models/route.js +1 -1
  19. package/runtime/.next/server/app/api/agent/run/route.js +1 -1
  20. package/runtime/.next/server/app/api/agent/runtime-health/route.js +1 -1
  21. package/runtime/.next/server/app/api/agent/steer/route.js +1 -1
  22. package/runtime/.next/server/app/api/agent/stream/route.js +2 -2
  23. package/runtime/.next/server/app/api/agent-workspaces/[workspaceId]/sessions/route.js +1 -1
  24. package/runtime/.next/server/app/api/agent-workspaces/route.js +1 -1
  25. package/runtime/.next/server/app/api/auth/verify/route.js +1 -1
  26. package/runtime/.next/server/app/api/business/route.js +1 -1
  27. package/runtime/.next/server/app/api/calendar/route.js +3 -0
  28. package/runtime/.next/server/app/api/calendar/route.js.nft.json +1 -0
  29. package/runtime/.next/server/app/api/client-logs/route.js +1 -1
  30. package/runtime/.next/server/app/api/collaboration/route.js +2 -2
  31. package/runtime/.next/server/app/api/engine-threads/route.js +1 -1
  32. package/runtime/.next/server/app/api/flow/v1/catalog/route.js +1 -1
  33. package/runtime/.next/server/app/api/flow/v1/runs/[runId]/cancel/route.js +1 -1
  34. package/runtime/.next/server/app/api/flow/v1/runs/[runId]/events/route.js +2 -2
  35. package/runtime/.next/server/app/api/flow/v1/runs/route.js +1 -1
  36. package/runtime/.next/server/app/api/flow-studio/config/route.js +1 -1
  37. package/runtime/.next/server/app/api/mcp/connect/route.js +1 -1
  38. package/runtime/.next/server/app/api/mcp/disconnect/route.js +1 -1
  39. package/runtime/.next/server/app/api/mcp/servers/route.js +1 -1
  40. package/runtime/.next/server/app/api/memory/[key]/route.js +1 -1
  41. package/runtime/.next/server/app/api/memory/route.js +1 -1
  42. package/runtime/.next/server/app/api/messaging/route.js +1 -1
  43. package/runtime/.next/server/app/api/plugins/load/route.js +1 -1
  44. package/runtime/.next/server/app/api/projects/[id]/route.js +1 -1
  45. package/runtime/.next/server/app/api/projects/check/route.js +1 -1
  46. package/runtime/.next/server/app/api/projects/directories/route.js +1 -1
  47. package/runtime/.next/server/app/api/projects/roots/route.js +1 -1
  48. package/runtime/.next/server/app/api/projects/route.js +1 -1
  49. package/runtime/.next/server/app/api/push/subscribe/route.js +2 -2
  50. package/runtime/.next/server/app/api/push/unsubscribe/route.js +2 -2
  51. package/runtime/.next/server/app/api/push/vapid/route.js +2 -2
  52. package/runtime/.next/server/app/api/push/vapid.body +1 -1
  53. package/runtime/.next/server/app/api/remote-tools/register/route.js +1 -1
  54. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/[jobId]/route.js +1 -1
  55. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/[jobId]/stop/route.js +1 -1
  56. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/route.js +1 -1
  57. package/runtime/.next/server/app/api/sessions/[id]/changes/route.js +2 -2
  58. package/runtime/.next/server/app/api/sessions/[id]/engine-switches/route.js +1 -1
  59. package/runtime/.next/server/app/api/sessions/[id]/fork/route.js +1 -1
  60. package/runtime/.next/server/app/api/sessions/[id]/fork-at/route.js +1 -1
  61. package/runtime/.next/server/app/api/sessions/[id]/goals/route.js +1 -1
  62. package/runtime/.next/server/app/api/sessions/[id]/handoff/route.js +1 -1
  63. package/runtime/.next/server/app/api/sessions/[id]/native-goal/route.js +1 -1
  64. package/runtime/.next/server/app/api/sessions/[id]/query-index/route.js +1 -1
  65. package/runtime/.next/server/app/api/sessions/[id]/release/route.js +1 -1
  66. package/runtime/.next/server/app/api/sessions/[id]/route.js +1 -1
  67. package/runtime/.next/server/app/api/sessions/[id]/switch-engine/route.js +1 -1
  68. package/runtime/.next/server/app/api/sessions/[id]/thread-goal/route.js +1 -1
  69. package/runtime/.next/server/app/api/sessions/[id]/thread-history/route.js +1 -1
  70. package/runtime/.next/server/app/api/sessions/[id]/tool-result/route.js +1 -1
  71. package/runtime/.next/server/app/api/sessions/parallel/route.js +1 -1
  72. package/runtime/.next/server/app/api/sessions/route.js +1 -1
  73. package/runtime/.next/server/app/api/settings/route.js +1 -1
  74. package/runtime/.next/server/app/api/skills/route.js +1 -1
  75. package/runtime/.next/server/app/api/tool-policies/[policyId]/route.js +1 -1
  76. package/runtime/.next/server/app/api/tool-policies/route.js +1 -1
  77. package/runtime/.next/server/app/api/tools/route.js +1 -1
  78. package/runtime/.next/server/app/api/update/check/route.js +1 -1
  79. package/runtime/.next/server/app/api/update/install/route.js +1 -1
  80. package/runtime/.next/server/app/api/update/status/route.js +1 -1
  81. package/runtime/.next/server/app/api/web-auth/login/route.js +1 -1
  82. package/runtime/.next/server/app/api/web-auth/logout/route.js +1 -1
  83. package/runtime/.next/server/app/api/web-auth/revoke-all/route.js +1 -1
  84. package/runtime/.next/server/app/api/web-auth/setup/route.js +1 -1
  85. package/runtime/.next/server/app/api/web-auth/status/route.js +1 -1
  86. package/runtime/.next/server/app/api/web-console/bootstrap/route.js +1 -1
  87. package/runtime/.next/server/app/api/web-console/computer-settings/route.js +1 -1
  88. package/runtime/.next/server/app/api/web-console/computers/route.js +1 -1
  89. package/runtime/.next/server/app/api/web-console/device-state/route.js +1 -1
  90. package/runtime/.next/server/app/api/web-console/history/route.js +1 -1
  91. package/runtime/.next/server/app/api/web-console/preferences/route.js +1 -1
  92. package/runtime/.next/server/app/web/page.js +2 -2
  93. package/runtime/.next/server/app/web/page_client-reference-manifest.js +1 -1
  94. package/runtime/.next/server/app-paths-manifest.json +16 -15
  95. package/runtime/.next/server/chunks/5303.js +1 -1
  96. package/runtime/.next/server/middleware-build-manifest.js +1 -1
  97. package/runtime/.next/server/pages/404.html +1 -1
  98. package/runtime/.next/server/pages/500.html +1 -1
  99. package/runtime/.next/server/server-reference-manifest.json +1 -1
  100. package/runtime/.next/static/chunks/app/web/{error-53531bb27b3b87f8.js → error-3cae58f0f14f0b4f.js} +1 -1
  101. package/runtime/.next/static/chunks/app/web/layout-d5d7d1c5c74eef3c.js +1 -0
  102. package/runtime/.next/static/chunks/app/web/page-7afa4cb0119e90b7.js +1 -0
  103. package/runtime/.next/static/chunks/{main-app-ba2527534563adfe.js → main-app-7a6902a607752446.js} +1 -1
  104. package/runtime/.next/static/chunks/{main-93c452d518291b1c.js → main-d8ef9def37924b01.js} +1 -1
  105. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/MacOS/agentroam-remote-desktop +0 -0
  106. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/Resources/agentroam-component.json +1 -1
  107. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/_CodeSignature/CodeResources +2 -2
  108. package/runtime/node_modules/.package-lock.json +11 -11
  109. package/runtime/node_modules/@agent/core/dist/index.js +86 -9
  110. package/runtime/node_modules/@agent/native-runtime/dist/index.js +17 -15
  111. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/README.md +1 -1
  112. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/bridge.mjs +96 -96
  113. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/browser-sdk.js +73 -71
  114. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-2h2qc9qv.mjs +18 -0
  115. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-9sxfsmzx.mjs +18 -0
  116. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-zg882d22.mjs → core-ba5rrckm.mjs} +2 -2
  117. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-dnsvg8nc.mjs +53 -0
  118. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-9je8ee1j.mjs → core-h6r54bwv.mjs} +2 -2
  119. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-k67vj6j9.mjs +20 -0
  120. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-qbjntcdf.mjs +18 -0
  121. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-qj4dtgyt.mjs +17 -0
  122. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-rn7tc54w.mjs +17 -0
  123. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-sstebd83.mjs +18 -0
  124. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-td7rt8zt.mjs +17 -0
  125. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-x3hc9abc.mjs → core-tf03rfab.mjs} +3 -3
  126. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-x4kwpwv9.mjs +16 -0
  127. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-y6bhrwmk.mjs +47 -0
  128. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-fxa8mwbm.mjs → core-ya1m7gzj.mjs} +3 -3
  129. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core.mjs +11 -11
  130. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.json +21 -21
  131. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.zst.json +25 -25
  132. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/package.json +25 -21
  133. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs +88 -85
  134. package/runtime/package-lock.json +35 -35
  135. package/runtime/server.js +1 -1
  136. package/runtime/webapp/dist/assets/{AIHubView-DBOyOZzW.js → AIHubView-BMeOfqfm.js} +1 -1
  137. package/runtime/webapp/dist/assets/{AgentManager-BLHvEA2d.js → AgentManager-CrN2B-tH.js} +1 -1
  138. package/runtime/webapp/dist/assets/{AiHubPane-CWvL3HSl.js → AiHubPane-Du6ajSsx.js} +1 -1
  139. package/runtime/webapp/dist/assets/App-zihaYk1L.js +179 -0
  140. package/runtime/webapp/dist/assets/{BrowserLivePanel-Cl5kMDJF.js → BrowserLivePanel-CU_X6OU2.js} +1 -1
  141. package/runtime/webapp/dist/assets/{CollaborationCreateDialog-DPs4doOz.js → CollaborationCreateDialog-BmgYdwe7.js} +1 -1
  142. package/runtime/webapp/dist/assets/{CollaborationDashboard-ChUaJ5xA.js → CollaborationDashboard-mHU8iJYg.js} +1 -1
  143. package/runtime/webapp/dist/assets/{CollaborationPage-Cg22tJGB.js → CollaborationPage-Br5fhNce.js} +1 -1
  144. package/runtime/webapp/dist/assets/{FilePreview-BItgMeyP.js → FilePreview-CevPpP6E.js} +3 -3
  145. package/runtime/webapp/dist/assets/{FileTree-t-YjjCDU.js → FileTree-CagcHV1N.js} +1 -1
  146. package/runtime/webapp/dist/assets/{FileWorkspaceDrawer-BnOoPJA6.js → FileWorkspaceDrawer-CWVndCXp.js} +1 -1
  147. package/runtime/webapp/dist/assets/{FlowStudioPane-DHrpQpBA.js → FlowStudioPane-BZA-qvBj.js} +1 -1
  148. package/runtime/webapp/dist/assets/{LSPServerList-CB2Cwqw_.js → LSPServerList-BMY6dFfG.js} +1 -1
  149. package/runtime/webapp/dist/assets/{MCPServerList-DUpgIcHk.js → MCPServerList-c91QNM-g.js} +1 -1
  150. package/runtime/webapp/dist/assets/{MemoryViewer-DCFueBdK.js → MemoryViewer-C9IfWwzW.js} +1 -1
  151. package/runtime/webapp/dist/assets/{RemoteDesktopPage-DD9aNe8m.js → RemoteDesktopPage-w8aL061W.js} +1 -1
  152. package/runtime/webapp/dist/assets/{RunningSessionsIcon-CKKjZfu_.js → RunningSessionsIcon-B8Cr2-hp.js} +1 -1
  153. package/runtime/webapp/dist/assets/{SessionDashboard-CCpxslxg.js → SessionDashboard-CFXXTm_4.js} +1 -1
  154. package/runtime/webapp/dist/assets/{SessionDashboardBridge-DG1fQUEQ.js → SessionDashboardBridge-Bx4EXtos.js} +1 -1
  155. package/runtime/webapp/dist/assets/{SettingsPanel-CA0Pj7qk.js → SettingsPanel-CS4XL2sd.js} +1 -1
  156. package/runtime/webapp/dist/assets/{SkillManager-BzgAJlVW.js → SkillManager-5FZnR9My.js} +1 -1
  157. package/runtime/webapp/dist/assets/{TerminalPane-Bc4cGUmA.js → TerminalPane-CRrbd0i4.js} +1 -1
  158. package/runtime/webapp/dist/assets/{abnfDiagram-VCTEODGH-Dsp6XgB7.js → abnfDiagram-VCTEODGH-DBioGYiE.js} +1 -1
  159. package/runtime/webapp/dist/assets/{arc-DROGDR5M.js → arc-BRj_RXHL.js} +1 -1
  160. package/runtime/webapp/dist/assets/{architectureDiagram-5GKGNRK7-S8c_fFRN.js → architectureDiagram-5GKGNRK7-CoCdq67U.js} +1 -1
  161. package/runtime/webapp/dist/assets/{arrow-right-CUDfCOna.js → arrow-right-Cqqb1zqH.js} +1 -1
  162. package/runtime/webapp/dist/assets/{artifact-links-C7zYRJaC.js → artifact-links-73OZyi5W.js} +1 -1
  163. package/runtime/webapp/dist/assets/{blockDiagram-I7D4REHJ-DrTz3v2B.js → blockDiagram-I7D4REHJ-CLisIPjq.js} +1 -1
  164. package/runtime/webapp/dist/assets/{c4Diagram-7LVT6UL2-wuHRphdr.js → c4Diagram-7LVT6UL2-BoLCIVW8.js} +1 -1
  165. package/runtime/webapp/dist/assets/channel-JGVZzkSo.js +1 -0
  166. package/runtime/webapp/dist/assets/{chevron-down-fUU2ZKzR.js → chevron-down-DhZV290h.js} +1 -1
  167. package/runtime/webapp/dist/assets/{chunk-2Q5K7J3B-BpV5cOX0.js → chunk-2Q5K7J3B-CIQxwzU0.js} +1 -1
  168. package/runtime/webapp/dist/assets/{chunk-5VM5RSS4-1_IZosIm.js → chunk-5VM5RSS4-Buiv0MCN.js} +1 -1
  169. package/runtime/webapp/dist/assets/{chunk-F27PBJKO-IZ7w-WCZ.js → chunk-F27PBJKO-XBMwIl6X.js} +1 -1
  170. package/runtime/webapp/dist/assets/{chunk-IMKFNOWR-BuicwmZn.js → chunk-IMKFNOWR-C0NrkJOc.js} +1 -1
  171. package/runtime/webapp/dist/assets/{chunk-JWPE2WC7-CfNSj3eC.js → chunk-JWPE2WC7-CGON_UvB.js} +1 -1
  172. package/runtime/webapp/dist/assets/{chunk-POPQ4Y6H-Bxryudz4.js → chunk-POPQ4Y6H-BXvOsc9g.js} +1 -1
  173. package/runtime/webapp/dist/assets/{chunk-SVP7TREG-DSZbEEd6.js → chunk-SVP7TREG-ZD_qn-NK.js} +1 -1
  174. package/runtime/webapp/dist/assets/{chunk-TICWLB2K-CHqUfDzl.js → chunk-TICWLB2K-DrB8f6RG.js} +1 -1
  175. package/runtime/webapp/dist/assets/{chunk-XXDRQBXY-CPbMDiSF.js → chunk-XXDRQBXY-CYgLMn5t.js} +1 -1
  176. package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-BnctJ00R.js +1 -0
  177. package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-BnctJ00R.js +1 -0
  178. package/runtime/webapp/dist/assets/{codeSyntax-BENnBdX2.js → codeSyntax-DfQ5rLir.js} +1 -1
  179. package/runtime/webapp/dist/assets/{collaboration-DwgXZbHy.js → collaboration-CQhzjwS_.js} +1 -1
  180. package/runtime/webapp/dist/assets/{composer-file-routing-CKLnrVkP.js → composer-file-routing-D9orqwzY.js} +1 -1
  181. package/runtime/webapp/dist/assets/{cose-bilkent-JH36ORCC-BPzEzfJw.js → cose-bilkent-JH36ORCC-CDPnTlcy.js} +1 -1
  182. package/runtime/webapp/dist/assets/{cynefin-OW5HDTMX-BZgzPIdr.js → cynefin-OW5HDTMX-DDCxhkA5.js} +1 -1
  183. package/runtime/webapp/dist/assets/{cynefinDiagram-5FMLGOSQ-CyNjL-LN.js → cynefinDiagram-5FMLGOSQ-CIJ1KBPA.js} +1 -1
  184. package/runtime/webapp/dist/assets/{dagre-GXQ25YYZ-QqLmAYnp.js → dagre-GXQ25YYZ-CFX8O3IJ.js} +1 -1
  185. package/runtime/webapp/dist/assets/{diagram-S7CK7UJ4-DrIIbhV6.js → diagram-S7CK7UJ4-B8UX2IBH.js} +1 -1
  186. package/runtime/webapp/dist/assets/{diagram-UQ7AKVKN-B7JON90e.js → diagram-UQ7AKVKN-Ce34DNrv.js} +1 -1
  187. package/runtime/webapp/dist/assets/{diagram-VSXAHHWV-C1Fzjcgp.js → diagram-VSXAHHWV-CVL_erWD.js} +1 -1
  188. package/runtime/webapp/dist/assets/{diagram-VX7I27RA-HmkXh54q.js → diagram-VX7I27RA-DBFHI7Dk.js} +1 -1
  189. package/runtime/webapp/dist/assets/{diagram-Z3DM3KII-Ca5jnESS.js → diagram-Z3DM3KII-Bw_QcSQY.js} +1 -1
  190. package/runtime/webapp/dist/assets/{download-CKrjXoG9.js → download-D3xZPWnZ.js} +1 -1
  191. package/runtime/webapp/dist/assets/{ebnfDiagram-PWID7BFC-a3qnPIiF.js → ebnfDiagram-PWID7BFC-DRly04dj.js} +1 -1
  192. package/runtime/webapp/dist/assets/{erDiagram-RLTQ6QDP-EZKQ4NYt.js → erDiagram-RLTQ6QDP-DTm817hG.js} +1 -1
  193. package/runtime/webapp/dist/assets/{external-link-C9AwR_tM.js → external-link-Cwu5rEgp.js} +1 -1
  194. package/runtime/webapp/dist/assets/{file-types-BlRT2KnS.js → file-types-DKkhMnUV.js} +1 -1
  195. package/runtime/webapp/dist/assets/{flowDiagram-HODETNUW-C4U9dCin.js → flowDiagram-HODETNUW-tc8ygZtG.js} +1 -1
  196. package/runtime/webapp/dist/assets/{ganttDiagram-EL5Y4UJY-B5iyiF0_.js → ganttDiagram-EL5Y4UJY-CsQFf1IN.js} +1 -1
  197. package/runtime/webapp/dist/assets/{gitGraphDiagram-WWUBYQGX-D9CfK-tl.js → gitGraphDiagram-WWUBYQGX-DAIxbmPX.js} +1 -1
  198. package/runtime/webapp/dist/assets/{image-plus-DsCC5WAa.js → image-plus-nplydLA5.js} +1 -1
  199. package/runtime/webapp/dist/assets/{index-DrzCwyPu.css → index-B-d1Vs9E.css} +1 -1
  200. package/runtime/webapp/dist/assets/{index-DBNVLOBM.js → index-DKm9ESDq.js} +3 -3
  201. package/runtime/webapp/dist/assets/{infoDiagram-27XIBGKW-DBcCijd6.js → infoDiagram-27XIBGKW-CVcMW4UM.js} +1 -1
  202. package/runtime/webapp/dist/assets/{ishikawaDiagram-5VMMS53U-D_m8F4n9.js → ishikawaDiagram-5VMMS53U-zzlEtZ1l.js} +1 -1
  203. package/runtime/webapp/dist/assets/{journeyDiagram-3NMN7TZE-4oy2R7XW.js → journeyDiagram-3NMN7TZE-q7NuIMSl.js} +1 -1
  204. package/runtime/webapp/dist/assets/{kanban-definition-UXKFOSKX-O6jHSf0E.js → kanban-definition-UXKFOSKX-DLYFZlKO.js} +1 -1
  205. package/runtime/webapp/dist/assets/{layout-P82L_S-q.js → layout-PFWssIkE.js} +1 -1
  206. package/runtime/webapp/dist/assets/{linear-B-Cl5K73.js → linear-ZRVcojb1.js} +1 -1
  207. package/runtime/webapp/dist/assets/{loader-circle--s-WzZxC.js → loader-circle-DIW9tlEz.js} +1 -1
  208. package/runtime/webapp/dist/assets/{mermaid.core-BEmIap6p.js → mermaid.core-C8Dl0Nah.js} +5 -5
  209. package/runtime/webapp/dist/assets/{mindmap-definition-YA3MSWOX-Bnlqql-j.js → mindmap-definition-YA3MSWOX-BcbqtwVk.js} +1 -1
  210. package/runtime/webapp/dist/assets/{page-BtLq1udo.js → page-BG97oPXr.js} +4 -4
  211. package/runtime/webapp/dist/assets/{pegDiagram-XKGWAZYB-AbRjuoUM.js → pegDiagram-XKGWAZYB-BQN3zQuy.js} +1 -1
  212. package/runtime/webapp/dist/assets/{pieDiagram-E7YTZNPT-5-ms1WT0.js → pieDiagram-E7YTZNPT-pOgxh3os.js} +1 -1
  213. package/runtime/webapp/dist/assets/{quadrantDiagram-AXDQQJYC-BXr5BqtQ.js → quadrantDiagram-AXDQQJYC-BOg7ujzG.js} +1 -1
  214. package/runtime/webapp/dist/assets/{railroadDiagram-O6MQD6OU-DqBC-aod.js → railroadDiagram-O6MQD6OU-CWsN3juJ.js} +1 -1
  215. package/runtime/webapp/dist/assets/{requirementDiagram-BXWQKSXE-VOUcatZG.js → requirementDiagram-BXWQKSXE-B0yrO7Oy.js} +1 -1
  216. package/runtime/webapp/dist/assets/{rotate-ccw-CSiD4c4O.js → rotate-ccw-O4wnfQP7.js} +1 -1
  217. package/runtime/webapp/dist/assets/{rotate-cw-CclBpLSU.js → rotate-cw-CCJtlAtB.js} +1 -1
  218. package/runtime/webapp/dist/assets/{sankeyDiagram-P5KCCOFB-Bs23XmVr.js → sankeyDiagram-P5KCCOFB-5MS_e-3E.js} +1 -1
  219. package/runtime/webapp/dist/assets/{send-CfzPXlfx.js → send-Cdg4ZVlp.js} +1 -1
  220. package/runtime/webapp/dist/assets/{sequenceDiagram-WJ2MYXX4-DO-oDX3L.js → sequenceDiagram-WJ2MYXX4-C1w8qYSu.js} +1 -1
  221. package/runtime/webapp/dist/assets/{session-dashboard-D-0Cip5Y.js → session-dashboard-BigU92sz.js} +1 -1
  222. package/runtime/webapp/dist/assets/{shield-check-Dsex8w1k.js → shield-check-CrjI2wPR.js} +1 -1
  223. package/runtime/webapp/dist/assets/{sizeCapture-INFHLROL-hCQ98eA9.js → sizeCapture-INFHLROL-BonKTynC.js} +1 -1
  224. package/runtime/webapp/dist/assets/{stateDiagram-D77RDMKH-DLODIaTQ.js → stateDiagram-D77RDMKH-D3mn6ZK5.js} +1 -1
  225. package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-WEfEW-mH.js +1 -0
  226. package/runtime/webapp/dist/assets/{swimlanes-42K2YHIH-B3Qg_5tW.js → swimlanes-42K2YHIH-Bn9KWChU.js} +1 -1
  227. package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-D26_Nmko.js +8 -0
  228. package/runtime/webapp/dist/assets/{timeline-definition-24CTP7MA-BdFnRV4K.js → timeline-definition-24CTP7MA-BfuhI7EF.js} +1 -1
  229. package/runtime/webapp/dist/assets/{trash-2-CZp_yMDT.js → trash-2-BrfgMjfL.js} +1 -1
  230. package/runtime/webapp/dist/assets/{types-BWTyn3Bs.js → types-VnQ_cKrp.js} +1 -1
  231. package/runtime/webapp/dist/assets/{vennDiagram-4TSXK5OY-CRU6BY1c.js → vennDiagram-4TSXK5OY-CUFs5JyR.js} +1 -1
  232. package/runtime/webapp/dist/assets/{wardleyDiagram-VM6X3IG4-CXK3g3al.js → wardleyDiagram-VM6X3IG4-C27HHz1A.js} +1 -1
  233. package/runtime/webapp/dist/assets/{web-Den_EYDz.js → web-BOzkL-0Z.js} +1 -1
  234. package/runtime/webapp/dist/assets/{web-JmfGsfI_.js → web-CeCHmdwO.js} +1 -1
  235. package/runtime/webapp/dist/assets/{x-CLvev0bC.js → x-DP1nC4qG.js} +1 -1
  236. package/runtime/webapp/dist/assets/{xychartDiagram-S5SC5T6Z-CeISrKUm.js → xychartDiagram-S5SC5T6Z-CQwRrSTf.js} +1 -1
  237. package/runtime/webapp/dist/assets/{zoom-out-CSyjX26v.js → zoom-out-Dg7YyzcP.js} +1 -1
  238. package/runtime/webapp/dist/index.html +2 -2
  239. package/runtime/.next/static/chunks/app/web/layout-88328c61ec0589af.js +0 -1
  240. package/runtime/.next/static/chunks/app/web/page-84b5f00b4c9cd4ce.js +0 -1
  241. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-0a66n3e7.mjs +0 -16
  242. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-0bmnpbz2.mjs +0 -45
  243. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-ds2jqcef.mjs +0 -19
  244. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-gbbw9cgm.mjs +0 -17
  245. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-msnqqcc2.mjs +0 -42
  246. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-wadgcjfh.mjs +0 -18
  247. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-x20yarwf.mjs +0 -17
  248. package/runtime/webapp/dist/assets/App-DGtdMfGk.js +0 -179
  249. package/runtime/webapp/dist/assets/channel-C_3UNQvo.js +0 -1
  250. package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-j9nJ5DUm.js +0 -1
  251. package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-j9nJ5DUm.js +0 -1
  252. package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-CTpD-7Re.js +0 -1
  253. package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-v5rUeqtL.js +0 -8
  254. /package/runtime/.next/static/{5l3_g1bKM6rXvoGoMh_OC → xuZ1UJWVNJ-rxb5YgETmd}/_buildManifest.js +0 -0
  255. /package/runtime/.next/static/{5l3_g1bKM6rXvoGoMh_OC → xuZ1UJWVNJ-rxb5YgETmd}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./page-BtLq1udo.js","./RunningSessionsIcon-CKKjZfu_.js","./x-CLvev0bC.js","./chevron-down-fUU2ZKzR.js","./artifact-links-C7zYRJaC.js","./trash-2-CZp_yMDT.js","./external-link-C9AwR_tM.js","./clipboard-BvwmdR4z.js","./CollaborationTabBridge-Dxq4G1Uk.js","./SessionDashboardBridge-DG1fQUEQ.js","./RemoteDesktopTabBridge-Cp9mLtcY.js","./CollaborationPage-Cg22tJGB.js","./composer-file-routing-CKLnrVkP.js","./shield-check-Dsex8w1k.js","./collaboration-DwgXZbHy.js","./collaboration-DkVTQ-wS.css","./types-BWTyn3Bs.js","./loader-circle--s-WzZxC.js","./image-plus-DsCC5WAa.js","./CollaborationDashboard-ChUaJ5xA.js","./CollaborationCreateDialog-DPs4doOz.js","./file-types-BlRT2KnS.js","./arrow-right-CUDfCOna.js","./CollaborationDashboard-CCXC6JuQ.css","./SessionDashboard-CCpxslxg.js","./session-dashboard-D-0Cip5Y.js","./session-dashboard-D3n4eFut.css","./SessionDashboard-CAYVDT8Z.css","./RemoteDesktopPage-DD9aNe8m.js","./BrowserLivePanel-Cl5kMDJF.js","./rotate-ccw-CSiD4c4O.js","./zoom-out-CSyjX26v.js","./App-DGtdMfGk.js","./download-CKrjXoG9.js","./rotate-cw-CclBpLSU.js","./App-CrZstnCH.css"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./page-BG97oPXr.js","./RunningSessionsIcon-B8Cr2-hp.js","./x-DP1nC4qG.js","./chevron-down-DhZV290h.js","./artifact-links-73OZyi5W.js","./trash-2-BrfgMjfL.js","./external-link-Cwu5rEgp.js","./clipboard-BvwmdR4z.js","./CollaborationTabBridge-Dxq4G1Uk.js","./SessionDashboardBridge-Bx4EXtos.js","./RemoteDesktopTabBridge-Cp9mLtcY.js","./CollaborationPage-Br5fhNce.js","./composer-file-routing-D9orqwzY.js","./shield-check-CrjI2wPR.js","./collaboration-CQhzjwS_.js","./collaboration-DkVTQ-wS.css","./types-VnQ_cKrp.js","./loader-circle-DIW9tlEz.js","./image-plus-nplydLA5.js","./CollaborationDashboard-mHU8iJYg.js","./CollaborationCreateDialog-BmgYdwe7.js","./file-types-DKkhMnUV.js","./arrow-right-Cqqb1zqH.js","./CollaborationDashboard-CCXC6JuQ.css","./SessionDashboard-CFXXTm_4.js","./session-dashboard-BigU92sz.js","./session-dashboard-D3n4eFut.css","./SessionDashboard-CAYVDT8Z.css","./RemoteDesktopPage-w8aL061W.js","./BrowserLivePanel-CU_X6OU2.js","./rotate-ccw-O4wnfQP7.js","./zoom-out-Dg7YyzcP.js","./App-zihaYk1L.js","./download-D3xZPWnZ.js","./rotate-cw-CCJtlAtB.js","./App-CrZstnCH.css"])))=>i.map(i=>d[i]);
2
2
  (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const f of c)if(f.type==="childList")for(const g of f.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&o(g)}).observe(document,{childList:!0,subtree:!0});function n(c){const f={};return c.integrity&&(f.integrity=c.integrity),c.referrerPolicy&&(f.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?f.credentials="include":c.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function o(c){if(c.ep)return;c.ep=!0;const f=n(c);fetch(c.href,f)}})();const _3="modulepreload",O3=function(e,t){return new URL(e,t).href},ch={},Fn=function(t,n,o){let c=Promise.resolve();if(n&&n.length>0){const g=document.getElementsByTagName("link"),x=document.querySelector("meta[property=csp-nonce]"),w=(x==null?void 0:x.nonce)||(x==null?void 0:x.getAttribute("nonce"));c=Promise.allSettled(n.map(m=>{if(m=O3(m,o),m in ch)return;ch[m]=!0;const b=m.endsWith(".css"),y=b?'[rel="stylesheet"]':"";if(o)for(let T=g.length-1;T>=0;T--){const k=g[T];if(k.href===m&&(!b||k.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${y}`))return;const A=document.createElement("link");if(A.rel=b?"stylesheet":_3,b||(A.as="script"),A.crossOrigin="",A.href=m,w&&A.setAttribute("nonce",w),document.head.appendChild(A),b)return new Promise((T,k)=>{A.addEventListener("load",T),A.addEventListener("error",()=>k(Error(`Unable to preload CSS for ${m}`)))})}))}function f(g){const x=new Event("vite:preloadError",{cancelable:!0});if(x.payload=g,window.dispatchEvent(x),!x.defaultPrevented)throw g}return c.then(g=>{for(const x of g||[])x.status==="rejected"&&f(x.reason);return t().catch(f)})};var gn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function b2(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var A2={exports:{}},mc={},S2={exports:{}},be={};/**
3
3
  * @license React
4
4
  * react.production.min.js
@@ -477,7 +477,7 @@ Error generating stack: `+f.message+`
477
477
  `),r.append(`>>
478
478
  `),r.toString()}setMode(r){this.mode=r}setECLevel(r){this.ecLevel=r}setVersion(r){this.version=r}setMaskPattern(r){this.maskPattern=r}setMatrix(r){this.matrix=r}static isValidMaskPattern(r){return r>=0&&r<fi.NUM_MASK_PATTERNS}}fi.NUM_MASK_PATTERNS=8;class Fe extends m{}Fe.kind="WriterException";class de{constructor(){}static clearMatrix(r){r.clear(255)}static buildMatrix(r,i,s,a,l){de.clearMatrix(l),de.embedBasicPatterns(s,l),de.embedTypeInfo(i,a,l),de.maybeEmbedVersionInfo(s,l),de.embedDataBits(r,a,l)}static embedBasicPatterns(r,i){de.embedPositionDetectionPatternsAndSeparators(i),de.embedDarkDotAtLeftBottomCorner(i),de.maybeEmbedPositionAdjustmentPatterns(r,i),de.embedTimingPatterns(i)}static embedTypeInfo(r,i,s){const a=new B;de.makeTypeInfoBits(r,i,a);for(let l=0,u=a.getSize();l<u;++l){const d=a.get(a.getSize()-1-l),h=de.TYPE_INFO_COORDINATES[l],p=h[0],v=h[1];if(s.setBoolean(p,v,d),l<8){const C=s.getWidth()-l-1;s.setBoolean(C,8,d)}else{const S=s.getHeight()-7+(l-8);s.setBoolean(8,S,d)}}}static maybeEmbedVersionInfo(r,i){if(r.getVersionNumber()<7)return;const s=new B;de.makeVersionInfoBits(r,s);let a=6*3-1;for(let l=0;l<6;++l)for(let u=0;u<3;++u){const d=s.get(a);a--,i.setBoolean(l,i.getHeight()-11+u,d),i.setBoolean(i.getHeight()-11+u,l,d)}}static embedDataBits(r,i,s){let a=0,l=-1,u=s.getWidth()-1,d=s.getHeight()-1;for(;u>0;){for(u===6&&(u-=1);d>=0&&d<s.getHeight();){for(let h=0;h<2;++h){const p=u-h;if(!de.isEmpty(s.get(p,d)))continue;let v;a<r.getSize()?(v=r.get(a),++a):v=!1,i!==255&&st.getDataMaskBit(i,p,d)&&(v=!v),s.setBoolean(p,d,v)}d+=l}l=-l,d+=l,u-=2}if(a!==r.getSize())throw new Fe("Not all bits consumed: "+a+"/"+r.getSize())}static findMSBSet(r){return 32-O.numberOfLeadingZeros(r)}static calculateBCHCode(r,i){if(i===0)throw new y("0 polynomial");const s=de.findMSBSet(i);for(r<<=s-1;de.findMSBSet(r)>=s;)r^=i<<de.findMSBSet(r)-s;return r}static makeTypeInfoBits(r,i,s){if(!fi.isValidMaskPattern(i))throw new Fe("Invalid mask pattern");const a=r.getBits()<<3|i;s.appendBits(a,5);const l=de.calculateBCHCode(a,de.TYPE_INFO_POLY);s.appendBits(l,10);const u=new B;if(u.appendBits(de.TYPE_INFO_MASK_PATTERN,15),s.xor(u),s.getSize()!==15)throw new Fe("should not happen but we got: "+s.getSize())}static makeVersionInfoBits(r,i){i.appendBits(r.getVersionNumber(),6);const s=de.calculateBCHCode(r.getVersionNumber(),de.VERSION_INFO_POLY);if(i.appendBits(s,12),i.getSize()!==18)throw new Fe("should not happen but we got: "+i.getSize())}static isEmpty(r){return r===255}static embedTimingPatterns(r){for(let i=8;i<r.getWidth()-8;++i){const s=(i+1)%2;de.isEmpty(r.get(i,6))&&r.setNumber(i,6,s),de.isEmpty(r.get(6,i))&&r.setNumber(6,i,s)}}static embedDarkDotAtLeftBottomCorner(r){if(r.get(8,r.getHeight()-8)===0)throw new Fe;r.setNumber(8,r.getHeight()-8,1)}static embedHorizontalSeparationPattern(r,i,s){for(let a=0;a<8;++a){if(!de.isEmpty(s.get(r+a,i)))throw new Fe;s.setNumber(r+a,i,0)}}static embedVerticalSeparationPattern(r,i,s){for(let a=0;a<7;++a){if(!de.isEmpty(s.get(r,i+a)))throw new Fe;s.setNumber(r,i+a,0)}}static embedPositionAdjustmentPattern(r,i,s){for(let a=0;a<5;++a){const l=de.POSITION_ADJUSTMENT_PATTERN[a];for(let u=0;u<5;++u)s.setNumber(r+u,i+a,l[u])}}static embedPositionDetectionPattern(r,i,s){for(let a=0;a<7;++a){const l=de.POSITION_DETECTION_PATTERN[a];for(let u=0;u<7;++u)s.setNumber(r+u,i+a,l[u])}}static embedPositionDetectionPatternsAndSeparators(r){const i=de.POSITION_DETECTION_PATTERN[0].length;de.embedPositionDetectionPattern(0,0,r),de.embedPositionDetectionPattern(r.getWidth()-i,0,r),de.embedPositionDetectionPattern(0,r.getWidth()-i,r);const s=8;de.embedHorizontalSeparationPattern(0,s-1,r),de.embedHorizontalSeparationPattern(r.getWidth()-s,s-1,r),de.embedHorizontalSeparationPattern(0,r.getWidth()-s,r);const a=7;de.embedVerticalSeparationPattern(a,0,r),de.embedVerticalSeparationPattern(r.getHeight()-a-1,0,r),de.embedVerticalSeparationPattern(a,r.getHeight()-a,r)}static maybeEmbedPositionAdjustmentPatterns(r,i){if(r.getVersionNumber()<2)return;const s=r.getVersionNumber()-1,a=de.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[s];for(let l=0,u=a.length;l!==u;l++){const d=a[l];if(d>=0)for(let h=0;h!==u;h++){const p=a[h];p>=0&&de.isEmpty(i.get(p,d))&&de.embedPositionAdjustmentPattern(p-2,d-2,i)}}}}de.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),de.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),de.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),de.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),de.VERSION_INFO_POLY=7973,de.TYPE_INFO_POLY=1335,de.TYPE_INFO_MASK_PATTERN=21522;class v3{constructor(r,i){this.dataBytes=r,this.errorCorrectionBytes=i}getDataBytes(){return this.dataBytes}getErrorCorrectionBytes(){return this.errorCorrectionBytes}}class $e{constructor(){}static calculateMaskPenalty(r){return st.applyMaskPenaltyRule1(r)+st.applyMaskPenaltyRule2(r)+st.applyMaskPenaltyRule3(r)+st.applyMaskPenaltyRule4(r)}static encode(r,i,s=null){let a=$e.DEFAULT_BYTE_MODE_ENCODING;const l=s!==null&&s.get(wt.CHARACTER_SET)!==void 0;l&&(a=s.get(wt.CHARACTER_SET).toString());const u=this.chooseMode(r,a),d=new B;if(u===fe.BYTE&&(l||$e.DEFAULT_BYTE_MODE_ENCODING!==a)){const J=$.getCharacterSetECIByName(a);J!==void 0&&this.appendECI(J,d)}this.appendModeInfo(u,d);const h=new B;this.appendBytes(r,u,h,a);let p;if(s!==null&&s.get(wt.QR_VERSION)!==void 0){const J=Number.parseInt(s.get(wt.QR_VERSION).toString(),10);p=ce.getVersionForNumber(J);const Z=this.calculateBitsNeeded(u,d,h,p);if(!this.willFit(Z,p,i))throw new Fe("Data too big for requested version")}else p=this.recommendVersion(i,u,d,h);const v=new B;v.appendBitArray(d);const C=u===fe.BYTE?h.getSizeInBytes():r.length;this.appendLengthInfo(C,p,u,v),v.appendBitArray(h);const S=p.getECBlocksForLevel(i),_=p.getTotalCodewords()-S.getTotalECCodewords();this.terminateBits(_,v);const M=this.interleaveWithECBytes(v,p.getTotalCodewords(),_,S.getNumBlocks()),P=new fi;P.setECLevel(i),P.setMode(u),P.setVersion(p);const W=p.getDimensionForVersion(),H=new Aa(W,W),q=this.chooseMaskPattern(M,i,p,H);return P.setMaskPattern(q),de.buildMatrix(M,i,p,q,H),P.setMatrix(H),P}static recommendVersion(r,i,s,a){const l=this.calculateBitsNeeded(i,s,a,ce.getVersionForNumber(1)),u=this.chooseVersion(l,r),d=this.calculateBitsNeeded(i,s,a,u);return this.chooseVersion(d,r)}static calculateBitsNeeded(r,i,s,a){return i.getSize()+r.getCharacterCountBits(a)+s.getSize()}static getAlphanumericCode(r){return r<$e.ALPHANUMERIC_TABLE.length?$e.ALPHANUMERIC_TABLE[r]:-1}static chooseMode(r,i=null){if($.SJIS.getName()===i&&this.isOnlyDoubleByteKanji(r))return fe.KANJI;let s=!1,a=!1;for(let l=0,u=r.length;l<u;++l){const d=r.charAt(l);if($e.isDigit(d))s=!0;else if(this.getAlphanumericCode(d.charCodeAt(0))!==-1)a=!0;else return fe.BYTE}return a?fe.ALPHANUMERIC:s?fe.NUMERIC:fe.BYTE}static isOnlyDoubleByteKanji(r){let i;try{i=ve.encode(r,$.SJIS)}catch{return!1}const s=i.length;if(s%2!==0)return!1;for(let a=0;a<s;a+=2){const l=i[a]&255;if((l<129||l>159)&&(l<224||l>235))return!1}return!0}static chooseMaskPattern(r,i,s,a){let l=Number.MAX_SAFE_INTEGER,u=-1;for(let d=0;d<fi.NUM_MASK_PATTERNS;d++){de.buildMatrix(r,i,s,d,a);let h=this.calculateMaskPenalty(a);h<l&&(l=h,u=d)}return u}static chooseVersion(r,i){for(let s=1;s<=40;s++){const a=ce.getVersionForNumber(s);if($e.willFit(r,a,i))return a}throw new Fe("Data too big")}static willFit(r,i,s){const a=i.getTotalCodewords(),u=i.getECBlocksForLevel(s).getTotalECCodewords(),d=a-u,h=(r+7)/8;return d>=h}static terminateBits(r,i){const s=r*8;if(i.getSize()>s)throw new Fe("data bits cannot fit in the QR Code"+i.getSize()+" > "+s);for(let u=0;u<4&&i.getSize()<s;++u)i.appendBit(!1);const a=i.getSize()&7;if(a>0)for(let u=a;u<8;u++)i.appendBit(!1);const l=r-i.getSizeInBytes();for(let u=0;u<l;++u)i.appendBits(u&1?17:236,8);if(i.getSize()!==s)throw new Fe("Bits size does not equal capacity")}static getNumDataBytesAndNumECBytesForBlockID(r,i,s,a,l,u){if(a>=s)throw new Fe("Block ID too large");const d=r%s,h=s-d,p=Math.floor(r/s),v=p+1,C=Math.floor(i/s),S=C+1,_=p-C,M=v-S;if(_!==M)throw new Fe("EC bytes mismatch");if(s!==h+d)throw new Fe("RS blocks mismatch");if(r!==(C+_)*h+(S+M)*d)throw new Fe("Total bytes mismatch");a<h?(l[0]=C,u[0]=_):(l[0]=S,u[0]=M)}static interleaveWithECBytes(r,i,s,a){if(r.getSizeInBytes()!==s)throw new Fe("Number of bits and data bytes does not match");let l=0,u=0,d=0;const h=new Array;for(let v=0;v<a;++v){const C=new Int32Array(1),S=new Int32Array(1);$e.getNumDataBytesAndNumECBytesForBlockID(i,s,a,v,C,S);const _=C[0],M=new Uint8Array(_);r.toBytes(8*l,M,0,_);const P=$e.generateECBytes(M,S[0]);h.push(new v3(M,P)),u=Math.max(u,_),d=Math.max(d,P.length),l+=C[0]}if(s!==l)throw new Fe("Data bytes does not match offset");const p=new B;for(let v=0;v<u;++v)for(const C of h){const S=C.getDataBytes();v<S.length&&p.appendBits(S[v],8)}for(let v=0;v<d;++v)for(const C of h){const S=C.getErrorCorrectionBytes();v<S.length&&p.appendBits(S[v],8)}if(i!==p.getSizeInBytes())throw new Fe("Interleaving error: "+i+" and "+p.getSizeInBytes()+" differ.");return p}static generateECBytes(r,i){const s=r.length,a=new Int32Array(s+i);for(let u=0;u<s;u++)a[u]=r[u]&255;new hu(Ne.QR_CODE_FIELD_256).encode(a,i);const l=new Uint8Array(i);for(let u=0;u<i;u++)l[u]=a[s+u];return l}static appendModeInfo(r,i){i.appendBits(r.getBits(),4)}static appendLengthInfo(r,i,s,a){const l=s.getCharacterCountBits(i);if(r>=1<<l)throw new Fe(r+" is bigger than "+((1<<l)-1));a.appendBits(r,l)}static appendBytes(r,i,s,a){switch(i){case fe.NUMERIC:$e.appendNumericBytes(r,s);break;case fe.ALPHANUMERIC:$e.appendAlphanumericBytes(r,s);break;case fe.BYTE:$e.append8BitBytes(r,s,a);break;case fe.KANJI:$e.appendKanjiBytes(r,s);break;default:throw new Fe("Invalid mode: "+i)}}static getDigit(r){return r.charCodeAt(0)-48}static isDigit(r){const i=$e.getDigit(r);return i>=0&&i<=9}static appendNumericBytes(r,i){const s=r.length;let a=0;for(;a<s;){const l=$e.getDigit(r.charAt(a));if(a+2<s){const u=$e.getDigit(r.charAt(a+1)),d=$e.getDigit(r.charAt(a+2));i.appendBits(l*100+u*10+d,10),a+=3}else if(a+1<s){const u=$e.getDigit(r.charAt(a+1));i.appendBits(l*10+u,7),a+=2}else i.appendBits(l,4),a++}}static appendAlphanumericBytes(r,i){const s=r.length;let a=0;for(;a<s;){const l=$e.getAlphanumericCode(r.charCodeAt(a));if(l===-1)throw new Fe;if(a+1<s){const u=$e.getAlphanumericCode(r.charCodeAt(a+1));if(u===-1)throw new Fe;i.appendBits(l*45+u,11),a+=2}else i.appendBits(l,6),a++}}static append8BitBytes(r,i,s){let a;try{a=ve.encode(r,s)}catch(l){throw new Fe(l)}for(let l=0,u=a.length;l!==u;l++){const d=a[l];i.appendBits(d,8)}}static appendKanjiBytes(r,i){let s;try{s=ve.encode(r,$.SJIS)}catch(l){throw new Fe(l)}const a=s.length;for(let l=0;l<a;l+=2){const u=s[l]&255,d=s[l+1]&255,h=u<<8&4294967295|d;let p=-1;if(h>=33088&&h<=40956?p=h-33088:h>=57408&&h<=60351&&(p=h-49472),p===-1)throw new Fe("Invalid byte sequence");const v=(p>>8)*192+(p&255);i.appendBits(v,13)}}static appendECI(r,i){i.appendBits(fe.ECI.getBits(),4),i.appendBits(r.getValue(),8)}}$e.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),$e.DEFAULT_BYTE_MODE_ENCODING=$.UTF8.getName();class di{write(r,i,s,a=null){if(r.length===0)throw new y("Found empty contents");if(i<0||s<0)throw new y("Requested dimensions are too small: "+i+"x"+s);let l=We.L,u=di.QUIET_ZONE_SIZE;a!==null&&(a.get(wt.ERROR_CORRECTION)!==void 0&&(l=We.fromString(a.get(wt.ERROR_CORRECTION).toString())),a.get(wt.MARGIN)!==void 0&&(u=Number.parseInt(a.get(wt.MARGIN).toString(),10)));const d=$e.encode(r,l,a);return this.renderResult(d,i,s,u)}writeToDom(r,i,s,a,l=null){typeof r=="string"&&(r=document.querySelector(r));const u=this.write(i,s,a,l);r&&r.appendChild(u)}renderResult(r,i,s,a){const l=r.getMatrix();if(l===null)throw new Gr;const u=l.getWidth(),d=l.getHeight(),h=u+a*2,p=d+a*2,v=Math.max(i,h),C=Math.max(s,p),S=Math.min(Math.floor(v/h),Math.floor(C/p)),_=Math.floor((v-u*S)/2),M=Math.floor((C-d*S)/2),P=this.createSVGElement(v,C);for(let W=0,H=M;W<d;W++,H+=S)for(let q=0,J=_;q<u;q++,J+=S)if(l.get(q,W)===1){const Z=this.createSvgRectElement(J,H,S,S);P.appendChild(Z)}return P}createSVGElement(r,i){const s=document.createElementNS(di.SVG_NS,"svg");return s.setAttributeNS(null,"height",r.toString()),s.setAttributeNS(null,"width",i.toString()),s}createSvgRectElement(r,i,s,a){const l=document.createElementNS(di.SVG_NS,"rect");return l.setAttributeNS(null,"x",r.toString()),l.setAttributeNS(null,"y",i.toString()),l.setAttributeNS(null,"height",s.toString()),l.setAttributeNS(null,"width",a.toString()),l.setAttributeNS(null,"fill","#000000"),l}}di.QUIET_ZONE_SIZE=4,di.SVG_NS="http://www.w3.org/2000/svg";class zi{encode(r,i,s,a,l){if(r.length===0)throw new y("Found empty contents");if(i!==le.QR_CODE)throw new y("Can only encode QR_CODE, but got "+i);if(s<0||a<0)throw new y(`Requested dimensions are too small: ${s}x${a}`);let u=We.L,d=zi.QUIET_ZONE_SIZE;l!==null&&(l.get(wt.ERROR_CORRECTION)!==void 0&&(u=We.fromString(l.get(wt.ERROR_CORRECTION).toString())),l.get(wt.MARGIN)!==void 0&&(d=Number.parseInt(l.get(wt.MARGIN).toString(),10)));const h=$e.encode(r,u,l);return zi.renderResult(h,s,a,d)}static renderResult(r,i,s,a){const l=r.getMatrix();if(l===null)throw new Gr;const u=l.getWidth(),d=l.getHeight(),h=u+a*2,p=d+a*2,v=Math.max(i,h),C=Math.max(s,p),S=Math.min(Math.floor(v/h),Math.floor(C/p)),_=Math.floor((v-u*S)/2),M=Math.floor((C-d*S)/2),P=new Te(v,C);for(let W=0,H=M;W<d;W++,H+=S)for(let q=0,J=_;q<u;q++,J+=S)l.get(q,W)===1&&P.setRegion(J,H,S,S);return P}}zi.QUIET_ZONE_SIZE=4;class y3{encode(r,i,s,a,l){let u;switch(i){case le.QR_CODE:u=new zi;break;default:throw new y("No encoder available for format "+i)}return u.encode(r,i,s,a,l)}}class Zr extends te{constructor(r,i,s,a,l,u,d,h){if(super(u,d),this.yuvData=r,this.dataWidth=i,this.dataHeight=s,this.left=a,this.top=l,a+u>i||l+d>s)throw new y("Crop rectangle does not fit within image data.");h&&this.reverseHorizontal(u,d)}getRow(r,i){if(r<0||r>=this.getHeight())throw new y("Requested row is outside the image: "+r);const s=this.getWidth();(i==null||i.length<s)&&(i=new Uint8ClampedArray(s));const a=(r+this.top)*this.dataWidth+this.left;return D.arraycopy(this.yuvData,a,i,0,s),i}getMatrix(){const r=this.getWidth(),i=this.getHeight();if(r===this.dataWidth&&i===this.dataHeight)return this.yuvData;const s=r*i,a=new Uint8ClampedArray(s);let l=this.top*this.dataWidth+this.left;if(r===this.dataWidth)return D.arraycopy(this.yuvData,l,a,0,s),a;for(let u=0;u<i;u++){const d=u*r;D.arraycopy(this.yuvData,l,a,d,r),l+=this.dataWidth}return a}isCropSupported(){return!0}crop(r,i,s,a){return new Zr(this.yuvData,this.dataWidth,this.dataHeight,this.left+r,this.top+i,s,a,!1)}renderThumbnail(){const r=this.getWidth()/Zr.THUMBNAIL_SCALE_FACTOR,i=this.getHeight()/Zr.THUMBNAIL_SCALE_FACTOR,s=new Int32Array(r*i),a=this.yuvData;let l=this.top*this.dataWidth+this.left;for(let u=0;u<i;u++){const d=u*r;for(let h=0;h<r;h++){const p=a[l+h*Zr.THUMBNAIL_SCALE_FACTOR]&255;s[d+h]=4278190080|p*65793}l+=this.dataWidth*Zr.THUMBNAIL_SCALE_FACTOR}return s}getThumbnailWidth(){return this.getWidth()/Zr.THUMBNAIL_SCALE_FACTOR}getThumbnailHeight(){return this.getHeight()/Zr.THUMBNAIL_SCALE_FACTOR}reverseHorizontal(r,i){const s=this.yuvData;for(let a=0,l=this.top*this.dataWidth+this.left;a<i;a++,l+=this.dataWidth){const u=l+r/2;for(let d=l,h=l+r-1;d<u;d++,h--){const p=s[d];s[d]=s[h],s[h]=p}}}invert(){return new he(this)}}Zr.THUMBNAIL_SCALE_FACTOR=2;class gu extends te{constructor(r,i,s,a,l,u,d){if(super(i,s),this.dataWidth=a,this.dataHeight=l,this.left=u,this.top=d,r.BYTES_PER_ELEMENT===4){const h=i*s,p=new Uint8ClampedArray(h);for(let v=0;v<h;v++){const C=r[v],S=C>>16&255,_=C>>7&510,M=C&255;p[v]=(S+_+M)/4&255}this.luminances=p}else this.luminances=r;if(a===void 0&&(this.dataWidth=i),l===void 0&&(this.dataHeight=s),u===void 0&&(this.left=0),d===void 0&&(this.top=0),this.left+i>this.dataWidth||this.top+s>this.dataHeight)throw new y("Crop rectangle does not fit within image data.")}getRow(r,i){if(r<0||r>=this.getHeight())throw new y("Requested row is outside the image: "+r);const s=this.getWidth();(i==null||i.length<s)&&(i=new Uint8ClampedArray(s));const a=(r+this.top)*this.dataWidth+this.left;return D.arraycopy(this.luminances,a,i,0,s),i}getMatrix(){const r=this.getWidth(),i=this.getHeight();if(r===this.dataWidth&&i===this.dataHeight)return this.luminances;const s=r*i,a=new Uint8ClampedArray(s);let l=this.top*this.dataWidth+this.left;if(r===this.dataWidth)return D.arraycopy(this.luminances,l,a,0,s),a;for(let u=0;u<i;u++){const d=u*r;D.arraycopy(this.luminances,l,a,d,r),l+=this.dataWidth}return a}isCropSupported(){return!0}crop(r,i,s,a){return new gu(this.luminances,s,a,this.dataWidth,this.dataHeight,this.left+r,this.top+i)}invert(){return new he(this)}}class ih extends ${static forName(r){return this.getCharacterSetECIByName(r)}}class pu{}pu.ISO_8859_1=$.ISO8859_1;class sh{isCompact(){return this.compact}setCompact(r){this.compact=r}getSize(){return this.size}setSize(r){this.size=r}getLayers(){return this.layers}setLayers(r){this.layers=r}getCodeWords(){return this.codeWords}setCodeWords(r){this.codeWords=r}getMatrix(){return this.matrix}setMatrix(r){this.matrix=r}}class oh{static singletonList(r){return[r]}static min(r,i){return r.sort(i)[0]}}class E3{constructor(r){this.previous=r}getPrevious(){return this.previous}}class $i extends E3{constructor(r,i,s){super(r),this.value=i,this.bitCount=s}appendTo(r,i){r.appendBits(this.value,this.bitCount)}add(r,i){return new $i(this,r,i)}addBinaryShift(r,i){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new $i(this,r,i)}toString(){let r=this.value&(1<<this.bitCount)-1;return r|=1<<this.bitCount,"<"+O.toBinaryString(r|1<<this.bitCount).substring(1)+">"}}class mu extends $i{constructor(r,i,s){super(r,0,0),this.binaryShiftStart=i,this.binaryShiftByteCount=s}appendTo(r,i){for(let s=0;s<this.binaryShiftByteCount;s++)(s===0||s===31&&this.binaryShiftByteCount<=62)&&(r.appendBits(31,5),this.binaryShiftByteCount>62?r.appendBits(this.binaryShiftByteCount-31,16):s===0?r.appendBits(Math.min(this.binaryShiftByteCount,31),5):r.appendBits(this.binaryShiftByteCount-31,5)),r.appendBits(i[this.binaryShiftStart+s],8)}addBinaryShift(r,i){return new mu(this,r,i)}toString(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}function C3(E,r,i){return new mu(E,r,i)}function Xs(E,r,i){return new $i(E,r,i)}const b3=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],Mn=0,Sa=1,Sr=2,ah=3,Qr=4,A3=new $i(null,0,0),xu=[Int32Array.from([0,(5<<16)+28,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(9<<16)+480+14,0,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(4<<16)+14,(9<<16)+448+28,0,(9<<16)+448+29,932798]),Int32Array.from([(5<<16)+29,(5<<16)+28,656318,0,(5<<16)+30]),Int32Array.from([(5<<16)+31,656380,656382,656381,0])];function S3(E){for(let r of E)I.fill(r,-1);return E[Mn][Qr]=0,E[Sa][Qr]=0,E[Sa][Mn]=28,E[ah][Qr]=0,E[Sr][Qr]=0,E[Sr][Mn]=15,E}const lh=S3(I.createInt32Array(6,6));class qr{constructor(r,i,s,a){this.token=r,this.mode=i,this.binaryShiftByteCount=s,this.bitCount=a}getMode(){return this.mode}getToken(){return this.token}getBinaryShiftByteCount(){return this.binaryShiftByteCount}getBitCount(){return this.bitCount}latchAndAppend(r,i){let s=this.bitCount,a=this.token;if(r!==this.mode){let u=xu[this.mode][r];a=Xs(a,u&65535,u>>16),s+=u>>16}let l=r===Sr?4:5;return a=Xs(a,i,l),new qr(a,r,0,s+l)}shiftAndAppend(r,i){let s=this.token,a=this.mode===Sr?4:5;return s=Xs(s,lh[this.mode][r],a),s=Xs(s,i,5),new qr(s,this.mode,0,this.bitCount+a+5)}addBinaryShiftChar(r){let i=this.token,s=this.mode,a=this.bitCount;if(this.mode===Qr||this.mode===Sr){let d=xu[s][Mn];i=Xs(i,d&65535,d>>16),a+=d>>16,s=Mn}let l=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,u=new qr(i,s,this.binaryShiftByteCount+1,a+l);return u.binaryShiftByteCount===2078&&(u=u.endBinaryShift(r+1)),u}endBinaryShift(r){if(this.binaryShiftByteCount===0)return this;let i=this.token;return i=C3(i,r-this.binaryShiftByteCount,this.binaryShiftByteCount),new qr(i,this.mode,0,this.bitCount)}isBetterThanOrEqualTo(r){let i=this.bitCount+(xu[this.mode][r.mode]>>16);return this.binaryShiftByteCount<r.binaryShiftByteCount?i+=qr.calculateBinaryShiftCost(r)-qr.calculateBinaryShiftCost(this):this.binaryShiftByteCount>r.binaryShiftByteCount&&r.binaryShiftByteCount>0&&(i+=10),i<=r.bitCount}toBitArray(r){let i=[];for(let a=this.endBinaryShift(r.length).token;a!==null;a=a.getPrevious())i.unshift(a);let s=new B;for(const a of i)a.appendTo(s,r);return s}toString(){return ie.format("%s bits=%d bytes=%d",b3[this.mode],this.bitCount,this.binaryShiftByteCount)}static calculateBinaryShiftCost(r){return r.binaryShiftByteCount>62?21:r.binaryShiftByteCount>31?20:r.binaryShiftByteCount>0?10:0}}qr.INITIAL_STATE=new qr(A3,Mn,0,0);function I3(E){const r=ie.getCharCode(" "),i=ie.getCharCode("."),s=ie.getCharCode(",");E[Mn][r]=1;const a=ie.getCharCode("Z"),l=ie.getCharCode("A");for(let S=l;S<=a;S++)E[Mn][S]=S-l+2;E[Sa][r]=1;const u=ie.getCharCode("z"),d=ie.getCharCode("a");for(let S=d;S<=u;S++)E[Sa][S]=S-d+2;E[Sr][r]=1;const h=ie.getCharCode("9"),p=ie.getCharCode("0");for(let S=p;S<=h;S++)E[Sr][S]=S-p+2;E[Sr][s]=12,E[Sr][i]=13;const v=["\0"," ","","","","","","","\x07","\b"," ",`
479
479
  `,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~",""];for(let S=0;S<v.length;S++)E[ah][ie.getCharCode(v[S])]=S;const C=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(let S=0;S<C.length;S++)ie.getCharCode(C[S])>0&&(E[Qr][ie.getCharCode(C[S])]=S);return E}const wu=I3(I.createInt32Array(5,256));class Ys{constructor(r){this.text=r}encode(){const r=ie.getCharCode(" "),i=ie.getCharCode(`
480
- `);let s=oh.singletonList(qr.INITIAL_STATE);for(let l=0;l<this.text.length;l++){let u,d=l+1<this.text.length?this.text[l+1]:0;switch(this.text[l]){case ie.getCharCode("\r"):u=d===i?2:0;break;case ie.getCharCode("."):u=d===r?3:0;break;case ie.getCharCode(","):u=d===r?4:0;break;case ie.getCharCode(":"):u=d===r?5:0;break;default:u=0}u>0?(s=Ys.updateStateListForPair(s,l,u),l++):s=this.updateStateListForChar(s,l)}return oh.min(s,(l,u)=>l.getBitCount()-u.getBitCount()).toBitArray(this.text)}updateStateListForChar(r,i){const s=[];for(let a of r)this.updateStateForChar(a,i,s);return Ys.simplifyStates(s)}updateStateForChar(r,i,s){let a=this.text[i]&255,l=wu[r.getMode()][a]>0,u=null;for(let d=0;d<=Qr;d++){let h=wu[d][a];if(h>0){if(u==null&&(u=r.endBinaryShift(i)),!l||d===r.getMode()||d===Sr){const p=u.latchAndAppend(d,h);s.push(p)}if(!l&&lh[r.getMode()][d]>=0){const p=u.shiftAndAppend(d,h);s.push(p)}}}if(r.getBinaryShiftByteCount()>0||wu[r.getMode()][a]===0){let d=r.addBinaryShiftChar(i);s.push(d)}}static updateStateListForPair(r,i,s){const a=[];for(let l of r)this.updateStateForPair(l,i,s,a);return this.simplifyStates(a)}static updateStateForPair(r,i,s,a){let l=r.endBinaryShift(i);if(a.push(l.latchAndAppend(Qr,s)),r.getMode()!==Qr&&a.push(l.shiftAndAppend(Qr,s)),s===3||s===4){let u=l.latchAndAppend(Sr,16-s).latchAndAppend(Sr,1);a.push(u)}if(r.getBinaryShiftByteCount()>0){let u=r.addBinaryShiftChar(i).addBinaryShiftChar(i+1);a.push(u)}}static simplifyStates(r){let i=[];for(const s of r){let a=!0;for(const l of i){if(l.isBetterThanOrEqualTo(s)){a=!1;break}s.isBetterThanOrEqualTo(l)&&(i=i.filter(u=>u!==l))}a&&i.push(s)}return i}}class _e{constructor(){}static encodeBytes(r){return _e.encode(r,_e.DEFAULT_EC_PERCENT,_e.DEFAULT_AZTEC_LAYERS)}static encode(r,i,s){let a=new Ys(r).encode(),l=O.truncDivision(a.getSize()*i,100)+11,u=a.getSize()+l,d,h,p,v,C;if(s!==_e.DEFAULT_AZTEC_LAYERS){if(d=s<0,h=Math.abs(s),h>(d?_e.MAX_NB_BITS_COMPACT:_e.MAX_NB_BITS))throw new y(ie.format("Illegal value %s for layers",s));p=_e.totalBitsInLayer(h,d),v=_e.WORD_SIZE[h];let Z=p-p%v;if(C=_e.stuffBits(a,v),C.getSize()+l>Z)throw new y("Data to large for user specified layer");if(d&&C.getSize()>v*64)throw new y("Data to large for user specified layer")}else{v=0,C=null;for(let Z=0;;Z++){if(Z>_e.MAX_NB_BITS)throw new y("Data too large for an Aztec code");if(d=Z<=3,h=d?Z+1:Z,p=_e.totalBitsInLayer(h,d),u>p)continue;(C==null||v!==_e.WORD_SIZE[h])&&(v=_e.WORD_SIZE[h],C=_e.stuffBits(a,v));let Ae=p-p%v;if(!(d&&C.getSize()>v*64)&&C.getSize()+l<=Ae)break}}let S=_e.generateCheckWords(C,p,v),_=C.getSize()/v,M=_e.generateModeMessage(d,h,_),P=(d?11:14)+h*4,W=new Int32Array(P),H;if(d){H=P;for(let Z=0;Z<W.length;Z++)W[Z]=Z}else{H=P+1+2*O.truncDivision(O.truncDivision(P,2)-1,15);let Z=O.truncDivision(P,2),Ae=O.truncDivision(H,2);for(let we=0;we<Z;we++){let tr=we+O.truncDivision(we,15);W[Z-we-1]=Ae-tr-1,W[Z+we]=Ae+tr+1}}let q=new Te(H);for(let Z=0,Ae=0;Z<h;Z++){let we=(h-Z)*4+(d?9:12);for(let tr=0;tr<we;tr++){let Mr=tr*2;for(let rr=0;rr<2;rr++)S.get(Ae+Mr+rr)&&q.set(W[Z*2+rr],W[Z*2+tr]),S.get(Ae+we*2+Mr+rr)&&q.set(W[Z*2+tr],W[P-1-Z*2-rr]),S.get(Ae+we*4+Mr+rr)&&q.set(W[P-1-Z*2-rr],W[P-1-Z*2-tr]),S.get(Ae+we*6+Mr+rr)&&q.set(W[P-1-Z*2-tr],W[Z*2+rr])}Ae+=we*8}if(_e.drawModeMessage(q,d,H,M),d)_e.drawBullsEye(q,O.truncDivision(H,2),5);else{_e.drawBullsEye(q,O.truncDivision(H,2),7);for(let Z=0,Ae=0;Z<O.truncDivision(P,2)-1;Z+=15,Ae+=16)for(let we=O.truncDivision(H,2)&1;we<H;we+=2)q.set(O.truncDivision(H,2)-Ae,we),q.set(O.truncDivision(H,2)+Ae,we),q.set(we,O.truncDivision(H,2)-Ae),q.set(we,O.truncDivision(H,2)+Ae)}let J=new sh;return J.setCompact(d),J.setSize(H),J.setLayers(h),J.setCodeWords(_),J.setMatrix(q),J}static drawBullsEye(r,i,s){for(let a=0;a<s;a+=2)for(let l=i-a;l<=i+a;l++)r.set(l,i-a),r.set(l,i+a),r.set(i-a,l),r.set(i+a,l);r.set(i-s,i-s),r.set(i-s+1,i-s),r.set(i-s,i-s+1),r.set(i+s,i-s),r.set(i+s,i-s+1),r.set(i+s,i+s-1)}static generateModeMessage(r,i,s){let a=new B;return r?(a.appendBits(i-1,2),a.appendBits(s-1,6),a=_e.generateCheckWords(a,28,4)):(a.appendBits(i-1,5),a.appendBits(s-1,11),a=_e.generateCheckWords(a,40,4)),a}static drawModeMessage(r,i,s,a){let l=O.truncDivision(s,2);if(i)for(let u=0;u<7;u++){let d=l-3+u;a.get(u)&&r.set(d,l-5),a.get(u+7)&&r.set(l+5,d),a.get(20-u)&&r.set(d,l+5),a.get(27-u)&&r.set(l-5,d)}else for(let u=0;u<10;u++){let d=l-5+u+O.truncDivision(u,5);a.get(u)&&r.set(d,l-7),a.get(u+10)&&r.set(l+7,d),a.get(29-u)&&r.set(d,l+7),a.get(39-u)&&r.set(l-7,d)}}static generateCheckWords(r,i,s){let a=r.getSize()/s,l=new hu(_e.getGF(s)),u=O.truncDivision(i,s),d=_e.bitsToWords(r,s,u);l.encode(d,u-a);let h=i%s,p=new B;p.appendBits(0,h);for(const v of Array.from(d))p.appendBits(v,s);return p}static bitsToWords(r,i,s){let a=new Int32Array(s),l,u;for(l=0,u=r.getSize()/i;l<u;l++){let d=0;for(let h=0;h<i;h++)d|=r.get(l*i+h)?1<<i-h-1:0;a[l]=d}return a}static getGF(r){switch(r){case 4:return Ne.AZTEC_PARAM;case 6:return Ne.AZTEC_DATA_6;case 8:return Ne.AZTEC_DATA_8;case 10:return Ne.AZTEC_DATA_10;case 12:return Ne.AZTEC_DATA_12;default:throw new y("Unsupported word size "+r)}}static stuffBits(r,i){let s=new B,a=r.getSize(),l=(1<<i)-2;for(let u=0;u<a;u+=i){let d=0;for(let h=0;h<i;h++)(u+h>=a||r.get(u+h))&&(d|=1<<i-1-h);(d&l)===l?(s.appendBits(d&l,i),u--):d&l?s.appendBits(d,i):(s.appendBits(d|1,i),u--)}return s}static totalBitsInLayer(r,i){return((i?88:112)+16*r)*r}}_e.DEFAULT_EC_PERCENT=33,_e.DEFAULT_AZTEC_LAYERS=0,_e.MAX_NB_BITS=32,_e.MAX_NB_BITS_COMPACT=4,_e.WORD_SIZE=Int32Array.from([4,6,6,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12]);class Ia{encode(r,i,s,a){return this.encodeWithHints(r,i,s,a,null)}encodeWithHints(r,i,s,a,l){let u=pu.ISO_8859_1,d=_e.DEFAULT_EC_PERCENT,h=_e.DEFAULT_AZTEC_LAYERS;return l!=null&&(l.has(wt.CHARACTER_SET)&&(u=ih.forName(l.get(wt.CHARACTER_SET).toString())),l.has(wt.ERROR_CORRECTION)&&(d=O.parseInt(l.get(wt.ERROR_CORRECTION).toString())),l.has(wt.AZTEC_LAYERS)&&(h=O.parseInt(l.get(wt.AZTEC_LAYERS).toString()))),Ia.encodeLayers(r,i,s,a,u,d,h)}static encodeLayers(r,i,s,a,l,u,d){if(i!==le.AZTEC)throw new y("Can only encode AZTEC, but got "+i);let h=_e.encode(ie.getBytes(r,l),u,d);return Ia.renderResult(h,s,a)}static renderResult(r,i,s){let a=r.getMatrix();if(a==null)throw new Gr;let l=a.getWidth(),u=a.getHeight(),d=Math.max(i,l),h=Math.max(s,u),p=Math.min(d/l,h/u),v=(d-l*p)/2,C=(h-u*p)/2,S=new Te(d,h);for(let _=0,M=C;_<u;_++,M+=p)for(let P=0,W=v;P<l;P++,W+=p)a.get(P,_)&&S.setRegion(W,M,p,p);return S}}n.AbstractExpandedDecoder=nu,n.ArgumentException=b,n.ArithmeticException=ga,n.AztecCode=sh,n.AztecCodeReader=xa,n.AztecCodeWriter=Ia,n.AztecDecoder=je,n.AztecDetector=H0,n.AztecDetectorResult=$0,n.AztecEncoder=_e,n.AztecHighLevelEncoder=Ys,n.AztecPoint=Vt,n.BarcodeFormat=le,n.Binarizer=k,n.BinaryBitmap=A,n.BitArray=B,n.BitMatrix=Te,n.BitSource=au,n.BrowserAztecCodeReader=qv,n.BrowserBarcodeReader=n3,n.BrowserCodeReader=Er,n.BrowserDatamatrixCodeReader=s3,n.BrowserMultiFormatReader=m3,n.BrowserPDF417Reader=x3,n.BrowserQRCodeReader=w3,n.BrowserQRCodeSvgWriter=di,n.CharacterSetECI=$,n.ChecksumException=T,n.Code128Reader=ee,n.Code39Reader=mt,n.DataMatrixDecodedBitStreamParser=On,n.DataMatrixReader=Nn,n.DecodeHintType=U,n.DecoderResult=Bs,n.DefaultGridSampler=V0,n.DetectorResult=ma,n.EAN13Reader=ai,n.EncodeHintType=wt,n.Exception=m,n.FormatException=F,n.GenericGF=Ne,n.GenericGFPoly=Qt,n.GlobalHistogramBinarizer=rt,n.GridSampler=Jc,n.GridSamplerInstance=Rn,n.HTMLCanvasElementLuminanceSource=me,n.HybridBinarizer=xe,n.ITFReader=Be,n.IllegalArgumentException=y,n.IllegalStateException=Gr,n.InvertedLuminanceSource=he,n.LuminanceSource=te,n.MathUtils=Re,n.MultiFormatOneDReader=ji,n.MultiFormatReader=nh,n.MultiFormatWriter=y3,n.NotFoundException=X,n.OneDReader=ht,n.PDF417DecodedBitStreamParser=V,n.PDF417DecoderErrorCorrection=Q0,n.PDF417Reader=Nt,n.PDF417ResultMetadata=J0,n.PerspectiveTransform=kr,n.PlanarYUVLuminanceSource=Zr,n.QRCodeByteMatrix=Aa,n.QRCodeDataMask=br,n.QRCodeDecodedBitStreamParser=Qe,n.QRCodeDecoderErrorCorrectionLevel=We,n.QRCodeDecoderFormatInformation=Ut,n.QRCodeEncoder=$e,n.QRCodeEncoderQRCode=fi,n.QRCodeMaskUtil=st,n.QRCodeMatrixUtil=de,n.QRCodeMode=fe,n.QRCodeReader=kn,n.QRCodeVersion=ce,n.QRCodeWriter=zi,n.RGBLuminanceSource=gu,n.RSS14Reader=it,n.RSSExpandedReader=K,n.ReaderException=ba,n.ReedSolomonDecoder=Us,n.ReedSolomonEncoder=hu,n.ReedSolomonException=Li,n.Result=Ze,n.ResultMetadataType=bt,n.ResultPoint=ae,n.StringUtils=ie,n.UnsupportedOperationException=oe,n.VideoInputDevice=Ge,n.WhiteRectangleDetector=cn,n.WriterException=Fe,n.ZXingArrays=I,n.ZXingCharset=ih,n.ZXingInteger=O,n.ZXingStandardCharsets=pu,n.ZXingStringBuilder=pe,n.ZXingStringEncoding=ve,n.ZXingSystem=D,n.createAbstractExpandedDecoder=K0,Object.defineProperty(n,"__esModule",{value:!0})})})(X1,X1.exports);var qe=X1.exports;const kR=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var s2=function(){function e(t,n,o){if(this.formatMap=new Map([[re.QR_CODE,qe.BarcodeFormat.QR_CODE],[re.AZTEC,qe.BarcodeFormat.AZTEC],[re.CODABAR,qe.BarcodeFormat.CODABAR],[re.CODE_39,qe.BarcodeFormat.CODE_39],[re.CODE_93,qe.BarcodeFormat.CODE_93],[re.CODE_128,qe.BarcodeFormat.CODE_128],[re.DATA_MATRIX,qe.BarcodeFormat.DATA_MATRIX],[re.MAXICODE,qe.BarcodeFormat.MAXICODE],[re.ITF,qe.BarcodeFormat.ITF],[re.EAN_13,qe.BarcodeFormat.EAN_13],[re.EAN_8,qe.BarcodeFormat.EAN_8],[re.PDF_417,qe.BarcodeFormat.PDF_417],[re.RSS_14,qe.BarcodeFormat.RSS_14],[re.RSS_EXPANDED,qe.BarcodeFormat.RSS_EXPANDED],[re.UPC_A,qe.BarcodeFormat.UPC_A],[re.UPC_E,qe.BarcodeFormat.UPC_E],[re.UPC_EAN_EXTENSION,qe.BarcodeFormat.UPC_EAN_EXTENSION]]),this.reverseFormatMap=this.createReverseFormatMap(),!kR)throw"Use html5qrcode.min.js without edit, ZXing not found.";this.verbose=n,this.logger=o;var c=this.createZXingFormats(t),f=new Map;f.set(qe.DecodeHintType.POSSIBLE_FORMATS,c),f.set(qe.DecodeHintType.TRY_HARDER,!1),this.hints=f}return e.prototype.decodeAsync=function(t){var n=this;return new Promise(function(o,c){try{o(n.decode(t))}catch(f){c(f)}})},e.prototype.decode=function(t){var n=new qe.MultiFormatReader(this.verbose,this.hints),o=new qe.HTMLCanvasElementLuminanceSource(t),c=new qe.BinaryBitmap(new qe.HybridBinarizer(o)),f=n.decode(c);return{text:f.text,format:$v.create(this.toHtml5QrcodeSupportedFormats(f.format)),debugData:this.createDebugData()}},e.prototype.createReverseFormatMap=function(){var t=new Map;return this.formatMap.forEach(function(n,o,c){t.set(n,o)}),t},e.prototype.toHtml5QrcodeSupportedFormats=function(t){if(!this.reverseFormatMap.has(t))throw"reverseFormatMap doesn't have ".concat(t);return this.reverseFormatMap.get(t)},e.prototype.createZXingFormats=function(t){for(var n=[],o=0,c=t;o<c.length;o++){var f=c[o];this.formatMap.has(f)?n.push(this.formatMap.get(f)):this.logger.logError("".concat(f," is not supported by")+"ZXingHtml5QrcodeShim")}return n},e.prototype.createDebugData=function(){return{decoderName:"zxing-js"}},e}(),DR=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function x(b){try{m(o.next(b))}catch(y){g(y)}}function w(b){try{m(o.throw(b))}catch(y){g(y)}}function m(b){b.done?f(b.value):c(b.value).then(x,w)}m((o=o.apply(e,t||[])).next())})},MR=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function x(m){return function(b){return w([m,b])}}function w(m){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,m[0]&&(n=0)),n;)try{if(o=1,c&&(f=m[0]&2?c.return:m[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,m[1])).done)return f;switch(c=0,f&&(m=[m[0]&2,f.value]),m[0]){case 0:case 1:f=m;break;case 4:return n.label++,{value:m[1],done:!1};case 5:n.label++,c=m[1],m=[0];continue;case 7:m=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(m[0]===6||m[0]===2)){n=0;continue}if(m[0]===3&&(!f||m[1]>f[0]&&m[1]<f[3])){n.label=m[1];break}if(m[0]===6&&n.label<f[1]){n.label=f[1],f=m;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(m);break}f[2]&&n.ops.pop(),n.trys.pop();continue}m=t.call(e,n)}catch(b){m=[6,b],c=0}finally{o=f=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},o2=function(){function e(t,n,o){if(this.formatMap=new Map([[re.QR_CODE,"qr_code"],[re.AZTEC,"aztec"],[re.CODABAR,"codabar"],[re.CODE_39,"code_39"],[re.CODE_93,"code_93"],[re.CODE_128,"code_128"],[re.DATA_MATRIX,"data_matrix"],[re.ITF,"itf"],[re.EAN_13,"ean_13"],[re.EAN_8,"ean_8"],[re.PDF_417,"pdf417"],[re.UPC_A,"upc_a"],[re.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=o;var c=this.createBarcodeDetectorFormats(t);if(this.detector=new BarcodeDetector(c),!this.detector)throw"BarcodeDetector detector not supported"}return e.isSupported=function(){if(!("BarcodeDetector"in window))return!1;var t=new BarcodeDetector({formats:["qr_code"]});return typeof t<"u"},e.prototype.decodeAsync=function(t){return DR(this,void 0,void 0,function(){var n,o;return MR(this,function(c){switch(c.label){case 0:return[4,this.detector.detect(t)];case 1:if(n=c.sent(),!n||n.length===0)throw"No barcode or QR code detected.";return o=this.selectLargestBarcode(n),[2,{text:o.rawValue,format:$v.create(this.toHtml5QrcodeSupportedFormats(o.format)),debugData:this.createDebugData()}]}})})},e.prototype.selectLargestBarcode=function(t){for(var n=null,o=0,c=0,f=t;c<f.length;c++){var g=f[c],x=g.boundingBox.width*g.boundingBox.height;x>o&&(o=x,n=g)}if(!n)throw"No largest barcode found";return n},e.prototype.createBarcodeDetectorFormats=function(t){for(var n=[],o=0,c=t;o<c.length;o++){var f=c[o];this.formatMap.has(f)?n.push(this.formatMap.get(f)):this.logger.warn("".concat(f," is not supported by")+"BarcodeDetectorDelegate")}return{formats:n}},e.prototype.toHtml5QrcodeSupportedFormats=function(t){if(!this.reverseFormatMap.has(t))throw"reverseFormatMap doesn't have ".concat(t);return this.reverseFormatMap.get(t)},e.prototype.createReverseFormatMap=function(){var t=new Map;return this.formatMap.forEach(function(n,o,c){t.set(n,o)}),t},e.prototype.createDebugData=function(){return{decoderName:"BarcodeDetector"}},e}(),a2=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function x(b){try{m(o.next(b))}catch(y){g(y)}}function w(b){try{m(o.throw(b))}catch(y){g(y)}}function m(b){b.done?f(b.value):c(b.value).then(x,w)}m((o=o.apply(e,t||[])).next())})},l2=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function x(m){return function(b){return w([m,b])}}function w(m){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,m[0]&&(n=0)),n;)try{if(o=1,c&&(f=m[0]&2?c.return:m[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,m[1])).done)return f;switch(c=0,f&&(m=[m[0]&2,f.value]),m[0]){case 0:case 1:f=m;break;case 4:return n.label++,{value:m[1],done:!1};case 5:n.label++,c=m[1],m=[0];continue;case 7:m=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(m[0]===6||m[0]===2)){n=0;continue}if(m[0]===3&&(!f||m[1]>f[0]&&m[1]<f[3])){n.label=m[1];break}if(m[0]===6&&n.label<f[1]){n.label=f[1],f=m;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(m);break}f[2]&&n.ops.pop(),n.trys.pop();continue}m=t.call(e,n)}catch(b){m=[6,b],c=0}finally{o=f=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},PR=function(){function e(t,n,o,c){this.EXECUTIONS_TO_REPORT_PERFORMANCE=100,this.executions=0,this.executionResults=[],this.wasPrimaryDecoderUsedInLastDecode=!1,this.verbose=o,n&&o2.isSupported()?(this.primaryDecoder=new o2(t,o,c),this.secondaryDecoder=new s2(t,o,c)):this.primaryDecoder=new s2(t,o,c)}return e.prototype.decodeAsync=function(t){return a2(this,void 0,void 0,function(){var n;return l2(this,function(o){switch(o.label){case 0:n=performance.now(),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,this.getDecoder().decodeAsync(t)];case 2:return[2,o.sent()];case 3:return this.possiblyLogPerformance(n),[7];case 4:return[2]}})})},e.prototype.decodeRobustlyAsync=function(t){return a2(this,void 0,void 0,function(){var n,o;return l2(this,function(c){switch(c.label){case 0:n=performance.now(),c.label=1;case 1:return c.trys.push([1,3,4,5]),[4,this.primaryDecoder.decodeAsync(t)];case 2:return[2,c.sent()];case 3:if(o=c.sent(),this.secondaryDecoder)return[2,this.secondaryDecoder.decodeAsync(t)];throw o;case 4:return this.possiblyLogPerformance(n),[7];case 5:return[2]}})})},e.prototype.getDecoder=function(){return this.secondaryDecoder?this.wasPrimaryDecoderUsedInLastDecode===!1?(this.wasPrimaryDecoderUsedInLastDecode=!0,this.primaryDecoder):(this.wasPrimaryDecoderUsedInLastDecode=!1,this.secondaryDecoder):this.primaryDecoder},e.prototype.possiblyLogPerformance=function(t){if(this.verbose){var n=performance.now()-t;this.executionResults.push(n),this.executions++,this.possiblyFlushPerformanceReport()}},e.prototype.possiblyFlushPerformanceReport=function(){if(!(this.executions<this.EXECUTIONS_TO_REPORT_PERFORMANCE)){for(var t=0,n=0,o=this.executionResults;n<o.length;n++){var c=o[n];t+=c}var f=t/this.executionResults.length;console.log("".concat(f," ms for ").concat(this.executionResults.length," last runs.")),this.executions=0,this.executionResults=[]}},e}(),W0=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,c){o.__proto__=c}||function(o,c){for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(o[f]=c[f])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),fc=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function x(b){try{m(o.next(b))}catch(y){g(y)}}function w(b){try{m(o.throw(b))}catch(y){g(y)}}function m(b){b.done?f(b.value):c(b.value).then(x,w)}m((o=o.apply(e,t||[])).next())})},dc=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function x(m){return function(b){return w([m,b])}}function w(m){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,m[0]&&(n=0)),n;)try{if(o=1,c&&(f=m[0]&2?c.return:m[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,m[1])).done)return f;switch(c=0,f&&(m=[m[0]&2,f.value]),m[0]){case 0:case 1:f=m;break;case 4:return n.label++,{value:m[1],done:!1};case 5:n.label++,c=m[1],m=[0];continue;case 7:m=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(m[0]===6||m[0]===2)){n=0;continue}if(m[0]===3&&(!f||m[1]>f[0]&&m[1]<f[3])){n.label=m[1];break}if(m[0]===6&&n.label<f[1]){n.label=f[1],f=m;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(m);break}f[2]&&n.ops.pop(),n.trys.pop();continue}m=t.call(e,n)}catch(b){m=[6,b],c=0}finally{o=f=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},Hv=function(){function e(t,n){this.name=t,this.track=n}return e.prototype.isSupported=function(){return this.track.getCapabilities?this.name in this.track.getCapabilities():!1},e.prototype.apply=function(t){var n={};n[this.name]=t;var o={advanced:[n]};return this.track.applyConstraints(o)},e.prototype.value=function(){var t=this.track.getSettings();if(this.name in t){var n=t[this.name];return n}return null},e}(),LR=function(e){W0(t,e);function t(n,o){return e.call(this,n,o)||this}return 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(n){var o={};o[this.name]=n;var c={advanced:[o]};return this.track.applyConstraints(c)},t.prototype.getCapabilities=function(){this.failIfNotSupported();var n=this.track.getCapabilities(),o=n[this.name];return{min:o.min,max:o.max,step:o.step}},t.prototype.failIfNotSupported=function(){if(!this.isSupported())throw new Error("".concat(this.name," capability not supported"))},t}(Hv),BR=function(e){W0(t,e);function t(n){return e.call(this,"zoom",n)||this}return t}(LR),FR=function(e){W0(t,e);function t(n){return e.call(this,"torch",n)||this}return t}(Hv),UR=function(){function e(t){this.track=t}return e.prototype.zoomFeature=function(){return new BR(this.track)},e.prototype.torchFeature=function(){return new FR(this.track)},e}(),jR=function(){function e(t,n,o){this.isClosed=!1,this.parentElement=t,this.mediaStream=n,this.callbacks=o,this.surface=this.createVideoElement(this.parentElement.clientWidth),t.append(this.surface)}return e.prototype.createVideoElement=function(t){var n=document.createElement("video");return n.style.width="".concat(t,"px"),n.style.display="block",n.muted=!0,n.setAttribute("muted","true"),n.playsInline=!0,n},e.prototype.setupSurface=function(){var t=this;this.surface.onabort=function(){throw"RenderedCameraImpl video surface onabort() called"},this.surface.onerror=function(){throw"RenderedCameraImpl video surface onerror() called"};var n=function(){var o=t.surface.clientWidth,c=t.surface.clientHeight;t.callbacks.onRenderSurfaceReady(o,c),t.surface.removeEventListener("playing",n)};this.surface.addEventListener("playing",n),this.surface.srcObject=this.mediaStream,this.surface.play()},e.create=function(t,n,o,c){return fc(this,void 0,void 0,function(){var f,g;return dc(this,function(x){switch(x.label){case 0:return f=new e(t,n,c),o.aspectRatio?(g={aspectRatio:o.aspectRatio},[4,f.getFirstTrackOrFail().applyConstraints(g)]):[3,2];case 1:x.sent(),x.label=2;case 2:return f.setupSurface(),[2,f]}})})},e.prototype.failIfClosed=function(){if(this.isClosed)throw"The RenderedCamera has already been closed."},e.prototype.getFirstTrackOrFail=function(){if(this.failIfClosed(),this.mediaStream.getVideoTracks().length===0)throw"No video tracks found";return this.mediaStream.getVideoTracks()[0]},e.prototype.pause=function(){this.failIfClosed(),this.surface.pause()},e.prototype.resume=function(t){this.failIfClosed();var n=this,o=function(){setTimeout(t,200),n.surface.removeEventListener("playing",o)};this.surface.addEventListener("playing",o),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(t){return fc(this,void 0,void 0,function(){return dc(this,function(n){if("aspectRatio"in t)throw"Changing 'aspectRatio' in run-time is not yet supported.";return[2,this.getFirstTrackOrFail().applyConstraints(t)]})})},e.prototype.close=function(){if(this.isClosed)return Promise.resolve();var t=this;return new Promise(function(n,o){var c=t.mediaStream.getVideoTracks(),f=c.length,g=0;t.mediaStream.getVideoTracks().forEach(function(x){t.mediaStream.removeTrack(x),x.stop(),++g,g>=f&&(t.isClosed=!0,t.parentElement.removeChild(t.surface),n())})})},e.prototype.getCapabilities=function(){return new UR(this.getFirstTrackOrFail())},e}(),WR=function(){function e(t){this.mediaStream=t}return e.prototype.render=function(t,n,o){return fc(this,void 0,void 0,function(){return dc(this,function(c){return[2,jR.create(t,this.mediaStream,n,o)]})})},e.create=function(t){return fc(this,void 0,void 0,function(){var n,o;return dc(this,function(c){switch(c.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 o=c.sent(),[2,new e(o)]}})})},e}(),c2=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function x(b){try{m(o.next(b))}catch(y){g(y)}}function w(b){try{m(o.throw(b))}catch(y){g(y)}}function m(b){b.done?f(b.value):c(b.value).then(x,w)}m((o=o.apply(e,t||[])).next())})},u2=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function x(m){return function(b){return w([m,b])}}function w(m){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,m[0]&&(n=0)),n;)try{if(o=1,c&&(f=m[0]&2?c.return:m[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,m[1])).done)return f;switch(c=0,f&&(m=[m[0]&2,f.value]),m[0]){case 0:case 1:f=m;break;case 4:return n.label++,{value:m[1],done:!1};case 5:n.label++,c=m[1],m=[0];continue;case 7:m=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(m[0]===6||m[0]===2)){n=0;continue}if(m[0]===3&&(!f||m[1]>f[0]&&m[1]<f[3])){n.label=m[1];break}if(m[0]===6&&n.label<f[1]){n.label=f[1],f=m;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(m);break}f[2]&&n.ops.pop(),n.trys.pop();continue}m=t.call(e,n)}catch(b){m=[6,b],c=0}finally{o=f=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},zR=function(){function e(){}return e.failIfNotSupported=function(){return c2(this,void 0,void 0,function(){return u2(this,function(t){if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return[2,new e]})})},e.prototype.create=function(t){return c2(this,void 0,void 0,function(){return u2(this,function(n){return[2,WR.create(t)]})})},e}(),$R=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function x(b){try{m(o.next(b))}catch(y){g(y)}}function w(b){try{m(o.throw(b))}catch(y){g(y)}}function m(b){b.done?f(b.value):c(b.value).then(x,w)}m((o=o.apply(e,t||[])).next())})},VR=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function x(m){return function(b){return w([m,b])}}function w(m){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,m[0]&&(n=0)),n;)try{if(o=1,c&&(f=m[0]&2?c.return:m[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,m[1])).done)return f;switch(c=0,f&&(m=[m[0]&2,f.value]),m[0]){case 0:case 1:f=m;break;case 4:return n.label++,{value:m[1],done:!1};case 5:n.label++,c=m[1],m=[0];continue;case 7:m=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(m[0]===6||m[0]===2)){n=0;continue}if(m[0]===3&&(!f||m[1]>f[0]&&m[1]<f[3])){n.label=m[1];break}if(m[0]===6&&n.label<f[1]){n.label=f[1],f=m;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(m);break}f[2]&&n.ops.pop(),n.trys.pop();continue}m=t.call(e,n)}catch(b){m=[6,b],c=0}finally{o=f=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},HR=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=us.unableToQuerySupportedDevices();return e.isHttpsOrLocalhost()||(t=us.insecureContextCameraQueryError()),Promise.reject(t)},e.isHttpsOrLocalhost=function(){if(location.protocol==="https:")return!0;var t=location.host.split(":")[0];return t==="127.0.0.1"||t==="localhost"},e.getCamerasFromMediaDevices=function(){return $R(this,void 0,void 0,function(){var t,n,o,c,f,g,x;return VR(this,function(w){switch(w.label){case 0:return t=function(m){for(var b=m.getVideoTracks(),y=0,A=b;y<A.length;y++){var T=A[y];T.enabled=!1,T.stop(),m.removeTrack(T)}},[4,navigator.mediaDevices.getUserMedia({audio:!1,video:!0})];case 1:return n=w.sent(),[4,navigator.mediaDevices.enumerateDevices()];case 2:for(o=w.sent(),c=[],f=0,g=o;f<g.length;f++)x=g[f],x.kind==="videoinput"&&c.push({id:x.deviceId,label:x.label});return t(n),[2,c]}})})},e.getCamerasFromMediaStreamTrack=function(){return new Promise(function(t,n){var o=function(f){for(var g=[],x=0,w=f;x<w.length;x++){var m=w[x];m.kind==="video"&&g.push({id:m.id,label:m.label})}t(g)},c=MediaStreamTrack;c.getSources(o)})},e}(),ot;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.NOT_STARTED=1]="NOT_STARTED",e[e.SCANNING=2]="SCANNING",e[e.PAUSED=3]="PAUSED"})(ot||(ot={}));var GR=function(){function e(){this.state=ot.NOT_STARTED,this.onGoingTransactionNewState=ot.UNKNOWN}return e.prototype.directTransition=function(t){this.failIfTransitionOngoing(),this.validateTransition(t),this.state=t},e.prototype.startTransition=function(t){return this.failIfTransitionOngoing(),this.validateTransition(t),this.onGoingTransactionNewState=t,this},e.prototype.execute=function(){if(this.onGoingTransactionNewState===ot.UNKNOWN)throw"Transaction is already cancelled, cannot execute().";var t=this.onGoingTransactionNewState;this.onGoingTransactionNewState=ot.UNKNOWN,this.directTransition(t)},e.prototype.cancel=function(){if(this.onGoingTransactionNewState===ot.UNKNOWN)throw"Transaction is already cancelled, cannot cancel().";this.onGoingTransactionNewState=ot.UNKNOWN},e.prototype.getState=function(){return this.state},e.prototype.failIfTransitionOngoing=function(){if(this.onGoingTransactionNewState!==ot.UNKNOWN)throw"Cannot transition to a new state, already under transition"},e.prototype.validateTransition=function(t){switch(this.state){case ot.UNKNOWN:throw"Transition from unknown is not allowed";case ot.NOT_STARTED:this.failIfNewStateIs(t,[ot.PAUSED]);break;case ot.SCANNING:break;case ot.PAUSED:break}},e.prototype.failIfNewStateIs=function(t,n){for(var o=0,c=n;o<c.length;o++){var f=c[o];if(t===f)throw"Cannot transition from ".concat(this.state," to ").concat(t)}},e}(),XR=function(){function e(t){this.stateManager=t}return e.prototype.startTransition=function(t){return this.stateManager.startTransition(t)},e.prototype.directTransition=function(t){this.stateManager.directTransition(t)},e.prototype.getState=function(){return this.stateManager.getState()},e.prototype.canScanFile=function(){return this.stateManager.getState()===ot.NOT_STARTED},e.prototype.isScanning=function(){return this.stateManager.getState()!==ot.NOT_STARTED},e.prototype.isStrictlyScanning=function(){return this.stateManager.getState()===ot.SCANNING},e.prototype.isPaused=function(){return this.stateManager.getState()===ot.PAUSED},e}(),YR=function(){function e(){}return e.create=function(){return new XR(new GR)},e}(),KR=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,c){o.__proto__=c}||function(o,c){for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(o[f]=c[f])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),dr=function(e){KR(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return 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}(_R),ZR=function(){function e(t,n){this.logger=n,this.fps=dr.SCAN_DEFAULT_FPS,t?(t.fps&&(this.fps=t.fps),this.disableFlip=t.disableFlip===!0,this.qrbox=t.qrbox,this.aspectRatio=t.aspectRatio,this.videoConstraints=t.videoConstraints):this.disableFlip=dr.DEFAULT_DISABLE_FLIP}return e.prototype.isMediaStreamConstraintsValid=function(){return this.videoConstraints?Vv.isMediaStreamConstraintsValid(this.videoConstraints,this.logger):(this.logger.logError("Empty videoConstraints",!0),!1)},e.prototype.isShadedBoxEnabled=function(){return!un(this.qrbox)},e.create=function(t,n){return new e(t,n)},e}(),L_=function(){function e(t,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(t))throw"HTML Element with id=".concat(t," not found");this.elementId=t,this.verbose=!1;var o;typeof n=="boolean"?this.verbose=n===!0:n&&(o=n,this.verbose=o.verbose===!0,o.experimentalFeatures),this.logger=new NR(this.verbose),this.qrcode=new PR(this.getSupportedFormats(n),this.getUseBarCodeDetectorIfSupported(o),this.verbose,this.logger),this.foreverScanTimeout,this.shouldScan=!0,this.stateManagerProxy=YR.create()}return e.prototype.start=function(t,n,o,c){var f=this;if(!t)throw"cameraIdOrConfig is required";if(!o||typeof o!="function")throw"qrCodeSuccessCallback is required and should be a function.";var g;c?g=c:g=this.verbose?this.logger.log:function(){};var x=ZR.create(n,this.logger);this.clearElement();var w=!1;x.videoConstraints&&(x.isMediaStreamConstraintsValid()?w=!0:this.logger.logError("'videoConstraints' is not valid 'MediaStreamConstraints, it will be ignored.'",!0));var m=w,b=document.getElementById(this.elementId);b.clientWidth?b.clientWidth:dr.DEFAULT_WIDTH,b.style.position="relative",this.shouldScan=!0,this.element=b;var y=this,A=this.stateManagerProxy.startTransition(ot.SCANNING);return new Promise(function(T,k){var D=m?x.videoConstraints:y.createVideoConstraints(t);if(!D){A.cancel(),k("videoConstraints should be defined");return}var G={};(!m||x.aspectRatio)&&(G.aspectRatio=x.aspectRatio);var N={onRenderSurfaceReady:function(I,O){y.setupUi(I,O,x),y.isScanning=!0,y.foreverScan(x,o,g)}};zR.failIfNotSupported().then(function(I){I.create(D).then(function(O){return O.render(f.element,G,N).then(function(B){y.renderedCamera=B,A.execute(),T(null)}).catch(function(B){A.cancel(),k(B)})}).catch(function(O){A.cancel(),k(us.errorGettingUserMedia(O))})}).catch(function(I){A.cancel(),k(us.cameraStreamingNotSupported())})})},e.prototype.pause=function(t){if(!this.stateManagerProxy.isStrictlyScanning())throw"Cannot pause, scanner is not scanning.";this.stateManagerProxy.directTransition(ot.PAUSED),this.showPausedState(),(un(t)||t!==!0)&&(t=!1),t&&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 t=this,n=function(){t.stateManagerProxy.directTransition(ot.SCANNING),t.hidePausedState()};if(!this.renderedCamera.isPaused()){n();return}this.renderedCamera.resume(function(){n()})},e.prototype.getState=function(){return this.stateManagerProxy.getState()},e.prototype.stop=function(){var t=this;if(!this.stateManagerProxy.isScanning())throw"Cannot stop, scanner is not running or paused.";var n=this.stateManagerProxy.startTransition(ot.NOT_STARTED);this.shouldScan=!1,this.foreverScanTimeout&&clearTimeout(this.foreverScanTimeout);var o=function(){if(t.element){var f=document.getElementById(dr.SHADED_REGION_ELEMENT_ID);f&&t.element.removeChild(f)}},c=this;return this.renderedCamera.close().then(function(){return c.renderedCamera=null,c.element&&(c.element.removeChild(c.canvasElement),c.canvasElement=null),o(),c.qrRegion&&(c.qrRegion=null),c.context&&(c.context=null),n.execute(),c.hidePausedState(),c.isScanning=!1,Promise.resolve()})},e.prototype.scanFile=function(t,n){return this.scanFileV2(t,n).then(function(o){return o.decodedText})},e.prototype.scanFileV2=function(t,n){var o=this;if(!t||!(t instanceof File))throw"imageFile argument is mandatory and should be instance of File. Use 'event.target.files[0]'.";if(un(n)&&(n=!0),!this.stateManagerProxy.canScanFile())throw"Cannot start file scan - ongoing camera scan";return new Promise(function(c,f){o.possiblyCloseLastScanImageFile(),o.clearElement(),o.lastScanImageFile=URL.createObjectURL(t);var g=new Image;g.onload=function(){var x=g.width,w=g.height,m=document.getElementById(o.elementId),b=m.clientWidth?m.clientWidth:dr.DEFAULT_WIDTH,y=Math.max(m.clientHeight?m.clientHeight:w,dr.FILE_SCAN_MIN_HEIGHT),A=o.computeCanvasDrawConfig(x,w,b,y);if(n){var T=o.createCanvasElement(b,y,"qr-canvas-visible");T.style.display="inline-block",m.appendChild(T);var k=T.getContext("2d");if(!k)throw"Unable to get 2d context from canvas";k.canvas.width=b,k.canvas.height=y,k.drawImage(g,0,0,x,w,A.x,A.y,A.width,A.height)}var D=dr.FILE_SCAN_HIDDEN_CANVAS_PADDING,G=Math.max(g.width,A.width),N=Math.max(g.height,A.height),I=G+2*D,O=N+2*D,B=o.createCanvasElement(I,O);m.appendChild(B);var j=B.getContext("2d");if(!j)throw"Unable to get 2d context from canvas";j.canvas.width=I,j.canvas.height=O,j.drawImage(g,0,0,x,w,D,D,G,N);try{o.qrcode.decodeRobustlyAsync(B).then(function(U){c(i2.createFromQrcodeResult(U))}).catch(f)}catch(U){f("QR code parse error, error = ".concat(U))}},g.onerror=f,g.onabort=f,g.onstalled=f,g.onsuspend=f,g.src=URL.createObjectURL(t)})},e.prototype.clear=function(){this.clearElement()},e.getCameras=function(){return HR.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(t){if(t){if(!Vv.isMediaStreamConstraintsValid(t,this.logger))throw"invalid videoConstaints passed, check logs for more details"}else throw"videoConstaints is required argument.";return this.getRenderedCameraOrFail().applyVideoConstraints(t)},e.prototype.getRenderedCameraOrFail=function(){if(this.renderedCamera==null)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(t){var n=[re.QR_CODE,re.AZTEC,re.CODABAR,re.CODE_39,re.CODE_93,re.CODE_128,re.DATA_MATRIX,re.MAXICODE,re.ITF,re.EAN_13,re.EAN_8,re.PDF_417,re.RSS_14,re.RSS_EXPANDED,re.UPC_A,re.UPC_E,re.UPC_EAN_EXTENSION];if(!t||typeof t=="boolean"||!t.formatsToSupport)return n;if(!Array.isArray(t.formatsToSupport))throw"configOrVerbosityFlag.formatsToSupport should be undefined or an array.";if(t.formatsToSupport.length===0)throw"Atleast 1 formatsToSupport is needed.";for(var o=[],c=0,f=t.formatsToSupport;c<f.length;c++){var g=f[c];RR(g)?o.push(g):this.logger.warn("Invalid format: ".concat(g," passed in config, ignoring."))}if(o.length===0)throw"None of formatsToSupport match supported values.";return o},e.prototype.getUseBarCodeDetectorIfSupported=function(t){if(un(t))return!0;if(!un(t.useBarCodeDetectorIfSupported))return t.useBarCodeDetectorIfSupported!==!1;if(un(t.experimentalFeatures))return!0;var n=t.experimentalFeatures;return un(n.useBarCodeDetectorIfSupported)?!0:n.useBarCodeDetectorIfSupported!==!1},e.prototype.validateQrboxSize=function(t,n,o){var c=this,f=o.qrbox;this.validateQrboxConfig(f);var g=this.toQrdimensions(t,n,f),x=function(m){if(m<dr.MIN_QR_BOX_SIZE)throw"minimum size of 'config.qrbox' dimension value is"+" ".concat(dr.MIN_QR_BOX_SIZE,"px.")},w=function(m){return m>t&&(c.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."),m=t),m};x(g.width),x(g.height),g.width=w(g.width)},e.prototype.validateQrboxConfig=function(t){if(typeof t!="number"&&typeof t!="function"&&(t.width===void 0||t.height===void 0))throw"Invalid instance of QrDimensions passed for 'config.qrbox'. Both 'width' and 'height' should be set."},e.prototype.toQrdimensions=function(t,n,o){if(typeof o=="number")return{width:o,height:o};if(typeof o=="function")try{return o(t,n)}catch(c){throw new Error("qrbox config was passed as a function but it failed with unknown error"+c)}return o},e.prototype.setupUi=function(t,n,o){o.isShadedBoxEnabled()&&this.validateQrboxSize(t,n,o);var c=un(o.qrbox)?{width:t,height:n}:o.qrbox;this.validateQrboxConfig(c);var f=this.toQrdimensions(t,n,c);f.height>n&&this.logger.warn("[Html5Qrcode] config.qrbox has height that isgreater than the height of the video stream. Shading will be ignored");var g=o.isShadedBoxEnabled()&&f.height<=n,x={x:0,y:0,width:t,height:n},w=g?this.getShadedRegionBounds(t,n,f):x,m=this.createCanvasElement(w.width,w.height),b={willReadFrequently:!0},y=m.getContext("2d",b);y.canvas.width=w.width,y.canvas.height=w.height,this.element.append(m),g&&this.possiblyInsertShadingElement(this.element,t,n,f),this.createScannerPausedUiElement(this.element),this.qrRegion=w,this.context=y,this.canvasElement=m},e.prototype.createScannerPausedUiElement=function(t){var n=document.createElement("div");n.innerText=us.scannerPaused(),n.style.display="none",n.style.position="absolute",n.style.top="0px",n.style.zIndex="1",n.style.background="rgba(9, 9, 9, 0.46)",n.style.color="#FFECEC",n.style.textAlign="center",n.style.width="100%",t.appendChild(n),this.scannerPausedUiElement=n},e.prototype.scanContext=function(t,n){var o=this;return this.stateManagerProxy.isPaused()?Promise.resolve(!1):this.qrcode.decodeAsync(this.canvasElement).then(function(c){return t(c.text,i2.createFromQrcodeResult(c)),o.possiblyUpdateShaders(!0),!0}).catch(function(c){o.possiblyUpdateShaders(!1);var f=us.codeParseError(c);return n(f,OR.createFrom(f)),!1})},e.prototype.foreverScan=function(t,n,o){var c=this;if(this.shouldScan&&this.renderedCamera){var f=this.renderedCamera.getSurface(),g=f.videoWidth/f.clientWidth,x=f.videoHeight/f.clientHeight;if(!this.qrRegion)throw"qrRegion undefined when localMediaStream is ready.";var w=this.qrRegion.width*g,m=this.qrRegion.height*x,b=this.qrRegion.x*g,y=this.qrRegion.y*x;this.context.drawImage(f,b,y,w,m,0,0,this.qrRegion.width,this.qrRegion.height);var A=function(){c.foreverScanTimeout=setTimeout(function(){c.foreverScan(t,n,o)},c.getTimeoutFps(t.fps))};this.scanContext(n,o).then(function(T){!T&&t.disableFlip!==!0?(c.context.translate(c.context.canvas.width,0),c.context.scale(-1,1),c.scanContext(n,o).finally(function(){A()})):A()}).catch(function(T){c.logger.logError("Error happend while scanning context",T),A()})}},e.prototype.createVideoConstraints=function(t){if(typeof t=="string")return{deviceId:{exact:t}};if(typeof t=="object"){var n="facingMode",o="deviceId",c={user:!0,environment:!0},f="exact",g=function(k){if(k in c)return!0;throw"config has invalid 'facingMode' value = "+"'".concat(k,"'")},x=Object.keys(t);if(x.length!==1)throw"'cameraIdOrConfig' object should have exactly 1 key,"+" if passed as an object, found ".concat(x.length," keys");var w=Object.keys(t)[0];if(w!==n&&w!==o)throw"Only '".concat(n,"' and '").concat(o,"' ")+" are supported for 'cameraIdOrConfig'";if(w===n){var m=t.facingMode;if(typeof m=="string"){if(g(m))return{facingMode:m}}else if(typeof m=="object")if(f in m){if(g(m["".concat(f)]))return{facingMode:{exact:m["".concat(f)]}}}else throw"'facingMode' should be string or object with"+" ".concat(f," as key.");else{var b=typeof m;throw"Invalid type of 'facingMode' = ".concat(b)}}else{var y=t.deviceId;if(typeof y=="string")return{deviceId:y};if(typeof y=="object"){if(f in y)return{deviceId:{exact:y["".concat(f)]}};throw"'deviceId' should be string or object with"+" ".concat(f," as key.")}else{var A=typeof y;throw"Invalid type of 'deviceId' = ".concat(A)}}}var T=typeof t;throw"Invalid type of 'cameraIdOrConfig' = ".concat(T)},e.prototype.computeCanvasDrawConfig=function(t,n,o,c){if(t<=o&&n<=c){var f=(o-t)/2,g=(c-n)/2;return{x:f,y:g,width:t,height:n}}else{var x=t,w=n;return t>o&&(n=o/t*n,t=o),n>c&&(t=c/n*t,n=c),this.logger.log("Image downsampled from "+"".concat(x,"X").concat(w)+" to ".concat(t,"X").concat(n,".")),this.computeCanvasDrawConfig(t,n,o,c)}},e.prototype.clearElement=function(){if(this.stateManagerProxy.isScanning())throw"Cannot clear while scan is ongoing, close it first.";var t=document.getElementById(this.elementId);t&&(t.innerHTML="")},e.prototype.possiblyUpdateShaders=function(t){this.qrMatch!==t&&(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(n){n.style.backgroundColor=t?dr.BORDER_SHADER_MATCH_COLOR:dr.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=t)},e.prototype.possiblyCloseLastScanImageFile=function(){this.lastScanImageFile&&(URL.revokeObjectURL(this.lastScanImageFile),this.lastScanImageFile=null)},e.prototype.createCanvasElement=function(t,n,o){var c=t,f=n,g=document.createElement("canvas");return g.style.width="".concat(c,"px"),g.style.height="".concat(f,"px"),g.style.display="none",g.id=un(o)?"qr-canvas":o,g},e.prototype.getShadedRegionBounds=function(t,n,o){if(o.width>t||o.height>n)throw"'config.qrbox' dimensions should not be greater than the dimensions of the root HTML element.";return{x:(t-o.width)/2,y:(n-o.height)/2,width:o.width,height:o.height}},e.prototype.possiblyInsertShadingElement=function(t,n,o,c){if(!(n-c.width<1||o-c.height<1)){var f=document.createElement("div");f.style.position="absolute";var g=(n-c.width)/2,x=(o-c.height)/2;if(f.style.borderLeft="".concat(g,"px solid rgba(0, 0, 0, 0.48)"),f.style.borderRight="".concat(g,"px solid rgba(0, 0, 0, 0.48)"),f.style.borderTop="".concat(x,"px solid rgba(0, 0, 0, 0.48)"),f.style.borderBottom="".concat(x,"px solid rgba(0, 0, 0, 0.48)"),f.style.boxSizing="border-box",f.style.top="0px",f.style.bottom="0px",f.style.left="0px",f.style.right="0px",f.id="".concat(dr.SHADED_REGION_ELEMENT_ID),n-c.width<11||o-c.height<11)this.hasBorderShaders=!1;else{var w=5,m=40;this.insertShaderBorders(f,m,w,-w,null,0,!0),this.insertShaderBorders(f,m,w,-w,null,0,!1),this.insertShaderBorders(f,m,w,null,-w,0,!0),this.insertShaderBorders(f,m,w,null,-w,0,!1),this.insertShaderBorders(f,w,m+w,-w,null,-w,!0),this.insertShaderBorders(f,w,m+w,null,-w,-w,!0),this.insertShaderBorders(f,w,m+w,-w,null,-w,!1),this.insertShaderBorders(f,w,m+w,null,-w,-w,!1),this.hasBorderShaders=!0}t.append(f)}},e.prototype.insertShaderBorders=function(t,n,o,c,f,g,x){var w=document.createElement("div");w.style.position="absolute",w.style.backgroundColor=dr.BORDER_SHADER_DEFAULT_COLOR,w.style.width="".concat(n,"px"),w.style.height="".concat(o,"px"),c!==null&&(w.style.top="".concat(c,"px")),f!==null&&(w.style.bottom="".concat(f,"px")),x?w.style.left="".concat(g,"px"):w.style.right="".concat(g,"px"),this.borderShaders||(this.borderShaders=[]),this.borderShaders.push(w),t.appendChild(w)},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(t){return 1e3/t},e}(),f2;(function(e){e[e.STATUS_DEFAULT=0]="STATUS_DEFAULT",e[e.STATUS_SUCCESS=1]="STATUS_SUCCESS",e[e.STATUS_WARNING=2]="STATUS_WARNING",e[e.STATUS_REQUESTING_PERMISSION=3]="STATUS_REQUESTING_PERMISSION"})(f2||(f2={}));var Y1;(function(e){e[e.BACK=1]="BACK",e[e.FRONT=2]="FRONT"})(Y1||(Y1={}));var K1;(function(e){e[e.PORTRAIT=1]="PORTRAIT",e[e.LANDSCAPE=2]="LANDSCAPE",e[e.ADAPTIVE=3]="ADAPTIVE"})(K1||(K1={}));var Z1;(function(e){e[e.ALL=17]="ALL"})(Z1||(Z1={}));const QR=Object.assign(Object.assign({},re),Z1);var d2;(function(e){e.ZXING="zxing",e.MLKIT="mlkit"})(d2||(d2={}));const qR=[{selector:".scanner-container-display",css:"display: block;"},{selector:".scanner-dialog",css:"display: none; position: fixed; z-index: 999; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.4);"},{selector:".scanner-dialog-inner",css:"background-color: #fefefe; margin: 2% auto; padding: 20px; border: 1px solid #888; width: 96%;"},{selector:".close-button",css:"color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer;"},{selector:".close-button:hover",css:"color: #222;"},{selector:".scanner-container-full-width",css:"width: 100%;"}];function JR(e){const t="custom-style-os-cap-barcode";let n=document.getElementById(t);if(n||(n=document.createElement("style"),n.type="text/css",n.id=t,document.head.appendChild(n)),n.sheet){for(;n.sheet.cssRules.length;)n.sheet.deleteRule(0);for(const{selector:o,css:c}of e)n.sheet.insertRule(`${o} { ${c} }`)}else{n.textContent="";for(const{selector:o,css:c}of e)n.textContent+=`${o} { ${c} }`}}const e_=ha("CapacitorBarcodeScanner",{web:()=>(JR(qR),Fn(()=>import("./web-Den_EYDz.js"),[],import.meta.url).then(e=>new e.CapacitorBarcodeScannerWeb))});class t_{static async scanBarcode(t){return t.scanInstructions=t.scanInstructions||" ",t.scanButton=t.scanButton||!1,t.scanText=t.scanText||" ",t.cameraDirection=t.cameraDirection||Y1.BACK,t.scanOrientation=t.scanOrientation||K1.ADAPTIVE,e_.scanBarcode(t)}}const Nf=ha("SecureStoragePlugin",{web:()=>Fn(()=>import("./web-JmfGsfI_.js"),[],import.meta.url).then(e=>new e.SecureStoragePluginWeb)});function r_(e){try{if(e.length>2048)throw new Error;if(!e.startsWith("{")){const c=new URL(e);if(!["http:","https:"].includes(c.protocol)||c.username||c.password||c.pathname!=="/pair"||c.search||!/^#pair=[A-Za-z0-9_-]{43}$/.test(c.hash))throw new Error;const f=an.parse(c.origin);if(!f)throw new Error;return{endpoint:f,grant:c.hash.slice(6)}}const t=JSON.parse(e);if(t.type!=="agentroam-pair"||t.version!==1||typeof t.server!="string"||typeof t.grant!="string"||!/^[A-Za-z0-9_-]{43}$/.test(t.grant))throw new Error;const n=new URL(t.server);if(n.username||n.password||n.search||n.hash||n.pathname!=="/")throw new Error;const o=an.parse(t.server);if(!o)throw new Error;return{endpoint:o,grant:t.grant}}catch{throw new Error("这不是 AgentRoam 授权二维码,请扫描电脑终端上新生成的二维码。")}}class Gv{ready(){if(!Ns.isNativePlatform())throw new Error("请在 AgentRoam App 中扫码连接。")}async get(t){this.ready();try{return(await Nf.get({key:`agentroam-device:${t}`})).value}catch(n){if(String(n).includes("does not exist"))return null;throw new Error("无法读取设备凭证,请重试。")}}async set(t,n){this.ready(),await Nf.set({key:`agentroam-device:${t}`,value:n})}async remove(t){this.ready();try{await Nf.remove({key:`agentroam-device:${t}`})}catch(n){if(!String(n).includes("does not exist"))throw n}}}async function Xv(){if(!Ns.isNativePlatform())throw new Error("请在 AgentRoam App 中使用相机扫码。");try{return(await t_.scanBarcode({hint:QR.QR_CODE,scanInstructions:"扫描电脑上的 AgentRoam 授权二维码",cameraDirection:1})).ScanResult||null}catch(e){if(/cancel/i.test(String(e)))return null;throw new Error("无法打开相机,请在系统设置中允许 AgentRoam 使用相机后重试。")}}class Yv{constructor(t,n=(...c)=>fetch(...c),o=()=>window.dispatchEvent(new CustomEvent("webapp:unauthorized"))){this.storage=t,this.transport=n,this.onRevoked=o,this.session=null,this.fetch=async(c,f={})=>{const g=this.session,x=new URL(typeof c=="string"?c:c instanceof URL?c.href:c.url),w=new Headers(f.headers??(c instanceof Request?c.headers:void 0));g&&x.origin===g.origin&&w.set("authorization",`Bearer ${g.token}`);const m=await this.transport(c,{...f,headers:w,credentials:"omit",redirect:"error"});if(g&&this.session===g&&x.origin===g.origin&&(m.status===401||m.status===423)){this.session=null;try{await this.storage.remove(g.origin)}finally{this.onRevoked()}}return m}}async resume(t){const n=await this.storage.get(t.url);this.session=n?{origin:t.url,token:n}:null}async pair(t){const{endpoint:n,grant:o}=r_(t),c=new AbortController,f=setTimeout(()=>c.abort(),3e4);let g=null;try{let x;try{x=await this.transport(n.api("/api/pairing/qr-exchange"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant:o,name:"我的 App"}),credentials:"omit",redirect:"error",signal:c.signal}),x.ok&&(g=await x.json())}catch(w){if(w instanceof SyntaxError)throw new Error("服务器返回了无效的设备凭证。");const m=c.signal.aborted||w instanceof Error&&(w.name==="TimeoutError"||w.name==="AbortError"),b=n.url.startsWith("http://")?"请确认手机与电脑在同一网络,并检查电脑防火墙是否允许 AgentRoam 连接。":"请检查手机网络和电脑的远程连接是否可用。";throw new Error(`${m?"连接电脑超时":"无法连接电脑"}(${n.url})。${b}请在电脑上刷新二维码后重新扫码。`)}if(!x.ok)throw new Error(x.status===423?"电脑已锁定远程访问,请先在电脑上解锁。":x.status===410?"二维码已使用或已过期,请在电脑上重新生成。":"扫码连接失败,请检查服务器地址和网络后重试。")}finally{clearTimeout(f)}if(!g||typeof g.token!="string"||!/^[A-Za-z0-9_-]{43}$/.test(g.token))throw new Error("服务器返回了无效的设备凭证。");try{await this.storage.set(n.url,g.token)}catch{throw await this.transport(n.api("/api/pairing/logout"),{method:"POST",headers:{authorization:`Bearer ${g.token}`},credentials:"omit",redirect:"error",signal:AbortSignal.timeout(5e3)}).catch(()=>{}),new Error("无法安全保存设备凭证,请在电脑上重新生成二维码后重试。")}return this.session={origin:n.url,token:g.token},n}async checkAuthorization(){const t=this.session;if(!t)return;const n=await this.fetch(`${t.origin}/api/web-auth/status`,{signal:AbortSignal.timeout(5e3)});if(!n.ok)return;const o=await n.json();if(this.session===t&&(o.locked||o.authenticated===!1)){this.session=null;try{await this.storage.remove(t.origin)}finally{this.onRevoked()}}}}function Kv(e,t,n,o){const c=new URL(t);return(f,g)=>{const x=typeof f=="string"?f:f instanceof URL?f.href:f.url,w=new URL(x,c),m=w.protocol===c.protocol&&w.host===c.host;if(w.pathname.startsWith("/api/")&&(m||w.origin===e)){const b=new URL(w.pathname+w.search,e);return n.fetch(f instanceof Request?new Request(b,f):b,g)}return o(f,g)}}function n_(e,t){const n=new URL(e,"https://agentroam.local");if(n.pathname!=="/app/")throw new Error("Invalid workspace frame path");const o=new URL(t);return o.search=n.search,o.searchParams.set("workspace","1"),o.hash="",o.href}function Q1(e){mR(xR(e.url,void 0,jv())),new Lv().save(e)}async function i_(e,t,n,o){e.render(L.jsx(F0,{})),window.__agentroamNativeFrame={origin:t.url,fetch:n.fetch},globalThis.fetch=Kv(t.url,location.href,n,o);const c=async g=>{const x=await n.pair(g);Q1(x),location.reload()};fR({origin:t.url,frameUrl:g=>n_(g,location.href),pair:c,scan:async()=>{const g=await Xv();g&&await c(g)},switchComputer:async g=>{const x=an.parse(g);if(!x)throw new Error("电脑地址无效,请重新扫码。");const w=new Yv(new Gv,o,()=>{});await w.resume(x);const m=await w.fetch(x.api("/api/web-auth/status"),{signal:AbortSignal.timeout(5e3)}),b=m.ok?await m.json():null;if(!(b!=null&&b.authenticated)||b.locked)throw new Error("这台电脑需要重新授权,请点击扫码添加电脑。");Q1(x),location.reload()}});const{default:f}=await Fn(async()=>{const{default:g}=await import("./page-BtLq1udo.js").then(x=>x.p);return{default:g}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url);e.render(L.jsx(ue.StrictMode,{children:L.jsx(f,{})}))}function s_(){if(window.parent===window||new URLSearchParams(location.search).get("workspace")!=="1")return null;try{const e=new URL(window.parent.location.href);return e.protocol!==location.protocol||e.host!==location.host?null:window.parent.__agentroamNativeFrame??null}catch{return null}}function o_(e){return async(t,n)=>{const o=new Request(t,n);return e.fetch(o.url,{method:o.method,headers:Object.fromEntries(o.headers),body:o.method==="GET"||o.method==="HEAD"?void 0:await o.arrayBuffer(),signal:o.signal,cache:o.cache})}}var hc;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(hc||(hc={}));var h2;(function(e){e.None="NONE",e.Slide="SLIDE",e.Fade="FADE"})(h2||(h2={}));const kf=ha("StatusBar");function a_(e){const t=/^#([a-f\d]{6})$/i.exec(e.trim());if(!t)return null;const n=[0,2,4].map(c=>{const f=parseInt(t[1].slice(c,c+2),16)/255;return f<=.04045?f/12.92:((f+.055)/1.055)**2.4}),o=.2126*n[0]+.7152*n[1]+.0722*n[2];return{color:`#${t[1]}`,style:o>.179?hc.Light:hc.Dark}}function l_(){if(Ns.getPlatform()!=="android")return()=>{};const e=document.documentElement;e.dataset.skin=Ci.getState().skin;let t=!1,n=kf.setOverlaysWebView({overlay:!1}).catch(()=>{});const o=()=>{const g=a_(getComputedStyle(e).getPropertyValue("--bg-deepest"));g&&(n=n.then(async()=>{t||(await kf.setBackgroundColor({color:g.color}),await kf.setStyle({style:g.style}))}).catch(()=>{console.warn("Unable to update the Android status bar.")}))},c=new MutationObserver(o);c.observe(e,{attributes:!0,attributeFilter:["data-skin"]});const f=()=>{document.hidden||o()};return document.addEventListener("visibilitychange",f),window.addEventListener("focus",o),o(),()=>{t=!0,c.disconnect(),document.removeEventListener("visibilitychange",f),window.removeEventListener("focus",o)}}const c_="/service-worker.js";function u_(){return typeof window<"u"&&window.isSecureContext===!0&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window}function f_(e){const t="=".repeat((4-e.length%4)%4),n=`${e}${t}`.replace(/-/g,"+").replace(/_/g,"/"),o=atob(n),c=new Uint8Array(new ArrayBuffer(o.length));for(let f=0;f<o.length;f+=1)c[f]=o.charCodeAt(f);return c}async function g2(e){const{publicKey:t}=await e.get("/api/push/vapid");if(!t)return;const n=await navigator.serviceWorker.register(c_),c=await n.pushManager.getSubscription()??await n.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:f_(t)});await e.post("/api/push/subscribe",c.toJSON())}function d_(e){u_()&&(async()=>{try{if(Notification.permission==="granted"){await g2(e);return}if(Notification.permission!=="default")return;const t=()=>{(async()=>{try{await Notification.requestPermission()==="granted"&&await g2(e)}catch{}})()};document.addEventListener("pointerdown",t,{once:!0})}catch{}})()}class Df extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}}const p2=10,h_=13,gi=32;function Mf(e){}function g_(e){if(typeof e=="function")throw new TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");const{onEvent:t=Mf,onError:n=Mf,onRetry:o=Mf,onComment:c,maxBufferSize:f}=e,g=[];let x=0,w=!0,m,b="",y=0,A,T=!1;function k(j){if(T)throw new Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(w&&(w=!1,j.charCodeAt(0)===239&&j.charCodeAt(1)===187&&j.charCodeAt(2)===191&&(j=j.slice(3))),g.length===0){const Y=G(j);Y!==""&&(g.push(Y),x=Y.length),D();return}if(j.indexOf(`
480
+ `);let s=oh.singletonList(qr.INITIAL_STATE);for(let l=0;l<this.text.length;l++){let u,d=l+1<this.text.length?this.text[l+1]:0;switch(this.text[l]){case ie.getCharCode("\r"):u=d===i?2:0;break;case ie.getCharCode("."):u=d===r?3:0;break;case ie.getCharCode(","):u=d===r?4:0;break;case ie.getCharCode(":"):u=d===r?5:0;break;default:u=0}u>0?(s=Ys.updateStateListForPair(s,l,u),l++):s=this.updateStateListForChar(s,l)}return oh.min(s,(l,u)=>l.getBitCount()-u.getBitCount()).toBitArray(this.text)}updateStateListForChar(r,i){const s=[];for(let a of r)this.updateStateForChar(a,i,s);return Ys.simplifyStates(s)}updateStateForChar(r,i,s){let a=this.text[i]&255,l=wu[r.getMode()][a]>0,u=null;for(let d=0;d<=Qr;d++){let h=wu[d][a];if(h>0){if(u==null&&(u=r.endBinaryShift(i)),!l||d===r.getMode()||d===Sr){const p=u.latchAndAppend(d,h);s.push(p)}if(!l&&lh[r.getMode()][d]>=0){const p=u.shiftAndAppend(d,h);s.push(p)}}}if(r.getBinaryShiftByteCount()>0||wu[r.getMode()][a]===0){let d=r.addBinaryShiftChar(i);s.push(d)}}static updateStateListForPair(r,i,s){const a=[];for(let l of r)this.updateStateForPair(l,i,s,a);return this.simplifyStates(a)}static updateStateForPair(r,i,s,a){let l=r.endBinaryShift(i);if(a.push(l.latchAndAppend(Qr,s)),r.getMode()!==Qr&&a.push(l.shiftAndAppend(Qr,s)),s===3||s===4){let u=l.latchAndAppend(Sr,16-s).latchAndAppend(Sr,1);a.push(u)}if(r.getBinaryShiftByteCount()>0){let u=r.addBinaryShiftChar(i).addBinaryShiftChar(i+1);a.push(u)}}static simplifyStates(r){let i=[];for(const s of r){let a=!0;for(const l of i){if(l.isBetterThanOrEqualTo(s)){a=!1;break}s.isBetterThanOrEqualTo(l)&&(i=i.filter(u=>u!==l))}a&&i.push(s)}return i}}class _e{constructor(){}static encodeBytes(r){return _e.encode(r,_e.DEFAULT_EC_PERCENT,_e.DEFAULT_AZTEC_LAYERS)}static encode(r,i,s){let a=new Ys(r).encode(),l=O.truncDivision(a.getSize()*i,100)+11,u=a.getSize()+l,d,h,p,v,C;if(s!==_e.DEFAULT_AZTEC_LAYERS){if(d=s<0,h=Math.abs(s),h>(d?_e.MAX_NB_BITS_COMPACT:_e.MAX_NB_BITS))throw new y(ie.format("Illegal value %s for layers",s));p=_e.totalBitsInLayer(h,d),v=_e.WORD_SIZE[h];let Z=p-p%v;if(C=_e.stuffBits(a,v),C.getSize()+l>Z)throw new y("Data to large for user specified layer");if(d&&C.getSize()>v*64)throw new y("Data to large for user specified layer")}else{v=0,C=null;for(let Z=0;;Z++){if(Z>_e.MAX_NB_BITS)throw new y("Data too large for an Aztec code");if(d=Z<=3,h=d?Z+1:Z,p=_e.totalBitsInLayer(h,d),u>p)continue;(C==null||v!==_e.WORD_SIZE[h])&&(v=_e.WORD_SIZE[h],C=_e.stuffBits(a,v));let Ae=p-p%v;if(!(d&&C.getSize()>v*64)&&C.getSize()+l<=Ae)break}}let S=_e.generateCheckWords(C,p,v),_=C.getSize()/v,M=_e.generateModeMessage(d,h,_),P=(d?11:14)+h*4,W=new Int32Array(P),H;if(d){H=P;for(let Z=0;Z<W.length;Z++)W[Z]=Z}else{H=P+1+2*O.truncDivision(O.truncDivision(P,2)-1,15);let Z=O.truncDivision(P,2),Ae=O.truncDivision(H,2);for(let we=0;we<Z;we++){let tr=we+O.truncDivision(we,15);W[Z-we-1]=Ae-tr-1,W[Z+we]=Ae+tr+1}}let q=new Te(H);for(let Z=0,Ae=0;Z<h;Z++){let we=(h-Z)*4+(d?9:12);for(let tr=0;tr<we;tr++){let Mr=tr*2;for(let rr=0;rr<2;rr++)S.get(Ae+Mr+rr)&&q.set(W[Z*2+rr],W[Z*2+tr]),S.get(Ae+we*2+Mr+rr)&&q.set(W[Z*2+tr],W[P-1-Z*2-rr]),S.get(Ae+we*4+Mr+rr)&&q.set(W[P-1-Z*2-rr],W[P-1-Z*2-tr]),S.get(Ae+we*6+Mr+rr)&&q.set(W[P-1-Z*2-tr],W[Z*2+rr])}Ae+=we*8}if(_e.drawModeMessage(q,d,H,M),d)_e.drawBullsEye(q,O.truncDivision(H,2),5);else{_e.drawBullsEye(q,O.truncDivision(H,2),7);for(let Z=0,Ae=0;Z<O.truncDivision(P,2)-1;Z+=15,Ae+=16)for(let we=O.truncDivision(H,2)&1;we<H;we+=2)q.set(O.truncDivision(H,2)-Ae,we),q.set(O.truncDivision(H,2)+Ae,we),q.set(we,O.truncDivision(H,2)-Ae),q.set(we,O.truncDivision(H,2)+Ae)}let J=new sh;return J.setCompact(d),J.setSize(H),J.setLayers(h),J.setCodeWords(_),J.setMatrix(q),J}static drawBullsEye(r,i,s){for(let a=0;a<s;a+=2)for(let l=i-a;l<=i+a;l++)r.set(l,i-a),r.set(l,i+a),r.set(i-a,l),r.set(i+a,l);r.set(i-s,i-s),r.set(i-s+1,i-s),r.set(i-s,i-s+1),r.set(i+s,i-s),r.set(i+s,i-s+1),r.set(i+s,i+s-1)}static generateModeMessage(r,i,s){let a=new B;return r?(a.appendBits(i-1,2),a.appendBits(s-1,6),a=_e.generateCheckWords(a,28,4)):(a.appendBits(i-1,5),a.appendBits(s-1,11),a=_e.generateCheckWords(a,40,4)),a}static drawModeMessage(r,i,s,a){let l=O.truncDivision(s,2);if(i)for(let u=0;u<7;u++){let d=l-3+u;a.get(u)&&r.set(d,l-5),a.get(u+7)&&r.set(l+5,d),a.get(20-u)&&r.set(d,l+5),a.get(27-u)&&r.set(l-5,d)}else for(let u=0;u<10;u++){let d=l-5+u+O.truncDivision(u,5);a.get(u)&&r.set(d,l-7),a.get(u+10)&&r.set(l+7,d),a.get(29-u)&&r.set(d,l+7),a.get(39-u)&&r.set(l-7,d)}}static generateCheckWords(r,i,s){let a=r.getSize()/s,l=new hu(_e.getGF(s)),u=O.truncDivision(i,s),d=_e.bitsToWords(r,s,u);l.encode(d,u-a);let h=i%s,p=new B;p.appendBits(0,h);for(const v of Array.from(d))p.appendBits(v,s);return p}static bitsToWords(r,i,s){let a=new Int32Array(s),l,u;for(l=0,u=r.getSize()/i;l<u;l++){let d=0;for(let h=0;h<i;h++)d|=r.get(l*i+h)?1<<i-h-1:0;a[l]=d}return a}static getGF(r){switch(r){case 4:return Ne.AZTEC_PARAM;case 6:return Ne.AZTEC_DATA_6;case 8:return Ne.AZTEC_DATA_8;case 10:return Ne.AZTEC_DATA_10;case 12:return Ne.AZTEC_DATA_12;default:throw new y("Unsupported word size "+r)}}static stuffBits(r,i){let s=new B,a=r.getSize(),l=(1<<i)-2;for(let u=0;u<a;u+=i){let d=0;for(let h=0;h<i;h++)(u+h>=a||r.get(u+h))&&(d|=1<<i-1-h);(d&l)===l?(s.appendBits(d&l,i),u--):d&l?s.appendBits(d,i):(s.appendBits(d|1,i),u--)}return s}static totalBitsInLayer(r,i){return((i?88:112)+16*r)*r}}_e.DEFAULT_EC_PERCENT=33,_e.DEFAULT_AZTEC_LAYERS=0,_e.MAX_NB_BITS=32,_e.MAX_NB_BITS_COMPACT=4,_e.WORD_SIZE=Int32Array.from([4,6,6,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12]);class Ia{encode(r,i,s,a){return this.encodeWithHints(r,i,s,a,null)}encodeWithHints(r,i,s,a,l){let u=pu.ISO_8859_1,d=_e.DEFAULT_EC_PERCENT,h=_e.DEFAULT_AZTEC_LAYERS;return l!=null&&(l.has(wt.CHARACTER_SET)&&(u=ih.forName(l.get(wt.CHARACTER_SET).toString())),l.has(wt.ERROR_CORRECTION)&&(d=O.parseInt(l.get(wt.ERROR_CORRECTION).toString())),l.has(wt.AZTEC_LAYERS)&&(h=O.parseInt(l.get(wt.AZTEC_LAYERS).toString()))),Ia.encodeLayers(r,i,s,a,u,d,h)}static encodeLayers(r,i,s,a,l,u,d){if(i!==le.AZTEC)throw new y("Can only encode AZTEC, but got "+i);let h=_e.encode(ie.getBytes(r,l),u,d);return Ia.renderResult(h,s,a)}static renderResult(r,i,s){let a=r.getMatrix();if(a==null)throw new Gr;let l=a.getWidth(),u=a.getHeight(),d=Math.max(i,l),h=Math.max(s,u),p=Math.min(d/l,h/u),v=(d-l*p)/2,C=(h-u*p)/2,S=new Te(d,h);for(let _=0,M=C;_<u;_++,M+=p)for(let P=0,W=v;P<l;P++,W+=p)a.get(P,_)&&S.setRegion(W,M,p,p);return S}}n.AbstractExpandedDecoder=nu,n.ArgumentException=b,n.ArithmeticException=ga,n.AztecCode=sh,n.AztecCodeReader=xa,n.AztecCodeWriter=Ia,n.AztecDecoder=je,n.AztecDetector=H0,n.AztecDetectorResult=$0,n.AztecEncoder=_e,n.AztecHighLevelEncoder=Ys,n.AztecPoint=Vt,n.BarcodeFormat=le,n.Binarizer=k,n.BinaryBitmap=A,n.BitArray=B,n.BitMatrix=Te,n.BitSource=au,n.BrowserAztecCodeReader=qv,n.BrowserBarcodeReader=n3,n.BrowserCodeReader=Er,n.BrowserDatamatrixCodeReader=s3,n.BrowserMultiFormatReader=m3,n.BrowserPDF417Reader=x3,n.BrowserQRCodeReader=w3,n.BrowserQRCodeSvgWriter=di,n.CharacterSetECI=$,n.ChecksumException=T,n.Code128Reader=ee,n.Code39Reader=mt,n.DataMatrixDecodedBitStreamParser=On,n.DataMatrixReader=Nn,n.DecodeHintType=U,n.DecoderResult=Bs,n.DefaultGridSampler=V0,n.DetectorResult=ma,n.EAN13Reader=ai,n.EncodeHintType=wt,n.Exception=m,n.FormatException=F,n.GenericGF=Ne,n.GenericGFPoly=Qt,n.GlobalHistogramBinarizer=rt,n.GridSampler=Jc,n.GridSamplerInstance=Rn,n.HTMLCanvasElementLuminanceSource=me,n.HybridBinarizer=xe,n.ITFReader=Be,n.IllegalArgumentException=y,n.IllegalStateException=Gr,n.InvertedLuminanceSource=he,n.LuminanceSource=te,n.MathUtils=Re,n.MultiFormatOneDReader=ji,n.MultiFormatReader=nh,n.MultiFormatWriter=y3,n.NotFoundException=X,n.OneDReader=ht,n.PDF417DecodedBitStreamParser=V,n.PDF417DecoderErrorCorrection=Q0,n.PDF417Reader=Nt,n.PDF417ResultMetadata=J0,n.PerspectiveTransform=kr,n.PlanarYUVLuminanceSource=Zr,n.QRCodeByteMatrix=Aa,n.QRCodeDataMask=br,n.QRCodeDecodedBitStreamParser=Qe,n.QRCodeDecoderErrorCorrectionLevel=We,n.QRCodeDecoderFormatInformation=Ut,n.QRCodeEncoder=$e,n.QRCodeEncoderQRCode=fi,n.QRCodeMaskUtil=st,n.QRCodeMatrixUtil=de,n.QRCodeMode=fe,n.QRCodeReader=kn,n.QRCodeVersion=ce,n.QRCodeWriter=zi,n.RGBLuminanceSource=gu,n.RSS14Reader=it,n.RSSExpandedReader=K,n.ReaderException=ba,n.ReedSolomonDecoder=Us,n.ReedSolomonEncoder=hu,n.ReedSolomonException=Li,n.Result=Ze,n.ResultMetadataType=bt,n.ResultPoint=ae,n.StringUtils=ie,n.UnsupportedOperationException=oe,n.VideoInputDevice=Ge,n.WhiteRectangleDetector=cn,n.WriterException=Fe,n.ZXingArrays=I,n.ZXingCharset=ih,n.ZXingInteger=O,n.ZXingStandardCharsets=pu,n.ZXingStringBuilder=pe,n.ZXingStringEncoding=ve,n.ZXingSystem=D,n.createAbstractExpandedDecoder=K0,Object.defineProperty(n,"__esModule",{value:!0})})})(X1,X1.exports);var qe=X1.exports;const kR=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var s2=function(){function e(t,n,o){if(this.formatMap=new Map([[re.QR_CODE,qe.BarcodeFormat.QR_CODE],[re.AZTEC,qe.BarcodeFormat.AZTEC],[re.CODABAR,qe.BarcodeFormat.CODABAR],[re.CODE_39,qe.BarcodeFormat.CODE_39],[re.CODE_93,qe.BarcodeFormat.CODE_93],[re.CODE_128,qe.BarcodeFormat.CODE_128],[re.DATA_MATRIX,qe.BarcodeFormat.DATA_MATRIX],[re.MAXICODE,qe.BarcodeFormat.MAXICODE],[re.ITF,qe.BarcodeFormat.ITF],[re.EAN_13,qe.BarcodeFormat.EAN_13],[re.EAN_8,qe.BarcodeFormat.EAN_8],[re.PDF_417,qe.BarcodeFormat.PDF_417],[re.RSS_14,qe.BarcodeFormat.RSS_14],[re.RSS_EXPANDED,qe.BarcodeFormat.RSS_EXPANDED],[re.UPC_A,qe.BarcodeFormat.UPC_A],[re.UPC_E,qe.BarcodeFormat.UPC_E],[re.UPC_EAN_EXTENSION,qe.BarcodeFormat.UPC_EAN_EXTENSION]]),this.reverseFormatMap=this.createReverseFormatMap(),!kR)throw"Use html5qrcode.min.js without edit, ZXing not found.";this.verbose=n,this.logger=o;var c=this.createZXingFormats(t),f=new Map;f.set(qe.DecodeHintType.POSSIBLE_FORMATS,c),f.set(qe.DecodeHintType.TRY_HARDER,!1),this.hints=f}return e.prototype.decodeAsync=function(t){var n=this;return new Promise(function(o,c){try{o(n.decode(t))}catch(f){c(f)}})},e.prototype.decode=function(t){var n=new qe.MultiFormatReader(this.verbose,this.hints),o=new qe.HTMLCanvasElementLuminanceSource(t),c=new qe.BinaryBitmap(new qe.HybridBinarizer(o)),f=n.decode(c);return{text:f.text,format:$v.create(this.toHtml5QrcodeSupportedFormats(f.format)),debugData:this.createDebugData()}},e.prototype.createReverseFormatMap=function(){var t=new Map;return this.formatMap.forEach(function(n,o,c){t.set(n,o)}),t},e.prototype.toHtml5QrcodeSupportedFormats=function(t){if(!this.reverseFormatMap.has(t))throw"reverseFormatMap doesn't have ".concat(t);return this.reverseFormatMap.get(t)},e.prototype.createZXingFormats=function(t){for(var n=[],o=0,c=t;o<c.length;o++){var f=c[o];this.formatMap.has(f)?n.push(this.formatMap.get(f)):this.logger.logError("".concat(f," is not supported by")+"ZXingHtml5QrcodeShim")}return n},e.prototype.createDebugData=function(){return{decoderName:"zxing-js"}},e}(),DR=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function x(b){try{m(o.next(b))}catch(y){g(y)}}function w(b){try{m(o.throw(b))}catch(y){g(y)}}function m(b){b.done?f(b.value):c(b.value).then(x,w)}m((o=o.apply(e,t||[])).next())})},MR=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function x(m){return function(b){return w([m,b])}}function w(m){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,m[0]&&(n=0)),n;)try{if(o=1,c&&(f=m[0]&2?c.return:m[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,m[1])).done)return f;switch(c=0,f&&(m=[m[0]&2,f.value]),m[0]){case 0:case 1:f=m;break;case 4:return n.label++,{value:m[1],done:!1};case 5:n.label++,c=m[1],m=[0];continue;case 7:m=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(m[0]===6||m[0]===2)){n=0;continue}if(m[0]===3&&(!f||m[1]>f[0]&&m[1]<f[3])){n.label=m[1];break}if(m[0]===6&&n.label<f[1]){n.label=f[1],f=m;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(m);break}f[2]&&n.ops.pop(),n.trys.pop();continue}m=t.call(e,n)}catch(b){m=[6,b],c=0}finally{o=f=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},o2=function(){function e(t,n,o){if(this.formatMap=new Map([[re.QR_CODE,"qr_code"],[re.AZTEC,"aztec"],[re.CODABAR,"codabar"],[re.CODE_39,"code_39"],[re.CODE_93,"code_93"],[re.CODE_128,"code_128"],[re.DATA_MATRIX,"data_matrix"],[re.ITF,"itf"],[re.EAN_13,"ean_13"],[re.EAN_8,"ean_8"],[re.PDF_417,"pdf417"],[re.UPC_A,"upc_a"],[re.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=o;var c=this.createBarcodeDetectorFormats(t);if(this.detector=new BarcodeDetector(c),!this.detector)throw"BarcodeDetector detector not supported"}return e.isSupported=function(){if(!("BarcodeDetector"in window))return!1;var t=new BarcodeDetector({formats:["qr_code"]});return typeof t<"u"},e.prototype.decodeAsync=function(t){return DR(this,void 0,void 0,function(){var n,o;return MR(this,function(c){switch(c.label){case 0:return[4,this.detector.detect(t)];case 1:if(n=c.sent(),!n||n.length===0)throw"No barcode or QR code detected.";return o=this.selectLargestBarcode(n),[2,{text:o.rawValue,format:$v.create(this.toHtml5QrcodeSupportedFormats(o.format)),debugData:this.createDebugData()}]}})})},e.prototype.selectLargestBarcode=function(t){for(var n=null,o=0,c=0,f=t;c<f.length;c++){var g=f[c],x=g.boundingBox.width*g.boundingBox.height;x>o&&(o=x,n=g)}if(!n)throw"No largest barcode found";return n},e.prototype.createBarcodeDetectorFormats=function(t){for(var n=[],o=0,c=t;o<c.length;o++){var f=c[o];this.formatMap.has(f)?n.push(this.formatMap.get(f)):this.logger.warn("".concat(f," is not supported by")+"BarcodeDetectorDelegate")}return{formats:n}},e.prototype.toHtml5QrcodeSupportedFormats=function(t){if(!this.reverseFormatMap.has(t))throw"reverseFormatMap doesn't have ".concat(t);return this.reverseFormatMap.get(t)},e.prototype.createReverseFormatMap=function(){var t=new Map;return this.formatMap.forEach(function(n,o,c){t.set(n,o)}),t},e.prototype.createDebugData=function(){return{decoderName:"BarcodeDetector"}},e}(),a2=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function x(b){try{m(o.next(b))}catch(y){g(y)}}function w(b){try{m(o.throw(b))}catch(y){g(y)}}function m(b){b.done?f(b.value):c(b.value).then(x,w)}m((o=o.apply(e,t||[])).next())})},l2=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function x(m){return function(b){return w([m,b])}}function w(m){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,m[0]&&(n=0)),n;)try{if(o=1,c&&(f=m[0]&2?c.return:m[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,m[1])).done)return f;switch(c=0,f&&(m=[m[0]&2,f.value]),m[0]){case 0:case 1:f=m;break;case 4:return n.label++,{value:m[1],done:!1};case 5:n.label++,c=m[1],m=[0];continue;case 7:m=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(m[0]===6||m[0]===2)){n=0;continue}if(m[0]===3&&(!f||m[1]>f[0]&&m[1]<f[3])){n.label=m[1];break}if(m[0]===6&&n.label<f[1]){n.label=f[1],f=m;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(m);break}f[2]&&n.ops.pop(),n.trys.pop();continue}m=t.call(e,n)}catch(b){m=[6,b],c=0}finally{o=f=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},PR=function(){function e(t,n,o,c){this.EXECUTIONS_TO_REPORT_PERFORMANCE=100,this.executions=0,this.executionResults=[],this.wasPrimaryDecoderUsedInLastDecode=!1,this.verbose=o,n&&o2.isSupported()?(this.primaryDecoder=new o2(t,o,c),this.secondaryDecoder=new s2(t,o,c)):this.primaryDecoder=new s2(t,o,c)}return e.prototype.decodeAsync=function(t){return a2(this,void 0,void 0,function(){var n;return l2(this,function(o){switch(o.label){case 0:n=performance.now(),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,this.getDecoder().decodeAsync(t)];case 2:return[2,o.sent()];case 3:return this.possiblyLogPerformance(n),[7];case 4:return[2]}})})},e.prototype.decodeRobustlyAsync=function(t){return a2(this,void 0,void 0,function(){var n,o;return l2(this,function(c){switch(c.label){case 0:n=performance.now(),c.label=1;case 1:return c.trys.push([1,3,4,5]),[4,this.primaryDecoder.decodeAsync(t)];case 2:return[2,c.sent()];case 3:if(o=c.sent(),this.secondaryDecoder)return[2,this.secondaryDecoder.decodeAsync(t)];throw o;case 4:return this.possiblyLogPerformance(n),[7];case 5:return[2]}})})},e.prototype.getDecoder=function(){return this.secondaryDecoder?this.wasPrimaryDecoderUsedInLastDecode===!1?(this.wasPrimaryDecoderUsedInLastDecode=!0,this.primaryDecoder):(this.wasPrimaryDecoderUsedInLastDecode=!1,this.secondaryDecoder):this.primaryDecoder},e.prototype.possiblyLogPerformance=function(t){if(this.verbose){var n=performance.now()-t;this.executionResults.push(n),this.executions++,this.possiblyFlushPerformanceReport()}},e.prototype.possiblyFlushPerformanceReport=function(){if(!(this.executions<this.EXECUTIONS_TO_REPORT_PERFORMANCE)){for(var t=0,n=0,o=this.executionResults;n<o.length;n++){var c=o[n];t+=c}var f=t/this.executionResults.length;console.log("".concat(f," ms for ").concat(this.executionResults.length," last runs.")),this.executions=0,this.executionResults=[]}},e}(),W0=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,c){o.__proto__=c}||function(o,c){for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(o[f]=c[f])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),fc=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function x(b){try{m(o.next(b))}catch(y){g(y)}}function w(b){try{m(o.throw(b))}catch(y){g(y)}}function m(b){b.done?f(b.value):c(b.value).then(x,w)}m((o=o.apply(e,t||[])).next())})},dc=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function x(m){return function(b){return w([m,b])}}function w(m){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,m[0]&&(n=0)),n;)try{if(o=1,c&&(f=m[0]&2?c.return:m[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,m[1])).done)return f;switch(c=0,f&&(m=[m[0]&2,f.value]),m[0]){case 0:case 1:f=m;break;case 4:return n.label++,{value:m[1],done:!1};case 5:n.label++,c=m[1],m=[0];continue;case 7:m=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(m[0]===6||m[0]===2)){n=0;continue}if(m[0]===3&&(!f||m[1]>f[0]&&m[1]<f[3])){n.label=m[1];break}if(m[0]===6&&n.label<f[1]){n.label=f[1],f=m;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(m);break}f[2]&&n.ops.pop(),n.trys.pop();continue}m=t.call(e,n)}catch(b){m=[6,b],c=0}finally{o=f=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},Hv=function(){function e(t,n){this.name=t,this.track=n}return e.prototype.isSupported=function(){return this.track.getCapabilities?this.name in this.track.getCapabilities():!1},e.prototype.apply=function(t){var n={};n[this.name]=t;var o={advanced:[n]};return this.track.applyConstraints(o)},e.prototype.value=function(){var t=this.track.getSettings();if(this.name in t){var n=t[this.name];return n}return null},e}(),LR=function(e){W0(t,e);function t(n,o){return e.call(this,n,o)||this}return 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(n){var o={};o[this.name]=n;var c={advanced:[o]};return this.track.applyConstraints(c)},t.prototype.getCapabilities=function(){this.failIfNotSupported();var n=this.track.getCapabilities(),o=n[this.name];return{min:o.min,max:o.max,step:o.step}},t.prototype.failIfNotSupported=function(){if(!this.isSupported())throw new Error("".concat(this.name," capability not supported"))},t}(Hv),BR=function(e){W0(t,e);function t(n){return e.call(this,"zoom",n)||this}return t}(LR),FR=function(e){W0(t,e);function t(n){return e.call(this,"torch",n)||this}return t}(Hv),UR=function(){function e(t){this.track=t}return e.prototype.zoomFeature=function(){return new BR(this.track)},e.prototype.torchFeature=function(){return new FR(this.track)},e}(),jR=function(){function e(t,n,o){this.isClosed=!1,this.parentElement=t,this.mediaStream=n,this.callbacks=o,this.surface=this.createVideoElement(this.parentElement.clientWidth),t.append(this.surface)}return e.prototype.createVideoElement=function(t){var n=document.createElement("video");return n.style.width="".concat(t,"px"),n.style.display="block",n.muted=!0,n.setAttribute("muted","true"),n.playsInline=!0,n},e.prototype.setupSurface=function(){var t=this;this.surface.onabort=function(){throw"RenderedCameraImpl video surface onabort() called"},this.surface.onerror=function(){throw"RenderedCameraImpl video surface onerror() called"};var n=function(){var o=t.surface.clientWidth,c=t.surface.clientHeight;t.callbacks.onRenderSurfaceReady(o,c),t.surface.removeEventListener("playing",n)};this.surface.addEventListener("playing",n),this.surface.srcObject=this.mediaStream,this.surface.play()},e.create=function(t,n,o,c){return fc(this,void 0,void 0,function(){var f,g;return dc(this,function(x){switch(x.label){case 0:return f=new e(t,n,c),o.aspectRatio?(g={aspectRatio:o.aspectRatio},[4,f.getFirstTrackOrFail().applyConstraints(g)]):[3,2];case 1:x.sent(),x.label=2;case 2:return f.setupSurface(),[2,f]}})})},e.prototype.failIfClosed=function(){if(this.isClosed)throw"The RenderedCamera has already been closed."},e.prototype.getFirstTrackOrFail=function(){if(this.failIfClosed(),this.mediaStream.getVideoTracks().length===0)throw"No video tracks found";return this.mediaStream.getVideoTracks()[0]},e.prototype.pause=function(){this.failIfClosed(),this.surface.pause()},e.prototype.resume=function(t){this.failIfClosed();var n=this,o=function(){setTimeout(t,200),n.surface.removeEventListener("playing",o)};this.surface.addEventListener("playing",o),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(t){return fc(this,void 0,void 0,function(){return dc(this,function(n){if("aspectRatio"in t)throw"Changing 'aspectRatio' in run-time is not yet supported.";return[2,this.getFirstTrackOrFail().applyConstraints(t)]})})},e.prototype.close=function(){if(this.isClosed)return Promise.resolve();var t=this;return new Promise(function(n,o){var c=t.mediaStream.getVideoTracks(),f=c.length,g=0;t.mediaStream.getVideoTracks().forEach(function(x){t.mediaStream.removeTrack(x),x.stop(),++g,g>=f&&(t.isClosed=!0,t.parentElement.removeChild(t.surface),n())})})},e.prototype.getCapabilities=function(){return new UR(this.getFirstTrackOrFail())},e}(),WR=function(){function e(t){this.mediaStream=t}return e.prototype.render=function(t,n,o){return fc(this,void 0,void 0,function(){return dc(this,function(c){return[2,jR.create(t,this.mediaStream,n,o)]})})},e.create=function(t){return fc(this,void 0,void 0,function(){var n,o;return dc(this,function(c){switch(c.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 o=c.sent(),[2,new e(o)]}})})},e}(),c2=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function x(b){try{m(o.next(b))}catch(y){g(y)}}function w(b){try{m(o.throw(b))}catch(y){g(y)}}function m(b){b.done?f(b.value):c(b.value).then(x,w)}m((o=o.apply(e,t||[])).next())})},u2=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function x(m){return function(b){return w([m,b])}}function w(m){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,m[0]&&(n=0)),n;)try{if(o=1,c&&(f=m[0]&2?c.return:m[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,m[1])).done)return f;switch(c=0,f&&(m=[m[0]&2,f.value]),m[0]){case 0:case 1:f=m;break;case 4:return n.label++,{value:m[1],done:!1};case 5:n.label++,c=m[1],m=[0];continue;case 7:m=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(m[0]===6||m[0]===2)){n=0;continue}if(m[0]===3&&(!f||m[1]>f[0]&&m[1]<f[3])){n.label=m[1];break}if(m[0]===6&&n.label<f[1]){n.label=f[1],f=m;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(m);break}f[2]&&n.ops.pop(),n.trys.pop();continue}m=t.call(e,n)}catch(b){m=[6,b],c=0}finally{o=f=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},zR=function(){function e(){}return e.failIfNotSupported=function(){return c2(this,void 0,void 0,function(){return u2(this,function(t){if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return[2,new e]})})},e.prototype.create=function(t){return c2(this,void 0,void 0,function(){return u2(this,function(n){return[2,WR.create(t)]})})},e}(),$R=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function x(b){try{m(o.next(b))}catch(y){g(y)}}function w(b){try{m(o.throw(b))}catch(y){g(y)}}function m(b){b.done?f(b.value):c(b.value).then(x,w)}m((o=o.apply(e,t||[])).next())})},VR=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function x(m){return function(b){return w([m,b])}}function w(m){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,m[0]&&(n=0)),n;)try{if(o=1,c&&(f=m[0]&2?c.return:m[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,m[1])).done)return f;switch(c=0,f&&(m=[m[0]&2,f.value]),m[0]){case 0:case 1:f=m;break;case 4:return n.label++,{value:m[1],done:!1};case 5:n.label++,c=m[1],m=[0];continue;case 7:m=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(m[0]===6||m[0]===2)){n=0;continue}if(m[0]===3&&(!f||m[1]>f[0]&&m[1]<f[3])){n.label=m[1];break}if(m[0]===6&&n.label<f[1]){n.label=f[1],f=m;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(m);break}f[2]&&n.ops.pop(),n.trys.pop();continue}m=t.call(e,n)}catch(b){m=[6,b],c=0}finally{o=f=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},HR=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=us.unableToQuerySupportedDevices();return e.isHttpsOrLocalhost()||(t=us.insecureContextCameraQueryError()),Promise.reject(t)},e.isHttpsOrLocalhost=function(){if(location.protocol==="https:")return!0;var t=location.host.split(":")[0];return t==="127.0.0.1"||t==="localhost"},e.getCamerasFromMediaDevices=function(){return $R(this,void 0,void 0,function(){var t,n,o,c,f,g,x;return VR(this,function(w){switch(w.label){case 0:return t=function(m){for(var b=m.getVideoTracks(),y=0,A=b;y<A.length;y++){var T=A[y];T.enabled=!1,T.stop(),m.removeTrack(T)}},[4,navigator.mediaDevices.getUserMedia({audio:!1,video:!0})];case 1:return n=w.sent(),[4,navigator.mediaDevices.enumerateDevices()];case 2:for(o=w.sent(),c=[],f=0,g=o;f<g.length;f++)x=g[f],x.kind==="videoinput"&&c.push({id:x.deviceId,label:x.label});return t(n),[2,c]}})})},e.getCamerasFromMediaStreamTrack=function(){return new Promise(function(t,n){var o=function(f){for(var g=[],x=0,w=f;x<w.length;x++){var m=w[x];m.kind==="video"&&g.push({id:m.id,label:m.label})}t(g)},c=MediaStreamTrack;c.getSources(o)})},e}(),ot;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.NOT_STARTED=1]="NOT_STARTED",e[e.SCANNING=2]="SCANNING",e[e.PAUSED=3]="PAUSED"})(ot||(ot={}));var GR=function(){function e(){this.state=ot.NOT_STARTED,this.onGoingTransactionNewState=ot.UNKNOWN}return e.prototype.directTransition=function(t){this.failIfTransitionOngoing(),this.validateTransition(t),this.state=t},e.prototype.startTransition=function(t){return this.failIfTransitionOngoing(),this.validateTransition(t),this.onGoingTransactionNewState=t,this},e.prototype.execute=function(){if(this.onGoingTransactionNewState===ot.UNKNOWN)throw"Transaction is already cancelled, cannot execute().";var t=this.onGoingTransactionNewState;this.onGoingTransactionNewState=ot.UNKNOWN,this.directTransition(t)},e.prototype.cancel=function(){if(this.onGoingTransactionNewState===ot.UNKNOWN)throw"Transaction is already cancelled, cannot cancel().";this.onGoingTransactionNewState=ot.UNKNOWN},e.prototype.getState=function(){return this.state},e.prototype.failIfTransitionOngoing=function(){if(this.onGoingTransactionNewState!==ot.UNKNOWN)throw"Cannot transition to a new state, already under transition"},e.prototype.validateTransition=function(t){switch(this.state){case ot.UNKNOWN:throw"Transition from unknown is not allowed";case ot.NOT_STARTED:this.failIfNewStateIs(t,[ot.PAUSED]);break;case ot.SCANNING:break;case ot.PAUSED:break}},e.prototype.failIfNewStateIs=function(t,n){for(var o=0,c=n;o<c.length;o++){var f=c[o];if(t===f)throw"Cannot transition from ".concat(this.state," to ").concat(t)}},e}(),XR=function(){function e(t){this.stateManager=t}return e.prototype.startTransition=function(t){return this.stateManager.startTransition(t)},e.prototype.directTransition=function(t){this.stateManager.directTransition(t)},e.prototype.getState=function(){return this.stateManager.getState()},e.prototype.canScanFile=function(){return this.stateManager.getState()===ot.NOT_STARTED},e.prototype.isScanning=function(){return this.stateManager.getState()!==ot.NOT_STARTED},e.prototype.isStrictlyScanning=function(){return this.stateManager.getState()===ot.SCANNING},e.prototype.isPaused=function(){return this.stateManager.getState()===ot.PAUSED},e}(),YR=function(){function e(){}return e.create=function(){return new XR(new GR)},e}(),KR=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,c){o.__proto__=c}||function(o,c){for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(o[f]=c[f])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),dr=function(e){KR(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return 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}(_R),ZR=function(){function e(t,n){this.logger=n,this.fps=dr.SCAN_DEFAULT_FPS,t?(t.fps&&(this.fps=t.fps),this.disableFlip=t.disableFlip===!0,this.qrbox=t.qrbox,this.aspectRatio=t.aspectRatio,this.videoConstraints=t.videoConstraints):this.disableFlip=dr.DEFAULT_DISABLE_FLIP}return e.prototype.isMediaStreamConstraintsValid=function(){return this.videoConstraints?Vv.isMediaStreamConstraintsValid(this.videoConstraints,this.logger):(this.logger.logError("Empty videoConstraints",!0),!1)},e.prototype.isShadedBoxEnabled=function(){return!un(this.qrbox)},e.create=function(t,n){return new e(t,n)},e}(),L_=function(){function e(t,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(t))throw"HTML Element with id=".concat(t," not found");this.elementId=t,this.verbose=!1;var o;typeof n=="boolean"?this.verbose=n===!0:n&&(o=n,this.verbose=o.verbose===!0,o.experimentalFeatures),this.logger=new NR(this.verbose),this.qrcode=new PR(this.getSupportedFormats(n),this.getUseBarCodeDetectorIfSupported(o),this.verbose,this.logger),this.foreverScanTimeout,this.shouldScan=!0,this.stateManagerProxy=YR.create()}return e.prototype.start=function(t,n,o,c){var f=this;if(!t)throw"cameraIdOrConfig is required";if(!o||typeof o!="function")throw"qrCodeSuccessCallback is required and should be a function.";var g;c?g=c:g=this.verbose?this.logger.log:function(){};var x=ZR.create(n,this.logger);this.clearElement();var w=!1;x.videoConstraints&&(x.isMediaStreamConstraintsValid()?w=!0:this.logger.logError("'videoConstraints' is not valid 'MediaStreamConstraints, it will be ignored.'",!0));var m=w,b=document.getElementById(this.elementId);b.clientWidth?b.clientWidth:dr.DEFAULT_WIDTH,b.style.position="relative",this.shouldScan=!0,this.element=b;var y=this,A=this.stateManagerProxy.startTransition(ot.SCANNING);return new Promise(function(T,k){var D=m?x.videoConstraints:y.createVideoConstraints(t);if(!D){A.cancel(),k("videoConstraints should be defined");return}var G={};(!m||x.aspectRatio)&&(G.aspectRatio=x.aspectRatio);var N={onRenderSurfaceReady:function(I,O){y.setupUi(I,O,x),y.isScanning=!0,y.foreverScan(x,o,g)}};zR.failIfNotSupported().then(function(I){I.create(D).then(function(O){return O.render(f.element,G,N).then(function(B){y.renderedCamera=B,A.execute(),T(null)}).catch(function(B){A.cancel(),k(B)})}).catch(function(O){A.cancel(),k(us.errorGettingUserMedia(O))})}).catch(function(I){A.cancel(),k(us.cameraStreamingNotSupported())})})},e.prototype.pause=function(t){if(!this.stateManagerProxy.isStrictlyScanning())throw"Cannot pause, scanner is not scanning.";this.stateManagerProxy.directTransition(ot.PAUSED),this.showPausedState(),(un(t)||t!==!0)&&(t=!1),t&&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 t=this,n=function(){t.stateManagerProxy.directTransition(ot.SCANNING),t.hidePausedState()};if(!this.renderedCamera.isPaused()){n();return}this.renderedCamera.resume(function(){n()})},e.prototype.getState=function(){return this.stateManagerProxy.getState()},e.prototype.stop=function(){var t=this;if(!this.stateManagerProxy.isScanning())throw"Cannot stop, scanner is not running or paused.";var n=this.stateManagerProxy.startTransition(ot.NOT_STARTED);this.shouldScan=!1,this.foreverScanTimeout&&clearTimeout(this.foreverScanTimeout);var o=function(){if(t.element){var f=document.getElementById(dr.SHADED_REGION_ELEMENT_ID);f&&t.element.removeChild(f)}},c=this;return this.renderedCamera.close().then(function(){return c.renderedCamera=null,c.element&&(c.element.removeChild(c.canvasElement),c.canvasElement=null),o(),c.qrRegion&&(c.qrRegion=null),c.context&&(c.context=null),n.execute(),c.hidePausedState(),c.isScanning=!1,Promise.resolve()})},e.prototype.scanFile=function(t,n){return this.scanFileV2(t,n).then(function(o){return o.decodedText})},e.prototype.scanFileV2=function(t,n){var o=this;if(!t||!(t instanceof File))throw"imageFile argument is mandatory and should be instance of File. Use 'event.target.files[0]'.";if(un(n)&&(n=!0),!this.stateManagerProxy.canScanFile())throw"Cannot start file scan - ongoing camera scan";return new Promise(function(c,f){o.possiblyCloseLastScanImageFile(),o.clearElement(),o.lastScanImageFile=URL.createObjectURL(t);var g=new Image;g.onload=function(){var x=g.width,w=g.height,m=document.getElementById(o.elementId),b=m.clientWidth?m.clientWidth:dr.DEFAULT_WIDTH,y=Math.max(m.clientHeight?m.clientHeight:w,dr.FILE_SCAN_MIN_HEIGHT),A=o.computeCanvasDrawConfig(x,w,b,y);if(n){var T=o.createCanvasElement(b,y,"qr-canvas-visible");T.style.display="inline-block",m.appendChild(T);var k=T.getContext("2d");if(!k)throw"Unable to get 2d context from canvas";k.canvas.width=b,k.canvas.height=y,k.drawImage(g,0,0,x,w,A.x,A.y,A.width,A.height)}var D=dr.FILE_SCAN_HIDDEN_CANVAS_PADDING,G=Math.max(g.width,A.width),N=Math.max(g.height,A.height),I=G+2*D,O=N+2*D,B=o.createCanvasElement(I,O);m.appendChild(B);var j=B.getContext("2d");if(!j)throw"Unable to get 2d context from canvas";j.canvas.width=I,j.canvas.height=O,j.drawImage(g,0,0,x,w,D,D,G,N);try{o.qrcode.decodeRobustlyAsync(B).then(function(U){c(i2.createFromQrcodeResult(U))}).catch(f)}catch(U){f("QR code parse error, error = ".concat(U))}},g.onerror=f,g.onabort=f,g.onstalled=f,g.onsuspend=f,g.src=URL.createObjectURL(t)})},e.prototype.clear=function(){this.clearElement()},e.getCameras=function(){return HR.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(t){if(t){if(!Vv.isMediaStreamConstraintsValid(t,this.logger))throw"invalid videoConstaints passed, check logs for more details"}else throw"videoConstaints is required argument.";return this.getRenderedCameraOrFail().applyVideoConstraints(t)},e.prototype.getRenderedCameraOrFail=function(){if(this.renderedCamera==null)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(t){var n=[re.QR_CODE,re.AZTEC,re.CODABAR,re.CODE_39,re.CODE_93,re.CODE_128,re.DATA_MATRIX,re.MAXICODE,re.ITF,re.EAN_13,re.EAN_8,re.PDF_417,re.RSS_14,re.RSS_EXPANDED,re.UPC_A,re.UPC_E,re.UPC_EAN_EXTENSION];if(!t||typeof t=="boolean"||!t.formatsToSupport)return n;if(!Array.isArray(t.formatsToSupport))throw"configOrVerbosityFlag.formatsToSupport should be undefined or an array.";if(t.formatsToSupport.length===0)throw"Atleast 1 formatsToSupport is needed.";for(var o=[],c=0,f=t.formatsToSupport;c<f.length;c++){var g=f[c];RR(g)?o.push(g):this.logger.warn("Invalid format: ".concat(g," passed in config, ignoring."))}if(o.length===0)throw"None of formatsToSupport match supported values.";return o},e.prototype.getUseBarCodeDetectorIfSupported=function(t){if(un(t))return!0;if(!un(t.useBarCodeDetectorIfSupported))return t.useBarCodeDetectorIfSupported!==!1;if(un(t.experimentalFeatures))return!0;var n=t.experimentalFeatures;return un(n.useBarCodeDetectorIfSupported)?!0:n.useBarCodeDetectorIfSupported!==!1},e.prototype.validateQrboxSize=function(t,n,o){var c=this,f=o.qrbox;this.validateQrboxConfig(f);var g=this.toQrdimensions(t,n,f),x=function(m){if(m<dr.MIN_QR_BOX_SIZE)throw"minimum size of 'config.qrbox' dimension value is"+" ".concat(dr.MIN_QR_BOX_SIZE,"px.")},w=function(m){return m>t&&(c.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."),m=t),m};x(g.width),x(g.height),g.width=w(g.width)},e.prototype.validateQrboxConfig=function(t){if(typeof t!="number"&&typeof t!="function"&&(t.width===void 0||t.height===void 0))throw"Invalid instance of QrDimensions passed for 'config.qrbox'. Both 'width' and 'height' should be set."},e.prototype.toQrdimensions=function(t,n,o){if(typeof o=="number")return{width:o,height:o};if(typeof o=="function")try{return o(t,n)}catch(c){throw new Error("qrbox config was passed as a function but it failed with unknown error"+c)}return o},e.prototype.setupUi=function(t,n,o){o.isShadedBoxEnabled()&&this.validateQrboxSize(t,n,o);var c=un(o.qrbox)?{width:t,height:n}:o.qrbox;this.validateQrboxConfig(c);var f=this.toQrdimensions(t,n,c);f.height>n&&this.logger.warn("[Html5Qrcode] config.qrbox has height that isgreater than the height of the video stream. Shading will be ignored");var g=o.isShadedBoxEnabled()&&f.height<=n,x={x:0,y:0,width:t,height:n},w=g?this.getShadedRegionBounds(t,n,f):x,m=this.createCanvasElement(w.width,w.height),b={willReadFrequently:!0},y=m.getContext("2d",b);y.canvas.width=w.width,y.canvas.height=w.height,this.element.append(m),g&&this.possiblyInsertShadingElement(this.element,t,n,f),this.createScannerPausedUiElement(this.element),this.qrRegion=w,this.context=y,this.canvasElement=m},e.prototype.createScannerPausedUiElement=function(t){var n=document.createElement("div");n.innerText=us.scannerPaused(),n.style.display="none",n.style.position="absolute",n.style.top="0px",n.style.zIndex="1",n.style.background="rgba(9, 9, 9, 0.46)",n.style.color="#FFECEC",n.style.textAlign="center",n.style.width="100%",t.appendChild(n),this.scannerPausedUiElement=n},e.prototype.scanContext=function(t,n){var o=this;return this.stateManagerProxy.isPaused()?Promise.resolve(!1):this.qrcode.decodeAsync(this.canvasElement).then(function(c){return t(c.text,i2.createFromQrcodeResult(c)),o.possiblyUpdateShaders(!0),!0}).catch(function(c){o.possiblyUpdateShaders(!1);var f=us.codeParseError(c);return n(f,OR.createFrom(f)),!1})},e.prototype.foreverScan=function(t,n,o){var c=this;if(this.shouldScan&&this.renderedCamera){var f=this.renderedCamera.getSurface(),g=f.videoWidth/f.clientWidth,x=f.videoHeight/f.clientHeight;if(!this.qrRegion)throw"qrRegion undefined when localMediaStream is ready.";var w=this.qrRegion.width*g,m=this.qrRegion.height*x,b=this.qrRegion.x*g,y=this.qrRegion.y*x;this.context.drawImage(f,b,y,w,m,0,0,this.qrRegion.width,this.qrRegion.height);var A=function(){c.foreverScanTimeout=setTimeout(function(){c.foreverScan(t,n,o)},c.getTimeoutFps(t.fps))};this.scanContext(n,o).then(function(T){!T&&t.disableFlip!==!0?(c.context.translate(c.context.canvas.width,0),c.context.scale(-1,1),c.scanContext(n,o).finally(function(){A()})):A()}).catch(function(T){c.logger.logError("Error happend while scanning context",T),A()})}},e.prototype.createVideoConstraints=function(t){if(typeof t=="string")return{deviceId:{exact:t}};if(typeof t=="object"){var n="facingMode",o="deviceId",c={user:!0,environment:!0},f="exact",g=function(k){if(k in c)return!0;throw"config has invalid 'facingMode' value = "+"'".concat(k,"'")},x=Object.keys(t);if(x.length!==1)throw"'cameraIdOrConfig' object should have exactly 1 key,"+" if passed as an object, found ".concat(x.length," keys");var w=Object.keys(t)[0];if(w!==n&&w!==o)throw"Only '".concat(n,"' and '").concat(o,"' ")+" are supported for 'cameraIdOrConfig'";if(w===n){var m=t.facingMode;if(typeof m=="string"){if(g(m))return{facingMode:m}}else if(typeof m=="object")if(f in m){if(g(m["".concat(f)]))return{facingMode:{exact:m["".concat(f)]}}}else throw"'facingMode' should be string or object with"+" ".concat(f," as key.");else{var b=typeof m;throw"Invalid type of 'facingMode' = ".concat(b)}}else{var y=t.deviceId;if(typeof y=="string")return{deviceId:y};if(typeof y=="object"){if(f in y)return{deviceId:{exact:y["".concat(f)]}};throw"'deviceId' should be string or object with"+" ".concat(f," as key.")}else{var A=typeof y;throw"Invalid type of 'deviceId' = ".concat(A)}}}var T=typeof t;throw"Invalid type of 'cameraIdOrConfig' = ".concat(T)},e.prototype.computeCanvasDrawConfig=function(t,n,o,c){if(t<=o&&n<=c){var f=(o-t)/2,g=(c-n)/2;return{x:f,y:g,width:t,height:n}}else{var x=t,w=n;return t>o&&(n=o/t*n,t=o),n>c&&(t=c/n*t,n=c),this.logger.log("Image downsampled from "+"".concat(x,"X").concat(w)+" to ".concat(t,"X").concat(n,".")),this.computeCanvasDrawConfig(t,n,o,c)}},e.prototype.clearElement=function(){if(this.stateManagerProxy.isScanning())throw"Cannot clear while scan is ongoing, close it first.";var t=document.getElementById(this.elementId);t&&(t.innerHTML="")},e.prototype.possiblyUpdateShaders=function(t){this.qrMatch!==t&&(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(n){n.style.backgroundColor=t?dr.BORDER_SHADER_MATCH_COLOR:dr.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=t)},e.prototype.possiblyCloseLastScanImageFile=function(){this.lastScanImageFile&&(URL.revokeObjectURL(this.lastScanImageFile),this.lastScanImageFile=null)},e.prototype.createCanvasElement=function(t,n,o){var c=t,f=n,g=document.createElement("canvas");return g.style.width="".concat(c,"px"),g.style.height="".concat(f,"px"),g.style.display="none",g.id=un(o)?"qr-canvas":o,g},e.prototype.getShadedRegionBounds=function(t,n,o){if(o.width>t||o.height>n)throw"'config.qrbox' dimensions should not be greater than the dimensions of the root HTML element.";return{x:(t-o.width)/2,y:(n-o.height)/2,width:o.width,height:o.height}},e.prototype.possiblyInsertShadingElement=function(t,n,o,c){if(!(n-c.width<1||o-c.height<1)){var f=document.createElement("div");f.style.position="absolute";var g=(n-c.width)/2,x=(o-c.height)/2;if(f.style.borderLeft="".concat(g,"px solid rgba(0, 0, 0, 0.48)"),f.style.borderRight="".concat(g,"px solid rgba(0, 0, 0, 0.48)"),f.style.borderTop="".concat(x,"px solid rgba(0, 0, 0, 0.48)"),f.style.borderBottom="".concat(x,"px solid rgba(0, 0, 0, 0.48)"),f.style.boxSizing="border-box",f.style.top="0px",f.style.bottom="0px",f.style.left="0px",f.style.right="0px",f.id="".concat(dr.SHADED_REGION_ELEMENT_ID),n-c.width<11||o-c.height<11)this.hasBorderShaders=!1;else{var w=5,m=40;this.insertShaderBorders(f,m,w,-w,null,0,!0),this.insertShaderBorders(f,m,w,-w,null,0,!1),this.insertShaderBorders(f,m,w,null,-w,0,!0),this.insertShaderBorders(f,m,w,null,-w,0,!1),this.insertShaderBorders(f,w,m+w,-w,null,-w,!0),this.insertShaderBorders(f,w,m+w,null,-w,-w,!0),this.insertShaderBorders(f,w,m+w,-w,null,-w,!1),this.insertShaderBorders(f,w,m+w,null,-w,-w,!1),this.hasBorderShaders=!0}t.append(f)}},e.prototype.insertShaderBorders=function(t,n,o,c,f,g,x){var w=document.createElement("div");w.style.position="absolute",w.style.backgroundColor=dr.BORDER_SHADER_DEFAULT_COLOR,w.style.width="".concat(n,"px"),w.style.height="".concat(o,"px"),c!==null&&(w.style.top="".concat(c,"px")),f!==null&&(w.style.bottom="".concat(f,"px")),x?w.style.left="".concat(g,"px"):w.style.right="".concat(g,"px"),this.borderShaders||(this.borderShaders=[]),this.borderShaders.push(w),t.appendChild(w)},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(t){return 1e3/t},e}(),f2;(function(e){e[e.STATUS_DEFAULT=0]="STATUS_DEFAULT",e[e.STATUS_SUCCESS=1]="STATUS_SUCCESS",e[e.STATUS_WARNING=2]="STATUS_WARNING",e[e.STATUS_REQUESTING_PERMISSION=3]="STATUS_REQUESTING_PERMISSION"})(f2||(f2={}));var Y1;(function(e){e[e.BACK=1]="BACK",e[e.FRONT=2]="FRONT"})(Y1||(Y1={}));var K1;(function(e){e[e.PORTRAIT=1]="PORTRAIT",e[e.LANDSCAPE=2]="LANDSCAPE",e[e.ADAPTIVE=3]="ADAPTIVE"})(K1||(K1={}));var Z1;(function(e){e[e.ALL=17]="ALL"})(Z1||(Z1={}));const QR=Object.assign(Object.assign({},re),Z1);var d2;(function(e){e.ZXING="zxing",e.MLKIT="mlkit"})(d2||(d2={}));const qR=[{selector:".scanner-container-display",css:"display: block;"},{selector:".scanner-dialog",css:"display: none; position: fixed; z-index: 999; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.4);"},{selector:".scanner-dialog-inner",css:"background-color: #fefefe; margin: 2% auto; padding: 20px; border: 1px solid #888; width: 96%;"},{selector:".close-button",css:"color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer;"},{selector:".close-button:hover",css:"color: #222;"},{selector:".scanner-container-full-width",css:"width: 100%;"}];function JR(e){const t="custom-style-os-cap-barcode";let n=document.getElementById(t);if(n||(n=document.createElement("style"),n.type="text/css",n.id=t,document.head.appendChild(n)),n.sheet){for(;n.sheet.cssRules.length;)n.sheet.deleteRule(0);for(const{selector:o,css:c}of e)n.sheet.insertRule(`${o} { ${c} }`)}else{n.textContent="";for(const{selector:o,css:c}of e)n.textContent+=`${o} { ${c} }`}}const e_=ha("CapacitorBarcodeScanner",{web:()=>(JR(qR),Fn(()=>import("./web-BOzkL-0Z.js"),[],import.meta.url).then(e=>new e.CapacitorBarcodeScannerWeb))});class t_{static async scanBarcode(t){return t.scanInstructions=t.scanInstructions||" ",t.scanButton=t.scanButton||!1,t.scanText=t.scanText||" ",t.cameraDirection=t.cameraDirection||Y1.BACK,t.scanOrientation=t.scanOrientation||K1.ADAPTIVE,e_.scanBarcode(t)}}const Nf=ha("SecureStoragePlugin",{web:()=>Fn(()=>import("./web-CeCHmdwO.js"),[],import.meta.url).then(e=>new e.SecureStoragePluginWeb)});function r_(e){try{if(e.length>2048)throw new Error;if(!e.startsWith("{")){const c=new URL(e);if(!["http:","https:"].includes(c.protocol)||c.username||c.password||c.pathname!=="/pair"||c.search||!/^#pair=[A-Za-z0-9_-]{43}$/.test(c.hash))throw new Error;const f=an.parse(c.origin);if(!f)throw new Error;return{endpoint:f,grant:c.hash.slice(6)}}const t=JSON.parse(e);if(t.type!=="agentroam-pair"||t.version!==1||typeof t.server!="string"||typeof t.grant!="string"||!/^[A-Za-z0-9_-]{43}$/.test(t.grant))throw new Error;const n=new URL(t.server);if(n.username||n.password||n.search||n.hash||n.pathname!=="/")throw new Error;const o=an.parse(t.server);if(!o)throw new Error;return{endpoint:o,grant:t.grant}}catch{throw new Error("这不是 AgentRoam 授权二维码,请扫描电脑终端上新生成的二维码。")}}class Gv{ready(){if(!Ns.isNativePlatform())throw new Error("请在 AgentRoam App 中扫码连接。")}async get(t){this.ready();try{return(await Nf.get({key:`agentroam-device:${t}`})).value}catch(n){if(String(n).includes("does not exist"))return null;throw new Error("无法读取设备凭证,请重试。")}}async set(t,n){this.ready(),await Nf.set({key:`agentroam-device:${t}`,value:n})}async remove(t){this.ready();try{await Nf.remove({key:`agentroam-device:${t}`})}catch(n){if(!String(n).includes("does not exist"))throw n}}}async function Xv(){if(!Ns.isNativePlatform())throw new Error("请在 AgentRoam App 中使用相机扫码。");try{return(await t_.scanBarcode({hint:QR.QR_CODE,scanInstructions:"扫描电脑上的 AgentRoam 授权二维码",cameraDirection:1})).ScanResult||null}catch(e){if(/cancel/i.test(String(e)))return null;throw new Error("无法打开相机,请在系统设置中允许 AgentRoam 使用相机后重试。")}}class Yv{constructor(t,n=(...c)=>fetch(...c),o=()=>window.dispatchEvent(new CustomEvent("webapp:unauthorized"))){this.storage=t,this.transport=n,this.onRevoked=o,this.session=null,this.fetch=async(c,f={})=>{const g=this.session,x=new URL(typeof c=="string"?c:c instanceof URL?c.href:c.url),w=new Headers(f.headers??(c instanceof Request?c.headers:void 0));g&&x.origin===g.origin&&w.set("authorization",`Bearer ${g.token}`);const m=await this.transport(c,{...f,headers:w,credentials:"omit",redirect:"error"});if(g&&this.session===g&&x.origin===g.origin&&(m.status===401||m.status===423)){this.session=null;try{await this.storage.remove(g.origin)}finally{this.onRevoked()}}return m}}async resume(t){const n=await this.storage.get(t.url);this.session=n?{origin:t.url,token:n}:null}async pair(t){const{endpoint:n,grant:o}=r_(t),c=new AbortController,f=setTimeout(()=>c.abort(),3e4);let g=null;try{let x;try{x=await this.transport(n.api("/api/pairing/qr-exchange"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant:o,name:"我的 App"}),credentials:"omit",redirect:"error",signal:c.signal}),x.ok&&(g=await x.json())}catch(w){if(w instanceof SyntaxError)throw new Error("服务器返回了无效的设备凭证。");const m=c.signal.aborted||w instanceof Error&&(w.name==="TimeoutError"||w.name==="AbortError"),b=n.url.startsWith("http://")?"请确认手机与电脑在同一网络,并检查电脑防火墙是否允许 AgentRoam 连接。":"请检查手机网络和电脑的远程连接是否可用。";throw new Error(`${m?"连接电脑超时":"无法连接电脑"}(${n.url})。${b}请在电脑上刷新二维码后重新扫码。`)}if(!x.ok)throw new Error(x.status===423?"电脑已锁定远程访问,请先在电脑上解锁。":x.status===410?"二维码已使用或已过期,请在电脑上重新生成。":"扫码连接失败,请检查服务器地址和网络后重试。")}finally{clearTimeout(f)}if(!g||typeof g.token!="string"||!/^[A-Za-z0-9_-]{43}$/.test(g.token))throw new Error("服务器返回了无效的设备凭证。");try{await this.storage.set(n.url,g.token)}catch{throw await this.transport(n.api("/api/pairing/logout"),{method:"POST",headers:{authorization:`Bearer ${g.token}`},credentials:"omit",redirect:"error",signal:AbortSignal.timeout(5e3)}).catch(()=>{}),new Error("无法安全保存设备凭证,请在电脑上重新生成二维码后重试。")}return this.session={origin:n.url,token:g.token},n}async checkAuthorization(){const t=this.session;if(!t)return;const n=await this.fetch(`${t.origin}/api/web-auth/status`,{signal:AbortSignal.timeout(5e3)});if(!n.ok)return;const o=await n.json();if(this.session===t&&(o.locked||o.authenticated===!1)){this.session=null;try{await this.storage.remove(t.origin)}finally{this.onRevoked()}}}}function Kv(e,t,n,o){const c=new URL(t);return(f,g)=>{const x=typeof f=="string"?f:f instanceof URL?f.href:f.url,w=new URL(x,c),m=w.protocol===c.protocol&&w.host===c.host;if(w.pathname.startsWith("/api/")&&(m||w.origin===e)){const b=new URL(w.pathname+w.search,e);return n.fetch(f instanceof Request?new Request(b,f):b,g)}return o(f,g)}}function n_(e,t){const n=new URL(e,"https://agentroam.local");if(n.pathname!=="/app/")throw new Error("Invalid workspace frame path");const o=new URL(t);return o.search=n.search,o.searchParams.set("workspace","1"),o.hash="",o.href}function Q1(e){mR(xR(e.url,void 0,jv())),new Lv().save(e)}async function i_(e,t,n,o){e.render(L.jsx(F0,{})),window.__agentroamNativeFrame={origin:t.url,fetch:n.fetch},globalThis.fetch=Kv(t.url,location.href,n,o);const c=async g=>{const x=await n.pair(g);Q1(x),location.reload()};fR({origin:t.url,frameUrl:g=>n_(g,location.href),pair:c,scan:async()=>{const g=await Xv();g&&await c(g)},switchComputer:async g=>{const x=an.parse(g);if(!x)throw new Error("电脑地址无效,请重新扫码。");const w=new Yv(new Gv,o,()=>{});await w.resume(x);const m=await w.fetch(x.api("/api/web-auth/status"),{signal:AbortSignal.timeout(5e3)}),b=m.ok?await m.json():null;if(!(b!=null&&b.authenticated)||b.locked)throw new Error("这台电脑需要重新授权,请点击扫码添加电脑。");Q1(x),location.reload()}});const{default:f}=await Fn(async()=>{const{default:g}=await import("./page-BG97oPXr.js").then(x=>x.p);return{default:g}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url);e.render(L.jsx(ue.StrictMode,{children:L.jsx(f,{})}))}function s_(){if(window.parent===window||new URLSearchParams(location.search).get("workspace")!=="1")return null;try{const e=new URL(window.parent.location.href);return e.protocol!==location.protocol||e.host!==location.host?null:window.parent.__agentroamNativeFrame??null}catch{return null}}function o_(e){return async(t,n)=>{const o=new Request(t,n);return e.fetch(o.url,{method:o.method,headers:Object.fromEntries(o.headers),body:o.method==="GET"||o.method==="HEAD"?void 0:await o.arrayBuffer(),signal:o.signal,cache:o.cache})}}var hc;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(hc||(hc={}));var h2;(function(e){e.None="NONE",e.Slide="SLIDE",e.Fade="FADE"})(h2||(h2={}));const kf=ha("StatusBar");function a_(e){const t=/^#([a-f\d]{6})$/i.exec(e.trim());if(!t)return null;const n=[0,2,4].map(c=>{const f=parseInt(t[1].slice(c,c+2),16)/255;return f<=.04045?f/12.92:((f+.055)/1.055)**2.4}),o=.2126*n[0]+.7152*n[1]+.0722*n[2];return{color:`#${t[1]}`,style:o>.179?hc.Light:hc.Dark}}function l_(){if(Ns.getPlatform()!=="android")return()=>{};const e=document.documentElement;e.dataset.skin=Ci.getState().skin;let t=!1,n=kf.setOverlaysWebView({overlay:!1}).catch(()=>{});const o=()=>{const g=a_(getComputedStyle(e).getPropertyValue("--bg-deepest"));g&&(n=n.then(async()=>{t||(await kf.setBackgroundColor({color:g.color}),await kf.setStyle({style:g.style}))}).catch(()=>{console.warn("Unable to update the Android status bar.")}))},c=new MutationObserver(o);c.observe(e,{attributes:!0,attributeFilter:["data-skin"]});const f=()=>{document.hidden||o()};return document.addEventListener("visibilitychange",f),window.addEventListener("focus",o),o(),()=>{t=!0,c.disconnect(),document.removeEventListener("visibilitychange",f),window.removeEventListener("focus",o)}}const c_="/service-worker.js";function u_(){return typeof window<"u"&&window.isSecureContext===!0&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window}function f_(e){const t="=".repeat((4-e.length%4)%4),n=`${e}${t}`.replace(/-/g,"+").replace(/_/g,"/"),o=atob(n),c=new Uint8Array(new ArrayBuffer(o.length));for(let f=0;f<o.length;f+=1)c[f]=o.charCodeAt(f);return c}async function g2(e){const{publicKey:t}=await e.get("/api/push/vapid");if(!t)return;const n=await navigator.serviceWorker.register(c_),c=await n.pushManager.getSubscription()??await n.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:f_(t)});await e.post("/api/push/subscribe",c.toJSON())}function d_(e){u_()&&(async()=>{try{if(Notification.permission==="granted"){await g2(e);return}if(Notification.permission!=="default")return;const t=()=>{(async()=>{try{await Notification.requestPermission()==="granted"&&await g2(e)}catch{}})()};document.addEventListener("pointerdown",t,{once:!0})}catch{}})()}class Df extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}}const p2=10,h_=13,gi=32;function Mf(e){}function g_(e){if(typeof e=="function")throw new TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");const{onEvent:t=Mf,onError:n=Mf,onRetry:o=Mf,onComment:c,maxBufferSize:f}=e,g=[];let x=0,w=!0,m,b="",y=0,A,T=!1;function k(j){if(T)throw new Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(w&&(w=!1,j.charCodeAt(0)===239&&j.charCodeAt(1)===187&&j.charCodeAt(2)===191&&(j=j.slice(3))),g.length===0){const Y=G(j);Y!==""&&(g.push(Y),x=Y.length),D();return}if(j.indexOf(`
481
481
  `)===-1&&j.indexOf("\r")===-1){g.push(j),x+=j.length,D();return}g.push(j);const U=g.join("");g.length=0,x=0;const F=G(U);F!==""&&(g.push(F),x=F.length),D()}function D(){f!==void 0&&(x+b.length<=f||(T=!0,g.length=0,x=0,m=void 0,b="",y=0,A=void 0,n(new Df(`Buffered data exceeded max buffer size of ${f} characters`,{type:"max-buffer-size-exceeded"}))))}function G(j){let U=0;if(j.indexOf("\r")===-1){let F=j.indexOf(`
482
482
  `,U);for(;F!==-1;){if(U===F){y>0&&t({id:m,event:A,data:b}),m=void 0,b="",y=0,A=void 0,U=F+1,F=j.indexOf(`
483
483
  `,U);continue}const Y=j.charCodeAt(U);if(m2(j,U,Y)){const $=j.charCodeAt(U+5)===gi?U+6:U+5,oe=j.slice($,F);if(y===0&&j.charCodeAt(F+1)===p2){t({id:m,event:A,data:oe}),m=void 0,b="",A=void 0,U=F+2,F=j.indexOf(`
@@ -486,4 +486,4 @@ ${oe}`,y++}else x2(j,U,Y)?A=j.slice(j.charCodeAt(U+6)===gi?U+7:U+6,F)||void 0:N(
486
486
  `,U)}return j.slice(U)}for(;U<j.length;){const F=j.indexOf("\r",U),Y=j.indexOf(`
487
487
  `,U);let $=-1;if(F!==-1&&Y!==-1?$=F<Y?F:Y:F!==-1?F===j.length-1?$=-1:$=F:Y!==-1&&($=Y),$===-1)break;N(j,U,$),U=$+1,j.charCodeAt(U-1)===h_&&j.charCodeAt(U)===p2&&U++}return j.slice(U)}function N(j,U,F){if(U===F){O();return}const Y=j.charCodeAt(U);if(m2(j,U,Y)){const Te=j.charCodeAt(U+5)===gi?U+6:U+5,X=j.slice(Te,F);b=y===0?X:`${b}
488
488
  ${X}`,y++;return}if(x2(j,U,Y)){A=j.slice(j.charCodeAt(U+6)===gi?U+7:U+6,F)||void 0;return}if(Y===105&&j.charCodeAt(U+1)===100&&j.charCodeAt(U+2)===58){const Te=j.slice(j.charCodeAt(U+3)===gi?U+4:U+3,F);Te.includes("\0")||(m=Te);return}if(Y===58){if(c){const Te=j.slice(U,F);c(Te.slice(j.charCodeAt(U+1)===gi?2:1))}return}const $=j.slice(U,F),oe=$.indexOf(":");if(oe===-1){I($,"",$);return}const ve=$.slice(0,oe),ie=$.charCodeAt(oe+1)===gi?2:1,pe=$.slice(oe+ie);I(ve,pe,$)}function I(j,U,F){switch(j){case"event":A=U||void 0;break;case"data":b=y===0?U:`${b}
489
- ${U}`,y++;break;case"id":U.includes("\0")||(m=U);break;case"retry":/^\d+$/.test(U)?o(parseInt(U,10)):n(new Df(`Invalid \`retry\` value: "${U}"`,{type:"invalid-retry",value:U,line:F}));break;default:n(new Df(`Unknown field "${j.length>20?`${j.slice(0,20)}…`:j}"`,{type:"unknown-field",field:j,value:U,line:F}));break}}function O(){y>0&&t({id:m,event:A,data:b}),m=void 0,b="",y=0,A=void 0}function B(j={}){if(j.consume&&g.length>0){const U=g.join("");N(U,0,U.length)}w=!0,m=void 0,b="",y=0,A=void 0,g.length=0,x=0,T=!1}return{feed:k,reset:B}}function m2(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function x2(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}class w2 extends Event{constructor(t,n){var o,c;super(t),this.code=(o=n==null?void 0:n.code)!=null?o:void 0,this.message=(c=n==null?void 0:n.message)!=null?c:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,o){return o(v2(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(v2(this),n)}}function p_(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function q1(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(q1).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${q1(e.cause)}`:e.message:`${e}`}function v2(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var Zv=e=>{throw TypeError(e)},z0=(e,t,n)=>t.has(e)||Zv("Cannot "+n),Ce=(e,t,n)=>(z0(e,t,"read from private field"),n?n.call(e):t.get(e)),vt=(e,t,n)=>t.has(e)?Zv("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ye=(e,t,n,o)=>(z0(e,t,"write to private field"),t.set(e,n),n),fn=(e,t,n)=>(z0(e,t,"access private method"),n),nr,xi,Yi,_l,gc,Oo,fs,No,Wn,Ki,vs,Zi,xo,Lr,J1,ed,td,y2,rd,nd,wo,id,sd;let Ol=class extends EventTarget{constructor(t,n){var o,c;super(),vt(this,Lr),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,vt(this,nr),vt(this,xi),vt(this,Yi),vt(this,_l),vt(this,gc),vt(this,Oo),vt(this,fs),vt(this,No,null),vt(this,Wn),vt(this,Ki),vt(this,vs,null),vt(this,Zi,null),vt(this,xo,null),vt(this,ed,async f=>{var g;Ce(this,Ki).reset();const{body:x,redirected:w,status:m,headers:b}=f;if(m===204){fn(this,Lr,wo).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(w?Ye(this,Yi,new URL(f.url)):Ye(this,Yi,void 0),m!==200){fn(this,Lr,wo).call(this,`Non-200 status code (${m})`,m);return}if(!(b.get("content-type")||"").startsWith("text/event-stream")){fn(this,Lr,wo).call(this,'Invalid content type, expected "text/event-stream"',m);return}if(Ce(this,nr)===this.CLOSED)return;Ye(this,nr,this.OPEN);const y=new Event("open");if((g=Ce(this,xo))==null||g.call(this,y),this.dispatchEvent(y),typeof x!="object"||!x||!("getReader"in x)){fn(this,Lr,wo).call(this,"Invalid response body, expected a web ReadableStream",m),this.close();return}const A=new TextDecoder,T=x.getReader();let k=!0;do{const{done:D,value:G}=await T.read();G&&Ce(this,Ki).feed(A.decode(G,{stream:!D})),D&&(k=!1,Ce(this,Ki).reset(),fn(this,Lr,id).call(this))}while(k)}),vt(this,td,f=>{Ye(this,Wn,void 0),!(f.name==="AbortError"||f.type==="aborted")&&fn(this,Lr,id).call(this,q1(f))}),vt(this,rd,f=>{typeof f.id=="string"&&Ye(this,No,f.id);const g=new MessageEvent(f.event||"message",{data:f.data,origin:Ce(this,Yi)?Ce(this,Yi).origin:Ce(this,xi).origin,lastEventId:f.id||""});Ce(this,Zi)&&(!f.event||f.event==="message")&&Ce(this,Zi).call(this,g),this.dispatchEvent(g)}),vt(this,nd,f=>{Ye(this,Oo,f)}),vt(this,sd,()=>{Ye(this,fs,void 0),Ce(this,nr)===this.CONNECTING&&fn(this,Lr,J1).call(this)});try{if(t instanceof URL)Ye(this,xi,t);else if(typeof t=="string")Ye(this,xi,new URL(t,m_()));else throw new Error("Invalid URL")}catch{throw p_("An invalid or illegal string was specified")}Ye(this,Ki,g_({onEvent:Ce(this,rd),onRetry:Ce(this,nd)})),Ye(this,nr,this.CONNECTING),Ye(this,Oo,3e3),Ye(this,gc,(o=n==null?void 0:n.fetch)!=null?o:globalThis.fetch),Ye(this,_l,(c=n==null?void 0:n.withCredentials)!=null?c:!1),fn(this,Lr,J1).call(this)}get readyState(){return Ce(this,nr)}get url(){return Ce(this,xi).href}get withCredentials(){return Ce(this,_l)}get onerror(){return Ce(this,vs)}set onerror(t){Ye(this,vs,t)}get onmessage(){return Ce(this,Zi)}set onmessage(t){Ye(this,Zi,t)}get onopen(){return Ce(this,xo)}set onopen(t){Ye(this,xo,t)}addEventListener(t,n,o){const c=n;super.addEventListener(t,c,o)}removeEventListener(t,n,o){const c=n;super.removeEventListener(t,c,o)}close(){Ce(this,fs)&&clearTimeout(Ce(this,fs)),Ce(this,nr)!==this.CLOSED&&(Ce(this,Wn)&&Ce(this,Wn).abort(),Ye(this,nr,this.CLOSED),Ye(this,Wn,void 0))}};nr=new WeakMap,xi=new WeakMap,Yi=new WeakMap,_l=new WeakMap,gc=new WeakMap,Oo=new WeakMap,fs=new WeakMap,No=new WeakMap,Wn=new WeakMap,Ki=new WeakMap,vs=new WeakMap,Zi=new WeakMap,xo=new WeakMap,Lr=new WeakSet,J1=function(){Ye(this,nr,this.CONNECTING),Ye(this,Wn,new AbortController),Ce(this,gc)(Ce(this,xi),fn(this,Lr,y2).call(this)).then(Ce(this,ed)).catch(Ce(this,td))},ed=new WeakMap,td=new WeakMap,y2=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...Ce(this,No)?{"Last-Event-ID":Ce(this,No)}:void 0},cache:"no-store",signal:(e=Ce(this,Wn))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},rd=new WeakMap,nd=new WeakMap,wo=function(e,t){var n;Ce(this,nr)!==this.CLOSED&&Ye(this,nr,this.CLOSED);const o=new w2("error",{code:t,message:e});(n=Ce(this,vs))==null||n.call(this,o),this.dispatchEvent(o)},id=function(e,t){var n;if(Ce(this,nr)===this.CLOSED)return;Ye(this,nr,this.CONNECTING);const o=new w2("error",{code:t,message:e});(n=Ce(this,vs))==null||n.call(this,o),this.dispatchEvent(o),Ye(this,fs,setTimeout(Ce(this,sd),Ce(this,Oo)))},sd=new WeakMap,Ol.CONNECTING=0,Ol.OPEN=1,Ol.CLOSED=2;function m_(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}T5();iT();lT();fT();dT();pT();H9({baseUrl:()=>ta,source:"webapp"});document.body.dataset.webShell="1";const Qc=new LT,ti=s_(),od=Qc.isNativeApp()||!!ti;od&&(document.body.dataset.nativeApp="1");l_();if(!Qc.isNativeApp()&&window.parent===window){const e=document.createElement("link");e.rel="manifest",e.href="/manifest.webmanifest",document.head.append(e);const t=document.querySelector('link[rel="apple-touch-icon"]');t&&(t.href="/pwa/icon-192.png");const n=document.createElement("script");n.src="/pwa/install.js",document.head.append(n)}if(window.parent===window){const e=()=>{const t=Wg.find(o=>o.id===Ci.getState().skin)??Wg[0];document.body.style.background=t.preview[0];let n=document.querySelector('meta[name="theme-color"]');n||(n=document.createElement("meta"),n.name="theme-color",document.head.append(n)),n.content=t.preview[0]};e(),Ci.subscribe(e)}const qc=globalThis.fetch.bind(globalThis),gt=Qc.isNativeApp()&&!ti?new Yv(new Gv,qc):null,ea=ti?o_(ti):gt==null?void 0:gt.fetch;ti&&ea&&(globalThis.fetch=Kv(ti.origin,location.href,{fetch:ea},qc));const pc=new W9(ea),x_=window.parent===window?void 0:new AT,w_=window.parent===window?void 0:new MT;let ta="";async function E2(e){const{wsNonce:t}=await pc.get("/api/web-console/bootstrap"),n=new URL(e,ta||location.href);return n.protocol=n.protocol==="https:"?"wss:":"ws:",n.searchParams.set("nonce",t),new WebSocket(n)}const C2=new Q9(pc,new tT,x_,e=>ea?new Ol(ta+e,{fetch:ea}):new EventSource(ta+e),new J9({openSocket:()=>E2("/ws/voice")}),new eT(()=>E2("/ws/voice/tts")));window.browserLiveApi=w_;const Qv=document.getElementById("root");if(!Qv)throw new Error("#root missing");const ko=Nv(Qv);gt&&window.parent===window&&ko.render(L.jsx(F0,{}));function v_(){return ue.useEffect(()=>{xT()},[]),null}(async()=>{gt&&window.addEventListener("webapp:unauthorized",()=>location.reload());const e=new PT(Qc,new Lv,new FT(gt?async(n,o)=>{const c=an.parse(String(n));return c&&await gt.resume(c),gt.fetch(n,o)}:void 0));if(ti){await ld(an.parse(ti.origin));return}const t=await e.planStartup();if(t.mode==="setup"){ad(t.failure);return}await ld(t.mode==="ready"?t.endpoint:null)})().catch(e=>{gt&&ad(e instanceof Error?e.message:"连接失败,请重新扫码。")});function ad(e=""){globalThis.fetch=qc,delete window.__agentroamNativeFrame,ko.render(L.jsx(uR,{initialFailure:e,onScan:async()=>{const t=await Xv();if(!t||!gt)return;const n=await gt.pair(t);Q1(n),await ld(n)}}))}async function ld(e){try{if(e&&(await(gt==null?void 0:gt.resume(e)),pc.setBaseUrl(e.url),ta=e.url),gt&&e&&window.parent===window){await i_(ko,e,gt,qc),setInterval(()=>{gt.checkAuthorization().catch(()=>{})},1e4);return}window.agentApi=C2;const t=new URLSearchParams(location.search).get("view"),n=t==="collaboration"?Fn(()=>import("./CollaborationPage-Cg22tJGB.js"),__vite__mapDeps([11,4,12,2,9,13,14,15,16,8,17,18]),import.meta.url):t==="collaboration-dashboard"?Fn(()=>import("./CollaborationDashboard-ChUaJ5xA.js"),__vite__mapDeps([19,8,20,16,21,2,5,14,15,3,9,22,23]),import.meta.url):t==="session-dashboard"?Fn(()=>import("./SessionDashboard-CCpxslxg.js"),__vite__mapDeps([24,9,25,26,14,15,2,22,3,13,27]),import.meta.url):t==="remote-desktop"?Fn(()=>import("./RemoteDesktopPage-DD9aNe8m.js"),__vite__mapDeps([28,29,17,3,7,30,2,31,6,10]),import.meta.url):Fn(()=>import("./App-DGtdMfGk.js").then(c=>c.a),__vite__mapDeps([32,17,3,21,5,12,4,2,7,1,31,30,33,25,9,26,14,15,20,16,8,34,35]),import.meta.url),[,{default:o}]=await Promise.all([C2.refreshServerModel(),n]);!od&&window.parent===window&&d_(pc),ko.render(L.jsxs(ue.StrictMode,{children:[L.jsx(_5.Provider,{value:L.jsx(U9,{}),children:L.jsx(R5.Provider,{value:L.jsx(y9,{}),children:L.jsx(o,{})})}),L.jsx(v_,{})]})),gt&&setInterval(()=>{gt.checkAuthorization().catch(()=>{})},1e4),e||(window.addEventListener("webapp:unauthorized",()=>location.reload()),y_())}catch(t){if(t instanceof kv&&!od&&window.parent===window){location.replace("/pair");return}if(gt&&window.parent===window){ad(t instanceof Error?t.message:"连接失败,请重新扫码。");return}ko.render(L.jsx("div",{style:{minHeight:"100dvh",display:"flex",alignItems:"center",justifyContent:"center",padding:24,background:"#f5f6fa",boxSizing:"border-box"},children:L.jsxs("div",{style:{maxWidth:560,background:"#fff",borderRadius:12,padding:20,boxShadow:"0 4px 16px rgba(0,0,0,0.08)"},children:[L.jsx("h2",{style:{margin:"0 0 8px",fontSize:16,color:"#dc2626"},children:"界面启动失败"}),L.jsx("p",{style:{margin:"0 0 12px",fontSize:13,color:"#374151",wordBreak:"break-all"},children:t instanceof Error?`${t.name}: ${t.message}`:String(t)}),L.jsx("button",{type:"button",onClick:()=>location.reload(),style:{padding:"8px 20px",fontSize:14,borderRadius:8,border:"1px solid #d6d9e0",background:"#fff",cursor:"pointer"},children:"重试"})]})}))}}function y_(){const e=[...document.scripts].map(n=>n.src).join(",").match(/index-([^/]+)\.js/),t=e?e[1]:null;t&&setInterval(async()=>{if(iy())try{const n=await fetch("/api/agent/model",{credentials:"same-origin",cache:"no-store"});if(n.status===401||n.status===423){location.reload();return}const c=((await n.json()).buildId||"").replace(/^index-|\.js$/g,"");c&&c!==t&&wT()}catch{}},6e4)}export{f7 as $,nR as A,R5 as B,K1 as C,P_ as D,P9 as E,_v as F,I9 as G,L_ as H,I_ as I,vT as J,N_ as K,O9 as L,k9 as M,k_ as N,ey as O,L9 as P,J3 as Q,Ov as R,F0 as S,XT as T,B9 as U,u7 as V,zv as W,Ax as X,O_ as Y,TT as Z,ZT as _,QR as a,IT as a0,GT as a1,VT as a2,YT as a3,S_ as a4,T_ as a5,ST as a6,Fn as a7,G3 as a8,U0 as a9,j0 as aa,sR as ab,R_ as ac,r7 as ad,F9 as ae,Xp as af,_5 as ag,hT as ah,JT as ai,H1 as aj,b_ as ak,aR as al,C_ as am,Wg as an,A_ as ao,dR as b,Rt as c,cc as d,M9 as e,c7 as f,gn as g,b2 as h,iR as i,L as j,E_ as k,iy as l,A9 as m,D9 as n,D_ as o,Uv as p,jv as q,ue as r,mR as s,xR as t,Ci as u,__ as v,wR as w,M_ as x,pR as y,T9 as z};
489
+ ${U}`,y++;break;case"id":U.includes("\0")||(m=U);break;case"retry":/^\d+$/.test(U)?o(parseInt(U,10)):n(new Df(`Invalid \`retry\` value: "${U}"`,{type:"invalid-retry",value:U,line:F}));break;default:n(new Df(`Unknown field "${j.length>20?`${j.slice(0,20)}…`:j}"`,{type:"unknown-field",field:j,value:U,line:F}));break}}function O(){y>0&&t({id:m,event:A,data:b}),m=void 0,b="",y=0,A=void 0}function B(j={}){if(j.consume&&g.length>0){const U=g.join("");N(U,0,U.length)}w=!0,m=void 0,b="",y=0,A=void 0,g.length=0,x=0,T=!1}return{feed:k,reset:B}}function m2(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function x2(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}class w2 extends Event{constructor(t,n){var o,c;super(t),this.code=(o=n==null?void 0:n.code)!=null?o:void 0,this.message=(c=n==null?void 0:n.message)!=null?c:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,o){return o(v2(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(v2(this),n)}}function p_(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function q1(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(q1).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${q1(e.cause)}`:e.message:`${e}`}function v2(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var Zv=e=>{throw TypeError(e)},z0=(e,t,n)=>t.has(e)||Zv("Cannot "+n),Ce=(e,t,n)=>(z0(e,t,"read from private field"),n?n.call(e):t.get(e)),vt=(e,t,n)=>t.has(e)?Zv("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ye=(e,t,n,o)=>(z0(e,t,"write to private field"),t.set(e,n),n),fn=(e,t,n)=>(z0(e,t,"access private method"),n),nr,xi,Yi,_l,gc,Oo,fs,No,Wn,Ki,vs,Zi,xo,Lr,J1,ed,td,y2,rd,nd,wo,id,sd;let Ol=class extends EventTarget{constructor(t,n){var o,c;super(),vt(this,Lr),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,vt(this,nr),vt(this,xi),vt(this,Yi),vt(this,_l),vt(this,gc),vt(this,Oo),vt(this,fs),vt(this,No,null),vt(this,Wn),vt(this,Ki),vt(this,vs,null),vt(this,Zi,null),vt(this,xo,null),vt(this,ed,async f=>{var g;Ce(this,Ki).reset();const{body:x,redirected:w,status:m,headers:b}=f;if(m===204){fn(this,Lr,wo).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(w?Ye(this,Yi,new URL(f.url)):Ye(this,Yi,void 0),m!==200){fn(this,Lr,wo).call(this,`Non-200 status code (${m})`,m);return}if(!(b.get("content-type")||"").startsWith("text/event-stream")){fn(this,Lr,wo).call(this,'Invalid content type, expected "text/event-stream"',m);return}if(Ce(this,nr)===this.CLOSED)return;Ye(this,nr,this.OPEN);const y=new Event("open");if((g=Ce(this,xo))==null||g.call(this,y),this.dispatchEvent(y),typeof x!="object"||!x||!("getReader"in x)){fn(this,Lr,wo).call(this,"Invalid response body, expected a web ReadableStream",m),this.close();return}const A=new TextDecoder,T=x.getReader();let k=!0;do{const{done:D,value:G}=await T.read();G&&Ce(this,Ki).feed(A.decode(G,{stream:!D})),D&&(k=!1,Ce(this,Ki).reset(),fn(this,Lr,id).call(this))}while(k)}),vt(this,td,f=>{Ye(this,Wn,void 0),!(f.name==="AbortError"||f.type==="aborted")&&fn(this,Lr,id).call(this,q1(f))}),vt(this,rd,f=>{typeof f.id=="string"&&Ye(this,No,f.id);const g=new MessageEvent(f.event||"message",{data:f.data,origin:Ce(this,Yi)?Ce(this,Yi).origin:Ce(this,xi).origin,lastEventId:f.id||""});Ce(this,Zi)&&(!f.event||f.event==="message")&&Ce(this,Zi).call(this,g),this.dispatchEvent(g)}),vt(this,nd,f=>{Ye(this,Oo,f)}),vt(this,sd,()=>{Ye(this,fs,void 0),Ce(this,nr)===this.CONNECTING&&fn(this,Lr,J1).call(this)});try{if(t instanceof URL)Ye(this,xi,t);else if(typeof t=="string")Ye(this,xi,new URL(t,m_()));else throw new Error("Invalid URL")}catch{throw p_("An invalid or illegal string was specified")}Ye(this,Ki,g_({onEvent:Ce(this,rd),onRetry:Ce(this,nd)})),Ye(this,nr,this.CONNECTING),Ye(this,Oo,3e3),Ye(this,gc,(o=n==null?void 0:n.fetch)!=null?o:globalThis.fetch),Ye(this,_l,(c=n==null?void 0:n.withCredentials)!=null?c:!1),fn(this,Lr,J1).call(this)}get readyState(){return Ce(this,nr)}get url(){return Ce(this,xi).href}get withCredentials(){return Ce(this,_l)}get onerror(){return Ce(this,vs)}set onerror(t){Ye(this,vs,t)}get onmessage(){return Ce(this,Zi)}set onmessage(t){Ye(this,Zi,t)}get onopen(){return Ce(this,xo)}set onopen(t){Ye(this,xo,t)}addEventListener(t,n,o){const c=n;super.addEventListener(t,c,o)}removeEventListener(t,n,o){const c=n;super.removeEventListener(t,c,o)}close(){Ce(this,fs)&&clearTimeout(Ce(this,fs)),Ce(this,nr)!==this.CLOSED&&(Ce(this,Wn)&&Ce(this,Wn).abort(),Ye(this,nr,this.CLOSED),Ye(this,Wn,void 0))}};nr=new WeakMap,xi=new WeakMap,Yi=new WeakMap,_l=new WeakMap,gc=new WeakMap,Oo=new WeakMap,fs=new WeakMap,No=new WeakMap,Wn=new WeakMap,Ki=new WeakMap,vs=new WeakMap,Zi=new WeakMap,xo=new WeakMap,Lr=new WeakSet,J1=function(){Ye(this,nr,this.CONNECTING),Ye(this,Wn,new AbortController),Ce(this,gc)(Ce(this,xi),fn(this,Lr,y2).call(this)).then(Ce(this,ed)).catch(Ce(this,td))},ed=new WeakMap,td=new WeakMap,y2=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...Ce(this,No)?{"Last-Event-ID":Ce(this,No)}:void 0},cache:"no-store",signal:(e=Ce(this,Wn))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},rd=new WeakMap,nd=new WeakMap,wo=function(e,t){var n;Ce(this,nr)!==this.CLOSED&&Ye(this,nr,this.CLOSED);const o=new w2("error",{code:t,message:e});(n=Ce(this,vs))==null||n.call(this,o),this.dispatchEvent(o)},id=function(e,t){var n;if(Ce(this,nr)===this.CLOSED)return;Ye(this,nr,this.CONNECTING);const o=new w2("error",{code:t,message:e});(n=Ce(this,vs))==null||n.call(this,o),this.dispatchEvent(o),Ye(this,fs,setTimeout(Ce(this,sd),Ce(this,Oo)))},sd=new WeakMap,Ol.CONNECTING=0,Ol.OPEN=1,Ol.CLOSED=2;function m_(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}T5();iT();lT();fT();dT();pT();H9({baseUrl:()=>ta,source:"webapp"});document.body.dataset.webShell="1";const Qc=new LT,ti=s_(),od=Qc.isNativeApp()||!!ti;od&&(document.body.dataset.nativeApp="1");l_();if(!Qc.isNativeApp()&&window.parent===window){const e=document.createElement("link");e.rel="manifest",e.href="/manifest.webmanifest",document.head.append(e);const t=document.querySelector('link[rel="apple-touch-icon"]');t&&(t.href="/pwa/icon-192.png");const n=document.createElement("script");n.src="/pwa/install.js",document.head.append(n)}if(window.parent===window){const e=()=>{const t=Wg.find(o=>o.id===Ci.getState().skin)??Wg[0];document.body.style.background=t.preview[0];let n=document.querySelector('meta[name="theme-color"]');n||(n=document.createElement("meta"),n.name="theme-color",document.head.append(n)),n.content=t.preview[0]};e(),Ci.subscribe(e)}const qc=globalThis.fetch.bind(globalThis),gt=Qc.isNativeApp()&&!ti?new Yv(new Gv,qc):null,ea=ti?o_(ti):gt==null?void 0:gt.fetch;ti&&ea&&(globalThis.fetch=Kv(ti.origin,location.href,{fetch:ea},qc));const pc=new W9(ea),x_=window.parent===window?void 0:new AT,w_=window.parent===window?void 0:new MT;let ta="";async function E2(e){const{wsNonce:t}=await pc.get("/api/web-console/bootstrap"),n=new URL(e,ta||location.href);return n.protocol=n.protocol==="https:"?"wss:":"ws:",n.searchParams.set("nonce",t),new WebSocket(n)}const C2=new Q9(pc,new tT,x_,e=>ea?new Ol(ta+e,{fetch:ea}):new EventSource(ta+e),new J9({openSocket:()=>E2("/ws/voice")}),new eT(()=>E2("/ws/voice/tts")));window.browserLiveApi=w_;const Qv=document.getElementById("root");if(!Qv)throw new Error("#root missing");const ko=Nv(Qv);gt&&window.parent===window&&ko.render(L.jsx(F0,{}));function v_(){return ue.useEffect(()=>{xT()},[]),null}(async()=>{gt&&window.addEventListener("webapp:unauthorized",()=>location.reload());const e=new PT(Qc,new Lv,new FT(gt?async(n,o)=>{const c=an.parse(String(n));return c&&await gt.resume(c),gt.fetch(n,o)}:void 0));if(ti){await ld(an.parse(ti.origin));return}const t=await e.planStartup();if(t.mode==="setup"){ad(t.failure);return}await ld(t.mode==="ready"?t.endpoint:null)})().catch(e=>{gt&&ad(e instanceof Error?e.message:"连接失败,请重新扫码。")});function ad(e=""){globalThis.fetch=qc,delete window.__agentroamNativeFrame,ko.render(L.jsx(uR,{initialFailure:e,onScan:async()=>{const t=await Xv();if(!t||!gt)return;const n=await gt.pair(t);Q1(n),await ld(n)}}))}async function ld(e){try{if(e&&(await(gt==null?void 0:gt.resume(e)),pc.setBaseUrl(e.url),ta=e.url),gt&&e&&window.parent===window){await i_(ko,e,gt,qc),setInterval(()=>{gt.checkAuthorization().catch(()=>{})},1e4);return}window.agentApi=C2;const t=new URLSearchParams(location.search).get("view"),n=t==="collaboration"?Fn(()=>import("./CollaborationPage-Br5fhNce.js"),__vite__mapDeps([11,4,12,2,9,13,14,15,16,8,17,18]),import.meta.url):t==="collaboration-dashboard"?Fn(()=>import("./CollaborationDashboard-mHU8iJYg.js"),__vite__mapDeps([19,8,20,16,21,2,5,14,15,3,9,22,23]),import.meta.url):t==="session-dashboard"?Fn(()=>import("./SessionDashboard-CFXXTm_4.js"),__vite__mapDeps([24,9,25,26,14,15,2,22,3,13,27]),import.meta.url):t==="remote-desktop"?Fn(()=>import("./RemoteDesktopPage-w8aL061W.js"),__vite__mapDeps([28,29,17,3,7,30,2,31,6,10]),import.meta.url):Fn(()=>import("./App-zihaYk1L.js").then(c=>c.a),__vite__mapDeps([32,17,3,21,5,12,4,2,7,1,31,30,33,25,9,26,14,15,20,16,8,34,35]),import.meta.url),[,{default:o}]=await Promise.all([C2.refreshServerModel(),n]);!od&&window.parent===window&&d_(pc),ko.render(L.jsxs(ue.StrictMode,{children:[L.jsx(_5.Provider,{value:L.jsx(U9,{}),children:L.jsx(R5.Provider,{value:L.jsx(y9,{}),children:L.jsx(o,{})})}),L.jsx(v_,{})]})),gt&&setInterval(()=>{gt.checkAuthorization().catch(()=>{})},1e4),e||(window.addEventListener("webapp:unauthorized",()=>location.reload()),y_())}catch(t){if(t instanceof kv&&!od&&window.parent===window){location.replace("/pair");return}if(gt&&window.parent===window){ad(t instanceof Error?t.message:"连接失败,请重新扫码。");return}ko.render(L.jsx("div",{style:{minHeight:"100dvh",display:"flex",alignItems:"center",justifyContent:"center",padding:24,background:"#f5f6fa",boxSizing:"border-box"},children:L.jsxs("div",{style:{maxWidth:560,background:"#fff",borderRadius:12,padding:20,boxShadow:"0 4px 16px rgba(0,0,0,0.08)"},children:[L.jsx("h2",{style:{margin:"0 0 8px",fontSize:16,color:"#dc2626"},children:"界面启动失败"}),L.jsx("p",{style:{margin:"0 0 12px",fontSize:13,color:"#374151",wordBreak:"break-all"},children:t instanceof Error?`${t.name}: ${t.message}`:String(t)}),L.jsx("button",{type:"button",onClick:()=>location.reload(),style:{padding:"8px 20px",fontSize:14,borderRadius:8,border:"1px solid #d6d9e0",background:"#fff",cursor:"pointer"},children:"重试"})]})}))}}function y_(){const e=[...document.scripts].map(n=>n.src).join(",").match(/index-([^/]+)\.js/),t=e?e[1]:null;t&&setInterval(async()=>{if(iy())try{const n=await fetch("/api/agent/model",{credentials:"same-origin",cache:"no-store"});if(n.status===401||n.status===423){location.reload();return}const c=((await n.json()).buildId||"").replace(/^index-|\.js$/g,"");c&&c!==t&&wT()}catch{}},6e4)}export{f7 as $,nR as A,R5 as B,K1 as C,P_ as D,P9 as E,_v as F,I9 as G,L_ as H,I_ as I,vT as J,N_ as K,O9 as L,k9 as M,k_ as N,ey as O,L9 as P,J3 as Q,Ov as R,F0 as S,XT as T,B9 as U,u7 as V,zv as W,Ax as X,O_ as Y,TT as Z,ZT as _,QR as a,IT as a0,GT as a1,VT as a2,YT as a3,S_ as a4,T_ as a5,ST as a6,Fn as a7,G3 as a8,U0 as a9,j0 as aa,sR as ab,R_ as ac,r7 as ad,F9 as ae,Xp as af,_5 as ag,hT as ah,JT as ai,H1 as aj,b_ as ak,aR as al,C_ as am,Wg as an,A_ as ao,dR as b,Rt as c,cc as d,M9 as e,c7 as f,gn as g,b2 as h,iR as i,L as j,E_ as k,iy as l,A9 as m,D9 as n,D_ as o,Uv as p,jv as q,ue as r,mR as s,xR as t,Ci as u,__ as v,wR as w,M_ as x,pR as y,T9 as z};
@@ -1,2 +1,2 @@
1
- import{_ as e,l as s,D as o,d as i}from"./mermaid.core-BEmIap6p.js";import{p as g}from"./cynefin-OW5HDTMX-BZgzPIdr.js";import"./index-DBNVLOBM.js";var p={parse:e(async r=>{const a=await g("info",r);s.debug(a)},"parse")},d={version:"11.17.2"},v=e(()=>d.version,"getVersion"),m={getVersion:v},c=e((r,a,n)=>{s.debug(`rendering info diagram
1
+ import{_ as e,l as s,D as o,d as i}from"./mermaid.core-C8Dl0Nah.js";import{p as g}from"./cynefin-OW5HDTMX-DDCxhkA5.js";import"./index-DKm9ESDq.js";var p={parse:e(async r=>{const a=await g("info",r);s.debug(a)},"parse")},d={version:"11.17.2"},v=e(()=>d.version,"getVersion"),m={getVersion:v},c=e((r,a,n)=>{s.debug(`rendering info diagram
2
2
  `+r);const t=o(a);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${n}`)},"draw"),l={draw:c},b={parser:p,db:m,renderer:l};export{b as diagram};
@@ -1,4 +1,4 @@
1
- import{_ as o,c as ot,a2 as ut,D as dt,an as yt,p as ft,k as pt,n as it,a as gt,b as kt,g as mt,s as wt,o as _t,d as bt}from"./mermaid.core-BEmIap6p.js";import"./index-DBNVLOBM.js";var tt=function(){var e=o(function(M,t,s,i){for(s=s||{},i=M.length;i--;s[M[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],N={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,u,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return u;case 15:u.addNode(n[w-1].length,n[w].trim());break;case 16:u.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(c,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],u=[],p=[null],n=[],v=this.table,w="",I=0,S=0,L=2,E=1,R=n.slice.call(arguments,1),b=Object.create(this.lexer),C={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(C.yy[F]=this.yy[F]);b.setInput(t,C.yy),C.yy.lexer=b,C.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var T=b.yylloc;n.push(T);var D=b.options&&b.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function j(P){i.length=i.length-2*P,p.length=p.length-P,n.length=n.length-P}o(j,"popStack");function z(){var P;return P=u.pop()||b.lex()||E,typeof P!="number"&&(P instanceof Array&&(u=P,P=u.pop()),P=s.symbols_[P]||P),P}o(z,"lex");for(var A,W,B,q,H={},X,V,et,Y;;){if(W=i[i.length-1],this.defaultActions[W]?B=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=z()),B=v[W]&&v[W][A]),typeof B>"u"||!B.length||!B[0]){var Q="";Y=[];for(X in v[W])this.terminals_[X]&&X>L&&Y.push("'"+this.terminals_[X]+"'");b.showPosition?Q="Parse error on line "+(I+1)+`:
1
+ import{_ as o,c as ot,a2 as ut,D as dt,an as yt,p as ft,k as pt,n as it,a as gt,b as kt,g as mt,s as wt,o as _t,d as bt}from"./mermaid.core-C8Dl0Nah.js";import"./index-DKm9ESDq.js";var tt=function(){var e=o(function(M,t,s,i){for(s=s||{},i=M.length;i--;s[M[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],N={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,u,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return u;case 15:u.addNode(n[w-1].length,n[w].trim());break;case 16:u.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(c,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],u=[],p=[null],n=[],v=this.table,w="",I=0,S=0,L=2,E=1,R=n.slice.call(arguments,1),b=Object.create(this.lexer),C={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(C.yy[F]=this.yy[F]);b.setInput(t,C.yy),C.yy.lexer=b,C.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var T=b.yylloc;n.push(T);var D=b.options&&b.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function j(P){i.length=i.length-2*P,p.length=p.length-P,n.length=n.length-P}o(j,"popStack");function z(){var P;return P=u.pop()||b.lex()||E,typeof P!="number"&&(P instanceof Array&&(u=P,P=u.pop()),P=s.symbols_[P]||P),P}o(z,"lex");for(var A,W,B,q,H={},X,V,et,Y;;){if(W=i[i.length-1],this.defaultActions[W]?B=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=z()),B=v[W]&&v[W][A]),typeof B>"u"||!B.length||!B[0]){var Q="";Y=[];for(X in v[W])this.terminals_[X]&&X>L&&Y.push("'"+this.terminals_[X]+"'");b.showPosition?Q="Parse error on line "+(I+1)+`:
2
2
  `+b.showPosition()+`
3
3
  Expecting `+Y.join(", ")+", got '"+(this.terminals_[A]||A)+"'":Q="Parse error on line "+(I+1)+": Unexpected "+(A==E?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(Q,{text:b.match,token:this.terminals_[A]||A,line:b.yylineno,loc:T,expected:Y})}if(B[0]instanceof Array&&B.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+A);switch(B[0]){case 1:i.push(A),p.push(b.yytext),n.push(b.yylloc),i.push(B[1]),A=null,S=b.yyleng,w=b.yytext,I=b.yylineno,T=b.yylloc;break;case 2:if(V=this.productions_[B[1]][1],H.$=p[p.length-V],H._$={first_line:n[n.length-(V||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(V||1)].first_column,last_column:n[n.length-1].last_column},D&&(H._$.range=[n[n.length-(V||1)].range[0],n[n.length-1].range[1]]),q=this.performAction.apply(H,[w,S,I,C.yy,B[1],p,n].concat(R)),typeof q<"u")return q;V&&(i=i.slice(0,-1*V*2),p=p.slice(0,-1*V),n=n.slice(0,-1*V)),i.push(this.productions_[B[1]][0]),p.push(H.$),n.push(H._$),et=v[i[i.length-2]][i[i.length-1]],i.push(et);break;case 3:return!0}}return!0},"parse")},O=function(){var M={EOF:1,parseError:o(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:o(function(t,s){return this.yy=s||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var s=t.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var s=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===u.length?this.yylloc.first_column:0)+u[u.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),s=new Array(t.length+1).join("-");return t+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{g as gt}from"./chunk-5VM5RSS4-1_IZosIm.js";import{a as mt,b as lt,h as xt,d as kt}from"./chunk-F27PBJKO-IZ7w-WCZ.js";import{g as _t,s as vt,a as bt,b as wt,o as Tt,n as St,_ as s,c as R,j as G,d as $t,p as Mt}from"./mermaid.core-BEmIap6p.js";import{d as it}from"./arc-DROGDR5M.js";import"./index-DBNVLOBM.js";var U=function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var X="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?X="Parse error on line "+(C+1)+`:
1
+ import{g as gt}from"./chunk-5VM5RSS4-Buiv0MCN.js";import{a as mt,b as lt,h as xt,d as kt}from"./chunk-F27PBJKO-XBMwIl6X.js";import{g as _t,s as vt,a as bt,b as wt,o as Tt,n as St,_ as s,c as R,j as G,d as $t,p as Mt}from"./mermaid.core-C8Dl0Nah.js";import{d as it}from"./arc-BRj_RXHL.js";import"./index-DKm9ESDq.js";var U=function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var X="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?X="Parse error on line "+(C+1)+`:
2
2
  `+_.showPosition()+`
3
3
  Expecting `+z.join(", ")+", got '"+(this.terminals_[b]||b)+"'":X="Parse error on line "+(C+1)+": Unexpected "+(b==D?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(X,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Y,expected:z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+b);switch(T[0]){case 1:l.push(b),d.push(_.yytext),c.push(_.yylloc),l.push(T[1]),b=null,Q=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=d[d.length-M],F._$={first_line:c[c.length-(M||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(M||1)].first_column,last_column:c[c.length-1].last_column},ft&&(F._$.range=[c[c.length-(M||1)].range[0],c[c.length-1].range[1]]),q=this.performAction.apply(F,[k,Q,C,I.yy,T[1],d,c].concat(dt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),d=d.slice(0,-1*M),c=c.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),d.push(F.$),c.push(F._$),et=v[l[l.length-2]][l[l.length-1]],l.push(et);break;case 3:return!0}}return!0},"parse")},m=function(){var h={EOF:1,parseError:s(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:s(function(r,n){return this.yy=n||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var n=r.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:s(function(r){var n=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var d=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var r=this.pastInput(),n=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{_ as c,l as te,c as W,D as fe,ah as ye,ai as be,aj as me,af as _e,B as Y,i as G,Z as ke,$ as Ee,ac as Se,ad as le,ae as ce}from"./mermaid.core-BEmIap6p.js";import{g as Ne}from"./chunk-5VM5RSS4-1_IZosIm.js";import"./index-DBNVLOBM.js";var $=function(){var t=c(function(_,s,n,a){for(n=n||{},a=_.length;a--;n[_[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],k=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],j=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],M=[1,35],U=[1,36],A=[1,6,7,11,13,16,17,20,23],H=[1,38],B={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,V){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:j}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(P,[2,14],{7:M,11:U}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:j}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:H}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:M,11:U}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:H}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],V=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(T.yy[J]=this.yy[J]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var Z=m.yylloc;e.push(Z);var de=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var E,R,v,q,F={},X,I,oe,K;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((E===null||typeof E>"u")&&(E=ae()),v=V[R]&&V[R][E]),typeof v>"u"||!v.length||!v[0]){var Q="";K=[];for(X in V[R])this.terminals_[X]&&X>ue&&K.push("'"+this.terminals_[X]+"'");m.showPosition?Q="Parse error on line "+(z+1)+`:
1
+ import{_ as c,l as te,c as W,D as fe,ah as ye,ai as be,aj as me,af as _e,B as Y,i as G,Z as ke,$ as Ee,ac as Se,ad as le,ae as ce}from"./mermaid.core-C8Dl0Nah.js";import{g as Ne}from"./chunk-5VM5RSS4-Buiv0MCN.js";import"./index-DKm9ESDq.js";var $=function(){var t=c(function(_,s,n,a){for(n=n||{},a=_.length;a--;n[_[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],k=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],j=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],M=[1,35],U=[1,36],A=[1,6,7,11,13,16,17,20,23],H=[1,38],B={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,V){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:j}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(P,[2,14],{7:M,11:U}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:j}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:H}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:M,11:U}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:H}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],V=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(T.yy[J]=this.yy[J]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var Z=m.yylloc;e.push(Z);var de=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var E,R,v,q,F={},X,I,oe,K;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((E===null||typeof E>"u")&&(E=ae()),v=V[R]&&V[R][E]),typeof v>"u"||!v.length||!v[0]){var Q="";K=[];for(X in V[R])this.terminals_[X]&&X>ue&&K.push("'"+this.terminals_[X]+"'");m.showPosition?Q="Parse error on line "+(z+1)+`:
2
2
  `+m.showPosition()+`
3
3
  Expecting `+K.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Q="Parse error on line "+(z+1)+": Unexpected "+(E==re?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Q,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:Z,expected:K})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+E);switch(v[0]){case 1:a.push(E),u.push(m.yytext),e.push(m.yylloc),a.push(v[1]),E=null,ie=m.yyleng,l=m.yytext,z=m.yylineno,Z=m.yylloc;break;case 2:if(I=this.productions_[v[1]][1],F.$=u[u.length-I],F._$={first_line:e[e.length-(I||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(I||1)].first_column,last_column:e[e.length-1].last_column},de&&(F._$.range=[e[e.length-(I||1)].range[0],e[e.length-1].range[1]]),q=this.performAction.apply(F,[l,ie,z,T.yy,v[1],u,e].concat(ge)),typeof q<"u")return q;I&&(a=a.slice(0,-1*I*2),u=u.slice(0,-1*I),e=e.slice(0,-1*I)),a.push(this.productions_[v[1]][0]),u.push(F.$),e.push(F._$),oe=V[a[a.length-2]][a[a.length-1]],a.push(oe);break;case 3:return!0}}return!0},"parse")},y=function(){var _={EOF:1,parseError:c(function(n,a){if(this.yy.parser)this.yy.parser.parseError(n,a);else throw new Error(n)},"parseError"),setInput:c(function(s,n){return this.yy=n||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:c(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var n=s.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:c(function(s){var n=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===o.length?this.yylloc.first_column:0)+o[o.length-a.length].length-a[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:c(function(){return this._more=!0,this},"more"),reject:c(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:c(function(s){this.unput(this.match.slice(s))},"less"),pastInput:c(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:c(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:c(function(){var s=this.pastInput(),n=new Array(s.length+1).join("-");return s+this.upcomingInput()+`