@intent-hq/web 2.383.6 → 2.383.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.
Files changed (148) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{w2q0NJFW.js → 1pggOq7Y.js} +1 -1
  3. package/web/app/immutable/chunks/{3gdcau2g.js → 3Ldfn3Hk.js} +1 -1
  4. package/web/app/immutable/chunks/{DML-1n7e.js → 7gWOOPbU.js} +1 -1
  5. package/web/app/immutable/chunks/{RwU8EQ7-.js → 7xJIif_I.js} +1 -1
  6. package/web/app/immutable/chunks/{DdYRxRPc.js → B-GeM0hN.js} +1 -1
  7. package/web/app/immutable/chunks/{CAgJTEqX.js → B1xhmeEH.js} +1 -1
  8. package/web/app/immutable/chunks/{DAi59CB_.js → B76xmWcE.js} +1 -1
  9. package/web/app/immutable/chunks/{okU6lEoA.js → B9nR8abu.js} +1 -1
  10. package/web/app/immutable/chunks/{B51SeJXG.js → BAlOCGA0.js} +1 -1
  11. package/web/app/immutable/chunks/{C2307jRD.js → BJJHfc9t.js} +1 -1
  12. package/web/app/immutable/chunks/{ByGaQPue.js → BK9M_z99.js} +1 -1
  13. package/web/app/immutable/chunks/{C8iCqYhc.js → BKS-pxip.js} +1 -1
  14. package/web/app/immutable/chunks/{DT4Cgjmu.js → BLUz30qV.js} +1 -1
  15. package/web/app/immutable/chunks/{DfNht_cf.js → BPXHGMqU.js} +1 -1
  16. package/web/app/immutable/chunks/{BTtB75CV.js → BQDKcjOE.js} +1 -1
  17. package/web/app/immutable/chunks/{DoDP-NJt.js → BSVf-Bjr.js} +1 -1
  18. package/web/app/immutable/chunks/{Bp4RMAg2.js → BTKxt0G5.js} +1 -1
  19. package/web/app/immutable/chunks/{DMtuN9wu.js → BTQPEfI4.js} +1 -1
  20. package/web/app/immutable/chunks/{D93FnkSV.js → BURetyvc.js} +1 -1
  21. package/web/app/immutable/chunks/{DTpKHtQ2.js → BUtc5GRR.js} +1 -1
  22. package/web/app/immutable/chunks/{BDATxlJG.js → BVAdLfsa.js} +4 -4
  23. package/web/app/immutable/chunks/{BsuKoRte.js → BYFX8NvB.js} +1 -1
  24. package/web/app/immutable/chunks/{D0a_zKAq.js → BbV6sku_.js} +1 -1
  25. package/web/app/immutable/chunks/{C2XGUcnW.js → BbbgNz0Q.js} +1 -1
  26. package/web/app/immutable/chunks/{BZxyR-1L.js → BdTfZwM8.js} +1 -1
  27. package/web/app/immutable/chunks/{dpO6awDJ.js → BhqgbIQr.js} +1 -1
  28. package/web/app/immutable/chunks/{Dx_8-INB.js → Bjm5XArF.js} +1 -1
  29. package/web/app/immutable/chunks/{JbVFIGCp.js → BkfS5KoW.js} +40 -40
  30. package/web/app/immutable/chunks/{umMyGIUt.js → BmlblCgy.js} +1 -1
  31. package/web/app/immutable/chunks/{C9Ea_4DW.js → BnbH2DvO.js} +1 -1
  32. package/web/app/immutable/chunks/{CqcYFh8j.js → Bo1VuU-H.js} +1 -1
  33. package/web/app/immutable/chunks/{vpidVnoK.js → Bo7KS63f.js} +1 -1
  34. package/web/app/immutable/chunks/{Cb0qNR4H.js → BpfNraM2.js} +1 -1
  35. package/web/app/immutable/chunks/{BlU12h14.js → Brm4kmEq.js} +1 -1
  36. package/web/app/immutable/chunks/{x8QjiOrF.js → BtxkToW7.js} +1 -1
  37. package/web/app/immutable/chunks/{DwEGyXAz.js → Buso8jHT.js} +1 -1
  38. package/web/app/immutable/chunks/{DswCtQ8W.js → ByDL4Wt0.js} +1 -1
  39. package/web/app/immutable/chunks/{DOXAHHuz.js → C2o4LFKC.js} +2 -2
  40. package/web/app/immutable/chunks/{B5R37z34.js → C6AhVpEM.js} +3 -3
  41. package/web/app/immutable/chunks/{CjJvlfCr.js → C89-HR3N.js} +4 -4
  42. package/web/app/immutable/chunks/{BNK8isss.js → C8za2RwY.js} +1 -1
  43. package/web/app/immutable/chunks/{C-HPMTfc.js → CC1pNuhl.js} +1 -1
  44. package/web/app/immutable/chunks/{B0iC7Hp2.js → CDaqERFv.js} +1 -1
  45. package/web/app/immutable/chunks/{DUJWrM6V.js → CE0T7dwE.js} +3 -3
  46. package/web/app/immutable/chunks/{BxQcCpea.js → CGOaYbWk.js} +1 -1
  47. package/web/app/immutable/chunks/{Cm4ptdH4.js → CGnOIrwW.js} +1 -1
  48. package/web/app/immutable/chunks/{BdReS-5Z.js → CJL0nxkZ.js} +1 -1
  49. package/web/app/immutable/chunks/{DtmCgGP_.js → CKyxiFOy.js} +2 -2
  50. package/web/app/immutable/chunks/{BmRtsF0k.js → COBU-CLw.js} +3 -3
  51. package/web/app/immutable/chunks/{lkgbZnYm.js → COW99wsu.js} +1 -1
  52. package/web/app/immutable/chunks/{CgCfiUM-.js → CRR7Y95m.js} +2 -2
  53. package/web/app/immutable/chunks/{DAj3--4v.js → CRfEdILh.js} +1 -1
  54. package/web/app/immutable/chunks/{DYVqPPax.js → CS4mJHYc.js} +1 -1
  55. package/web/app/immutable/chunks/{CeGEVvKd.js → CSRKWN2m.js} +2 -2
  56. package/web/app/immutable/chunks/{DayBneSF.js → CShcKF5d.js} +1 -1
  57. package/web/app/immutable/chunks/{BYsxLCZX.js → CUfjsZQQ.js} +1 -1
  58. package/web/app/immutable/chunks/{DDWXzJJL.js → CZsHRLvg.js} +1 -1
  59. package/web/app/immutable/chunks/{C6UuYHLt.js → C_zDgOHy.js} +1 -1
  60. package/web/app/immutable/chunks/{CIWayVej.js → CaiHVgqy.js} +1 -1
  61. package/web/app/immutable/chunks/{7EHgRnzQ.js → Cb9Smg8Z.js} +1 -1
  62. package/web/app/immutable/chunks/{BHzfXdU-.js → CbT0r42d.js} +1 -1
  63. package/web/app/immutable/chunks/{syIfkUtY.js → Cc4N9YOF.js} +2 -2
  64. package/web/app/immutable/chunks/{D1gev-Oa.js → Cg61PLZh.js} +1 -1
  65. package/web/app/immutable/chunks/{CbazPhvO.js → CjpmxxIF.js} +1 -1
  66. package/web/app/immutable/chunks/{BRdwblgo.js → Cka0AqTN.js} +1 -1
  67. package/web/app/immutable/chunks/{D85Dkv1L.js → CkvXIU5f.js} +1 -1
  68. package/web/app/immutable/chunks/{6mKf423T.js → ClZz0jys.js} +1 -1
  69. package/web/app/immutable/chunks/{BxTLs9JS.js → ClfSST38.js} +1 -1
  70. package/web/app/immutable/chunks/{Zc9S8AIT.js → CmQgxntP.js} +1 -1
  71. package/web/app/immutable/chunks/{B5lAxopi.js → CmoThujO.js} +1 -1
  72. package/web/app/immutable/chunks/{BFKNHcgD.js → CpwGgnWV.js} +1 -1
  73. package/web/app/immutable/chunks/{CHoUTmhW.js → CqjTdgdP.js} +1 -1
  74. package/web/app/immutable/chunks/{pAMHAQGK.js → CzAdFBS-.js} +1 -1
  75. package/web/app/immutable/chunks/{D3KbOo9x.js → D0DWZnGH.js} +2 -2
  76. package/web/app/immutable/chunks/{DPTzvpZC.js → D0i8GwSa.js} +2 -2
  77. package/web/app/immutable/chunks/{DA6FwFPA.js → D0n-4lqf.js} +3 -3
  78. package/web/app/immutable/chunks/{CfOfDsl2.js → D2EoEx7R.js} +1 -1
  79. package/web/app/immutable/chunks/{ZAGtf4QC.js → D2Y3lcdt.js} +4 -4
  80. package/web/app/immutable/chunks/{DSpm6A1W.js → D3qmsAQt.js} +2 -2
  81. package/web/app/immutable/chunks/{BpIice81.js → D5EQeUyi.js} +1 -1
  82. package/web/app/immutable/chunks/{gXSh3Rqp.js → DAreoJms.js} +1 -1
  83. package/web/app/immutable/chunks/{bQJcjDVH.js → DBD3Fgdf.js} +1 -1
  84. package/web/app/immutable/chunks/{BNbuor20.js → DBvm0g7B.js} +1 -1
  85. package/web/app/immutable/chunks/{Day2rmDJ.js → DDYaIqxc.js} +1 -1
  86. package/web/app/immutable/chunks/{BlU2v4uc.js → DTDpxeis.js} +1 -1
  87. package/web/app/immutable/chunks/{IcuTx12D.js → DU7k8Meq.js} +1 -1
  88. package/web/app/immutable/chunks/{DqUfbKVJ.js → DUUjp9sb.js} +1 -1
  89. package/web/app/immutable/chunks/{DsevRTZh.js → DaNZLNee.js} +1 -1
  90. package/web/app/immutable/chunks/{Bhl-6bQ6.js → DaVnXn1w.js} +1 -1
  91. package/web/app/immutable/chunks/{DPpIdNvg.js → Dbkui2NJ.js} +1 -1
  92. package/web/app/immutable/chunks/{CdyTEe8y.js → Dea7iEsq.js} +1 -1
  93. package/web/app/immutable/chunks/{CBh3oApX.js → Df8HaglQ.js} +1 -1
  94. package/web/app/immutable/chunks/{DTFjA6nd.js → DgSmYey_.js} +1 -1
  95. package/web/app/immutable/chunks/{BBIYuEK_.js → DhBr4igy.js} +1 -1
  96. package/web/app/immutable/chunks/{BsHKPA8J.js → DiKXd1w8.js} +2 -2
  97. package/web/app/immutable/chunks/{BBdixUsX.js → DqkmESML.js} +1 -1
  98. package/web/app/immutable/chunks/DrG_DaSS.js +12 -0
  99. package/web/app/immutable/chunks/{RnZ98Lx7.js → DrOujub9.js} +1 -1
  100. package/web/app/immutable/chunks/{CHTaR4fl.js → DsKSelM2.js} +1 -1
  101. package/web/app/immutable/chunks/{Cv71FrWX.js → DtAW1k1y.js} +1 -1
  102. package/web/app/immutable/chunks/{BhFoVE_t.js → DtKxKldd.js} +1 -1
  103. package/web/app/immutable/chunks/{BzuFQ4uC.js → Dua5IJ1m.js} +1 -1
  104. package/web/app/immutable/chunks/{Cyc867L5.js → DxM5221X.js} +1 -1
  105. package/web/app/immutable/chunks/{eJ7uL4LD.js → DyLYpcbU.js} +1 -1
  106. package/web/app/immutable/chunks/{wUEfWFO0.js → DyU1d4KO.js} +1 -1
  107. package/web/app/immutable/chunks/{UmmBf5TK.js → K0UaKTlA.js} +1 -1
  108. package/web/app/immutable/chunks/{e2T92U2C.js → M1pm4Ylz.js} +3 -3
  109. package/web/app/immutable/chunks/{Dvrtbry_.js → M4SSivqw.js} +1 -1
  110. package/web/app/immutable/chunks/{606ykLjp.js → Ok-Tb49z.js} +3 -3
  111. package/web/app/immutable/chunks/{xCOOeB5y.js → PWCv1nwS.js} +1 -1
  112. package/web/app/immutable/chunks/{B2REQkHq.js → TwgPo_u9.js} +3 -3
  113. package/web/app/immutable/chunks/{Bx7gEyNR.js → a-NM4LeO.js} +1 -1
  114. package/web/app/immutable/chunks/{1a7PBgFk.js → c1qYicwM.js} +1 -1
  115. package/web/app/immutable/chunks/{C5I-aQNv.js → e_FRlhPf.js} +1 -1
  116. package/web/app/immutable/chunks/{CDr_0i5Z.js → fKj7i94n.js} +1 -1
  117. package/web/app/immutable/chunks/{DhHELjW9.js → hoVWzIJA.js} +1 -1
  118. package/web/app/immutable/chunks/{FKyiybGz.js → ijAQGDk2.js} +1 -1
  119. package/web/app/immutable/chunks/{DrK3Y0uD.js → j9JAHeUU.js} +2 -2
  120. package/web/app/immutable/chunks/{CXqdP_ch.js → jVKXeiL6.js} +1 -1
  121. package/web/app/immutable/chunks/{3lsVHf6U.js → jbr21ium.js} +1 -1
  122. package/web/app/immutable/chunks/{DGdXhwsJ.js → m6pGB8MK.js} +1 -1
  123. package/web/app/immutable/chunks/{oZzpgNB8.js → pxZ1G7sU.js} +1 -1
  124. package/web/app/immutable/chunks/{DODT78Qk.js → rotY2sdQ.js} +1 -1
  125. package/web/app/immutable/chunks/{WIWu6pzv.js → tDrnMawv.js} +1 -1
  126. package/web/app/immutable/chunks/{CChkl_5h.js → vjpfI6xX.js} +1 -1
  127. package/web/app/immutable/chunks/{qEaQygdG.js → xG-zLBf8.js} +1 -1
  128. package/web/app/immutable/chunks/{BYBhz2vc.js → yDR0_Br6.js} +3 -3
  129. package/web/app/immutable/entry/{app.DTU8Ib8_.js → app.PgiJw0D4.js} +2 -2
  130. package/web/app/immutable/entry/start.C2TmF15J.js +1 -0
  131. package/web/app/immutable/nodes/{0.DSHPaYBf.js → 0.cff5OhJc.js} +1 -1
  132. package/web/app/immutable/nodes/{1.DKliZtsI.js → 1.D2tI4cty.js} +1 -1
  133. package/web/app/immutable/nodes/{10.mXAnRqVu.js → 10.BnJGsWqJ.js} +4 -4
  134. package/web/app/immutable/nodes/{11.BNoZ2Awp.js → 11.D8yEv7E-.js} +1 -1
  135. package/web/app/immutable/nodes/{15.CklBb62Z.js → 15.CozJxxNW.js} +1 -1
  136. package/web/app/immutable/nodes/{19.BxZ4y2DZ.js → 19.DH3ipUNG.js} +2 -2
  137. package/web/app/immutable/nodes/{2.DZmz8fq0.js → 2.DX0DfJJh.js} +4 -4
  138. package/web/app/immutable/nodes/{3.umir6RZQ.js → 3.Bxlo4Xts.js} +1 -1
  139. package/web/app/immutable/nodes/{4.BN-AJGgH.js → 4.BJEI4s-5.js} +1 -1
  140. package/web/app/immutable/nodes/{5.BbafFHWz.js → 5.CLAljKic.js} +1 -1
  141. package/web/app/immutable/nodes/{6.Zsgk8jus.js → 6.DDVeuDZh.js} +1 -1
  142. package/web/app/immutable/nodes/{7.ChjI-TG1.js → 7.w-I6a2X1.js} +1 -1
  143. package/web/app/immutable/nodes/{8.DPKyN2xT.js → 8.BBjC7avZ.js} +1 -1
  144. package/web/app/immutable/nodes/{9.Ds0Wbr5E.js → 9.ByPAfGSa.js} +13 -13
  145. package/web/app/version.json +1 -1
  146. package/web/index.html +9 -9
  147. package/web/app/immutable/chunks/8o9CPlKy.js +0 -12
  148. package/web/app/immutable/entry/start.vqAdlzsb.js +0 -1
