@intent-hq/web 2.372.3 → 2.372.4

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 (143) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{CP03b_lt.js → -JM4IO5s.js} +1 -1
  3. package/web/app/immutable/chunks/{BDMD6FdT.js → 0x9fwj6X.js} +1 -1
  4. package/web/app/immutable/chunks/{a_hFrVUs.js → 1cfvZqIL.js} +1 -1
  5. package/web/app/immutable/chunks/{DtPlbqlO.js → 4V5RPZv7.js} +1 -1
  6. package/web/app/immutable/chunks/{BpXYSrHL.js → 6s1pPvLx.js} +4 -4
  7. package/web/app/immutable/chunks/{uMNoDmQ2.js → 8kN6wMYA.js} +1 -1
  8. package/web/app/immutable/chunks/{CuNdhmq6.js → B0rlWqYd.js} +1 -1
  9. package/web/app/immutable/chunks/{BiWBSez2.js → B62l45Uf.js} +2 -2
  10. package/web/app/immutable/chunks/{C_MA8w30.js → B7-7bZi9.js} +1 -1
  11. package/web/app/immutable/chunks/{kRDyYnu-.js → B70PGGIw.js} +1 -1
  12. package/web/app/immutable/chunks/{CCr3GhwT.js → BBFSGGQF.js} +1 -1
  13. package/web/app/immutable/chunks/{DZnf3Vcd.js → BDARQpEZ.js} +1 -1
  14. package/web/app/immutable/chunks/{Ciyw1cDk.js → BEUFwM79.js} +1 -1
  15. package/web/app/immutable/chunks/{xCNFDAsL.js → BGPjhZRB.js} +1 -1
  16. package/web/app/immutable/chunks/{CBP_r2rZ.js → BGTJWNfe.js} +1 -1
  17. package/web/app/immutable/chunks/{DQITwHBm.js → BGdVu4MB.js} +2 -2
  18. package/web/app/immutable/chunks/{pO_uIUtS.js → BHINa8Ry.js} +2 -2
  19. package/web/app/immutable/chunks/{CLkKOQIb.js → BIHiol8V.js} +1 -1
  20. package/web/app/immutable/chunks/{D9E1Sed-.js → BIoeY2kf.js} +3 -3
  21. package/web/app/immutable/chunks/{C5Ddrquv.js → BJyEBl3g.js} +1 -1
  22. package/web/app/immutable/chunks/{DTl-epgW.js → BO2BotXa.js} +1 -1
  23. package/web/app/immutable/chunks/{BjmThgx9.js → BPE9rssu.js} +3 -3
  24. package/web/app/immutable/chunks/{Byc-Gwn1.js → BTTV-GiU.js} +2 -2
  25. package/web/app/immutable/chunks/{paBp5EDQ.js → BTtsrh4I.js} +2 -2
  26. package/web/app/immutable/chunks/{DmNlyOFF.js → BTwXmxv4.js} +2 -2
  27. package/web/app/immutable/chunks/{DL1rChoc.js → Ba0RqSDe.js} +1 -1
  28. package/web/app/immutable/chunks/{D0WHOKE3.js → BcI2Qs88.js} +1 -1
  29. package/web/app/immutable/chunks/{DfvdR1t7.js → BlCrzIC_.js} +13 -13
  30. package/web/app/immutable/chunks/{s5eSUTR7.js → BlEjgaTq.js} +1 -1
  31. package/web/app/immutable/chunks/{DsATs4Yw.js → BlT-PlLX.js} +3 -3
  32. package/web/app/immutable/chunks/{DoUa1hTg.js → BmpDBFC8.js} +1 -1
  33. package/web/app/immutable/chunks/{B8GoKZxM.js → Bng2Wjmd.js} +1 -1
  34. package/web/app/immutable/chunks/{8vt0w0gB.js → BoVvYfWW.js} +1 -1
  35. package/web/app/immutable/chunks/{DO0YQnSr.js → BoqgKStq.js} +1 -1
  36. package/web/app/immutable/chunks/{-il6if-X.js → BqwlUVV2.js} +1 -1
  37. package/web/app/immutable/chunks/{CXXobfG5.js → BtmPL5YS.js} +1 -1
  38. package/web/app/immutable/chunks/{rUAQGuY9.js → BuJuLth3.js} +1 -1
  39. package/web/app/immutable/chunks/{CNc8h__d.js → BukcKDm8.js} +1 -1
  40. package/web/app/immutable/chunks/{BAcZGd3g.js → Byis73mI.js} +1 -1
  41. package/web/app/immutable/chunks/{BlPpu_gv.js → C0QlGAGX.js} +1 -1
  42. package/web/app/immutable/chunks/{BbbO1mVP.js → C0pO6HUL.js} +1 -1
  43. package/web/app/immutable/chunks/{BuHIOAsb.js → C8EZa-xD.js} +1 -1
  44. package/web/app/immutable/chunks/{CMR4RacT.js → CACF-3uP.js} +1 -1
  45. package/web/app/immutable/chunks/{BIZcpPtH.js → CDypb-9r.js} +1 -1
  46. package/web/app/immutable/chunks/{Cu_kcmjo.js → CE4gPfvG.js} +1 -1
  47. package/web/app/immutable/chunks/{DXq51U5Z.js → CEEa3RhU.js} +1 -1
  48. package/web/app/immutable/chunks/{B93aSOB6.js → CEwqW-JV.js} +1 -1
  49. package/web/app/immutable/chunks/{BjLzmoKu.js → CGn7nYWV.js} +1 -1
  50. package/web/app/immutable/chunks/{D73rJM26.js → CHpIe7_H.js} +1 -1
  51. package/web/app/immutable/chunks/{lMYobXp7.js → CIZP3oBY.js} +1 -1
  52. package/web/app/immutable/chunks/{3vi-OgRR.js → CJ-lCrFi.js} +1 -1
  53. package/web/app/immutable/chunks/{B77zwvv7.js → CMFcg3RE.js} +1 -1
  54. package/web/app/immutable/chunks/{CNW9Rwes.js → CNefgEA2.js} +1 -1
  55. package/web/app/immutable/chunks/{eWtOjdwZ.js → CRHarGqr.js} +1 -1
  56. package/web/app/immutable/chunks/{CVA75Jzf.js → CSfWCx1k.js} +1 -1
  57. package/web/app/immutable/chunks/{Dyda26aD.js → CSr8o6qm.js} +1 -1
  58. package/web/app/immutable/chunks/{CSUG4tUd.js → CVnLEltT.js} +2 -2
  59. package/web/app/immutable/chunks/{sppurVVE.js → CWm_YxN-.js} +1 -1
  60. package/web/app/immutable/chunks/{BMjTWq66.js → CYUq_fja.js} +1 -1
  61. package/web/app/immutable/chunks/{64KJqioX.js → CZ7G19nC.js} +1 -1
  62. package/web/app/immutable/chunks/{DlekFIEJ.js → CbbK8WaD.js} +1 -1
  63. package/web/app/immutable/chunks/{D4_8WlAX.js → Cd2ZM5fn.js} +1 -1
  64. package/web/app/immutable/chunks/{4WFBPbig.js → ChADavMb.js} +2 -2
  65. package/web/app/immutable/chunks/{Smn45KEu.js → CjJYMl8M.js} +1 -1
  66. package/web/app/immutable/chunks/{AzvtNQGc.js → CjoZjg16.js} +1 -1
  67. package/web/app/immutable/chunks/{D-5xnKgT.js → CnjuQpEd.js} +1 -1
  68. package/web/app/immutable/chunks/{C4tXJNlU.js → CpGAJSr-.js} +1 -1
  69. package/web/app/immutable/chunks/{D4HebHoD.js → Cqsgf1DM.js} +1 -1
  70. package/web/app/immutable/chunks/{Dr_KWcsf.js → CrrouvLD.js} +1 -1
  71. package/web/app/immutable/chunks/{DoGlKPs8.js → Csqgcuja.js} +1 -1
  72. package/web/app/immutable/chunks/{B6OWzTDz.js → Cub6NZJQ.js} +1 -1
  73. package/web/app/immutable/chunks/{0PFbquWg.js → Cuij5UQt.js} +1 -1
  74. package/web/app/immutable/chunks/{CEIGYgmC.js → CvPNqaI1.js} +1 -1
  75. package/web/app/immutable/chunks/{DXT_tHZV.js → CxNWBXR-.js} +3 -3
  76. package/web/app/immutable/chunks/{DVkhmNxg.js → D0Rl0jWy.js} +3 -3
  77. package/web/app/immutable/chunks/{BQ0lhaiw.js → D1B_DGCd.js} +1 -1
  78. package/web/app/immutable/chunks/{C8GDR5mq.js → D1gQR6EA.js} +1 -1
  79. package/web/app/immutable/chunks/{BFAXN_U2.js → D2akGP2t.js} +1 -1
  80. package/web/app/immutable/chunks/{CbGkMYMi.js → D69enMvZ.js} +1 -1
  81. package/web/app/immutable/chunks/{CmfLCgYN.js → D6nqIgl8.js} +1 -1
  82. package/web/app/immutable/chunks/{D7X_WaSL.js → D72FFXC3.js} +3 -3
  83. package/web/app/immutable/chunks/{QJaPD5ja.js → D9N7PGtO.js} +3 -3
  84. package/web/app/immutable/chunks/{DSam4kPq.js → DA_CqgBx.js} +2 -2
  85. package/web/app/immutable/chunks/{FHdlPR2E.js → DB4YPFuG.js} +1 -1
  86. package/web/app/immutable/chunks/{CygNkso5.js → DCdZE6Zv.js} +1 -1
  87. package/web/app/immutable/chunks/{Di8laZBj.js → DE0oDk53.js} +1 -1
  88. package/web/app/immutable/chunks/{Dqso2iIq.js → DE9J1g7V.js} +1 -1
  89. package/web/app/immutable/chunks/{DyOuvQsx.js → DEsEAjIo.js} +3 -3
  90. package/web/app/immutable/chunks/{D9ZsyNyz.js → DJbcK1vm.js} +1 -1
  91. package/web/app/immutable/chunks/{n1Mub_w4.js → DOOWwNKc.js} +1 -1
  92. package/web/app/immutable/chunks/{DdfA1Cl6.js → DRX7fFc0.js} +2 -2
  93. package/web/app/immutable/chunks/{DzXo18RQ.js → DYb2Jx_H.js} +1 -1
  94. package/web/app/immutable/chunks/{Dz9187FZ.js → DZXtm4_Y.js} +1 -1
  95. package/web/app/immutable/chunks/{ezsQjlt6.js → DcPlD4Yk.js} +1 -1
  96. package/web/app/immutable/chunks/{eHy-2vQk.js → DfC089Aj.js} +1 -1
  97. package/web/app/immutable/chunks/{BSXFgzj_.js → DfybFhnX.js} +1 -1
  98. package/web/app/immutable/chunks/{tDXv5z_U.js → Dl1bhT5L.js} +1 -1
  99. package/web/app/immutable/chunks/{B3agx6Zv.js → Dp1LDv4x.js} +1 -1
  100. package/web/app/immutable/chunks/{m5FEmsd9.js → DskDJYfd.js} +1 -1
  101. package/web/app/immutable/chunks/{DUnf3IJM.js → DtDGJeDZ.js} +1 -1
  102. package/web/app/immutable/chunks/{DoKriIRg.js → DthXaxFc.js} +1 -1
  103. package/web/app/immutable/chunks/{Buf2XX2m.js → DwIiGflF.js} +1 -1
  104. package/web/app/immutable/chunks/{CMd9xe_v.js → DyZwlsjA.js} +1 -1
  105. package/web/app/immutable/chunks/{CwLBVHwC.js → EYYp06eB.js} +1 -1
  106. package/web/app/immutable/chunks/{DpqgMZNx.js → Fg5V-_KH.js} +1 -1
  107. package/web/app/immutable/chunks/{DSviIBB2.js → Id9rbUde.js} +1 -1
  108. package/web/app/immutable/chunks/{B430oCRo.js → JHEpx9qH.js} +1 -1
  109. package/web/app/immutable/chunks/{D_yMjDjB.js → NDFzzX6j.js} +6 -6
  110. package/web/app/immutable/chunks/{Bmgc_Vmk.js → OKyJRSao.js} +1 -1
  111. package/web/app/immutable/chunks/{TWY-IEJw.js → PAnofhoS.js} +1 -1
  112. package/web/app/immutable/chunks/{CjmicwNO.js → RLm3umLY.js} +1 -1
  113. package/web/app/immutable/chunks/{BR-e1Dqz.js → RNLMbZ9C.js} +4 -4
  114. package/web/app/immutable/chunks/{B4N2SW_I.js → TWIpzPb0.js} +1 -1
  115. package/web/app/immutable/chunks/{DumB3eQv.js → ZVjzo5B6.js} +1 -1
  116. package/web/app/immutable/chunks/{C8F76z1j.js → _q3XqkyK.js} +1 -1
  117. package/web/app/immutable/chunks/{D4p9bnGO.js → b2N6VSvj.js} +1 -1
  118. package/web/app/immutable/chunks/{DjHgMTjl.js → f_7_jVTC.js} +3 -3
  119. package/web/app/immutable/chunks/{2gbKHQXV.js → gprpeC7D.js} +1 -1
  120. package/web/app/immutable/chunks/{CgyKOUjB.js → p9pVDf-Y.js} +1 -1
  121. package/web/app/immutable/chunks/{CvO597Pq.js → pjjCtVad.js} +1 -1
  122. package/web/app/immutable/chunks/{C2f0QCtk.js → pnLCy_6A.js} +1 -1
  123. package/web/app/immutable/chunks/{yc-ZA4uZ.js → qc5YRWua.js} +1 -1
  124. package/web/app/immutable/chunks/{DAAshoKb.js → xHTS7_DQ.js} +1 -1
  125. package/web/app/immutable/entry/{app.DDy_f4Vr.js → app.Bn2XrulZ.js} +2 -2
  126. package/web/app/immutable/entry/start.DdzwOLyS.js +1 -0
  127. package/web/app/immutable/nodes/{0.BIgrj7tk.js → 0.BCyk8Eor.js} +1 -1
  128. package/web/app/immutable/nodes/{1.BS4qG73n.js → 1.D2GMUxe6.js} +1 -1
  129. package/web/app/immutable/nodes/{10.CoUmfWJP.js → 10.CqLjvueR.js} +4 -4
  130. package/web/app/immutable/nodes/{11.Cp19-DaX.js → 11.DjHiLQV_.js} +1 -1
  131. package/web/app/immutable/nodes/{15._NKX_puo.js → 15.DBgLfjTo.js} +1 -1
  132. package/web/app/immutable/nodes/{19.CrIpgdrd.js → 19.C65aoXG7.js} +2 -2
  133. package/web/app/immutable/nodes/{2.B-ARMoF4.js → 2.DyILpfUv.js} +4 -4
  134. package/web/app/immutable/nodes/{3.CeiKZ0d6.js → 3.BUXW6SHm.js} +1 -1
  135. package/web/app/immutable/nodes/{4.-s0Jfvde.js → 4.IOdsbvEy.js} +1 -1
  136. package/web/app/immutable/nodes/{5.BIDxYMYJ.js → 5.CdjllGpy.js} +1 -1
  137. package/web/app/immutable/nodes/{6.3fDeScAq.js → 6.B9bgqfmM.js} +1 -1
  138. package/web/app/immutable/nodes/{7.DydkXABx.js → 7.CJeEPi1x.js} +1 -1
  139. package/web/app/immutable/nodes/{8.DyQruTiJ.js → 8.CoXwlNYv.js} +1 -1
  140. package/web/app/immutable/nodes/{9.D0w1njvH.js → 9.B7TZvLdB.js} +4 -4
  141. package/web/app/version.json +1 -1
  142. package/web/index.html +9 -9
  143. package/web/app/immutable/entry/start.CtWgyCM1.js +0 -1
