@uniqbit/mate-core 1.0.0-canary.6 → 1.0.0-canary.8
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/claude-capability-plugins/companion-mentions/.claude-plugin/plugin.json +1 -1
- package/package.json +6 -3
- package/src/cli/commands/artifact/delivery/submit.ts +6 -4
- package/src/cli/commands/artifact/finish/command.ts +28 -11
- package/src/cli/commands/artifact/pending/command.ts +71 -7
- package/src/cli/commands/cap/tokensave.ts +2 -2
- package/src/cli/commands/companion/update.ts +2 -3
- package/src/cli/commands/doctor.ts +67 -4
- package/src/cli/commands/friction.ts +558 -0
- package/src/cli/commands/install.ts +8 -4
- package/src/cli/commands/plugin/install.ts +82 -35
- package/src/cli/commands/studio/connection.ts +53 -0
- package/src/cli/commands/studio/routes.ts +3 -0
- package/src/cli/commands/studio/selection.ts +10 -1
- package/src/cli/commands/studio/server.ts +31 -0
- package/src/cli/commands/studio/service-host.ts +3 -0
- package/src/cli/commands/studio/services.ts +25 -0
- package/src/cli/commands/triage.ts +172 -0
- package/src/cli/commands/vscode/release-vsix.json +2 -2
- package/src/cli/install-plan.tsx +3 -0
- package/src/cli/main.ts +85 -19
- package/src/cli/plugin-commands.ts +6 -1
- package/src/cli/usage.ts +12 -2
- package/src/create-mate.ts +11 -5
- package/src/distribution.ts +2 -0
- package/src/factory-host.ts +6 -0
- package/src/hooks/validate-artifact-path.ts +64 -14
- package/src/index.ts +1 -0
- package/src/lib/delivery/merge-git.ts +31 -7
- package/src/lib/delivery/overlap.ts +14 -1
- package/src/lib/delivery/repository-access.ts +11 -6
- package/src/lib/delivery/staging/apply-chain.ts +25 -7
- package/src/lib/delivery/staging/linked-merges.ts +175 -0
- package/src/lib/delivery/staging/naming.ts +3 -0
- package/src/lib/delivery/staging/openspec-type.ts +38 -7
- package/src/lib/delivery/staging/pending.ts +153 -11
- package/src/lib/delivery/staging/preflight.ts +239 -0
- package/src/lib/delivery/staging/project.ts +243 -104
- package/src/lib/delivery/staging/replay.ts +5 -3
- package/src/lib/delivery/staging/settle-linked.ts +5 -119
- package/src/lib/delivery/staging/submit.ts +139 -18
- package/src/lib/delivery/submit-change.ts +163 -37
- package/src/lib/friction/describe.ts +42 -0
- package/src/lib/friction/fields.ts +60 -0
- package/src/lib/friction/mark.ts +194 -0
- package/src/lib/friction/view/model.ts +67 -0
- package/src/lib/friction/view/read.ts +145 -0
- package/src/lib/friction/view/select.ts +54 -0
- package/src/lib/openspec-cli.ts +10 -5
- package/src/lib/orchestrator/adapters/claude.ts +5 -4
- package/src/lib/orchestrator/adapters/opencode.ts +2 -0
- package/src/lib/orchestrator/root-context.ts +23 -6
- package/src/lib/package-paths.ts +23 -15
- package/src/lib/session-attribution.ts +3 -7
- package/src/lib/skills-cli.ts +38 -0
- package/src/lib/tool-manifest.ts +73 -0
- package/src/lib/triage/context.ts +312 -0
- package/src/lib/triage/launch.ts +52 -0
- package/src/lib/triage/prepare.ts +112 -0
- package/src/lib/triage/session.ts +126 -0
- package/src/opencode/companion-hooks.ts +53 -5
- package/src/opencode/projected-guidance.ts +2 -0
- package/src/playbooks/companion-guidance.ts +2 -2
- package/src/plugin-api.ts +6 -0
- package/src/runtime/command-arg.ts +15 -0
- package/src/runtime/command-friction.ts +97 -0
- package/src/runtime/companion-guidance.ts +33 -16
- package/src/runtime/friction-fingerprint.ts +35 -0
- package/src/runtime/friction-log.ts +376 -0
- package/src/runtime/friction-recorder.ts +212 -0
- package/src/runtime/friction-retention.ts +1 -0
- package/src/runtime/friction-state.ts +110 -0
- package/src/runtime/friction-switch.ts +26 -0
- package/src/runtime/friction-vocabulary.ts +42 -0
- package/src/runtime/git-tracked.ts +13 -2
- package/src/runtime/projected-guidance.ts +2 -1
- package/src/runtime/secret-values.ts +16 -0
- package/src/runtime/session-id.ts +24 -0
- package/src/runtime/session-prepare-runner.ts +3 -0
- package/src/runtime/workflow/next-handoff-process.ts +2 -1
- package/src/studio.ts +47 -1
- package/src/templates/capabilities/openspec-cap/mate-minimal/schema.yaml +5 -1
- package/src/templates/capabilities/react-doctor/mate-react-doctor/SKILL.md +28 -0
- package/src/templates/mate-skills/agents/mate-apply-change/SKILL.md +42 -4
- package/src/templates/mate-skills/agents/mate-archive-change/SKILL.md +27 -2
- package/src/templates/mate-skills/agents/mate-backfill-spec/SKILL.md +23 -1
- package/src/templates/mate-skills/agents/mate-clarify-intent/SKILL.md +26 -1
- package/src/templates/mate-skills/agents/mate-domain-modeling/SKILL.md +28 -0
- package/src/templates/mate-skills/agents/mate-explore-change/SKILL.md +28 -3
- package/src/templates/mate-skills/agents/mate-grill-me/SKILL.md +28 -0
- package/src/templates/mate-skills/agents/mate-grill-with-docs/SKILL.md +28 -0
- package/src/templates/mate-skills/agents/mate-grilling/SKILL.md +25 -0
- package/src/templates/mate-skills/agents/mate-interview-me/SKILL.md +28 -0
- package/src/templates/mate-skills/agents/mate-propose-change/SKILL.md +28 -3
- package/src/templates/mate-skills/agents/mate-publish-artifact/SKILL.md +28 -6
- package/src/templates/mate-skills/agents/mate-show-me/SKILL.md +27 -2
- package/src/templates/mate-skills/agents/mate-simplify-code/SKILL.md +28 -0
- package/src/templates/mate-skills/agents/mate-submit-change/SKILL.md +24 -2
- package/src/templates/mate-skills/claude/mate-apply-change/SKILL.md +42 -4
- package/src/templates/mate-skills/claude/mate-archive-change/SKILL.md +27 -2
- package/src/templates/mate-skills/claude/mate-backfill-spec/SKILL.md +23 -1
- package/src/templates/mate-skills/claude/mate-clarify-intent/SKILL.md +26 -1
- package/src/templates/mate-skills/claude/mate-domain-modeling/SKILL.md +28 -0
- package/src/templates/mate-skills/claude/mate-explore-change/SKILL.md +28 -3
- package/src/templates/mate-skills/claude/mate-grill-me/SKILL.md +28 -0
- package/src/templates/mate-skills/claude/mate-grill-with-docs/SKILL.md +28 -0
- package/src/templates/mate-skills/claude/mate-grilling/SKILL.md +25 -0
- package/src/templates/mate-skills/claude/mate-interview-me/SKILL.md +28 -0
- package/src/templates/mate-skills/claude/mate-propose-change/SKILL.md +28 -3
- package/src/templates/mate-skills/claude/mate-publish-artifact/SKILL.md +28 -6
- package/src/templates/mate-skills/claude/mate-show-me/SKILL.md +27 -2
- package/src/templates/mate-skills/claude/mate-simplify-code/SKILL.md +28 -0
- package/src/templates/mate-skills/claude/mate-submit-change/SKILL.md +24 -2
- package/src/templates/triage/PLAYBOOK.md +120 -0
- package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +108 -108
- package/src/tools/setup/capabilities/graphify.ts +23 -1
- package/src/tools/setup/capabilities/rtk.ts +46 -94
- package/src/tools/setup/capabilities/tokensave.ts +76 -54
- package/src/tools/setup/dynamic-plugins/audiences.ts +28 -14
- package/src/tools/setup/dynamic-plugins/hydrate.ts +32 -14
- package/src/tools/setup/dynamic-plugins/install.ts +2 -0
- package/src/tools/setup/dynamic-plugins/installed.ts +73 -0
- package/src/tools/setup/dynamic-plugins/loader.ts +12 -10
- package/src/tools/setup/dynamic-plugins/local.ts +492 -0
- package/src/tools/setup/dynamic-plugins/paths.ts +34 -6
- package/src/tools/setup/dynamic-plugins/verify.ts +34 -14
- package/src/tools/setup/dynamic-plugins/workspaces.ts +17 -8
- package/src/tools/setup/mate.ts +26 -1
- package/src/tools/setup/plugin.ts +5 -0
- package/src/tools/setup/plugins/gitignore.ts +45 -12
- package/src/tools/setup/service.ts +12 -0
- package/src/tools/setup/utils.ts +10 -1
- package/src/tools/setup.ts +16 -2
- package/studio-dist/client/assets/app-ggXJ_QVh.css +2 -0
- package/studio-dist/client/assets/button-amJ3g5oD.js +1 -0
- package/studio-dist/client/assets/cn-BQPKiwI4.js +1 -0
- package/studio-dist/client/assets/combobox-CJ7aGFid.js +1 -0
- package/studio-dist/client/assets/{companion-view-BVaZNtiI.js → companion-view-C_N237bf.js} +1 -1
- package/studio-dist/client/assets/fields-BAiGkJ5N.js +1 -0
- package/studio-dist/client/assets/friction-DqOU59v7.js +1 -0
- package/studio-dist/client/assets/getting-started-djaQeWlu.js +1 -0
- package/studio-dist/client/assets/getting-started-yp42dj5S.js +1 -0
- package/studio-dist/client/assets/getting-started._topic-C9zVXz_m.js +1 -0
- package/studio-dist/client/assets/getting-started.index-DWbDKICP.js +1 -0
- package/studio-dist/client/assets/graph-BYaD_5Bq.js +2 -0
- package/studio-dist/client/assets/{graph-canvas-DDuzsNSx.js → graph-canvas-ySGKMhmk.js} +1 -1
- package/studio-dist/client/assets/guides-D6T6W_jV.js +1 -0
- package/studio-dist/client/assets/index-Qx7reRPD.js +40 -0
- package/studio-dist/client/assets/markdown-view-jMiaBTSO.js +1 -0
- package/studio-dist/client/assets/panel-C4bf_h2W.js +1 -0
- package/studio-dist/client/assets/plugins._service._view-y6f2FDAB.js +1 -0
- package/studio-dist/client/assets/prepaint-CKsXyJOR.js +27 -0
- package/studio-dist/client/assets/{queries-axYk2u9L.js → queries-Dfp5deWj.js} +1 -1
- package/studio-dist/client/assets/react-BYUSgtBs.js +1 -0
- package/studio-dist/client/assets/reports-JFSwSueq.js +1 -0
- package/studio-dist/client/assets/routes-BdOWSgzK.js +1 -0
- package/studio-dist/client/assets/search-CXosfvYh.js +1 -0
- package/studio-dist/client/assets/select-BHYYWPhK.js +1 -0
- package/studio-dist/client/assets/skills-Bo9FLsBd.js +1 -0
- package/studio-dist/client/assets/{specs-DU1kqcp5.js → specs-BrCOjOch.js} +1 -1
- package/studio-dist/client/assets/specs-view-CdE2rlli.js +1 -0
- package/studio-dist/client/assets/{steps-DhIFuAZy.js → steps-CKUno4lh.js} +1 -1
- package/studio-dist/client/assets/store-C3vJq8Wj.js +1 -0
- package/studio-dist/client/assets/{studio-BR9j15J0.js → studio-0ueISxwP.js} +8 -8
- package/studio-dist/client/assets/{studio-queries-CFP_yTpr.js → studio-queries-BflKt9va.js} +2 -2
- package/studio-dist/client/assets/{usage-CHmwtkoM.js → usage-BLsLy0nN.js} +16 -16
- package/studio-dist/client/assets/useAnchoredPopupScrollLock-DC7f8GOp.js +1 -0
- package/studio-dist/client/assets/useMutation-uJUrejsi.js +1 -0
- package/studio-dist/client/assets/vault-BB1B_OhR.js +1 -0
- package/studio-dist/client/assets/warnings-CqOOGlPD.js +1 -0
- package/studio-dist/client/assets/workflow-BFzmI-06.js +1 -0
- package/studio-dist/server/assets/{__23tanstack-start-server-fn-resolver-DAbZ6fzY.js → __23tanstack-start-server-fn-resolver-gVfW5vIV.js} +30 -14
- package/studio-dist/server/assets/_tanstack-start-manifest_v.js +66 -50
- package/studio-dist/server/assets/{button-BfoNadNR.js → button-D6bvrFmm.js} +226 -3478
- package/studio-dist/server/assets/cn-FXJAM0KO.js +5528 -0
- package/studio-dist/server/assets/combobox-D2MbYV1O.js +484 -0
- package/studio-dist/server/assets/{companion-view-DHUjPpA0.js → companion-view-Mf1ANbMb.js} +2 -2
- package/studio-dist/server/assets/{companions-kBrJZAd6.js → companions-Dr6IpNAb.js} +1 -1
- package/studio-dist/server/assets/{fields-BD_c65T1.js → fields-B4mAPETz.js} +2 -1
- package/studio-dist/server/assets/friction-9a5S1m7U.js +943 -0
- package/studio-dist/server/assets/friction-CWOTjpCV.js +62 -0
- package/studio-dist/server/assets/{getting-started-7P0oyWaM.js → getting-started-RU6tYU2Q.js} +2 -2
- package/studio-dist/server/assets/{getting-started._topic-B1mV0kGz.js → getting-started._topic-C02HGrC6.js} +2 -2
- package/studio-dist/server/assets/{getting-started.index-CeGtvUsm.js → getting-started.index-EzLRosbb.js} +2 -2
- package/studio-dist/server/assets/{graph-BWtmJOH2.js → graph-B11ITte0.js} +1 -1
- package/studio-dist/server/assets/{graph-DSDVEELZ.js → graph-CZ2H9Fzr.js} +8 -8
- package/studio-dist/server/assets/{graph-canvas-CID9Nksc.js → graph-canvas-rP5TT14Z.js} +2 -2
- package/studio-dist/server/assets/{guides-Bm3RbUB-.js → guides-B8HdeK_C.js} +1 -1
- package/studio-dist/server/assets/{guides-BLJenHwQ.js → guides-BGftp4wf.js} +1 -1
- package/studio-dist/server/assets/{guides.server-rHHqRuzV.js → guides.server-DqFQAStf.js} +1 -1
- package/studio-dist/server/assets/{markdown-view-D3v9x-cM.js → markdown-view-CArpV-CS.js} +1 -1
- package/studio-dist/server/assets/{panel-yqOl5GMU.js → panel-DR0iq46J.js} +4 -3
- package/studio-dist/server/assets/{plugins._service._view-DwqJX7s9.js → plugins._service._view-n7u2k5dF.js} +11 -6
- package/studio-dist/server/assets/prepaint-B28ClcPN.js +45 -0
- package/studio-dist/server/assets/{queries-DYmGrhNO.js → queries-D-yVP9i0.js} +1 -1
- package/studio-dist/server/assets/react-CiBZPDs8.js +45 -0
- package/studio-dist/server/assets/{reports-C4Y_Jd-x.js → reports-B9k98oE6.js} +1 -1
- package/studio-dist/server/assets/{reports-7yaPz7aP.js → reports-C2SmTgqh.js} +7 -7
- package/studio-dist/server/assets/{router-Dnoq5auE.js → router-CPt0TAk_.js} +654 -1565
- package/studio-dist/server/assets/{routes-Cok4p3mK.js → routes-CwH8LEy2.js} +8 -8
- package/studio-dist/server/assets/{search-DUK7Jl6f.js → search-b-yQesv3.js} +25 -2
- package/studio-dist/server/assets/{combobox-oxUI6r4V.js → select-C3i6TTX-.js} +35 -514
- package/studio-dist/server/assets/{shell-DNVXedgE.js → shell-CagqZZMZ.js} +4 -3
- package/studio-dist/server/assets/{skills-D8qdXSku.js → skills-C21Mg_8-.js} +8 -8
- package/studio-dist/server/assets/{skills-pKmuAs0F.js → skills-DGg0mWDM.js} +1 -1
- package/studio-dist/server/assets/{specs-DeHYUNFp.js → specs-DetoMiaB.js} +4 -4
- package/studio-dist/server/assets/{specs-view-BGn-5Ik_.js → specs-view-CmbfLDwN.js} +10 -9
- package/studio-dist/server/assets/{steps-CV7Yk7L7.js → steps-D1tYAyWZ.js} +1 -1
- package/studio-dist/server/assets/store-aC-I6f6o.js +93 -0
- package/studio-dist/server/assets/{studio-CB94np48.js → studio-qRvQjRpz.js} +47 -2
- package/studio-dist/server/assets/{studio-queries-BqZGBE70.js → studio-queries-Dqf-3nzj.js} +66 -8
- package/studio-dist/server/assets/{usage-M6Gi6Km7.js → usage-CS4CBK9D.js} +13 -44
- package/studio-dist/server/assets/{usage-j5jR9gX9.js → usage-Cwle9-xY.js} +1 -1
- package/studio-dist/server/assets/useAnchoredPopupScrollLock-BjMNgXv9.js +756 -0
- package/studio-dist/server/assets/useMutation-DpBIuWXt.js +690 -0
- package/studio-dist/server/assets/{vault-lBlvSyD4.js → vault-CEBBRLMb.js} +1 -1
- package/studio-dist/server/assets/{vault-PqVmssmW.js → vault-DVQidlId.js} +6 -6
- package/studio-dist/server/assets/{views-CsFp1i1G.js → views-UgO0Qz_g.js} +2 -2
- package/studio-dist/server/assets/{warnings-BDs34j_m.js → warnings-C7hgXpdk.js} +2 -2
- package/studio-dist/server/assets/{workflow-T0eEldsa.js → workflow-6dZZ1ofw.js} +9 -9
- package/studio-dist/server/server.js +2 -2
- package/tool-manifest.yaml +85 -0
- package/studio-dist/client/assets/app-BFVyWHGo.css +0 -2
- package/studio-dist/client/assets/button-D6LrRkOG.js +0 -1
- package/studio-dist/client/assets/combobox-Dk2MMZWE.js +0 -1
- package/studio-dist/client/assets/fields-D_FYhxQr.js +0 -1
- package/studio-dist/client/assets/getting-started-ByWRg7hC.js +0 -1
- package/studio-dist/client/assets/getting-started-DZSjYC-b.js +0 -1
- package/studio-dist/client/assets/getting-started._topic-C6OyQ4G6.js +0 -1
- package/studio-dist/client/assets/getting-started.index-BkmPHdEm.js +0 -1
- package/studio-dist/client/assets/graph-7jm2XzyL.js +0 -2
- package/studio-dist/client/assets/guides-D9VTjWXP.js +0 -1
- package/studio-dist/client/assets/index-BBmFpG4y.js +0 -40
- package/studio-dist/client/assets/markdown-view-RL5YvfZg.js +0 -1
- package/studio-dist/client/assets/panel-B8F8sOKQ.js +0 -1
- package/studio-dist/client/assets/plugins._service._view-CynxTbMx.js +0 -1
- package/studio-dist/client/assets/react-r45OnJCw.js +0 -27
- package/studio-dist/client/assets/reports-BCAyXh6p.js +0 -1
- package/studio-dist/client/assets/routes-BFPqq89E.js +0 -1
- package/studio-dist/client/assets/skills-DTks_uBx.js +0 -1
- package/studio-dist/client/assets/specs-view-omrd_5P3.js +0 -1
- package/studio-dist/client/assets/store-DJ5cncKA.js +0 -1
- package/studio-dist/client/assets/useBaseQuery-BlC-AZ35.js +0 -1
- package/studio-dist/client/assets/vault-DRg8MScm.js +0 -1
- package/studio-dist/client/assets/warnings-UHFy6HAp.js +0 -1
- package/studio-dist/client/assets/workflow-Bv9vSfVV.js +0 -1
- package/studio-dist/server/assets/react-BO0uMhpm.js +0 -89
- package/studio-dist/server/assets/store-CWDGIp6x.js +0 -280
- package/studio-dist/server/assets/useBaseQuery-Tv_QJt9r.js +0 -2051
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t,t as n}from"./jsx-runtime-MZURdZre.js";import{$t as r,Bt as i,Cn as a,Fn as o,Ft as s,G as c,Gn as l,H as u,Hn as d,Jn as f,Kn as p,L as m,M as h,Mn as g,On as _,Pn as v,Qt as y,Rt as b,S as x,Sn as S,T as C,Tr as w,Ut as T,V as E,Vn as D,W as O,Wn as k,Wt as A,Xt as j,Y as M,Yn as N,_n as P,_r as F,_t as I,a as L,br as R,f as z,gr as B,hn as V,hr as H,ht as U,ir as W,jn as ee,l as te,mn as ne,mr as G,nt as K,on as re,or as q,pn as J,q as ie,qn as Y,r as ae,rt as X,tt as oe,vr as se,w as ce,wr as le,x as ue,xn as de,xr as fe}from"./button-D6LrRkOG.js";import{_ as pe,a as me,c as he,d as ge,g as _e,l as ve,m as ye,o as be,s as xe,u as Se,v as Ce}from"./fields-D_FYhxQr.js";import{$ as we,A as Te,B as Ee,F as De,G as Oe,H as ke,I as Ae,J as je,K as Me,L as Ne,M as Z,N as Pe,P as Fe,Q as Ie,R as Le,U as Re,V as ze,W as Be,X as Ve,Y as He,Z as Ue,_t as We,at as Ge,dt as Ke,et as qe,ft as Je,gt as Ye,ht as Xe,it as Ze,j as Qe,mt as $e,nt as et,ot as tt,pt as nt,q as rt,rt as it,tt as at,z as ot}from"./index-BBmFpG4y.js";var Q=e(t(),1);function st(e,t){let{listRef:n,elementsRef:r,activeIndex:a,onMatch:o,disabledIndices:s,onTyping:c,enabled:l=!0,resetMs:u=750,selectedIndex:d=null}=t,p=N(c),m=e.useState(`open`),h=M(),g=Q.useRef(``),_=Q.useRef(d??a??-1),v=Q.useRef(null),y=N(e=>{function t(e){return r?.current[e]}function c(e){let n=t(e);return n&&!U(n)||n?.matches(`:disabled`)?!1:s==null||!I(B,e,s)}function l(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&c(n))return n}return-1}let f=n.current;if(g.current.length>0&&e.key===` `&&(i(e),p?.(!0)),g.current.length>0&&g.current[0]!==` `&&l(f,g.current)===-1&&e.key!==` `&&p?.(!1),f==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;m&&e.key!==` `&&(i(e),p?.(!0));let y=g.current===``;y&&(_.current=d??a??-1),f.every((e,t)=>e&&c(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&g.current===e.key&&(g.current=``,_.current=v.current),g.current+=e.key,h.start(u,()=>{g.current=``,_.current=v.current,p?.(!1)});let b=((y?d??a??-1:_.current)??0)+1,x=l(f,g.current,b);x===-1?e.key!==` `&&(g.current=``,p?.(!1)):(o?.(x,e),v.current=x)}),b=N(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);J(r,n)||J(i,n)||(h.clear(),g.current=``,_.current=v.current,p?.(!1))});f(()=>{(m||d===null)&&(h.clear(),v.current=null,g.current!==``&&(g.current=``,p?.(!1)))},[m,d,h,p]);let x=Q.useMemo(()=>({onKeyDown:y,onBlur:b}),[y,b]);return Q.useMemo(()=>l?{reference:x,floating:x}:{},[l,x])}var $=n();function ct(e){let[t,n]=Q.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}var lt=5;function ut(e,t){let n=dt(t);return e.clientX>=n.left-lt&&e.clientX<=n.right+lt&&e.clientY>=n.top-lt&&e.clientY<=n.bottom+lt}function dt(e){let t=e.getBoundingClientRect(),n=W(e);if(V)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function ft(e,t){return e??t}var pt=Q.forwardRef(function(e,t){let{render:n,className:r,nativeButton:s=!0,disabled:c=!1,id:u,style:f,...m}=e,{state:h,disabled:g,setTouched:_,validationMode:y,validation:b}=ye(),{labelId:x}=ve(),S=Ge(),C=S.useState(`selectionMode`),w=S.useState(`disabled`),T=S.useState(`readOnly`),E=S.useState(`required`),D=S.useState(`positionerElement`),O=S.useState(`listElement`),k=S.useState(`popupId`),A=S.useState(`triggerProps`),j=S.useState(`inputInsidePopup`),P=S.useState(`id`),F=S.useState(`labelId`),I=S.useState(`open`),L=S.useState(`selectedValue`),R=S.useState(`activeIndex`),z=S.useState(`selectedIndex`),B=S.useState(`hasSelectedValue`),V=it(),H=Ze(),U=M(),W=g||w||c,ee=ot(),te=Ee(S),K=Q.useRef(null),re=be(W,K);he({id:j?u:void 0});let q=j?u??P:u,ie=ft(x,F),Y;I&&j?Y=k??Be(P):I&&(Y=O?.id);let ae=Q.useRef(``);function X(e){ae.current=e.pointerType}let{reference:oe}=st(V,{enabled:!I&&!T&&!w&&C===`single`,listRef:S.context.labelsRef,activeIndex:R,selectedIndex:z,onMatch(e){let t=S.context.valuesRef.current[e];t!==void 0&&S.context.setSelectedValue(t,d(o))}}),{reference:se}=We(V,{enabled:!w,event:`mousedown`}),{buttonRef:ce,getButtonProps:le}=l({native:s,disabled:W}),ue={...h,readOnly:T,open:I,disabled:W,popupSide:te,listEmpty:ee,placeholder:C!==`none`&&!B},de=N(e=>{S.set(`triggerElement`,e)});return G(`button`,e,{ref:[t,ce,K,de],state:ue,props:[A,se,oe,{id:q,tabIndex:j?0:-1,role:j?`combobox`:void 0,"aria-expanded":I,"aria-haspopup":j?`dialog`:`listbox`,"aria-controls":Y,"aria-required":j&&E||void 0,"aria-readonly":j&&T||void 0,"aria-labelledby":ie,onPointerDown:X,onPointerEnter:X,onFocus(){re(!0),W||U.start(0,S.context.forceMount)},onBlur(e){if(!J(D,e.relatedTarget)&&(_(!0),re(!1),y===`onBlur`)){let e=C===`none`?H:L;b.commit(e)}},onMouseDown(e){if(W||(j||V.set(`domReferenceElement`,e.currentTarget),S.context.forceMount(),ae.current!==`touch`&&(S.context.inputRef.current?.focus(),j||e.preventDefault()),I))return;let t=p(e.currentTarget);function n(e){let t=S.state.triggerElement;if(!t)return;let n=ne(e),r=S.state.positionerElement,i=S.state.listElement;J(t,n)||J(r,n)||J(i,n)||ut(e,t)||S.context.setOpen(!1,d(a,e))}j&&t.addEventListener(`mouseup`,n,{once:!0})},onKeyDown(e){(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(i(e),S.context.setOpen(!0,d(v,e.nativeEvent)),S.context.inputRef.current?.focus())}},b.getValidationProps(W,m),le],stateAttributesMapping:ze})});function mt(e,t,n,r){if(e.baseUIHandlerPrevented)return;let i=ne(e.nativeEvent),a=q(i)?i:null;(a===e.currentTarget||!r?.(a)&&!A(a))&&(e.preventDefault(),n||(t.context.inputRef.current?.focus(),t.state.openOnInputClick&&t.context.setOpen(!0,d(ee,e.nativeEvent))))}var ht=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=ye(),s=Ge(),c=s.useState(`open`),l=s.useState(`disabled`),u=s.useState(`readOnly`),d=s.useState(`hasSelectedValue`),f=s.useState(`selectionMode`),p=Ee(s),m=l,h=ot(),g=f!==`none`&&!d,_={...o,open:c,disabled:m,readOnly:u,popupSide:p,listEmpty:h,placeholder:g},v=N(e=>{s.set(`inputGroupElement`,e)});return G(`div`,e,{ref:[t,v],props:[{role:`group`,onMouseDown(e){mt(e,s,m,e=>J(s.context.chipsContainerRef.current,e))}},a],state:_,stateAttributesMapping:ze})}),gt=Q.createContext(void 0);function _t(){let e=Q.useContext(gt);if(e===void 0)throw Error(Y(20));return e}var vt=Q.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=Ge(),a=i.useState(`mounted`),o=i.useState(`forceMounted`);return a||n||o?(0,$.jsx)(gt.Provider,{value:n,children:(0,$.jsx)(h,{ref:t,...r})}):null}),yt=Q.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:p,sticky:h,disableAnchorTracking:g=!1,collisionAvoidance:_=m,style:v,...y}=e,b=Ge(),x=it(),S=_t(),C=b.useState(`modal`),w=b.useState(`open`),T=b.useState(`mounted`),E=b.useState(`openMethod`),D=b.useState(`positionerElement`),O=b.useState(`triggerElement`),k=b.useState(`inputElement`),A=b.useState(`inputGroupElement`),j=b.useState(`inputInsidePopup`),M=b.useState(`transitionStatus`),P=ot(),F=nt({anchor:i??(j?O:A??k),floatingRootContext:x,positionMethod:a,mounted:T,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:p,collisionBoundary:u,collisionPadding:d,sticky:h,disableAnchorTracking:g,keepMounted:S,collisionAvoidance:_,lazyFlip:!0});Pe(w&&C,E===`touch`,D,O);let I={open:w,side:F.side,align:F.align,anchorHidden:F.anchorHidden,empty:P};f(()=>{b.set(`popupSide`,F.side)},[b,F.side]);let L=N(e=>{b.set(`positionerElement`,e)}),R=Ke(e,I,{styles:F.positionerStyles,transitionStatus:M,props:y,refs:[t,L],hidden:!T,inert:!w});return(0,$.jsxs)(Ne.Provider,{value:F,children:[T&&C&&(0,$.jsx)(me,{inert:pe(!w),cutout:A??k??O}),R]})}),bt={...j,...re},xt=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=Ge(),l=Le(),u=it(),d=c.useState(`mounted`),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`popupProps`),g=c.useState(`transitionStatus`),_=c.useState(`inputInsidePopup`),v=c.useState(`inputElement`),y=c.useState(`modal`),b=c.useState(`id`),S=ot(),C=s.id??(_?Be(b):void 0);f(()=>(c.set(`popupId`,c.context.popupRef.current?.id||C),()=>{c.set(`popupId`,void 0)}),[c,C]),x({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete(!0)}});let w={open:p,side:l.side,align:l.align,anchorHidden:l.anchorHidden,transitionStatus:g,empty:S},T=G(`div`,e,{state:w,ref:[t,c.context.popupRef],props:[h,{id:C,role:_?`dialog`:`presentation`,onFocus(e){let t=ne(e.nativeEvent);m!==`touch`&&(J(c.state.listElement,t)||t===e.currentTarget)&&c.context.inputRef.current?.focus()}},Je(g),s],stateAttributesMapping:bt}),E=a===void 0?_?e=>e===`touch`?c.context.popupRef.current:v:!1:a,D;D=o??(_?void 0:!1);let O=!_||y;return(0,$.jsx)(Ce,{context:u,disabled:!d,modal:O,openInteractionType:m,initialFocus:E,returnFocus:D,getInsideElements:()=>[c.context.startDismissRef.current,c.context.endDismissRef.current],children:(0,$.jsxs)(Q.Fragment,{children:[T,O&&(0,$.jsx)(Ae,{ref:c.context.endDismissRef})]})})});function St(e){let{multiple:t=!1,defaultValue:n,value:r,onValueChange:i,autoComplete:a,...o}=e;return(0,$.jsx)(ke,{...o,selectionMode:t?`multiple`:`single`,selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:i,formAutoComplete:a})}var Ct=Q.memo(Q.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a,selected:o,...s}=e,c=Q.useRef(null),{transitionStatus:l,setMounted:u}=ce(o),d=G(`span`,e,{ref:[t,c],state:{selected:o,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},s],stateAttributesMapping:re});return x({batch:!0,enabled:!o,open:o,ref:c,onComplete(){o||u(!1)}}),d})),wt=Q.forwardRef(function(e,t){let{selected:n}=Z();return e.keepMounted||n?(0,$.jsx)(Ct,{...e,selected:n,ref:t}):null}),Tt=Q.createContext(void 0),Et=Q.createContext(void 0);function Dt(){let e=Q.useContext(Tt);if(e===void 0)throw Error(Y(60));return e}function Ot(){let e=Q.useContext(Et);if(e===void 0)throw Error(Y(61));return e}var kt={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,multiple:e=>e.multiple,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,highlightItemOnHover:e=>e.highlightItemOnHover,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:He(t,r)!==``},hasNullItemLabel:(e,t)=>t?Oe(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>Ve(t,e,n)):Ve(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function At(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function jt(e,t){return Math.max(0,e-t)}function Mt(e,t){if(t<=0)return 0;let n=At(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function Nt(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:s=!1,onOpenChange:l,name:p,form:m,autoComplete:h,disabled:g=!1,readOnly:v=!1,required:y=!1,modal:b=!0,actionsRef:x,inputRef:S,onOpenChangeComplete:w,items:T,multiple:D=!1,itemToStringLabel:O,itemToStringValue:k,isItemEqualToValue:A=Ue,highlightItemOnHover:j=!0,children:M}=e,{clearErrors:P}=Se(),{setDirty:I,setTouched:V,setFocused:U,validityData:W,setFilled:ee,name:ne,disabled:G,validation:K,validationMode:re}=ye(),q=he({id:t}),J=G||g,ie=ne??p,[Y,ae]=le({controlled:n,default:D?r??B:r,name:`Select`,state:`value`}),[X,oe]=le({controlled:a,default:s,name:`Select`,state:`open`}),ce=Q.useRef([]),pe=Q.useRef([]),me=Q.useRef(null),_e=Q.useRef(null),ve=Q.useRef(0),be=Q.useRef(null),Ce=Q.useRef([]),Te=Q.useRef(!1),Ee=Q.useRef(null),De=Q.useRef(null),Oe=Q.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),ke=Q.useRef(!1),Ae=Q.useRef(Y),{openMethod:Me,triggerProps:Ne}=Re(X),Z=fe(()=>new L({id:q,labelId:void 0,modal:b,multiple:D,disabled:J,readOnly:v,required:y,highlightItemOnHover:j,itemToStringLabel:O,itemToStringValue:k,isItemEqualToValue:A,value:Y,open:X,mounted:X,transitionStatus:void 0,items:T,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:F,triggerProps:F,itemRoot:{props:F,multiple:D,disabled:J,readOnly:v,isItemEqualToValue:A},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:se,setOpen:se,handleScrollArrowVisibility:se,onOpenChangeComplete:se,listRef:ce,popupRef:me,scrollHandlerRef:_e,scrollArrowsMountedCountRef:ve,valueRef:be,valuesRef:Ce,labelsRef:pe,typingRef:Te,selectionRef:Oe,firstItemTextRef:Ee,selectedItemTextRef:De,alignItemWithTriggerActiveRef:ke,initialValueRef:Ae},kt)).current,[Pe,Fe]=Q.useState(!1),{mounted:Ie,transitionStatus:Le,forceUnmount:ze}=ue({open:X,ref:me,preventUnmountOnClose:Pe,setPreventUnmountOnClose:Fe,onUnmount(){Z.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),w?.(!1)}}),Be=Z.useState(`activeIndex`),Ve=Z.useState(`selectedIndex`),Ge=Z.useState(`triggerElement`),Ke=Z.useState(`positionerElement`),Je=ct(Me),Ze=Me??Je,Qe=Q.useMemo(()=>D?``:He(Y,k),[D,Y,k]),$e=Q.useMemo(()=>D&&Array.isArray(Y)?Y.map(e=>He(e,k)):He(Y,k),[D,Y,k]),et=c(Ge),nt=N(()=>$e);ge(et,q,Y,nt,!J,p);let rt=D?Array.isArray(Y)&&Y.length>0:Y!=null&&Qe!==``;f(()=>{ee(rt)},[rt,ee]),f(function(){let e=we(Ce.current,Y,A,D);e===null&&(De.current=null),X||Z.set(`selectedIndex`,e)},[D,X,Y,A,Z]),xe(Y,()=>{P(ie),I(qe(Y,W.initialValue,A)),K.change(Y)});let it=N((e,t)=>{let n=t,r=z(n);l?.(e,n),t.isCanceled||(e||Fe(r()),oe(e),e||t.reason!==`focus-out`&&t.reason!==`outside-press`||(V(!0),U(!1),re===`onBlur`&&K.commit(Y)))});Q.useImperativeHandle(x,()=>({unmount:ze,close:()=>{Z.state.open&&it(!1,d(_))}}),[ze,it,Z]);let at=N((e,t)=>{i?.(e,t),t.isCanceled||ae(e)}),ot=N(e=>{let t=jt(e.scrollHeight,e.clientHeight),n=Mt(e.scrollTop,t),r=n>0,i=n<t;Z.set(`scrollUpArrowVisible`,r),Z.set(`scrollDownArrowVisible`,i)}),lt=Ye({open:X,onOpenChange:it,elements:{reference:Ge,floating:Ke}}),ut=We(lt,{enabled:!J,event:`mousedown`}),dt=C(lt),ft=Xe(lt,{enabled:!J,listRef:ce,activeIndex:Be,selectedIndex:Ve,disabledIndices:B,onNavigate(e){(e!==null||X)&&Z.set(`activeIndex`,e)},focusItemOnHover:j}),pt=st(lt,{enabled:!J&&(X||!v&&!D),listRef:pe,activeIndex:Be,selectedIndex:Ve,disabledIndices:e=>de(ce.current[e]),onMatch(e){X?Z.set(`activeIndex`,e):at(Ce.current[e],d(o))},onTyping(e){Te.current=e}}),mt=Q.useMemo(()=>H(pt.reference,ft.reference,dt.reference,ut.reference,Ne),[ut.reference,pt.reference,ft.reference,dt.reference,Ne]),ht=Q.useMemo(()=>H(te,pt.floating,ft.floating,dt.floating),[pt.floating,ft.floating,dt.floating]),gt=ft.item??F,_t=Q.useMemo(()=>({props:gt,multiple:D,disabled:J,readOnly:v,isItemEqualToValue:A}),[gt,D,J,v,A]);Z.useContextCallback(`setValue`,at),Z.useContextCallback(`setOpen`,it),Z.useContextCallback(`handleScrollArrowVisibility`,ot),Z.useContextCallback(`onOpenChangeComplete`,w),tt(()=>{Z.update({popupProps:ht,triggerProps:mt,itemRoot:_t})}),Z.useSyncedValues({id:q,modal:b,multiple:D,disabled:J,readOnly:v,required:y,highlightItemOnHover:j,value:Y,open:X,mounted:Ie,transitionStatus:Le,popupProps:ht,triggerProps:mt,itemRoot:_t,items:T,itemToStringLabel:O,itemToStringValue:k,isItemEqualToValue:A,openMethod:Ze});let vt=R(S,K.inputRef),yt=D?void 0:ie,bt=Q.useMemo(()=>!D||!Array.isArray(Y)||!ie?null:Y.map(e=>{let t=He(e,k);return(0,$.jsx)(`input`,{type:`hidden`,form:m,name:ie,value:t,disabled:J},t)}),[D,Y,m,ie,k,J]);return(0,$.jsxs)(Tt.Provider,{value:Z,children:[(0,$.jsx)(Et.Provider,{value:lt,children:M}),(0,$.jsx)(`input`,{...K.getValidationProps(J,{onFocus(){Z.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||J||v)return;let t=e.currentTarget.value,n=d(o,e.nativeEvent);function r(){if(D)return;let e=t.toLowerCase(),r=Ce.current.findIndex(t=>He(t,k).toLowerCase()===e||je(t,O).toLowerCase()===e);r===-1&&(r=Ce.current.findIndex((t,n)=>{let r=pe.current[n];return r!=null&&r.toLowerCase()===e}));let i=Ce.current[r];i!=null&&at(i,n)}Z.set(`forceMount`,!0),queueMicrotask(r)}}),id:q&&yt==null?`${q}-hidden-input`:void 0,form:m,name:yt,autoComplete:h,value:Qe,disabled:J,required:y&&!(D&&rt),readOnly:v,ref:vt,style:ie?u:E,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),bt]})}var Pt=`data-popup-side`,Ft=400,It={...y,..._e,popupSide:e=>e?{[Pt]:e}:null,value:()=>null},Lt=Q.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:s=!1,nativeButton:u=!0,style:f,...m}=e,{setTouched:h,validationMode:g,validation:_,state:v,disabled:y}=ye(),{labelId:b}=ve(),x=Dt(),S=x.useState(`readOnly`),C=x.useState(`required`),w=x.useState(`disabled`),E=y||w||s,D=x.useState(`open`),O=x.useState(`mounted`),k=x.useState(`value`),A=x.useState(`triggerProps`),j=x.useState(`positionerElement`),N=x.useState(`listElement`),P=x.useState(`popupSide`),F=x.useState(`id`),I=x.useState(`labelId`),L=x.useState(`hasSelectedValue`),R=O&&j?P:null,z=i??F,B=ft(b,I);he({id:i});let V=c(j),U=Q.useRef(null),W=be(E,U),{getButtonProps:ee,buttonRef:te}=l({disabled:E,native:u}),ne=x.useStateSetter(`triggerElement`),K=M(),re=M(),q=M();Q.useEffect(()=>{if(D)return q.start(Ft,()=>{x.context.selectionRef.current.allowUnselectedMouseUp=!0,x.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{q.clear()};x.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},re.clear()},[D,x,re,q]);let ie=H(A,{id:z,role:`combobox`,"aria-expanded":D,"aria-haspopup":`listbox`,"aria-controls":D?N?.id??T(j)?.id:void 0,"aria-labelledby":B,"aria-readonly":S||void 0,"aria-required":C||void 0,tabIndex:E?-1:0,onFocus(e){W(!0),D&&x.context.alignItemWithTriggerActiveRef.current&&x.context.setOpen(!1,d(o,e.nativeEvent)),K.start(0,()=>{x.set(`forceMount`,!0)})},onBlur(e){J(j,e.relatedTarget)||(h(!0),W(!1),g===`onBlur`&&_.commit(k))},onMouseDown(e){if(D)return;let t=p(e.currentTarget);function n(e){if(!U.current)return;let t=e.target;J(U.current,t)||J(V.current,t)||ut(e,U.current)||x.context.setOpen(!1,d(a,e))}re.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},m,ee),Y=_.getValidationProps(E,ie);Y.role=`combobox`;let ae={...v,open:D,disabled:E,value:k,readOnly:S,popupSide:R,placeholder:!L};return G(`button`,e,{ref:[t,U,te,ne],state:ae,stateAttributesMapping:It,props:Y})}),Rt={value:()=>null},zt=Q.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=Dt(),l=c.useState(`value`),u=c.useState(`items`),d=c.useState(`itemToStringLabel`),f=c.useState(`hasSelectedValue`),p=!f&&a!=null&&i==null,m=c.useState(`hasNullItemLabel`,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(p&&!m?a:Array.isArray(l)?Me(l,u,d):rt(l,u,d)),G(`span`,e,{state:h,ref:[t,c.context.valueRef],props:[{children:g},s],stateAttributesMapping:Rt})}),Bt=Q.forwardRef(function(e,t){let{render:n,className:i,style:a,...o}=e,s={open:Dt().useState(`open`)};return G(`span`,e,{state:s,ref:t,props:[{"aria-hidden":!0,children:`▼`},o],stateAttributesMapping:r})}),Vt=Q.forwardRef(function(e,t){let n=Dt(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,$.jsx)(h,{ref:t,...e}):null}),Ht=Q.createContext(void 0);function Ut(){let e=Q.useContext(Ht);if(!e)throw Error(Y(59));return e}function Wt(e,t){e&&Object.assign(e.style,t)}var Gt={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},Kt={position:`fixed`},qt=Q.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:p=`clipping-ancestors`,collisionPadding:h,arrowPadding:g,sticky:_,disableAnchorTracking:v,alignItemWithTrigger:y=!0,collisionAvoidance:b=m,style:x,...C}=e,w=Dt(),T=Ot(),E=w.useState(`open`),D=w.useState(`mounted`),O=w.useState(`modal`),k=w.useState(`value`),A=w.useState(`openMethod`),j=w.useState(`positionerElement`),M=w.useState(`triggerElement`),P=w.useState(`isItemEqualToValue`),F=w.useState(`transitionStatus`),I=Q.useRef(null),L=Q.useRef(null),[R,z]=Q.useState(y),B=D&&R&&A!==`touch`;!D&&R!==y&&z(y),Q.useImperativeHandle(w.context.alignItemWithTriggerActiveRef,()=>B),Pe((B||O)&&E,A===`touch`,j,M);let V=nt({anchor:n,floatingRootContext:T,positionMethod:a,mounted:D,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:g,collisionBoundary:p,collisionPadding:h,sticky:_,disableAnchorTracking:v??B,collisionAvoidance:b,keepMounted:!0}),H=B?`none`:V.side,U=B?Kt:V.positionerStyles,W={open:E,side:H,align:V.align,anchorHidden:V.anchorHidden};f(()=>{w.set(`popupSide`,V.side)},[w,V.side]);let ee=w.useStateSetter(`positionerElement`),te=Ke(e,W,{styles:U,transitionStatus:F,props:C,refs:[t,ee],hidden:!D,inert:!E}),ne=Q.useRef(0),G=N(e=>{if(w.context.valuesRef.current.length===0)return;let t=ne.current;ne.current=e.size;let n=d(o);if(t!==0&&!w.state.multiple&&k!==null&&Ie(w.context.valuesRef.current,k,P)===-1){let e=w.context.initialValueRef.current,t=e!=null&&Ie(w.context.valuesRef.current,e,P)!==-1?e:null;w.context.setValue(t,n),t===null&&(w.set(`selectedIndex`,null),w.context.selectedItemTextRef.current=null)}if(t!==0&&w.state.multiple&&Array.isArray(k)){let e=k.filter(e=>Ie(w.context.valuesRef.current,e,P)!==-1);e.length!==k.length&&(w.context.setValue(e,n),e.length===0&&(w.set(`selectedIndex`,null),w.context.selectedItemTextRef.current=null))}if(E&&B){w.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};Wt(j,e),Wt(w.context.popupRef.current,e)}}),K=Q.useMemo(()=>({...V,side:H,alignItemWithTriggerActive:B,setControlledAlignItemWithTrigger:z,scrollUpArrowRef:I,scrollDownArrowRef:L}),[V,H,B,z]);return(0,$.jsx)(S,{elementsRef:w.context.listRef,labelsRef:w.context.labelsRef,onMapChange:G,children:(0,$.jsxs)(Ht.Provider,{value:K,children:[D&&O&&(0,$.jsx)(me,{inert:pe(!E),cutout:M}),te]})})}),Jt=`base-ui-disable-scrollbar`,Yt={className:Jt,getElement(e){return(0,$.jsx)(`style`,{nonce:e,href:Jt,precedence:`base-ui:low`,children:`.${Jt}{scrollbar-width:none}.${Jt}::-webkit-scrollbar{display:none}`})}},Xt=Q.createContext(void 0),Zt={disableStyleElements:!1};function Qt(){return Q.useContext(Xt)??Zt}var $t=`--transform-origin`,en={...j,...re},tn=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,s=Dt(),c=s.useState(`multiple`),l=s.useState(`readOnly`),u=s.useState(`highlightItemOnHover`),m=Ot(),{side:h,align:g,alignItemWithTriggerActive:_,isPositioned:v,setControlledAlignItemWithTrigger:y}=Ut(),b=oe(!0)!=null,S=K(),{nonce:C,disableStyleElements:w}=Qt(),T=s.useState(`id`),E=s.useState(`open`),k=s.useState(`openMethod`),A=s.useState(`mounted`),j=s.useState(`popupProps`),M=s.useState(`transitionStatus`),F=s.useState(`triggerElement`),I=s.useState(`positionerElement`),L=s.useState(`listElement`),R=Q.useRef(!1),z=Q.useRef(!1),B=Q.useRef({}),V=O(),H=N(e=>{if(!I||!s.context.popupRef.current||!z.current)return;let t=I.style.top===`0px`,n=I.style.bottom===`0px`;if(R.current||!_||!t&&!n){s.context.handleScrollArrowVisibility(e);return}let r=an(I),i=on(I.getBoundingClientRect().height,`y`,r),a=p(I),o=W(I),c=o.getComputedStyle(I),l=parseFloat(c.marginTop),u=parseFloat(c.marginBottom),d=nn(o.getComputedStyle(s.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),m=e.scrollTop,h=rn(e),g=null,v=e=>{I.style.height=`${e}px`},y=t?h-m:m,b=Math.min(i+y,f);if(y<=1){let n=At(y,0,f-i);n>0&&v(i+n),e.scrollTop=t?h:0,f-(i+n)<=1&&(R.current=!0),s.context.handleScrollArrowVisibility(e);return}f-b>1?g=t?1/0:0:n&&m<h&&(g=m-(y-(i+y-f)));let x=Math.ceil(b);if(x!==0&&v(x),g!=null){let t=At(g,0,rn(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}x>=f-1&&(R.current=!0),s.context.handleScrollArrowVisibility(e)});Q.useImperativeHandle(s.context.scrollHandlerRef,()=>H,[H]),x({open:E,ref:s.context.popupRef,onComplete(){E&&s.context.onOpenChangeComplete(!0)}});let U={open:E,transitionStatus:M,side:h,align:g};f(()=>{I&&s.context.popupRef.current&&!Object.keys(B.current).length&&(B.current={top:I.style.top||`0`,left:I.style.left||`0`,right:I.style.right,height:I.style.height,bottom:I.style.bottom,minHeight:I.style.minHeight,maxHeight:I.style.maxHeight,marginTop:I.style.marginTop,marginBottom:I.style.marginBottom})},[s,I]),f(()=>{E||_||(z.current=!1,R.current=!1,Wt(I,B.current))},[E,_,I]),f(()=>{let e=s.context.popupRef.current;if(!E||!F||!I||!e||_&&!v||s.state.transitionStatus===`ending`)return;if(z.current=!0,e.style.removeProperty($t),!_){V.request(()=>s.context.handleScrollArrowVisibility(L||e));return}let t=ln(e);try{let t=s.context.selectedItemTextRef.current;t?.isConnected||(t=!s.select(`hasSelectedValue`)&&s.context.firstItemTextRef.current?.isConnected?s.context.firstItemTextRef.current:null);let n=s.context.valueRef.current,r=W(I),i=r.getComputedStyle(I),a=r.getComputedStyle(e),o=p(F),c=an(F),l=sn(F.getBoundingClientRect(),c),d=sn(I.getBoundingClientRect(),c),f=l.height,m=L||e,h=m.scrollHeight,g=parseFloat(a.borderBottomWidth),_=parseFloat(i.marginTop)||10,v=parseFloat(i.marginBottom)||10,b=parseFloat(i.minHeight)||100,x=nn(a),C=o.documentElement.clientHeight-_-v,w=o.documentElement.clientWidth,T=C-l.bottom+f,E,D=S===`rtl`?l.right-d.width:l.left,O=0;if(t&&n){let e=sn(n.getBoundingClientRect(),c);E=sn(t.getBoundingClientRect(),c),D=d.left+(S===`rtl`?e.right-E.right:e.left-E.left);let r=e.top-l.top+e.height/2;O=E.top-d.top+E.height/2-r}let k=T+O+v+g,A=Math.min(C,k),j=C-_-v,M=k-A,N=w-5;I.style.left=`${At(D,5,N-d.width)}px`,I.style.height=`${A}px`,I.style.maxHeight=`none`,I.style.marginTop=`${_}px`,I.style.marginBottom=`${v}px`,e.style.height=`100%`;let z=rn(m),V=M>=z-1;V&&(A=Math.min(C,d.height)-(M-z));let H=l.top<20||l.bottom>C-20||Math.ceil(A)+1<Math.min(h,b),U=(r.visualViewport?.scale??1)!==1&&P;if(H||U){Wt(I,B.current),y(!1);return}let ee=Math.max(b,A);if(V){let e=Math.max(0,C-k);I.style.top=d.height>=j?`0`:`${e}px`,I.style.height=`${A}px`,m.scrollTop=rn(m)}else I.style.bottom=`0`,m.scrollTop=M;if(E){let t=d.top,n=d.height,r=E.top+E.height/2,i=At(n>0?(r-t)/n*100:50,0,100);e.style.setProperty($t,`50% ${i}%`)}(ee===C||A>=x)&&(R.current=!0),s.context.handleScrollArrowVisibility(m),u&&s.state.selectedIndex===null&&s.state.activeIndex===null&&s.context.listRef.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,E,I,F,_,y,V,L,u,S,v]),Q.useEffect(()=>{if(!_||!I||!E)return;let e=W(I);function t(e){s.context.setOpen(!1,d(D,e))}return ie(e,`resize`,t)},[s,_,I,E]);let ee={...L?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":c||void 0,"aria-readonly":l||void 0,id:`${T}-list`},onKeyDown(e){b&&X.has(e.key)&&e.stopPropagation()},onScroll(e){L||H(e.currentTarget)},..._&&{style:L?{height:`100%`}:Gt},className:!L&&_?Yt.className:void 0},te=G(`div`,e,{ref:[t,s.context.popupRef],state:U,stateAttributesMapping:en,props:[j,ee,Je(M),o]});return(0,$.jsxs)(Q.Fragment,{children:[!w&&Yt.getElement(C),(0,$.jsx)(Ce,{context:m,modal:!1,disabled:!A,openInteractionType:k,returnFocus:a,restoreFocus:!0,children:te})]})});function nn(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function rn(e){return jt(e.scrollHeight,e.clientHeight)}function an(e){return $e.getScale(e)}function on(e,t,n){return e/n[t]}function sn(e,t){return s({x:on(e.x,`x`,t),y:on(e.y,`y`,t),width:on(e.width,`x`,t),height:on(e.height,`y`,t)})}var cn=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function ln(e){let{style:t}=e,n={};for(let[e,r]of cn)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of cn){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var un=Q.createContext(void 0);function dn(){let e=Q.useContext(un);if(!e)throw Error(Y(57));return e}var fn=Q.memo(Q.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...u}=e,p=Q.useRef(null),m=k({guess:!0,label:o,textRef:p}),h=Dt(),{props:_,multiple:v,disabled:y,readOnly:x,isItemEqualToValue:S}=h.useState(`itemRoot`),C=y||s,w=h.useState(`isActive`,m.index),T=h.useState(`open`),E=h.useState(`isSelected`,a),D=h.useState(`isSelectedByFocus`,m.index),O=m.index,A=Q.useRef(null);f(()=>{let e=h.context.valuesRef.current;return e[O]=a,()=>{delete e[O]}},[O,a,h]),f(()=>{let e=h.state.value,t=h.state.selectedIndex,n=t,r;v&&Array.isArray(e)?(n=et(O,a,h.context.valuesRef.current,e,S,t),r=n===O,O===t&&!r&&(h.context.selectedItemTextRef.current=null)):(r=e!==void 0&&Ve(a,e,S),r&&(n=O)),h.set(`selectedIndex`,n),r&&p.current&&(h.context.selectedItemTextRef.current=p.current)},[O,v,S,h,a]);let j=Q.useRef(`mouse`),M=Q.useRef(!1),{getButtonProps:N,buttonRef:P}=l({disabled:C,focusableWhenDisabled:!0,native:c,composite:!0}),F={disabled:C,selected:E,highlighted:w};function I(e){if(y||x)return;let t=h.state.value;if(v){let n=Array.isArray(t)?t:[],r=E?at(n,a,S):[...n,a];h.context.setValue(r,d(g,e))}else h.context.setValue(a,d(g,e)),h.context.setOpen(!1,d(g,e))}function L(){h.context.selectionRef.current.dragY=0}let R={role:`option`,"aria-selected":E,tabIndex:T&&w?0:-1,onKeyDown(e){h.set(`activeIndex`,O),e.key===` `&&h.context.typingRef.current&&e.preventDefault()},onClick(e){let t=j.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&b(e.nativeEvent)&&(n!==void 0||w),i=t&&!r&&!M.current;M.current=!1,C||i||I(e.nativeEvent)},onPointerEnter(e){j.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=h.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){j.current=e.pointerType,M.current=!0,L()},onMouseUp(){if(L(),C||j.current===`touch`||M.current)return;let e=!h.context.selectionRef.current.allowSelectedMouseUp&&E,t=!h.context.selectionRef.current.allowUnselectedMouseUp&&!E;e||t||(M.current=!0,A.current?.click(),M.current=!1)}},z=G(`div`,e,{ref:[P,t,m.ref,A],state:F,props:[_,R,u,N]}),B=Q.useMemo(()=>({selected:E,index:O,textRef:p,selectedByFocus:D}),[E,O,p,D]);return(0,$.jsx)(un.Provider,{value:B,children:z})})),pn=Q.forwardRef(function(e,t){let{selected:n}=dn();return e.keepMounted||n?(0,$.jsx)(Ct,{...e,selected:n,ref:t}):null}),mn=Q.memo(Q.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=dn(),a=Dt(),{render:o,className:s,style:c,...l}=e,u=Q.useCallback(e=>{e&&(n===0&&(a.context.firstItemTextRef.current=e),i&&(a.context.selectedItemTextRef.current=e))},[a,n,i]);return G(`div`,e,{ref:[u,t,r],props:l})})),hn=`relative flex h-9 w-full min-w-0 items-center gap-2 rounded-control border border-rule bg-page pr-9 pl-3 text-left text-sm text-text outline-none transition-colors focus-visible:border-accent data-popup-open:border-accent disabled:cursor-not-allowed disabled:opacity-60`,gn=`pointer-events-none size-4 text-muted`,_n=`max-h-[min(var(--available-height),20rem)] min-w-(--anchor-width) overflow-y-auto rounded-card border border-rule bg-surface p-1 text-text shadow-float outline-none transition-[opacity,transform] duration-150 data-ending-style:-translate-y-1 data-ending-style:opacity-0 data-starting-style:-translate-y-1 data-starting-style:opacity-0`,vn=`relative flex cursor-default items-center rounded-[6px] py-1.5 pr-8 pl-2.5 text-sm outline-none select-none data-disabled:opacity-50 data-highlighted:bg-accent-soft`,yn=`pointer-events-none absolute right-2.5 size-4 text-accent`;function bn(e){return(0,$.jsx)(Nt,{"data-slot":`select`,...e})}function xn({className:e,children:t,...n}){return(0,$.jsxs)(Lt,{"data-slot":`select-trigger`,className:w(hn,e),...n,children:[t,(0,$.jsx)(Bt,{className:`absolute right-3 flex`,children:(0,$.jsx)(ae,{name:`chevron`,className:gn})})]})}function Sn({className:e,...t}){return(0,$.jsx)(zt,{"data-slot":`select-value`,className:w(`truncate`,e),...t})}function Cn({className:e,...t}){return(0,$.jsx)(Vt,{children:(0,$.jsx)(qt,{alignItemWithTrigger:!1,sideOffset:6,className:`z-40`,children:(0,$.jsx)(tn,{"data-slot":`select-content`,className:w(_n,e),...t})})})}function wn({className:e,children:t,...n}){return(0,$.jsxs)(fn,{"data-slot":`select-item`,className:w(vn,e),...n,children:[(0,$.jsx)(mn,{className:`truncate`,children:t}),(0,$.jsx)(pn,{className:yn,children:(0,$.jsx)(ae,{name:`check`,className:`size-4`})})]})}var Tn=St;function En({className:e,...t}){return(0,$.jsxs)(ht,{"data-slot":`combobox-input-group`,className:w(`relative flex items-center`,e),children:[(0,$.jsx)(De,{"data-slot":`combobox-input`,className:w(hn,`placeholder:text-muted focus:border-accent`),...t}),(0,$.jsx)(pt,{"data-slot":`combobox-trigger`,"aria-label":`Show options`,className:`absolute inset-y-0 right-0 flex w-9 items-center justify-center outline-none`,children:(0,$.jsx)(ae,{name:`chevron`,className:gn})})]})}function Dn({className:e,...t}){return(0,$.jsx)(vt,{children:(0,$.jsx)(yt,{sideOffset:6,className:`z-40`,children:(0,$.jsx)(xt,{"data-slot":`combobox-content`,className:w(_n,e),...t})})})}var On=Fe;function kn({className:e,...t}){return(0,$.jsx)(Te,{"data-slot":`combobox-empty`,className:w(`px-2.5 py-1.5 text-sm text-muted empty:hidden`,e),...t})}function An({className:e,children:t,...n}){return(0,$.jsxs)(Qe,{"data-slot":`combobox-item`,className:w(vn,e),...n,children:[(0,$.jsx)(`span`,{className:`truncate`,children:t}),(0,$.jsx)(wt,{className:yn,children:(0,$.jsx)(ae,{name:`check`,className:`size-4`})})]})}export{An as a,Cn as c,Sn as d,En as i,wn as l,Dn as n,On as o,kn as r,bn as s,Tn as t,xn as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t,t as n}from"./jsx-runtime-MZURdZre.js";import{B as r,Bt as i,Dn as a,E as o,Fn as s,G as c,Hn as l,Ht as u,J as d,Jn as f,K as ee,Kn as p,Kt as te,P as ne,Rt as m,Sr as re,Tr as h,U as g,Ut as _,Vt as v,W as ie,Y as ae,Yn as y,_n as b,_r as x,at as oe,br as se,ct as S,dn as C,er as ce,fn as le,ht as ue,ir as w,it as T,j as de,lr as E,lt as fe,mn as D,mr as O,ot as pe,pn as k,q as A,qn as me,qt as he,sr as j,ur as ge,ut as _e,vr as M,xr as N,yn as P,yr as F,z as ve,zt as ye}from"./button-D6LrRkOG.js";var I=e(t(),1),L=0;function be(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(L);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),M;let o=requestAnimationFrame(a);return L=o,()=>{L===o&&(cancelAnimationFrame(o),L=0)}}var R=`data-base-ui-inert`,z=new WeakMap,B=new WeakSet,V=new WeakMap,H=0;function xe(e){return e?ge(e)?e.host:xe(e.parentNode):null}var Se=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=xe(t);return e.contains(n)?n:null}).filter(e=>e!=null),U=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Ce=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{ce(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function W(e,t,n,{mark:r=!0}){let i=Se(t,e),a=r?Ce(t,U(i),new Set(i)):[],o=[],s=[];if(n){let e=Se(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);Ce(t,U(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(z.get(e)||0)+1;z.set(e,r),o.push(e),r===1&&n&&B.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(V.get(e)||0)+1;V.set(e,t),s.push(e),t===1&&e.setAttribute(R,``)}),H+=1,()=>{o.forEach(e=>{let t=(z.get(e)||0)-1;z.set(e,t),t||(B.has(e)||e.removeAttribute(`aria-hidden`),B.delete(e))}),r&&s.forEach(e=>{let t=(V.get(e)||0)-1;V.set(e,t),t||e.removeAttribute(R)}),--H,H||(z=new WeakMap,B=new WeakSet,V=new WeakMap)}}function we(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=p(e[0]).body;return W(e,i,n,{mark:r})}var G=n();function Te(e,t){let n=w(D(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(m(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var K=20,q=[];function Ee(){q=q.filter(e=>e.deref()?.isConnected)}function De(e){Ee(),e&&ce(e)!==`body`&&(q.push(new WeakRef(e)),q.length>K&&(q=q.slice(-20)))}function Oe(){return Ee(),q[q.length-1]?.deref()}function ke(e){return e?fe(e)?e:_e(e)[0]||e:null}function Ae(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=T(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return fe(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function J(e){let{context:t,children:n,disabled:s=!1,initialFocus:d=!0,returnFocus:re=!0,explicitReturnFocus:h,restoreFocus:g=!1,modal:x=!0,closeOnFocusOut:w=!0,openInteractionType:T=``,nextFocusableElement:E,previousFocusableElement:O,beforeContentFocusGuardRef:me,externalTree:ge,getInsideElements:M}=e,N=t.useState(`open`),P=t.useState(`domReferenceElement`),F=t.useState(`floatingElement`),{events:L,dataRef:R}=t.context,z=y(()=>R.current.floatingContext?.nodeId),B=d===!1,V=te(P)&&B,H=c(d),xe=c(re),Se=c(h),U=c(T),Ce=c(N),W=de(ge),K=ne(),q=I.useRef(!1),J=I.useRef(!1),je=I.useRef(!1),Me=I.useRef(null),Ne=I.useRef(``),Pe=I.useRef(``),Fe=I.useRef(null),Ie=I.useRef(null),Le=se(Fe,me,K?.beforeInsideRef),Re=se(Ie,K?.afterInsideRef),ze=ae(),Y=ae(),Be=ie(),Ve=K!=null,X=_(F),Z=y((e=X)=>e?_e(e):[]),Q=y(()=>M?.().filter(e=>e!=null)??[]);I.useEffect(()=>{if(s||!x)return;function e(e){e.key===`Tab`&&k(X,C(p(X)))&&Z().length===0&&!V&&i(e)}let t=p(X);return A(t,`keydown`,e)},[s,X,x,V,Z]),I.useEffect(()=>{if(s||!N)return;let e=p(X);function t(){je.current=!1}function n(e){let t=D(e),n=Q(),r=k(F,t)||k(P,t)||k(K?.portalNode,t)||n.some(e=>e===t||k(e,t));je.current=!r,Pe.current=e.pointerType||`keyboard`,le(t,`[data-base-ui-click-trigger]`)&&(J.current=!0,Y.start(0,()=>{J.current=!1}))}function r(){Pe.current=`keyboard`}return ee(A(e,`pointerdown`,n,!0),A(e,`pointerup`,t,!0),A(e,`pointercancel`,t,!0),A(e,`keydown`,r,!0),t)},[s,F,P,X,N,K,Y,Q]),I.useEffect(()=>{if(s||!w)return;let e=p(X);function n(){J.current=!0,Y.start(0,()=>{J.current=!1})}function r(e){let t=D(e);fe(t)&&(Me.current=t)}function i(n){let r=n.relatedTarget,i=n.currentTarget,s=D(n);x&&r==null&&s!=null&&k(F,s)&&De(s),queueMicrotask(()=>{let c=z(),d=t.context.triggerElements,f=Q(),ee=r?.hasAttribute(ve(`focus-guard`))&&[Fe.current,Ie.current,K?.beforeInsideRef.current,K?.afterInsideRef.current,K?.beforeOutsideRef.current,K?.afterOutsideRef.current,o(O),o(E)].includes(r),p=!(k(P,r)||k(F,r)||k(r,F)||k(K?.portalNode,r)||f.some(e=>e===r||k(e,r))||d.hasMatchingElement(e=>k(e,r))||ee||W&&(u(W.nodesRef.current,c).find(e=>k(e.context?.elements.floating,r)||k(e.context?.elements.domReference,r))||v(W.nodesRef.current,c).find(e=>[e.context?.elements.floating,_(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===P&&X&&Ae(X),g&&i!==P&&!ue(s)&&C(e)===e.body){if(j(X)&&(X.focus(),g===`popup`)){Be.request(()=>{X.focus()});return}let e=Z(),t=Me.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||X;j(n)&&n.focus()}R.current.insideReactTree?R.current.insideReactTree=!1:(V||!x)&&r&&p&&!J.current&&(V||r!==Oe())&&(q.current=!0,t.setOpen(!1,l(a,n)))})}function c(){je.current||(R.current.insideReactTree=!0,ze.start(0,()=>{R.current.insideReactTree=!1}))}let d=j(P)?P:null;if(F||d)return ee(d&&A(d,`focusout`,i),d&&A(d,`pointerdown`,n),F&&A(F,`focusin`,r),F&&A(F,`focusout`,i),F&&K&&A(F,`focusout`,c,!0))},[s,P,F,X,x,W,K,t,w,g,Z,V,z,R,ze,Y,Be,E,O,Q]),I.useEffect(()=>{if(s||!F||!N)return;let e=Array.from(K?.portalNode?.querySelectorAll(`[${ve(`portal`)}]`)||[]),t=(W?v(W.nodesRef.current,z()):[]).find(e=>te(e.context?.elements.domReference||null))?.context?.elements.domReference,n=we([F,...e,Fe.current,Ie.current,K?.beforeOutsideRef.current,K?.afterOutsideRef.current,...Q(),t,o(O),o(E),V?P:null].filter(e=>e!=null),{ariaHidden:x||V,mark:!1}),r=we([F,...e].filter(e=>e!=null));return()=>{r(),n()}},[N,s,P,F,x,K,V,W,z,E,O,Q]),f(()=>{if(!N||s||!j(X))return;Ne.current=``,Pe.current=``;let e=p(X),t=C(e);queueMicrotask(()=>{let n=H.current,r=typeof n==`function`?n(U.current||``):n;if(r===void 0||r===!1||k(X,t))return;let i=null,a=()=>(i??=Z(X),i[0]||X),s;s=r===!0||r===null?a():o(r),s||=a();let c=k(X,C(e)),l=R.current.openEvent,u=l?.type===`mousedown`&&m(l);be(s,{sync:u,preventScroll:s===X,shouldFocus(){if(!Ce.current)return!1;if(c)return!0;let t=C(e);return!(t!==s&&k(X,t))}})})},[s,N,X,Z,H,U,Ce,R]);let $=I.useRef(null);f(()=>{if(s||!X){$.current=null;return}$.current&&=($.current.cancelled=!0,null);let e=p(X),t=C(e),n=U.current==null;De(t);function r(e){if(e.open||(Ne.current=Te(e.nativeEvent,Pe.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(ve(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(q.current=!0),e.reason===`outside-press`){if(e.nested)q.current=!1;else if(m(e.nativeEvent)||ye(e.nativeEvent))q.current=!1;else{let e=!1;p(X).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?q.current=!1:q.current=!0}}}L.on(`openchange`,r);function i(e){let r=xe.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=P?.isConnected?P:null,s=t?.isConnected&&ce(t)!==`body`?t:null,c=n?s||a:a||s;return c||=Oe()||null,typeof i==`boolean`?c:o(i)||c||null}return()=>{L.off(`openchange`,r);let t=C(e),n=Q(),a=k(F,t)||n.some(e=>e===t||k(e,t))||W&&u(W.nodesRef.current,z(),!1).some(e=>k(e.context?.elements.floating,t)),o=xe.current,s=Ne.current,c=i(s),l={cancelled:!1};$.current=l,queueMicrotask(()=>{$.current===l&&($.current=null);let n=ke(c),r=Se.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!q.current&&j(n)&&(r||n===t||t===e.body||a)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}q.current=!1})}},[s,F,X,xe,Se,U,L,W,P,z,Q]),f(()=>{if(!b||N||!F)return;let e=C(p(F));j(e)&&he(e)&&k(F,e)&&e.blur()},[N,F]),f(()=>{if(!s&&K)return K.setFocusManagerState({modal:x,closeOnFocusOut:w,open:N,onOpenChange:t.setOpen,domReference:P}),()=>{K.setFocusManagerState(null)}},[s,K,x,N,t,w,P]),f(()=>{if(!s&&X)return Ae(X),()=>{queueMicrotask(Ee)}},[s,X]);let He=!s&&(!x||!V)&&(Ve||x);return(0,G.jsxs)(I.Fragment,{children:[He&&(0,G.jsx)(r,{"data-type":`inside`,ref:Le,onFocus:e=>{if(x){let e=Z();be(e[e.length-1])}else K?.portalNode&&(q.current=!1,S(e,K.portalNode)?oe(P)?.focus():o(O??K.beforeOutsideRef)?.focus())}}),n,He&&(0,G.jsx)(r,{"data-type":`inside`,ref:Re,onFocus:e=>{x?be(Z()[0]):K?.portalNode&&(w&&(q.current=!0),S(e,K.portalNode)?pe(P)?.focus():o(E??K.afterOutsideRef)?.focus())}})]})}function je(e){return F(19)?e:e?`true`:void 0}var Me=`data-valid`,Ne=`data-invalid`,Pe={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Fe={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Ie={disabled:!1,...Fe},Le={valid(e){return e===null?null:e?{[Me]:``}:{[Ne]:``}}},Re={invalid:void 0,name:void 0,validityData:{state:Pe,errors:[],error:``,value:``,initialValue:null},setValidityData:M,disabled:void 0,setTouched:M,setDirty:M,setFilled:M,setFocused:M,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:Ie,registerFieldControl:M,validation:{getValidationProps:(e,t=x)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:M,getInputControl:()=>null,commit:async()=>{},change:M}},ze=I.createContext(Re);function Y(e=!0){let t=I.useContext(ze);if(t.setValidityData===M&&!e)throw Error(me(28));return t}function Be(e,t,n,r,i=!0,a){let{registerFieldControl:o}=Y(),s=N(()=>Symbol());f(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),f(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var Ve=I.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:M,validationMode:`onSubmit`,submitCountRef:{current:0}});function X(){return I.useContext(Ve)}var Z=I.createContext({controlId:void 0,registerControlId:M,resetControlId:M,labelId:void 0,setLabelId:M,messageIds:[],setMessageIds:M,getDescriptionProps:e=>e});function Q(){return I.useContext(Z)}function $(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=Q(),o=re(),s=N(()=>Symbol()),c=I.useRef(!1),l=I.useRef(!1),u=y(()=>{c.current&&i!==M&&(c.current=!1,i(s.current,void 0))});return f(()=>{if(!n||i===M){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}e===void 0?u():(c.current=!0,i(s.current,e))},[t,n,i,a,o,s,u]),f(()=>u,[u]),(n?r:void 0)??t??o}function He(e,t){let n=I.useRef(e),r=y(t);f(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function Ue(e,t,n){let{setFocused:r,focusOwnerRef:i}=Y(),a=y(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return f(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}var We=I.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,G.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),Ge={},Ke={},qe=``;function Je(e,t){return E(e)?e:t}function Ye(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Je(t,n)).overflowY)}function Xe(e){if(typeof document>`u`)return!1;let t=p(e);return w(t).innerWidth-t.documentElement.clientWidth>0}function Ze(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=p(e),n=t.documentElement,r=t.body,i=Je(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Qe(e){let t=p(e),n=t.documentElement,r=t.body,i=Je(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function $e(e){let t=p(e),n=t.documentElement,r=t.body,i=w(n),a=0,o=0,s=!1,c=g.create();if(b&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Ge={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},qe=n.style.scrollBehavior,Ke={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,ee=t.overflowX===`scroll`||c.overflowX===`scroll`,p=Math.max(0,i.innerWidth-r.clientWidth),te=Math.max(0,i.innerHeight-r.clientHeight),ne=parseFloat(c.marginTop)+parseFloat(c.marginBottom),m=parseFloat(c.marginLeft)+parseFloat(c.marginRight),re=Je(n,r);s=Ze(e),s?(n.style.scrollbarGutter=l,re.style.overflowY=`hidden`,re.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||ee)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:ne||te?`calc(100dvh - ${ne+te}px)`:`100dvh`,width:m||p?`calc(100vw - ${m+p}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,Ge),Object.assign(r.style,Ke),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=qe)}function d(){u(),c.request(l)}l();let f=A(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var et=new class{lockCount=0;restore=null;timeoutLock=d.create();timeoutUnlock=d.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=p(e),n=t.documentElement,r=t.body,i=w(n);if(Ye(i,n,r)){let t=new i.MutationObserver(()=>{Ye(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=P||!Xe(e);this.restore=a?Qe(e):$e(e)}};function tt(e=!0,t=null){f(()=>{if(e)return et.acquire(t)},[e,t])}var nt=I.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:c=!1,onValueChange:u,defaultValue:d,autoFocus:ee=!1,style:p,...te}=e,{state:ne,name:m,disabled:re,setTouched:h,setDirty:g,validityData:_,setFilled:v,validationMode:ie,validation:b}=Y(),{clearErrors:x,elementRef:oe,submitCountRef:se}=X(),S=re||c,C=m??a,ce={...ne,disabled:S},{labelId:le}=Q(),ue=$({id:i}),w=o!==void 0,T=o==null?void 0:String(o),de=y(()=>b.inputRef.current?.value);Be(b.inputRef,ue,T,de,!S,a),f(()=>{let e=T??b.inputRef.current?.value;e!==void 0&&v(e!==``)},[T,d,b.inputRef,v]),He(T,()=>{T!==void 0&&(x(C),g(T!==(_.initialValue??``)),b.change(T))});let E=I.useRef(null),fe=Ue(S,E),D=ae();return O(`input`,e,{ref:[t,E],state:ce,props:[{id:ue,disabled:S,name:C,ref:b.inputRef,"aria-labelledby":le,autoFocus:ee,...w?{value:o}:{defaultValue:d},onChange(e){let t=e.currentTarget.value,n=l(s,e.nativeEvent);u?.(t,n),w||(g(t!==(_.initialValue??``)),v(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(x(C),b.change(t)))},onFocus(){fe(!0)},onBlur(e){if(h(!0),fe(!1),ie===`onBlur`){let t=e.currentTarget.value;b.commit(t),w&&queueMicrotask(()=>{let e=b.inputRef.current?.value;e!==void 0&&e!==t&&e!==(_.initialValue??``)&&b.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){h(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===oe.current&&!e.defaultPrevented){let t=e.currentTarget,n=se.current;D.start(0,()=>{se.current===n&&b.commit(t.value)})}else b.commit(t)}}},te,e=>b.getValidationProps(S,e)],stateAttributesMapping:Le})}),rt=I.forwardRef(function(e,t){return(0,G.jsx)(nt,{ref:t,...e})}),it=I.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return O(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function at({className:e,...t}){return(0,G.jsx)(`kbd`,{"data-slot":`kbd`,className:h(`inline-grid h-[18px] min-w-[18px] place-items-center rounded-[4px] border border-b-2 border-rule bg-page px-1 font-mono text-[0.66rem] leading-none font-semibold text-muted select-none`,e),...t})}var ot=`w-full min-w-0 rounded-control border border-rule bg-page px-3 text-sm text-text outline-none transition-colors placeholder:text-muted focus:border-accent disabled:cursor-not-allowed disabled:opacity-60`;function st({className:e,...t}){return(0,G.jsx)(rt,{"data-slot":`input`,className:h(ot,`h-9`,e),...t})}function ct({className:e,orientation:t=`horizontal`,...n}){return(0,G.jsx)(it,{"data-slot":`separator`,orientation:t,className:h(`shrink-0 bg-rule-soft data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch`,e),...n})}export{je as _,We as a,$ as c,Be as d,Re as f,Le as g,Fe as h,tt as i,Q as l,Y as m,at as n,Ue as o,ze as p,ct as r,He as s,st as t,X as u,J as v,be as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{St as e}from"./index-BBmFpG4y.js";var t=e;export{t as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{J as e}from"./studio-queries-CFP_yTpr.js";import{t}from"./markdown-view-RL5YvfZg.js";import{t as n}from"./jsx-runtime-MZURdZre.js";var r=n(),i=[{id:`start`,label:`Start here`,path:`/getting-started`},{id:`worktrees`,label:`Worktrees`,path:`/getting-started/worktrees`},{id:`vscode`,label:`VS Code & Cursor`,path:`/getting-started/vscode`}];function a({topic:n,guide:a,search:o}){let s={companion:o.companion,studioMode:o.studioMode};return(0,r.jsxs)(`div`,{className:`guide-reader min-w-0 px-6 max-sm:px-4`,children:[(0,r.jsx)(`nav`,{"aria-label":`Getting Started topics`,className:`mb-6 flex flex-wrap gap-2 border-b border-rule pb-3`,children:i.map(({id:t,label:i,path:a})=>(0,r.jsx)(e,{to:a,search:s,activeOptions:{exact:!0},"aria-current":n===t?`page`:void 0,className:`rounded-control px-3 py-2 text-sm text-muted hover:bg-surface hover:text-text aria-[current=page]:bg-accent-soft aria-[current=page]:font-semibold aria-[current=page]:text-accent`,children:i},t))}),(0,r.jsxs)(`article`,{className:`min-w-0 max-w-[70ch] pb-8`,"aria-label":a?.title??`Guide not found`,children:[a&&n!==`start`?(0,r.jsx)(`h2`,{className:`mb-4 text-lg font-semibold`,children:a.title}):null,a?(0,r.jsx)(t,{nodes:a.nodes,guideSearch:s}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`h2`,{className:`mb-2 text-lg font-semibold`,children:`Guide not found`}),(0,r.jsxs)(`p`,{children:[`This topic is not bundled with Studio.`,` `,(0,r.jsx)(e,{to:`/getting-started`,search:s,className:`text-accent underline`,children:`Return to Start here`}),`.`]})]})]})]})}export{a as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./getting-started-DZSjYC-b.js";import{n as t}from"./index-BBmFpG4y.js";import{t as n}from"./jsx-runtime-MZURdZre.js";var r=n(),i=function(){return(0,r.jsx)(e,{topic:t.useParams().topic,guide:t.useLoaderData(),search:t.useSearch()})};export{i as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./getting-started-DZSjYC-b.js";import{r as t}from"./index-BBmFpG4y.js";import{t as n}from"./jsx-runtime-MZURdZre.js";var r=n(),i=function(){return(0,r.jsx)(e,{topic:`start`,guide:t.useLoaderData(),search:t.useSearch()})};export{i as component};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/graph-canvas-DDuzsNSx.js","assets/studio-BR9j15J0.js","assets/jsx-runtime-MZURdZre.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{Dr as e,Tr as t,r as n}from"./button-D6LrRkOG.js";import"./studio-BR9j15J0.js";import{a as r,i,n as a,t as o}from"./jsx-runtime-MZURdZre.js";import{c as s,o as c}from"./store-DJ5cncKA.js";import{J as l,o as u}from"./studio-queries-CFP_yTpr.js";import{n as d,r as f,t as p}from"./panel-B8F8sOKQ.js";import{a as m,i as h,o as g,s as _,t as v}from"./specs-view-omrd_5P3.js";import{t as y}from"./preload-helper-BLdHbfdN.js";import{u as b}from"./index-BBmFpG4y.js";var x=r(a(),1),S={repository:8,area:5,capability:2.5},C=e=>`e${e}`;function w(e,t){let n=2166136261^t;for(let t=0;t<e.length;t++)n=Math.imul(n^e.charCodeAt(t),16777619);return(n>>>0)%1e5/1e5}function T(e,t,n){let r=w(t,1)*Math.PI*2,i=n*(.35+.65*w(t,2));return{x:e.x+Math.cos(r)*i,y:e.y+Math.sin(r)*i}}function E(e){let t=e.nodes.map(()=>({x:0,y:0})),n=e.nodes.flatMap((e,t)=>e.kind===`repository`?[t]:[]),r=Math.sqrt(e.nodes.length)*10;n.forEach((e,i)=>{let a=i/Math.max(1,n.length)*Math.PI*2;t[e]=n.length===1?{x:0,y:0}:{x:Math.cos(a)*r,y:Math.sin(a)*r}});let i=new Map,a=new Map;return O(e,(e,t,n)=>{n===`in`&&a.set(e,t),n===`binds`&&!i.has(e)&&i.set(e,t)}),e.nodes.forEach((e,n)=>{if(e.kind!==`area`)return;let i=a.get(n);t[n]=T(i===void 0?{x:0,y:0}:t[i],e.id,r/2)}),e.nodes.forEach((e,n)=>{if(e.kind!==`capability`)return;let a=i.get(n);t[n]=a===void 0?T({x:0,y:0},e.id,r*1.4):T(t[a],e.id,r/5)}),t}function D(e,t){if(!t)return{positions:E(e),missing:e.nodes.length};let n=e.nodes.map(e=>t.get(e.id)),r=n.filter(e=>!e).length;if(r===0)return{positions:n,missing:r};let i=new Map,a=(e,t)=>{let r=n[t];if(n[e]||!r)return;let a=i.get(e)??{x:0,y:0,count:0};i.set(e,{x:a.x+r.x,y:a.y+r.y,count:a.count+1})};O(e,(e,t)=>{a(e,t),a(t,e)});let o=E(e);return{positions:n.map((t,n)=>{if(t)return t;let r=i.get(n);return r?T({x:r.x/r.count,y:r.y/r.count},e.nodes[n].id,1):o[n]}),missing:r}}function O(e,t){for(let n=0,r=0;n<e.edges.length;n+=4,r++)t(e.edges[n],e.edges[n+1],h[e.edges[n+2]],e.edges[n+3],r)}var k={hidden:new Set,minWeight:1};function A(e,t){return t.hidden.has(e.kind)?!1:e.kind!==`co-change`||e.weight>=t.minWeight}function j(e){return e.kind===`binds`||e.kind===`in`?.3:e.kind===`mentions`?1:Math.min(4,e.weight)}function M(e,t,n=8){let r=t.trim().toLowerCase();if(!r)return[];let i={capability:0,area:1,repository:2};return e.nodes.filter(e=>[e.label,e.area,e.repository].some(e=>e?.toLowerCase().includes(r))).toSorted((e,t)=>Number(t.label.toLowerCase()===r)-Number(e.label.toLowerCase()===r)||i[e.kind]-i[t.kind]||e.label.localeCompare(t.label)).slice(0,n)}function ee(e){let t=new Map(e.nodes.map((e,t)=>[e.id,t])),n=e.nodes.map(()=>[]);return O(e,(e,t,r,i,a)=>{n[e].push({other:t,kind:r,edge:a,outgoing:!0}),n[t].push({other:e,kind:r,edge:a,outgoing:!1})}),{byId:t,links:n}}function te(e,t,n){let r=new Set(e.history[n]);return e.history[t].flatMap(t=>r.has(t)?[e.archives[t]]:[])}function N(e,t){let n=t*4;return!Number.isInteger(t)||t<0||n>=e.edges.length?null:{source:e.edges[n],target:e.edges[n+1],kind:h[e.edges[n+2]],weight:e.edges[n+3]}}function P(e,t,n){if(`edge`in n){let t=N(e,n.edge);return t?`Connection ${e.nodes[t.source].label} and ${e.nodes[t.target].label}`:`Connection`}let r=t.byId.get(n.node);if(r===void 0)return`Graph`;let i=e.nodes[r];return`${F[i.kind]} ${i.label}`}var F={capability:`Spec`,area:`Area`,repository:`Repository`};function I(e){return e?`edge`in e?`edge:${e.edge}`:e.node:null}function L(e){return e.kind===`capability`?`spec`:e.kind===`area`?e.repository??``:`repository`}var R=o(),z={"proposal.md":`proposal`,"design.md":`design`,"tasks.md":`tasks`,"verification.md":`verification`},B=e=>e.label;function V({search:e,path:t,children:n}){return(0,R.jsx)(l,{className:`text-sm`,to:`/vault`,search:{companion:e.companion,studioMode:e.studioMode,path:t},children:n})}function H({archive:e,capabilities:t,search:n}){return(0,R.jsxs)(`li`,{className:`grid gap-1 border-t border-rule-soft py-2 first:border-t-0`,"data-archive":e.anchor,children:[(0,R.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,R.jsx)(`span`,{className:`min-w-0 truncate font-mono text-sm`,children:e.name}),(0,R.jsx)(`time`,{className:`ml-auto font-mono text-2xs text-muted`,dateTime:e.archivedOn,children:e.archivedOn})]}),(0,R.jsxs)(`span`,{className:`flex flex-wrap gap-x-3 gap-y-1`,children:[e.artifacts.map(t=>(0,R.jsx)(V,{search:n,path:g(e.anchor,t),children:z[t]??t},t)),t.map(r=>(0,R.jsx)(V,{search:n,path:g(e.anchor,`specs/${r}/spec.md`),children:t.length>1?`${r} delta`:`delta spec`},r))]})]})}function U({archives:e,capabilities:t,search:n,empty:r}){return e.length===0?(0,R.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:r}):(0,R.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.map(e=>(0,R.jsx)(H,{archive:e,capabilities:t,search:n},e.anchor))})}function W({nodes:e,onSelectNode:n}){return(0,R.jsx)(`ul`,{className:`m-0 grid list-none gap-0.5 p-0`,children:e.map(e=>(0,R.jsx)(`li`,{children:(0,R.jsx)(`button`,{type:`button`,className:t(`w-full truncate rounded-[4px] border-0 bg-transparent px-1.5 py-0.5 text-left text-sm text-text hover:bg-surface`,e.kind===`capability`&&`font-mono`),"data-graph-node":e.id,onClick:()=>n(e.id),children:e.label})},e.id))})}function G(e,t,n,r,i){return t.links[n].flatMap(t=>t.kind===r&&(i===void 0||t.outgoing===i)?[e.nodes[t.other]]:[]).toSorted((e,t)=>e.label.localeCompare(t.label))}function K({wire:e,index:t,search:n,onSelectNode:r,node:i}){let a=B(e.nodes[i]),o=G(e,t,i,`binds`,!0).map(({repository:e,area:t})=>({repository:e,area:t})),s=e.history[i].map(t=>e.archives[t]),c=G(e,t,i,`mentions`,!0),l=G(e,t,i,`mentions`,!1),u=G(e,t,i,`co-change`);return(0,R.jsxs)(v,{spec:{capability:a,scopes:o},companion:n.companion,withStatus:!1,children:[(0,R.jsx)(d,{title:`History`,aside:`${s.length} archived`,children:(0,R.jsx)(U,{archives:s,capabilities:[a],search:n,empty:`No archived change names this spec.`})}),c.length+l.length+u.length>0?(0,R.jsxs)(d,{title:`Connected specs`,children:[c.length>0?(0,R.jsx)(q,{label:`Mentions`,nodes:c,onSelectNode:r}):null,l.length>0?(0,R.jsx)(q,{label:`Mentioned by`,nodes:l,onSelectNode:r}):null,u.length>0?(0,R.jsx)(q,{label:`Changed together`,nodes:u,onSelectNode:r}):null]}):null]})}function q({label:e,nodes:t,onSelectNode:n}){return(0,R.jsxs)(`div`,{className:`grid gap-1`,children:[(0,R.jsx)(`span`,{className:`text-xs text-muted`,children:e}),(0,R.jsx)(W,{nodes:t,onSelectNode:n})]})}function J({wire:e,index:t,onSelectNode:n,node:r}){let i=e.nodes[r],a=G(e,t,r,`binds`,!1),o=G(e,t,r,`in`,!0)[0];return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(p,{mono:i.area!==`.`,title:i.label,kicker:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{children:`Area`}),o?(0,R.jsx)(`button`,{type:`button`,className:`ml-auto border-0 bg-transparent p-0 font-mono text-xs text-muted hover:text-text`,onClick:()=>n(o.id),children:o.label}):null]})}),(0,R.jsx)(d,{title:`Capabilities`,aside:a.length,children:(0,R.jsx)(W,{nodes:a,onSelectNode:n})})]})}function Y({wire:e,index:t,onSelectNode:n,node:r}){let i=e.nodes[r],a=G(e,t,r,`in`,!1);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(p,{mono:!0,title:i.label,kicker:(0,R.jsx)(`span`,{children:`Repository`})}),a.map(r=>{let i=G(e,t,t.byId.get(r.id),`binds`,!1);return(0,R.jsxs)(d,{title:r.area===`.`?m:r.label,aside:i.length,children:[(0,R.jsx)(`button`,{type:`button`,className:`justify-self-start border-0 bg-transparent p-0 text-xs text-muted hover:text-text`,onClick:()=>n(r.id),children:`Open Area`}),(0,R.jsx)(W,{nodes:i,onSelectNode:n})]},r.id)})]})}var X={binds:`Binds`,in:`In repository`,mentions:`Mentions`,"co-change":`Changed together`};function Z({wire:e,search:t,onSelectNode:n,edge:r}){let i=N(e,r);if(!i)return(0,R.jsx)(`p`,{className:`m-0 px-5 py-4 text-sm text-muted`,children:`This connection is no longer in the graph.`});let a=e.nodes[i.source],o=e.nodes[i.target],s=i.kind===`co-change`?te(e,i.source,i.target):[];return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(p,{title:X[i.kind],kicker:i.kind===`co-change`?(0,R.jsx)(`span`,{children:`${i.weight} shared archived ${i.weight===1?`change`:`changes`}`}):null,children:(0,R.jsxs)(`span`,{className:`flex flex-wrap items-center gap-1.5 font-mono text-sm`,children:[(0,R.jsx)(`button`,{type:`button`,className:`border-0 bg-transparent p-0 text-accent`,onClick:()=>n(a.id),children:a.label}),(0,R.jsx)(`span`,{className:`text-muted`,"aria-hidden":`true`,children:i.kind===`co-change`?`↔`:`→`}),(0,R.jsx)(`button`,{type:`button`,className:`border-0 bg-transparent p-0 text-accent`,onClick:()=>n(o.id),children:o.label})]})}),i.kind===`co-change`?(0,R.jsx)(d,{title:`Archived changes`,aside:s.length,children:(0,R.jsx)(U,{archives:s,capabilities:[a.label,o.label],search:t,empty:`No archive names both specs.`})}):null]})}function ne({selection:e,...t}){if(`edge`in e)return(0,R.jsx)(Z,{...t,edge:e.edge});let n=t.index.byId.get(e.node);if(n===void 0)return null;let r=t.wire.nodes[n].kind;return r===`capability`?(0,R.jsx)(K,{...t,node:n}):r===`area`?(0,R.jsx)(J,{...t,node:n}):(0,R.jsx)(Y,{...t,node:n})}var re=(0,x.lazy)(()=>y(()=>import(`./graph-canvas-DDuzsNSx.js`),__vite__mapDeps([0,1,2]))),ie={binds:`Areas`,in:`Repositories`,mentions:`Mentions`,"co-change":`Changed together`};function ae({search:n,node:r,onNodeChange:i}){let a=e({...u(n.companion??``),enabled:!!n.companion});return a.data?(0,R.jsx)(oe,{wire:a.data,search:n,node:r,onNodeChange:i}):a.isError?(0,R.jsx)(`section`,{className:t(s,`pb-10`),children:(0,R.jsxs)(c,{children:[`The spec graph could not be built: `,a.error.message]})}):(0,R.jsx)(`section`,{className:t(s,`pb-10`),children:(0,R.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Building the spec graph…`})})}function oe({wire:e,search:n,node:r,onNodeChange:i}){let a=(0,x.useMemo)(()=>ee(e),[e]),[o,l]=(0,x.useState)(k),[u,d]=(0,x.useState)(null),p=u?.wire===e?u.edge:null,[m,h]=(0,x.useState)(null),g=e.nodes.filter(e=>e.kind===`capability`).length,_=r!==void 0&&a.byId.has(r)?r:null,v=p===null?_?{node:_}:null:{edge:p},y=e=>{d(null),i(e??void 0)},b=e=>{y(e),h(t=>({id:e,nonce:(t?.nonce??0)+1}))};if(g===0)return(0,R.jsx)(`section`,{className:t(s,`pb-10`),children:(0,R.jsx)(c,{children:`No specs in this companion.`})});let S=I(v);return(0,R.jsxs)(`section`,{className:t(s,`flex min-h-[480px] flex-1 flex-col gap-2 pb-4`),"aria-label":`Spec graph`,"data-graph-view":!0,children:[(0,R.jsx)(se,{wire:e,filter:o,onFilter:l,onFocus:b}),(0,R.jsx)(Q,{wire:e,onSelectNode:b}),(0,R.jsxs)(`div`,{className:`relative min-h-0 flex-1 overflow-hidden rounded-card border border-rule`,children:[(0,R.jsx)(x.Suspense,{fallback:(0,R.jsx)(`p`,{className:`m-0 p-4 text-sm text-muted`,children:`Loading the renderer…`}),children:(0,R.jsx)(re,{wire:e,layoutKey:n.companion??``,filter:o,selected:_,focus:m,onSelectNode:y,onSelectEdge:t=>{i(void 0),d({wire:e,edge:t})}})}),(0,R.jsx)(ce,{})]}),(0,R.jsx)(f,{items:S?[S]:[],current:S,onSelect:e=>{e===null&&y(null)},wide:!0,title:v?P(e,a,v):`Graph`,children:v?(0,R.jsx)(ne,{selection:v,wire:e,index:a,search:n,onSelectNode:b}):null})]})}function se({wire:e,filter:t,onFilter:r,onFocus:i}){let[a,o]=(0,x.useState)(``),s=(0,x.useId)(),c=(0,x.useMemo)(()=>M(e,a),[e,a]),l=(0,x.useMemo)(()=>{let t=1;return O(e,(e,n,r,i)=>{r===`co-change`&&(t=Math.max(t,i))}),t},[e]),u=e=>{let n=new Set(t.hidden);n.has(e)?n.delete(e):n.add(e),r({...t,hidden:n})};return(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2`,role:`toolbar`,"aria-label":`Graph controls`,children:[(0,R.jsxs)(`form`,{className:`relative`,role:`search`,onSubmit:e=>{e.preventDefault(),c[0]&&(i(c[0].id),o(``))},children:[(0,R.jsxs)(`label`,{className:`flex h-8 items-center gap-2 rounded-control border border-rule bg-surface px-2.5`,children:[(0,R.jsx)(n,{name:`search`,className:`size-3.5 text-muted`}),(0,R.jsx)(`span`,{className:`sr-only`,children:`Find a spec, Area or repository`}),(0,R.jsx)(`input`,{className:`w-56 border-0 bg-transparent text-sm text-text outline-none placeholder:text-muted`,placeholder:`Find a spec, Area or repository`,value:a,onChange:e=>o(e.target.value),"aria-controls":s,"aria-autocomplete":`list`,"data-graph-search":!0})]}),c.length>0?(0,R.jsx)(`ul`,{id:s,className:`absolute top-9 left-0 z-20 m-0 grid w-80 list-none gap-0.5 rounded-control border border-rule bg-surface p-1 shadow-float`,"aria-label":`Matches`,children:c.map(e=>(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{type:`button`,className:`flex w-full items-baseline gap-2 rounded-[4px] border-0 bg-transparent px-2 py-1 text-left text-sm text-text hover:bg-page`,onClick:()=>{i(e.id),o(``)},children:[(0,R.jsx)(`span`,{className:`min-w-0 truncate font-mono`,children:e.label}),(0,R.jsx)(`span`,{className:`ml-auto text-2xs text-muted`,children:L(e)})]})},e.id))}):null]}),(0,R.jsxs)(`fieldset`,{className:`m-0 flex flex-wrap items-center gap-3 border-0 p-0`,children:[(0,R.jsx)(`legend`,{className:`sr-only`,children:`Connections shown`}),h.map(e=>(0,R.jsxs)(`label`,{className:`inline-flex items-center gap-1.5 text-xs text-muted`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:!t.hidden.has(e),onChange:()=>u(e),"data-graph-edge-kind":e}),ie[e]]},e))]}),l>1?(0,R.jsxs)(`label`,{className:`inline-flex items-center gap-2 text-xs text-muted`,children:[`Changed together at least`,(0,R.jsx)(`input`,{type:`range`,min:1,max:l,value:t.minWeight,onChange:e=>r({...t,minWeight:Number(e.target.value)}),disabled:t.hidden.has(`co-change`),"data-graph-min-weight":!0}),(0,R.jsxs)(`span`,{className:`w-4 font-mono tabular-nums`,children:[t.minWeight,`×`]})]}):null]})}function Q({wire:e,onSelectNode:t}){if(e.unbound.length===0&&e.broken.length===0)return null;let n=[e.unbound.length>0?`${e.unbound.length} unbound ${e.unbound.length===1?`spec`:`specs`}`:null,e.broken.length>0?`${e.broken.length} broken ${e.broken.length===1?`link`:`links`}`:null].filter(Boolean);return(0,R.jsxs)(`details`,{className:`text-xs text-muted`,"data-graph-problems":!0,children:[(0,R.jsx)(`summary`,{className:`cursor-pointer text-warn`,children:n.join(` · `)}),(0,R.jsxs)(`div`,{className:`grid gap-2 pt-2`,children:[e.unbound.length>0?(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`m-0`,children:`They name no repository/Area pair, so they bind nothing:`}),(0,R.jsx)(`p`,{className:`m-0 flex flex-wrap gap-x-2 font-mono`,children:e.unbound.map(e=>(0,R.jsx)(`button`,{type:`button`,className:`border-0 bg-transparent p-0 text-text hover:text-accent`,onClick:()=>t(_(e)),children:e},e))})]}):null,e.broken.length>0?(0,R.jsx)(`ul`,{className:`m-0 grid list-none gap-0.5 p-0 font-mono`,"aria-label":`Broken links`,children:e.broken.map(e=>(0,R.jsxs)(`li`,{children:[e.from,` → `,(0,R.jsx)(`span`,{className:`text-bad`,children:e.target})]},`${e.from}>${e.target}`))}):null]})]})}function ce(){return(0,R.jsxs)(`ul`,{className:`pointer-events-none absolute top-2 left-2 m-0 flex list-none gap-3 rounded-control bg-[color-mix(in_srgb,var(--panel)_85%,transparent)] px-2 py-1 text-2xs text-muted`,"aria-label":`Legend`,children:[(0,R.jsxs)(`li`,{className:`inline-flex items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`size-1.5 rounded-full bg-accent`,"aria-hidden":`true`}),` Spec`]}),(0,R.jsxs)(`li`,{className:`inline-flex items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`size-2 rounded-full bg-info`,"aria-hidden":`true`}),` Area`]}),(0,R.jsxs)(`li`,{className:`inline-flex items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`size-2.5 rounded-full bg-why`,"aria-hidden":`true`}),` Repository`]})]})}var le=i({component:()=>$}),$=function(){let e=b.useSearch(),t=b.useNavigate();return e.companion?(0,R.jsx)(ae,{search:{companion:e.companion,studioMode:e.studioMode},node:e.node,onNodeChange:e=>void t({search:t=>({...t,node:e}),replace:!1})}):null};export{O as a,E as c,$ as component,A as i,S as n,j as o,C as r,D as s,le as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{W as e,et as t}from"./studio-queries-CFP_yTpr.js";var n=e({method:`GET`}).handler(t(`b2e22d82aeef8a3802144ae67d3a53a4fff5860a1a0b957618e8dcc7c0ef36c8`));export{n as t};
|