@@ -1 +1 @@
1
- import{t as Ot,bo as R,bm as u,bw as Ft,b as Rt}from"./C0QTy0Sy.js";import{bs as Gt,bV as K,br as rt,bk as er,bj as tr,bH as r,a5 as c,aD as e,bS as n,bl as S,bA as l,b_ as g,bO as m,W as o,bn as Mt,aA as G,c9 as z,be as Ve,b$ as Be,aB as b,c5 as mt,ca as ft,a7 as Ue,ay as U,ai as rr,aj as ar,bf as sr}from"./3SdAC2_C.js";import{i as W}from"./bhKPSdq4.js";import{I as or,g as Xe}from"./B6S6VNu7.js";import{c as Ee}from"./CUkDMZwP.js";import{n as Oe,j as Ze,h as $t}from"./DLwWVKiF.js";import{f as Fe,c as gt,s as nr}from"./7UPrdiE9.js";import{b as xt}from"./Dn334wJv.js";import{F as Te,cR as ir,au as lr,cK as bt,c$ as Pt,cd as cr}from"./U9jJmfYa.js";import{f as ye}from"./CttA-M7l.js";import"./C2jYl_tm.js";import"./Dhy-QJgd.js";import{M as nt}from"./BmRtsF0k.js";import{M as dr}from"./c6a4q1y9.js";import{w as _e}from"./BdReS-5Z.js";import{h as Ct,i as Et,g as Tt,P as At}from"./DlUZpQ7U.js";import{C as ht}from"./D32iIfZB.js";import{c as pr}from"./ChTqQfQN.js";import{A as ur}from"./wl2qP2wF.js";import"./CrD0jtXE.js";import{f as vr}from"./B50rrLDJ.js";import{Jv as _r}from"./_LtUY0jS.js";import{dS as mr}from"./Cppy6ZYG.js";import{S as et,j as fr,a as jt}from"./ZAGtf4QC.js";import{R as qe,c as it,m as gr,bE as tt}from"./BYBhz2vc.js";import"./Cb0qNR4H.js";var xr=b('<div class="w-2 h-2 bg-green-500 rounded-full animate-pulse"></div>'),br=b('<div class="text-sm text-danger bg-danger-background/10 rounded-md p-3"> </div>'),hr=b('<div class="flex items-center gap-2 text-subtle"><!> <span class="text-sm"> </span></div>'),Sr=b('<div class="p-4 max-h-60 overflow-y-auto overscroll-contain"><!></div>'),wr=b('<div class="p-3 bg-muted/30"><div class="flex items-center justify-between mb-2"><div class="flex items-center gap-2"><!> <span class="text-sm font-medium"> </span></div> <!></div> <p class="text-xs text-subtle mb-2"> </p> <div class="h-32 rounded border border-border overflow-hidden"><!></div></div>'),yr=b('<div class="flex flex-col bg-background border border-border rounded-lg overflow-hidden"><div class="flex items-center justify-between px-3 py-2 border-b border-border bg-muted/30"><div class="flex items-center gap-2"><!> <span class="text-sm font-medium"> </span> <!></div> <div class="flex items-center gap-1"><!></div></div> <!> <!></div>');function St(He,P){if(new.target)return Ot({component:St,...He});Gt(P,!0);const at=pr("SetupScriptAgent");let Ae=R(P,"repoPath",7),Re=R(P,"onScriptGenerated",7),Ge=R(P,"onClose",7),Me=K(rt(crypto.randomUUID())),O=K(!1),ae=K(null),me=!1,ie=K(null);er(()=>{me=!0,C()}),tr(()=>{me=!1});async function le(){try{const v=mr.select(_r.state).find(E=>E.repositoryPath===Ae()||E.path===Ae()||E.worktreePath===Ae());return v?String(v.id):null}catch{return null}}async function C(){r(O,!0),r(ae,null),r(ie,null);try{const s=await le();if(!me)return;if(!s){r(ae,u.workspace_setupScriptAgent_noWorkspace_error(),!0),r(O,!1);return}const v=await vr.setupScripts.generate(s);if(!me)return;if(!v||!v.script){r(ae,u.workspace_setupScriptAgent_generateFailed_error(),!0),r(O,!1);return}r(ie,{name:v.projectType?u.workspace_setupScriptAgent_projectTypeSetup_label({projectType:v.projectType}):u.workspace_setupScriptAgent_generatedSetup_label(),description:v.projectType?u.workspace_setupScriptAgent_generatedForProject_description({projectType:v.projectType}):u.workspace_setupScriptAgent_generatedFromAnalysis_description(),content:v.script},!0),r(O,!1)}catch(s){if(at.error("Failed to generate setup script",s),!me)return;r(ae,s instanceof Error?s.message:u.workspace_setupScriptAgent_generateFailed_error(),!0),r(O,!1)}}function fe(s){Re()?.(s)}var ge={get repoPath(){return Ae()},set repoPath(s){Ae(s),G()},get onScriptGenerated(){return Re()},set onScriptGenerated(s){Re(s),G()},get onClose(){return Ge()},set onClose(s){Ge(s),G()},$set:Ft,$on:(s,v)=>Rt(P,s,v)},ce=yr(),xe=c(ce),be=c(xe),De=c(be);ur(De,{variant:"standard",get agentId(){return e(Me)}});var Le=n(De,2),je=S(Le,!0),he=n(Le,2);{var de=s=>{var v=xr();o(s,v)};W(he,s=>{e(O)&&s(de)})}l(be);var Y=n(be,2),ke=c(Y);{let s=z(()=>u.workspace_setupScriptAgent_close_ariaLabel());ye(ke,{variant:"ghost-light",size:"icon-sm",iconOnly:!0,get"aria-label"(){return e(s)},get onclick(){return Ge()},children:(v,E)=>{Te(v,{get icon(){return ir}})},$$slots:{default:!0}})}l(Y),l(xe);var $e=n(xe,2);{var Ie=s=>{var v=Sr(),E=c(v);{var q=B=>{var M=br(),Q=S(M,!0);g(()=>m(Q,e(ae))),o(B,M)},se=B=>{var M=hr(),Q=c(M);or(Q,{size:16,class:"text-primary"});var Se=n(Q,2),ze=S(Se,!0);l(M),g(we=>m(ze,we),[()=>u.workspace_setupScriptAgent_analyzing_label()]),o(B,M)};W(E,B=>{e(ae)?B(q):B(se,-1)})}l(v),o(s,v)};W($e,s=>{(e(ae)||e(O))&&s(Ie)})}var Je=n($e,2);{var pe=s=>{var v=wr(),E=c(v),q=c(E),se=c(q);Te(se,{get icon(){return lr},class:"text-green-500"});var B=n(se,2),M=S(B,!0);l(q);var Q=n(q,2);ye(Q,{variant:"primary",size:"sm",onclick:()=>fe(e(ie)),class:"h-7",children:(Pe,st)=>{Ve();var Ye=Be();g(ct=>m(Ye,ct),[()=>u.workspace_setupScriptAgent_createScript_label()]),o(Pe,Ye)},$$slots:{default:!0}}),l(E);var Se=n(E,2),ze=S(Se,!0),we=n(Se,2),lt=c(we);ht(lt,{get value(){return e(ie).content},language:"shell",readOnly:!0,lineNumbers:!1}),l(we),l(v),g(()=>{m(M,e(ie).name),m(ze,e(ie).description)}),o(s,v)};W(Je,s=>{e(ie)&&!e(O)&&s(pe)})}return l(ce),g(s=>m(je,s),[()=>u.workspace_setupScriptAgent_title()]),o(He,ce),Mt(ge)}var kr=b('<span class="block truncate"> </span>'),$r=b("<div></div>"),Pr=b('<div role="group"></div> <div class="mt-2 border-t border-border pt-2"><!></div> <!> <div class="mt-2 border-t border-border pt-2"><!> <!></div>',1),Cr=b('<code class="type-caption text-muted-foreground"> </code>'),Er=b('<p> </p> <code class="type-caption"> </code>',1),It=b("<!> <!>",1),Tr=b('<div class="mt-2 flex flex-wrap gap-2 px-2"></div>'),Ar=b('<div class="h-44 min-w-0 overflow-hidden rounded-(--radius-medium) border border-border bg-background py-2"><!></div> <div class="mt-2 px-1"><!> <!></div>',1),jr=b('<div class="mb-2 flex items-center justify-between gap-3 px-2"><div class="min-w-0"><h3> </h3> <p class="type-caption truncate text-muted-foreground"> </p></div> <!></div> <!>',1),Ke=b("<div><!></div>"),Ir=b("<!> ",1),Nt=b('<div class="min-w-0 w-full"><span class="text-sm"> </span> <p class="text-xs text-subtle mt-0.5"> </p></div>'),Ut=b('<div class="mb-4"><h4 class="type-caption font-medium text-muted-foreground mb-1.5 px-2"> </h4> <!></div>'),Nr=b('<span class="type-caption px-1.5 py-0.5 rounded-full bg-primary/10 text-primary font-medium shrink-0"> </span>'),Ur=b('<div class="min-w-0 w-full"><div class="flex flex-wrap items-center gap-x-2 gap-y-1"><span class="text-sm"> </span> <!></div> <p class="text-xs text-subtle mt-0.5"> </p></div>'),Or=b('<div class="mb-4"><h4 class="type-caption font-medium text-muted-foreground mb-1.5 px-2"> </h4> <p class="text-xs text-subtle px-2 mb-2"> </p> <!></div> <!> <!> <div class="mb-4"><h4 class="type-caption font-medium text-muted-foreground mb-1.5 px-2"> </h4> <!></div>',1),Fr=b('<code class="type-caption px-1.5 py-0.5 rounded bg-background/80 text-muted-foreground font-mono cursor-pointer hover:bg-background hover:text-foreground transition-colors"> </code>'),Rr=b('<p class="text-xs"> </p> <p class="mt-1 text-xs text-muted-foreground"> <code class="type-caption"> </code></p>',1),Gr=b('<div class="flex flex-wrap items-center gap-x-3 gap-y-1.5 px-3 py-1.5 bg-muted/30 shrink-0"><span class="type-caption font-medium text-muted-foreground shrink-0"> </span> <div class="flex flex-wrap gap-1.5"></div></div> <div class="flex-1 min-h-0 min-w-0 overflow-hidden py-3 bg-background"><!></div>',1),Mr=b('<div class="flex min-h-0 min-w-0 flex-col overflow-y-auto"><!></div> <div class="flex min-h-0 min-w-0 flex-col"><!></div>',1),Dr=b('<div class="flex flex-col min-h-0 min-w-0 overflow-y-auto p-2 md:pr-4"><!></div> <div class="flex flex-col min-w-0 min-h-0"><!></div>',1),Lr=b('<!> <span class="text-sm font-normal text-subtle"> </span> <span class="text-subtle font-normal"> </span>',1),zr=b('<div class="mt-1 pl-7 space-y-3"><!></div>'),Wr=b('<div class="space-y-3"><!></div>'),qr=b("<div><!> <!></div> <!>",1);function Kr(He,P){if(new.target)return Ot({component:Kr,...He});Gt(P,!0);const at=(t,a=sr)=>{{const y=_=>{Te(_,{get icon(){return bt},get class(){return _e.icon}})},j=_=>{var i=kr(),f=S(i,!0);g(()=>m(f,a().name)),o(_,i)},T=_=>{{let i=z(()=>e(st)===a().id?"checked":"empty");dr(_,{get state(){return e(i)}})}};let h=z(()=>e(st)===a().id),$=z(()=>e(st)===a().id);nt(t,{get selected(){return e(h)},get"aria-pressed"(){return e($)},get"data-setup-source"(){return a().id},get class(){return _e.row},onclick:()=>a().id==="custom"?Dt():we(a().id),leading:y,title:j,trailing:T,$$slots:{leading:!0,title:!0,trailing:!0}})}},Ae=t=>{var a=Ke(),y=c(a);{var j=h=>{var $=Pr(),_=U($);Xe(_,21,()=>e(Ye),I=>I.id,(I,F)=>{at(I,()=>e(F))}),l(_);var i=n(_,2),f=c(i);nt(f,{get"aria-expanded"(){return e($e)},get class(){return _e.row},onclick:()=>r($e,!e($e)),leading:w=>{Te(w,{get icon(){return cr},get class(){return _e.icon}})},title:w=>{Ve();var d=Be();g(p=>m(d,p),[()=>u.workspace_setupScriptEditor_templates_label()]),o(w,d)},$$slots:{leading:!0,title:!0}}),l(i);var x=n(i,2);{var k=I=>{var F=$r();Xe(F,21,()=>e(ct),w=>w.id,(w,d)=>{at(w,()=>({id:`template-${e(d).id}`,name:e(d).name}))}),l(F),Oe(3,F,()=>Ze,()=>({tier:"moderate"})),o(I,F)};W(x,I=>{e($e)&&I(k)})}var D=n(x,2),ue=c(D);nt(ue,{get class(){return _e.row},onclick:()=>r(ke,!0),leading:w=>{Te(w,{get icon(){return bt},get class(){return _e.icon}})},title:w=>{Ve();var d=Be();g(p=>m(d,p),[()=>u.workspace_setupScriptPicker_edit_label()]),o(w,d)},$$slots:{leading:!0,title:!0}});var ve=n(ue,2);{const I=d=>{Te(d,{get icon(){return Pt},get class(){return _e.icon}})},F=d=>{Ve();var p=Be();g(N=>m(p,N),[()=>u.workspace_setupScriptEditor_autoGenerate_label()]),o(d,p)};let w=z(()=>!O());nt(ve,{get class(){return _e.row},get disabled(){return e(w)},onclick:()=>{r(ke,!0),r(Y,!0)},leading:I,title:F,$$slots:{leading:!0,title:!0}})}l(D),g(I=>nr(_,"aria-label",I),[()=>u.workspace_setupScriptEditor_setupScript_label()]),o(h,$)},T=h=>{var $=jr(),_=U($),i=c(_),f=c(i),x=S(f,!0),k=n(f,2),D=S(k,!0);l(i);var ue=n(i,2);ye(ue,{variant:"ghost",size:"sm",onclick:()=>{r(ke,!1),r(Y,!1)},children:(w,d)=>{Ve();var p=Be();g(N=>m(p,N),[()=>u.workspace_setupScriptPicker_choose_label()]),o(w,p)},$$slots:{default:!0}}),l(_);var ve=n(_,2);{var I=w=>{St(w,{get repoPath(){return O()},onScriptGenerated:Lt,onClose:()=>r(Y,!1)})},F=w=>{var d=Ar(),p=U(d),N=c(p);xt(ht(N,{language:"shell",lineNumbers:!1,get lineWrapping(){return e(Se)},get value(){return C()},set value(A){C(A)}}),A=>r(pe,A,!0),()=>e(pe)),l(p);var X=n(p,2),H=c(X);ye(H,{variant:"ghost",size:"sm",get active(){return e(Ie)},get"aria-expanded"(){return e(Ie)},onclick:()=>r(Ie,!e(Ie)),children:(A,oe)=>{Ve();var L=Be();g(ee=>m(L,ee),[()=>u.workspace_setupScriptEditor_variables_label()]),o(A,L)},$$slots:{default:!0}});var V=n(H,2);{var Z=A=>{var oe=Ue(),L=U(oe);Ee(L,()=>At,(ee,te)=>{te(ee,{delayDuration:100,children:(ne,Ce)=>{var J=Tr();Xe(J,21,()=>jt,re=>re.name,(re,Ne)=>{var We=Ue(),pt=U(We);Ee(pt,()=>Ct,(Vt,Bt)=>{Bt(Vt,{children:(Ht,Vr)=>{var yt=It(),kt=U(yt);Ee(kt,()=>Et,(ut,vt)=>{vt(ut,{children:(_t,Yt)=>{var Qe=Cr(),ot=S(Qe);g(()=>m(ot,`$${e(Ne).name??""}`)),o(_t,Qe)},$$slots:{default:!0}})});var Jt=n(kt,2);Ee(Jt,()=>Tt,(ut,vt)=>{vt(ut,{side:"top",class:"max-w-xs",children:(_t,Yt)=>{var Qe=Er(),ot=U(Qe),Qt=S(ot,!0),Xt=n(ot,2),Zt=S(Xt,!0);g(()=>{m(Qt,e(Ne).description),m(Zt,e(Ne).example)}),o(_t,Qe)},$$slots:{default:!0}})}),o(Ht,yt)},$$slots:{default:!0}})}),o(re,We)}),l(J),o(ne,J)},$$slots:{default:!0}})}),o(A,oe)};W(V,A=>{e(Ie)&&A(Z)})}l(X),o(w,d)};W(ve,w=>{e(Y)&&O()?w(I):w(F,-1)})}g(w=>{Fe(f,1,gt(_e.title),"svelte-1yy464i"),m(x,w),m(D,e(ze))},[()=>u.workspace_setupScriptPicker_commands_label()]),o(h,$)};W(y,h=>{e(ke)?h(T,-1):h(j)})}l(a),xt(a,h=>r(Je,h),()=>e(Je)),g(()=>Fe(a,1,`${_e.rows} min-w-0`,"svelte-1yy464i")),o(t,a)},Re=t=>{var a=Or(),y=U(a),j=c(y),T=S(j,!0),h=n(j,2),$=S(h,!0),_=n(h,2);{var i=d=>{var p=Ke(),N=c(p);St(N,{get repoPath(){return O()},onScriptGenerated:X=>{r(se,!0),r(s,""),C(X.content),r(E,X.name,!0),r(v,!0),de()?.(C()),r(Y,!1),requestAnimationFrame(()=>e(pe)?.focus())},onClose:()=>r(Y,!1)}),l(p),Oe(3,p,()=>Ze,()=>({tier:"moderate"})),o(d,p)},f=d=>{{let p=z(()=>!O());ye(d,{variant:"ghost",size:"sm",class:"w-full justify-start text-subtle",onclick:()=>r(Y,!0),get disabled(){return e(p)},children:(N,X)=>{var H=Ir(),V=U(H);Te(V,{get icon(){return Pt},class:"mr-1.5"});var Z=n(V);g(A=>m(Z,` ${A??""}`),[()=>u.workspace_setupScriptEditor_autoGenerate_label()]),o(N,H)},$$slots:{default:!0}})}};W(_,d=>{e(Y)&&O()?d(i):d(f,-1)})}l(y);var x=n(y,2);{var k=d=>{var p=Ut(),N=c(p),X=S(N,!0),H=n(N,2);{let V=z(()=>e(s)===qe),Z=z(()=>e(s)===qe);ye(H,{variant:"ghost",truncateLabel:!1,get active(){return e(V)},get"aria-pressed"(){return e(Z)},class:"w-full h-auto justify-start whitespace-normal text-left px-2 py-1.5",onclick:()=>we(qe),children:(A,oe)=>{var L=Nt(),ee=c(L),te=S(ee,!0),ne=n(ee,2),Ce=S(ne,!0);l(L),g((J,re)=>{m(te,J),m(Ce,re)},[()=>tt(it,"repo-config"),()=>u.workspace_setupScriptEditor_repoConfig_description()]),o(A,L)},$$slots:{default:!0}})}l(p),g(V=>m(X,V),[()=>u.workspace_setupScriptEditor_repoConfig_label()]),o(d,p)};W(x,d=>{le()&&d(k)})}var D=n(x,2);{var ue=d=>{var p=Ut(),N=c(p),X=S(N,!0),H=n(N,2);{let V=z(()=>e(s)===B),Z=z(()=>e(s)===B);ye(H,{variant:"ghost",truncateLabel:!1,get active(){return e(V)},get"aria-pressed"(){return e(Z)},class:"w-full h-auto justify-start whitespace-normal text-left px-2 py-1.5",onclick:()=>we(B),children:(A,oe)=>{var L=Nt(),ee=c(L),te=S(ee,!0),ne=n(ee,2),Ce=S(ne,!0);l(L),g((J,re)=>{m(te,J),m(Ce,re)},[()=>tt(e(M).name,e(M).nameSource),()=>u.workspace_setupScriptEditor_lastUsed_description()]),o(A,L)},$$slots:{default:!0}})}l(p),g(V=>m(X,V),[()=>u.workspace_setupScriptEditor_lastUsed_label()]),o(d,p)};W(D,d=>{e(M)&&d(ue)})}var ve=n(D,2),I=c(ve),F=S(I,!0),w=n(I,2);Xe(w,17,()=>et,d=>d.id,(d,p)=>{{let N=z(()=>e(s)===`template-${e(p).id}`),X=z(()=>e(s)===`template-${e(p).id}`);ye(d,{variant:"ghost",truncateLabel:!1,get active(){return e(N)},get"aria-pressed"(){return e(X)},class:"w-full h-auto justify-start whitespace-normal text-left px-2 py-1.5",onclick:()=>we(`template-${e(p).id}`),children:(H,V)=>{var Z=Ur(),A=c(Z),oe=c(A),L=S(oe,!0),ee=n(oe,2);{var te=J=>{var re=Nr(),Ne=S(re,!0);g(We=>m(Ne,We),[()=>u.workspace_setupScriptEditor_recommended_label()]),o(J,re)};W(ee,J=>{e(p).projectType===ie()&&J(te)})}l(A);var ne=n(A,2),Ce=S(ne,!0);l(Z),g(()=>{m(L,e(p).name),m(Ce,e(p).description)}),o(H,Z)},$$slots:{default:!0}})}}),l(ve),g((d,p,N)=>{m(T,d),m($,p),m(F,N)},[()=>u.workspace_setupScriptEditor_generate_label(),()=>u.workspace_setupScriptEditor_generate_description(),()=>u.workspace_setupScriptEditor_templates_label()]),o(t,a)},Ge=t=>{var a=Gr(),y=U(a),j=c(y),T=S(j,!0),h=n(j,2);Xe(h,21,()=>jt,i=>i.name,(i,f)=>{var x=Ue(),k=U(x);Ee(k,()=>At,(D,ue)=>{ue(D,{delayDuration:100,children:(ve,I)=>{var F=Ue(),w=U(F);Ee(w,()=>Ct,(d,p)=>{p(d,{delayDuration:100,children:(N,X)=>{var H=It(),V=U(H);Ee(V,()=>Et,(A,oe)=>{oe(A,{children:(L,ee)=>{var te=Fr(),ne=S(te);g(()=>m(ne,`$${e(f).name??""}`)),o(L,te)},$$slots:{default:!0}})});var Z=n(V,2);Ee(Z,()=>Tt,(A,oe)=>{oe(A,{side:"bottom",class:"max-w-xs z-[200]",children:(L,ee)=>{var te=Rr(),ne=U(te),Ce=S(ne,!0),J=n(ne,2),re=c(J),Ne=n(re),We=S(Ne,!0);l(J),g(pt=>{m(Ce,e(f).description),m(re,`${pt??""} `),m(We,e(f).example)},[()=>u.workspace_setupScriptEditor_example_before()]),o(L,te)},$$slots:{default:!0}})}),o(N,H)},$$slots:{default:!0}})}),o(ve,F)},$$slots:{default:!0}})}),o(i,x)}),l(h),l(y);var $=n(y,2),_=c($);xt(ht(_,{language:"shell",lineNumbers:!0,get lineWrapping(){return e(Se)},get value(){return C()},set value(i){C(i)}}),i=>r(pe,i,!0),()=>e(pe)),l($),g(i=>m(T,i),[()=>u.workspace_setupScriptEditor_variables_label()]),ar("keydown",$,i=>{i.altKey&&i.key==="z"&&(i.preventDefault(),r(Se,!e(Se)))}),o(t,a)},Me=t=>{var a=Ke(),y=c(a);{var j=h=>{var $=Mr(),_=U($),i=c(_);Re(i),l(_);var f=n(_,2),x=c(f);Ge(x),l(f),Oe(1,_,()=>$t,()=>({tier:"moderate",axis:"x",distance:-8})),Oe(1,f,()=>$t,()=>({tier:"moderate",axis:"x"})),o(h,$)},T=h=>{var $=Dr(),_=U($),i=c(_);Re(i),l(_);var f=n(_,2),x=c(f);Ge(x),l(f),o(h,$)};W(y,h=>{he()==="workspace"?h(j):h(T,-1)})}l(a),g(()=>Fe(a,1,gt(he()==="workspace"?"setup-workspace-layout":"grid flex-1 min-h-0 min-w-0 grid-cols-1 grid-rows-[minmax(0,1fr)_minmax(0,2fr)] md:grid-cols-[minmax(0,2fr)_minmax(0,3fr)] md:grid-rows-1"),"svelte-1yy464i")),o(t,a)};let O=R(P,"repoPath",7,""),ae=R(P,"repositoryKey",7),me=R(P,"githubUrl",7,null),ie=R(P,"projectType",7,void 0),le=R(P,"repoConfigScript",7,null),C=R(P,"value",15,""),fe=R(P,"expanded",15,!1),ge=R(P,"scriptName",31,()=>rt(u.workspace_setupScriptEditor_custom_name())),ce=R(P,"scriptNameSource",15,"named"),xe=R(P,"isCustomScript",15,!1),be=R(P,"compact",7,!1),De=R(P,"triggerClass",7,""),Le=R(P,"contentOnly",7,!1),je=R(P,"contentClass",7,""),he=R(P,"presentation",7,"editor"),de=R(P,"onchange",7),Y=K(!1),ke=K(rt(mt(()=>xe()))),$e=K(!1),Ie=K(!1),Je=K(void 0),pe=K(void 0),s=K(""),v=K(!1),E=K(rt(ge())),q=K(rt(ce())),se=K(!1);const B="last-used",M=z(()=>{const t=ae()??O(),a=t?gr(t,me()):void 0;return a?.nameSource==="repo-config"?{...a,name:"Custom",nameSource:"custom"}:a}),Q=z(()=>{const t=new Map;return le()&&t.set(qe,{content:le(),label:it,source:"repo-config"}),e(M)&&t.set(B,{content:e(M).content,label:e(M).name,source:e(M).nameSource}),et.forEach(a=>{t.set(`template-${a.id}`,{content:fr(a),label:a.name,source:"named"})}),t});let Se=K(!0);const ze=z(()=>{if(e(v))return tt(e(E),e(q));if(!e(s))return u.workspace_setupScriptEditor_custom_name();const t=e(Q).get(e(s));return t?tt(t.label,t.source):u.workspace_setupScriptEditor_custom_name()});function we(t){r(s,t,!0),r(v,!1),r(se,!0);const a=e(Q).get(t);a&&(C(a.content),r(E,a.label,!0),r(q,a.source,!0),de()?.(C())),he()==="picker"?(r(ke,!1),r($e,!1),requestAnimationFrame(()=>e(Je)?.querySelector("[data-setup-source][aria-pressed=true]")?.focus())):requestAnimationFrame(()=>e(pe)?.focus())}function lt(t){if(e(s)&&e(s)!=="none"){const a=e(Q).get(e(s));a&&r(v,t!==a.content)}else t&&r(v,!0)}const Pe=(()=>{const t=et.find(a=>a.id==="generic");return t?`template-${t.id}`:""})(),st=z(()=>e(v)||!e(s)?"custom":e(s)),Ye=z(()=>{const t=[];le()&&t.push({id:qe,name:tt(it,"repo-config")}),e(M)&&t.push({id:B,name:u.workspace_setupScriptEditor_lastUsed_label()});for(const a of et){const y=`template-${a.id}`;(y===Pe||y===e(s))&&t.push({id:y,name:a.name})}return t.push({id:"custom",name:u.workspace_setupScriptPicker_custom_label()}),t}),ct=z(()=>et.filter(t=>!e(Ye).some(a=>a.id===`template-${t.id}`)));function Dt(){r(s,""),r(v,!0),r(E,"Custom"),r(q,"custom"),r(Y,!1),r(ke,!0),requestAnimationFrame(()=>e(pe)?.focus())}function Lt(t){r(se,!0),r(s,""),C(t.content),r(E,t.name,!0),r(q,"named"),r(v,!0),de()?.(C()),r(Y,!1),requestAnimationFrame(()=>e(pe)?.focus())}let dt=K(null);ft(()=>{const t=ae()??O();if(t===e(dt))return;const a=e(dt)===null&&(xe()||C().trim().length>0);if(r(dt,t,!0),a){mt(()=>{let T=!1;const h=C().trim();for(const[$,_]of e(Q).entries())if(h===_.content.trim()&&_.source===ce()&&_.label===ge()){r(s,$,!0),r(E,_.label,!0),r(q,_.source,!0),r(v,!1),T=!0;break}T||(r(v,!0),e(E)||(r(E,ge()||u.workspace_setupScriptEditor_custom_name(),!0),r(q,ge()?ce():"named",!0))),r(se,!0)});return}const y=!!le(),j=e(M);if(mt(()=>{if(r(v,!1),r(se,!0),y)r(s,qe,!0),r(E,it,!0),r(q,"repo-config");else if(j)r(s,B),r(E,j.name,!0),r(q,j.nameSource,!0);else if(Pe){r(s,Pe,!0);const T=e(Q).get(Pe);r(E,T?.label||u.workspace_setupScriptEditor_custom_name(),!0),r(q,"named")}else r(E,u.workspace_setupScriptEditor_custom_name(),!0),r(q,"named")}),y&&le())C(le()),de()?.(C());else if(j)C(j.content),de()?.(C());else if(Pe){const T=e(Q).get(Pe);T&&(C(T.content),de()?.(C()))}}),ft(()=>{if(e(se)){r(se,!1);return}C()!==void 0&&lt(C())}),ft(()=>{ge(e(E)),ce(e(q)),xe(e(v))});var zt={get repoPath(){return O()},set repoPath(t=""){O(t),G()},get repositoryKey(){return ae()},set repositoryKey(t){ae(t),G()},get githubUrl(){return me()},set githubUrl(t=null){me(t),G()},get projectType(){return ie()},set projectType(t=void 0){ie(t),G()},get repoConfigScript(){return le()},set repoConfigScript(t=null){le(t),G()},get value(){return C()},set value(t=""){C(t),G()},get expanded(){return fe()},set expanded(t=!1){fe(t),G()},get scriptName(){return ge()},set scriptName(t=u.workspace_setupScriptEditor_custom_name()){ge(t),G()},get scriptNameSource(){return ce()},set scriptNameSource(t="named"){ce(t),G()},get isCustomScript(){return xe()},set isCustomScript(t=!1){xe(t),G()},get compact(){return be()},set compact(t=!1){be(t),G()},get triggerClass(){return De()},set triggerClass(t=""){De(t),G()},get contentOnly(){return Le()},set contentOnly(t=!1){Le(t),G()},get contentClass(){return je()},set contentClass(t=""){je(t),G()},get presentation(){return he()},set presentation(t="editor"){he(t),G()},get onchange(){return de()},set onchange(t){de(t),G()},$set:Ft,$on:(t,a)=>Rt(P,t,a)},wt=Ue(),Wt=U(wt);{var qt=t=>{var a=Ue(),y=U(a);{var j=T=>{var h=Ue(),$=U(h);{var _=x=>{var k=Ke(),D=c(k);Ae(D),l(k),g(()=>Fe(k,1,`${je()??""} min-w-0`,"svelte-1yy464i")),o(x,k)},i=x=>{var k=Ke(),D=c(k);Me(D),l(k),g(()=>Fe(k,1,`${je()??""} flex min-h-0 min-w-0 flex-1 flex-col`,"svelte-1yy464i")),o(x,k)},f=x=>{var k=Ke(),D=c(k);Me(D),l(k),g(()=>Fe(k,1,`${je()??""} flex flex-col gap-3 flex-1 min-h-0 min-w-0`,"svelte-1yy464i")),Oe(3,k,()=>Ze,()=>({tier:"moderate"})),o(x,k)};W($,x=>{he()==="picker"?x(_):he()==="workspace"?x(i,1):x(f,-1)})}o(T,h)};W(y,T=>{fe()&&T(j)})}o(t,a)},Kt=t=>{var a=qr(),y=U(a),j=c(y);ye(j,{variant:"ghost",size:"sm",get class(){return`whitespace-nowrap hover:text-inherit! ${De()??""}`},onclick:()=>fe(!fe()),children:(i,f)=>{var x=Lr(),k=U(x);Te(k,{get icon(){return bt},size:"xs"});var D=n(k,2),ue=S(D,!0),ve=n(D,2),I=S(ve,!0);g(F=>{m(ue,F),m(I,e(ze))},[()=>u.workspace_setupScriptEditor_setupScript_label()]),o(i,x)},$$slots:{default:!0}});var T=n(j,2);{var h=i=>{var f=zr(),x=c(f);Me(x),l(f),Oe(3,f,()=>Ze,()=>({tier:"moderate"})),o(i,f)};W(T,i=>{fe()&&!be()&&i(h)})}l(y);var $=n(y,2);{var _=i=>{var f=Wr(),x=c(f);Me(x),l(f),Oe(3,f,()=>Ze,()=>({tier:"moderate"})),o(i,f)};W($,i=>{fe()&&be()&&i(_)})}g(()=>Fe(y,1,gt(be()?"":"w-full"))),o(t,a)};W(Wt,t=>{Le()?t(qt):t(Kt,-1)})}return o(He,wt),Mt(zt)}rr(["keydown"]);export{Kr as default};
1
+ import{t as Ot,bo as R,bm as u,bw as Ft,b as Rt}from"./C0QTy0Sy.js";import{bs as Gt,bV as K,br as rt,bk as er,bj as tr,bH as r,a5 as c,aD as e,bS as n,bl as S,bA as l,b_ as g,bO as m,W as o,bn as Mt,aA as G,c9 as z,be as Ve,b$ as Be,aB as b,c5 as mt,ca as ft,a7 as Ue,ay as U,ai as rr,aj as ar,bf as sr}from"./3SdAC2_C.js";import{i as W}from"./bhKPSdq4.js";import{I as or,g as Xe}from"./B6S6VNu7.js";import{c as Ee}from"./CUkDMZwP.js";import{n as Oe,j as Ze,h as $t}from"./DLwWVKiF.js";import{f as Fe,c as gt,s as nr}from"./7UPrdiE9.js";import{b as xt}from"./Dn334wJv.js";import{F as Te,cR as ir,au as lr,cK as bt,c$ as Pt,cd as cr}from"./U9jJmfYa.js";import{f as ye}from"./CttA-M7l.js";import"./C2jYl_tm.js";import"./Dhy-QJgd.js";import{M as nt}from"./COBU-CLw.js";import{M as dr}from"./c6a4q1y9.js";import{w as _e}from"./CJL0nxkZ.js";import{h as Ct,i as Et,g as Tt,P as At}from"./DlUZpQ7U.js";import{C as ht}from"./D32iIfZB.js";import{c as pr}from"./ChTqQfQN.js";import{A as ur}from"./wl2qP2wF.js";import"./CrD0jtXE.js";import{f as vr}from"./B50rrLDJ.js";import{Jv as _r}from"./_LtUY0jS.js";import{dS as mr}from"./Cppy6ZYG.js";import{S as et,j as fr,a as jt}from"./D2Y3lcdt.js";import{R as qe,c as it,m as gr,bE as tt}from"./yDR0_Br6.js";import"./BpfNraM2.js";var xr=b('<div class="w-2 h-2 bg-green-500 rounded-full animate-pulse"></div>'),br=b('<div class="text-sm text-danger bg-danger-background/10 rounded-md p-3"> </div>'),hr=b('<div class="flex items-center gap-2 text-subtle"><!> <span class="text-sm"> </span></div>'),Sr=b('<div class="p-4 max-h-60 overflow-y-auto overscroll-contain"><!></div>'),wr=b('<div class="p-3 bg-muted/30"><div class="flex items-center justify-between mb-2"><div class="flex items-center gap-2"><!> <span class="text-sm font-medium"> </span></div> <!></div> <p class="text-xs text-subtle mb-2"> </p> <div class="h-32 rounded border border-border overflow-hidden"><!></div></div>'),yr=b('<div class="flex flex-col bg-background border border-border rounded-lg overflow-hidden"><div class="flex items-center justify-between px-3 py-2 border-b border-border bg-muted/30"><div class="flex items-center gap-2"><!> <span class="text-sm font-medium"> </span> <!></div> <div class="flex items-center gap-1"><!></div></div> <!> <!></div>');function St(He,P){if(new.target)return Ot({component:St,...He});Gt(P,!0);const at=pr("SetupScriptAgent");let Ae=R(P,"repoPath",7),Re=R(P,"onScriptGenerated",7),Ge=R(P,"onClose",7),Me=K(rt(crypto.randomUUID())),O=K(!1),ae=K(null),me=!1,ie=K(null);er(()=>{me=!0,C()}),tr(()=>{me=!1});async function le(){try{const v=mr.select(_r.state).find(E=>E.repositoryPath===Ae()||E.path===Ae()||E.worktreePath===Ae());return v?String(v.id):null}catch{return null}}async function C(){r(O,!0),r(ae,null),r(ie,null);try{const s=await le();if(!me)return;if(!s){r(ae,u.workspace_setupScriptAgent_noWorkspace_error(),!0),r(O,!1);return}const v=await vr.setupScripts.generate(s);if(!me)return;if(!v||!v.script){r(ae,u.workspace_setupScriptAgent_generateFailed_error(),!0),r(O,!1);return}r(ie,{name:v.projectType?u.workspace_setupScriptAgent_projectTypeSetup_label({projectType:v.projectType}):u.workspace_setupScriptAgent_generatedSetup_label(),description:v.projectType?u.workspace_setupScriptAgent_generatedForProject_description({projectType:v.projectType}):u.workspace_setupScriptAgent_generatedFromAnalysis_description(),content:v.script},!0),r(O,!1)}catch(s){if(at.error("Failed to generate setup script",s),!me)return;r(ae,s instanceof Error?s.message:u.workspace_setupScriptAgent_generateFailed_error(),!0),r(O,!1)}}function fe(s){Re()?.(s)}var ge={get repoPath(){return Ae()},set repoPath(s){Ae(s),G()},get onScriptGenerated(){return Re()},set onScriptGenerated(s){Re(s),G()},get onClose(){return Ge()},set onClose(s){Ge(s),G()},$set:Ft,$on:(s,v)=>Rt(P,s,v)},ce=yr(),xe=c(ce),be=c(xe),De=c(be);ur(De,{variant:"standard",get agentId(){return e(Me)}});var Le=n(De,2),je=S(Le,!0),he=n(Le,2);{var de=s=>{var v=xr();o(s,v)};W(he,s=>{e(O)&&s(de)})}l(be);var Y=n(be,2),ke=c(Y);{let s=z(()=>u.workspace_setupScriptAgent_close_ariaLabel());ye(ke,{variant:"ghost-light",size:"icon-sm",iconOnly:!0,get"aria-label"(){return e(s)},get onclick(){return Ge()},children:(v,E)=>{Te(v,{get icon(){return ir}})},$$slots:{default:!0}})}l(Y),l(xe);var $e=n(xe,2);{var Ie=s=>{var v=Sr(),E=c(v);{var q=B=>{var M=br(),Q=S(M,!0);g(()=>m(Q,e(ae))),o(B,M)},se=B=>{var M=hr(),Q=c(M);or(Q,{size:16,class:"text-primary"});var Se=n(Q,2),ze=S(Se,!0);l(M),g(we=>m(ze,we),[()=>u.workspace_setupScriptAgent_analyzing_label()]),o(B,M)};W(E,B=>{e(ae)?B(q):B(se,-1)})}l(v),o(s,v)};W($e,s=>{(e(ae)||e(O))&&s(Ie)})}var Je=n($e,2);{var pe=s=>{var v=wr(),E=c(v),q=c(E),se=c(q);Te(se,{get icon(){return lr},class:"text-green-500"});var B=n(se,2),M=S(B,!0);l(q);var Q=n(q,2);ye(Q,{variant:"primary",size:"sm",onclick:()=>fe(e(ie)),class:"h-7",children:(Pe,st)=>{Ve();var Ye=Be();g(ct=>m(Ye,ct),[()=>u.workspace_setupScriptAgent_createScript_label()]),o(Pe,Ye)},$$slots:{default:!0}}),l(E);var Se=n(E,2),ze=S(Se,!0),we=n(Se,2),lt=c(we);ht(lt,{get value(){return e(ie).content},language:"shell",readOnly:!0,lineNumbers:!1}),l(we),l(v),g(()=>{m(M,e(ie).name),m(ze,e(ie).description)}),o(s,v)};W(Je,s=>{e(ie)&&!e(O)&&s(pe)})}return l(ce),g(s=>m(je,s),[()=>u.workspace_setupScriptAgent_title()]),o(He,ce),Mt(ge)}var kr=b('<span class="block truncate"> </span>'),$r=b("<div></div>"),Pr=b('<div role="group"></div> <div class="mt-2 border-t border-border pt-2"><!></div> <!> <div class="mt-2 border-t border-border pt-2"><!> <!></div>',1),Cr=b('<code class="type-caption text-muted-foreground"> </code>'),Er=b('<p> </p> <code class="type-caption"> </code>',1),It=b("<!> <!>",1),Tr=b('<div class="mt-2 flex flex-wrap gap-2 px-2"></div>'),Ar=b('<div class="h-44 min-w-0 overflow-hidden rounded-(--radius-medium) border border-border bg-background py-2"><!></div> <div class="mt-2 px-1"><!> <!></div>',1),jr=b('<div class="mb-2 flex items-center justify-between gap-3 px-2"><div class="min-w-0"><h3> </h3> <p class="type-caption truncate text-muted-foreground"> </p></div> <!></div> <!>',1),Ke=b("<div><!></div>"),Ir=b("<!> ",1),Nt=b('<div class="min-w-0 w-full"><span class="text-sm"> </span> <p class="text-xs text-subtle mt-0.5"> </p></div>'),Ut=b('<div class="mb-4"><h4 class="type-caption font-medium text-muted-foreground mb-1.5 px-2"> </h4> <!></div>'),Nr=b('<span class="type-caption px-1.5 py-0.5 rounded-full bg-primary/10 text-primary font-medium shrink-0"> </span>'),Ur=b('<div class="min-w-0 w-full"><div class="flex flex-wrap items-center gap-x-2 gap-y-1"><span class="text-sm"> </span> <!></div> <p class="text-xs text-subtle mt-0.5"> </p></div>'),Or=b('<div class="mb-4"><h4 class="type-caption font-medium text-muted-foreground mb-1.5 px-2"> </h4> <p class="text-xs text-subtle px-2 mb-2"> </p> <!></div> <!> <!> <div class="mb-4"><h4 class="type-caption font-medium text-muted-foreground mb-1.5 px-2"> </h4> <!></div>',1),Fr=b('<code class="type-caption px-1.5 py-0.5 rounded bg-background/80 text-muted-foreground font-mono cursor-pointer hover:bg-background hover:text-foreground transition-colors"> </code>'),Rr=b('<p class="text-xs"> </p> <p class="mt-1 text-xs text-muted-foreground"> <code class="type-caption"> </code></p>',1),Gr=b('<div class="flex flex-wrap items-center gap-x-3 gap-y-1.5 px-3 py-1.5 bg-muted/30 shrink-0"><span class="type-caption font-medium text-muted-foreground shrink-0"> </span> <div class="flex flex-wrap gap-1.5"></div></div> <div class="flex-1 min-h-0 min-w-0 overflow-hidden py-3 bg-background"><!></div>',1),Mr=b('<div class="flex min-h-0 min-w-0 flex-col overflow-y-auto"><!></div> <div class="flex min-h-0 min-w-0 flex-col"><!></div>',1),Dr=b('<div class="flex flex-col min-h-0 min-w-0 overflow-y-auto p-2 md:pr-4"><!></div> <div class="flex flex-col min-w-0 min-h-0"><!></div>',1),Lr=b('<!> <span class="text-sm font-normal text-subtle"> </span> <span class="text-subtle font-normal"> </span>',1),zr=b('<div class="mt-1 pl-7 space-y-3"><!></div>'),Wr=b('<div class="space-y-3"><!></div>'),qr=b("<div><!> <!></div> <!>",1);function Kr(He,P){if(new.target)return Ot({component:Kr,...He});Gt(P,!0);const at=(t,a=sr)=>{{const y=_=>{Te(_,{get icon(){return bt},get class(){return _e.icon}})},j=_=>{var i=kr(),f=S(i,!0);g(()=>m(f,a().name)),o(_,i)},T=_=>{{let i=z(()=>e(st)===a().id?"checked":"empty");dr(_,{get state(){return e(i)}})}};let h=z(()=>e(st)===a().id),$=z(()=>e(st)===a().id);nt(t,{get selected(){return e(h)},get"aria-pressed"(){return e($)},get"data-setup-source"(){return a().id},get class(){return _e.row},onclick:()=>a().id==="custom"?Dt():we(a().id),leading:y,title:j,trailing:T,$$slots:{leading:!0,title:!0,trailing:!0}})}},Ae=t=>{var a=Ke(),y=c(a);{var j=h=>{var $=Pr(),_=U($);Xe(_,21,()=>e(Ye),I=>I.id,(I,F)=>{at(I,()=>e(F))}),l(_);var i=n(_,2),f=c(i);nt(f,{get"aria-expanded"(){return e($e)},get class(){return _e.row},onclick:()=>r($e,!e($e)),leading:w=>{Te(w,{get icon(){return cr},get class(){return _e.icon}})},title:w=>{Ve();var d=Be();g(p=>m(d,p),[()=>u.workspace_setupScriptEditor_templates_label()]),o(w,d)},$$slots:{leading:!0,title:!0}}),l(i);var x=n(i,2);{var k=I=>{var F=$r();Xe(F,21,()=>e(ct),w=>w.id,(w,d)=>{at(w,()=>({id:`template-${e(d).id}`,name:e(d).name}))}),l(F),Oe(3,F,()=>Ze,()=>({tier:"moderate"})),o(I,F)};W(x,I=>{e($e)&&I(k)})}var D=n(x,2),ue=c(D);nt(ue,{get class(){return _e.row},onclick:()=>r(ke,!0),leading:w=>{Te(w,{get icon(){return bt},get class(){return _e.icon}})},title:w=>{Ve();var d=Be();g(p=>m(d,p),[()=>u.workspace_setupScriptPicker_edit_label()]),o(w,d)},$$slots:{leading:!0,title:!0}});var ve=n(ue,2);{const I=d=>{Te(d,{get icon(){return Pt},get class(){return _e.icon}})},F=d=>{Ve();var p=Be();g(N=>m(p,N),[()=>u.workspace_setupScriptEditor_autoGenerate_label()]),o(d,p)};let w=z(()=>!O());nt(ve,{get class(){return _e.row},get disabled(){return e(w)},onclick:()=>{r(ke,!0),r(Y,!0)},leading:I,title:F,$$slots:{leading:!0,title:!0}})}l(D),g(I=>nr(_,"aria-label",I),[()=>u.workspace_setupScriptEditor_setupScript_label()]),o(h,$)},T=h=>{var $=jr(),_=U($),i=c(_),f=c(i),x=S(f,!0),k=n(f,2),D=S(k,!0);l(i);var ue=n(i,2);ye(ue,{variant:"ghost",size:"sm",onclick:()=>{r(ke,!1),r(Y,!1)},children:(w,d)=>{Ve();var p=Be();g(N=>m(p,N),[()=>u.workspace_setupScriptPicker_choose_label()]),o(w,p)},$$slots:{default:!0}}),l(_);var ve=n(_,2);{var I=w=>{St(w,{get repoPath(){return O()},onScriptGenerated:Lt,onClose:()=>r(Y,!1)})},F=w=>{var d=Ar(),p=U(d),N=c(p);xt(ht(N,{language:"shell",lineNumbers:!1,get lineWrapping(){return e(Se)},get value(){return C()},set value(A){C(A)}}),A=>r(pe,A,!0),()=>e(pe)),l(p);var X=n(p,2),H=c(X);ye(H,{variant:"ghost",size:"sm",get active(){return e(Ie)},get"aria-expanded"(){return e(Ie)},onclick:()=>r(Ie,!e(Ie)),children:(A,oe)=>{Ve();var L=Be();g(ee=>m(L,ee),[()=>u.workspace_setupScriptEditor_variables_label()]),o(A,L)},$$slots:{default:!0}});var V=n(H,2);{var Z=A=>{var oe=Ue(),L=U(oe);Ee(L,()=>At,(ee,te)=>{te(ee,{delayDuration:100,children:(ne,Ce)=>{var J=Tr();Xe(J,21,()=>jt,re=>re.name,(re,Ne)=>{var We=Ue(),pt=U(We);Ee(pt,()=>Ct,(Vt,Bt)=>{Bt(Vt,{children:(Ht,Vr)=>{var yt=It(),kt=U(yt);Ee(kt,()=>Et,(ut,vt)=>{vt(ut,{children:(_t,Yt)=>{var Qe=Cr(),ot=S(Qe);g(()=>m(ot,`$${e(Ne).name??""}`)),o(_t,Qe)},$$slots:{default:!0}})});var Jt=n(kt,2);Ee(Jt,()=>Tt,(ut,vt)=>{vt(ut,{side:"top",class:"max-w-xs",children:(_t,Yt)=>{var Qe=Er(),ot=U(Qe),Qt=S(ot,!0),Xt=n(ot,2),Zt=S(Xt,!0);g(()=>{m(Qt,e(Ne).description),m(Zt,e(Ne).example)}),o(_t,Qe)},$$slots:{default:!0}})}),o(Ht,yt)},$$slots:{default:!0}})}),o(re,We)}),l(J),o(ne,J)},$$slots:{default:!0}})}),o(A,oe)};W(V,A=>{e(Ie)&&A(Z)})}l(X),o(w,d)};W(ve,w=>{e(Y)&&O()?w(I):w(F,-1)})}g(w=>{Fe(f,1,gt(_e.title),"svelte-1yy464i"),m(x,w),m(D,e(ze))},[()=>u.workspace_setupScriptPicker_commands_label()]),o(h,$)};W(y,h=>{e(ke)?h(T,-1):h(j)})}l(a),xt(a,h=>r(Je,h),()=>e(Je)),g(()=>Fe(a,1,`${_e.rows} min-w-0`,"svelte-1yy464i")),o(t,a)},Re=t=>{var a=Or(),y=U(a),j=c(y),T=S(j,!0),h=n(j,2),$=S(h,!0),_=n(h,2);{var i=d=>{var p=Ke(),N=c(p);St(N,{get repoPath(){return O()},onScriptGenerated:X=>{r(se,!0),r(s,""),C(X.content),r(E,X.name,!0),r(v,!0),de()?.(C()),r(Y,!1),requestAnimationFrame(()=>e(pe)?.focus())},onClose:()=>r(Y,!1)}),l(p),Oe(3,p,()=>Ze,()=>({tier:"moderate"})),o(d,p)},f=d=>{{let p=z(()=>!O());ye(d,{variant:"ghost",size:"sm",class:"w-full justify-start text-subtle",onclick:()=>r(Y,!0),get disabled(){return e(p)},children:(N,X)=>{var H=Ir(),V=U(H);Te(V,{get icon(){return Pt},class:"mr-1.5"});var Z=n(V);g(A=>m(Z,` ${A??""}`),[()=>u.workspace_setupScriptEditor_autoGenerate_label()]),o(N,H)},$$slots:{default:!0}})}};W(_,d=>{e(Y)&&O()?d(i):d(f,-1)})}l(y);var x=n(y,2);{var k=d=>{var p=Ut(),N=c(p),X=S(N,!0),H=n(N,2);{let V=z(()=>e(s)===qe),Z=z(()=>e(s)===qe);ye(H,{variant:"ghost",truncateLabel:!1,get active(){return e(V)},get"aria-pressed"(){return e(Z)},class:"w-full h-auto justify-start whitespace-normal text-left px-2 py-1.5",onclick:()=>we(qe),children:(A,oe)=>{var L=Nt(),ee=c(L),te=S(ee,!0),ne=n(ee,2),Ce=S(ne,!0);l(L),g((J,re)=>{m(te,J),m(Ce,re)},[()=>tt(it,"repo-config"),()=>u.workspace_setupScriptEditor_repoConfig_description()]),o(A,L)},$$slots:{default:!0}})}l(p),g(V=>m(X,V),[()=>u.workspace_setupScriptEditor_repoConfig_label()]),o(d,p)};W(x,d=>{le()&&d(k)})}var D=n(x,2);{var ue=d=>{var p=Ut(),N=c(p),X=S(N,!0),H=n(N,2);{let V=z(()=>e(s)===B),Z=z(()=>e(s)===B);ye(H,{variant:"ghost",truncateLabel:!1,get active(){return e(V)},get"aria-pressed"(){return e(Z)},class:"w-full h-auto justify-start whitespace-normal text-left px-2 py-1.5",onclick:()=>we(B),children:(A,oe)=>{var L=Nt(),ee=c(L),te=S(ee,!0),ne=n(ee,2),Ce=S(ne,!0);l(L),g((J,re)=>{m(te,J),m(Ce,re)},[()=>tt(e(M).name,e(M).nameSource),()=>u.workspace_setupScriptEditor_lastUsed_description()]),o(A,L)},$$slots:{default:!0}})}l(p),g(V=>m(X,V),[()=>u.workspace_setupScriptEditor_lastUsed_label()]),o(d,p)};W(D,d=>{e(M)&&d(ue)})}var ve=n(D,2),I=c(ve),F=S(I,!0),w=n(I,2);Xe(w,17,()=>et,d=>d.id,(d,p)=>{{let N=z(()=>e(s)===`template-${e(p).id}`),X=z(()=>e(s)===`template-${e(p).id}`);ye(d,{variant:"ghost",truncateLabel:!1,get active(){return e(N)},get"aria-pressed"(){return e(X)},class:"w-full h-auto justify-start whitespace-normal text-left px-2 py-1.5",onclick:()=>we(`template-${e(p).id}`),children:(H,V)=>{var Z=Ur(),A=c(Z),oe=c(A),L=S(oe,!0),ee=n(oe,2);{var te=J=>{var re=Nr(),Ne=S(re,!0);g(We=>m(Ne,We),[()=>u.workspace_setupScriptEditor_recommended_label()]),o(J,re)};W(ee,J=>{e(p).projectType===ie()&&J(te)})}l(A);var ne=n(A,2),Ce=S(ne,!0);l(Z),g(()=>{m(L,e(p).name),m(Ce,e(p).description)}),o(H,Z)},$$slots:{default:!0}})}}),l(ve),g((d,p,N)=>{m(T,d),m($,p),m(F,N)},[()=>u.workspace_setupScriptEditor_generate_label(),()=>u.workspace_setupScriptEditor_generate_description(),()=>u.workspace_setupScriptEditor_templates_label()]),o(t,a)},Ge=t=>{var a=Gr(),y=U(a),j=c(y),T=S(j,!0),h=n(j,2);Xe(h,21,()=>jt,i=>i.name,(i,f)=>{var x=Ue(),k=U(x);Ee(k,()=>At,(D,ue)=>{ue(D,{delayDuration:100,children:(ve,I)=>{var F=Ue(),w=U(F);Ee(w,()=>Ct,(d,p)=>{p(d,{delayDuration:100,children:(N,X)=>{var H=It(),V=U(H);Ee(V,()=>Et,(A,oe)=>{oe(A,{children:(L,ee)=>{var te=Fr(),ne=S(te);g(()=>m(ne,`$${e(f).name??""}`)),o(L,te)},$$slots:{default:!0}})});var Z=n(V,2);Ee(Z,()=>Tt,(A,oe)=>{oe(A,{side:"bottom",class:"max-w-xs z-[200]",children:(L,ee)=>{var te=Rr(),ne=U(te),Ce=S(ne,!0),J=n(ne,2),re=c(J),Ne=n(re),We=S(Ne,!0);l(J),g(pt=>{m(Ce,e(f).description),m(re,`${pt??""} `),m(We,e(f).example)},[()=>u.workspace_setupScriptEditor_example_before()]),o(L,te)},$$slots:{default:!0}})}),o(N,H)},$$slots:{default:!0}})}),o(ve,F)},$$slots:{default:!0}})}),o(i,x)}),l(h),l(y);var $=n(y,2),_=c($);xt(ht(_,{language:"shell",lineNumbers:!0,get lineWrapping(){return e(Se)},get value(){return C()},set value(i){C(i)}}),i=>r(pe,i,!0),()=>e(pe)),l($),g(i=>m(T,i),[()=>u.workspace_setupScriptEditor_variables_label()]),ar("keydown",$,i=>{i.altKey&&i.key==="z"&&(i.preventDefault(),r(Se,!e(Se)))}),o(t,a)},Me=t=>{var a=Ke(),y=c(a);{var j=h=>{var $=Mr(),_=U($),i=c(_);Re(i),l(_);var f=n(_,2),x=c(f);Ge(x),l(f),Oe(1,_,()=>$t,()=>({tier:"moderate",axis:"x",distance:-8})),Oe(1,f,()=>$t,()=>({tier:"moderate",axis:"x"})),o(h,$)},T=h=>{var $=Dr(),_=U($),i=c(_);Re(i),l(_);var f=n(_,2),x=c(f);Ge(x),l(f),o(h,$)};W(y,h=>{he()==="workspace"?h(j):h(T,-1)})}l(a),g(()=>Fe(a,1,gt(he()==="workspace"?"setup-workspace-layout":"grid flex-1 min-h-0 min-w-0 grid-cols-1 grid-rows-[minmax(0,1fr)_minmax(0,2fr)] md:grid-cols-[minmax(0,2fr)_minmax(0,3fr)] md:grid-rows-1"),"svelte-1yy464i")),o(t,a)};let O=R(P,"repoPath",7,""),ae=R(P,"repositoryKey",7),me=R(P,"githubUrl",7,null),ie=R(P,"projectType",7,void 0),le=R(P,"repoConfigScript",7,null),C=R(P,"value",15,""),fe=R(P,"expanded",15,!1),ge=R(P,"scriptName",31,()=>rt(u.workspace_setupScriptEditor_custom_name())),ce=R(P,"scriptNameSource",15,"named"),xe=R(P,"isCustomScript",15,!1),be=R(P,"compact",7,!1),De=R(P,"triggerClass",7,""),Le=R(P,"contentOnly",7,!1),je=R(P,"contentClass",7,""),he=R(P,"presentation",7,"editor"),de=R(P,"onchange",7),Y=K(!1),ke=K(rt(mt(()=>xe()))),$e=K(!1),Ie=K(!1),Je=K(void 0),pe=K(void 0),s=K(""),v=K(!1),E=K(rt(ge())),q=K(rt(ce())),se=K(!1);const B="last-used",M=z(()=>{const t=ae()??O(),a=t?gr(t,me()):void 0;return a?.nameSource==="repo-config"?{...a,name:"Custom",nameSource:"custom"}:a}),Q=z(()=>{const t=new Map;return le()&&t.set(qe,{content:le(),label:it,source:"repo-config"}),e(M)&&t.set(B,{content:e(M).content,label:e(M).name,source:e(M).nameSource}),et.forEach(a=>{t.set(`template-${a.id}`,{content:fr(a),label:a.name,source:"named"})}),t});let Se=K(!0);const ze=z(()=>{if(e(v))return tt(e(E),e(q));if(!e(s))return u.workspace_setupScriptEditor_custom_name();const t=e(Q).get(e(s));return t?tt(t.label,t.source):u.workspace_setupScriptEditor_custom_name()});function we(t){r(s,t,!0),r(v,!1),r(se,!0);const a=e(Q).get(t);a&&(C(a.content),r(E,a.label,!0),r(q,a.source,!0),de()?.(C())),he()==="picker"?(r(ke,!1),r($e,!1),requestAnimationFrame(()=>e(Je)?.querySelector("[data-setup-source][aria-pressed=true]")?.focus())):requestAnimationFrame(()=>e(pe)?.focus())}function lt(t){if(e(s)&&e(s)!=="none"){const a=e(Q).get(e(s));a&&r(v,t!==a.content)}else t&&r(v,!0)}const Pe=(()=>{const t=et.find(a=>a.id==="generic");return t?`template-${t.id}`:""})(),st=z(()=>e(v)||!e(s)?"custom":e(s)),Ye=z(()=>{const t=[];le()&&t.push({id:qe,name:tt(it,"repo-config")}),e(M)&&t.push({id:B,name:u.workspace_setupScriptEditor_lastUsed_label()});for(const a of et){const y=`template-${a.id}`;(y===Pe||y===e(s))&&t.push({id:y,name:a.name})}return t.push({id:"custom",name:u.workspace_setupScriptPicker_custom_label()}),t}),ct=z(()=>et.filter(t=>!e(Ye).some(a=>a.id===`template-${t.id}`)));function Dt(){r(s,""),r(v,!0),r(E,"Custom"),r(q,"custom"),r(Y,!1),r(ke,!0),requestAnimationFrame(()=>e(pe)?.focus())}function Lt(t){r(se,!0),r(s,""),C(t.content),r(E,t.name,!0),r(q,"named"),r(v,!0),de()?.(C()),r(Y,!1),requestAnimationFrame(()=>e(pe)?.focus())}let dt=K(null);ft(()=>{const t=ae()??O();if(t===e(dt))return;const a=e(dt)===null&&(xe()||C().trim().length>0);if(r(dt,t,!0),a){mt(()=>{let T=!1;const h=C().trim();for(const[$,_]of e(Q).entries())if(h===_.content.trim()&&_.source===ce()&&_.label===ge()){r(s,$,!0),r(E,_.label,!0),r(q,_.source,!0),r(v,!1),T=!0;break}T||(r(v,!0),e(E)||(r(E,ge()||u.workspace_setupScriptEditor_custom_name(),!0),r(q,ge()?ce():"named",!0))),r(se,!0)});return}const y=!!le(),j=e(M);if(mt(()=>{if(r(v,!1),r(se,!0),y)r(s,qe,!0),r(E,it,!0),r(q,"repo-config");else if(j)r(s,B),r(E,j.name,!0),r(q,j.nameSource,!0);else if(Pe){r(s,Pe,!0);const T=e(Q).get(Pe);r(E,T?.label||u.workspace_setupScriptEditor_custom_name(),!0),r(q,"named")}else r(E,u.workspace_setupScriptEditor_custom_name(),!0),r(q,"named")}),y&&le())C(le()),de()?.(C());else if(j)C(j.content),de()?.(C());else if(Pe){const T=e(Q).get(Pe);T&&(C(T.content),de()?.(C()))}}),ft(()=>{if(e(se)){r(se,!1);return}C()!==void 0&&lt(C())}),ft(()=>{ge(e(E)),ce(e(q)),xe(e(v))});var zt={get repoPath(){return O()},set repoPath(t=""){O(t),G()},get repositoryKey(){return ae()},set repositoryKey(t){ae(t),G()},get githubUrl(){return me()},set githubUrl(t=null){me(t),G()},get projectType(){return ie()},set projectType(t=void 0){ie(t),G()},get repoConfigScript(){return le()},set repoConfigScript(t=null){le(t),G()},get value(){return C()},set value(t=""){C(t),G()},get expanded(){return fe()},set expanded(t=!1){fe(t),G()},get scriptName(){return ge()},set scriptName(t=u.workspace_setupScriptEditor_custom_name()){ge(t),G()},get scriptNameSource(){return ce()},set scriptNameSource(t="named"){ce(t),G()},get isCustomScript(){return xe()},set isCustomScript(t=!1){xe(t),G()},get compact(){return be()},set compact(t=!1){be(t),G()},get triggerClass(){return De()},set triggerClass(t=""){De(t),G()},get contentOnly(){return Le()},set contentOnly(t=!1){Le(t),G()},get contentClass(){return je()},set contentClass(t=""){je(t),G()},get presentation(){return he()},set presentation(t="editor"){he(t),G()},get onchange(){return de()},set onchange(t){de(t),G()},$set:Ft,$on:(t,a)=>Rt(P,t,a)},wt=Ue(),Wt=U(wt);{var qt=t=>{var a=Ue(),y=U(a);{var j=T=>{var h=Ue(),$=U(h);{var _=x=>{var k=Ke(),D=c(k);Ae(D),l(k),g(()=>Fe(k,1,`${je()??""} min-w-0`,"svelte-1yy464i")),o(x,k)},i=x=>{var k=Ke(),D=c(k);Me(D),l(k),g(()=>Fe(k,1,`${je()??""} flex min-h-0 min-w-0 flex-1 flex-col`,"svelte-1yy464i")),o(x,k)},f=x=>{var k=Ke(),D=c(k);Me(D),l(k),g(()=>Fe(k,1,`${je()??""} flex flex-col gap-3 flex-1 min-h-0 min-w-0`,"svelte-1yy464i")),Oe(3,k,()=>Ze,()=>({tier:"moderate"})),o(x,k)};W($,x=>{he()==="picker"?x(_):he()==="workspace"?x(i,1):x(f,-1)})}o(T,h)};W(y,T=>{fe()&&T(j)})}o(t,a)},Kt=t=>{var a=qr(),y=U(a),j=c(y);ye(j,{variant:"ghost",size:"sm",get class(){return`whitespace-nowrap hover:text-inherit! ${De()??""}`},onclick:()=>fe(!fe()),children:(i,f)=>{var x=Lr(),k=U(x);Te(k,{get icon(){return bt},size:"xs"});var D=n(k,2),ue=S(D,!0),ve=n(D,2),I=S(ve,!0);g(F=>{m(ue,F),m(I,e(ze))},[()=>u.workspace_setupScriptEditor_setupScript_label()]),o(i,x)},$$slots:{default:!0}});var T=n(j,2);{var h=i=>{var f=zr(),x=c(f);Me(x),l(f),Oe(3,f,()=>Ze,()=>({tier:"moderate"})),o(i,f)};W(T,i=>{fe()&&!be()&&i(h)})}l(y);var $=n(y,2);{var _=i=>{var f=Wr(),x=c(f);Me(x),l(f),Oe(3,f,()=>Ze,()=>({tier:"moderate"})),o(i,f)};W($,i=>{fe()&&be()&&i(_)})}g(()=>Fe(y,1,gt(be()?"":"w-full"))),o(t,a)};W(Wt,t=>{Le()?t(qt):t(Kt,-1)})}return o(He,wt),Mt(zt)}rr(["keydown"]);export{Kr as default};
@@ -1,4 +1,4 @@
1
- var cQ=Object.defineProperty;var NB=Q=>{throw TypeError(Q)};var LQ=(Q,A,B)=>A in Q?cQ(Q,A,{enumerable:!0,configurable:!0,writable:!0,value:B}):Q[A]=B;var x=(Q,A,B)=>LQ(Q,typeof A!="symbol"?A+"":A,B),CB=(Q,A,B)=>A.has(Q)||NB("Cannot "+B);var g=(Q,A,B)=>(CB(Q,A,"read from private field"),B?B.call(Q):A.get(Q)),c=(Q,A,B)=>A.has(Q)?NB("Cannot add the same private member more than once"):A instanceof WeakSet?A.add(Q):A.set(Q,B),M=(Q,A,B,E)=>(CB(Q,A,"write to private field"),E?E.call(Q,B):A.set(Q,B),B),D=(Q,A,B)=>(CB(Q,A,"access private method"),B);var HB=(Q,A,B,E)=>({set _(I){M(Q,A,I,B)},get _(){return g(Q,A,E)}});import{a3 as tQ,r as hQ,Q as jQ}from"./BDATxlJG.js";import{B as oQ,D as YQ}from"./CHoUTmhW.js";const T=["none","attribute","attribute.jsx","boolean","comment","comment.doc","constant","constant.builtin","constructor","diff.minus","diff.plus","embedded","emphasis","emphasis.strong","function","function.definition","function.method","keyword","keyword.control","keyword.declaration","keyword.import","keyword.operator","label","namespace","number","operator","predictive","preproc","primary","property","property.json_key","punctuation","punctuation.bracket","punctuation.bracket.html","punctuation.bracket.jsx","punctuation.delimiter","punctuation.delimiter.html","punctuation.delimiter.jsx","punctuation.list_marker","punctuation.markup","punctuation.special","selector","selector.class","selector.id","string","string.escape","string.regex","string.special","string.special.symbol","tag","tag.doctype","tag.jsx","text.jsx","text.literal","title","type","type.builtin","type.class","variable","variable.parameter","variable.special","enum","hint","keyword.jsdoc","link_text","link_uri","selector.pseudo","tag.component.jsx","type.jsdoc","variable.jsdoc","variant","background","foreground"],aQ="--hls-",NQ=new TextEncoder,HQ=/^#([a-f0-9]{3,4}|[a-f0-9]{6}|[a-f0-9]{8})$/i,nQ=/^color\(display-p3\s+[+-]?(?:\d+(?:\.\d*)?|\.\d+)\s+[+-]?(?:\d+(?:\.\d*)?|\.\d+)\s+[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:\s*\/\s*[+-]?(?:\d+(?:\.\d*)?|\.\d+))?\s*\)$/i;function ZQ(Q){return typeof Q=="string"&&(HQ.test(Q.trim())||nQ.test(Q.trim()))}function FB(Q){return Q["editor.foreground"]??Q.text??Q.foreground}function uB(Q){return Q["editor.background"]??Q.background}const YB=["black","red","green","yellow","blue","magenta","cyan","white","bright_black","bright_red","bright_green","bright_yellow","bright_blue","bright_magenta","bright_cyan","bright_white"],eQ=["#000000","#cd3131","#0dbc79","#e5e510","#2472c8","#bc3fbc","#11a8cd","#e5e5e5","#666666","#f14c4c","#23d18b","#f5f543","#3b8eea","#d670d6","#29b8db","#ffffff"];function dQ(Q){return YB.map((A,B)=>zB({foreground:Q[`terminal.ansi.${A}`]},"foreground").color??eQ[B])}function OB(Q){return Q===null?"null":Q===void 0?"undefined":typeof Q=="string"?`the string ${JSON.stringify(Q)} (theme ids are not supported; import the theme object from "@pierre/highlights/themes")`:Array.isArray(Q)?"an array":typeof Q=="object"?"themes"in Q&&Array.isArray(Q.themes)?`a ThemeFamily whose first member is ${OB(Q.themes[0])}`:"an object without a `name`":`a ${typeof Q}`}function lQ(Q){return Q!=null&&typeof Q=="object"&&"name"in Q&&typeof Q.name=="string"&&Q.name!==""}function xQ(Q){const A=Q!=null&&typeof Q=="object"&&"themes"in Q&&Q.themes!=null?Q.themes[0]:Q;if(!lQ(A))throw new TypeError(`invalid theme: expected a Theme or ThemeFamily object, received ${OB(Q)}`);return A}function vB(Q,A){let B;for(let E=A;E!=="";){const I=Q[E];if(typeof I=="string")return{...B,color:I};if(I!=null&&typeof I=="object"&&(B??=I,I.color!=null))return{...B,color:I.color};const C=E.lastIndexOf(".");E=C<0?"":E.slice(0,C)}return B}function zB(Q,A){let B,E,I;return A==="background"?B=uB(Q):A==="foreground"?B=FB(Q):({color:B,font_style:E,font_weight:I}=vB(Q.syntax??{},A)??{},(E!=null||I!=null)&&(B??=FB(Q))),ZQ(B)?(B=B.trim().toLowerCase(),B.startsWith("#")&&(B.length<=5&&(B=B.replace(/[^#]/g,"$&$&")),B.length===9&&B.endsWith("ff")&&(B=B.slice(0,7)),B==="#00000000"&&(B=void 0))):B=void 0,{color:B,italic:E==="italic",weight:I!=null&&I>=100&&I<=900?Math.round(I/100)*100:0}}function zA(Q,A){return`var(${A}${Q.replace(/[._]/g,"-")})`}function gA(Q){return Q.replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;").replaceAll(">","&gt;")}function $B(Q){const A=Q.map(w=>NQ.encode(w));let B=4+8*A.length;const E=new Uint8Array(B+A.reduce((w,G)=>w+G.length,0)),I=new DataView(E.buffer);let C=32;for(let w=0;w<A.length;w++)I.setUint32(4+8*w,B,!0),I.setUint32(8+8*w,A[w].length,!0),E.set(A[w],B),B+=A[w].length,w!==0&&(C=Math.max(C,A[w].length+32));return I.setUint32(0,C,!0),E}const nB=new WeakMap;function SB(Q,A=aQ){const B=xQ(Q),E=B.cssVariables===!0?A:"";let I=nB.get(B);const C=I?.get(E);if(C!==void 0)return C;const w=B.cssVariables===!0?rQ(B.name,A):typeof B.cssVariables=="object"?bQ(B):WQ(B);return I===void 0&&(I=new Map,nB.set(B,I)),I.set(E,w),w}function bQ(Q){const A=Q.cssVariables;if(typeof A!="object")throw new Error("Expected CSS palette");const B=A.prefix??"--hls-",E=R=>{const i=A.defaults?.[R];return`var(${B}${R}${i?`, ${i}`:""})`},I=new Array(T.length).fill(null),C=Q.style.syntax??{};for(let R=1;R<T.length;R++){const i=vB(C,T[R]);I[R]={color:E(i?.color??"foreground"),italic:i?.font_style==="italic",weight:i?.font_weight===void 0?0:Math.round(i.font_weight/100)*100}}const w=E(FB(Q.style)??"foreground"),G=E(uB(Q.style)??"background");let k,S;return{name:Q.name,styles:I,fg:w,bg:G,table:void 0,get htmlOpeners(){return k??=_B(I,w,G)},get ansi(){return S??=YB.map(R=>{const i=Q.style[`terminal.ansi.${R}`];return E(typeof i=="string"?i:`terminal-ansi-${R.replace("_","-")}`)})}}}function rQ(Q,A){let B;const E=()=>B??=TQ(A);let I;return{name:Q,get styles(){return E().styles},get fg(){return E().fg},get bg(){return E().bg},table:void 0,htmlOpeners:void 0,get ansi(){return I??=YB.map(C=>zA(`terminal.ansi.${C}`,A))}}}function TQ(Q){const A=new Array(T.length).fill(null);for(let B=1;B<T.length;B++)A[B]={color:zA(T[B],Q),italic:!1,weight:0};return{styles:A,fg:zA("foreground",Q),bg:zA("background",Q)}}function WQ(Q){const A=Q.style??{},B=new Array(T.length).fill(null),E=new Uint8Array(T.length*5);let I,C,w=!1;for(let S=1;S<T.length;S++){const R=T[S],i=zB(A,R),{color:F,italic:s,weight:J}=i,t=S*5;if(F!==void 0)if(F.startsWith("#")){const a=parseInt(F.slice(1,7),16);E[t]=a>>16,E[t+1]=a>>8&255,E[t+2]=a&255,E[t+3]=F.length===9?parseInt(F.slice(7),16):255}else w=!0;E[t+4]=(s?16:0)|J/100,!(F===void 0&&!s&&J===0)&&(R==="foreground"?I=F:R==="background"?C=F:B[S]=i)}let G,k;return{name:Q.name,styles:B,fg:I,bg:C,table:w?void 0:E,get htmlOpeners(){if(w)return G??=_B(B,I,C)},get ansi(){return k??=dQ(A)}}}function _B(Q,A,B){const E=[`<pre class="highlights" style="${gA((B===void 0?"":`background-color:${B};`)+(A===void 0?"":`color:${A}`))}"><code>`];for(let I=1;I<T.length;I++){const C=Q[I],w=`color:${C?.color??"inherit"}`+(C?.italic===!0?";font-style:italic":"")+(C!=null&&C.weight!==0?`;font-weight:${C.weight}`:"");E.push(`<span style="${gA(w)}">`)}return $B(E)}const XQ=new TextEncoder,yA=new Uint8Array(T.length);for(let Q=0;Q<T.length;Q++){const A=T[Q];A==="string.regex"?yA[Q]=3:A==="comment"||A.startsWith("comment.")?yA[Q]=1:(A==="string"||A.startsWith("string."))&&(yA[Q]=2)}const ZB=new WeakMap,eB=new WeakMap;let fQ=1;const dB=new WeakMap,lB=new WeakMap,xB=new WeakMap;let KQ=0;function PQ(Q){let A=xB.get(Q);return A===void 0&&(A=KQ++,xB.set(Q,A)),A}function bB(Q,A,B){const{name:E,styles:I,fg:C,bg:w,table:G}=Q;return{color:A,role:B,name:E,styles:I,fg:C,bg:w,table:G,get ansi(){return Q.ansi}}}function lA(Q){const{cssVariablePrefix:A}=Q;if(Q.themes==null)return[bB(SB(Q.theme,A),null,"single")];const B=Object.entries(Q.themes).filter(([,R])=>R!=null).sort(([R],[i])=>R<i?-1:1);if(B.length===0)throw new TypeError("themes must not be empty");const E=Q.defaultColor??"light";let I;if(E==="light-dark()"){const R=B.find(([F])=>F==="light"),i=B.find(([F])=>F==="dark");if(R===void 0||i===void 0)throw new TypeError("`themes` must contain `light` and `dark` when defaultColor is 'light-dark()'");B.splice(0,B.length,R,i),I=["light-dark","light-dark"]}else{if(E!==!1){const R=B.findIndex(([i])=>i===E);if(R<0)throw new TypeError(`\`themes\` must contain the defaultColor key \`${E}\``);B.unshift(...B.splice(R,1))}I=B.map((R,i)=>E!==!1&&i===0?"default":"variable")}const C=B.map(([,R])=>SB(R,A)),w=JSON.stringify(B.map(([R],i)=>[PQ(C[i]),I[i],R]));let G=lB.get(C[0]);const k=G?.get(w);if(k!==void 0)return k;const S=B.map(([R],i)=>bB(C[i],R,I[i]));if(G===void 0&&(G=new Map,lB.set(C[0],G)),G.set(w,S),G.size>128){const R=G.keys().next().value;R!==void 0&&G.delete(R)}return S}function xA(Q,A,B,E,I,C,w=0){const G={content:Q.slice(A,B),offset:A+w};if(I[0].role==="single"){const{styles:S,fg:R}=I[0],i=S[E];G.color=i?.color??R;let F=0;i?.italic===!0&&(F|=1),(i?.weight??0)>=600&&(F|=2),G.fontStyle=F}else G.htmlStyle=aB(I,E,C);const k=yA[E];return k!==0&&(G.type=k),G}function AQ(Q,A){let B=ZB.get(Q);B===void 0&&(B=new Map,ZB.set(Q,B));let E=B.get(A);return E===void 0&&(E=[],B.set(A,E)),E}function aB(Q,A,B){const E=AQ(Q,B);let I=E[A];if(I===void 0){if(Q[0].role==="light-dark")I=pQ(Q,A,B);else{I={};for(const{color:C,role:w,styles:G,fg:k}of Q){const S=G[A],R=w==="default";I[R?"color":B+C]=S?.color??k??"inherit",S?.italic===!0&&(I[R?"font-style":`${B}${C}-font-style`]="italic"),S!=null&&S.weight!==0&&(I[R?"font-weight":`${B}${C}-font-weight`]=String(S.weight))}}E[A]=I}return I}function VQ(Q,A){let B=eB.get(Q);B===void 0&&(B=new Map,eB.set(Q,B));const E=B.get(A);if(E!==void 0)return E??void 0;const I=Q.length;if(!(I<=255&&Q.every(J=>J.table!==void 0))){B.set(A,null);return}const C=Q.map(J=>J.role==="default"?new Uint8Array(0):XQ.encode(gA(`${A}${J.color}`))),w=32+16*I,G=w+384*I;let k=64,S=128,R=0;for(const{length:J}of C)k+=64+3*J,S+=48+2*J,R+=J;const i=new Uint8Array(G+R),F=new DataView(i.buffer);i[0]=I,i[1]=Q[0].role==="light-dark"?1:0,F.setUint32(4,w,!0),F.setUint32(8,k,!0),F.setUint32(12,S,!0),F.setUint32(16,fQ++,!0);let s=G;for(let J=0;J<I;J++){const t=32+16*J;F.setUint32(t,s,!0),F.setUint32(t+4,C[J].length,!0),F.setUint32(t+8,Q[J].role==="default"?1:0,!0),i.set(Q[J].table,w+384*J),i.set(C[J],s),s+=C[J].length}return B.set(A,i),i}function mQ(Q,A){let B=dB.get(Q);B===void 0&&(B=new Map,dB.set(Q,B));const E=B.get(A);if(E!==void 0)return E;const{fg:I,bg:C,rootStyle:w}=kB(Q,A),G=[`<pre class="highlights" style="${gA(w??`background-color:${C};color:${I}`)}"><code>`];for(let S=1;S<T.length;S++){const R=aB(Q,S,A);let i="";for(const F in R)i+=`${i===""?"":";"}${F}:${R[F]}`;G.push(`<span style="${gA(i)}">`)}const k=$B(G);return B.set(A,k),k}function pQ(Q,A,B){const[E,I]=Q,C=E.styles[A],w=I.styles[A],G=C?.color??E.fg??"currentcolor",k=w?.color??I.fg??"currentcolor",S={color:G===k?G:`light-dark(${G}, ${k})`},R=C?.italic===!0,i=w?.italic===!0;R&&i?S["font-style"]="italic":(R&&(S[`${B}light-font-style`]="italic"),i&&(S[`${B}dark-font-style`]="italic"));const F=C?.weight??0,s=w?.weight??0;return F!==0&&F===s?S["font-weight"]=String(F):(F!==0&&(S[`${B}light-font-weight`]=String(F)),s!==0&&(S[`${B}dark-font-weight`]=String(s))),S}function BQ(Q,A,B,E,I,C=0){const w=[],G=I??0,{styles:k,fg:S,role:R}=B[0],i=R==="single"?void 0:AQ(B,E);let F=0;for(let s=0;;s+=2){const J=s;for(;s<A.length&&A[s+1]!==4294967295;)s+=2;const t=s===J?F:A[s-2];let a;if(G>0&&t-F>=G)a=[xA(Q,F,t,0,B,E,C)];else{a=new Array((s-J)/2);let o=0;for(let n=J;n<s;n+=2){const Z=A[n];if(Z>F){const h=A[n+1];let L;if(i===void 0){const H=k[h];L={content:Q.slice(F,Z),offset:F+C,color:H?.color??S,fontStyle:(H?.italic===!0?1:0)|((H?.weight??0)>=600?2:0)}}else L={content:Q.slice(F,Z),offset:F+C,htmlStyle:i[h]??aB(B,h,E)};const y=yA[h];y!==0&&(L.type=y),a[o++]=L,F=Z}}a.length=o}if(w.push(a),s===A.length)break;F=A[s]}return w}function kB(Q,A){if(Q[0].role==="single")return{fg:Q[0].fg,bg:Q[0].bg,themeName:Q[0].name};const B=`highlights-themes ${Q.map(C=>C.name).join(" ")}`;if(Q[0].role==="light-dark"){const C=(w,G,k)=>{const S=w??k,R=G??k;return S===R?S:`light-dark(${S}, ${R})`};return{fg:C(Q[0].fg,Q[1].fg,"currentcolor"),bg:C(Q[0].bg,Q[1].bg,"transparent"),themeName:B}}const E=Q.map(C=>C.role==="default"?C.fg??"inherit":`${A}${C.color}:${C.fg??"inherit"}`).join(";"),I=Q.map(C=>C.role==="default"?C.bg??"inherit":`${A}${C.color}-bg:${C.bg??"inherit"}`).join(";");return{fg:E,bg:I,themeName:B,rootStyle:Q[0].role==="default"?void 0:`${E};${I}`}}const sB=1,QQ=2,EQ=4,IQ=8,CQ=16,gQ=32,rB=[0,sB,QQ,EQ,IQ,0,0,CQ,0,gQ],gB=[0,95,135,175,215,255],wB=/\x1b(?:\[([0-?]*)[ -/]*([@-~])|\][^\x07\x1b\n]*(?:\x07|\x1b\\)|[ -/]*[0-~])/y;var wQ=class{constructor(){x(this,"fg",-1);x(this,"bg",-1);x(this,"flags",0);x(this,"styles",new Map)}};function bA(Q){return String(Q).toLowerCase()==="ansi"}function RB(Q,A){if(A<16)return Q.ansi[A];let B=A&16777215;if(A<232){const E=A-16;B=gB[E/36|0]<<16|gB[(E/6|0)%6]<<8|gB[E%6]}else A<256&&(B=(8+(A-232)*10)*65793);return`#${B.toString(16).padStart(6,"0")}`}function UB(Q,A,B,E,I=new wQ,C=0){const w=[],G=E??0;let k=[],S,R,i,F=Q.indexOf("\x1B"),s=0;for(;;){const J=Q.indexOf(`
1
+ var cQ=Object.defineProperty;var NB=Q=>{throw TypeError(Q)};var LQ=(Q,A,B)=>A in Q?cQ(Q,A,{enumerable:!0,configurable:!0,writable:!0,value:B}):Q[A]=B;var x=(Q,A,B)=>LQ(Q,typeof A!="symbol"?A+"":A,B),CB=(Q,A,B)=>A.has(Q)||NB("Cannot "+B);var g=(Q,A,B)=>(CB(Q,A,"read from private field"),B?B.call(Q):A.get(Q)),c=(Q,A,B)=>A.has(Q)?NB("Cannot add the same private member more than once"):A instanceof WeakSet?A.add(Q):A.set(Q,B),M=(Q,A,B,E)=>(CB(Q,A,"write to private field"),E?E.call(Q,B):A.set(Q,B),B),D=(Q,A,B)=>(CB(Q,A,"access private method"),B);var HB=(Q,A,B,E)=>({set _(I){M(Q,A,I,B)},get _(){return g(Q,A,E)}});import{a3 as tQ,r as hQ,Q as jQ}from"./BVAdLfsa.js";import{B as oQ,D as YQ}from"./CqjTdgdP.js";const T=["none","attribute","attribute.jsx","boolean","comment","comment.doc","constant","constant.builtin","constructor","diff.minus","diff.plus","embedded","emphasis","emphasis.strong","function","function.definition","function.method","keyword","keyword.control","keyword.declaration","keyword.import","keyword.operator","label","namespace","number","operator","predictive","preproc","primary","property","property.json_key","punctuation","punctuation.bracket","punctuation.bracket.html","punctuation.bracket.jsx","punctuation.delimiter","punctuation.delimiter.html","punctuation.delimiter.jsx","punctuation.list_marker","punctuation.markup","punctuation.special","selector","selector.class","selector.id","string","string.escape","string.regex","string.special","string.special.symbol","tag","tag.doctype","tag.jsx","text.jsx","text.literal","title","type","type.builtin","type.class","variable","variable.parameter","variable.special","enum","hint","keyword.jsdoc","link_text","link_uri","selector.pseudo","tag.component.jsx","type.jsdoc","variable.jsdoc","variant","background","foreground"],aQ="--hls-",NQ=new TextEncoder,HQ=/^#([a-f0-9]{3,4}|[a-f0-9]{6}|[a-f0-9]{8})$/i,nQ=/^color\(display-p3\s+[+-]?(?:\d+(?:\.\d*)?|\.\d+)\s+[+-]?(?:\d+(?:\.\d*)?|\.\d+)\s+[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:\s*\/\s*[+-]?(?:\d+(?:\.\d*)?|\.\d+))?\s*\)$/i;function ZQ(Q){return typeof Q=="string"&&(HQ.test(Q.trim())||nQ.test(Q.trim()))}function FB(Q){return Q["editor.foreground"]??Q.text??Q.foreground}function uB(Q){return Q["editor.background"]??Q.background}const YB=["black","red","green","yellow","blue","magenta","cyan","white","bright_black","bright_red","bright_green","bright_yellow","bright_blue","bright_magenta","bright_cyan","bright_white"],eQ=["#000000","#cd3131","#0dbc79","#e5e510","#2472c8","#bc3fbc","#11a8cd","#e5e5e5","#666666","#f14c4c","#23d18b","#f5f543","#3b8eea","#d670d6","#29b8db","#ffffff"];function dQ(Q){return YB.map((A,B)=>zB({foreground:Q[`terminal.ansi.${A}`]},"foreground").color??eQ[B])}function OB(Q){return Q===null?"null":Q===void 0?"undefined":typeof Q=="string"?`the string ${JSON.stringify(Q)} (theme ids are not supported; import the theme object from "@pierre/highlights/themes")`:Array.isArray(Q)?"an array":typeof Q=="object"?"themes"in Q&&Array.isArray(Q.themes)?`a ThemeFamily whose first member is ${OB(Q.themes[0])}`:"an object without a `name`":`a ${typeof Q}`}function lQ(Q){return Q!=null&&typeof Q=="object"&&"name"in Q&&typeof Q.name=="string"&&Q.name!==""}function xQ(Q){const A=Q!=null&&typeof Q=="object"&&"themes"in Q&&Q.themes!=null?Q.themes[0]:Q;if(!lQ(A))throw new TypeError(`invalid theme: expected a Theme or ThemeFamily object, received ${OB(Q)}`);return A}function vB(Q,A){let B;for(let E=A;E!=="";){const I=Q[E];if(typeof I=="string")return{...B,color:I};if(I!=null&&typeof I=="object"&&(B??=I,I.color!=null))return{...B,color:I.color};const C=E.lastIndexOf(".");E=C<0?"":E.slice(0,C)}return B}function zB(Q,A){let B,E,I;return A==="background"?B=uB(Q):A==="foreground"?B=FB(Q):({color:B,font_style:E,font_weight:I}=vB(Q.syntax??{},A)??{},(E!=null||I!=null)&&(B??=FB(Q))),ZQ(B)?(B=B.trim().toLowerCase(),B.startsWith("#")&&(B.length<=5&&(B=B.replace(/[^#]/g,"$&$&")),B.length===9&&B.endsWith("ff")&&(B=B.slice(0,7)),B==="#00000000"&&(B=void 0))):B=void 0,{color:B,italic:E==="italic",weight:I!=null&&I>=100&&I<=900?Math.round(I/100)*100:0}}function zA(Q,A){return`var(${A}${Q.replace(/[._]/g,"-")})`}function gA(Q){return Q.replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;").replaceAll(">","&gt;")}function $B(Q){const A=Q.map(w=>NQ.encode(w));let B=4+8*A.length;const E=new Uint8Array(B+A.reduce((w,G)=>w+G.length,0)),I=new DataView(E.buffer);let C=32;for(let w=0;w<A.length;w++)I.setUint32(4+8*w,B,!0),I.setUint32(8+8*w,A[w].length,!0),E.set(A[w],B),B+=A[w].length,w!==0&&(C=Math.max(C,A[w].length+32));return I.setUint32(0,C,!0),E}const nB=new WeakMap;function SB(Q,A=aQ){const B=xQ(Q),E=B.cssVariables===!0?A:"";let I=nB.get(B);const C=I?.get(E);if(C!==void 0)return C;const w=B.cssVariables===!0?rQ(B.name,A):typeof B.cssVariables=="object"?bQ(B):WQ(B);return I===void 0&&(I=new Map,nB.set(B,I)),I.set(E,w),w}function bQ(Q){const A=Q.cssVariables;if(typeof A!="object")throw new Error("Expected CSS palette");const B=A.prefix??"--hls-",E=R=>{const i=A.defaults?.[R];return`var(${B}${R}${i?`, ${i}`:""})`},I=new Array(T.length).fill(null),C=Q.style.syntax??{};for(let R=1;R<T.length;R++){const i=vB(C,T[R]);I[R]={color:E(i?.color??"foreground"),italic:i?.font_style==="italic",weight:i?.font_weight===void 0?0:Math.round(i.font_weight/100)*100}}const w=E(FB(Q.style)??"foreground"),G=E(uB(Q.style)??"background");let k,S;return{name:Q.name,styles:I,fg:w,bg:G,table:void 0,get htmlOpeners(){return k??=_B(I,w,G)},get ansi(){return S??=YB.map(R=>{const i=Q.style[`terminal.ansi.${R}`];return E(typeof i=="string"?i:`terminal-ansi-${R.replace("_","-")}`)})}}}function rQ(Q,A){let B;const E=()=>B??=TQ(A);let I;return{name:Q,get styles(){return E().styles},get fg(){return E().fg},get bg(){return E().bg},table:void 0,htmlOpeners:void 0,get ansi(){return I??=YB.map(C=>zA(`terminal.ansi.${C}`,A))}}}function TQ(Q){const A=new Array(T.length).fill(null);for(let B=1;B<T.length;B++)A[B]={color:zA(T[B],Q),italic:!1,weight:0};return{styles:A,fg:zA("foreground",Q),bg:zA("background",Q)}}function WQ(Q){const A=Q.style??{},B=new Array(T.length).fill(null),E=new Uint8Array(T.length*5);let I,C,w=!1;for(let S=1;S<T.length;S++){const R=T[S],i=zB(A,R),{color:F,italic:s,weight:J}=i,t=S*5;if(F!==void 0)if(F.startsWith("#")){const a=parseInt(F.slice(1,7),16);E[t]=a>>16,E[t+1]=a>>8&255,E[t+2]=a&255,E[t+3]=F.length===9?parseInt(F.slice(7),16):255}else w=!0;E[t+4]=(s?16:0)|J/100,!(F===void 0&&!s&&J===0)&&(R==="foreground"?I=F:R==="background"?C=F:B[S]=i)}let G,k;return{name:Q.name,styles:B,fg:I,bg:C,table:w?void 0:E,get htmlOpeners(){if(w)return G??=_B(B,I,C)},get ansi(){return k??=dQ(A)}}}function _B(Q,A,B){const E=[`<pre class="highlights" style="${gA((B===void 0?"":`background-color:${B};`)+(A===void 0?"":`color:${A}`))}"><code>`];for(let I=1;I<T.length;I++){const C=Q[I],w=`color:${C?.color??"inherit"}`+(C?.italic===!0?";font-style:italic":"")+(C!=null&&C.weight!==0?`;font-weight:${C.weight}`:"");E.push(`<span style="${gA(w)}">`)}return $B(E)}const XQ=new TextEncoder,yA=new Uint8Array(T.length);for(let Q=0;Q<T.length;Q++){const A=T[Q];A==="string.regex"?yA[Q]=3:A==="comment"||A.startsWith("comment.")?yA[Q]=1:(A==="string"||A.startsWith("string."))&&(yA[Q]=2)}const ZB=new WeakMap,eB=new WeakMap;let fQ=1;const dB=new WeakMap,lB=new WeakMap,xB=new WeakMap;let KQ=0;function PQ(Q){let A=xB.get(Q);return A===void 0&&(A=KQ++,xB.set(Q,A)),A}function bB(Q,A,B){const{name:E,styles:I,fg:C,bg:w,table:G}=Q;return{color:A,role:B,name:E,styles:I,fg:C,bg:w,table:G,get ansi(){return Q.ansi}}}function lA(Q){const{cssVariablePrefix:A}=Q;if(Q.themes==null)return[bB(SB(Q.theme,A),null,"single")];const B=Object.entries(Q.themes).filter(([,R])=>R!=null).sort(([R],[i])=>R<i?-1:1);if(B.length===0)throw new TypeError("themes must not be empty");const E=Q.defaultColor??"light";let I;if(E==="light-dark()"){const R=B.find(([F])=>F==="light"),i=B.find(([F])=>F==="dark");if(R===void 0||i===void 0)throw new TypeError("`themes` must contain `light` and `dark` when defaultColor is 'light-dark()'");B.splice(0,B.length,R,i),I=["light-dark","light-dark"]}else{if(E!==!1){const R=B.findIndex(([i])=>i===E);if(R<0)throw new TypeError(`\`themes\` must contain the defaultColor key \`${E}\``);B.unshift(...B.splice(R,1))}I=B.map((R,i)=>E!==!1&&i===0?"default":"variable")}const C=B.map(([,R])=>SB(R,A)),w=JSON.stringify(B.map(([R],i)=>[PQ(C[i]),I[i],R]));let G=lB.get(C[0]);const k=G?.get(w);if(k!==void 0)return k;const S=B.map(([R],i)=>bB(C[i],R,I[i]));if(G===void 0&&(G=new Map,lB.set(C[0],G)),G.set(w,S),G.size>128){const R=G.keys().next().value;R!==void 0&&G.delete(R)}return S}function xA(Q,A,B,E,I,C,w=0){const G={content:Q.slice(A,B),offset:A+w};if(I[0].role==="single"){const{styles:S,fg:R}=I[0],i=S[E];G.color=i?.color??R;let F=0;i?.italic===!0&&(F|=1),(i?.weight??0)>=600&&(F|=2),G.fontStyle=F}else G.htmlStyle=aB(I,E,C);const k=yA[E];return k!==0&&(G.type=k),G}function AQ(Q,A){let B=ZB.get(Q);B===void 0&&(B=new Map,ZB.set(Q,B));let E=B.get(A);return E===void 0&&(E=[],B.set(A,E)),E}function aB(Q,A,B){const E=AQ(Q,B);let I=E[A];if(I===void 0){if(Q[0].role==="light-dark")I=pQ(Q,A,B);else{I={};for(const{color:C,role:w,styles:G,fg:k}of Q){const S=G[A],R=w==="default";I[R?"color":B+C]=S?.color??k??"inherit",S?.italic===!0&&(I[R?"font-style":`${B}${C}-font-style`]="italic"),S!=null&&S.weight!==0&&(I[R?"font-weight":`${B}${C}-font-weight`]=String(S.weight))}}E[A]=I}return I}function VQ(Q,A){let B=eB.get(Q);B===void 0&&(B=new Map,eB.set(Q,B));const E=B.get(A);if(E!==void 0)return E??void 0;const I=Q.length;if(!(I<=255&&Q.every(J=>J.table!==void 0))){B.set(A,null);return}const C=Q.map(J=>J.role==="default"?new Uint8Array(0):XQ.encode(gA(`${A}${J.color}`))),w=32+16*I,G=w+384*I;let k=64,S=128,R=0;for(const{length:J}of C)k+=64+3*J,S+=48+2*J,R+=J;const i=new Uint8Array(G+R),F=new DataView(i.buffer);i[0]=I,i[1]=Q[0].role==="light-dark"?1:0,F.setUint32(4,w,!0),F.setUint32(8,k,!0),F.setUint32(12,S,!0),F.setUint32(16,fQ++,!0);let s=G;for(let J=0;J<I;J++){const t=32+16*J;F.setUint32(t,s,!0),F.setUint32(t+4,C[J].length,!0),F.setUint32(t+8,Q[J].role==="default"?1:0,!0),i.set(Q[J].table,w+384*J),i.set(C[J],s),s+=C[J].length}return B.set(A,i),i}function mQ(Q,A){let B=dB.get(Q);B===void 0&&(B=new Map,dB.set(Q,B));const E=B.get(A);if(E!==void 0)return E;const{fg:I,bg:C,rootStyle:w}=kB(Q,A),G=[`<pre class="highlights" style="${gA(w??`background-color:${C};color:${I}`)}"><code>`];for(let S=1;S<T.length;S++){const R=aB(Q,S,A);let i="";for(const F in R)i+=`${i===""?"":";"}${F}:${R[F]}`;G.push(`<span style="${gA(i)}">`)}const k=$B(G);return B.set(A,k),k}function pQ(Q,A,B){const[E,I]=Q,C=E.styles[A],w=I.styles[A],G=C?.color??E.fg??"currentcolor",k=w?.color??I.fg??"currentcolor",S={color:G===k?G:`light-dark(${G}, ${k})`},R=C?.italic===!0,i=w?.italic===!0;R&&i?S["font-style"]="italic":(R&&(S[`${B}light-font-style`]="italic"),i&&(S[`${B}dark-font-style`]="italic"));const F=C?.weight??0,s=w?.weight??0;return F!==0&&F===s?S["font-weight"]=String(F):(F!==0&&(S[`${B}light-font-weight`]=String(F)),s!==0&&(S[`${B}dark-font-weight`]=String(s))),S}function BQ(Q,A,B,E,I,C=0){const w=[],G=I??0,{styles:k,fg:S,role:R}=B[0],i=R==="single"?void 0:AQ(B,E);let F=0;for(let s=0;;s+=2){const J=s;for(;s<A.length&&A[s+1]!==4294967295;)s+=2;const t=s===J?F:A[s-2];let a;if(G>0&&t-F>=G)a=[xA(Q,F,t,0,B,E,C)];else{a=new Array((s-J)/2);let o=0;for(let n=J;n<s;n+=2){const Z=A[n];if(Z>F){const h=A[n+1];let L;if(i===void 0){const H=k[h];L={content:Q.slice(F,Z),offset:F+C,color:H?.color??S,fontStyle:(H?.italic===!0?1:0)|((H?.weight??0)>=600?2:0)}}else L={content:Q.slice(F,Z),offset:F+C,htmlStyle:i[h]??aB(B,h,E)};const y=yA[h];y!==0&&(L.type=y),a[o++]=L,F=Z}}a.length=o}if(w.push(a),s===A.length)break;F=A[s]}return w}function kB(Q,A){if(Q[0].role==="single")return{fg:Q[0].fg,bg:Q[0].bg,themeName:Q[0].name};const B=`highlights-themes ${Q.map(C=>C.name).join(" ")}`;if(Q[0].role==="light-dark"){const C=(w,G,k)=>{const S=w??k,R=G??k;return S===R?S:`light-dark(${S}, ${R})`};return{fg:C(Q[0].fg,Q[1].fg,"currentcolor"),bg:C(Q[0].bg,Q[1].bg,"transparent"),themeName:B}}const E=Q.map(C=>C.role==="default"?C.fg??"inherit":`${A}${C.color}:${C.fg??"inherit"}`).join(";"),I=Q.map(C=>C.role==="default"?C.bg??"inherit":`${A}${C.color}-bg:${C.bg??"inherit"}`).join(";");return{fg:E,bg:I,themeName:B,rootStyle:Q[0].role==="default"?void 0:`${E};${I}`}}const sB=1,QQ=2,EQ=4,IQ=8,CQ=16,gQ=32,rB=[0,sB,QQ,EQ,IQ,0,0,CQ,0,gQ],gB=[0,95,135,175,215,255],wB=/\x1b(?:\[([0-?]*)[ -/]*([@-~])|\][^\x07\x1b\n]*(?:\x07|\x1b\\)|[ -/]*[0-~])/y;var wQ=class{constructor(){x(this,"fg",-1);x(this,"bg",-1);x(this,"flags",0);x(this,"styles",new Map)}};function bA(Q){return String(Q).toLowerCase()==="ansi"}function RB(Q,A){if(A<16)return Q.ansi[A];let B=A&16777215;if(A<232){const E=A-16;B=gB[E/36|0]<<16|gB[(E/6|0)%6]<<8|gB[E%6]}else A<256&&(B=(8+(A-232)*10)*65793);return`#${B.toString(16).padStart(6,"0")}`}function UB(Q,A,B,E,I=new wQ,C=0){const w=[],G=E??0;let k=[],S,R,i,F=Q.indexOf("\x1B"),s=0;for(;;){const J=Q.indexOf(`
2
2
  `,s);let t=J<0?Q.length:J;J>s&&Q.charCodeAt(J-1)===13&&t--;const a=G>0&&t-s>=G;for(;s<t;){F>=0&&F<s&&(F=Q.indexOf("\x1B",s));let o=F>=0&&F<t?F:t,n=o,Z;if(o<t){wB.lastIndex=o;const h=wB.exec(Q);h===null?n=++o:(n=wB.lastIndex,h[2]==="m"&&!(h[1].charCodeAt(0)>=60)&&(Z=h[1]))}if(o>s&&a)R===void 0?(R=xA(Q,s,o,0,A,B,C),k.push(R)):R.content+=Q.slice(s,o);else if(o>s){if(S===void 0){const{fg:h,bg:L,flags:y}=I,H=`${h},${L},${y}`;if(S=I.styles.get(H),S===void 0){const m=((y&EQ)!==0?1:0)|((y&sB)!==0?2:0)|((y&IQ)!==0?4:0)|((y&gQ)!==0?8:0),z=A.map(e=>{let j=h<0?e.fg:RB(e,h),$=L<0?void 0:RB(e,L);return(y&CQ)!==0&&($=j,j=L<0?e.bg:RB(e,L)),(y&QQ)!==0&&j!==void 0&&(j=j.startsWith("#")?j.length===9?j.slice(0,7)+Math.round(parseInt(j.slice(7),16)/2).toString(16).padStart(2,"0"):`${j}80`:`color-mix(in srgb, ${j} 50%, transparent)`),[j,$]});if(A[0].role==="single"){const[e,j]=z[0];S=j===void 0?{color:e,fontStyle:m}:{color:e,bgColor:j,fontStyle:m}}else{const e=[];(m&1)!==0&&e.push(["font-style","italic"]),(m&2)!==0&&e.push(["font-weight","bold"]),(m&12)!==0&&e.push(["text-decoration",(m&12)===12?"underline line-through":(m&4)!==0?"underline":"line-through"]);const j={};if(A[0].role==="light-dark"){const[[$,pA],[qA,sA]]=z,wA=$??"currentcolor",HA=qA??"currentcolor";if(j.color=wA===HA?wA:`light-dark(${wA}, ${HA})`,pA!==void 0||sA!==void 0){const RA=pA??"transparent",uA=sA??"transparent";j["background-color"]=RA===uA?RA:`light-dark(${RA}, ${uA})`}for(const[RA,uA]of e)j[RA]=uA}else for(let $=0;$<A.length;$++){const[pA,qA]=z[$],sA=A[$].role==="default",wA=`${B}${A[$].color}`;j[sA?"color":wA]=pA??"inherit",qA!==void 0&&(j[sA?"background-color":`${wA}-bg`]=qA);for(const[HA,RA]of e)j[sA?HA:`${wA}-${HA}`]=RA}S={htmlStyle:j}}I.styles.set(H,S)}}R!==void 0&&i===S?R.content+=Q.slice(s,o):(R={content:Q.slice(s,o),offset:s+C,...S},i=S,k.push(R))}if(Z!==void 0){const h=Z.split(";");for(let L=0;L<h.length;L++){const y=Number(h[L]);if(y===0)I.fg=-1,I.bg=-1,I.flags=0;else if(y<10)I.flags|=rB[y]??0;else if(y>20&&y<30)I.flags&=~((rB[y-20]??0)|(y===22?sB:0));else if(y>=30&&y<38)I.fg=y-30;else if(y===39)I.fg=-1;else if(y>=40&&y<48)I.bg=y-40;else if(y===49)I.bg=-1;else if(y>=90&&y<98)I.fg=y-82;else if(y>=100&&y<108)I.bg=y-92;else if(y===38||y===48){const H=h[++L];let m=-1;if(H==="5"){const z=Number(h[++L]);Number.isInteger(z)&&z<256&&(m=z)}else if(H==="2"){const z=Number(h[L+1]),e=Number(h[L+2]),j=Number(h[L+3]);L+=3,z>=0&&e>=0&&j>=0&&(m=16777216|Math.min(z,255)<<16|Math.min(e,255)<<8|Math.min(j,255))}m>=0&&(y===38?I.fg=m:I.bg=m)}}S=void 0}s=n}if(w.push(k),J<0)return w;s=J+1,k=[],R=void 0}}const qQ={plain:0,plaintext:0,text:0,txt:0,abap:1,ada:2,adb:2,ads:2,"angular-html":3,apache:4,apacheconf:4,htaccess:4,apex:5,applescript:6,adoc:7,asciidoc:7,asm:8,assembly:8,mips:8,mipsasm:8,riscv:8,s:8,astro:9,awk:10,bash:11,sh:11,shell:11,shellscript:11,shellsession:11,zsh:11,bat:12,batch:12,batchfile:12,cmd:12,dos:12,bib:13,bibtex:13,bicep:14,blade:15,c:16,h:16,c3:17,clj:18,cljc:18,cljs:18,clojure:18,edn:18,cmake:19,cbl:20,cob:20,cobol:20,codeowners:21,codeql:22,ql:22,coffee:23,coffeescript:23,coq:24,rocq:24,"c++":25,cc:25,cpp:25,cxx:25,hh:25,hpp:25,hxx:25,"c#":26,cs:26,csharp:26,css:27,postcss:27,qss:27,csv:28,cu:29,cuda:29,cuh:29,cql:30,cypher:30,d:31,dart:32,dax:33,diff:34,"git-commit":34,"git-rebase":34,patch:34,containerfile:35,docker:35,dockerfile:35,dotenv:36,env:36,elixir:37,ex:37,exs:37,elm:38,erb:39,erl:40,erlang:40,hrl:40,fish:41,f03:42,f08:42,f90:42,f95:42,fortran:42,"fortran-free-form":42,f:43,f77:43,for:43,"fortran-fixed-form":43,"f#":44,fs:44,fsharp:44,fsi:44,fsx:44,gdresource:45,"godot-resource":45,tres:45,tscn:45,gd:46,gdscript:46,gdshader:47,gdshaderinc:47,"godot-shader":47,cucumber:48,feature:48,gherkin:48,gleam:49,comp:50,frag:50,geom:50,glsl:50,vert:50,gnuplot:51,gp:51,go:52,golang:52,gql:53,graphql:53,groq:54,gradle:55,groovy:55,gsh:55,gvy:55,gy:55,nextflow:55,"nextflow-groovy":55,nf:55,hack:56,haml:57,handlebars:58,hbs:58,mustache:58,haskell:59,hs:59,haxe:60,hx:60,hlsl:61,htm:62,html:62,"html-derivative":62,http:63,desktop:64,ini:64,properties:64,systemd:64,java:65,j2:66,jinja:66,jinja2:66,cjs:67,javascript:67,js:67,mjs:67,json:68,jsonc:68,json5:69,jsonl:70,jsonnet:71,libsonnet:71,jsx:72,jl:73,julia:73,just:74,justfile:74,kdl:75,kotlin:76,kt:76,kts:76,latex:77,tex:77,lean:78,lean4:78,less:79,liquid:80,cl:81,el:81,elisp:81,"emacs-lisp":81,lisp:81,lsp:81,racket:81,rkt:81,scheme:81,scm:81,llvm:82,log:83,lua:84,luau:85,make:86,makefile:86,mk:86,markdown:87,md:87,mdc:87,matlab:88,octave:88,mdx:89,mermaid:90,mmd:90,mbt:91,moonbit:91,nginx:92,nim:93,nix:94,m:95,mm:95,objc:95,objcpp:95,"objective-c":95,"objective-cpp":95,objectivec:95,ml:96,mli:96,ocaml:96,odin:97,openscad:98,scad:98,delphi:99,dpk:99,dpr:99,lpr:99,"object-pascal":99,objectpascal:99,pas:99,pascal:99,pp:99,perl:100,pl:100,pm:100,php:101,plsql:102,po:103,pot:103,potx:103,powerquery:104,pq:104,powershell:105,ps:105,ps1:105,psd1:105,psm1:105,pwsh:105,prisma:106,prolog:107,promql:108,proto:109,protobuf:109,jade:110,pug:110,puppet:111,py:112,python:112,qml:113,r:114,rscript:114,cshtml:115,razor:115,reg:116,rosmsg:117,restructuredtext:118,rst:118,rb:119,ruby:119,rs:120,rust:120,sas:121,sass:122,sbt:123,sc:123,scala:123,scss:124,shader:125,shaderlab:125,sol:126,solidity:126,sparql:127,sql:128,stata:129,styl:130,stylus:130,svelte:131,swift:132,tcl:133,hcl:134,terraform:134,tf:134,tfvars:134,toml:135,"angular-ts":136,cts:136,lit:136,mts:136,ts:136,"ts-tags":136,typescript:136,tsrx:137,tsv:138,tsx:139,ttl:140,turtle:140,twig:141,typ:142,typst:142,sv:143,svh:143,"system-verilog":143,systemverilog:143,verilog:143,vhd:144,vhdl:144,vim:145,viml:145,vimscript:145,vue:146,"vue-html":146,wasm:147,wat:147,wgsl:148,mathematica:149,wl:149,wolfram:149,svg:150,xml:150,xsd:150,xsl:150,xslt:150,yaml:151,yml:151,zig:152,zon:152},OA=new TextEncoder,RQ=new TextDecoder("utf-8",{ignoreBOM:!0}),$A=65536,TB=64,iA=81920,WB=[/^\p{ID_Start}$/u,/^[\u200C\u200D\p{ID_Continue}]$/u];let iB;const iQ=qQ;function QB(Q){const A=iQ[String(Q).toLowerCase()];if(typeof A!="number")throw new RangeError(`unknown lang: ${Q}`);return A}function uQ(Q){return typeof iQ[String(Q).toLowerCase()]=="number"||bA(Q)}var rA,TA,WA,XA,fA,P,DB,UA,JB,mB,IB=(mB=class{constructor(A){c(this,P);c(this,rA);c(this,TA);c(this,WA);c(this,XA);c(this,fA,new Uint8Array(0));x(this,"wasmModule");x(this,"instance");x(this,"memory");x(this,"buffer");x(this,"dv");x(this,"pageN");this.wasmModule=A;const B=new WebAssembly.Instance(A,{env:{is_id_start:(E,I)=>D(this,P,JB).call(this,E,I,0),is_id_continue:(E,I)=>D(this,P,JB).call(this,E,I,2)}});this.instance=B,this.memory=B.exports.memory,M(this,rA,B.exports.highlight),M(this,TA,B.exports.highlightStream),this.pageN=this.memory.buffer.byteLength/$A,this.buffer=new Uint8Array(this.memory.buffer),this.dv=new DataView(this.memory.buffer)}writeInput(A,B=0){if(typeof A=="string"){D(this,P,UA).call(this,B+A.length+96);let{read:E,written:I}=OA.encodeInto(A,this.buffer.subarray(iA+B,this.buffer.length-96));if(E<A.length){const C=A.slice(E);D(this,P,UA).call(this,B+I+C.length*3+96),I+=OA.encodeInto(C,this.buffer.subarray(iA+B+I,this.buffer.length-96)).written}return I}if(A instanceof ArrayBuffer&&(A=new Uint8Array(A)),!(A instanceof Uint8Array))throw new TypeError("input must be a string, Uint8Array, or ArrayBuffer");return D(this,P,UA).call(this,B+A.length+96),this.buffer.set(A,iA+B),A.length}codeToHtml(A,B){const E=B.cssVariablePrefix??"--hls-";if(bA(B.lang)){const i=lA(B),{fg:F,bg:s,rootStyle:J}=kB(i,E),t=yB(A),a=UB(t,i[0].role==="single"?[{...i[0],role:"default"}]:i,E);let o=`<pre class="highlights" style="${gA(J??(s===void 0?"":`background-color:${s};`)+(F===void 0?"":`color:${F}`))}"><code>`;for(let n=0,Z=-1;n<a.length;n++){n>0&&(Z=t.indexOf(`