@@ -1 +1 @@
1
- import{t as Ot,bo as R,bm as u,bw as Ft,b as Rt}from"./ClpAEjbe.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"./CJxGDkBm.js";import{i as W}from"./wmcYjLAa.js";import{I as or,g as Xe}from"./BwASeArv.js";import{c as Ee}from"./DSqSJXGX.js";import{n as Oe,j as Ze,h as $t}from"./oXpJ1LFx.js";import{f as Fe,c as gt,s as nr}from"./CnGVh7I3.js";import{b as xt}from"./NtFyWdpR.js";import{F as Te,cR as ir,au as lr,cK as bt,c$ as Pt,cd as cr}from"./CtJxHvGv.js";import{f as ye}from"./BVi5KkOP.js";import"./CPDV_dyu.js";import"./B5wwCKYG.js";import{M as nt}from"./DVkhmNxg.js";import{M as dr}from"./wJsFiZDi.js";import{w as _e}from"./C8GDR5mq.js";import{h as Ct,i as Et,g as Tt,P as At}from"./C1zxTHwk.js";import{C as ht}from"./19Io1z-x.js";import{c as pr}from"./ChTqQfQN.js";import{A as ur}from"./BCrI1nnw.js";import"./WSVFXKpL.js";import{d as vr}from"./BxKppgO5.js";import{Jq as _r}from"./CpP1PKzF.js";import{dP as mr}from"./D9Ykl3eH.js";import{S as et,j as fr,a as jt}from"./BR-e1Dqz.js";import{R as qe,c as it,m as gr,bE as tt}from"./QJaPD5ja.js";import"./CVA75Jzf.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"./ClpAEjbe.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"./CJxGDkBm.js";import{i as W}from"./wmcYjLAa.js";import{I as or,g as Xe}from"./BwASeArv.js";import{c as Ee}from"./DSqSJXGX.js";import{n as Oe,j as Ze,h as $t}from"./oXpJ1LFx.js";import{f as Fe,c as gt,s as nr}from"./CnGVh7I3.js";import{b as xt}from"./NtFyWdpR.js";import{F as Te,cR as ir,au as lr,cK as bt,c$ as Pt,cd as cr}from"./CtJxHvGv.js";import{f as ye}from"./BVi5KkOP.js";import"./CPDV_dyu.js";import"./B5wwCKYG.js";import{M as nt}from"./D0Rl0jWy.js";import{M as dr}from"./wJsFiZDi.js";import{w as _e}from"./D1gQR6EA.js";import{h as Ct,i as Et,g as Tt,P as At}from"./C1zxTHwk.js";import{C as ht}from"./19Io1z-x.js";import{c as pr}from"./ChTqQfQN.js";import{A as ur}from"./BCrI1nnw.js";import"./WSVFXKpL.js";import{d as vr}from"./BxKppgO5.js";import{Jq as _r}from"./CpP1PKzF.js";import{dP as mr}from"./D9Ykl3eH.js";import{S as et,j as fr,a as jt}from"./RNLMbZ9C.js";import{R as qe,c as it,m as gr,bE as tt}from"./D9N7PGtO.js";import"./CSfWCx1k.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 +1 @@
1
- import{D as C}from"./eHy-2vQk.js";import{t as re,bo as y,bw as se,b as ae,bm as I}from"./ClpAEjbe.js";import{bs as ne,cb as oe,c5 as ie,bH as k,aD as b,a5 as G,bA as W,b_ as R,W as E,bn as le,bV as q,c9 as F,aA as x,ay as H,bl as N,bS as L,bO as O,a7 as ce,aB as P}from"./CJxGDkBm.js";import{i as de}from"./wmcYjLAa.js";import{k as me}from"./Xh71Wbuh.js";import{s as D}from"./CnGVh7I3.js";import{a as ue}from"./BpXYSrHL.js";const K=C.shape.model,pe=C.shape.states.unwrap().element;function U(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function fe(t){return/^(?:|model|model\.(?:nodes|edges|groups)|states)$/.test(t)}function ge(t){let e=0;const s=()=>{for(;/[\t\n\r ]/.test(t[e]??"\0");)e+=1},a=(l,d)=>{if(d>64)throw new Error("JSON nesting limit exceeded");s();const f=e,m=t[e];if(m===void 0)return{complete:!1};if(m==='"'){for(e+=1;e<t.length;){const r=t[e++];if(r==="\\")e+=1;else if(r==='"')return{value:JSON.parse(t.slice(f,e)),complete:!0}}return{complete:!1}}if(m==="{"||m==="["){const r=m==="{",c=r?Object.create(null):[],h=r?"}":"]";if(e+=1,s(),t[e]===h)return e+=1,{value:c,complete:!0};for(;e<t.length;){let i="";if(r){if(t[e]!=='"')throw new Error("Expected JSON property");const _=a(l,d+1);if(!_.complete)return{value:c,complete:!1};if(i=_.value,s(),e===t.length)return{value:c,complete:!1};if(t[e++]!==":")throw new Error("Expected JSON colon")}const g=r?l?`${l}.${i}`:i:`${l}[]`,v=a(g,d+1);if((v.complete||fe(g)&&v.value!==void 0)&&(Array.isArray(c)?c.push(v.value):c[i]=v.value),!v.complete)return{value:c,complete:!1};if(s(),e===t.length)return{value:c,complete:!1};if(t[e]===h)return e+=1,{value:c,complete:!0};if(t[e++]!==",")throw new Error("Expected JSON separator");s()}return{value:c,complete:!1}}for(;e<t.length&&!/[\t\n\r ,}\]]/.test(t[e]);)e+=1;return e===t.length?{complete:!1}:{value:JSON.parse(t.slice(f,e)),complete:!0}},n=a("",0);if(s(),n.complete&&e!==t.length)throw new Error("Unexpected JSON suffix");return n}function J(t){const e=new Set;return t.filter(({id:s})=>e.has(s)?!1:(e.add(s),!0))}function z(t,e,s,a){return[t.visibleNodes,t.highlightedNodes].every(n=>n?.every(l=>e.has(l))??!0)&&[t.visibleEdges,t.highlightedEdges].every(n=>n?.every(l=>s.has(l))??!0)&&(t.visibleGroups?.every(n=>a.has(n))??!0)&&(t.camera?.focus===void 0||e.has(t.camera.focus))}function ve(t){if(!U(t)||!U(t.model))return null;const e=t.model,s=(i,g)=>Array.isArray(i)?i.filter(v=>g.safeParse(v).success):[];let a=J(s(e.nodes,K.shape.nodes.element)),n=J(s(e.groups,K.shape.groups.unwrap().element)),l=!0;for(;l;){const i=new Set(a.map(({id:u})=>u)),g=n.filter(u=>u.nodeIds.every(A=>i.has(A))),v=new Set(g.map(({id:u})=>u)),_=a.filter(u=>u.group===void 0||v.has(u.group));l=_.length!==a.length||g.length!==n.length,a=_,n=g}if(!a.length)return null;const d=new Set(a.map(({id:i})=>i)),f=J(s(e.edges,K.shape.edges.element)).filter(i=>d.has(i.from)&&d.has(i.to)),m=new Set(f.map(({id:i})=>i)),r=new Set(n.map(({id:i})=>i)),c=J(s(t.states,pe)).filter(i=>z(i,d,m,r)),h={...t,model:{...e,nodes:a,edges:f,...e.groups===void 0?{}:{groups:n}},...t.states===void 0?{}:{states:c}};return c.some(i=>i.id===h.currentStateId)||delete h.currentStateId,C.safeParse(h).success?h:null}function V(t){if(!C.safeParse(t).success)return null;const e=t,{nodes:s,edges:a,groups:n=[]}=e.model,l=e.states??[],d=new Set(s.map(({id:r})=>r)),f=new Set(a.map(({id:r})=>r)),m=new Set(n.map(({id:r})=>r));return[s,a,n,l].some(r=>new Set(r.map(({id:c})=>c)).size!==r.length)||s.some(r=>r.group!==void 0&&!m.has(r.group))||a.some(r=>!d.has(r.from)||!d.has(r.to))||n.some(r=>r.nodeIds.some(c=>!d.has(c)))||l.some(r=>!z(r,d,f,m))||e.currentStateId!==void 0&&!l.some(r=>r.id===e.currentStateId)?null:e}function Oe(t,e=!1){const s=(a,n,l)=>({rawSource:t,status:a,diagram:n,...l?{error:l}:{}});try{if(e){const n=V(JSON.parse(t));return n?s("complete",n):s("invalid",null,"Invalid diagram payload")}const a=ge(t);if(a.complete){const n=V(a.value);if(n)return s("complete",n)}return s("partial",ve(a.value))}catch{return s(e?"invalid":"partial",null,e?"Invalid diagram JSON":void 0)}}var he=P('<div class="diagram-feedback svelte-p097sp" role="alert"><strong> </strong> <span> </span></div> <pre class="diagram-source svelte-p097sp"> </pre>',1),we=P('<div class="diagram-feedback svelte-p097sp" role="status"> </div>'),Se=P('<div class="streaming-diagram svelte-p097sp"><!></div>');function _e(t,e){if(new.target)return re({component:_e,...t});ne(e,!0);let s=y(e,"diagram",7),a=y(e,"isStreaming",7,!1),n=y(e,"source",7),l=y(e,"sourceError",7),d=y(e,"viewResetKey",7),f=y(e,"onBindingClick",7),m=q(null),r=q(0),c="",h,i=!1;oe(()=>{const o=s(),p=n(),w=d(),S=a(),B=!!l();ie(()=>{i&&(w!==h||!p.startsWith(c))&&(k(m,null),k(r,b(r)+1)),i=!0,c=p,h=w,B||!S&&!o?k(m,null):o&&k(m,o,!0)})});const g=F(()=>l()?null:s()??(a()?b(m):null)),v=F(()=>!!l()||!a()&&!s());var _={get diagram(){return s()},set diagram(o){s(o),x()},get isStreaming(){return a()},set isStreaming(o=!1){a(o),x()},get source(){return n()},set source(o){n(o),x()},get sourceError(){return l()},set sourceError(o){l(o),x()},get viewResetKey(){return d()},set viewResetKey(o){d(o),x()},get onBindingClick(){return f()},set onBindingClick(o){f(o),x()},$set:se,$on:(o,p)=>ae(e,o,p)},u=Se(),A=G(u);{var M=o=>{var p=he(),w=H(p),S=G(w),B=N(S,!0),X=L(S,2),Y=N(X,!0);W(w);var j=L(w,2),Z=N(j,!0);R(($,ee,te)=>{O(B,$),O(Y,ee),D(j,"aria-label",te),O(Z,n())},[()=>I.markdown_mermaid_renderFailed_error(),()=>I.diagram_renderer_error_description(),()=>I.markdown_mermaid_viewSource_label()]),E(o,p)},Q=o=>{var p=ce(),w=H(p);me(w,()=>b(r),S=>{ue(S,{get diagram(){return b(g)},editable:!1,get viewResetKey(){return d()},get onBindingClick(){return f()}})}),E(o,p)},T=o=>{var p=we(),w=N(p,!0);R(S=>O(w,S),[()=>I.ui_spinner_loading_ariaLabel()]),E(o,p)};de(A,o=>{b(v)?o(M):b(g)?o(Q,1):o(T,-1)})}return W(u),R(()=>{D(u,"aria-busy",a()),D(u,"data-diagram-streaming",a())}),E(t,u),le(_)}export{_e as S,Oe as p};
1
+ import{D as C}from"./DfC089Aj.js";import{t as re,bo as y,bw as se,b as ae,bm as I}from"./ClpAEjbe.js";import{bs as ne,cb as oe,c5 as ie,bH as k,aD as b,a5 as G,bA as W,b_ as R,W as E,bn as le,bV as q,c9 as F,aA as x,ay as H,bl as N,bS as L,bO as O,a7 as ce,aB as P}from"./CJxGDkBm.js";import{i as de}from"./wmcYjLAa.js";import{k as me}from"./Xh71Wbuh.js";import{s as D}from"./CnGVh7I3.js";import{a as ue}from"./6s1pPvLx.js";const K=C.shape.model,pe=C.shape.states.unwrap().element;function U(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function fe(t){return/^(?:|model|model\.(?:nodes|edges|groups)|states)$/.test(t)}function ge(t){let e=0;const s=()=>{for(;/[\t\n\r ]/.test(t[e]??"\0");)e+=1},a=(l,d)=>{if(d>64)throw new Error("JSON nesting limit exceeded");s();const f=e,m=t[e];if(m===void 0)return{complete:!1};if(m==='"'){for(e+=1;e<t.length;){const r=t[e++];if(r==="\\")e+=1;else if(r==='"')return{value:JSON.parse(t.slice(f,e)),complete:!0}}return{complete:!1}}if(m==="{"||m==="["){const r=m==="{",c=r?Object.create(null):[],h=r?"}":"]";if(e+=1,s(),t[e]===h)return e+=1,{value:c,complete:!0};for(;e<t.length;){let i="";if(r){if(t[e]!=='"')throw new Error("Expected JSON property");const _=a(l,d+1);if(!_.complete)return{value:c,complete:!1};if(i=_.value,s(),e===t.length)return{value:c,complete:!1};if(t[e++]!==":")throw new Error("Expected JSON colon")}const g=r?l?`${l}.${i}`:i:`${l}[]`,v=a(g,d+1);if((v.complete||fe(g)&&v.value!==void 0)&&(Array.isArray(c)?c.push(v.value):c[i]=v.value),!v.complete)return{value:c,complete:!1};if(s(),e===t.length)return{value:c,complete:!1};if(t[e]===h)return e+=1,{value:c,complete:!0};if(t[e++]!==",")throw new Error("Expected JSON separator");s()}return{value:c,complete:!1}}for(;e<t.length&&!/[\t\n\r ,}\]]/.test(t[e]);)e+=1;return e===t.length?{complete:!1}:{value:JSON.parse(t.slice(f,e)),complete:!0}},n=a("",0);if(s(),n.complete&&e!==t.length)throw new Error("Unexpected JSON suffix");return n}function J(t){const e=new Set;return t.filter(({id:s})=>e.has(s)?!1:(e.add(s),!0))}function z(t,e,s,a){return[t.visibleNodes,t.highlightedNodes].every(n=>n?.every(l=>e.has(l))??!0)&&[t.visibleEdges,t.highlightedEdges].every(n=>n?.every(l=>s.has(l))??!0)&&(t.visibleGroups?.every(n=>a.has(n))??!0)&&(t.camera?.focus===void 0||e.has(t.camera.focus))}function ve(t){if(!U(t)||!U(t.model))return null;const e=t.model,s=(i,g)=>Array.isArray(i)?i.filter(v=>g.safeParse(v).success):[];let a=J(s(e.nodes,K.shape.nodes.element)),n=J(s(e.groups,K.shape.groups.unwrap().element)),l=!0;for(;l;){const i=new Set(a.map(({id:u})=>u)),g=n.filter(u=>u.nodeIds.every(A=>i.has(A))),v=new Set(g.map(({id:u})=>u)),_=a.filter(u=>u.group===void 0||v.has(u.group));l=_.length!==a.length||g.length!==n.length,a=_,n=g}if(!a.length)return null;const d=new Set(a.map(({id:i})=>i)),f=J(s(e.edges,K.shape.edges.element)).filter(i=>d.has(i.from)&&d.has(i.to)),m=new Set(f.map(({id:i})=>i)),r=new Set(n.map(({id:i})=>i)),c=J(s(t.states,pe)).filter(i=>z(i,d,m,r)),h={...t,model:{...e,nodes:a,edges:f,...e.groups===void 0?{}:{groups:n}},...t.states===void 0?{}:{states:c}};return c.some(i=>i.id===h.currentStateId)||delete h.currentStateId,C.safeParse(h).success?h:null}function V(t){if(!C.safeParse(t).success)return null;const e=t,{nodes:s,edges:a,groups:n=[]}=e.model,l=e.states??[],d=new Set(s.map(({id:r})=>r)),f=new Set(a.map(({id:r})=>r)),m=new Set(n.map(({id:r})=>r));return[s,a,n,l].some(r=>new Set(r.map(({id:c})=>c)).size!==r.length)||s.some(r=>r.group!==void 0&&!m.has(r.group))||a.some(r=>!d.has(r.from)||!d.has(r.to))||n.some(r=>r.nodeIds.some(c=>!d.has(c)))||l.some(r=>!z(r,d,f,m))||e.currentStateId!==void 0&&!l.some(r=>r.id===e.currentStateId)?null:e}function Oe(t,e=!1){const s=(a,n,l)=>({rawSource:t,status:a,diagram:n,...l?{error:l}:{}});try{if(e){const n=V(JSON.parse(t));return n?s("complete",n):s("invalid",null,"Invalid diagram payload")}const a=ge(t);if(a.complete){const n=V(a.value);if(n)return s("complete",n)}return s("partial",ve(a.value))}catch{return s(e?"invalid":"partial",null,e?"Invalid diagram JSON":void 0)}}var he=P('<div class="diagram-feedback svelte-p097sp" role="alert"><strong> </strong> <span> </span></div> <pre class="diagram-source svelte-p097sp"> </pre>',1),we=P('<div class="diagram-feedback svelte-p097sp" role="status"> </div>'),Se=P('<div class="streaming-diagram svelte-p097sp"><!></div>');function _e(t,e){if(new.target)return re({component:_e,...t});ne(e,!0);let s=y(e,"diagram",7),a=y(e,"isStreaming",7,!1),n=y(e,"source",7),l=y(e,"sourceError",7),d=y(e,"viewResetKey",7),f=y(e,"onBindingClick",7),m=q(null),r=q(0),c="",h,i=!1;oe(()=>{const o=s(),p=n(),w=d(),S=a(),B=!!l();ie(()=>{i&&(w!==h||!p.startsWith(c))&&(k(m,null),k(r,b(r)+1)),i=!0,c=p,h=w,B||!S&&!o?k(m,null):o&&k(m,o,!0)})});const g=F(()=>l()?null:s()??(a()?b(m):null)),v=F(()=>!!l()||!a()&&!s());var _={get diagram(){return s()},set diagram(o){s(o),x()},get isStreaming(){return a()},set isStreaming(o=!1){a(o),x()},get source(){return n()},set source(o){n(o),x()},get sourceError(){return l()},set sourceError(o){l(o),x()},get viewResetKey(){return d()},set viewResetKey(o){d(o),x()},get onBindingClick(){return f()},set onBindingClick(o){f(o),x()},$set:se,$on:(o,p)=>ae(e,o,p)},u=Se(),A=G(u);{var M=o=>{var p=he(),w=H(p),S=G(w),B=N(S,!0),X=L(S,2),Y=N(X,!0);W(w);var j=L(w,2),Z=N(j,!0);R(($,ee,te)=>{O(B,$),O(Y,ee),D(j,"aria-label",te),O(Z,n())},[()=>I.markdown_mermaid_renderFailed_error(),()=>I.diagram_renderer_error_description(),()=>I.markdown_mermaid_viewSource_label()]),E(o,p)},Q=o=>{var p=ce(),w=H(p);me(w,()=>b(r),S=>{ue(S,{get diagram(){return b(g)},editable:!1,get viewResetKey(){return d()},get onBindingClick(){return f()}})}),E(o,p)},T=o=>{var p=we(),w=N(p,!0);R(S=>O(w,S),[()=>I.ui_spinner_loading_ariaLabel()]),E(o,p)};de(A,o=>{b(v)?o(M):b(g)?o(Q,1):o(T,-1)})}return W(u),R(()=>{D(u,"aria-busy",a()),D(u,"data-diagram-streaming",a())}),E(t,u),le(_)}export{_e as S,Oe as p};
@@ -1 +1 @@
1
- import{a as S}from"./BdWqymET.js";import{aE as l}from"./CJxGDkBm.js";import{g as c}from"./D_yMjDjB.js";import{p as g}from"./CuNdhmq6.js";import{d as I}from"./B0Z-1lwJ.js";import{dP as f}from"./D9Ykl3eH.js";import{Cl as u,m as y,Jq as o,h6 as A,vF as m,vG as N,vI as b}from"./CpP1PKzF.js";import{g as W,n as h}from"./ByoP16rr.js";import{S as D,a as R,n as E}from"./pO_uIUtS.js";import{n as O,o as v}from"./a_hFrVUs.js";const P="intent:onboarding-skip:v1";function k(e){return u.getItem(h(P,e))==="1"}function re(e){k(e)||u.setItem(h(P,e),"1")}function _(e){return e.connections?.hasReceivedList===!0&&k(W(e))}function F(e,a){return e.some(t=>t.id!==y&&t.id!==a&&t.status!=="Archived"&&t.status!=="Deleted")}function j(e,a,t=!1){return t||F(e,a)?"/":"/workspace/new"}function d(e,a){return j(f.select(e),a,_(e))}const se=Object.freeze(Object.defineProperty({__proto__:null,resolveWindowEmptyDestination:d},Symbol.toStringTag,{value:"Module"})),r=new S("WorkspaceNavigation");async function L(e){r.info(`[navigateToAgent] Navigating to agent: ${e}`);const t=l(g).params.id;if(!t){r.error("[navigateToAgent] No workspace ID found in current page params");return}const n=new URL(window.location.href);n.searchParams.set("drawerOpen","1"),n.searchParams.set("drawerType","agent"),n.searchParams.set("selectedAgent",e),n.searchParams.delete("selectedTerminal"),await c(n.toString(),{replaceState:!0}),o.dispatch(m(t,"agent",e))}async function C(e){r.info(`[navigateToTerminal] Navigating to terminal: ${e}`);const t=l(g).params.id;if(!t){r.error("[navigateToTerminal] No workspace ID found in current page params");return}const n=new URL(window.location.href),i=n.searchParams.get("drawerOpen")==="1",s=n.searchParams.get("drawerType")==="terminal";(!i||!s)&&n.searchParams.set("drawerOpen","1"),n.searchParams.set("drawerType","terminal"),n.searchParams.set("selectedTerminal",e),n.searchParams.delete("selectedAgent"),await c(n.toString(),{replaceState:!0}),o.dispatch(m(t,"terminal",e))}function $(e){return!e||!(e instanceof Element)?void 0:e.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0}async function p(e,a){r.info(`[navigateToNote] Navigating to note: ${e}`,a);const t=l(g),n=a?.workspaceId??t.params.id;if(!n){r.error("[navigateToNote] No workspace ID found in current page params");return}o.dispatch(b(n,e,{openInAdjacentPanel:a?.openInAdjacentPanel??!1,openInNewAdjacentPanel:a?.openInNewAdjacentPanel??!1,sourcePanelId:a?.sourcePanelId}))}async function U(e,a,t){r.info(`[navigateToFile] Navigating to file: ${e}${a?` (line ${a})`:""}`,t);const i=l(g).params.id;if(!i){r.error("[navigateToFile] No workspace ID found in current page params");return}o.dispatch(N(i,e,{line:a,openInAdjacentPanel:t?.openInAdjacentPanel??!1,sourcePanelId:t?.sourcePanelId}))}async function M(){r.info("[navigateToSpec] Navigating to workspace spec"),await p("spec")}async function B(){r.info("[closeDrawer] Closing drawer");const a=l(g).params.id;if(!a){r.error("[closeDrawer] No workspace ID found in current page params");return}const t=new URL(window.location.href);t.searchParams.set("drawerOpen","0"),t.searchParams.delete("selectedAgent"),t.searchParams.delete("selectedTerminal"),await c(t.toString(),{replaceState:!0}),o.dispatch(A(a))}async function K(){r.info("[clearMainContent] Clearing main content");const e=new URL(window.location.href);e.searchParams.set("mainContentType","empty"),e.searchParams.delete("selectedNoteId"),e.searchParams.delete("selectedFile"),e.searchParams.delete("line"),await c(e.toString(),{replaceState:!1})}async function G(e,a,t){r.info("[navigateToTask] Navigating to task",{noteId:e,taskPosition:a,taskText:t}),await p(e);const n=()=>{I("scroll-to-task",{noteId:e,taskPosition:a,taskText:t},{bubbles:!0}),r.debug("[navigateToTask] Dispatched scroll-to-task event",{noteId:e,taskPosition:a})},i=[100,300,600];for(const s of i)setTimeout(n,s)}async function H(e){r.info("[navigateToSettings] Navigating to settings",e);const a=new URL("/settings",window.location.origin),t=window.location.pathname.match(/^\/workspace\/([^/]+)/)?.[1],n=t==="new"?void 0:t,i=e?.workspaceId??n;if(e?.tab&&a.searchParams.set("tab",e.tab),e?.specialist&&a.searchParams.set("specialist",e.specialist),e?.view&&a.searchParams.set("view",e.view),i&&a.searchParams.set("workspaceId",i),e?.hash&&(a.hash=e.hash),typeof window<"u"&&window.location.pathname==="/settings"){if(e?.tab||e?.specialist||e?.view||e?.workspaceId){const s=new URL(window.location.href);e?.tab&&s.searchParams.set("tab",e.tab),e?.specialist&&s.searchParams.set("specialist",e.specialist),e?.view&&s.searchParams.set("view",e.view),e?.workspaceId&&s.searchParams.set("workspaceId",e.workspaceId),e?.hash&&(s.hash=e.hash),await c(s.toString(),{replaceState:!0});return}if(e?.hash){const s=`#${e.hash}`;window.location.hash===s&&(window.location.hash=""),window.location.hash=s;return}return}await E(a.pathname+a.search+a.hash)}function T(){const e=typeof sessionStorage>"u"?null:sessionStorage.getItem(D);if(e&&e!=="/"&&!R(e))return e;const a=w();return a?`/workspace/${a.id}`:d(o.state)}async function z(){const e=T();r.info("[navigateBackFromSettings] Navigating back to:",e),await O(e)}function w(e){return f.select(o.state).find(a=>a.id!==e&&a.status!=="Archived"&&a.status!=="Deleted")}async function Y(){const e=w();if(e){r.info("[navigateToFirstWorkspace] Showing workspace:",e.id),await v(e.id);return}const a=d(o.state);r.info("[navigateToFirstWorkspace] Navigating to:",a),await c(a)}async function q(e){const a=w(e);if(a){r.info("[navigateAfterWorkspaceRemoval] Showing workspace:",a.id),await v(a.id);return}const t=d(o.state,e);r.info("[navigateAfterWorkspaceRemoval] Navigating to:",t),await c(t)}const ie=Object.freeze(Object.defineProperty({__proto__:null,clearMainContent:K,closeDrawer:B,findSourcePanelId:$,getSettingsPreviousPath:T,navigateAfterWorkspaceRemoval:q,navigateBackFromSettings:z,navigateToAgent:L,navigateToFile:U,navigateToFirstWorkspace:Y,navigateToNote:p,navigateToSettings:H,navigateToSpec:M,navigateToTask:G,navigateToTerminal:C},Symbol.toStringTag,{value:"Module"}));export{U as a,Y as b,p as c,H as d,G as e,$ as f,d as g,ie as h,_ as i,z as n,re as r,se as w};
1
+ import{a as S}from"./BdWqymET.js";import{aE as l}from"./CJxGDkBm.js";import{g as c}from"./NDFzzX6j.js";import{p as g}from"./B0rlWqYd.js";import{d as I}from"./B0Z-1lwJ.js";import{dP as f}from"./D9Ykl3eH.js";import{Cl as u,m as y,Jq as o,h6 as A,vF as m,vG as N,vI as b}from"./CpP1PKzF.js";import{g as W,n as h}from"./ByoP16rr.js";import{S as D,a as R,n as E}from"./BHINa8Ry.js";import{n as O,o as v}from"./1cfvZqIL.js";const P="intent:onboarding-skip:v1";function k(e){return u.getItem(h(P,e))==="1"}function re(e){k(e)||u.setItem(h(P,e),"1")}function _(e){return e.connections?.hasReceivedList===!0&&k(W(e))}function F(e,a){return e.some(t=>t.id!==y&&t.id!==a&&t.status!=="Archived"&&t.status!=="Deleted")}function j(e,a,t=!1){return t||F(e,a)?"/":"/workspace/new"}function d(e,a){return j(f.select(e),a,_(e))}const se=Object.freeze(Object.defineProperty({__proto__:null,resolveWindowEmptyDestination:d},Symbol.toStringTag,{value:"Module"})),r=new S("WorkspaceNavigation");async function L(e){r.info(`[navigateToAgent] Navigating to agent: ${e}`);const t=l(g).params.id;if(!t){r.error("[navigateToAgent] No workspace ID found in current page params");return}const n=new URL(window.location.href);n.searchParams.set("drawerOpen","1"),n.searchParams.set("drawerType","agent"),n.searchParams.set("selectedAgent",e),n.searchParams.delete("selectedTerminal"),await c(n.toString(),{replaceState:!0}),o.dispatch(m(t,"agent",e))}async function C(e){r.info(`[navigateToTerminal] Navigating to terminal: ${e}`);const t=l(g).params.id;if(!t){r.error("[navigateToTerminal] No workspace ID found in current page params");return}const n=new URL(window.location.href),i=n.searchParams.get("drawerOpen")==="1",s=n.searchParams.get("drawerType")==="terminal";(!i||!s)&&n.searchParams.set("drawerOpen","1"),n.searchParams.set("drawerType","terminal"),n.searchParams.set("selectedTerminal",e),n.searchParams.delete("selectedAgent"),await c(n.toString(),{replaceState:!0}),o.dispatch(m(t,"terminal",e))}function $(e){return!e||!(e instanceof Element)?void 0:e.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0}async function p(e,a){r.info(`[navigateToNote] Navigating to note: ${e}`,a);const t=l(g),n=a?.workspaceId??t.params.id;if(!n){r.error("[navigateToNote] No workspace ID found in current page params");return}o.dispatch(b(n,e,{openInAdjacentPanel:a?.openInAdjacentPanel??!1,openInNewAdjacentPanel:a?.openInNewAdjacentPanel??!1,sourcePanelId:a?.sourcePanelId}))}async function U(e,a,t){r.info(`[navigateToFile] Navigating to file: ${e}${a?` (line ${a})`:""}`,t);const i=l(g).params.id;if(!i){r.error("[navigateToFile] No workspace ID found in current page params");return}o.dispatch(N(i,e,{line:a,openInAdjacentPanel:t?.openInAdjacentPanel??!1,sourcePanelId:t?.sourcePanelId}))}async function M(){r.info("[navigateToSpec] Navigating to workspace spec"),await p("spec")}async function B(){r.info("[closeDrawer] Closing drawer");const a=l(g).params.id;if(!a){r.error("[closeDrawer] No workspace ID found in current page params");return}const t=new URL(window.location.href);t.searchParams.set("drawerOpen","0"),t.searchParams.delete("selectedAgent"),t.searchParams.delete("selectedTerminal"),await c(t.toString(),{replaceState:!0}),o.dispatch(A(a))}async function K(){r.info("[clearMainContent] Clearing main content");const e=new URL(window.location.href);e.searchParams.set("mainContentType","empty"),e.searchParams.delete("selectedNoteId"),e.searchParams.delete("selectedFile"),e.searchParams.delete("line"),await c(e.toString(),{replaceState:!1})}async function G(e,a,t){r.info("[navigateToTask] Navigating to task",{noteId:e,taskPosition:a,taskText:t}),await p(e);const n=()=>{I("scroll-to-task",{noteId:e,taskPosition:a,taskText:t},{bubbles:!0}),r.debug("[navigateToTask] Dispatched scroll-to-task event",{noteId:e,taskPosition:a})},i=[100,300,600];for(const s of i)setTimeout(n,s)}async function H(e){r.info("[navigateToSettings] Navigating to settings",e);const a=new URL("/settings",window.location.origin),t=window.location.pathname.match(/^\/workspace\/([^/]+)/)?.[1],n=t==="new"?void 0:t,i=e?.workspaceId??n;if(e?.tab&&a.searchParams.set("tab",e.tab),e?.specialist&&a.searchParams.set("specialist",e.specialist),e?.view&&a.searchParams.set("view",e.view),i&&a.searchParams.set("workspaceId",i),e?.hash&&(a.hash=e.hash),typeof window<"u"&&window.location.pathname==="/settings"){if(e?.tab||e?.specialist||e?.view||e?.workspaceId){const s=new URL(window.location.href);e?.tab&&s.searchParams.set("tab",e.tab),e?.specialist&&s.searchParams.set("specialist",e.specialist),e?.view&&s.searchParams.set("view",e.view),e?.workspaceId&&s.searchParams.set("workspaceId",e.workspaceId),e?.hash&&(s.hash=e.hash),await c(s.toString(),{replaceState:!0});return}if(e?.hash){const s=`#${e.hash}`;window.location.hash===s&&(window.location.hash=""),window.location.hash=s;return}return}await E(a.pathname+a.search+a.hash)}function T(){const e=typeof sessionStorage>"u"?null:sessionStorage.getItem(D);if(e&&e!=="/"&&!R(e))return e;const a=w();return a?`/workspace/${a.id}`:d(o.state)}async function z(){const e=T();r.info("[navigateBackFromSettings] Navigating back to:",e),await O(e)}function w(e){return f.select(o.state).find(a=>a.id!==e&&a.status!=="Archived"&&a.status!=="Deleted")}async function Y(){const e=w();if(e){r.info("[navigateToFirstWorkspace] Showing workspace:",e.id),await v(e.id);return}const a=d(o.state);r.info("[navigateToFirstWorkspace] Navigating to:",a),await c(a)}async function q(e){const a=w(e);if(a){r.info("[navigateAfterWorkspaceRemoval] Showing workspace:",a.id),await v(a.id);return}const t=d(o.state,e);r.info("[navigateAfterWorkspaceRemoval] Navigating to:",t),await c(t)}const ie=Object.freeze(Object.defineProperty({__proto__:null,clearMainContent:K,closeDrawer:B,findSourcePanelId:$,getSettingsPreviousPath:T,navigateAfterWorkspaceRemoval:q,navigateBackFromSettings:z,navigateToAgent:L,navigateToFile:U,navigateToFirstWorkspace:Y,navigateToNote:p,navigateToSettings:H,navigateToSpec:M,navigateToTask:G,navigateToTerminal:C},Symbol.toStringTag,{value:"Module"}));export{U as a,Y as b,p as c,H as d,G as e,$ as f,d as g,ie as h,_ as i,z as n,re as r,se as w};
@@ -1 +1 @@
1
- import{i as r}from"./CL3a4Hm1.js";import{w as a,I as e}from"./Bqd7fdCF.js";import{Jq as s}from"./CpP1PKzF.js";import{c as t}from"./DTl-epgW.js";function C(o,i){return t(s,o,{navigate:i,...a("windowChrome")?{closeWindow:()=>r(e.WINDOW.CLOSE)}:{}})}export{C as closeActiveTab};
1
+ import{i as r}from"./CL3a4Hm1.js";import{w as a,I as e}from"./Bqd7fdCF.js";import{Jq as s}from"./CpP1PKzF.js";import{c as t}from"./BO2BotXa.js";function C(o,i){return t(s,o,{navigate:i,...a("windowChrome")?{closeWindow:()=>r(e.WINDOW.CLOSE)}:{}})}export{C as closeActiveTab};
@@ -1 +1 @@
1
- import{d as p}from"./BxKppgO5.js";import{A as s,z as l}from"./DlekFIEJ.js";import{selectScriptOutput as o,selectScriptById as f,selectCanReadScriptDefinition as m}from"./uMNoDmQ2.js";async function a(i,t,e,r=100){const n=s(o.select(i,t,e)).slice(-r);if(!t||!e)return n;const u=f.select(i,t,e);if(!m.select(i,t,u))return[];try{const c=l(await p.scripts.output(t,e,r));return c.length>0?c.slice(-r):n}catch{return n}}export{a as readScriptContextOutputLines};
1
+ import{d as p}from"./BxKppgO5.js";import{A as s,z as l}from"./CbbK8WaD.js";import{selectScriptOutput as o,selectScriptById as f,selectCanReadScriptDefinition as m}from"./8kN6wMYA.js";async function a(i,t,e,r=100){const n=s(o.select(i,t,e)).slice(-r);if(!t||!e)return n;const u=f.select(i,t,e);if(!m.select(i,t,u))return[];try{const c=l(await p.scripts.output(t,e,r));return c.length>0?c.slice(-r):n}catch{return n}}export{a as readScriptContextOutputLines};
@@ -1,12 +1,12 @@
1
- var ut=e=>{throw TypeError(e)};var rn=(e,t,n)=>t.has(e)||ut("Cannot "+n);var k=(e,t,n)=>(rn(e,t,"read from private field"),n?n.call(e):t.get(e)),x=(e,t,n)=>t.has(e)?ut("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n);import{ao as R,cd as We,bk as dt,bV as U,aD as N,bH as C,c0 as Se,bX as on,bP as an,c5 as sn}from"./CJxGDkBm.js";const Pt=!0;class Xe{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Ze{constructor(t,n){try{new Headers({location:n})}catch{throw new Error(`Invalid redirect location ${JSON.stringify(n)}: this string contains characters that cannot be used in HTTP headers`)}this.status=t,this.location=n}}class Ee extends Error{constructor(t,n,o){super(o),this.status=t,this.text=n}}new URL("sveltekit-internal://");function cn(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function ln(e){return e.split("%25").map(decodeURI).join("%25")}function fn(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function Ve({href:e}){return e.split("#")[0]}function q(){}function un(...e){let t=5381;for(const n of e)if(typeof n=="string"){let o=n.length;for(;o;)t=t*33^n.charCodeAt(--o)}else if(ArrayBuffer.isView(n)){const o=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let r=o.length;for(;r;)t=t*33^o[--r]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;function dn(e){const t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}let hn=0;const ht=window.fetch;if(R&&Pt){let e=!1;(async()=>{e=new Error().stack.includes("check_stack_trace")})(),window.fetch=(n,o)=>{const r=n instanceof Request?n.url:n.toString(),i=new Error().stack.split(`
1
+ var ut=e=>{throw TypeError(e)};var rn=(e,t,n)=>t.has(e)||ut("Cannot "+n);var k=(e,t,n)=>(rn(e,t,"read from private field"),n?n.call(e):t.get(e)),j=(e,t,n)=>t.has(e)?ut("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n);import{ao as R,cd as We,bk as dt,bV as U,aD as N,bH as C,c0 as Se,bX as on,bP as an,c5 as sn}from"./CJxGDkBm.js";const Lt=!0;class Xe{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Ze{constructor(t,n){try{new Headers({location:n})}catch{throw new Error(`Invalid redirect location ${JSON.stringify(n)}: this string contains characters that cannot be used in HTTP headers`)}this.status=t,this.location=n}}class Ee extends Error{constructor(t,n,o){super(o),this.status=t,this.text=n}}new URL("sveltekit-internal://");function cn(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function ln(e){return e.split("%25").map(decodeURI).join("%25")}function fn(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function Ve({href:e}){return e.split("#")[0]}function q(){}function un(...e){let t=5381;for(const n of e)if(typeof n=="string"){let o=n.length;for(;o;)t=t*33^n.charCodeAt(--o)}else if(ArrayBuffer.isView(n)){const o=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let r=o.length;for(;r;)t=t*33^o[--r]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;function dn(e){const t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}let hn=0;const ht=window.fetch;if(R&&Lt){let e=!1;(async()=>{e=new Error().stack.includes("check_stack_trace")})(),window.fetch=(n,o)=>{const r=n instanceof Request?n.url:n.toString(),i=new Error().stack.split(`
2
2
  `),a=i.findIndex(g=>g.includes("load@")||g.includes("at load")),s=i.slice(0,a+2).join(`
3
- `),c=e?s.includes("src/runtime/client/client.js"):hn,f=o?.__sveltekit_fetch__;return c&&!f&&console.warn(`Loading ${r} using \`window.fetch\`. For best results, use the \`fetch\` that is passed to your \`load\` function: https://svelte.dev/docs/kit/load#making-fetch-requests`),(n instanceof Request?n.method:o?.method||"GET")!=="GET"&&Q.delete(Oe(n)),ht(n,o)}}else window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&Q.delete(Oe(e)),ht(e,t));const Q=new Map;function pn(e,t){const n=Oe(e,t),o=document.querySelector(n);if(o?.textContent){o.remove();let{body:r,...i}=JSON.parse(o.textContent);o.getAttribute("data-b64")!==null&&(r=dn(r));const s=o.getAttribute("data-ttl");return s&&Q.set(n,{body:r,init:i,ttl:1e3*Number(s)}),Promise.resolve(new Response(r,i))}return R?jt(e,t):window.fetch(e,t)}function gn(e,t,n){if(Q.size>0){const o=Oe(e,n),r=Q.get(o);if(r){if(performance.now()<r.ttl&&["default","force-cache","only-if-cached",void 0].includes(n?.cache))return new Response(r.body,r.init);Q.delete(o)}}return R?jt(t,n):window.fetch(t,n)}function jt(e,t){const n={...t};return Object.defineProperty(n,"__sveltekit_fetch__",{value:!0,writable:!0,configurable:!0}),window.fetch(e,n)}function Oe(e,t){let o=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){const r=[];t.headers&&r.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&r.push(t.body),o+=`[data-hash="${un(...r)}"]`}return o}const _n=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/,yn=/^\/\((?:[^)]+)\)$/;function mn(e){const t=[];return{pattern:e==="/"||yn.test(e)?/^\/$/:new RegExp(`^${vn(e).map(o=>{const r=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(o);if(r)return t.push({name:r[1],matcher:r[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const i=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(o);if(i)return t.push({name:i[1],matcher:i[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!o)return;const a=o.split(/\[(.+?)\](?!\])/);return"/"+a.map((c,f)=>{if(f%2){if(c.startsWith("x+"))return qe(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return qe(String.fromCharCode(...c.slice(2).split("-").map(m=>parseInt(m,16))));const u=_n.exec(c),[,g,d,h,p]=u;return t.push({name:h,matcher:p,optional:!!g,rest:!!d,chained:d?f===1&&a[0]==="":!1}),d?"([^]*?)":g?"([^/]*)?":"([^/]+?)"}return qe(c)}).join("")}).join("")}/?$`),params:t}}function wn(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function vn(e){return e.slice(1).split("/").filter(wn)}function bn(e,t,n){const o={},r=e.slice(1),i=r.filter(s=>s!==void 0);let a=0;for(let s=0;s<t.length;s+=1){const c=t[s];let f=r[s-a];if(c.chained&&c.rest&&a&&(f=r.slice(s-a,s+1).filter(u=>u).join("/"),a=0),f===void 0)if(c.rest)f="";else continue;if(!c.matcher||n[c.matcher](f)){o[c.name]=f;const u=t[s+1],g=r[s+1];u&&!u.rest&&u.optional&&g&&c.chained&&(a=0),!u&&!g&&Object.keys(o).length===i.length&&(a=0);continue}if(c.optional&&c.chained){a++;continue}return}if(!a)return o}function qe(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function kn({nodes:e,server_loads:t,dictionary:n,matchers:o}){const r=new Set(t);return Object.entries(n).map(([s,[c,f,u]])=>{const{pattern:g,params:d}=mn(s),h={id:s,exec:p=>{const m=g.exec(p);if(m)return bn(m,d,o)},errors:[1,...u||[]].map(p=>e[p]),layouts:[0,...f||[]].map(a),leaf:i(c)};return h.errors.length=h.layouts.length=Math.max(h.errors.length,h.layouts.length),h});function i(s){const c=s<0;return c&&(s=~s),[c,e[s]]}function a(s){return s===void 0?s:[r.has(s),e[s]]}}function It(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function pt(e,t,n=JSON.stringify){const o=n(t);try{sessionStorage[e]=o}catch{}}const j=globalThis.__sveltekit_1j6w0mw?.base??"",Sn=globalThis.__sveltekit_1j6w0mw?.assets??j??"",En="1795366514400",xt="sveltekit:snapshot",Ut="sveltekit:scroll",Qe="sveltekit:states",Nt="sveltekit:pageurl",G="sveltekit:history",ne="sveltekit:navigation",Y={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},xe=location.origin;function Ue(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function J(){return{x:pageXOffset,y:pageYOffset}}const gt=new WeakSet,_t={"preload-code":["","off","false","tap","hover","viewport","eager"],"preload-data":["","off","false","tap","hover"],keepfocus:["","true","off","false"],noscroll:["","true","off","false"],reload:["","true","off","false"],replacestate:["","true","off","false"]};function X(e,t){const n=e.getAttribute(`data-sveltekit-${t}`);return R&&On(e,t,n),n}function On(e,t,n){n!==null&&!gt.has(e)&&!_t[t].includes(n)&&(console.error(`Unexpected value for ${t} — should be one of ${_t[t].map(o=>JSON.stringify(o)).join(", ")}`,e),gt.add(e))}const yt={...Y,"":Y.hover};function Ct(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function Dt(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=Ct(e)}}function He(e,t,n){let o;try{if(o=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&o.hash.match(/^#[^/]/)){const s=location.hash.split("#")[1]||"/";o.hash=`#${s}${o.hash}`}}catch{}const r=e instanceof SVGAElement?e.target.baseVal:e.target,i=!o||!!r||Ne(o,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),a=o?.origin===xe&&e.hasAttribute("download");return{url:o,external:i,target:r,download:a}}function $e(e){let t=null,n=null,o=null,r=null,i=null,a=null,s=e;for(;s&&s!==document.documentElement;)o===null&&(o=X(s,"preload-code")),r===null&&(r=X(s,"preload-data")),t===null&&(t=X(s,"keepfocus")),n===null&&(n=X(s,"noscroll")),i===null&&(i=X(s,"reload")),a===null&&(a=X(s,"replacestate")),s=Ct(s);function c(f){switch(f){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:yt[o??"off"],preload_data:yt[r??"off"],keepfocus:c(t),noscroll:c(n),reload:c(i),replace_state:c(a)}}function mt(e){const t=We(e);let n=!0;function o(){n=!0,t.update(a=>a)}function r(a){n=!1,t.set(a)}function i(a){let s;return t.subscribe(c=>{(s===void 0||n&&c!==s)&&a(s=c)})}return{notify:o,set:r,subscribe:i}}const Bt={v:q};function $n(){const{set:e,subscribe:t}=We(!1);let n;async function o(){clearTimeout(n);try{const r=await fetch(`${Sn}/app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const a=(await r.json()).version!==En;return a&&(e(!0),Bt.v(),clearTimeout(n)),a}catch{return!1}}return{subscribe:t,check:o}}function Ne(e,t,n){return e.origin!==xe||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function Cr(e){}const Mt=-1,wt=-2,An=-3,Rn=-4,Tn=-5,Vt=-6,Ln=-7,Pn=2**32-1,jn=Pn-1;class H extends Error{constructor(t,n,o,r){super(t),this.name="DevalueError",this.path=n.join(""),this.value=o,this.root=r}}const In=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function xn(e){const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getPrototypeOf(t)===null||Object.getOwnPropertyNames(t).sort().join("\0")===In}function Un(e){return Object.prototype.toString.call(e).slice(8,-1)}function Nn(e){return typeof Buffer<"u"&&Buffer.isBuffer(e)}function Cn(e){switch(e){case'"':return'\\"';case"<":return"\\u003C";case"\\":return"\\\\";case`
4
- `:return"\\n";case"\r":return"\\r";case" ":return"\\t";case"\b":return"\\b";case"\f":return"\\f";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:return e<" "?`\\u${e.charCodeAt(0).toString(16).padStart(4,"0")}`:""}}function M(e){let t="",n=0;const o=e.length;for(let r=0;r<o;r+=1){const i=e[r],a=Cn(i);a&&(t+=e.slice(n,r)+a,n=r+1)}return`"${n===0?e:t+e.slice(n)}"`}function Dn(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)}const Bn=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function vt(e){return Bn.test(e)?"."+e:"["+JSON.stringify(e)+"]"}function Mn(e){return!(!Number.isInteger(e)||e<0||e>jn)}function Vn(e){if(e.length===0||e.length>1&&e.charCodeAt(0)===48)return!1;for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<48||n>57)return!1}return Mn(+e)}function qn(e){for(var t=e.length-1;t>=0&&!Vn(e[t]);t--);return t+1}function Fn(e){const t=Object.keys(e);return t.length=qn(t),t}function zn(e){return new Uint8Array(e).toBase64()}function Hn(e){return Buffer.from(e).toString("base64")}function Yn(e){const t=new Uint8Array(e);let n="";const o=32768;for(let r=0;r<t.length;r+=o){const i=t.subarray(r,r+o);n+=String.fromCharCode.apply(null,i)}return btoa(n)}const Gn=typeof Uint8Array.fromBase64=="function",Kn=typeof process=="object"&&process.versions?.node!==void 0,Jn=Gn?zn:Kn?Hn:Yn;function Wn(e,t){return e}const Xn=Object.freeze({kind:"not-plain"}),Zn=Object.freeze({kind:"symbol-keys"}),Qn={identify:e=>e,typeOf:e=>e===null?"null":typeof e,toPrimitive:e=>e,tagOf:e=>Un(e),isThenable:e=>typeof e.then=="function",toPromise:e=>Promise.resolve(e),unbox:e=>e.valueOf(),toISOString:e=>isNaN(e.getDate())?"":e.toISOString(),toStringValue:e=>e.toString(),regExpInfo:e=>({source:e.source,flags:e.flags}),valuesOf:e=>e,entriesOf:e=>e,viewInfo:e=>(Nn(e)&&(e=new Uint8Array(e)),{buffer:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength,length:e.length,bufferByteLength:e.buffer.byteLength}),toArrayBuffer:e=>e,lengthOf:e=>e.length,hasOwn:(e,t)=>Object.hasOwn(e,t),indicesOf:e=>Fn(e),shapeOf:e=>xn(e)?Dn(e).length>0?Zn:{kind:Object.getPrototypeOf(e)===null?"null-proto":"plain",keys:Object.keys(e)}:Xn,get:(e,t)=>e[t]},er=Object.freeze(Qn);Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get;typeof SharedArrayBuffer>"u"||Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype,"byteLength").get;function tr(e,t,n){const o=nr(!1,e);return typeof o=="string"?o:`[${o.join(",")}]`}function nr(e,t,n,o){const r=Wn(er),i=[],a=new Map,s=[],c=[];let f=0;function u(d,h){const p=r.typeOf(d);if(p==="undefined")return Mt;let m;if(p==="number"){if(m=r.toPrimitive(d),Number.isNaN(m))return An;if(m===1/0)return Rn;if(m===-1/0)return Tn;if(m===0&&1/m<0)return Vt}const _=r.identify(d);if(a.has(_))return a.get(_);h??=f++,a.set(_,h);for(const{key:b,fn:E}of s){const T=E(d);if(T)return i[h]=`["${b}",${u(T)}]`,h}if(p==="function")throw new H("Cannot stringify a function",c,d,t);if(p==="symbol")throw new H("Cannot stringify a Symbol primitive",c,d,t);let l="";if(p!=="object")l=bt(p==="number"?m:r.toPrimitive(d));else{if(r.isThenable(d))throw new H("Cannot stringify a Promise or thenable — use stringifyAsync instead",c,d,t);{const b=r.tagOf(d);switch(b){case"Number":case"String":case"Boolean":case"BigInt":l=`["Object",${u(r.unbox(d))}]`;break;case"Date":l=`["Date","${r.toISOString(d)}"]`;break;case"URL":l=`["URL",${M(r.toStringValue(d))}]`;break;case"URLSearchParams":l=`["URLSearchParams",${M(r.toStringValue(d))}]`;break;case"RegExp":const{source:E,flags:T}=r.regExpInfo(d);l=T?`["RegExp",${M(E)},"${T}"]`:`["RegExp",${M(E)}]`;break;case"Array":{let y=!1;const $=r.lengthOf(d);l="[";for(let w=0;w<$;w+=1)if(w>0&&(l+=","),r.hasOwn(d,w))c.push(`[${w}]`),l+=u(r.get(d,w)),c.pop();else if(y)l+=wt;else{const I=r.indicesOf(d),W=I.length,B=String($).length,re=($-W)*3,nn=4+B+W*(B+1);if(re>nn){l="["+Ln+","+$;for(let Be=0;Be<I.length;Be++){const Me=I[Be];c.push(`[${Me}]`),l+=","+Me+","+u(r.get(d,Me)),c.pop()}break}else y=!0,l+=wt}l+="]";break}case"Set":l='["Set"';for(const y of r.valuesOf(d))l+=`,${u(y)}`;l+="]";break;case"Map":l='["Map"';for(const[y,$]of r.entriesOf(d)){const w=r.typeOf(y),I=w!=="object"&&w!=="function"&&w!=="symbol";c.push(`.get(${I?bt(r.toPrimitive(y)):"..."})`),l+=`,${u(y)},${u($)}`,c.pop()}l+="]";break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Float16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":{const y=r.viewInfo(d);l='["'+b+'",'+u(y.buffer),y.byteLength!==y.bufferByteLength&&(l+=`,${y.byteOffset},${y.length}`),l+="]";break}case"DataView":{const y=r.viewInfo(d);l='["'+b+'",'+u(y.buffer),y.byteLength!==y.bufferByteLength&&(l+=`,${y.byteOffset},${y.byteLength}`),l+="]";break}case"ArrayBuffer":{l=`["ArrayBuffer","${Jn(r.toArrayBuffer(d))}"]`;break}case"Temporal.Duration":case"Temporal.Instant":case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.PlainMonthDay":case"Temporal.PlainYearMonth":case"Temporal.ZonedDateTime":l=`["${b}",${M(r.toStringValue(d))}]`;break;default:{const y=r.shapeOf(d);if(y.kind==="not-plain")throw new H("Cannot stringify arbitrary non-POJOs",c,d,t);if(y.kind==="symbol-keys")throw new H("Cannot stringify POJOs with symbolic keys",c,d,t);if(y.kind==="null-proto"){l='["null"';for(const $ of y.keys){if($==="__proto__")throw new H("Cannot stringify objects with __proto__ keys",c,d,t);c.push(vt($)),l+=`,${M($)},${u(r.get(d,$))}`,c.pop()}l+="]"}else{l="{";let $=!1;for(const w of y.keys){if(w==="__proto__")throw new H("Cannot stringify objects with __proto__ keys",c,d,t);$&&(l+=","),$=!0,c.push(vt(w)),l+=`${M(w)}:${u(r.get(d,w))}`,c.pop()}l+="}"}}}}}return i[h]=l,h}const g=u(t);return g<0?`${g}`:i}function bt(e){const t=typeof e;return t==="string"?M(e):e===void 0?Mt.toString():e===0&&1/e<0?Vt.toString():t==="bigint"?`["BigInt","${e}"]`:String(e)}function rr(e){function t(n,o){if(n)for(const r in n){if(r[0]==="_"||e.has(r))continue;const i=[...e.values()],a=or(r,o?.slice(o.lastIndexOf(".")))??`valid exports are ${i.join(", ")}, or anything with a '_' prefix`;throw new Error(`Invalid export '${r}'${o?` in ${o}`:""} (${a})`)}}return t}function or(e,t=".js"){const n=[];if(et.has(e)&&n.push(`+layout${t}`),qt.has(e)&&n.push(`+page${t}`),Ft.has(e)&&n.push(`+layout.server${t}`),ar.has(e)&&n.push(`+page.server${t}`),sr.has(e)&&n.push(`+server${t}`),n.length>0)return`'${e}' is a valid export in ${n.slice(0,-1).join(", ")}${n.length>1?" or ":""}${n.at(-1)}`}const et=new Set(["load","prerender","csr","ssr","trailingSlash","config"]),qt=new Set([...et,"entries"]),Ft=new Set([...et]),ar=new Set([...Ft,"actions","entries"]),sr=new Set(["GET","POST","PATCH","PUT","DELETE","OPTIONS","HEAD","fallback","prerender","trailingSlash","config","entries"]),ir=rr(qt);function cr(e){return e.filter(t=>t!=null)}function be(e,t){return e+"/"+t}function tt(e){return e instanceof Xe||e instanceof Ee?e.status:500}function lr(e){return e instanceof Ee?e.text:"Internal Error"}let A,se,Fe;const fr=dt.toString().includes("$$")||/function \w+\(\) \{\}/.test(dt.toString()),kt="a:";var ue,de,he,pe,ge,_e,ye,me,Rt,we,Tt,ve,Lt;fr?(A={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL(kt)},se={current:null},Fe={current:!1}):(A=new(Rt=class{constructor(){x(this,ue,U({}));x(this,de,U(null));x(this,he,U(null));x(this,pe,U({}));x(this,ge,U({id:null}));x(this,_e,U({}));x(this,ye,U(-1));x(this,me,U(new URL(kt)))}get data(){return N(k(this,ue))}set data(t){C(k(this,ue),t)}get form(){return N(k(this,de))}set form(t){C(k(this,de),t)}get error(){return N(k(this,he))}set error(t){C(k(this,he),t)}get params(){return N(k(this,pe))}set params(t){C(k(this,pe),t)}get route(){return N(k(this,ge))}set route(t){C(k(this,ge),t)}get state(){return N(k(this,_e))}set state(t){C(k(this,_e),t)}get status(){return N(k(this,ye))}set status(t){C(k(this,ye),t)}get url(){return N(k(this,me))}set url(t){C(k(this,me),t)}},ue=new WeakMap,de=new WeakMap,he=new WeakMap,pe=new WeakMap,ge=new WeakMap,_e=new WeakMap,ye=new WeakMap,me=new WeakMap,Rt),se=new(Tt=class{constructor(){x(this,we,U(null))}get current(){return N(k(this,we))}set current(t){C(k(this,we),t)}},we=new WeakMap,Tt),Fe=new(Lt=class{constructor(){x(this,ve,U(!1))}get current(){return N(k(this,ve))}set current(t){C(k(this,ve),t)}},ve=new WeakMap,Lt),Bt.v=()=>Fe.current=!0);function zt(e){Object.assign(A,e)}const{onMount:ur}=on,dr=sn??(e=>e()),hr=new Set(["icon","shortcut icon","apple-touch-icon"]);let oe=null;const z=It(Ut)??{},ie=It(xt)??{};if(R&&Pt){let e=!1;const t=()=>{if(e)return;let r=new Error().stack?.split(`
5
- `);!r||(!r[0].includes("https:")&&!r[0].includes("http:")&&(r=r.slice(1)),r[2]?.includes("node_modules"))||(e=!0,console.warn("Avoid using `history.pushState(...)` and `history.replaceState(...)` as these will conflict with SvelteKit's router. Use the `pushState` and `replaceState` imports from `$app/navigation` instead."))},n=history.pushState;history.pushState=(...r)=>(t(),n.apply(history,r));const o=history.replaceState;history.replaceState=(...r)=>(t(),o.apply(history,r))}const F={url:mt({}),page:mt({}),navigating:We(null),updated:$n()};function nt(e){z[e]=J()}function pr(e,t){let n=e+1;for(;z[n];)delete z[n],n+=1;for(n=t+1;ie[n];)delete ie[n],n+=1}function ce(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(q)}async function Ht(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(j||"/");e&&await e.update()}}let rt,Ye,Ae,D,Ge,S;const Re=[],Te=[];let P=null;function Le(){P?.fork?.then(e=>e?.discard()),P=null,Z={element:void 0,href:void 0}}const ke=new Map,ot=new Set,gr=new Set,ee=new Set;let v={branch:[],error:null,url:null},Yt=!1,le=!1,St=!0,fe=!1,ae=!1,Gt=!1,at=!1,st,O,L,V;const Pe=new Set,Et=new Map,Ot=new Map;async function Vr(e,t,n){if(R&&t===document.body&&console.warn(`Placing %sveltekit.body% directly inside <body> is not recommended, as your app may break for users who have certain browser extensions installed.
3
+ `),c=e?s.includes("src/runtime/client/client.js"):hn,f=o?.__sveltekit_fetch__;return c&&!f&&console.warn(`Loading ${r} using \`window.fetch\`. For best results, use the \`fetch\` that is passed to your \`load\` function: https://svelte.dev/docs/kit/load#making-fetch-requests`),(n instanceof Request?n.method:o?.method||"GET")!=="GET"&&Q.delete(Oe(n)),ht(n,o)}}else window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&Q.delete(Oe(e)),ht(e,t));const Q=new Map;function pn(e,t){const n=Oe(e,t),o=document.querySelector(n);if(o?.textContent){o.remove();let{body:r,...i}=JSON.parse(o.textContent);o.getAttribute("data-b64")!==null&&(r=dn(r));const s=o.getAttribute("data-ttl");return s&&Q.set(n,{body:r,init:i,ttl:1e3*Number(s)}),Promise.resolve(new Response(r,i))}return R?Pt(e,t):window.fetch(e,t)}function gn(e,t,n){if(Q.size>0){const o=Oe(e,n),r=Q.get(o);if(r){if(performance.now()<r.ttl&&["default","force-cache","only-if-cached",void 0].includes(n?.cache))return new Response(r.body,r.init);Q.delete(o)}}return R?Pt(t,n):window.fetch(t,n)}function Pt(e,t){const n={...t};return Object.defineProperty(n,"__sveltekit_fetch__",{value:!0,writable:!0,configurable:!0}),window.fetch(e,n)}function Oe(e,t){let o=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){const r=[];t.headers&&r.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&r.push(t.body),o+=`[data-hash="${un(...r)}"]`}return o}const _n=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/,yn=/^\/\((?:[^)]+)\)$/;function mn(e){const t=[];return{pattern:e==="/"||yn.test(e)?/^\/$/:new RegExp(`^${vn(e).map(o=>{const r=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(o);if(r)return t.push({name:r[1],matcher:r[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const i=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(o);if(i)return t.push({name:i[1],matcher:i[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!o)return;const a=o.split(/\[(.+?)\](?!\])/);return"/"+a.map((c,f)=>{if(f%2){if(c.startsWith("x+"))return qe(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return qe(String.fromCharCode(...c.slice(2).split("-").map(m=>parseInt(m,16))));const u=_n.exec(c),[,g,d,h,p]=u;return t.push({name:h,matcher:p,optional:!!g,rest:!!d,chained:d?f===1&&a[0]==="":!1}),d?"([^]*?)":g?"([^/]*)?":"([^/]+?)"}return qe(c)}).join("")}).join("")}/?$`),params:t}}function wn(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function vn(e){return e.slice(1).split("/").filter(wn)}function bn(e,t,n){const o={},r=e.slice(1),i=r.filter(s=>s!==void 0);let a=0;for(let s=0;s<t.length;s+=1){const c=t[s];let f=r[s-a];if(c.chained&&c.rest&&a&&(f=r.slice(s-a,s+1).filter(u=>u).join("/"),a=0),f===void 0)if(c.rest)f="";else continue;if(!c.matcher||n[c.matcher](f)){o[c.name]=f;const u=t[s+1],g=r[s+1];u&&!u.rest&&u.optional&&g&&c.chained&&(a=0),!u&&!g&&Object.keys(o).length===i.length&&(a=0);continue}if(c.optional&&c.chained){a++;continue}return}if(!a)return o}function qe(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function kn({nodes:e,server_loads:t,dictionary:n,matchers:o}){const r=new Set(t);return Object.entries(n).map(([s,[c,f,u]])=>{const{pattern:g,params:d}=mn(s),h={id:s,exec:p=>{const m=g.exec(p);if(m)return bn(m,d,o)},errors:[1,...u||[]].map(p=>e[p]),layouts:[0,...f||[]].map(a),leaf:i(c)};return h.errors.length=h.layouts.length=Math.max(h.errors.length,h.layouts.length),h});function i(s){const c=s<0;return c&&(s=~s),[c,e[s]]}function a(s){return s===void 0?s:[r.has(s),e[s]]}}function It(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function pt(e,t,n=JSON.stringify){const o=n(t);try{sessionStorage[e]=o}catch{}}const P=globalThis.__sveltekit_xwdzg0?.base??"",Sn=globalThis.__sveltekit_xwdzg0?.assets??P??"",En="1795381115176",jt="sveltekit:snapshot",Ut="sveltekit:scroll",Qe="sveltekit:states",Nt="sveltekit:pageurl",G="sveltekit:history",ne="sveltekit:navigation",Y={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},je=location.origin;function Ue(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function J(){return{x:pageXOffset,y:pageYOffset}}const gt=new WeakSet,_t={"preload-code":["","off","false","tap","hover","viewport","eager"],"preload-data":["","off","false","tap","hover"],keepfocus:["","true","off","false"],noscroll:["","true","off","false"],reload:["","true","off","false"],replacestate:["","true","off","false"]};function X(e,t){const n=e.getAttribute(`data-sveltekit-${t}`);return R&&On(e,t,n),n}function On(e,t,n){n!==null&&!gt.has(e)&&!_t[t].includes(n)&&(console.error(`Unexpected value for ${t} — should be one of ${_t[t].map(o=>JSON.stringify(o)).join(", ")}`,e),gt.add(e))}const yt={...Y,"":Y.hover};function Ct(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function Dt(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=Ct(e)}}function He(e,t,n){let o;try{if(o=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&o.hash.match(/^#[^/]/)){const s=location.hash.split("#")[1]||"/";o.hash=`#${s}${o.hash}`}}catch{}const r=e instanceof SVGAElement?e.target.baseVal:e.target,i=!o||!!r||Ne(o,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),a=o?.origin===je&&e.hasAttribute("download");return{url:o,external:i,target:r,download:a}}function $e(e){let t=null,n=null,o=null,r=null,i=null,a=null,s=e;for(;s&&s!==document.documentElement;)o===null&&(o=X(s,"preload-code")),r===null&&(r=X(s,"preload-data")),t===null&&(t=X(s,"keepfocus")),n===null&&(n=X(s,"noscroll")),i===null&&(i=X(s,"reload")),a===null&&(a=X(s,"replacestate")),s=Ct(s);function c(f){switch(f){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:yt[o??"off"],preload_data:yt[r??"off"],keepfocus:c(t),noscroll:c(n),reload:c(i),replace_state:c(a)}}function mt(e){const t=We(e);let n=!0;function o(){n=!0,t.update(a=>a)}function r(a){n=!1,t.set(a)}function i(a){let s;return t.subscribe(c=>{(s===void 0||n&&c!==s)&&a(s=c)})}return{notify:o,set:r,subscribe:i}}const Bt={v:q};function $n(){const{set:e,subscribe:t}=We(!1);let n;async function o(){clearTimeout(n);try{const r=await fetch(`${Sn}/app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const a=(await r.json()).version!==En;return a&&(e(!0),Bt.v(),clearTimeout(n)),a}catch{return!1}}return{subscribe:t,check:o}}function Ne(e,t,n){return e.origin!==je||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function Cr(e){}const Mt=-1,wt=-2,An=-3,Rn=-4,Tn=-5,Vt=-6,xn=-7,Ln=2**32-1,Pn=Ln-1;class H extends Error{constructor(t,n,o,r){super(t),this.name="DevalueError",this.path=n.join(""),this.value=o,this.root=r}}const In=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function jn(e){const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getPrototypeOf(t)===null||Object.getOwnPropertyNames(t).sort().join("\0")===In}function Un(e){return Object.prototype.toString.call(e).slice(8,-1)}function Nn(e){return typeof Buffer<"u"&&Buffer.isBuffer(e)}function Cn(e){switch(e){case'"':return'\\"';case"<":return"\\u003C";case"\\":return"\\\\";case`
4
+ `:return"\\n";case"\r":return"\\r";case" ":return"\\t";case"\b":return"\\b";case"\f":return"\\f";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:return e<" "?`\\u${e.charCodeAt(0).toString(16).padStart(4,"0")}`:""}}function M(e){let t="",n=0;const o=e.length;for(let r=0;r<o;r+=1){const i=e[r],a=Cn(i);a&&(t+=e.slice(n,r)+a,n=r+1)}return`"${n===0?e:t+e.slice(n)}"`}function Dn(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)}const Bn=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function vt(e){return Bn.test(e)?"."+e:"["+JSON.stringify(e)+"]"}function Mn(e){return!(!Number.isInteger(e)||e<0||e>Pn)}function Vn(e){if(e.length===0||e.length>1&&e.charCodeAt(0)===48)return!1;for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<48||n>57)return!1}return Mn(+e)}function qn(e){for(var t=e.length-1;t>=0&&!Vn(e[t]);t--);return t+1}function zn(e){const t=Object.keys(e);return t.length=qn(t),t}function Fn(e){return new Uint8Array(e).toBase64()}function Hn(e){return Buffer.from(e).toString("base64")}function Yn(e){const t=new Uint8Array(e);let n="";const o=32768;for(let r=0;r<t.length;r+=o){const i=t.subarray(r,r+o);n+=String.fromCharCode.apply(null,i)}return btoa(n)}const Gn=typeof Uint8Array.fromBase64=="function",Kn=typeof process=="object"&&process.versions?.node!==void 0,Jn=Gn?Fn:Kn?Hn:Yn;function Wn(e,t){return e}const Xn=Object.freeze({kind:"not-plain"}),Zn=Object.freeze({kind:"symbol-keys"}),Qn={identify:e=>e,typeOf:e=>e===null?"null":typeof e,toPrimitive:e=>e,tagOf:e=>Un(e),isThenable:e=>typeof e.then=="function",toPromise:e=>Promise.resolve(e),unbox:e=>e.valueOf(),toISOString:e=>isNaN(e.getDate())?"":e.toISOString(),toStringValue:e=>e.toString(),regExpInfo:e=>({source:e.source,flags:e.flags}),valuesOf:e=>e,entriesOf:e=>e,viewInfo:e=>(Nn(e)&&(e=new Uint8Array(e)),{buffer:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength,length:e.length,bufferByteLength:e.buffer.byteLength}),toArrayBuffer:e=>e,lengthOf:e=>e.length,hasOwn:(e,t)=>Object.hasOwn(e,t),indicesOf:e=>zn(e),shapeOf:e=>jn(e)?Dn(e).length>0?Zn:{kind:Object.getPrototypeOf(e)===null?"null-proto":"plain",keys:Object.keys(e)}:Xn,get:(e,t)=>e[t]},er=Object.freeze(Qn);Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get;typeof SharedArrayBuffer>"u"||Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype,"byteLength").get;function tr(e,t,n){const o=nr(!1,e);return typeof o=="string"?o:`[${o.join(",")}]`}function nr(e,t,n,o){const r=Wn(er),i=[],a=new Map,s=[],c=[];let f=0;function u(d,h){const p=r.typeOf(d);if(p==="undefined")return Mt;let m;if(p==="number"){if(m=r.toPrimitive(d),Number.isNaN(m))return An;if(m===1/0)return Rn;if(m===-1/0)return Tn;if(m===0&&1/m<0)return Vt}const _=r.identify(d);if(a.has(_))return a.get(_);h??=f++,a.set(_,h);for(const{key:b,fn:E}of s){const T=E(d);if(T)return i[h]=`["${b}",${u(T)}]`,h}if(p==="function")throw new H("Cannot stringify a function",c,d,t);if(p==="symbol")throw new H("Cannot stringify a Symbol primitive",c,d,t);let l="";if(p!=="object")l=bt(p==="number"?m:r.toPrimitive(d));else{if(r.isThenable(d))throw new H("Cannot stringify a Promise or thenable — use stringifyAsync instead",c,d,t);{const b=r.tagOf(d);switch(b){case"Number":case"String":case"Boolean":case"BigInt":l=`["Object",${u(r.unbox(d))}]`;break;case"Date":l=`["Date","${r.toISOString(d)}"]`;break;case"URL":l=`["URL",${M(r.toStringValue(d))}]`;break;case"URLSearchParams":l=`["URLSearchParams",${M(r.toStringValue(d))}]`;break;case"RegExp":const{source:E,flags:T}=r.regExpInfo(d);l=T?`["RegExp",${M(E)},"${T}"]`:`["RegExp",${M(E)}]`;break;case"Array":{let y=!1;const $=r.lengthOf(d);l="[";for(let w=0;w<$;w+=1)if(w>0&&(l+=","),r.hasOwn(d,w))c.push(`[${w}]`),l+=u(r.get(d,w)),c.pop();else if(y)l+=wt;else{const I=r.indicesOf(d),W=I.length,B=String($).length,re=($-W)*3,nn=4+B+W*(B+1);if(re>nn){l="["+xn+","+$;for(let Be=0;Be<I.length;Be++){const Me=I[Be];c.push(`[${Me}]`),l+=","+Me+","+u(r.get(d,Me)),c.pop()}break}else y=!0,l+=wt}l+="]";break}case"Set":l='["Set"';for(const y of r.valuesOf(d))l+=`,${u(y)}`;l+="]";break;case"Map":l='["Map"';for(const[y,$]of r.entriesOf(d)){const w=r.typeOf(y),I=w!=="object"&&w!=="function"&&w!=="symbol";c.push(`.get(${I?bt(r.toPrimitive(y)):"..."})`),l+=`,${u(y)},${u($)}`,c.pop()}l+="]";break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Float16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":{const y=r.viewInfo(d);l='["'+b+'",'+u(y.buffer),y.byteLength!==y.bufferByteLength&&(l+=`,${y.byteOffset},${y.length}`),l+="]";break}case"DataView":{const y=r.viewInfo(d);l='["'+b+'",'+u(y.buffer),y.byteLength!==y.bufferByteLength&&(l+=`,${y.byteOffset},${y.byteLength}`),l+="]";break}case"ArrayBuffer":{l=`["ArrayBuffer","${Jn(r.toArrayBuffer(d))}"]`;break}case"Temporal.Duration":case"Temporal.Instant":case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.PlainMonthDay":case"Temporal.PlainYearMonth":case"Temporal.ZonedDateTime":l=`["${b}",${M(r.toStringValue(d))}]`;break;default:{const y=r.shapeOf(d);if(y.kind==="not-plain")throw new H("Cannot stringify arbitrary non-POJOs",c,d,t);if(y.kind==="symbol-keys")throw new H("Cannot stringify POJOs with symbolic keys",c,d,t);if(y.kind==="null-proto"){l='["null"';for(const $ of y.keys){if($==="__proto__")throw new H("Cannot stringify objects with __proto__ keys",c,d,t);c.push(vt($)),l+=`,${M($)},${u(r.get(d,$))}`,c.pop()}l+="]"}else{l="{";let $=!1;for(const w of y.keys){if(w==="__proto__")throw new H("Cannot stringify objects with __proto__ keys",c,d,t);$&&(l+=","),$=!0,c.push(vt(w)),l+=`${M(w)}:${u(r.get(d,w))}`,c.pop()}l+="}"}}}}}return i[h]=l,h}const g=u(t);return g<0?`${g}`:i}function bt(e){const t=typeof e;return t==="string"?M(e):e===void 0?Mt.toString():e===0&&1/e<0?Vt.toString():t==="bigint"?`["BigInt","${e}"]`:String(e)}function rr(e){function t(n,o){if(n)for(const r in n){if(r[0]==="_"||e.has(r))continue;const i=[...e.values()],a=or(r,o?.slice(o.lastIndexOf(".")))??`valid exports are ${i.join(", ")}, or anything with a '_' prefix`;throw new Error(`Invalid export '${r}'${o?` in ${o}`:""} (${a})`)}}return t}function or(e,t=".js"){const n=[];if(et.has(e)&&n.push(`+layout${t}`),qt.has(e)&&n.push(`+page${t}`),zt.has(e)&&n.push(`+layout.server${t}`),ar.has(e)&&n.push(`+page.server${t}`),sr.has(e)&&n.push(`+server${t}`),n.length>0)return`'${e}' is a valid export in ${n.slice(0,-1).join(", ")}${n.length>1?" or ":""}${n.at(-1)}`}const et=new Set(["load","prerender","csr","ssr","trailingSlash","config"]),qt=new Set([...et,"entries"]),zt=new Set([...et]),ar=new Set([...zt,"actions","entries"]),sr=new Set(["GET","POST","PATCH","PUT","DELETE","OPTIONS","HEAD","fallback","prerender","trailingSlash","config","entries"]),ir=rr(qt);function cr(e){return e.filter(t=>t!=null)}function be(e,t){return e+"/"+t}function tt(e){return e instanceof Xe||e instanceof Ee?e.status:500}function lr(e){return e instanceof Ee?e.text:"Internal Error"}let A,se,ze;const fr=dt.toString().includes("$$")||/function \w+\(\) \{\}/.test(dt.toString()),kt="a:";var ue,de,he,pe,ge,_e,ye,me,Rt,we,Tt,ve,xt;fr?(A={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL(kt)},se={current:null},ze={current:!1}):(A=new(Rt=class{constructor(){j(this,ue,U({}));j(this,de,U(null));j(this,he,U(null));j(this,pe,U({}));j(this,ge,U({id:null}));j(this,_e,U({}));j(this,ye,U(-1));j(this,me,U(new URL(kt)))}get data(){return N(k(this,ue))}set data(t){C(k(this,ue),t)}get form(){return N(k(this,de))}set form(t){C(k(this,de),t)}get error(){return N(k(this,he))}set error(t){C(k(this,he),t)}get params(){return N(k(this,pe))}set params(t){C(k(this,pe),t)}get route(){return N(k(this,ge))}set route(t){C(k(this,ge),t)}get state(){return N(k(this,_e))}set state(t){C(k(this,_e),t)}get status(){return N(k(this,ye))}set status(t){C(k(this,ye),t)}get url(){return N(k(this,me))}set url(t){C(k(this,me),t)}},ue=new WeakMap,de=new WeakMap,he=new WeakMap,pe=new WeakMap,ge=new WeakMap,_e=new WeakMap,ye=new WeakMap,me=new WeakMap,Rt),se=new(Tt=class{constructor(){j(this,we,U(null))}get current(){return N(k(this,we))}set current(t){C(k(this,we),t)}},we=new WeakMap,Tt),ze=new(xt=class{constructor(){j(this,ve,U(!1))}get current(){return N(k(this,ve))}set current(t){C(k(this,ve),t)}},ve=new WeakMap,xt),Bt.v=()=>ze.current=!0);function Ft(e){Object.assign(A,e)}const{onMount:ur}=on,dr=sn??(e=>e()),hr=new Set(["icon","shortcut icon","apple-touch-icon"]);let oe=null;const F=It(Ut)??{},ie=It(jt)??{};if(R&&Lt){let e=!1;const t=()=>{if(e)return;let r=new Error().stack?.split(`
5
+ `);!r||(!r[0].includes("https:")&&!r[0].includes("http:")&&(r=r.slice(1)),r[2]?.includes("node_modules"))||(e=!0,console.warn("Avoid using `history.pushState(...)` and `history.replaceState(...)` as these will conflict with SvelteKit's router. Use the `pushState` and `replaceState` imports from `$app/navigation` instead."))},n=history.pushState;history.pushState=(...r)=>(t(),n.apply(history,r));const o=history.replaceState;history.replaceState=(...r)=>(t(),o.apply(history,r))}const z={url:mt({}),page:mt({}),navigating:We(null),updated:$n()};function nt(e){F[e]=J()}function pr(e,t){let n=e+1;for(;F[n];)delete F[n],n+=1;for(n=t+1;ie[n];)delete ie[n],n+=1}function ce(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(q)}async function Ht(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(P||"/");e&&await e.update()}}let rt,Ye,Ae,D,Ge,S;const Re=[],Te=[];let L=null;function xe(){L?.fork?.then(e=>e?.discard()),L=null,Z={element:void 0,href:void 0}}const ke=new Map,ot=new Set,gr=new Set,ee=new Set;let v={branch:[],error:null,url:null},Yt=!1,le=!1,St=!0,fe=!1,ae=!1,Gt=!1,at=!1,st,O,x,V;const Le=new Set,Et=new Map,Ot=new Map;async function Vr(e,t,n){if(R&&t===document.body&&console.warn(`Placing %sveltekit.body% directly inside <body> is not recommended, as your app may break for users who have certain browser extensions installed.
6
6
 
7
7
  Consider wrapping it in an element:
8
8
 
9
9
  <div style="display: contents">
10
10
  %sveltekit.body%
11
- </div>`),globalThis.__sveltekit_1j6w0mw.data){const{q:i={},p:a={},l:s={},f:c={}}=globalThis.__sveltekit_1j6w0mw.data;for(const f in i)i[f];for(const f in s)s[f];for(const f in c)c[f];for(const f in a)a[f]}document.URL!==location.href&&(location.href=location.href),S=e,await e.hooks.init?.(),rt=kn(e),D=document.documentElement,Ge=t,Ye=e.nodes[0],Ae=e.nodes[1],Ye(),Ae(),O=history.state?.[G],L=history.state?.[ne],O||(O=L=Date.now(),history.replaceState({...history.state,[G]:O,[ne]:L},""));const o=z[O];function r(){o&&(history.scrollRestoration="manual",scrollTo(o.x,o.y))}n?(r(),await Pr(Ge,n)):(await te({type:"enter",url:Ue(S.hash?xr(new URL(location.href)):location.href),replace_state:!0}),r()),Lr()}function _r(){Re.length=0,at=!1}function Kt(e){Te.some(t=>t?.snapshot)&&(ie[e]=Te.map(t=>t?.snapshot?.capture()))}function Jt(e){ie[e]?.forEach((t,n)=>{Te[n]?.snapshot?.restore(t)})}function $t(){nt(O),pt(Ut,z),Kt(L),pt(xt,ie)}async function Wt(e,t,n,o){let r,i;t.invalidateAll&&Le(),await te({type:"goto",url:Ue(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:o,accept:()=>{if(t.invalidateAll){at=!0,r=new Set;for(const[a,s]of Et)for(const[c,f]of s)f.resource?.reset(),r.add(be(a,c));i=new Set;for(const[a,s]of Ot)for(const c of s.keys())i.add(be(a,c))}t.invalidate&&t.invalidate.forEach(Rr)}}),t.invalidateAll&&Se().then(Se).then(()=>{for(const[a,s]of Et)for(const[c,{resource:f}]of s)r?.has(be(a,c))&&f.start();for(const[a,s]of Ot)for(const[c,{resource:f}]of s)i?.has(be(a,c))&&f.reconnect()})}async function At(e){if(e.id!==P?.id){Le();const t={};Pe.add(t),P={id:e.id,token:t,promise:Zt({...e,preload:t}).then(n=>(Pe.delete(t),n.type==="loaded"&&n.state.error&&Le(),n)),fork:null}}return P.promise}async function ze(e){const t=(await Ce(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(n=>n[1]()))}async function Xt(e,t,n){const o={params:v.params,route:{id:v.route?.id??null},url:new URL(location.href)};if(v={...e.state,nav:o},zt(e.props.page),st=new S.root({target:t,props:{...e.props,stores:F,components:Te},hydrate:n,sync:!1,transformError:void 0}),await Promise.resolve(),n){const r={from:null,to:{...o,scroll:z[O]??J()},willUnload:!1,type:"enter",complete:Promise.resolve()};ee.forEach(i=>i(r))}Jt(L),le=!0}async function je({url:e,params:t,branch:n,errors:o,status:r,error:i,route:a,form:s}){let c="never";if(j&&(e.pathname===j||e.pathname===j+"/"))c="always";else for(const p of n)p?.slash!==void 0&&(c=p.slash);e.pathname=cn(e.pathname,c),e.search=e.search;const f={type:"loaded",state:{url:e,params:t,branch:n,error:i,route:a},props:{constructors:cr(n).map(p=>p.node.component),page:De(A)}};s!==void 0&&(f.props.form=s);let u={},g=!A,d=0;for(let p=0;p<Math.max(n.length,v.branch.length);p+=1){const m=n[p],_=v.branch[p];m?.data!==_?.data&&(g=!0),m&&(u={...u,...m.data},g&&(f.props[`data_${d}`]=u),d+=1)}return(!v.url||e.href!==v.url.href||v.error!==i||s!==void 0&&s!==A.form||g)&&(f.props.page={error:i,params:t,route:{id:a?.id??null},state:{},status:r,url:new URL(e),form:s??null,data:g?u:A.data}),f}async function it({loader:e,parent:t,url:n,params:o,route:r,server_data_node:i}){let a=null;const s={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},c=await e();if(R&&(ir(c.universal),c.universal&&S.hash)){const f=Object.keys(c.universal).filter(u=>u!=="load");if(f.length>0)throw new Error(`Page options are ignored when \`router.type === 'hash'\` (${r.id} has ${f.filter(u=>u!=="load").map(u=>`'${u}'`).join(", ")})`)}return{node:c,loader:e,server:i,universal:c.universal?.load?{type:"data",data:a,uses:s}:null,data:a??i?.data??null,slash:c.universal?.trailingSlash??i?.slash}}function yr(e,t,n){let o=e instanceof Request?e.url:e;const r=new URL(o,n);r.origin===n.origin&&(o=r.href.slice(n.origin.length));const i=le?gn(o,r.href,t):pn(o,t);return{resolved:r,promise:i}}function mr(e,t,n,o,r,i){if(at)return!0;if(!r)return!1;if(r.parent&&e||r.route&&t||r.url&&n)return!0;for(const a of r.search_params)if(o.has(a))return!0;for(const a of r.params)if(i[a]!==v.params[a])return!0;for(const a of r.dependencies)if(Re.some(s=>s(new URL(a))))return!0;return!1}function ct(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function wr(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const o of n){const r=e.searchParams.getAll(o),i=t.searchParams.getAll(o);r.every(a=>i.includes(a))&&i.every(a=>r.includes(a))&&n.delete(o)}return n}function vr({error:e,url:t,route:n,params:o}){return{type:"loaded",state:{error:e,url:t,route:n,params:o,branch:[]},props:{page:De(A),constructors:[]}}}async function Zt({id:e,invalidating:t,url:n,params:o,route:r,preload:i}){if(P?.id===e)return Pe.delete(P.token),P.promise;const{errors:a,layouts:s,leaf:c}=r,f=[...s,c];a.forEach(_=>_?.().catch(q)),f.forEach(_=>_?.[1]().catch(q));const u=v.url?e!==Ie(v.url):!1,g=v.route?r.id!==v.route.id:!1,d=wr(v.url,n);let h=!1;const p=f.map(async(_,l)=>{if(!_)return;const b=v.branch[l];return _[1]===b?.loader&&!mr(h,g,u,d,b.universal?.uses,o)?b:(h=!0,it({loader:_[1],url:n,params:o,route:r,parent:async()=>{const T={};for(let y=0;y<l;y+=1)Object.assign(T,(await p[y])?.data);return T},server_data_node:ct(_[0]?{type:"skip"}:null,_[0]?b?.server:void 0)}))});for(const _ of p)_.catch(q);const m=[];for(let _=0;_<f.length;_+=1)if(f[_])try{m.push(await p[_])}catch(l){if(l instanceof Ze)return{type:"redirect",location:l.location};if(i&&Pe.has(i))return vr({error:await K(l,{params:o,url:n,route:{id:r.id}}),url:n,params:o,route:r});let b=tt(l),E;if(l instanceof Xe)E=l.body;else{if(await F.updated.check())return await Ht(),await ce(n);E=await K(l,{params:o,url:n,route:{id:r.id}})}const T=await br(_,m,a);return T?je({url:n,params:o,branch:m.slice(0,T.idx).concat(T.node),errors:a,status:b,error:E,route:r}):await Ke(n,{id:r.id},E,b)}else m.push(void 0);return je({url:n,params:o,branch:m,errors:a,status:200,error:null,route:r,form:t?void 0:null})}async function br(e,t,n){for(;e--;)if(n[e]){let o=e;for(;!t[o];)o-=1;try{return{idx:o+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function lt({status:e,error:t,url:n,route:o}){const r={};let i=null;try{const a=await it({loader:Ye,url:n,params:r,route:o,parent:()=>Promise.resolve({}),server_data_node:ct(i)}),s={node:await Ae(),loader:Ae,universal:null,server:null,data:null};return je({url:n,params:r,branch:[a,s],status:e,error:t,errors:[],route:null})}catch(a){if(a instanceof Ze){await Wt(new URL(a.location,location.href),{},0);return}const s=await S.get_error_template(),c=await K(a,{url:n,params:r,route:o}),f=String(c?.message??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),u=s({status:e,message:f}),g=new DOMParser().parseFromString(u,"text/html");throw document.documentElement.replaceChild(document.adoptNode(g.head),document.head),document.documentElement.replaceChild(document.adoptNode(g.body),document.body),a}}async function kr(e){const t=e.href;if(ke.has(t))return ke.get(t);let n;try{const o=(async()=>{let r=await S.hooks.reroute({url:new URL(e),fetch:async(i,a)=>yr(i,a,e).promise})??e;if(typeof r=="string"){const i=new URL(e);S.hash?i.hash=r:i.pathname=r,r=i}return r})();ke.set(t,o),n=await o}catch(o){if(ke.delete(t),R){console.error(o);debugger}return}return n}async function Ce(e,t){if(e&&!Ne(e,j,S.hash)){const n=await kr(e);if(!n)return;const o=Sr(n);for(const r of rt){const i=r.exec(o);if(i)return{id:Ie(e),invalidating:t,route:r,params:fn(i),url:e}}}}function Sr(e){return ln(S.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(j.length))||"/"}function Ie(e){return(S.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function Qt({url:e,type:t,intent:n,delta:o,event:r,scroll:i}){let a=!1;const s=ft(v,n,e,t,i??null);o!==void 0&&(s.navigation.delta=o),r!==void 0&&(s.navigation.event=r);const c={...s.navigation,cancel:()=>{a=!0,s.reject(new Error("navigation cancelled"))}};return fe||ot.forEach(f=>f(c)),a?null:s}async function te({type:e,url:t,popped:n,keepfocus:o,noscroll:r,replace_state:i,state:a={},redirect_count:s=0,nav_token:c={},accept:f=q,block:u=q,event:g}){const d=V;V=c;const h=await Ce(t,!1),p=e==="enter"?ft(v,h,t,e):Qt({url:t,type:e,delta:n?.delta,intent:h,scroll:n?.scroll,event:g});if(!p){u(),V===c&&(V=d);return}const m=O,_=L;f(),fe=!0,le&&p.navigation.type!=="enter"&&F.navigating.set(se.current=p.navigation);let l=h&&await Zt(h);if(!l)if(Ne(t,j,S.hash))if(R&&S.hash)l=await Ke(t,{id:null},await K(new Ee(404,"Not Found",`Not found: ${t.pathname} (did you forget the hash?)`),{url:t,params:{},route:{id:null}}),404,i);else return await ce(t,i);else l=await Ke(t,{id:null},await K(new Ee(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,i);if(t=h?.url||t,V!==c){p.reject(new Error("navigation aborted"));return}if(!l)return;if(l.type==="redirect"){if(s<20){await te({type:e,url:new URL(l.location,t),popped:n,keepfocus:o,noscroll:r,replace_state:i,state:a,redirect_count:s+1,nav_token:c}),p.fulfil(void 0);return}if(l=await lt({status:500,error:await K(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}}),!l)return}else if(l.props.page.status>=400&&await F.updated.check())return await Ht(),await ce(t,i);if(_r(),nt(m),Kt(_),l.props.page.url.pathname!==t.pathname&&(t.pathname=l.props.page.url.pathname),a=n?n.state:a,!n){const w=i?0:1,I={[G]:O+=w,[ne]:L+=w,[Qe]:a};(i?history.replaceState:history.pushState).call(history,I,"",t),i||pr(O,L)}const b=h&&P?.id===h.id?P.fork:null;P?.fork&&!b?Le():(P=null,Z={element:void 0,href:void 0}),l.props.page.state=a;let E;if(le){const w=(await Promise.all(Array.from(gr,B=>B(p.navigation)))).filter(B=>typeof B=="function");if(w.length>0){let B=function(){w.forEach(re=>{ee.delete(re)})};w.push(B),w.forEach(re=>{ee.add(re)})}const I=p.navigation.to;v={...l.state,nav:{params:I.params,route:I.route,url:I.url}},l.props.page&&(l.props.page.url=t),!o&&document.activeElement instanceof HTMLElement&&document.activeElement!==document.body&&document.activeElement.blur();const W=b&&await b;W?E=W.commit():(oe=null,st.$set(l.props),oe&&Object.assign(l.props.page,oe),zt(l.props.page),E=an?.()),Gt=!0}else await Xt(l,Ge,!1);const{activeElement:T}=document;if(await E,await Se(),await Se(),V!==c){p.reject(new Error("navigation aborted"));return}l.props.page&&oe&&Object.assign(l.props.page,oe);let y=null;if(St){const w=n?n.scroll:r?J():null;w?scrollTo(w.x,w.y):(y=t.hash&&document.getElementById(tn(t)))?y.scrollIntoView():scrollTo(0,0)}const $=document.activeElement!==T&&document.activeElement!==document.body;!o&&!$&&Ir(t,!y),St=!0,fe=!1,p.fulfil(void 0),p.navigation.to&&(p.navigation.to.scroll=J()),ee.forEach(w=>w(p.navigation)),e==="popstate"&&Jt(L),F.navigating.set(se.current=null)}async function Ke(e,t,n,o,r){if(e.origin===xe&&e.pathname===location.pathname&&!Yt)return await lt({status:o,error:n,url:e,route:t});if(R&&o!==404){console.error("An error occurred while loading the page. This will cause a full page reload. (This message will only appear during development.)");debugger}return await ce(e,r)}let Z={element:void 0,href:void 0};function Er(){let e,t;D.addEventListener("mousemove",a=>{const s=a.target;clearTimeout(e),e=setTimeout(()=>{r(s,Y.hover)},20)});function n(a){a.defaultPrevented||r(a.composedPath()[0],Y.tap)}D.addEventListener("mousedown",n),D.addEventListener("touchstart",n,{passive:!0});const o=new IntersectionObserver(a=>{for(const s of a)s.isIntersecting&&(ze(new URL(s.target.href)),o.unobserve(s.target))},{threshold:0});async function r(a,s){const c=Dt(a,D),f=c===Z.element&&c?.href===Z.href&&s>=t;if(!c||f)return;const{url:u,external:g,download:d}=He(c,j,S.hash);if(g||d)return;const h=$e(c),p=u&&Ie(v.url)===Ie(u);if(!(h.reload||p))if(s<=h.preload_data){Z={element:c,href:c.href},t=Y.tap;const m=await Ce(u,!1);if(!m)return;R?At(m).then(_=>{_.type==="loaded"&&_.state.error&&console.warn(`Preloading data for ${m.url.pathname} failed with the following error: ${_.state.error.message}
12
- If this error is transient, you can ignore it. Otherwise, consider disabling preloading for this route. This route was preloaded due to a data-sveltekit-preload-data attribute. See https://svelte.dev/docs/kit/link-options for more info`)}):At(m)}else s<=h.preload_code&&(Z={element:c,href:c.href},t=s,ze(u))}function i(){o.disconnect();for(const a of D.querySelectorAll("a")){const{url:s,external:c,download:f}=He(a,j,S.hash);if(c||f)continue;const u=$e(a);u.reload||(u.preload_code===Y.viewport&&o.observe(a),u.preload_code===Y.eager&&ze(s))}}ee.add(i),i()}function K(e,t){if(e instanceof Xe)return e.body;R&&console.warn("The next HMR update will cause the page to reload");const n=tt(e),o=lr(e);return S.hooks.handleError({error:e,event:t,status:n,message:o})??{message:o}}function en(e,t){ur(()=>(e.add(t),()=>{e.delete(t)}))}function Or(e){en(ee,e)}function $r(e){en(ot,e)}function Ar(e,t={}){return e=new URL(Ue(e)),e.origin!==xe?Promise.reject(new Error(R?`Cannot use \`goto\` with an external URL. Use \`window.location = "${e}"\` instead`:"goto: invalid URL")):Wt(e,t,0)}function Rr(e){if(typeof e=="function")Re.push(e);else{const{href:t}=new URL(e,location.href);Re.push(n=>n.href===t)}}function Tr(e,t){if(R){if(!le)throw new Error("Cannot call replaceState(...) before router is initialized");try{tr(t)}catch(o){throw new Error(`Could not serialize state${o.path}`,{cause:o})}}const n={[G]:O,[ne]:L,[Nt]:A.url.href,[Qe]:t};history.replaceState(n,"",Ue(e)),A.state=t,st.$set({page:dr(()=>De(A))})}function Lr(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if($t(),!fe){const o=ft(v,void 0,null,"leave"),r={...o.navigation,cancel:()=>{n=!0,o.reject(new Error("navigation cancelled"))}};ot.forEach(i=>i(r))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&$t()}),navigator.connection?.saveData||Er(),D.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=Dt(t.composedPath()[0],D);if(!n)return;const{url:o,external:r,target:i,download:a}=He(n,j,S.hash);if(!o)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const s=$e(n);if(!(n instanceof SVGAElement)&&o.protocol!==location.protocol&&!(o.protocol==="https:"||o.protocol==="http:")||a)return;const[f,u]=(S.hash?o.hash.replace(/^#/,""):o.href).split("#"),g=f===Ve(location);if(r||s.reload&&(!g||!u)){Qt({url:o,type:"link",event:t})?fe=!0:t.preventDefault();return}if(u!==void 0&&g){const[,d]=v.url.href.split("#");if(d===u){if(t.preventDefault(),u===""||u==="top"&&n.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const h=n.ownerDocument.getElementById(decodeURIComponent(u));h&&(h.scrollIntoView(),h.focus())}return}if(ae=!0,nt(O),e(o),!s.replace_state)return;ae=!1}t.preventDefault(),await new Promise(d=>{requestAnimationFrame(()=>{setTimeout(d,0)}),setTimeout(d,100)}),await te({type:"link",url:o,keepfocus:s.keepfocus,noscroll:s.noscroll,replace_state:s.replace_state??o.href===location.href,event:t})}),D.addEventListener("submit",t=>{if(t.defaultPrevented)return;const n=HTMLFormElement.prototype.cloneNode.call(t.target),o=t.submitter;if((o?.formTarget||n.target)==="_blank"||(o?.formMethod||n.method)!=="get")return;const a=new URL(o?.hasAttribute("formaction")&&o?.formAction||n.action);if(Ne(a,j,!1))return;const s=t.target,c=$e(s);if(c.reload)return;t.preventDefault(),t.stopPropagation();const f=new FormData(s,o);a.search=new URLSearchParams(f).toString(),te({type:"form",url:a,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??a.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!Je){if(t.state?.[G]){const n=t.state[G];if(V={},n===O)return;const o=z[n],r=t.state[Qe]??{},i=new URL(t.state[Nt]??location.href),a=t.state[ne],s=v.url?Ve(location)===Ve(v.url):!1;if(a===L&&(Gt||s)){r!==A.state&&(A.state=r),e(i),z[O]=J(),o&&scrollTo(o.x,o.y),O=n;return}const f=n-O;await te({type:"popstate",url:i,popped:{state:r,scroll:o,delta:f},accept:()=>{O=n,L=a},block:()=>{history.go(-f)},nav_token:V,event:t})}else if(!ae){const n=new URL(location.href);e(n),S.hash&&location.reload()}}}),addEventListener("hashchange",()=>{ae&&(ae=!1,history.replaceState({...history.state,[G]:++O,[ne]:L},"",location.href))});for(const t of document.querySelectorAll("link"))hr.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&F.navigating.set(se.current=null)});function e(t){v.url=A.url=t,F.page.set(De(A)),F.page.notify()}}async function Pr(e,{status:t=200,error:n,node_ids:o,params:r,route:i,server_route:a,data:s,form:c}){Yt=!0;const f=new URL(location.href);let u;({params:r={},route:i={id:null}}=await Ce(f,!1)||{}),u=rt.find(({id:h})=>h===i.id);let g,d=!0;try{const h=o.map(async(m,_)=>{const l=s[_];return l?.uses&&(l.uses=jr(l.uses)),it({loader:S.nodes[m],url:f,params:r,route:i,parent:async()=>{const b={};for(let E=0;E<_;E+=1)Object.assign(b,(await h[E]).data);return b},server_data_node:ct(l)})}),p=await Promise.all(h);if(u){const m=u.layouts;for(let _=0;_<m.length;_++)m[_]||p.splice(_,0,void 0)}g=await je({url:f,params:r,branch:p,status:t,error:n,errors:u?.errors,form:c,route:u??null})}catch(h){if(h instanceof Ze)return await ce(new URL(h.location,location.href));g=await lt({status:tt(h),error:await K(h,{url:f,params:r,route:i}),url:f,route:i}),e.textContent="",d=!1}g&&(g.props.page&&(g.props.page.state={}),await Xt(g,e,d))}function jr(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}let Je=!1;function Ir(e,t=!0){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const o=tn(e);if(o&&document.getElementById(o)){const{x:i,y:a}=J();setTimeout(()=>{const s=history.state;Je=!0,location.replace(new URL(`#${o}`,location.href)),history.replaceState(s,"",e),t&&scrollTo(i,a),Je=!1})}else{const i=document.body,a=i.getAttribute("tabindex");i.tabIndex=-1,i.focus({preventScroll:!0,focusVisible:!1}),a!==null?i.setAttribute("tabindex",a):i.removeAttribute("tabindex")}const r=getSelection();if(r&&r.type!=="None"){const i=[];for(let a=0;a<r.rangeCount;a+=1)i.push(r.getRangeAt(a));setTimeout(()=>{if(r.rangeCount===i.length){for(let a=0;a<r.rangeCount;a+=1){const s=i[a],c=r.getRangeAt(a);if(s.commonAncestorContainer!==c.commonAncestorContainer||s.startContainer!==c.startContainer||s.endContainer!==c.endContainer||s.startOffset!==c.startOffset||s.endOffset!==c.endOffset)return}r.removeAllRanges()}})}}}function ft(e,t,n,o,r=null){let i,a;const s=new Promise((f,u)=>{i=f,a=u});return s.catch(q),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:J()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:r},willUnload:!t,type:o,complete:s},fulfil:i,reject:a}}function De(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function xr(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function tn(e){let t;if(S.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}if(R){const e=console.warn;console.warn=function(...n){n.length===1&&/<(Layout|Page|Error)(_[\w$]+)?> was created (with unknown|without expected) prop '(data|form)'/.test(n[0])||e(...n)}}const qr=Object.freeze(Object.defineProperty({__proto__:null,afterNavigate:Or,beforeNavigate:$r,goto:Ar,replaceState:Tr},Symbol.toStringTag,{value:"Module"}));export{Or as a,$r as b,Pt as c,F as d,Ar as g,Cr as l,qr as n,A as p,Tr as r,Vr as s};
11
+ </div>`),globalThis.__sveltekit_xwdzg0.data){const{q:i={},p:a={},l:s={},f:c={}}=globalThis.__sveltekit_xwdzg0.data;for(const f in i)i[f];for(const f in s)s[f];for(const f in c)c[f];for(const f in a)a[f]}document.URL!==location.href&&(location.href=location.href),S=e,await e.hooks.init?.(),rt=kn(e),D=document.documentElement,Ge=t,Ye=e.nodes[0],Ae=e.nodes[1],Ye(),Ae(),O=history.state?.[G],x=history.state?.[ne],O||(O=x=Date.now(),history.replaceState({...history.state,[G]:O,[ne]:x},""));const o=F[O];function r(){o&&(history.scrollRestoration="manual",scrollTo(o.x,o.y))}n?(r(),await Lr(Ge,n)):(await te({type:"enter",url:Ue(S.hash?jr(new URL(location.href)):location.href),replace_state:!0}),r()),xr()}function _r(){Re.length=0,at=!1}function Kt(e){Te.some(t=>t?.snapshot)&&(ie[e]=Te.map(t=>t?.snapshot?.capture()))}function Jt(e){ie[e]?.forEach((t,n)=>{Te[n]?.snapshot?.restore(t)})}function $t(){nt(O),pt(Ut,F),Kt(x),pt(jt,ie)}async function Wt(e,t,n,o){let r,i;t.invalidateAll&&xe(),await te({type:"goto",url:Ue(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:o,accept:()=>{if(t.invalidateAll){at=!0,r=new Set;for(const[a,s]of Et)for(const[c,f]of s)f.resource?.reset(),r.add(be(a,c));i=new Set;for(const[a,s]of Ot)for(const c of s.keys())i.add(be(a,c))}t.invalidate&&t.invalidate.forEach(Rr)}}),t.invalidateAll&&Se().then(Se).then(()=>{for(const[a,s]of Et)for(const[c,{resource:f}]of s)r?.has(be(a,c))&&f.start();for(const[a,s]of Ot)for(const[c,{resource:f}]of s)i?.has(be(a,c))&&f.reconnect()})}async function At(e){if(e.id!==L?.id){xe();const t={};Le.add(t),L={id:e.id,token:t,promise:Zt({...e,preload:t}).then(n=>(Le.delete(t),n.type==="loaded"&&n.state.error&&xe(),n)),fork:null}}return L.promise}async function Fe(e){const t=(await Ce(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(n=>n[1]()))}async function Xt(e,t,n){const o={params:v.params,route:{id:v.route?.id??null},url:new URL(location.href)};if(v={...e.state,nav:o},Ft(e.props.page),st=new S.root({target:t,props:{...e.props,stores:z,components:Te},hydrate:n,sync:!1,transformError:void 0}),await Promise.resolve(),n){const r={from:null,to:{...o,scroll:F[O]??J()},willUnload:!1,type:"enter",complete:Promise.resolve()};ee.forEach(i=>i(r))}Jt(x),le=!0}async function Pe({url:e,params:t,branch:n,errors:o,status:r,error:i,route:a,form:s}){let c="never";if(P&&(e.pathname===P||e.pathname===P+"/"))c="always";else for(const p of n)p?.slash!==void 0&&(c=p.slash);e.pathname=cn(e.pathname,c),e.search=e.search;const f={type:"loaded",state:{url:e,params:t,branch:n,error:i,route:a},props:{constructors:cr(n).map(p=>p.node.component),page:De(A)}};s!==void 0&&(f.props.form=s);let u={},g=!A,d=0;for(let p=0;p<Math.max(n.length,v.branch.length);p+=1){const m=n[p],_=v.branch[p];m?.data!==_?.data&&(g=!0),m&&(u={...u,...m.data},g&&(f.props[`data_${d}`]=u),d+=1)}return(!v.url||e.href!==v.url.href||v.error!==i||s!==void 0&&s!==A.form||g)&&(f.props.page={error:i,params:t,route:{id:a?.id??null},state:{},status:r,url:new URL(e),form:s??null,data:g?u:A.data}),f}async function it({loader:e,parent:t,url:n,params:o,route:r,server_data_node:i}){let a=null;const s={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},c=await e();if(R&&(ir(c.universal),c.universal&&S.hash)){const f=Object.keys(c.universal).filter(u=>u!=="load");if(f.length>0)throw new Error(`Page options are ignored when \`router.type === 'hash'\` (${r.id} has ${f.filter(u=>u!=="load").map(u=>`'${u}'`).join(", ")})`)}return{node:c,loader:e,server:i,universal:c.universal?.load?{type:"data",data:a,uses:s}:null,data:a??i?.data??null,slash:c.universal?.trailingSlash??i?.slash}}function yr(e,t,n){let o=e instanceof Request?e.url:e;const r=new URL(o,n);r.origin===n.origin&&(o=r.href.slice(n.origin.length));const i=le?gn(o,r.href,t):pn(o,t);return{resolved:r,promise:i}}function mr(e,t,n,o,r,i){if(at)return!0;if(!r)return!1;if(r.parent&&e||r.route&&t||r.url&&n)return!0;for(const a of r.search_params)if(o.has(a))return!0;for(const a of r.params)if(i[a]!==v.params[a])return!0;for(const a of r.dependencies)if(Re.some(s=>s(new URL(a))))return!0;return!1}function ct(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function wr(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const o of n){const r=e.searchParams.getAll(o),i=t.searchParams.getAll(o);r.every(a=>i.includes(a))&&i.every(a=>r.includes(a))&&n.delete(o)}return n}function vr({error:e,url:t,route:n,params:o}){return{type:"loaded",state:{error:e,url:t,route:n,params:o,branch:[]},props:{page:De(A),constructors:[]}}}async function Zt({id:e,invalidating:t,url:n,params:o,route:r,preload:i}){if(L?.id===e)return Le.delete(L.token),L.promise;const{errors:a,layouts:s,leaf:c}=r,f=[...s,c];a.forEach(_=>_?.().catch(q)),f.forEach(_=>_?.[1]().catch(q));const u=v.url?e!==Ie(v.url):!1,g=v.route?r.id!==v.route.id:!1,d=wr(v.url,n);let h=!1;const p=f.map(async(_,l)=>{if(!_)return;const b=v.branch[l];return _[1]===b?.loader&&!mr(h,g,u,d,b.universal?.uses,o)?b:(h=!0,it({loader:_[1],url:n,params:o,route:r,parent:async()=>{const T={};for(let y=0;y<l;y+=1)Object.assign(T,(await p[y])?.data);return T},server_data_node:ct(_[0]?{type:"skip"}:null,_[0]?b?.server:void 0)}))});for(const _ of p)_.catch(q);const m=[];for(let _=0;_<f.length;_+=1)if(f[_])try{m.push(await p[_])}catch(l){if(l instanceof Ze)return{type:"redirect",location:l.location};if(i&&Le.has(i))return vr({error:await K(l,{params:o,url:n,route:{id:r.id}}),url:n,params:o,route:r});let b=tt(l),E;if(l instanceof Xe)E=l.body;else{if(await z.updated.check())return await Ht(),await ce(n);E=await K(l,{params:o,url:n,route:{id:r.id}})}const T=await br(_,m,a);return T?Pe({url:n,params:o,branch:m.slice(0,T.idx).concat(T.node),errors:a,status:b,error:E,route:r}):await Ke(n,{id:r.id},E,b)}else m.push(void 0);return Pe({url:n,params:o,branch:m,errors:a,status:200,error:null,route:r,form:t?void 0:null})}async function br(e,t,n){for(;e--;)if(n[e]){let o=e;for(;!t[o];)o-=1;try{return{idx:o+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function lt({status:e,error:t,url:n,route:o}){const r={};let i=null;try{const a=await it({loader:Ye,url:n,params:r,route:o,parent:()=>Promise.resolve({}),server_data_node:ct(i)}),s={node:await Ae(),loader:Ae,universal:null,server:null,data:null};return Pe({url:n,params:r,branch:[a,s],status:e,error:t,errors:[],route:null})}catch(a){if(a instanceof Ze){await Wt(new URL(a.location,location.href),{},0);return}const s=await S.get_error_template(),c=await K(a,{url:n,params:r,route:o}),f=String(c?.message??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),u=s({status:e,message:f}),g=new DOMParser().parseFromString(u,"text/html");throw document.documentElement.replaceChild(document.adoptNode(g.head),document.head),document.documentElement.replaceChild(document.adoptNode(g.body),document.body),a}}async function kr(e){const t=e.href;if(ke.has(t))return ke.get(t);let n;try{const o=(async()=>{let r=await S.hooks.reroute({url:new URL(e),fetch:async(i,a)=>yr(i,a,e).promise})??e;if(typeof r=="string"){const i=new URL(e);S.hash?i.hash=r:i.pathname=r,r=i}return r})();ke.set(t,o),n=await o}catch(o){if(ke.delete(t),R){console.error(o);debugger}return}return n}async function Ce(e,t){if(e&&!Ne(e,P,S.hash)){const n=await kr(e);if(!n)return;const o=Sr(n);for(const r of rt){const i=r.exec(o);if(i)return{id:Ie(e),invalidating:t,route:r,params:fn(i),url:e}}}}function Sr(e){return ln(S.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(P.length))||"/"}function Ie(e){return(S.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function Qt({url:e,type:t,intent:n,delta:o,event:r,scroll:i}){let a=!1;const s=ft(v,n,e,t,i??null);o!==void 0&&(s.navigation.delta=o),r!==void 0&&(s.navigation.event=r);const c={...s.navigation,cancel:()=>{a=!0,s.reject(new Error("navigation cancelled"))}};return fe||ot.forEach(f=>f(c)),a?null:s}async function te({type:e,url:t,popped:n,keepfocus:o,noscroll:r,replace_state:i,state:a={},redirect_count:s=0,nav_token:c={},accept:f=q,block:u=q,event:g}){const d=V;V=c;const h=await Ce(t,!1),p=e==="enter"?ft(v,h,t,e):Qt({url:t,type:e,delta:n?.delta,intent:h,scroll:n?.scroll,event:g});if(!p){u(),V===c&&(V=d);return}const m=O,_=x;f(),fe=!0,le&&p.navigation.type!=="enter"&&z.navigating.set(se.current=p.navigation);let l=h&&await Zt(h);if(!l)if(Ne(t,P,S.hash))if(R&&S.hash)l=await Ke(t,{id:null},await K(new Ee(404,"Not Found",`Not found: ${t.pathname} (did you forget the hash?)`),{url:t,params:{},route:{id:null}}),404,i);else return await ce(t,i);else l=await Ke(t,{id:null},await K(new Ee(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,i);if(t=h?.url||t,V!==c){p.reject(new Error("navigation aborted"));return}if(!l)return;if(l.type==="redirect"){if(s<20){await te({type:e,url:new URL(l.location,t),popped:n,keepfocus:o,noscroll:r,replace_state:i,state:a,redirect_count:s+1,nav_token:c}),p.fulfil(void 0);return}if(l=await lt({status:500,error:await K(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}}),!l)return}else if(l.props.page.status>=400&&await z.updated.check())return await Ht(),await ce(t,i);if(_r(),nt(m),Kt(_),l.props.page.url.pathname!==t.pathname&&(t.pathname=l.props.page.url.pathname),a=n?n.state:a,!n){const w=i?0:1,I={[G]:O+=w,[ne]:x+=w,[Qe]:a};(i?history.replaceState:history.pushState).call(history,I,"",t),i||pr(O,x)}const b=h&&L?.id===h.id?L.fork:null;L?.fork&&!b?xe():(L=null,Z={element:void 0,href:void 0}),l.props.page.state=a;let E;if(le){const w=(await Promise.all(Array.from(gr,B=>B(p.navigation)))).filter(B=>typeof B=="function");if(w.length>0){let B=function(){w.forEach(re=>{ee.delete(re)})};w.push(B),w.forEach(re=>{ee.add(re)})}const I=p.navigation.to;v={...l.state,nav:{params:I.params,route:I.route,url:I.url}},l.props.page&&(l.props.page.url=t),!o&&document.activeElement instanceof HTMLElement&&document.activeElement!==document.body&&document.activeElement.blur();const W=b&&await b;W?E=W.commit():(oe=null,st.$set(l.props),oe&&Object.assign(l.props.page,oe),Ft(l.props.page),E=an?.()),Gt=!0}else await Xt(l,Ge,!1);const{activeElement:T}=document;if(await E,await Se(),await Se(),V!==c){p.reject(new Error("navigation aborted"));return}l.props.page&&oe&&Object.assign(l.props.page,oe);let y=null;if(St){const w=n?n.scroll:r?J():null;w?scrollTo(w.x,w.y):(y=t.hash&&document.getElementById(tn(t)))?y.scrollIntoView():scrollTo(0,0)}const $=document.activeElement!==T&&document.activeElement!==document.body;!o&&!$&&Ir(t,!y),St=!0,fe=!1,p.fulfil(void 0),p.navigation.to&&(p.navigation.to.scroll=J()),ee.forEach(w=>w(p.navigation)),e==="popstate"&&Jt(x),z.navigating.set(se.current=null)}async function Ke(e,t,n,o,r){if(e.origin===je&&e.pathname===location.pathname&&!Yt)return await lt({status:o,error:n,url:e,route:t});if(R&&o!==404){console.error("An error occurred while loading the page. This will cause a full page reload. (This message will only appear during development.)");debugger}return await ce(e,r)}let Z={element:void 0,href:void 0};function Er(){let e,t;D.addEventListener("mousemove",a=>{const s=a.target;clearTimeout(e),e=setTimeout(()=>{r(s,Y.hover)},20)});function n(a){a.defaultPrevented||r(a.composedPath()[0],Y.tap)}D.addEventListener("mousedown",n),D.addEventListener("touchstart",n,{passive:!0});const o=new IntersectionObserver(a=>{for(const s of a)s.isIntersecting&&(Fe(new URL(s.target.href)),o.unobserve(s.target))},{threshold:0});async function r(a,s){const c=Dt(a,D),f=c===Z.element&&c?.href===Z.href&&s>=t;if(!c||f)return;const{url:u,external:g,download:d}=He(c,P,S.hash);if(g||d)return;const h=$e(c),p=u&&Ie(v.url)===Ie(u);if(!(h.reload||p))if(s<=h.preload_data){Z={element:c,href:c.href},t=Y.tap;const m=await Ce(u,!1);if(!m)return;R?At(m).then(_=>{_.type==="loaded"&&_.state.error&&console.warn(`Preloading data for ${m.url.pathname} failed with the following error: ${_.state.error.message}
12
+ If this error is transient, you can ignore it. Otherwise, consider disabling preloading for this route. This route was preloaded due to a data-sveltekit-preload-data attribute. See https://svelte.dev/docs/kit/link-options for more info`)}):At(m)}else s<=h.preload_code&&(Z={element:c,href:c.href},t=s,Fe(u))}function i(){o.disconnect();for(const a of D.querySelectorAll("a")){const{url:s,external:c,download:f}=He(a,P,S.hash);if(c||f)continue;const u=$e(a);u.reload||(u.preload_code===Y.viewport&&o.observe(a),u.preload_code===Y.eager&&Fe(s))}}ee.add(i),i()}function K(e,t){if(e instanceof Xe)return e.body;R&&console.warn("The next HMR update will cause the page to reload");const n=tt(e),o=lr(e);return S.hooks.handleError({error:e,event:t,status:n,message:o})??{message:o}}function en(e,t){ur(()=>(e.add(t),()=>{e.delete(t)}))}function Or(e){en(ee,e)}function $r(e){en(ot,e)}function Ar(e,t={}){return e=new URL(Ue(e)),e.origin!==je?Promise.reject(new Error(R?`Cannot use \`goto\` with an external URL. Use \`window.location = "${e}"\` instead`:"goto: invalid URL")):Wt(e,t,0)}function Rr(e){if(typeof e=="function")Re.push(e);else{const{href:t}=new URL(e,location.href);Re.push(n=>n.href===t)}}function Tr(e,t){if(R){if(!le)throw new Error("Cannot call replaceState(...) before router is initialized");try{tr(t)}catch(o){throw new Error(`Could not serialize state${o.path}`,{cause:o})}}const n={[G]:O,[ne]:x,[Nt]:A.url.href,[Qe]:t};history.replaceState(n,"",Ue(e)),A.state=t,st.$set({page:dr(()=>De(A))})}function xr(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if($t(),!fe){const o=ft(v,void 0,null,"leave"),r={...o.navigation,cancel:()=>{n=!0,o.reject(new Error("navigation cancelled"))}};ot.forEach(i=>i(r))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&$t()}),navigator.connection?.saveData||Er(),D.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=Dt(t.composedPath()[0],D);if(!n)return;const{url:o,external:r,target:i,download:a}=He(n,P,S.hash);if(!o)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const s=$e(n);if(!(n instanceof SVGAElement)&&o.protocol!==location.protocol&&!(o.protocol==="https:"||o.protocol==="http:")||a)return;const[f,u]=(S.hash?o.hash.replace(/^#/,""):o.href).split("#"),g=f===Ve(location);if(r||s.reload&&(!g||!u)){Qt({url:o,type:"link",event:t})?fe=!0:t.preventDefault();return}if(u!==void 0&&g){const[,d]=v.url.href.split("#");if(d===u){if(t.preventDefault(),u===""||u==="top"&&n.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const h=n.ownerDocument.getElementById(decodeURIComponent(u));h&&(h.scrollIntoView(),h.focus())}return}if(ae=!0,nt(O),e(o),!s.replace_state)return;ae=!1}t.preventDefault(),await new Promise(d=>{requestAnimationFrame(()=>{setTimeout(d,0)}),setTimeout(d,100)}),await te({type:"link",url:o,keepfocus:s.keepfocus,noscroll:s.noscroll,replace_state:s.replace_state??o.href===location.href,event:t})}),D.addEventListener("submit",t=>{if(t.defaultPrevented)return;const n=HTMLFormElement.prototype.cloneNode.call(t.target),o=t.submitter;if((o?.formTarget||n.target)==="_blank"||(o?.formMethod||n.method)!=="get")return;const a=new URL(o?.hasAttribute("formaction")&&o?.formAction||n.action);if(Ne(a,P,!1))return;const s=t.target,c=$e(s);if(c.reload)return;t.preventDefault(),t.stopPropagation();const f=new FormData(s,o);a.search=new URLSearchParams(f).toString(),te({type:"form",url:a,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??a.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!Je){if(t.state?.[G]){const n=t.state[G];if(V={},n===O)return;const o=F[n],r=t.state[Qe]??{},i=new URL(t.state[Nt]??location.href),a=t.state[ne],s=v.url?Ve(location)===Ve(v.url):!1;if(a===x&&(Gt||s)){r!==A.state&&(A.state=r),e(i),F[O]=J(),o&&scrollTo(o.x,o.y),O=n;return}const f=n-O;await te({type:"popstate",url:i,popped:{state:r,scroll:o,delta:f},accept:()=>{O=n,x=a},block:()=>{history.go(-f)},nav_token:V,event:t})}else if(!ae){const n=new URL(location.href);e(n),S.hash&&location.reload()}}}),addEventListener("hashchange",()=>{ae&&(ae=!1,history.replaceState({...history.state,[G]:++O,[ne]:x},"",location.href))});for(const t of document.querySelectorAll("link"))hr.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&z.navigating.set(se.current=null)});function e(t){v.url=A.url=t,z.page.set(De(A)),z.page.notify()}}async function Lr(e,{status:t=200,error:n,node_ids:o,params:r,route:i,server_route:a,data:s,form:c}){Yt=!0;const f=new URL(location.href);let u;({params:r={},route:i={id:null}}=await Ce(f,!1)||{}),u=rt.find(({id:h})=>h===i.id);let g,d=!0;try{const h=o.map(async(m,_)=>{const l=s[_];return l?.uses&&(l.uses=Pr(l.uses)),it({loader:S.nodes[m],url:f,params:r,route:i,parent:async()=>{const b={};for(let E=0;E<_;E+=1)Object.assign(b,(await h[E]).data);return b},server_data_node:ct(l)})}),p=await Promise.all(h);if(u){const m=u.layouts;for(let _=0;_<m.length;_++)m[_]||p.splice(_,0,void 0)}g=await Pe({url:f,params:r,branch:p,status:t,error:n,errors:u?.errors,form:c,route:u??null})}catch(h){if(h instanceof Ze)return await ce(new URL(h.location,location.href));g=await lt({status:tt(h),error:await K(h,{url:f,params:r,route:i}),url:f,route:i}),e.textContent="",d=!1}g&&(g.props.page&&(g.props.page.state={}),await Xt(g,e,d))}function Pr(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}let Je=!1;function Ir(e,t=!0){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const o=tn(e);if(o&&document.getElementById(o)){const{x:i,y:a}=J();setTimeout(()=>{const s=history.state;Je=!0,location.replace(new URL(`#${o}`,location.href)),history.replaceState(s,"",e),t&&scrollTo(i,a),Je=!1})}else{const i=document.body,a=i.getAttribute("tabindex");i.tabIndex=-1,i.focus({preventScroll:!0,focusVisible:!1}),a!==null?i.setAttribute("tabindex",a):i.removeAttribute("tabindex")}const r=getSelection();if(r&&r.type!=="None"){const i=[];for(let a=0;a<r.rangeCount;a+=1)i.push(r.getRangeAt(a));setTimeout(()=>{if(r.rangeCount===i.length){for(let a=0;a<r.rangeCount;a+=1){const s=i[a],c=r.getRangeAt(a);if(s.commonAncestorContainer!==c.commonAncestorContainer||s.startContainer!==c.startContainer||s.endContainer!==c.endContainer||s.startOffset!==c.startOffset||s.endOffset!==c.endOffset)return}r.removeAllRanges()}})}}}function ft(e,t,n,o,r=null){let i,a;const s=new Promise((f,u)=>{i=f,a=u});return s.catch(q),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:J()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:r},willUnload:!t,type:o,complete:s},fulfil:i,reject:a}}function De(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function jr(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function tn(e){let t;if(S.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}if(R){const e=console.warn;console.warn=function(...n){n.length===1&&/<(Layout|Page|Error)(_[\w$]+)?> was created (with unknown|without expected) prop '(data|form)'/.test(n[0])||e(...n)}}const qr=Object.freeze(Object.defineProperty({__proto__:null,afterNavigate:Or,beforeNavigate:$r,goto:Ar,replaceState:Tr},Symbol.toStringTag,{value:"Module"}));export{Or as a,$r as b,Lt as c,z as d,Ar as g,Cr as l,qr as n,A as p,Tr as r,Vr as s};