limixbot 0.2.0 → 0.2.2
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-DQ6SldsH.js → ActivityPanel-BJ-KjzZQ.js} +1 -1
- package/dist/assets/{App-5ImTEsbf.js → App-B88ABHQh.js} +9 -9
- package/dist/assets/{AppEventEditor-D0d99syK.js → AppEventEditor-C1j7B-on.js} +1 -1
- package/dist/assets/{BotSettingsDialog-CsxnAEvN.js → BotSettingsDialog-CVVgZ_Nc.js} +1 -1
- package/dist/assets/{BrowserPanel-ClldymIL.js → BrowserPanel-DD7r9HOn.js} +1 -1
- package/dist/assets/{BrowserProfilesManager-CWHmWa18.js → BrowserProfilesManager-D1rUYWVD.js} +1 -1
- package/dist/assets/{CloudAddDialog-BOy7-oAN.js → CloudAddDialog-CZhJqPdM.js} +1 -1
- package/dist/assets/{ComputerFilesPane-FPZyVWJS.js → ComputerFilesPane-B1y88sYp.js} +1 -1
- package/dist/assets/{ComputerPanel-CvpWL_zw.js → ComputerPanel-DBvlrkN9.js} +2 -2
- package/dist/assets/{DataPanel-DN_Kqzgt.js → DataPanel-Bu3s4f1H.js} +1 -1
- package/dist/assets/{DesktopViewer-Dc_O38Q5.js → DesktopViewer-D_Tc0DtD.js} +1 -1
- package/dist/assets/{FilesView-DovLYw-8.js → FilesView-DwGmVJUN.js} +1 -1
- package/dist/assets/{GrokMoveDialog-BrTp3ms0.js → GrokMoveDialog-f1ta87oZ.js} +1 -1
- package/dist/assets/{InspectorPanel-Bk8Fb3Vv.js → InspectorPanel-D0_Z99j4.js} +1 -1
- package/dist/assets/{KeyboardShortcutsModal-DpIXj9DI.js → KeyboardShortcutsModal-CEwkgGoB.js} +1 -1
- package/dist/assets/{LiveDesktop-DLThLuRy.js → LiveDesktop-E6f1BBs1.js} +1 -1
- package/dist/assets/{LocalVmWorkspace-DaDnURCd.js → LocalVmWorkspace-D6Eotsee.js} +1 -1
- package/dist/assets/{MacLocalControl-ikpUIb9M.js → MacLocalControl-B3YOye-H.js} +1 -1
- package/dist/assets/{MarkdownFilePreview-C-zpxhEr.js → MarkdownFilePreview-BLGAemwy.js} +1 -1
- package/dist/assets/{MenuMotion-DIzo9CWe.js → MenuMotion-vm5ldfak.js} +1 -1
- package/dist/assets/{NewBotDialog-CMvWqjVk.js → NewBotDialog-B2X4qm4R.js} +1 -1
- package/dist/assets/{PhoneAppDialog-CbY1Fa80.js → PhoneAppDialog-hQoVtk6q.js} +1 -1
- package/dist/assets/{PlacesRail-CxT7ATSb.js → PlacesRail-0dNv7oZB.js} +1 -1
- package/dist/assets/{PluginsPanel-B-EaOkeS.js → PluginsPanel-DtdtIk9h.js} +1 -1
- package/dist/assets/{ProIntroduction-iQa0Iqvq.js → ProIntroduction-B7TckG4N.js} +1 -1
- package/dist/assets/{RemoteAgentSettingsPanel-Cg_Y1VsX.js → RemoteAgentSettingsPanel-DxXqwhrm.js} +1 -1
- package/dist/assets/{RoomPanel-CRbqjMMX.js → RoomPanel-FwiCG8NY.js} +1 -1
- package/dist/assets/{RoutinesPage-DAU4E5QH.js → RoutinesPage-D7e6qR1n.js} +1 -1
- package/dist/assets/{SettingsModal-C4KPUUbt.js → SettingsModal-DBR7IGpo.js} +1 -1
- package/dist/assets/{ShareTeamDialog-BxpyYb4D.js → ShareTeamDialog-TxtG8d2Y.js} +1 -1
- package/dist/assets/{SignedInSites-DVzh6Sgy.js → SignedInSites-CVRfJGQY.js} +1 -1
- package/dist/assets/{TeamLibraryPanel-DvhZh6bz.js → TeamLibraryPanel-NG1mKW-M.js} +1 -1
- package/dist/assets/{TeamMapPage-Bae2TYf8.js → TeamMapPage-j9euCmPt.js} +1 -1
- package/dist/assets/{TriggersPage-BK8vnxYR.js → TriggersPage-rajjjJ3z.js} +1 -1
- package/dist/assets/{VisibilitySection-DHZe007N.js → VisibilitySection-BVTc_bLr.js} +1 -1
- package/dist/assets/{WebhookTrigger-MvhmQqrH.js → WebhookTrigger-Bap1eB3c.js} +1 -1
- package/dist/assets/{WorksOnGrid-CdahWTTY.js → WorksOnGrid-BH9WTY-z.js} +1 -1
- package/dist/assets/{abnfDiagram-YUKMZFIV-DHIfjvy0.js → abnfDiagram-YUKMZFIV-DCjLKsgc.js} +1 -1
- package/dist/assets/{activity-DXW67hJH.js → activity-BjR5nw9Z.js} +1 -1
- package/dist/assets/{architectureDiagram-47P4ROYG-8ZFD18Ma.js → architectureDiagram-47P4ROYG-DhdUk3XR.js} +1 -1
- package/dist/assets/{blockDiagram-E7TT5TSB-oDCOkHO2.js → blockDiagram-E7TT5TSB-CJN1G2VQ.js} +1 -1
- package/dist/assets/{c4Diagram-CRA5TL53-IT3HaSBr.js → c4Diagram-CRA5TL53-BfkzahxK.js} +1 -1
- package/dist/assets/{calendar-days-CgDcDbmR.js → calendar-days-DlTxBFXF.js} +1 -1
- package/dist/assets/channel-BAivii3N.js +1 -0
- package/dist/assets/{chunk-2Q5K7J3B-DDzkmpw7.js → chunk-2Q5K7J3B-BwH3UOL3.js} +1 -1
- package/dist/assets/{chunk-5VM5RSS4-BIEkeU_y.js → chunk-5VM5RSS4-qo9dxZfl.js} +1 -1
- package/dist/assets/{chunk-7TKQ45FW-BCmNJdPg.js → chunk-7TKQ45FW-B_b-TvDW.js} +1 -1
- package/dist/assets/{chunk-AW2ZBBNX-Dq5hnl_T.js → chunk-AW2ZBBNX-DTVjfWfo.js} +1 -1
- package/dist/assets/{chunk-FVRAUYC3-CxT7tLVI.js → chunk-FVRAUYC3-6Ej1chkf.js} +2 -2
- package/dist/assets/{chunk-HTAEGDNF-WuMXXVXq.js → chunk-HTAEGDNF-dGKAv3Ly.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-9G7Ov5oO.js → chunk-JWPE2WC7-Dl30Op6i.js} +1 -1
- package/dist/assets/{chunk-KQW6MTUR-BqzkcKb7.js → chunk-KQW6MTUR-C7I5DprK.js} +1 -1
- package/dist/assets/{chunk-XXDRQBXY-rt20EPvY.js → chunk-XXDRQBXY-niGkH3Wm.js} +1 -1
- package/dist/assets/{classDiagram-v2-K4WV4PDN-CbiFsD2h.js → classDiagram-v2-K4WV4PDN-DV3eJqTd.js} +1 -1
- package/dist/assets/{coins-D8L4IeFd.js → coins-DEObq6EM.js} +1 -1
- package/dist/assets/{core-C3xVj8cU.js → core-CQuzVAof.js} +1 -1
- package/dist/assets/{cose-bilkent-JH36ORCC-bf0vlazf.js → cose-bilkent-JH36ORCC-Dw675nir.js} +1 -1
- package/dist/assets/{cynefin-EF2NZ3EQ-DW3N3IPQ.js → cynefin-EF2NZ3EQ-rM_Vx_Nc.js} +1 -1
- package/dist/assets/{cynefinDiagram-3GCD6N5R-iIWFatIE.js → cynefinDiagram-3GCD6N5R-LQIlP8_F.js} +1 -1
- package/dist/assets/{dagre-W4DXFKR2-V4xqT-Z3.js → dagre-W4DXFKR2-DIGKS0Jz.js} +1 -1
- package/dist/assets/de-B1J17cai.js +8 -0
- package/dist/assets/{diagram-2UJZ2QOL-Bk3ravV3.js → diagram-2UJZ2QOL-DHcKf8Wa.js} +1 -1
- package/dist/assets/{diagram-OVF4WLC6-BpJgMTyN.js → diagram-OVF4WLC6-CaakNCyA.js} +1 -1
- package/dist/assets/{diagram-PFPMY2P6-D9rWYBb8.js → diagram-PFPMY2P6-BQTgTfVh.js} +1 -1
- package/dist/assets/{diagram-UMYRVEAY-DgFKT_xE.js → diagram-UMYRVEAY-Dz4tiefj.js} +1 -1
- package/dist/assets/{diagram-YEKJPTXX-D2gh1ltw.js → diagram-YEKJPTXX-4K0yWjUe.js} +1 -1
- package/dist/assets/{diagram-ZIFT7M5P-JgwoPfe-.js → diagram-ZIFT7M5P-rWWlZtci.js} +1 -1
- package/dist/assets/{ebnfDiagram-VR2GEFS7-B-Hbq0A-.js → ebnfDiagram-VR2GEFS7-QPG43w9u.js} +1 -1
- package/dist/assets/{elk-IJKZMXRS-4aetViwb.js → elk-IJKZMXRS-hRSqsqP_.js} +1 -1
- package/dist/assets/{erDiagram-O2IAPWRE-_7zpWNwT.js → erDiagram-O2IAPWRE-V8e4toBc.js} +1 -1
- package/dist/assets/es-CS_V7OdX.js +6 -0
- package/dist/assets/{file-up-C-rFTv9c.js → file-up-DY1vL6py.js} +1 -1
- package/dist/assets/{flowDiagram-OXPTDLAJ-CfTlOpXM.js → flowDiagram-OXPTDLAJ-Cz7Ay48V.js} +1 -1
- package/dist/assets/fr-Dn65EJNi.js +8 -0
- package/dist/assets/{ganttDiagram-R7TSEDQI-CUGh7ikL.js → ganttDiagram-R7TSEDQI-CI6nugxH.js} +1 -1
- package/dist/assets/{gitGraphDiagram-XJZIOB7I-CNiOWIBa.js → gitGraphDiagram-XJZIOB7I-BjtDxt_s.js} +1 -1
- package/dist/assets/hi-CHU0sl7u.js +1 -0
- package/dist/assets/{import-name-DqWOlO3p.js → import-name-DqzojGXy.js} +1 -1
- package/dist/assets/{index-2wS-TBWF.js → index-BfUxIMI-.js} +1 -1
- package/dist/assets/{index-B8UoQvam.js → index-BiSZ69F2.js} +2 -2
- package/dist/assets/{index-CLuPZ_ge.js → index-BjLGGSd_.js} +1 -1
- package/dist/assets/{infoDiagram-5W2HQ5XZ-fn3sGtOU.js → infoDiagram-5W2HQ5XZ-B7kSPI8x.js} +1 -1
- package/dist/assets/{ishikawaDiagram-K3B6WC7H-DR50SXfs.js → ishikawaDiagram-K3B6WC7H-B80aI5uW.js} +1 -1
- package/dist/assets/it-CbDr93sA.js +13 -0
- package/dist/assets/ja-CJbW-M3a.js +13 -0
- package/dist/assets/{journeyDiagram-COXZFDF6-B7UkLqv1.js → journeyDiagram-COXZFDF6-CjxmU5O_.js} +1 -1
- package/dist/assets/{kanban-definition-P3RFRI5V-CtCmVeLg.js → kanban-definition-P3RFRI5V-BIU0Q11m.js} +1 -1
- package/dist/assets/ko-ZQvzPil_.js +13 -0
- package/dist/assets/{mcp-servers-PscuvSLp.js → mcp-servers-LGwHCvUp.js} +1 -1
- package/dist/assets/{mermaid.core-6s7iUTmY.js → mermaid.core-C9748YDA.js} +4 -4
- package/dist/assets/{mindmap-definition-LZFPQGKD-Brk3mBsF.js → mindmap-definition-LZFPQGKD-C_QDmkR_.js} +1 -1
- package/dist/assets/{minimize-BXPLizAB.js → minimize-DxmLA74X.js} +1 -1
- package/dist/assets/{monitor-fSDrciab.js → monitor-saVltJVe.js} +1 -1
- package/dist/assets/{new-bot-KSKvZiMw.js → new-bot-BdMgVWOM.js} +1 -1
- package/dist/assets/{org-library-CNwvES8-.js → org-library-DWY9-OyC.js} +1 -1
- package/dist/assets/{package-format-pY7V6pLt.js → package-format-CqLquC8E.js} +1 -1
- package/dist/assets/{pegDiagram-BGZESJAR-CV9rDiY7.js → pegDiagram-BGZESJAR-CWQyllhq.js} +1 -1
- package/dist/assets/{pieDiagram-CAPJLFHJ-68jslf3f.js → pieDiagram-CAPJLFHJ-BXx9zdy3.js} +1 -1
- package/dist/assets/pl-tZIDksyW.js +13 -0
- package/dist/assets/pt-br-BtcqPDCE.js +15 -0
- package/dist/assets/{quadrantDiagram-GDMTTRAM-B2W8pNbe.js → quadrantDiagram-GDMTTRAM-CT3VU9ss.js} +1 -1
- package/dist/assets/{rail-CkOyCo_V.js → rail-DDUwvn54.js} +1 -1
- package/dist/assets/{railroadDiagram-SM67HX2B-BV1B3pKV.js → railroadDiagram-SM67HX2B-DsZVUfT9.js} +1 -1
- package/dist/assets/{remote-desktop-panel-C9_e4Lf8.js → remote-desktop-panel-B-L_Sc4G.js} +1 -1
- package/dist/assets/{requirementDiagram-X7JNWC4A-Bdldpdiu.js → requirementDiagram-X7JNWC4A-DieBBfKD.js} +1 -1
- package/dist/assets/ru-Bfcy52OT.js +13 -0
- package/dist/assets/{sankeyDiagram-UM26HJRW-DNaUxJ0h.js → sankeyDiagram-UM26HJRW-D1n5IJ1M.js} +1 -1
- package/dist/assets/{sequenceDiagram-ZO4K6R2Y-mS8Nj2S_.js → sequenceDiagram-ZO4K6R2Y-Cn7_MLcn.js} +1 -1
- package/dist/assets/{sizeCapture-INFHLROL-CHzKGYk8.js → sizeCapture-INFHLROL-BCwe4Nln.js} +1 -1
- package/dist/assets/{stateDiagram-v2-TBUQTH76-Cze2_YJZ.js → stateDiagram-v2-TBUQTH76-Dpy7t5Eb.js} +1 -1
- package/dist/assets/{styles-BffiNBq-.js → styles-Df9bbQa1.js} +2 -2
- package/dist/assets/{swimlanes-N4OXWK64-Dfgizi06.js → swimlanes-N4OXWK64-CAY2xzWw.js} +1 -1
- package/dist/assets/swimlanesDiagram-K3J5GTZL-25FmnC_u.js +8 -0
- package/dist/assets/{team-share-Q_ti9wrd.js → team-share-B5XghBFg.js} +1 -1
- package/dist/assets/{timeline-definition-YOQAKGHF-CqmzLdGf.js → timeline-definition-YOQAKGHF-ClPw93T0.js} +1 -1
- package/dist/assets/tr-3Jw0E4fc.js +6 -0
- package/dist/assets/uk-B_Q6nXm0.js +1 -0
- package/dist/assets/{usecaseDiagram-VIAY4XPW-aHdQHg-z.js → usecaseDiagram-VIAY4XPW-Bodg7BA2.js} +1 -1
- package/dist/assets/{vennDiagram-BLWOH2XV-DlOR-xvJ.js → vennDiagram-BLWOH2XV-jHU0_O9m.js} +1 -1
- package/dist/assets/vi-VlbIiohE.js +6 -0
- package/dist/assets/{wardleyDiagram-YMQ3BMBF-gZWjmqvm.js → wardleyDiagram-YMQ3BMBF-Bqb5Ov5q.js} +1 -1
- package/dist/assets/{xychartDiagram-TAQBALBS-Tbo6-Ug-.js → xychartDiagram-TAQBALBS-cNVR4g0S.js} +1 -1
- package/dist/assets/zh-BwjuB8Xo.js +13 -0
- package/dist/assets/zh-tw-CWDGum-b.js +15 -0
- package/dist/index.html +2 -2
- package/dist/rail.html +4 -4
- package/dist-server/index.js +699 -719
- package/dist-server/openmausbot.js +548 -558
- package/dist-server/package.json +1 -1
- package/dist-server/pair-cli.js +61 -61
- package/dist-server/server/custom-domain.js +1 -1
- package/dist-server/server/index.js +2 -2
- package/dist-server/server/limix-report-config.js +1 -0
- package/dist-server/server/limix-report-mail.js +59 -0
- package/dist-server/server/skill-fetch.js +1 -1
- package/dist-server/server/wait-probes.js +1 -1
- package/dist-server/server/workspace-backup-http.js +2 -2
- package/package.json +1 -1
- package/dist/assets/channel-CH0X_KTA.js +0 -1
- package/dist/assets/de-BC0Kxj9f.js +0 -8
- package/dist/assets/es-A3rM0HzK.js +0 -6
- package/dist/assets/fr-DRDEDuSU.js +0 -8
- package/dist/assets/hi-Bar1etD1.js +0 -1
- package/dist/assets/it-CaaGmE6C.js +0 -13
- package/dist/assets/ja-C8goxgXK.js +0 -13
- package/dist/assets/ko-ClPjw23W.js +0 -13
- package/dist/assets/pl-BZRlEjRG.js +0 -13
- package/dist/assets/pt-br-Pn296bZX.js +0 -15
- package/dist/assets/ru-BjNOFHlt.js +0 -13
- package/dist/assets/swimlanesDiagram-K3J5GTZL-C64tYSDU.js +0 -8
- package/dist/assets/tr-DvCKopMI.js +0 -6
- package/dist/assets/uk-eQInRbS6.js +0 -1
- package/dist/assets/vi-BWcvK_yD.js +0 -6
- package/dist/assets/zh-CIfUJ9rS.js +0 -13
- package/dist/assets/zh-tw-DnyY-W7m.js +0 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as a}from"./App-
|
|
1
|
+
import{n as a}from"./App-B88ABHQh.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,3 +1,3 @@
|
|
|
1
|
-
import{d5 as W,d6 as A,d7 as k,d8 as C,d9 as $,da as q,db as z,dc as U,dd as X}from"./App-
|
|
1
|
+
import{d5 as W,d6 as A,d7 as k,d8 as C,d9 as $,da as q,db as z,dc as U,dd as X}from"./App-B88ABHQh.js";import T from"./katex-HP8lGamR.js";import"./styles-Df9bbQa1.js";import"./index-BiSZ69F2.js";import"./PlacesRail-0dNv7oZB.js";import"./monitor-saVltJVe.js";import"./MenuMotion-vm5ldfak.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
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/App-
|
|
2
|
-
import{t as o,av as Pe,r as i,j as n,S as pe,X as Ie,a as I,aw as Ae,ax as Te,g as $,L as _e,aa as M,N as W,aj as ne,K as Le,h as Oe,ay as Re,p as A,az as $e,b as De,y as Be,z as He,B as Fe,D as ze,E as Ue,aA as Me,aB as We,G as Ge,F as Xe,H as Ve,P as Ke,_ as me}from"./styles-BffiNBq-.js";function Qt(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 Ye(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 Je(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 Ze(){const e=/[#&]code=([^&]+)/.exec(location.hash);return e?(history.replaceState(null,"",location.pathname+location.search),decodeURIComponent(e[1])):null}function Qe(){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 et(){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 tt(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 nt(e,t,r=fetch){return V({code:e,label:xe(),attemptId:t,browser:!0},r)}function en(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 rt(e,t=fetch){return ge("/api/auth/email/start",{email:e},t)}function at(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 ot(){window.ogb?.softwareRendering===!0&&(document.documentElement.dataset.softwareRendering="")}function st({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 nt(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 q="bg-composer ring-1 ring-inset ring-ink/[0.07]",it="bg-composer ring-[0.5px] ring-ink/10",tn=`${it} shadow-(--shadow-float)`,ye="transition-colors duration-[120ms] hover:bg-[color-mix(in_srgb,var(--color-composer),var(--color-ink)_7%)]",lt=`${ye} aria-expanded:bg-[color-mix(in_srgb,var(--color-composer),var(--color-ink)_7%)]`,nn="bg-[color-mix(in_srgb,var(--color-composer),var(--color-ink)_7%)]",rn="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",ct=`${ke} ${q} ${lt} ${J}`,an=`${ke} ${q} ${ye} ${J}`,ut=`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}`,on="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",dt="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 sn({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?ut:ct,children:n.jsx(pe,{size:r?17:18,strokeWidth:1.5,"aria-hidden":"true"})})}function ln({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",q),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 pt(e,{howTo:t=!1,onClosed:r}={}){return e.menu(t?{from:"howto"}:void 0).finally(()=>{t&&r?.()})}function cn(e){Le("cloud_howto",{result:"closed"}),e({type:"cloudHowTo",open:!1})}function oe({text:e}){return n.jsxs("span",{className:"font-normal text-ink-secondary",children:[" · ",e]})}function mt(e){return e?.sleeps===!0?!0:e?.status==="paid"?!1:null}function ft(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(mt(y))}).catch(()=>{}),()=>{l=!1}},[t]),i.useEffect(()=>r?.onState(l=>u(l.waking===!0)),[r]),{sleeps:t?a:null,waking:c}}function ht({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=ft(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),pt(a,{howTo:t,onClosed:r}).catch(()=>f(o("sidebar.switchServerError"))).finally(()=>l(!1)))},switchable:!!a&&s?.home!==!0}}function xt(e){const t=Ae(),r=n.jsx(bt,{...e});return Te(t)?n.jsx("div",{"data-switcher-beside-rail":!0,className:t.beside?"hidden":"contents md:hidden",children:r}):r}function bt({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}=ht({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(dt,"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 gt(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 un=()=>({type:"toggleAppSettings",open:!0,section:"companion",phonePairing:!0});function dn(e){const t=typeof window>"u"?void 0:window.ogb;return yt({companion:!!t?.companion,remoteClient:t?.remoteClient?.active===!0,cloudHome:e})}function yt(e){return e.cloudHome?"cloud":e.companion&&!e.remoteClient?"computer":"server"}const kt={computer:"sidebar.menu.connectPhone.computer",cloud:"sidebar.menu.connectPhone.cloud",server:"sidebar.menu.connectPhone.server"};function pn(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:kt[e]}}function mn(e){return Oe(e).kind!=="paid"||Re(e)?null:e?.status==="connected"&&e.machine?.status==="ready"?"ready":"not-ready"}function fn(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 hn(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:gt(r).pairingCodes}}),se}const wt="data-phone-pairing-action";function xn(e,t=r=>window.requestAnimationFrame(r)){return e?(t(()=>{e.scrollIntoView?.({block:"start"}),(e.querySelector(`[${wt}]:not([disabled])`)??e).focus({preventScroll:!0})}),!0):!1}function bn(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 G(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 vt="23456789ABCDEFGHJKLMNPQRSTUVWXYZ",jt=12,Nt="omb_pair_",St=/^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 Et(e){return we(e).match(/.{1,4}/g)?.join("-")??e}const Ct={emailCode:"serverError.pair.emailCode",oldCode:"serverError.pair.oldCode",scriptKey:"serverError.pair.scriptKey",notACode:"serverError.pair.notACode"};function Pt(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=Pt(t);if(!s)return{kind:"wrong",problem:"notACode"};t=s.trim()}if(t.startsWith("omb_sess_"))return{kind:"wrong",problem:"scriptKey"};if(t.startsWith(Nt))return St.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!==jt||[...a].some(s=>!vt.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 It(e,t=typeof window<"u"&&!!window.ogb?.workspaces){return!!e&&t}function At({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 Tt(e){const t=Z(e);return t.kind==="wrong"&&t.problem!=="notACode"?o(Ct[t.problem]):null}function _t(e){const t=Z(e).kind;return t==="code"||t==="credential"}function Lt(e,t){const r=Z(t),a=r.kind==="code"?`&code=${encodeURIComponent(Et(r.code))}`:"";return`openmausbot://pair?address=${encodeURIComponent(e)}${a}`}function Ot(e){return e.protocol==="http:"&&!$e(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 Rt(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 $t({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),[z,je]=i.useState(()=>It(e));i.useEffect(()=>{if(!z||!e)return;let m=!0;return V({code:e,label:c,attemptId:g}).then(N=>{if(m){if(N.ok){location.replace(G(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 U=Je(f),Ne=l?.capabilities.emailSignIn===!0,_=l?.capabilities.cloudHome===!0,Se=!_&&l?.capabilities.cloudTeam!==!0,ee=Tt(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(G(location.search));return}p(N.error)}async function Ce(m){m.preventDefault(),x(!0),p(null);const N=h?await at({email:w,code:E,label:c}):await rt(w);if(x(!1),!N.ok){p(N.error);return}if(h){location.replace(G(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(xt,{})}),n.jsxs("div",{className:"w-full max-w-[420px]",children:[R&&Ot(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,z?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:Rt(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})} `:"",At({mode:j,sent:h,email:w,cloudHome:_})]}),ae(r)&&!U?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,!U&&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]}),z?null:U?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||!_t(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:Lt(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 gn="cloud-welcome-done",Dt="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 Bt({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 Ht={stopped:"cloudHome.stopped","payment-problem":"cloudHome.paymentProblem",failed:"cloudHome.failed"},ue={host:"cloudHome.unreachableHost",no_answer:"cloudHome.unreachable"};function Ft(e,t=Date.now()){const r=new Date(e).getFullYear()!==new Date(t).getFullYear();return new Intl.DateTimeFormat(De(),{day:"numeric",month:"long",...r?{year:"numeric"}:{}}).format(new Date(e))}function zt(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(Ht[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:Ft(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 Mt({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 Wt({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=zt(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(Bt,{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(Mt,{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 Gt({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,X=null;const Y=new Set;function yn(){K||X||(X=F().then(e=>{if(e.kind==="unauthenticated"){K=!0;try{sessionStorage.setItem(Q,"1")}catch{}for(const t of Y)t()}}).finally(()=>{X=null}))}function de(){return K}function kn(){return i.useSyncExternalStore(e=>(Y.add(e),()=>Y.delete(e)),de,de)}function Xt(){try{return sessionStorage.getItem(Q)==="1"}catch{return!1}}function Vt(){try{sessionStorage.removeItem(Q)}catch{}}Be();He(Fe());ze(Ue());ot();Me(We());const B=Ge(),Kt=new Set(["/home","/pair","/desktop-viewer"]),ve=()=>me(()=>import("./App-5ImTEsbf.js").then(e=>e.jJ),__vite__mapDeps([0,1,2,3,4,5])).catch(e=>({default:()=>{throw e}})),Yt=Kt.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 Jt(){const e=window.ogb?.home;if(location.pathname==="/home"&&e)return n.jsx(Wt,{bridge:e,manage:window.ogb?.cloudPlan?.manage});if(location.pathname==="/pair"){const a=Qe();if(a){const s=await tt(a);return await B,s?n.jsx(st,{credential:a,owner:s.owner,team:s.team}):n.jsx(D,{initialCode:null,reason:o("pair.browser.signInFailed")})}return n.jsx(D,{initialCode:Ze(),initialEmail:et()})}const t=await F();if(t.kind==="unauthenticated"){if(await B,t.error===Dt)return n.jsx($t,{team:await qt()});const a=n.jsx(D,{initialCode:null,reason:Xt()?o("pair.sessionEnded"):t.error});return e?n.jsx(Gt,{bridge:e,fallback:a}):a}if(Vt(),t.kind==="session"&&Ye(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-Dc_O38Q5.js");return{DesktopViewer:s}},__vite__mapDeps([6,1,2,7,8,5,4,9]));return n.jsx(a,{})}const{default:r}=await(Yt??ve());return n.jsx(r,{})}document.title=A();Promise.all([Xe(),Jt(),B]).then(([,e])=>{Ve.createRoot(document.getElementById("root")).render(n.jsx(i.StrictMode,{children:n.jsx(Ke,{children:e})}))});export{kn as A,D as B,Bt as C,xt as D,tn as E,bn as F,on as P,ct as S,gt as a,xn as b,dn as c,lt as d,q as e,fn as f,Qt as g,pn as h,he as i,mn as j,cn as k,hn as l,an as m,yn as n,pt as o,un as p,en as q,F as r,rn as s,ut as t,ht as u,sn as v,ln as w,it as x,nn as y,gn as z};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/App-B88ABHQh.js","assets/styles-Df9bbQa1.js","assets/styles-D8FmJr6X.css","assets/PlacesRail-0dNv7oZB.js","assets/monitor-saVltJVe.js","assets/MenuMotion-vm5ldfak.js","assets/DesktopViewer-D_Tc0DtD.js","assets/desktop-connection-Dfaq6k5a.js","assets/desktop-viewer-CF-OpSo0.js","assets/minimize-DxmLA74X.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as o,av as Pe,r as i,j as n,S as pe,X as Ie,a as I,aw as Ae,ax as Te,g as $,L as _e,aa as M,N as W,aj as ne,K as Le,h as Oe,ay as Re,p as A,az as $e,b as De,y as Be,z as He,B as Fe,D as ze,E as Ue,aA as Me,aB as We,G as Ge,F as Xe,H as Ve,P as Ke,_ as me}from"./styles-Df9bbQa1.js";function Qt(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 Ye(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 Je(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 Ze(){const e=/[#&]code=([^&]+)/.exec(location.hash);return e?(history.replaceState(null,"",location.pathname+location.search),decodeURIComponent(e[1])):null}function Qe(){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 et(){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 tt(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 nt(e,t,r=fetch){return V({code:e,label:xe(),attemptId:t,browser:!0},r)}function en(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 rt(e,t=fetch){return ge("/api/auth/email/start",{email:e},t)}function at(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 ot(){window.ogb?.softwareRendering===!0&&(document.documentElement.dataset.softwareRendering="")}function st({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 nt(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 q="bg-composer ring-1 ring-inset ring-ink/[0.07]",it="bg-composer ring-[0.5px] ring-ink/10",tn=`${it} shadow-(--shadow-float)`,ye="transition-colors duration-[120ms] hover:bg-[color-mix(in_srgb,var(--color-composer),var(--color-ink)_7%)]",lt=`${ye} aria-expanded:bg-[color-mix(in_srgb,var(--color-composer),var(--color-ink)_7%)]`,nn="bg-[color-mix(in_srgb,var(--color-composer),var(--color-ink)_7%)]",rn="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",ct=`${ke} ${q} ${lt} ${J}`,an=`${ke} ${q} ${ye} ${J}`,ut=`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}`,on="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",dt="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 sn({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?ut:ct,children:n.jsx(pe,{size:r?17:18,strokeWidth:1.5,"aria-hidden":"true"})})}function ln({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",q),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 pt(e,{howTo:t=!1,onClosed:r}={}){return e.menu(t?{from:"howto"}:void 0).finally(()=>{t&&r?.()})}function cn(e){Le("cloud_howto",{result:"closed"}),e({type:"cloudHowTo",open:!1})}function oe({text:e}){return n.jsxs("span",{className:"font-normal text-ink-secondary",children:[" · ",e]})}function mt(e){return e?.sleeps===!0?!0:e?.status==="paid"?!1:null}function ft(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(mt(y))}).catch(()=>{}),()=>{l=!1}},[t]),i.useEffect(()=>r?.onState(l=>u(l.waking===!0)),[r]),{sleeps:t?a:null,waking:c}}function ht({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=ft(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),pt(a,{howTo:t,onClosed:r}).catch(()=>f(o("sidebar.switchServerError"))).finally(()=>l(!1)))},switchable:!!a&&s?.home!==!0}}function xt(e){const t=Ae(),r=n.jsx(bt,{...e});return Te(t)?n.jsx("div",{"data-switcher-beside-rail":!0,className:t.beside?"hidden":"contents md:hidden",children:r}):r}function bt({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}=ht({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(dt,"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 gt(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 un=()=>({type:"toggleAppSettings",open:!0,section:"companion",phonePairing:!0});function dn(e){const t=typeof window>"u"?void 0:window.ogb;return yt({companion:!!t?.companion,remoteClient:t?.remoteClient?.active===!0,cloudHome:e})}function yt(e){return e.cloudHome?"cloud":e.companion&&!e.remoteClient?"computer":"server"}const kt={computer:"sidebar.menu.connectPhone.computer",cloud:"sidebar.menu.connectPhone.cloud",server:"sidebar.menu.connectPhone.server"};function pn(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:kt[e]}}function mn(e){return Oe(e).kind!=="paid"||Re(e)?null:e?.status==="connected"&&e.machine?.status==="ready"?"ready":"not-ready"}function fn(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 hn(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:gt(r).pairingCodes}}),se}const wt="data-phone-pairing-action";function xn(e,t=r=>window.requestAnimationFrame(r)){return e?(t(()=>{e.scrollIntoView?.({block:"start"}),(e.querySelector(`[${wt}]:not([disabled])`)??e).focus({preventScroll:!0})}),!0):!1}function bn(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 G(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 vt="23456789ABCDEFGHJKLMNPQRSTUVWXYZ",jt=12,Nt="omb_pair_",St=/^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 Et(e){return we(e).match(/.{1,4}/g)?.join("-")??e}const Ct={emailCode:"serverError.pair.emailCode",oldCode:"serverError.pair.oldCode",scriptKey:"serverError.pair.scriptKey",notACode:"serverError.pair.notACode"};function Pt(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=Pt(t);if(!s)return{kind:"wrong",problem:"notACode"};t=s.trim()}if(t.startsWith("omb_sess_"))return{kind:"wrong",problem:"scriptKey"};if(t.startsWith(Nt))return St.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!==jt||[...a].some(s=>!vt.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 It(e,t=typeof window<"u"&&!!window.ogb?.workspaces){return!!e&&t}function At({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 Tt(e){const t=Z(e);return t.kind==="wrong"&&t.problem!=="notACode"?o(Ct[t.problem]):null}function _t(e){const t=Z(e).kind;return t==="code"||t==="credential"}function Lt(e,t){const r=Z(t),a=r.kind==="code"?`&code=${encodeURIComponent(Et(r.code))}`:"";return`openmausbot://pair?address=${encodeURIComponent(e)}${a}`}function Ot(e){return e.protocol==="http:"&&!$e(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 Rt(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 $t({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),[z,je]=i.useState(()=>It(e));i.useEffect(()=>{if(!z||!e)return;let m=!0;return V({code:e,label:c,attemptId:g}).then(N=>{if(m){if(N.ok){location.replace(G(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 U=Je(f),Ne=l?.capabilities.emailSignIn===!0,_=l?.capabilities.cloudHome===!0,Se=!_&&l?.capabilities.cloudTeam!==!0,ee=Tt(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(G(location.search));return}p(N.error)}async function Ce(m){m.preventDefault(),x(!0),p(null);const N=h?await at({email:w,code:E,label:c}):await rt(w);if(x(!1),!N.ok){p(N.error);return}if(h){location.replace(G(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(xt,{})}),n.jsxs("div",{className:"w-full max-w-[420px]",children:[R&&Ot(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,z?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:Rt(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})} `:"",At({mode:j,sent:h,email:w,cloudHome:_})]}),ae(r)&&!U?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,!U&&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]}),z?null:U?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||!_t(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:Lt(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 gn="cloud-welcome-done",Dt="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 Bt({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 Ht={stopped:"cloudHome.stopped","payment-problem":"cloudHome.paymentProblem",failed:"cloudHome.failed"},ue={host:"cloudHome.unreachableHost",no_answer:"cloudHome.unreachable"};function Ft(e,t=Date.now()){const r=new Date(e).getFullYear()!==new Date(t).getFullYear();return new Intl.DateTimeFormat(De(),{day:"numeric",month:"long",...r?{year:"numeric"}:{}}).format(new Date(e))}function zt(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(Ht[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:Ft(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 Mt({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 Wt({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=zt(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(Bt,{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(Mt,{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 Gt({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,X=null;const Y=new Set;function yn(){K||X||(X=F().then(e=>{if(e.kind==="unauthenticated"){K=!0;try{sessionStorage.setItem(Q,"1")}catch{}for(const t of Y)t()}}).finally(()=>{X=null}))}function de(){return K}function kn(){return i.useSyncExternalStore(e=>(Y.add(e),()=>Y.delete(e)),de,de)}function Xt(){try{return sessionStorage.getItem(Q)==="1"}catch{return!1}}function Vt(){try{sessionStorage.removeItem(Q)}catch{}}Be();He(Fe());ze(Ue());ot();Me(We());const B=Ge(),Kt=new Set(["/home","/pair","/desktop-viewer"]),ve=()=>me(()=>import("./App-B88ABHQh.js").then(e=>e.jJ),__vite__mapDeps([0,1,2,3,4,5])).catch(e=>({default:()=>{throw e}})),Yt=Kt.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 Jt(){const e=window.ogb?.home;if(location.pathname==="/home"&&e)return n.jsx(Wt,{bridge:e,manage:window.ogb?.cloudPlan?.manage});if(location.pathname==="/pair"){const a=Qe();if(a){const s=await tt(a);return await B,s?n.jsx(st,{credential:a,owner:s.owner,team:s.team}):n.jsx(D,{initialCode:null,reason:o("pair.browser.signInFailed")})}return n.jsx(D,{initialCode:Ze(),initialEmail:et()})}const t=await F();if(t.kind==="unauthenticated"){if(await B,t.error===Dt)return n.jsx($t,{team:await qt()});const a=n.jsx(D,{initialCode:null,reason:Xt()?o("pair.sessionEnded"):t.error});return e?n.jsx(Gt,{bridge:e,fallback:a}):a}if(Vt(),t.kind==="session"&&Ye(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-D_Tc0DtD.js");return{DesktopViewer:s}},__vite__mapDeps([6,1,2,7,8,5,4,9]));return n.jsx(a,{})}const{default:r}=await(Yt??ve());return n.jsx(r,{})}document.title=A();Promise.all([Xe(),Jt(),B]).then(([,e])=>{Ve.createRoot(document.getElementById("root")).render(n.jsx(i.StrictMode,{children:n.jsx(Ke,{children:e})}))});export{kn as A,D as B,Bt as C,xt as D,tn as E,bn as F,on as P,ct as S,gt as a,xn as b,dn as c,lt as d,q as e,fn as f,Qt as g,pn as h,he as i,mn as j,cn as k,hn as l,an as m,yn as n,pt as o,un as p,en as q,F as r,rn as s,ut as t,ht as u,sn as v,ln as w,it as x,nn as y,gn as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{R}from"./styles-BffiNBq-.js";var le=Object.defineProperty,D=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable,Y=(u,l,s)=>l in u?le(u,l,{enumerable:!0,configurable:!0,writable:!0,value:s}):u[l]=s,z=(u,l)=>{for(var s in l||(l={}))V.call(l,s)&&Y(u,s,l[s]);if(D)for(var s of D(l))x.call(l,s)&&Y(u,s,l[s]);return u},U=(u,l)=>{var s={};for(var c in u)V.call(u,c)&&l.indexOf(c)<0&&(s[c]=u[c]);if(u!=null&&D)for(var c of D(u))l.indexOf(c)<0&&x.call(u,c)&&(s[c]=u[c]);return s};var S;(u=>{const l=class g{constructor(e,n,t,r){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<g.MIN_VERSION||e>g.MAX_VERSION)throw new RangeError("Version value out of range");if(r<-1||r>7)throw new RangeError("Mask value out of range");this.size=e*4+17;let o=[];for(let i=0;i<this.size;i++)o.push(!1);for(let i=0;i<this.size;i++)this.modules.push(o.slice()),this.isFunction.push(o.slice());this.drawFunctionPatterns();const a=this.addEccAndInterleave(t);if(this.drawCodewords(a),r==-1){let i=1e9;for(let m=0;m<8;m++){this.applyMask(m),this.drawFormatBits(m);const h=this.getPenaltyScore();h<i&&(r=m,i=h),this.applyMask(m)}}E(0<=r&&r<=7),this.mask=r,this.applyMask(r),this.drawFormatBits(r),this.isFunction=[]}static encodeText(e,n){const t=u.QrSegment.makeSegments(e);return g.encodeSegments(t,n)}static encodeBinary(e,n){const t=u.QrSegment.makeBytes(e);return g.encodeSegments([t],n)}static encodeSegments(e,n,t=1,r=40,o=-1,a=!0){if(!(g.MIN_VERSION<=t&&t<=r&&r<=g.MAX_VERSION)||o<-1||o>7)throw new RangeError("Invalid value");let i,m;for(i=t;;i++){const d=g.getNumDataCodewords(i,n)*8,w=A.getTotalBits(e,i);if(w<=d){m=w;break}if(i>=r)throw new RangeError("Data too long")}for(const d of[g.Ecc.MEDIUM,g.Ecc.QUARTILE,g.Ecc.HIGH])a&&m<=g.getNumDataCodewords(i,d)*8&&(n=d);let h=[];for(const d of e){s(d.mode.modeBits,4,h),s(d.numChars,d.mode.numCharCountBits(i),h);for(const w of d.getData())h.push(w)}E(h.length==m);const P=g.getNumDataCodewords(i,n)*8;E(h.length<=P),s(0,Math.min(4,P-h.length),h),s(0,(8-h.length%8)%8,h),E(h.length%8==0);for(let d=236;h.length<P;d^=253)s(d,8,h);let p=[];for(;p.length*8<h.length;)p.push(0);return h.forEach((d,w)=>p[w>>>3]|=d<<7-(w&7)),new g(i,n,p,o)}getModule(e,n){return 0<=e&&e<this.size&&0<=n&&n<this.size&&this.modules[n][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let t=0;t<this.size;t++)this.setFunctionModule(6,t,t%2==0),this.setFunctionModule(t,6,t%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),n=e.length;for(let t=0;t<n;t++)for(let r=0;r<n;r++)t==0&&r==0||t==0&&r==n-1||t==n-1&&r==0||this.drawAlignmentPattern(e[t],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const n=this.errorCorrectionLevel.formatBits<<3|e;let t=n;for(let o=0;o<10;o++)t=t<<1^(t>>>9)*1335;const r=(n<<10|t)^21522;E(r>>>15==0);for(let o=0;o<=5;o++)this.setFunctionModule(8,o,c(r,o));this.setFunctionModule(8,7,c(r,6)),this.setFunctionModule(8,8,c(r,7)),this.setFunctionModule(7,8,c(r,8));for(let o=9;o<15;o++)this.setFunctionModule(14-o,8,c(r,o));for(let o=0;o<8;o++)this.setFunctionModule(this.size-1-o,8,c(r,o));for(let o=8;o<15;o++)this.setFunctionModule(8,this.size-15+o,c(r,o));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;const n=this.version<<12|e;E(n>>>18==0);for(let t=0;t<18;t++){const r=c(n,t),o=this.size-11+t%3,a=Math.floor(t/3);this.setFunctionModule(o,a,r),this.setFunctionModule(a,o,r)}}drawFinderPattern(e,n){for(let t=-4;t<=4;t++)for(let r=-4;r<=4;r++){const o=Math.max(Math.abs(r),Math.abs(t)),a=e+r,i=n+t;0<=a&&a<this.size&&0<=i&&i<this.size&&this.setFunctionModule(a,i,o!=2&&o!=4)}}drawAlignmentPattern(e,n){for(let t=-2;t<=2;t++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,n+t,Math.max(Math.abs(r),Math.abs(t))!=1)}setFunctionModule(e,n,t){this.modules[n][e]=t,this.isFunction[n][e]=!0}addEccAndInterleave(e){const n=this.version,t=this.errorCorrectionLevel;if(e.length!=g.getNumDataCodewords(n,t))throw new RangeError("Invalid argument");const r=g.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][n],o=g.ECC_CODEWORDS_PER_BLOCK[t.ordinal][n],a=Math.floor(g.getNumRawDataModules(n)/8),i=r-a%r,m=Math.floor(a/r);let h=[];const P=g.reedSolomonComputeDivisor(o);for(let d=0,w=0;d<r;d++){let N=e.slice(w,w+m-o+(d<i?0:1));w+=N.length;const F=g.reedSolomonComputeRemainder(N,P);d<i&&N.push(0),h.push(N.concat(F))}let p=[];for(let d=0;d<h[0].length;d++)h.forEach((w,N)=>{(d!=m-o||N>=i)&&p.push(w[d])});return E(p.length==a),p}drawCodewords(e){if(e.length!=Math.floor(g.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let t=this.size-1;t>=1;t-=2){t==6&&(t=5);for(let r=0;r<this.size;r++)for(let o=0;o<2;o++){const a=t-o,m=(t+1&2)==0?this.size-1-r:r;!this.isFunction[m][a]&&n<e.length*8&&(this.modules[m][a]=c(e[n>>>3],7-(n&7)),n++)}}E(n==e.length*8)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let n=0;n<this.size;n++)for(let t=0;t<this.size;t++){let r;switch(e){case 0:r=(t+n)%2==0;break;case 1:r=n%2==0;break;case 2:r=t%3==0;break;case 3:r=(t+n)%3==0;break;case 4:r=(Math.floor(t/3)+Math.floor(n/2))%2==0;break;case 5:r=t*n%2+t*n%3==0;break;case 6:r=(t*n%2+t*n%3)%2==0;break;case 7:r=((t+n)%2+t*n%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[n][t]&&r&&(this.modules[n][t]=!this.modules[n][t])}}getPenaltyScore(){let e=0;for(let o=0;o<this.size;o++){let a=!1,i=0,m=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[o][h]==a?(i++,i==5?e+=g.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,m),a||(e+=this.finderPenaltyCountPatterns(m)*g.PENALTY_N3),a=this.modules[o][h],i=1);e+=this.finderPenaltyTerminateAndCount(a,i,m)*g.PENALTY_N3}for(let o=0;o<this.size;o++){let a=!1,i=0,m=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[h][o]==a?(i++,i==5?e+=g.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,m),a||(e+=this.finderPenaltyCountPatterns(m)*g.PENALTY_N3),a=this.modules[h][o],i=1);e+=this.finderPenaltyTerminateAndCount(a,i,m)*g.PENALTY_N3}for(let o=0;o<this.size-1;o++)for(let a=0;a<this.size-1;a++){const i=this.modules[o][a];i==this.modules[o][a+1]&&i==this.modules[o+1][a]&&i==this.modules[o+1][a+1]&&(e+=g.PENALTY_N2)}let n=0;for(const o of this.modules)n=o.reduce((a,i)=>a+(i?1:0),n);const t=this.size*this.size,r=Math.ceil(Math.abs(n*20-t*10)/t)-1;return E(0<=r&&r<=9),e+=r*g.PENALTY_N4,E(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(this.version==1)return[];{const e=Math.floor(this.version/7)+2,n=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2;let t=[6];for(let r=this.size-7;t.length<e;r-=n)t.splice(1,0,r);return t}}static getNumRawDataModules(e){if(e<g.MIN_VERSION||e>g.MAX_VERSION)throw new RangeError("Version number out of range");let n=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return E(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(g.getNumRawDataModules(e)/8)-g.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*g.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let n=[];for(let r=0;r<e-1;r++)n.push(0);n.push(1);let t=1;for(let r=0;r<e;r++){for(let o=0;o<n.length;o++)n[o]=g.reedSolomonMultiply(n[o],t),o+1<n.length&&(n[o]^=n[o+1]);t=g.reedSolomonMultiply(t,2)}return n}static reedSolomonComputeRemainder(e,n){let t=n.map(r=>0);for(const r of e){const o=r^t.shift();t.push(0),n.forEach((a,i)=>t[i]^=g.reedSolomonMultiply(a,o))}return t}static reedSolomonMultiply(e,n){if(e>>>8||n>>>8)throw new RangeError("Byte out of range");let t=0;for(let r=7;r>=0;r--)t=t<<1^(t>>>7)*285,t^=(n>>>r&1)*e;return E(t>>>8==0),t}finderPenaltyCountPatterns(e){const n=e[1];E(n<=this.size*3);const t=n>0&&e[2]==n&&e[3]==n*3&&e[4]==n&&e[5]==n;return(t&&e[0]>=n*4&&e[6]>=n?1:0)+(t&&e[6]>=n*4&&e[0]>=n?1:0)}finderPenaltyTerminateAndCount(e,n,t){return e&&(this.finderPenaltyAddHistory(n,t),n=0),n+=this.size,this.finderPenaltyAddHistory(n,t),this.finderPenaltyCountPatterns(t)}finderPenaltyAddHistory(e,n){n[0]==0&&(e+=this.size),n.pop(),n.unshift(e)}};l.MIN_VERSION=1,l.MAX_VERSION=40,l.PENALTY_N1=3,l.PENALTY_N2=3,l.PENALTY_N3=40,l.PENALTY_N4=10,l.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],l.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],u.QrCode=l;function s(C,e,n){if(e<0||e>31||C>>>e)throw new RangeError("Value out of range");for(let t=e-1;t>=0;t--)n.push(C>>>t&1)}function c(C,e){return(C>>>e&1)!=0}function E(C){if(!C)throw new Error("Assertion error")}const f=class M{constructor(e,n,t){if(this.mode=e,this.numChars=n,this.bitData=t,n<0)throw new RangeError("Invalid argument");this.bitData=t.slice()}static makeBytes(e){let n=[];for(const t of e)s(t,8,n);return new M(M.Mode.BYTE,e.length,n)}static makeNumeric(e){if(!M.isNumeric(e))throw new RangeError("String contains non-numeric characters");let n=[];for(let t=0;t<e.length;){const r=Math.min(e.length-t,3);s(parseInt(e.substring(t,t+r),10),r*3+1,n),t+=r}return new M(M.Mode.NUMERIC,e.length,n)}static makeAlphanumeric(e){if(!M.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let n=[],t;for(t=0;t+2<=e.length;t+=2){let r=M.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t))*45;r+=M.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t+1)),s(r,11,n)}return t<e.length&&s(M.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)),6,n),new M(M.Mode.ALPHANUMERIC,e.length,n)}static makeSegments(e){return e==""?[]:M.isNumeric(e)?[M.makeNumeric(e)]:M.isAlphanumeric(e)?[M.makeAlphanumeric(e)]:[M.makeBytes(M.toUtf8ByteArray(e))]}static makeEci(e){let n=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)s(e,8,n);else if(e<16384)s(2,2,n),s(e,14,n);else if(e<1e6)s(6,3,n),s(e,21,n);else throw new RangeError("ECI assignment value out of range");return new M(M.Mode.ECI,0,n)}static isNumeric(e){return M.NUMERIC_REGEX.test(e)}static isAlphanumeric(e){return M.ALPHANUMERIC_REGEX.test(e)}getData(){return this.bitData.slice()}static getTotalBits(e,n){let t=0;for(const r of e){const o=r.mode.numCharCountBits(n);if(r.numChars>=1<<o)return 1/0;t+=4+o+r.bitData.length}return t}static toUtf8ByteArray(e){e=encodeURI(e);let n=[];for(let t=0;t<e.length;t++)e.charAt(t)!="%"?n.push(e.charCodeAt(t)):(n.push(parseInt(e.substring(t+1,t+3),16)),t+=2);return n}};f.NUMERIC_REGEX=/^[0-9]*$/,f.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,f.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let A=f;u.QrSegment=f})(S||(S={}));(u=>{(l=>{const s=class{constructor(E,f){this.ordinal=E,this.formatBits=f}};s.LOW=new s(0,1),s.MEDIUM=new s(1,0),s.QUARTILE=new s(2,3),s.HIGH=new s(3,2),l.Ecc=s})(u.QrCode||(u.QrCode={}))})(S||(S={}));(u=>{(l=>{const s=class{constructor(E,f){this.modeBits=E,this.numBitsCharCount=f}numCharCountBits(E){return this.numBitsCharCount[Math.floor((E+7)/17)]}};s.NUMERIC=new s(1,[10,12,14]),s.ALPHANUMERIC=new s(2,[9,11,13]),s.BYTE=new s(4,[8,16,16]),s.KANJI=new s(8,[8,10,12]),s.ECI=new s(7,[0,0,0]),l.Mode=s})(u.QrSegment||(u.QrSegment={}))})(S||(S={}));var O=S;var ae={L:O.QrCode.Ecc.LOW,M:O.QrCode.Ecc.MEDIUM,Q:O.QrCode.Ecc.QUARTILE,H:O.QrCode.Ecc.HIGH},X=128,K="L",W="#FFFFFF",j="#000000",Z=!1,J=1,ce=4,ue=0,he=.1;function q(u,l=0){const s=[];return u.forEach(function(c,E){let f=null;c.forEach(function(A,C){if(!A&&f!==null){s.push(`M${f+l} ${E+l}h${C-f}v1H${f+l}z`),f=null;return}if(C===c.length-1){if(!A)return;f===null?s.push(`M${C+l},${E+l} h1v1H${C+l}z`):s.push(`M${f+l},${E+l} h${C+1-f}v1H${f+l}z`);return}A&&f===null&&(f=C)})}),s.join("")}function ee(u,l){return u.slice().map((s,c)=>c<l.y||c>=l.y+l.h?s:s.map((E,f)=>f<l.x||f>=l.x+l.w?E:!1))}function fe(u,l,s,c){if(c==null)return null;const E=u.length+s*2,f=Math.floor(l*he),A=E/l,C=(c.width||f)*A,e=(c.height||f)*A,n=c.x==null?u.length/2-C/2:c.x*A,t=c.y==null?u.length/2-e/2:c.y*A,r=c.opacity==null?1:c.opacity;let o=null;if(c.excavate){let i=Math.floor(n),m=Math.floor(t),h=Math.ceil(C+n-i),P=Math.ceil(e+t-m);o={x:i,y:m,w:h,h:P}}const a=c.crossOrigin;return{x:n,y:t,h:e,w:C,excavation:o,opacity:r,crossOrigin:a}}function de(u,l){return l!=null?Math.max(Math.floor(l),0):u?ce:ue}function te({value:u,level:l,minVersion:s,includeMargin:c,marginSize:E,imageSettings:f,size:A,boostLevel:C}){let e=R.useMemo(()=>{const i=(Array.isArray(u)?u:[u]).reduce((m,h)=>(m.push(...O.QrSegment.makeSegments(h)),m),[]);return O.QrCode.encodeSegments(i,ae[l],s,void 0,void 0,C)},[u,l,s,C]);const{cells:n,margin:t,numCells:r,calculatedImageSettings:o}=R.useMemo(()=>{let a=e.getModules();const i=de(c,E),m=a.length+i*2,h=fe(a,A,i,f);return{cells:a,margin:i,numCells:m,calculatedImageSettings:h}},[e,A,f,c,E]);return{qrcode:e,margin:t,cells:n,numCells:r,calculatedImageSettings:o}}var me=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),ge=R.forwardRef(function(l,s){const c=l,{value:E,size:f=X,level:A=K,bgColor:C=W,fgColor:e=j,includeMargin:n=Z,minVersion:t=J,boostLevel:r,marginSize:o,imageSettings:a}=c,m=U(c,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:h}=m,P=U(m,["style"]),p=a?.src,d=R.useRef(null),w=R.useRef(null),N=R.useCallback(y=>{d.current=y,typeof s=="function"?s(y):s&&(s.current=y)},[s]),[F,_]=R.useState(!1),{margin:L,cells:T,numCells:B,calculatedImageSettings:v}=te({value:E,level:A,minVersion:t,boostLevel:r,includeMargin:n,marginSize:o,imageSettings:a,size:f});R.useEffect(()=>{if(d.current!=null){const y=d.current,I=y.getContext("2d");if(!I)return;let k=T;const b=w.current,H=v!=null&&b!==null&&b.complete&&b.naturalHeight!==0&&b.naturalWidth!==0;H&&v.excavation!=null&&(k=ee(T,v.excavation));const $=window.devicePixelRatio||1;y.height=y.width=f*$;const G=f/B*$;I.scale(G,G),I.fillStyle=C,I.fillRect(0,0,B,B),I.fillStyle=e,me?I.fill(new Path2D(q(k,L))):T.forEach(function(re,oe){re.forEach(function(se,ie){se&&I.fillRect(ie+L,oe+L,1,1)})}),v&&(I.globalAlpha=v.opacity),H&&I.drawImage(b,v.x+L,v.y+L,v.w,v.h)}}),R.useEffect(()=>{_(!1)},[p]);const ne=z({height:f,width:f},h);let Q=null;return p!=null&&(Q=R.createElement("img",{src:p,key:p,style:{display:"none"},onLoad:()=>{_(!0)},ref:w,crossOrigin:v?.crossOrigin})),R.createElement(R.Fragment,null,R.createElement("canvas",z({style:ne,height:f,width:f,ref:N,role:"img"},P)),Q)});ge.displayName="QRCodeCanvas";var Ee=R.forwardRef(function(l,s){const c=l,{value:E,size:f=X,level:A=K,bgColor:C=W,fgColor:e=j,includeMargin:n=Z,minVersion:t=J,boostLevel:r,title:o,marginSize:a,imageSettings:i}=c,m=U(c,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:h,cells:P,numCells:p,calculatedImageSettings:d}=te({value:E,level:A,minVersion:t,boostLevel:r,includeMargin:n,marginSize:a,imageSettings:i,size:f});let w=P,N=null;i!=null&&d!=null&&(d.excavation!=null&&(w=ee(P,d.excavation)),N=R.createElement("image",{href:i.src,height:d.h,width:d.w,x:d.x+h,y:d.y+h,preserveAspectRatio:"none",opacity:d.opacity,crossOrigin:d.crossOrigin}));const F=q(w,h);return R.createElement("svg",z({height:f,width:f,viewBox:`0 0 ${p} ${p}`,ref:s,role:"img"},m),!!o&&R.createElement("title",null,o),R.createElement("path",{fill:C,d:`M0,0 h${p}v${p}H0z`,shapeRendering:"crispEdges"}),R.createElement("path",{fill:e,d:F,shapeRendering:"crispEdges"}),N)});Ee.displayName="QRCodeSVG";export{Ee as Q};
|
|
1
|
+
import{R}from"./styles-Df9bbQa1.js";var le=Object.defineProperty,D=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable,Y=(u,l,s)=>l in u?le(u,l,{enumerable:!0,configurable:!0,writable:!0,value:s}):u[l]=s,z=(u,l)=>{for(var s in l||(l={}))V.call(l,s)&&Y(u,s,l[s]);if(D)for(var s of D(l))x.call(l,s)&&Y(u,s,l[s]);return u},U=(u,l)=>{var s={};for(var c in u)V.call(u,c)&&l.indexOf(c)<0&&(s[c]=u[c]);if(u!=null&&D)for(var c of D(u))l.indexOf(c)<0&&x.call(u,c)&&(s[c]=u[c]);return s};var S;(u=>{const l=class g{constructor(e,n,t,r){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<g.MIN_VERSION||e>g.MAX_VERSION)throw new RangeError("Version value out of range");if(r<-1||r>7)throw new RangeError("Mask value out of range");this.size=e*4+17;let o=[];for(let i=0;i<this.size;i++)o.push(!1);for(let i=0;i<this.size;i++)this.modules.push(o.slice()),this.isFunction.push(o.slice());this.drawFunctionPatterns();const a=this.addEccAndInterleave(t);if(this.drawCodewords(a),r==-1){let i=1e9;for(let m=0;m<8;m++){this.applyMask(m),this.drawFormatBits(m);const h=this.getPenaltyScore();h<i&&(r=m,i=h),this.applyMask(m)}}E(0<=r&&r<=7),this.mask=r,this.applyMask(r),this.drawFormatBits(r),this.isFunction=[]}static encodeText(e,n){const t=u.QrSegment.makeSegments(e);return g.encodeSegments(t,n)}static encodeBinary(e,n){const t=u.QrSegment.makeBytes(e);return g.encodeSegments([t],n)}static encodeSegments(e,n,t=1,r=40,o=-1,a=!0){if(!(g.MIN_VERSION<=t&&t<=r&&r<=g.MAX_VERSION)||o<-1||o>7)throw new RangeError("Invalid value");let i,m;for(i=t;;i++){const d=g.getNumDataCodewords(i,n)*8,w=A.getTotalBits(e,i);if(w<=d){m=w;break}if(i>=r)throw new RangeError("Data too long")}for(const d of[g.Ecc.MEDIUM,g.Ecc.QUARTILE,g.Ecc.HIGH])a&&m<=g.getNumDataCodewords(i,d)*8&&(n=d);let h=[];for(const d of e){s(d.mode.modeBits,4,h),s(d.numChars,d.mode.numCharCountBits(i),h);for(const w of d.getData())h.push(w)}E(h.length==m);const P=g.getNumDataCodewords(i,n)*8;E(h.length<=P),s(0,Math.min(4,P-h.length),h),s(0,(8-h.length%8)%8,h),E(h.length%8==0);for(let d=236;h.length<P;d^=253)s(d,8,h);let p=[];for(;p.length*8<h.length;)p.push(0);return h.forEach((d,w)=>p[w>>>3]|=d<<7-(w&7)),new g(i,n,p,o)}getModule(e,n){return 0<=e&&e<this.size&&0<=n&&n<this.size&&this.modules[n][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let t=0;t<this.size;t++)this.setFunctionModule(6,t,t%2==0),this.setFunctionModule(t,6,t%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),n=e.length;for(let t=0;t<n;t++)for(let r=0;r<n;r++)t==0&&r==0||t==0&&r==n-1||t==n-1&&r==0||this.drawAlignmentPattern(e[t],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const n=this.errorCorrectionLevel.formatBits<<3|e;let t=n;for(let o=0;o<10;o++)t=t<<1^(t>>>9)*1335;const r=(n<<10|t)^21522;E(r>>>15==0);for(let o=0;o<=5;o++)this.setFunctionModule(8,o,c(r,o));this.setFunctionModule(8,7,c(r,6)),this.setFunctionModule(8,8,c(r,7)),this.setFunctionModule(7,8,c(r,8));for(let o=9;o<15;o++)this.setFunctionModule(14-o,8,c(r,o));for(let o=0;o<8;o++)this.setFunctionModule(this.size-1-o,8,c(r,o));for(let o=8;o<15;o++)this.setFunctionModule(8,this.size-15+o,c(r,o));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;const n=this.version<<12|e;E(n>>>18==0);for(let t=0;t<18;t++){const r=c(n,t),o=this.size-11+t%3,a=Math.floor(t/3);this.setFunctionModule(o,a,r),this.setFunctionModule(a,o,r)}}drawFinderPattern(e,n){for(let t=-4;t<=4;t++)for(let r=-4;r<=4;r++){const o=Math.max(Math.abs(r),Math.abs(t)),a=e+r,i=n+t;0<=a&&a<this.size&&0<=i&&i<this.size&&this.setFunctionModule(a,i,o!=2&&o!=4)}}drawAlignmentPattern(e,n){for(let t=-2;t<=2;t++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,n+t,Math.max(Math.abs(r),Math.abs(t))!=1)}setFunctionModule(e,n,t){this.modules[n][e]=t,this.isFunction[n][e]=!0}addEccAndInterleave(e){const n=this.version,t=this.errorCorrectionLevel;if(e.length!=g.getNumDataCodewords(n,t))throw new RangeError("Invalid argument");const r=g.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][n],o=g.ECC_CODEWORDS_PER_BLOCK[t.ordinal][n],a=Math.floor(g.getNumRawDataModules(n)/8),i=r-a%r,m=Math.floor(a/r);let h=[];const P=g.reedSolomonComputeDivisor(o);for(let d=0,w=0;d<r;d++){let N=e.slice(w,w+m-o+(d<i?0:1));w+=N.length;const F=g.reedSolomonComputeRemainder(N,P);d<i&&N.push(0),h.push(N.concat(F))}let p=[];for(let d=0;d<h[0].length;d++)h.forEach((w,N)=>{(d!=m-o||N>=i)&&p.push(w[d])});return E(p.length==a),p}drawCodewords(e){if(e.length!=Math.floor(g.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let t=this.size-1;t>=1;t-=2){t==6&&(t=5);for(let r=0;r<this.size;r++)for(let o=0;o<2;o++){const a=t-o,m=(t+1&2)==0?this.size-1-r:r;!this.isFunction[m][a]&&n<e.length*8&&(this.modules[m][a]=c(e[n>>>3],7-(n&7)),n++)}}E(n==e.length*8)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let n=0;n<this.size;n++)for(let t=0;t<this.size;t++){let r;switch(e){case 0:r=(t+n)%2==0;break;case 1:r=n%2==0;break;case 2:r=t%3==0;break;case 3:r=(t+n)%3==0;break;case 4:r=(Math.floor(t/3)+Math.floor(n/2))%2==0;break;case 5:r=t*n%2+t*n%3==0;break;case 6:r=(t*n%2+t*n%3)%2==0;break;case 7:r=((t+n)%2+t*n%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[n][t]&&r&&(this.modules[n][t]=!this.modules[n][t])}}getPenaltyScore(){let e=0;for(let o=0;o<this.size;o++){let a=!1,i=0,m=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[o][h]==a?(i++,i==5?e+=g.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,m),a||(e+=this.finderPenaltyCountPatterns(m)*g.PENALTY_N3),a=this.modules[o][h],i=1);e+=this.finderPenaltyTerminateAndCount(a,i,m)*g.PENALTY_N3}for(let o=0;o<this.size;o++){let a=!1,i=0,m=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[h][o]==a?(i++,i==5?e+=g.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,m),a||(e+=this.finderPenaltyCountPatterns(m)*g.PENALTY_N3),a=this.modules[h][o],i=1);e+=this.finderPenaltyTerminateAndCount(a,i,m)*g.PENALTY_N3}for(let o=0;o<this.size-1;o++)for(let a=0;a<this.size-1;a++){const i=this.modules[o][a];i==this.modules[o][a+1]&&i==this.modules[o+1][a]&&i==this.modules[o+1][a+1]&&(e+=g.PENALTY_N2)}let n=0;for(const o of this.modules)n=o.reduce((a,i)=>a+(i?1:0),n);const t=this.size*this.size,r=Math.ceil(Math.abs(n*20-t*10)/t)-1;return E(0<=r&&r<=9),e+=r*g.PENALTY_N4,E(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(this.version==1)return[];{const e=Math.floor(this.version/7)+2,n=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2;let t=[6];for(let r=this.size-7;t.length<e;r-=n)t.splice(1,0,r);return t}}static getNumRawDataModules(e){if(e<g.MIN_VERSION||e>g.MAX_VERSION)throw new RangeError("Version number out of range");let n=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return E(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(g.getNumRawDataModules(e)/8)-g.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*g.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let n=[];for(let r=0;r<e-1;r++)n.push(0);n.push(1);let t=1;for(let r=0;r<e;r++){for(let o=0;o<n.length;o++)n[o]=g.reedSolomonMultiply(n[o],t),o+1<n.length&&(n[o]^=n[o+1]);t=g.reedSolomonMultiply(t,2)}return n}static reedSolomonComputeRemainder(e,n){let t=n.map(r=>0);for(const r of e){const o=r^t.shift();t.push(0),n.forEach((a,i)=>t[i]^=g.reedSolomonMultiply(a,o))}return t}static reedSolomonMultiply(e,n){if(e>>>8||n>>>8)throw new RangeError("Byte out of range");let t=0;for(let r=7;r>=0;r--)t=t<<1^(t>>>7)*285,t^=(n>>>r&1)*e;return E(t>>>8==0),t}finderPenaltyCountPatterns(e){const n=e[1];E(n<=this.size*3);const t=n>0&&e[2]==n&&e[3]==n*3&&e[4]==n&&e[5]==n;return(t&&e[0]>=n*4&&e[6]>=n?1:0)+(t&&e[6]>=n*4&&e[0]>=n?1:0)}finderPenaltyTerminateAndCount(e,n,t){return e&&(this.finderPenaltyAddHistory(n,t),n=0),n+=this.size,this.finderPenaltyAddHistory(n,t),this.finderPenaltyCountPatterns(t)}finderPenaltyAddHistory(e,n){n[0]==0&&(e+=this.size),n.pop(),n.unshift(e)}};l.MIN_VERSION=1,l.MAX_VERSION=40,l.PENALTY_N1=3,l.PENALTY_N2=3,l.PENALTY_N3=40,l.PENALTY_N4=10,l.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],l.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],u.QrCode=l;function s(C,e,n){if(e<0||e>31||C>>>e)throw new RangeError("Value out of range");for(let t=e-1;t>=0;t--)n.push(C>>>t&1)}function c(C,e){return(C>>>e&1)!=0}function E(C){if(!C)throw new Error("Assertion error")}const f=class M{constructor(e,n,t){if(this.mode=e,this.numChars=n,this.bitData=t,n<0)throw new RangeError("Invalid argument");this.bitData=t.slice()}static makeBytes(e){let n=[];for(const t of e)s(t,8,n);return new M(M.Mode.BYTE,e.length,n)}static makeNumeric(e){if(!M.isNumeric(e))throw new RangeError("String contains non-numeric characters");let n=[];for(let t=0;t<e.length;){const r=Math.min(e.length-t,3);s(parseInt(e.substring(t,t+r),10),r*3+1,n),t+=r}return new M(M.Mode.NUMERIC,e.length,n)}static makeAlphanumeric(e){if(!M.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let n=[],t;for(t=0;t+2<=e.length;t+=2){let r=M.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t))*45;r+=M.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t+1)),s(r,11,n)}return t<e.length&&s(M.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)),6,n),new M(M.Mode.ALPHANUMERIC,e.length,n)}static makeSegments(e){return e==""?[]:M.isNumeric(e)?[M.makeNumeric(e)]:M.isAlphanumeric(e)?[M.makeAlphanumeric(e)]:[M.makeBytes(M.toUtf8ByteArray(e))]}static makeEci(e){let n=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)s(e,8,n);else if(e<16384)s(2,2,n),s(e,14,n);else if(e<1e6)s(6,3,n),s(e,21,n);else throw new RangeError("ECI assignment value out of range");return new M(M.Mode.ECI,0,n)}static isNumeric(e){return M.NUMERIC_REGEX.test(e)}static isAlphanumeric(e){return M.ALPHANUMERIC_REGEX.test(e)}getData(){return this.bitData.slice()}static getTotalBits(e,n){let t=0;for(const r of e){const o=r.mode.numCharCountBits(n);if(r.numChars>=1<<o)return 1/0;t+=4+o+r.bitData.length}return t}static toUtf8ByteArray(e){e=encodeURI(e);let n=[];for(let t=0;t<e.length;t++)e.charAt(t)!="%"?n.push(e.charCodeAt(t)):(n.push(parseInt(e.substring(t+1,t+3),16)),t+=2);return n}};f.NUMERIC_REGEX=/^[0-9]*$/,f.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,f.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let A=f;u.QrSegment=f})(S||(S={}));(u=>{(l=>{const s=class{constructor(E,f){this.ordinal=E,this.formatBits=f}};s.LOW=new s(0,1),s.MEDIUM=new s(1,0),s.QUARTILE=new s(2,3),s.HIGH=new s(3,2),l.Ecc=s})(u.QrCode||(u.QrCode={}))})(S||(S={}));(u=>{(l=>{const s=class{constructor(E,f){this.modeBits=E,this.numBitsCharCount=f}numCharCountBits(E){return this.numBitsCharCount[Math.floor((E+7)/17)]}};s.NUMERIC=new s(1,[10,12,14]),s.ALPHANUMERIC=new s(2,[9,11,13]),s.BYTE=new s(4,[8,16,16]),s.KANJI=new s(8,[8,10,12]),s.ECI=new s(7,[0,0,0]),l.Mode=s})(u.QrSegment||(u.QrSegment={}))})(S||(S={}));var O=S;var ae={L:O.QrCode.Ecc.LOW,M:O.QrCode.Ecc.MEDIUM,Q:O.QrCode.Ecc.QUARTILE,H:O.QrCode.Ecc.HIGH},X=128,K="L",W="#FFFFFF",j="#000000",Z=!1,J=1,ce=4,ue=0,he=.1;function q(u,l=0){const s=[];return u.forEach(function(c,E){let f=null;c.forEach(function(A,C){if(!A&&f!==null){s.push(`M${f+l} ${E+l}h${C-f}v1H${f+l}z`),f=null;return}if(C===c.length-1){if(!A)return;f===null?s.push(`M${C+l},${E+l} h1v1H${C+l}z`):s.push(`M${f+l},${E+l} h${C+1-f}v1H${f+l}z`);return}A&&f===null&&(f=C)})}),s.join("")}function ee(u,l){return u.slice().map((s,c)=>c<l.y||c>=l.y+l.h?s:s.map((E,f)=>f<l.x||f>=l.x+l.w?E:!1))}function fe(u,l,s,c){if(c==null)return null;const E=u.length+s*2,f=Math.floor(l*he),A=E/l,C=(c.width||f)*A,e=(c.height||f)*A,n=c.x==null?u.length/2-C/2:c.x*A,t=c.y==null?u.length/2-e/2:c.y*A,r=c.opacity==null?1:c.opacity;let o=null;if(c.excavate){let i=Math.floor(n),m=Math.floor(t),h=Math.ceil(C+n-i),P=Math.ceil(e+t-m);o={x:i,y:m,w:h,h:P}}const a=c.crossOrigin;return{x:n,y:t,h:e,w:C,excavation:o,opacity:r,crossOrigin:a}}function de(u,l){return l!=null?Math.max(Math.floor(l),0):u?ce:ue}function te({value:u,level:l,minVersion:s,includeMargin:c,marginSize:E,imageSettings:f,size:A,boostLevel:C}){let e=R.useMemo(()=>{const i=(Array.isArray(u)?u:[u]).reduce((m,h)=>(m.push(...O.QrSegment.makeSegments(h)),m),[]);return O.QrCode.encodeSegments(i,ae[l],s,void 0,void 0,C)},[u,l,s,C]);const{cells:n,margin:t,numCells:r,calculatedImageSettings:o}=R.useMemo(()=>{let a=e.getModules();const i=de(c,E),m=a.length+i*2,h=fe(a,A,i,f);return{cells:a,margin:i,numCells:m,calculatedImageSettings:h}},[e,A,f,c,E]);return{qrcode:e,margin:t,cells:n,numCells:r,calculatedImageSettings:o}}var me=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),ge=R.forwardRef(function(l,s){const c=l,{value:E,size:f=X,level:A=K,bgColor:C=W,fgColor:e=j,includeMargin:n=Z,minVersion:t=J,boostLevel:r,marginSize:o,imageSettings:a}=c,m=U(c,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:h}=m,P=U(m,["style"]),p=a?.src,d=R.useRef(null),w=R.useRef(null),N=R.useCallback(y=>{d.current=y,typeof s=="function"?s(y):s&&(s.current=y)},[s]),[F,_]=R.useState(!1),{margin:L,cells:T,numCells:B,calculatedImageSettings:v}=te({value:E,level:A,minVersion:t,boostLevel:r,includeMargin:n,marginSize:o,imageSettings:a,size:f});R.useEffect(()=>{if(d.current!=null){const y=d.current,I=y.getContext("2d");if(!I)return;let k=T;const b=w.current,H=v!=null&&b!==null&&b.complete&&b.naturalHeight!==0&&b.naturalWidth!==0;H&&v.excavation!=null&&(k=ee(T,v.excavation));const $=window.devicePixelRatio||1;y.height=y.width=f*$;const G=f/B*$;I.scale(G,G),I.fillStyle=C,I.fillRect(0,0,B,B),I.fillStyle=e,me?I.fill(new Path2D(q(k,L))):T.forEach(function(re,oe){re.forEach(function(se,ie){se&&I.fillRect(ie+L,oe+L,1,1)})}),v&&(I.globalAlpha=v.opacity),H&&I.drawImage(b,v.x+L,v.y+L,v.w,v.h)}}),R.useEffect(()=>{_(!1)},[p]);const ne=z({height:f,width:f},h);let Q=null;return p!=null&&(Q=R.createElement("img",{src:p,key:p,style:{display:"none"},onLoad:()=>{_(!0)},ref:w,crossOrigin:v?.crossOrigin})),R.createElement(R.Fragment,null,R.createElement("canvas",z({style:ne,height:f,width:f,ref:N,role:"img"},P)),Q)});ge.displayName="QRCodeCanvas";var Ee=R.forwardRef(function(l,s){const c=l,{value:E,size:f=X,level:A=K,bgColor:C=W,fgColor:e=j,includeMargin:n=Z,minVersion:t=J,boostLevel:r,title:o,marginSize:a,imageSettings:i}=c,m=U(c,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:h,cells:P,numCells:p,calculatedImageSettings:d}=te({value:E,level:A,minVersion:t,boostLevel:r,includeMargin:n,marginSize:a,imageSettings:i,size:f});let w=P,N=null;i!=null&&d!=null&&(d.excavation!=null&&(w=ee(P,d.excavation)),N=R.createElement("image",{href:i.src,height:d.h,width:d.w,x:d.x+h,y:d.y+h,preserveAspectRatio:"none",opacity:d.opacity,crossOrigin:d.crossOrigin}));const F=q(w,h);return R.createElement("svg",z({height:f,width:f,viewBox:`0 0 ${p} ${p}`,ref:s,role:"img"},m),!!o&&R.createElement("title",null,o),R.createElement("path",{fill:C,d:`M0,0 h${p}v${p}H0z`,shapeRendering:"crispEdges"}),R.createElement("path",{fill:e,d:F,shapeRendering:"crispEdges"}),N)});Ee.displayName="QRCodeSVG";export{Ee as Q};
|
|
@@ -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-C9748YDA.js";import{p}from"./cynefin-EF2NZ3EQ-rM_Vx_Nc.js";import"./styles-Df9bbQa1.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-DR50SXfs.js → ishikawaDiagram-K3B6WC7H-B80aI5uW.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-C9748YDA.js";import"./styles-Df9bbQa1.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()+`
|