@xopcai/xopc 0.0.341 → 0.0.342
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/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BLPcg31f.js → agent-avatar-dicebear-BHTH7Hzp.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-C70FWAHE.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-BmYHMIPz.js +1 -0
- package/dist/gateway/static/root/assets/agents-BqIiqYmt.js +70 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-9hEICfl6.js → agents-admin-api-Op3XAo56.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-D1t5R8Nw.js → app-management-settings-panel-DrvjGsNn.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-AEXbf39m.js → appearance-settings-CdYUxeW5.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-DmDgodab.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-Dn0-Buj5.js → archive-plugin-Dvl6N_oW.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BSra2qfj.js → automations-page-7eSAb9Fz.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BXLmMZKj.js +7 -0
- package/dist/gateway/static/root/assets/{binary-plugins-Dot1Il-Y.js → binary-plugins-B6fBdtZm.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CDcC8LCq.js → block-editor-DnMibNrZ.js} +29 -29
- package/dist/gateway/static/root/assets/{browser-automation-inputs-cnvnVaXG.js → browser-automation-inputs-CX5HElxM.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-CAUS0Ri8.js → browser-automations-page-fTkFKnIa.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-CGF08LW0.js +3 -0
- package/dist/gateway/static/root/assets/{capabilities-CE5NAPxj.js → capabilities-DSg8th5w.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-CADE2fFw.js → capabilities-page-CBQUqwHq.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BIXA7-_a.js +8 -0
- package/dist/gateway/static/root/assets/{capability-header-actions-BJNo9stz.js → capability-header-actions-UQmVc6ea.js} +1 -1
- package/dist/gateway/static/root/assets/channels-Cwqvvnpy.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-kdmj_0as.js → chat-terminal-dock-81LOYomp.js} +2 -2
- package/dist/gateway/static/root/assets/{computer-settings-page-0eV1PD7w.js → computer-settings-page-DffgMAWa.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-CfoHye-I.js → connector-service-page-DjKxEmO4.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-w-DTg9X-.js +2 -0
- package/dist/gateway/static/root/assets/{date-picker-Cos4-ejW.js → date-picker--gtRUEYY.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-BPwj_jHy.js → dependency-picker-OM5MJcAI.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DEuqqeV7.js → desktop-pet-Ck5QncbS.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CjBMcLuI.js → desktop-pet-settings-Be9YZ7dP.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-CG2bKfYq.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-CcGJupzB.js → directory-picker-path-field-CS-rIYvx.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-BK0gkhEA.js → extension-debug-page-yeovsc29.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BjfzKvd3.js → extension-page-BGXlLDIK.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-xqe5mUAc.js → extension-settings-page-1T5JWoRQ.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-BdBCP9uF.js → gateway-config-swr-D_oNkPwY.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-MiR9DJIf.js → gateway-realtime-B6tO02l7.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-DA3d45t6.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-DXaGFC4E.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-B8XTENLw.js → gateway-startup-retry-DVo2M1Ed.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-Be8_HeNB.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-DufKsb8h.js → image-generation-api-DjyB_9yW.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-BMiS5gUB.js → imports-page-DHoZ6dWz.js} +1 -1
- package/dist/gateway/static/root/assets/index-Bbo9EJvY.js +106 -0
- package/dist/gateway/static/root/assets/index-CRfBe1x4.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BTOmULWn.js → keyboard-shortcuts-settings-DOloJmHM.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-EwMSmvUp.js → local-app-workbench-page-DzvhfcOp.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-gicbE8bt.js → local-apps-page-BcZxG7Sm.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-Bwxng2U0.js → local-session-drafts-yZc4OIxG.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-GbEE8D1I.js → locale-store-CCYf4Qxv.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-jPeHW3s9.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-CcEPCLdK.js → management-settings-Dal0gIED.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-DtEVIWB3.js → markdown-view-gPnGW4pR.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-1hJztT1f.js → media-plugins-BqXBeW_0.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-DvcSrOiI.js → messages-6j-AkWdj.js} +2 -2
- package/dist/gateway/static/root/assets/note-detail-panel-Dnd6FEft.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-DWMxG17u.js +8 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-yJUYnJxT.js → page-context-capture-button-CblMYGvM.js} +1 -1
- package/dist/gateway/static/root/assets/{page-tabs-BM7TwlkM.js → page-tabs-BQLuzP2G.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-C8ewCNje.js → preview-open-alternatives-bAtTMiqI.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-CRx7HKvw.js → product-open-page-BiZx2t3O.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-BeCtOOvf.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DVFst1Zv.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-DTHBAr2T.js → registry-api-DGRLQQ_H.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-xlX73tyv.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DOB15s5m.js → runtime-tools-settings-panel-BL43kX94.js} +2 -2
- package/dist/gateway/static/root/assets/scenes-page-CHIai08O.js +2 -0
- package/dist/gateway/static/root/assets/{schema-form-DchPlBrp.js → schema-form-BpTqO-iv.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-Bb2zLVED.js → session-api-BXyyrPIk.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-9M-yBtb4.js → session-manager-OBkrb3ow.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-DEcTMG-C.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DXWLgEoV.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-UlkZDGLU.js → settings-form-section-DTsRLeno.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-PYnr6mlX.js → settings-page-DXuAkBPd.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-Di0Ed3Y_.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-B0jqVHIE.js → share-preview-page-kKdqUjj2.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-Deazms2V.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-DgwnV477.js → skill-api-BYnK8QTQ.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-B6GZUBNC.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-BAEDw1ez.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-eEK7Mm70.js → system-settings-panel-DbULjt1I.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-Dwa6P2yd.js +1 -0
- package/dist/gateway/static/root/assets/{tunnel-api-Cty9Iw8k.js → tunnel-api-CEoNfQtH.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-C3ZO6KNv.js → usage-page-BFFftzL6.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-EEUVQbRp.js → use-autosave-qKVzK824.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-Cb9EhncT.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-DTmACeYO.js → voice-api-key-field-DUg1IyGa.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-DIBe0AZN.js → voice-config-api-Dh_RxWat.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-C9guuKGB.js → work-discovery-overlay-C8RS5pAe.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BjGFnWIF.js → workflow-run-setup-panel-FkVKYHxF.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-CXTfjyCR.js +6 -0
- package/dist/gateway/static/root/index.html +15 -15
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/mobile-user-understanding.js +9 -0
- package/dist/src/agent/agent-manager.js +5 -5
- package/dist/src/agent/background-review/run-background-review.js +2 -2
- package/dist/src/agent/bootstrap/filter-bootstrap-files.js +1 -1
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +1 -1
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/image/tool-model-config.js +2 -2
- package/dist/src/agent/service.js +4 -4
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.d.ts +25 -2
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +9 -3
- package/dist/src/agent/tasks/task-judge-service.js +3 -3
- package/dist/src/agent/tools/xopc-use-tool.js +1 -1
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +1 -1
- package/dist/src/auth/oauth-provider-lock.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +1 -1
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/bootstrap/application-state.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/chat-commands/builtins/config.js +1 -1
- package/dist/src/cli/commands/agent.js +1 -1
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +2 -2
- package/dist/src/cli/commands/extension-agent-plugin.js +3 -2
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +2 -2
- package/dist/src/cli/extension-cli-register.js +2 -0
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/computer/runtime.js +1 -1
- package/dist/src/config/index.js +5 -5
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.d.ts +1 -0
- package/dist/src/config/schema.js +2 -1
- package/dist/src/extensions/agent-plugins/inventory.d.ts +37 -13
- package/dist/src/extensions/agent-plugins/inventory.js +1 -0
- package/dist/src/extensions/agent-plugins/sources.d.ts +13 -1
- package/dist/src/extensions/agent-plugins/sources.js +17 -2
- package/dist/src/extensions/agent-plugins/store.d.ts +46 -0
- package/dist/src/extensions/agent-plugins/store.js +19 -1
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/extensions/marketplace.d.ts +2 -1
- package/dist/src/extensions/marketplace.js +6 -5
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -0
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/agent-plugins.js +6 -4
- package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -2
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/hono/routes/user-model.js +62 -4
- package/dist/src/gateway/image-generation-setup.js +2 -2
- package/dist/src/gateway/lock.js +1 -1
- package/dist/src/gateway/service/marketplace-service.d.ts +1 -1
- package/dist/src/gateway/service/marketplace-service.js +3 -2
- package/dist/src/gateway/service.js +4 -4
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/home-intelligence/generator.js +1 -1
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/notes/service.js +1 -1
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tui/backends/embedded-backend.js +3 -3
- package/dist/src/tui/tui-commands.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +2 -2
- package/dist/src/user-context/config.d.ts +2 -0
- package/dist/src/user-context/config.js +2 -0
- package/dist/src/user-model/index.js +2 -2
- package/dist/src/user-model/repository.d.ts +2 -0
- package/dist/src/user-model/repository.js +18 -1
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/dist/src/work-discovery/service.js +2 -2
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +4 -4
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-C6lTld5j.js +0 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-C4tkmkNX.js +0 -1
- package/dist/gateway/static/root/assets/agents-CfnoU72e.js +0 -70
- package/dist/gateway/static/root/assets/apps-page-BBlltMmy.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-wN4UZK_t.js +0 -7
- package/dist/gateway/static/root/assets/browser-settings-page-DXgm5Ckn.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BVA9R5lZ.js +0 -8
- package/dist/gateway/static/root/assets/channels-Do21a722.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-Db1Y7qF-.js +0 -2
- package/dist/gateway/static/root/assets/device-pairing-wizard-BsqwXeyv.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-Cj-byMay.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-C07o7J3o.js +0 -1
- package/dist/gateway/static/root/assets/home-page-a92Q8Na2.js +0 -1
- package/dist/gateway/static/root/assets/index-Bd7mDZFV.css +0 -1
- package/dist/gateway/static/root/assets/index-CJRGgrw3.js +0 -106
- package/dist/gateway/static/root/assets/logs-page-BBxTvrXn.js +0 -2
- package/dist/gateway/static/root/assets/note-detail-panel-LcJBf6gK.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-BaTCRZLb.js +0 -8
- package/dist/gateway/static/root/assets/project-detail-page-CSh8kKw8.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-DYwOgWaC.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-B8ApF5IX.js +0 -1
- package/dist/gateway/static/root/assets/scenes-page-DqhxjqAy.js +0 -2
- package/dist/gateway/static/root/assets/sessions-page-BcnoQbIP.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Cedcl54F.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-xp2jQuPa.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BnRfPQfC.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-zai_s2F8.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-BYAE6Al2.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-BK82L-MC.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-CT_RNLbB.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-B1uzFMKj.js +0 -6
|
@@ -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{g as i}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as a}from"./popover-select-0p9PIHRy.js";import{t as o}from"./plus-Q2yW6OE7.js";import{t as s}from"./search-DA7gz22f.js";import{t as c}from"./x-B_N4OPjy.js";import{t as l}from"./messages-DvcSrOiI.js";import{t as u}from"./cn-JdwAhgNB.js";import{i as d,n as ee,r as f}from"./locale-store-GbEE8D1I.js";import{a as p,n as m,o as h,r as g,s as _,t as v}from"./dist-BGTk37IG.js";import{i as y}from"./vendor-swr-BIWyz7Rc.js";import{t as b}from"./button-CS04eWY9.js";import{i as x,o as S}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{Fa as C,Fl as w,Iu as T,Lu as E,Mc as te,ad as D,ba as O,kc as k,pl as ne,xa as A}from"./index-CJRGgrw3.js";import{t as j}from"./page-tabs-BM7TwlkM.js";import{n as M,r as N,t as P}from"./settings-page-layout-X1x-2Cp9.js";import{t as F}from"./device-pairing-wizard-BsqwXeyv.js";import{n as I}from"./settings-loading-skeleton-CAmWMaOT.js";var L=e(t(),1),R=n(),z=720*60*60*1e3;function B(e){let t=[e.access,e.principal].filter(e=>e!==null);return t.length>0&&t.every(e=>e.revokedAt!==void 0)}function V(e){return B(e)?`revoked`:e.endpoints.length>0?`online`:`offline`}function re(e){return new Set(e.endpoints.flatMap(e=>e.tools.map(({descriptor:e})=>e.name))).size}function ie(e,t=Date.now()){return V(e)===`offline`?(e.lastSeenAt??e.createdAt)<t-z:!1}function ae(e,t,n=Date.now()){let r=t.query.trim().toLocaleLowerCase();return e.filter(e=>{let i=V(e),a=t.status===`all`||(t.status===`active`?i!==`revoked`:t.status===`stale`?ie(e,n):i===t.status),o=!t.platform||e.platform===t.platform,s=!r||[e.displayName,e.id,e.kind,e.platform].some(e=>e.toLocaleLowerCase().includes(r));return a&&o&&s})}function oe(e){return e.length>8?e.slice(-8):e}var H=r();function se(e){let t=(0,R.c)(59),{device:n,busy:r,onClose:i,onRevoke:a}=e,o=ee(U),s;t[0]===o?s=t[1]:(s=l(o),t[0]=o,t[1]=s);let d=s.endpointToolsSettings,f=o===`zh`?`zh-CN`:`en`,y;t[2]===f?y=t[3]:(y=new Intl.DateTimeFormat(f,{dateStyle:`medium`,timeStyle:`short`}),t[2]=f,t[3]=y);let C=y,w;t[4]===n?w=t[5]:(w=n?V(n):`offline`,t[4]=n,t[5]=w);let T=w,E=n!==null,D;t[6]===i?D=t[7]:(D=e=>!e&&i(),t[6]=i,t[7]=D);let O;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,H.jsx)(p,{className:u(`xopc-dialog-overlay fixed inset-0 bg-scrim`,S)}),t[8]=O):O=t[8];let k;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(k=u(`xopc-drawer-right fixed right-0 top-0 flex size-full max-w-lg flex-col border-l border-edge bg-surface-overlay shadow-popover outline-none`,x),t[9]=k):k=t[9];let ne=n?.displayName??d.deviceDetails,A;t[10]===ne?A=t[11]:(A=(0,H.jsx)(_,{className:`truncate text-base font-semibold text-fg`,children:ne}),t[10]=ne,t[11]=A);let j;t[12]===n?j=t[13]:(j=n?(0,H.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[n.kind,` · `,n.platform,` · `,oe(n.id)]}):null,t[12]=n,t[13]=j);let M;t[14]!==A||t[15]!==j?(M=(0,H.jsxs)(`div`,{className:`min-w-0`,children:[A,j]}),t[14]=A,t[15]=j,t[16]=M):M=t[16];let N;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,H.jsx)(c,{className:`size-5`,"aria-hidden":!0}),t[17]=N):N=t[17];let P;t[18]===d.close?P=t[19]:(P=(0,H.jsx)(m,{asChild:!0,children:(0,H.jsx)(b,{variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":d.close,children:N})}),t[18]=d.close,t[19]=P);let F;t[20]!==M||t[21]!==P?(F=(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-b border-edge px-4 py-3`,children:[M,P]}),t[20]=M,t[21]=P,t[22]=F):F=t[22];let I;t[23]!==d.accessActive||t[24]!==d.accessRevoked||t[25]!==d.accessTitle||t[26]!==d.createdAt||t[27]!==d.endpointCount||t[28]!==d.endpointsTitle||t[29]!==d.identityId||t[30]!==d.identityTitle||t[31]!==d.lastSeen||t[32]!==d.never||t[33]!==d.noAccessIdentity||t[34]!==d.noOnlineEndpoints||t[35]!==d.noPermissions||t[36]!==d.permissions||t[37]!==d.status||t[38]!==d.statusLabel||t[39]!==d.toolCount||t[40]!==n||t[41]!==C||t[42]!==T?(I=n?(0,H.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto p-4`,children:[(0,H.jsxs)(`dl`,{className:`grid grid-cols-2 gap-3 rounded-xl bg-surface-hover/40 p-4`,children:[(0,H.jsx)(W,{label:d.statusLabel,value:d.status[T]}),(0,H.jsx)(W,{label:d.lastSeen,value:n.lastSeenAt?C.format(n.lastSeenAt):d.never}),(0,H.jsx)(W,{label:d.endpointCount,value:String(n.endpoints.length)}),(0,H.jsx)(W,{label:d.toolCount,value:String(re(n))})]}),(0,H.jsxs)(`section`,{children:[(0,H.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:d.accessTitle}),(0,H.jsx)(`div`,{className:`mt-2 rounded-xl border border-edge-subtle bg-surface-base p-3 text-xs text-fg-muted`,children:n.access?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`p`,{children:n.access.revokedAt?d.accessRevoked:d.accessActive}),(0,H.jsxs)(`p`,{className:`mt-1 break-words`,children:[d.permissions,`: `,n.access.scopes.join(`, `)||d.noPermissions]})]}):(0,H.jsx)(`p`,{children:d.noAccessIdentity})})]}),(0,H.jsxs)(`section`,{children:[(0,H.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:d.endpointsTitle}),(0,H.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[n.endpoints.length===0?(0,H.jsx)(`p`,{className:`text-sm text-fg-muted`,children:d.noOnlineEndpoints}):null,n.endpoints.map(e=>(0,H.jsxs)(`article`,{className:`rounded-xl border border-edge-subtle bg-surface-base p-3`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,H.jsx)(`p`,{className:`min-w-0 break-all text-xs font-medium text-fg`,children:e.endpointId}),(0,H.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[d.status[e.availability],` · v`,e.appVersion]})]}),(0,H.jsx)(`div`,{className:`mt-3 space-y-2`,children:e.tools.map(e=>{let{descriptor:t}=e;return(0,H.jsxs)(`div`,{className:`rounded-lg bg-surface-hover/50 px-3 py-2`,children:[(0,H.jsx)(`p`,{className:`break-all text-xs font-medium text-fg`,children:t.name}),(0,H.jsx)(`p`,{className:`mt-0.5 break-words text-xs text-fg-subtle`,children:t.requiredPermissions.join(`, `)||d.noPermissions})]},t.name)})})]},e.connectionId))]})]}),(0,H.jsxs)(`section`,{children:[(0,H.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:d.identityTitle}),(0,H.jsxs)(`dl`,{className:`mt-2 rounded-xl border border-edge-subtle bg-surface-base p-3 text-xs`,children:[(0,H.jsx)(W,{label:d.identityId,value:n.id,breakAll:!0}),(0,H.jsx)(`div`,{className:`mt-3`,children:(0,H.jsx)(W,{label:d.createdAt,value:C.format(n.createdAt)})})]})]})]}):null,t[23]=d.accessActive,t[24]=d.accessRevoked,t[25]=d.accessTitle,t[26]=d.createdAt,t[27]=d.endpointCount,t[28]=d.endpointsTitle,t[29]=d.identityId,t[30]=d.identityTitle,t[31]=d.lastSeen,t[32]=d.never,t[33]=d.noAccessIdentity,t[34]=d.noOnlineEndpoints,t[35]=d.noPermissions,t[36]=d.permissions,t[37]=d.status,t[38]=d.statusLabel,t[39]=d.toolCount,t[40]=n,t[41]=C,t[42]=T,t[43]=I):I=t[43];let L;t[44]!==r||t[45]!==d.removeDevice||t[46]!==d.revoking||t[47]!==n||t[48]!==a||t[49]!==T?(L=n&&T!==`revoked`?(0,H.jsx)(`div`,{className:`shrink-0 border-t border-edge px-4 py-3`,children:(0,H.jsxs)(b,{variant:`secondary`,className:`w-full text-danger`,disabled:r,onClick:()=>a(n),children:[(0,H.jsx)(te,{className:`size-4`,"aria-hidden":!0}),r?d.revoking:d.removeDevice]})}):null,t[44]=r,t[45]=d.removeDevice,t[46]=d.revoking,t[47]=n,t[48]=a,t[49]=T,t[50]=L):L=t[50];let z;t[51]!==F||t[52]!==I||t[53]!==L?(z=(0,H.jsxs)(h,{children:[O,(0,H.jsxs)(g,{className:k,"aria-describedby":void 0,children:[F,I,L]})]}),t[51]=F,t[52]=I,t[53]=L,t[54]=z):z=t[54];let B;return t[55]!==z||t[56]!==E||t[57]!==D?(B=(0,H.jsx)(v,{open:E,onOpenChange:D,children:z}),t[55]=z,t[56]=E,t[57]=D,t[58]=B):B=t[58],B}function U(e){return e.language}function W(e){let t=(0,R.c)(10),{label:n,value:r,breakAll:i}=e,a=i===void 0?!1:i,o;t[0]===n?o=t[1]:(o=(0,H.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:n}),t[0]=n,t[1]=o);let s=a&&`break-all font-mono text-xs`,c;t[2]===s?c=t[3]:(c=u(`mt-1 text-sm text-fg`,s),t[2]=s,t[3]=c);let l;t[4]!==c||t[5]!==r?(l=(0,H.jsx)(`dd`,{className:c,children:r}),t[4]=c,t[5]=r,t[6]=l):l=t[6];let d;return t[7]!==o||t[8]!==l?(d=(0,H.jsxs)(`div`,{className:`min-w-0`,children:[o,l]}),t[7]=o,t[8]=l,t[9]=d):d=t[9],d}function ce(e){let t=(0,R.c)(19),{onPaired:n}=e,[r,a]=i(),s=ee(le),c;t[0]===s?c=t[1]:(c=l(s),t[0]=s,t[1]=c);let u=c.endpointToolsSettings.deviceAccess,d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d={open:!1},t[2]=d):d=t[2];let[f,p]=(0,L.useState)(d),m,h;t[3]!==r||t[4]!==a?(m=()=>{let e=r.get(`startDevicePairing`);e!==`mobile`&&e!==`browser`||(p({open:!0,target:e}),a(G,{replace:!0}))},h=[r,a],t[3]=r,t[4]=a,t[5]=m,t[6]=h):(m=t[5],h=t[6]),(0,L.useEffect)(m,h);let g,_;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>p({open:!0}),_=(0,H.jsx)(o,{className:`size-4`,"aria-hidden":!0}),t[7]=g,t[8]=_):(g=t[7],_=t[8]);let v;t[9]===u.addDevice?v=t[10]:(v=(0,H.jsxs)(b,{variant:`primary`,onClick:g,children:[_,u.addDevice]}),t[9]=u.addDevice,t[10]=v);let y;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>p(t=>({...t,open:e})),t[11]=y):y=t[11];let x;t[12]!==f.open||t[13]!==f.target||t[14]!==n?(x=(0,H.jsx)(F,{open:f.open,onOpenChange:y,onPaired:n,targetKind:f.target}),t[12]=f.open,t[13]=f.target,t[14]=n,t[15]=x):x=t[15];let S;return t[16]!==v||t[17]!==x?(S=(0,H.jsxs)(H.Fragment,{children:[v,x]}),t[16]=v,t[17]=x,t[18]=S):S=t[18],S}function G(e){let t=new URLSearchParams(e);return t.delete(`startDevicePairing`),t}function le(e){return e.language}async function ue(e){let t=await e.json().catch(()=>null);if(!e.ok||t?.payload===void 0)throw Error(t?.error?.message??`Endpoint management request failed: ${e.status}`);return t.payload}function de(){return f(`/api/endpoint-tools/devices`)}function fe(e){let t=new URLSearchParams({page:String(e.page),pageSize:String(e.pageSize)});return e.query.trim()&&t.set(`query`,e.query.trim()),e.principalId&&t.set(`principalId`,e.principalId),e.status&&t.set(`status`,e.status),e.effect&&t.set(`effect`,e.effect),f(`/api/endpoint-tools/invocations?${t}`)}async function pe(){return ue(await d(de()))}async function me(e){let t=Array.from({length:Math.ceil(e.length/100)},(t,n)=>e.slice(n*100,(n+1)*100));await Promise.all(t.map(async e=>{await ue(await d(f(`/api/endpoint-tools/devices/revoke`),{method:`POST`,body:JSON.stringify({ids:e})}))}))}async function he(e){return ue(await d(fe(e)))}var ge=5e3,K=20,_e=20;function ve(e){return e===`online`||e===`succeeded`?`bg-success-soft text-success`:e===`running`?`bg-accent-soft text-accent-fg`:e===`failed`||e===`revoked`?`bg-danger-soft text-danger`:`bg-surface-hover text-fg-muted`}function ye(e){let t=(0,R.c)(5),{status:n,label:r}=e,i;t[0]===n?i=t[1]:(i=u(`rounded-full px-2 py-0.5 text-xs font-medium`,ve(n)),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,H.jsx)(`span`,{className:i,children:r}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function be(){let e=ee(e=>e.language),t=l(e).endpointToolsSettings,[n,r]=i(),o=n.get(`view`)===`activity`?`activity`:`devices`,[c,d]=(0,L.useState)(null),[f,p]=(0,L.useState)([]),[m,h]=(0,L.useState)(!1),[g,_]=(0,L.useState)(!1),[v,x]=(0,L.useState)(``),[S,F]=(0,L.useState)(`active`),[R,z]=(0,L.useState)(``),[B,U]=(0,L.useState)(1),[W,G]=(0,L.useState)(()=>new Set),[le,ue]=(0,L.useState)(``),[ve]=C(le,250),[be,xe]=(0,L.useState)(``),[Se,Ce]=(0,L.useState)(``),[we,Te]=(0,L.useState)(``),[Ee,q]=(0,L.useState)(1),De={page:Ee,pageSize:_e,query:ve,principalId:be,status:Se,effect:we},J=y(de(),pe,{refreshInterval:ge}),Y=y(o===`activity`?fe(De):null,()=>he(De),{refreshInterval:ge,keepPreviousData:!0}),Oe=(0,L.useMemo)(()=>new Intl.DateTimeFormat(e===`zh`?`zh-CN`:`en`,{dateStyle:`medium`,timeStyle:`short`}),[e]);if(J.isLoading&&!J.data)return(0,H.jsx)(N,{children:(0,H.jsx)(I,{sections:2})});let X=J.data??[],ke=Y.data?.items??[],Ae=X.filter(e=>V(e)===`online`).length,je=X.filter(e=>V(e)!==`revoked`).length,Me=X.filter(e=>ie(e)).length,Ne=[...new Set(X.map(e=>e.platform))].toSorted(),Z=ae(X,{query:v,status:S,platform:R}),Pe=Math.max(1,Math.ceil(Z.length/K)),Q=Math.min(B,Pe),Fe=Z.slice((Q-1)*K,Q*K),$=Fe.reduce((e,t)=>(V(t)!==`revoked`&&e.push(t.id),e),[]),Ie=$.length>0&&$.every(e=>W.has(e)),Le=e=>{r(t=>{let n=new URLSearchParams(t);return e===`devices`?n.delete(`view`):n.set(`view`,e),n},{replace:!0})},Re=async()=>{await Promise.all([J.mutate(),o===`activity`?Y.mutate():Promise.resolve()])},ze=async()=>{if(!(f.length===0||m)){h(!0),_(!1);try{await me(f.map(e=>e.id)),p([]),G(new Set),await J.mutate()}catch{_(!0)}finally{h(!1)}}},Be=e=>{e(),U(1),G(new Set)};return(0,H.jsxs)(N,{children:[(0,H.jsx)(M,{title:t.title,subtitle:t.subtitle,actions:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(O,{className:`size-9 shrink-0 p-0`,label:t.refresh,onClick:Re}),(0,H.jsx)(ce,{onPaired:()=>void J.mutate()})]})}),J.error||Y.error?(0,H.jsx)(`div`,{className:`rounded-xl bg-danger-soft px-4 py-3 text-sm text-danger`,children:t.loadError}):null,(0,H.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[{label:t.activeDevices,value:je,filter:`active`},{label:t.onlineDevices,value:Ae,filter:`online`},{label:t.staleDevices,value:Me,filter:`stale`}].map(({label:e,value:t,filter:n})=>(0,H.jsxs)(`button`,{type:`button`,className:u(`touch-target rounded-xl px-4 py-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,S===n?`bg-surface-active`:`bg-surface-hover/20 hover:bg-surface-hover/50`),"aria-pressed":S===n,onClick:()=>{Be(()=>F(n)),Le(`devices`)},children:[(0,H.jsx)(`span`,{className:`text-xs text-fg-muted`,children:e}),(0,H.jsx)(`span`,{className:`mt-1 block text-2xl font-semibold text-fg`,children:t})]},n))}),(0,H.jsx)(j,{items:[{id:`devices`,label:t.devicesTab,icon:ne,count:je},{id:`activity`,label:t.activityTab,icon:D,count:Y.data?.total}],activeTab:o,onChange:Le,ariaLabel:t.viewsAria,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`}),(0,H.jsxs)(P,{id:`devices`,activeTab:o,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`,title:t.devicesTitle,hint:t.devicesHint,children:[(0,H.jsxs)(`div`,{className:`mb-4 grid gap-2 sm:grid-cols-[minmax(0,1fr)_11rem_11rem]`,children:[(0,H.jsxs)(`label`,{className:`relative block`,children:[(0,H.jsx)(`span`,{className:`sr-only`,children:t.searchDevices}),(0,H.jsx)(s,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),(0,H.jsx)(`input`,{type:`search`,"aria-label":t.searchDevices,value:v,placeholder:t.searchDevices,className:`h-10 w-full rounded-lg border border-edge bg-surface-inset pl-9 pr-3 text-base text-fg placeholder:text-fg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent sm:text-sm`,onChange:e=>Be(()=>x(e.target.value))})]}),(0,H.jsx)(a,{value:S,options:[{value:`active`,label:t.filterActive},{value:`online`,label:t.status.online},{value:`offline`,label:t.status.offline},{value:`stale`,label:t.filterStale},{value:`revoked`,label:t.status.revoked},{value:`all`,label:t.filterAll}],placeholder:t.statusLabel,allowEmpty:!1,ariaLabel:t.statusLabel,onChange:e=>Be(()=>F(e))}),(0,H.jsx)(a,{value:R,options:Ne.map(e=>({value:e,label:e})),placeholder:t.allPlatforms,emptyLabel:t.allPlatforms,ariaLabel:t.platformLabel,onChange:e=>Be(()=>z(e))})]}),W.size>0?(0,H.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3 rounded-xl bg-accent-soft px-3 py-2`,children:[(0,H.jsx)(`p`,{className:`text-sm font-medium text-accent-fg`,children:t.selectedCount.replace(`{{count}}`,String(W.size))}),(0,H.jsxs)(b,{variant:`secondary`,className:`text-danger`,onClick:()=>{_(!1),p(X.filter(e=>W.has(e.id)))},children:[(0,H.jsx)(te,{className:`size-4`,"aria-hidden":!0}),t.removeSelected]})]}):null,X.length===0?(0,H.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noDevices}):Z.length===0?(0,H.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noMatchingDevices}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`flex min-h-10 items-center gap-3 border-b border-edge-subtle px-1`,children:(0,H.jsxs)(`label`,{className:u(`touch-target flex items-center gap-2 text-xs text-fg-muted`,$.length>0?`cursor-pointer`:`cursor-not-allowed opacity-50`),children:[(0,H.jsx)(`input`,{type:`checkbox`,"aria-label":t.selectPage,checked:Ie,disabled:$.length===0,className:`size-4 accent-accent`,onChange:e=>{G(t=>{let n=new Set(t);for(let t of $)e.target.checked?n.add(t):n.delete(t);return n})}}),t.selectPage]})}),(0,H.jsx)(`ul`,{className:`divide-y divide-edge-subtle`,children:Fe.map(e=>{let n=V(e),r=e.kind===`mobile`?k:w;return(0,H.jsxs)(`li`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(`label`,{className:u(`touch-target flex size-10 shrink-0 items-center justify-center`,n===`revoked`?`cursor-not-allowed opacity-40`:`cursor-pointer`),children:(0,H.jsx)(`input`,{type:`checkbox`,checked:W.has(e.id),disabled:n===`revoked`,"aria-label":t.selectDevice.replace(`{{name}}`,e.displayName),className:`size-4 accent-accent`,onChange:t=>{G(n=>{let r=new Set(n);return t.target.checked?r.add(e.id):r.delete(e.id),r})}})}),(0,H.jsxs)(`button`,{type:`button`,className:`touch-target flex min-w-0 flex-1 items-center gap-3 py-3 text-left hover:bg-surface-hover/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>d(e),children:[(0,H.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-surface-inset text-fg-muted`,children:(0,H.jsx)(r,{className:`size-4`,"aria-hidden":!0})}),(0,H.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:e.displayName}),(0,H.jsx)(ye,{status:n,label:t.status[n]})]}),(0,H.jsxs)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:[e.platform,` · `,oe(e.id),` · `,t.lastSeen,`: `,e.lastSeenAt?Oe.format(e.lastSeenAt):t.never]})]}),(0,H.jsx)(`span`,{className:`hidden shrink-0 text-right text-xs text-fg-muted sm:block`,children:t.endpointSummary.replace(`{{endpoints}}`,String(e.endpoints.length)).replace(`{{tools}}`,String(re(e)))}),(0,H.jsx)(T,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0})]})]},e.id)})}),(0,H.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3 border-t border-edge-subtle pt-3`,children:[(0,H.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.paginationSummary.replace(`{{from}}`,String((Q-1)*K+1)).replace(`{{to}}`,String(Math.min(Q*K,Z.length))).replace(`{{total}}`,String(Z.length))}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(b,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.previousPage,disabled:Q<=1,onClick:()=>U(e=>Math.max(1,e-1)),children:(0,H.jsx)(E,{className:`size-4`,"aria-hidden":!0})}),(0,H.jsx)(b,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.nextPage,disabled:Q>=Pe,onClick:()=>U(e=>Math.min(Pe,e+1)),children:(0,H.jsx)(T,{className:`size-4`,"aria-hidden":!0})})]})]})]})]}),(0,H.jsxs)(P,{id:`activity`,activeTab:o,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`,title:t.callsTitle,hint:t.callsHint,children:[(0,H.jsxs)(`div`,{className:`mb-4 grid gap-2 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,H.jsxs)(`label`,{className:`relative block sm:col-span-2 lg:col-span-1`,children:[(0,H.jsx)(`span`,{className:`sr-only`,children:t.searchActivity}),(0,H.jsx)(s,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),(0,H.jsx)(`input`,{type:`search`,"aria-label":t.searchActivity,value:le,placeholder:t.searchActivity,className:`h-10 w-full rounded-lg border border-edge bg-surface-inset pl-9 pr-3 text-base text-fg placeholder:text-fg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent sm:text-sm`,onChange:e=>{ue(e.target.value),q(1)}})]}),(0,H.jsx)(a,{value:be,options:X.map(e=>({value:e.id,label:`${e.displayName} · ${oe(e.id)}`})),placeholder:t.allDevices,emptyLabel:t.allDevices,ariaLabel:t.deviceLabel,onChange:e=>{xe(e),q(1)}}),(0,H.jsx)(a,{value:Se,options:[{value:`running`,label:t.status.running},{value:`succeeded`,label:t.status.succeeded},{value:`failed`,label:t.status.failed}],placeholder:t.allStatuses,emptyLabel:t.allStatuses,ariaLabel:t.statusLabel,onChange:e=>{Ce(e),q(1)}}),(0,H.jsx)(a,{value:we,options:[{value:`read`,label:t.effects.read},{value:`write`,label:t.effects.write},{value:`destructive`,label:t.effects.destructive}],placeholder:t.allEffects,emptyLabel:t.allEffects,ariaLabel:t.effectLabel,onChange:e=>{Te(e),q(1)}})]}),Y.isLoading&&!Y.data?(0,H.jsx)(I,{sections:1}):null,ke.length===0&&!Y.isLoading?(0,H.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noMatchingCalls}):null,(0,H.jsx)(`div`,{className:`space-y-2`,children:ke.map(e=>(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-lg bg-surface-base/55 px-3 py-2.5`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`p`,{className:`break-all text-sm font-medium text-fg`,children:e.toolName}),(0,H.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[Oe.format(e.startedAt),` · `,t.effects[e.effect],` · `,e.endpointId]}),e.errorMessage?(0,H.jsx)(`p`,{className:`mt-1 text-xs text-danger`,children:e.errorMessage}):null]}),(0,H.jsx)(ye,{status:e.status,label:t.status[e.status]})]},e.id))}),Y.data&&Y.data.total>0?(0,H.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3 border-t border-edge-subtle pt-3`,children:[(0,H.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.paginationSummary.replace(`{{from}}`,String((Y.data.page-1)*Y.data.pageSize+1)).replace(`{{to}}`,String(Math.min(Y.data.page*Y.data.pageSize,Y.data.total))).replace(`{{total}}`,String(Y.data.total))}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(b,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.previousPage,disabled:Y.data.page<=1,onClick:()=>q(e=>Math.max(1,e-1)),children:(0,H.jsx)(E,{className:`size-4`,"aria-hidden":!0})}),(0,H.jsx)(b,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.nextPage,disabled:Y.data.page>=Y.data.totalPages,onClick:()=>q(e=>Math.min(Y.data.totalPages,e+1)),children:(0,H.jsx)(T,{className:`size-4`,"aria-hidden":!0})})]})]}):null]}),(0,H.jsx)(se,{device:c,busy:m,onClose:()=>d(null),onRevoke:e=>{d(null),_(!1),p([e])}}),(0,H.jsx)(A,{open:f.length>0,title:f.length>1?t.removeManyTitle:t.removeTitle,description:`${f.length>1?t.removeManyDescription.replace(`{{count}}`,String(f.length)):t.removeDescription.replace(`{{name}}`,f[0]?.displayName??``)}${g?`\n\n${t.revokeError}`:``}`,confirmLabel:m?t.revoking:t.removeDevice,cancelLabel:t.cancel,destructive:!0,onConfirm:()=>void ze(),onCancel:()=>{m||p([])}})]})}export{be as EndpointToolsManagementSettings};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{g as i}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as a}from"./popover-select-0p9PIHRy.js";import{t as o}from"./plus-Q2yW6OE7.js";import{t as s}from"./search-DA7gz22f.js";import{t as c}from"./x-B_N4OPjy.js";import{t as l}from"./messages-6j-AkWdj.js";import{t as u}from"./cn-JdwAhgNB.js";import{i as d,n as ee,r as f}from"./locale-store-CCYf4Qxv.js";import{a as p,n as m,o as h,r as g,s as _,t as v}from"./dist-BGTk37IG.js";import{i as y}from"./vendor-swr-BIWyz7Rc.js";import{t as b}from"./button-CS04eWY9.js";import{i as x,o as S}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{Bu as C,Ic as te,Nc as w,Ta as T,Vu as E,_l as D,ld as O,wa as k,za as ne,zl as A}from"./index-Bbo9EJvY.js";import{t as j}from"./page-tabs-BQLuzP2G.js";import{n as M,r as N,t as P}from"./settings-page-layout-X1x-2Cp9.js";import{t as F}from"./device-pairing-wizard-CG2bKfYq.js";import{n as I}from"./settings-loading-skeleton-CAmWMaOT.js";var L=e(t(),1),R=n(),z=720*60*60*1e3;function B(e){let t=[e.access,e.principal].filter(e=>e!==null);return t.length>0&&t.every(e=>e.revokedAt!==void 0)}function V(e){return B(e)?`revoked`:e.endpoints.length>0?`online`:`offline`}function re(e){return new Set(e.endpoints.flatMap(e=>e.tools.map(({descriptor:e})=>e.name))).size}function ie(e,t=Date.now()){return V(e)===`offline`?(e.lastSeenAt??e.createdAt)<t-z:!1}function ae(e,t,n=Date.now()){let r=t.query.trim().toLocaleLowerCase();return e.filter(e=>{let i=V(e),a=t.status===`all`||(t.status===`active`?i!==`revoked`:t.status===`stale`?ie(e,n):i===t.status),o=!t.platform||e.platform===t.platform,s=!r||[e.displayName,e.id,e.kind,e.platform].some(e=>e.toLocaleLowerCase().includes(r));return a&&o&&s})}function oe(e){return e.length>8?e.slice(-8):e}var H=r();function se(e){let t=(0,R.c)(59),{device:n,busy:r,onClose:i,onRevoke:a}=e,o=ee(U),s;t[0]===o?s=t[1]:(s=l(o),t[0]=o,t[1]=s);let d=s.endpointToolsSettings,f=o===`zh`?`zh-CN`:`en`,y;t[2]===f?y=t[3]:(y=new Intl.DateTimeFormat(f,{dateStyle:`medium`,timeStyle:`short`}),t[2]=f,t[3]=y);let C=y,w;t[4]===n?w=t[5]:(w=n?V(n):`offline`,t[4]=n,t[5]=w);let T=w,E=n!==null,D;t[6]===i?D=t[7]:(D=e=>!e&&i(),t[6]=i,t[7]=D);let O;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,H.jsx)(p,{className:u(`xopc-dialog-overlay fixed inset-0 bg-scrim`,S)}),t[8]=O):O=t[8];let k;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(k=u(`xopc-drawer-right fixed right-0 top-0 flex size-full max-w-lg flex-col border-l border-edge bg-surface-overlay shadow-popover outline-none`,x),t[9]=k):k=t[9];let ne=n?.displayName??d.deviceDetails,A;t[10]===ne?A=t[11]:(A=(0,H.jsx)(_,{className:`truncate text-base font-semibold text-fg`,children:ne}),t[10]=ne,t[11]=A);let j;t[12]===n?j=t[13]:(j=n?(0,H.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[n.kind,` · `,n.platform,` · `,oe(n.id)]}):null,t[12]=n,t[13]=j);let M;t[14]!==A||t[15]!==j?(M=(0,H.jsxs)(`div`,{className:`min-w-0`,children:[A,j]}),t[14]=A,t[15]=j,t[16]=M):M=t[16];let N;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,H.jsx)(c,{className:`size-5`,"aria-hidden":!0}),t[17]=N):N=t[17];let P;t[18]===d.close?P=t[19]:(P=(0,H.jsx)(m,{asChild:!0,children:(0,H.jsx)(b,{variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":d.close,children:N})}),t[18]=d.close,t[19]=P);let F;t[20]!==M||t[21]!==P?(F=(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-b border-edge px-4 py-3`,children:[M,P]}),t[20]=M,t[21]=P,t[22]=F):F=t[22];let I;t[23]!==d.accessActive||t[24]!==d.accessRevoked||t[25]!==d.accessTitle||t[26]!==d.createdAt||t[27]!==d.endpointCount||t[28]!==d.endpointsTitle||t[29]!==d.identityId||t[30]!==d.identityTitle||t[31]!==d.lastSeen||t[32]!==d.never||t[33]!==d.noAccessIdentity||t[34]!==d.noOnlineEndpoints||t[35]!==d.noPermissions||t[36]!==d.permissions||t[37]!==d.status||t[38]!==d.statusLabel||t[39]!==d.toolCount||t[40]!==n||t[41]!==C||t[42]!==T?(I=n?(0,H.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto p-4`,children:[(0,H.jsxs)(`dl`,{className:`grid grid-cols-2 gap-3 rounded-xl bg-surface-hover/40 p-4`,children:[(0,H.jsx)(W,{label:d.statusLabel,value:d.status[T]}),(0,H.jsx)(W,{label:d.lastSeen,value:n.lastSeenAt?C.format(n.lastSeenAt):d.never}),(0,H.jsx)(W,{label:d.endpointCount,value:String(n.endpoints.length)}),(0,H.jsx)(W,{label:d.toolCount,value:String(re(n))})]}),(0,H.jsxs)(`section`,{children:[(0,H.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:d.accessTitle}),(0,H.jsx)(`div`,{className:`mt-2 rounded-xl border border-edge-subtle bg-surface-base p-3 text-xs text-fg-muted`,children:n.access?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`p`,{children:n.access.revokedAt?d.accessRevoked:d.accessActive}),(0,H.jsxs)(`p`,{className:`mt-1 break-words`,children:[d.permissions,`: `,n.access.scopes.join(`, `)||d.noPermissions]})]}):(0,H.jsx)(`p`,{children:d.noAccessIdentity})})]}),(0,H.jsxs)(`section`,{children:[(0,H.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:d.endpointsTitle}),(0,H.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[n.endpoints.length===0?(0,H.jsx)(`p`,{className:`text-sm text-fg-muted`,children:d.noOnlineEndpoints}):null,n.endpoints.map(e=>(0,H.jsxs)(`article`,{className:`rounded-xl border border-edge-subtle bg-surface-base p-3`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,H.jsx)(`p`,{className:`min-w-0 break-all text-xs font-medium text-fg`,children:e.endpointId}),(0,H.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[d.status[e.availability],` · v`,e.appVersion]})]}),(0,H.jsx)(`div`,{className:`mt-3 space-y-2`,children:e.tools.map(e=>{let{descriptor:t}=e;return(0,H.jsxs)(`div`,{className:`rounded-lg bg-surface-hover/50 px-3 py-2`,children:[(0,H.jsx)(`p`,{className:`break-all text-xs font-medium text-fg`,children:t.name}),(0,H.jsx)(`p`,{className:`mt-0.5 break-words text-xs text-fg-subtle`,children:t.requiredPermissions.join(`, `)||d.noPermissions})]},t.name)})})]},e.connectionId))]})]}),(0,H.jsxs)(`section`,{children:[(0,H.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:d.identityTitle}),(0,H.jsxs)(`dl`,{className:`mt-2 rounded-xl border border-edge-subtle bg-surface-base p-3 text-xs`,children:[(0,H.jsx)(W,{label:d.identityId,value:n.id,breakAll:!0}),(0,H.jsx)(`div`,{className:`mt-3`,children:(0,H.jsx)(W,{label:d.createdAt,value:C.format(n.createdAt)})})]})]})]}):null,t[23]=d.accessActive,t[24]=d.accessRevoked,t[25]=d.accessTitle,t[26]=d.createdAt,t[27]=d.endpointCount,t[28]=d.endpointsTitle,t[29]=d.identityId,t[30]=d.identityTitle,t[31]=d.lastSeen,t[32]=d.never,t[33]=d.noAccessIdentity,t[34]=d.noOnlineEndpoints,t[35]=d.noPermissions,t[36]=d.permissions,t[37]=d.status,t[38]=d.statusLabel,t[39]=d.toolCount,t[40]=n,t[41]=C,t[42]=T,t[43]=I):I=t[43];let L;t[44]!==r||t[45]!==d.removeDevice||t[46]!==d.revoking||t[47]!==n||t[48]!==a||t[49]!==T?(L=n&&T!==`revoked`?(0,H.jsx)(`div`,{className:`shrink-0 border-t border-edge px-4 py-3`,children:(0,H.jsxs)(b,{variant:`secondary`,className:`w-full text-danger`,disabled:r,onClick:()=>a(n),children:[(0,H.jsx)(te,{className:`size-4`,"aria-hidden":!0}),r?d.revoking:d.removeDevice]})}):null,t[44]=r,t[45]=d.removeDevice,t[46]=d.revoking,t[47]=n,t[48]=a,t[49]=T,t[50]=L):L=t[50];let z;t[51]!==F||t[52]!==I||t[53]!==L?(z=(0,H.jsxs)(h,{children:[O,(0,H.jsxs)(g,{className:k,"aria-describedby":void 0,children:[F,I,L]})]}),t[51]=F,t[52]=I,t[53]=L,t[54]=z):z=t[54];let B;return t[55]!==z||t[56]!==E||t[57]!==D?(B=(0,H.jsx)(v,{open:E,onOpenChange:D,children:z}),t[55]=z,t[56]=E,t[57]=D,t[58]=B):B=t[58],B}function U(e){return e.language}function W(e){let t=(0,R.c)(10),{label:n,value:r,breakAll:i}=e,a=i===void 0?!1:i,o;t[0]===n?o=t[1]:(o=(0,H.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:n}),t[0]=n,t[1]=o);let s=a&&`break-all font-mono text-xs`,c;t[2]===s?c=t[3]:(c=u(`mt-1 text-sm text-fg`,s),t[2]=s,t[3]=c);let l;t[4]!==c||t[5]!==r?(l=(0,H.jsx)(`dd`,{className:c,children:r}),t[4]=c,t[5]=r,t[6]=l):l=t[6];let d;return t[7]!==o||t[8]!==l?(d=(0,H.jsxs)(`div`,{className:`min-w-0`,children:[o,l]}),t[7]=o,t[8]=l,t[9]=d):d=t[9],d}function ce(e){let t=(0,R.c)(19),{onPaired:n}=e,[r,a]=i(),s=ee(le),c;t[0]===s?c=t[1]:(c=l(s),t[0]=s,t[1]=c);let u=c.endpointToolsSettings.deviceAccess,d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d={open:!1},t[2]=d):d=t[2];let[f,p]=(0,L.useState)(d),m,h;t[3]!==r||t[4]!==a?(m=()=>{let e=r.get(`startDevicePairing`);e!==`mobile`&&e!==`browser`||(p({open:!0,target:e}),a(G,{replace:!0}))},h=[r,a],t[3]=r,t[4]=a,t[5]=m,t[6]=h):(m=t[5],h=t[6]),(0,L.useEffect)(m,h);let g,_;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>p({open:!0}),_=(0,H.jsx)(o,{className:`size-4`,"aria-hidden":!0}),t[7]=g,t[8]=_):(g=t[7],_=t[8]);let v;t[9]===u.addDevice?v=t[10]:(v=(0,H.jsxs)(b,{variant:`primary`,onClick:g,children:[_,u.addDevice]}),t[9]=u.addDevice,t[10]=v);let y;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>p(t=>({...t,open:e})),t[11]=y):y=t[11];let x;t[12]!==f.open||t[13]!==f.target||t[14]!==n?(x=(0,H.jsx)(F,{open:f.open,onOpenChange:y,onPaired:n,targetKind:f.target}),t[12]=f.open,t[13]=f.target,t[14]=n,t[15]=x):x=t[15];let S;return t[16]!==v||t[17]!==x?(S=(0,H.jsxs)(H.Fragment,{children:[v,x]}),t[16]=v,t[17]=x,t[18]=S):S=t[18],S}function G(e){let t=new URLSearchParams(e);return t.delete(`startDevicePairing`),t}function le(e){return e.language}async function ue(e){let t=await e.json().catch(()=>null);if(!e.ok||t?.payload===void 0)throw Error(t?.error?.message??`Endpoint management request failed: ${e.status}`);return t.payload}function de(){return f(`/api/endpoint-tools/devices`)}function fe(e){let t=new URLSearchParams({page:String(e.page),pageSize:String(e.pageSize)});return e.query.trim()&&t.set(`query`,e.query.trim()),e.principalId&&t.set(`principalId`,e.principalId),e.status&&t.set(`status`,e.status),e.effect&&t.set(`effect`,e.effect),f(`/api/endpoint-tools/invocations?${t}`)}async function pe(){return ue(await d(de()))}async function me(e){let t=Array.from({length:Math.ceil(e.length/100)},(t,n)=>e.slice(n*100,(n+1)*100));await Promise.all(t.map(async e=>{await ue(await d(f(`/api/endpoint-tools/devices/revoke`),{method:`POST`,body:JSON.stringify({ids:e})}))}))}async function he(e){return ue(await d(fe(e)))}var ge=5e3,K=20,_e=20;function ve(e){return e===`online`||e===`succeeded`?`bg-success-soft text-success`:e===`running`?`bg-accent-soft text-accent-fg`:e===`failed`||e===`revoked`?`bg-danger-soft text-danger`:`bg-surface-hover text-fg-muted`}function ye(e){let t=(0,R.c)(5),{status:n,label:r}=e,i;t[0]===n?i=t[1]:(i=u(`rounded-full px-2 py-0.5 text-xs font-medium`,ve(n)),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,H.jsx)(`span`,{className:i,children:r}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function be(){let e=ee(e=>e.language),t=l(e).endpointToolsSettings,[n,r]=i(),o=n.get(`view`)===`activity`?`activity`:`devices`,[c,d]=(0,L.useState)(null),[f,p]=(0,L.useState)([]),[m,h]=(0,L.useState)(!1),[g,_]=(0,L.useState)(!1),[v,x]=(0,L.useState)(``),[S,F]=(0,L.useState)(`active`),[R,z]=(0,L.useState)(``),[B,U]=(0,L.useState)(1),[W,G]=(0,L.useState)(()=>new Set),[le,ue]=(0,L.useState)(``),[ve]=ne(le,250),[be,xe]=(0,L.useState)(``),[Se,Ce]=(0,L.useState)(``),[we,Te]=(0,L.useState)(``),[Ee,q]=(0,L.useState)(1),De={page:Ee,pageSize:_e,query:ve,principalId:be,status:Se,effect:we},J=y(de(),pe,{refreshInterval:ge}),Y=y(o===`activity`?fe(De):null,()=>he(De),{refreshInterval:ge,keepPreviousData:!0}),Oe=(0,L.useMemo)(()=>new Intl.DateTimeFormat(e===`zh`?`zh-CN`:`en`,{dateStyle:`medium`,timeStyle:`short`}),[e]);if(J.isLoading&&!J.data)return(0,H.jsx)(N,{children:(0,H.jsx)(I,{sections:2})});let X=J.data??[],ke=Y.data?.items??[],Ae=X.filter(e=>V(e)===`online`).length,je=X.filter(e=>V(e)!==`revoked`).length,Me=X.filter(e=>ie(e)).length,Ne=[...new Set(X.map(e=>e.platform))].toSorted(),Z=ae(X,{query:v,status:S,platform:R}),Pe=Math.max(1,Math.ceil(Z.length/K)),Q=Math.min(B,Pe),Fe=Z.slice((Q-1)*K,Q*K),$=Fe.reduce((e,t)=>(V(t)!==`revoked`&&e.push(t.id),e),[]),Ie=$.length>0&&$.every(e=>W.has(e)),Le=e=>{r(t=>{let n=new URLSearchParams(t);return e===`devices`?n.delete(`view`):n.set(`view`,e),n},{replace:!0})},Re=async()=>{await Promise.all([J.mutate(),o===`activity`?Y.mutate():Promise.resolve()])},ze=async()=>{if(!(f.length===0||m)){h(!0),_(!1);try{await me(f.map(e=>e.id)),p([]),G(new Set),await J.mutate()}catch{_(!0)}finally{h(!1)}}},Be=e=>{e(),U(1),G(new Set)};return(0,H.jsxs)(N,{children:[(0,H.jsx)(M,{title:t.title,subtitle:t.subtitle,actions:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(k,{className:`size-9 shrink-0 p-0`,label:t.refresh,onClick:Re}),(0,H.jsx)(ce,{onPaired:()=>void J.mutate()})]})}),J.error||Y.error?(0,H.jsx)(`div`,{className:`rounded-xl bg-danger-soft px-4 py-3 text-sm text-danger`,children:t.loadError}):null,(0,H.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[{label:t.activeDevices,value:je,filter:`active`},{label:t.onlineDevices,value:Ae,filter:`online`},{label:t.staleDevices,value:Me,filter:`stale`}].map(({label:e,value:t,filter:n})=>(0,H.jsxs)(`button`,{type:`button`,className:u(`touch-target rounded-xl px-4 py-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,S===n?`bg-surface-active`:`bg-surface-hover/20 hover:bg-surface-hover/50`),"aria-pressed":S===n,onClick:()=>{Be(()=>F(n)),Le(`devices`)},children:[(0,H.jsx)(`span`,{className:`text-xs text-fg-muted`,children:e}),(0,H.jsx)(`span`,{className:`mt-1 block text-2xl font-semibold text-fg`,children:t})]},n))}),(0,H.jsx)(j,{items:[{id:`devices`,label:t.devicesTab,icon:D,count:je},{id:`activity`,label:t.activityTab,icon:O,count:Y.data?.total}],activeTab:o,onChange:Le,ariaLabel:t.viewsAria,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`}),(0,H.jsxs)(P,{id:`devices`,activeTab:o,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`,title:t.devicesTitle,hint:t.devicesHint,children:[(0,H.jsxs)(`div`,{className:`mb-4 grid gap-2 sm:grid-cols-[minmax(0,1fr)_11rem_11rem]`,children:[(0,H.jsxs)(`label`,{className:`relative block`,children:[(0,H.jsx)(`span`,{className:`sr-only`,children:t.searchDevices}),(0,H.jsx)(s,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),(0,H.jsx)(`input`,{type:`search`,"aria-label":t.searchDevices,value:v,placeholder:t.searchDevices,className:`h-10 w-full rounded-lg border border-edge bg-surface-inset pl-9 pr-3 text-base text-fg placeholder:text-fg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent sm:text-sm`,onChange:e=>Be(()=>x(e.target.value))})]}),(0,H.jsx)(a,{value:S,options:[{value:`active`,label:t.filterActive},{value:`online`,label:t.status.online},{value:`offline`,label:t.status.offline},{value:`stale`,label:t.filterStale},{value:`revoked`,label:t.status.revoked},{value:`all`,label:t.filterAll}],placeholder:t.statusLabel,allowEmpty:!1,ariaLabel:t.statusLabel,onChange:e=>Be(()=>F(e))}),(0,H.jsx)(a,{value:R,options:Ne.map(e=>({value:e,label:e})),placeholder:t.allPlatforms,emptyLabel:t.allPlatforms,ariaLabel:t.platformLabel,onChange:e=>Be(()=>z(e))})]}),W.size>0?(0,H.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3 rounded-xl bg-accent-soft px-3 py-2`,children:[(0,H.jsx)(`p`,{className:`text-sm font-medium text-accent-fg`,children:t.selectedCount.replace(`{{count}}`,String(W.size))}),(0,H.jsxs)(b,{variant:`secondary`,className:`text-danger`,onClick:()=>{_(!1),p(X.filter(e=>W.has(e.id)))},children:[(0,H.jsx)(te,{className:`size-4`,"aria-hidden":!0}),t.removeSelected]})]}):null,X.length===0?(0,H.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noDevices}):Z.length===0?(0,H.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noMatchingDevices}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`flex min-h-10 items-center gap-3 border-b border-edge-subtle px-1`,children:(0,H.jsxs)(`label`,{className:u(`touch-target flex items-center gap-2 text-xs text-fg-muted`,$.length>0?`cursor-pointer`:`cursor-not-allowed opacity-50`),children:[(0,H.jsx)(`input`,{type:`checkbox`,"aria-label":t.selectPage,checked:Ie,disabled:$.length===0,className:`size-4 accent-accent`,onChange:e=>{G(t=>{let n=new Set(t);for(let t of $)e.target.checked?n.add(t):n.delete(t);return n})}}),t.selectPage]})}),(0,H.jsx)(`ul`,{className:`divide-y divide-edge-subtle`,children:Fe.map(e=>{let n=V(e),r=e.kind===`mobile`?w:A;return(0,H.jsxs)(`li`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(`label`,{className:u(`touch-target flex size-10 shrink-0 items-center justify-center`,n===`revoked`?`cursor-not-allowed opacity-40`:`cursor-pointer`),children:(0,H.jsx)(`input`,{type:`checkbox`,checked:W.has(e.id),disabled:n===`revoked`,"aria-label":t.selectDevice.replace(`{{name}}`,e.displayName),className:`size-4 accent-accent`,onChange:t=>{G(n=>{let r=new Set(n);return t.target.checked?r.add(e.id):r.delete(e.id),r})}})}),(0,H.jsxs)(`button`,{type:`button`,className:`touch-target flex min-w-0 flex-1 items-center gap-3 py-3 text-left hover:bg-surface-hover/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>d(e),children:[(0,H.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-surface-inset text-fg-muted`,children:(0,H.jsx)(r,{className:`size-4`,"aria-hidden":!0})}),(0,H.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:e.displayName}),(0,H.jsx)(ye,{status:n,label:t.status[n]})]}),(0,H.jsxs)(`span`,{className:`mt-1 block text-xs text-fg-muted`,children:[e.platform,` · `,oe(e.id),` · `,t.lastSeen,`: `,e.lastSeenAt?Oe.format(e.lastSeenAt):t.never]})]}),(0,H.jsx)(`span`,{className:`hidden shrink-0 text-right text-xs text-fg-muted sm:block`,children:t.endpointSummary.replace(`{{endpoints}}`,String(e.endpoints.length)).replace(`{{tools}}`,String(re(e)))}),(0,H.jsx)(C,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":!0})]})]},e.id)})}),(0,H.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3 border-t border-edge-subtle pt-3`,children:[(0,H.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.paginationSummary.replace(`{{from}}`,String((Q-1)*K+1)).replace(`{{to}}`,String(Math.min(Q*K,Z.length))).replace(`{{total}}`,String(Z.length))}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(b,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.previousPage,disabled:Q<=1,onClick:()=>U(e=>Math.max(1,e-1)),children:(0,H.jsx)(E,{className:`size-4`,"aria-hidden":!0})}),(0,H.jsx)(b,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.nextPage,disabled:Q>=Pe,onClick:()=>U(e=>Math.min(Pe,e+1)),children:(0,H.jsx)(C,{className:`size-4`,"aria-hidden":!0})})]})]})]})]}),(0,H.jsxs)(P,{id:`activity`,activeTab:o,tabIdPrefix:`endpoint-management-tab`,panelIdPrefix:`endpoint-management-panel`,title:t.callsTitle,hint:t.callsHint,children:[(0,H.jsxs)(`div`,{className:`mb-4 grid gap-2 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,H.jsxs)(`label`,{className:`relative block sm:col-span-2 lg:col-span-1`,children:[(0,H.jsx)(`span`,{className:`sr-only`,children:t.searchActivity}),(0,H.jsx)(s,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),(0,H.jsx)(`input`,{type:`search`,"aria-label":t.searchActivity,value:le,placeholder:t.searchActivity,className:`h-10 w-full rounded-lg border border-edge bg-surface-inset pl-9 pr-3 text-base text-fg placeholder:text-fg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent sm:text-sm`,onChange:e=>{ue(e.target.value),q(1)}})]}),(0,H.jsx)(a,{value:be,options:X.map(e=>({value:e.id,label:`${e.displayName} · ${oe(e.id)}`})),placeholder:t.allDevices,emptyLabel:t.allDevices,ariaLabel:t.deviceLabel,onChange:e=>{xe(e),q(1)}}),(0,H.jsx)(a,{value:Se,options:[{value:`running`,label:t.status.running},{value:`succeeded`,label:t.status.succeeded},{value:`failed`,label:t.status.failed}],placeholder:t.allStatuses,emptyLabel:t.allStatuses,ariaLabel:t.statusLabel,onChange:e=>{Ce(e),q(1)}}),(0,H.jsx)(a,{value:we,options:[{value:`read`,label:t.effects.read},{value:`write`,label:t.effects.write},{value:`destructive`,label:t.effects.destructive}],placeholder:t.allEffects,emptyLabel:t.allEffects,ariaLabel:t.effectLabel,onChange:e=>{Te(e),q(1)}})]}),Y.isLoading&&!Y.data?(0,H.jsx)(I,{sections:1}):null,ke.length===0&&!Y.isLoading?(0,H.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.noMatchingCalls}):null,(0,H.jsx)(`div`,{className:`space-y-2`,children:ke.map(e=>(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-lg bg-surface-base/55 px-3 py-2.5`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`p`,{className:`break-all text-sm font-medium text-fg`,children:e.toolName}),(0,H.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[Oe.format(e.startedAt),` · `,t.effects[e.effect],` · `,e.endpointId]}),e.errorMessage?(0,H.jsx)(`p`,{className:`mt-1 text-xs text-danger`,children:e.errorMessage}):null]}),(0,H.jsx)(ye,{status:e.status,label:t.status[e.status]})]},e.id))}),Y.data&&Y.data.total>0?(0,H.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3 border-t border-edge-subtle pt-3`,children:[(0,H.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.paginationSummary.replace(`{{from}}`,String((Y.data.page-1)*Y.data.pageSize+1)).replace(`{{to}}`,String(Math.min(Y.data.page*Y.data.pageSize,Y.data.total))).replace(`{{total}}`,String(Y.data.total))}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(b,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.previousPage,disabled:Y.data.page<=1,onClick:()=>q(e=>Math.max(1,e-1)),children:(0,H.jsx)(E,{className:`size-4`,"aria-hidden":!0})}),(0,H.jsx)(b,{variant:`ghost`,className:`size-9 p-0`,"aria-label":t.nextPage,disabled:Y.data.page>=Y.data.totalPages,onClick:()=>q(e=>Math.min(Y.data.totalPages,e+1)),children:(0,H.jsx)(C,{className:`size-4`,"aria-hidden":!0})})]})]}):null]}),(0,H.jsx)(se,{device:c,busy:m,onClose:()=>d(null),onRevoke:e=>{d(null),_(!1),p([e])}}),(0,H.jsx)(T,{open:f.length>0,title:f.length>1?t.removeManyTitle:t.removeTitle,description:`${f.length>1?t.removeManyDescription.replace(`{{count}}`,String(f.length)):t.removeDescription.replace(`{{name}}`,f[0]?.displayName??``)}${g?`\n\n${t.revokeError}`:``}`,confirmLabel:m?t.revoking:t.removeDevice,cancelLabel:t.cancel,destructive:!0,onConfirm:()=>void ze(),onCancel:()=>{m||p([])}})]})}export{be as EndpointToolsManagementSettings};
|
package/dist/gateway/static/root/assets/{markdown-view-DtEVIWB3.js → markdown-view-gPnGW4pR.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,r as t,t as n}from"./rolldown-runtime-aKtaBQYM.js";import{a as r,n as i,t as a}from"./vendor-react-BOUWij0V.js";import{f as o,u as s}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as c}from"./createLucideIcon-DPHK1VkS.js";import{t as l}from"./download-Dk-ZjtO6.js";import{t as u}from"./plus-Q2yW6OE7.js";import{t as d}from"./x-B_N4OPjy.js";import{t as f}from"./messages-
|
|
1
|
+
import{i as e,r as t,t as n}from"./rolldown-runtime-aKtaBQYM.js";import{a as r,n as i,t as a}from"./vendor-react-BOUWij0V.js";import{f as o,u as s}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as c}from"./createLucideIcon-DPHK1VkS.js";import{t as l}from"./download-Dk-ZjtO6.js";import{t as u}from"./plus-Q2yW6OE7.js";import{t as d}from"./x-B_N4OPjy.js";import{t as f}from"./messages-6j-AkWdj.js";import{t as p}from"./cn-JdwAhgNB.js";import{n as m}from"./locale-store-CCYf4Qxv.js";import{a as h,n as g,o as _,r as v,s as y,t as b}from"./dist-BGTk37IG.js";import{n as x,r as S,t as ee}from"./app-link-DRL0YnPs.js";import{t as te}from"./copy-to-clipboard-HOJ79TWv.js";var ne=c(`file-image`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),C=c(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),re=c(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]);function ie(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ae(e){if(Array.isArray(e))return e}function oe(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function se(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ce(e,t){return ae(e)||oe(e,t)||le(e,t)||se()}function le(e,t){if(e){if(typeof e==`string`)return ie(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ie(e,t):void 0}}var ue=Object.entries,de=Object.setPrototypeOf,fe=Object.isFrozen,pe=Object.getPrototypeOf,me=Object.getOwnPropertyDescriptor,he=Object.freeze,ge=Object.seal,_e=Object.create,ve=typeof Reflect<`u`&&Reflect,ye=ve.apply,be=ve.construct;he||=function(e){return e},ge||=function(e){return e},ye||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},be||=function(e){return new e(...[...arguments].slice(1))};var xe=Ve(Array.prototype.forEach),Se=Ve(Array.prototype.lastIndexOf),Ce=Ve(Array.prototype.pop),we=Ve(Array.prototype.push),Te=Ve(Array.prototype.splice),Ee=Array.isArray,De=Ve(String.prototype.toLowerCase),Oe=Ve(String.prototype.toString),ke=Ve(String.prototype.match),Ae=Ve(String.prototype.replace),je=Ve(String.prototype.indexOf),Me=Ve(String.prototype.trim),Ne=Ve(Number.prototype.toString),Pe=Ve(Boolean.prototype.toString),Fe=typeof BigInt>`u`?null:Ve(BigInt.prototype.toString),Ie=typeof Symbol>`u`?null:Ve(Symbol.prototype.toString),Le=Ve(Object.prototype.hasOwnProperty),Re=Ve(Object.prototype.toString),ze=Ve(RegExp.prototype.test),Be=He(TypeError);function Ve(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return ye(e,t,n)}}function He(e){return function(){return be(e,[...arguments])}}function Ue(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:De;if(de&&de(e,null),!Ee(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(fe(t)||(t[r]=e),i=e)}e[i]=!0}return e}function We(e){for(let t=0;t<e.length;t++)Le(e,t)||(e[t]=null);return e}function Ge(e){let t=_e(null);for(let r of ue(e)){var n=ce(r,2);let i=n[0],a=n[1];Le(e,i)&&(Ee(a)?t[i]=We(a):a&&typeof a==`object`&&a.constructor===Object?t[i]=Ge(a):t[i]=a)}return t}function Ke(e){switch(typeof e){case`string`:return e;case`number`:return Ne(e);case`boolean`:return Pe(e);case`bigint`:return Fe?Fe(e):`0`;case`symbol`:return Ie?Ie(e):`Symbol()`;case`undefined`:return Re(e);case`function`:case`object`:{if(e===null)return Re(e);let t=e,n=qe(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Re(e)}return Re(e)}default:return Re(e)}}function qe(e,t){for(;e!==null;){let n=me(e,t);if(n){if(n.get)return Ve(n.get);if(typeof n.value==`function`)return Ve(n.value)}e=pe(e)}function n(){return null}return n}function Je(e){try{return ze(e,``),!0}catch{return!1}}var Ye=he(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Xe=he(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Ze=he([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),eee=he([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Qe=he(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),tee=he([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),$e=he([`#text`]),et=he(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),tt=he(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),nt=he(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),rt=he([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),it=ge(/{{[\w\W]*|^[\w\W]*}}/g),at=ge(/<%[\w\W]*|^[\w\W]*%>/g),nee=ge(/\${[\w\W]*/g),ot=ge(/^data-[\-\w.\u00B7-\uFFFF]+$/),ree=ge(/^aria-[\-\w]+$/),st=ge(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),iee=ge(/^(?:\w+script|data):/i),ct=ge(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),aee=ge(/^html$/i),oee=ge(/^[a-z][.\w]*(-[.\w]+)+$/i),lt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ut=function(){return typeof window>`u`?null:window},dt=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},ft=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function pt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ut(),t=e=>pt(e);if(t.version=`3.4.7`,t.removed=[],!e||!e.document||e.document.nodeType!==lt.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=qe(d,`cloneNode`),p=qe(d,`remove`),m=qe(d,`nextSibling`),h=qe(d,`childNodes`),g=qe(d,`parentNode`),_=qe(d,`shadowRoot`),v=qe(d,`attributes`),y=o&&o.prototype?qe(o.prototype,`nodeType`):null,b=o&&o.prototype?qe(o.prototype,`nodeName`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,S=``,ee=n,te=ee.implementation,ne=ee.createNodeIterator,C=ee.createDocumentFragment,re=ee.getElementsByTagName,ie=r.importNode,ae=ft();t.isSupported=typeof ue==`function`&&typeof g==`function`&&te&&te.createHTMLDocument!==void 0;let oe=it,se=at,ce=nee,le=ot,de=ree,fe=iee,pe=ct,me=oee,ge=st,ve=null,ye=Ue({},[...Ye,...Xe,...Ze,...Qe,...$e]),be=null,Ne=Ue({},[...et,...tt,...nt,...rt]),Pe=Object.seal(_e(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Fe=null,Ie=null,Re=Object.seal(_e(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ve=!0,He=!0,We=!1,mt=!0,ht=!1,gt=!0,_t=!1,vt=!1,yt=!1,bt=!1,xt=!1,St=!1,Ct=!0,wt=!1,Tt=`user-content-`,Et=!0,Dt=!1,Ot={},kt=null,At=Ue({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),jt=null,Mt=Ue({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Nt=null,Pt=Ue({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ft=`http://www.w3.org/1998/Math/MathML`,It=`http://www.w3.org/2000/svg`,Lt=`http://www.w3.org/1999/xhtml`,Rt=Lt,zt=!1,Bt=null,Vt=Ue({},[Ft,It,Lt],Oe),Ht=Ue({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Ut=Ue({},[`annotation-xml`]),Wt=Ue({},[`title`,`style`,`font`,`a`,`script`]),Gt=null,Kt=[`application/xhtml+xml`,`text/html`],qt=null,Jt=null,Yt=n.createElement(`form`),Xt=function(e){return e instanceof RegExp||e instanceof Function},Zt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Jt&&Jt===e)return;(!e||typeof e!=`object`)&&(e={}),e=Ge(e),Gt=Kt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,qt=Gt===`application/xhtml+xml`?Oe:De,ve=Le(e,`ALLOWED_TAGS`)&&Ee(e.ALLOWED_TAGS)?Ue({},e.ALLOWED_TAGS,qt):ye,be=Le(e,`ALLOWED_ATTR`)&&Ee(e.ALLOWED_ATTR)?Ue({},e.ALLOWED_ATTR,qt):Ne,Bt=Le(e,`ALLOWED_NAMESPACES`)&&Ee(e.ALLOWED_NAMESPACES)?Ue({},e.ALLOWED_NAMESPACES,Oe):Vt,Nt=Le(e,`ADD_URI_SAFE_ATTR`)&&Ee(e.ADD_URI_SAFE_ATTR)?Ue(Ge(Pt),e.ADD_URI_SAFE_ATTR,qt):Pt,jt=Le(e,`ADD_DATA_URI_TAGS`)&&Ee(e.ADD_DATA_URI_TAGS)?Ue(Ge(Mt),e.ADD_DATA_URI_TAGS,qt):Mt,kt=Le(e,`FORBID_CONTENTS`)&&Ee(e.FORBID_CONTENTS)?Ue({},e.FORBID_CONTENTS,qt):At,Fe=Le(e,`FORBID_TAGS`)&&Ee(e.FORBID_TAGS)?Ue({},e.FORBID_TAGS,qt):Ge({}),Ie=Le(e,`FORBID_ATTR`)&&Ee(e.FORBID_ATTR)?Ue({},e.FORBID_ATTR,qt):Ge({}),Ot=Le(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Ge(e.USE_PROFILES):e.USE_PROFILES:!1,Ve=e.ALLOW_ARIA_ATTR!==!1,He=e.ALLOW_DATA_ATTR!==!1,We=e.ALLOW_UNKNOWN_PROTOCOLS||!1,mt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ht=e.SAFE_FOR_TEMPLATES||!1,gt=e.SAFE_FOR_XML!==!1,_t=e.WHOLE_DOCUMENT||!1,bt=e.RETURN_DOM||!1,xt=e.RETURN_DOM_FRAGMENT||!1,St=e.RETURN_TRUSTED_TYPE||!1,yt=e.FORCE_BODY||!1,Ct=e.SANITIZE_DOM!==!1,wt=e.SANITIZE_NAMED_PROPS||!1,Et=e.KEEP_CONTENT!==!1,Dt=e.IN_PLACE||!1,ge=Je(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:st,Rt=typeof e.NAMESPACE==`string`?e.NAMESPACE:Lt,Ht=Le(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?Ge(e.MATHML_TEXT_INTEGRATION_POINTS):Ue({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Ut=Le(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?Ge(e.HTML_INTEGRATION_POINTS):Ue({},[`annotation-xml`]);let t=Le(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?Ge(e.CUSTOM_ELEMENT_HANDLING):_e(null);if(Pe=_e(null),Le(t,`tagNameCheck`)&&Xt(t.tagNameCheck)&&(Pe.tagNameCheck=t.tagNameCheck),Le(t,`attributeNameCheck`)&&Xt(t.attributeNameCheck)&&(Pe.attributeNameCheck=t.attributeNameCheck),Le(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(Pe.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),ht&&(He=!1),xt&&(bt=!0),Ot&&(ve=Ue({},$e),be=_e(null),Ot.html===!0&&(Ue(ve,Ye),Ue(be,et)),Ot.svg===!0&&(Ue(ve,Xe),Ue(be,tt),Ue(be,rt)),Ot.svgFilters===!0&&(Ue(ve,Ze),Ue(be,tt),Ue(be,rt)),Ot.mathMl===!0&&(Ue(ve,Qe),Ue(be,nt),Ue(be,rt))),Re.tagCheck=null,Re.attributeCheck=null,Le(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?Re.tagCheck=e.ADD_TAGS:Ee(e.ADD_TAGS)&&(ve===ye&&(ve=Ge(ve)),Ue(ve,e.ADD_TAGS,qt))),Le(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?Re.attributeCheck=e.ADD_ATTR:Ee(e.ADD_ATTR)&&(be===Ne&&(be=Ge(be)),Ue(be,e.ADD_ATTR,qt))),Le(e,`ADD_URI_SAFE_ATTR`)&&Ee(e.ADD_URI_SAFE_ATTR)&&Ue(Nt,e.ADD_URI_SAFE_ATTR,qt),Le(e,`FORBID_CONTENTS`)&&Ee(e.FORBID_CONTENTS)&&(kt===At&&(kt=Ge(kt)),Ue(kt,e.FORBID_CONTENTS,qt)),Le(e,`ADD_FORBID_CONTENTS`)&&Ee(e.ADD_FORBID_CONTENTS)&&(kt===At&&(kt=Ge(kt)),Ue(kt,e.ADD_FORBID_CONTENTS,qt)),Et&&(ve[`#text`]=!0),_t&&Ue(ve,[`html`,`head`,`body`]),ve.table&&(Ue(ve,[`tbody`]),delete Fe.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Be(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Be(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);x=e.TRUSTED_TYPES_POLICY,S=x.createHTML(``)}else x===void 0&&(x=dt(u,i)),x!==null&&typeof S==`string`&&(S=x.createHTML(``));(ae.uponSanitizeElement.length>0||ae.uponSanitizeAttribute.length>0)&&ve===ye&&(ve=Ge(ve)),ae.uponSanitizeAttribute.length>0&&be===Ne&&(be=Ge(be)),he&&he(e),Jt=e},Qt=Ue({},[...Xe,...Ze,...eee]),$t=Ue({},[...Qe,...tee]),en=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:Rt,tagName:`template`});let n=De(e.tagName),r=De(t.tagName);return Bt[e.namespaceURI]?e.namespaceURI===It?t.namespaceURI===Lt?n===`svg`:t.namespaceURI===Ft?n===`svg`&&(r===`annotation-xml`||Ht[r]):!!Qt[n]:e.namespaceURI===Ft?t.namespaceURI===Lt?n===`math`:t.namespaceURI===It?n===`math`&&Ut[r]:!!$t[n]:e.namespaceURI===Lt?t.namespaceURI===It&&!Ut[r]||t.namespaceURI===Ft&&!Ht[r]?!1:!$t[n]&&(Wt[n]||!Qt[n]):!!(Gt===`application/xhtml+xml`&&Bt[e.namespaceURI]):!1},tn=function(e){we(t.removed,{element:e});try{g(e).removeChild(e)}catch{p(e)}},nn=function(e,n){try{we(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{we(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(bt||xt)try{tn(n)}catch{}else try{n.setAttribute(e,``)}catch{}},rn=function(e){let t=null,r=null;if(yt)e=`<remove></remove>`+e;else{let t=ke(e,/^[\r\n\t ]+/);r=t&&t[0]}Gt===`application/xhtml+xml`&&Rt===Lt&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=x?x.createHTML(e):e;if(Rt===Lt)try{t=new l().parseFromString(i,Gt)}catch{}if(!t||!t.documentElement){t=te.createDocument(Rt,`template`,null);try{t.documentElement.innerHTML=zt?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Rt===Lt?re.call(t,_t?`html`:`body`)[0]:_t?t.documentElement:a},an=function(e){return ne.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},on=function(e){e.normalize();let t=ne.call(e.ownerDocument||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),n=t.nextNode();for(;n;){let e=n.data;xe([oe,se,ce],t=>{e=Ae(e,t,` `)}),n.data=e,n=t.nextNode()}},sn=function(e){let t=b?b(e):null;return typeof t!=`string`||qt(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},cn=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===lt.documentFragment}catch{return!1}},ln=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function un(e,n,r){xe(e,e=>{e.call(t,n,r,Jt)})}let dn=function(e){let n=null;if(un(ae.beforeSanitizeElements,e,null),sn(e))return tn(e),!0;let r=qt(e.nodeName);if(un(ae.uponSanitizeElement,e,{tagName:r,allowedTags:ve}),gt&&e.hasChildNodes()&&!ln(e.firstElementChild)&&ze(/<[/\w!]/g,e.innerHTML)&&ze(/<[/\w!]/g,e.textContent)||gt&&e.namespaceURI===Lt&&r===`style`&&ln(e.firstElementChild)||e.nodeType===lt.progressingInstruction||gt&&e.nodeType===lt.comment&&ze(/<[/\w]/g,e.data))return tn(e),!0;if(Fe[r]||!(Re.tagCheck instanceof Function&&Re.tagCheck(r))&&!ve[r]){if(!Fe[r]&&mn(r)&&(Pe.tagNameCheck instanceof RegExp&&ze(Pe.tagNameCheck,r)||Pe.tagNameCheck instanceof Function&&Pe.tagNameCheck(r)))return!1;if(Et&&!kt[r]){let t=g(e),n=h(e);if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=f(n[i],!0);t.insertBefore(r,m(e))}}}return tn(e),!0}return(y?y(e):e.nodeType)===lt.element&&!en(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&ze(/<\/no(script|embed|frames)/i,e.innerHTML)?(tn(e),!0):(ht&&e.nodeType===lt.text&&(n=e.textContent,xe([oe,se,ce],e=>{n=Ae(n,e,` `)}),e.textContent!==n&&(we(t.removed,{element:e.cloneNode()}),e.textContent=n)),un(ae.afterSanitizeElements,e,null),!1)},fn=function(e,t,r){if(Ie[t]||Ct&&(t===`id`||t===`name`)&&(r in n||r in Yt))return!1;let i=be[t]||Re.attributeCheck instanceof Function&&Re.attributeCheck(t,e);if(!(He&&!Ie[t]&&ze(le,t))&&!(Ve&&ze(de,t))){if(!i||Ie[t]){if(!(mn(e)&&(Pe.tagNameCheck instanceof RegExp&&ze(Pe.tagNameCheck,e)||Pe.tagNameCheck instanceof Function&&Pe.tagNameCheck(e))&&(Pe.attributeNameCheck instanceof RegExp&&ze(Pe.attributeNameCheck,t)||Pe.attributeNameCheck instanceof Function&&Pe.attributeNameCheck(t,e))||t===`is`&&Pe.allowCustomizedBuiltInElements&&(Pe.tagNameCheck instanceof RegExp&&ze(Pe.tagNameCheck,r)||Pe.tagNameCheck instanceof Function&&Pe.tagNameCheck(r))))return!1}else if(!Nt[t]&&!ze(ge,Ae(r,pe,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&je(r,`data:`)===0&&jt[e])&&!(We&&!ze(fe,Ae(r,pe,``)))&&r)return!1}return!0},pn=Ue({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),mn=function(e){return!pn[De(e)]&&ze(me,e)},hn=function(e){un(ae.beforeSanitizeAttributes,e,null);let n=e.attributes;if(!n||sn(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:be,forceKeepAttr:void 0},i=n.length;for(;i--;){let a=n[i],o=a.name,s=a.namespaceURI,c=a.value,l=qt(o),d=c,f=o===`value`?d:Me(d);if(r.attrName=l,r.attrValue=f,r.keepAttr=!0,r.forceKeepAttr=void 0,un(ae.uponSanitizeAttribute,e,r),f=r.attrValue,wt&&(l===`id`||l===`name`)&&je(f,Tt)!==0&&(nn(o,e),f=Tt+f),gt&&ze(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){nn(o,e);continue}if(l===`attributename`&&ke(f,`href`)){nn(o,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){nn(o,e);continue}if(!mt&&ze(/\/>/i,f)){nn(o,e);continue}ht&&xe([oe,se,ce],e=>{f=Ae(f,e,` `)});let p=qt(e.nodeName);if(!fn(p,l,f)){nn(o,e);continue}if(x&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!s)switch(u.getAttributeType(p,l)){case`TrustedHTML`:f=x.createHTML(f);break;case`TrustedScriptURL`:f=x.createScriptURL(f);break}if(f!==d)try{s?e.setAttributeNS(s,o,f):e.setAttribute(o,f),sn(e)?tn(e):Ce(t.removed)}catch{nn(o,e)}}un(ae.afterSanitizeAttributes,e,null)},gn=function(e){let t=null,n=an(e);for(un(ae.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(un(ae.uponSanitizeShadowNode,t,null),dn(t),hn(t),cn(t.content)&&gn(t.content),(y?y(t):t.nodeType)===lt.element){let e=_?_(t):t.shadowRoot;cn(e)&&(_n(e),gn(e))}un(ae.afterSanitizeShadowDOM,e,null)},_n=function(e){let t=y?y(e):e.nodeType;if(t===lt.element){let t=_?_(e):e.shadowRoot;cn(t)&&(_n(t),gn(t))}let n=h?h(e):e.childNodes;if(!n)return;let r=[];xe(n,e=>{we(r,e)});for(let e of r)_n(e);if(t===lt.element){let t=b?b(e):null;if(typeof t==`string`&&qt(t)===`template`){let t=e.content;cn(t)&&_n(t)}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(zt=!e,zt&&(e=`<!-->`),typeof e!=`string`&&!ln(e)&&(e=Ke(e),typeof e!=`string`))throw Be(`dirty is not a string, aborting`);if(!t.isSupported)return e;if(vt||Zt(n),t.removed=[],typeof e==`string`&&(Dt=!1),Dt){let t=b?b(e):e.nodeName;if(typeof t==`string`){let e=qt(t);if(!ve[e]||Fe[e])throw Be(`root node is forbidden and cannot be sanitized in-place`)}if(sn(e))throw Be(`root node is clobbered and cannot be sanitized in-place`);_n(e)}else if(ln(e))i=rn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===lt.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),_n(a);else{if(!bt&&!ht&&!_t&&e.indexOf(`<`)===-1)return x&&St?x.createHTML(e):e;if(i=rn(e),!i)return bt?null:St?S:``}i&&yt&&tn(i.firstChild);let c=an(Dt?e:i);for(;o=c.nextNode();)dn(o),hn(o),cn(o.content)&&gn(o.content);if(Dt)return ht&&on(e),e;if(bt){if(ht&&on(i),xt)for(s=C.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(be.shadowroot||be.shadowrootmode)&&(s=ie.call(r,s,!0)),s}let l=_t?i.outerHTML:i.innerHTML;return _t&&ve[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&ze(aee,i.ownerDocument.doctype.name)&&(l=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
3
3
|
`+l),ht&&xe([oe,se,ce],e=>{l=Ae(l,e,` `)}),x&&St?x.createHTML(l):l},t.setConfig=function(){Zt(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),vt=!0},t.clearConfig=function(){Jt=null,vt=!1},t.isValidAttribute=function(e,t,n){return Jt||Zt({}),fn(qt(e),qt(t),n)},t.addHook=function(e,t){typeof t==`function`&&we(ae[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=Se(ae[e],t);return n===-1?void 0:Te(ae[e],n,1)[0]}return Ce(ae[e])},t.removeHooks=function(e){ae[e]=[]},t.removeAllHooks=function(){ae=ft()},t}var mt=pt(),ht=e(r(),1),gt=i();function _t(e,t,n){let r=e?.trim();if(!r||!r.startsWith(`/`)||r.startsWith(`//`)||r.includes(`://`)||r.includes(`\\`))return t;let i=r.split(/[?#]/,1)[0]||`/`;return n.some(e=>i===e||i.startsWith(`${e}/`))?r:t}function vt(e,t){let n=t?.trim();if(!n)return e;let r=e.indexOf(`#`),i=r>=0?e.slice(0,r):e,a=r>=0?e.slice(r):``;return`${i}${i.includes(`?`)?`&`:`?`}returnTo=${encodeURIComponent(n)}${a}`}var yt=[`/notes/`,`/tasks/`,`/projects/`];function bt(e,t){let n=e.split(/[?#]/,1)[0]??``;if(!yt.some(e=>n.startsWith(e)))return e;let r=e.slice(n.length).split(`#`,1)[0];return new URLSearchParams(r.startsWith(`?`)?r.slice(1):r).has(`returnTo`)?e:vt(e,t)}function xt(){let e=(0,gt.c)(4),t=s(),n=o(),r;return e[0]!==t.pathname||e[1]!==t.search||e[2]!==n?(r=async e=>{let r=S(e);if(r.kind===`internal-route`)return n(bt(r.route,`${t.pathname}${t.search}`)),{ok:!0,kind:r.kind};if(r.kind===`external-http`){let e=await x(r.url);return e.ok?{ok:!0,kind:r.kind}:e}return{ok:!1,error:`Unsupported link`}},e[0]=t.pathname,e[1]=t.search,e[2]=n,e[3]=r):r=e[3],r}function St(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ct=St();function wt(e){Ct=e}var Tt={exec:()=>null};function Et(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function Dt(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(kt.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Ot=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),kt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Et(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Et(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Et(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:Et(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Et(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,`i`)),blockquoteBeginRegex:Et(e=>RegExp(`^ {0,${e}}>`))},At=/^(?:[ \t]*(?:\n|$))+/,jt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Mt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Nt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Pt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ft=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,It=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Lt=Dt(It).replace(/bull/g,Ft).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),Rt=Dt(It).replace(/bull/g,Ft).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),zt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Bt=/^[^\n]+/,Vt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ht=Dt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Vt).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ut=Dt(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ft).getRegex(),Wt=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,Gt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Kt=Dt(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,Gt).replace(`tag`,Wt).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),qt=Dt(zt).replace(`hr`,Nt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Wt).getRegex(),Jt={blockquote:Dt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,qt).getRegex(),code:jt,def:Ht,fences:Mt,heading:Pt,hr:Nt,html:Kt,lheading:Lt,list:Ut,newline:At,paragraph:qt,table:Tt,text:Bt},Yt=Dt(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Nt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Wt).getRegex(),Xt={...Jt,lheading:Rt,table:Yt,paragraph:Dt(zt).replace(`hr`,Nt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Yt).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Wt).getRegex()},Zt={...Jt,html:Dt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,Gt).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Tt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Dt(zt).replace(`hr`,Nt).replace(`heading`,` *#{1,6} *[^
|
|
4
4
|
]`).replace(`lheading`,Lt).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Qt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,$t=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,en=/^( {2,}|\\)\n(?!\s*$)/,tn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,nn=/[\p{P}\p{S}]/u,rn=/[\s\p{P}\p{S}]/u,an=/[^\s\p{P}\p{S}]/u,on=Dt(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,rn).getRegex(),sn=/(?!~)[\p{P}\p{S}]/u,cn=/(?!~)[\s\p{P}\p{S}]/u,ln=/(?:[^\s\p{P}\p{S}]|~)/u,un=Dt(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Ot?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),dn=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,fn=Dt(dn,`u`).replace(/punct/g,nn).getRegex(),pn=Dt(dn,`u`).replace(/punct/g,sn).getRegex(),mn=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,hn=Dt(mn,`gu`).replace(/notPunctSpace/g,an).replace(/punctSpace/g,rn).replace(/punct/g,nn).getRegex(),gn=Dt(mn,`gu`).replace(/notPunctSpace/g,ln).replace(/punctSpace/g,cn).replace(/punct/g,sn).getRegex(),_n=Dt(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,an).replace(/punctSpace/g,rn).replace(/punct/g,nn).getRegex(),see=Dt(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,nn).getRegex(),cee=Dt(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,an).replace(/punctSpace/g,rn).replace(/punct/g,nn).getRegex(),lee=Dt(/\\(punct)/,`gu`).replace(/punct/g,nn).getRegex(),uee=Dt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),dee=Dt(Gt).replace(`(?:-->|$)`,`-->`).getRegex(),fee=Dt(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,dee).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),vn=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,pee=Dt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,vn).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),yn=Dt(/^!?\[(label)\]\[(ref)\]/).replace(`label`,vn).replace(`ref`,Vt).getRegex(),bn=Dt(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Vt).getRegex(),xn=Dt(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,yn).replace(`nolink`,bn).getRegex(),Sn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Cn={_backpedal:Tt,anyPunctuation:lee,autolink:uee,blockSkip:un,br:en,code:$t,del:Tt,delLDelim:Tt,delRDelim:Tt,emStrongLDelim:fn,emStrongRDelimAst:hn,emStrongRDelimUnd:_n,escape:Qt,link:pee,nolink:bn,punctuation:on,reflink:yn,reflinkSearch:xn,tag:fee,text:tn,url:Tt},mee={...Cn,link:Dt(/^!?\[(label)\]\((.*?)\)/).replace(`label`,vn).getRegex(),reflink:Dt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,vn).getRegex()},wn={...Cn,emStrongRDelimAst:gn,emStrongLDelim:pn,delLDelim:see,delRDelim:cee,url:Dt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,Sn).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Dt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,Sn).getRegex()},hee={...wn,br:Dt(en).replace(`{2,}`,`*`).getRegex(),text:Dt(wn.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Tn={normal:Jt,gfm:Xt,pedantic:Zt},En={normal:Cn,gfm:wn,breaks:hee,pedantic:mee},gee={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},Dn=e=>gee[e];function On(e,t){if(t){if(kt.escapeTest.test(e))return e.replace(kt.escapeReplace,Dn)}else if(kt.escapeTestNoEncode.test(e))return e.replace(kt.escapeReplaceNoEncode,Dn);return e}function kn(e){try{e=encodeURI(e).replace(kt.percentDecode,`%`)}catch{return null}return e}function An(e,t){let n=e.replace(kt.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(kt.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(kt.slashPipe,`|`);return n}function jn(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Mn(e){let t=e.split(`
|
package/dist/gateway/static/root/assets/{media-plugins-1hJztT1f.js → media-plugins-BqXBeW_0.js}
RENAMED
|
@@ -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"./messages-
|
|
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"./messages-6j-AkWdj.js";import{a as i}from"./attachment-utils-core-BIOUBrpT.js";import{t as a}from"./preview-open-alternatives-bAtTMiqI.js";import{t as o}from"./use-blob-object-url-D4BFuzZB.js";var s=t();e();var c=n();function l(e){let t=(0,s.c)(2),n;return t[0]===e?n=t[1]:(n=(0,c.jsx)(d,{props:e,kind:`audio`}),t[0]=e,t[1]=n),n}function u(e){let t=(0,s.c)(2),n;return t[0]===e?n=t[1]:(n=(0,c.jsx)(d,{props:e,kind:`video`}),t[0]=e,t[1]=n),n}function d(e){let t=(0,s.c)(8),{props:n,kind:r}=e,a;bb0:{if(!n.binaryBuffer){a=null;break bb0}let e;if(t[0]!==r||t[1]!==n.binaryBuffer||t[2]!==n.descriptor.fileName||t[3]!==n.descriptor.mimeType){let a=i(n.descriptor.fileName)??n.descriptor.mimeType;e=new Blob([n.binaryBuffer],{type:a||`${r}/*`}),t[0]=r,t[1]=n.binaryBuffer,t[2]=n.descriptor.fileName,t[3]=n.descriptor.mimeType,t[4]=e}else e=t[4];a=e}let l=o(a);if(!l)return null;let u;return t[5]!==r||t[6]!==l?(u=(0,c.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto bg-surface-base p-4 dark:bg-surface-hover/20`,children:r===`audio`?(0,c.jsx)(`audio`,{src:l,controls:!0,className:`w-full max-w-2xl`}):(0,c.jsx)(`video`,{src:l,controls:!0,playsInline:!0,className:`max-h-full max-w-full rounded-md bg-black`})}),t[5]=r,t[6]=l,t[7]=u):u=t[7],u}function f(e){let t=(0,s.c)(12),n;t[0]===e.language?n=t[1]:(n=r(e.language),t[0]=e.language,t[1]=n);let i=n,o=e.descriptor.context===`workspace`,l=o?`${i.workspace.cannotPreviewType} ${i.workspace.openElsewhereHint}`:i.chat.attachmentPreviewOpenElsewhereHint,u=o?i.workspace.openSystemApp:void 0,d=o?i.workspace.chooseApp:void 0,f;return t[2]!==i.chat.attachmentPreviewDownloadFull||t[3]!==e.actions.canChooseOpenWithApp||t[4]!==e.actions.canOpenWithSystemApp||t[5]!==e.actions.onChooseOpenWithApp||t[6]!==e.actions.onDownload||t[7]!==e.actions.onOpenWithSystemApp||t[8]!==l||t[9]!==u||t[10]!==d?(f=(0,c.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-auto p-4`,children:(0,c.jsx)(a,{message:l,downloadLabel:i.chat.attachmentPreviewDownloadFull,onDownload:e.actions.onDownload,openSystemLabel:u,onOpenWithSystemApp:e.actions.onOpenWithSystemApp,canOpenWithSystemApp:e.actions.canOpenWithSystemApp,chooseAppLabel:d,onChooseOpenWithApp:e.actions.onChooseOpenWithApp,canChooseOpenWithApp:e.actions.canChooseOpenWithApp})}),t[2]=i.chat.attachmentPreviewDownloadFull,t[3]=e.actions.canChooseOpenWithApp,t[4]=e.actions.canOpenWithSystemApp,t[5]=e.actions.onChooseOpenWithApp,t[6]=e.actions.onDownload,t[7]=e.actions.onOpenWithSystemApp,t[8]=l,t[9]=u,t[10]=d,t[11]=f):f=t[11],f}export{l as AudioPreviewPluginView,f as UnsupportedPreviewPluginView,u as VideoPreviewPluginView};
|