limixbot 0.3.129 → 0.3.130

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 (167) hide show
  1. package/dist/assets/{ActivityPanel-C092xjIk.js → ActivityPanel-CswemPGx.js} +1 -1
  2. package/dist/assets/{App-CFt1bVwj.js → App-CeGk9O7P.js} +135 -134
  3. package/dist/assets/{AppEventEditor-C00_DMLy.js → AppEventEditor-lydjfKAA.js} +1 -1
  4. package/dist/assets/{BotSettingsDialog-81Yk4G56.js → BotSettingsDialog-BGO7s2Sa.js} +4 -4
  5. package/dist/assets/{BrowserPanel-BZiZr6JO.js → BrowserPanel-WFfhXRW4.js} +1 -1
  6. package/dist/assets/{BrowserProfilesManager-CIDDGvM_.js → BrowserProfilesManager-DAI3EyaZ.js} +1 -1
  7. package/dist/assets/{CloudAddDialog-bLdejHsc.js → CloudAddDialog-Lo18f6GE.js} +1 -1
  8. package/dist/assets/{ComputerFilesPane-Ce9ODuX8.js → ComputerFilesPane-LtL8VMhS.js} +1 -1
  9. package/dist/assets/{ComputerPanel-Dpekp0Z2.js → ComputerPanel-mEdoL4Dh.js} +2 -2
  10. package/dist/assets/{DataPanel-i5mxANER.js → DataPanel-HeNk8eOt.js} +1 -1
  11. package/dist/assets/{DesktopViewer-B9mw98xI.js → DesktopViewer-DCC-jq_j.js} +1 -1
  12. package/dist/assets/{GrokMoveDialog-DYarhzxZ.js → GrokMoveDialog-I9x5B1Kv.js} +1 -1
  13. package/dist/assets/{InspectorPanel-D5ulGIOz.js → InspectorPanel-C-ocpaf1.js} +1 -1
  14. package/dist/assets/{KeyboardShortcutsModal-BVDKAY0o.js → KeyboardShortcutsModal-D73O8To_.js} +1 -1
  15. package/dist/assets/{LimixResizeHandles-Jjthi0zS.js → LimixResizeHandles-kOyb_U62.js} +1 -1
  16. package/dist/assets/{LiveDesktop-CFqHs50a.js → LiveDesktop-DYg8H5rp.js} +1 -1
  17. package/dist/assets/{LocalVmWorkspace-DbB_ec11.js → LocalVmWorkspace-BsGviUnb.js} +1 -1
  18. package/dist/assets/{MacLocalControl-DoWLhevV.js → MacLocalControl-Db0f-6Gc.js} +1 -1
  19. package/dist/assets/{MarkdownFilePreview-CCaYi8EP.js → MarkdownFilePreview-Dj8Z6Mm0.js} +1 -1
  20. package/dist/assets/{MenuMotion-DG5tk0i3.js → MenuMotion-CgVWckHz.js} +1 -1
  21. package/dist/assets/{NewBotDialog-CWbeGI3M.js → NewBotDialog-Bp8-zb5M.js} +1 -1
  22. package/dist/assets/{PhoneAppDialog-BErSSwmM.js → PhoneAppDialog-BWtFp9EN.js} +1 -1
  23. package/dist/assets/{PlacesRail-CAV7kW3Y.js → PlacesRail-CKR79j8d.js} +1 -1
  24. package/dist/assets/{PluginsPanel-BKQ4in_K.js → PluginsPanel-BZe968J8.js} +2 -2
  25. package/dist/assets/{ProIntroduction-DgDPOYzn.js → ProIntroduction-CZGUC6Ms.js} +1 -1
  26. package/dist/assets/{RemoteAgentSettingsPanel-BsD_TT_T.js → RemoteAgentSettingsPanel-CCOe2O1O.js} +1 -1
  27. package/dist/assets/{RoomPanel-UR35p-lT.js → RoomPanel-jgyrxLn2.js} +1 -1
  28. package/dist/assets/{RoutinesPage-Cims3t6g.js → RoutinesPage-D5Z3pmtB.js} +2 -2
  29. package/dist/assets/{SettingsModal-2S8H2h_g.js → SettingsModal-CeKynb83.js} +2 -2
  30. package/dist/assets/{ShareTeamDialog-org_7J0x.js → ShareTeamDialog-D7qwIwXJ.js} +1 -1
  31. package/dist/assets/{SignedInSites-Dp2PSLBK.js → SignedInSites-Dh9imU42.js} +1 -1
  32. package/dist/assets/{TeamLibraryPanel-Ch-zZVWY.js → TeamLibraryPanel-nz4rcGmz.js} +1 -1
  33. package/dist/assets/{TeamMapPage-Ba7y1YPZ.js → TeamMapPage-CLdRh0ZK.js} +1 -1
  34. package/dist/assets/{TriggersPage-qUNQ79Nb.js → TriggersPage-BByyX4CZ.js} +1 -1
  35. package/dist/assets/VisibilitySection-BNhdo2-L.js +22 -0
  36. package/dist/assets/{WebhookTrigger-DjYDUzGP.js → WebhookTrigger-DxDhbnYz.js} +1 -1
  37. package/dist/assets/{WorksOnGrid-wPPuMbjR.js → WorksOnGrid-CUh8CexO.js} +1 -1
  38. package/dist/assets/{abnfDiagram-YUKMZFIV-v0NjYm2N.js → abnfDiagram-YUKMZFIV-uSJsuKuD.js} +1 -1
  39. package/dist/assets/{activity-DONzM_Hr.js → activity-CmQeVvqw.js} +1 -1
  40. package/dist/assets/{architectureDiagram-47P4ROYG-C9p47RSg.js → architectureDiagram-47P4ROYG-Br4Cv9sO.js} +1 -1
  41. package/dist/assets/{blockDiagram-E7TT5TSB-BjCDCsDZ.js → blockDiagram-E7TT5TSB-CzcaYs_s.js} +1 -1
  42. package/dist/assets/{c4Diagram-CRA5TL53-BwcLeGrs.js → c4Diagram-CRA5TL53-CDGjKlxD.js} +1 -1
  43. package/dist/assets/{calendar-days-C0163EM9.js → calendar-days-DSUOH-dL.js} +1 -1
  44. package/dist/assets/channel-N74fzi1P.js +1 -0
  45. package/dist/assets/{chunk-2Q5K7J3B-DkMrEZ1P.js → chunk-2Q5K7J3B-CvuZ4KJD.js} +1 -1
  46. package/dist/assets/{chunk-5VM5RSS4-BvT5jzrf.js → chunk-5VM5RSS4-negAvO9N.js} +1 -1
  47. package/dist/assets/{chunk-7TKQ45FW-BPY6DMgY.js → chunk-7TKQ45FW-DA_OVnE1.js} +1 -1
  48. package/dist/assets/{chunk-AW2ZBBNX-CA02FkCe.js → chunk-AW2ZBBNX-Dbtemotq.js} +1 -1
  49. package/dist/assets/{chunk-FVRAUYC3-DR_HIm4k.js → chunk-FVRAUYC3-Cnt25BNn.js} +2 -2
  50. package/dist/assets/{chunk-HTAEGDNF--Q5YJ5qq.js → chunk-HTAEGDNF-CtrZ11_G.js} +1 -1
  51. package/dist/assets/{chunk-JWPE2WC7-CdUxnp0z.js → chunk-JWPE2WC7-DKZW0s8n.js} +1 -1
  52. package/dist/assets/{chunk-KQW6MTUR-CZ_kOJX4.js → chunk-KQW6MTUR-DLg5U6as.js} +1 -1
  53. package/dist/assets/{chunk-XXDRQBXY-Baw_LI4a.js → chunk-XXDRQBXY-pkGzgUQb.js} +1 -1
  54. package/dist/assets/{classDiagram-v2-K4WV4PDN-C3p6RSXv.js → classDiagram-v2-K4WV4PDN-BUBR3HPE.js} +1 -1
  55. package/dist/assets/{coins-CRTGCu3d.js → coins-Dbmac6SO.js} +1 -1
  56. package/dist/assets/{core-C6iWxuTj.js → core-BA6DGyEo.js} +1 -1
  57. package/dist/assets/{cose-bilkent-JH36ORCC-DexASxvw.js → cose-bilkent-JH36ORCC-BukDY2ET.js} +1 -1
  58. package/dist/assets/{cynefin-EF2NZ3EQ-CnBYCH8E.js → cynefin-EF2NZ3EQ-B3XBpINL.js} +1 -1
  59. package/dist/assets/{cynefinDiagram-3GCD6N5R-BxlPVTxc.js → cynefinDiagram-3GCD6N5R-BV0SrhK6.js} +1 -1
  60. package/dist/assets/{dagre-W4DXFKR2-DwHsGS35.js → dagre-W4DXFKR2-DzXXYwns.js} +1 -1
  61. package/dist/assets/{diagram-2UJZ2QOL-BitCWJhQ.js → diagram-2UJZ2QOL-BmOG88-j.js} +1 -1
  62. package/dist/assets/{diagram-OVF4WLC6-DVq8AK9P.js → diagram-OVF4WLC6-C9zP_sNp.js} +1 -1
  63. package/dist/assets/{diagram-PFPMY2P6-B1CGGTYD.js → diagram-PFPMY2P6-UzTTpwh8.js} +1 -1
  64. package/dist/assets/{diagram-UMYRVEAY-BJOrT_fX.js → diagram-UMYRVEAY-Bo-9jQh-.js} +1 -1
  65. package/dist/assets/{diagram-YEKJPTXX-CqTidMyp.js → diagram-YEKJPTXX-eNeARjiU.js} +1 -1
  66. package/dist/assets/{diagram-ZIFT7M5P-BrETFWbJ.js → diagram-ZIFT7M5P-Bp8Apm58.js} +1 -1
  67. package/dist/assets/{ebnfDiagram-VR2GEFS7-odzlCiG_.js → ebnfDiagram-VR2GEFS7-CThvAW5-.js} +1 -1
  68. package/dist/assets/{elk-IJKZMXRS-DOqejjFU.js → elk-IJKZMXRS-CIAQeuC1.js} +1 -1
  69. package/dist/assets/{erDiagram-O2IAPWRE-pus74-u1.js → erDiagram-O2IAPWRE-DJc0-QG5.js} +1 -1
  70. package/dist/assets/{file-up-VlqNWssp.js → file-up-uBDzou4C.js} +1 -1
  71. package/dist/assets/{flowDiagram-OXPTDLAJ-BoR02YXy.js → flowDiagram-OXPTDLAJ-CX1UCZsi.js} +1 -1
  72. package/dist/assets/{ganttDiagram-R7TSEDQI-DEWJjq9w.js → ganttDiagram-R7TSEDQI-CFCWgBLl.js} +1 -1
  73. package/dist/assets/{gitGraphDiagram-XJZIOB7I-A0Ut1vzJ.js → gitGraphDiagram-XJZIOB7I-BY59AEfH.js} +1 -1
  74. package/dist/assets/{import-name-Dzn9IajS.js → import-name-gQROrWbj.js} +1 -1
  75. package/dist/assets/{index-ByrnprY3.js → index-CkdvX5_R.js} +1 -1
  76. package/dist/assets/{index-DoClz3zG.js → index-a4OBw5ZS.js} +3 -3
  77. package/dist/assets/{infoDiagram-5W2HQ5XZ-IrI9xNS5.js → infoDiagram-5W2HQ5XZ-CiWYCcE-.js} +1 -1
  78. package/dist/assets/{ishikawaDiagram-K3B6WC7H-CcZaBkPV.js → ishikawaDiagram-K3B6WC7H-DXZKShaj.js} +1 -1
  79. package/dist/assets/{journeyDiagram-COXZFDF6-Lhq1JIrG.js → journeyDiagram-COXZFDF6-qrPSJHoF.js} +1 -1
  80. package/dist/assets/{kanban-definition-P3RFRI5V-Dpnd1w1Z.js → kanban-definition-P3RFRI5V-Ch9e9C4r.js} +1 -1
  81. package/dist/assets/{mermaid.core-CwYv1-pN.js → mermaid.core-DQALiqHr.js} +4 -4
  82. package/dist/assets/{mindmap-definition-LZFPQGKD-BQu-1VuI.js → mindmap-definition-LZFPQGKD-BirJD4xj.js} +1 -1
  83. package/dist/assets/{minimize-BRtvUvR3.js → minimize-DlAHYBEI.js} +1 -1
  84. package/dist/assets/{monitor-Gc_xwWHG.js → monitor-B-DfxCLW.js} +1 -1
  85. package/dist/assets/{new-bot-CMIOaWIO.js → new-bot-CAtQzQF1.js} +1 -1
  86. package/dist/assets/{org-library-CwIWLSKR.js → org-library-PVNP5n7J.js} +1 -1
  87. package/dist/assets/{package-format-C4Kbcf94.js → package-format-xp0kEF1i.js} +1 -1
  88. package/dist/assets/{pegDiagram-BGZESJAR-C2kBJx8q.js → pegDiagram-BGZESJAR-UzkL237f.js} +1 -1
  89. package/dist/assets/{pieDiagram-CAPJLFHJ-3IGf8-rd.js → pieDiagram-CAPJLFHJ-CPI42dPn.js} +1 -1
  90. package/dist/assets/{quadrantDiagram-GDMTTRAM-Ds0i1JJu.js → quadrantDiagram-GDMTTRAM-BEcjaKog.js} +1 -1
  91. package/dist/assets/{rail-BxO9nJ7b.js → rail-DzsIoRRT.js} +1 -1
  92. package/dist/assets/{railroadDiagram-SM67HX2B-C5HMZeLZ.js → railroadDiagram-SM67HX2B-B0KHoW-7.js} +1 -1
  93. package/dist/assets/{remote-desktop-panel-z23u6kyq.js → remote-desktop-panel-BtSv4c6E.js} +1 -1
  94. package/dist/assets/{requirementDiagram-X7JNWC4A-W7wEhXbS.js → requirementDiagram-X7JNWC4A-BdBqE5oc.js} +1 -1
  95. package/dist/assets/{sankeyDiagram-UM26HJRW-BIIvZEMK.js → sankeyDiagram-UM26HJRW-o-m5UnNV.js} +1 -1
  96. package/dist/assets/{sequenceDiagram-ZO4K6R2Y-B6ZAapb0.js → sequenceDiagram-ZO4K6R2Y-CS89JhnM.js} +1 -1
  97. package/dist/assets/{sizeCapture-INFHLROL-CijBtoJ-.js → sizeCapture-INFHLROL-u3jsM9rY.js} +1 -1
  98. package/dist/assets/{stateDiagram-v2-TBUQTH76-gVAJTp58.js → stateDiagram-v2-TBUQTH76-ZR8x5js6.js} +1 -1
  99. package/dist/assets/styles-_tGCSCNl.css +1 -0
  100. package/dist/assets/{swimlanes-N4OXWK64-1T5CmmoT.js → swimlanes-N4OXWK64-CxHXcQ4B.js} +1 -1
  101. package/dist/assets/swimlanesDiagram-K3J5GTZL-DJxa56rP.js +8 -0
  102. package/dist/assets/{team-share-DZ71boDj.js → team-share-DNj2KZjX.js} +1 -1
  103. package/dist/assets/{timeline-definition-YOQAKGHF-b2WZ1F71.js → timeline-definition-YOQAKGHF-Bhgot_xM.js} +1 -1
  104. package/dist/assets/{usecaseDiagram-VIAY4XPW-DvPVm705.js → usecaseDiagram-VIAY4XPW-C4T3EUA4.js} +1 -1
  105. package/dist/assets/{vennDiagram-BLWOH2XV-BG-PWVxl.js → vennDiagram-BLWOH2XV-B1Z8NDj7.js} +1 -1
  106. package/dist/assets/{wardleyDiagram-YMQ3BMBF-5xjAr3nW.js → wardleyDiagram-YMQ3BMBF-D3gNVcd7.js} +1 -1
  107. package/dist/assets/{xychartDiagram-TAQBALBS-DgoVlD5n.js → xychartDiagram-TAQBALBS-CM-Am2Dc.js} +1 -1
  108. package/dist/index.html +3 -3
  109. package/dist/rail.html +6 -6
  110. package/dist-server/bot-box/box-check.js +6 -6
  111. package/dist-server/drivers/agents-proxy.js +50 -48
  112. package/dist-server/hybrid-plugin-gateway.js +1489 -0
  113. package/dist-server/index.js +5546 -5454
  114. package/dist-server/limixbot.js +517 -508
  115. package/dist-server/mcp-gate.js +76 -61
  116. package/dist-server/mcp-remote-proxy.js +26 -23
  117. package/dist-server/mcp-server.js +28 -25
  118. package/dist-server/package.json +1 -1
  119. package/dist-server/pair-cli.js +517 -508
  120. package/dist-server/scripts/mcp-server.js +30 -27
  121. package/dist-server/server/agents-turn.js +1 -0
  122. package/dist-server/server/auto-approve.js +2 -0
  123. package/dist-server/server/bot-box/env.js +2 -2
  124. package/dist-server/server/cli-usage.js +2 -2
  125. package/dist-server/server/drivers/acp/native-process-sampler.js +84 -0
  126. package/dist-server/server/drivers/acp/quiet-status.js +12 -3
  127. package/dist-server/server/drivers/agents-call.js +4 -0
  128. package/dist-server/server/drivers/agents-catalog-profile.js +1 -0
  129. package/dist-server/server/drivers/agents-catalog.js +16 -1
  130. package/dist-server/server/drivers/agents-mcp-env.js +1 -1
  131. package/dist-server/server/drivers/claude-elicitation.js +21 -9
  132. package/dist-server/server/drivers/elicited-consent.js +24 -0
  133. package/dist-server/server/headless/client.js +10 -9
  134. package/dist-server/server/headless/main.js +1 -1
  135. package/dist-server/server/hybrid-plugin-gateway.js +162 -0
  136. package/dist-server/server/hybrid-plugin-manifest.js +99 -0
  137. package/dist-server/server/index.js +41 -3
  138. package/dist-server/server/limix-native-path.js +8 -0
  139. package/dist-server/server/mcp-app-connections.js +58 -5
  140. package/dist-server/server/mcp-gate-tasks.js +75 -0
  141. package/dist-server/server/mcp-gate.js +81 -5
  142. package/dist-server/server/mcp-http.js +34 -6
  143. package/dist-server/server/mcp-native-response.js +112 -0
  144. package/dist-server/server/mcp-skills.js +263 -0
  145. package/dist-server/server/mcp-trim.js +15 -8
  146. package/dist-server/server/plugin-hub.js +259 -25
  147. package/dist-server/server/plugin-passages.js +16 -0
  148. package/dist-server/server/routes/plugin-mcp.js +118 -0
  149. package/dist-server/server/routes/plugin-studio.js +50 -0
  150. package/dist-server/server/side-jobs.js +1 -1
  151. package/dist-server/shared/plugin-hub.js +6 -2
  152. package/dist-server/vps-container-mcp.js +6 -6
  153. package/package.json +1 -1
  154. package/skills/limix-bot-factory/SKILL.md +2 -0
  155. package/skills/limix-bot-factory/assets/schemas/bot-spec.schema.json +14 -0
  156. package/skills/limix-bot-factory/references/integration-blueprint.md +1 -1
  157. package/skills/limix-bot-factory/references/vi.md +4 -0
  158. package/skills/limix-bot-factory/scripts/factorylib/cli.py +2 -1
  159. package/skills/limix-bot-factory/scripts/factorylib/core.py +19 -1
  160. package/skills/limix-bot-factory/scripts/factorylib/engine.py +10 -1
  161. package/skills/limix-bot-factory/scripts/mcp_server.py +3 -3
  162. package/dist/assets/VisibilitySection-DdEr_5bZ.js +0 -22
  163. package/dist/assets/channel-BloV1v8U.js +0 -1
  164. package/dist/assets/mcp-servers-iT-sFJLT.js +0 -1
  165. package/dist/assets/styles-DiAFRlxu.css +0 -1
  166. package/dist/assets/swimlanesDiagram-K3J5GTZL-D0mOoyOD.js +0 -8
  167. /package/dist/assets/{styles-Be5qq6WR.js → styles-CE92r4H3.js} +0 -0