3
3
  `,Z+1),o+=t.charCodeAt(Z-1)===13?`\r
4
4
  `:`
@@ -1 +1 @@
1
- import{t as Oe,bo as K,bm as L,bw as qe,b as Ne,bs as Ie,bq as at,br as xt}from"./C0QTy0Sy.js";import{bs as je,bj as bt,a5 as u,bA as c,b_ as x,W as r,bn as Ge,aA as U,ay as R,bS as n,aD as e,aB as m,c9 as $,c5 as Ce,ca as yt,bk as st,bH as Pe,bV as Be,a7 as fe,be as $e,b$ as ke,bO as B,bl as Ae}from"./3SdAC2_C.js";import{i as X}from"./bhKPSdq4.js";import{k as ot}from"./-K3ARgq0.js";import{g as De}from"./B6S6VNu7.js";import{c as P}from"./CUkDMZwP.js";import{s as Ee,f as Ue,c as Ye,b as Qe}from"./7UPrdiE9.js";import{P as He,h as Le,i as Me,g as We}from"./DlUZpQ7U.js";import{S as T,E as At}from"./DCL0Px6m.js";import"./C2jYl_tm.js";import{w as Pt}from"./CQwOMyxz.js";import{C as Tt}from"./3lsVHf6U.js";import{E as Ze}from"./B9qXV8kb.js";import"./Bsh6nUhU.js";import{Jv as xe,fx as Rt,Fs as nt,DN as it,q1 as Dt}from"./_LtUY0jS.js";import{a_ as lt,aX as It,aY as St,dJ as zt}from"./Cppy6ZYG.js";import{d as Et,r as Ht}from"./pQ6IdBCz.js";import{M as Lt}from"./DUJWrM6V.js";import{G as Mt}from"./a3TFelkn.js";import{A as et}from"./wl2qP2wF.js";import{M as Wt,e as Ft}from"./CBh3oApX.js";import{o as Ct}from"./RnZ98Lx7.js";import{f as Fe}from"./CttA-M7l.js";import{S as Se}from"./ClIBKxjv.js";import{F as ze,a2 as Bt,d3 as Ot,aw as qt,bn as Nt}from"./U9jJmfYa.js";var jt=m('<div class="space-y-3"><!> <!></div>'),Gt=m('<div class="space-y-3"><!> <!></div> <!>',1),Jt=m('<div class="space-y-3 rounded-xl border border-border p-4 shadow-xs"><div class="flex items-center gap-3"><!><!></div> <!> <div class="flex items-center justify-between pt-1"><!><!></div></div>'),Vt=m('<div class="min-w-0 space-y-3"><div class="flex h-10 items-center px-2"><!></div> <!></div>'),Xt=m('<div class="grid grid-cols-[repeat(auto-fit,minmax(min(100%,10rem),1fr))] gap-3 px-1"></div>'),Kt=m('<div class="flex h-10 items-center px-3"><!></div>'),Ut=m("<div><!> <!> <!> <!></div>"),Yt=m("<!> <!>",1),Qt=m('<div role="status" class="min-h-0 min-w-0 flex-1 overflow-hidden svelte-kmeefs" data-home-loading=""><div aria-hidden="true"><!></div></div>');function dt(b,l){if(new.target)return Oe({component:dt,...b});je(l,!0);const Y=Pt();bt(Y.cleanup);let S=K(l,"detail",7,!1),O=K(l,"count",7,5),Q=K(l,"view",7,"list"),Z=K(l,"grouped",7,!1),s=K(l,"rows",7,"workspace");var z={get detail(){return S()},set detail(i=!1){S(i),U()},get count(){return O()},set count(i=5){O(i),U()},get view(){return Q()},set view(i="list"){Q(i),U()},get grouped(){return Z()},set grouped(i=!1){Z(i),U()},get rows(){return s()},set rows(i="workspace"){s(i),U()},$set:qe,$on:(i,D)=>Ne(l,i,D)},y=Qt(),ie=u(y),be=u(ie);{var le=i=>{var D=Gt(),g=R(D),ee=u(g);T(ee,{class:"h-6 w-4/5"});var M=n(ee,2);T(M,{class:"h-4 w-1/2"}),c(g);var d=n(g,2);De(d,16,()=>[0,1],h=>h,(h,A)=>{var k=jt(),te=u(k);T(te,{class:"h-3 w-full"});var q=n(te,2);T(q,{class:"h-3 w-5/6"}),c(k),r(h,k)}),r(i,D)},Te=i=>{var D=Xt();De(D,20,()=>[0,1,2],g=>g,(g,ee)=>{var M=Vt(),d=u(M),h=u(d);T(h,{class:"h-3 w-20"}),c(d);var A=n(d,2);De(A,16,()=>[0,1,2],k=>k,(k,te)=>{var q=Jt(),de=u(q),re=u(de);T(re,{class:"h-4 flex-1"});var ce=n(re);T(ce,{class:"size-3 rounded-full"}),c(de);var t=n(de,2);T(t,{class:"h-3 w-full"});var o=n(t,2),w=u(o);T(w,{class:"size-4 rounded-sm"});var N=n(w);T(N,{class:"h-3 w-6"}),c(o),c(q),r(k,q)}),c(M),r(g,M)}),c(D),r(i,D)},_e=i=>{var D=Yt(),g=R(D);{var ee=d=>{var h=Kt(),A=u(h);T(A,{class:"h-3 w-20"}),c(h),r(d,h)};X(g,d=>{Z()&&d(ee)})}var M=n(g,2);De(M,16,()=>Array.from({length:O()},(d,h)=>h),d=>d,(d,h)=>{var A=Ut(),k=u(A);T(k,{class:"size-4 shrink-0 rounded-sm"});var te=n(k,2);T(te,{class:"h-4 min-w-0 flex-1"});var q=n(te,2);{var de=o=>{T(o,{class:"size-3 shrink-0 rounded-full"})},re=o=>{T(o,{class:"size-5 shrink-0 rounded-full"})};X(q,o=>{s()==="workspace"?o(de):s()==="integration"&&o(re,1)})}var ce=n(q,2);{var t=o=>{{let w=$(()=>s()==="workspace"?"h-3 w-8 shrink-0":"h-3 w-6 shrink-0");T(o,{get class(){return e(w)}})}};X(ce,o=>{s()!=="compact"&&o(t)})}c(A),x(()=>Ue(A,1,Ye(s()==="compact"?"flex min-h-6 items-center gap-2 py-1":`flex h-12 items-center gap-3 border-b border-border ${s()==="integration"?"px-2":"px-3"}`))),r(d,A)}),r(i,D)};X(be,i=>{S()?i(le):Q()==="board"?i(Te,1):i(_e,-1)})}return c(ie),c(y),x(i=>{Ee(y,"aria-label",i),Ee(y,"data-reduced",Y.current),Ue(ie,1,Ye(S()?"space-y-6 py-3":s()==="compact"?"":"px-5 pb-4"))},[()=>L.home_integrations_loading()]),r(b,y),Ge(z)}function ct(b){return b.filter(Et)}function Zt(){let b=null;return(l,Y)=>{const S=b?l.find(Q=>Q.id===b):void 0;if(S)return S;const O=Ht(l);return b=Y&&O?String(O.id):null,O}}function er(b,l,Y){return l&&b.find(S=>S.id===l)||Y}var tr=m('<div class="p-4"><!></div>'),rr=m('<div class="flex h-full min-h-0 min-w-0 flex-col" data-home-workspace-chat=""><!></div>');function vt(b,l){if(new.target)return Oe({component:vt,...b});je(l,!0);const Y=()=>Ie(ie,"$agents$",O),S=()=>Ie(be,"$loaded$",O),[O,Q]=at();let Z=K(l,"workspace",7),s=K(l,"preview",7,!1),z=K(l,"agent",7);const y=Ce(()=>Z().id),ie=lt(y),be=It(y),le=$(()=>ct(Y())),Te=$(()=>s()?void 0:z()?.id);yt(()=>{const t=e(Te);if(!t)return;const o=Date.now();return()=>{Date.now()-o<Lt||setTimeout(()=>xe.dispatch(Rt(t)),0)}});let _e=Be(void 0),i=0;function D(t,o){s()||!e(le).some(w=>w.id===t)||(Pe(_e,{agentId:t,questionMessageId:o,requestId:++i},!0),xe.dispatch(nt(y,t)),xe.dispatch(it(y,t)))}let g=Be(!1),ee;function M(){s()||(Pe(g,!1),clearTimeout(ee),xe.dispatch(Dt(y)),ee=setTimeout(()=>{Pe(g,!0)},15e3))}st(()=>(s()||M(),()=>clearTimeout(ee)));var d={focusAttention:D,get workspace(){return Z()},set workspace(t){Z(t),U()},get preview(){return s()},set preview(t=!1){s(t),U()},get agent(){return z()},set agent(t){z(t),U()},$set:qe,$on:(t,o)=>Ne(l,t,o)},h=rr(),A=u(h);{var k=t=>{Ze(t,{density:"compact",title:w=>{$e();var N=ke();x(ae=>B(N,ae),[()=>L.agentOverview_hierarchyGraph_noAgents_title()]),r(w,N)},$$slots:{title:!0}})},te=t=>{var o=fe(),w=R(o);ot(w,()=>z().id,N=>{{let ae=$(()=>e(_e)?.agentId===z().id?e(_e):void 0);Tt(N,{get workspace(){return Z()},get agentId(){return z().id},get agentName(){return z().name},autoFocus:!1,isFallbackPromptTarget:!0,get attentionFocusRequest(){return e(ae)},isInitialWorkspaceAgent:!1})}}),r(t,o)},q=t=>{var o=tr(),w=u(o);dt(w,{detail:!0}),c(o),r(t,o)},de=t=>{{const o=N=>{$e();var ae=ke();x(ye=>B(ae,ye),[()=>L.home_detail_unavailable()]),r(N,ae)};let w=$(()=>L.home_retry());At(t,{density:"compact",get retryLabel(){return e(w)},onRetry:M,message:o,$$slots:{message:!0}})}},re=t=>{{const o=N=>{$e();var ae=ke();x(ye=>B(ae,ye),[()=>L.agentOverview_hierarchyGraph_noAgents_title()]),r(N,ae)};let w=$(()=>L.home_retry());Ze(t,{density:"compact",get actionLabel(){return e(w)},onAction:M,title:o,$$slots:{title:!0}})}};X(A,t=>{s()?t(k):z()?t(te,1):!S()&&!e(g)?t(q,2):S()?t(re,-1):t(de,3)})}c(h),x(()=>Ee(h,"data-workspace-link-target",Z().id)),r(b,h);var ce=Ge(d);return Q(),ce}var ar=m('<span class="min-w-0 line-clamp-2 [overflow-wrap:anywhere]"> </span> <!>',1),tt=m("<!> <!>",1),sr=m('<div class="shrink-0"><!></div>'),or=m('<div><!> <span class="home-detail-repository-name truncate"> </span></div>'),rt=m("<!><!>",1),nr=m("<p> </p>"),ir=m('<!> <span class="min-w-0 truncate text-left"> </span> <!>',1),lr=m('<span class="flex min-w-0 items-center gap-2"><!> <span class="truncate"> </span></span>'),dr=m('<div class="shrink-0 min-w-0 px-1 py-2" data-home-agent-switcher=""><!></div>'),cr=m('<div class="flex items-center gap-2 px-4 py-2 type-caption text-muted-foreground" role="status"><p> </p> <!></div>'),vr=m('<section class="flex h-full min-h-0 min-w-0 flex-col" data-home-detail=""><header class="shrink-0 border-b border-border px-4 py-2"><div class="flex min-w-0 items-center gap-3"><h2 class="-ml-2 min-w-0 flex-1"><!></h2> <!></div> <!> <!></header> <!> <!> <div class="min-h-0 min-w-0 flex-1"><!></div></section>');function ur(b,l){if(new.target)return Oe({component:ur,...b});je(l,!0);const Y=()=>Ie(_e,"$readRevision$",Q),S=()=>Ie(Te,"$agents$",Q),O=()=>Ie(D,"$pickedId$",Q),[Q,Z]=at();let s=K(l,"workspace",7),z=K(l,"onclose",7),y=K(l,"preview",7,!1),ie=K(l,"showBackToList",7,!0);const be=$(()=>s().title.trim()?s().title:L.workspace_links_untitled_label()),le=Ce(()=>s().id),Te=lt(le),_e=St(le),i=Ce(()=>Y()),D=Wt(le),g=$(()=>ct(S())),ee=Zt(),M=$(()=>ee(e(g),Y()>i)),d=$(()=>er(e(g),O(),e(M)));function h(a){xe.dispatch(nt(le,a)),xe.dispatch(it(le,a))}const A=$(()=>[s().repositoryOwner,s().repositoryName].filter(Boolean).join("/")||s().repositoryPath);let k=Be(!1);async function te(){Pe(k,!1);try{await Ft(s().id),Pe(k,!zt.select(xe.state,s().id))}catch{Pe(k,!0)}}st(()=>{y()||te()});function q(){Ct(s().id)}var de={get workspace(){return s()},set workspace(a){s(a),U()},get onclose(){return z()},set onclose(a){z(a),U()},get preview(){return y()},set preview(a=!1){y(a),U()},get showBackToList(){return ie()},set showBackToList(a=!0){ie(a),U()},$set:qe,$on:(a,f)=>Ne(l,a,f)},re=vr(),ce=u(re),t=u(ce),o=u(t),w=u(o);P(w,()=>He,(a,f)=>{f(a,{children:(j,oe)=>{var G=fe(),W=R(G);P(W,()=>Le,(ve,E)=>{E(ve,{children:(J,ge)=>{var me=tt(),ne=R(me);{const F=(H,C)=>{let I=()=>(C?.()).props;{let v=$(()=>L.home_open_workspace());Fe(H,xt(I,{variant:"ghost",class:"type-title h-auto min-w-0 max-w-full shrink gap-2 justify-start whitespace-normal px-2 py-1 text-left font-medium leading-snug",wrapContent:!1,get"aria-label"(){return e(v)},onclick:q,children:(p,V)=>{var _=ar(),se=R(_),ue=Ae(se,!0),we=n(se,2);ze(we,{get icon(){return Bt},class:"shrink-0 text-muted-foreground",size:"sm"}),x(()=>B(ue,e(be))),r(p,_)},$$slots:{default:!0}}))}};P(ne,()=>Me,(H,C)=>{C(H,{child:F,$$slots:{child:!0}})})}var he=n(ne,2);P(he,()=>We,(F,H)=>{H(F,{children:(C,I)=>{$e();var v=ke();x(()=>B(v,e(be))),r(C,v)},$$slots:{default:!0}})}),r(J,me)},$$slots:{default:!0}})}),r(j,G)},$$slots:{default:!0}})}),c(o);var N=n(o,2);{var ae=a=>{var f=sr(),j=u(f);{let oe=$(()=>L.home_close_preview()),G=$(()=>L.home_close_preview());Fe(j,{variant:"ghost",size:"icon-sm",get"aria-label"(){return e(oe)},get tooltip(){return e(G)},get onclick(){return z()},children:(W,ve)=>{ze(W,{get icon(){return Ot}})},$$slots:{default:!0}})}c(f),r(a,f)};X(N,a=>{ie()&&a(ae)})}c(t);var ye=n(t,2);{var ut=a=>{var f=fe(),j=R(f);P(j,()=>He,(oe,G)=>{G(oe,{children:(W,ve)=>{var E=fe(),J=R(E);P(J,()=>Le,(ge,me)=>{me(ge,{children:(ne,he)=>{var F=rt(),H=R(F);{const I=(v,p)=>{let V=()=>(p?.()).props;var _=or();Qe(_,()=>({...V(),class:"mb-1 flex min-w-0 max-w-[min(100%,16rem)] items-center gap-1.5 type-caption text-muted-foreground","data-home-detail-repository":!0,"aria-label":e(A)}));var se=u(_);{var ue=pe=>{Mt(pe,{get identity(){return s().repositoryOwner},size:16,class:"shrink-0 rounded-sm"})},we=pe=>{ze(pe,{get icon(){return Nt}})};X(se,pe=>{s().repositoryOwner?pe(ue):pe(we,-1)})}var Ke=n(se,2),Re=Ae(Ke,!0);c(_),x(()=>B(Re,e(A))),r(v,_)};P(H,()=>Me,(v,p)=>{p(v,{child:I,$$slots:{child:!0}})})}var C=n(H);P(C,()=>We,(I,v)=>{v(I,{children:(p,V)=>{$e();var _=ke();x(()=>B(_,e(A))),r(p,_)},$$slots:{default:!0}})}),r(ne,F)},$$slots:{default:!0}})}),r(W,E)},$$slots:{default:!0}})}),r(a,f)};X(ye,a=>{e(A)&&a(ut)})}var pt=n(ye,2);{var mt=a=>{var f=fe(),j=R(f);P(j,()=>He,(oe,G)=>{G(oe,{children:(W,ve)=>{var E=fe(),J=R(E);P(J,()=>Le,(ge,me)=>{me(ge,{children:(ne,he)=>{var F=rt(),H=R(F);{const I=(v,p)=>{let V=()=>(p?.()).props;var _=nr();Qe(_,()=>({...V(),class:"type-caption line-clamp-2 break-words leading-snug text-muted-foreground"}));var se=Ae(_,!0);x(()=>B(se,s().statusMessage)),r(v,_)};P(H,()=>Me,(v,p)=>{p(v,{child:I,$$slots:{child:!0}})})}var C=n(H);P(C,()=>We,(I,v)=>{v(I,{children:(p,V)=>{$e();var _=ke();x(()=>B(_,s().statusMessage)),r(p,_)},$$slots:{default:!0}})}),r(ne,F)},$$slots:{default:!0}})}),r(W,E)},$$slots:{default:!0}})}),r(a,f)};X(pt,a=>{s().statusMessage&&a(mt)})}c(ce);var Je=n(ce,2);{var ft=a=>{var f=dr(),j=u(f);{let oe=$(()=>e(d)?.id??"");P(j,()=>Se.Root,(G,W)=>{W(G,{get value(){return e(oe)},onchange:ve=>{const E=e(g).find(J=>J.id===ve);E&&h(E.id)},children:(ve,E)=>{var J=tt(),ge=R(J);{let ne=$(()=>L.home_agents());P(ge,()=>Se.Trigger,(he,F)=>{F(he,{variant:"ghost",class:"h-8 w-fit max-w-full justify-start",get"aria-label"(){return e(ne)},children:(H,C)=>{var I=ir(),v=R(I);{var p=ue=>{{let we=$(()=>e(d).metadata?.specialist??e(d).agentMetadata?.specialist);et(ue,{get agentId(){return e(d).id},get specialist(){return e(we)},variant:"emphasized"})}};X(v,ue=>{e(d)&&ue(p)})}var V=n(v,2),_=Ae(V,!0),se=n(V,2);ze(se,{get icon(){return qt},class:"shrink-0 text-muted-foreground"}),x(()=>B(_,e(d)?.name)),r(H,I)},$$slots:{default:!0}})})}var me=n(ge,2);P(me,()=>Se.Content,(ne,he)=>{he(ne,{portal:!0,children:(F,H)=>{var C=fe(),I=R(C);De(I,17,()=>e(g),v=>v.id,(v,p)=>{var V=fe(),_=R(V);P(_,()=>Se.Item,(se,ue)=>{ue(se,{get value(){return e(p).id},get label(){return e(p).name},children:(we,Ke)=>{var Re=lr(),pe=u(Re);{let kt=$(()=>e(p).metadata?.specialist??e(p).agentMetadata?.specialist);et(pe,{get agentId(){return e(p).id},get specialist(){return e(kt)},variant:"emphasized"})}var wt=n(pe,2),$t=Ae(wt,!0);c(Re),x(()=>B($t,e(p).name)),r(we,Re)},$$slots:{default:!0}})}),r(v,V)}),r(F,C)},$$slots:{default:!0}})}),r(ve,J)},$$slots:{default:!0}})})}c(f),r(a,f)};X(Je,a=>{e(g).length&&a(ft)})}var Ve=n(Je,2);{var _t=a=>{var f=cr(),j=u(f),oe=Ae(j,!0),G=n(j,2);Fe(G,{variant:"outline",size:"sm",onclick:te,children:(W,ve)=>{$e();var E=ke();x(J=>B(E,J),[()=>L.home_retry()]),r(W,E)},$$slots:{default:!0}}),c(f),x(W=>B(oe,W),[()=>L.home_detail_unavailable()]),r(a,f)};X(Ve,a=>{e(k)&&a(_t)})}var Xe=n(Ve,2),gt=u(Xe);ot(gt,()=>s().id,a=>{vt(a,{get workspace(){return s()},get preview(){return y()},get agent(){return e(d)}})}),c(Xe),c(re),x(a=>Ee(re,"aria-label",a),[()=>L.home_workspace_details()]),r(b,re);var ht=Ge(de);return Z(),ht}export{dt as H,ur as a};
1
+ import{t as Oe,bo as K,bm as L,bw as qe,b as Ne,bs as Ie,bq as at,br as xt}from"./C0QTy0Sy.js";import{bs as je,bj as bt,a5 as u,bA as c,b_ as x,W as r,bn as Ge,aA as U,ay as R,bS as n,aD as e,aB as m,c9 as $,c5 as Ce,ca as yt,bk as st,bH as Pe,bV as Be,a7 as fe,be as $e,b$ as ke,bO as B,bl as Ae}from"./3SdAC2_C.js";import{i as X}from"./bhKPSdq4.js";import{k as ot}from"./-K3ARgq0.js";import{g as De}from"./B6S6VNu7.js";import{c as P}from"./CUkDMZwP.js";import{s as Ee,f as Ue,c as Ye,b as Qe}from"./7UPrdiE9.js";import{P as He,h as Le,i as Me,g as We}from"./DlUZpQ7U.js";import{S as T,E as At}from"./DCL0Px6m.js";import"./C2jYl_tm.js";import{w as Pt}from"./CQwOMyxz.js";import{C as Tt}from"./jbr21ium.js";import{E as Ze}from"./B9qXV8kb.js";import"./Bsh6nUhU.js";import{Jv as xe,fx as Rt,Fs as nt,DN as it,q1 as Dt}from"./_LtUY0jS.js";import{a_ as lt,aX as It,aY as St,dJ as zt}from"./Cppy6ZYG.js";import{d as Et,r as Ht}from"./pQ6IdBCz.js";import{M as Lt}from"./CE0T7dwE.js";import{G as Mt}from"./a3TFelkn.js";import{A as et}from"./wl2qP2wF.js";import{M as Wt,e as Ft}from"./Df8HaglQ.js";import{o as Ct}from"./DrOujub9.js";import{f as Fe}from"./CttA-M7l.js";import{S as Se}from"./ClIBKxjv.js";import{F as ze,a2 as Bt,d3 as Ot,aw as qt,bn as Nt}from"./U9jJmfYa.js";var jt=m('<div class="space-y-3"><!> <!></div>'),Gt=m('<div class="space-y-3"><!> <!></div> <!>',1),Jt=m('<div class="space-y-3 rounded-xl border border-border p-4 shadow-xs"><div class="flex items-center gap-3"><!><!></div> <!> <div class="flex items-center justify-between pt-1"><!><!></div></div>'),Vt=m('<div class="min-w-0 space-y-3"><div class="flex h-10 items-center px-2"><!></div> <!></div>'),Xt=m('<div class="grid grid-cols-[repeat(auto-fit,minmax(min(100%,10rem),1fr))] gap-3 px-1"></div>'),Kt=m('<div class="flex h-10 items-center px-3"><!></div>'),Ut=m("<div><!> <!> <!> <!></div>"),Yt=m("<!> <!>",1),Qt=m('<div role="status" class="min-h-0 min-w-0 flex-1 overflow-hidden svelte-kmeefs" data-home-loading=""><div aria-hidden="true"><!></div></div>');function dt(b,l){if(new.target)return Oe({component:dt,...b});je(l,!0);const Y=Pt();bt(Y.cleanup);let S=K(l,"detail",7,!1),O=K(l,"count",7,5),Q=K(l,"view",7,"list"),Z=K(l,"grouped",7,!1),s=K(l,"rows",7,"workspace");var z={get detail(){return S()},set detail(i=!1){S(i),U()},get count(){return O()},set count(i=5){O(i),U()},get view(){return Q()},set view(i="list"){Q(i),U()},get grouped(){return Z()},set grouped(i=!1){Z(i),U()},get rows(){return s()},set rows(i="workspace"){s(i),U()},$set:qe,$on:(i,D)=>Ne(l,i,D)},y=Qt(),ie=u(y),be=u(ie);{var le=i=>{var D=Gt(),g=R(D),ee=u(g);T(ee,{class:"h-6 w-4/5"});var M=n(ee,2);T(M,{class:"h-4 w-1/2"}),c(g);var d=n(g,2);De(d,16,()=>[0,1],h=>h,(h,A)=>{var k=jt(),te=u(k);T(te,{class:"h-3 w-full"});var q=n(te,2);T(q,{class:"h-3 w-5/6"}),c(k),r(h,k)}),r(i,D)},Te=i=>{var D=Xt();De(D,20,()=>[0,1,2],g=>g,(g,ee)=>{var M=Vt(),d=u(M),h=u(d);T(h,{class:"h-3 w-20"}),c(d);var A=n(d,2);De(A,16,()=>[0,1,2],k=>k,(k,te)=>{var q=Jt(),de=u(q),re=u(de);T(re,{class:"h-4 flex-1"});var ce=n(re);T(ce,{class:"size-3 rounded-full"}),c(de);var t=n(de,2);T(t,{class:"h-3 w-full"});var o=n(t,2),w=u(o);T(w,{class:"size-4 rounded-sm"});var N=n(w);T(N,{class:"h-3 w-6"}),c(o),c(q),r(k,q)}),c(M),r(g,M)}),c(D),r(i,D)},_e=i=>{var D=Yt(),g=R(D);{var ee=d=>{var h=Kt(),A=u(h);T(A,{class:"h-3 w-20"}),c(h),r(d,h)};X(g,d=>{Z()&&d(ee)})}var M=n(g,2);De(M,16,()=>Array.from({length:O()},(d,h)=>h),d=>d,(d,h)=>{var A=Ut(),k=u(A);T(k,{class:"size-4 shrink-0 rounded-sm"});var te=n(k,2);T(te,{class:"h-4 min-w-0 flex-1"});var q=n(te,2);{var de=o=>{T(o,{class:"size-3 shrink-0 rounded-full"})},re=o=>{T(o,{class:"size-5 shrink-0 rounded-full"})};X(q,o=>{s()==="workspace"?o(de):s()==="integration"&&o(re,1)})}var ce=n(q,2);{var t=o=>{{let w=$(()=>s()==="workspace"?"h-3 w-8 shrink-0":"h-3 w-6 shrink-0");T(o,{get class(){return e(w)}})}};X(ce,o=>{s()!=="compact"&&o(t)})}c(A),x(()=>Ue(A,1,Ye(s()==="compact"?"flex min-h-6 items-center gap-2 py-1":`flex h-12 items-center gap-3 border-b border-border ${s()==="integration"?"px-2":"px-3"}`))),r(d,A)}),r(i,D)};X(be,i=>{S()?i(le):Q()==="board"?i(Te,1):i(_e,-1)})}return c(ie),c(y),x(i=>{Ee(y,"aria-label",i),Ee(y,"data-reduced",Y.current),Ue(ie,1,Ye(S()?"space-y-6 py-3":s()==="compact"?"":"px-5 pb-4"))},[()=>L.home_integrations_loading()]),r(b,y),Ge(z)}function ct(b){return b.filter(Et)}function Zt(){let b=null;return(l,Y)=>{const S=b?l.find(Q=>Q.id===b):void 0;if(S)return S;const O=Ht(l);return b=Y&&O?String(O.id):null,O}}function er(b,l,Y){return l&&b.find(S=>S.id===l)||Y}var tr=m('<div class="p-4"><!></div>'),rr=m('<div class="flex h-full min-h-0 min-w-0 flex-col" data-home-workspace-chat=""><!></div>');function vt(b,l){if(new.target)return Oe({component:vt,...b});je(l,!0);const Y=()=>Ie(ie,"$agents$",O),S=()=>Ie(be,"$loaded$",O),[O,Q]=at();let Z=K(l,"workspace",7),s=K(l,"preview",7,!1),z=K(l,"agent",7);const y=Ce(()=>Z().id),ie=lt(y),be=It(y),le=$(()=>ct(Y())),Te=$(()=>s()?void 0:z()?.id);yt(()=>{const t=e(Te);if(!t)return;const o=Date.now();return()=>{Date.now()-o<Lt||setTimeout(()=>xe.dispatch(Rt(t)),0)}});let _e=Be(void 0),i=0;function D(t,o){s()||!e(le).some(w=>w.id===t)||(Pe(_e,{agentId:t,questionMessageId:o,requestId:++i},!0),xe.dispatch(nt(y,t)),xe.dispatch(it(y,t)))}let g=Be(!1),ee;function M(){s()||(Pe(g,!1),clearTimeout(ee),xe.dispatch(Dt(y)),ee=setTimeout(()=>{Pe(g,!0)},15e3))}st(()=>(s()||M(),()=>clearTimeout(ee)));var d={focusAttention:D,get workspace(){return Z()},set workspace(t){Z(t),U()},get preview(){return s()},set preview(t=!1){s(t),U()},get agent(){return z()},set agent(t){z(t),U()},$set:qe,$on:(t,o)=>Ne(l,t,o)},h=rr(),A=u(h);{var k=t=>{Ze(t,{density:"compact",title:w=>{$e();var N=ke();x(ae=>B(N,ae),[()=>L.agentOverview_hierarchyGraph_noAgents_title()]),r(w,N)},$$slots:{title:!0}})},te=t=>{var o=fe(),w=R(o);ot(w,()=>z().id,N=>{{let ae=$(()=>e(_e)?.agentId===z().id?e(_e):void 0);Tt(N,{get workspace(){return Z()},get agentId(){return z().id},get agentName(){return z().name},autoFocus:!1,isFallbackPromptTarget:!0,get attentionFocusRequest(){return e(ae)},isInitialWorkspaceAgent:!1})}}),r(t,o)},q=t=>{var o=tr(),w=u(o);dt(w,{detail:!0}),c(o),r(t,o)},de=t=>{{const o=N=>{$e();var ae=ke();x(ye=>B(ae,ye),[()=>L.home_detail_unavailable()]),r(N,ae)};let w=$(()=>L.home_retry());At(t,{density:"compact",get retryLabel(){return e(w)},onRetry:M,message:o,$$slots:{message:!0}})}},re=t=>{{const o=N=>{$e();var ae=ke();x(ye=>B(ae,ye),[()=>L.agentOverview_hierarchyGraph_noAgents_title()]),r(N,ae)};let w=$(()=>L.home_retry());Ze(t,{density:"compact",get actionLabel(){return e(w)},onAction:M,title:o,$$slots:{title:!0}})}};X(A,t=>{s()?t(k):z()?t(te,1):!S()&&!e(g)?t(q,2):S()?t(re,-1):t(de,3)})}c(h),x(()=>Ee(h,"data-workspace-link-target",Z().id)),r(b,h);var ce=Ge(d);return Q(),ce}var ar=m('<span class="min-w-0 line-clamp-2 [overflow-wrap:anywhere]"> </span> <!>',1),tt=m("<!> <!>",1),sr=m('<div class="shrink-0"><!></div>'),or=m('<div><!> <span class="home-detail-repository-name truncate"> </span></div>'),rt=m("<!><!>",1),nr=m("<p> </p>"),ir=m('<!> <span class="min-w-0 truncate text-left"> </span> <!>',1),lr=m('<span class="flex min-w-0 items-center gap-2"><!> <span class="truncate"> </span></span>'),dr=m('<div class="shrink-0 min-w-0 px-1 py-2" data-home-agent-switcher=""><!></div>'),cr=m('<div class="flex items-center gap-2 px-4 py-2 type-caption text-muted-foreground" role="status"><p> </p> <!></div>'),vr=m('<section class="flex h-full min-h-0 min-w-0 flex-col" data-home-detail=""><header class="shrink-0 border-b border-border px-4 py-2"><div class="flex min-w-0 items-center gap-3"><h2 class="-ml-2 min-w-0 flex-1"><!></h2> <!></div> <!> <!></header> <!> <!> <div class="min-h-0 min-w-0 flex-1"><!></div></section>');function ur(b,l){if(new.target)return Oe({component:ur,...b});je(l,!0);const Y=()=>Ie(_e,"$readRevision$",Q),S=()=>Ie(Te,"$agents$",Q),O=()=>Ie(D,"$pickedId$",Q),[Q,Z]=at();let s=K(l,"workspace",7),z=K(l,"onclose",7),y=K(l,"preview",7,!1),ie=K(l,"showBackToList",7,!0);const be=$(()=>s().title.trim()?s().title:L.workspace_links_untitled_label()),le=Ce(()=>s().id),Te=lt(le),_e=St(le),i=Ce(()=>Y()),D=Wt(le),g=$(()=>ct(S())),ee=Zt(),M=$(()=>ee(e(g),Y()>i)),d=$(()=>er(e(g),O(),e(M)));function h(a){xe.dispatch(nt(le,a)),xe.dispatch(it(le,a))}const A=$(()=>[s().repositoryOwner,s().repositoryName].filter(Boolean).join("/")||s().repositoryPath);let k=Be(!1);async function te(){Pe(k,!1);try{await Ft(s().id),Pe(k,!zt.select(xe.state,s().id))}catch{Pe(k,!0)}}st(()=>{y()||te()});function q(){Ct(s().id)}var de={get workspace(){return s()},set workspace(a){s(a),U()},get onclose(){return z()},set onclose(a){z(a),U()},get preview(){return y()},set preview(a=!1){y(a),U()},get showBackToList(){return ie()},set showBackToList(a=!0){ie(a),U()},$set:qe,$on:(a,f)=>Ne(l,a,f)},re=vr(),ce=u(re),t=u(ce),o=u(t),w=u(o);P(w,()=>He,(a,f)=>{f(a,{children:(j,oe)=>{var G=fe(),W=R(G);P(W,()=>Le,(ve,E)=>{E(ve,{children:(J,ge)=>{var me=tt(),ne=R(me);{const F=(H,C)=>{let I=()=>(C?.()).props;{let v=$(()=>L.home_open_workspace());Fe(H,xt(I,{variant:"ghost",class:"type-title h-auto min-w-0 max-w-full shrink gap-2 justify-start whitespace-normal px-2 py-1 text-left font-medium leading-snug",wrapContent:!1,get"aria-label"(){return e(v)},onclick:q,children:(p,V)=>{var _=ar(),se=R(_),ue=Ae(se,!0),we=n(se,2);ze(we,{get icon(){return Bt},class:"shrink-0 text-muted-foreground",size:"sm"}),x(()=>B(ue,e(be))),r(p,_)},$$slots:{default:!0}}))}};P(ne,()=>Me,(H,C)=>{C(H,{child:F,$$slots:{child:!0}})})}var he=n(ne,2);P(he,()=>We,(F,H)=>{H(F,{children:(C,I)=>{$e();var v=ke();x(()=>B(v,e(be))),r(C,v)},$$slots:{default:!0}})}),r(J,me)},$$slots:{default:!0}})}),r(j,G)},$$slots:{default:!0}})}),c(o);var N=n(o,2);{var ae=a=>{var f=sr(),j=u(f);{let oe=$(()=>L.home_close_preview()),G=$(()=>L.home_close_preview());Fe(j,{variant:"ghost",size:"icon-sm",get"aria-label"(){return e(oe)},get tooltip(){return e(G)},get onclick(){return z()},children:(W,ve)=>{ze(W,{get icon(){return Ot}})},$$slots:{default:!0}})}c(f),r(a,f)};X(N,a=>{ie()&&a(ae)})}c(t);var ye=n(t,2);{var ut=a=>{var f=fe(),j=R(f);P(j,()=>He,(oe,G)=>{G(oe,{children:(W,ve)=>{var E=fe(),J=R(E);P(J,()=>Le,(ge,me)=>{me(ge,{children:(ne,he)=>{var F=rt(),H=R(F);{const I=(v,p)=>{let V=()=>(p?.()).props;var _=or();Qe(_,()=>({...V(),class:"mb-1 flex min-w-0 max-w-[min(100%,16rem)] items-center gap-1.5 type-caption text-muted-foreground","data-home-detail-repository":!0,"aria-label":e(A)}));var se=u(_);{var ue=pe=>{Mt(pe,{get identity(){return s().repositoryOwner},size:16,class:"shrink-0 rounded-sm"})},we=pe=>{ze(pe,{get icon(){return Nt}})};X(se,pe=>{s().repositoryOwner?pe(ue):pe(we,-1)})}var Ke=n(se,2),Re=Ae(Ke,!0);c(_),x(()=>B(Re,e(A))),r(v,_)};P(H,()=>Me,(v,p)=>{p(v,{child:I,$$slots:{child:!0}})})}var C=n(H);P(C,()=>We,(I,v)=>{v(I,{children:(p,V)=>{$e();var _=ke();x(()=>B(_,e(A))),r(p,_)},$$slots:{default:!0}})}),r(ne,F)},$$slots:{default:!0}})}),r(W,E)},$$slots:{default:!0}})}),r(a,f)};X(ye,a=>{e(A)&&a(ut)})}var pt=n(ye,2);{var mt=a=>{var f=fe(),j=R(f);P(j,()=>He,(oe,G)=>{G(oe,{children:(W,ve)=>{var E=fe(),J=R(E);P(J,()=>Le,(ge,me)=>{me(ge,{children:(ne,he)=>{var F=rt(),H=R(F);{const I=(v,p)=>{let V=()=>(p?.()).props;var _=nr();Qe(_,()=>({...V(),class:"type-caption line-clamp-2 break-words leading-snug text-muted-foreground"}));var se=Ae(_,!0);x(()=>B(se,s().statusMessage)),r(v,_)};P(H,()=>Me,(v,p)=>{p(v,{child:I,$$slots:{child:!0}})})}var C=n(H);P(C,()=>We,(I,v)=>{v(I,{children:(p,V)=>{$e();var _=ke();x(()=>B(_,s().statusMessage)),r(p,_)},$$slots:{default:!0}})}),r(ne,F)},$$slots:{default:!0}})}),r(W,E)},$$slots:{default:!0}})}),r(a,f)};X(pt,a=>{s().statusMessage&&a(mt)})}c(ce);var Je=n(ce,2);{var ft=a=>{var f=dr(),j=u(f);{let oe=$(()=>e(d)?.id??"");P(j,()=>Se.Root,(G,W)=>{W(G,{get value(){return e(oe)},onchange:ve=>{const E=e(g).find(J=>J.id===ve);E&&h(E.id)},children:(ve,E)=>{var J=tt(),ge=R(J);{let ne=$(()=>L.home_agents());P(ge,()=>Se.Trigger,(he,F)=>{F(he,{variant:"ghost",class:"h-8 w-fit max-w-full justify-start",get"aria-label"(){return e(ne)},children:(H,C)=>{var I=ir(),v=R(I);{var p=ue=>{{let we=$(()=>e(d).metadata?.specialist??e(d).agentMetadata?.specialist);et(ue,{get agentId(){return e(d).id},get specialist(){return e(we)},variant:"emphasized"})}};X(v,ue=>{e(d)&&ue(p)})}var V=n(v,2),_=Ae(V,!0),se=n(V,2);ze(se,{get icon(){return qt},class:"shrink-0 text-muted-foreground"}),x(()=>B(_,e(d)?.name)),r(H,I)},$$slots:{default:!0}})})}var me=n(ge,2);P(me,()=>Se.Content,(ne,he)=>{he(ne,{portal:!0,children:(F,H)=>{var C=fe(),I=R(C);De(I,17,()=>e(g),v=>v.id,(v,p)=>{var V=fe(),_=R(V);P(_,()=>Se.Item,(se,ue)=>{ue(se,{get value(){return e(p).id},get label(){return e(p).name},children:(we,Ke)=>{var Re=lr(),pe=u(Re);{let kt=$(()=>e(p).metadata?.specialist??e(p).agentMetadata?.specialist);et(pe,{get agentId(){return e(p).id},get specialist(){return e(kt)},variant:"emphasized"})}var wt=n(pe,2),$t=Ae(wt,!0);c(Re),x(()=>B($t,e(p).name)),r(we,Re)},$$slots:{default:!0}})}),r(v,V)}),r(F,C)},$$slots:{default:!0}})}),r(ve,J)},$$slots:{default:!0}})})}c(f),r(a,f)};X(Je,a=>{e(g).length&&a(ft)})}var Ve=n(Je,2);{var _t=a=>{var f=cr(),j=u(f),oe=Ae(j,!0),G=n(j,2);Fe(G,{variant:"outline",size:"sm",onclick:te,children:(W,ve)=>{$e();var E=ke();x(J=>B(E,J),[()=>L.home_retry()]),r(W,E)},$$slots:{default:!0}}),c(f),x(W=>B(oe,W),[()=>L.home_detail_unavailable()]),r(a,f)};X(Ve,a=>{e(k)&&a(_t)})}var Xe=n(Ve,2),gt=u(Xe);ot(gt,()=>s().id,a=>{vt(a,{get workspace(){return s()},get preview(){return y()},get agent(){return e(d)}})}),c(Xe),c(re),x(a=>Ee(re,"aria-label",a),[()=>L.home_workspace_details()]),r(b,re);var ht=Ge(de);return Z(),ht}export{dt as H,ur as a};
@@ -1,4 +1,4 @@
1
- import{g as Ni}from"./DGdXhwsJ.js";import{s as Ci}from"./CfOfDsl2.js";import{U as Zs,aZ as jt,V as Qs,a_ as Gt,Y as bi,b0 as vi,b as h,aU as je,ay as _i,X as en,a1 as xi,aP as Mi,bh as wi,aV as Ui,r as Pi,O as Di,am as Fi,W as Bi,ab as $i,aG as ji,aA as Gi,aW as Wi}from"./CjJvlfCr.js";function Wt(s){console&&console.error&&console.error(`Error: ${s}`)}function tn(s){console&&console.warn&&console.warn(`Warning: ${s}`)}function sn(s){const e=new Date().getTime(),t=s();return{time:new Date().getTime()-e,value:t}}function nn(s){function e(){}e.prototype=s;const t=new e;function n(){return typeof t.bar}return n(),n(),s}function Ki(s){return Vi(s)?s.LABEL:s.name}function Vi(s){return typeof s.LABEL=="string"&&s.LABEL!==""}class te{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(t=>{t.accept(e)})}}class K extends te{constructor(e){super([]),this.idx=1,Object.assign(this,ie(e))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class _e extends te{constructor(e){super(e.definition),this.orgText="",Object.assign(this,ie(e))}}class W extends te{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,ie(e))}}class G extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class se extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class ne extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class M extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class q extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class Z extends te{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,ie(e))}}class k{constructor(e){this.idx=1,Object.assign(this,ie(e))}accept(e){e.visit(this)}}function zi(s){return s.map(at)}function at(s){function e(t){return t.map(at)}if(s instanceof K){const t={type:"NonTerminal",name:s.nonTerminalName,idx:s.idx};return typeof s.label=="string"&&(t.label=s.label),t}else{if(s instanceof W)return{type:"Alternative",definition:e(s.definition)};if(s instanceof G)return{type:"Option",idx:s.idx,definition:e(s.definition)};if(s instanceof se)return{type:"RepetitionMandatory",idx:s.idx,definition:e(s.definition)};if(s instanceof ne)return{type:"RepetitionMandatoryWithSeparator",idx:s.idx,separator:at(new k({terminalType:s.separator})),definition:e(s.definition)};if(s instanceof q)return{type:"RepetitionWithSeparator",idx:s.idx,separator:at(new k({terminalType:s.separator})),definition:e(s.definition)};if(s instanceof M)return{type:"Repetition",idx:s.idx,definition:e(s.definition)};if(s instanceof Z)return{type:"Alternation",idx:s.idx,definition:e(s.definition)};if(s instanceof k){const t={type:"Terminal",name:s.terminalType.name,label:Ki(s.terminalType),idx:s.idx};typeof s.label=="string"&&(t.terminalLabel=s.label);const n=s.terminalType.PATTERN;return s.terminalType.PATTERN&&(t.pattern=n instanceof RegExp?n.source:n),t}else{if(s instanceof _e)return{type:"Rule",name:s.name,orgText:s.orgText,definition:e(s.definition)};throw Error("non exhaustive match")}}}function ie(s){return Object.fromEntries(Object.entries(s).filter(([,e])=>e!==void 0))}class xe{visit(e){const t=e;switch(t.constructor){case K:return this.visitNonTerminal(t);case W:return this.visitAlternative(t);case G:return this.visitOption(t);case se:return this.visitRepetitionMandatory(t);case ne:return this.visitRepetitionMandatoryWithSeparator(t);case q:return this.visitRepetitionWithSeparator(t);case M:return this.visitRepetition(t);case Z:return this.visitAlternation(t);case k:return this.visitTerminal(t);case _e:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Hi(s){return s instanceof W||s instanceof G||s instanceof M||s instanceof se||s instanceof ne||s instanceof q||s instanceof k||s instanceof _e}function Tt(s,e=[]){return s instanceof G||s instanceof M||s instanceof q?!0:s instanceof Z?s.definition.some(n=>Tt(n,e)):s instanceof K&&e.includes(s)?!1:s instanceof te?(s instanceof K&&e.push(s),s.definition.every(n=>Tt(n,e))):!1}function Xi(s){return s instanceof Z}function ee(s){if(s instanceof K)return"SUBRULE";if(s instanceof G)return"OPTION";if(s instanceof Z)return"OR";if(s instanceof se)return"AT_LEAST_ONE";if(s instanceof ne)return"AT_LEAST_ONE_SEP";if(s instanceof q)return"MANY_SEP";if(s instanceof M)return"MANY";if(s instanceof k)return"CONSUME";throw Error("non exhaustive match")}class kt{walk(e,t=[]){e.definition.forEach((n,i)=>{const a=e.definition.slice(i+1);if(n instanceof K)this.walkProdRef(n,a,t);else if(n instanceof k)this.walkTerminal(n,a,t);else if(n instanceof W)this.walkFlat(n,a,t);else if(n instanceof G)this.walkOption(n,a,t);else if(n instanceof se)this.walkAtLeastOne(n,a,t);else if(n instanceof ne)this.walkAtLeastOneSep(n,a,t);else if(n instanceof q)this.walkManySep(n,a,t);else if(n instanceof M)this.walkMany(n,a,t);else if(n instanceof Z)this.walkOr(n,a,t);else throw Error("non exhaustive match")})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const i=t.concat(n);this.walk(e,i)}walkOption(e,t,n){const i=t.concat(n);this.walk(e,i)}walkAtLeastOne(e,t,n){const i=[new G({definition:e.definition})].concat(t,n);this.walk(e,i)}walkAtLeastOneSep(e,t,n){const i=ys(e,t,n);this.walk(e,i)}walkMany(e,t,n){const i=[new G({definition:e.definition})].concat(t,n);this.walk(e,i)}walkManySep(e,t,n){const i=ys(e,t,n);this.walk(e,i)}walkOr(e,t,n){const i=t.concat(n);e.definition.forEach(a=>{const r=new W({definition:[a]});this.walk(r,i)})}}function ys(s,e,t){return[new G({definition:[new k({terminalType:s.separator})].concat(s.definition)})].concat(e,t)}function Je(s){if(s instanceof K)return Je(s.referencedRule);if(s instanceof k)return qi(s);if(Hi(s))return Yi(s);if(Xi(s))return Ji(s);throw Error("non exhaustive match")}function Yi(s){let e=[];const t=s.definition;let n=0,i=t.length>n,a,r=!0;for(;i&&r;)a=t[n],r=Tt(a),e=e.concat(Je(a)),n=n+1,i=t.length>n;return[...new Set(e)]}function Ji(s){const e=s.definition.map(t=>Je(t));return[...new Set(e.flat())]}function qi(s){return[s.terminalType]}const an="_~IN~_";class Zi extends kt{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const i=ea(e.referencedRule,e.idx)+this.topProd.name,a=t.concat(n),r=new W({definition:a}),l=Je(r);this.follows[i]=l}}function Qi(s){const e={};return s.forEach(t=>{const n=new Zi(t).startWalking();Object.assign(e,n)}),e}function ea(s,e){return s.name+e+an}function S(s){return s.charCodeAt(0)}function Pt(s,e){Array.isArray(s)?s.forEach(function(t){e.push(t)}):e.push(s)}function Fe(s,e){if(s[e]===!0)throw"duplicate flag "+e;s[e],s[e]=!0}function Se(s){if(s===void 0)throw Error("Internal Error - Should never get here!");return!0}function ta(){throw Error("Internal Error - Should never get here!")}function Rs(s){return s.type==="Character"}const gt=[];for(let s=S("0");s<=S("9");s++)gt.push(s);const At=[S("_")].concat(gt);for(let s=S("a");s<=S("z");s++)At.push(s);for(let s=S("A");s<=S("Z");s++)At.push(s);const Os=[S(" "),S("\f"),S(`
1
+ import{g as Ni}from"./m6pGB8MK.js";import{s as Ci}from"./D2EoEx7R.js";import{U as Zs,aZ as jt,V as Qs,a_ as Gt,Y as bi,b0 as vi,b as h,aU as je,ay as _i,X as en,a1 as xi,aP as Mi,bh as wi,aV as Ui,r as Pi,O as Di,am as Fi,W as Bi,ab as $i,aG as ji,aA as Gi,aW as Wi}from"./C89-HR3N.js";function Wt(s){console&&console.error&&console.error(`Error: ${s}`)}function tn(s){console&&console.warn&&console.warn(`Warning: ${s}`)}function sn(s){const e=new Date().getTime(),t=s();return{time:new Date().getTime()-e,value:t}}function nn(s){function e(){}e.prototype=s;const t=new e;function n(){return typeof t.bar}return n(),n(),s}function Ki(s){return Vi(s)?s.LABEL:s.name}function Vi(s){return typeof s.LABEL=="string"&&s.LABEL!==""}class te{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(t=>{t.accept(e)})}}class K extends te{constructor(e){super([]),this.idx=1,Object.assign(this,ie(e))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class _e extends te{constructor(e){super(e.definition),this.orgText="",Object.assign(this,ie(e))}}class W extends te{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,ie(e))}}class G extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class se extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class ne extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class M extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class q extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class Z extends te{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,ie(e))}}class k{constructor(e){this.idx=1,Object.assign(this,ie(e))}accept(e){e.visit(this)}}function zi(s){return s.map(at)}function at(s){function e(t){return t.map(at)}if(s instanceof K){const t={type:"NonTerminal",name:s.nonTerminalName,idx:s.idx};return typeof s.label=="string"&&(t.label=s.label),t}else{if(s instanceof W)return{type:"Alternative",definition:e(s.definition)};if(s instanceof G)return{type:"Option",idx:s.idx,definition:e(s.definition)};if(s instanceof se)return{type:"RepetitionMandatory",idx:s.idx,definition:e(s.definition)};if(s instanceof ne)return{type:"RepetitionMandatoryWithSeparator",idx:s.idx,separator:at(new k({terminalType:s.separator})),definition:e(s.definition)};if(s instanceof q)return{type:"RepetitionWithSeparator",idx:s.idx,separator:at(new k({terminalType:s.separator})),definition:e(s.definition)};if(s instanceof M)return{type:"Repetition",idx:s.idx,definition:e(s.definition)};if(s instanceof Z)return{type:"Alternation",idx:s.idx,definition:e(s.definition)};if(s instanceof k){const t={type:"Terminal",name:s.terminalType.name,label:Ki(s.terminalType),idx:s.idx};typeof s.label=="string"&&(t.terminalLabel=s.label);const n=s.terminalType.PATTERN;return s.terminalType.PATTERN&&(t.pattern=n instanceof RegExp?n.source:n),t}else{if(s instanceof _e)return{type:"Rule",name:s.name,orgText:s.orgText,definition:e(s.definition)};throw Error("non exhaustive match")}}}function ie(s){return Object.fromEntries(Object.entries(s).filter(([,e])=>e!==void 0))}class xe{visit(e){const t=e;switch(t.constructor){case K:return this.visitNonTerminal(t);case W:return this.visitAlternative(t);case G:return this.visitOption(t);case se:return this.visitRepetitionMandatory(t);case ne:return this.visitRepetitionMandatoryWithSeparator(t);case q:return this.visitRepetitionWithSeparator(t);case M:return this.visitRepetition(t);case Z:return this.visitAlternation(t);case k:return this.visitTerminal(t);case _e:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Hi(s){return s instanceof W||s instanceof G||s instanceof M||s instanceof se||s instanceof ne||s instanceof q||s instanceof k||s instanceof _e}function Tt(s,e=[]){return s instanceof G||s instanceof M||s instanceof q?!0:s instanceof Z?s.definition.some(n=>Tt(n,e)):s instanceof K&&e.includes(s)?!1:s instanceof te?(s instanceof K&&e.push(s),s.definition.every(n=>Tt(n,e))):!1}function Xi(s){return s instanceof Z}function ee(s){if(s instanceof K)return"SUBRULE";if(s instanceof G)return"OPTION";if(s instanceof Z)return"OR";if(s instanceof se)return"AT_LEAST_ONE";if(s instanceof ne)return"AT_LEAST_ONE_SEP";if(s instanceof q)return"MANY_SEP";if(s instanceof M)return"MANY";if(s instanceof k)return"CONSUME";throw Error("non exhaustive match")}class kt{walk(e,t=[]){e.definition.forEach((n,i)=>{const a=e.definition.slice(i+1);if(n instanceof K)this.walkProdRef(n,a,t);else if(n instanceof k)this.walkTerminal(n,a,t);else if(n instanceof W)this.walkFlat(n,a,t);else if(n instanceof G)this.walkOption(n,a,t);else if(n instanceof se)this.walkAtLeastOne(n,a,t);else if(n instanceof ne)this.walkAtLeastOneSep(n,a,t);else if(n instanceof q)this.walkManySep(n,a,t);else if(n instanceof M)this.walkMany(n,a,t);else if(n instanceof Z)this.walkOr(n,a,t);else throw Error("non exhaustive match")})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const i=t.concat(n);this.walk(e,i)}walkOption(e,t,n){const i=t.concat(n);this.walk(e,i)}walkAtLeastOne(e,t,n){const i=[new G({definition:e.definition})].concat(t,n);this.walk(e,i)}walkAtLeastOneSep(e,t,n){const i=ys(e,t,n);this.walk(e,i)}walkMany(e,t,n){const i=[new G({definition:e.definition})].concat(t,n);this.walk(e,i)}walkManySep(e,t,n){const i=ys(e,t,n);this.walk(e,i)}walkOr(e,t,n){const i=t.concat(n);e.definition.forEach(a=>{const r=new W({definition:[a]});this.walk(r,i)})}}function ys(s,e,t){return[new G({definition:[new k({terminalType:s.separator})].concat(s.definition)})].concat(e,t)}function Je(s){if(s instanceof K)return Je(s.referencedRule);if(s instanceof k)return qi(s);if(Hi(s))return Yi(s);if(Xi(s))return Ji(s);throw Error("non exhaustive match")}function Yi(s){let e=[];const t=s.definition;let n=0,i=t.length>n,a,r=!0;for(;i&&r;)a=t[n],r=Tt(a),e=e.concat(Je(a)),n=n+1,i=t.length>n;return[...new Set(e)]}function Ji(s){const e=s.definition.map(t=>Je(t));return[...new Set(e.flat())]}function qi(s){return[s.terminalType]}const an="_~IN~_";class Zi extends kt{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const i=ea(e.referencedRule,e.idx)+this.topProd.name,a=t.concat(n),r=new W({definition:a}),l=Je(r);this.follows[i]=l}}function Qi(s){const e={};return s.forEach(t=>{const n=new Zi(t).startWalking();Object.assign(e,n)}),e}function ea(s,e){return s.name+e+an}function S(s){return s.charCodeAt(0)}function Pt(s,e){Array.isArray(s)?s.forEach(function(t){e.push(t)}):e.push(s)}function Fe(s,e){if(s[e]===!0)throw"duplicate flag "+e;s[e],s[e]=!0}function Se(s){if(s===void 0)throw Error("Internal Error - Should never get here!");return!0}function ta(){throw Error("Internal Error - Should never get here!")}function Rs(s){return s.type==="Character"}const gt=[];for(let s=S("0");s<=S("9");s++)gt.push(s);const At=[S("_")].concat(gt);for(let s=S("a");s<=S("z");s++)At.push(s);for(let s=S("A");s<=S("Z");s++)At.push(s);const Os=[S(" "),S("\f"),S(`
2
2
  `),S("\r"),S(" "),S("\v"),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S("\u2028"),S("\u2029"),S(" "),S(" "),S(" "),S("\uFEFF")],sa=/[0-9a-fA-F]/,tt=/[0-9]/,na=/[1-9]/;class ia{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Fe(n,"global");break;case"i":Fe(n,"ignoreCase");break;case"m":Fe(n,"multiLine");break;case"u":Fe(n,"unicode");break;case"y":Fe(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let t;switch(this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}break}}Se(t);const n=this.disjunction();return this.consumeChar(")"),{type:t,value:n,loc:this.loc(e)}}return ta()}quantifier(e=!1){let t;const n=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:i,atMost:i};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),t={atLeast:i,atMost:a}):t={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&t===void 0)return;Se(t);break}if(!(e===!0&&t===void 0)&&Se(t))return this.peekChar(0)==="?"?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(n),t}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Se(e))return e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[S(`
3
3
  `),S("\r"),S("\u2028"),S("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=gt;break;case"D":e=gt,t=!0;break;case"s":e=Os;break;case"S":e=Os,t=!0;break;case"w":e=At;break;case"W":e=At,t=!0;break}if(Se(e))return{type:"Set",value:e,complement:t}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=S("\f");break;case"n":e=S(`
4
4
  `);break;case"r":e=S("\r");break;case"t":e=S(" ");break;case"v":e=S("\v");break}if(Se(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:S("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:S(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
@@ -1 +1 @@
1
- import{Jv as s,ii as a,ml as S,nX as f,my as m}from"./_LtUY0jS.js";import{v as O}from"./Cb0qNR4H.js";import{dO as d,b5 as v,dW as b}from"./Cppy6ZYG.js";const k=s.createSelector((t,e)=>{if(v.select(t,e)&&b.select(t,e))return!1;const r=t.principal?.snapshot;return r?.capabilities.workspaceGuestRoles===!0&&(r.capabilities.hostMembership?r.principal.hostRole==="guest":!r.principal.isAdministrator)}),h=s.createSelector(t=>t.principal?.snapshot?.capabilities.remoteScripts===1),l=s.createSelector((t,e,r)=>!k.select(t,e)||!!d.select(t,e)&&r?.purpose==="saved");function o(t,e,r){return!!e&&!!r&&l.select(t,e,r)}function i(t,e){return e?t.scripts.byWorkspaceId[e]??m:m}const j=s.createSelector((t,e)=>i(t,e).initialized),W=s.createSelector((t,e)=>{const r=i(t,e);return r.activeScriptIds?r.activeScriptIds.flatMap(c=>o(t,e,r.scripts[c])?[r.scripts[c]]:[]):Object.values(r.scripts).filter(c=>!c.archivedAt&&o(t,e,c))}),C=s.createSelector((t,e)=>W.select(t,e).filter(r=>O((r.runtime??a()).status))),u=s.createSelector((t,e,r)=>{const c=i(t,e);return o(t,e,c.scripts[r])?c.scripts[r]:null}),x=s.createSelector((t,e,r)=>u.select(t,e,r)?.runtime??a()),E=s.createSelector((t,e,r)=>{const c=i(t,e);return l.select(t,e??"",c.scripts[r])?c.outputBuffers[r]??S:S}),M=s.createSelector((t,e,r,c)=>{const n=i(t,e).retainedOutputs?.[c];return n?.scriptId===r&&l.select(t,e,i(t,e).scripts[r])?n:void 0}),z=s.createSelector(t=>Object.entries(t.scripts?.byWorkspaceId??{}).filter(([,e])=>Object.keys(e.retainedOutputs??{}).length>0).map(([e])=>e).sort()),A=s.createSelector((t,e)=>!!t.scripts?.byWorkspaceId[e]?.outputStreamReady),D=s.createSelector((t,e)=>i(t,e).initialized),B=s.createSelector((t,e)=>{const r=i(t,e);return r.activeScriptIds?r.activeScriptIds.flatMap(c=>o(t,e,r.scripts[c])?[r.scripts[c]]:[]):Object.values(r.scripts).filter(c=>!c.archivedAt&&o(t,e,c))}),G=s.createSelector((t,e)=>{const r=i(t,e);return r.detectionOperation?.pending?{...r.operations,...Object.fromEntries(Object.keys(r.scripts).map(c=>[c,r.detectionOperation]))}:r.operations}),J=s.createSelector((t,e)=>i(t,e).detectionOperation),L=s.createSelector((t,e,r,c)=>{const n=i(t,r).workflowOutcomes,p=n?f(n,e):void 0;return p?.workspaceId===r&&p.resourceId===c?p:void 0}),P=s.createSelector((t,e,r)=>u.select(t,e,r)?.runtime??a()),U=s.createSelector((t,e)=>Object.values(i(t,e).scripts).filter(r=>o(t,e,r))),V=s.createSelector((t,e,r)=>i(t,e).pendingReads?.[r]),X=s.createSelector((t,e,r)=>!!u.select(t,e,r)&&!i(t,e).detectionOperation?.pending&&!i(t,e).operations[r]?.pending),q=s.createSelector((t,e)=>({nextCursor:i(t,e).nextCursor,loading:i(t,e).loading,error:i(t,e).loadError}));export{U as selectAllWorkspaceScriptEntries,X as selectCanDeleteScript,l as selectCanReadScriptDefinition,h as selectRemoteScriptsSupported,C as selectRunningScripts,u as selectScriptById,J as selectScriptDetectionOperation,W as selectScriptEntries,q as selectScriptListPageState,E as selectScriptOutput,A as selectScriptOutputStreamReady,z as selectScriptOutputViewerWorkspaceIds,V as selectScriptReadJournal,M as selectScriptRetainedOutput,x as selectScriptRuntime,L as selectScriptWorkflowOutcome,j as selectScriptsInitialized,k as selectUsesGuestScriptScope,B as selectWorkspaceScriptEntries,G as selectWorkspaceScriptOperations,P as selectWorkspaceScriptRuntime,D as selectWorkspaceScriptsInitialized};
1
+ import{Jv as s,ii as a,ml as S,nX as f,my as m}from"./_LtUY0jS.js";import{v as O}from"./BpfNraM2.js";import{dO as d,b5 as v,dW as b}from"./Cppy6ZYG.js";const k=s.createSelector((t,e)=>{if(v.select(t,e)&&b.select(t,e))return!1;const r=t.principal?.snapshot;return r?.capabilities.workspaceGuestRoles===!0&&(r.capabilities.hostMembership?r.principal.hostRole==="guest":!r.principal.isAdministrator)}),h=s.createSelector(t=>t.principal?.snapshot?.capabilities.remoteScripts===1),l=s.createSelector((t,e,r)=>!k.select(t,e)||!!d.select(t,e)&&r?.purpose==="saved");function o(t,e,r){return!!e&&!!r&&l.select(t,e,r)}function i(t,e){return e?t.scripts.byWorkspaceId[e]??m:m}const j=s.createSelector((t,e)=>i(t,e).initialized),W=s.createSelector((t,e)=>{const r=i(t,e);return r.activeScriptIds?r.activeScriptIds.flatMap(c=>o(t,e,r.scripts[c])?[r.scripts[c]]:[]):Object.values(r.scripts).filter(c=>!c.archivedAt&&o(t,e,c))}),C=s.createSelector((t,e)=>W.select(t,e).filter(r=>O((r.runtime??a()).status))),u=s.createSelector((t,e,r)=>{const c=i(t,e);return o(t,e,c.scripts[r])?c.scripts[r]:null}),x=s.createSelector((t,e,r)=>u.select(t,e,r)?.runtime??a()),E=s.createSelector((t,e,r)=>{const c=i(t,e);return l.select(t,e??"",c.scripts[r])?c.outputBuffers[r]??S:S}),M=s.createSelector((t,e,r,c)=>{const n=i(t,e).retainedOutputs?.[c];return n?.scriptId===r&&l.select(t,e,i(t,e).scripts[r])?n:void 0}),z=s.createSelector(t=>Object.entries(t.scripts?.byWorkspaceId??{}).filter(([,e])=>Object.keys(e.retainedOutputs??{}).length>0).map(([e])=>e).sort()),A=s.createSelector((t,e)=>!!t.scripts?.byWorkspaceId[e]?.outputStreamReady),D=s.createSelector((t,e)=>i(t,e).initialized),B=s.createSelector((t,e)=>{const r=i(t,e);return r.activeScriptIds?r.activeScriptIds.flatMap(c=>o(t,e,r.scripts[c])?[r.scripts[c]]:[]):Object.values(r.scripts).filter(c=>!c.archivedAt&&o(t,e,c))}),G=s.createSelector((t,e)=>{const r=i(t,e);return r.detectionOperation?.pending?{...r.operations,...Object.fromEntries(Object.keys(r.scripts).map(c=>[c,r.detectionOperation]))}:r.operations}),J=s.createSelector((t,e)=>i(t,e).detectionOperation),L=s.createSelector((t,e,r,c)=>{const n=i(t,r).workflowOutcomes,p=n?f(n,e):void 0;return p?.workspaceId===r&&p.resourceId===c?p:void 0}),P=s.createSelector((t,e,r)=>u.select(t,e,r)?.runtime??a()),U=s.createSelector((t,e)=>Object.values(i(t,e).scripts).filter(r=>o(t,e,r))),V=s.createSelector((t,e,r)=>i(t,e).pendingReads?.[r]),X=s.createSelector((t,e,r)=>!!u.select(t,e,r)&&!i(t,e).detectionOperation?.pending&&!i(t,e).operations[r]?.pending),q=s.createSelector((t,e)=>({nextCursor:i(t,e).nextCursor,loading:i(t,e).loading,error:i(t,e).loadError}));export{U as selectAllWorkspaceScriptEntries,X as selectCanDeleteScript,l as selectCanReadScriptDefinition,h as selectRemoteScriptsSupported,C as selectRunningScripts,u as selectScriptById,J as selectScriptDetectionOperation,W as selectScriptEntries,q as selectScriptListPageState,E as selectScriptOutput,A as selectScriptOutputStreamReady,z as selectScriptOutputViewerWorkspaceIds,V as selectScriptReadJournal,M as selectScriptRetainedOutput,x as selectScriptRuntime,L as selectScriptWorkflowOutcome,j as selectScriptsInitialized,k as selectUsesGuestScriptScope,B as selectWorkspaceScriptEntries,G as selectWorkspaceScriptOperations,P as selectWorkspaceScriptRuntime,D as selectWorkspaceScriptsInitialized};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/DYVqPPax.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/B50rrLDJ.js","/app/immutable/chunks/C0QTy0Sy.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/_LtUY0jS.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/DX-Wrapd.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/CrD0jtXE.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/C2jYl_tm.js","/app/immutable/chunks/C7LIHk5_.js","/app/immutable/chunks/7UPrdiE9.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/_WGu_9si.js","/app/immutable/chunks/Cppy6ZYG.js","/app/immutable/chunks/U9jJmfYa.js","/app/immutable/chunks/CUkDMZwP.js","/app/immutable/chunks/bhKPSdq4.js","/app/immutable/chunks/B6S6VNu7.js","/app/immutable/chunks/B9ZFoPLo.js","/app/immutable/chunks/CE7dsja4.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/CeGEVvKd.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/RnZ98Lx7.js"])))=>i.map(i=>d[i]);
2
- import{bm as c,_ as p}from"./C0QTy0Sy.js";import{m as k}from"./DlUZpQ7U.js";import"./3SdAC2_C.js";import"./7UPrdiE9.js";import"./CrD0jtXE.js";import{Q as A}from"./C2jYl_tm.js";import"./ChTqQfQN.js";import"./DI_O2uCQ.js";import{m as L,Jv as d,vI as g,vK as v}from"./_LtUY0jS.js";import{a9 as R}from"./Cppy6ZYG.js";import{selectCurrentWorkspaceTabId as P}from"./VxaCN40t.js";const F="intent://local/note/{note-id}",S="intent://local/{workspace-id}/note/{note-id}";function f(){return c.ui_linkHandler_invalidFormat_error({shortFormat:F,longFormat:S})}class u extends Error{constructor(r){super(r),this.name="NotFoundError"}}function W(e){try{const r=new URL(e.replace("intent://","http://")),t=r.hostname,n=r.pathname.replace(/^\/+/,"").split("/").filter(l=>l.length>0),a=e.replace("intent://","").split(/[?#]/)[0].split("/").slice(1);if(!t||n.length<2)return{type:"unknown",orgId:t||"",resourceId:"",valid:!1,error:f()};let o,s,i,_,w;if(a[0]==="workspace"&&(a.length===2||a.length===3&&a[2]==="")){const l=O(a[1]);if(!l)return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:f()};o=l,s="workspace",i=l}else if(a[0]==="file")s="file",i=m(a.slice(1));else if(a.length>=3&&I(a[0])&&a[1]==="file")o=a[0],s="file",i=m(a.slice(2));else if(a.length===5&&a[1]==="agent"&&a[3]==="message"&&I(a[0])&&I(a[2])&&I(a[4])&&n.length===5&&n[1]==="agent"&&n[3]==="message")o=n[0],s="message",_=n[2],i=n[4];else if(n[0]==="note"||n[0]==="task")s=n[0],i=n[1];else if(n.length>=3&&(n[1]==="note"||n[1]==="task"))o=n[0],s=n[1],i=n[2];else return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:f()};if(!i||i.trim().length===0)return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:c.ui_linkHandler_emptyResourceId_error()};if(s==="note"||s==="task")return{type:s,orgId:t,workspaceId:o,resourceId:i,valid:!0};if(s==="file"){const l=/^#L\d+(?:-\d+|C\d+)?$/.test(r.hash)?r.hash:"",E=a.slice(o?2:1).join("/"),h=A(E+l);return i=m(h.path.split("/")),w=h.line,H(i)?{type:"file",orgId:t,workspaceId:o,resourceId:i,...w!==void 0?{line:w}:{},valid:!0}:{type:"unknown",orgId:t,workspaceId:o,resourceId:"",valid:!1,error:c.ui_linkHandler_invalidFilePath_error()}}return s==="workspace"&&o?{type:"workspace",orgId:t,workspaceId:o,resourceId:i,valid:!0}:s==="message"&&o&&_?{type:"message",orgId:t,workspaceId:o,resourceId:i,agentId:_,valid:!0}:{type:"unknown",orgId:t,workspaceId:o,resourceId:i,valid:!1,error:c.ui_linkHandler_unknownResourceType_error({type:s})}}catch(r){return{type:"unknown",orgId:"",resourceId:"",valid:!1,error:r instanceof Error?r.message:c.ui_linkHandler_parseFailed_error()}}}function m(e){return e.map(r=>decodeURIComponent(r)).join("/")}function H(e){return/^[A-Za-z]:/.test(e)?!1:e.split(/[\\/]/).every(t=>t.length>0&&t!=="."&&t!=="..")}const j=new Set([L,"new"]);function O(e){if(e===void 0||!I(e))return null;const r=decodeURIComponent(e);return j.has(r)?null:r}function I(e){let r;try{r=decodeURIComponent(e)}catch{return!1}return r.length>0&&r!=="."&&r!==".."&&!/[\\/]/.test(r)}async function T(e,r={}){if(!e.startsWith("intent://"))return!1;const t=W(e);if(!t.valid)return k.error(c.ui_linkHandler_invalidLink_title(),{description:t.error||c.ui_linkHandler_invalidLink_description()}),!0;try{switch(t.type){case"note":case"task":await N(t,r);break;case"file":await b(t,r);break;case"workspace":await C(t.resourceId);break;case"message":{const{openMessage:n}=await p(async()=>{const{openMessage:a}=await import("./DYVqPPax.js");return{openMessage:a}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]),import.meta.url);await n({workspaceId:t.workspaceId,agentId:t.agentId,messageId:t.resourceId});break}default:k.error(c.ui_linkHandler_unsupportedLink_title(),{description:c.ui_linkHandler_unsupportedLink_description({type:t.type})})}}catch(n){n instanceof u?k.error(c.ui_linkHandler_notFound_title(),{description:n.message}):k.error(c.ui_linkHandler_navigationFailed_title(),{description:n instanceof Error?n.message:c.ui_linkHandler_unknownError_label()})}return!0}function Q(e,r){return R(e,r)}function Z(){return async(e,r,t)=>{const a=t.target.closest("a");return a?.href?.startsWith("intent://")?(t.preventDefault(),await T(a.href)):!1}}async function C(e){const{appClient:r}=await p(async()=>{const{appClient:a}=await import("./B50rrLDJ.js").then(o=>o.s);return{appClient:a}},__vite__mapDeps([3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,2,20,21,22,23]),import.meta.url);if(!await r.workspaces.get(e).catch(()=>null))throw new u(c.workspace_loader_notFound_title());const{openAndShowWorkspace:n}=await p(async()=>{const{openAndShowWorkspace:a}=await import("./RnZ98Lx7.js").then(o=>o.s);return{openAndShowWorkspace:a}},__vite__mapDeps([34,7,5,6,8,9,10,11,4,12,13,14,32,33]),import.meta.url);await n(e)}async function N(e,r){const t=r.workspaceId??P.select(d.state)??void 0;if(e.workspaceId){const a=!t||e.workspaceId!==t;if(!await y(e.workspaceId,e.resourceId))throw new u(c.ui_linkHandler_noteNotFound_error({noteId:e.resourceId,workspaceId:e.workspaceId}));if(a){const{openAndShowWorkspace:s}=await p(async()=>{const{openAndShowWorkspace:i}=await import("./RnZ98Lx7.js").then(_=>_.s);return{openAndShowWorkspace:i}},__vite__mapDeps([34,7,5,6,8,9,10,11,4,12,13,14,32,33]),import.meta.url);await s(e.workspaceId,{query:{note:e.resourceId}})}else d.dispatch(v(e.workspaceId,e.resourceId,{openInAdjacentPanel:r.openInAdjacentPanel??!1,openInNewAdjacentPanel:r.openInNewAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}));return}if(!t)throw new u(c.ui_linkHandler_noSpaceOpen_error());if(!await y(t,e.resourceId))throw new u(c.ui_linkHandler_noteNotFoundCurrent_error({noteId:e.resourceId}));d.dispatch(v(t,e.resourceId,{openInAdjacentPanel:r.openInAdjacentPanel??!1,openInNewAdjacentPanel:r.openInNewAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}))}async function b(e,r){const t=r.workspaceId??P.select(d.state)??void 0;if(e.workspaceId){const n=!t||e.workspaceId!==t;if(n){const{openAndShowWorkspace:a}=await p(async()=>{const{openAndShowWorkspace:o}=await import("./RnZ98Lx7.js").then(s=>s.s);return{openAndShowWorkspace:o}},__vite__mapDeps([34,7,5,6,8,9,10,11,4,12,13,14,32,33]),import.meta.url);if(!await a(e.workspaceId))return}d.dispatch(g(e.workspaceId,e.resourceId,{filePathIsLiteral:!0,...e.line!==void 0?{line:e.line}:{},openInAdjacentPanel:n?!1:r.openInAdjacentPanel??!1,sourcePanelId:n?void 0:r.sourcePanelId}));return}if(!t)throw new u(c.ui_linkHandler_noSpaceOpen_error());d.dispatch(g(t,e.resourceId,{filePathIsLiteral:!0,...e.line!==void 0?{line:e.line}:{},openInAdjacentPanel:r.openInAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}))}async function y(e,r){try{const{backendRequest:t}=await p(async()=>{const{backendRequest:o}=await import("./C2jYl_tm.js").then(s=>s.j);return{backendRequest:o}},__vite__mapDeps([15,4,5,14,10,16,13,17,11,18,19]),import.meta.url),n=await t("note.get",{workspaceId:e,noteId:r}),a=n&&typeof n=="object"&&"note"in n?n.note:n;return a!=null&&typeof a=="object"}catch{return!1}}export{u as NotFoundError,Z as createIntentLinkClickHandler,Q as generateNoteLink,T as handleIntentLink,W as parseIntentLink};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/CS4mJHYc.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/B50rrLDJ.js","/app/immutable/chunks/C0QTy0Sy.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/_LtUY0jS.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/DX-Wrapd.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/CrD0jtXE.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/C2jYl_tm.js","/app/immutable/chunks/C7LIHk5_.js","/app/immutable/chunks/7UPrdiE9.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/_WGu_9si.js","/app/immutable/chunks/Cppy6ZYG.js","/app/immutable/chunks/U9jJmfYa.js","/app/immutable/chunks/CUkDMZwP.js","/app/immutable/chunks/bhKPSdq4.js","/app/immutable/chunks/B6S6VNu7.js","/app/immutable/chunks/B9ZFoPLo.js","/app/immutable/chunks/CE7dsja4.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/CSRKWN2m.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/DrOujub9.js"])))=>i.map(i=>d[i]);
2
+ import{bm as c,_ as p}from"./C0QTy0Sy.js";import{m as k}from"./DlUZpQ7U.js";import"./3SdAC2_C.js";import"./7UPrdiE9.js";import"./CrD0jtXE.js";import{Q as A}from"./C2jYl_tm.js";import"./ChTqQfQN.js";import"./DI_O2uCQ.js";import{m as L,Jv as d,vI as g,vK as v}from"./_LtUY0jS.js";import{a9 as R}from"./Cppy6ZYG.js";import{selectCurrentWorkspaceTabId as P}from"./VxaCN40t.js";const F="intent://local/note/{note-id}",S="intent://local/{workspace-id}/note/{note-id}";function f(){return c.ui_linkHandler_invalidFormat_error({shortFormat:F,longFormat:S})}class u extends Error{constructor(r){super(r),this.name="NotFoundError"}}function W(e){try{const r=new URL(e.replace("intent://","http://")),t=r.hostname,n=r.pathname.replace(/^\/+/,"").split("/").filter(l=>l.length>0),a=e.replace("intent://","").split(/[?#]/)[0].split("/").slice(1);if(!t||n.length<2)return{type:"unknown",orgId:t||"",resourceId:"",valid:!1,error:f()};let o,s,i,_,w;if(a[0]==="workspace"&&(a.length===2||a.length===3&&a[2]==="")){const l=O(a[1]);if(!l)return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:f()};o=l,s="workspace",i=l}else if(a[0]==="file")s="file",i=m(a.slice(1));else if(a.length>=3&&I(a[0])&&a[1]==="file")o=a[0],s="file",i=m(a.slice(2));else if(a.length===5&&a[1]==="agent"&&a[3]==="message"&&I(a[0])&&I(a[2])&&I(a[4])&&n.length===5&&n[1]==="agent"&&n[3]==="message")o=n[0],s="message",_=n[2],i=n[4];else if(n[0]==="note"||n[0]==="task")s=n[0],i=n[1];else if(n.length>=3&&(n[1]==="note"||n[1]==="task"))o=n[0],s=n[1],i=n[2];else return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:f()};if(!i||i.trim().length===0)return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:c.ui_linkHandler_emptyResourceId_error()};if(s==="note"||s==="task")return{type:s,orgId:t,workspaceId:o,resourceId:i,valid:!0};if(s==="file"){const l=/^#L\d+(?:-\d+|C\d+)?$/.test(r.hash)?r.hash:"",E=a.slice(o?2:1).join("/"),h=A(E+l);return i=m(h.path.split("/")),w=h.line,H(i)?{type:"file",orgId:t,workspaceId:o,resourceId:i,...w!==void 0?{line:w}:{},valid:!0}:{type:"unknown",orgId:t,workspaceId:o,resourceId:"",valid:!1,error:c.ui_linkHandler_invalidFilePath_error()}}return s==="workspace"&&o?{type:"workspace",orgId:t,workspaceId:o,resourceId:i,valid:!0}:s==="message"&&o&&_?{type:"message",orgId:t,workspaceId:o,resourceId:i,agentId:_,valid:!0}:{type:"unknown",orgId:t,workspaceId:o,resourceId:i,valid:!1,error:c.ui_linkHandler_unknownResourceType_error({type:s})}}catch(r){return{type:"unknown",orgId:"",resourceId:"",valid:!1,error:r instanceof Error?r.message:c.ui_linkHandler_parseFailed_error()}}}function m(e){return e.map(r=>decodeURIComponent(r)).join("/")}function H(e){return/^[A-Za-z]:/.test(e)?!1:e.split(/[\\/]/).every(t=>t.length>0&&t!=="."&&t!=="..")}const j=new Set([L,"new"]);function O(e){if(e===void 0||!I(e))return null;const r=decodeURIComponent(e);return j.has(r)?null:r}function I(e){let r;try{r=decodeURIComponent(e)}catch{return!1}return r.length>0&&r!=="."&&r!==".."&&!/[\\/]/.test(r)}async function T(e,r={}){if(!e.startsWith("intent://"))return!1;const t=W(e);if(!t.valid)return k.error(c.ui_linkHandler_invalidLink_title(),{description:t.error||c.ui_linkHandler_invalidLink_description()}),!0;try{switch(t.type){case"note":case"task":await N(t,r);break;case"file":await b(t,r);break;case"workspace":await C(t.resourceId);break;case"message":{const{openMessage:n}=await p(async()=>{const{openMessage:a}=await import("./CS4mJHYc.js");return{openMessage:a}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]),import.meta.url);await n({workspaceId:t.workspaceId,agentId:t.agentId,messageId:t.resourceId});break}default:k.error(c.ui_linkHandler_unsupportedLink_title(),{description:c.ui_linkHandler_unsupportedLink_description({type:t.type})})}}catch(n){n instanceof u?k.error(c.ui_linkHandler_notFound_title(),{description:n.message}):k.error(c.ui_linkHandler_navigationFailed_title(),{description:n instanceof Error?n.message:c.ui_linkHandler_unknownError_label()})}return!0}function Q(e,r){return R(e,r)}function Z(){return async(e,r,t)=>{const a=t.target.closest("a");return a?.href?.startsWith("intent://")?(t.preventDefault(),await T(a.href)):!1}}async function C(e){const{appClient:r}=await p(async()=>{const{appClient:a}=await import("./B50rrLDJ.js").then(o=>o.s);return{appClient:a}},__vite__mapDeps([3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,2,20,21,22,23]),import.meta.url);if(!await r.workspaces.get(e).catch(()=>null))throw new u(c.workspace_loader_notFound_title());const{openAndShowWorkspace:n}=await p(async()=>{const{openAndShowWorkspace:a}=await import("./DrOujub9.js").then(o=>o.s);return{openAndShowWorkspace:a}},__vite__mapDeps([34,7,5,6,8,9,10,11,4,12,13,14,32,33]),import.meta.url);await n(e)}async function N(e,r){const t=r.workspaceId??P.select(d.state)??void 0;if(e.workspaceId){const a=!t||e.workspaceId!==t;if(!await y(e.workspaceId,e.resourceId))throw new u(c.ui_linkHandler_noteNotFound_error({noteId:e.resourceId,workspaceId:e.workspaceId}));if(a){const{openAndShowWorkspace:s}=await p(async()=>{const{openAndShowWorkspace:i}=await import("./DrOujub9.js").then(_=>_.s);return{openAndShowWorkspace:i}},__vite__mapDeps([34,7,5,6,8,9,10,11,4,12,13,14,32,33]),import.meta.url);await s(e.workspaceId,{query:{note:e.resourceId}})}else d.dispatch(v(e.workspaceId,e.resourceId,{openInAdjacentPanel:r.openInAdjacentPanel??!1,openInNewAdjacentPanel:r.openInNewAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}));return}if(!t)throw new u(c.ui_linkHandler_noSpaceOpen_error());if(!await y(t,e.resourceId))throw new u(c.ui_linkHandler_noteNotFoundCurrent_error({noteId:e.resourceId}));d.dispatch(v(t,e.resourceId,{openInAdjacentPanel:r.openInAdjacentPanel??!1,openInNewAdjacentPanel:r.openInNewAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}))}async function b(e,r){const t=r.workspaceId??P.select(d.state)??void 0;if(e.workspaceId){const n=!t||e.workspaceId!==t;if(n){const{openAndShowWorkspace:a}=await p(async()=>{const{openAndShowWorkspace:o}=await import("./DrOujub9.js").then(s=>s.s);return{openAndShowWorkspace:o}},__vite__mapDeps([34,7,5,6,8,9,10,11,4,12,13,14,32,33]),import.meta.url);if(!await a(e.workspaceId))return}d.dispatch(g(e.workspaceId,e.resourceId,{filePathIsLiteral:!0,...e.line!==void 0?{line:e.line}:{},openInAdjacentPanel:n?!1:r.openInAdjacentPanel??!1,sourcePanelId:n?void 0:r.sourcePanelId}));return}if(!t)throw new u(c.ui_linkHandler_noSpaceOpen_error());d.dispatch(g(t,e.resourceId,{filePathIsLiteral:!0,...e.line!==void 0?{line:e.line}:{},openInAdjacentPanel:r.openInAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}))}async function y(e,r){try{const{backendRequest:t}=await p(async()=>{const{backendRequest:o}=await import("./C2jYl_tm.js").then(s=>s.j);return{backendRequest:o}},__vite__mapDeps([15,4,5,14,10,16,13,17,11,18,19]),import.meta.url),n=await t("note.get",{workspaceId:e,noteId:r}),a=n&&typeof n=="object"&&"note"in n?n.note:n;return a!=null&&typeof a=="object"}catch{return!1}}export{u as NotFoundError,Z as createIntentLinkClickHandler,Q as generateNoteLink,T as handleIntentLink,W as parseIntentLink};