limixbot 0.3.27 → 0.3.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ActivityPanel-CZp2xEki.js → ActivityPanel-Cv8SavDj.js} +1 -1
- package/dist/assets/{App-D_mkV9W-.js → App-ajUV-Eko.js} +126 -125
- package/dist/assets/AppEventEditor-BmuhU4di.js +1 -0
- package/dist/assets/{BotSettingsDialog-DaI2-9_R.js → BotSettingsDialog-Djt5Z8_c.js} +2 -2
- package/dist/assets/BrowserPanel-cwjDpf3J.js +3 -0
- package/dist/assets/{BrowserProfilesManager-A9Zp2yg3.js → BrowserProfilesManager-CzNf4P8c.js} +1 -1
- package/dist/assets/CloudAddDialog-CuAJ_n8A.js +1 -0
- package/dist/assets/{ComputerFilesPane-DXUwyPuB.js → ComputerFilesPane-CUwmhG4G.js} +1 -1
- package/dist/assets/ComputerPanel-thbNTglI.js +2 -0
- package/dist/assets/{DataPanel-D7ycypEv.js → DataPanel-LpZaOwFy.js} +1 -1
- package/dist/assets/{DesktopViewer-CRcjWYHe.js → DesktopViewer-CO6rKDOC.js} +1 -1
- package/dist/assets/{FilesView-C9q-oJuG.js → FilesView-BcPlXY2Z.js} +2 -2
- package/dist/assets/{GrokMoveDialog-CZv7Fds1.js → GrokMoveDialog-DPhfPAAd.js} +3 -3
- package/dist/assets/{InspectorPanel-fkCIC4EB.js → InspectorPanel-l3AppDb0.js} +1 -1
- package/dist/assets/KeyboardShortcutsModal-D78LOnXx.js +1 -0
- package/dist/assets/{LiveDesktop-od0aHHqq.js → LiveDesktop-DCwjKpuh.js} +1 -1
- package/dist/assets/{LocalVmWorkspace-DH05UaVi.js → LocalVmWorkspace-DRUmNe2b.js} +1 -1
- package/dist/assets/{MacLocalControl-CEALKyim.js → MacLocalControl-QdlFsN0H.js} +1 -1
- package/dist/assets/{MarkdownFilePreview-DhFsdkOv.js → MarkdownFilePreview-BQk1kEdI.js} +1 -1
- package/dist/assets/{MenuMotion-BOUToDZz.js → MenuMotion-QoOXKNvf.js} +1 -1
- package/dist/assets/NewBotDialog-DxwobeWs.js +1 -0
- package/dist/assets/PhoneAppDialog-ht-Y64Q_.js +1 -0
- package/dist/assets/{PlacesRail-dslg5RRJ.js → PlacesRail-B0r2Van_.js} +2 -2
- package/dist/assets/{PluginsPanel-CCQmQ2XT.js → PluginsPanel-CUxVDpGZ.js} +5 -5
- package/dist/assets/{ProIntroduction-D0A7u7j2.js → ProIntroduction-CE4vJUn2.js} +1 -1
- package/dist/assets/{RemoteAgentSettingsPanel-CMyqxw7K.js → RemoteAgentSettingsPanel-3he4axXK.js} +1 -1
- package/dist/assets/{RoomPanel-DNYnR3YM.js → RoomPanel-By9zNgSd.js} +1 -1
- package/dist/assets/{RoutinesPage-BOkrb8H8.js → RoutinesPage-qN6QGEQA.js} +2 -2
- package/dist/assets/SettingsModal-YpTplGBe.js +19 -0
- package/dist/assets/ShareTeamDialog-D2VGoot3.js +1 -0
- package/dist/assets/{SignedInSites-Deoa-m3S.js → SignedInSites-UilEy8xN.js} +1 -1
- package/dist/assets/TeamLibraryPanel-iXKP8bHg.js +1 -0
- package/dist/assets/TeamMapPage-DXmzzK2K.js +1 -0
- package/dist/assets/{TriggersPage-CiEkHUBu.js → TriggersPage-cCF8IoEn.js} +1 -1
- package/dist/assets/{VisibilitySection-Dd761EPJ.js → VisibilitySection-BYBx_roX.js} +2 -2
- package/dist/assets/WebhookTrigger-B3HjCzO1.js +1 -0
- package/dist/assets/{WorksOnGrid-Bu7gRfv5.js → WorksOnGrid-Cb8HQTdi.js} +1 -1
- package/dist/assets/{abnfDiagram-YUKMZFIV-UeQ15ljp.js → abnfDiagram-YUKMZFIV-D3RC58wh.js} +1 -1
- package/dist/assets/{activity-Rykx5lZJ.js → activity-Dbl6UsX-.js} +1 -1
- package/dist/assets/{architectureDiagram-47P4ROYG-Cb42ilBV.js → architectureDiagram-47P4ROYG-Z8fpyY75.js} +1 -1
- package/dist/assets/{blockDiagram-E7TT5TSB-BF1yg64q.js → blockDiagram-E7TT5TSB-DvE9XpO8.js} +1 -1
- package/dist/assets/{c4Diagram-CRA5TL53-VaNJpISp.js → c4Diagram-CRA5TL53-BpGfeK2S.js} +1 -1
- package/dist/assets/{calendar-days-kC634hX1.js → calendar-days-D_ADHCH2.js} +1 -1
- package/dist/assets/channel-D_u3gZnK.js +1 -0
- package/dist/assets/{chunk-2Q5K7J3B-NtXjlfnQ.js → chunk-2Q5K7J3B-D67vAX0H.js} +1 -1
- package/dist/assets/{chunk-5VM5RSS4-CYWCBb40.js → chunk-5VM5RSS4-CMFiNc6u.js} +1 -1
- package/dist/assets/{chunk-7TKQ45FW-CTx1wLnU.js → chunk-7TKQ45FW-CoFLZ60I.js} +1 -1
- package/dist/assets/{chunk-AW2ZBBNX-PDrwpbhk.js → chunk-AW2ZBBNX-gUfW5Adc.js} +1 -1
- package/dist/assets/{chunk-FVRAUYC3-CqIp8Ubp.js → chunk-FVRAUYC3-D1Q069A2.js} +2 -2
- package/dist/assets/{chunk-HTAEGDNF-yA6riuIr.js → chunk-HTAEGDNF-D3ZZF79x.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-DEE_S031.js → chunk-JWPE2WC7-qcqhs_9A.js} +1 -1
- package/dist/assets/{chunk-KQW6MTUR-QybxNtsY.js → chunk-KQW6MTUR-ChtMO8fh.js} +1 -1
- package/dist/assets/{chunk-XXDRQBXY-BjchQyqU.js → chunk-XXDRQBXY-Bx_iNGRg.js} +1 -1
- package/dist/assets/{classDiagram-v2-K4WV4PDN-DtOc8Abr.js → classDiagram-v2-K4WV4PDN-BFNAyWC6.js} +1 -1
- package/dist/assets/{coins-D0wNJCPg.js → coins-DKr1YBNV.js} +1 -1
- package/dist/assets/{core-8pT2FttX.js → core-CncVixaG.js} +1 -1
- package/dist/assets/{cose-bilkent-JH36ORCC-CWHsqn7M.js → cose-bilkent-JH36ORCC-Bg8ti_oz.js} +1 -1
- package/dist/assets/{cynefin-EF2NZ3EQ-BqS-D9jN.js → cynefin-EF2NZ3EQ-AzIaeBzO.js} +1 -1
- package/dist/assets/{cynefinDiagram-3GCD6N5R-Fc51YETb.js → cynefinDiagram-3GCD6N5R-DkvCNROf.js} +1 -1
- package/dist/assets/{dagre-W4DXFKR2-So1kz52t.js → dagre-W4DXFKR2-eHc7s4oU.js} +1 -1
- package/dist/assets/{de-B1J17cai.js → de-BZ9nuzrz.js} +1 -1
- package/dist/assets/{diagram-2UJZ2QOL-DpdA_Lk0.js → diagram-2UJZ2QOL-C7M1j1Z_.js} +1 -1
- package/dist/assets/{diagram-OVF4WLC6-BqSu7ih2.js → diagram-OVF4WLC6-CsI6LK_l.js} +1 -1
- package/dist/assets/{diagram-PFPMY2P6-BoM6YcIG.js → diagram-PFPMY2P6-Cy-sdnqW.js} +1 -1
- package/dist/assets/{diagram-UMYRVEAY-B7wKoLi9.js → diagram-UMYRVEAY-BUJZwO0b.js} +1 -1
- package/dist/assets/{diagram-YEKJPTXX-BEXKw540.js → diagram-YEKJPTXX-W-jVXeaq.js} +1 -1
- package/dist/assets/{diagram-ZIFT7M5P-BAD7sJRi.js → diagram-ZIFT7M5P-lriD7N0L.js} +1 -1
- package/dist/assets/{ebnfDiagram-VR2GEFS7-DILoqvy-.js → ebnfDiagram-VR2GEFS7-BsUEFVYI.js} +1 -1
- package/dist/assets/{elk-IJKZMXRS-BHW-Cxin.js → elk-IJKZMXRS-DaJpjkbS.js} +1 -1
- package/dist/assets/{erDiagram-O2IAPWRE-Blp0Wwq0.js → erDiagram-O2IAPWRE-BcNSWX_I.js} +1 -1
- package/dist/assets/es-BxLq0ePd.js +6 -0
- package/dist/assets/{file-up-CEuHjVBK.js → file-up-W9Ukts61.js} +1 -1
- package/dist/assets/{flowDiagram-OXPTDLAJ-6SkVmYje.js → flowDiagram-OXPTDLAJ-C0yLQ4G-.js} +1 -1
- package/dist/assets/{fr-Dn65EJNi.js → fr-BoXnQ5F8.js} +1 -1
- package/dist/assets/{ganttDiagram-R7TSEDQI-DFDwj8QX.js → ganttDiagram-R7TSEDQI-C8zJsAus.js} +1 -1
- package/dist/assets/{gitGraphDiagram-XJZIOB7I-mtJG-sis.js → gitGraphDiagram-XJZIOB7I-CvM9Ff5h.js} +1 -1
- package/dist/assets/{hi-CHU0sl7u.js → hi-CcIxinfW.js} +1 -1
- package/dist/assets/{import-name-C4W1Pfjg.js → import-name-IKTfLDbm.js} +1 -1
- package/dist/assets/{index-C-oxoDHn.js → index-C5PxeCx7.js} +2 -2
- package/dist/assets/{index-IrHnIHKE.js → index-DXcH006d.js} +1 -1
- package/dist/assets/{infoDiagram-5W2HQ5XZ-CmyXB17U.js → infoDiagram-5W2HQ5XZ-EFSHnQLZ.js} +1 -1
- package/dist/assets/{ishikawaDiagram-K3B6WC7H-BKFtIESa.js → ishikawaDiagram-K3B6WC7H-Do-25hEq.js} +1 -1
- package/dist/assets/it-I6t2VEkh.js +13 -0
- package/dist/assets/ja-XTlk5V47.js +13 -0
- package/dist/assets/{journeyDiagram-COXZFDF6-DuXMREdz.js → journeyDiagram-COXZFDF6-B2ghVJCI.js} +1 -1
- package/dist/assets/{kanban-definition-P3RFRI5V-B9mWvKdh.js → kanban-definition-P3RFRI5V-TkPbxRAY.js} +1 -1
- package/dist/assets/ko-BplWTKGd.js +13 -0
- package/dist/assets/{mcp-servers-sCMeVHO_.js → mcp-servers-CLBiWzWC.js} +1 -1
- package/dist/assets/{mermaid.core-3c-Lql2y.js → mermaid.core-DO0Pzmu4.js} +4 -4
- package/dist/assets/{mindmap-definition-LZFPQGKD-BmLt9bkD.js → mindmap-definition-LZFPQGKD-nID_euLE.js} +1 -1
- package/dist/assets/{minimize-BfKI3Nbu.js → minimize-BYioV8YM.js} +1 -1
- package/dist/assets/{monitor-C-EBTsrK.js → monitor-DGPG5gJh.js} +1 -1
- package/dist/assets/{new-bot-BEp90nDO.js → new-bot-CzseIDJe.js} +1 -1
- package/dist/assets/{org-library-CtpOGMPw.js → org-library-D736oTBO.js} +1 -1
- package/dist/assets/{package-format-JjOaH2hV.js → package-format-DVPcCWYU.js} +1 -1
- package/dist/assets/{pegDiagram-BGZESJAR-5w1MTtLg.js → pegDiagram-BGZESJAR-BBY2tvO7.js} +1 -1
- package/dist/assets/{pieDiagram-CAPJLFHJ-C4etNvsK.js → pieDiagram-CAPJLFHJ-DX04Xe_e.js} +1 -1
- package/dist/assets/pl-Bv2R8H4r.js +13 -0
- package/dist/assets/{pt-br-BtcqPDCE.js → pt-br-CM02ONwa.js} +1 -1
- package/dist/assets/{quadrantDiagram-GDMTTRAM-k4cDUeIN.js → quadrantDiagram-GDMTTRAM-DaV-XRR2.js} +1 -1
- package/dist/assets/{rail-C6qkoJbO.js → rail-B6Von-6v.js} +1 -1
- package/dist/assets/{railroadDiagram-SM67HX2B-B9d0qasL.js → railroadDiagram-SM67HX2B-BszaHa5J.js} +1 -1
- package/dist/assets/{remote-desktop-panel-D_ANOxbk.js → remote-desktop-panel-C_BqZvn5.js} +1 -1
- package/dist/assets/{requirementDiagram-X7JNWC4A-BlYV4z86.js → requirementDiagram-X7JNWC4A-mBECwzIc.js} +1 -1
- package/dist/assets/ru-CJcyvxC6.js +13 -0
- package/dist/assets/{sankeyDiagram-UM26HJRW-DaIVWJEd.js → sankeyDiagram-UM26HJRW-BVYWK2kU.js} +1 -1
- package/dist/assets/{sequenceDiagram-ZO4K6R2Y-CAnXpud0.js → sequenceDiagram-ZO4K6R2Y-Cm1NiUC3.js} +1 -1
- package/dist/assets/{sizeCapture-INFHLROL-BIeqIcHi.js → sizeCapture-INFHLROL-By1WASi4.js} +1 -1
- package/dist/assets/{stateDiagram-v2-TBUQTH76-7ql5dn9y.js → stateDiagram-v2-TBUQTH76-BC010wH6.js} +1 -1
- package/dist/assets/{styles-BRMaHK08.js → styles-BynTeCUc.js} +1 -1
- package/dist/assets/{styles-Di_mG4l3.css → styles-D4XTB2mJ.css} +1 -1
- package/dist/assets/{swimlanes-N4OXWK64-CItt-UlU.js → swimlanes-N4OXWK64-kzfE1u3G.js} +1 -1
- package/dist/assets/swimlanesDiagram-K3J5GTZL-CsEp3kJM.js +8 -0
- package/dist/assets/{team-share-2OjfOHsk.js → team-share-Cz-g0ol5.js} +1 -1
- package/dist/assets/{timeline-definition-YOQAKGHF-8Xn9QBNo.js → timeline-definition-YOQAKGHF-DaWipjgK.js} +1 -1
- package/dist/assets/{tr-3Jw0E4fc.js → tr-CTl25e95.js} +1 -1
- package/dist/assets/{uk-B_Q6nXm0.js → uk-B_psMXqm.js} +1 -1
- package/dist/assets/{usecaseDiagram-VIAY4XPW-B6LxotkO.js → usecaseDiagram-VIAY4XPW-DAGDIl84.js} +1 -1
- package/dist/assets/{vennDiagram-BLWOH2XV-Ciex0LDC.js → vennDiagram-BLWOH2XV-DQpd7Brj.js} +1 -1
- package/dist/assets/{wardleyDiagram-YMQ3BMBF-B_TbpQlN.js → wardleyDiagram-YMQ3BMBF-CDz0yqs3.js} +1 -1
- package/dist/assets/{xychartDiagram-TAQBALBS-Dz_iIYt1.js → xychartDiagram-TAQBALBS-BjjtqaU2.js} +1 -1
- package/dist/assets/zh-BPHbGe7C.js +13 -0
- package/dist/assets/{zh-tw-CWDGum-b.js → zh-tw-BMYbS8NC.js} +1 -1
- package/dist/index.html +3 -3
- package/dist/rail.html +5 -5
- package/dist-server/container-mcp.js +1 -1
- package/dist-server/index.js +1158 -1119
- package/dist-server/openmausbot.js +3 -3
- package/dist-server/package.json +1 -1
- package/dist-server/pair-cli.js +3 -3
- package/dist-server/server/container-computer.js +32 -1
- package/dist-server/server/drivers/chatgpt-plan-auth.js +1 -1
- package/dist-server/server/limix-bot-library.js +9 -6
- package/dist-server/server/limix-skill-requirements.js +327 -0
- package/dist-server/server/limix-skill-store.js +27 -5
- package/dist-server/server/routes/bot-skills.js +6 -2
- package/dist-server/server/skill-learn.js +2 -1
- package/dist-server/vps-container-mcp.js +1 -1
- package/dist-server/workspace-backup.worker.js +2 -2
- package/package.json +1 -1
- package/skills/agent-reach/manifest.json +6 -1
- package/skills/create-verification-skill/manifest.json +8 -2
- package/skills/data-dashboards/manifest.json +10 -1
- package/skills/phone-connection/SKILL.md +7 -7
- package/skills/phone-connection/manifest.json +11 -2
- package/skills/phone-harness/SKILL.md +1 -1
- package/skills/phone-harness/agents/openai.yaml +1 -1
- package/skills/phone-harness/manifest.json +9 -2
- package/skills/rea-video/manifest.json +3 -1
- package/skills/social-posts/manifest.json +9 -1
- package/skills/ui-ux-pro-max/manifest.json +4 -1
- package/skills/windows-computer-automation/SKILL.md +35 -35
- package/skills/windows-computer-automation/manifest.json +5 -2
- package/skills/windows-computer-automation/references/guide.vi.md +52 -0
- package/skills/windows-computer-automation/references/herionix-integration.md +31 -31
- package/skills/windows-computer-automation/references/routing.md +18 -18
- package/skills/windows-computer-automation/references/scenarios.md +26 -26
- package/skills/windows-computer-automation/references/security.md +18 -18
- package/dist/assets/AppEventEditor-D64c8IWK.js +0 -1
- package/dist/assets/BrowserPanel-6q-wWkU_.js +0 -3
- package/dist/assets/CloudAddDialog-C13cTWxt.js +0 -1
- package/dist/assets/ComputerPanel-B9Q6kwf8.js +0 -2
- package/dist/assets/KeyboardShortcutsModal-CgCp58T_.js +0 -1
- package/dist/assets/NewBotDialog-Ceqj6MMN.js +0 -1
- package/dist/assets/PhoneAppDialog-CUxtDKPl.js +0 -1
- package/dist/assets/SettingsModal-ZyPdij7d.js +0 -19
- package/dist/assets/ShareTeamDialog-BlrpGRW0.js +0 -1
- package/dist/assets/TeamLibraryPanel-jl65sW8p.js +0 -1
- package/dist/assets/TeamMapPage-DkQj9J_8.js +0 -1
- package/dist/assets/WebhookTrigger-DSdjao1J.js +0 -1
- package/dist/assets/channel-Di74R1Kh.js +0 -1
- package/dist/assets/es-CS_V7OdX.js +0 -6
- package/dist/assets/it-CbDr93sA.js +0 -13
- package/dist/assets/ja-CJbW-M3a.js +0 -13
- package/dist/assets/ko-ZQvzPil_.js +0 -13
- package/dist/assets/pl-tZIDksyW.js +0 -13
- package/dist/assets/ru-Bfcy52OT.js +0 -13
- package/dist/assets/swimlanesDiagram-K3J5GTZL-DAZsljU6.js +0 -8
- package/dist/assets/zh-BwjuB8Xo.js +0 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as a}from"./App-
|
|
1
|
+
import{n as a}from"./App-ajUV-Eko.js";async function f(s,e){const t=await a("/api/teams/import?mode=add",{method:"POST",body:JSON.stringify(s)});for(const o of t.bots)e({type:"botAdded",bot:o});for(const o of t.groups??[])e({type:"groupPatched",group:o});for(const o of t.routines??[])e({type:"routinePatched",routine:o});const r=t.bots.find(o=>!o.hidden);return r&&e({type:"select",id:r.id}),{...t,...r?{first:r}:{}}}function c(s,e,t=100){const r=s.trim().slice(0,t);let o=r;for(let n=2;e.has(o.toLowerCase());n++){const i=` ${n}`;o=`${r.slice(0,t-i.length).trimEnd()}${i}`}return e.add(o.toLowerCase()),o}export{f as a,c as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/App-
|
|
2
|
-
import{t as o,al as Pe,r as i,j as n,S as pe,X as Ie,a as I,am as Ae,an as Te,g as $,L as _e,a0 as M,B as W,a9 as ne,ao as Le,ap as Oe,p as A,aq as Re,b as $e,s as De,l as Be,m as He,o as Fe,q as Ue,ar as ze,as as Me,x as We,v as Xe,y as Ge,P as Ve,_ as me}from"./styles-BRMaHK08.js";function Zt(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 r=t.email;if(r?.trim())return e?.email?.trim().toLowerCase()===r.trim().toLowerCase()?e:{email:r}}const fe="omb.team-sign-in";function Ke(e){try{e&&globalThis.localStorage?.setItem(fe,e)}catch{}}function qe(){try{return globalThis.localStorage?.getItem(fe)??null}catch{return null}}async function F(e=fetch){let t;try{t=await e("/api/auth/session",{credentials:"same-origin"})}catch(s){return{kind:"unreachable",error:s instanceof Error?s.message:String(s)}}const r=await t.json().catch(()=>({})),a=Object(r);return t.status===401||t.status===403?{kind:"unauthenticated",error:typeof a.error=="string"?a.error:`${t.status}`}:t.ok?a.kind==="session"&&typeof a.id=="string"?{kind:"session",id:a.id,label:typeof a.label=="string"?a.label:"",...typeof a.email=="string"?{email:a.email}:{},scopes:Array.isArray(a.scopes)?a.scopes.filter(s=>typeof s=="string"):[],expiresAt:typeof a.expiresAt=="number"?a.expiresAt:0,...typeof a.reactor=="string"?{reactor:a.reactor}:{},...typeof a.teamSignIn=="string"?{teamSignIn:a.teamSignIn}:{},...re(a.team)?{team:re(a.team),openedThreads:Array.isArray(a.openedThreads)?a.openedThreads.filter(s=>typeof s=="string"):[]}:{},...a.cloudGuest===!0?{cloudGuest:!0,openedThreads:Array.isArray(a.openedThreads)?a.openedThreads.filter(s=>typeof s=="string"):[]}:{}}:a.trust==="service"?{kind:"loopback",trust:"service"}:{kind:"loopback"}:{kind:"unreachable",error:`${t.status} ${t.statusText}`}}function re(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 Ye(e){return e?.kind==="session"||e?.kind==="loopback"&&e.trust!=="service"}function he(e){return e?e.kind==="loopback"?e.trust!=="service":e.kind==="session"&&e.scopes.includes("admin"):!1}function Je(){const e=/[#&]code=([^&]+)/.exec(location.hash);return e?(history.replaceState(null,"",location.pathname+location.search),decodeURIComponent(e[1])):null}function Ze(){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 Qe(){const e=new URLSearchParams(location.search),t=e.get("email")?.trim().toLowerCase()??"";if(!t)return null;e.delete("email");const r=e.toString();return history.replaceState(null,"",location.pathname+(r?`?${r}`:"")+location.hash),/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(t)?t:null}function xe(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",r=/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 r?`${t} on ${r}`:t}function H(){return typeof crypto?.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,14)}`}function be(e,t){const r=Reflect.get(Object(e),"error");return Pe(e,typeof r=="string"?r:`${t.status} ${t.statusText}`)}async function V(e,t=fetch){let r;try{r=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??H(),...e.browser?{browser:!0}:{}})})}catch(s){return{ok:!1,error:o("pair.unreachable",{error:s instanceof Error?s.message:String(s)})}}const a=await r.json().catch(()=>({}));return r.ok?{ok:!0}:{ok:!1,error:be(a,r)}}async function et(e,t=fetch){try{const r=await t("/api/auth/pair",{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify({code:e,browser:!0,preview:!0})}),a=Object(await r.json().catch(()=>({}))),s=Reflect.get(a,"owner"),c=Reflect.get(a,"team");return r.ok&&typeof s=="string"&&s?{owner:s,...typeof c=="string"&&c.trim()?{team:c.trim()}:{}}:null}catch{return null}}function tt(e,t,r=fetch){return V({code:e,label:xe(),attemptId:t,browser:!0},r)}function Qt(e){const t=Object(e);return t.cloudHome===!0&&typeof t.owner=="string"&&t.owner?t.owner:null}async function ge(e,t,r){let a;try{a=await r(e,{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify(t)})}catch(c){return{ok:!1,error:o("pair.unreachable",{error:c instanceof Error?c.message:String(c)})}}const s=await a.json().catch(()=>({}));return a.ok?{ok:!0}:{ok:!1,error:be(s,a)}}function nt(e,t=fetch){return ge("/api/auth/email/start",{email:e},t)}function rt(e,t=fetch){return ge("/api/auth/email/verify",{email:e.email,code:e.code,label:e.label},t)}function ae(e){return!e||/through a proxy|loopback host required|cross-origin request|^40[13]$/i.test(e)?null:e}function at(){window.ogb?.softwareRendering===!0&&(document.documentElement.dataset.softwareRendering="")}function ot({credential:e,owner:t,team:r}){const[a]=i.useState(()=>H()),[s,c]=i.useState(!1),[u,l]=i.useState(null);async function y(){c(!0),l(null);const f=await tt(e,a);if(f.ok){location.replace("/");return}c(!1),l(f.error)}return n.jsx("main",{className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",children:n.jsxs("div",{className:"w-full max-w-[420px]",children:[n.jsx("h1",{className:"text-[20px] font-semibold",children:r?o("pair.browser.teamTitle",{team:r,owner:t}):o("pair.browser.title",{owner:t})}),n.jsx("p",{className:"mt-1.5 text-[14px] text-ink-secondary",children:o("pair.browser.notYou")}),u?n.jsx("p",{role:"alert",className:"mt-3 text-[13px] text-danger",children:u}):null,n.jsx("button",{type:"button",onClick:()=>{y()},disabled:s,className:"mt-5 w-full rounded-md bg-accent px-4 py-2 text-[14px] font-medium text-accent-ink disabled:opacity-50",children:o(s?"pair.signingIn":"pair.continue")})]})})}const Y="bg-composer ring-1 ring-inset ring-ink/[0.07]",st="bg-composer ring-[0.5px] ring-ink/10",en=`${st} shadow-(--shadow-float)`,ye="transition-colors duration-[120ms] hover:bg-[color-mix(in_srgb,var(--color-composer),var(--color-ink)_7%)]",it=`${ye} aria-expanded:bg-[color-mix(in_srgb,var(--color-composer),var(--color-ink)_7%)]`,tn="bg-[color-mix(in_srgb,var(--color-composer),var(--color-ink)_7%)]",nn="focus-visible:outline-2 focus-visible:-outline-offset-2! focus-visible:outline-focus",ke="flex size-9 shrink-0 items-center justify-center rounded-full text-ink/90",J="focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",lt=`${ke} ${Y} ${it} ${J}`,rn=`${ke} ${Y} ${ye} ${J}`,ct=`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 ${J}`,an="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",ut="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 on({open:e,onToggle:t,corner:r=!1,ref:a}){return n.jsx("button",{ref:a,type:"button","data-sidebar-search-toggle":!0,onClick:t,"aria-label":o("sidebar.searchAria"),"aria-expanded":e,title:o("sidebar.searchAria"),className:r?ct:lt,children:n.jsx(pe,{size:r?17:18,strokeWidth:1.5,"aria-hidden":"true"})})}function sn({query:e,onQuery:t,onClose:r}){return n.jsx("div",{"data-sidebar-search-pill":!0,className:"px-3 pb-2 pt-0.5",children:n.jsxs("div",{className:I("flex h-[34px] items-center gap-2 rounded-full pl-3 pr-1.5 text-ink-secondary focus-within:ring-focus",Y),children:[n.jsx(pe,{size:15,"aria-hidden":"true",className:"shrink-0"}),n.jsx("input",{autoFocus:!0,value:e,onChange:a=>t(a.target.value),onKeyDown:a=>{a.key==="Escape"&&(a.preventDefault(),r())},placeholder:o("sidebar.searchAria"),"aria-label":o("sidebar.searchAria"),className:"min-w-0 flex-1 bg-transparent text-[13px] text-ink placeholder:text-ink-tertiary focus:outline-none"}),n.jsx("button",{type:"button",onClick:r,"aria-label":o("sidebar.searchClose"),title:o("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:n.jsx(Ie,{size:14,"aria-hidden":"true"})})]})})}function dt(e,{howTo:t=!1,onClosed:r}={}){return e.menu(t?{from:"howto"}:void 0).finally(()=>{t&&r?.()})}function ln(e){e({type:"cloudHowTo",open:!1})}function oe({text:e}){return n.jsxs("span",{className:"font-normal text-ink-secondary",children:[" · ",e]})}function pt(e){return e?.sleeps===!0?!0:e?.status==="paid"?!1:null}function mt(e){const t=e&&!window.ogb?.remoteClient?.active?window.ogb?.cloudPlan:void 0,r=e||window.ogb?.remoteClient?.active?void 0:window.ogb?.cloudAccount,[a,s]=i.useState(null),[c,u]=i.useState(!1);return i.useEffect(()=>{if(!t)return;let l=!0;return t.state().then(y=>{l&&s(pt(y))}).catch(()=>{}),()=>{l=!1}},[t]),i.useEffect(()=>r?.onState(l=>u(l.waking===!0)),[r]),{sleeps:t?a:null,waking:c}}function ft({cloudHome:e=!1,howTo:t=!1,onMenuClosed:r}){const a=window.ogb?.workspaces,[s,c]=i.useState(null),[u,l]=i.useState(!1),[y,f]=i.useState("");i.useEffect(()=>{let p=!0;const g=()=>{a?.state().then(j=>{p&&c(j)}).catch(()=>{})};g();const S=a?.onChanged?.(g);return()=>{p=!1,S?.()}},[a]);const k=mt(e||s?.home===!0),d=k.sleeps===null?"":o(k.sleeps?"cloudSetup.sleepsWhenIdle":"cloudSetup.alwaysOn"),x=k.waking?o("cloudHome.waking"):"";return{bridge:a,current:s,cloudHome:e,open:u,error:y,onLine:d,waking:x,openMenu:()=>{!a||u||(f(""),l(!0),dt(a,{howTo:t,onClosed:r}).catch(()=>f(o("sidebar.switchServerError"))).finally(()=>l(!1)))},switchable:!!a&&s?.home!==!0}}function ht(e){const t=Ae(),r=n.jsx(xt,{...e});return Te(t)?n.jsx("div",{"data-switcher-beside-rail":!0,className:t.beside?"hidden":"contents md:hidden",children:r}):r}function xt({compact:e=!1,inline:t=!1,pill:r=!1,rail:a=!1,cloudHome:s=!1,owner:c=null,howTo:u=!1,place:l,onMenuClosed:y}){const f=l||o("cloudSetup.myCloud"),{bridge:k,current:d,open:x,error:b,onLine:p,waking:g,openMenu:S}=ft({cloudHome:s,howTo:u,onMenuClosed:y}),j=h=>p?`${h} · ${p}`:h;if(!k||d?.home===!0){if(!s&&!d?.home)return null;const h=c?o("sidebar.cloudOwner",{email:c}):"",v=`${j(f)}${h?` · ${h}`:""}`;return a?n.jsx("div",{"data-cloud-home-indicator":!0,"data-workspace-switcher":"rail",role:"img","aria-label":v,title:v,className:"flex size-9 items-center justify-center text-ink-secondary",children:n.jsx($,{size:18,"aria-hidden":"true"})}):t?n.jsxs("div",{"data-cloud-home-indicator":!0,"data-workspace-switcher":"inline",title:v,className:r?"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:[n.jsx($,{size:r?15:14,"aria-hidden":"true",className:r?"hidden shrink-0 text-ink-secondary @max-[124px]/sidebar-top:block":"shrink-0 text-ink-secondary"}),n.jsx("span",{className:r?"min-w-0 truncate @max-[124px]/sidebar-top:hidden":"min-w-0 truncate",children:f}),(p||h)&&n.jsxs("span",{className:"sr-only",children:[p?` · ${p}`:"",h?` · ${h}`:""]})]}):n.jsx("div",{"data-cloud-home-indicator":!0,className:I("py-1.5",e?"px-2":"px-3"),children:n.jsxs("div",{title:v,className:I("flex items-center gap-2 py-2 text-[13px] font-medium text-ink",e?"justify-center px-1":"px-2"),children:[n.jsx($,{size:16,"aria-hidden":"true",className:"shrink-0 text-ink-secondary"}),e?n.jsx("span",{className:"sr-only",children:v}):n.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[f,p&&n.jsx(oe,{text:p}),h&&n.jsx("span",{className:"block truncate text-[12px] font-normal text-ink-secondary",children:h})]})]})})}const C=d?.profileName??(d?.local&&!d.localPath?o("place.local"):d?.name)??(s?f:o("sidebar.servers")),w=d?.local===!1||s&&!d?$:_e,T=s?j(C):C,E=d?.origin?`${T} · ${d.origin}`:T,P=o("sidebar.switchServer",{name:T});return a?n.jsxs("div",{"data-workspace-switcher":"rail",className:"relative",children:[n.jsx("button",{type:"button","aria-label":P,"aria-haspopup":"menu","aria-expanded":x,"data-cloud-home-indicator":s||void 0,"data-tour":"server-switcher",title:E,onClick:S,className:I(ut,"aria-expanded:bg-raised"),style:{WebkitAppRegion:"no-drag"},children:M(d?.color)?n.jsx(W,{color:d?.color,size:18}):n.jsx(w,{size:18,"aria-hidden":"true"})}),b&&n.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:b}),g&&!b&&n.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:g})]}):t?n.jsxs("div",{"data-workspace-switcher":"inline",className:"flex min-w-0",children:[n.jsxs("button",{type:"button","aria-label":P,"aria-haspopup":"menu","aria-expanded":x,"data-cloud-home-indicator":s||void 0,"data-tour":"server-switcher",title:E,onClick:S,className:r?"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:[M(d?.color)?n.jsx(W,{color:d?.color,size:16}):n.jsx(w,{size:r?15:14,"aria-hidden":"true","data-switcher-icon":!0,className:r?"hidden shrink-0 text-ink-secondary @max-[124px]/sidebar-top:block":"shrink-0 text-ink-secondary"}),n.jsx("span",{className:r?"min-w-0 truncate @max-[124px]/sidebar-top:hidden":"min-w-0 truncate @max-[96px]/sidebar-top:hidden",children:C}),n.jsx(ne,{size:r?12:11,"aria-hidden":"true",className:r?"shrink-0 text-ink-tertiary":"shrink-0 text-ink-secondary"})]}),b&&n.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:b}),g&&!b&&n.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:g})]}):n.jsxs("div",{className:I("py-1.5",e?"px-2":"px-3"),children:[n.jsxs("button",{type:"button","aria-label":P,"aria-haspopup":"menu","aria-expanded":x,"data-cloud-home-indicator":s||void 0,"data-tour":"server-switcher",title:E,onClick:S,className:I("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:[M(d?.color)?n.jsx(W,{color:d?.color,size:20}):n.jsx(w,{size:16,className:"shrink-0 text-ink-secondary"}),!e&&n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[C,s&&p&&n.jsx(oe,{text:p})]}),n.jsx(ne,{size:13,className:"shrink-0 text-ink-secondary"})]})]}),b&&n.jsx("p",{role:"alert",className:"mt-1 text-[11px] text-danger",children:b}),g&&!b&&n.jsx("p",{role:"status","data-cloud-waking":!0,className:"mt-1 text-[11px] text-ink-secondary",children:g})]})}function bt(e){const t=e&&typeof e=="object"?e.membership:void 0,r=t&&typeof t=="object"?t:{};let a=null;if(typeof r.peopleUrl=="string")try{new URL(r.peopleUrl).protocol==="https:"&&(a=r.peopleUrl)}catch{a=null}return{authority:r.authority==="portal"?"portal":"local",pairingCodes:r.pairingCodes!==!1,peopleUrl:a}}const cn=()=>({type:"toggleAppSettings",open:!0,section:"companion",phonePairing:!0});function un(e){const t=typeof window>"u"?void 0:window.ogb;return gt({companion:!!t?.companion,remoteClient:t?.remoteClient?.active===!0,cloudHome:e})}function gt(e){return e.cloudHome?"cloud":e.companion&&!e.remoteClient?"computer":"server"}const yt={computer:"sidebar.menu.connectPhone.computer",cloud:"sidebar.menu.connectPhone.cloud",server:"sidebar.menu.connectPhone.server"};function dn(e,t){const r=t?.session?.kind==="session"?t.session.team?.name:void 0;return r?{target:e,subtitleKey:"sidebar.menu.connectPhone.team",team:r}:e!=="computer"&&!(t&&t.pairingCodes&&he(t.session))?null:{target:e,subtitleKey:yt[e]}}function pn(e){return Le(e).kind!=="paid"||Oe(e)?null:e?.status==="connected"&&e.machine?.status==="ready"?"ready":"not-ready"}function mn(e,t){if(!e)return[];const r={...e,id:"here"};return e.target!=="computer"||!t?[r]:t==="not-ready"?[{...r,noteKey:"sidebar.menu.connectPhone.cloudNotReady"}]:[{id:"cloud",target:"cloud",subtitleKey:"sidebar.menu.connectPhone.cloudAlwaysOn"},r]}let se=null;function fn(e=fetch){return se??=F(e).then(async t=>{if(!he(t))return{session:t,pairingCodes:!1};const r=await e("/api/config",{credentials:"same-origin"}).then(a=>a.ok?a.json():null).catch(()=>null);return{session:t,pairingCodes:bt(r).pairingCodes}}),se}const kt="data-phone-pairing-action";function hn(e,t=r=>window.requestAnimationFrame(r)){return e?(t(()=>{e.scrollIntoView?.({block:"start"}),(e.querySelector(`[${kt}]:not([disabled])`)??e).focus({preventScroll:!0})}),!0):!1}function xn(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 X(e){const t=new URLSearchParams(e);if(t.get("desktop-settings")==="phone")return"/?desktop-settings=phone";const r=t.get("next");return r&&/^\/(?!\/)/.test(r)&&!r.startsWith("/pair")&&!/[\\\s]/.test(r)?r:"/"}const wt="23456789ABCDEFGHJKLMNPQRSTUVWXYZ",vt=12,jt="omb_pair_",Nt=/^omb_pair_[A-Za-z0-9_-]{43}$/;function we(e){return e.toUpperCase().replace(/[^A-Z0-9]/g,"").replace(/0/g,"O").replace(/1/g,"I")}function St(e){return we(e).match(/.{1,4}/g)?.join("-")??e}const Et={emailCode:"serverError.pair.emailCode",oldCode:"serverError.pair.oldCode",scriptKey:"serverError.pair.scriptKey",notACode:"serverError.pair.notACode"};function Ct(e){let t;try{t=new URL(e)}catch{return null}const r=new URLSearchParams(t.hash.replace(/^#/,""));return t.searchParams.get("token")??t.searchParams.get("code")??r.get("code")}function Z(e){let t=e.trim();if(!t)return{kind:"empty"};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(t)){const s=Ct(t);if(!s)return{kind:"wrong",problem:"notACode"};t=s.trim()}if(t.startsWith("omb_sess_"))return{kind:"wrong",problem:"scriptKey"};if(t.startsWith(jt))return Nt.test(t)?{kind:"credential",credential:t}:{kind:"wrong",problem:"notACode"};const r=t.replace(/[\s-]/g,"");if(/^\d{8}$/.test(r))return{kind:"wrong",problem:"emailCode"};if(/^\d{6}$/.test(r))return{kind:"wrong",problem:"oldCode"};const a=we(t);return a.length!==vt||[...a].some(s=>!wt.includes(s))?{kind:"wrong",problem:"notACode"}:{kind:"code",code:a}}const L="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",ie="mt-5 w-full rounded-md bg-accent px-4 py-2 text-[14px] font-medium text-accent-ink disabled:opacity-50",O="mt-4 block text-[12px] font-medium text-ink-secondary";function Pt(e,t=typeof window<"u"&&!!window.ogb?.workspaces){return!!e&&t}function It({mode:e,sent:t,email:r,cloudHome:a}){return e==="email"?t?o("pair.intro.emailSent",{email:r}):o("pair.intro.email"):a?o("pair.intro.cloud",{app:A(),open:o("cloudHome.connect"),section:o("settings.section.cloudAccount")}):o("pair.intro.code")}function At(e){const t=Z(e);return t.kind==="wrong"&&t.problem!=="notACode"?o(Et[t.problem]):null}function Tt(e){const t=Z(e).kind;return t==="code"||t==="credential"}function _t(e,t){const r=Z(t),a=r.kind==="code"?`&code=${encodeURIComponent(St(r.code))}`:"";return`openmausbot://pair?address=${encodeURIComponent(e)}${a}`}function Lt(e){return e.protocol==="http:"&&!Re(e.hostname)}function le(e,t=qe()){if(!e?.capabilities.cloudTeam||typeof t!="string")return null;try{const r=new URL(t),a=r.protocol==="http:"&&["127.0.0.1","localhost","[::1]"].includes(r.hostname);return(r.protocol==="https:"||a)&&!r.username&&!r.password&&!r.hash?r.href:null}catch{return null}}function Ot(e,t){return e?.capabilities.cloudTeam?e.label:e?.capabilities.cloudHome?o("pair.myCloud"):o(t==="email"?"pair.signInTo":"pair.connectTo",{name:e?.label??o("pair.thisOpenMausBot",{app:A()})})}function Rt({team:e}){return n.jsx("main",{"data-team-left":!0,className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",children:n.jsx("p",{role:"status",className:"max-w-[420px] text-[16px]",children:o("homeLine.left",{name:e??o("pair.thisOpenMausBot",{app:A()})})})})}function D({initialCode:e,initialEmail:t=null,reason:r}){const[a,s]=i.useState(e??""),[c,u]=i.useState(xe()),[l,y]=i.useState(null),[f,k]=i.useState(null),[d,x]=i.useState(!1),[b,p]=i.useState(null),[g,S]=i.useState(()=>H()),[j,C]=i.useState(t&&!e?"email":"code"),[w,T]=i.useState(t??""),[E,P]=i.useState(""),[h,v]=i.useState(!1),[U,je]=i.useState(()=>Pt(e));i.useEffect(()=>{if(!U||!e)return;let m=!0;return V({code:e,label:c,attemptId:g}).then(N=>{if(m){if(N.ok){location.replace(X(location.search));return}je(!1),p(N.error)}}),()=>{m=!1}},[]),i.useEffect(()=>{fetch("/.well-known/openmausbot/environment").then(m=>m.ok?m.json():null).then(m=>{y(m)}).catch(()=>{y(null)}),F().then(k)},[]);const z=Ye(f),Ne=l?.capabilities.emailSignIn===!0,_=l?.capabilities.cloudHome===!0,Se=!_&&l?.capabilities.cloudTeam!==!0,ee=At(a),R=typeof location<"u"&&typeof location.protocol=="string"?location:null;async function Ee(m){m.preventDefault(),x(!0),p(null);const N=await V({code:a,label:c,attemptId:g});if(x(!1),N.ok){location.replace(X(location.search));return}p(N.error)}async function Ce(m){m.preventDefault(),x(!0),p(null);const N=h?await rt({email:w,code:E,label:c}):await nt(w);if(x(!1),!N.ok){p(N.error);return}if(h){location.replace(X(location.search));return}v(!0)}function te(m){C(m),p(null)}return n.jsxs("main",{className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",children:[n.jsx("div",{className:"absolute left-3 top-12 max-w-[280px]",children:n.jsx(ht,{})}),n.jsxs("div",{className:"w-full max-w-[420px]",children:[R&&Lt(R)?n.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:o("pair.notEncrypted")}):null,U?n.jsx("p",{role:"status",className:"text-[20px] font-semibold",children:_?o("pair.openingCloud"):o("pair.connectingTo",{name:l?.label??o("pair.thisOpenMausBot")})}):n.jsxs(n.Fragment,{children:[n.jsx("h1",{className:"text-[20px] font-semibold",children:Ot(l,j)}),n.jsxs("p",{className:"mt-1.5 text-[14px] leading-relaxed text-ink-secondary",children:[l&&!_?`${o("pair.version",{version:l.version,platform:l.platform})} `:"",It({mode:j,sent:h,email:w,cloudHome:_})]}),ae(r)&&!z?n.jsx("p",{className:"mt-3 text-[13px] text-ink-secondary",children:ae(r)}):null,b&&_&&e?n.jsx("p",{className:"mt-3 text-[13px] text-ink-secondary",children:o("pair.expired",{app:A(),open:o("cloudHome.connect"),section:o("settings.section.cloudAccount")})}):null,!z&&le(l)?n.jsxs("div",{"data-team-sign-in":!0,className:"mt-4 flex flex-col items-start gap-1.5",children:[n.jsx("a",{href:le(l),className:"rounded-md bg-accent px-4 py-2 text-[14px] font-medium text-accent-ink",children:o("pair.team.open",{team:l.label})}),n.jsx("p",{className:"text-[13px] text-ink-secondary",children:o("pair.team.openHint")})]}):null]}),U?null:z?n.jsxs("p",{className:"mt-4 text-[14px]",children:[o("pair.alreadyConnected")," ",n.jsx("a",{href:"/",className:"text-accent underline",children:o("pair.openApp")})]}):j==="email"?n.jsxs("form",{onSubmit:Ce,children:[n.jsx("label",{className:O,htmlFor:"signin-email",children:o("cloudBuy.signIn.email")}),n.jsx("input",{id:"signin-email",type:"email",value:w,onChange:m=>{T(m.target.value),v(!1),P("")},autoComplete:"email",inputMode:"email",spellCheck:!1,className:L}),h?n.jsxs(n.Fragment,{children:[n.jsx("label",{className:O,htmlFor:"signin-code",children:o("pair.emailCode")}),n.jsx("input",{id:"signin-code",value:E,onChange:m=>P(m.target.value),placeholder:"12345678",autoComplete:"one-time-code",inputMode:"numeric",spellCheck:!1,className:`${L} font-mono text-[15px] tracking-[0.12em]`}),n.jsx("label",{className:O,htmlFor:"signin-label",children:o("pair.deviceLabel")}),n.jsx("input",{id:"signin-label",value:c,onChange:m=>u(m.target.value),maxLength:80,className:L})]}):null,b?n.jsx("p",{className:"mt-3 text-[13px] text-danger",children:b}):null,n.jsx("button",{type:"submit",disabled:d||!w.includes("@")||h&&E.replace(/\D/g,"").length<8,className:ie,children:o(d?h?"pair.signingIn":"pair.sending":h?"pair.signIn":"cloudBuy.signIn.send")}),h?n.jsx("button",{type:"button",onClick:()=>v(!1),className:"mt-3 w-full text-[13px] text-ink-secondary underline",children:o("pair.resend")}):null,n.jsx("button",{type:"button",onClick:()=>te("code"),className:"mt-3 w-full text-[13px] text-ink-secondary underline",children:o("pair.useCode")})]}):n.jsxs("form",{onSubmit:Ee,children:[n.jsx("label",{className:O,htmlFor:"pair-code",children:o("pair.code")}),n.jsx("input",{id:"pair-code",value:a,onChange:m=>{s(m.target.value),S(H())},placeholder:"XXXX-XXXX-XXXX","aria-describedby":e&&a===e?"pair-code-from-link":void 0,autoComplete:"one-time-code",autoCapitalize:"characters",spellCheck:!1,className:`${L} font-mono text-[15px] tracking-[0.12em]`}),e&&a===e?n.jsx("p",{id:"pair-code-from-link",className:"mt-1 text-[12px] text-ink-secondary",children:o("pair.fromLink")}):null,n.jsx("label",{className:O,htmlFor:"pair-label",children:o("pair.deviceLabel")}),n.jsx("input",{id:"pair-label",value:c,onChange:m=>u(m.target.value),maxLength:80,className:L}),ee?n.jsx("p",{role:"alert",className:"mt-3 text-[13px] text-danger",children:ee}):b?n.jsx("p",{className:"mt-3 text-[13px] text-danger",children:b}):null,n.jsx("button",{type:"submit",disabled:d||!Tt(a),className:ie,children:o(d?"pair.connecting":"pair.connect")}),R?.origin?n.jsxs("p",{className:"mt-3 text-[13px] text-ink-secondary",children:[o("pair.onPhone")," ",n.jsx("a",{href:_t(R.origin,a),className:"text-accent underline",children:o("pair.openInApp",{app:A()})})]}):null,Se?n.jsxs("p",{className:"mt-3 text-[13px] text-ink-secondary",children:[o("pair.noCode")," ",n.jsx("code",{className:"select-all rounded bg-inset px-1.5 py-0.5 text-[12px] text-ink",children:"npx limixbot pair"})]}):null,Ne?n.jsxs("p",{className:"mt-5 border-t border-hairline/40 pt-4 text-[13px] text-ink-secondary",children:[o("pair.invitedByEmail")," ",n.jsx("button",{type:"button",onClick:()=>te("email"),className:"text-accent underline",children:o("pair.useEmail")})]}):null]})]})]})}const bn="cloud-welcome-done",$t="unauthorized: you are no longer in this team",ce=[["reserving","cloudHome.step.reserving"],["storage","cloudHome.step.storage"],["starting","cloudHome.step.starting"],["checking","cloudHome.step.checking"]];function Dt({step:e}){const t=ce.findIndex(([r])=>r===e);return n.jsx("ol",{"data-cloud-setup":e,className:"flex flex-col gap-1 text-[13px]",children:ce.map(([r,a],s)=>n.jsx("li",{"aria-current":s===t?"step":void 0,className:s===t?"font-medium text-ink":s<t?"text-ink-secondary line-through decoration-ink-secondary/40":"text-ink-secondary",children:o(a)},r))})}const Bt={stopped:"cloudHome.stopped","payment-problem":"cloudHome.paymentProblem",failed:"cloudHome.failed"},ue={host:"cloudHome.unreachableHost",no_answer:"cloudHome.unreachable"};function Ht(e,t=Date.now()){const r=new Date(e).getFullYear()!==new Date(t).getFullYear();return new Intl.DateTimeFormat($e(),{day:"numeric",month:"long",...r?{year:"numeric"}:{}}).format(new Date(e))}function Ft(e,t=Date.now()){const r=e?.name??null,a=(s,c)=>r?o(c,{name:r}):o(s);return e?.screen==="setup"?{title:a("homeScreen.setup","homeScreen.setupNamed"),body:o(e.slow?"cloudHome.slow":"homeScreen.setupBody"),reason:null,action:null,busy:!0}:e?.screen==="offline"?{title:a("homeScreen.offline","homeScreen.offlineNamed"),body:o("homeScreen.offlineBack"),reason:e.cause&&Object.hasOwn(ue,e.cause)?o(ue[e.cause]):e.reason??null,action:"retry",busy:!1}:e?.screen==="signin"?{title:a("homeScreen.signIn","homeScreen.signInNamed"),body:o(e.other?"homeScreen.signInOther":"homeScreen.signInEnded"),reason:null,action:"sign-in",busy:!1}:e?.screen==="plan"&&e.member&&e.machine!=="failed"?{title:a("homeScreen.plan","homeScreen.planNamed"),body:o("cloudHome.stoppedMember"),reason:null,action:null,busy:!1}:e?.screen==="plan"?{title:a("homeScreen.plan","homeScreen.planNamed"),body:o(Bt[e.machine]??"cloudHome.failed"),reason:null,action:e.machine==="failed"?null:"manage",busy:!1}:e?.screen==="ended"?{title:a("cloudHome.ended","cloudHome.endedNamed"),body:e.deleteAt?o("cloudHome.endedFiles",{date:Ht(e.deleteAt,t)}):null,reason:null,action:"buy",busy:!1}:e?.screen==="checkout"?{title:a("cloudHome.checkout","cloudHome.checkoutNamed"),body:null,reason:null,action:"continue",busy:!1}:e?.screen==="payment"?{title:a("cloudHome.payment","cloudHome.paymentNamed"),body:o("cloudHome.paymentBody"),reason:null,action:"card",busy:!1}:e?.screen==="waking"?{title:o("homeScreen.waking"),body:null,reason:null,action:null,busy:!0}:e?.screen==="moving"?{title:a("homeScreen.moving","homeScreen.movingNamed"),body:null,reason:null,action:null,busy:!0}:{title:a("homeScreen.opening","homeScreen.openingNamed"),body:null,reason:null,action:null,busy:!0}}const Ut={retry:"cloudHome.tryAgain",buy:"cloudHome.buyAgain",continue:"cloudHome.continue",card:"cloudHome.updateCard"};function zt({name:e,remove:t}){const[r,a]=i.useState(!1),[s,c]=i.useState(!1),[u,l]=i.useState(null),y=()=>{c(!0),l(null),t().then(f=>{c(!1),f!=="removed"&&f!=="gone"&&(a(!1),l(f==="refused"?"refused":"failed"))},()=>{c(!1),a(!1),l("failed")})};return n.jsxs("div",{"data-home-remove":!0,className:"flex flex-col items-start gap-2",children:[r?n.jsxs("div",{role:"alertdialog","aria-label":o("rail.remove"),className:"flex flex-col gap-2 rounded-xl border border-hairline/70 bg-card/70 px-4 py-3",children:[n.jsx("p",{className:"text-[13px] leading-relaxed text-ink",children:o("rail.removeAsk",{name:e})}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{type:"button","data-home-remove-confirm":!0,className:"ui-button ui-button-primary",disabled:s,onClick:y,children:o("rail.removeYes")}),n.jsx("button",{type:"button",className:"ui-button",disabled:s,onClick:()=>a(!1),children:o("rail.removeNo")})]})]}):n.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),a(!0)},children:o("rail.remove")}),u&&n.jsx("p",{role:"alert",className:"text-[13px] text-danger",children:o(u==="refused"?"rail.removeRefused":"rail.removeFailed")})]})}function Mt({bridge:e,manage:t}){const[r,a]=i.useState(null),[s,c]=i.useState(!1);i.useEffect(()=>{let x=!0;const b=e.onState(g=>a(g)),p=()=>{e.retry().then(g=>{x&&a(g)}).catch(()=>{})};return e.state().then(g=>{x&&a(g)}).catch(()=>{}).then(p),window.addEventListener("online",p),window.addEventListener("focus",p),()=>{x=!1,b(),window.removeEventListener("online",p),window.removeEventListener("focus",p)}},[e]);const u=Ft(r),l=x=>{c(!1),x().catch(()=>c(!0))},y=window.ogb?.cloudAdd?.reopen,f={retry:()=>e.retry().then(x=>a(x)),...t?{manage:t,buy:t,card:t,continue:async()=>{y&&await y().catch(()=>!1)||await t()}}:{}},k=u.action&&u.action!=="sign-in"&&u.action!=="manage"?u.action:null,d=(r?.screen==="ended"||r?.screen==="payment")&&r.removable===!0&&typeof e.remove=="function";return n.jsx("main",{"data-home-screen":r?.screen??"opening",className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",style:{WebkitAppRegion:"drag"},children:n.jsxs("div",{className:"flex w-full max-w-[420px] flex-col items-start gap-3",style:{WebkitAppRegion:"no-drag"},children:[n.jsxs("p",{role:"status",className:"flex items-center gap-2 text-[20px] font-semibold",children:[u.busy&&n.jsx("span",{"aria-hidden":"true",className:"size-3.5 shrink-0 animate-spin rounded-full border-2 border-hairline border-t-accent"}),u.title]}),u.body&&n.jsx("p",{className:"text-[14px] leading-relaxed text-ink-secondary",children:u.body}),r?.screen==="setup"&&n.jsx(Dt,{step:r.step??"reserving"}),u.reason&&n.jsx("p",{"data-home-reason":!0,className:"text-[13px] leading-relaxed text-ink-secondary",children:u.reason}),u.action==="sign-in"&&n.jsx("button",{type:"button",className:"ui-button ui-button-primary mt-2",onClick:()=>l(()=>e.signIn()),children:o("homeScreen.signInButton")}),u.action==="manage"&&t&&n.jsx("button",{type:"button",className:"ui-button mt-2",onClick:()=>l(t),children:o("cloudAccount.manageInBrowser")}),k&&f[k]&&n.jsx("button",{type:"button","data-home-action":k,className:k==="retry"?"ui-button mt-2":"ui-button ui-button-primary mt-2",onClick:()=>l(f[k]),children:o(Ut[k])}),d&&n.jsx(zt,{name:r.name??o("cloudSetup.myCloud"),remove:()=>e.remove()}),s&&n.jsx("p",{role:"alert",className:"text-[13px] text-danger",children:o("cloudAccount.actionFailed")})]})})}function Wt({bridge:e,fallback:t}){const[r,a]=i.useState(!1);return i.useEffect(()=>{e.repair().catch(()=>a(!0))},[e]),r?n.jsx(n.Fragment,{children:t}):n.jsx("main",{"data-home-screen":"opening",className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",children:n.jsx("p",{role:"status",className:"w-full max-w-[420px] text-[20px] font-semibold",children:o("homeScreen.opening")})})}const Q="omb.session-ended";let K=!1,G=null;const q=new Set;function gn(){K||G||(G=F().then(e=>{if(e.kind==="unauthenticated"){K=!0;try{sessionStorage.setItem(Q,"1")}catch{}for(const t of q)t()}}).finally(()=>{G=null}))}function de(){return K}function yn(){return i.useSyncExternalStore(e=>(q.add(e),()=>q.delete(e)),de,de)}function Xt(){try{return sessionStorage.getItem(Q)==="1"}catch{return!1}}function Gt(){try{sessionStorage.removeItem(Q)}catch{}}De();Be(He());Fe(Ue());at();ze(Me());const B=We(),Vt=new Set(["/home","/pair","/desktop-viewer"]),ve=()=>me(()=>import("./App-D_mkV9W-.js").then(e=>e.jS),__vite__mapDeps([0,1,2,3,4,5])).catch(e=>({default:()=>{throw e}})),Kt=Vt.has(location.pathname)?null:ve(),qt=()=>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 Yt(){const e=window.ogb?.home;if(location.pathname==="/home"&&e)return n.jsx(Mt,{bridge:e,manage:window.ogb?.cloudPlan?.manage});if(location.pathname==="/pair"){const a=Ze();if(a){const s=await et(a);return await B,s?n.jsx(ot,{credential:a,owner:s.owner,team:s.team}):n.jsx(D,{initialCode:null,reason:o("pair.browser.signInFailed")})}return n.jsx(D,{initialCode:Je(),initialEmail:Qe()})}const t=await F();if(t.kind==="unauthenticated"){if(await B,t.error===$t)return n.jsx(Rt,{team:await qt()});const a=n.jsx(D,{initialCode:null,reason:Xt()?o("pair.sessionEnded"):t.error});return e?n.jsx(Wt,{bridge:e,fallback:a}):a}if(Gt(),t.kind==="session"&&Ke(t.teamSignIn),t.kind==="loopback"&&t.trust==="service")return await B,n.jsx(D,{initialCode:null,reason:o("pair.serviceTrust")});if(location.pathname==="/desktop-viewer"){const{DesktopViewer:a}=await me(async()=>{const{DesktopViewer:s}=await import("./DesktopViewer-CRcjWYHe.js");return{DesktopViewer:s}},__vite__mapDeps([6,1,2,7,8,5,4,9]));return n.jsx(a,{})}const{default:r}=await(Kt??ve());return n.jsx(r,{})}document.title=A();Promise.all([Xe(),Yt(),B]).then(([,e])=>{Ge.createRoot(document.getElementById("root")).render(n.jsx(i.StrictMode,{children:n.jsx(Ve,{children:e})}))});export{yn as A,D as B,Dt as C,ht as D,en as E,xn as F,an as P,lt as S,bt as a,hn as b,un as c,it as d,Y as e,mn as f,Zt as g,dn as h,he as i,pn as j,ln as k,fn as l,rn as m,gn as n,dt as o,cn as p,Qt as q,F as r,nn as s,ct as t,ft as u,on as v,sn as w,st as x,tn as y,bn as z};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/App-ajUV-Eko.js","assets/styles-BynTeCUc.js","assets/styles-D4XTB2mJ.css","assets/PlacesRail-B0r2Van_.js","assets/monitor-DGPG5gJh.js","assets/MenuMotion-QoOXKNvf.js","assets/DesktopViewer-CO6rKDOC.js","assets/desktop-connection-Dfaq6k5a.js","assets/desktop-viewer-CF-OpSo0.js","assets/minimize-BYioV8YM.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as o,al as Pe,r as i,j as n,S as pe,X as Ie,a as I,am as Ae,an as Te,g as $,L as _e,a0 as M,B as W,a9 as ne,ao as Le,ap as Oe,p as A,aq as Re,b as $e,s as De,l as Be,m as He,o as Fe,q as Ue,ar as ze,as as Me,x as We,v as Xe,y as Ge,P as Ve,_ as me}from"./styles-BynTeCUc.js";function Zt(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 r=t.email;if(r?.trim())return e?.email?.trim().toLowerCase()===r.trim().toLowerCase()?e:{email:r}}const fe="omb.team-sign-in";function Ke(e){try{e&&globalThis.localStorage?.setItem(fe,e)}catch{}}function qe(){try{return globalThis.localStorage?.getItem(fe)??null}catch{return null}}async function F(e=fetch){let t;try{t=await e("/api/auth/session",{credentials:"same-origin"})}catch(s){return{kind:"unreachable",error:s instanceof Error?s.message:String(s)}}const r=await t.json().catch(()=>({})),a=Object(r);return t.status===401||t.status===403?{kind:"unauthenticated",error:typeof a.error=="string"?a.error:`${t.status}`}:t.ok?a.kind==="session"&&typeof a.id=="string"?{kind:"session",id:a.id,label:typeof a.label=="string"?a.label:"",...typeof a.email=="string"?{email:a.email}:{},scopes:Array.isArray(a.scopes)?a.scopes.filter(s=>typeof s=="string"):[],expiresAt:typeof a.expiresAt=="number"?a.expiresAt:0,...typeof a.reactor=="string"?{reactor:a.reactor}:{},...typeof a.teamSignIn=="string"?{teamSignIn:a.teamSignIn}:{},...re(a.team)?{team:re(a.team),openedThreads:Array.isArray(a.openedThreads)?a.openedThreads.filter(s=>typeof s=="string"):[]}:{},...a.cloudGuest===!0?{cloudGuest:!0,openedThreads:Array.isArray(a.openedThreads)?a.openedThreads.filter(s=>typeof s=="string"):[]}:{}}:a.trust==="service"?{kind:"loopback",trust:"service"}:{kind:"loopback"}:{kind:"unreachable",error:`${t.status} ${t.statusText}`}}function re(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 Ye(e){return e?.kind==="session"||e?.kind==="loopback"&&e.trust!=="service"}function he(e){return e?e.kind==="loopback"?e.trust!=="service":e.kind==="session"&&e.scopes.includes("admin"):!1}function Je(){const e=/[#&]code=([^&]+)/.exec(location.hash);return e?(history.replaceState(null,"",location.pathname+location.search),decodeURIComponent(e[1])):null}function Ze(){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 Qe(){const e=new URLSearchParams(location.search),t=e.get("email")?.trim().toLowerCase()??"";if(!t)return null;e.delete("email");const r=e.toString();return history.replaceState(null,"",location.pathname+(r?`?${r}`:"")+location.hash),/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(t)?t:null}function xe(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",r=/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 r?`${t} on ${r}`:t}function H(){return typeof crypto?.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,14)}`}function be(e,t){const r=Reflect.get(Object(e),"error");return Pe(e,typeof r=="string"?r:`${t.status} ${t.statusText}`)}async function V(e,t=fetch){let r;try{r=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??H(),...e.browser?{browser:!0}:{}})})}catch(s){return{ok:!1,error:o("pair.unreachable",{error:s instanceof Error?s.message:String(s)})}}const a=await r.json().catch(()=>({}));return r.ok?{ok:!0}:{ok:!1,error:be(a,r)}}async function et(e,t=fetch){try{const r=await t("/api/auth/pair",{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify({code:e,browser:!0,preview:!0})}),a=Object(await r.json().catch(()=>({}))),s=Reflect.get(a,"owner"),c=Reflect.get(a,"team");return r.ok&&typeof s=="string"&&s?{owner:s,...typeof c=="string"&&c.trim()?{team:c.trim()}:{}}:null}catch{return null}}function tt(e,t,r=fetch){return V({code:e,label:xe(),attemptId:t,browser:!0},r)}function Qt(e){const t=Object(e);return t.cloudHome===!0&&typeof t.owner=="string"&&t.owner?t.owner:null}async function ge(e,t,r){let a;try{a=await r(e,{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify(t)})}catch(c){return{ok:!1,error:o("pair.unreachable",{error:c instanceof Error?c.message:String(c)})}}const s=await a.json().catch(()=>({}));return a.ok?{ok:!0}:{ok:!1,error:be(s,a)}}function nt(e,t=fetch){return ge("/api/auth/email/start",{email:e},t)}function rt(e,t=fetch){return ge("/api/auth/email/verify",{email:e.email,code:e.code,label:e.label},t)}function ae(e){return!e||/through a proxy|loopback host required|cross-origin request|^40[13]$/i.test(e)?null:e}function at(){window.ogb?.softwareRendering===!0&&(document.documentElement.dataset.softwareRendering="")}function ot({credential:e,owner:t,team:r}){const[a]=i.useState(()=>H()),[s,c]=i.useState(!1),[u,l]=i.useState(null);async function y(){c(!0),l(null);const f=await tt(e,a);if(f.ok){location.replace("/");return}c(!1),l(f.error)}return n.jsx("main",{className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",children:n.jsxs("div",{className:"w-full max-w-[420px]",children:[n.jsx("h1",{className:"text-[20px] font-semibold",children:r?o("pair.browser.teamTitle",{team:r,owner:t}):o("pair.browser.title",{owner:t})}),n.jsx("p",{className:"mt-1.5 text-[14px] text-ink-secondary",children:o("pair.browser.notYou")}),u?n.jsx("p",{role:"alert",className:"mt-3 text-[13px] text-danger",children:u}):null,n.jsx("button",{type:"button",onClick:()=>{y()},disabled:s,className:"mt-5 w-full rounded-md bg-accent px-4 py-2 text-[14px] font-medium text-accent-ink disabled:opacity-50",children:o(s?"pair.signingIn":"pair.continue")})]})})}const Y="bg-composer ring-1 ring-inset ring-ink/[0.07]",st="bg-composer ring-[0.5px] ring-ink/10",en=`${st} shadow-(--shadow-float)`,ye="transition-colors duration-[120ms] hover:bg-[color-mix(in_srgb,var(--color-composer),var(--color-ink)_7%)]",it=`${ye} aria-expanded:bg-[color-mix(in_srgb,var(--color-composer),var(--color-ink)_7%)]`,tn="bg-[color-mix(in_srgb,var(--color-composer),var(--color-ink)_7%)]",nn="focus-visible:outline-2 focus-visible:-outline-offset-2! focus-visible:outline-focus",ke="flex size-9 shrink-0 items-center justify-center rounded-full text-ink/90",J="focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",lt=`${ke} ${Y} ${it} ${J}`,rn=`${ke} ${Y} ${ye} ${J}`,ct=`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 ${J}`,an="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",ut="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 on({open:e,onToggle:t,corner:r=!1,ref:a}){return n.jsx("button",{ref:a,type:"button","data-sidebar-search-toggle":!0,onClick:t,"aria-label":o("sidebar.searchAria"),"aria-expanded":e,title:o("sidebar.searchAria"),className:r?ct:lt,children:n.jsx(pe,{size:r?17:18,strokeWidth:1.5,"aria-hidden":"true"})})}function sn({query:e,onQuery:t,onClose:r}){return n.jsx("div",{"data-sidebar-search-pill":!0,className:"px-3 pb-2 pt-0.5",children:n.jsxs("div",{className:I("flex h-[34px] items-center gap-2 rounded-full pl-3 pr-1.5 text-ink-secondary focus-within:ring-focus",Y),children:[n.jsx(pe,{size:15,"aria-hidden":"true",className:"shrink-0"}),n.jsx("input",{autoFocus:!0,value:e,onChange:a=>t(a.target.value),onKeyDown:a=>{a.key==="Escape"&&(a.preventDefault(),r())},placeholder:o("sidebar.searchAria"),"aria-label":o("sidebar.searchAria"),className:"min-w-0 flex-1 bg-transparent text-[13px] text-ink placeholder:text-ink-tertiary focus:outline-none"}),n.jsx("button",{type:"button",onClick:r,"aria-label":o("sidebar.searchClose"),title:o("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:n.jsx(Ie,{size:14,"aria-hidden":"true"})})]})})}function dt(e,{howTo:t=!1,onClosed:r}={}){return e.menu(t?{from:"howto"}:void 0).finally(()=>{t&&r?.()})}function ln(e){e({type:"cloudHowTo",open:!1})}function oe({text:e}){return n.jsxs("span",{className:"font-normal text-ink-secondary",children:[" · ",e]})}function pt(e){return e?.sleeps===!0?!0:e?.status==="paid"?!1:null}function mt(e){const t=e&&!window.ogb?.remoteClient?.active?window.ogb?.cloudPlan:void 0,r=e||window.ogb?.remoteClient?.active?void 0:window.ogb?.cloudAccount,[a,s]=i.useState(null),[c,u]=i.useState(!1);return i.useEffect(()=>{if(!t)return;let l=!0;return t.state().then(y=>{l&&s(pt(y))}).catch(()=>{}),()=>{l=!1}},[t]),i.useEffect(()=>r?.onState(l=>u(l.waking===!0)),[r]),{sleeps:t?a:null,waking:c}}function ft({cloudHome:e=!1,howTo:t=!1,onMenuClosed:r}){const a=window.ogb?.workspaces,[s,c]=i.useState(null),[u,l]=i.useState(!1),[y,f]=i.useState("");i.useEffect(()=>{let p=!0;const g=()=>{a?.state().then(j=>{p&&c(j)}).catch(()=>{})};g();const S=a?.onChanged?.(g);return()=>{p=!1,S?.()}},[a]);const k=mt(e||s?.home===!0),d=k.sleeps===null?"":o(k.sleeps?"cloudSetup.sleepsWhenIdle":"cloudSetup.alwaysOn"),x=k.waking?o("cloudHome.waking"):"";return{bridge:a,current:s,cloudHome:e,open:u,error:y,onLine:d,waking:x,openMenu:()=>{!a||u||(f(""),l(!0),dt(a,{howTo:t,onClosed:r}).catch(()=>f(o("sidebar.switchServerError"))).finally(()=>l(!1)))},switchable:!!a&&s?.home!==!0}}function ht(e){const t=Ae(),r=n.jsx(xt,{...e});return Te(t)?n.jsx("div",{"data-switcher-beside-rail":!0,className:t.beside?"hidden":"contents md:hidden",children:r}):r}function xt({compact:e=!1,inline:t=!1,pill:r=!1,rail:a=!1,cloudHome:s=!1,owner:c=null,howTo:u=!1,place:l,onMenuClosed:y}){const f=l||o("cloudSetup.myCloud"),{bridge:k,current:d,open:x,error:b,onLine:p,waking:g,openMenu:S}=ft({cloudHome:s,howTo:u,onMenuClosed:y}),j=h=>p?`${h} · ${p}`:h;if(!k||d?.home===!0){if(!s&&!d?.home)return null;const h=c?o("sidebar.cloudOwner",{email:c}):"",v=`${j(f)}${h?` · ${h}`:""}`;return a?n.jsx("div",{"data-cloud-home-indicator":!0,"data-workspace-switcher":"rail",role:"img","aria-label":v,title:v,className:"flex size-9 items-center justify-center text-ink-secondary",children:n.jsx($,{size:18,"aria-hidden":"true"})}):t?n.jsxs("div",{"data-cloud-home-indicator":!0,"data-workspace-switcher":"inline",title:v,className:r?"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:[n.jsx($,{size:r?15:14,"aria-hidden":"true",className:r?"hidden shrink-0 text-ink-secondary @max-[124px]/sidebar-top:block":"shrink-0 text-ink-secondary"}),n.jsx("span",{className:r?"min-w-0 truncate @max-[124px]/sidebar-top:hidden":"min-w-0 truncate",children:f}),(p||h)&&n.jsxs("span",{className:"sr-only",children:[p?` · ${p}`:"",h?` · ${h}`:""]})]}):n.jsx("div",{"data-cloud-home-indicator":!0,className:I("py-1.5",e?"px-2":"px-3"),children:n.jsxs("div",{title:v,className:I("flex items-center gap-2 py-2 text-[13px] font-medium text-ink",e?"justify-center px-1":"px-2"),children:[n.jsx($,{size:16,"aria-hidden":"true",className:"shrink-0 text-ink-secondary"}),e?n.jsx("span",{className:"sr-only",children:v}):n.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[f,p&&n.jsx(oe,{text:p}),h&&n.jsx("span",{className:"block truncate text-[12px] font-normal text-ink-secondary",children:h})]})]})})}const C=d?.profileName??(d?.local&&!d.localPath?o("place.local"):d?.name)??(s?f:o("sidebar.servers")),w=d?.local===!1||s&&!d?$:_e,T=s?j(C):C,E=d?.origin?`${T} · ${d.origin}`:T,P=o("sidebar.switchServer",{name:T});return a?n.jsxs("div",{"data-workspace-switcher":"rail",className:"relative",children:[n.jsx("button",{type:"button","aria-label":P,"aria-haspopup":"menu","aria-expanded":x,"data-cloud-home-indicator":s||void 0,"data-tour":"server-switcher",title:E,onClick:S,className:I(ut,"aria-expanded:bg-raised"),style:{WebkitAppRegion:"no-drag"},children:M(d?.color)?n.jsx(W,{color:d?.color,size:18}):n.jsx(w,{size:18,"aria-hidden":"true"})}),b&&n.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:b}),g&&!b&&n.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:g})]}):t?n.jsxs("div",{"data-workspace-switcher":"inline",className:"flex min-w-0",children:[n.jsxs("button",{type:"button","aria-label":P,"aria-haspopup":"menu","aria-expanded":x,"data-cloud-home-indicator":s||void 0,"data-tour":"server-switcher",title:E,onClick:S,className:r?"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:[M(d?.color)?n.jsx(W,{color:d?.color,size:16}):n.jsx(w,{size:r?15:14,"aria-hidden":"true","data-switcher-icon":!0,className:r?"hidden shrink-0 text-ink-secondary @max-[124px]/sidebar-top:block":"shrink-0 text-ink-secondary"}),n.jsx("span",{className:r?"min-w-0 truncate @max-[124px]/sidebar-top:hidden":"min-w-0 truncate @max-[96px]/sidebar-top:hidden",children:C}),n.jsx(ne,{size:r?12:11,"aria-hidden":"true",className:r?"shrink-0 text-ink-tertiary":"shrink-0 text-ink-secondary"})]}),b&&n.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:b}),g&&!b&&n.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:g})]}):n.jsxs("div",{className:I("py-1.5",e?"px-2":"px-3"),children:[n.jsxs("button",{type:"button","aria-label":P,"aria-haspopup":"menu","aria-expanded":x,"data-cloud-home-indicator":s||void 0,"data-tour":"server-switcher",title:E,onClick:S,className:I("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:[M(d?.color)?n.jsx(W,{color:d?.color,size:20}):n.jsx(w,{size:16,className:"shrink-0 text-ink-secondary"}),!e&&n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[C,s&&p&&n.jsx(oe,{text:p})]}),n.jsx(ne,{size:13,className:"shrink-0 text-ink-secondary"})]})]}),b&&n.jsx("p",{role:"alert",className:"mt-1 text-[11px] text-danger",children:b}),g&&!b&&n.jsx("p",{role:"status","data-cloud-waking":!0,className:"mt-1 text-[11px] text-ink-secondary",children:g})]})}function bt(e){const t=e&&typeof e=="object"?e.membership:void 0,r=t&&typeof t=="object"?t:{};let a=null;if(typeof r.peopleUrl=="string")try{new URL(r.peopleUrl).protocol==="https:"&&(a=r.peopleUrl)}catch{a=null}return{authority:r.authority==="portal"?"portal":"local",pairingCodes:r.pairingCodes!==!1,peopleUrl:a}}const cn=()=>({type:"toggleAppSettings",open:!0,section:"companion",phonePairing:!0});function un(e){const t=typeof window>"u"?void 0:window.ogb;return gt({companion:!!t?.companion,remoteClient:t?.remoteClient?.active===!0,cloudHome:e})}function gt(e){return e.cloudHome?"cloud":e.companion&&!e.remoteClient?"computer":"server"}const yt={computer:"sidebar.menu.connectPhone.computer",cloud:"sidebar.menu.connectPhone.cloud",server:"sidebar.menu.connectPhone.server"};function dn(e,t){const r=t?.session?.kind==="session"?t.session.team?.name:void 0;return r?{target:e,subtitleKey:"sidebar.menu.connectPhone.team",team:r}:e!=="computer"&&!(t&&t.pairingCodes&&he(t.session))?null:{target:e,subtitleKey:yt[e]}}function pn(e){return Le(e).kind!=="paid"||Oe(e)?null:e?.status==="connected"&&e.machine?.status==="ready"?"ready":"not-ready"}function mn(e,t){if(!e)return[];const r={...e,id:"here"};return e.target!=="computer"||!t?[r]:t==="not-ready"?[{...r,noteKey:"sidebar.menu.connectPhone.cloudNotReady"}]:[{id:"cloud",target:"cloud",subtitleKey:"sidebar.menu.connectPhone.cloudAlwaysOn"},r]}let se=null;function fn(e=fetch){return se??=F(e).then(async t=>{if(!he(t))return{session:t,pairingCodes:!1};const r=await e("/api/config",{credentials:"same-origin"}).then(a=>a.ok?a.json():null).catch(()=>null);return{session:t,pairingCodes:bt(r).pairingCodes}}),se}const kt="data-phone-pairing-action";function hn(e,t=r=>window.requestAnimationFrame(r)){return e?(t(()=>{e.scrollIntoView?.({block:"start"}),(e.querySelector(`[${kt}]:not([disabled])`)??e).focus({preventScroll:!0})}),!0):!1}function xn(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 X(e){const t=new URLSearchParams(e);if(t.get("desktop-settings")==="phone")return"/?desktop-settings=phone";const r=t.get("next");return r&&/^\/(?!\/)/.test(r)&&!r.startsWith("/pair")&&!/[\\\s]/.test(r)?r:"/"}const wt="23456789ABCDEFGHJKLMNPQRSTUVWXYZ",vt=12,jt="omb_pair_",Nt=/^omb_pair_[A-Za-z0-9_-]{43}$/;function we(e){return e.toUpperCase().replace(/[^A-Z0-9]/g,"").replace(/0/g,"O").replace(/1/g,"I")}function St(e){return we(e).match(/.{1,4}/g)?.join("-")??e}const Et={emailCode:"serverError.pair.emailCode",oldCode:"serverError.pair.oldCode",scriptKey:"serverError.pair.scriptKey",notACode:"serverError.pair.notACode"};function Ct(e){let t;try{t=new URL(e)}catch{return null}const r=new URLSearchParams(t.hash.replace(/^#/,""));return t.searchParams.get("token")??t.searchParams.get("code")??r.get("code")}function Z(e){let t=e.trim();if(!t)return{kind:"empty"};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(t)){const s=Ct(t);if(!s)return{kind:"wrong",problem:"notACode"};t=s.trim()}if(t.startsWith("omb_sess_"))return{kind:"wrong",problem:"scriptKey"};if(t.startsWith(jt))return Nt.test(t)?{kind:"credential",credential:t}:{kind:"wrong",problem:"notACode"};const r=t.replace(/[\s-]/g,"");if(/^\d{8}$/.test(r))return{kind:"wrong",problem:"emailCode"};if(/^\d{6}$/.test(r))return{kind:"wrong",problem:"oldCode"};const a=we(t);return a.length!==vt||[...a].some(s=>!wt.includes(s))?{kind:"wrong",problem:"notACode"}:{kind:"code",code:a}}const L="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",ie="mt-5 w-full rounded-md bg-accent px-4 py-2 text-[14px] font-medium text-accent-ink disabled:opacity-50",O="mt-4 block text-[12px] font-medium text-ink-secondary";function Pt(e,t=typeof window<"u"&&!!window.ogb?.workspaces){return!!e&&t}function It({mode:e,sent:t,email:r,cloudHome:a}){return e==="email"?t?o("pair.intro.emailSent",{email:r}):o("pair.intro.email"):a?o("pair.intro.cloud",{app:A(),open:o("cloudHome.connect"),section:o("settings.section.cloudAccount")}):o("pair.intro.code")}function At(e){const t=Z(e);return t.kind==="wrong"&&t.problem!=="notACode"?o(Et[t.problem]):null}function Tt(e){const t=Z(e).kind;return t==="code"||t==="credential"}function _t(e,t){const r=Z(t),a=r.kind==="code"?`&code=${encodeURIComponent(St(r.code))}`:"";return`openmausbot://pair?address=${encodeURIComponent(e)}${a}`}function Lt(e){return e.protocol==="http:"&&!Re(e.hostname)}function le(e,t=qe()){if(!e?.capabilities.cloudTeam||typeof t!="string")return null;try{const r=new URL(t),a=r.protocol==="http:"&&["127.0.0.1","localhost","[::1]"].includes(r.hostname);return(r.protocol==="https:"||a)&&!r.username&&!r.password&&!r.hash?r.href:null}catch{return null}}function Ot(e,t){return e?.capabilities.cloudTeam?e.label:e?.capabilities.cloudHome?o("pair.myCloud"):o(t==="email"?"pair.signInTo":"pair.connectTo",{name:e?.label??o("pair.thisOpenMausBot",{app:A()})})}function Rt({team:e}){return n.jsx("main",{"data-team-left":!0,className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",children:n.jsx("p",{role:"status",className:"max-w-[420px] text-[16px]",children:o("homeLine.left",{name:e??o("pair.thisOpenMausBot",{app:A()})})})})}function D({initialCode:e,initialEmail:t=null,reason:r}){const[a,s]=i.useState(e??""),[c,u]=i.useState(xe()),[l,y]=i.useState(null),[f,k]=i.useState(null),[d,x]=i.useState(!1),[b,p]=i.useState(null),[g,S]=i.useState(()=>H()),[j,C]=i.useState(t&&!e?"email":"code"),[w,T]=i.useState(t??""),[E,P]=i.useState(""),[h,v]=i.useState(!1),[U,je]=i.useState(()=>Pt(e));i.useEffect(()=>{if(!U||!e)return;let m=!0;return V({code:e,label:c,attemptId:g}).then(N=>{if(m){if(N.ok){location.replace(X(location.search));return}je(!1),p(N.error)}}),()=>{m=!1}},[]),i.useEffect(()=>{fetch("/.well-known/openmausbot/environment").then(m=>m.ok?m.json():null).then(m=>{y(m)}).catch(()=>{y(null)}),F().then(k)},[]);const z=Ye(f),Ne=l?.capabilities.emailSignIn===!0,_=l?.capabilities.cloudHome===!0,Se=!_&&l?.capabilities.cloudTeam!==!0,ee=At(a),R=typeof location<"u"&&typeof location.protocol=="string"?location:null;async function Ee(m){m.preventDefault(),x(!0),p(null);const N=await V({code:a,label:c,attemptId:g});if(x(!1),N.ok){location.replace(X(location.search));return}p(N.error)}async function Ce(m){m.preventDefault(),x(!0),p(null);const N=h?await rt({email:w,code:E,label:c}):await nt(w);if(x(!1),!N.ok){p(N.error);return}if(h){location.replace(X(location.search));return}v(!0)}function te(m){C(m),p(null)}return n.jsxs("main",{className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",children:[n.jsx("div",{className:"absolute left-3 top-12 max-w-[280px]",children:n.jsx(ht,{})}),n.jsxs("div",{className:"w-full max-w-[420px]",children:[R&&Lt(R)?n.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:o("pair.notEncrypted")}):null,U?n.jsx("p",{role:"status",className:"text-[20px] font-semibold",children:_?o("pair.openingCloud"):o("pair.connectingTo",{name:l?.label??o("pair.thisOpenMausBot")})}):n.jsxs(n.Fragment,{children:[n.jsx("h1",{className:"text-[20px] font-semibold",children:Ot(l,j)}),n.jsxs("p",{className:"mt-1.5 text-[14px] leading-relaxed text-ink-secondary",children:[l&&!_?`${o("pair.version",{version:l.version,platform:l.platform})} `:"",It({mode:j,sent:h,email:w,cloudHome:_})]}),ae(r)&&!z?n.jsx("p",{className:"mt-3 text-[13px] text-ink-secondary",children:ae(r)}):null,b&&_&&e?n.jsx("p",{className:"mt-3 text-[13px] text-ink-secondary",children:o("pair.expired",{app:A(),open:o("cloudHome.connect"),section:o("settings.section.cloudAccount")})}):null,!z&&le(l)?n.jsxs("div",{"data-team-sign-in":!0,className:"mt-4 flex flex-col items-start gap-1.5",children:[n.jsx("a",{href:le(l),className:"rounded-md bg-accent px-4 py-2 text-[14px] font-medium text-accent-ink",children:o("pair.team.open",{team:l.label})}),n.jsx("p",{className:"text-[13px] text-ink-secondary",children:o("pair.team.openHint")})]}):null]}),U?null:z?n.jsxs("p",{className:"mt-4 text-[14px]",children:[o("pair.alreadyConnected")," ",n.jsx("a",{href:"/",className:"text-accent underline",children:o("pair.openApp")})]}):j==="email"?n.jsxs("form",{onSubmit:Ce,children:[n.jsx("label",{className:O,htmlFor:"signin-email",children:o("cloudBuy.signIn.email")}),n.jsx("input",{id:"signin-email",type:"email",value:w,onChange:m=>{T(m.target.value),v(!1),P("")},autoComplete:"email",inputMode:"email",spellCheck:!1,className:L}),h?n.jsxs(n.Fragment,{children:[n.jsx("label",{className:O,htmlFor:"signin-code",children:o("pair.emailCode")}),n.jsx("input",{id:"signin-code",value:E,onChange:m=>P(m.target.value),placeholder:"12345678",autoComplete:"one-time-code",inputMode:"numeric",spellCheck:!1,className:`${L} font-mono text-[15px] tracking-[0.12em]`}),n.jsx("label",{className:O,htmlFor:"signin-label",children:o("pair.deviceLabel")}),n.jsx("input",{id:"signin-label",value:c,onChange:m=>u(m.target.value),maxLength:80,className:L})]}):null,b?n.jsx("p",{className:"mt-3 text-[13px] text-danger",children:b}):null,n.jsx("button",{type:"submit",disabled:d||!w.includes("@")||h&&E.replace(/\D/g,"").length<8,className:ie,children:o(d?h?"pair.signingIn":"pair.sending":h?"pair.signIn":"cloudBuy.signIn.send")}),h?n.jsx("button",{type:"button",onClick:()=>v(!1),className:"mt-3 w-full text-[13px] text-ink-secondary underline",children:o("pair.resend")}):null,n.jsx("button",{type:"button",onClick:()=>te("code"),className:"mt-3 w-full text-[13px] text-ink-secondary underline",children:o("pair.useCode")})]}):n.jsxs("form",{onSubmit:Ee,children:[n.jsx("label",{className:O,htmlFor:"pair-code",children:o("pair.code")}),n.jsx("input",{id:"pair-code",value:a,onChange:m=>{s(m.target.value),S(H())},placeholder:"XXXX-XXXX-XXXX","aria-describedby":e&&a===e?"pair-code-from-link":void 0,autoComplete:"one-time-code",autoCapitalize:"characters",spellCheck:!1,className:`${L} font-mono text-[15px] tracking-[0.12em]`}),e&&a===e?n.jsx("p",{id:"pair-code-from-link",className:"mt-1 text-[12px] text-ink-secondary",children:o("pair.fromLink")}):null,n.jsx("label",{className:O,htmlFor:"pair-label",children:o("pair.deviceLabel")}),n.jsx("input",{id:"pair-label",value:c,onChange:m=>u(m.target.value),maxLength:80,className:L}),ee?n.jsx("p",{role:"alert",className:"mt-3 text-[13px] text-danger",children:ee}):b?n.jsx("p",{className:"mt-3 text-[13px] text-danger",children:b}):null,n.jsx("button",{type:"submit",disabled:d||!Tt(a),className:ie,children:o(d?"pair.connecting":"pair.connect")}),R?.origin?n.jsxs("p",{className:"mt-3 text-[13px] text-ink-secondary",children:[o("pair.onPhone")," ",n.jsx("a",{href:_t(R.origin,a),className:"text-accent underline",children:o("pair.openInApp",{app:A()})})]}):null,Se?n.jsxs("p",{className:"mt-3 text-[13px] text-ink-secondary",children:[o("pair.noCode")," ",n.jsx("code",{className:"select-all rounded bg-inset px-1.5 py-0.5 text-[12px] text-ink",children:"npx limixbot pair"})]}):null,Ne?n.jsxs("p",{className:"mt-5 border-t border-hairline/40 pt-4 text-[13px] text-ink-secondary",children:[o("pair.invitedByEmail")," ",n.jsx("button",{type:"button",onClick:()=>te("email"),className:"text-accent underline",children:o("pair.useEmail")})]}):null]})]})]})}const bn="cloud-welcome-done",$t="unauthorized: you are no longer in this team",ce=[["reserving","cloudHome.step.reserving"],["storage","cloudHome.step.storage"],["starting","cloudHome.step.starting"],["checking","cloudHome.step.checking"]];function Dt({step:e}){const t=ce.findIndex(([r])=>r===e);return n.jsx("ol",{"data-cloud-setup":e,className:"flex flex-col gap-1 text-[13px]",children:ce.map(([r,a],s)=>n.jsx("li",{"aria-current":s===t?"step":void 0,className:s===t?"font-medium text-ink":s<t?"text-ink-secondary line-through decoration-ink-secondary/40":"text-ink-secondary",children:o(a)},r))})}const Bt={stopped:"cloudHome.stopped","payment-problem":"cloudHome.paymentProblem",failed:"cloudHome.failed"},ue={host:"cloudHome.unreachableHost",no_answer:"cloudHome.unreachable"};function Ht(e,t=Date.now()){const r=new Date(e).getFullYear()!==new Date(t).getFullYear();return new Intl.DateTimeFormat($e(),{day:"numeric",month:"long",...r?{year:"numeric"}:{}}).format(new Date(e))}function Ft(e,t=Date.now()){const r=e?.name??null,a=(s,c)=>r?o(c,{name:r}):o(s);return e?.screen==="setup"?{title:a("homeScreen.setup","homeScreen.setupNamed"),body:o(e.slow?"cloudHome.slow":"homeScreen.setupBody"),reason:null,action:null,busy:!0}:e?.screen==="offline"?{title:a("homeScreen.offline","homeScreen.offlineNamed"),body:o("homeScreen.offlineBack"),reason:e.cause&&Object.hasOwn(ue,e.cause)?o(ue[e.cause]):e.reason??null,action:"retry",busy:!1}:e?.screen==="signin"?{title:a("homeScreen.signIn","homeScreen.signInNamed"),body:o(e.other?"homeScreen.signInOther":"homeScreen.signInEnded"),reason:null,action:"sign-in",busy:!1}:e?.screen==="plan"&&e.member&&e.machine!=="failed"?{title:a("homeScreen.plan","homeScreen.planNamed"),body:o("cloudHome.stoppedMember"),reason:null,action:null,busy:!1}:e?.screen==="plan"?{title:a("homeScreen.plan","homeScreen.planNamed"),body:o(Bt[e.machine]??"cloudHome.failed"),reason:null,action:e.machine==="failed"?null:"manage",busy:!1}:e?.screen==="ended"?{title:a("cloudHome.ended","cloudHome.endedNamed"),body:e.deleteAt?o("cloudHome.endedFiles",{date:Ht(e.deleteAt,t)}):null,reason:null,action:"buy",busy:!1}:e?.screen==="checkout"?{title:a("cloudHome.checkout","cloudHome.checkoutNamed"),body:null,reason:null,action:"continue",busy:!1}:e?.screen==="payment"?{title:a("cloudHome.payment","cloudHome.paymentNamed"),body:o("cloudHome.paymentBody"),reason:null,action:"card",busy:!1}:e?.screen==="waking"?{title:o("homeScreen.waking"),body:null,reason:null,action:null,busy:!0}:e?.screen==="moving"?{title:a("homeScreen.moving","homeScreen.movingNamed"),body:null,reason:null,action:null,busy:!0}:{title:a("homeScreen.opening","homeScreen.openingNamed"),body:null,reason:null,action:null,busy:!0}}const Ut={retry:"cloudHome.tryAgain",buy:"cloudHome.buyAgain",continue:"cloudHome.continue",card:"cloudHome.updateCard"};function zt({name:e,remove:t}){const[r,a]=i.useState(!1),[s,c]=i.useState(!1),[u,l]=i.useState(null),y=()=>{c(!0),l(null),t().then(f=>{c(!1),f!=="removed"&&f!=="gone"&&(a(!1),l(f==="refused"?"refused":"failed"))},()=>{c(!1),a(!1),l("failed")})};return n.jsxs("div",{"data-home-remove":!0,className:"flex flex-col items-start gap-2",children:[r?n.jsxs("div",{role:"alertdialog","aria-label":o("rail.remove"),className:"flex flex-col gap-2 rounded-xl border border-hairline/70 bg-card/70 px-4 py-3",children:[n.jsx("p",{className:"text-[13px] leading-relaxed text-ink",children:o("rail.removeAsk",{name:e})}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{type:"button","data-home-remove-confirm":!0,className:"ui-button ui-button-primary",disabled:s,onClick:y,children:o("rail.removeYes")}),n.jsx("button",{type:"button",className:"ui-button",disabled:s,onClick:()=>a(!1),children:o("rail.removeNo")})]})]}):n.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),a(!0)},children:o("rail.remove")}),u&&n.jsx("p",{role:"alert",className:"text-[13px] text-danger",children:o(u==="refused"?"rail.removeRefused":"rail.removeFailed")})]})}function Mt({bridge:e,manage:t}){const[r,a]=i.useState(null),[s,c]=i.useState(!1);i.useEffect(()=>{let x=!0;const b=e.onState(g=>a(g)),p=()=>{e.retry().then(g=>{x&&a(g)}).catch(()=>{})};return e.state().then(g=>{x&&a(g)}).catch(()=>{}).then(p),window.addEventListener("online",p),window.addEventListener("focus",p),()=>{x=!1,b(),window.removeEventListener("online",p),window.removeEventListener("focus",p)}},[e]);const u=Ft(r),l=x=>{c(!1),x().catch(()=>c(!0))},y=window.ogb?.cloudAdd?.reopen,f={retry:()=>e.retry().then(x=>a(x)),...t?{manage:t,buy:t,card:t,continue:async()=>{y&&await y().catch(()=>!1)||await t()}}:{}},k=u.action&&u.action!=="sign-in"&&u.action!=="manage"?u.action:null,d=(r?.screen==="ended"||r?.screen==="payment")&&r.removable===!0&&typeof e.remove=="function";return n.jsx("main",{"data-home-screen":r?.screen??"opening",className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",style:{WebkitAppRegion:"drag"},children:n.jsxs("div",{className:"flex w-full max-w-[420px] flex-col items-start gap-3",style:{WebkitAppRegion:"no-drag"},children:[n.jsxs("p",{role:"status",className:"flex items-center gap-2 text-[20px] font-semibold",children:[u.busy&&n.jsx("span",{"aria-hidden":"true",className:"size-3.5 shrink-0 animate-spin rounded-full border-2 border-hairline border-t-accent"}),u.title]}),u.body&&n.jsx("p",{className:"text-[14px] leading-relaxed text-ink-secondary",children:u.body}),r?.screen==="setup"&&n.jsx(Dt,{step:r.step??"reserving"}),u.reason&&n.jsx("p",{"data-home-reason":!0,className:"text-[13px] leading-relaxed text-ink-secondary",children:u.reason}),u.action==="sign-in"&&n.jsx("button",{type:"button",className:"ui-button ui-button-primary mt-2",onClick:()=>l(()=>e.signIn()),children:o("homeScreen.signInButton")}),u.action==="manage"&&t&&n.jsx("button",{type:"button",className:"ui-button mt-2",onClick:()=>l(t),children:o("cloudAccount.manageInBrowser")}),k&&f[k]&&n.jsx("button",{type:"button","data-home-action":k,className:k==="retry"?"ui-button mt-2":"ui-button ui-button-primary mt-2",onClick:()=>l(f[k]),children:o(Ut[k])}),d&&n.jsx(zt,{name:r.name??o("cloudSetup.myCloud"),remove:()=>e.remove()}),s&&n.jsx("p",{role:"alert",className:"text-[13px] text-danger",children:o("cloudAccount.actionFailed")})]})})}function Wt({bridge:e,fallback:t}){const[r,a]=i.useState(!1);return i.useEffect(()=>{e.repair().catch(()=>a(!0))},[e]),r?n.jsx(n.Fragment,{children:t}):n.jsx("main",{"data-home-screen":"opening",className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",children:n.jsx("p",{role:"status",className:"w-full max-w-[420px] text-[20px] font-semibold",children:o("homeScreen.opening")})})}const Q="omb.session-ended";let K=!1,G=null;const q=new Set;function gn(){K||G||(G=F().then(e=>{if(e.kind==="unauthenticated"){K=!0;try{sessionStorage.setItem(Q,"1")}catch{}for(const t of q)t()}}).finally(()=>{G=null}))}function de(){return K}function yn(){return i.useSyncExternalStore(e=>(q.add(e),()=>q.delete(e)),de,de)}function Xt(){try{return sessionStorage.getItem(Q)==="1"}catch{return!1}}function Gt(){try{sessionStorage.removeItem(Q)}catch{}}De();Be(He());Fe(Ue());at();ze(Me());const B=We(),Vt=new Set(["/home","/pair","/desktop-viewer"]),ve=()=>me(()=>import("./App-ajUV-Eko.js").then(e=>e.jS),__vite__mapDeps([0,1,2,3,4,5])).catch(e=>({default:()=>{throw e}})),Kt=Vt.has(location.pathname)?null:ve(),qt=()=>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 Yt(){const e=window.ogb?.home;if(location.pathname==="/home"&&e)return n.jsx(Mt,{bridge:e,manage:window.ogb?.cloudPlan?.manage});if(location.pathname==="/pair"){const a=Ze();if(a){const s=await et(a);return await B,s?n.jsx(ot,{credential:a,owner:s.owner,team:s.team}):n.jsx(D,{initialCode:null,reason:o("pair.browser.signInFailed")})}return n.jsx(D,{initialCode:Je(),initialEmail:Qe()})}const t=await F();if(t.kind==="unauthenticated"){if(await B,t.error===$t)return n.jsx(Rt,{team:await qt()});const a=n.jsx(D,{initialCode:null,reason:Xt()?o("pair.sessionEnded"):t.error});return e?n.jsx(Wt,{bridge:e,fallback:a}):a}if(Gt(),t.kind==="session"&&Ke(t.teamSignIn),t.kind==="loopback"&&t.trust==="service")return await B,n.jsx(D,{initialCode:null,reason:o("pair.serviceTrust")});if(location.pathname==="/desktop-viewer"){const{DesktopViewer:a}=await me(async()=>{const{DesktopViewer:s}=await import("./DesktopViewer-CO6rKDOC.js");return{DesktopViewer:s}},__vite__mapDeps([6,1,2,7,8,5,4,9]));return n.jsx(a,{})}const{default:r}=await(Kt??ve());return n.jsx(r,{})}document.title=A();Promise.all([Xe(),Yt(),B]).then(([,e])=>{Ge.createRoot(document.getElementById("root")).render(n.jsx(i.StrictMode,{children:n.jsx(Ve,{children:e})}))});export{yn as A,D as B,Dt as C,ht as D,en as E,xn as F,an as P,lt as S,bt as a,hn as b,un as c,it as d,Y as e,mn as f,Zt as g,dn as h,he as i,pn as j,ln as k,fn as l,rn as m,gn as n,dt as o,cn as p,Qt as q,F as r,nn as s,ct as t,ft as u,on as v,sn as w,st as x,tn as y,bn as z};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{d9 as W,da as A,db as k,dc as C,dd as $,de as q,df as z,dg as U,dh as X}from"./App-
|
|
1
|
+
import{d9 as W,da as A,db as k,dc as C,dd as $,de as q,df as z,dg as U,dh as X}from"./App-ajUV-Eko.js";import T from"./katex-HP8lGamR.js";import"./styles-BynTeCUc.js";import"./PlacesRail-B0r2Van_.js";import"./monitor-DGPG5gJh.js";import"./index-C5PxeCx7.js";import"./MenuMotion-QoOXKNvf.js";const j=/[#.]/g;function Y(e,t){const n=e||"",r={};let o=0,i,s;for(;o<n.length;){j.lastIndex=o;const a=j.exec(n),c=n.slice(o,a?a.index:n.length);c&&(i?i==="#"?r.id=c:Array.isArray(r.className)?r.className.push(c):r.className=[c]:s=c,o+=c.length),a&&(i=a[0],o++)}return{type:"element",tagName:s||t||"div",properties:r,children:[]}}function B(e,t,n){const r=n?v(n):void 0;function o(i,s,...a){let c;if(i==null){c={type:"root",children:[]};const f=s;a.unshift(f)}else{c=Y(i,t);const f=c.tagName.toLowerCase(),l=r?r.get(f):void 0;if(c.tagName=l||f,J(s))a.unshift(s);else for(const[u,d]of Object.entries(s))Q(e,c.properties,u,d)}for(const f of a)w(c.children,f);return c.type==="element"&&c.tagName==="template"&&(c.content={type:"root",children:c.children},c.children=[]),c}return o}function J(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const o=t[r];if(o&&typeof o=="object"){if(!Array.isArray(o))return!0;const i=o;for(const s of i)if(typeof s!="number"&&typeof s!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function Q(e,t,n,r){const o=W(e,n);let i;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;i=r}else typeof r=="boolean"?i=r:typeof r=="string"?o.spaceSeparated?i=A(r):o.commaSeparated?i=k(r):o.commaOrSpaceSeparated?i=A(k(r).join(" ")):i=E(o,o.property,r):Array.isArray(r)?i=[...r]:i=o.property==="style"?Z(r):String(r);if(Array.isArray(i)){const s=[];for(const a of i)s.push(E(o,o.property,a));i=s}o.property==="className"&&Array.isArray(t.className)&&(i=t.className.concat(i)),t[o.property]=i}}function w(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)w(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?w(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function E(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||C(n)===C(t)))return!0}return n}function Z(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function v(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const ee=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],te=B($,"div"),ne=B(q,"g",ee),y={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function re(e,t){return P(e,{})||{type:"root",children:[]}}function P(e,t){const n=oe(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function oe(e,t){switch(e.nodeType){case 1:return ae(e,t);case 3:return se(e);case 8:return ce(e);case 9:return S(e,t);case 10:return ie();case 11:return S(e,t);default:return}}function S(e,t){return{type:"root",children:D(e,t)}}function ie(){return{type:"doctype"}}function se(e){return{type:"text",value:e.nodeValue||""}}function ce(e){return{type:"comment",value:e.nodeValue||""}}function ae(e,t){const n=e.namespaceURI,r=n===y.svg?ne:te,o=n===y.html?e.tagName.toLowerCase():e.tagName,i=n===y.html&&o==="template"?e.content:e,s=e.getAttributeNames(),a={};let c=-1;for(;++c<s.length;)a[s[c]]=e.getAttribute(s[c])||"";return r(o,a,D(i,t))}function D(e,t){const n=e.childNodes,r=[];let o=-1;for(;++o<n.length;){const i=P(n[o],t);i!==void 0&&r.push(i)}return r}new DOMParser;function fe(e,t){const n=le(e);return re(n)}function le(e){const t=document.createElement("template");return t.innerHTML=e,t.content}const I=(function(e,t,n){const r=z(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),h=(function(e){if(e==null)return he;if(typeof e=="string")return pe(e);if(typeof e=="object")return ue(e);if(typeof e=="function")return b(e);throw new Error("Expected function, string, or array as `test`")});function ue(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=h(e[n]);return b(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function pe(e){return b(t);function t(n){return n.tagName===e}}function b(e){return t;function t(n,r,o){return!!(de(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function he(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function de(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const O=/\n/g,M=/[\t ]+/g,N=h("br"),F=h(Ae),me=h("p"),L=h("tr"),ge=h(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",xe,ke]),G=h(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function ye(e,t){const n=t||{},r="children"in e?e.children:[],o=G(e),i=H(e,{whitespace:n.whitespace||"normal"}),s=[];(e.type==="text"||e.type==="comment")&&s.push(..._(e,{breakBefore:!0,breakAfter:!0}));let a=-1;for(;++a<r.length;)s.push(...R(r[a],e,{whitespace:i,breakBefore:a?void 0:o,breakAfter:a<r.length-1?N(r[a+1]):o}));const c=[];let f;for(a=-1;++a<s.length;){const l=s[a];typeof l=="number"?f!==void 0&&l>f&&(f=l):l&&(f!==void 0&&f>-1&&c.push(`
|
|
2
2
|
`.repeat(f)||" "),f=-1,c.push(l))}return c.join("")}function R(e,t,n){return e.type==="element"?we(e,t,n):e.type==="text"?n.whitespace==="normal"?_(e,n):Ne(e):[]}function we(e,t,n){const r=H(e,n),o=e.children||[];let i=-1,s=[];if(ge(e))return s;let a,c;for(N(e)||L(e)&&I(t,e,L)?c=`
|
|
3
3
|
`:me(e)?(a=2,c=2):G(e)&&(a=1,c=1);++i<o.length;)s=s.concat(R(o[i],e,{whitespace:r,breakBefore:i?void 0:a,breakAfter:i<o.length-1?N(o[i+1]):c}));return F(e)&&I(t,e,F)&&s.push(" "),a&&s.unshift(a),c&&s.push(c),s}function _(e,t){const n=String(e.value),r=[],o=[];let i=0;for(;i<=n.length;){O.lastIndex=i;const c=O.exec(n),f=c&&"index"in c?c.index:n.length;r.push(be(n.slice(i,f).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),i===0?t.breakBefore:!0,f===n.length?t.breakAfter:!0)),i=f+1}let s=-1,a;for(;++s<r.length;)r[s].charCodeAt(r[s].length-1)===8203||s<r.length-1&&r[s+1].charCodeAt(0)===8203?(o.push(r[s]),a=void 0):r[s]?(typeof a=="number"&&o.push(a),o.push(r[s]),a=0):(s===0||s===r.length-1)&&o.push(0);return o}function Ne(e){return[String(e.value)]}function be(e,t,n){const r=[];let o=0,i;for(;o<e.length;){M.lastIndex=o;const s=M.exec(e);i=s?s.index:e.length,!o&&!i&&s&&!t&&r.push(""),o!==i&&r.push(e.slice(o,i)),o=s?i+s[0].length:i}return o!==i&&!n&&r.push(""),r.join(" ")}function H(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function xe(e){return!!(e.properties||{}).hidden}function Ae(e){return e.tagName==="td"||e.tagName==="th"}function ke(e){return e.tagName==="dialog"&&!(e.properties||{}).open}const Ce={},Te=[];function Le(e){const t=e||Ce;return function(n,r){U(n,"element",function(o,i){const s=Array.isArray(o.properties.className)?o.properties.className:Te,a=s.includes("language-math"),c=s.includes("math-display"),f=s.includes("math-inline");let l=c;if(!a&&!c&&!f)return;let u=i[i.length-1],d=o;if(o.tagName==="code"&&a&&u&&u.type==="element"&&u.tagName==="pre"&&(d=u,u=i[i.length-2],l=!0),!u)return;const m=ye(d,{whitespace:"pre"});let p;try{p=T.renderToString(m,{...t,displayMode:l,throwOnError:!0})}catch(g){const x=g,V=x.name.toLowerCase();r.message("Could not render math with KaTeX",{ancestors:[...i,o],cause:x,place:o.position,ruleId:V,source:"rehype-katex"});try{p=T.renderToString(m,{...t,displayMode:l,strict:"ignore",throwOnError:!1})}catch{p=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(t.errorColor||"#cc0000"),title:String(g)},children:[{type:"text",value:m}]}]}}typeof p=="string"&&(p=fe(p).children);const K=u.children.indexOf(d);return u.children.splice(K,1,...p),X})}}export{Le as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as e,l as s,T as n,d as i}from"./mermaid.core-
|
|
1
|
+
import{_ as e,l as s,T as n,d as i}from"./mermaid.core-DO0Pzmu4.js";import{p}from"./cynefin-EF2NZ3EQ-AzIaeBzO.js";import"./styles-BynTeCUc.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};
|
package/dist/assets/{ishikawaDiagram-K3B6WC7H-BKFtIESa.js → ishikawaDiagram-K3B6WC7H-Do-25hEq.js}
RENAMED
|
@@ -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-
|
|
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-DO0Pzmu4.js";import"./styles-BynTeCUc.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()+`
|