@@ -1,3 +1,3 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/App-CFt1bVwj.js","assets/styles-Be5qq6WR.js","assets/styles-DiAFRlxu.css","assets/PlacesRail-CAV7kW3Y.js","assets/monitor-Gc_xwWHG.js","assets/MenuMotion-DG5tk0i3.js","assets/DesktopViewer-B9mw98xI.js","assets/desktop-connection-Dfaq6k5a.js","assets/desktop-viewer-CF-OpSo0.js","assets/minimize-BRtvUvR3.js"])))=>i.map(i=>d[i]);
2
- import{t as s,ar as vt,s as T,as as St,g as Ye,o as xe,at as qe,N as jt,I as Nt,r as u,au as Et,y as be,av as Pe,w as Te,aw as Ie,ax as Ct,ay as Pt,j as r,S as Je,X as Tt,a as $,az as It,aA as _t,k as W,L as At,a8 as re,R as ae,ae as _e,p as U,aB as Lt,l as Ot,x as Rt,z as $t,A as Ht,B as Dt,aC as Mt,aD as zt,E as Bt,D as Ft,F as Ut,P as Wt,_ as Ze}from"./styles-Be5qq6WR.js";function fo(e,t){if(!t)return;if(t.kind!=="session")return t.kind==="loopback"?e:void 0;if(t.team||t.scopes.includes("admin"))return e;const n=t.email;if(n?.trim())return e?.email?.trim().toLowerCase()===n.trim().toLowerCase()?e:{email:n}}const Qe="omb.team-sign-in";function Kt(e){try{e&&globalThis.localStorage?.setItem(Qe,e)}catch{}}function Vt(){try{return globalThis.localStorage?.getItem(Qe)??null}catch{return null}}async function te(e=fetch){let t;try{t=await e("/api/auth/session",{credentials:"same-origin"})}catch(a){return{kind:"unreachable",error:a instanceof Error?a.message:String(a)}}const n=await t.json().catch(()=>({})),o=Object(n);return t.status===401||t.status===403?{kind:"unauthenticated",error:typeof o.error=="string"?o.error:`${t.status}`}:t.ok?o.kind==="session"&&typeof o.id=="string"?{kind:"session",id:o.id,label:typeof o.label=="string"?o.label:"",...typeof o.email=="string"?{email:o.email}:{},scopes:Array.isArray(o.scopes)?o.scopes.filter(a=>typeof a=="string"):[],expiresAt:typeof o.expiresAt=="number"?o.expiresAt:0,...typeof o.reactor=="string"?{reactor:o.reactor}:{},...typeof o.teamSignIn=="string"?{teamSignIn:o.teamSignIn}:{},...Ae(o.team)?{team:Ae(o.team),openedThreads:Array.isArray(o.openedThreads)?o.openedThreads.filter(a=>typeof a=="string"):[]}:{},...o.cloudGuest===!0?{cloudGuest:!0,openedThreads:Array.isArray(o.openedThreads)?o.openedThreads.filter(a=>typeof a=="string"):[]}:{}}:o.trust==="service"?{kind:"loopback",trust:"service"}:{kind:"loopback"}:{kind:"unreachable",error:`${t.status} ${t.statusText}`}}function Ae(e){const t=Object(e);return typeof t.id=="string"&&typeof t.name=="string"&&typeof t.role=="string"?{id:t.id,name:t.name,role:t.role}:null}function Xt(e){return e?.kind==="session"||e?.kind==="loopback"&&e.trust!=="service"}function et(e){return e?e.kind==="loopback"?e.trust!=="service":e.kind==="session"&&e.scopes.includes("admin"):!1}function Gt(){const e=/[#&]code=([^&]+)/.exec(location.hash);return e?(history.replaceState(null,"",location.pathname+location.search),decodeURIComponent(e[1])):null}function Yt(){if(!/[#&]signin=/.test(location.hash))return null;const e=/[#&]signin=(omb_pair_[A-Za-z0-9_-]{43})(?:&|$)/.exec(location.hash);return history.replaceState(null,"",location.pathname+location.search),e?e[1]:null}function qt(){const e=new URLSearchParams(location.search),t=e.get("email")?.trim().toLowerCase()??"";if(!t)return null;e.delete("email");const n=e.toString();return history.replaceState(null,"",location.pathname+(n?`?${n}`:"")+location.hash),/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(t)?t:null}function tt(e=navigator.userAgent){const t=/Edg\//.test(e)?"Edge":/OPR\//.test(e)?"Opera":/Chrome\//.test(e)?"Chrome":/Firefox\//.test(e)?"Firefox":/Safari\//.test(e)?"Safari":"Browser",n=/iPhone/.test(e)?"iPhone":/iPad/.test(e)?"iPad":/Android/.test(e)?"Android":/Mac OS X/.test(e)?"Mac":/Windows/.test(e)?"Windows":/Linux/.test(e)?"Linux":"";return n?`${t} on ${n}`:t}function J(){return typeof crypto?.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,14)}`}function nt(e,t){const n=Reflect.get(Object(e),"error");return vt(e,typeof n=="string"?n:`${t.status} ${t.statusText}`)}async function ce(e,t=fetch){let n;try{n=await t("/api/auth/pair",{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify({code:e.code,label:e.label,cookie:!0,attemptId:e.attemptId??J(),...e.browser?{browser:!0}:{}})})}catch(a){return{ok:!1,error:s("pair.unreachable",{error:a instanceof Error?a.message:String(a)})}}const o=await n.json().catch(()=>({}));return n.ok?{ok:!0}:{ok:!1,error:nt(o,n)}}async function Jt(e,t=fetch){try{const n=await t("/api/auth/pair",{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify({code:e,browser:!0,preview:!0})}),o=Object(await n.json().catch(()=>({}))),a=Reflect.get(o,"owner"),i=Reflect.get(o,"team");return n.ok&&typeof a=="string"&&a?{owner:a,...typeof i=="string"&&i.trim()?{team:i.trim()}:{}}:null}catch{return null}}function Zt(e,t,n=fetch){return ce({code:e,label:tt(),attemptId:t,browser:!0},n)}function ho(e){const t=Object(e);return t.cloudHome===!0&&typeof t.owner=="string"&&t.owner?t.owner:null}async function ot(e,t,n){let o;try{o=await n(e,{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify(t)})}catch(i){return{ok:!1,error:s("pair.unreachable",{error:i instanceof Error?i.message:String(i)})}}const a=await o.json().catch(()=>({}));return o.ok?{ok:!0}:{ok:!1,error:nt(a,o)}}function Qt(e,t=fetch){return ot("/api/auth/email/start",{email:e},t)}function en(e,t=fetch){return ot("/api/auth/email/verify",{email:e.email,code:e.code,label:e.label},t)}function Le(e){return!e||/through a proxy|loopback host required|cross-origin request|^40[13]$/i.test(e)?null:e}function tn(){window.ogb?.softwareRendering===!0&&(document.documentElement.dataset.softwareRendering="")}const nn="/api/theme-assets/",on="safe-look",rt={cssChars:1e5,assetBytes:10*1024*1024},rn=/^[a-z0-9][a-z0-9-]{0,47}$/,an=/^[a-z0-9][a-z0-9_-]{0,79}\.(png|jpe?g|webp|gif|avif|svg|woff2?|ttf|otf)$/,sn=/^\/api\/theme-assets\/[a-z0-9][a-z0-9-]{0,47}\/[a-z0-9][a-z0-9_-]{0,79}\.[a-z0-9]{2,5}$/,at=["app","panel","frame","raised","raised-hover","card","inset","control","composer","composer-ring","menu","menu-hover","menu-active","hairline","edge","scrollbar","ink","ink-secondary","ink-tertiary","accent","accent-border","accent-text","accent-ink","focus","bubble-user","bubble-user-ink","success","success-ink","danger","danger-ink","warning"],Z=T().trim().regex(/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i,"a hex colour such as #1a2b3c"),ln=T().trim().min(1).max(120).regex(/^[#a-z0-9(),.%\s/+-]+$/i,"a CSS colour such as #1a2b3c, rgb(…) or color-mix(…)").refine(e=>!/url|image|src|attr/i.test(e),"a colour, not a file"),st=St(Ye(at),ln),Oe=xe({canvas:Z.optional(),accent:Z.optional(),colors:st.optional()}).strict(),ge=xe({name:T().trim().min(1).max(60),skin:Ye([...qe,"system"]).optional(),canvas:Z.optional(),accent:Z.optional(),colors:st.optional(),light:Oe.optional(),dark:Oe.optional(),font:T().trim().max(300).regex(/^[\w\s"',.-]*$/,'a font-family list such as "Inter Variable", serif').optional(),css:T().max(rt.cssChars).optional()}).strict(),cn=1;xe({mausbotTheme:Nt(cn),id:T().regex(rn).optional(),theme:ge,assets:jt(T().regex(an),T().max(Math.ceil(rt.assetBytes*1.4)).regex(/^data:[\w/+.-]+;base64,[A-Za-z0-9+/=]+$/)).optional()}).strict();function it(e){return/^data:/i.test(e)||e.startsWith("#")||sn.test(e)&&!e.includes("..")}function lt(e){const t=e.toLowerCase(),n=[];for(let o=t.indexOf("url(");o!==-1;o=t.indexOf("url(",o+4)){let a=o+4;for(;/\s/.test(e[a]??"");)a++;const i=e[a];let c;if(i==='"'||i==="'"){const l=e.indexOf(i,a+1);if(l===-1)return null;for(c=e.slice(a+1,l),a=l+1;/\s/.test(e[a]??"");)a++;if(e[a]!==")")return null}else{const l=e.indexOf(")",a);if(l===-1||(c=e.slice(a,l).trim(),/[\s"'(]/.test(c)))return null}n.push(c.trim())}return n}const ct=/image-set\(|\bimage\(|\bsrc\(/i;function ut(e){if(e.includes("\\")||ct.test(e))return!0;const t=lt(e);return t===null||t.some(n=>!it(n))}function un(e){let t="";for(let n=0;n<e.length;n++){const o=e[n];if(o==="/"&&e[n+1]==="*"){const a=e.indexOf("*/",n+2);n=a===-1?e.length:a+1,t+=" "}else if(o==='"'||o==="'"){let a=n+1;for(;a<e.length&&e[a]!==o&&e[a]!==`
3
- `;)a+=e[a]==="\\"?2:1;t+=`${o}${" ".repeat(Math.max(0,a-n-1))}${o}`,n=a}else t+=o}return t}function xo(e){const t=un(e);if(/@import/i.test(t))return"@import is not allowed: themes cannot load other stylesheets.";if(t.includes("\\"))return"Backslash escapes are only allowed inside quoted strings.";if(ct.test(t))return"image-set(), image() and src() are not allowed: use url() with a theme file or a data: address.";const n=e.replace(/\/\*[\s\S]*?\*\//g," "),o=lt(n);if(o===null)return'A url() could not be read. Write url("/api/theme-assets/<theme>/<file>").';const a=o.find(i=>!it(i));return a!==void 0?`url(${a.slice(0,80)}) is not allowed: themes load only their own files (${nn}<theme>/<file>), data: addresses or #ids, never the internet.`:null}function ue(e=typeof document>"u"?null:document.documentElement){if(!e||typeof window>"u"||typeof window.getComputedStyle!="function")return"dark";try{return window.getComputedStyle(e).getPropertyValue("--code-color-scheme").trim()==="light"?"light":"dark"}catch{return"dark"}}function bo(){const[e,t]=u.useState(()=>ue());return u.useEffect(()=>{const n=()=>t(ue());if(n(),typeof MutationObserver>"u")return;const o=new MutationObserver(n);return o.observe(document.documentElement,{attributes:!0,attributeFilter:["data-skin"]}),()=>o.disconnect()},[]),e}const N=[255,255,255],P=[0,0,0];function Q(e){const t=e.trim().replace(/^#/,""),n=t.length===3?[...t].map(a=>a+a).join(""):t,o=Number.parseInt(n.slice(0,6),16);return Number.isFinite(o)?[o>>16&255,o>>8&255,o&255]:P}const K=e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,"0"),d=([e,t,n],o)=>`#${K(e)}${K(t)}${K(n)}${o===void 0?"":K(o*255)}`,v=(e,t,n)=>[0,1,2].map(o=>e[o]+(t[o]-e[o])*n);function ee([e,t,n]){const o=a=>{const i=a/255;return i<=.03928?i/12.92:((i+.055)/1.055)**2.4};return .2126*o(e)+.7152*o(t)+.0722*o(n)}function de(e,t){const[n,o]=[ee(e),ee(t)].sort((a,i)=>i-a);return(n+.05)/(o+.05)}const Re=e=>ee(Q(e))<.2?"dark":"light";function X(e,t,n){const o=ee(t)<.2?N:P;let a=e;for(let i=1;i<=20&&de(a,t)<n;i++)a=v(e,o,i/20);return a}const dt=e=>de(N,e)>=de(P,e)?N:[17,17,17];function dn(e,t){const n=Q(e),o=t==="dark",a=f=>v(n,o?N:P,f),i=o?a(.08):v(n,N,.85),c=a(o?.14:.06),l=X(v(o?N:P,n,o?.04:.1),n,12),x=a(o?.22:.07);return{app:d(n),panel:d(o?v(n,P,.25):v(n,N,.45)),frame:d(o?v(n,P,.25):v(n,N,.45)),raised:d(i),"raised-hover":d(c),card:d(o?a(.07):i),inset:d(o?a(.04):n),control:d(a(o?.12:.07)),composer:d(o?a(.07):i),"composer-ring":d(a(o?.14:.12)),menu:d(i),"menu-hover":d(l,.06),"menu-active":d(l,.09),hairline:d(a(.2)),edge:d(l,.08),scrollbar:d(a(o?.25:.22)),ink:d(l),"ink-secondary":d(X(v(l,n,o?.3:.4),c,4.5)),"ink-tertiary":d(X(v(l,n,o?.42:.5),c,4.5)),"bubble-user":d(x),"bubble-user-ink":d(o?dt(x):l)}}function mn(e,t,n){const o=Q(e),a=X(o,Q(n),4.5);return{accent:d(o),"accent-ink":d(dt(o)),"accent-border":d(t==="dark"?v(o,N,.2):v(o,P,.1)),"accent-text":d(a),focus:d(a)}}class pn extends Error{}function G(e,t){const n=globalThis[t];return typeof n=="function"&&e instanceof n}function $e(e){const t=e.style;return t&&typeof t=="object"&&typeof t.getPropertyValue=="function"?t:null}function He(e){for(let t=e.length-1;t>=0;t--){const n=e.item(t);ut(e.getPropertyValue(n))&&e.removeProperty(n)}}const fn=e=>"cssRules"in e&&typeof e.deleteRule=="function";function De(e,t,n){try{e.deleteRule(t)}catch{if(!G(n,"CSSNamespaceRule"))throw new pn}}function mt(e){for(let t=e.cssRules.length-1;t>=0;t--){const n=e.cssRules[t];if(!n)continue;if(G(n,"CSSKeyframesRule")){for(const a of Array.from(n.cssRules)){const i=$e(a);i&&He(i)}continue}if(G(n,"CSSPropertyRule")){ut(n.initialValue??"")&&De(e,t,n);continue}const o=$e(n);o&&He(o),fn(n)?mt(n):!o&&!G(n,"CSSLayerStatementRule")&&De(e,t,n)}}let R=null,Me="";function ze(e){if(!(typeof document>"u"||typeof CSSStyleSheet>"u"||!("adoptedStyleSheets"in document))&&e!==Me){Me=e,R||(R=new CSSStyleSheet,document.adoptedStyleSheets=[...document.adoptedStyleSheets,R]);try{R.replaceSync(e),mt(R)}catch{R.replaceSync("")}}}const me="omb-theme",Be="omb-safe-look";let A=null,B=[],se=!1;const pe=new Set;function F(e){try{return typeof window>"u"?void 0:window[e]}catch{return}}function hn(){try{return typeof location<"u"&&new URLSearchParams(location.search).has(on)&&F("sessionStorage")?.setItem(Be,"1"),F("sessionStorage")?.getItem(Be)==="1"}catch{return!1}}function go(){return A}function yo(e){return pe.add(e),()=>{pe.delete(e)}}function xn(e){for(const t of B)e.style.removeProperty(t);B=[]}function Y(){if(!(typeof document>"u"||se)){se=!0;try{const e=document.documentElement;xn(e);const t=hn()?null:A?.theme;if(!t){delete e.dataset.theme,ze(""),Te(Ie());return}const n=t.skin??(t.canvas?Ct[Re(t.canvas)]:void 0);Te(n?Pt(n):Ie());const o=ue(e),a=t[o],i=a?.canvas??(t.canvas&&Re(t.canvas)===o?t.canvas:void 0),c=a?.accent??t.accent,l={...i?dn(i,o):{},...c?mn(c,o,i??(o==="dark"?"#121212":"#ffffff")):{},...t.colors,...a?.colors};for(const x of at){const f=l[x];f&&(e.style.setProperty(`--color-${x}`,f),B.push(`--color-${x}`))}i&&(e.style.setProperty("--code-color-scheme",o),B.push("--code-color-scheme")),t.font&&(e.style.setProperty("--font-sans",t.font),B.push("--font-sans")),e.dataset.theme=A.id,ze(t.css??"")}finally{se=!1;for(const e of pe)e()}}}function ye(e){A=e;try{e?F("localStorage")?.setItem(me,JSON.stringify(e)):F("localStorage")?.removeItem(me)}catch{}Y()}function bn(){try{const e=JSON.parse(F("localStorage")?.getItem(me)??"null"),t=ge.safeParse(e?.theme);return typeof e?.id=="string"&&t.success?{id:e.id,theme:t.data}:null}catch{return null}}async function ke(){try{const e=await fetch("/api/themes/active",{headers:{accept:"application/json"}});if(!e.ok)return;const t=await e.json(),n=t.theme?ge.safeParse(t.theme):null;ye(t.id&&n?.success?{id:t.id,theme:n.data}:null)}catch{}}function ko(e){const t=e.skin;(t==="system"||qe.includes(t))&&be(t),ke()}const we=(e,t)=>fetch("/api/themes/active",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({id:e,...t?{skin:t}:{}})}).then(n=>n.ok,()=>!1);function wo(){A&&(ye(null),we(null))}async function vo(e){const t=await we(e);return t&&await ke(),t}function gn(){be(Pe),ye(null),we(null,Pe)}const yn=e=>e.code==="KeyR"&&e.altKey&&e.shiftKey&&(e.metaKey||e.ctrlKey);function kn(){if(!(typeof window>"u")){if(window.addEventListener("keydown",e=>{yn(e)&&(e.preventDefault(),e.stopPropagation(),gn())},{capture:!0}),Et(Y),typeof matchMedia=="function")try{matchMedia("(prefers-color-scheme: dark)").addEventListener("change",Y)}catch{}A=bn(),A&&Y()}}function wn({credential:e,owner:t,team:n}){const[o]=u.useState(()=>J()),[a,i]=u.useState(!1),[c,l]=u.useState(null);async function x(){i(!0),l(null);const f=await Zt(e,o);if(f.ok){location.replace("/");return}i(!1),l(f.error)}return r.jsx("main",{className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",children:r.jsxs("div",{className:"w-full max-w-[420px]",children:[r.jsx("h1",{className:"text-[20px] font-semibold",children:n?s("pair.browser.teamTitle",{team:n,owner:t}):s("pair.browser.title",{owner:t})}),r.jsx("p",{className:"mt-1.5 text-[14px] text-ink-secondary",children:s("pair.browser.notYou")}),c?r.jsx("p",{role:"alert",className:"mt-3 text-[13px] text-danger",children:c}):null,r.jsx("button",{type:"button",onClick:()=>{x()},disabled:a,className:"mt-5 w-full rounded-md bg-accent px-4 py-2 text-[14px] font-medium text-accent-ink disabled:opacity-50",children:s(a?"pair.signingIn":"pair.continue")})]})})}const ve="bg-composer ring-1 ring-inset ring-ink/[0.07]",vn="bg-composer ring-[0.5px] ring-ink/10",So=`${vn} shadow-(--shadow-float)`,pt="transition-colors duration-[120ms] hover:bg-[color-mix(in_srgb,var(--color-composer),var(--color-ink)_7%)]",Sn=`${pt} aria-expanded:bg-[color-mix(in_srgb,var(--color-composer),var(--color-ink)_7%)]`,jo="bg-[color-mix(in_srgb,var(--color-composer),var(--color-ink)_7%)]",No="focus-visible:outline-2 focus-visible:-outline-offset-2! focus-visible:outline-focus",ft="flex size-9 shrink-0 items-center justify-center rounded-full text-ink/90",Se="focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",jn=`${ft} ${ve} ${Sn} ${Se}`,Eo=`${ft} ${ve} ${pt} ${Se}`,Nn=`flex size-[26px] shrink-0 items-center justify-center rounded-lg text-ink-secondary transition-colors hover:bg-ink/[0.06] hover:text-ink aria-expanded:bg-ink/[0.06] aria-expanded:text-ink ${Se}`,Co="flex size-10 shrink-0 items-center justify-center rounded-full border border-hairline bg-card text-ink hover:bg-raised focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",En="flex size-9 shrink-0 items-center justify-center rounded-xl text-ink-secondary hover:bg-raised/60 hover:text-ink focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus";function Po({open:e,onToggle:t,corner:n=!1,ref:o}){return r.jsx("button",{ref:o,type:"button","data-sidebar-search-toggle":!0,onClick:t,"aria-label":s("sidebar.searchAria"),"aria-expanded":e,title:s("sidebar.searchAria"),className:n?Nn:jn,children:r.jsx(Je,{size:n?17:18,strokeWidth:1.5,"aria-hidden":"true"})})}function To({query:e,onQuery:t,onClose:n}){return r.jsx("div",{"data-sidebar-search-pill":!0,className:"px-3 pb-2 pt-0.5",children:r.jsxs("div",{className:$("flex h-[34px] items-center gap-2 rounded-full pl-3 pr-1.5 text-ink-secondary focus-within:ring-focus",ve),children:[r.jsx(Je,{size:15,"aria-hidden":"true",className:"shrink-0"}),r.jsx("input",{autoFocus:!0,value:e,onChange:o=>t(o.target.value),onKeyDown:o=>{o.key==="Escape"&&(o.preventDefault(),n())},placeholder:s("sidebar.searchAria"),"aria-label":s("sidebar.searchAria"),className:"min-w-0 flex-1 bg-transparent text-[13px] text-ink placeholder:text-ink-tertiary focus:outline-none"}),r.jsx("button",{type:"button",onClick:n,"aria-label":s("sidebar.searchClose"),title:s("sidebar.searchClose"),className:"flex size-6 shrink-0 items-center justify-center rounded-full text-ink-tertiary hover:bg-raised hover:text-ink focus-visible:outline focus-visible:outline-2 focus-visible:outline-focus",children:r.jsx(Tt,{size:14,"aria-hidden":"true"})})]})})}function Cn(e,{howTo:t=!1,onClosed:n}={}){return e.menu(t?{from:"howto"}:void 0).finally(()=>{t&&n?.()})}function Io(e){e({type:"cloudHowTo",open:!1})}function Fe({text:e}){return r.jsxs("span",{className:"font-normal text-ink-secondary",children:[" · ",e]})}function Pn(e){return e?.sleeps===!0?!0:e?.status==="paid"?!1:null}function Tn(e){const t=e&&!window.ogb?.remoteClient?.active?window.ogb?.cloudPlan:void 0,n=e||window.ogb?.remoteClient?.active?void 0:window.ogb?.cloudAccount,[o,a]=u.useState(null),[i,c]=u.useState(!1);return u.useEffect(()=>{if(!t)return;let l=!0;return t.state().then(x=>{l&&a(Pn(x))}).catch(()=>{}),()=>{l=!1}},[t]),u.useEffect(()=>n?.onState(l=>c(l.waking===!0)),[n]),{sleeps:t?o:null,waking:i}}function In({cloudHome:e=!1,howTo:t=!1,onMenuClosed:n}){const o=window.ogb?.workspaces,[a,i]=u.useState(null),[c,l]=u.useState(!1),[x,f]=u.useState("");u.useEffect(()=>{let p=!0;const k=()=>{o?.state().then(E=>{p&&i(E)}).catch(()=>{})};k();const I=o?.onChanged?.(k);return()=>{p=!1,I?.()}},[o]);const w=Tn(e||a?.home===!0),m=w.sleeps===null?"":s(w.sleeps?"cloudSetup.sleepsWhenIdle":"cloudSetup.alwaysOn"),g=w.waking?s("cloudHome.waking"):"";return{bridge:o,current:a,cloudHome:e,open:c,error:x,onLine:m,waking:g,openMenu:()=>{!o||c||(f(""),l(!0),Cn(o,{howTo:t,onClosed:n}).catch(()=>f(s("sidebar.switchServerError"))).finally(()=>l(!1)))},switchable:!!o&&a?.home!==!0}}function _n(e){const t=It(),n=r.jsx(An,{...e});return _t(t)?r.jsx("div",{"data-switcher-beside-rail":!0,className:t.beside?"hidden":"contents md:hidden",children:n}):n}function An({compact:e=!1,inline:t=!1,pill:n=!1,rail:o=!1,cloudHome:a=!1,owner:i=null,howTo:c=!1,place:l,onMenuClosed:x}){const f=l||s("cloudSetup.myCloud"),{bridge:w,current:m,open:g,error:y,onLine:p,waking:k,openMenu:I}=In({cloudHome:a,howTo:c,onMenuClosed:x}),E=b=>p?`${b} · ${p}`:b;if(!w||m?.home===!0){if(!a&&!m?.home)return null;const b=i?s("sidebar.cloudOwner",{email:i}):"",j=`${E(f)}${b?` · ${b}`:""}`;return o?r.jsx("div",{"data-cloud-home-indicator":!0,"data-workspace-switcher":"rail",role:"img","aria-label":j,title:j,className:"flex size-9 items-center justify-center text-ink-secondary",children:r.jsx(W,{size:18,"aria-hidden":"true"})}):t?r.jsxs("div",{"data-cloud-home-indicator":!0,"data-workspace-switcher":"inline",title:j,className:n?"flex h-8 min-w-0 items-center gap-1 rounded-full bg-raised/50 px-3 text-[13px] font-medium text-ink":"flex min-w-0 items-center gap-1.5 px-1.5 text-[13px] font-medium text-ink",children:[r.jsx(W,{size:n?15:14,"aria-hidden":"true",className:n?"hidden shrink-0 text-ink-secondary @max-[124px]/sidebar-top:block":"shrink-0 text-ink-secondary"}),r.jsx("span",{className:n?"min-w-0 truncate @max-[124px]/sidebar-top:hidden":"min-w-0 truncate",children:f}),(p||b)&&r.jsxs("span",{className:"sr-only",children:[p?` · ${p}`:"",b?` · ${b}`:""]})]}):r.jsx("div",{"data-cloud-home-indicator":!0,className:$("py-1.5",e?"px-2":"px-3"),children:r.jsxs("div",{title:j,className:$("flex items-center gap-2 py-2 text-[13px] font-medium text-ink",e?"justify-center px-1":"px-2"),children:[r.jsx(W,{size:16,"aria-hidden":"true",className:"shrink-0 text-ink-secondary"}),e?r.jsx("span",{className:"sr-only",children:j}):r.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[f,p&&r.jsx(Fe,{text:p}),b&&r.jsx("span",{className:"block truncate text-[12px] font-normal text-ink-secondary",children:b})]})]})})}const L=m?.profileName??(m?.local&&!m.localPath?s("place.local"):m?.name)??(a?f:s("sidebar.servers")),S=m?.local===!1||a&&!m?W:At,H=a?E(L):L,_=m?.origin?`${H} · ${m.origin}`:H,O=s("sidebar.switchServer",{name:H});return o?r.jsxs("div",{"data-workspace-switcher":"rail",className:"relative",children:[r.jsx("button",{type:"button","aria-label":O,"aria-haspopup":"menu","aria-expanded":g,"data-cloud-home-indicator":a||void 0,"data-tour":"server-switcher",title:_,onClick:I,className:$(En,"aria-expanded:bg-raised"),style:{WebkitAppRegion:"no-drag"},children:re(m?.color)?r.jsx(ae,{color:m?.color,size:18}):r.jsx(S,{size:18,"aria-hidden":"true"})}),y&&r.jsx("p",{role:"alert",className:"absolute bottom-0 left-full z-40 ml-2 w-56 rounded-md bg-menu px-2 py-1 text-[11px] text-danger shadow-lg",children:y}),k&&!y&&r.jsx("p",{role:"status","data-cloud-waking":!0,className:"absolute bottom-0 left-full z-40 ml-2 w-56 rounded-md bg-menu px-2 py-1 text-[11px] text-ink-secondary shadow-lg",children:k})]}):t?r.jsxs("div",{"data-workspace-switcher":"inline",className:"flex min-w-0",children:[r.jsxs("button",{type:"button","aria-label":O,"aria-haspopup":"menu","aria-expanded":g,"data-cloud-home-indicator":a||void 0,"data-tour":"server-switcher",title:_,onClick:I,className:n?"flex h-8 min-w-0 max-w-full items-center gap-1 overflow-hidden rounded-full bg-raised/50 pl-2.5 pr-1.5 text-left text-[13px] font-medium text-ink hover:bg-raised aria-expanded:bg-raised focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus":"flex h-7 min-w-0 max-w-full items-center gap-1.5 overflow-hidden rounded-md px-1.5 text-left text-[13px] font-medium text-ink hover:bg-control focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",style:{WebkitAppRegion:"no-drag"},children:[re(m?.color)?r.jsx(ae,{color:m?.color,size:16}):r.jsx(S,{size:n?15:14,"aria-hidden":"true","data-switcher-icon":!0,className:n?"hidden shrink-0 text-ink-secondary @max-[124px]/sidebar-top:block":"shrink-0 text-ink-secondary"}),r.jsx("span",{className:n?"min-w-0 truncate @max-[124px]/sidebar-top:hidden":"min-w-0 truncate @max-[96px]/sidebar-top:hidden",children:L}),r.jsx(_e,{size:n?12:11,"aria-hidden":"true",className:n?"shrink-0 text-ink-tertiary":"shrink-0 text-ink-secondary"})]}),y&&r.jsx("p",{role:"alert",className:"absolute right-2 top-full z-40 mt-1 w-56 max-w-[calc(100%-1rem)] rounded-md bg-menu px-2 py-1 text-[11px] text-danger shadow-lg",children:y}),k&&!y&&r.jsx("p",{role:"status","data-cloud-waking":!0,className:"absolute right-2 top-full z-40 mt-1 w-56 max-w-[calc(100%-1rem)] rounded-md bg-menu px-2 py-1 text-[11px] text-ink-secondary shadow-lg",children:k})]}):r.jsxs("div",{className:$("py-1.5",e?"px-2":"px-3"),children:[r.jsxs("button",{type:"button","aria-label":O,"aria-haspopup":"menu","aria-expanded":g,"data-cloud-home-indicator":a||void 0,"data-tour":"server-switcher",title:_,onClick:I,className:$("flex w-full items-center gap-2 rounded-lg py-2 text-left text-[13px] font-medium text-ink hover:bg-control focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",e?"justify-center px-1":"px-2"),style:{WebkitAppRegion:"no-drag"},children:[re(m?.color)?r.jsx(ae,{color:m?.color,size:20}):r.jsx(S,{size:16,className:"shrink-0 text-ink-secondary"}),!e&&r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[L,a&&p&&r.jsx(Fe,{text:p})]}),r.jsx(_e,{size:13,className:"shrink-0 text-ink-secondary"})]})]}),y&&r.jsx("p",{role:"alert",className:"mt-1 text-[11px] text-danger",children:y}),k&&!y&&r.jsx("p",{role:"status","data-cloud-waking":!0,className:"mt-1 text-[11px] text-ink-secondary",children:k})]})}function Ln(e){const t=e&&typeof e=="object"?e.membership:void 0,n=t&&typeof t=="object"?t:{};let o=null;if(typeof n.peopleUrl=="string")try{new URL(n.peopleUrl).protocol==="https:"&&(o=n.peopleUrl)}catch{o=null}return{authority:n.authority==="portal"?"portal":"local",pairingCodes:n.pairingCodes!==!1,peopleUrl:o}}const _o=()=>({type:"toggleAppSettings",open:!0,section:"companion",phonePairing:!0});function Ao(e){const t=typeof window>"u"?void 0:window.ogb;return On({companion:!!t?.companion,remoteClient:t?.remoteClient?.active===!0,cloudHome:e})}function On(e){return e.cloudHome?"cloud":e.companion&&!e.remoteClient?"computer":"server"}const Rn={computer:"sidebar.menu.connectPhone.computer",cloud:"sidebar.menu.connectPhone.cloud",server:"sidebar.menu.connectPhone.server"};function Lo(e,t){const n=t?.session?.kind==="session"?t.session.team?.name:void 0;return n?{target:e,subtitleKey:"sidebar.menu.connectPhone.team",team:n}:e!=="computer"&&!(t&&t.pairingCodes&&et(t.session))?null:{target:e,subtitleKey:Rn[e]}}function Oo(e,t){if(!e)return[];const n={...e,id:"here"};return e.target,[n]}let Ue=null;function Ro(e=fetch){return Ue??=te(e).then(async t=>{if(!et(t))return{session:t,pairingCodes:!1};const n=await e("/api/config",{credentials:"same-origin"}).then(o=>o.ok?o.json():null).catch(()=>null);return{session:t,pairingCodes:Ln(n).pairingCodes}}),Ue}const $n="data-phone-pairing-action";function $o(e,t=n=>window.requestAnimationFrame(n)){return e?(t(()=>{e.scrollIntoView?.({block:"start"}),(e.querySelector(`[${$n}]:not([disabled])`)??e).focus({preventScroll:!0})}),!0):!1}function Ho(e){const t=new URL(e);return t.searchParams.get("desktop-settings")!=="phone"?null:(t.searchParams.delete("desktop-settings"),`${t.pathname}${t.search}${t.hash}`)}function ie(e){const t=new URLSearchParams(e);if(t.get("desktop-settings")==="phone")return"/?desktop-settings=phone";const n=t.get("next");return n&&/^\/(?!\/)/.test(n)&&!n.startsWith("/pair")&&!/[\\\s]/.test(n)?n:"/"}const Hn="23456789ABCDEFGHJKLMNPQRSTUVWXYZ",Dn=12,Mn="omb_pair_",zn=/^omb_pair_[A-Za-z0-9_-]{43}$/;function Bn(e){return e.toUpperCase().replace(/[^A-Z0-9]/g,"").replace(/0/g,"O").replace(/1/g,"I")}const Fn={emailCode:"serverError.pair.emailCode",oldCode:"serverError.pair.oldCode",scriptKey:"serverError.pair.scriptKey",notACode:"serverError.pair.notACode"};function Un(e){let t;try{t=new URL(e)}catch{return null}const n=new URLSearchParams(t.hash.replace(/^#/,""));return t.searchParams.get("token")??t.searchParams.get("code")??n.get("code")}function ht(e){let t=e.trim();if(!t)return{kind:"empty"};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(t)){const a=Un(t);if(!a)return{kind:"wrong",problem:"notACode"};t=a.trim()}if(t.startsWith("omb_sess_"))return{kind:"wrong",problem:"scriptKey"};if(t.startsWith(Mn))return zn.test(t)?{kind:"credential",credential:t}:{kind:"wrong",problem:"notACode"};const n=t.replace(/[\s-]/g,"");if(/^\d{8}$/.test(n))return{kind:"wrong",problem:"emailCode"};if(/^\d{6}$/.test(n))return{kind:"wrong",problem:"oldCode"};const o=Bn(t);return o.length!==Dn||[...o].some(a=>!Hn.includes(a))?{kind:"wrong",problem:"notACode"}:{kind:"code",code:o}}const M="mt-1 w-full rounded-md border border-hairline/40 bg-inset px-3 py-2 text-[14px] text-ink outline-none focus:border-accent-border",We="mt-5 w-full rounded-md bg-accent px-4 py-2 text-[14px] font-medium text-accent-ink disabled:opacity-50",z="mt-4 block text-[12px] font-medium text-ink-secondary";function Wn(e,t=typeof window<"u"&&!!window.ogb?.workspaces){return!!e&&t}function Kn({mode:e,sent:t,email:n,cloudHome:o}){return e==="email"?t?s("pair.intro.emailSent",{email:n}):s("pair.intro.email"):o?s("pair.intro.cloud",{app:U(),open:s("cloudHome.connect"),section:s("settings.section.cloudAccount")}):s("pair.intro.code")}function Vn(e){const t=ht(e);return t.kind==="wrong"&&t.problem!=="notACode"?s(Fn[t.problem]):null}function Xn(e){const t=ht(e).kind;return t==="code"||t==="credential"}function Gn(e){return e.protocol==="http:"&&!Lt(e.hostname)}function Ke(e,t=Vt()){if(!e?.capabilities.cloudTeam||typeof t!="string")return null;try{const n=new URL(t),o=n.protocol==="http:"&&["127.0.0.1","localhost","[::1]"].includes(n.hostname);return(n.protocol==="https:"||o)&&!n.username&&!n.password&&!n.hash?n.href:null}catch{return null}}function Yn(e,t){return e?.capabilities.cloudTeam?e.label:e?.capabilities.cloudHome?s("pair.myCloud"):s(t==="email"?"pair.signInTo":"pair.connectTo",{name:e?.label??s("pair.thisLimixBot",{app:U()})})}function qn({team:e}){return r.jsx("main",{"data-team-left":!0,className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",children:r.jsx("p",{role:"status",className:"max-w-[420px] text-[16px]",children:s("homeLine.left",{name:e??s("pair.thisLimixBot",{app:U()})})})})}function V({initialCode:e,initialEmail:t=null,reason:n}){const[o,a]=u.useState(e??""),[i,c]=u.useState(tt()),[l,x]=u.useState(null),[f,w]=u.useState(null),[m,g]=u.useState(!1),[y,p]=u.useState(null),[k,I]=u.useState(()=>J()),[E,L]=u.useState(t&&!e?"email":"code"),[S,H]=u.useState(t??""),[_,O]=u.useState(""),[b,j]=u.useState(!1),[ne,bt]=u.useState(()=>Wn(e));u.useEffect(()=>{if(!ne||!e)return;let h=!0;return ce({code:e,label:i,attemptId:k}).then(C=>{if(h){if(C.ok){location.replace(ie(location.search));return}bt(!1),p(C.error)}}),()=>{h=!1}},[]),u.useEffect(()=>{fetch("/.well-known/openmausbot/environment").then(h=>h.ok?h.json():null).then(h=>{x(h)}).catch(()=>{x(null)}),te().then(w)},[]);const oe=Xt(f),gt=l?.capabilities.emailSignIn===!0,D=l?.capabilities.cloudHome===!0,yt=!D&&l?.capabilities.cloudTeam!==!0,Ne=Vn(o),Ee=typeof location<"u"&&typeof location.protocol=="string"?location:null;async function kt(h){h.preventDefault(),g(!0),p(null);const C=await ce({code:o,label:i,attemptId:k});if(g(!1),C.ok){location.replace(ie(location.search));return}p(C.error)}async function wt(h){h.preventDefault(),g(!0),p(null);const C=b?await en({email:S,code:_,label:i}):await Qt(S);if(g(!1),!C.ok){p(C.error);return}if(b){location.replace(ie(location.search));return}j(!0)}function Ce(h){L(h),p(null)}return r.jsxs("main",{className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",children:[r.jsx("div",{className:"absolute left-3 top-12 max-w-[280px]",children:r.jsx(_n,{})}),r.jsxs("div",{className:"w-full max-w-[420px]",children:[Ee&&Gn(Ee)?r.jsx("p",{role:"alert",className:"mb-4 rounded-md border border-warning/30 bg-warning/10 px-3 py-2 text-[13px] text-warning",children:s("pair.notEncrypted")}):null,ne?r.jsx("p",{role:"status",className:"text-[20px] font-semibold",children:D?s("pair.openingCloud"):s("pair.connectingTo",{name:l?.label??s("pair.thisLimixBot")})}):r.jsxs(r.Fragment,{children:[r.jsx("h1",{className:"text-[20px] font-semibold",children:Yn(l,E)}),r.jsxs("p",{className:"mt-1.5 text-[14px] leading-relaxed text-ink-secondary",children:[l&&!D?`${s("pair.version",{version:l.version,platform:l.platform})} `:"",Kn({mode:E,sent:b,email:S,cloudHome:D})]}),Le(n)&&!oe?r.jsx("p",{className:"mt-3 text-[13px] text-ink-secondary",children:Le(n)}):null,y&&D&&e?r.jsx("p",{className:"mt-3 text-[13px] text-ink-secondary",children:s("pair.expired",{app:U(),open:s("cloudHome.connect"),section:s("settings.section.cloudAccount")})}):null,!oe&&Ke(l)?r.jsxs("div",{"data-team-sign-in":!0,className:"mt-4 flex flex-col items-start gap-1.5",children:[r.jsx("a",{href:Ke(l),className:"rounded-md bg-accent px-4 py-2 text-[14px] font-medium text-accent-ink",children:s("pair.team.open",{team:l.label})}),r.jsx("p",{className:"text-[13px] text-ink-secondary",children:s("pair.team.openHint")})]}):null]}),ne?null:oe?r.jsxs("p",{className:"mt-4 text-[14px]",children:[s("pair.alreadyConnected")," ",r.jsx("a",{href:"/",className:"text-accent underline",children:s("pair.openApp")})]}):E==="email"?r.jsxs("form",{onSubmit:wt,children:[r.jsx("label",{className:z,htmlFor:"signin-email",children:s("cloudBuy.signIn.email")}),r.jsx("input",{id:"signin-email",type:"email",value:S,onChange:h=>{H(h.target.value),j(!1),O("")},autoComplete:"email",inputMode:"email",spellCheck:!1,className:M}),b?r.jsxs(r.Fragment,{children:[r.jsx("label",{className:z,htmlFor:"signin-code",children:s("pair.emailCode")}),r.jsx("input",{id:"signin-code",value:_,onChange:h=>O(h.target.value),placeholder:"12345678",autoComplete:"one-time-code",inputMode:"numeric",spellCheck:!1,className:`${M} font-mono text-[15px] tracking-[0.12em]`}),r.jsx("label",{className:z,htmlFor:"signin-label",children:s("pair.deviceLabel")}),r.jsx("input",{id:"signin-label",value:i,onChange:h=>c(h.target.value),maxLength:80,className:M})]}):null,y?r.jsx("p",{className:"mt-3 text-[13px] text-danger",children:y}):null,r.jsx("button",{type:"submit",disabled:m||!S.includes("@")||b&&_.replace(/\D/g,"").length<8,className:We,children:s(m?b?"pair.signingIn":"pair.sending":b?"pair.signIn":"cloudBuy.signIn.send")}),b?r.jsx("button",{type:"button",onClick:()=>j(!1),className:"mt-3 w-full text-[13px] text-ink-secondary underline",children:s("pair.resend")}):null,r.jsx("button",{type:"button",onClick:()=>Ce("code"),className:"mt-3 w-full text-[13px] text-ink-secondary underline",children:s("pair.useCode")})]}):r.jsxs("form",{onSubmit:kt,children:[r.jsx("label",{className:z,htmlFor:"pair-code",children:s("pair.code")}),r.jsx("input",{id:"pair-code",value:o,onChange:h=>{a(h.target.value),I(J())},placeholder:"XXXX-XXXX-XXXX","aria-describedby":e&&o===e?"pair-code-from-link":void 0,autoComplete:"one-time-code",autoCapitalize:"characters",spellCheck:!1,className:`${M} font-mono text-[15px] tracking-[0.12em]`}),e&&o===e?r.jsx("p",{id:"pair-code-from-link",className:"mt-1 text-[12px] text-ink-secondary",children:s("pair.fromLink")}):null,r.jsx("label",{className:z,htmlFor:"pair-label",children:s("pair.deviceLabel")}),r.jsx("input",{id:"pair-label",value:i,onChange:h=>c(h.target.value),maxLength:80,className:M}),Ne?r.jsx("p",{role:"alert",className:"mt-3 text-[13px] text-danger",children:Ne}):y?r.jsx("p",{className:"mt-3 text-[13px] text-danger",children:y}):null,r.jsx("button",{type:"submit",disabled:m||!Xn(o),className:We,children:s(m?"pair.connecting":"pair.connect")}),null,yt?r.jsxs("p",{className:"mt-3 text-[13px] text-ink-secondary",children:[s("pair.noCode")," ",r.jsx("code",{className:"select-all rounded bg-inset px-1.5 py-0.5 text-[12px] text-ink",children:"npx limixbot pair"})]}):null,gt?r.jsxs("p",{className:"mt-5 border-t border-hairline/40 pt-4 text-[13px] text-ink-secondary",children:[s("pair.invitedByEmail")," ",r.jsx("button",{type:"button",onClick:()=>Ce("email"),className:"text-accent underline",children:s("pair.useEmail")})]}):null]})]})]})}const Do="cloud-welcome-done",Jn="unauthorized: you are no longer in this team",Ve=[["reserving","cloudHome.step.reserving"],["storage","cloudHome.step.storage"],["starting","cloudHome.step.starting"],["checking","cloudHome.step.checking"]];function Zn({step:e}){const t=Ve.findIndex(([n])=>n===e);return r.jsx("ol",{"data-cloud-setup":e,className:"flex flex-col gap-1 text-[13px]",children:Ve.map(([n,o],a)=>r.jsx("li",{"aria-current":a===t?"step":void 0,className:a===t?"font-medium text-ink":a<t?"text-ink-secondary line-through decoration-ink-secondary/40":"text-ink-secondary",children:s(o)},n))})}const Qn={stopped:"cloudHome.stopped","payment-problem":"cloudHome.paymentProblem",failed:"cloudHome.failed"},Xe={host:"cloudHome.unreachableHost",no_answer:"cloudHome.unreachable"};function eo(e,t=Date.now()){const n=new Date(e).getFullYear()!==new Date(t).getFullYear();return new Intl.DateTimeFormat(Ot(),{day:"numeric",month:"long",...n?{year:"numeric"}:{}}).format(new Date(e))}function to(e,t=Date.now()){const n=e?.name??null,o=(a,i)=>n?s(i,{name:n}):s(a);return e?.screen==="setup"?{title:o("homeScreen.setup","homeScreen.setupNamed"),body:s(e.slow?"cloudHome.slow":"homeScreen.setupBody"),reason:null,action:null,busy:!0}:e?.screen==="offline"?{title:o("homeScreen.offline","homeScreen.offlineNamed"),body:s("homeScreen.offlineBack"),reason:e.cause&&Object.hasOwn(Xe,e.cause)?s(Xe[e.cause]):e.reason??null,action:"retry",busy:!1}:e?.screen==="signin"?{title:o("homeScreen.signIn","homeScreen.signInNamed"),body:s(e.other?"homeScreen.signInOther":"homeScreen.signInEnded"),reason:null,action:"sign-in",busy:!1}:e?.screen==="plan"&&e.member&&e.machine!=="failed"?{title:o("homeScreen.plan","homeScreen.planNamed"),body:s("cloudHome.stoppedMember"),reason:null,action:null,busy:!1}:e?.screen==="plan"?{title:o("homeScreen.plan","homeScreen.planNamed"),body:s(Qn[e.machine]??"cloudHome.failed"),reason:null,action:e.machine==="failed"?null:"manage",busy:!1}:e?.screen==="ended"?{title:o("cloudHome.ended","cloudHome.endedNamed"),body:e.deleteAt?s("cloudHome.endedFiles",{date:eo(e.deleteAt,t)}):null,reason:null,action:"buy",busy:!1}:e?.screen==="checkout"?{title:o("cloudHome.checkout","cloudHome.checkoutNamed"),body:null,reason:null,action:"continue",busy:!1}:e?.screen==="payment"?{title:o("cloudHome.payment","cloudHome.paymentNamed"),body:s("cloudHome.paymentBody"),reason:null,action:"card",busy:!1}:e?.screen==="waking"?{title:s("homeScreen.waking"),body:null,reason:null,action:null,busy:!0}:e?.screen==="moving"?{title:o("homeScreen.moving","homeScreen.movingNamed"),body:null,reason:null,action:null,busy:!0}:{title:o("homeScreen.opening","homeScreen.openingNamed"),body:null,reason:null,action:null,busy:!0}}const no={retry:"cloudHome.tryAgain",buy:"cloudHome.buyAgain",continue:"cloudHome.continue",card:"cloudHome.updateCard"};function oo({name:e,remove:t}){const[n,o]=u.useState(!1),[a,i]=u.useState(!1),[c,l]=u.useState(null),x=()=>{i(!0),l(null),t().then(f=>{i(!1),f!=="removed"&&f!=="gone"&&(o(!1),l(f==="refused"?"refused":"failed"))},()=>{i(!1),o(!1),l("failed")})};return r.jsxs("div",{"data-home-remove":!0,className:"flex flex-col items-start gap-2",children:[n?r.jsxs("div",{role:"alertdialog","aria-label":s("rail.remove"),className:"flex flex-col gap-2 rounded-xl border border-hairline/70 bg-card/70 px-4 py-3",children:[r.jsx("p",{className:"text-[13px] leading-relaxed text-ink",children:s("rail.removeAsk",{name:e})}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"button","data-home-remove-confirm":!0,className:"ui-button ui-button-primary",disabled:a,onClick:x,children:s("rail.removeYes")}),r.jsx("button",{type:"button",className:"ui-button",disabled:a,onClick:()=>o(!1),children:s("rail.removeNo")})]})]}):r.jsx("button",{type:"button","data-home-remove-ask":!0,className:"text-[13px] text-ink-secondary underline-offset-2 hover:text-ink hover:underline",onClick:()=>{l(null),o(!0)},children:s("rail.remove")}),c&&r.jsx("p",{role:"alert",className:"text-[13px] text-danger",children:s(c==="refused"?"rail.removeRefused":"rail.removeFailed")})]})}function ro({bridge:e,manage:t}){const[n,o]=u.useState(null),[a,i]=u.useState(!1);u.useEffect(()=>{let g=!0;const y=e.onState(k=>o(k)),p=()=>{e.retry().then(k=>{g&&o(k)}).catch(()=>{})};return e.state().then(k=>{g&&o(k)}).catch(()=>{}).then(p),window.addEventListener("online",p),window.addEventListener("focus",p),()=>{g=!1,y(),window.removeEventListener("online",p),window.removeEventListener("focus",p)}},[e]);const c=to(n),l=g=>{i(!1),g().catch(()=>i(!0))},x=window.ogb?.cloudAdd?.reopen,f={retry:()=>e.retry().then(g=>o(g)),...t?{manage:t,buy:t,card:t,continue:async()=>{x&&await x().catch(()=>!1)||await t()}}:{}},w=c.action&&c.action!=="sign-in"&&c.action!=="manage"?c.action:null,m=(n?.screen==="ended"||n?.screen==="payment")&&n.removable===!0&&typeof e.remove=="function";return r.jsx("main",{"data-home-screen":n?.screen??"opening",className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",style:{WebkitAppRegion:"drag"},children:r.jsxs("div",{className:"flex w-full max-w-[420px] flex-col items-start gap-3",style:{WebkitAppRegion:"no-drag"},children:[r.jsxs("p",{role:"status",className:"flex items-center gap-2 text-[20px] font-semibold",children:[c.busy&&r.jsx("span",{"aria-hidden":"true",className:"size-3.5 shrink-0 animate-spin rounded-full border-2 border-hairline border-t-accent"}),c.title]}),c.body&&r.jsx("p",{className:"text-[14px] leading-relaxed text-ink-secondary",children:c.body}),n?.screen==="setup"&&r.jsx(Zn,{step:n.step??"reserving"}),c.reason&&r.jsx("p",{"data-home-reason":!0,className:"text-[13px] leading-relaxed text-ink-secondary",children:c.reason}),c.action==="sign-in"&&r.jsx("button",{type:"button",className:"ui-button ui-button-primary mt-2",onClick:()=>l(()=>e.signIn()),children:s("homeScreen.signInButton")}),c.action==="manage"&&t&&r.jsx("button",{type:"button",className:"ui-button mt-2",onClick:()=>l(t),children:s("cloudAccount.manageInBrowser")}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[n?.screen==="offline"&&e.openLocal&&r.jsx("button",{type:"button","data-home-action":"local",className:"ui-button ui-button-primary mt-2",onClick:()=>l(async()=>{if(!await e.openLocal())throw new Error}),children:s("homeScreen.useLocal")}),w&&f[w]&&r.jsx("button",{type:"button","data-home-action":w,className:w==="retry"?"ui-button mt-2":"ui-button ui-button-primary mt-2",onClick:()=>l(f[w]),children:s(no[w])})]}),m&&r.jsx(oo,{name:n.name??s("cloudSetup.myCloud"),remove:()=>e.remove()}),a&&r.jsx("p",{role:"alert",className:"text-[13px] text-danger",children:s("cloudAccount.actionFailed")})]})})}function ao({bridge:e,fallback:t}){const[n,o]=u.useState(!1);return u.useEffect(()=>{e.repair().catch(()=>o(!0))},[e]),n?r.jsx(r.Fragment,{children:t}):r.jsx("main",{"data-home-screen":"opening",className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",children:r.jsx("p",{role:"status",className:"w-full max-w-[420px] text-[20px] font-semibold",children:s("homeScreen.opening")})})}const je="omb.session-ended";let fe=!1,le=null;const he=new Set;function Mo(){fe||le||(le=te().then(e=>{if(e.kind==="unauthenticated"){fe=!0;try{sessionStorage.setItem(je,"1")}catch{}for(const t of he)t()}}).finally(()=>{le=null}))}function Ge(){return fe}function zo(){return u.useSyncExternalStore(e=>(he.add(e),()=>he.delete(e)),Ge,Ge)}function so(){try{return sessionStorage.getItem(je)==="1"}catch{return!1}}function io(){try{sessionStorage.removeItem(je)}catch{}}Rt();be($t());Ht(Dt());tn();Mt(zt());kn();const q=Bt(),lo=new Set(["/home","/pair","/desktop-viewer"]),xt=()=>Ze(()=>import("./App-CFt1bVwj.js").then(e=>e.k6),__vite__mapDeps([0,1,2,3,4,5])).catch(e=>({default:()=>{throw e}})),co=lo.has(location.pathname)?null:xt(),uo=()=>fetch("/.well-known/openmausbot/environment").then(e=>e.json()).then(e=>e.capabilities?.cloudTeam===!0&&typeof e.label=="string"?e.label:null,()=>null);async function mo(){const e=window.ogb?.home;if(location.pathname==="/home"&&e)return r.jsx(ro,{bridge:e,manage:window.ogb?.cloudPlan?.manage});if(location.pathname==="/pair"){const o=Yt();if(o){const a=await Jt(o);return await q,a?r.jsx(wn,{credential:o,owner:a.owner,team:a.team}):r.jsx(V,{initialCode:null,reason:s("pair.browser.signInFailed")})}return r.jsx(V,{initialCode:Gt(),initialEmail:qt()})}const t=await te();if(t.kind==="unauthenticated"){if(await q,t.error===Jn)return r.jsx(qn,{team:await uo()});const o=r.jsx(V,{initialCode:null,reason:so()?s("pair.sessionEnded"):t.error});return e?r.jsx(ao,{bridge:e,fallback:o}):o}if(io(),t.kind==="session"&&Kt(t.teamSignIn),t.kind==="loopback"&&t.trust==="service")return await q,r.jsx(V,{initialCode:null,reason:s("pair.serviceTrust")});if(location.pathname==="/desktop-viewer"){const{DesktopViewer:o}=await Ze(async()=>{const{DesktopViewer:a}=await import("./DesktopViewer-B9mw98xI.js");return{DesktopViewer:a}},__vite__mapDeps([6,1,2,7,8,5,4,9]));return r.jsx(o,{})}const{default:n}=await(co??xt());return ke(),r.jsx(n,{})}document.title=U();Promise.all([Ft(),mo(),q]).then(([,e])=>{Ut.createRoot(document.getElementById("root")).render(r.jsx(u.StrictMode,{children:r.jsx(Wt,{children:e})}))});export{Eo as A,ho as B,Zn as C,No as D,So as E,Nn as F,_n as G,Po as H,To as I,vn as J,ue as K,jo as L,Do as M,zo as N,V as O,Co as P,Ho as Q,jn as S,rt as T,Ln as a,hn as b,gn as c,vo as d,wo as e,Ao as f,ko as g,Sn as h,et as i,ve as j,$o as k,ke as l,Oo as m,Mo as n,Cn as o,_o as p,fo as q,te as r,yo as s,xo as t,bo as u,Ro as v,go as w,Lo as x,In as y,Io as z};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/App-CeGk9O7P.js","assets/styles-CE92r4H3.js","assets/styles-_tGCSCNl.css","assets/PlacesRail-CKR79j8d.js","assets/monitor-B-DfxCLW.js","assets/MenuMotion-CgVWckHz.js","assets/DesktopViewer-DCC-jq_j.js","assets/desktop-connection-Dfaq6k5a.js","assets/desktop-viewer-CF-OpSo0.js","assets/minimize-DlAHYBEI.js"])))=>i.map(i=>d[i]);
2
+ import{t as s,ar as vt,s as T,as as St,g as Ye,o as xe,at as qe,N as jt,I as Nt,r as u,au as Et,y as be,av as Pe,w as Te,aw as Ie,ax as Ct,ay as Pt,j as r,S as Je,X as Tt,a as $,az as It,aA as _t,k as W,L as At,a8 as re,R as ae,ae as _e,p as U,aB as Lt,l as Ot,x as Rt,z as $t,A as Ht,B as Dt,aC as Mt,aD as zt,E as Bt,D as Ft,F as Ut,P as Wt,_ as Ze}from"./styles-CE92r4H3.js";function fo(e,t){if(!t)return;if(t.kind!=="session")return t.kind==="loopback"?e:void 0;if(t.team||t.scopes.includes("admin"))return e;const n=t.email;if(n?.trim())return e?.email?.trim().toLowerCase()===n.trim().toLowerCase()?e:{email:n}}const Qe="omb.team-sign-in";function Kt(e){try{e&&globalThis.localStorage?.setItem(Qe,e)}catch{}}function Vt(){try{return globalThis.localStorage?.getItem(Qe)??null}catch{return null}}async function te(e=fetch){let t;try{t=await e("/api/auth/session",{credentials:"same-origin"})}catch(a){return{kind:"unreachable",error:a instanceof Error?a.message:String(a)}}const n=await t.json().catch(()=>({})),o=Object(n);return t.status===401||t.status===403?{kind:"unauthenticated",error:typeof o.error=="string"?o.error:`${t.status}`}:t.ok?o.kind==="session"&&typeof o.id=="string"?{kind:"session",id:o.id,label:typeof o.label=="string"?o.label:"",...typeof o.email=="string"?{email:o.email}:{},scopes:Array.isArray(o.scopes)?o.scopes.filter(a=>typeof a=="string"):[],expiresAt:typeof o.expiresAt=="number"?o.expiresAt:0,...typeof o.reactor=="string"?{reactor:o.reactor}:{},...typeof o.teamSignIn=="string"?{teamSignIn:o.teamSignIn}:{},...Ae(o.team)?{team:Ae(o.team),openedThreads:Array.isArray(o.openedThreads)?o.openedThreads.filter(a=>typeof a=="string"):[]}:{},...o.cloudGuest===!0?{cloudGuest:!0,openedThreads:Array.isArray(o.openedThreads)?o.openedThreads.filter(a=>typeof a=="string"):[]}:{}}:o.trust==="service"?{kind:"loopback",trust:"service"}:{kind:"loopback"}:{kind:"unreachable",error:`${t.status} ${t.statusText}`}}function Ae(e){const t=Object(e);return typeof t.id=="string"&&typeof t.name=="string"&&typeof t.role=="string"?{id:t.id,name:t.name,role:t.role}:null}function Xt(e){return e?.kind==="session"||e?.kind==="loopback"&&e.trust!=="service"}function et(e){return e?e.kind==="loopback"?e.trust!=="service":e.kind==="session"&&e.scopes.includes("admin"):!1}function Gt(){const e=/[#&]code=([^&]+)/.exec(location.hash);return e?(history.replaceState(null,"",location.pathname+location.search),decodeURIComponent(e[1])):null}function Yt(){if(!/[#&]signin=/.test(location.hash))return null;const e=/[#&]signin=(omb_pair_[A-Za-z0-9_-]{43})(?:&|$)/.exec(location.hash);return history.replaceState(null,"",location.pathname+location.search),e?e[1]:null}function qt(){const e=new URLSearchParams(location.search),t=e.get("email")?.trim().toLowerCase()??"";if(!t)return null;e.delete("email");const n=e.toString();return history.replaceState(null,"",location.pathname+(n?`?${n}`:"")+location.hash),/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(t)?t:null}function tt(e=navigator.userAgent){const t=/Edg\//.test(e)?"Edge":/OPR\//.test(e)?"Opera":/Chrome\//.test(e)?"Chrome":/Firefox\//.test(e)?"Firefox":/Safari\//.test(e)?"Safari":"Browser",n=/iPhone/.test(e)?"iPhone":/iPad/.test(e)?"iPad":/Android/.test(e)?"Android":/Mac OS X/.test(e)?"Mac":/Windows/.test(e)?"Windows":/Linux/.test(e)?"Linux":"";return n?`${t} on ${n}`:t}function J(){return typeof crypto?.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,14)}`}function nt(e,t){const n=Reflect.get(Object(e),"error");return vt(e,typeof n=="string"?n:`${t.status} ${t.statusText}`)}async function ce(e,t=fetch){let n;try{n=await t("/api/auth/pair",{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify({code:e.code,label:e.label,cookie:!0,attemptId:e.attemptId??J(),...e.browser?{browser:!0}:{}})})}catch(a){return{ok:!1,error:s("pair.unreachable",{error:a instanceof Error?a.message:String(a)})}}const o=await n.json().catch(()=>({}));return n.ok?{ok:!0}:{ok:!1,error:nt(o,n)}}async function Jt(e,t=fetch){try{const n=await t("/api/auth/pair",{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify({code:e,browser:!0,preview:!0})}),o=Object(await n.json().catch(()=>({}))),a=Reflect.get(o,"owner"),i=Reflect.get(o,"team");return n.ok&&typeof a=="string"&&a?{owner:a,...typeof i=="string"&&i.trim()?{team:i.trim()}:{}}:null}catch{return null}}function Zt(e,t,n=fetch){return ce({code:e,label:tt(),attemptId:t,browser:!0},n)}function ho(e){const t=Object(e);return t.cloudHome===!0&&typeof t.owner=="string"&&t.owner?t.owner:null}async function ot(e,t,n){let o;try{o=await n(e,{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify(t)})}catch(i){return{ok:!1,error:s("pair.unreachable",{error:i instanceof Error?i.message:String(i)})}}const a=await o.json().catch(()=>({}));return o.ok?{ok:!0}:{ok:!1,error:nt(a,o)}}function Qt(e,t=fetch){return ot("/api/auth/email/start",{email:e},t)}function en(e,t=fetch){return ot("/api/auth/email/verify",{email:e.email,code:e.code,label:e.label},t)}function Le(e){return!e||/through a proxy|loopback host required|cross-origin request|^40[13]$/i.test(e)?null:e}function tn(){window.ogb?.softwareRendering===!0&&(document.documentElement.dataset.softwareRendering="")}const nn="/api/theme-assets/",on="safe-look",rt={cssChars:1e5,assetBytes:10*1024*1024},rn=/^[a-z0-9][a-z0-9-]{0,47}$/,an=/^[a-z0-9][a-z0-9_-]{0,79}\.(png|jpe?g|webp|gif|avif|svg|woff2?|ttf|otf)$/,sn=/^\/api\/theme-assets\/[a-z0-9][a-z0-9-]{0,47}\/[a-z0-9][a-z0-9_-]{0,79}\.[a-z0-9]{2,5}$/,at=["app","panel","frame","raised","raised-hover","card","inset","control","composer","composer-ring","menu","menu-hover","menu-active","hairline","edge","scrollbar","ink","ink-secondary","ink-tertiary","accent","accent-border","accent-text","accent-ink","focus","bubble-user","bubble-user-ink","success","success-ink","danger","danger-ink","warning"],Z=T().trim().regex(/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i,"a hex colour such as #1a2b3c"),ln=T().trim().min(1).max(120).regex(/^[#a-z0-9(),.%\s/+-]+$/i,"a CSS colour such as #1a2b3c, rgb(…) or color-mix(…)").refine(e=>!/url|image|src|attr/i.test(e),"a colour, not a file"),st=St(Ye(at),ln),Oe=xe({canvas:Z.optional(),accent:Z.optional(),colors:st.optional()}).strict(),ge=xe({name:T().trim().min(1).max(60),skin:Ye([...qe,"system"]).optional(),canvas:Z.optional(),accent:Z.optional(),colors:st.optional(),light:Oe.optional(),dark:Oe.optional(),font:T().trim().max(300).regex(/^[\w\s"',.-]*$/,'a font-family list such as "Inter Variable", serif').optional(),css:T().max(rt.cssChars).optional()}).strict(),cn=1;xe({mausbotTheme:Nt(cn),id:T().regex(rn).optional(),theme:ge,assets:jt(T().regex(an),T().max(Math.ceil(rt.assetBytes*1.4)).regex(/^data:[\w/+.-]+;base64,[A-Za-z0-9+/=]+$/)).optional()}).strict();function it(e){return/^data:/i.test(e)||e.startsWith("#")||sn.test(e)&&!e.includes("..")}function lt(e){const t=e.toLowerCase(),n=[];for(let o=t.indexOf("url(");o!==-1;o=t.indexOf("url(",o+4)){let a=o+4;for(;/\s/.test(e[a]??"");)a++;const i=e[a];let c;if(i==='"'||i==="'"){const l=e.indexOf(i,a+1);if(l===-1)return null;for(c=e.slice(a+1,l),a=l+1;/\s/.test(e[a]??"");)a++;if(e[a]!==")")return null}else{const l=e.indexOf(")",a);if(l===-1||(c=e.slice(a,l).trim(),/[\s"'(]/.test(c)))return null}n.push(c.trim())}return n}const ct=/image-set\(|\bimage\(|\bsrc\(/i;function ut(e){if(e.includes("\\")||ct.test(e))return!0;const t=lt(e);return t===null||t.some(n=>!it(n))}function un(e){let t="";for(let n=0;n<e.length;n++){const o=e[n];if(o==="/"&&e[n+1]==="*"){const a=e.indexOf("*/",n+2);n=a===-1?e.length:a+1,t+=" "}else if(o==='"'||o==="'"){let a=n+1;for(;a<e.length&&e[a]!==o&&e[a]!==`
3
+ `;)a+=e[a]==="\\"?2:1;t+=`${o}${" ".repeat(Math.max(0,a-n-1))}${o}`,n=a}else t+=o}return t}function xo(e){const t=un(e);if(/@import/i.test(t))return"@import is not allowed: themes cannot load other stylesheets.";if(t.includes("\\"))return"Backslash escapes are only allowed inside quoted strings.";if(ct.test(t))return"image-set(), image() and src() are not allowed: use url() with a theme file or a data: address.";const n=e.replace(/\/\*[\s\S]*?\*\//g," "),o=lt(n);if(o===null)return'A url() could not be read. Write url("/api/theme-assets/<theme>/<file>").';const a=o.find(i=>!it(i));return a!==void 0?`url(${a.slice(0,80)}) is not allowed: themes load only their own files (${nn}<theme>/<file>), data: addresses or #ids, never the internet.`:null}function ue(e=typeof document>"u"?null:document.documentElement){if(!e||typeof window>"u"||typeof window.getComputedStyle!="function")return"dark";try{return window.getComputedStyle(e).getPropertyValue("--code-color-scheme").trim()==="light"?"light":"dark"}catch{return"dark"}}function bo(){const[e,t]=u.useState(()=>ue());return u.useEffect(()=>{const n=()=>t(ue());if(n(),typeof MutationObserver>"u")return;const o=new MutationObserver(n);return o.observe(document.documentElement,{attributes:!0,attributeFilter:["data-skin"]}),()=>o.disconnect()},[]),e}const N=[255,255,255],P=[0,0,0];function Q(e){const t=e.trim().replace(/^#/,""),n=t.length===3?[...t].map(a=>a+a).join(""):t,o=Number.parseInt(n.slice(0,6),16);return Number.isFinite(o)?[o>>16&255,o>>8&255,o&255]:P}const K=e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,"0"),d=([e,t,n],o)=>`#${K(e)}${K(t)}${K(n)}${o===void 0?"":K(o*255)}`,v=(e,t,n)=>[0,1,2].map(o=>e[o]+(t[o]-e[o])*n);function ee([e,t,n]){const o=a=>{const i=a/255;return i<=.03928?i/12.92:((i+.055)/1.055)**2.4};return .2126*o(e)+.7152*o(t)+.0722*o(n)}function de(e,t){const[n,o]=[ee(e),ee(t)].sort((a,i)=>i-a);return(n+.05)/(o+.05)}const Re=e=>ee(Q(e))<.2?"dark":"light";function X(e,t,n){const o=ee(t)<.2?N:P;let a=e;for(let i=1;i<=20&&de(a,t)<n;i++)a=v(e,o,i/20);return a}const dt=e=>de(N,e)>=de(P,e)?N:[17,17,17];function dn(e,t){const n=Q(e),o=t==="dark",a=f=>v(n,o?N:P,f),i=o?a(.08):v(n,N,.85),c=a(o?.14:.06),l=X(v(o?N:P,n,o?.04:.1),n,12),x=a(o?.22:.07);return{app:d(n),panel:d(o?v(n,P,.25):v(n,N,.45)),frame:d(o?v(n,P,.25):v(n,N,.45)),raised:d(i),"raised-hover":d(c),card:d(o?a(.07):i),inset:d(o?a(.04):n),control:d(a(o?.12:.07)),composer:d(o?a(.07):i),"composer-ring":d(a(o?.14:.12)),menu:d(i),"menu-hover":d(l,.06),"menu-active":d(l,.09),hairline:d(a(.2)),edge:d(l,.08),scrollbar:d(a(o?.25:.22)),ink:d(l),"ink-secondary":d(X(v(l,n,o?.3:.4),c,4.5)),"ink-tertiary":d(X(v(l,n,o?.42:.5),c,4.5)),"bubble-user":d(x),"bubble-user-ink":d(o?dt(x):l)}}function mn(e,t,n){const o=Q(e),a=X(o,Q(n),4.5);return{accent:d(o),"accent-ink":d(dt(o)),"accent-border":d(t==="dark"?v(o,N,.2):v(o,P,.1)),"accent-text":d(a),focus:d(a)}}class pn extends Error{}function G(e,t){const n=globalThis[t];return typeof n=="function"&&e instanceof n}function $e(e){const t=e.style;return t&&typeof t=="object"&&typeof t.getPropertyValue=="function"?t:null}function He(e){for(let t=e.length-1;t>=0;t--){const n=e.item(t);ut(e.getPropertyValue(n))&&e.removeProperty(n)}}const fn=e=>"cssRules"in e&&typeof e.deleteRule=="function";function De(e,t,n){try{e.deleteRule(t)}catch{if(!G(n,"CSSNamespaceRule"))throw new pn}}function mt(e){for(let t=e.cssRules.length-1;t>=0;t--){const n=e.cssRules[t];if(!n)continue;if(G(n,"CSSKeyframesRule")){for(const a of Array.from(n.cssRules)){const i=$e(a);i&&He(i)}continue}if(G(n,"CSSPropertyRule")){ut(n.initialValue??"")&&De(e,t,n);continue}const o=$e(n);o&&He(o),fn(n)?mt(n):!o&&!G(n,"CSSLayerStatementRule")&&De(e,t,n)}}let R=null,Me="";function ze(e){if(!(typeof document>"u"||typeof CSSStyleSheet>"u"||!("adoptedStyleSheets"in document))&&e!==Me){Me=e,R||(R=new CSSStyleSheet,document.adoptedStyleSheets=[...document.adoptedStyleSheets,R]);try{R.replaceSync(e),mt(R)}catch{R.replaceSync("")}}}const me="omb-theme",Be="omb-safe-look";let A=null,B=[],se=!1;const pe=new Set;function F(e){try{return typeof window>"u"?void 0:window[e]}catch{return}}function hn(){try{return typeof location<"u"&&new URLSearchParams(location.search).has(on)&&F("sessionStorage")?.setItem(Be,"1"),F("sessionStorage")?.getItem(Be)==="1"}catch{return!1}}function go(){return A}function yo(e){return pe.add(e),()=>{pe.delete(e)}}function xn(e){for(const t of B)e.style.removeProperty(t);B=[]}function Y(){if(!(typeof document>"u"||se)){se=!0;try{const e=document.documentElement;xn(e);const t=hn()?null:A?.theme;if(!t){delete e.dataset.theme,ze(""),Te(Ie());return}const n=t.skin??(t.canvas?Ct[Re(t.canvas)]:void 0);Te(n?Pt(n):Ie());const o=ue(e),a=t[o],i=a?.canvas??(t.canvas&&Re(t.canvas)===o?t.canvas:void 0),c=a?.accent??t.accent,l={...i?dn(i,o):{},...c?mn(c,o,i??(o==="dark"?"#121212":"#ffffff")):{},...t.colors,...a?.colors};for(const x of at){const f=l[x];f&&(e.style.setProperty(`--color-${x}`,f),B.push(`--color-${x}`))}i&&(e.style.setProperty("--code-color-scheme",o),B.push("--code-color-scheme")),t.font&&(e.style.setProperty("--font-sans",t.font),B.push("--font-sans")),e.dataset.theme=A.id,ze(t.css??"")}finally{se=!1;for(const e of pe)e()}}}function ye(e){A=e;try{e?F("localStorage")?.setItem(me,JSON.stringify(e)):F("localStorage")?.removeItem(me)}catch{}Y()}function bn(){try{const e=JSON.parse(F("localStorage")?.getItem(me)??"null"),t=ge.safeParse(e?.theme);return typeof e?.id=="string"&&t.success?{id:e.id,theme:t.data}:null}catch{return null}}async function ke(){try{const e=await fetch("/api/themes/active",{headers:{accept:"application/json"}});if(!e.ok)return;const t=await e.json(),n=t.theme?ge.safeParse(t.theme):null;ye(t.id&&n?.success?{id:t.id,theme:n.data}:null)}catch{}}function ko(e){const t=e.skin;(t==="system"||qe.includes(t))&&be(t),ke()}const we=(e,t)=>fetch("/api/themes/active",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({id:e,...t?{skin:t}:{}})}).then(n=>n.ok,()=>!1);function wo(){A&&(ye(null),we(null))}async function vo(e){const t=await we(e);return t&&await ke(),t}function gn(){be(Pe),ye(null),we(null,Pe)}const yn=e=>e.code==="KeyR"&&e.altKey&&e.shiftKey&&(e.metaKey||e.ctrlKey);function kn(){if(!(typeof window>"u")){if(window.addEventListener("keydown",e=>{yn(e)&&(e.preventDefault(),e.stopPropagation(),gn())},{capture:!0}),Et(Y),typeof matchMedia=="function")try{matchMedia("(prefers-color-scheme: dark)").addEventListener("change",Y)}catch{}A=bn(),A&&Y()}}function wn({credential:e,owner:t,team:n}){const[o]=u.useState(()=>J()),[a,i]=u.useState(!1),[c,l]=u.useState(null);async function x(){i(!0),l(null);const f=await Zt(e,o);if(f.ok){location.replace("/");return}i(!1),l(f.error)}return r.jsx("main",{className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",children:r.jsxs("div",{className:"w-full max-w-[420px]",children:[r.jsx("h1",{className:"text-[20px] font-semibold",children:n?s("pair.browser.teamTitle",{team:n,owner:t}):s("pair.browser.title",{owner:t})}),r.jsx("p",{className:"mt-1.5 text-[14px] text-ink-secondary",children:s("pair.browser.notYou")}),c?r.jsx("p",{role:"alert",className:"mt-3 text-[13px] text-danger",children:c}):null,r.jsx("button",{type:"button",onClick:()=>{x()},disabled:a,className:"mt-5 w-full rounded-md bg-accent px-4 py-2 text-[14px] font-medium text-accent-ink disabled:opacity-50",children:s(a?"pair.signingIn":"pair.continue")})]})})}const ve="bg-composer ring-1 ring-inset ring-ink/[0.07]",vn="bg-composer ring-[0.5px] ring-ink/10",So=`${vn} shadow-(--shadow-float)`,pt="transition-colors duration-[120ms] hover:bg-[color-mix(in_srgb,var(--color-composer),var(--color-ink)_7%)]",Sn=`${pt} aria-expanded:bg-[color-mix(in_srgb,var(--color-composer),var(--color-ink)_7%)]`,jo="bg-[color-mix(in_srgb,var(--color-composer),var(--color-ink)_7%)]",No="focus-visible:outline-2 focus-visible:-outline-offset-2! focus-visible:outline-focus",ft="flex size-9 shrink-0 items-center justify-center rounded-full text-ink/90",Se="focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",jn=`${ft} ${ve} ${Sn} ${Se}`,Eo=`${ft} ${ve} ${pt} ${Se}`,Nn=`flex size-[26px] shrink-0 items-center justify-center rounded-lg text-ink-secondary transition-colors hover:bg-ink/[0.06] hover:text-ink aria-expanded:bg-ink/[0.06] aria-expanded:text-ink ${Se}`,Co="flex size-10 shrink-0 items-center justify-center rounded-full border border-hairline bg-card text-ink hover:bg-raised focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",En="flex size-9 shrink-0 items-center justify-center rounded-xl text-ink-secondary hover:bg-raised/60 hover:text-ink focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus";function Po({open:e,onToggle:t,corner:n=!1,ref:o}){return r.jsx("button",{ref:o,type:"button","data-sidebar-search-toggle":!0,onClick:t,"aria-label":s("sidebar.searchAria"),"aria-expanded":e,title:s("sidebar.searchAria"),className:n?Nn:jn,children:r.jsx(Je,{size:n?17:18,strokeWidth:1.5,"aria-hidden":"true"})})}function To({query:e,onQuery:t,onClose:n}){return r.jsx("div",{"data-sidebar-search-pill":!0,className:"px-3 pb-2 pt-0.5",children:r.jsxs("div",{className:$("flex h-[34px] items-center gap-2 rounded-full pl-3 pr-1.5 text-ink-secondary focus-within:ring-focus",ve),children:[r.jsx(Je,{size:15,"aria-hidden":"true",className:"shrink-0"}),r.jsx("input",{autoFocus:!0,value:e,onChange:o=>t(o.target.value),onKeyDown:o=>{o.key==="Escape"&&(o.preventDefault(),n())},placeholder:s("sidebar.searchAria"),"aria-label":s("sidebar.searchAria"),className:"min-w-0 flex-1 bg-transparent text-[13px] text-ink placeholder:text-ink-tertiary focus:outline-none"}),r.jsx("button",{type:"button",onClick:n,"aria-label":s("sidebar.searchClose"),title:s("sidebar.searchClose"),className:"flex size-6 shrink-0 items-center justify-center rounded-full text-ink-tertiary hover:bg-raised hover:text-ink focus-visible:outline focus-visible:outline-2 focus-visible:outline-focus",children:r.jsx(Tt,{size:14,"aria-hidden":"true"})})]})})}function Cn(e,{howTo:t=!1,onClosed:n}={}){return e.menu(t?{from:"howto"}:void 0).finally(()=>{t&&n?.()})}function Io(e){e({type:"cloudHowTo",open:!1})}function Fe({text:e}){return r.jsxs("span",{className:"font-normal text-ink-secondary",children:[" · ",e]})}function Pn(e){return e?.sleeps===!0?!0:e?.status==="paid"?!1:null}function Tn(e){const t=e&&!window.ogb?.remoteClient?.active?window.ogb?.cloudPlan:void 0,n=e||window.ogb?.remoteClient?.active?void 0:window.ogb?.cloudAccount,[o,a]=u.useState(null),[i,c]=u.useState(!1);return u.useEffect(()=>{if(!t)return;let l=!0;return t.state().then(x=>{l&&a(Pn(x))}).catch(()=>{}),()=>{l=!1}},[t]),u.useEffect(()=>n?.onState(l=>c(l.waking===!0)),[n]),{sleeps:t?o:null,waking:i}}function In({cloudHome:e=!1,howTo:t=!1,onMenuClosed:n}){const o=window.ogb?.workspaces,[a,i]=u.useState(null),[c,l]=u.useState(!1),[x,f]=u.useState("");u.useEffect(()=>{let p=!0;const k=()=>{o?.state().then(E=>{p&&i(E)}).catch(()=>{})};k();const I=o?.onChanged?.(k);return()=>{p=!1,I?.()}},[o]);const w=Tn(e||a?.home===!0),m=w.sleeps===null?"":s(w.sleeps?"cloudSetup.sleepsWhenIdle":"cloudSetup.alwaysOn"),g=w.waking?s("cloudHome.waking"):"";return{bridge:o,current:a,cloudHome:e,open:c,error:x,onLine:m,waking:g,openMenu:()=>{!o||c||(f(""),l(!0),Cn(o,{howTo:t,onClosed:n}).catch(()=>f(s("sidebar.switchServerError"))).finally(()=>l(!1)))},switchable:!!o&&a?.home!==!0}}function _n(e){const t=It(),n=r.jsx(An,{...e});return _t(t)?r.jsx("div",{"data-switcher-beside-rail":!0,className:t.beside?"hidden":"contents md:hidden",children:n}):n}function An({compact:e=!1,inline:t=!1,pill:n=!1,rail:o=!1,cloudHome:a=!1,owner:i=null,howTo:c=!1,place:l,onMenuClosed:x}){const f=l||s("cloudSetup.myCloud"),{bridge:w,current:m,open:g,error:y,onLine:p,waking:k,openMenu:I}=In({cloudHome:a,howTo:c,onMenuClosed:x}),E=b=>p?`${b} · ${p}`:b;if(!w||m?.home===!0){if(!a&&!m?.home)return null;const b=i?s("sidebar.cloudOwner",{email:i}):"",j=`${E(f)}${b?` · ${b}`:""}`;return o?r.jsx("div",{"data-cloud-home-indicator":!0,"data-workspace-switcher":"rail",role:"img","aria-label":j,title:j,className:"flex size-9 items-center justify-center text-ink-secondary",children:r.jsx(W,{size:18,"aria-hidden":"true"})}):t?r.jsxs("div",{"data-cloud-home-indicator":!0,"data-workspace-switcher":"inline",title:j,className:n?"flex h-8 min-w-0 items-center gap-1 rounded-full bg-raised/50 px-3 text-[13px] font-medium text-ink":"flex min-w-0 items-center gap-1.5 px-1.5 text-[13px] font-medium text-ink",children:[r.jsx(W,{size:n?15:14,"aria-hidden":"true",className:n?"hidden shrink-0 text-ink-secondary @max-[124px]/sidebar-top:block":"shrink-0 text-ink-secondary"}),r.jsx("span",{className:n?"min-w-0 truncate @max-[124px]/sidebar-top:hidden":"min-w-0 truncate",children:f}),(p||b)&&r.jsxs("span",{className:"sr-only",children:[p?` · ${p}`:"",b?` · ${b}`:""]})]}):r.jsx("div",{"data-cloud-home-indicator":!0,className:$("py-1.5",e?"px-2":"px-3"),children:r.jsxs("div",{title:j,className:$("flex items-center gap-2 py-2 text-[13px] font-medium text-ink",e?"justify-center px-1":"px-2"),children:[r.jsx(W,{size:16,"aria-hidden":"true",className:"shrink-0 text-ink-secondary"}),e?r.jsx("span",{className:"sr-only",children:j}):r.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[f,p&&r.jsx(Fe,{text:p}),b&&r.jsx("span",{className:"block truncate text-[12px] font-normal text-ink-secondary",children:b})]})]})})}const L=m?.profileName??(m?.local&&!m.localPath?s("place.local"):m?.name)??(a?f:s("sidebar.servers")),S=m?.local===!1||a&&!m?W:At,H=a?E(L):L,_=m?.origin?`${H} · ${m.origin}`:H,O=s("sidebar.switchServer",{name:H});return o?r.jsxs("div",{"data-workspace-switcher":"rail",className:"relative",children:[r.jsx("button",{type:"button","aria-label":O,"aria-haspopup":"menu","aria-expanded":g,"data-cloud-home-indicator":a||void 0,"data-tour":"server-switcher",title:_,onClick:I,className:$(En,"aria-expanded:bg-raised"),style:{WebkitAppRegion:"no-drag"},children:re(m?.color)?r.jsx(ae,{color:m?.color,size:18}):r.jsx(S,{size:18,"aria-hidden":"true"})}),y&&r.jsx("p",{role:"alert",className:"absolute bottom-0 left-full z-40 ml-2 w-56 rounded-md bg-menu px-2 py-1 text-[11px] text-danger shadow-lg",children:y}),k&&!y&&r.jsx("p",{role:"status","data-cloud-waking":!0,className:"absolute bottom-0 left-full z-40 ml-2 w-56 rounded-md bg-menu px-2 py-1 text-[11px] text-ink-secondary shadow-lg",children:k})]}):t?r.jsxs("div",{"data-workspace-switcher":"inline",className:"flex min-w-0",children:[r.jsxs("button",{type:"button","aria-label":O,"aria-haspopup":"menu","aria-expanded":g,"data-cloud-home-indicator":a||void 0,"data-tour":"server-switcher",title:_,onClick:I,className:n?"flex h-8 min-w-0 max-w-full items-center gap-1 overflow-hidden rounded-full bg-raised/50 pl-2.5 pr-1.5 text-left text-[13px] font-medium text-ink hover:bg-raised aria-expanded:bg-raised focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus":"flex h-7 min-w-0 max-w-full items-center gap-1.5 overflow-hidden rounded-md px-1.5 text-left text-[13px] font-medium text-ink hover:bg-control focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",style:{WebkitAppRegion:"no-drag"},children:[re(m?.color)?r.jsx(ae,{color:m?.color,size:16}):r.jsx(S,{size:n?15:14,"aria-hidden":"true","data-switcher-icon":!0,className:n?"hidden shrink-0 text-ink-secondary @max-[124px]/sidebar-top:block":"shrink-0 text-ink-secondary"}),r.jsx("span",{className:n?"min-w-0 truncate @max-[124px]/sidebar-top:hidden":"min-w-0 truncate @max-[96px]/sidebar-top:hidden",children:L}),r.jsx(_e,{size:n?12:11,"aria-hidden":"true",className:n?"shrink-0 text-ink-tertiary":"shrink-0 text-ink-secondary"})]}),y&&r.jsx("p",{role:"alert",className:"absolute right-2 top-full z-40 mt-1 w-56 max-w-[calc(100%-1rem)] rounded-md bg-menu px-2 py-1 text-[11px] text-danger shadow-lg",children:y}),k&&!y&&r.jsx("p",{role:"status","data-cloud-waking":!0,className:"absolute right-2 top-full z-40 mt-1 w-56 max-w-[calc(100%-1rem)] rounded-md bg-menu px-2 py-1 text-[11px] text-ink-secondary shadow-lg",children:k})]}):r.jsxs("div",{className:$("py-1.5",e?"px-2":"px-3"),children:[r.jsxs("button",{type:"button","aria-label":O,"aria-haspopup":"menu","aria-expanded":g,"data-cloud-home-indicator":a||void 0,"data-tour":"server-switcher",title:_,onClick:I,className:$("flex w-full items-center gap-2 rounded-lg py-2 text-left text-[13px] font-medium text-ink hover:bg-control focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",e?"justify-center px-1":"px-2"),style:{WebkitAppRegion:"no-drag"},children:[re(m?.color)?r.jsx(ae,{color:m?.color,size:20}):r.jsx(S,{size:16,className:"shrink-0 text-ink-secondary"}),!e&&r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[L,a&&p&&r.jsx(Fe,{text:p})]}),r.jsx(_e,{size:13,className:"shrink-0 text-ink-secondary"})]})]}),y&&r.jsx("p",{role:"alert",className:"mt-1 text-[11px] text-danger",children:y}),k&&!y&&r.jsx("p",{role:"status","data-cloud-waking":!0,className:"mt-1 text-[11px] text-ink-secondary",children:k})]})}function Ln(e){const t=e&&typeof e=="object"?e.membership:void 0,n=t&&typeof t=="object"?t:{};let o=null;if(typeof n.peopleUrl=="string")try{new URL(n.peopleUrl).protocol==="https:"&&(o=n.peopleUrl)}catch{o=null}return{authority:n.authority==="portal"?"portal":"local",pairingCodes:n.pairingCodes!==!1,peopleUrl:o}}const _o=()=>({type:"toggleAppSettings",open:!0,section:"companion",phonePairing:!0});function Ao(e){const t=typeof window>"u"?void 0:window.ogb;return On({companion:!!t?.companion,remoteClient:t?.remoteClient?.active===!0,cloudHome:e})}function On(e){return e.cloudHome?"cloud":e.companion&&!e.remoteClient?"computer":"server"}const Rn={computer:"sidebar.menu.connectPhone.computer",cloud:"sidebar.menu.connectPhone.cloud",server:"sidebar.menu.connectPhone.server"};function Lo(e,t){const n=t?.session?.kind==="session"?t.session.team?.name:void 0;return n?{target:e,subtitleKey:"sidebar.menu.connectPhone.team",team:n}:e!=="computer"&&!(t&&t.pairingCodes&&et(t.session))?null:{target:e,subtitleKey:Rn[e]}}function Oo(e,t){if(!e)return[];const n={...e,id:"here"};return e.target,[n]}let Ue=null;function Ro(e=fetch){return Ue??=te(e).then(async t=>{if(!et(t))return{session:t,pairingCodes:!1};const n=await e("/api/config",{credentials:"same-origin"}).then(o=>o.ok?o.json():null).catch(()=>null);return{session:t,pairingCodes:Ln(n).pairingCodes}}),Ue}const $n="data-phone-pairing-action";function $o(e,t=n=>window.requestAnimationFrame(n)){return e?(t(()=>{e.scrollIntoView?.({block:"start"}),(e.querySelector(`[${$n}]:not([disabled])`)??e).focus({preventScroll:!0})}),!0):!1}function Ho(e){const t=new URL(e);return t.searchParams.get("desktop-settings")!=="phone"?null:(t.searchParams.delete("desktop-settings"),`${t.pathname}${t.search}${t.hash}`)}function ie(e){const t=new URLSearchParams(e);if(t.get("desktop-settings")==="phone")return"/?desktop-settings=phone";const n=t.get("next");return n&&/^\/(?!\/)/.test(n)&&!n.startsWith("/pair")&&!/[\\\s]/.test(n)?n:"/"}const Hn="23456789ABCDEFGHJKLMNPQRSTUVWXYZ",Dn=12,Mn="omb_pair_",zn=/^omb_pair_[A-Za-z0-9_-]{43}$/;function Bn(e){return e.toUpperCase().replace(/[^A-Z0-9]/g,"").replace(/0/g,"O").replace(/1/g,"I")}const Fn={emailCode:"serverError.pair.emailCode",oldCode:"serverError.pair.oldCode",scriptKey:"serverError.pair.scriptKey",notACode:"serverError.pair.notACode"};function Un(e){let t;try{t=new URL(e)}catch{return null}const n=new URLSearchParams(t.hash.replace(/^#/,""));return t.searchParams.get("token")??t.searchParams.get("code")??n.get("code")}function ht(e){let t=e.trim();if(!t)return{kind:"empty"};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(t)){const a=Un(t);if(!a)return{kind:"wrong",problem:"notACode"};t=a.trim()}if(t.startsWith("omb_sess_"))return{kind:"wrong",problem:"scriptKey"};if(t.startsWith(Mn))return zn.test(t)?{kind:"credential",credential:t}:{kind:"wrong",problem:"notACode"};const n=t.replace(/[\s-]/g,"");if(/^\d{8}$/.test(n))return{kind:"wrong",problem:"emailCode"};if(/^\d{6}$/.test(n))return{kind:"wrong",problem:"oldCode"};const o=Bn(t);return o.length!==Dn||[...o].some(a=>!Hn.includes(a))?{kind:"wrong",problem:"notACode"}:{kind:"code",code:o}}const M="mt-1 w-full rounded-md border border-hairline/40 bg-inset px-3 py-2 text-[14px] text-ink outline-none focus:border-accent-border",We="mt-5 w-full rounded-md bg-accent px-4 py-2 text-[14px] font-medium text-accent-ink disabled:opacity-50",z="mt-4 block text-[12px] font-medium text-ink-secondary";function Wn(e,t=typeof window<"u"&&!!window.ogb?.workspaces){return!!e&&t}function Kn({mode:e,sent:t,email:n,cloudHome:o}){return e==="email"?t?s("pair.intro.emailSent",{email:n}):s("pair.intro.email"):o?s("pair.intro.cloud",{app:U(),open:s("cloudHome.connect"),section:s("settings.section.cloudAccount")}):s("pair.intro.code")}function Vn(e){const t=ht(e);return t.kind==="wrong"&&t.problem!=="notACode"?s(Fn[t.problem]):null}function Xn(e){const t=ht(e).kind;return t==="code"||t==="credential"}function Gn(e){return e.protocol==="http:"&&!Lt(e.hostname)}function Ke(e,t=Vt()){if(!e?.capabilities.cloudTeam||typeof t!="string")return null;try{const n=new URL(t),o=n.protocol==="http:"&&["127.0.0.1","localhost","[::1]"].includes(n.hostname);return(n.protocol==="https:"||o)&&!n.username&&!n.password&&!n.hash?n.href:null}catch{return null}}function Yn(e,t){return e?.capabilities.cloudTeam?e.label:e?.capabilities.cloudHome?s("pair.myCloud"):s(t==="email"?"pair.signInTo":"pair.connectTo",{name:e?.label??s("pair.thisLimixBot",{app:U()})})}function qn({team:e}){return r.jsx("main",{"data-team-left":!0,className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",children:r.jsx("p",{role:"status",className:"max-w-[420px] text-[16px]",children:s("homeLine.left",{name:e??s("pair.thisLimixBot",{app:U()})})})})}function V({initialCode:e,initialEmail:t=null,reason:n}){const[o,a]=u.useState(e??""),[i,c]=u.useState(tt()),[l,x]=u.useState(null),[f,w]=u.useState(null),[m,g]=u.useState(!1),[y,p]=u.useState(null),[k,I]=u.useState(()=>J()),[E,L]=u.useState(t&&!e?"email":"code"),[S,H]=u.useState(t??""),[_,O]=u.useState(""),[b,j]=u.useState(!1),[ne,bt]=u.useState(()=>Wn(e));u.useEffect(()=>{if(!ne||!e)return;let h=!0;return ce({code:e,label:i,attemptId:k}).then(C=>{if(h){if(C.ok){location.replace(ie(location.search));return}bt(!1),p(C.error)}}),()=>{h=!1}},[]),u.useEffect(()=>{fetch("/.well-known/openmausbot/environment").then(h=>h.ok?h.json():null).then(h=>{x(h)}).catch(()=>{x(null)}),te().then(w)},[]);const oe=Xt(f),gt=l?.capabilities.emailSignIn===!0,D=l?.capabilities.cloudHome===!0,yt=!D&&l?.capabilities.cloudTeam!==!0,Ne=Vn(o),Ee=typeof location<"u"&&typeof location.protocol=="string"?location:null;async function kt(h){h.preventDefault(),g(!0),p(null);const C=await ce({code:o,label:i,attemptId:k});if(g(!1),C.ok){location.replace(ie(location.search));return}p(C.error)}async function wt(h){h.preventDefault(),g(!0),p(null);const C=b?await en({email:S,code:_,label:i}):await Qt(S);if(g(!1),!C.ok){p(C.error);return}if(b){location.replace(ie(location.search));return}j(!0)}function Ce(h){L(h),p(null)}return r.jsxs("main",{className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",children:[r.jsx("div",{className:"absolute left-3 top-12 max-w-[280px]",children:r.jsx(_n,{})}),r.jsxs("div",{className:"w-full max-w-[420px]",children:[Ee&&Gn(Ee)?r.jsx("p",{role:"alert",className:"mb-4 rounded-md border border-warning/30 bg-warning/10 px-3 py-2 text-[13px] text-warning",children:s("pair.notEncrypted")}):null,ne?r.jsx("p",{role:"status",className:"text-[20px] font-semibold",children:D?s("pair.openingCloud"):s("pair.connectingTo",{name:l?.label??s("pair.thisLimixBot")})}):r.jsxs(r.Fragment,{children:[r.jsx("h1",{className:"text-[20px] font-semibold",children:Yn(l,E)}),r.jsxs("p",{className:"mt-1.5 text-[14px] leading-relaxed text-ink-secondary",children:[l&&!D?`${s("pair.version",{version:l.version,platform:l.platform})} `:"",Kn({mode:E,sent:b,email:S,cloudHome:D})]}),Le(n)&&!oe?r.jsx("p",{className:"mt-3 text-[13px] text-ink-secondary",children:Le(n)}):null,y&&D&&e?r.jsx("p",{className:"mt-3 text-[13px] text-ink-secondary",children:s("pair.expired",{app:U(),open:s("cloudHome.connect"),section:s("settings.section.cloudAccount")})}):null,!oe&&Ke(l)?r.jsxs("div",{"data-team-sign-in":!0,className:"mt-4 flex flex-col items-start gap-1.5",children:[r.jsx("a",{href:Ke(l),className:"rounded-md bg-accent px-4 py-2 text-[14px] font-medium text-accent-ink",children:s("pair.team.open",{team:l.label})}),r.jsx("p",{className:"text-[13px] text-ink-secondary",children:s("pair.team.openHint")})]}):null]}),ne?null:oe?r.jsxs("p",{className:"mt-4 text-[14px]",children:[s("pair.alreadyConnected")," ",r.jsx("a",{href:"/",className:"text-accent underline",children:s("pair.openApp")})]}):E==="email"?r.jsxs("form",{onSubmit:wt,children:[r.jsx("label",{className:z,htmlFor:"signin-email",children:s("cloudBuy.signIn.email")}),r.jsx("input",{id:"signin-email",type:"email",value:S,onChange:h=>{H(h.target.value),j(!1),O("")},autoComplete:"email",inputMode:"email",spellCheck:!1,className:M}),b?r.jsxs(r.Fragment,{children:[r.jsx("label",{className:z,htmlFor:"signin-code",children:s("pair.emailCode")}),r.jsx("input",{id:"signin-code",value:_,onChange:h=>O(h.target.value),placeholder:"12345678",autoComplete:"one-time-code",inputMode:"numeric",spellCheck:!1,className:`${M} font-mono text-[15px] tracking-[0.12em]`}),r.jsx("label",{className:z,htmlFor:"signin-label",children:s("pair.deviceLabel")}),r.jsx("input",{id:"signin-label",value:i,onChange:h=>c(h.target.value),maxLength:80,className:M})]}):null,y?r.jsx("p",{className:"mt-3 text-[13px] text-danger",children:y}):null,r.jsx("button",{type:"submit",disabled:m||!S.includes("@")||b&&_.replace(/\D/g,"").length<8,className:We,children:s(m?b?"pair.signingIn":"pair.sending":b?"pair.signIn":"cloudBuy.signIn.send")}),b?r.jsx("button",{type:"button",onClick:()=>j(!1),className:"mt-3 w-full text-[13px] text-ink-secondary underline",children:s("pair.resend")}):null,r.jsx("button",{type:"button",onClick:()=>Ce("code"),className:"mt-3 w-full text-[13px] text-ink-secondary underline",children:s("pair.useCode")})]}):r.jsxs("form",{onSubmit:kt,children:[r.jsx("label",{className:z,htmlFor:"pair-code",children:s("pair.code")}),r.jsx("input",{id:"pair-code",value:o,onChange:h=>{a(h.target.value),I(J())},placeholder:"XXXX-XXXX-XXXX","aria-describedby":e&&o===e?"pair-code-from-link":void 0,autoComplete:"one-time-code",autoCapitalize:"characters",spellCheck:!1,className:`${M} font-mono text-[15px] tracking-[0.12em]`}),e&&o===e?r.jsx("p",{id:"pair-code-from-link",className:"mt-1 text-[12px] text-ink-secondary",children:s("pair.fromLink")}):null,r.jsx("label",{className:z,htmlFor:"pair-label",children:s("pair.deviceLabel")}),r.jsx("input",{id:"pair-label",value:i,onChange:h=>c(h.target.value),maxLength:80,className:M}),Ne?r.jsx("p",{role:"alert",className:"mt-3 text-[13px] text-danger",children:Ne}):y?r.jsx("p",{className:"mt-3 text-[13px] text-danger",children:y}):null,r.jsx("button",{type:"submit",disabled:m||!Xn(o),className:We,children:s(m?"pair.connecting":"pair.connect")}),null,yt?r.jsxs("p",{className:"mt-3 text-[13px] text-ink-secondary",children:[s("pair.noCode")," ",r.jsx("code",{className:"select-all rounded bg-inset px-1.5 py-0.5 text-[12px] text-ink",children:"npx limixbot pair"})]}):null,gt?r.jsxs("p",{className:"mt-5 border-t border-hairline/40 pt-4 text-[13px] text-ink-secondary",children:[s("pair.invitedByEmail")," ",r.jsx("button",{type:"button",onClick:()=>Ce("email"),className:"text-accent underline",children:s("pair.useEmail")})]}):null]})]})]})}const Do="cloud-welcome-done",Jn="unauthorized: you are no longer in this team",Ve=[["reserving","cloudHome.step.reserving"],["storage","cloudHome.step.storage"],["starting","cloudHome.step.starting"],["checking","cloudHome.step.checking"]];function Zn({step:e}){const t=Ve.findIndex(([n])=>n===e);return r.jsx("ol",{"data-cloud-setup":e,className:"flex flex-col gap-1 text-[13px]",children:Ve.map(([n,o],a)=>r.jsx("li",{"aria-current":a===t?"step":void 0,className:a===t?"font-medium text-ink":a<t?"text-ink-secondary line-through decoration-ink-secondary/40":"text-ink-secondary",children:s(o)},n))})}const Qn={stopped:"cloudHome.stopped","payment-problem":"cloudHome.paymentProblem",failed:"cloudHome.failed"},Xe={host:"cloudHome.unreachableHost",no_answer:"cloudHome.unreachable"};function eo(e,t=Date.now()){const n=new Date(e).getFullYear()!==new Date(t).getFullYear();return new Intl.DateTimeFormat(Ot(),{day:"numeric",month:"long",...n?{year:"numeric"}:{}}).format(new Date(e))}function to(e,t=Date.now()){const n=e?.name??null,o=(a,i)=>n?s(i,{name:n}):s(a);return e?.screen==="setup"?{title:o("homeScreen.setup","homeScreen.setupNamed"),body:s(e.slow?"cloudHome.slow":"homeScreen.setupBody"),reason:null,action:null,busy:!0}:e?.screen==="offline"?{title:o("homeScreen.offline","homeScreen.offlineNamed"),body:s("homeScreen.offlineBack"),reason:e.cause&&Object.hasOwn(Xe,e.cause)?s(Xe[e.cause]):e.reason??null,action:"retry",busy:!1}:e?.screen==="signin"?{title:o("homeScreen.signIn","homeScreen.signInNamed"),body:s(e.other?"homeScreen.signInOther":"homeScreen.signInEnded"),reason:null,action:"sign-in",busy:!1}:e?.screen==="plan"&&e.member&&e.machine!=="failed"?{title:o("homeScreen.plan","homeScreen.planNamed"),body:s("cloudHome.stoppedMember"),reason:null,action:null,busy:!1}:e?.screen==="plan"?{title:o("homeScreen.plan","homeScreen.planNamed"),body:s(Qn[e.machine]??"cloudHome.failed"),reason:null,action:e.machine==="failed"?null:"manage",busy:!1}:e?.screen==="ended"?{title:o("cloudHome.ended","cloudHome.endedNamed"),body:e.deleteAt?s("cloudHome.endedFiles",{date:eo(e.deleteAt,t)}):null,reason:null,action:"buy",busy:!1}:e?.screen==="checkout"?{title:o("cloudHome.checkout","cloudHome.checkoutNamed"),body:null,reason:null,action:"continue",busy:!1}:e?.screen==="payment"?{title:o("cloudHome.payment","cloudHome.paymentNamed"),body:s("cloudHome.paymentBody"),reason:null,action:"card",busy:!1}:e?.screen==="waking"?{title:s("homeScreen.waking"),body:null,reason:null,action:null,busy:!0}:e?.screen==="moving"?{title:o("homeScreen.moving","homeScreen.movingNamed"),body:null,reason:null,action:null,busy:!0}:{title:o("homeScreen.opening","homeScreen.openingNamed"),body:null,reason:null,action:null,busy:!0}}const no={retry:"cloudHome.tryAgain",buy:"cloudHome.buyAgain",continue:"cloudHome.continue",card:"cloudHome.updateCard"};function oo({name:e,remove:t}){const[n,o]=u.useState(!1),[a,i]=u.useState(!1),[c,l]=u.useState(null),x=()=>{i(!0),l(null),t().then(f=>{i(!1),f!=="removed"&&f!=="gone"&&(o(!1),l(f==="refused"?"refused":"failed"))},()=>{i(!1),o(!1),l("failed")})};return r.jsxs("div",{"data-home-remove":!0,className:"flex flex-col items-start gap-2",children:[n?r.jsxs("div",{role:"alertdialog","aria-label":s("rail.remove"),className:"flex flex-col gap-2 rounded-xl border border-hairline/70 bg-card/70 px-4 py-3",children:[r.jsx("p",{className:"text-[13px] leading-relaxed text-ink",children:s("rail.removeAsk",{name:e})}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"button","data-home-remove-confirm":!0,className:"ui-button ui-button-primary",disabled:a,onClick:x,children:s("rail.removeYes")}),r.jsx("button",{type:"button",className:"ui-button",disabled:a,onClick:()=>o(!1),children:s("rail.removeNo")})]})]}):r.jsx("button",{type:"button","data-home-remove-ask":!0,className:"text-[13px] text-ink-secondary underline-offset-2 hover:text-ink hover:underline",onClick:()=>{l(null),o(!0)},children:s("rail.remove")}),c&&r.jsx("p",{role:"alert",className:"text-[13px] text-danger",children:s(c==="refused"?"rail.removeRefused":"rail.removeFailed")})]})}function ro({bridge:e,manage:t}){const[n,o]=u.useState(null),[a,i]=u.useState(!1);u.useEffect(()=>{let g=!0;const y=e.onState(k=>o(k)),p=()=>{e.retry().then(k=>{g&&o(k)}).catch(()=>{})};return e.state().then(k=>{g&&o(k)}).catch(()=>{}).then(p),window.addEventListener("online",p),window.addEventListener("focus",p),()=>{g=!1,y(),window.removeEventListener("online",p),window.removeEventListener("focus",p)}},[e]);const c=to(n),l=g=>{i(!1),g().catch(()=>i(!0))},x=window.ogb?.cloudAdd?.reopen,f={retry:()=>e.retry().then(g=>o(g)),...t?{manage:t,buy:t,card:t,continue:async()=>{x&&await x().catch(()=>!1)||await t()}}:{}},w=c.action&&c.action!=="sign-in"&&c.action!=="manage"?c.action:null,m=(n?.screen==="ended"||n?.screen==="payment")&&n.removable===!0&&typeof e.remove=="function";return r.jsx("main",{"data-home-screen":n?.screen??"opening",className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",style:{WebkitAppRegion:"drag"},children:r.jsxs("div",{className:"flex w-full max-w-[420px] flex-col items-start gap-3",style:{WebkitAppRegion:"no-drag"},children:[r.jsxs("p",{role:"status",className:"flex items-center gap-2 text-[20px] font-semibold",children:[c.busy&&r.jsx("span",{"aria-hidden":"true",className:"size-3.5 shrink-0 animate-spin rounded-full border-2 border-hairline border-t-accent"}),c.title]}),c.body&&r.jsx("p",{className:"text-[14px] leading-relaxed text-ink-secondary",children:c.body}),n?.screen==="setup"&&r.jsx(Zn,{step:n.step??"reserving"}),c.reason&&r.jsx("p",{"data-home-reason":!0,className:"text-[13px] leading-relaxed text-ink-secondary",children:c.reason}),c.action==="sign-in"&&r.jsx("button",{type:"button",className:"ui-button ui-button-primary mt-2",onClick:()=>l(()=>e.signIn()),children:s("homeScreen.signInButton")}),c.action==="manage"&&t&&r.jsx("button",{type:"button",className:"ui-button mt-2",onClick:()=>l(t),children:s("cloudAccount.manageInBrowser")}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[n?.screen==="offline"&&e.openLocal&&r.jsx("button",{type:"button","data-home-action":"local",className:"ui-button ui-button-primary mt-2",onClick:()=>l(async()=>{if(!await e.openLocal())throw new Error}),children:s("homeScreen.useLocal")}),w&&f[w]&&r.jsx("button",{type:"button","data-home-action":w,className:w==="retry"?"ui-button mt-2":"ui-button ui-button-primary mt-2",onClick:()=>l(f[w]),children:s(no[w])})]}),m&&r.jsx(oo,{name:n.name??s("cloudSetup.myCloud"),remove:()=>e.remove()}),a&&r.jsx("p",{role:"alert",className:"text-[13px] text-danger",children:s("cloudAccount.actionFailed")})]})})}function ao({bridge:e,fallback:t}){const[n,o]=u.useState(!1);return u.useEffect(()=>{e.repair().catch(()=>o(!0))},[e]),n?r.jsx(r.Fragment,{children:t}):r.jsx("main",{"data-home-screen":"opening",className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",children:r.jsx("p",{role:"status",className:"w-full max-w-[420px] text-[20px] font-semibold",children:s("homeScreen.opening")})})}const je="omb.session-ended";let fe=!1,le=null;const he=new Set;function Mo(){fe||le||(le=te().then(e=>{if(e.kind==="unauthenticated"){fe=!0;try{sessionStorage.setItem(je,"1")}catch{}for(const t of he)t()}}).finally(()=>{le=null}))}function Ge(){return fe}function zo(){return u.useSyncExternalStore(e=>(he.add(e),()=>he.delete(e)),Ge,Ge)}function so(){try{return sessionStorage.getItem(je)==="1"}catch{return!1}}function io(){try{sessionStorage.removeItem(je)}catch{}}Rt();be($t());Ht(Dt());tn();Mt(zt());kn();const q=Bt(),lo=new Set(["/home","/pair","/desktop-viewer"]),xt=()=>Ze(()=>import("./App-CeGk9O7P.js").then(e=>e.kb),__vite__mapDeps([0,1,2,3,4,5])).catch(e=>({default:()=>{throw e}})),co=lo.has(location.pathname)?null:xt(),uo=()=>fetch("/.well-known/openmausbot/environment").then(e=>e.json()).then(e=>e.capabilities?.cloudTeam===!0&&typeof e.label=="string"?e.label:null,()=>null);async function mo(){const e=window.ogb?.home;if(location.pathname==="/home"&&e)return r.jsx(ro,{bridge:e,manage:window.ogb?.cloudPlan?.manage});if(location.pathname==="/pair"){const o=Yt();if(o){const a=await Jt(o);return await q,a?r.jsx(wn,{credential:o,owner:a.owner,team:a.team}):r.jsx(V,{initialCode:null,reason:s("pair.browser.signInFailed")})}return r.jsx(V,{initialCode:Gt(),initialEmail:qt()})}const t=await te();if(t.kind==="unauthenticated"){if(await q,t.error===Jn)return r.jsx(qn,{team:await uo()});const o=r.jsx(V,{initialCode:null,reason:so()?s("pair.sessionEnded"):t.error});return e?r.jsx(ao,{bridge:e,fallback:o}):o}if(io(),t.kind==="session"&&Kt(t.teamSignIn),t.kind==="loopback"&&t.trust==="service")return await q,r.jsx(V,{initialCode:null,reason:s("pair.serviceTrust")});if(location.pathname==="/desktop-viewer"){const{DesktopViewer:o}=await Ze(async()=>{const{DesktopViewer:a}=await import("./DesktopViewer-DCC-jq_j.js");return{DesktopViewer:a}},__vite__mapDeps([6,1,2,7,8,5,4,9]));return r.jsx(o,{})}const{default:n}=await(co??xt());return ke(),r.jsx(n,{})}document.title=U();Promise.all([Ft(),mo(),q]).then(([,e])=>{Ut.createRoot(document.getElementById("root")).render(r.jsx(u.StrictMode,{children:r.jsx(Wt,{children:e})}))});export{Eo as A,ho as B,Zn as C,No as D,So as E,Nn as F,_n as G,Po as H,To as I,vn as J,ue as K,jo as L,Do as M,zo as N,V as O,Co as P,Ho as Q,jn as S,rt as T,Ln as a,hn as b,gn as c,vo as d,wo as e,Ao as f,ko as g,Sn as h,et as i,ve as j,$o as k,ke as l,Oo as m,Mo as n,Cn as o,_o as p,fo as q,te as r,yo as s,xo as t,bo as u,Ro as v,go as w,Lo as x,In as y,Io as z};
@@ -1,2 +1,2 @@
1
- import{_ as e,l as s,T as n,d as i}from"./mermaid.core-CwYv1-pN.js";import{p}from"./cynefin-EF2NZ3EQ-CnBYCH8E.js";import"./styles-Be5qq6WR.js";import"./step-CkmJJ7wq.js";var g={parse:e(async r=>{const a=await p("info",r);s.debug(a)},"parse")},d={version:"12.1.0"},v=e(()=>d.version,"getVersion"),m={getVersion:v},c=e((r,a,o)=>{s.debug(`rendering info diagram
1
+ import{_ as e,l as s,T as n,d as i}from"./mermaid.core-DQALiqHr.js";import{p}from"./cynefin-EF2NZ3EQ-B3XBpINL.js";import"./styles-CE92r4H3.js";import"./step-CkmJJ7wq.js";var g={parse:e(async r=>{const a=await p("info",r);s.debug(a)},"parse")},d={version:"12.1.0"},v=e(()=>d.version,"getVersion"),m={getVersion:v},c=e((r,a,o)=>{s.debug(`rendering info diagram
2
2
  `+r);const t=n(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${o}`)},"draw"),l={draw:c},w={parser:g,db:m,renderer:l};export{w as diagram};
@@ -1,4 +1,4 @@
1
- import{_ as o,c as ot,Y as ut,T as dt,ae as yt,D as ft,m as pt,v as it,a as gt,b as kt,g as mt,s as wt,x as _t,d as bt}from"./mermaid.core-CwYv1-pN.js";import"./styles-Be5qq6WR.js";import"./step-CkmJJ7wq.js";var J=(function(){var e=o(function(T,t,s,i){for(s=s||{},i=T.length;i--;s[T[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],u=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],D={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,c,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return c;case 15:c.addNode(n[w-1].length,n[w].trim());break;case 16:c.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(u,[2,18],{14:[1,21]}),e(u,[2,16]),e(u,[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(u,[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],c=[],p=[null],n=[],v=this.table,w="",I=0,$=0,L=2,A=1,C=n.slice.call(arguments,1),b=Object.create(this.lexer),S={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&(S.yy[P]=this.yy[P]);b.setInput(t,S.yy),S.yy.lexer=b,S.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var R=b.yylloc;n.push(R);var G=b.options&&b.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function X(B){i.length=i.length-2*B,p.length=p.length-B,n.length=n.length-B}o(X,"popStack");function tt(){var B;return B=c.pop()||b.lex()||A,typeof B!="number"&&(B instanceof Array&&(c=B,B=c.pop()),B=s.symbols_[B]||B),B}o(tt,"lex");for(var M,W,N,K,F={},U,V,et,Y;;){if(W=i[i.length-1],this.defaultActions[W]?N=this.defaultActions[W]:((M===null||typeof M>"u")&&(M=tt()),N=v[W]&&v[W][M]),typeof N>"u"||!N.length||!N[0]){var q="";Y=[];for(U in v[W])this.terminals_[U]&&U>L&&Y.push("'"+this.terminals_[U]+"'");b.showPosition?q="Parse error on line "+(I+1)+`:
1
+ import{_ as o,c as ot,Y as ut,T as dt,ae as yt,D as ft,m as pt,v as it,a as gt,b as kt,g as mt,s as wt,x as _t,d as bt}from"./mermaid.core-DQALiqHr.js";import"./styles-CE92r4H3.js";import"./step-CkmJJ7wq.js";var J=(function(){var e=o(function(T,t,s,i){for(s=s||{},i=T.length;i--;s[T[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],u=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],D={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,c,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return c;case 15:c.addNode(n[w-1].length,n[w].trim());break;case 16:c.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(u,[2,18],{14:[1,21]}),e(u,[2,16]),e(u,[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(u,[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],c=[],p=[null],n=[],v=this.table,w="",I=0,$=0,L=2,A=1,C=n.slice.call(arguments,1),b=Object.create(this.lexer),S={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&(S.yy[P]=this.yy[P]);b.setInput(t,S.yy),S.yy.lexer=b,S.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var R=b.yylloc;n.push(R);var G=b.options&&b.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function X(B){i.length=i.length-2*B,p.length=p.length-B,n.length=n.length-B}o(X,"popStack");function tt(){var B;return B=c.pop()||b.lex()||A,typeof B!="number"&&(B instanceof Array&&(c=B,B=c.pop()),B=s.symbols_[B]||B),B}o(tt,"lex");for(var M,W,N,K,F={},U,V,et,Y;;){if(W=i[i.length-1],this.defaultActions[W]?N=this.defaultActions[W]:((M===null||typeof M>"u")&&(M=tt()),N=v[W]&&v[W][M]),typeof N>"u"||!N.length||!N[0]){var q="";Y=[];for(U in v[W])this.terminals_[U]&&U>L&&Y.push("'"+this.terminals_[U]+"'");b.showPosition?q="Parse error on line "+(I+1)+`:
2
2
  `+b.showPosition()+`
3
3
  Expecting `+Y.join(", ")+", got '"+(this.terminals_[M]||M)+"'":q="Parse error on line "+(I+1)+": Unexpected "+(M==A?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(q,{text:b.match,token:this.terminals_[M]||M,line:b.yylineno,loc:R,expected:Y})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+M);switch(N[0]){case 1:i.push(M),p.push(b.yytext),n.push(b.yylloc),i.push(N[1]),M=null,$=b.yyleng,w=b.yytext,I=b.yylineno,R=b.yylloc;break;case 2:if(V=this.productions_[N[1]][1],F.$=p[p.length-V],F._$={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},G&&(F._$.range=[n[n.length-(V||1)].range[0],n[n.length-1].range[1]]),K=this.performAction.apply(F,[w,$,I,S.yy,N[1],p,n].concat(C)),typeof K<"u")return K;V&&(i=i.slice(0,-1*V*2),p=p.slice(0,-1*V),n=n.slice(0,-1*V)),i.push(this.productions_[N[1]][0]),p.push(F.$),n.push(F._$),et=v[i[i.length-2]][i[i.length-1]],i.push(et);break;case 3:return!0}}return!0},"parse")},O=(function(){var T={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 c=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===c.length?this.yylloc.first_column:0)+c[c.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-BvT5jzrf.js";import{a as mt,b as lt,h as xt,d as kt}from"./chunk-7TKQ45FW-BPY6DMgY.js";import{g as _t,s as vt,a as bt,b as wt,x as Tt,v as St,_ as s,c as R,k as X,d as $t,D as Mt}from"./mermaid.core-CwYv1-pN.js";import{d as it}from"./arc-UbyzOkqk.js";import"./styles-Be5qq6WR.js";import"./step-CkmJJ7wq.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 H="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`:
1
+ import{g as gt}from"./chunk-5VM5RSS4-negAvO9N.js";import{a as mt,b as lt,h as xt,d as kt}from"./chunk-7TKQ45FW-DA_OVnE1.js";import{g as _t,s as vt,a as bt,b as wt,x as Tt,v as St,_ as s,c as R,k as X,d as $t,D as Mt}from"./mermaid.core-DQALiqHr.js";import{d as it}from"./arc-UbyzOkqk.js";import"./styles-CE92r4H3.js";import"./step-CkmJJ7wq.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 H="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`:
2
2
  `+_.showPosition()+`
3
3
  Expecting `+z.join(", ")+", got '"+(this.terminals_[b]||b)+"'":H="Parse error on line "+(C+1)+": Unexpected "+(b==D?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(H,{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 o,l as te,c as H,T as fe,a8 as ye,a9 as me,aa as be,a6 as _e,R as K,j as F,y as ke,J as Ee,a3 as Se,a4 as ce,a5 as le}from"./mermaid.core-CwYv1-pN.js";import{g as Ne}from"./chunk-5VM5RSS4-BvT5jzrf.js";import"./styles-Be5qq6WR.js";import"./step-CkmJJ7wq.js";var $=(function(){var e=o(function(O,i,n,r){for(n=n||{},r=O.length;r--;n[O[r]]=i);return n},"o"),h=[1,4],p=[1,13],s=[1,12],d=[1,15],_=[1,16],b=[1,20],l=[1,19],D=[6,7,8],I=[1,26],g=[1,24],w=[1,25],k=[6,7,11],G=[1,31],N=[6,7,11,24],V=[1,6,13,16,17,20,23],f=[1,35],A=[1,36],L=[1,6,7,11,13,16,17,20,23],M=[1,38],T={trace:o(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:o(function(i,n,r,a,u,t,U){var c=t.length-1;switch(u){case 6:case 7:return a;case 8:a.getLogger().trace("Stop NL ");break;case 9:a.getLogger().trace("Stop EOF ");break;case 11:a.getLogger().trace("Stop NL2 ");break;case 12:a.getLogger().trace("Stop EOF2 ");break;case 15:a.getLogger().info("Node: ",t[c-1].id),a.addNode(t[c-2].length,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 16:a.getLogger().info("Node: ",t[c].id),a.addNode(t[c-1].length,t[c].id,t[c].descr,t[c].type);break;case 17:a.getLogger().trace("Icon: ",t[c]),a.decorateNode({icon:t[c]});break;case 18:case 23:a.decorateNode({class:t[c]});break;case 19:a.getLogger().trace("SPACELIST");break;case 20:a.getLogger().trace("Node: ",t[c-1].id),a.addNode(0,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 21:a.getLogger().trace("Node: ",t[c].id),a.addNode(0,t[c].id,t[c].descr,t[c].type);break;case 22:a.decorateNode({icon:t[c]});break;case 27:a.getLogger().trace("node found ..",t[c-2]),this.$={id:t[c-1],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 28:this.$={id:t[c],descr:t[c],type:0};break;case 29:a.getLogger().trace("node found ..",t[c-3]),this.$={id:t[c-3],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 30:this.$=t[c-1]+t[c];break;case 31:this.$=t[c];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:p,7:[1,10],9:9,12:11,13:s,14:14,16:d,17:_,18:17,19:18,20:b,23:l},e(D,[2,3]),{1:[2,2]},e(D,[2,4]),e(D,[2,5]),{1:[2,6],6:p,12:21,13:s,14:14,16:d,17:_,18:17,19:18,20:b,23:l},{6:p,9:22,12:11,13:s,14:14,16:d,17:_,18:17,19:18,20:b,23:l},{6:I,7:g,10:23,11:w},e(k,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:b,23:l}),e(k,[2,19]),e(k,[2,21],{15:30,24:G}),e(k,[2,22]),e(k,[2,23]),e(N,[2,25]),e(N,[2,26]),e(N,[2,28],{20:[1,32]}),{21:[1,33]},{6:I,7:g,10:34,11:w},{1:[2,7],6:p,12:21,13:s,14:14,16:d,17:_,18:17,19:18,20:b,23:l},e(V,[2,14],{7:f,11:A}),e(L,[2,8]),e(L,[2,9]),e(L,[2,10]),e(k,[2,16],{15:37,24:G}),e(k,[2,17]),e(k,[2,18]),e(k,[2,20],{24:M}),e(N,[2,31]),{21:[1,39]},{22:[1,40]},e(V,[2,13],{7:f,11:A}),e(L,[2,11]),e(L,[2,12]),e(k,[2,15],{24:M}),e(N,[2,30]),{22:[1,41]},e(N,[2,27]),e(N,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(i,n){if(n.recoverable)this.trace(i);else{var r=new Error(i);throw r.hash=n,r}},"parseError"),parse:o(function(i){var n=this,r=[0],a=[],u=[null],t=[],U=this.table,c="",W=0,se=0,ue=2,re=1,ge=t.slice.call(arguments,1),m=Object.create(this.lexer),R={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(R.yy[J]=this.yy[J]);m.setInput(i,R.yy),R.yy.lexer=m,R.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var q=m.yylloc;t.push(q);var de=m.options&&m.options.ranges;typeof R.yy.parseError=="function"?this.parseError=R.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){r.length=r.length-2*S,u.length=u.length-S,t.length=t.length-S}o(pe,"popStack");function ae(){var S;return S=a.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(a=S,S=a.pop()),S=n.symbols_[S]||S),S}o(ae,"lex");for(var E,P,x,Q,j={},z,C,oe,X;;){if(P=r[r.length-1],this.defaultActions[P]?x=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=ae()),x=U[P]&&U[P][E]),typeof x>"u"||!x.length||!x[0]){var Z="";X=[];for(z in U[P])this.terminals_[z]&&z>ue&&X.push("'"+this.terminals_[z]+"'");m.showPosition?Z="Parse error on line "+(W+1)+`:
1
+ import{_ as o,l as te,c as H,T as fe,a8 as ye,a9 as me,aa as be,a6 as _e,R as K,j as F,y as ke,J as Ee,a3 as Se,a4 as ce,a5 as le}from"./mermaid.core-DQALiqHr.js";import{g as Ne}from"./chunk-5VM5RSS4-negAvO9N.js";import"./styles-CE92r4H3.js";import"./step-CkmJJ7wq.js";var $=(function(){var e=o(function(O,i,n,r){for(n=n||{},r=O.length;r--;n[O[r]]=i);return n},"o"),h=[1,4],p=[1,13],s=[1,12],d=[1,15],_=[1,16],b=[1,20],l=[1,19],D=[6,7,8],I=[1,26],g=[1,24],w=[1,25],k=[6,7,11],G=[1,31],N=[6,7,11,24],V=[1,6,13,16,17,20,23],f=[1,35],A=[1,36],L=[1,6,7,11,13,16,17,20,23],M=[1,38],T={trace:o(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:o(function(i,n,r,a,u,t,U){var c=t.length-1;switch(u){case 6:case 7:return a;case 8:a.getLogger().trace("Stop NL ");break;case 9:a.getLogger().trace("Stop EOF ");break;case 11:a.getLogger().trace("Stop NL2 ");break;case 12:a.getLogger().trace("Stop EOF2 ");break;case 15:a.getLogger().info("Node: ",t[c-1].id),a.addNode(t[c-2].length,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 16:a.getLogger().info("Node: ",t[c].id),a.addNode(t[c-1].length,t[c].id,t[c].descr,t[c].type);break;case 17:a.getLogger().trace("Icon: ",t[c]),a.decorateNode({icon:t[c]});break;case 18:case 23:a.decorateNode({class:t[c]});break;case 19:a.getLogger().trace("SPACELIST");break;case 20:a.getLogger().trace("Node: ",t[c-1].id),a.addNode(0,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 21:a.getLogger().trace("Node: ",t[c].id),a.addNode(0,t[c].id,t[c].descr,t[c].type);break;case 22:a.decorateNode({icon:t[c]});break;case 27:a.getLogger().trace("node found ..",t[c-2]),this.$={id:t[c-1],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 28:this.$={id:t[c],descr:t[c],type:0};break;case 29:a.getLogger().trace("node found ..",t[c-3]),this.$={id:t[c-3],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 30:this.$=t[c-1]+t[c];break;case 31:this.$=t[c];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:p,7:[1,10],9:9,12:11,13:s,14:14,16:d,17:_,18:17,19:18,20:b,23:l},e(D,[2,3]),{1:[2,2]},e(D,[2,4]),e(D,[2,5]),{1:[2,6],6:p,12:21,13:s,14:14,16:d,17:_,18:17,19:18,20:b,23:l},{6:p,9:22,12:11,13:s,14:14,16:d,17:_,18:17,19:18,20:b,23:l},{6:I,7:g,10:23,11:w},e(k,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:b,23:l}),e(k,[2,19]),e(k,[2,21],{15:30,24:G}),e(k,[2,22]),e(k,[2,23]),e(N,[2,25]),e(N,[2,26]),e(N,[2,28],{20:[1,32]}),{21:[1,33]},{6:I,7:g,10:34,11:w},{1:[2,7],6:p,12:21,13:s,14:14,16:d,17:_,18:17,19:18,20:b,23:l},e(V,[2,14],{7:f,11:A}),e(L,[2,8]),e(L,[2,9]),e(L,[2,10]),e(k,[2,16],{15:37,24:G}),e(k,[2,17]),e(k,[2,18]),e(k,[2,20],{24:M}),e(N,[2,31]),{21:[1,39]},{22:[1,40]},e(V,[2,13],{7:f,11:A}),e(L,[2,11]),e(L,[2,12]),e(k,[2,15],{24:M}),e(N,[2,30]),{22:[1,41]},e(N,[2,27]),e(N,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(i,n){if(n.recoverable)this.trace(i);else{var r=new Error(i);throw r.hash=n,r}},"parseError"),parse:o(function(i){var n=this,r=[0],a=[],u=[null],t=[],U=this.table,c="",W=0,se=0,ue=2,re=1,ge=t.slice.call(arguments,1),m=Object.create(this.lexer),R={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(R.yy[J]=this.yy[J]);m.setInput(i,R.yy),R.yy.lexer=m,R.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var q=m.yylloc;t.push(q);var de=m.options&&m.options.ranges;typeof R.yy.parseError=="function"?this.parseError=R.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){r.length=r.length-2*S,u.length=u.length-S,t.length=t.length-S}o(pe,"popStack");function ae(){var S;return S=a.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(a=S,S=a.pop()),S=n.symbols_[S]||S),S}o(ae,"lex");for(var E,P,x,Q,j={},z,C,oe,X;;){if(P=r[r.length-1],this.defaultActions[P]?x=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=ae()),x=U[P]&&U[P][E]),typeof x>"u"||!x.length||!x[0]){var Z="";X=[];for(z in U[P])this.terminals_[z]&&z>ue&&X.push("'"+this.terminals_[z]+"'");m.showPosition?Z="Parse error on line "+(W+1)+`:
2
2
  `+m.showPosition()+`
3
3
  Expecting `+X.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Z="Parse error on line "+(W+1)+": Unexpected "+(E==re?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Z,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:q,expected:X})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+E);switch(x[0]){case 1:r.push(E),u.push(m.yytext),t.push(m.yylloc),r.push(x[1]),E=null,se=m.yyleng,c=m.yytext,W=m.yylineno,q=m.yylloc;break;case 2:if(C=this.productions_[x[1]][1],j.$=u[u.length-C],j._$={first_line:t[t.length-(C||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(C||1)].first_column,last_column:t[t.length-1].last_column},de&&(j._$.range=[t[t.length-(C||1)].range[0],t[t.length-1].range[1]]),Q=this.performAction.apply(j,[c,se,W,R.yy,x[1],u,t].concat(ge)),typeof Q<"u")return Q;C&&(r=r.slice(0,-1*C*2),u=u.slice(0,-1*C),t=t.slice(0,-1*C)),r.push(this.productions_[x[1]][0]),u.push(j.$),t.push(j._$),oe=U[r[r.length-2]][r[r.length-1]],r.push(oe);break;case 3:return!0}}return!0},"parse")},Y=(function(){var O={EOF:1,parseError:o(function(n,r){if(this.yy.parser)this.yy.parser.parseError(n,r);else throw new Error(n)},"parseError"),setInput:o(function(i,n){return this.yy=n||this.yy||{},this._input=i,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 i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var n=i.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),i},"input"),unput:o(function(i){var n=i.length,r=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var a=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),r.length-1&&(this.yylineno-=r.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:r?(r.length===a.length?this.yylloc.first_column:0)+a[a.length-r.length].length-r[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: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(i){this.unput(this.match.slice(i))},"less"),pastInput:o(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var i=this.pastInput(),n=new Array(i.length+1).join("-");return i+this.upcomingInput()+`