@xopcai/xopc 0.0.396 → 0.0.397
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/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/src/plugin.js +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DwTaeL1e.js → agent-avatar-dicebear-CIEGrioy.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-D8Q9Cpge.js → agent-defaults-settings-panel-CzKNVkRn.js} +1 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-mpA9rwYd.js +1 -0
- package/dist/gateway/static/root/assets/{agents-DOv68iBN.js → agents-7VMa7Rzo.js} +3 -3
- package/dist/gateway/static/root/assets/{app-management-settings-panel-B1ApwlFh.js → app-management-settings-panel-DIJ0ii-n.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-Avd_jVji.js → appearance-settings-BGnyHS-p.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-CvqDUvof.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-C26WGbj9.js → archive-plugin-CR8FcRAa.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-T3FSuURJ.js → automations-page-BLInZo7N.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-B9r27rPk.js → automations-workspace-DvTSHLt3.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-CLaLkM3M.js → binary-plugins-DW9pu205.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CB4oRyM5.js → block-editor-ClgTc5v8.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automation-inputs-0nkk3bLA.js → browser-automation-inputs-Bn7kDuUB.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-KLG8IXvl.js → browser-automations-page-CJGBhDnv.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-Tcejw5fF.js → browser-settings-page-tsi5W-cJ.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-CfbGk8q_.js +2 -0
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-kEvUR6Yu.js → capabilities-settings-panel-BkO7QEyA.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-header-actions-Br5PchG2.js → capability-header-actions-9ZG71-BO.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-DRaE6_ub.js → channels-D0CwJktG.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-Cl0hAav9.js → chat-terminal-dock-x1W2_hwc.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-B6JI2S1b.js → computer-settings-page-D_b_bFVz.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-AqsoqTnF.js → connector-service-page-Kf8kaNm_.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-cDRZ8bqm.js → connectors-page-DlpfL2Rc.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-CyFehuto.js → date-picker-d5kiPUG0.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-Vu_5QGGJ.js → dependency-picker-BcH76tQC.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-Dw9k0Z2p.js → desktop-pet-B-925tPX.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-DKqkhvxu.js → desktop-pet-settings-3XJ4qR65.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-12m5Z9-8.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-7svbL2tR.js → directory-picker-path-field-B-qZCjGR.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-CFa6PCBV.js → extension-debug-page-BlQu1u6X.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BD4nZ9sf.js → extension-page-CXxM1M62.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CxPIMrmn.js → extension-settings-page-AF5nvsPP.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-Da2CtQ7c.js → gateway-settings-ABXvW_yL.js} +1 -1
- package/dist/gateway/static/root/assets/{highlighted-body-KQOG7T2V-DzEeyJpH.js → highlighted-body-KQOG7T2V-Czdbbi0H.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-Cp4-sTfX.js → home-page-LXGxGwVl.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-Zo56ZmKs.js → image-generation-api-DPFPJ2ps.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-C_PPaOFv.js → imports-page-Bwyotfbt.js} +1 -1
- package/dist/gateway/static/root/assets/index-BKHxJaGD.css +1 -0
- package/dist/gateway/static/root/assets/{index-XRbEWVyZ.js → index-Dsp_gNdl.js} +116 -116
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BGtrzFT6.js → keyboard-shortcuts-settings-C20gl-l7.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-Cu80fCA0.js → local-app-workbench-page-o0M_OSjC.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-Zsu8FnwP.js → local-apps-page-DoWJCmOq.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-DlIhfEW_.js → logs-page-BFTL93RX.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-CDV-xItG.js → management-settings-C52cuMg1.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-Ba1_QMmZ.js → media-plugins-DLrTRF0a.js} +1 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-CPYJsRUJ.js +1 -0
- package/dist/gateway/static/root/assets/{note-detail-panel-BXi6BrXd.js → note-detail-panel-CNN41byS.js} +3 -3
- package/dist/gateway/static/root/assets/{notes-page-ClR9R90o.js → notes-page-BsfBp_8z.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-BqNWtf_f.js → page-context-capture-button-YTVWZ02-.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-CSF-sn8w.js → personal-page-N4KoCZYG.js} +1 -1
- package/dist/gateway/static/root/assets/plugin-details-page-DcrrzQI-.js +1 -0
- package/dist/gateway/static/root/assets/{preview-open-alternatives-kkbrbiVd.js → preview-open-alternatives-DzA__S54.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-Dheqo_4J.js → product-open-page-DvlMKj0T.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-B9Y6dIuh.js → product-preview-content-qdFyo4NG.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-l5dXxnSq.js → project-detail-page-y67s_fA8.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-95Od8gLy.js → projects-page-D5iYgi0O.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-DPEpPFax.js → remote-access-hub-DeFF7Re-.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BjyZGNP3.js → runtime-tools-settings-panel-BCHLh-KQ.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-DelMOLjg.js → schema-form-CJvaVHkx.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-BN0nMm0w.js → sessions-page-DZ93_D5M.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-F1WX7vxq.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-DNWEDA71.js → settings-form-section-B3eODxNv.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-DJ27gC7J.js → settings-page-Dg86uCnr.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-BWA_puDN.js → setup-status-panel-ruFzAArp.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-Du4mumVM.js → share-preview-page-DCy1f25V.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-C0ixka9_.js → shares-settings-DeIVZvpJ.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-zOxHjU7m.js → skill-api-RisyPAMA.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-743oJIiS.js → skill-reload-api-Dwkm1Fof.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-DBYhEjP9.js → skills-page-UiTLsrFc.js} +1 -1
- package/dist/gateway/static/root/assets/{style-DsnKw5jo.js → style-CwMX73G7.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-mz9hWo_H.js → system-settings-panel-Cma37Pfm.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-Brp2wrEc.js → task-detail-page-BKOF_kxS.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-aC-ziRbY.js → tracing-settings-page-DC-kLysq.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-Ch2Veztk.js → tunnel-api-BgdhbR1L.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-KfKZ2a3t.js → usage-page-BSlFg3Xj.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-BLW3t_OK.js → use-autosave-iKvZ1pvC.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-BSsT8WjA.js → user-model-page-D4GB8QsM.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-DulF6Cm4.js → voice-api-key-field-CESbtuwM.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-bBMZM8tN.js → work-discovery-overlay-dtPpmYyh.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-CsxXS1WI.js → workflow-run-setup-panel-DmFn3E_B.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-a-mfjQ2h.js → workflows-page-DEtaRuxH.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-wwIRBFCs.js → xopc-cloud-account-card-DTZnabfg.js} +1 -1
- package/dist/gateway/static/root/index.html +2 -2
- package/dist/package.js +1 -1
- package/dist/src/agent/embedded/codemode-extension.d.ts +1 -0
- package/dist/src/agent/embedded/codemode-extension.js +6 -1
- package/dist/src/agent/embedded/run-for-session.js +1 -1
- package/dist/src/agent/embedded/run-turn.js +34 -2
- package/dist/src/agent/embedded/session-runner.js +1 -1
- package/dist/src/agent/mcp/config.d.ts +2 -0
- package/dist/src/agent/mcp/config.js +2 -2
- package/dist/src/agent/mcp/connection-setup.js +13 -1
- package/dist/src/agent/mcp/effective-server.d.ts +3 -0
- package/dist/src/agent/mcp/effective-server.js +27 -0
- package/dist/src/agent/mcp/native-mcp.d.ts +1 -1
- package/dist/src/agent/mcp/native-mcp.js +13 -4
- package/dist/src/agent/mcp/tool-catalog.js +2 -1
- package/dist/src/agent/skills/index.d.ts +1 -0
- package/dist/src/agent/skills/index.js +6 -2
- package/dist/src/agent/skills/skill-manager.d.ts +1 -0
- package/dist/src/agent/skills/skill-manager.js +6 -1
- package/dist/src/agent/skills/skill-sources.d.ts +1 -0
- package/dist/src/agent/skills/skill-sources.js +4 -3
- package/dist/src/agent/skills/types.d.ts +1 -0
- package/dist/src/agent/workspace-runtime/registry.js +6 -2
- package/dist/src/browser/native-messaging-host.js +1 -1
- package/dist/src/browser/providers/browser-ext-install.js +2 -2
- package/dist/src/channels/index.js +1 -1
- package/dist/src/channels/manager.js +1 -1
- package/dist/src/cli/commands/channels.js +1 -1
- package/dist/src/cli/commands/connectors.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/extension-agent-plugin.js +92 -7
- package/dist/src/cli/commands/extension-marketplace.js +2 -2
- package/dist/src/cli/commands/extension.js +1 -1
- package/dist/src/cli/commands/mcp.js +6 -4
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/extensions/agent-plugins/auth.d.ts +7 -1
- package/dist/src/extensions/agent-plugins/auth.js +53 -12
- package/dist/src/extensions/agent-plugins/branding.d.ts +6 -0
- package/dist/src/extensions/agent-plugins/branding.js +44 -0
- package/dist/src/extensions/agent-plugins/cli-authorization.d.ts +22 -0
- package/dist/src/extensions/agent-plugins/cli-authorization.js +198 -0
- package/dist/src/extensions/agent-plugins/connection-reuse.d.ts +10 -0
- package/dist/src/extensions/agent-plugins/connection-reuse.js +23 -0
- package/dist/src/extensions/agent-plugins/credentials.js +24 -1
- package/dist/src/extensions/agent-plugins/formats.d.ts +27 -0
- package/dist/src/extensions/agent-plugins/formats.js +208 -0
- package/dist/src/extensions/agent-plugins/inventory.d.ts +142 -2
- package/dist/src/extensions/agent-plugins/inventory.js +39 -5
- package/dist/src/extensions/agent-plugins/mcp-adapter.d.ts +2 -1
- package/dist/src/extensions/agent-plugins/mcp-adapter.js +42 -8
- package/dist/src/extensions/agent-plugins/mcp-format.d.ts +2 -0
- package/dist/src/extensions/agent-plugins/mcp-format.js +82 -0
- package/dist/src/extensions/agent-plugins/resources.d.ts +14 -0
- package/dist/src/extensions/agent-plugins/resources.js +112 -0
- package/dist/src/extensions/agent-plugins/setup-contract.d.ts +54 -0
- package/dist/src/extensions/agent-plugins/setup-contract.js +58 -0
- package/dist/src/extensions/agent-plugins/setup.d.ts +119 -0
- package/dist/src/extensions/agent-plugins/setup.js +491 -0
- package/dist/src/extensions/agent-plugins/source-catalog.d.ts +21 -0
- package/dist/src/extensions/agent-plugins/source-catalog.js +175 -0
- package/dist/src/extensions/agent-plugins/sources.d.ts +1 -1
- package/dist/src/extensions/agent-plugins/sources.js +12 -3
- package/dist/src/extensions/agent-plugins/store.d.ts +33 -2
- package/dist/src/extensions/agent-plugins/store.js +175 -25
- package/dist/src/extensions/agent-plugins/user-config.d.ts +5 -0
- package/dist/src/extensions/agent-plugins/user-config.js +49 -0
- package/dist/src/extensions/agent-plugins/validation.d.ts +26 -1
- package/dist/src/extensions/agent-plugins/validation.js +142 -27
- package/dist/src/extensions/sdk/index.js +1 -1
- package/dist/src/gateway/hono/app.js +1 -1
- package/dist/src/gateway/hono/routes/agent-plugins.js +120 -9
- package/dist/src/gateway/hono/routes/browser-install.js +1 -1
- package/dist/src/gateway/hono/routes/composer-history.js +22 -4
- package/dist/src/gateway/hono/routes/mcp.js +6 -4
- package/dist/src/gateway/service.js +5 -3
- package/dist/src/gateway/session-context-summary.js +1 -1
- package/dist/src/storage/sqlite/composer-input-history-repository.d.ts +4 -3
- package/dist/src/storage/sqlite/composer-input-history-repository.js +10 -8
- package/dist/src/storage/sqlite/device-pairing-approval.js +1 -1
- package/dist/src/storage/sqlite/migrations/257_session_composer_history.sql +11 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/tui/backends/embedded-backend.d.ts +2 -2
- package/dist/src/tui/backends/embedded-backend.js +4 -4
- package/dist/src/tui/backends/gateway-realtime-backend.d.ts +2 -2
- package/dist/src/tui/backends/gateway-realtime-backend.js +7 -4
- package/dist/src/tui/composer-history.d.ts +14 -0
- package/dist/src/tui/composer-history.js +85 -0
- package/dist/src/tui/tui-backend.d.ts +4 -3
- package/dist/src/tui/tui.js +19 -46
- package/package.json +12 -4
- package/dist/gateway/static/root/assets/agent-plugin-dialog-C-UKhDkS.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-Da6Ar2U3.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-page-BJlw9rhA.js +0 -2
- package/dist/gateway/static/root/assets/device-pairing-wizard-4l4ESMon.js +0 -1
- package/dist/gateway/static/root/assets/index-zIgp-ZTu.css +0 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-CpK57Kgp.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BvfEKyfy.js +0 -1
package/dist/gateway/static/root/assets/{projects-page-95Od8gLy.js → projects-page-D5iYgi0O.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./chunk-KS7C4IRE-B2HK1psj.js";import{t as a}from"./folder-open-CyzJ19I9.js";import{t as o}from"./plus-Q2yW6OE7.js";import{t as s}from"./x-B_N4OPjy.js";import{t as ee}from"./messages-DPxcWxfD.js";import{t as c}from"./cn-0WouolD0.js";import{n as l}from"./locale-store-Djl2FW6_.js";import{a as u,i as d,n as f,o as p,r as m,s as h,t as g}from"./dist-BGTk37IG.js";import{$a as _,Co as v,Ed as te,Go as y,Mi as b,Of as x,Oo as S,Rc as C,Tf as ne,To as w,Wc as T,Wu as E,_u as D,co as O,ds as k,fs as A,mo as j,nu as M,ou as N,po as re,ro as ie,vu as P,wo as ae}from"./index-XRbEWVyZ.js";var F=n(),I=e(t(),1),L=r();function R(e,t){if(e==null)return t;let n=new Date(e);return Number.isNaN(n.getTime())?t:b(n)}function oe(e){return[...e].sort((e,t)=>{let n=Number(!!t.pinnedAt)-Number(!!e.pinnedAt);return n===0?new Date(t.lastActiveAt??t.updatedAt).getTime()-new Date(e.lastActiveAt??e.updatedAt).getTime():n})}function se(){let e=(0,F.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,L.jsx)(`div`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-3`,"aria-busy":!0,children:Array.from({length:6},z)}),e[0]=t):t=e[0],t}function z(e,t){return(0,L.jsx)(C,{className:`h-40 rounded-xl`},t)}function ce(e){let t=(0,F.c)(59),{project:n,busy:r,onTogglePin:a,onToggleArchive:o}=e,s=l(B),c,u,d,f,p,m,h,g;if(t[0]!==s||t[1]!==n.brief||t[2]!==n.description||t[3]!==n.id||t[4]!==n.lastActiveAt||t[5]!==n.name||t[6]!==n.status||t[7]!==n.updatedAt||t[8]!==n.workspaceRoot){let e=ee(s).projectsPage;c=e.management,h=`flex h-full flex-col rounded-xl border border-edge-subtle bg-surface-base p-4`;let r;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,L.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-surface-hover text-fg-muted`,children:(0,L.jsx)(te,{className:`size-4`,"aria-hidden":!0})}),t[17]=r):r=t[17];let a;t[18]===n.name?a=t[19]:(a=(0,L.jsx)(`h2`,{className:`truncate text-base font-semibold sm:text-sm text-fg`,children:n.name}),t[18]=n.name,t[19]=a);let o=(0,L.jsxs)(`div`,{className:`min-w-0`,children:[a,(0,L.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-subtle`,children:e.statuses[n.status]})]}),l;t[20]===o?l=t[21]:(l=(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[r,o]}),t[20]=o,t[21]=l);let _;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,L.jsx)(ne,{className:`mt-2 size-4 shrink-0 text-fg-subtle transition-transform group-hover:translate-x-0.5`,"aria-hidden":!0}),t[22]=_):_=t[22];let v;t[23]===l?v=t[24]:(v=(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[l,_]}),t[23]=l,t[24]=v),g=(0,L.jsxs)(i,{to:`/projects/${encodeURIComponent(n.id)}`,className:`group flex min-w-0 flex-1 flex-col rounded-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[v,(0,L.jsx)(`p`,{className:`mt-3 line-clamp-2 min-h-10 text-sm leading-6 sm:text-xs sm:leading-5 text-fg-muted`,children:n.description||n.brief||e.noDescription})]}),m=`mt-3 flex shrink-0 items-end justify-between gap-3 border-t border-edge-subtle pt-3`,f=`min-w-0 text-xs text-fg-muted`,p=(0,L.jsx)(`p`,{className:`hidden truncate sm:block`,children:n.workspaceRoot||e.agentDefault}),u=`mt-1`,d=R(n.lastActiveAt??n.updatedAt,e.never),t[0]=s,t[1]=n.brief,t[2]=n.description,t[3]=n.id,t[4]=n.lastActiveAt,t[5]=n.name,t[6]=n.status,t[7]=n.updatedAt,t[8]=n.workspaceRoot,t[9]=c,t[10]=u,t[11]=d,t[12]=f,t[13]=p,t[14]=m,t[15]=h,t[16]=g}else c=t[9],u=t[10],d=t[11],f=t[12],p=t[13],m=t[14],h=t[15],g=t[16];let _;t[25]!==u||t[26]!==d?(_=(0,L.jsx)(`p`,{className:u,children:d}),t[25]=u,t[26]=d,t[27]=_):_=t[27];let v;t[28]!==f||t[29]!==p||t[30]!==_?(v=(0,L.jsxs)(`div`,{className:f,children:[p,_]}),t[28]=f,t[29]=p,t[30]=_,t[31]=v):v=t[31];let y=n.pinnedAt?c.unpin:c.pin,b=n.pinnedAt?c.unpin:c.pin,S;t[32]===n.pinnedAt?S=t[33]:(S=n.pinnedAt?(0,L.jsx)(D,{className:`size-4`,"aria-hidden":!0}):(0,L.jsx)(P,{className:`size-4`,"aria-hidden":!0}),t[32]=n.pinnedAt,t[33]=S);let C;t[34]!==r||t[35]!==a||t[36]!==y||t[37]!==b||t[38]!==S?(C=(0,L.jsx)(T,{type:`button`,variant:`ghost`,className:`size-8 p-0`,disabled:r,onClick:a,"aria-label":y,title:b,children:S}),t[34]=r,t[35]=a,t[36]=y,t[37]=b,t[38]=S,t[39]=C):C=t[39];let w=n.status===`archived`?c.restore:c.archive,E=n.status===`archived`?c.restore:c.archive,O;t[40]===n.status?O=t[41]:(O=n.status===`archived`?(0,L.jsx)(N,{className:`size-4`,"aria-hidden":!0}):(0,L.jsx)(x,{className:`size-4`,"aria-hidden":!0}),t[40]=n.status,t[41]=O);let k;t[42]!==r||t[43]!==o||t[44]!==w||t[45]!==E||t[46]!==O?(k=(0,L.jsx)(T,{type:`button`,variant:`ghost`,className:`size-8 p-0`,disabled:r,onClick:o,"aria-label":w,title:E,children:O}),t[42]=r,t[43]=o,t[44]=w,t[45]=E,t[46]=O,t[47]=k):k=t[47];let A;t[48]!==C||t[49]!==k?(A=(0,L.jsxs)(`div`,{className:`flex shrink-0 gap-1`,children:[C,k]}),t[48]=C,t[49]=k,t[50]=A):A=t[50];let j;t[51]!==A||t[52]!==m||t[53]!==v?(j=(0,L.jsxs)(`div`,{className:m,children:[v,A]}),t[51]=A,t[52]=m,t[53]=v,t[54]=j):j=t[54];let M;return t[55]!==j||t[56]!==h||t[57]!==g?(M=(0,L.jsxs)(`article`,{className:h,children:[g,j]}),t[55]=j,t[56]=h,t[57]=g,t[58]=M):M=t[58],M}function B(e){return e.language}function V(){let e=ee(l(e=>e.language)),t=e.projectsPage,n=t.management,r=e.chat.workingDirectory,i=y(e=>e.setPageHeader),b=y(e=>e.clearPageHeader),[x,C]=(0,I.useState)([]),[ne,D]=(0,I.useState)(!0),[N,P]=(0,I.useState)(null),[F,R]=(0,I.useState)(``),[z,B]=(0,I.useState)(!1),[V,le]=(0,I.useState)(`active`),[ue,H]=(0,I.useState)(null),[de,U]=(0,I.useState)(!1),[fe,W]=(0,I.useState)(null),[G,pe]=(0,I.useState)(!1),[K,me]=(0,I.useState)(!0),[q,he]=(0,I.useState)(``),[J,ge]=(0,I.useState)(``),[Y,_e]=(0,I.useState)(``),X=ie({initialPath:Y,onPicked:_e}),Z=(0,I.useRef)(0),Q=(0,I.useCallback)(async(e=!1)=>{let t=++Z.current;e||(D(!0),P(null));try{let e=await v({limit:100,sortBy:`updatedAt`,sortOrder:`desc`});t===Z.current&&C(oe(e.items))}catch(n){!e&&t===Z.current&&P(n instanceof Error?n.message:String(n))}finally{t===Z.current&&D(!1)}},[]);(0,I.useEffect)(()=>(Q(),()=>{Z.current++}),[Q]),(0,I.useEffect)(()=>{let e=()=>{Q(!0)};return window.addEventListener(`project-resource-changed`,e),()=>{window.removeEventListener(`project-resource-changed`,e)}},[Q]);let $=(0,I.useMemo)(()=>{let e=F.trim().toLocaleLowerCase();return x.filter(e=>V===`all`||e.status===V).filter(t=>!e||[t.name,t.description,t.brief,t.workspaceRoot].filter(Boolean).some(t=>t.toLocaleLowerCase().includes(e)))},[V,x,F]),ve=(0,I.useMemo)(()=>(0,L.jsxs)(T,{type:`button`,variant:`primary`,className:`h-9 rounded-lg`,onClick:()=>U(!0),children:[(0,L.jsx)(o,{className:`size-4`,"aria-hidden":!0}),t.create]}),[t.create]);(0,I.useLayoutEffect)(()=>(i({startExtra:null,main:(0,L.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:n.title}),end:ve}),()=>b()),[b,ve,n.title,i]);let ye=(0,I.useCallback)(async e=>{e.preventDefault();let t=q.trim(),n=Y.trim();if(!(!t||!n||G)){pe(!0),W(null);try{let e=await j({autoUnderstand:K,name:t,...J.trim()?{description:J.trim()}:{},workspaceRoot:n});C(t=>[e,...t.filter(t=>t.id!==e.id)]),he(``),ge(``),_e(``),me(!0),U(!1),window.dispatchEvent(new CustomEvent(`project-updated`,{detail:{id:e.id}}))}catch(e){W(e instanceof Error?e.message:String(e))}finally{pe(!1)}}},[G,J,q,Y,K]),be=(0,I.useCallback)(async(e,t)=>{H(e.id),P(null);try{let n;n=t===`pin`?e.pinnedAt?await S(e.id,e.version):await ae(e.id,e.version):e.status===`archived`?await w(e.id,e.version):await re(e.id,e.version),C(e=>e.map(e=>e.id===n.id?n:e)),window.dispatchEvent(new CustomEvent(`project-updated`,{detail:{id:e.id}}))}catch(e){P(e instanceof Error?e.message:String(e))}finally{H(null)}},[]),xe=[{id:`active`,label:t.statuses.active},{id:`paused`,label:t.statuses.paused},{id:`archived`,label:t.statuses.archived},{id:`all`,label:t.all}],Se=xe.find(e=>e.id===V)?.label??t.all,Ce=n.resultCount.replace(`{{status}}`,Se).replace(`{{count}}`,String($.length));return(0,L.jsxs)(`main`,{className:`mx-auto flex w-full max-w-7xl flex-1 flex-col gap-5 px-4 pb-7 pt-3 sm:px-6 lg:px-8 lg:pb-9 lg:pt-4`,children:[(0,L.jsx)(g,{open:de,onOpenChange:e=>{U(e),e||W(null)},children:(0,L.jsxs)(p,{children:[(0,L.jsx)(u,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,L.jsxs)(m,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[90] flex h-[min(34rem,calc(100vh-2rem))] w-[min(38rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-float focus:outline-none`,children:[(0,L.jsxs)(`div`,{className:`shrink-0 border-b border-edge px-5 py-4`,children:[(0,L.jsx)(h,{className:`text-base font-semibold text-fg`,children:t.createTitle}),(0,L.jsx)(d,{className:`mt-1 text-sm text-fg-muted`,children:t.createDescription})]}),(0,L.jsxs)(`form`,{onSubmit:ye,className:`flex min-h-0 flex-1 flex-col`,children:[(0,L.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-5 py-4`,children:[(0,L.jsxs)(`label`,{className:`grid gap-1.5 text-sm font-medium text-fg`,children:[t.projectName,(0,L.jsx)(`input`,{className:`h-10 rounded-lg border border-edge bg-surface-base px-3 font-normal outline-none focus:border-accent focus:ring-2 focus:ring-accent/20`,value:q,onChange:e=>he(e.target.value),maxLength:160})]}),(0,L.jsxs)(`label`,{className:`grid gap-1.5 text-sm font-medium text-fg`,children:[n.descriptionLabel,(0,L.jsx)(`textarea`,{className:`min-h-28 resize-none rounded-lg border border-edge bg-surface-base px-3 py-2 font-normal leading-6 outline-none focus:border-accent focus:ring-2 focus:ring-accent/20`,value:J,onChange:e=>ge(e.target.value),maxLength:2e3,placeholder:n.descriptionPlaceholder})]}),(0,L.jsxs)(`div`,{className:`grid gap-1.5 text-sm`,children:[(0,L.jsx)(`span`,{className:`font-medium text-fg`,children:t.workspaceRoot}),(0,L.jsxs)(`button`,{type:`button`,className:`flex min-h-12 w-full items-center gap-3 rounded-lg border border-edge bg-surface-base px-3 py-2 text-left outline-none transition-colors hover:bg-surface-hover focus-visible:border-accent focus-visible:ring-2 focus-visible:ring-accent/20 disabled:cursor-not-allowed disabled:opacity-60`,onClick:X.pick,disabled:G||X.picking,children:[X.picking?(0,L.jsx)(E,{className:`size-5 shrink-0 animate-spin text-accent`,"aria-hidden":!0}):(0,L.jsx)(a,{className:`size-5 shrink-0 text-accent`,"aria-hidden":!0}),(0,L.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:Y?r.chooseFolder:r.selectWorkingDirectory}),(0,L.jsx)(`span`,{className:c(`mt-0.5 block truncate font-mono text-xs font-normal`,Y?`text-fg-muted`:`text-fg-subtle`),title:Y||void 0,children:Y||t.workspaceSelectionPlaceholder})]})]}),(0,L.jsx)(`p`,{className:`text-xs font-normal text-fg-subtle`,children:t.workspaceSelectionHint})]}),(0,L.jsx)(O,{checked:K,onChange:me,disabled:G}),fe?(0,L.jsx)(`p`,{className:`rounded-lg bg-danger-soft px-3 py-2 text-xs text-danger`,role:`alert`,children:fe}):null]}),(0,L.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-5 py-4`,children:[(0,L.jsx)(f,{asChild:!0,children:(0,L.jsx)(T,{type:`button`,variant:`ghost`,children:t.cancel})}),(0,L.jsx)(T,{type:`submit`,variant:`primary`,disabled:G||!q.trim()||!Y.trim(),children:G?t.home.creating:t.create})]})]})]})]})}),X.hasNativePicker?null:(0,L.jsx)(_,{open:X.modalOpen,onOpenChange:X.setModalOpen,initialAbsolutePath:Y||void 0,onConfirm:X.confirmPick,wd:r}),(0,L.jsxs)(`section`,{className:`flex min-h-10 flex-wrap items-center justify-between gap-3`,"aria-label":n.filterLabel,children:[(0,L.jsx)(`p`,{className:`text-sm font-medium text-fg-muted`,"aria-live":`polite`,children:Ce}),(0,L.jsxs)(`div`,{className:c(`ml-auto flex min-w-0 items-center justify-end gap-2`,z&&`w-full sm:w-auto`),children:[z?(0,L.jsxs)(`div`,{className:`relative min-w-0 flex-1 sm:w-64 sm:flex-none`,children:[(0,L.jsx)(M,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),(0,L.jsx)(`input`,{autoFocus:!0,className:`h-11 w-full rounded-lg border border-edge bg-surface-panel pl-9 pr-12 text-base sm:h-9 sm:text-sm text-fg outline-none placeholder:text-fg-muted focus:border-accent`,value:F,onChange:e=>R(e.target.value),placeholder:t.searchPlaceholder,"aria-label":t.searchPlaceholder}),(0,L.jsx)(`button`,{type:`button`,className:`touch-target absolute right-0 top-1/2 flex size-6 -translate-y-1/2 items-center justify-center rounded-md text-fg-subtle transition-colors hover:bg-surface-hover hover:text-fg`,onClick:()=>{R(``),B(!1)},"aria-label":n.clearSearch,title:n.clearSearch,children:(0,L.jsx)(s,{className:`size-3.5`,"aria-hidden":!0})})]}):(0,L.jsx)(T,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,onClick:()=>B(!0),"aria-label":t.searchPlaceholder,title:t.searchPlaceholder,children:(0,L.jsx)(M,{className:`size-4`,"aria-hidden":!0})}),(0,L.jsx)(k,{className:`w-28 sm:w-32`,triggerClassName:`h-9 border-edge bg-surface-panel px-2.5 text-xs font-medium`,contentClassName:`min-w-36`,align:`end`,value:V,"aria-label":n.filterLabel,onChange:e=>le(e.target.value),children:xe.map(e=>(0,L.jsx)(A,{value:e.id,children:e.label},e.id))})]})]}),N?(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl border border-danger/25 bg-danger-soft px-4 py-3 text-sm text-danger`,role:`alert`,children:[(0,L.jsx)(`span`,{children:N}),(0,L.jsx)(T,{type:`button`,variant:`ghost`,className:`h-8 px-2`,onClick:()=>void Q(),children:t.home.retry})]}):null,ne?(0,L.jsx)(se,{}):$.length?(0,L.jsx)(`section`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-3`,children:$.map(e=>(0,L.jsx)(ce,{project:e,busy:ue===e.id,onTogglePin:()=>void be(e,`pin`),onToggleArchive:()=>void be(e,`archive`)},e.id))}):(0,L.jsxs)(`section`,{className:`py-16 text-center`,children:[(0,L.jsx)(te,{className:`mx-auto size-7 text-fg-subtle`,"aria-hidden":!0}),(0,L.jsx)(`h2`,{className:`mt-3 text-sm font-semibold text-fg`,children:n.emptyTitle}),(0,L.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:n.emptyHint})]})]})}export{V as ProjectsPage};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./chunk-KS7C4IRE-B2HK1psj.js";import{t as a}from"./folder-open-CyzJ19I9.js";import{t as o}from"./plus-Q2yW6OE7.js";import{t as s}from"./x-B_N4OPjy.js";import{t as ee}from"./messages-DPxcWxfD.js";import{t as c}from"./cn-0WouolD0.js";import{n as l}from"./locale-store-Djl2FW6_.js";import{a as u,i as d,n as f,o as p,r as m,s as h,t as g}from"./dist-BGTk37IG.js";import{$a as _,Co as v,Ed as te,Go as y,Mi as b,Of as x,Oo as S,Rc as C,Tf as ne,To as w,Wc as T,Wu as E,_u as D,co as O,ds as k,fs as A,mo as j,nu as M,ou as N,po as re,ro as ie,vu as P,wo as ae}from"./index-Dsp_gNdl.js";var F=n(),I=e(t(),1),L=r();function R(e,t){if(e==null)return t;let n=new Date(e);return Number.isNaN(n.getTime())?t:b(n)}function oe(e){return[...e].sort((e,t)=>{let n=Number(!!t.pinnedAt)-Number(!!e.pinnedAt);return n===0?new Date(t.lastActiveAt??t.updatedAt).getTime()-new Date(e.lastActiveAt??e.updatedAt).getTime():n})}function se(){let e=(0,F.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,L.jsx)(`div`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-3`,"aria-busy":!0,children:Array.from({length:6},z)}),e[0]=t):t=e[0],t}function z(e,t){return(0,L.jsx)(C,{className:`h-40 rounded-xl`},t)}function ce(e){let t=(0,F.c)(59),{project:n,busy:r,onTogglePin:a,onToggleArchive:o}=e,s=l(B),c,u,d,f,p,m,h,g;if(t[0]!==s||t[1]!==n.brief||t[2]!==n.description||t[3]!==n.id||t[4]!==n.lastActiveAt||t[5]!==n.name||t[6]!==n.status||t[7]!==n.updatedAt||t[8]!==n.workspaceRoot){let e=ee(s).projectsPage;c=e.management,h=`flex h-full flex-col rounded-xl border border-edge-subtle bg-surface-base p-4`;let r;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,L.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-surface-hover text-fg-muted`,children:(0,L.jsx)(te,{className:`size-4`,"aria-hidden":!0})}),t[17]=r):r=t[17];let a;t[18]===n.name?a=t[19]:(a=(0,L.jsx)(`h2`,{className:`truncate text-base font-semibold sm:text-sm text-fg`,children:n.name}),t[18]=n.name,t[19]=a);let o=(0,L.jsxs)(`div`,{className:`min-w-0`,children:[a,(0,L.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-subtle`,children:e.statuses[n.status]})]}),l;t[20]===o?l=t[21]:(l=(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[r,o]}),t[20]=o,t[21]=l);let _;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,L.jsx)(ne,{className:`mt-2 size-4 shrink-0 text-fg-subtle transition-transform group-hover:translate-x-0.5`,"aria-hidden":!0}),t[22]=_):_=t[22];let v;t[23]===l?v=t[24]:(v=(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[l,_]}),t[23]=l,t[24]=v),g=(0,L.jsxs)(i,{to:`/projects/${encodeURIComponent(n.id)}`,className:`group flex min-w-0 flex-1 flex-col rounded-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[v,(0,L.jsx)(`p`,{className:`mt-3 line-clamp-2 min-h-10 text-sm leading-6 sm:text-xs sm:leading-5 text-fg-muted`,children:n.description||n.brief||e.noDescription})]}),m=`mt-3 flex shrink-0 items-end justify-between gap-3 border-t border-edge-subtle pt-3`,f=`min-w-0 text-xs text-fg-muted`,p=(0,L.jsx)(`p`,{className:`hidden truncate sm:block`,children:n.workspaceRoot||e.agentDefault}),u=`mt-1`,d=R(n.lastActiveAt??n.updatedAt,e.never),t[0]=s,t[1]=n.brief,t[2]=n.description,t[3]=n.id,t[4]=n.lastActiveAt,t[5]=n.name,t[6]=n.status,t[7]=n.updatedAt,t[8]=n.workspaceRoot,t[9]=c,t[10]=u,t[11]=d,t[12]=f,t[13]=p,t[14]=m,t[15]=h,t[16]=g}else c=t[9],u=t[10],d=t[11],f=t[12],p=t[13],m=t[14],h=t[15],g=t[16];let _;t[25]!==u||t[26]!==d?(_=(0,L.jsx)(`p`,{className:u,children:d}),t[25]=u,t[26]=d,t[27]=_):_=t[27];let v;t[28]!==f||t[29]!==p||t[30]!==_?(v=(0,L.jsxs)(`div`,{className:f,children:[p,_]}),t[28]=f,t[29]=p,t[30]=_,t[31]=v):v=t[31];let y=n.pinnedAt?c.unpin:c.pin,b=n.pinnedAt?c.unpin:c.pin,S;t[32]===n.pinnedAt?S=t[33]:(S=n.pinnedAt?(0,L.jsx)(D,{className:`size-4`,"aria-hidden":!0}):(0,L.jsx)(P,{className:`size-4`,"aria-hidden":!0}),t[32]=n.pinnedAt,t[33]=S);let C;t[34]!==r||t[35]!==a||t[36]!==y||t[37]!==b||t[38]!==S?(C=(0,L.jsx)(T,{type:`button`,variant:`ghost`,className:`size-8 p-0`,disabled:r,onClick:a,"aria-label":y,title:b,children:S}),t[34]=r,t[35]=a,t[36]=y,t[37]=b,t[38]=S,t[39]=C):C=t[39];let w=n.status===`archived`?c.restore:c.archive,E=n.status===`archived`?c.restore:c.archive,O;t[40]===n.status?O=t[41]:(O=n.status===`archived`?(0,L.jsx)(N,{className:`size-4`,"aria-hidden":!0}):(0,L.jsx)(x,{className:`size-4`,"aria-hidden":!0}),t[40]=n.status,t[41]=O);let k;t[42]!==r||t[43]!==o||t[44]!==w||t[45]!==E||t[46]!==O?(k=(0,L.jsx)(T,{type:`button`,variant:`ghost`,className:`size-8 p-0`,disabled:r,onClick:o,"aria-label":w,title:E,children:O}),t[42]=r,t[43]=o,t[44]=w,t[45]=E,t[46]=O,t[47]=k):k=t[47];let A;t[48]!==C||t[49]!==k?(A=(0,L.jsxs)(`div`,{className:`flex shrink-0 gap-1`,children:[C,k]}),t[48]=C,t[49]=k,t[50]=A):A=t[50];let j;t[51]!==A||t[52]!==m||t[53]!==v?(j=(0,L.jsxs)(`div`,{className:m,children:[v,A]}),t[51]=A,t[52]=m,t[53]=v,t[54]=j):j=t[54];let M;return t[55]!==j||t[56]!==h||t[57]!==g?(M=(0,L.jsxs)(`article`,{className:h,children:[g,j]}),t[55]=j,t[56]=h,t[57]=g,t[58]=M):M=t[58],M}function B(e){return e.language}function V(){let e=ee(l(e=>e.language)),t=e.projectsPage,n=t.management,r=e.chat.workingDirectory,i=y(e=>e.setPageHeader),b=y(e=>e.clearPageHeader),[x,C]=(0,I.useState)([]),[ne,D]=(0,I.useState)(!0),[N,P]=(0,I.useState)(null),[F,R]=(0,I.useState)(``),[z,B]=(0,I.useState)(!1),[V,le]=(0,I.useState)(`active`),[ue,H]=(0,I.useState)(null),[de,U]=(0,I.useState)(!1),[fe,W]=(0,I.useState)(null),[G,pe]=(0,I.useState)(!1),[K,me]=(0,I.useState)(!0),[q,he]=(0,I.useState)(``),[J,ge]=(0,I.useState)(``),[Y,_e]=(0,I.useState)(``),X=ie({initialPath:Y,onPicked:_e}),Z=(0,I.useRef)(0),Q=(0,I.useCallback)(async(e=!1)=>{let t=++Z.current;e||(D(!0),P(null));try{let e=await v({limit:100,sortBy:`updatedAt`,sortOrder:`desc`});t===Z.current&&C(oe(e.items))}catch(n){!e&&t===Z.current&&P(n instanceof Error?n.message:String(n))}finally{t===Z.current&&D(!1)}},[]);(0,I.useEffect)(()=>(Q(),()=>{Z.current++}),[Q]),(0,I.useEffect)(()=>{let e=()=>{Q(!0)};return window.addEventListener(`project-resource-changed`,e),()=>{window.removeEventListener(`project-resource-changed`,e)}},[Q]);let $=(0,I.useMemo)(()=>{let e=F.trim().toLocaleLowerCase();return x.filter(e=>V===`all`||e.status===V).filter(t=>!e||[t.name,t.description,t.brief,t.workspaceRoot].filter(Boolean).some(t=>t.toLocaleLowerCase().includes(e)))},[V,x,F]),ve=(0,I.useMemo)(()=>(0,L.jsxs)(T,{type:`button`,variant:`primary`,className:`h-9 rounded-lg`,onClick:()=>U(!0),children:[(0,L.jsx)(o,{className:`size-4`,"aria-hidden":!0}),t.create]}),[t.create]);(0,I.useLayoutEffect)(()=>(i({startExtra:null,main:(0,L.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:n.title}),end:ve}),()=>b()),[b,ve,n.title,i]);let ye=(0,I.useCallback)(async e=>{e.preventDefault();let t=q.trim(),n=Y.trim();if(!(!t||!n||G)){pe(!0),W(null);try{let e=await j({autoUnderstand:K,name:t,...J.trim()?{description:J.trim()}:{},workspaceRoot:n});C(t=>[e,...t.filter(t=>t.id!==e.id)]),he(``),ge(``),_e(``),me(!0),U(!1),window.dispatchEvent(new CustomEvent(`project-updated`,{detail:{id:e.id}}))}catch(e){W(e instanceof Error?e.message:String(e))}finally{pe(!1)}}},[G,J,q,Y,K]),be=(0,I.useCallback)(async(e,t)=>{H(e.id),P(null);try{let n;n=t===`pin`?e.pinnedAt?await S(e.id,e.version):await ae(e.id,e.version):e.status===`archived`?await w(e.id,e.version):await re(e.id,e.version),C(e=>e.map(e=>e.id===n.id?n:e)),window.dispatchEvent(new CustomEvent(`project-updated`,{detail:{id:e.id}}))}catch(e){P(e instanceof Error?e.message:String(e))}finally{H(null)}},[]),xe=[{id:`active`,label:t.statuses.active},{id:`paused`,label:t.statuses.paused},{id:`archived`,label:t.statuses.archived},{id:`all`,label:t.all}],Se=xe.find(e=>e.id===V)?.label??t.all,Ce=n.resultCount.replace(`{{status}}`,Se).replace(`{{count}}`,String($.length));return(0,L.jsxs)(`main`,{className:`mx-auto flex w-full max-w-7xl flex-1 flex-col gap-5 px-4 pb-7 pt-3 sm:px-6 lg:px-8 lg:pb-9 lg:pt-4`,children:[(0,L.jsx)(g,{open:de,onOpenChange:e=>{U(e),e||W(null)},children:(0,L.jsxs)(p,{children:[(0,L.jsx)(u,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,L.jsxs)(m,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[90] flex h-[min(34rem,calc(100vh-2rem))] w-[min(38rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-float focus:outline-none`,children:[(0,L.jsxs)(`div`,{className:`shrink-0 border-b border-edge px-5 py-4`,children:[(0,L.jsx)(h,{className:`text-base font-semibold text-fg`,children:t.createTitle}),(0,L.jsx)(d,{className:`mt-1 text-sm text-fg-muted`,children:t.createDescription})]}),(0,L.jsxs)(`form`,{onSubmit:ye,className:`flex min-h-0 flex-1 flex-col`,children:[(0,L.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-5 py-4`,children:[(0,L.jsxs)(`label`,{className:`grid gap-1.5 text-sm font-medium text-fg`,children:[t.projectName,(0,L.jsx)(`input`,{className:`h-10 rounded-lg border border-edge bg-surface-base px-3 font-normal outline-none focus:border-accent focus:ring-2 focus:ring-accent/20`,value:q,onChange:e=>he(e.target.value),maxLength:160})]}),(0,L.jsxs)(`label`,{className:`grid gap-1.5 text-sm font-medium text-fg`,children:[n.descriptionLabel,(0,L.jsx)(`textarea`,{className:`min-h-28 resize-none rounded-lg border border-edge bg-surface-base px-3 py-2 font-normal leading-6 outline-none focus:border-accent focus:ring-2 focus:ring-accent/20`,value:J,onChange:e=>ge(e.target.value),maxLength:2e3,placeholder:n.descriptionPlaceholder})]}),(0,L.jsxs)(`div`,{className:`grid gap-1.5 text-sm`,children:[(0,L.jsx)(`span`,{className:`font-medium text-fg`,children:t.workspaceRoot}),(0,L.jsxs)(`button`,{type:`button`,className:`flex min-h-12 w-full items-center gap-3 rounded-lg border border-edge bg-surface-base px-3 py-2 text-left outline-none transition-colors hover:bg-surface-hover focus-visible:border-accent focus-visible:ring-2 focus-visible:ring-accent/20 disabled:cursor-not-allowed disabled:opacity-60`,onClick:X.pick,disabled:G||X.picking,children:[X.picking?(0,L.jsx)(E,{className:`size-5 shrink-0 animate-spin text-accent`,"aria-hidden":!0}):(0,L.jsx)(a,{className:`size-5 shrink-0 text-accent`,"aria-hidden":!0}),(0,L.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:Y?r.chooseFolder:r.selectWorkingDirectory}),(0,L.jsx)(`span`,{className:c(`mt-0.5 block truncate font-mono text-xs font-normal`,Y?`text-fg-muted`:`text-fg-subtle`),title:Y||void 0,children:Y||t.workspaceSelectionPlaceholder})]})]}),(0,L.jsx)(`p`,{className:`text-xs font-normal text-fg-subtle`,children:t.workspaceSelectionHint})]}),(0,L.jsx)(O,{checked:K,onChange:me,disabled:G}),fe?(0,L.jsx)(`p`,{className:`rounded-lg bg-danger-soft px-3 py-2 text-xs text-danger`,role:`alert`,children:fe}):null]}),(0,L.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-5 py-4`,children:[(0,L.jsx)(f,{asChild:!0,children:(0,L.jsx)(T,{type:`button`,variant:`ghost`,children:t.cancel})}),(0,L.jsx)(T,{type:`submit`,variant:`primary`,disabled:G||!q.trim()||!Y.trim(),children:G?t.home.creating:t.create})]})]})]})]})}),X.hasNativePicker?null:(0,L.jsx)(_,{open:X.modalOpen,onOpenChange:X.setModalOpen,initialAbsolutePath:Y||void 0,onConfirm:X.confirmPick,wd:r}),(0,L.jsxs)(`section`,{className:`flex min-h-10 flex-wrap items-center justify-between gap-3`,"aria-label":n.filterLabel,children:[(0,L.jsx)(`p`,{className:`text-sm font-medium text-fg-muted`,"aria-live":`polite`,children:Ce}),(0,L.jsxs)(`div`,{className:c(`ml-auto flex min-w-0 items-center justify-end gap-2`,z&&`w-full sm:w-auto`),children:[z?(0,L.jsxs)(`div`,{className:`relative min-w-0 flex-1 sm:w-64 sm:flex-none`,children:[(0,L.jsx)(M,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),(0,L.jsx)(`input`,{autoFocus:!0,className:`h-11 w-full rounded-lg border border-edge bg-surface-panel pl-9 pr-12 text-base sm:h-9 sm:text-sm text-fg outline-none placeholder:text-fg-muted focus:border-accent`,value:F,onChange:e=>R(e.target.value),placeholder:t.searchPlaceholder,"aria-label":t.searchPlaceholder}),(0,L.jsx)(`button`,{type:`button`,className:`touch-target absolute right-0 top-1/2 flex size-6 -translate-y-1/2 items-center justify-center rounded-md text-fg-subtle transition-colors hover:bg-surface-hover hover:text-fg`,onClick:()=>{R(``),B(!1)},"aria-label":n.clearSearch,title:n.clearSearch,children:(0,L.jsx)(s,{className:`size-3.5`,"aria-hidden":!0})})]}):(0,L.jsx)(T,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,onClick:()=>B(!0),"aria-label":t.searchPlaceholder,title:t.searchPlaceholder,children:(0,L.jsx)(M,{className:`size-4`,"aria-hidden":!0})}),(0,L.jsx)(k,{className:`w-28 sm:w-32`,triggerClassName:`h-9 border-edge bg-surface-panel px-2.5 text-xs font-medium`,contentClassName:`min-w-36`,align:`end`,value:V,"aria-label":n.filterLabel,onChange:e=>le(e.target.value),children:xe.map(e=>(0,L.jsx)(A,{value:e.id,children:e.label},e.id))})]})]}),N?(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl border border-danger/25 bg-danger-soft px-4 py-3 text-sm text-danger`,role:`alert`,children:[(0,L.jsx)(`span`,{children:N}),(0,L.jsx)(T,{type:`button`,variant:`ghost`,className:`h-8 px-2`,onClick:()=>void Q(),children:t.home.retry})]}):null,ne?(0,L.jsx)(se,{}):$.length?(0,L.jsx)(`section`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-3`,children:$.map(e=>(0,L.jsx)(ce,{project:e,busy:ue===e.id,onTogglePin:()=>void be(e,`pin`),onToggleArchive:()=>void be(e,`archive`)},e.id))}):(0,L.jsxs)(`section`,{className:`py-16 text-center`,children:[(0,L.jsx)(te,{className:`mx-auto size-7 text-fg-subtle`,"aria-hidden":!0}),(0,L.jsx)(`h2`,{className:`mt-3 text-sm font-semibold text-fg`,children:n.emptyTitle}),(0,L.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:n.emptyHint})]})]})}export{V as ProjectsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{f as i,g as a,t as o}from"./chunk-KS7C4IRE-B2HK1psj.js";import{t as s}from"./check-DUBLcKHA.js";import{t as c}from"./copy-Dv6d4Dvw.js";import{t as l}from"./external-link-DjqjBmc3.js";import{t as u}from"./messages-DPxcWxfD.js";import{t as d}from"./cn-0WouolD0.js";import{c as f,n as p}from"./locale-store-Djl2FW6_.js";import{a as m,i as h,o as g,r as _,s as v,t as y}from"./dist-BGTk37IG.js";import{t as b}from"./copy-to-clipboard-HOJ79TWv.js";import{i as x}from"./vendor-swr-BIWyz7Rc.js";import{n as S,r as C}from"./gateway-config-swr-Di9g6pE8.js";import{F as w,G as T,Gt as E,Hn as D,I as O,Jl as k,Kl as A,L as j,Ns as M,Pl as N,Qd as P,Rt as F,Tf as I,Vt as L,Wc as R,Wu as z,Za as B,eu as V,fu as H,is as U,ja as W,kl as ee,ku as G,lf as K,no as te,sd as ne,sf as re,vs as q,xd as J,ys as ie,zt as ae}from"./index-XRbEWVyZ.js";import{n as oe,r as se,t as ce}from"./settings-page-layout-Dx5S-Msc.js";import{n as Y,r as le,t as ue}from"./settings-form-section-DNWEDA71.js";import{_ as X,a as de,b as fe,c as pe,h as me,i as he,n as ge,o as _e,r as ve,s as ye,t as be,v as xe,y as Se}from"./tunnel-api-Ch2Veztk.js";import{t as Ce}from"./settings-advanced-gate-BvfEKyfy.js";var Z=e(t(),1),Q=n(),$=r();function we(e){switch(e){case`active`:return`text-emerald-700 dark:text-emerald-400`;case`connecting`:return`text-amber-700 dark:text-amber-400`;default:return`text-fg-muted`}}function Te(e){let t=(0,Q.c)(11),{label:n,kind:r}=e,i;t[0]===r?i=t[1]:(i=d(`inline-flex items-center gap-1.5 text-xs font-medium`,we(r)),t[0]=r,t[1]=i);let a=r===`active`&&`bg-emerald-500`,o=r===`connecting`&&`bg-amber-500`,s;t[2]!==a||t[3]!==o?(s=d(`size-1.5 rounded-full bg-fg-subtle/50`,a,o),t[2]=a,t[3]=o,t[4]=s):s=t[4];let c;t[5]===s?c=t[6]:(c=(0,$.jsx)(`span`,{className:s,"aria-hidden":!0}),t[5]=s,t[6]=c);let l;return t[7]!==n||t[8]!==i||t[9]!==c?(l=(0,$.jsxs)(`span`,{className:i,children:[c,n]}),t[7]=n,t[8]=i,t[9]=c,t[10]=l):l=t[10],l}function Ee(e){let t=(0,Q.c)(31),{onOpenTab:n}=e,r=p(Oe),i;t[0]===r?i=t[1]:(i=u(r),t[0]=r,t[1]=i);let a=i.remoteAccess.guide,o=!!f(De),s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s={refreshInterval:3e4},t[2]=s):s=t[2];let{data:c}=x(o?`exposure-status`:null,Se,s),l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l={refreshInterval:15e3},t[3]=l):l=t[3];let{data:m}=x(o?`tunnel-status`:null,ge,l),h=C(o);if(!o)return null;let g=c?.tailscale.active===!0,_=m?.state,v=m?.enabled&&_===`connected`,y=m?.enabled&&(_===`connecting`||_===`reconnecting`||!!m?.startProgress||!!m?.frpcDownload),b=h.data?.payload?.config,S=!!(b&&typeof b==`object`&&!Array.isArray(b)&&b.gateway?.publicUrl),w=g?`active`:`off`,T=g?a.statusActive:a.statusOff,E;t[4]!==a.tailscaleCardTitle||t[5]!==w||t[6]!==T?(E={tab:`tailscale`,icon:J,title:a.tailscaleCardTitle,kind:w,statusLabel:T},t[4]=a.tailscaleCardTitle,t[5]=w,t[6]=T,t[7]=E):E=t[7];let D=v?`active`:y?`connecting`:`off`,O=v?a.statusActive:y?a.statusConnecting:a.statusOff,A;t[8]!==a.publicCardTitle||t[9]!==D||t[10]!==O?(A={tab:`public`,icon:G,title:a.publicCardTitle,kind:D,statusLabel:O},t[8]=a.publicCardTitle,t[9]=D,t[10]=O,t[11]=A):A=t[11];let j=S?`active`:`off`,M=S?a.statusActive:a.statusOff,P;t[12]!==a.reverseProxyCardTitle||t[13]!==j||t[14]!==M?(P={tab:`reverse-proxy`,icon:k,title:a.reverseProxyCardTitle,kind:j,statusLabel:M},t[12]=a.reverseProxyCardTitle,t[13]=j,t[14]=M,t[15]=P):P=t[15];let F;t[16]!==a.sshCardStatus||t[17]!==a.sshCardTitle?(F={tab:`ssh`,icon:N,title:a.sshCardTitle,kind:`off`,statusLabel:a.sshCardStatus},t[16]=a.sshCardStatus,t[17]=a.sshCardTitle,t[18]=F):F=t[18];let I;t[19]!==a.lanCardStatus||t[20]!==a.lanCardTitle?(I={tab:`lan`,icon:V,title:a.lanCardTitle,kind:`off`,statusLabel:a.lanCardStatus},t[19]=a.lanCardStatus,t[20]=a.lanCardTitle,t[21]=I):I=t[21];let L;t[22]!==P||t[23]!==F||t[24]!==I||t[25]!==E||t[26]!==A?(L=[E,A,P,F,I],t[22]=P,t[23]=F,t[24]=I,t[25]=E,t[26]=A,t[27]=L):L=t[27];let R=L,z;return t[28]!==R||t[29]!==n?(z=(0,$.jsx)(`div`,{className:`grid gap-1 rounded-xl bg-surface-hover/20 p-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5`,children:R.map(e=>{let t=e.icon;return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>n(e.tab),className:d(`flex items-start gap-3 rounded-lg bg-surface-base/45 px-2 py-3 text-left transition-colors`,`hover:bg-surface-hover/30`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:[(0,$.jsx)(`span`,{className:`flex size-8 shrink-0 items-center justify-center text-fg-muted`,children:(0,$.jsx)(t,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0})}),(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`span`,{className:`block truncate text-sm font-medium text-fg`,children:e.title}),(0,$.jsx)(Te,{label:e.statusLabel,kind:e.kind})]})]},`${e.tab}-${e.title}`)})}),t[28]=R,t[29]=n,t[30]=z):z=t[30],z}function De(e){return e.conversationId}function Oe(e){return e.language}function ke(e){let t=(0,Q.c)(21),{title:n,description:r,recommended:i,icon:a,onOpen:o,recommendedLabel:s}=e,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=d(`group flex w-full items-start gap-3 px-3 py-4 text-left transition-colors`,`hover:bg-surface-hover/30`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),t[0]=c):c=t[0];let l;t[1]===a?l=t[2]:(l=(0,$.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-surface-hover/70 text-fg-muted`,children:(0,$.jsx)(a,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0})}),t[1]=a,t[2]=l);let u;t[3]===n?u=t[4]:(u=(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:n}),t[3]=n,t[4]=u);let f;t[5]!==i||t[6]!==s?(f=i&&s?(0,$.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2 py-0.5 text-[11px] font-medium text-accent-fg`,children:s}):null,t[5]=i,t[6]=s,t[7]=f):f=t[7];let p;t[8]!==u||t[9]!==f?(p=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[u,f]}),t[8]=u,t[9]=f,t[10]=p):p=t[10];let m;t[11]===r?m=t[12]:(m=(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg-muted`,children:r}),t[11]=r,t[12]=m);let h;t[13]!==p||t[14]!==m?(h=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[p,m]}),t[13]=p,t[14]=m,t[15]=h):h=t[15];let g;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(re,{className:`mt-2 size-4 shrink-0 text-fg-subtle transition-transform group-hover:translate-x-0.5 group-hover:text-fg-muted`,"aria-hidden":!0}),t[16]=g):g=t[16];let _;return t[17]!==o||t[18]!==l||t[19]!==h?(_=(0,$.jsxs)(`button`,{type:`button`,onClick:o,className:c,children:[l,h,g]}),t[17]=o,t[18]=l,t[19]=h,t[20]=_):_=t[20],_}function Ae(e){let t=(0,Q.c)(78),{onOpenTab:n}=e,r=p(Ne),i;t[0]===r?i=t[1]:(i=u(r),t[0]=r,t[1]=i);let a=i.remoteAccess,o=a.guide,s=!!f(Me),c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c={refreshInterval:3e4},t[2]=c):c=t[2];let{data:l}=x(s?`exposure-status`:null,Se,c),d;t[3]===l?.conflicts?d=t[4]:(d=l?.conflicts??[],t[3]=l?.conflicts,t[4]=d);let m=d;if(!s){let e;return t[5]===o.needToken?e=t[6]:(e=(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:o.needToken}),t[5]=o.needToken,t[6]=e),e}let h;t[7]===n?h=t[8]:(h=(0,$.jsx)(Ee,{onOpenTab:n}),t[7]=n,t[8]=h);let g;t[9]!==m||t[10]!==o.conflictsHint||t[11]!==o.conflictsTitle?(g=m.length>0?(0,$.jsxs)(`div`,{className:`rounded-xl bg-amber-500/10 px-4 py-3 text-sm text-fg-muted`,children:[(0,$.jsx)(`p`,{className:`font-medium text-fg`,children:o.conflictsTitle}),(0,$.jsx)(`p`,{className:`mt-1`,children:o.conflictsHint}),(0,$.jsx)(`ul`,{className:`mt-2 list-inside list-disc text-xs`,children:m.map(je)})]}):null,t[9]=m,t[10]=o.conflictsHint,t[11]=o.conflictsTitle,t[12]=g):g=t[12];let _;t[13]===o.pickMethod?_=t[14]:(_=(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:o.pickMethod}),t[13]=o.pickMethod,t[14]=_);let v;t[15]===n?v=t[16]:(v=()=>n(`tailscale`),t[15]=n,t[16]=v);let y;t[17]!==o.recommended||t[18]!==o.tailscaleCardDesc||t[19]!==o.tailscaleCardTitle||t[20]!==v?(y=(0,$.jsx)(ke,{icon:J,title:o.tailscaleCardTitle,description:o.tailscaleCardDesc,recommended:!0,recommendedLabel:o.recommended,onOpen:v}),t[17]=o.recommended,t[18]=o.tailscaleCardDesc,t[19]=o.tailscaleCardTitle,t[20]=v,t[21]=y):y=t[21];let b;t[22]===n?b=t[23]:(b=()=>n(`public`),t[22]=n,t[23]=b);let S;t[24]!==o.publicCardDesc||t[25]!==o.publicCardTitle||t[26]!==b?(S=(0,$.jsx)(ke,{icon:G,title:o.publicCardTitle,description:o.publicCardDesc,onOpen:b}),t[24]=o.publicCardDesc,t[25]=o.publicCardTitle,t[26]=b,t[27]=S):S=t[27];let C;t[28]===n?C=t[29]:(C=()=>n(`reverse-proxy`),t[28]=n,t[29]=C);let w;t[30]!==o.reverseProxyCardDesc||t[31]!==o.reverseProxyCardTitle||t[32]!==C?(w=(0,$.jsx)(ke,{icon:k,title:o.reverseProxyCardTitle,description:o.reverseProxyCardDesc,onOpen:C}),t[30]=o.reverseProxyCardDesc,t[31]=o.reverseProxyCardTitle,t[32]=C,t[33]=w):w=t[33];let E;t[34]===n?E=t[35]:(E=()=>n(`ssh`),t[34]=n,t[35]=E);let D;t[36]!==o.sshCardDesc||t[37]!==o.sshCardTitle||t[38]!==E?(D=(0,$.jsx)(ke,{icon:N,title:o.sshCardTitle,description:o.sshCardDesc,onOpen:E}),t[36]=o.sshCardDesc,t[37]=o.sshCardTitle,t[38]=E,t[39]=D):D=t[39];let O;t[40]!==a.advanced.proxyBody||t[41]!==a.advanced.proxyTitle||t[42]!==w||t[43]!==D?(O=(0,$.jsxs)(T,{title:a.advanced.proxyTitle,summary:a.advanced.proxyBody,children:[w,D]}),t[40]=a.advanced.proxyBody,t[41]=a.advanced.proxyTitle,t[42]=w,t[43]=D,t[44]=O):O=t[44];let A;t[45]===n?A=t[46]:(A=()=>n(`lan`),t[45]=n,t[46]=A);let j;t[47]!==o.lanCardDesc||t[48]!==o.lanCardTitle||t[49]!==A?(j=(0,$.jsx)(ke,{icon:V,title:o.lanCardTitle,description:o.lanCardDesc,onOpen:A}),t[47]=o.lanCardDesc,t[48]=o.lanCardTitle,t[49]=A,t[50]=j):j=t[50];let M;t[51]!==S||t[52]!==O||t[53]!==j||t[54]!==y?(M=(0,$.jsxs)(`div`,{className:`mt-2 flex max-w-3xl flex-col gap-1 rounded-xl bg-surface-hover/20 p-1 [&>*]:rounded-lg [&>*]:bg-surface-base/45`,children:[y,S,O,j]}),t[51]=S,t[52]=O,t[53]=j,t[54]=y,t[55]=M):M=t[55];let P;t[56]!==M||t[57]!==_?(P=(0,$.jsxs)(`div`,{children:[_,M]}),t[56]=M,t[57]=_,t[58]=P):P=t[58];let F;t[59]===o.oneAtATimeHint?F=t[60]:(F=(0,$.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-subtle`,children:o.oneAtATimeHint}),t[59]=o.oneAtATimeHint,t[60]=F);let I;t[61]===a.advanced.proxyTitle?I=t[62]:(I=(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:a.advanced.proxyTitle}),t[61]=a.advanced.proxyTitle,t[62]=I);let L;t[63]===a.advanced.proxyBody?L=t[64]:(L=(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:a.advanced.proxyBody}),t[63]=a.advanced.proxyBody,t[64]=L);let R;t[65]!==r||t[66]!==a.advanced.proxyDocs?(R=(0,$.jsx)(fe,{language:r,label:a.advanced.proxyDocs,section:`advanced`,className:`mt-2`}),t[65]=r,t[66]=a.advanced.proxyDocs,t[67]=R):R=t[67];let z;t[68]!==I||t[69]!==L||t[70]!==R?(z=(0,$.jsxs)(`div`,{className:`max-w-3xl rounded-xl bg-surface-hover/20 px-4 py-4`,children:[I,L,R]}),t[68]=I,t[69]=L,t[70]=R,t[71]=z):z=t[71];let B;return t[72]!==P||t[73]!==F||t[74]!==z||t[75]!==h||t[76]!==g?(B=(0,$.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[h,g,P,F,z]}),t[72]=P,t[73]=F,t[74]=z,t[75]=h,t[76]=g,t[77]=B):B=t[77],B}function je(e){return(0,$.jsx)(`li`,{children:e.message},e.code)}function Me(e){return e.conversationId}function Ne(e){return e.language}function Pe(){let e=(0,Q.c)(16),t=p(Fe),n;e[0]===t?n=e[1]:(n=u(t),e[0]=t,e[1]=n);let r=n.remoteAccess.lan,i;e[2]!==r.subtitle||e[3]!==r.title?(i=(0,$.jsx)(Y,{icon:V,title:r.title,subtitle:r.subtitle}),e[2]=r.subtitle,e[3]=r.title,e[4]=i):i=e[4];let a;e[5]===r.body?a=e[6]:(a=(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:r.body}),e[5]=r.body,e[6]=a);let s;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(l,{className:`size-3.5`,"aria-hidden":!0}),e[7]=s):s=e[7];let c;e[8]===r.link?c=e[9]:(c=(0,$.jsxs)(o,{to:`/settings/gateway`,className:`inline-flex items-center gap-1.5 text-sm font-medium text-accent hover:underline`,children:[r.link,s]}),e[8]=r.link,e[9]=c);let d;e[10]!==a||e[11]!==c?(d=(0,$.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[a,c]}),e[10]=a,e[11]=c,e[12]=d):d=e[12];let f;return e[13]!==i||e[14]!==d?(f=(0,$.jsx)(`div`,{className:`flex flex-col gap-4`,children:(0,$.jsxs)(ue,{children:[i,d]})}),e[13]=i,e[14]=d,e[15]=f):f=e[15],f}function Fe(e){return e.language}function Ie(e){let t=(0,Q.c)(30),{embedded:n}=e,r=n===void 0?!1:n,i=p(Le),a;t[0]===i?a=t[1]:(a=u(i),t[0]=i,t[1]=a);let o=a.remoteAccess.ssh,[s,l]=(0,Z.useState)(!1),d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=async()=>{await b(`xopc gateway ssh-tunnel --target user@your-host --local-port 18790 --remote-port 18790`)&&(l(!0),setTimeout(()=>l(!1),2e3))},t[2]=d):d=t[2];let f=d,m;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(`pre`,{className:`overflow-x-auto rounded-lg bg-surface-base/55 px-3 py-2 text-xs text-fg-muted`,children:`xopc gateway ssh-tunnel --target user@your-host --local-port 18790 --remote-port 18790`}),t[3]=m):m=t[3];let h,g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>void f(),g=(0,$.jsx)(c,{className:`mr-1 size-4`}),t[4]=h,t[5]=g):(h=t[4],g=t[5]);let _=s?o.copied:o.copy,v;t[6]===_?v=t[7]:(v=(0,$.jsx)(`div`,{className:`mt-2`,children:(0,$.jsxs)(R,{type:`button`,variant:`ghost`,onClick:h,children:[g,_]})}),t[6]=_,t[7]=v);let y;t[8]!==r||t[9]!==o.hint?(y=r?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-subtle`,children:o.hint}):null,t[8]=r,t[9]=o.hint,t[10]=y):y=t[10];let x;t[11]!==v||t[12]!==y?(x=(0,$.jsxs)($.Fragment,{children:[m,v,y]}),t[11]=v,t[12]=y,t[13]=x):x=t[13];let S=x;if(r){let e;t[14]!==o.subtitle||t[15]!==o.title?(e=(0,$.jsx)(Y,{icon:N,title:o.title,subtitle:o.subtitle}),t[14]=o.subtitle,t[15]=o.title,t[16]=e):e=t[16];let n;t[17]===S?n=t[18]:(n=(0,$.jsx)(`div`,{className:`mt-4 space-y-2`,children:S}),t[17]=S,t[18]=n);let r;return t[19]!==e||t[20]!==n?(r=(0,$.jsxs)(ue,{children:[e,n]}),t[19]=e,t[20]=n,t[21]=r):r=t[21],r}let C;t[22]!==o.subtitle||t[23]!==o.title?(C=(0,$.jsx)(Y,{icon:N,title:o.title,subtitle:o.subtitle}),t[22]=o.subtitle,t[23]=o.title,t[24]=C):C=t[24];let w;t[25]===S?w=t[26]:(w=(0,$.jsx)(`div`,{className:`mt-4`,children:S}),t[25]=S,t[26]=w);let T;return t[27]!==C||t[28]!==w?(T=(0,$.jsxs)(ue,{children:[C,w]}),t[27]=C,t[28]=w,t[29]=T):T=t[29],T}function Le(e){return e.language}function Re(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Ie,{embedded:!0}),e[0]=t):t=e[0],t}var ze=[`guide`,`tailscale`,`public`,`reverse-proxy`,`ssh`,`lan`];function Be(e){return e&&ze.includes(e)?e:`guide`}function Ve(e){let t=(0,Q.c)(32),{showLabel:n,hideLabel:r,icon:i,hint:a,children:o,className:s,defaultOpen:c,advancedOnly:l}=e,u=l===void 0?!1:l,[f,p]=(0,Z.useState)(c??!1),m;t[0]===s?m=t[1]:(m=d(`rounded-xl bg-surface-hover/20`,s),t[0]=s,t[1]=m);let h;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>p(He),t[2]=h):h=t[2];let g=f&&`rotate-180`,_;t[3]===g?_=t[4]:(_=d(`size-4 shrink-0 text-fg-muted transition-transform duration-200 motion-reduce:transition-none`,g),t[3]=g,t[4]=_);let v;t[5]===_?v=t[6]:(v=(0,$.jsx)(K,{className:_,"aria-hidden":!0}),t[5]=_,t[6]=v);let y;t[7]===i?y=t[8]:(y=i?(0,$.jsx)(i,{className:`size-4 shrink-0 text-accent`,strokeWidth:1.75,"aria-hidden":!0}):null,t[7]=i,t[8]=y);let b=f?r:n,x;t[9]===b?x=t[10]:(x=(0,$.jsx)(`span`,{children:b}),t[9]=b,t[10]=x);let S;t[11]!==f||t[12]!==v||t[13]!==y||t[14]!==x?(S=(0,$.jsxs)(`button`,{type:`button`,"aria-expanded":f,onClick:h,className:`flex w-full items-center gap-2 rounded-2xl px-4 py-3.5 text-left text-sm font-medium text-fg transition-colors hover:text-fg`,children:[v,y,x]}),t[11]=f,t[12]=v,t[13]=y,t[14]=x,t[15]=S):S=t[15];let C=f?`grid-rows-[1fr] opacity-100`:`grid-rows-[0fr] opacity-0`,w;t[16]===C?w=t[17]:(w=d(`grid transition-[grid-template-rows,opacity] duration-200 ease-out motion-reduce:transition-none`,C),t[16]=C,t[17]=w);let T;t[18]===a?T=t[19]:(T=a?(0,$.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:a}):null,t[18]=a,t[19]=T);let E;t[20]!==o||t[21]!==T?(E=(0,$.jsx)(`div`,{className:`overflow-hidden`,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-4 px-4 pb-4 pt-1`,children:[T,o]})}),t[20]=o,t[21]=T,t[22]=E):E=t[22];let D;t[23]!==w||t[24]!==E?(D=(0,$.jsx)(`div`,{className:w,children:E}),t[23]=w,t[24]=E,t[25]=D):D=t[25];let O;t[26]!==S||t[27]!==D||t[28]!==m?(O=(0,$.jsxs)(`section`,{className:m,children:[S,D]}),t[26]=S,t[27]=D,t[28]=m,t[29]=O):O=t[29];let k=O;if(u){let e;return t[30]===k?e=t[31]:(e=(0,$.jsx)(Ce,{children:k}),t[30]=k,t[31]=e),e}return k}function He(e){return!e}function Ue(e){let t=(0,Q.c)(40),{open:n,title:r,intro:i,bullets:a,checkboxLabel:o,confirmLabel:s,cancelLabel:c,onConfirm:l,onCancel:u}=e,[f,p]=(0,Z.useState)(!1),b;t[0]===u?b=t[1]:(b=e=>{e||(p(!1),u())},t[0]=u,t[1]=b);let x;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(m,{className:d(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,ie)}),t[2]=x):x=t[2];let S;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(S=d(`xopc-dialog-content fixed left-1/2 top-1/2 max-h-[min(90vh,40rem)] w-[min(100%-2rem,32rem)] -translate-x-1/2 -translate-y-1/2`,`overflow-y-auto rounded-2xl border border-edge bg-surface-overlay p-6 shadow-popover outline-none dark:border-edge`,q),t[3]=S):S=t[3];let C;t[4]===r?C=t[5]:(C=(0,$.jsx)(v,{className:`text-base font-semibold text-fg`,children:r}),t[4]=r,t[5]=C);let w;t[6]===i?w=t[7]:(w=(0,$.jsx)(h,{className:`mt-2 text-sm text-fg-muted`,children:i}),t[6]=i,t[7]=w);let T;t[8]===a?T=t[9]:(T=a.map(We),t[8]=a,t[9]=T);let E;t[10]===T?E=t[11]:(E=(0,$.jsx)(`ul`,{className:`mt-4 list-disc space-y-2 pl-5 text-sm text-fg-muted`,children:T}),t[10]=T,t[11]=E);let D;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>p(e.target.checked),t[12]=D):D=t[12];let O;t[13]===f?O=t[14]:(O=(0,$.jsx)(`input`,{type:`checkbox`,className:`mt-0.5 size-4 shrink-0 rounded border-edge accent-accent`,checked:f,onChange:D}),t[13]=f,t[14]=O);let k;t[15]===o?k=t[16]:(k=(0,$.jsx)(`span`,{children:o}),t[15]=o,t[16]=k);let A;t[17]!==k||t[18]!==O?(A=(0,$.jsxs)(`label`,{className:`mt-5 flex cursor-pointer items-start gap-3 text-sm text-fg`,children:[O,k]}),t[17]=k,t[18]=O,t[19]=A):A=t[19];let j;t[20]!==c||t[21]!==u?(j=(0,$.jsx)(R,{type:`button`,variant:`secondary`,onClick:u,children:c}),t[20]=c,t[21]=u,t[22]=j):j=t[22];let M=!f,N;t[23]!==s||t[24]!==l||t[25]!==M?(N=(0,$.jsx)(R,{type:`button`,disabled:M,onClick:l,children:s}),t[23]=s,t[24]=l,t[25]=M,t[26]=N):N=t[26];let P;t[27]!==j||t[28]!==N?(P=(0,$.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[j,N]}),t[27]=j,t[28]=N,t[29]=P):P=t[29];let F;t[30]!==A||t[31]!==P||t[32]!==C||t[33]!==w||t[34]!==E?(F=(0,$.jsxs)(g,{children:[x,(0,$.jsxs)(_,{className:S,onOpenAutoFocus:Ge,children:[C,w,E,A,P]})]}),t[30]=A,t[31]=P,t[32]=C,t[33]=w,t[34]=E,t[35]=F):F=t[35];let I;return t[36]!==n||t[37]!==b||t[38]!==F?(I=(0,$.jsx)(y,{open:n,onOpenChange:b,children:F}),t[36]=n,t[37]=b,t[38]=F,t[39]=I):I=t[39],I}function We(e){return(0,$.jsx)(`li`,{children:e},e)}function Ge(e){return e.preventDefault()}function Ke(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}var qe=[`preparing_frpc`,`registering`,`starting_frpc`];function Je(e){return e?e===`reconnecting_frpc`?qe.indexOf(`starting_frpc`):qe.indexOf(e):-1}function Ye(e,t){if(t.state===`connected`)return`done`;let n=t.startProgress?.phase,r=qe.indexOf(e),i=Je(n);return i<0?t.state===`connecting`||t.state===`reconnecting`?`active`:`pending`:r<i?`done`:r===i?`active`:`pending`}function Xe(e,t,n){let r=n.startProgress;return Ye(t,n)===`active`?t===`preparing_frpc`&&n.frpcDownload?n.frpcDownload.phase===`extracting`?e.frpcExtracting:n.frpcDownload.percent==null?e.frpcDownloading:e.frpcDownloadingPercent.replace(`{{percent}}`,String(n.frpcDownload.percent)):t===`registering`&&r?.publicUrl?e.stepRegisterDetail:t===`starting_frpc`?r?.phase===`reconnecting_frpc`?e.stepReconnectDetail:e.stepFrpcDetail:null:null}function Ze(e,t){switch(t){case`preparing_frpc`:return e.stepPrepareFrpc;case`registering`:return e.stepRegister;case`starting_frpc`:return e.stepFrpcLogin}}function Qe(e){if(!e)return null;let t=Math.max(0,Math.floor((Date.now()-new Date(e).getTime())/1e3));return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}function $e(e){let t=(0,Q.c)(31),{status:n,t:r}=e,[,i]=(0,Z.useState)(0),a;t[0]!==i||t[1]!==n.state?(a=()=>{if(n.state!==`connecting`&&n.state!==`reconnecting`)return;let e=window.setInterval(()=>i(et),1e3);return()=>window.clearInterval(e)},t[0]=i,t[1]=n.state,t[2]=a):a=t[2];let o=n.startProgress?.startedAt,c;if(t[3]!==n.state||t[4]!==o?(c=[n.state,o],t[3]=n.state,t[4]=o,t[5]=c):c=t[5],(0,Z.useEffect)(a,c),!(n.state===`connecting`||n.state===`reconnecting`||n.state===`connected`&&n.startProgress))return null;let l,u,f,p,m;if(t[6]!==n||t[7]!==r){let e=Qe(n.startProgress?.startedAt);l=!!n.publicUrl&&n.state!==`connected`&&n.startProgress?.phase!==`registering`,u=`mt-3 space-y-3 rounded-lg bg-surface-panel/80 p-3 shadow-surface`;let i;t[13]===r.startProgressTitle?i=t[14]:(i=(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:r.startProgressTitle}),t[13]=r.startProgressTitle,t[14]=i);let a;t[15]===r.startProgressHint?a=t[16]:(a=(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:r.startProgressHint}),t[15]=r.startProgressHint,t[16]=a),t[17]!==i||t[18]!==a?(f=(0,$.jsxs)(`div`,{children:[i,a]}),t[17]=i,t[18]=a,t[19]=f):f=t[19];let o=qe.map(e=>{let t=Ye(e,n),i=Xe(r,e,n);return(0,$.jsxs)(`li`,{className:`flex gap-2 text-xs`,children:[(0,$.jsx)(`span`,{className:`mt-0.5 shrink-0 text-fg-subtle`,"aria-hidden":!0,children:t===`done`?(0,$.jsx)(s,{className:`size-3.5 text-emerald-600 dark:text-emerald-400`}):t===`active`?(0,$.jsx)(z,{className:`size-3.5 animate-spin text-accent`}):(0,$.jsx)(P,{className:`size-3.5`})}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`div`,{className:d(`font-medium`,t===`active`?`text-fg`:t===`done`?`text-fg-muted`:`text-fg-subtle`),children:Ze(r,e)}),i?(0,$.jsx)(`div`,{className:`mt-0.5 text-fg-muted`,children:i}):null,e===`preparing_frpc`&&t===`active`&&n.frpcDownload&&n.frpcDownload.phase===`downloading`?(0,$.jsxs)(`div`,{className:`mt-2 space-y-1`,children:[(0,$.jsx)(`div`,{className:`h-1.5 w-full overflow-hidden rounded-full bg-surface-panel`,children:(0,$.jsx)(`div`,{className:d(`h-full rounded-full bg-accent transition-[width] duration-300`,n.frpcDownload.percent==null&&`w-1/3 animate-pulse`),style:n.frpcDownload.percent==null?void 0:{width:`${n.frpcDownload.percent}%`}})}),n.frpcDownload.bytesReceived!=null&&n.frpcDownload.totalBytes?(0,$.jsxs)(`p`,{className:`text-fg-subtle`,children:[Ke(n.frpcDownload.bytesReceived),` /`,` `,Ke(n.frpcDownload.totalBytes)]}):null]}):null,e===`preparing_frpc`&&t===`active`&&n.frpcDownload?.url?(0,$.jsxs)(`p`,{className:`mt-2 text-fg-subtle`,children:[(0,$.jsxs)(`span`,{className:`font-sans`,children:[r.frpcDownloadingUrlLabel,`: `]}),(0,$.jsx)(`a`,{href:n.frpcDownload.url,target:`_blank`,rel:`noopener noreferrer`,className:`break-all font-mono text-[11px] text-accent hover:underline`,children:n.frpcDownload.url})]}):null]})]},e)});t[20]===o?p=t[21]:(p=(0,$.jsx)(`ol`,{className:`space-y-2`,children:o}),t[20]=o,t[21]=p),m=e&&n.startProgress?(0,$.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:r.startProgressElapsed.replace(`{{elapsed}}`,e)}):null,t[6]=n,t[7]=r,t[8]=l,t[9]=u,t[10]=f,t[11]=p,t[12]=m}else l=t[8],u=t[9],f=t[10],p=t[11],m=t[12];let h;t[22]!==l||t[23]!==r.publicUrlPendingNotice?(h=l?(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:r.publicUrlPendingNotice}):null,t[22]=l,t[23]=r.publicUrlPendingNotice,t[24]=h):h=t[24];let g;return t[25]!==u||t[26]!==f||t[27]!==p||t[28]!==m||t[29]!==h?(g=(0,$.jsxs)(`div`,{className:u,children:[f,p,m,h]}),t[25]=u,t[26]=f,t[27]=p,t[28]=m,t[29]=h,t[30]=g):g=t[30],g}function et(e){return e+1}function tt(e,t){return t.state===`connected`?e.statusConnected:t.state===`error`?e.statusError:t.startProgress?.phase===`reconnecting_frpc`?e.statusReconnecting:t.startProgress?.phase===`starting_frpc`?e.statusStartingFrpc:t.startProgress?.phase===`registering`?e.statusRegistering:t.startProgress?.phase===`preparing_frpc`||t.frpcDownload?e.statusPreparingFrpc:t.state===`connecting`||t.state===`reconnecting`?e.statusConnecting:e.statusOff}function nt(e){return e.state===`connected`?`connected`:e.state===`error`?`error`:e.state===`connecting`||e.state===`reconnecting`||e.startProgress||e.frpcDownload?`progress`:`off`}function rt(e){switch(e){case`connected`:return`bg-emerald-500/15 text-emerald-700 dark:text-emerald-400`;case`progress`:return`bg-amber-500/15 text-amber-700 dark:text-amber-400`;case`error`:return`bg-red-500/15 text-red-700 dark:text-red-400`;default:return`bg-surface-hover text-fg-muted`}}function it(e){if(!e)return`—`;let t=Date.now()-new Date(e).getTime();if(t<0)return`—`;let n=Math.floor(t/6e4);return n<60?`${n}m`:`${Math.floor(n/60)}h ${n%60}m`}function at(e){let t=(0,Q.c)(61),{t:n,status:r,isLoading:i,statusErr:a,starting:o,stopping:s,showConsentExpired:c,copyLabels:l,startDisabled:u,startDisabledReason:f,stepLabel:p,onStart:m,onStop:h}=e,g=u===void 0?!1:u,_,v,y,b,x,S,C;t[0]!==r||t[1]!==o?(C=nt(r),_=r.enabled||o,v=o||r.state===`connecting`||r.state===`reconnecting`||!!r.startProgress||!!r.frpcDownload,t[9]===Symbol.for(`react.memo_cache_sentinel`)?(S=d(le(),`space-y-4`),t[9]=S):S=t[9],x=`flex flex-wrap items-start justify-between gap-3`,b=`flex items-center gap-2`,y=d(`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium`,rt(C)),t[0]=r,t[1]=o,t[2]=_,t[3]=v,t[4]=y,t[5]=b,t[6]=x,t[7]=S,t[8]=C):(_=t[2],v=t[3],y=t[4],b=t[5],x=t[6],S=t[7],C=t[8]);let w=C===`connected`&&`bg-emerald-500`,T=C===`progress`&&`bg-amber-500 animate-pulse`,E=C===`error`&&`bg-red-500`,D=C===`off`&&`bg-fg-subtle`,O;t[10]!==w||t[11]!==T||t[12]!==E||t[13]!==D?(O=d(`size-1.5 rounded-full`,w,T,E,D),t[10]=w,t[11]=T,t[12]=E,t[13]=D,t[14]=O):O=t[14];let k;t[15]===O?k=t[16]:(k=(0,$.jsx)(`span`,{className:O,"aria-hidden":!0}),t[15]=O,t[16]=k);let A;t[17]!==i||t[18]!==r||t[19]!==n?(A=i&&!r.enabled?(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block h-3 w-16 animate-pulse rounded-full bg-surface-hover/70 motion-reduce:animate-none`}):tt(n,r),t[17]=i,t[18]=r,t[19]=n,t[20]=A):A=t[20];let j;t[21]!==k||t[22]!==A||t[23]!==y?(j=(0,$.jsxs)(`span`,{className:y,children:[k,A]}),t[21]=k,t[22]=A,t[23]=y,t[24]=j):j=t[24];let M;t[25]!==r.connectedSince||t[26]!==r.state||t[27]!==n.uptime?(M=r.connectedSince&&r.state===`connected`?(0,$.jsxs)(`span`,{className:`text-xs text-fg-subtle`,children:[n.uptime,` `,it(r.connectedSince)]}):null,t[25]=r.connectedSince,t[26]=r.state,t[27]=n.uptime,t[28]=M):M=t[28];let N;t[29]!==j||t[30]!==M||t[31]!==b?(N=(0,$.jsxs)(`div`,{className:b,children:[j,M]}),t[29]=j,t[30]=M,t[31]=b,t[32]=N):N=t[32];let P;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,$.jsx)(J,{className:`size-4 text-fg-subtle`,strokeWidth:1.75,"aria-hidden":!0}),t[33]=P):P=t[33];let F;t[34]!==N||t[35]!==x?(F=(0,$.jsxs)(`div`,{className:x,children:[N,P]}),t[34]=N,t[35]=x,t[36]=F):F=t[36];let I;t[37]===a?I=t[38]:(I=a?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:a instanceof Error?a.message:String(a)}):null,t[37]=a,t[38]=I);let L;t[39]!==c||t[40]!==n.consentExpiredBanner?(L=c?(0,$.jsx)(`p`,{className:`rounded-lg bg-amber-500/10 px-3 py-2 text-xs text-fg-muted`,children:n.consentExpiredBanner}):null,t[39]=c,t[40]=n.consentExpiredBanner,t[41]=L):L=t[41];let B;t[42]!==_||t[43]!==l||t[44]!==m||t[45]!==h||t[46]!==v||t[47]!==r||t[48]!==g||t[49]!==f||t[50]!==o||t[51]!==p||t[52]!==s||t[53]!==n?(B=_?(0,$.jsxs)(`div`,{className:`space-y-4`,children:[r.publicUrl?(0,$.jsx)(`div`,{className:`rounded-xl bg-surface-panel/80 p-3 shadow-surface`,children:(0,$.jsx)(W,{label:n.publicUrlLabel,text:r.publicUrl,labels:l})}):null,v?(0,$.jsx)($e,{status:r,t:n}):null,r.lastError&&r.state===`error`?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:r.lastError}):null,(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:r.enabled?(0,$.jsxs)(R,{type:`button`,variant:`secondary`,disabled:s,onClick:h,children:[s?(0,$.jsx)(z,{className:`size-4 animate-spin`}):null,n.stop]}):(0,$.jsxs)(R,{type:`button`,disabled:o,onClick:m,children:[o?(0,$.jsx)(z,{className:`size-4 animate-spin`}):(0,$.jsx)(H,{className:`size-4`}),n.start]})})]}):(0,$.jsxs)(`div`,{className:`space-y-4`,children:[p?(0,$.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-fg-subtle`,children:p}):null,(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.emptyStateTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg-muted`,children:n.emptyStateBody})]}),(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg bg-amber-500/10 px-3 py-2.5 text-xs text-fg-muted`,children:[(0,$.jsx)(ee,{className:`mt-0.5 size-4 shrink-0 text-amber-600 dark:text-amber-400`}),(0,$.jsx)(`p`,{children:n.riskBannerBody})]}),g&&f?(0,$.jsx)(`p`,{className:`text-sm text-amber-800 dark:text-amber-200`,children:f}):null,(0,$.jsxs)(R,{type:`button`,disabled:o||g,onClick:m,className:`w-full sm:w-auto`,children:[o?(0,$.jsx)(z,{className:`size-4 animate-spin`}):(0,$.jsx)(H,{className:`size-4`}),n.start]})]}),t[42]=_,t[43]=l,t[44]=m,t[45]=h,t[46]=v,t[47]=r,t[48]=g,t[49]=f,t[50]=o,t[51]=p,t[52]=s,t[53]=n,t[54]=B):B=t[54];let V;return t[55]!==F||t[56]!==I||t[57]!==L||t[58]!==B||t[59]!==S?(V=(0,$.jsxs)(`section`,{className:S,children:[F,I,L,B]}),t[55]=F,t[56]=I,t[57]=L,t[58]=B,t[59]=S,t[60]=V):V=t[60],V}var ot={reconfiguring:!1};function st(e){let t=(0,Q.c)(89),{t:n,brokerSecretReady:r,brokerSecretConfiguredInConfig:i,brokerSecretMaskedValue:a,brokerSecretDraft:o,savingBrokerSecret:c,authorizingBrokerSecret:u,brokerSecretAuthorizationUrl:f,brokerSecretNotice:p,copyFailedLabel:m,onDraftChange:h,onSave:g,onAuthorize:_,onClear:v,sectionRef:y}=e,b=(0,Z.useId)(),x=r,S=!x,[C,w]=(0,Z.useReducer)(te,ot),{reconfiguring:T}=C,D;t[0]!==i||t[1]!==o||t[2]!==T?(D=i&&!T&&!o.trim(),t[0]=i,t[1]=o,t[2]=T,t[3]=D):D=t[3];let O=D,k;t[4]!==n.copied||t[5]!==n.copyKey||t[6]!==n.hideKey||t[7]!==n.showKey?(k={show:n.showKey,hide:n.hideKey,copy:n.copyKey,copied:n.copied},t[4]=n.copied,t[5]=n.copyKey,t[6]=n.hideKey,t[7]=n.showKey,t[8]=k):k=t[8];let A=k,j;t[9]===o?j=t[10]:(j=o.trim().length>0&&!E(o.trim()),t[9]=o,t[10]=j);let N=j,P;t[11]===h?P=t[12]:(P=()=>{w({type:`patch`,patch:{reconfiguring:!1}}),h(``)},t[11]=h,t[12]=P);let F=P,I=S&&`ring-1 ring-amber-500/30`,L;t[13]===I?L=t[14]:(L=d(I),t[13]=I,t[14]=L);let B=x?`bg-emerald-500/10 text-emerald-600 dark:text-emerald-400`:S?`bg-amber-500/10 text-amber-700 dark:text-amber-400`:`bg-surface-hover text-fg-muted`,V;t[15]===B?V=t[16]:(V=d(`flex size-9 shrink-0 items-center justify-center rounded-lg`,B),t[15]=B,t[16]=V);let H;t[17]===x?H=t[18]:(H=x?(0,$.jsx)(s,{className:`size-4`,strokeWidth:2,"aria-hidden":!0}):(0,$.jsx)(ne,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),t[17]=x,t[18]=H);let U;t[19]!==V||t[20]!==H?(U=(0,$.jsx)(`span`,{className:V,children:H}),t[19]=V,t[20]=H,t[21]=U):U=t[21];let W=x?n.brokerSecretReadyTitle:n.brokerSecretStepTitle,ee;t[22]===W?ee=t[23]:(ee=(0,$.jsx)(`p`,{className:`text-sm font-semibold text-fg`,children:W}),t[22]=W,t[23]=ee);let G=x?n.brokerSecretReadyHint:n.brokerSecretHint,K;t[24]===G?K=t[25]:(K=(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg-muted`,children:G}),t[24]=G,t[25]=K);let re;t[26]!==S||t[27]!==n.brokerSecretMissingHint?(re=S?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-amber-800 dark:text-amber-200`,children:n.brokerSecretMissingHint}):null,t[26]=S,t[27]=n.brokerSecretMissingHint,t[28]=re):re=t[28];let q;t[29]!==ee||t[30]!==K||t[31]!==re?(q=(0,$.jsxs)(`div`,{children:[ee,K,re]}),t[29]=ee,t[30]=K,t[31]=re,t[32]=q):q=t[32];let J;t[33]!==u||t[34]!==S||t[35]!==_||t[36]!==T||t[37]!==c||t[38]!==n.brokerSecretAuthorize||t[39]!==n.brokerSecretAuthorizing||t[40]!==n.brokerSecretConsoleLink?(J=S||T?(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsxs)(R,{type:`button`,disabled:c||u,onClick:_,children:[u?(0,$.jsx)(z,{className:`size-4 animate-spin`}):null,u?n.brokerSecretAuthorizing:n.brokerSecretAuthorize]}),(0,$.jsxs)(`a`,{href:be,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex w-fit items-center gap-1 text-xs font-medium text-accent-fg hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[n.brokerSecretConsoleLink,(0,$.jsx)(l,{className:`size-3`,"aria-hidden":!0})]})]}):null,t[33]=u,t[34]=S,t[35]=_,t[36]=T,t[37]=c,t[38]=n.brokerSecretAuthorize,t[39]=n.brokerSecretAuthorizing,t[40]=n.brokerSecretConsoleLink,t[41]=J):J=t[41];let ie;t[42]!==u||t[43]!==f||t[44]!==n.brokerSecretOpenAuthorization?(ie=u&&f?(0,$.jsxs)(`a`,{href:f,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex w-fit items-center gap-1 text-xs font-medium text-accent-fg hover:underline`,children:[n.brokerSecretOpenAuthorization,(0,$.jsx)(l,{className:`size-3`,"aria-hidden":!0})]}):null,t[42]=u,t[43]=f,t[44]=n.brokerSecretOpenAuthorization,t[45]=ie):ie=t[45];let ae;t[46]!==i||t[47]!==o||t[48]!==a||t[49]!==N||t[50]!==F||t[51]!==m||t[52]!==b||t[53]!==S||t[54]!==v||t[55]!==h||t[56]!==g||t[57]!==T||t[58]!==c||t[59]!==A||t[60]!==O||t[61]!==n.brokerSecretCancelReconfigure||t[62]!==n.brokerSecretClear||t[63]!==n.brokerSecretMaskedHelp||t[64]!==n.brokerSecretNotInConfigFile||t[65]!==n.brokerSecretPlaceholder||t[66]!==n.brokerSecretReconfigure||t[67]!==n.brokerSecretRevealFailed||t[68]!==n.brokerSecretSave||t[69]!==n.brokerSecretSaveAndContinue||t[70]!==n.brokerSecretTitle?(ae=O?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`label`,{className:`sr-only`,htmlFor:b,children:n.brokerSecretTitle}),(0,$.jsx)(M,{id:b,value:a,labels:A,reveal:ct,loadFailedLabel:m||n.brokerSecretRevealFailed,maskedHelp:n.brokerSecretMaskedHelp,notInConfigFile:n.brokerSecretNotInConfigFile,readOnly:!0}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsx)(R,{type:`button`,variant:`secondary`,disabled:c,onClick:()=>{w({type:`patch`,patch:{reconfiguring:!0}})},children:n.brokerSecretReconfigure}),(0,$.jsx)(R,{type:`button`,variant:`ghost`,disabled:c,onClick:v,children:n.brokerSecretClear})]})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`label`,{className:`sr-only`,htmlFor:b,children:n.brokerSecretTitle}),(0,$.jsx)(M,{id:b,value:o,onChange:h,placeholder:n.brokerSecretPlaceholder,labels:A,disabled:c}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsxs)(R,{type:`button`,disabled:c||!N,onClick:g,children:[c?(0,$.jsx)(z,{className:`size-4 animate-spin`}):null,S?n.brokerSecretSaveAndContinue:n.brokerSecretSave]}),i?(0,$.jsx)(R,{type:`button`,variant:`ghost`,disabled:c,onClick:v,children:n.brokerSecretClear}):null,T?(0,$.jsx)(R,{type:`button`,variant:`ghost`,disabled:c,onClick:F,children:n.brokerSecretCancelReconfigure}):null]})]}),t[46]=i,t[47]=o,t[48]=a,t[49]=N,t[50]=F,t[51]=m,t[52]=b,t[53]=S,t[54]=v,t[55]=h,t[56]=g,t[57]=T,t[58]=c,t[59]=A,t[60]=O,t[61]=n.brokerSecretCancelReconfigure,t[62]=n.brokerSecretClear,t[63]=n.brokerSecretMaskedHelp,t[64]=n.brokerSecretNotInConfigFile,t[65]=n.brokerSecretPlaceholder,t[66]=n.brokerSecretReconfigure,t[67]=n.brokerSecretRevealFailed,t[68]=n.brokerSecretSave,t[69]=n.brokerSecretSaveAndContinue,t[70]=n.brokerSecretTitle,t[71]=ae):ae=t[71];let oe;t[72]===p?oe=t[73]:(oe=p?(0,$.jsx)(`p`,{className:`text-xs text-emerald-700 dark:text-emerald-400`,children:p}):null,t[72]=p,t[73]=oe);let se;t[74]!==q||t[75]!==J||t[76]!==ie||t[77]!==ae||t[78]!==oe?(se=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-3`,children:[q,J,ie,ae,oe]}),t[74]=q,t[75]=J,t[76]=ie,t[77]=ae,t[78]=oe,t[79]=se):se=t[79];let ce;t[80]!==U||t[81]!==se?(ce=(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[U,se]}),t[80]=U,t[81]=se,t[82]=ce):ce=t[82];let Y;t[83]!==ce||t[84]!==L?(Y=(0,$.jsx)(ue,{className:L,children:ce}),t[83]=ce,t[84]=L,t[85]=Y):Y=t[85];let le;return t[86]!==y||t[87]!==Y?(le=(0,$.jsx)(`div`,{ref:y,id:`tunnel-broker-secret-setup`,children:Y}),t[86]=y,t[87]=Y,t[88]=le):le=t[88],le}function ct(){return _e().then(lt)}function lt(e){return e.registrationSecret??null}var ut={actionError:null,starting:!1,stopping:!1,savingAutoStart:!1,consentOpen:!1,autoStartConfirmOpen:!1,releaseConfirmOpen:!1,releasing:!1,brokerSecretDraft:``,savingBrokerSecret:!1,authorizingBrokerSecret:!1,brokerSecretAuthorizationUrl:null,brokerSecretNotice:null};function dt({embedded:e=!1}){let t=p(e=>e.language),n=u(t).tunnelSettings,r=!!f(e=>e.conversationId),[i,a]=(0,Z.useReducer)(te,ut),{actionError:o,starting:s,stopping:c,savingAutoStart:l,consentOpen:m,autoStartConfirmOpen:h,releaseConfirmOpen:g,releasing:_,brokerSecretDraft:v,savingBrokerSecret:y,authorizingBrokerSecret:b,brokerSecretAuthorizationUrl:T,brokerSecretNotice:D}=i,k=(0,Z.useRef)(null),{data:A}=C(r),{data:M,error:N,isLoading:P,mutate:I}=x(r?`tunnel-status`:null,ge,{refreshInterval:e=>s?1e3:e?.frpcDownload||e?.state===`connecting`||e?.state===`reconnecting`?2e3:6e4}),V=(0,Z.useMemo)(()=>{let e=A?.payload?.config;if(e&&typeof e==`object`&&!Array.isArray(e)){let t=e.tunnel;if(t&&typeof t==`object`&&!Array.isArray(t)&&t.autoStart===!0)return!0}return M?.config?.autoStart===!0},[A,M?.config?.autoStart]),H=(0,Z.useMemo)(()=>{let e=A?.payload?.config;if(e&&typeof e==`object`&&!Array.isArray(e)){let t=e.tunnel;if(t&&typeof t==`object`&&!Array.isArray(t)){let e=t.registrationSecret;if(typeof e==`string`)return e}}return``},[A]),U=E(H),W=M?.registrationSecret?.configured??U;(0,Z.useEffect)(()=>{let e=()=>{I()};return window.addEventListener(`tunnel-status`,e),()=>window.removeEventListener(`tunnel-status`,e)},[I]);let ee=(0,Z.useMemo)(()=>[n.consentBullet1,n.consentBullet2,n.consentBullet3],[n.consentBullet1,n.consentBullet2,n.consentBullet3]),G=(0,Z.useCallback)(async()=>{a({type:`patch`,patch:{actionError:null}}),a({type:`patch`,patch:{starting:!0}});try{await ye(),await I(),S()}catch(e){a({type:`patch`,patch:{actionError:e instanceof Error?e.message:String(e)}})}finally{a({type:`patch`,patch:{starting:!1}})}},[I]),K=(0,Z.useCallback)(()=>{if(!W){a({type:`patch`,patch:{actionError:n.brokerSecretRequiredBeforeStart}}),k.current?.scrollIntoView({behavior:`smooth`,block:`start`});return}if(M?.consentRequired){a({type:`patch`,patch:{consentOpen:!0}});return}G()},[W,M?.consentRequired,G,n.brokerSecretRequiredBeforeStart]),ne=(0,Z.useCallback)(async()=>{a({type:`patch`,patch:{consentOpen:!1}}),a({type:`patch`,patch:{actionError:null}});try{await de(),await Promise.all([I(),G()])}catch(e){a({type:`patch`,patch:{actionError:e instanceof Error?e.message:String(e)}})}},[I,G]),re=(0,Z.useCallback)(async()=>{a({type:`patch`,patch:{actionError:null}}),a({type:`patch`,patch:{stopping:!0}});try{await pe(),await I(),S()}catch(e){a({type:`patch`,patch:{actionError:e instanceof Error?e.message:String(e)}})}finally{a({type:`patch`,patch:{stopping:!1}})}},[I]),q=(0,Z.useCallback)(async e=>{a({type:`patch`,patch:{savingAutoStart:!0}}),a({type:`patch`,patch:{actionError:null}});try{await ve({autoStart:e}),S()}catch(e){a({type:`patch`,patch:{actionError:e instanceof Error?e.message:String(e)}})}finally{a({type:`patch`,patch:{savingAutoStart:!1}})}},[]),ie=(0,Z.useCallback)(()=>{if(V){q(!1);return}if(M?.consentRequired){a({type:`patch`,patch:{actionError:n.consentExpiredBanner}});return}if(!M?.canAutoStart){a({type:`patch`,patch:{actionError:n.autoStartHint}});return}a({type:`patch`,patch:{autoStartConfirmOpen:!0}})},[q,M?.canAutoStart,M?.consentRequired,n,V]),oe=(0,Z.useCallback)(async()=>{let e=v.trim();if(e){a({type:`patch`,patch:{savingBrokerSecret:!0,actionError:null,brokerSecretNotice:null}});try{await ve({registrationSecret:e}),a({type:`patch`,patch:{brokerSecretDraft:``,brokerSecretNotice:n.brokerSecretSaved}}),S(),await I(),a({type:`patch`,patch:{actionError:null}})}catch(e){a({type:`patch`,patch:{actionError:e instanceof Error?e.message:String(e)}})}finally{a({type:`patch`,patch:{savingBrokerSecret:!1}})}}},[v,I,n.brokerSecretSaved]),se=(0,Z.useCallback)(async()=>{a({type:`patch`,patch:{savingBrokerSecret:!0,actionError:null,brokerSecretNotice:null}});try{await ve({registrationSecret:null}),a({type:`patch`,patch:{brokerSecretDraft:``,brokerSecretNotice:n.brokerSecretCleared}}),S(),await I()}catch(e){a({type:`patch`,patch:{actionError:e instanceof Error?e.message:String(e)}})}finally{a({type:`patch`,patch:{savingBrokerSecret:!1}})}},[I,n.brokerSecretCleared]),ce=(0,Z.useCallback)(async()=>{let e=j(),t=null,r=null;a({type:`patch`,patch:{authorizingBrokerSecret:!0,brokerSecretAuthorizationUrl:null,brokerSecretNotice:null,actionError:null}});try{for(t=(await L(`xopc-tunnel`)).sessionId;;){await new Promise(e=>window.setTimeout(e,1e3));let i=await ae(t);if(i.authUrl&&i.authUrl!==r&&(r=i.authUrl,a({type:`patch`,patch:{brokerSecretAuthorizationUrl:i.authUrl}}),await O(i.authUrl,e)),i.status===`failed`||i.status===`cancelled`)throw Error(i.error??i.message??`OAuth authorization failed`);if(i.status===`completed`){await he(),await Promise.all([I(),S()]),a({type:`patch`,patch:{brokerSecretNotice:n.brokerSecretSaved,brokerSecretDraft:``}});return}}}catch(e){a({type:`patch`,patch:{actionError:e instanceof Error?e.message:String(e)}})}finally{w(e),t&&F(t).catch(()=>void 0),a({type:`patch`,patch:{authorizingBrokerSecret:!1,brokerSecretAuthorizationUrl:null}})}},[I,n.brokerSecretSaved]),Y=(0,Z.useCallback)(async()=>{a({type:`patch`,patch:{releaseConfirmOpen:!1,actionError:null,releasing:!0}});try{await pe({release:!0}),await I(),S()}catch(e){a({type:`patch`,patch:{actionError:e instanceof Error?e.message:String(e)}})}finally{a({type:`patch`,patch:{releasing:!1}})}},[I]),le=(0,Z.useMemo)(()=>({copy:n.copyUrl,copied:n.copied,copyFailed:u(t).clipboard.copyFailed}),[t,n.copyUrl,n.copied]);if(!r)return(0,$.jsx)(`div`,{className:e?void 0:`w-full px-3 py-8 sm:px-5 xl:px-6`,children:(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.needToken})});let X=M??{enabled:!1,state:`disconnected`,subdomain:null,publicUrl:null,connectedSince:null,frpcPid:null,lastHeartbeatAt:null,lastError:null,consentRequired:!0,config:{autoStart:V,brokerUrl:`https://frp.xopc.ai/api`}},me=M?.consentRequired&&(X.enabled||V||M?.consent?.acceptedAt),_e=(0,$.jsx)(st,{t:n,brokerSecretReady:W,brokerSecretConfiguredInConfig:U,brokerSecretMaskedValue:U?H:``,brokerSecretDraft:v,savingBrokerSecret:y,authorizingBrokerSecret:b,brokerSecretAuthorizationUrl:T,brokerSecretNotice:D,copyFailedLabel:u(t).clipboard.copyFailed,onDraftChange:e=>a({type:`patch`,patch:{brokerSecretDraft:e}}),onSave:()=>void oe(),onAuthorize:()=>void ce(),onClear:()=>void se(),sectionRef:k}),be=(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ue,{open:m,title:n.consentTitle,intro:n.consentIntro,bullets:ee,checkboxLabel:n.consentCheckbox,confirmLabel:me?n.consentReconfirm:n.consentConfirm,cancelLabel:n.consentCancel,onConfirm:()=>void ne(),onCancel:()=>a({type:`patch`,patch:{consentOpen:!1}})},m?`consent-open`:`consent-closed`),(0,$.jsx)(B,{open:h,title:n.autoStartConfirmTitle,description:n.autoStartConfirmBody,confirmLabel:n.autoStartConfirmLabel,cancelLabel:n.consentCancel,onConfirm:()=>{a({type:`patch`,patch:{autoStartConfirmOpen:!1}}),q(!0)},onCancel:()=>a({type:`patch`,patch:{autoStartConfirmOpen:!1}})}),(0,$.jsx)(B,{open:g,title:n.releaseConfirmTitle,description:n.releaseConfirmBody,confirmLabel:n.releaseConfirmLabel,cancelLabel:n.consentCancel,destructive:!0,onConfirm:()=>void Y(),onCancel:()=>a({type:`patch`,patch:{releaseConfirmOpen:!1}})})]});return e?(0,$.jsxs)(`div`,{className:`flex w-full flex-col gap-4`,children:[o?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:o}):null,_e,(0,$.jsx)(at,{t:n,status:X,isLoading:P,statusErr:N,starting:s,stopping:c,showConsentExpired:!!me,copyLabels:le,startDisabled:!W,startDisabledReason:W?void 0:n.brokerSecretRequiredBeforeStart,stepLabel:n.flowStepStart,onStart:K,onStop:()=>void re()}),(0,$.jsxs)(Ve,{showLabel:n.showOptions,hideLabel:n.hideOptions,children:[(0,$.jsxs)(`label`,{className:d(`flex items-center gap-3 text-sm text-fg`,!V&&!M?.canAutoStart?`cursor-not-allowed opacity-60`:`cursor-pointer`),children:[(0,$.jsx)(`input`,{type:`checkbox`,className:`size-4 rounded border-edge accent-accent`,checked:V,disabled:l||!V&&!M?.canAutoStart,onChange:ie}),n.autoStart]}),!M?.canAutoStart&&!V?(0,$.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:n.autoStartHint}):null,X.subdomain||X.publicUrl?(0,$.jsxs)(`div`,{className:`space-y-2 rounded-xl bg-surface-base/45 p-4`,children:[(0,$.jsxs)(R,{type:`button`,variant:`secondary`,disabled:_||c,className:`border-danger/40 text-danger hover:bg-danger/10`,onClick:()=>a({type:`patch`,patch:{releaseConfirmOpen:!0}}),children:[_?(0,$.jsx)(z,{className:`size-4 animate-spin`}):null,n.release]}),(0,$.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:n.releaseHint})]}):null]}),(0,$.jsx)(Ve,{showLabel:n.showAdvanced,hideLabel:n.hideAdvanced,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-base/45 p-4 text-xs text-fg-subtle`,children:[(0,$.jsxs)(`p`,{className:`flex items-start gap-2`,children:[(0,$.jsx)(J,{className:`mt-0.5 size-4 shrink-0 text-accent`}),(0,$.jsx)(`span`,{children:n.brokerNote})]}),(0,$.jsx)(fe,{language:t,label:n.brokerDocsLink,section:`public-tunnel`,className:`text-xs`})]})}),be]}):(0,$.jsxs)(`div`,{className:e?`flex w-full flex-col gap-6`:`flex w-full flex-col gap-6 px-3 py-8 sm:px-5 xl:px-6`,children:[e?null:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h1`,{className:`text-lg font-semibold text-fg`,children:n.title}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:n.subtitle})]}),o?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:o}):null,_e,(0,$.jsx)(at,{t:n,status:X,isLoading:P,statusErr:N,starting:s,stopping:c,showConsentExpired:!!me,copyLabels:le,startDisabled:!W,startDisabledReason:W?void 0:n.brokerSecretRequiredBeforeStart,onStart:K,onStop:()=>void re()}),X.subdomain||X.publicUrl?(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,$.jsxs)(R,{type:`button`,variant:`secondary`,disabled:_||c,className:`border-danger/40 text-danger hover:bg-danger/10`,onClick:()=>a({type:`patch`,patch:{releaseConfirmOpen:!0}}),children:[_?(0,$.jsx)(z,{className:`size-4 animate-spin`}):null,n.release]})}):null,X.subdomain||X.publicUrl?(0,$.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:n.releaseHint}):null,(0,$.jsxs)(ue,{children:[(0,$.jsx)(`h2`,{className:`mb-3 text-sm font-semibold text-fg`,children:n.optionsTitle}),(0,$.jsxs)(`label`,{className:d(`flex items-center gap-3 text-sm text-fg`,!V&&!M?.canAutoStart?`cursor-not-allowed opacity-60`:`cursor-pointer`),children:[(0,$.jsx)(`input`,{type:`checkbox`,className:`size-4 rounded border-edge accent-accent`,checked:V,disabled:l||!V&&!M?.canAutoStart,onChange:ie}),n.autoStart]}),!M?.canAutoStart&&!V?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-subtle`,children:n.autoStartHint}):null]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg bg-surface-panel/80 px-3 py-2 text-xs text-fg-subtle shadow-surface`,children:[(0,$.jsxs)(`p`,{className:`flex items-start gap-2`,children:[(0,$.jsx)(J,{className:`mt-0.5 size-4 shrink-0 text-accent`}),(0,$.jsx)(`span`,{children:n.brokerNote})]}),(0,$.jsx)(fe,{language:t,label:n.brokerDocsLink,section:`public-tunnel`,className:`text-xs`})]}),be]})}function ft(e,t){return e.tabs[t]}function pt(e,t){return e.tabIntro[t]}function mt(e){switch(e){case`tailscale`:return`tailscale-serve`;case`public`:return`public-tunnel`;case`reverse-proxy`:return`reverse-proxy`;case`ssh`:return`ssh-tunnel`;case`lan`:return`lan`;default:return}}function ht(e){let t=(0,Q.c)(7),{tab:n,onOpenTab:r}=e;switch(n){case`guide`:{let e;return t[0]===r?e=t[1]:(e=(0,$.jsx)(Ae,{onOpenTab:r}),t[0]=r,t[1]=e),e}case`tailscale`:{let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(xe,{embedded:!0}),t[2]=e):e=t[2],e}case`public`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(dt,{embedded:!0}),t[3]=e):e=t[3],e}case`reverse-proxy`:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(X,{}),t[4]=e):e=t[4],e}case`ssh`:{let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Re,{}),t[5]=e):e=t[5],e}case`lan`:{let e;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Pe,{}),t[6]=e):e=t[6],e}}}function gt(){let e=(0,Q.c)(3),t=i(),n=p(vt),r=u(n).remoteAccess,o=!!f(_t),[s,c]=a(),l=D(),d=Be(s.get(`tab`)),m=s.get(`intent`)===`mobile-pairing`,h;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(h={refreshInterval:2e3},e[0]=h):h=e[0];let g=x(m?`device-pairing-readiness`:null,me,h),_;e[1]===c?_=e[2]:(_=e=>{c(t=>{let n=new URLSearchParams(t);return e===`guide`?n.delete(`tab`):n.set(`tab`,e),n},{replace:!0})},e[1]=c,e[2]=_);let v=_,y=pt(r,d),b=ze.filter(e=>l||e!==`ssh`&&e!==`reverse-proxy`||e===d).map(e=>({id:e,label:ft(r,e)}));return(0,$.jsxs)(se,{children:[(0,$.jsx)(oe,{title:r.pageTitle,meta:(0,$.jsx)(fe,{language:n,label:r.docsLink,section:mt(d),className:`mt-1`})}),o?(0,$.jsxs)($.Fragment,{children:[m?(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-xl bg-accent-soft px-4 py-3`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,$.jsx)(A,{className:`mt-0.5 size-5 shrink-0 text-accent`,"aria-hidden":!0}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:r.mobilePairingFlow.title}),(0,$.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:g.data?.ready?r.mobilePairingFlow.ready:r.mobilePairingFlow.hint})]})]}),(0,$.jsxs)(R,{variant:`primary`,disabled:!g.data?.ready,onClick:()=>t(`/settings/devices?startDevicePairing=mobile`),children:[g.data?.ready?r.mobilePairingFlow.continue:r.mobilePairingFlow.waiting,(0,$.jsx)(I,{className:`size-4`,"aria-hidden":!0})]})]}):null,(0,$.jsx)(U,{items:b,activeTab:d,onChange:v,ariaLabel:r.tabsAria,tabIdPrefix:`remote-access-tab`,panelIdPrefix:`remote-access-panel`}),(0,$.jsx)(ce,{id:d,activeTab:d,tabIdPrefix:`remote-access-tab`,panelIdPrefix:`remote-access-panel`,title:ft(r,d),hint:d===`public`?void 0:y,showHeading:!1,framed:!1,children:(0,$.jsx)(ht,{tab:d,onOpenTab:v})})]}):(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:r.guide.needToken})]})}function _t(e){return e.conversationId}function vt(e){return e.language}export{gt as RemoteAccessHub};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{f as i,g as a,t as o}from"./chunk-KS7C4IRE-B2HK1psj.js";import{t as s}from"./check-DUBLcKHA.js";import{t as c}from"./copy-Dv6d4Dvw.js";import{t as l}from"./external-link-DjqjBmc3.js";import{t as u}from"./messages-DPxcWxfD.js";import{t as d}from"./cn-0WouolD0.js";import{c as f,n as p}from"./locale-store-Djl2FW6_.js";import{a as m,i as h,o as g,r as _,s as v,t as y}from"./dist-BGTk37IG.js";import{t as b}from"./copy-to-clipboard-HOJ79TWv.js";import{i as x}from"./vendor-swr-BIWyz7Rc.js";import{n as S,r as C}from"./gateway-config-swr-Di9g6pE8.js";import{F as w,G as T,Gt as E,Hn as D,I as O,Jl as k,Kl as A,L as j,Ns as M,Pl as N,Qd as P,Rt as F,Tf as I,Vt as L,Wc as R,Wu as z,Za as B,eu as V,fu as H,is as U,ja as W,kl as ee,ku as G,lf as K,no as te,sd as ne,sf as re,vs as q,xd as J,ys as ie,zt as ae}from"./index-Dsp_gNdl.js";import{n as oe,r as se,t as ce}from"./settings-page-layout-Dx5S-Msc.js";import{n as Y,r as le,t as ue}from"./settings-form-section-B3eODxNv.js";import{_ as X,a as de,b as fe,c as pe,h as me,i as he,n as ge,o as _e,r as ve,s as ye,t as be,v as xe,y as Se}from"./tunnel-api-BgdhbR1L.js";import{t as Ce}from"./settings-advanced-gate-F1WX7vxq.js";var Z=e(t(),1),Q=n(),$=r();function we(e){switch(e){case`active`:return`text-emerald-700 dark:text-emerald-400`;case`connecting`:return`text-amber-700 dark:text-amber-400`;default:return`text-fg-muted`}}function Te(e){let t=(0,Q.c)(11),{label:n,kind:r}=e,i;t[0]===r?i=t[1]:(i=d(`inline-flex items-center gap-1.5 text-xs font-medium`,we(r)),t[0]=r,t[1]=i);let a=r===`active`&&`bg-emerald-500`,o=r===`connecting`&&`bg-amber-500`,s;t[2]!==a||t[3]!==o?(s=d(`size-1.5 rounded-full bg-fg-subtle/50`,a,o),t[2]=a,t[3]=o,t[4]=s):s=t[4];let c;t[5]===s?c=t[6]:(c=(0,$.jsx)(`span`,{className:s,"aria-hidden":!0}),t[5]=s,t[6]=c);let l;return t[7]!==n||t[8]!==i||t[9]!==c?(l=(0,$.jsxs)(`span`,{className:i,children:[c,n]}),t[7]=n,t[8]=i,t[9]=c,t[10]=l):l=t[10],l}function Ee(e){let t=(0,Q.c)(31),{onOpenTab:n}=e,r=p(Oe),i;t[0]===r?i=t[1]:(i=u(r),t[0]=r,t[1]=i);let a=i.remoteAccess.guide,o=!!f(De),s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s={refreshInterval:3e4},t[2]=s):s=t[2];let{data:c}=x(o?`exposure-status`:null,Se,s),l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l={refreshInterval:15e3},t[3]=l):l=t[3];let{data:m}=x(o?`tunnel-status`:null,ge,l),h=C(o);if(!o)return null;let g=c?.tailscale.active===!0,_=m?.state,v=m?.enabled&&_===`connected`,y=m?.enabled&&(_===`connecting`||_===`reconnecting`||!!m?.startProgress||!!m?.frpcDownload),b=h.data?.payload?.config,S=!!(b&&typeof b==`object`&&!Array.isArray(b)&&b.gateway?.publicUrl),w=g?`active`:`off`,T=g?a.statusActive:a.statusOff,E;t[4]!==a.tailscaleCardTitle||t[5]!==w||t[6]!==T?(E={tab:`tailscale`,icon:J,title:a.tailscaleCardTitle,kind:w,statusLabel:T},t[4]=a.tailscaleCardTitle,t[5]=w,t[6]=T,t[7]=E):E=t[7];let D=v?`active`:y?`connecting`:`off`,O=v?a.statusActive:y?a.statusConnecting:a.statusOff,A;t[8]!==a.publicCardTitle||t[9]!==D||t[10]!==O?(A={tab:`public`,icon:G,title:a.publicCardTitle,kind:D,statusLabel:O},t[8]=a.publicCardTitle,t[9]=D,t[10]=O,t[11]=A):A=t[11];let j=S?`active`:`off`,M=S?a.statusActive:a.statusOff,P;t[12]!==a.reverseProxyCardTitle||t[13]!==j||t[14]!==M?(P={tab:`reverse-proxy`,icon:k,title:a.reverseProxyCardTitle,kind:j,statusLabel:M},t[12]=a.reverseProxyCardTitle,t[13]=j,t[14]=M,t[15]=P):P=t[15];let F;t[16]!==a.sshCardStatus||t[17]!==a.sshCardTitle?(F={tab:`ssh`,icon:N,title:a.sshCardTitle,kind:`off`,statusLabel:a.sshCardStatus},t[16]=a.sshCardStatus,t[17]=a.sshCardTitle,t[18]=F):F=t[18];let I;t[19]!==a.lanCardStatus||t[20]!==a.lanCardTitle?(I={tab:`lan`,icon:V,title:a.lanCardTitle,kind:`off`,statusLabel:a.lanCardStatus},t[19]=a.lanCardStatus,t[20]=a.lanCardTitle,t[21]=I):I=t[21];let L;t[22]!==P||t[23]!==F||t[24]!==I||t[25]!==E||t[26]!==A?(L=[E,A,P,F,I],t[22]=P,t[23]=F,t[24]=I,t[25]=E,t[26]=A,t[27]=L):L=t[27];let R=L,z;return t[28]!==R||t[29]!==n?(z=(0,$.jsx)(`div`,{className:`grid gap-1 rounded-xl bg-surface-hover/20 p-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5`,children:R.map(e=>{let t=e.icon;return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>n(e.tab),className:d(`flex items-start gap-3 rounded-lg bg-surface-base/45 px-2 py-3 text-left transition-colors`,`hover:bg-surface-hover/30`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),children:[(0,$.jsx)(`span`,{className:`flex size-8 shrink-0 items-center justify-center text-fg-muted`,children:(0,$.jsx)(t,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0})}),(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`span`,{className:`block truncate text-sm font-medium text-fg`,children:e.title}),(0,$.jsx)(Te,{label:e.statusLabel,kind:e.kind})]})]},`${e.tab}-${e.title}`)})}),t[28]=R,t[29]=n,t[30]=z):z=t[30],z}function De(e){return e.conversationId}function Oe(e){return e.language}function ke(e){let t=(0,Q.c)(21),{title:n,description:r,recommended:i,icon:a,onOpen:o,recommendedLabel:s}=e,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=d(`group flex w-full items-start gap-3 px-3 py-4 text-left transition-colors`,`hover:bg-surface-hover/30`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`),t[0]=c):c=t[0];let l;t[1]===a?l=t[2]:(l=(0,$.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-surface-hover/70 text-fg-muted`,children:(0,$.jsx)(a,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0})}),t[1]=a,t[2]=l);let u;t[3]===n?u=t[4]:(u=(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:n}),t[3]=n,t[4]=u);let f;t[5]!==i||t[6]!==s?(f=i&&s?(0,$.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2 py-0.5 text-[11px] font-medium text-accent-fg`,children:s}):null,t[5]=i,t[6]=s,t[7]=f):f=t[7];let p;t[8]!==u||t[9]!==f?(p=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[u,f]}),t[8]=u,t[9]=f,t[10]=p):p=t[10];let m;t[11]===r?m=t[12]:(m=(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg-muted`,children:r}),t[11]=r,t[12]=m);let h;t[13]!==p||t[14]!==m?(h=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[p,m]}),t[13]=p,t[14]=m,t[15]=h):h=t[15];let g;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(re,{className:`mt-2 size-4 shrink-0 text-fg-subtle transition-transform group-hover:translate-x-0.5 group-hover:text-fg-muted`,"aria-hidden":!0}),t[16]=g):g=t[16];let _;return t[17]!==o||t[18]!==l||t[19]!==h?(_=(0,$.jsxs)(`button`,{type:`button`,onClick:o,className:c,children:[l,h,g]}),t[17]=o,t[18]=l,t[19]=h,t[20]=_):_=t[20],_}function Ae(e){let t=(0,Q.c)(78),{onOpenTab:n}=e,r=p(Ne),i;t[0]===r?i=t[1]:(i=u(r),t[0]=r,t[1]=i);let a=i.remoteAccess,o=a.guide,s=!!f(Me),c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c={refreshInterval:3e4},t[2]=c):c=t[2];let{data:l}=x(s?`exposure-status`:null,Se,c),d;t[3]===l?.conflicts?d=t[4]:(d=l?.conflicts??[],t[3]=l?.conflicts,t[4]=d);let m=d;if(!s){let e;return t[5]===o.needToken?e=t[6]:(e=(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:o.needToken}),t[5]=o.needToken,t[6]=e),e}let h;t[7]===n?h=t[8]:(h=(0,$.jsx)(Ee,{onOpenTab:n}),t[7]=n,t[8]=h);let g;t[9]!==m||t[10]!==o.conflictsHint||t[11]!==o.conflictsTitle?(g=m.length>0?(0,$.jsxs)(`div`,{className:`rounded-xl bg-amber-500/10 px-4 py-3 text-sm text-fg-muted`,children:[(0,$.jsx)(`p`,{className:`font-medium text-fg`,children:o.conflictsTitle}),(0,$.jsx)(`p`,{className:`mt-1`,children:o.conflictsHint}),(0,$.jsx)(`ul`,{className:`mt-2 list-inside list-disc text-xs`,children:m.map(je)})]}):null,t[9]=m,t[10]=o.conflictsHint,t[11]=o.conflictsTitle,t[12]=g):g=t[12];let _;t[13]===o.pickMethod?_=t[14]:(_=(0,$.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:o.pickMethod}),t[13]=o.pickMethod,t[14]=_);let v;t[15]===n?v=t[16]:(v=()=>n(`tailscale`),t[15]=n,t[16]=v);let y;t[17]!==o.recommended||t[18]!==o.tailscaleCardDesc||t[19]!==o.tailscaleCardTitle||t[20]!==v?(y=(0,$.jsx)(ke,{icon:J,title:o.tailscaleCardTitle,description:o.tailscaleCardDesc,recommended:!0,recommendedLabel:o.recommended,onOpen:v}),t[17]=o.recommended,t[18]=o.tailscaleCardDesc,t[19]=o.tailscaleCardTitle,t[20]=v,t[21]=y):y=t[21];let b;t[22]===n?b=t[23]:(b=()=>n(`public`),t[22]=n,t[23]=b);let S;t[24]!==o.publicCardDesc||t[25]!==o.publicCardTitle||t[26]!==b?(S=(0,$.jsx)(ke,{icon:G,title:o.publicCardTitle,description:o.publicCardDesc,onOpen:b}),t[24]=o.publicCardDesc,t[25]=o.publicCardTitle,t[26]=b,t[27]=S):S=t[27];let C;t[28]===n?C=t[29]:(C=()=>n(`reverse-proxy`),t[28]=n,t[29]=C);let w;t[30]!==o.reverseProxyCardDesc||t[31]!==o.reverseProxyCardTitle||t[32]!==C?(w=(0,$.jsx)(ke,{icon:k,title:o.reverseProxyCardTitle,description:o.reverseProxyCardDesc,onOpen:C}),t[30]=o.reverseProxyCardDesc,t[31]=o.reverseProxyCardTitle,t[32]=C,t[33]=w):w=t[33];let E;t[34]===n?E=t[35]:(E=()=>n(`ssh`),t[34]=n,t[35]=E);let D;t[36]!==o.sshCardDesc||t[37]!==o.sshCardTitle||t[38]!==E?(D=(0,$.jsx)(ke,{icon:N,title:o.sshCardTitle,description:o.sshCardDesc,onOpen:E}),t[36]=o.sshCardDesc,t[37]=o.sshCardTitle,t[38]=E,t[39]=D):D=t[39];let O;t[40]!==a.advanced.proxyBody||t[41]!==a.advanced.proxyTitle||t[42]!==w||t[43]!==D?(O=(0,$.jsxs)(T,{title:a.advanced.proxyTitle,summary:a.advanced.proxyBody,children:[w,D]}),t[40]=a.advanced.proxyBody,t[41]=a.advanced.proxyTitle,t[42]=w,t[43]=D,t[44]=O):O=t[44];let A;t[45]===n?A=t[46]:(A=()=>n(`lan`),t[45]=n,t[46]=A);let j;t[47]!==o.lanCardDesc||t[48]!==o.lanCardTitle||t[49]!==A?(j=(0,$.jsx)(ke,{icon:V,title:o.lanCardTitle,description:o.lanCardDesc,onOpen:A}),t[47]=o.lanCardDesc,t[48]=o.lanCardTitle,t[49]=A,t[50]=j):j=t[50];let M;t[51]!==S||t[52]!==O||t[53]!==j||t[54]!==y?(M=(0,$.jsxs)(`div`,{className:`mt-2 flex max-w-3xl flex-col gap-1 rounded-xl bg-surface-hover/20 p-1 [&>*]:rounded-lg [&>*]:bg-surface-base/45`,children:[y,S,O,j]}),t[51]=S,t[52]=O,t[53]=j,t[54]=y,t[55]=M):M=t[55];let P;t[56]!==M||t[57]!==_?(P=(0,$.jsxs)(`div`,{children:[_,M]}),t[56]=M,t[57]=_,t[58]=P):P=t[58];let F;t[59]===o.oneAtATimeHint?F=t[60]:(F=(0,$.jsx)(`p`,{className:`text-xs leading-relaxed text-fg-subtle`,children:o.oneAtATimeHint}),t[59]=o.oneAtATimeHint,t[60]=F);let I;t[61]===a.advanced.proxyTitle?I=t[62]:(I=(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:a.advanced.proxyTitle}),t[61]=a.advanced.proxyTitle,t[62]=I);let L;t[63]===a.advanced.proxyBody?L=t[64]:(L=(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:a.advanced.proxyBody}),t[63]=a.advanced.proxyBody,t[64]=L);let R;t[65]!==r||t[66]!==a.advanced.proxyDocs?(R=(0,$.jsx)(fe,{language:r,label:a.advanced.proxyDocs,section:`advanced`,className:`mt-2`}),t[65]=r,t[66]=a.advanced.proxyDocs,t[67]=R):R=t[67];let z;t[68]!==I||t[69]!==L||t[70]!==R?(z=(0,$.jsxs)(`div`,{className:`max-w-3xl rounded-xl bg-surface-hover/20 px-4 py-4`,children:[I,L,R]}),t[68]=I,t[69]=L,t[70]=R,t[71]=z):z=t[71];let B;return t[72]!==P||t[73]!==F||t[74]!==z||t[75]!==h||t[76]!==g?(B=(0,$.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[h,g,P,F,z]}),t[72]=P,t[73]=F,t[74]=z,t[75]=h,t[76]=g,t[77]=B):B=t[77],B}function je(e){return(0,$.jsx)(`li`,{children:e.message},e.code)}function Me(e){return e.conversationId}function Ne(e){return e.language}function Pe(){let e=(0,Q.c)(16),t=p(Fe),n;e[0]===t?n=e[1]:(n=u(t),e[0]=t,e[1]=n);let r=n.remoteAccess.lan,i;e[2]!==r.subtitle||e[3]!==r.title?(i=(0,$.jsx)(Y,{icon:V,title:r.title,subtitle:r.subtitle}),e[2]=r.subtitle,e[3]=r.title,e[4]=i):i=e[4];let a;e[5]===r.body?a=e[6]:(a=(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:r.body}),e[5]=r.body,e[6]=a);let s;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(l,{className:`size-3.5`,"aria-hidden":!0}),e[7]=s):s=e[7];let c;e[8]===r.link?c=e[9]:(c=(0,$.jsxs)(o,{to:`/settings/gateway`,className:`inline-flex items-center gap-1.5 text-sm font-medium text-accent hover:underline`,children:[r.link,s]}),e[8]=r.link,e[9]=c);let d;e[10]!==a||e[11]!==c?(d=(0,$.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[a,c]}),e[10]=a,e[11]=c,e[12]=d):d=e[12];let f;return e[13]!==i||e[14]!==d?(f=(0,$.jsx)(`div`,{className:`flex flex-col gap-4`,children:(0,$.jsxs)(ue,{children:[i,d]})}),e[13]=i,e[14]=d,e[15]=f):f=e[15],f}function Fe(e){return e.language}function Ie(e){let t=(0,Q.c)(30),{embedded:n}=e,r=n===void 0?!1:n,i=p(Le),a;t[0]===i?a=t[1]:(a=u(i),t[0]=i,t[1]=a);let o=a.remoteAccess.ssh,[s,l]=(0,Z.useState)(!1),d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=async()=>{await b(`xopc gateway ssh-tunnel --target user@your-host --local-port 18790 --remote-port 18790`)&&(l(!0),setTimeout(()=>l(!1),2e3))},t[2]=d):d=t[2];let f=d,m;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(`pre`,{className:`overflow-x-auto rounded-lg bg-surface-base/55 px-3 py-2 text-xs text-fg-muted`,children:`xopc gateway ssh-tunnel --target user@your-host --local-port 18790 --remote-port 18790`}),t[3]=m):m=t[3];let h,g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>void f(),g=(0,$.jsx)(c,{className:`mr-1 size-4`}),t[4]=h,t[5]=g):(h=t[4],g=t[5]);let _=s?o.copied:o.copy,v;t[6]===_?v=t[7]:(v=(0,$.jsx)(`div`,{className:`mt-2`,children:(0,$.jsxs)(R,{type:`button`,variant:`ghost`,onClick:h,children:[g,_]})}),t[6]=_,t[7]=v);let y;t[8]!==r||t[9]!==o.hint?(y=r?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-subtle`,children:o.hint}):null,t[8]=r,t[9]=o.hint,t[10]=y):y=t[10];let x;t[11]!==v||t[12]!==y?(x=(0,$.jsxs)($.Fragment,{children:[m,v,y]}),t[11]=v,t[12]=y,t[13]=x):x=t[13];let S=x;if(r){let e;t[14]!==o.subtitle||t[15]!==o.title?(e=(0,$.jsx)(Y,{icon:N,title:o.title,subtitle:o.subtitle}),t[14]=o.subtitle,t[15]=o.title,t[16]=e):e=t[16];let n;t[17]===S?n=t[18]:(n=(0,$.jsx)(`div`,{className:`mt-4 space-y-2`,children:S}),t[17]=S,t[18]=n);let r;return t[19]!==e||t[20]!==n?(r=(0,$.jsxs)(ue,{children:[e,n]}),t[19]=e,t[20]=n,t[21]=r):r=t[21],r}let C;t[22]!==o.subtitle||t[23]!==o.title?(C=(0,$.jsx)(Y,{icon:N,title:o.title,subtitle:o.subtitle}),t[22]=o.subtitle,t[23]=o.title,t[24]=C):C=t[24];let w;t[25]===S?w=t[26]:(w=(0,$.jsx)(`div`,{className:`mt-4`,children:S}),t[25]=S,t[26]=w);let T;return t[27]!==C||t[28]!==w?(T=(0,$.jsxs)(ue,{children:[C,w]}),t[27]=C,t[28]=w,t[29]=T):T=t[29],T}function Le(e){return e.language}function Re(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Ie,{embedded:!0}),e[0]=t):t=e[0],t}var ze=[`guide`,`tailscale`,`public`,`reverse-proxy`,`ssh`,`lan`];function Be(e){return e&&ze.includes(e)?e:`guide`}function Ve(e){let t=(0,Q.c)(32),{showLabel:n,hideLabel:r,icon:i,hint:a,children:o,className:s,defaultOpen:c,advancedOnly:l}=e,u=l===void 0?!1:l,[f,p]=(0,Z.useState)(c??!1),m;t[0]===s?m=t[1]:(m=d(`rounded-xl bg-surface-hover/20`,s),t[0]=s,t[1]=m);let h;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>p(He),t[2]=h):h=t[2];let g=f&&`rotate-180`,_;t[3]===g?_=t[4]:(_=d(`size-4 shrink-0 text-fg-muted transition-transform duration-200 motion-reduce:transition-none`,g),t[3]=g,t[4]=_);let v;t[5]===_?v=t[6]:(v=(0,$.jsx)(K,{className:_,"aria-hidden":!0}),t[5]=_,t[6]=v);let y;t[7]===i?y=t[8]:(y=i?(0,$.jsx)(i,{className:`size-4 shrink-0 text-accent`,strokeWidth:1.75,"aria-hidden":!0}):null,t[7]=i,t[8]=y);let b=f?r:n,x;t[9]===b?x=t[10]:(x=(0,$.jsx)(`span`,{children:b}),t[9]=b,t[10]=x);let S;t[11]!==f||t[12]!==v||t[13]!==y||t[14]!==x?(S=(0,$.jsxs)(`button`,{type:`button`,"aria-expanded":f,onClick:h,className:`flex w-full items-center gap-2 rounded-2xl px-4 py-3.5 text-left text-sm font-medium text-fg transition-colors hover:text-fg`,children:[v,y,x]}),t[11]=f,t[12]=v,t[13]=y,t[14]=x,t[15]=S):S=t[15];let C=f?`grid-rows-[1fr] opacity-100`:`grid-rows-[0fr] opacity-0`,w;t[16]===C?w=t[17]:(w=d(`grid transition-[grid-template-rows,opacity] duration-200 ease-out motion-reduce:transition-none`,C),t[16]=C,t[17]=w);let T;t[18]===a?T=t[19]:(T=a?(0,$.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:a}):null,t[18]=a,t[19]=T);let E;t[20]!==o||t[21]!==T?(E=(0,$.jsx)(`div`,{className:`overflow-hidden`,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-4 px-4 pb-4 pt-1`,children:[T,o]})}),t[20]=o,t[21]=T,t[22]=E):E=t[22];let D;t[23]!==w||t[24]!==E?(D=(0,$.jsx)(`div`,{className:w,children:E}),t[23]=w,t[24]=E,t[25]=D):D=t[25];let O;t[26]!==S||t[27]!==D||t[28]!==m?(O=(0,$.jsxs)(`section`,{className:m,children:[S,D]}),t[26]=S,t[27]=D,t[28]=m,t[29]=O):O=t[29];let k=O;if(u){let e;return t[30]===k?e=t[31]:(e=(0,$.jsx)(Ce,{children:k}),t[30]=k,t[31]=e),e}return k}function He(e){return!e}function Ue(e){let t=(0,Q.c)(40),{open:n,title:r,intro:i,bullets:a,checkboxLabel:o,confirmLabel:s,cancelLabel:c,onConfirm:l,onCancel:u}=e,[f,p]=(0,Z.useState)(!1),b;t[0]===u?b=t[1]:(b=e=>{e||(p(!1),u())},t[0]=u,t[1]=b);let x;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(m,{className:d(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,ie)}),t[2]=x):x=t[2];let S;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(S=d(`xopc-dialog-content fixed left-1/2 top-1/2 max-h-[min(90vh,40rem)] w-[min(100%-2rem,32rem)] -translate-x-1/2 -translate-y-1/2`,`overflow-y-auto rounded-2xl border border-edge bg-surface-overlay p-6 shadow-popover outline-none dark:border-edge`,q),t[3]=S):S=t[3];let C;t[4]===r?C=t[5]:(C=(0,$.jsx)(v,{className:`text-base font-semibold text-fg`,children:r}),t[4]=r,t[5]=C);let w;t[6]===i?w=t[7]:(w=(0,$.jsx)(h,{className:`mt-2 text-sm text-fg-muted`,children:i}),t[6]=i,t[7]=w);let T;t[8]===a?T=t[9]:(T=a.map(We),t[8]=a,t[9]=T);let E;t[10]===T?E=t[11]:(E=(0,$.jsx)(`ul`,{className:`mt-4 list-disc space-y-2 pl-5 text-sm text-fg-muted`,children:T}),t[10]=T,t[11]=E);let D;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>p(e.target.checked),t[12]=D):D=t[12];let O;t[13]===f?O=t[14]:(O=(0,$.jsx)(`input`,{type:`checkbox`,className:`mt-0.5 size-4 shrink-0 rounded border-edge accent-accent`,checked:f,onChange:D}),t[13]=f,t[14]=O);let k;t[15]===o?k=t[16]:(k=(0,$.jsx)(`span`,{children:o}),t[15]=o,t[16]=k);let A;t[17]!==k||t[18]!==O?(A=(0,$.jsxs)(`label`,{className:`mt-5 flex cursor-pointer items-start gap-3 text-sm text-fg`,children:[O,k]}),t[17]=k,t[18]=O,t[19]=A):A=t[19];let j;t[20]!==c||t[21]!==u?(j=(0,$.jsx)(R,{type:`button`,variant:`secondary`,onClick:u,children:c}),t[20]=c,t[21]=u,t[22]=j):j=t[22];let M=!f,N;t[23]!==s||t[24]!==l||t[25]!==M?(N=(0,$.jsx)(R,{type:`button`,disabled:M,onClick:l,children:s}),t[23]=s,t[24]=l,t[25]=M,t[26]=N):N=t[26];let P;t[27]!==j||t[28]!==N?(P=(0,$.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[j,N]}),t[27]=j,t[28]=N,t[29]=P):P=t[29];let F;t[30]!==A||t[31]!==P||t[32]!==C||t[33]!==w||t[34]!==E?(F=(0,$.jsxs)(g,{children:[x,(0,$.jsxs)(_,{className:S,onOpenAutoFocus:Ge,children:[C,w,E,A,P]})]}),t[30]=A,t[31]=P,t[32]=C,t[33]=w,t[34]=E,t[35]=F):F=t[35];let I;return t[36]!==n||t[37]!==b||t[38]!==F?(I=(0,$.jsx)(y,{open:n,onOpenChange:b,children:F}),t[36]=n,t[37]=b,t[38]=F,t[39]=I):I=t[39],I}function We(e){return(0,$.jsx)(`li`,{children:e},e)}function Ge(e){return e.preventDefault()}function Ke(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}var qe=[`preparing_frpc`,`registering`,`starting_frpc`];function Je(e){return e?e===`reconnecting_frpc`?qe.indexOf(`starting_frpc`):qe.indexOf(e):-1}function Ye(e,t){if(t.state===`connected`)return`done`;let n=t.startProgress?.phase,r=qe.indexOf(e),i=Je(n);return i<0?t.state===`connecting`||t.state===`reconnecting`?`active`:`pending`:r<i?`done`:r===i?`active`:`pending`}function Xe(e,t,n){let r=n.startProgress;return Ye(t,n)===`active`?t===`preparing_frpc`&&n.frpcDownload?n.frpcDownload.phase===`extracting`?e.frpcExtracting:n.frpcDownload.percent==null?e.frpcDownloading:e.frpcDownloadingPercent.replace(`{{percent}}`,String(n.frpcDownload.percent)):t===`registering`&&r?.publicUrl?e.stepRegisterDetail:t===`starting_frpc`?r?.phase===`reconnecting_frpc`?e.stepReconnectDetail:e.stepFrpcDetail:null:null}function Ze(e,t){switch(t){case`preparing_frpc`:return e.stepPrepareFrpc;case`registering`:return e.stepRegister;case`starting_frpc`:return e.stepFrpcLogin}}function Qe(e){if(!e)return null;let t=Math.max(0,Math.floor((Date.now()-new Date(e).getTime())/1e3));return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}function $e(e){let t=(0,Q.c)(31),{status:n,t:r}=e,[,i]=(0,Z.useState)(0),a;t[0]!==i||t[1]!==n.state?(a=()=>{if(n.state!==`connecting`&&n.state!==`reconnecting`)return;let e=window.setInterval(()=>i(et),1e3);return()=>window.clearInterval(e)},t[0]=i,t[1]=n.state,t[2]=a):a=t[2];let o=n.startProgress?.startedAt,c;if(t[3]!==n.state||t[4]!==o?(c=[n.state,o],t[3]=n.state,t[4]=o,t[5]=c):c=t[5],(0,Z.useEffect)(a,c),!(n.state===`connecting`||n.state===`reconnecting`||n.state===`connected`&&n.startProgress))return null;let l,u,f,p,m;if(t[6]!==n||t[7]!==r){let e=Qe(n.startProgress?.startedAt);l=!!n.publicUrl&&n.state!==`connected`&&n.startProgress?.phase!==`registering`,u=`mt-3 space-y-3 rounded-lg bg-surface-panel/80 p-3 shadow-surface`;let i;t[13]===r.startProgressTitle?i=t[14]:(i=(0,$.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:r.startProgressTitle}),t[13]=r.startProgressTitle,t[14]=i);let a;t[15]===r.startProgressHint?a=t[16]:(a=(0,$.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:r.startProgressHint}),t[15]=r.startProgressHint,t[16]=a),t[17]!==i||t[18]!==a?(f=(0,$.jsxs)(`div`,{children:[i,a]}),t[17]=i,t[18]=a,t[19]=f):f=t[19];let o=qe.map(e=>{let t=Ye(e,n),i=Xe(r,e,n);return(0,$.jsxs)(`li`,{className:`flex gap-2 text-xs`,children:[(0,$.jsx)(`span`,{className:`mt-0.5 shrink-0 text-fg-subtle`,"aria-hidden":!0,children:t===`done`?(0,$.jsx)(s,{className:`size-3.5 text-emerald-600 dark:text-emerald-400`}):t===`active`?(0,$.jsx)(z,{className:`size-3.5 animate-spin text-accent`}):(0,$.jsx)(P,{className:`size-3.5`})}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`div`,{className:d(`font-medium`,t===`active`?`text-fg`:t===`done`?`text-fg-muted`:`text-fg-subtle`),children:Ze(r,e)}),i?(0,$.jsx)(`div`,{className:`mt-0.5 text-fg-muted`,children:i}):null,e===`preparing_frpc`&&t===`active`&&n.frpcDownload&&n.frpcDownload.phase===`downloading`?(0,$.jsxs)(`div`,{className:`mt-2 space-y-1`,children:[(0,$.jsx)(`div`,{className:`h-1.5 w-full overflow-hidden rounded-full bg-surface-panel`,children:(0,$.jsx)(`div`,{className:d(`h-full rounded-full bg-accent transition-[width] duration-300`,n.frpcDownload.percent==null&&`w-1/3 animate-pulse`),style:n.frpcDownload.percent==null?void 0:{width:`${n.frpcDownload.percent}%`}})}),n.frpcDownload.bytesReceived!=null&&n.frpcDownload.totalBytes?(0,$.jsxs)(`p`,{className:`text-fg-subtle`,children:[Ke(n.frpcDownload.bytesReceived),` /`,` `,Ke(n.frpcDownload.totalBytes)]}):null]}):null,e===`preparing_frpc`&&t===`active`&&n.frpcDownload?.url?(0,$.jsxs)(`p`,{className:`mt-2 text-fg-subtle`,children:[(0,$.jsxs)(`span`,{className:`font-sans`,children:[r.frpcDownloadingUrlLabel,`: `]}),(0,$.jsx)(`a`,{href:n.frpcDownload.url,target:`_blank`,rel:`noopener noreferrer`,className:`break-all font-mono text-[11px] text-accent hover:underline`,children:n.frpcDownload.url})]}):null]})]},e)});t[20]===o?p=t[21]:(p=(0,$.jsx)(`ol`,{className:`space-y-2`,children:o}),t[20]=o,t[21]=p),m=e&&n.startProgress?(0,$.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:r.startProgressElapsed.replace(`{{elapsed}}`,e)}):null,t[6]=n,t[7]=r,t[8]=l,t[9]=u,t[10]=f,t[11]=p,t[12]=m}else l=t[8],u=t[9],f=t[10],p=t[11],m=t[12];let h;t[22]!==l||t[23]!==r.publicUrlPendingNotice?(h=l?(0,$.jsx)(`p`,{className:`text-xs text-fg-muted`,children:r.publicUrlPendingNotice}):null,t[22]=l,t[23]=r.publicUrlPendingNotice,t[24]=h):h=t[24];let g;return t[25]!==u||t[26]!==f||t[27]!==p||t[28]!==m||t[29]!==h?(g=(0,$.jsxs)(`div`,{className:u,children:[f,p,m,h]}),t[25]=u,t[26]=f,t[27]=p,t[28]=m,t[29]=h,t[30]=g):g=t[30],g}function et(e){return e+1}function tt(e,t){return t.state===`connected`?e.statusConnected:t.state===`error`?e.statusError:t.startProgress?.phase===`reconnecting_frpc`?e.statusReconnecting:t.startProgress?.phase===`starting_frpc`?e.statusStartingFrpc:t.startProgress?.phase===`registering`?e.statusRegistering:t.startProgress?.phase===`preparing_frpc`||t.frpcDownload?e.statusPreparingFrpc:t.state===`connecting`||t.state===`reconnecting`?e.statusConnecting:e.statusOff}function nt(e){return e.state===`connected`?`connected`:e.state===`error`?`error`:e.state===`connecting`||e.state===`reconnecting`||e.startProgress||e.frpcDownload?`progress`:`off`}function rt(e){switch(e){case`connected`:return`bg-emerald-500/15 text-emerald-700 dark:text-emerald-400`;case`progress`:return`bg-amber-500/15 text-amber-700 dark:text-amber-400`;case`error`:return`bg-red-500/15 text-red-700 dark:text-red-400`;default:return`bg-surface-hover text-fg-muted`}}function it(e){if(!e)return`—`;let t=Date.now()-new Date(e).getTime();if(t<0)return`—`;let n=Math.floor(t/6e4);return n<60?`${n}m`:`${Math.floor(n/60)}h ${n%60}m`}function at(e){let t=(0,Q.c)(61),{t:n,status:r,isLoading:i,statusErr:a,starting:o,stopping:s,showConsentExpired:c,copyLabels:l,startDisabled:u,startDisabledReason:f,stepLabel:p,onStart:m,onStop:h}=e,g=u===void 0?!1:u,_,v,y,b,x,S,C;t[0]!==r||t[1]!==o?(C=nt(r),_=r.enabled||o,v=o||r.state===`connecting`||r.state===`reconnecting`||!!r.startProgress||!!r.frpcDownload,t[9]===Symbol.for(`react.memo_cache_sentinel`)?(S=d(le(),`space-y-4`),t[9]=S):S=t[9],x=`flex flex-wrap items-start justify-between gap-3`,b=`flex items-center gap-2`,y=d(`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium`,rt(C)),t[0]=r,t[1]=o,t[2]=_,t[3]=v,t[4]=y,t[5]=b,t[6]=x,t[7]=S,t[8]=C):(_=t[2],v=t[3],y=t[4],b=t[5],x=t[6],S=t[7],C=t[8]);let w=C===`connected`&&`bg-emerald-500`,T=C===`progress`&&`bg-amber-500 animate-pulse`,E=C===`error`&&`bg-red-500`,D=C===`off`&&`bg-fg-subtle`,O;t[10]!==w||t[11]!==T||t[12]!==E||t[13]!==D?(O=d(`size-1.5 rounded-full`,w,T,E,D),t[10]=w,t[11]=T,t[12]=E,t[13]=D,t[14]=O):O=t[14];let k;t[15]===O?k=t[16]:(k=(0,$.jsx)(`span`,{className:O,"aria-hidden":!0}),t[15]=O,t[16]=k);let A;t[17]!==i||t[18]!==r||t[19]!==n?(A=i&&!r.enabled?(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block h-3 w-16 animate-pulse rounded-full bg-surface-hover/70 motion-reduce:animate-none`}):tt(n,r),t[17]=i,t[18]=r,t[19]=n,t[20]=A):A=t[20];let j;t[21]!==k||t[22]!==A||t[23]!==y?(j=(0,$.jsxs)(`span`,{className:y,children:[k,A]}),t[21]=k,t[22]=A,t[23]=y,t[24]=j):j=t[24];let M;t[25]!==r.connectedSince||t[26]!==r.state||t[27]!==n.uptime?(M=r.connectedSince&&r.state===`connected`?(0,$.jsxs)(`span`,{className:`text-xs text-fg-subtle`,children:[n.uptime,` `,it(r.connectedSince)]}):null,t[25]=r.connectedSince,t[26]=r.state,t[27]=n.uptime,t[28]=M):M=t[28];let N;t[29]!==j||t[30]!==M||t[31]!==b?(N=(0,$.jsxs)(`div`,{className:b,children:[j,M]}),t[29]=j,t[30]=M,t[31]=b,t[32]=N):N=t[32];let P;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,$.jsx)(J,{className:`size-4 text-fg-subtle`,strokeWidth:1.75,"aria-hidden":!0}),t[33]=P):P=t[33];let F;t[34]!==N||t[35]!==x?(F=(0,$.jsxs)(`div`,{className:x,children:[N,P]}),t[34]=N,t[35]=x,t[36]=F):F=t[36];let I;t[37]===a?I=t[38]:(I=a?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:a instanceof Error?a.message:String(a)}):null,t[37]=a,t[38]=I);let L;t[39]!==c||t[40]!==n.consentExpiredBanner?(L=c?(0,$.jsx)(`p`,{className:`rounded-lg bg-amber-500/10 px-3 py-2 text-xs text-fg-muted`,children:n.consentExpiredBanner}):null,t[39]=c,t[40]=n.consentExpiredBanner,t[41]=L):L=t[41];let B;t[42]!==_||t[43]!==l||t[44]!==m||t[45]!==h||t[46]!==v||t[47]!==r||t[48]!==g||t[49]!==f||t[50]!==o||t[51]!==p||t[52]!==s||t[53]!==n?(B=_?(0,$.jsxs)(`div`,{className:`space-y-4`,children:[r.publicUrl?(0,$.jsx)(`div`,{className:`rounded-xl bg-surface-panel/80 p-3 shadow-surface`,children:(0,$.jsx)(W,{label:n.publicUrlLabel,text:r.publicUrl,labels:l})}):null,v?(0,$.jsx)($e,{status:r,t:n}):null,r.lastError&&r.state===`error`?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:r.lastError}):null,(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:r.enabled?(0,$.jsxs)(R,{type:`button`,variant:`secondary`,disabled:s,onClick:h,children:[s?(0,$.jsx)(z,{className:`size-4 animate-spin`}):null,n.stop]}):(0,$.jsxs)(R,{type:`button`,disabled:o,onClick:m,children:[o?(0,$.jsx)(z,{className:`size-4 animate-spin`}):(0,$.jsx)(H,{className:`size-4`}),n.start]})})]}):(0,$.jsxs)(`div`,{className:`space-y-4`,children:[p?(0,$.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-fg-subtle`,children:p}):null,(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.emptyStateTitle}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg-muted`,children:n.emptyStateBody})]}),(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg bg-amber-500/10 px-3 py-2.5 text-xs text-fg-muted`,children:[(0,$.jsx)(ee,{className:`mt-0.5 size-4 shrink-0 text-amber-600 dark:text-amber-400`}),(0,$.jsx)(`p`,{children:n.riskBannerBody})]}),g&&f?(0,$.jsx)(`p`,{className:`text-sm text-amber-800 dark:text-amber-200`,children:f}):null,(0,$.jsxs)(R,{type:`button`,disabled:o||g,onClick:m,className:`w-full sm:w-auto`,children:[o?(0,$.jsx)(z,{className:`size-4 animate-spin`}):(0,$.jsx)(H,{className:`size-4`}),n.start]})]}),t[42]=_,t[43]=l,t[44]=m,t[45]=h,t[46]=v,t[47]=r,t[48]=g,t[49]=f,t[50]=o,t[51]=p,t[52]=s,t[53]=n,t[54]=B):B=t[54];let V;return t[55]!==F||t[56]!==I||t[57]!==L||t[58]!==B||t[59]!==S?(V=(0,$.jsxs)(`section`,{className:S,children:[F,I,L,B]}),t[55]=F,t[56]=I,t[57]=L,t[58]=B,t[59]=S,t[60]=V):V=t[60],V}var ot={reconfiguring:!1};function st(e){let t=(0,Q.c)(89),{t:n,brokerSecretReady:r,brokerSecretConfiguredInConfig:i,brokerSecretMaskedValue:a,brokerSecretDraft:o,savingBrokerSecret:c,authorizingBrokerSecret:u,brokerSecretAuthorizationUrl:f,brokerSecretNotice:p,copyFailedLabel:m,onDraftChange:h,onSave:g,onAuthorize:_,onClear:v,sectionRef:y}=e,b=(0,Z.useId)(),x=r,S=!x,[C,w]=(0,Z.useReducer)(te,ot),{reconfiguring:T}=C,D;t[0]!==i||t[1]!==o||t[2]!==T?(D=i&&!T&&!o.trim(),t[0]=i,t[1]=o,t[2]=T,t[3]=D):D=t[3];let O=D,k;t[4]!==n.copied||t[5]!==n.copyKey||t[6]!==n.hideKey||t[7]!==n.showKey?(k={show:n.showKey,hide:n.hideKey,copy:n.copyKey,copied:n.copied},t[4]=n.copied,t[5]=n.copyKey,t[6]=n.hideKey,t[7]=n.showKey,t[8]=k):k=t[8];let A=k,j;t[9]===o?j=t[10]:(j=o.trim().length>0&&!E(o.trim()),t[9]=o,t[10]=j);let N=j,P;t[11]===h?P=t[12]:(P=()=>{w({type:`patch`,patch:{reconfiguring:!1}}),h(``)},t[11]=h,t[12]=P);let F=P,I=S&&`ring-1 ring-amber-500/30`,L;t[13]===I?L=t[14]:(L=d(I),t[13]=I,t[14]=L);let B=x?`bg-emerald-500/10 text-emerald-600 dark:text-emerald-400`:S?`bg-amber-500/10 text-amber-700 dark:text-amber-400`:`bg-surface-hover text-fg-muted`,V;t[15]===B?V=t[16]:(V=d(`flex size-9 shrink-0 items-center justify-center rounded-lg`,B),t[15]=B,t[16]=V);let H;t[17]===x?H=t[18]:(H=x?(0,$.jsx)(s,{className:`size-4`,strokeWidth:2,"aria-hidden":!0}):(0,$.jsx)(ne,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),t[17]=x,t[18]=H);let U;t[19]!==V||t[20]!==H?(U=(0,$.jsx)(`span`,{className:V,children:H}),t[19]=V,t[20]=H,t[21]=U):U=t[21];let W=x?n.brokerSecretReadyTitle:n.brokerSecretStepTitle,ee;t[22]===W?ee=t[23]:(ee=(0,$.jsx)(`p`,{className:`text-sm font-semibold text-fg`,children:W}),t[22]=W,t[23]=ee);let G=x?n.brokerSecretReadyHint:n.brokerSecretHint,K;t[24]===G?K=t[25]:(K=(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg-muted`,children:G}),t[24]=G,t[25]=K);let re;t[26]!==S||t[27]!==n.brokerSecretMissingHint?(re=S?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-amber-800 dark:text-amber-200`,children:n.brokerSecretMissingHint}):null,t[26]=S,t[27]=n.brokerSecretMissingHint,t[28]=re):re=t[28];let q;t[29]!==ee||t[30]!==K||t[31]!==re?(q=(0,$.jsxs)(`div`,{children:[ee,K,re]}),t[29]=ee,t[30]=K,t[31]=re,t[32]=q):q=t[32];let J;t[33]!==u||t[34]!==S||t[35]!==_||t[36]!==T||t[37]!==c||t[38]!==n.brokerSecretAuthorize||t[39]!==n.brokerSecretAuthorizing||t[40]!==n.brokerSecretConsoleLink?(J=S||T?(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsxs)(R,{type:`button`,disabled:c||u,onClick:_,children:[u?(0,$.jsx)(z,{className:`size-4 animate-spin`}):null,u?n.brokerSecretAuthorizing:n.brokerSecretAuthorize]}),(0,$.jsxs)(`a`,{href:be,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex w-fit items-center gap-1 text-xs font-medium text-accent-fg hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[n.brokerSecretConsoleLink,(0,$.jsx)(l,{className:`size-3`,"aria-hidden":!0})]})]}):null,t[33]=u,t[34]=S,t[35]=_,t[36]=T,t[37]=c,t[38]=n.brokerSecretAuthorize,t[39]=n.brokerSecretAuthorizing,t[40]=n.brokerSecretConsoleLink,t[41]=J):J=t[41];let ie;t[42]!==u||t[43]!==f||t[44]!==n.brokerSecretOpenAuthorization?(ie=u&&f?(0,$.jsxs)(`a`,{href:f,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex w-fit items-center gap-1 text-xs font-medium text-accent-fg hover:underline`,children:[n.brokerSecretOpenAuthorization,(0,$.jsx)(l,{className:`size-3`,"aria-hidden":!0})]}):null,t[42]=u,t[43]=f,t[44]=n.brokerSecretOpenAuthorization,t[45]=ie):ie=t[45];let ae;t[46]!==i||t[47]!==o||t[48]!==a||t[49]!==N||t[50]!==F||t[51]!==m||t[52]!==b||t[53]!==S||t[54]!==v||t[55]!==h||t[56]!==g||t[57]!==T||t[58]!==c||t[59]!==A||t[60]!==O||t[61]!==n.brokerSecretCancelReconfigure||t[62]!==n.brokerSecretClear||t[63]!==n.brokerSecretMaskedHelp||t[64]!==n.brokerSecretNotInConfigFile||t[65]!==n.brokerSecretPlaceholder||t[66]!==n.brokerSecretReconfigure||t[67]!==n.brokerSecretRevealFailed||t[68]!==n.brokerSecretSave||t[69]!==n.brokerSecretSaveAndContinue||t[70]!==n.brokerSecretTitle?(ae=O?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`label`,{className:`sr-only`,htmlFor:b,children:n.brokerSecretTitle}),(0,$.jsx)(M,{id:b,value:a,labels:A,reveal:ct,loadFailedLabel:m||n.brokerSecretRevealFailed,maskedHelp:n.brokerSecretMaskedHelp,notInConfigFile:n.brokerSecretNotInConfigFile,readOnly:!0}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsx)(R,{type:`button`,variant:`secondary`,disabled:c,onClick:()=>{w({type:`patch`,patch:{reconfiguring:!0}})},children:n.brokerSecretReconfigure}),(0,$.jsx)(R,{type:`button`,variant:`ghost`,disabled:c,onClick:v,children:n.brokerSecretClear})]})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`label`,{className:`sr-only`,htmlFor:b,children:n.brokerSecretTitle}),(0,$.jsx)(M,{id:b,value:o,onChange:h,placeholder:n.brokerSecretPlaceholder,labels:A,disabled:c}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsxs)(R,{type:`button`,disabled:c||!N,onClick:g,children:[c?(0,$.jsx)(z,{className:`size-4 animate-spin`}):null,S?n.brokerSecretSaveAndContinue:n.brokerSecretSave]}),i?(0,$.jsx)(R,{type:`button`,variant:`ghost`,disabled:c,onClick:v,children:n.brokerSecretClear}):null,T?(0,$.jsx)(R,{type:`button`,variant:`ghost`,disabled:c,onClick:F,children:n.brokerSecretCancelReconfigure}):null]})]}),t[46]=i,t[47]=o,t[48]=a,t[49]=N,t[50]=F,t[51]=m,t[52]=b,t[53]=S,t[54]=v,t[55]=h,t[56]=g,t[57]=T,t[58]=c,t[59]=A,t[60]=O,t[61]=n.brokerSecretCancelReconfigure,t[62]=n.brokerSecretClear,t[63]=n.brokerSecretMaskedHelp,t[64]=n.brokerSecretNotInConfigFile,t[65]=n.brokerSecretPlaceholder,t[66]=n.brokerSecretReconfigure,t[67]=n.brokerSecretRevealFailed,t[68]=n.brokerSecretSave,t[69]=n.brokerSecretSaveAndContinue,t[70]=n.brokerSecretTitle,t[71]=ae):ae=t[71];let oe;t[72]===p?oe=t[73]:(oe=p?(0,$.jsx)(`p`,{className:`text-xs text-emerald-700 dark:text-emerald-400`,children:p}):null,t[72]=p,t[73]=oe);let se;t[74]!==q||t[75]!==J||t[76]!==ie||t[77]!==ae||t[78]!==oe?(se=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-3`,children:[q,J,ie,ae,oe]}),t[74]=q,t[75]=J,t[76]=ie,t[77]=ae,t[78]=oe,t[79]=se):se=t[79];let ce;t[80]!==U||t[81]!==se?(ce=(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[U,se]}),t[80]=U,t[81]=se,t[82]=ce):ce=t[82];let Y;t[83]!==ce||t[84]!==L?(Y=(0,$.jsx)(ue,{className:L,children:ce}),t[83]=ce,t[84]=L,t[85]=Y):Y=t[85];let le;return t[86]!==y||t[87]!==Y?(le=(0,$.jsx)(`div`,{ref:y,id:`tunnel-broker-secret-setup`,children:Y}),t[86]=y,t[87]=Y,t[88]=le):le=t[88],le}function ct(){return _e().then(lt)}function lt(e){return e.registrationSecret??null}var ut={actionError:null,starting:!1,stopping:!1,savingAutoStart:!1,consentOpen:!1,autoStartConfirmOpen:!1,releaseConfirmOpen:!1,releasing:!1,brokerSecretDraft:``,savingBrokerSecret:!1,authorizingBrokerSecret:!1,brokerSecretAuthorizationUrl:null,brokerSecretNotice:null};function dt({embedded:e=!1}){let t=p(e=>e.language),n=u(t).tunnelSettings,r=!!f(e=>e.conversationId),[i,a]=(0,Z.useReducer)(te,ut),{actionError:o,starting:s,stopping:c,savingAutoStart:l,consentOpen:m,autoStartConfirmOpen:h,releaseConfirmOpen:g,releasing:_,brokerSecretDraft:v,savingBrokerSecret:y,authorizingBrokerSecret:b,brokerSecretAuthorizationUrl:T,brokerSecretNotice:D}=i,k=(0,Z.useRef)(null),{data:A}=C(r),{data:M,error:N,isLoading:P,mutate:I}=x(r?`tunnel-status`:null,ge,{refreshInterval:e=>s?1e3:e?.frpcDownload||e?.state===`connecting`||e?.state===`reconnecting`?2e3:6e4}),V=(0,Z.useMemo)(()=>{let e=A?.payload?.config;if(e&&typeof e==`object`&&!Array.isArray(e)){let t=e.tunnel;if(t&&typeof t==`object`&&!Array.isArray(t)&&t.autoStart===!0)return!0}return M?.config?.autoStart===!0},[A,M?.config?.autoStart]),H=(0,Z.useMemo)(()=>{let e=A?.payload?.config;if(e&&typeof e==`object`&&!Array.isArray(e)){let t=e.tunnel;if(t&&typeof t==`object`&&!Array.isArray(t)){let e=t.registrationSecret;if(typeof e==`string`)return e}}return``},[A]),U=E(H),W=M?.registrationSecret?.configured??U;(0,Z.useEffect)(()=>{let e=()=>{I()};return window.addEventListener(`tunnel-status`,e),()=>window.removeEventListener(`tunnel-status`,e)},[I]);let ee=(0,Z.useMemo)(()=>[n.consentBullet1,n.consentBullet2,n.consentBullet3],[n.consentBullet1,n.consentBullet2,n.consentBullet3]),G=(0,Z.useCallback)(async()=>{a({type:`patch`,patch:{actionError:null}}),a({type:`patch`,patch:{starting:!0}});try{await ye(),await I(),S()}catch(e){a({type:`patch`,patch:{actionError:e instanceof Error?e.message:String(e)}})}finally{a({type:`patch`,patch:{starting:!1}})}},[I]),K=(0,Z.useCallback)(()=>{if(!W){a({type:`patch`,patch:{actionError:n.brokerSecretRequiredBeforeStart}}),k.current?.scrollIntoView({behavior:`smooth`,block:`start`});return}if(M?.consentRequired){a({type:`patch`,patch:{consentOpen:!0}});return}G()},[W,M?.consentRequired,G,n.brokerSecretRequiredBeforeStart]),ne=(0,Z.useCallback)(async()=>{a({type:`patch`,patch:{consentOpen:!1}}),a({type:`patch`,patch:{actionError:null}});try{await de(),await Promise.all([I(),G()])}catch(e){a({type:`patch`,patch:{actionError:e instanceof Error?e.message:String(e)}})}},[I,G]),re=(0,Z.useCallback)(async()=>{a({type:`patch`,patch:{actionError:null}}),a({type:`patch`,patch:{stopping:!0}});try{await pe(),await I(),S()}catch(e){a({type:`patch`,patch:{actionError:e instanceof Error?e.message:String(e)}})}finally{a({type:`patch`,patch:{stopping:!1}})}},[I]),q=(0,Z.useCallback)(async e=>{a({type:`patch`,patch:{savingAutoStart:!0}}),a({type:`patch`,patch:{actionError:null}});try{await ve({autoStart:e}),S()}catch(e){a({type:`patch`,patch:{actionError:e instanceof Error?e.message:String(e)}})}finally{a({type:`patch`,patch:{savingAutoStart:!1}})}},[]),ie=(0,Z.useCallback)(()=>{if(V){q(!1);return}if(M?.consentRequired){a({type:`patch`,patch:{actionError:n.consentExpiredBanner}});return}if(!M?.canAutoStart){a({type:`patch`,patch:{actionError:n.autoStartHint}});return}a({type:`patch`,patch:{autoStartConfirmOpen:!0}})},[q,M?.canAutoStart,M?.consentRequired,n,V]),oe=(0,Z.useCallback)(async()=>{let e=v.trim();if(e){a({type:`patch`,patch:{savingBrokerSecret:!0,actionError:null,brokerSecretNotice:null}});try{await ve({registrationSecret:e}),a({type:`patch`,patch:{brokerSecretDraft:``,brokerSecretNotice:n.brokerSecretSaved}}),S(),await I(),a({type:`patch`,patch:{actionError:null}})}catch(e){a({type:`patch`,patch:{actionError:e instanceof Error?e.message:String(e)}})}finally{a({type:`patch`,patch:{savingBrokerSecret:!1}})}}},[v,I,n.brokerSecretSaved]),se=(0,Z.useCallback)(async()=>{a({type:`patch`,patch:{savingBrokerSecret:!0,actionError:null,brokerSecretNotice:null}});try{await ve({registrationSecret:null}),a({type:`patch`,patch:{brokerSecretDraft:``,brokerSecretNotice:n.brokerSecretCleared}}),S(),await I()}catch(e){a({type:`patch`,patch:{actionError:e instanceof Error?e.message:String(e)}})}finally{a({type:`patch`,patch:{savingBrokerSecret:!1}})}},[I,n.brokerSecretCleared]),ce=(0,Z.useCallback)(async()=>{let e=j(),t=null,r=null;a({type:`patch`,patch:{authorizingBrokerSecret:!0,brokerSecretAuthorizationUrl:null,brokerSecretNotice:null,actionError:null}});try{for(t=(await L(`xopc-tunnel`)).sessionId;;){await new Promise(e=>window.setTimeout(e,1e3));let i=await ae(t);if(i.authUrl&&i.authUrl!==r&&(r=i.authUrl,a({type:`patch`,patch:{brokerSecretAuthorizationUrl:i.authUrl}}),await O(i.authUrl,e)),i.status===`failed`||i.status===`cancelled`)throw Error(i.error??i.message??`OAuth authorization failed`);if(i.status===`completed`){await he(),await Promise.all([I(),S()]),a({type:`patch`,patch:{brokerSecretNotice:n.brokerSecretSaved,brokerSecretDraft:``}});return}}}catch(e){a({type:`patch`,patch:{actionError:e instanceof Error?e.message:String(e)}})}finally{w(e),t&&F(t).catch(()=>void 0),a({type:`patch`,patch:{authorizingBrokerSecret:!1,brokerSecretAuthorizationUrl:null}})}},[I,n.brokerSecretSaved]),Y=(0,Z.useCallback)(async()=>{a({type:`patch`,patch:{releaseConfirmOpen:!1,actionError:null,releasing:!0}});try{await pe({release:!0}),await I(),S()}catch(e){a({type:`patch`,patch:{actionError:e instanceof Error?e.message:String(e)}})}finally{a({type:`patch`,patch:{releasing:!1}})}},[I]),le=(0,Z.useMemo)(()=>({copy:n.copyUrl,copied:n.copied,copyFailed:u(t).clipboard.copyFailed}),[t,n.copyUrl,n.copied]);if(!r)return(0,$.jsx)(`div`,{className:e?void 0:`w-full px-3 py-8 sm:px-5 xl:px-6`,children:(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.needToken})});let X=M??{enabled:!1,state:`disconnected`,subdomain:null,publicUrl:null,connectedSince:null,frpcPid:null,lastHeartbeatAt:null,lastError:null,consentRequired:!0,config:{autoStart:V,brokerUrl:`https://frp.xopc.ai/api`}},me=M?.consentRequired&&(X.enabled||V||M?.consent?.acceptedAt),_e=(0,$.jsx)(st,{t:n,brokerSecretReady:W,brokerSecretConfiguredInConfig:U,brokerSecretMaskedValue:U?H:``,brokerSecretDraft:v,savingBrokerSecret:y,authorizingBrokerSecret:b,brokerSecretAuthorizationUrl:T,brokerSecretNotice:D,copyFailedLabel:u(t).clipboard.copyFailed,onDraftChange:e=>a({type:`patch`,patch:{brokerSecretDraft:e}}),onSave:()=>void oe(),onAuthorize:()=>void ce(),onClear:()=>void se(),sectionRef:k}),be=(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ue,{open:m,title:n.consentTitle,intro:n.consentIntro,bullets:ee,checkboxLabel:n.consentCheckbox,confirmLabel:me?n.consentReconfirm:n.consentConfirm,cancelLabel:n.consentCancel,onConfirm:()=>void ne(),onCancel:()=>a({type:`patch`,patch:{consentOpen:!1}})},m?`consent-open`:`consent-closed`),(0,$.jsx)(B,{open:h,title:n.autoStartConfirmTitle,description:n.autoStartConfirmBody,confirmLabel:n.autoStartConfirmLabel,cancelLabel:n.consentCancel,onConfirm:()=>{a({type:`patch`,patch:{autoStartConfirmOpen:!1}}),q(!0)},onCancel:()=>a({type:`patch`,patch:{autoStartConfirmOpen:!1}})}),(0,$.jsx)(B,{open:g,title:n.releaseConfirmTitle,description:n.releaseConfirmBody,confirmLabel:n.releaseConfirmLabel,cancelLabel:n.consentCancel,destructive:!0,onConfirm:()=>void Y(),onCancel:()=>a({type:`patch`,patch:{releaseConfirmOpen:!1}})})]});return e?(0,$.jsxs)(`div`,{className:`flex w-full flex-col gap-4`,children:[o?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:o}):null,_e,(0,$.jsx)(at,{t:n,status:X,isLoading:P,statusErr:N,starting:s,stopping:c,showConsentExpired:!!me,copyLabels:le,startDisabled:!W,startDisabledReason:W?void 0:n.brokerSecretRequiredBeforeStart,stepLabel:n.flowStepStart,onStart:K,onStop:()=>void re()}),(0,$.jsxs)(Ve,{showLabel:n.showOptions,hideLabel:n.hideOptions,children:[(0,$.jsxs)(`label`,{className:d(`flex items-center gap-3 text-sm text-fg`,!V&&!M?.canAutoStart?`cursor-not-allowed opacity-60`:`cursor-pointer`),children:[(0,$.jsx)(`input`,{type:`checkbox`,className:`size-4 rounded border-edge accent-accent`,checked:V,disabled:l||!V&&!M?.canAutoStart,onChange:ie}),n.autoStart]}),!M?.canAutoStart&&!V?(0,$.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:n.autoStartHint}):null,X.subdomain||X.publicUrl?(0,$.jsxs)(`div`,{className:`space-y-2 rounded-xl bg-surface-base/45 p-4`,children:[(0,$.jsxs)(R,{type:`button`,variant:`secondary`,disabled:_||c,className:`border-danger/40 text-danger hover:bg-danger/10`,onClick:()=>a({type:`patch`,patch:{releaseConfirmOpen:!0}}),children:[_?(0,$.jsx)(z,{className:`size-4 animate-spin`}):null,n.release]}),(0,$.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:n.releaseHint})]}):null]}),(0,$.jsx)(Ve,{showLabel:n.showAdvanced,hideLabel:n.hideAdvanced,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-base/45 p-4 text-xs text-fg-subtle`,children:[(0,$.jsxs)(`p`,{className:`flex items-start gap-2`,children:[(0,$.jsx)(J,{className:`mt-0.5 size-4 shrink-0 text-accent`}),(0,$.jsx)(`span`,{children:n.brokerNote})]}),(0,$.jsx)(fe,{language:t,label:n.brokerDocsLink,section:`public-tunnel`,className:`text-xs`})]})}),be]}):(0,$.jsxs)(`div`,{className:e?`flex w-full flex-col gap-6`:`flex w-full flex-col gap-6 px-3 py-8 sm:px-5 xl:px-6`,children:[e?null:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h1`,{className:`text-lg font-semibold text-fg`,children:n.title}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:n.subtitle})]}),o?(0,$.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:o}):null,_e,(0,$.jsx)(at,{t:n,status:X,isLoading:P,statusErr:N,starting:s,stopping:c,showConsentExpired:!!me,copyLabels:le,startDisabled:!W,startDisabledReason:W?void 0:n.brokerSecretRequiredBeforeStart,onStart:K,onStop:()=>void re()}),X.subdomain||X.publicUrl?(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,$.jsxs)(R,{type:`button`,variant:`secondary`,disabled:_||c,className:`border-danger/40 text-danger hover:bg-danger/10`,onClick:()=>a({type:`patch`,patch:{releaseConfirmOpen:!0}}),children:[_?(0,$.jsx)(z,{className:`size-4 animate-spin`}):null,n.release]})}):null,X.subdomain||X.publicUrl?(0,$.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:n.releaseHint}):null,(0,$.jsxs)(ue,{children:[(0,$.jsx)(`h2`,{className:`mb-3 text-sm font-semibold text-fg`,children:n.optionsTitle}),(0,$.jsxs)(`label`,{className:d(`flex items-center gap-3 text-sm text-fg`,!V&&!M?.canAutoStart?`cursor-not-allowed opacity-60`:`cursor-pointer`),children:[(0,$.jsx)(`input`,{type:`checkbox`,className:`size-4 rounded border-edge accent-accent`,checked:V,disabled:l||!V&&!M?.canAutoStart,onChange:ie}),n.autoStart]}),!M?.canAutoStart&&!V?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-fg-subtle`,children:n.autoStartHint}):null]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg bg-surface-panel/80 px-3 py-2 text-xs text-fg-subtle shadow-surface`,children:[(0,$.jsxs)(`p`,{className:`flex items-start gap-2`,children:[(0,$.jsx)(J,{className:`mt-0.5 size-4 shrink-0 text-accent`}),(0,$.jsx)(`span`,{children:n.brokerNote})]}),(0,$.jsx)(fe,{language:t,label:n.brokerDocsLink,section:`public-tunnel`,className:`text-xs`})]}),be]})}function ft(e,t){return e.tabs[t]}function pt(e,t){return e.tabIntro[t]}function mt(e){switch(e){case`tailscale`:return`tailscale-serve`;case`public`:return`public-tunnel`;case`reverse-proxy`:return`reverse-proxy`;case`ssh`:return`ssh-tunnel`;case`lan`:return`lan`;default:return}}function ht(e){let t=(0,Q.c)(7),{tab:n,onOpenTab:r}=e;switch(n){case`guide`:{let e;return t[0]===r?e=t[1]:(e=(0,$.jsx)(Ae,{onOpenTab:r}),t[0]=r,t[1]=e),e}case`tailscale`:{let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(xe,{embedded:!0}),t[2]=e):e=t[2],e}case`public`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(dt,{embedded:!0}),t[3]=e):e=t[3],e}case`reverse-proxy`:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(X,{}),t[4]=e):e=t[4],e}case`ssh`:{let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Re,{}),t[5]=e):e=t[5],e}case`lan`:{let e;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Pe,{}),t[6]=e):e=t[6],e}}}function gt(){let e=(0,Q.c)(3),t=i(),n=p(vt),r=u(n).remoteAccess,o=!!f(_t),[s,c]=a(),l=D(),d=Be(s.get(`tab`)),m=s.get(`intent`)===`mobile-pairing`,h;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(h={refreshInterval:2e3},e[0]=h):h=e[0];let g=x(m?`device-pairing-readiness`:null,me,h),_;e[1]===c?_=e[2]:(_=e=>{c(t=>{let n=new URLSearchParams(t);return e===`guide`?n.delete(`tab`):n.set(`tab`,e),n},{replace:!0})},e[1]=c,e[2]=_);let v=_,y=pt(r,d),b=ze.filter(e=>l||e!==`ssh`&&e!==`reverse-proxy`||e===d).map(e=>({id:e,label:ft(r,e)}));return(0,$.jsxs)(se,{children:[(0,$.jsx)(oe,{title:r.pageTitle,meta:(0,$.jsx)(fe,{language:n,label:r.docsLink,section:mt(d),className:`mt-1`})}),o?(0,$.jsxs)($.Fragment,{children:[m?(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-xl bg-accent-soft px-4 py-3`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,$.jsx)(A,{className:`mt-0.5 size-5 shrink-0 text-accent`,"aria-hidden":!0}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:r.mobilePairingFlow.title}),(0,$.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:g.data?.ready?r.mobilePairingFlow.ready:r.mobilePairingFlow.hint})]})]}),(0,$.jsxs)(R,{variant:`primary`,disabled:!g.data?.ready,onClick:()=>t(`/settings/devices?startDevicePairing=mobile`),children:[g.data?.ready?r.mobilePairingFlow.continue:r.mobilePairingFlow.waiting,(0,$.jsx)(I,{className:`size-4`,"aria-hidden":!0})]})]}):null,(0,$.jsx)(U,{items:b,activeTab:d,onChange:v,ariaLabel:r.tabsAria,tabIdPrefix:`remote-access-tab`,panelIdPrefix:`remote-access-panel`}),(0,$.jsx)(ce,{id:d,activeTab:d,tabIdPrefix:`remote-access-tab`,panelIdPrefix:`remote-access-panel`,title:ft(r,d),hint:d===`public`?void 0:y,showHeading:!1,framed:!1,children:(0,$.jsx)(ht,{tab:d,onOpenTab:v})})]}):(0,$.jsx)(`p`,{className:`text-sm text-fg-muted`,children:r.guide.needToken})]})}function _t(e){return e.conversationId}function vt(e){return e.language}export{gt as RemoteAccessHub};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{t as r}from"./circle-check-C23XjkUj.js";import{t as i}from"./download-Dk-ZjtO6.js";import{t as a}from"./messages-DPxcWxfD.js";import{n as o,r as s}from"./locale-store-Djl2FW6_.js";import{i as c}from"./vendor-swr-BIWyz7Rc.js";import{On as l,Wc as u,Xa as d,ds as f,fs as p,of as m,ou as h}from"./index-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{t as r}from"./circle-check-C23XjkUj.js";import{t as i}from"./download-Dk-ZjtO6.js";import{t as a}from"./messages-DPxcWxfD.js";import{n as o,r as s}from"./locale-store-Djl2FW6_.js";import{i as c}from"./vendor-swr-BIWyz7Rc.js";import{On as l,Wc as u,Xa as d,ds as f,fs as p,of as m,ou as h}from"./index-Dsp_gNdl.js";import{n as g,r as _}from"./settings-page-layout-Dx5S-Msc.js";import{t as v}from"./settings-advanced-gate-F1WX7vxq.js";import{i as y,n as b,r as x}from"./runtime-tools-api-C_VOMhLI.js";var S=e(t(),1);function C(e){return e?.trim()||void 0}function w(e,t,n){return e?.state===`ready`?C(t)!==C(n):!0}var T=n(),E=[`node`,`python`,`uv`];function D(){let e=a(o(e=>e.language)).runtimeToolsSettings,{data:t,error:n,isLoading:C,mutate:D}=c(s(`/api/runtime-tools`)),[O,k]=(0,S.useState)(null),[A,j]=(0,S.useState)(!1),[M,N]=(0,S.useState)(!1),[P,F]=(0,S.useState)({}),[I,L]=(0,S.useState)({}),[R,z]=(0,S.useState)(null),B=Object.values(P).some(Boolean);if((0,S.useEffect)(()=>{t?.payload.config&&k(structuredClone(t.payload.config))},[t?.payload.config]),n)return(0,T.jsxs)(_,{children:[(0,T.jsx)(g,{title:e.title,subtitle:e.loadError}),(0,T.jsx)(u,{onClick:()=>void D(),children:e.refresh})]});if(C||!O)return(0,T.jsx)(_,{children:(0,T.jsx)(l,{sections:3})});let V=new Map(t?.payload.statuses.map(e=>[e.runtime,e])),H=(e,t)=>k(n=>n&&{...n,[e]:{...n[e],...t}}),U=async()=>{j(!0),z(null);try{await y(O),await D()}catch(e){z(e instanceof Error?e.message:String(e))}finally{j(!1)}},W=async(e,t)=>{F(t=>({...t,[e]:!0})),z(null);try{await y(O),await x({runtime:e,action:t,version:e===`uv`?O.uv.version:O[e].version,onProgress:t=>L(n=>({...n,[e]:t}))}),await D()}catch(e){z(e instanceof Error?e.message:String(e))}finally{F(t=>({...t,[e]:!1}))}},G=async()=>{N(!0),z(null);try{await b(),await D()}catch(e){z(e instanceof Error?e.message:String(e))}finally{N(!1)}};return(0,T.jsxs)(_,{gap:`gap-6`,children:[(0,T.jsx)(g,{title:e.title,actions:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(d,{className:`size-9 shrink-0 p-0`,disabled:B,label:e.refresh,onClick:async()=>{await D()}}),(0,T.jsx)(u,{onClick:()=>void G(),disabled:M||B,children:M?e.pruning:e.prune}),(0,T.jsx)(u,{variant:`primary`,onClick:()=>void U(),disabled:A||B,children:A?e.saving:e.save})]})}),R?(0,T.jsx)(`div`,{className:`rounded-xl bg-danger/10 px-4 py-3 text-sm text-danger`,children:R}):null,(0,T.jsx)(`section`,{className:`rounded-xl bg-surface-hover/20 p-4`,children:(0,T.jsxs)(`label`,{className:`flex items-center justify-between gap-4`,children:[(0,T.jsxs)(`span`,{children:[(0,T.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e.enabled}),(0,T.jsx)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:e.enabledHint})]}),(0,T.jsx)(`input`,{type:`checkbox`,checked:O.enabled,onChange:e=>k({...O,enabled:e.target.checked}),className:`size-4 accent-accent`})]})}),(0,T.jsx)(v,{children:(0,T.jsxs)(`section`,{className:`grid gap-4 rounded-xl bg-surface-hover/20 p-4 md:grid-cols-2`,children:[(0,T.jsxs)(`label`,{className:`space-y-1.5 text-xs font-medium text-fg-muted`,children:[e.downloadSource,(0,T.jsxs)(f,{value:O.download.source,onChange:e=>k({...O,download:{...O.download,source:e.target.value}}),children:[(0,T.jsx)(p,{value:`auto`,children:e.downloadSources.auto}),(0,T.jsx)(p,{value:`website-only`,children:e.downloadSources.websiteOnly}),(0,T.jsx)(p,{value:`direct-only`,children:e.downloadSources.directOnly})]})]}),(0,T.jsxs)(`label`,{className:`space-y-1.5 text-xs font-medium text-fg-muted`,children:[e.gatewayBaseUrl,(0,T.jsx)(`input`,{value:O.download.gatewayBaseUrl,disabled:O.download.source===`direct-only`,onChange:e=>k({...O,download:{...O.download,gatewayBaseUrl:e.target.value}}),className:`h-10 w-full rounded-lg border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-edge-strong disabled:opacity-50`})]}),(0,T.jsxs)(`label`,{className:`space-y-1.5 text-xs font-medium text-fg-muted`,children:[e.offlineBundle,(0,T.jsx)(`input`,{value:O.download.bundleDir??``,placeholder:e.offlineBundlePlaceholder,onChange:e=>k({...O,download:{...O.download,bundleDir:e.target.value||void 0}}),className:`h-10 w-full rounded-lg border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-edge-strong`})]}),(0,T.jsxs)(`label`,{className:`space-y-1.5 text-xs font-medium text-fg-muted`,children:[e.proxy,(0,T.jsx)(`input`,{value:O.download.proxy??``,placeholder:`http://127.0.0.1:7890`,onChange:e=>k({...O,download:{...O.download,proxy:e.target.value||void 0}}),className:`h-10 w-full rounded-lg border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-edge-strong`})]})]})}),(0,T.jsx)(`div`,{className:`flex flex-col gap-4`,children:E.map(n=>{let a=V.get(n),o=a?.state===`ready`,s=I[n],c=n===`uv`?O.uv:O[n],l=n===`uv`?t?.payload.config.uv:t?.payload.config[n],d=P[n]===!0,g=w(a,c.version,l?.version);return(0,T.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-5 rounded-xl bg-surface-base/55 p-5 sm:p-6`,children:[(0,T.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:e.runtimeNames[n]}),(0,T.jsx)(`p`,{className:`mt-1 break-words text-xs text-fg-muted`,children:a?.message??e.unknown})]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[o?(0,T.jsx)(r,{className:`size-5 shrink-0 text-success`}):(0,T.jsx)(m,{className:`size-5 shrink-0 text-warning`}),(0,T.jsx)(`input`,{type:`checkbox`,"aria-label":`${e.runtimeNames[n]} ${e.enabled}`,checked:c.enabled,onChange:e=>{n===`uv`?k({...O,uv:{...O.uv,enabled:e.target.checked}}):H(n,{enabled:e.target.checked})},className:`size-4 accent-accent`})]})]}),(0,T.jsxs)(`div`,{className:n===`uv`?`grid gap-4 md:grid-cols-[minmax(16rem,28rem)]`:`grid gap-4 md:grid-cols-2 xl:grid-cols-3`,children:[(0,T.jsxs)(`label`,{className:`space-y-1.5 text-xs font-medium text-fg-muted`,children:[e.version,(0,T.jsx)(`input`,{value:c.version??``,placeholder:a?.requestedVersion,onChange:e=>{let t=e.target.value||void 0;n===`uv`?k({...O,uv:{...O.uv,version:t}}):H(n,{version:t})},className:`h-10 w-full rounded-lg border border-edge bg-surface-inset px-3 text-sm text-fg outline-none focus:border-edge-strong`})]}),n===`uv`?null:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`label`,{className:`space-y-1.5 text-xs font-medium text-fg-muted`,children:[e.sourcePolicy,(0,T.jsxs)(f,{value:O[n].preference,onChange:e=>H(n,{preference:e.target.value}),children:[(0,T.jsx)(p,{value:`managed-first`,children:e.preferences.managedFirst}),(0,T.jsx)(p,{value:`system-first`,children:e.preferences.systemFirst}),(0,T.jsx)(p,{value:`managed-only`,children:e.preferences.managedOnly}),(0,T.jsx)(p,{value:`system-only`,children:e.preferences.systemOnly})]})]}),(0,T.jsxs)(`label`,{className:`space-y-1.5 text-xs font-medium text-fg-muted`,children:[e.provisionPolicy,(0,T.jsxs)(f,{value:O[n].provision,onChange:e=>H(n,{provision:e.target.value}),children:[(0,T.jsx)(p,{value:`eager`,children:e.provisions.eager}),(0,T.jsx)(p,{value:`on-demand`,children:e.provisions.onDemand}),(0,T.jsx)(p,{value:`disabled`,children:e.provisions.disabled})]})]})]})]}),s&&d?(0,T.jsxs)(`div`,{className:`rounded-lg bg-accent-soft px-3 py-2 text-xs text-accent-fg`,children:[s.message,s.totalBytes&&s.downloadedBytes?` · ${Math.round(s.downloadedBytes/s.totalBytes*100)}%`:``]}):null,(0,T.jsxs)(`div`,{className:`mt-auto flex flex-wrap items-center justify-between gap-3`,children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[g?(0,T.jsxs)(u,{variant:`primary`,disabled:!O.enabled||!c.enabled||d,onClick:()=>void W(n,`install`),children:[(0,T.jsx)(i,{className:`size-4`}),d?e.working:e.install]}):(0,T.jsxs)(`span`,{className:`inline-flex h-9 items-center gap-2 px-1 text-sm text-success`,children:[(0,T.jsx)(r,{className:`size-4`}),e.installed]}),a?.repairable?(0,T.jsxs)(u,{disabled:!O.enabled||!c.enabled||d,onClick:()=>void W(n,`repair`),children:[(0,T.jsx)(h,{className:`size-4`}),e.repair]}):null]}),(0,T.jsx)(v,{children:a?.resolved?.executable?(0,T.jsx)(`code`,{className:`break-all text-[11px] text-fg-subtle`,children:a.resolved.executable}):null})]})]},n)})})]})}export{D as RuntimeToolsSettingsPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-aKtaBQYM.js";import{a as e,n as t,t as n}from"./vendor-react-BOUWij0V.js";import{t as r}from"./cn-0WouolD0.js";import{As as i,Ns as a,ds as o,fs as s}from"./index-XRbEWVyZ.js";import{t as c}from"./number-input-DDeqHK-G.js";var l=t();e();var u=n();function d(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function f(e){let t=e[`x-order`];return typeof t==`number`&&!Number.isNaN(t)?t:999}function p(e){let t=e[`x-group`];return typeof t==`string`&&t.length>0?t:``}function m(e){return e[`x-hidden`]===!0}function h(e){let t=e.properties;if(!d(t))return[];let n=[];for(let[e,r]of Object.entries(t))d(r)&&(m(r)||n.push({key:e,sub:r,order:f(r),group:p(r),hidden:!1}));return n.sort((e,t)=>e.order-t.order||e.key.localeCompare(t.key)),n}function g(e){let t=new Map;for(let n of e){let e=n.group;t.has(e)||t.set(e,[]),t.get(e).push(n)}return t}function _(e){let t=(0,l.c)(38),{name:n,s:r,value:s,onChange:c,disabled:d}=e,f=typeof r.description==`string`?r.description:void 0,p=(typeof r[`x-placeholder`]==`string`?r[`x-placeholder`]:null)||f,m=r.format;if(Array.isArray(r.enum)&&r.enum.every(y)){let e;t[0]===f?e=t[1]:(e=f?(0,u.jsx)(`label`,{className:`text-xs text-fg-muted`,children:f}):null,t[0]=f,t[1]=e);let i;t[2]===c?i=t[3]:(i=e=>c(e.target.value),t[2]=c,t[3]=i);let a;t[4]===r.enum?a=t[5]:(a=r.enum.map(v),t[4]=r.enum,t[5]=a);let l;t[6]!==d||t[7]!==n||t[8]!==i||t[9]!==a||t[10]!==s?(l=(0,u.jsx)(o,{name:n,className:`ui-input h-9 rounded-md border border-edge bg-surface-base px-2 text-sm text-fg`,value:s,disabled:d,onChange:i,children:a}),t[6]=d,t[7]=n,t[8]=i,t[9]=a,t[10]=s,t[11]=l):l=t[11];let p;return t[12]!==e||t[13]!==l?(p=(0,u.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e,l]}),t[12]=e,t[13]=l,t[14]=p):p=t[14],p}if(m===`password`){let e;t[15]===f?e=t[16]:(e=f?(0,u.jsx)(`label`,{className:`text-xs text-fg-muted`,children:f}):null,t[15]=f,t[16]=e);let n;t[17]!==d||t[18]!==c||t[19]!==p||t[20]!==s?(n=(0,u.jsx)(a,{value:s,onChange:c,placeholder:p,labels:i,disabled:d,inputClassName:`ui-input h-9 rounded-md border border-edge bg-surface-base px-2.5 text-sm text-fg placeholder:text-fg-muted/70`}),t[17]=d,t[18]=c,t[19]=p,t[20]=s,t[21]=n):n=t[21];let r;return t[22]!==e||t[23]!==n?(r=(0,u.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e,n]}),t[22]=e,t[23]=n,t[24]=r):r=t[24],r}let h;t[25]===f?h=t[26]:(h=f?(0,u.jsx)(`label`,{className:`text-xs text-fg-muted`,children:f}):null,t[25]=f,t[26]=h);let g;t[27]===c?g=t[28]:(g=e=>c(e.target.value),t[27]=c,t[28]=g);let _;t[29]!==d||t[30]!==n||t[31]!==p||t[32]!==g||t[33]!==s?(_=(0,u.jsx)(`input`,{name:n,type:`text`,className:`ui-input h-9 rounded-md border border-edge bg-surface-base px-2.5 text-sm text-fg placeholder:text-fg-muted/70`,value:s,placeholder:p,disabled:d,onChange:g}),t[29]=d,t[30]=n,t[31]=p,t[32]=g,t[33]=s,t[34]=_):_=t[34];let b;return t[35]!==h||t[36]!==_?(b=(0,u.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[h,_]}),t[35]=h,t[36]=_,t[37]=b):b=t[37],b}function v(e){return(0,u.jsx)(s,{value:e,children:e},e)}function y(e){return typeof e==`string`}function b(e){let t=(0,l.c)(11),{s:n,value:r,onChange:i,disabled:a}=e,o=typeof n.description==`string`?n.description:void 0,s;t[0]===o?s=t[1]:(s=o?(0,u.jsx)(`label`,{className:`text-xs text-fg-muted`,children:o}):null,t[0]=o,t[1]=s);let d=Number.isFinite(r)?r:0,f;t[2]===i?f=t[3]:(f=e=>i(Number(e.target.value)),t[2]=i,t[3]=f);let p;t[4]!==a||t[5]!==d||t[6]!==f?(p=(0,u.jsx)(c,{type:`number`,className:`ui-input h-9 rounded-md border border-edge bg-surface-base px-2.5 text-sm text-fg`,value:d,disabled:a,onChange:f}),t[4]=a,t[5]=d,t[6]=f,t[7]=p):p=t[7];let m;return t[8]!==s||t[9]!==p?(m=(0,u.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[s,p]}),t[8]=s,t[9]=p,t[10]=m):m=t[10],m}function x(e){let t=(0,l.c)(11),{s:n,value:r,onChange:i,disabled:a,labels:o}=e,s=(typeof n.description==`string`?n.description:void 0)??(typeof n.title==`string`&&n.title.length>0?n.title:o?.defaultBooleanLabel??`Enable`),c;t[0]===i?c=t[1]:(c=e=>i(e.target.checked),t[0]=i,t[1]=c);let d;t[2]!==a||t[3]!==c||t[4]!==r?(d=(0,u.jsx)(`input`,{type:`checkbox`,className:`size-4 rounded border border-edge`,checked:r,disabled:a,onChange:c}),t[2]=a,t[3]=c,t[4]=r,t[5]=d):d=t[5];let f;t[6]===s?f=t[7]:(f=(0,u.jsx)(`span`,{children:s}),t[6]=s,t[7]=f);let p;return t[8]!==d||t[9]!==f?(p=(0,u.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-fg`,children:[d,f]}),t[8]=d,t[9]=f,t[10]=p):p=t[10],p}function S(e){let t=(0,l.c)(27),{s:n,value:r,onChange:i,disabled:a,labels:o}=e,s=typeof n.description==`string`?n.description:void 0,c=n.items,f=d(c)?c.type:void 0;if(!(f===`string`||Array.isArray(f)&&f.includes(`string`))){let e=o?.unsupportedArrayType??`Unsupported array type`,n;return t[0]===e?n=t[1]:(n=(0,u.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e}),t[0]=e,t[1]=n),n}let p,m,h,g,_;if(t[2]!==s||t[3]!==a||t[4]!==i||t[5]!==r){let e=r.map(String);p=t=>{let n=t.trim();!n||e.includes(n)||i([...e,n])},g=`flex flex-col gap-1.5`,t[11]===s?_=t[12]:(_=s?(0,u.jsx)(`label`,{className:`text-xs text-fg-muted`,children:s}):null,t[11]=s,t[12]=_),m=`flex flex-wrap gap-1`,h=e.map(t=>(0,u.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-md border border-edge bg-surface-panel px-2 py-0.5 text-sm`,children:[t,(0,u.jsx)(`button`,{type:`button`,className:`text-fg-muted hover:text-fg`,disabled:a,onClick:()=>i(e.filter(e=>e!==t)),children:`×`})]},t)),t[2]=s,t[3]=a,t[4]=i,t[5]=r,t[6]=p,t[7]=m,t[8]=h,t[9]=g,t[10]=_}else p=t[6],m=t[7],h=t[8],g=t[9],_=t[10];let v;t[13]!==m||t[14]!==h?(v=(0,u.jsx)(`div`,{className:m,children:h}),t[13]=m,t[14]=h,t[15]=v):v=t[15];let y=o?.arrayAddPlaceholder??`Add and press Enter`,b;t[16]===p?b=t[17]:(b=e=>{e.key===`Enter`&&(e.preventDefault(),p(e.target.value),e.target.value=``)},t[16]=p,t[17]=b);let x;t[18]!==a||t[19]!==y||t[20]!==b?(x=(0,u.jsx)(`input`,{className:`ui-input h-9 rounded-md border border-edge bg-surface-base px-2.5 text-sm`,disabled:a,placeholder:y,onKeyDown:b}),t[18]=a,t[19]=y,t[20]=b,t[21]=x):x=t[21];let S;return t[22]!==g||t[23]!==_||t[24]!==v||t[25]!==x?(S=(0,u.jsxs)(`div`,{className:g,children:[_,v,x]}),t[22]=g,t[23]=_,t[24]=v,t[25]=x,t[26]=S):S=t[26],S}function C(e){let t=(0,l.c)(66),{k:n,sub:r,value:i,onValue:a,disabled:o,labels:s}=e,c=r.type,f=(typeof r.title==`string`&&r.title.length>0?r.title:null)??n;if(c===`boolean`){let e;t[0]===f?e=t[1]:(e=(0,u.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:f}),t[0]=f,t[1]=e);let n=i===!0,c;t[2]===a?c=t[3]:(c=e=>a(e),t[2]=a,t[3]=c);let l;t[4]!==o||t[5]!==s||t[6]!==r||t[7]!==n||t[8]!==c?(l=(0,u.jsx)(x,{s:r,value:n,disabled:o,onChange:c,labels:s}),t[4]=o,t[5]=s,t[6]=r,t[7]=n,t[8]=c,t[9]=l):l=t[9];let d;return t[10]!==e||t[11]!==l?(d=(0,u.jsxs)(`div`,{className:`space-y-1.5`,children:[e,l]}),t[10]=e,t[11]=l,t[12]=d):d=t[12],d}if(c===`number`||c===`integer`){let e;t[13]===f?e=t[14]:(e=(0,u.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:f}),t[13]=f,t[14]=e);let n=typeof i==`number`?i:0,s;t[15]!==o||t[16]!==a||t[17]!==r||t[18]!==n?(s=(0,u.jsx)(b,{s:r,value:n,disabled:o,onChange:a}),t[15]=o,t[16]=a,t[17]=r,t[18]=n,t[19]=s):s=t[19];let c;return t[20]!==e||t[21]!==s?(c=(0,u.jsxs)(`div`,{className:`space-y-1.5`,children:[e,s]}),t[20]=e,t[21]=s,t[22]=c):c=t[22],c}if(c===`string`){let e;t[23]===f?e=t[24]:(e=(0,u.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:f}),t[23]=f,t[24]=e);let s=typeof i==`string`?i:``,c;t[25]!==o||t[26]!==n||t[27]!==a||t[28]!==r||t[29]!==s?(c=(0,u.jsx)(_,{name:n,s:r,value:s,disabled:o,onChange:a}),t[25]=o,t[26]=n,t[27]=a,t[28]=r,t[29]=s,t[30]=c):c=t[30];let l;return t[31]!==e||t[32]!==c?(l=(0,u.jsxs)(`div`,{className:`space-y-1.5`,children:[e,c]}),t[31]=e,t[32]=c,t[33]=l):l=t[33],l}if(c===`array`){let e=r.items,n=d(e)?e.type:void 0;if(n===`string`||Array.isArray(n)&&n.includes(`string`)){let e;t[34]===f?e=t[35]:(e=(0,u.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:f}),t[34]=f,t[35]=e);let n;t[36]===i?n=t[37]:(n=Array.isArray(i)&&i.every(w)?i.map(String):[],t[36]=i,t[37]=n);let c;t[38]!==o||t[39]!==s||t[40]!==a||t[41]!==r||t[42]!==n?(c=(0,u.jsx)(S,{s:r,value:n,disabled:o,onChange:a,labels:s}),t[38]=o,t[39]=s,t[40]=a,t[41]=r,t[42]=n,t[43]=c):c=t[43];let l;return t[44]!==e||t[45]!==c?(l=(0,u.jsxs)(`div`,{className:`space-y-1.5`,children:[e,c]}),t[44]=e,t[45]=c,t[46]=l):l=t[46],l}}if(c===`object`){let e;t[47]===i?e=t[48]:(e=d(i)?i:{},t[47]=i,t[48]=e);let n=e,c;t[49]===f?c=t[50]:(c=(0,u.jsx)(`summary`,{className:`cursor-pointer select-none px-3 py-2 text-sm font-medium text-fg group-open:rounded-b-none`,children:f}),t[49]=f,t[50]=c);let l;t[51]!==o||t[52]!==s||t[53]!==n||t[54]!==a||t[55]!==r?(l=(0,u.jsx)(`div`,{className:`border-t border-edge p-3`,children:(0,u.jsx)(T,{schema:r,values:n,onChange:a,disabled:o,labels:s})}),t[51]=o,t[52]=s,t[53]=n,t[54]=a,t[55]=r,t[56]=l):l=t[56];let p;return t[57]!==c||t[58]!==l?(p=(0,u.jsxs)(`details`,{className:`group rounded-lg border border-edge bg-surface-panel/40 open:bg-surface-base`,open:!0,children:[c,l]}),t[57]=c,t[58]=l,t[59]=p):p=t[59],p}let p;t[60]!==s||t[61]!==c||t[62]!==f?(p=s?.unsupportedFieldType?.(f,typeof c==`string`?c:void 0)??`${f}: unsupported field type${typeof c==`string`?` (${c})`:``}`,t[60]=s,t[61]=c,t[62]=f,t[63]=p):p=t[63];let m;return t[64]===p?m=t[65]:(m=(0,u.jsx)(`p`,{className:`text-xs text-fg-muted`,children:p}),t[64]=p,t[65]=m),m}function w(e){return typeof e==`string`||typeof e==`number`}function T(e){let t=(0,l.c)(28),{schema:n,values:i,onChange:a,disabled:o,className:s,labels:c}=e,f=o===void 0?!1:o,p;bb0:{if(n.type!==`object`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[0]=e):e=t[0],p=e;break bb0}let e;t[1]===n?e=t[2]:(e=h(n),t[1]=n,t[2]=e),p=e}let m=p,_;bb1:{if(m.length===0){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=new Map,t[3]=e):e=t[3],_=e;break bb1}let e;t[4]===m?e=t[5]:(e=g(m),t[4]=m,t[5]=e),_=e}let v=_,y;t[6]!==a||t[7]!==i?(y=(e,t)=>{a({...i,[e]:t})},t[6]=a,t[7]=i,t[8]=y):y=t[8];let b=y;if(n.type!==`object`||!d(n.properties)||m.length===0)return null;let x,S;if(t[9]!==s||t[10]!==f||t[11]!==v||t[12]!==c||t[13]!==b||t[14]!==i){let e=Array.from(v.keys()).sort(E);t[17]===s?x=t[18]:(x=r(`flex flex-col gap-4`,s),t[17]=s,t[18]=x);let n;t[19]!==f||t[20]!==v||t[21]!==c||t[22]!==b||t[23]!==i?(n=e=>{let t=(v.get(e)??[]).map(e=>(0,u.jsx)(C,{k:e.key,sub:e.sub,value:i[e.key],onValue:t=>b(e.key,t),disabled:f,labels:c},e.key));return e===``?(0,u.jsx)(`div`,{children:t},`default`):(0,u.jsxs)(`details`,{className:`group rounded-lg border border-edge bg-surface-panel/40 open:bg-surface-base`,open:!0,children:[(0,u.jsx)(`summary`,{className:`cursor-pointer select-none px-3 py-2 text-sm font-medium text-fg group-open:rounded-b-none`,children:e}),(0,u.jsx)(`div`,{className:`space-y-4 border-t border-edge p-3`,children:t})]},e)},t[19]=f,t[20]=v,t[21]=c,t[22]=b,t[23]=i,t[24]=n):n=t[24],S=e.map(n),t[9]=s,t[10]=f,t[11]=v,t[12]=c,t[13]=b,t[14]=i,t[15]=x,t[16]=S}else x=t[15],S=t[16];let w;return t[25]!==x||t[26]!==S?(w=(0,u.jsx)(`div`,{className:x,children:S}),t[25]=x,t[26]=S,t[27]=w):w=t[27],w}function E(e,t){return e===``?-1:t===``?1:e.localeCompare(t)}export{T as t};
|
|
1
|
+
import"./rolldown-runtime-aKtaBQYM.js";import{a as e,n as t,t as n}from"./vendor-react-BOUWij0V.js";import{t as r}from"./cn-0WouolD0.js";import{As as i,Ns as a,ds as o,fs as s}from"./index-Dsp_gNdl.js";import{t as c}from"./number-input-DDeqHK-G.js";var l=t();e();var u=n();function d(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function f(e){let t=e[`x-order`];return typeof t==`number`&&!Number.isNaN(t)?t:999}function p(e){let t=e[`x-group`];return typeof t==`string`&&t.length>0?t:``}function m(e){return e[`x-hidden`]===!0}function h(e){let t=e.properties;if(!d(t))return[];let n=[];for(let[e,r]of Object.entries(t))d(r)&&(m(r)||n.push({key:e,sub:r,order:f(r),group:p(r),hidden:!1}));return n.sort((e,t)=>e.order-t.order||e.key.localeCompare(t.key)),n}function g(e){let t=new Map;for(let n of e){let e=n.group;t.has(e)||t.set(e,[]),t.get(e).push(n)}return t}function _(e){let t=(0,l.c)(38),{name:n,s:r,value:s,onChange:c,disabled:d}=e,f=typeof r.description==`string`?r.description:void 0,p=(typeof r[`x-placeholder`]==`string`?r[`x-placeholder`]:null)||f,m=r.format;if(Array.isArray(r.enum)&&r.enum.every(y)){let e;t[0]===f?e=t[1]:(e=f?(0,u.jsx)(`label`,{className:`text-xs text-fg-muted`,children:f}):null,t[0]=f,t[1]=e);let i;t[2]===c?i=t[3]:(i=e=>c(e.target.value),t[2]=c,t[3]=i);let a;t[4]===r.enum?a=t[5]:(a=r.enum.map(v),t[4]=r.enum,t[5]=a);let l;t[6]!==d||t[7]!==n||t[8]!==i||t[9]!==a||t[10]!==s?(l=(0,u.jsx)(o,{name:n,className:`ui-input h-9 rounded-md border border-edge bg-surface-base px-2 text-sm text-fg`,value:s,disabled:d,onChange:i,children:a}),t[6]=d,t[7]=n,t[8]=i,t[9]=a,t[10]=s,t[11]=l):l=t[11];let p;return t[12]!==e||t[13]!==l?(p=(0,u.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e,l]}),t[12]=e,t[13]=l,t[14]=p):p=t[14],p}if(m===`password`){let e;t[15]===f?e=t[16]:(e=f?(0,u.jsx)(`label`,{className:`text-xs text-fg-muted`,children:f}):null,t[15]=f,t[16]=e);let n;t[17]!==d||t[18]!==c||t[19]!==p||t[20]!==s?(n=(0,u.jsx)(a,{value:s,onChange:c,placeholder:p,labels:i,disabled:d,inputClassName:`ui-input h-9 rounded-md border border-edge bg-surface-base px-2.5 text-sm text-fg placeholder:text-fg-muted/70`}),t[17]=d,t[18]=c,t[19]=p,t[20]=s,t[21]=n):n=t[21];let r;return t[22]!==e||t[23]!==n?(r=(0,u.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e,n]}),t[22]=e,t[23]=n,t[24]=r):r=t[24],r}let h;t[25]===f?h=t[26]:(h=f?(0,u.jsx)(`label`,{className:`text-xs text-fg-muted`,children:f}):null,t[25]=f,t[26]=h);let g;t[27]===c?g=t[28]:(g=e=>c(e.target.value),t[27]=c,t[28]=g);let _;t[29]!==d||t[30]!==n||t[31]!==p||t[32]!==g||t[33]!==s?(_=(0,u.jsx)(`input`,{name:n,type:`text`,className:`ui-input h-9 rounded-md border border-edge bg-surface-base px-2.5 text-sm text-fg placeholder:text-fg-muted/70`,value:s,placeholder:p,disabled:d,onChange:g}),t[29]=d,t[30]=n,t[31]=p,t[32]=g,t[33]=s,t[34]=_):_=t[34];let b;return t[35]!==h||t[36]!==_?(b=(0,u.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[h,_]}),t[35]=h,t[36]=_,t[37]=b):b=t[37],b}function v(e){return(0,u.jsx)(s,{value:e,children:e},e)}function y(e){return typeof e==`string`}function b(e){let t=(0,l.c)(11),{s:n,value:r,onChange:i,disabled:a}=e,o=typeof n.description==`string`?n.description:void 0,s;t[0]===o?s=t[1]:(s=o?(0,u.jsx)(`label`,{className:`text-xs text-fg-muted`,children:o}):null,t[0]=o,t[1]=s);let d=Number.isFinite(r)?r:0,f;t[2]===i?f=t[3]:(f=e=>i(Number(e.target.value)),t[2]=i,t[3]=f);let p;t[4]!==a||t[5]!==d||t[6]!==f?(p=(0,u.jsx)(c,{type:`number`,className:`ui-input h-9 rounded-md border border-edge bg-surface-base px-2.5 text-sm text-fg`,value:d,disabled:a,onChange:f}),t[4]=a,t[5]=d,t[6]=f,t[7]=p):p=t[7];let m;return t[8]!==s||t[9]!==p?(m=(0,u.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[s,p]}),t[8]=s,t[9]=p,t[10]=m):m=t[10],m}function x(e){let t=(0,l.c)(11),{s:n,value:r,onChange:i,disabled:a,labels:o}=e,s=(typeof n.description==`string`?n.description:void 0)??(typeof n.title==`string`&&n.title.length>0?n.title:o?.defaultBooleanLabel??`Enable`),c;t[0]===i?c=t[1]:(c=e=>i(e.target.checked),t[0]=i,t[1]=c);let d;t[2]!==a||t[3]!==c||t[4]!==r?(d=(0,u.jsx)(`input`,{type:`checkbox`,className:`size-4 rounded border border-edge`,checked:r,disabled:a,onChange:c}),t[2]=a,t[3]=c,t[4]=r,t[5]=d):d=t[5];let f;t[6]===s?f=t[7]:(f=(0,u.jsx)(`span`,{children:s}),t[6]=s,t[7]=f);let p;return t[8]!==d||t[9]!==f?(p=(0,u.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-fg`,children:[d,f]}),t[8]=d,t[9]=f,t[10]=p):p=t[10],p}function S(e){let t=(0,l.c)(27),{s:n,value:r,onChange:i,disabled:a,labels:o}=e,s=typeof n.description==`string`?n.description:void 0,c=n.items,f=d(c)?c.type:void 0;if(!(f===`string`||Array.isArray(f)&&f.includes(`string`))){let e=o?.unsupportedArrayType??`Unsupported array type`,n;return t[0]===e?n=t[1]:(n=(0,u.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e}),t[0]=e,t[1]=n),n}let p,m,h,g,_;if(t[2]!==s||t[3]!==a||t[4]!==i||t[5]!==r){let e=r.map(String);p=t=>{let n=t.trim();!n||e.includes(n)||i([...e,n])},g=`flex flex-col gap-1.5`,t[11]===s?_=t[12]:(_=s?(0,u.jsx)(`label`,{className:`text-xs text-fg-muted`,children:s}):null,t[11]=s,t[12]=_),m=`flex flex-wrap gap-1`,h=e.map(t=>(0,u.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-md border border-edge bg-surface-panel px-2 py-0.5 text-sm`,children:[t,(0,u.jsx)(`button`,{type:`button`,className:`text-fg-muted hover:text-fg`,disabled:a,onClick:()=>i(e.filter(e=>e!==t)),children:`×`})]},t)),t[2]=s,t[3]=a,t[4]=i,t[5]=r,t[6]=p,t[7]=m,t[8]=h,t[9]=g,t[10]=_}else p=t[6],m=t[7],h=t[8],g=t[9],_=t[10];let v;t[13]!==m||t[14]!==h?(v=(0,u.jsx)(`div`,{className:m,children:h}),t[13]=m,t[14]=h,t[15]=v):v=t[15];let y=o?.arrayAddPlaceholder??`Add and press Enter`,b;t[16]===p?b=t[17]:(b=e=>{e.key===`Enter`&&(e.preventDefault(),p(e.target.value),e.target.value=``)},t[16]=p,t[17]=b);let x;t[18]!==a||t[19]!==y||t[20]!==b?(x=(0,u.jsx)(`input`,{className:`ui-input h-9 rounded-md border border-edge bg-surface-base px-2.5 text-sm`,disabled:a,placeholder:y,onKeyDown:b}),t[18]=a,t[19]=y,t[20]=b,t[21]=x):x=t[21];let S;return t[22]!==g||t[23]!==_||t[24]!==v||t[25]!==x?(S=(0,u.jsxs)(`div`,{className:g,children:[_,v,x]}),t[22]=g,t[23]=_,t[24]=v,t[25]=x,t[26]=S):S=t[26],S}function C(e){let t=(0,l.c)(66),{k:n,sub:r,value:i,onValue:a,disabled:o,labels:s}=e,c=r.type,f=(typeof r.title==`string`&&r.title.length>0?r.title:null)??n;if(c===`boolean`){let e;t[0]===f?e=t[1]:(e=(0,u.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:f}),t[0]=f,t[1]=e);let n=i===!0,c;t[2]===a?c=t[3]:(c=e=>a(e),t[2]=a,t[3]=c);let l;t[4]!==o||t[5]!==s||t[6]!==r||t[7]!==n||t[8]!==c?(l=(0,u.jsx)(x,{s:r,value:n,disabled:o,onChange:c,labels:s}),t[4]=o,t[5]=s,t[6]=r,t[7]=n,t[8]=c,t[9]=l):l=t[9];let d;return t[10]!==e||t[11]!==l?(d=(0,u.jsxs)(`div`,{className:`space-y-1.5`,children:[e,l]}),t[10]=e,t[11]=l,t[12]=d):d=t[12],d}if(c===`number`||c===`integer`){let e;t[13]===f?e=t[14]:(e=(0,u.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:f}),t[13]=f,t[14]=e);let n=typeof i==`number`?i:0,s;t[15]!==o||t[16]!==a||t[17]!==r||t[18]!==n?(s=(0,u.jsx)(b,{s:r,value:n,disabled:o,onChange:a}),t[15]=o,t[16]=a,t[17]=r,t[18]=n,t[19]=s):s=t[19];let c;return t[20]!==e||t[21]!==s?(c=(0,u.jsxs)(`div`,{className:`space-y-1.5`,children:[e,s]}),t[20]=e,t[21]=s,t[22]=c):c=t[22],c}if(c===`string`){let e;t[23]===f?e=t[24]:(e=(0,u.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:f}),t[23]=f,t[24]=e);let s=typeof i==`string`?i:``,c;t[25]!==o||t[26]!==n||t[27]!==a||t[28]!==r||t[29]!==s?(c=(0,u.jsx)(_,{name:n,s:r,value:s,disabled:o,onChange:a}),t[25]=o,t[26]=n,t[27]=a,t[28]=r,t[29]=s,t[30]=c):c=t[30];let l;return t[31]!==e||t[32]!==c?(l=(0,u.jsxs)(`div`,{className:`space-y-1.5`,children:[e,c]}),t[31]=e,t[32]=c,t[33]=l):l=t[33],l}if(c===`array`){let e=r.items,n=d(e)?e.type:void 0;if(n===`string`||Array.isArray(n)&&n.includes(`string`)){let e;t[34]===f?e=t[35]:(e=(0,u.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:f}),t[34]=f,t[35]=e);let n;t[36]===i?n=t[37]:(n=Array.isArray(i)&&i.every(w)?i.map(String):[],t[36]=i,t[37]=n);let c;t[38]!==o||t[39]!==s||t[40]!==a||t[41]!==r||t[42]!==n?(c=(0,u.jsx)(S,{s:r,value:n,disabled:o,onChange:a,labels:s}),t[38]=o,t[39]=s,t[40]=a,t[41]=r,t[42]=n,t[43]=c):c=t[43];let l;return t[44]!==e||t[45]!==c?(l=(0,u.jsxs)(`div`,{className:`space-y-1.5`,children:[e,c]}),t[44]=e,t[45]=c,t[46]=l):l=t[46],l}}if(c===`object`){let e;t[47]===i?e=t[48]:(e=d(i)?i:{},t[47]=i,t[48]=e);let n=e,c;t[49]===f?c=t[50]:(c=(0,u.jsx)(`summary`,{className:`cursor-pointer select-none px-3 py-2 text-sm font-medium text-fg group-open:rounded-b-none`,children:f}),t[49]=f,t[50]=c);let l;t[51]!==o||t[52]!==s||t[53]!==n||t[54]!==a||t[55]!==r?(l=(0,u.jsx)(`div`,{className:`border-t border-edge p-3`,children:(0,u.jsx)(T,{schema:r,values:n,onChange:a,disabled:o,labels:s})}),t[51]=o,t[52]=s,t[53]=n,t[54]=a,t[55]=r,t[56]=l):l=t[56];let p;return t[57]!==c||t[58]!==l?(p=(0,u.jsxs)(`details`,{className:`group rounded-lg border border-edge bg-surface-panel/40 open:bg-surface-base`,open:!0,children:[c,l]}),t[57]=c,t[58]=l,t[59]=p):p=t[59],p}let p;t[60]!==s||t[61]!==c||t[62]!==f?(p=s?.unsupportedFieldType?.(f,typeof c==`string`?c:void 0)??`${f}: unsupported field type${typeof c==`string`?` (${c})`:``}`,t[60]=s,t[61]=c,t[62]=f,t[63]=p):p=t[63];let m;return t[64]===p?m=t[65]:(m=(0,u.jsx)(`p`,{className:`text-xs text-fg-muted`,children:p}),t[64]=p,t[65]=m),m}function w(e){return typeof e==`string`||typeof e==`number`}function T(e){let t=(0,l.c)(28),{schema:n,values:i,onChange:a,disabled:o,className:s,labels:c}=e,f=o===void 0?!1:o,p;bb0:{if(n.type!==`object`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[0]=e):e=t[0],p=e;break bb0}let e;t[1]===n?e=t[2]:(e=h(n),t[1]=n,t[2]=e),p=e}let m=p,_;bb1:{if(m.length===0){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=new Map,t[3]=e):e=t[3],_=e;break bb1}let e;t[4]===m?e=t[5]:(e=g(m),t[4]=m,t[5]=e),_=e}let v=_,y;t[6]!==a||t[7]!==i?(y=(e,t)=>{a({...i,[e]:t})},t[6]=a,t[7]=i,t[8]=y):y=t[8];let b=y;if(n.type!==`object`||!d(n.properties)||m.length===0)return null;let x,S;if(t[9]!==s||t[10]!==f||t[11]!==v||t[12]!==c||t[13]!==b||t[14]!==i){let e=Array.from(v.keys()).sort(E);t[17]===s?x=t[18]:(x=r(`flex flex-col gap-4`,s),t[17]=s,t[18]=x);let n;t[19]!==f||t[20]!==v||t[21]!==c||t[22]!==b||t[23]!==i?(n=e=>{let t=(v.get(e)??[]).map(e=>(0,u.jsx)(C,{k:e.key,sub:e.sub,value:i[e.key],onValue:t=>b(e.key,t),disabled:f,labels:c},e.key));return e===``?(0,u.jsx)(`div`,{children:t},`default`):(0,u.jsxs)(`details`,{className:`group rounded-lg border border-edge bg-surface-panel/40 open:bg-surface-base`,open:!0,children:[(0,u.jsx)(`summary`,{className:`cursor-pointer select-none px-3 py-2 text-sm font-medium text-fg group-open:rounded-b-none`,children:e}),(0,u.jsx)(`div`,{className:`space-y-4 border-t border-edge p-3`,children:t})]},e)},t[19]=f,t[20]=v,t[21]=c,t[22]=b,t[23]=i,t[24]=n):n=t[24],S=e.map(n),t[9]=s,t[10]=f,t[11]=v,t[12]=c,t[13]=b,t[14]=i,t[15]=x,t[16]=S}else x=t[15],S=t[16];let w;return t[25]!==x||t[26]!==S?(w=(0,u.jsx)(`div`,{className:x,children:S}),t[25]=x,t[26]=S,t[27]=w):w=t[27],w}function E(e,t){return e===``?-1:t===``?1:e.localeCompare(t)}export{T as t};
|