@intent-hq/web 2.393.1 → 2.393.2

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 (147) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{BZcIlO-m.js → 0Lodvm7U.js} +1 -1
  3. package/web/app/immutable/chunks/{PBRs5SJ0.js → 1hUesUcr.js} +1 -1
  4. package/web/app/immutable/chunks/{BX6cGa3P.js → 1p87nGiH.js} +1 -1
  5. package/web/app/immutable/chunks/{CxYEPO2e.js → 2XTpu-pp.js} +1 -1
  6. package/web/app/immutable/chunks/{ye-GTjqo.js → 3EQPKXoI.js} +1 -1
  7. package/web/app/immutable/chunks/{Do3KjvK9.js → 5NKE7nx3.js} +1 -1
  8. package/web/app/immutable/chunks/{BYFF4vXy.js → 5Nvv2Lts.js} +1 -1
  9. package/web/app/immutable/chunks/{BU9PIki-.js → 5SDFNZiZ.js} +1 -1
  10. package/web/app/immutable/chunks/{DgmcmslQ.js → 9N5egcma.js} +1 -1
  11. package/web/app/immutable/chunks/{PIyjm_eA.js → AX1GDLPb.js} +1 -1
  12. package/web/app/immutable/chunks/{kc2Bsov-.js → B1P2_A-D.js} +1 -1
  13. package/web/app/immutable/chunks/{03rp11-0.js → B25DCKCp.js} +1 -1
  14. package/web/app/immutable/chunks/{BoAOWVTV.js → B3_pG997.js} +1 -1
  15. package/web/app/immutable/chunks/{CD6SknDy.js → B8sPKQVl.js} +1 -1
  16. package/web/app/immutable/chunks/{_fNgz67j.js → B92LVVZl.js} +1 -1
  17. package/web/app/immutable/chunks/{BF2WXZJV.js → B941PH3R.js} +1 -1
  18. package/web/app/immutable/chunks/{CGnjVQAU.js → BET9_6zk.js} +2 -2
  19. package/web/app/immutable/chunks/{C9DL5612.js → BI4cZZX-.js} +1 -1
  20. package/web/app/immutable/chunks/{D2Y-4Hk1.js → BIDLT3JB.js} +1 -1
  21. package/web/app/immutable/chunks/{DeZREu1L.js → BOE0lXBq.js} +1 -1
  22. package/web/app/immutable/chunks/{DOrnNMXq.js → BOOf6vKl.js} +1 -1
  23. package/web/app/immutable/chunks/{Bz-k4xjY.js → BPphEAV1.js} +1 -1
  24. package/web/app/immutable/chunks/{BQr_CU_m.js → BQ9Nf0IV.js} +1 -1
  25. package/web/app/immutable/chunks/{DpmfoOfT.js → BSMKf5nA.js} +1 -1
  26. package/web/app/immutable/chunks/{DMZaN70J.js → BSVwkJI3.js} +1 -1
  27. package/web/app/immutable/chunks/{8XCqMH_A.js → BTQZ2eSY.js} +1 -1
  28. package/web/app/immutable/chunks/{By2IWKC2.js → BV9rfWFj.js} +1 -1
  29. package/web/app/immutable/chunks/{BbwMNYGv.js → BWH6q8SG.js} +3 -3
  30. package/web/app/immutable/chunks/{CC5YTA05.js → BXnNAEju.js} +1 -1
  31. package/web/app/immutable/chunks/{CKuv24OA.js → BZpl1Y6O.js} +1 -1
  32. package/web/app/immutable/chunks/{B08hyH_t.js → BcKhVYNw.js} +1 -1
  33. package/web/app/immutable/chunks/{DZYGgiAb.js → Bf8oyM9s.js} +1 -1
  34. package/web/app/immutable/chunks/{C0yEXWZT.js → BhsjECB4.js} +1 -1
  35. package/web/app/immutable/chunks/{2E4Z_ZFq.js → BmkQwoP6.js} +1 -1
  36. package/web/app/immutable/chunks/{B4H39zb5.js → Bo0ZNhTd.js} +1 -1
  37. package/web/app/immutable/chunks/{DhA_Bjtj.js → BvpvfHPp.js} +1 -1
  38. package/web/app/immutable/chunks/{CNZpDeJb.js → ByXyOGzc.js} +1 -1
  39. package/web/app/immutable/chunks/{DJPdI2sS.js → C-vJzBpf.js} +7 -7
  40. package/web/app/immutable/chunks/{DJWOAwhC.js → C0ZUrdOo.js} +1 -1
  41. package/web/app/immutable/chunks/{ChnCUogL.js → C3A6Etjq.js} +1 -1
  42. package/web/app/immutable/chunks/{BvADYKOZ.js → C3ldfPpK.js} +2 -2
  43. package/web/app/immutable/chunks/{Baa59Un_.js → C45mDBrU.js} +1 -1
  44. package/web/app/immutable/chunks/{ClK_UzEg.js → C4qoqU0x.js} +1 -1
  45. package/web/app/immutable/chunks/{DdNl3Rbm.js → CBdW99Fh.js} +3 -3
  46. package/web/app/immutable/chunks/{BHwv4Hfl.js → CCi081IH.js} +1 -1
  47. package/web/app/immutable/chunks/{BfFqg0tr.js → CEH2NAZ8.js} +1 -1
  48. package/web/app/immutable/chunks/{BBA4NncC.js → CFa8sUgf.js} +1 -1
  49. package/web/app/immutable/chunks/{K6U2gbY4.js → CFyhHTwc.js} +1 -1
  50. package/web/app/immutable/chunks/{CMQzFQs4.js → CG6G-VtV.js} +1 -1
  51. package/web/app/immutable/chunks/{B8COfuyw.js → CGYM6R_d.js} +1 -1
  52. package/web/app/immutable/chunks/{BGntbMwK.js → CH1Bpd5B.js} +1 -1
  53. package/web/app/immutable/chunks/{CBDRhyjO.js → CJUKJKPV.js} +1 -1
  54. package/web/app/immutable/chunks/{QiDikPQa.js → CJtBv95U.js} +1 -1
  55. package/web/app/immutable/chunks/{CkT6bu2G.js → CL5OTeL_.js} +1 -1
  56. package/web/app/immutable/chunks/{C0tj6dfD.js → CM3rEc3H.js} +1 -1
  57. package/web/app/immutable/chunks/{Bl5dZSyT.js → CNm0He-Z.js} +2 -2
  58. package/web/app/immutable/chunks/{CNzTIPQp.js → CPCJiIPK.js} +1 -1
  59. package/web/app/immutable/chunks/{BGLaHsDV.js → CPTHRAYg.js} +1 -1
  60. package/web/app/immutable/chunks/{B5JMHmH2.js → CPy0rCmw.js} +4 -4
  61. package/web/app/immutable/chunks/{BX6KUKcp.js → CR6bxzBv.js} +1 -1
  62. package/web/app/immutable/chunks/{DU4u3RKB.js → CVgSN9ZH.js} +2 -2
  63. package/web/app/immutable/chunks/{BSCmeu0N.js → CVhLsbHu.js} +1 -1
  64. package/web/app/immutable/chunks/{DN6txiJA.js → C_rsaO5o.js} +1 -1
  65. package/web/app/immutable/chunks/{BTVapThA.js → CbGGQnE9.js} +1 -1
  66. package/web/app/immutable/chunks/{CiezGigq.js → CdXM6BQL.js} +1 -1
  67. package/web/app/immutable/chunks/{Dp6gutm7.js → Cdwy3-nO.js} +4 -4
  68. package/web/app/immutable/chunks/{edvxHiJh.js → Ce5Cs6SN.js} +3 -3
  69. package/web/app/immutable/chunks/{DRVUI7n3.js → Cj36CQXD.js} +1 -1
  70. package/web/app/immutable/chunks/{CRNqz-CU.js → Cj92J6fP.js} +3 -3
  71. package/web/app/immutable/chunks/{BSglkeCR.js → CnnBx7yl.js} +1 -1
  72. package/web/app/immutable/chunks/{P235vPf0.js → Cnvb2S0V.js} +1 -1
  73. package/web/app/immutable/chunks/{Bv6jwx4N.js → Cohy0Z-x.js} +1 -1
  74. package/web/app/immutable/chunks/{CS_KcnQC.js → CpwZYDHS.js} +1 -1
  75. package/web/app/immutable/chunks/{6c2NdJk5.js → CqnoveI8.js} +1 -1
  76. package/web/app/immutable/chunks/{0fp6eBJ2.js → CtemMU54.js} +2 -2
  77. package/web/app/immutable/chunks/{D-IVWxYX.js → CuvONknh.js} +1 -1
  78. package/web/app/immutable/chunks/{CMHMpoVu.js → Cym4zMqt.js} +3 -3
  79. package/web/app/immutable/chunks/{CKGl1DmB.js → D1CYQTLS.js} +1 -1
  80. package/web/app/immutable/chunks/{2z2xJ2W_.js → D7rcwg4U.js} +2 -2
  81. package/web/app/immutable/chunks/{E6pB77s3.js → D7tp4A5_.js} +1 -1
  82. package/web/app/immutable/chunks/{BhzVqZCt.js → D8dc4uEZ.js} +1 -1
  83. package/web/app/immutable/chunks/{Bw9UsBZT.js → D9_9Xrbm.js} +1 -1
  84. package/web/app/immutable/chunks/{DEVOS0tD.js → DLTvtu0r.js} +1 -1
  85. package/web/app/immutable/chunks/{Dl68BOSP.js → DOjRTGtD.js} +1 -1
  86. package/web/app/immutable/chunks/{B2p16ZcG.js → DQMGgT_X.js} +1 -1
  87. package/web/app/immutable/chunks/{X-RVyfO0.js → DR2A4Ob1.js} +1 -1
  88. package/web/app/immutable/chunks/{BGBZTOoV.js → DRNQWF5u.js} +2 -2
  89. package/web/app/immutable/chunks/{Jpb8pOEi.js → DRgsIn-1.js} +1 -1
  90. package/web/app/immutable/chunks/{BDDEENB9.js → DW3UcPIr.js} +1 -1
  91. package/web/app/immutable/chunks/{C4P8DeLE.js → DY9oFeIm.js} +1 -1
  92. package/web/app/immutable/chunks/{BGZDnsPV.js → DYA10vhI.js} +2 -2
  93. package/web/app/immutable/chunks/{BZDblkH_.js → DYo8C3ZI.js} +1 -1
  94. package/web/app/immutable/chunks/{Cwn1Htr4.js → Da3dWtR7.js} +1 -1
  95. package/web/app/immutable/chunks/{D5vlW2SV.js → Db6ExzGF.js} +1 -1
  96. package/web/app/immutable/chunks/{C2BkU_2B.js → DcU97JoW.js} +1 -1
  97. package/web/app/immutable/chunks/{IuSiCp89.js → Dd4ehheI.js} +1 -1
  98. package/web/app/immutable/chunks/{xXSv9C4P.js → DeeBlDPG.js} +1 -1
  99. package/web/app/immutable/chunks/{CFsh8rrs.js → DfrPaMm3.js} +2 -2
  100. package/web/app/immutable/chunks/{D1rlIs5V.js → DgClg_4p.js} +1 -1
  101. package/web/app/immutable/chunks/{DBMzxcUI.js → DiaqLwTf.js} +1 -1
  102. package/web/app/immutable/chunks/{DjepxDVb.js → Dm529rkq.js} +4 -4
  103. package/web/app/immutable/chunks/{CLXQSor9.js → DmmU2UYb.js} +1 -1
  104. package/web/app/immutable/chunks/{BMejr7u6.js → DqVocOV1.js} +1 -1
  105. package/web/app/immutable/chunks/{C12O35p-.js → DsMWDyON.js} +1 -1
  106. package/web/app/immutable/chunks/{CHRXhmu4.js → DtyYBAfX.js} +1 -1
  107. package/web/app/immutable/chunks/{CfAvt2Zs.js → DuEeb8Mn.js} +1 -1
  108. package/web/app/immutable/chunks/{D8BXRngi.js → Dv4Vym3G.js} +1 -1
  109. package/web/app/immutable/chunks/{DUINlo9r.js → Dv9iFv_x.js} +1 -1
  110. package/web/app/immutable/chunks/{BUHPTzFz.js → G0vgahzI.js} +1 -1
  111. package/web/app/immutable/chunks/{Bx5_x_xs.js → M7sb2vsG.js} +1 -1
  112. package/web/app/immutable/chunks/{DAvgrUpQ.js → MdOlpTpG.js} +3 -3
  113. package/web/app/immutable/chunks/{Dq1yTcBb.js → MnHzHyX4.js} +1 -1
  114. package/web/app/immutable/chunks/{BiH1hXHp.js → OSt17igW.js} +1 -1
  115. package/web/app/immutable/chunks/{BJTRhgs4.js → OYbzRQNh.js} +1 -1
  116. package/web/app/immutable/chunks/{CU4LG5o2.js → PbtuJhxQ.js} +2 -2
  117. package/web/app/immutable/chunks/{BVY7HYcm.js → Qkw5r8H6.js} +1 -1
  118. package/web/app/immutable/chunks/{7qqqYD-I.js → RRXFJL92.js} +1 -1
  119. package/web/app/immutable/chunks/{BdvX8QCl.js → TzUDDwaI.js} +1 -1
  120. package/web/app/immutable/chunks/{Bb15Q1ED.js → WrCMkepk.js} +2 -2
  121. package/web/app/immutable/chunks/{6gbXuD_9.js → XXp2dlP1.js} +1 -1
  122. package/web/app/immutable/chunks/{C3PqMGoR.js → _bESm04T.js} +1 -1
  123. package/web/app/immutable/chunks/{BGzLfgjy.js → bNKugVDK.js} +1 -1
  124. package/web/app/immutable/chunks/{DOYZ_D5o.js → ch6_GOZD.js} +1 -1
  125. package/web/app/immutable/chunks/{DyFjB_S6.js → czWUw-OT.js} +1 -1
  126. package/web/app/immutable/chunks/{D9lcY5kd.js → dYI-d1qe.js} +1 -1
  127. package/web/app/immutable/chunks/{Dpt3eqkJ.js → grZaDfdl.js} +1 -1
  128. package/web/app/immutable/chunks/{CMtZLqiA.js → vXXIq-lQ.js} +1 -1
  129. package/web/app/immutable/entry/{app.BdS7izm7.js → app.O58wkIN2.js} +2 -2
  130. package/web/app/immutable/entry/start.Qg9AYZsG.js +1 -0
  131. package/web/app/immutable/nodes/{0.BISzmlhW.js → 0.TrE3RPnJ.js} +1 -1
  132. package/web/app/immutable/nodes/{1.Bb1ZAxDG.js → 1.BIksphyt.js} +1 -1
  133. package/web/app/immutable/nodes/{10.BgrCgg4r.js → 10.D2OvSkOf.js} +1 -1
  134. package/web/app/immutable/nodes/{11.BY0d-QhF.js → 11.fZEErUb-.js} +1 -1
  135. package/web/app/immutable/nodes/{15.DYwYAZ5-.js → 15.m6bg6xQe.js} +1 -1
  136. package/web/app/immutable/nodes/{19.Dlni-a6M.js → 19.CjtjBk01.js} +2 -2
  137. package/web/app/immutable/nodes/{2.CG_3VZwe.js → 2.DxHlcx2L.js} +1 -1
  138. package/web/app/immutable/nodes/{3.Dc7zxR5A.js → 3.BDHxIm-0.js} +1 -1
  139. package/web/app/immutable/nodes/{4.BK4Q0Tjj.js → 4.BNQKhByt.js} +1 -1
  140. package/web/app/immutable/nodes/{5.uyWg8rJg.js → 5.gaULhB1l.js} +1 -1
  141. package/web/app/immutable/nodes/{6.CqIhg880.js → 6.ZtFGqTn7.js} +1 -1
  142. package/web/app/immutable/nodes/{7.DNnSBe4i.js → 7.CTMwqxha.js} +1 -1
  143. package/web/app/immutable/nodes/{8.BGV6mK09.js → 8.DgeODsFV.js} +1 -1
  144. package/web/app/immutable/nodes/{9.BKtZcPwn.js → 9.BPdyHPQC.js} +2 -2
  145. package/web/app/version.json +1 -1
  146. package/web/index.html +9 -9
  147. package/web/app/immutable/entry/start.CnycbH9m.js +0 -1
@@ -1,2 +1,2 @@
1
- import{t as Xt,bo as de,_ as aa,bw as Yt,bs as ge,bq as pr,b as Zt,bm as d}from"./Fcr7AvC-.js";import{bs as Gt,ca as se,aD as e,bH as c,a5 as F,bA as k,W as s,bn as Jt,bV as j,c9 as i,aA as ce,c6 as Ht,ay as ve,be as ot,b$ as ct,b_ as I,bO as m,bS as g,bl as C,aB as x,bj as oa,aw as ut,ai as ia,c5 as ur,a as Lr,a7 as Ue,aj as yt,cd as na,br as la,bf as sa}from"./3SdAC2_C.js";import{i as Y}from"./BhYXv0ZM.js";import{k as Mr}from"./Cc0763mU.js";import{g as Ut}from"./CA6H1-bp.js";import{c as Nt}from"./2z64ELW5.js";import{s as Qe,g as jt,f as Kt}from"./BRCr02in.js";import{b as Rr}from"./Dn334wJv.js";import{JH as R,nZ as jr,wg as Ur,wf as Vr,LX as da,LY as ca,eK as ua,eL as fa,Ln as yr,m6 as nr,CI as $r,sI as kr,ol as va,Ad as pa,ad as Ir,n$ as ga,Ke as ma,Ku as _a,nz as ha,iX as wa,vI as ba,AG as xa,Lm as Pa}from"./D0qhIm1r.js";import{g as ya}from"./DWGXN6Nr.js";import{a as $a,h as ka,j as Ia,c as Sa,d as Ca,i as Fa,e as Da,f as Sr,g as Ta,b as lr}from"./D6H34kDj.js";import{bO as Ea,b$ as La,dI as Ma}from"./Cq6hdiVw.js";import{w as Cr,d as Ra}from"./wEnqV1Ol.js";import{f as ja}from"./CH7HNVC2.js";import{m as sr}from"./qB07BmZl.js";import{f as Te}from"./D-lOH49i.js";import{h as Ua}from"./pYdPYEfN.js";import"./CWfjuhY2.js";import{F as dt,ac as Va,au as za,aZ as Aa,b3 as Ot,ct as Wa,cu as Na,bm as Ba,cS as Ha,c9 as Oa}from"./ChHRVjww.js";import{E as qa,b as Ka,S as Fr}from"./CBbhUF1U.js";import{c as Xa}from"./ChTqQfQN.js";import"./DRMe5Ypb.js";import{$ as Ya}from"./DJPdI2sS.js";import{i as dr,b as Za,a as Ga}from"./H2jLkRRS.js";import{C as fr,p as Ja}from"./Bv-YmUA0.js";import{M as Qa}from"./CMHMpoVu.js";import{l as cr,m as zr}from"./C7b3vXLD.js";import"./CpK0xLH4.js";import"./CpIcQB5T.js";import{M as Bt}from"./CFDesZJP.js";import{V as eo}from"./CyZe9Esu.js";import{bT as to,b7 as ro}from"./D5vlW2SV.js";import{g as ao}from"./DJZIHUd7.js";import{H as oo}from"./Bqd7fdCF.js";import{g as io,W as no}from"./BiBCqvj8.js";import{b as lo,h as so}from"./B7nYGmHN.js";import{u as co}from"./UroPxNaS.js";const Dr=1024*1024,uo=5e3;function fo(A,_){if(A.length>Dr||new TextEncoder().encode(A).byteLength>Dr){_(null);return}let re;try{re=new Worker(new URL("/app/immutable/workers/html-file-preview.worker-BfFljPK-.js",import.meta.url),{type:"module"})}catch{_(null);return}let Be=!1;const ee=setTimeout(()=>O(null),uo);function P(){Be||(Be=!0,clearTimeout(ee),re.terminate())}function O(ae){Be||(P(),_(ae))}return re.onmessage=({data:ae})=>O(ae),re.onerror=ae=>{ae.preventDefault(),O(null)},re.postMessage(A),P}const Ar=R.createSelector((A,_)=>jr(A.pdfPreview.previews,_));var vo=x('<div class="flex shrink-0 flex-wrap items-center justify-center gap-2 border-b border-border p-2"><!> <span aria-live="polite"> </span> <!> <!> <span> </span> <!></div> <div class="min-h-0 flex-1 overflow-auto p-4"><canvas class="mx-auto block" role="img"></canvas></div>',1),po=x('<div class="flex h-full min-h-0 flex-col" data-testid="pdf-viewer"><!></div>');function vr(A,_){if(new.target)return Xt({component:vr,...A});Gt(_,!0);const re=()=>ge(ye,"$preview",Be),[Be,ee]=pr();let P=de(_,"workspaceId",7),O=de(_,"filePath",7),ae=de(_,"gitRootId",7);const Ee=crypto.randomUUID(),ye=Ar(Ee),be=new WeakMap;let oe=j(null),et=j(void 0),U=j(1),B=j(1),pe=j(!0),xe=j(!1),Le=j(null),W=j(0);const $e=i(()=>re()?.error??e(Le)),Ce=i(()=>e($e)==="missing"?d.file_pdf_missing_error():e($e)==="large"?d.file_pdf_large_error():e($e)==="invalid"?d.file_pdf_invalid_error():e($e)==="password"?d.file_pdf_password_error():d.file_pdf_load_error());se(()=>{const v=P(),f=O();e(W);const ie=crypto.randomUUID();return R.dispatch(Ur(Ee,ie,v,f,...ae()?[{gitRootId:ae()}]:[])),()=>{R.dispatch(Vr(Ee,ie))}}),se(()=>{const v=re()?.url;let f=!1,ie;if(c(oe,null),c(Le,null),c(pe,!0),c(U,1),c(B,1),!!v)return(async()=>{try{const{loadPdfDocument:y}=await aa(async()=>{const{loadPdfDocument:N}=await import("./cb1JHFKl.js");return{loadPdfDocument:N}},[],import.meta.url);if(f)return;ie=y(v);const Z=await ie.promise;f||c(oe,Z)}catch(y){if(f)return;c(Le,y instanceof Error&&y.name==="PasswordException"?"password":y instanceof Error&&y.name==="InvalidPDFException"?"invalid":"load",!0)}finally{f||c(pe,!1)}})(),()=>{f=!0,ie?.destroy()}}),se(()=>{const v=e(oe),f=e(et),ie=e(U),y=e(B);if(!v||!f)return;let Z=!1,N,D;const fe=()=>{if(!D)return;const G=(be.get(D)??1)-1;G?be.set(D,G):(be.delete(D),D.cleanup()),D=void 0};return c(xe,!0),(async()=>{try{if(D=await v.getPage(ie),be.set(D,(be.get(D)??0)+1),Z){fe();return}const G=D.getViewport({scale:y}),ne=Math.min(window.devicePixelRatio||1,2,Math.sqrt(16e6/(G.width*G.height)));f.width=Math.ceil(G.width*ne),f.height=Math.ceil(G.height*ne),f.style.width=`${G.width}px`,f.style.height=`${G.height}px`,N=D.render({canvas:f,viewport:G,transform:[ne,0,0,ne,0,0]}),await N.promise}catch{Z||c(Le,"invalid")}finally{Z||c(xe,!1)}})(),()=>{Z=!0,N?.cancel(),N?N.promise.then(fe,fe):fe()}});var qe={get workspaceId(){return P()},set workspaceId(v){P(v),ce()},get filePath(){return O()},set filePath(v){O(v),ce()},get gitRootId(){return ae()},set gitRootId(v){ae(v),ce()},$set:Yt,$on:(v,f)=>Zt(_,v,f)},Ve=po(),Ke=F(Ve);{var ue=v=>{{const f=y=>{ot();var Z=ct();I(()=>m(Z,e(Ce))),s(y,Z)};let ie=i(()=>d.ui_combobox_retry_label());qa(v,{onRetry:()=>Ht(W),get retryLabel(){return e(ie)},class:"m-auto",message:f,$$slots:{message:!0}})}},a=v=>{{let f=i(()=>d.file_pdf_loading_label());Ka(v,{get label(){return e(f)},count:1,class:"p-4"})}},l=v=>{var f=vo(),ie=ve(f),y=F(ie);{let me=i(()=>e(U)<=1);Te(y,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>Ht(U,-1),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.file_pdf_previous_label()]),s(Me,_e)},$$slots:{default:!0}})}var Z=g(y,2),N=C(Z,!0),D=g(Z,2);{let me=i(()=>e(U)>=e(oe).numPages);Te(D,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>Ht(U),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.file_pdf_next_label()]),s(Me,_e)},$$slots:{default:!0}})}var fe=g(D,2);{let me=i(()=>e(B)<=.25);Te(fe,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>c(B,Math.max(.25,e(B)-.25),!0),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.editor_fileViewer_zoomOut_tooltip()]),s(Me,_e)},$$slots:{default:!0}})}var G=g(fe,2),ne=C(G,!0),ft=g(G,2);{let me=i(()=>e(B)>=3);Te(ft,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>c(B,Math.min(3,e(B)+.25),!0),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.editor_fileViewer_zoomIn_tooltip()]),s(Me,_e)},$$slots:{default:!0}})}k(ie);var vt=g(ie,2),pt=F(vt);let bt;Rr(pt,me=>c(et,me),()=>e(et)),k(vt),I((me,Me,tt)=>{m(N,me),m(ne,Me),Qe(vt,"aria-busy",e(xe)),Qe(pt,"aria-label",tt),bt=jt(pt,"",bt,{visibility:e(xe)?"hidden":"visible"})},[()=>d.file_pdf_page_label({page:cr(e(U)),total:cr(e(oe).numPages)}),()=>zr(e(B),{style:"percent"}),()=>d.file_pdf_canvas_ariaLabel({name:O(),page:cr(e(U))})]),s(v,f)};Y(Ke,v=>{e($e)?v(ue):e(pe)||re()?.status==="loading"?v(a,1):e(oe)&&v(l,2)})}k(Ve),s(A,Ve);var q=Jt(qe);return ee(),q}const go=R.createSelector((A,_)=>jr(A.videoPreview.previews,_));var mo=x('<p role="status"> </p>'),_o=x('<p role="alert"> </p>'),ho=x('<div class="flex flex-col items-center gap-3 p-6 text-center text-sm text-subtle"><p class="break-all"> </p> <!> <!></div>'),wo=x('<video controls="" preload="metadata" playsinline="" class="max-w-full max-h-full" data-testid="file-video"> </video>',2),bo=x('<div class="min-h-0 flex-1 flex items-center justify-center bg-background"><!></div>');function Wr(A,_){if(new.target)return Xt({component:Wr,...A});Gt(_,!0);const re=()=>ge(et,"$preview",Be),[Be,ee]=pr();let P=de(_,"sourceUrl",7),O=de(_,"fileName",7),ae=de(_,"allowDownload",7),Ee=de(_,"downloading",7),ye=de(_,"onDownload",7),be=j(null);const oe=crypto.randomUUID(),et=go(oe),U=i(()=>re()?.status==="loading"),B=i(()=>e(be)??re()?.error);let pe=!1,xe=!1;oa(()=>{xe=!0,R.dispatch(da(oe))});function Le(){if(xe||e(U))return;const a=P().startsWith("workspace-file://")?new URL(P()):null;if(pe||!a||!a.pathname.toLowerCase().endsWith(".mp4")){c(be,"unsupported");return}pe=!0,a.searchParams.set("preview","h264"),R.dispatch(ca(oe,a.hostname,a.toString()))}function W(a){if(xe)return;const l=a.currentTarget.error?.code;l===2?c(be,"network"):l!==1&&Le()}var $e={get sourceUrl(){return P()},set sourceUrl(a){P(a),ce()},get fileName(){return O()},set fileName(a){O(a),ce()},get allowDownload(){return ae()},set allowDownload(a){ae(a),ce()},get downloading(){return Ee()},set downloading(a){Ee(a),ce()},get onDownload(){return ye()},set onDownload(a){ye(a),ce()},$set:Yt,$on:(a,l)=>Zt(_,a,l)},Ce=bo(),qe=F(Ce);{var Ve=a=>{var l=ho(),q=F(l),v=C(q,!0),f=g(q,2);{var ie=D=>{var fe=mo(),G=C(fe,!0);I(ne=>m(G,ne),[()=>d.editor_fileViewer_videoPreparing_label()]),s(D,fe)},y=D=>{var fe=_o(),G=C(fe,!0);I(ne=>m(G,ne),[()=>e(B)==="network"?d.editor_fileViewer_videoLoad_error():d.editor_fileViewer_videoUnsupported_label()]),s(D,fe)};Y(f,D=>{e(U)?D(ie):D(y,-1)})}var Z=g(f,2);{var N=D=>{Te(D,{variant:"secondary",size:"sm",get onclick(){return ye()},get disabled(){return Ee()},children:(fe,G)=>{ot();var ne=ct();I(ft=>m(ne,ft),[()=>d.layout_fileTab_downloadFile_label()]),s(fe,ne)},$$slots:{default:!0}})};Y(Z,D=>{ae()&&D(N)})}k(l),I(()=>m(v,O())),s(a,l)},Ke=a=>{var l=wo(),q=C(l,!0);I(v=>{Qe(l,"src",re()?.url??P()),m(q,v)},[()=>d.editor_fileViewer_videoUnsupported_label()]),ut("error",l,W),ut("loadedmetadata",l,v=>{v.currentTarget.videoWidth===0&&Le()}),s(a,l)};Y(qe,a=>{e(B)||e(U)?a(Ve):a(Ke,-1)})}k(Ce),s(A,Ce);var ue=Jt($e);return ee(),ue}var xo=x('<!> <span class="text-xs text-subtle min-w-[50px] text-center"> </span> <!> <div class="w-px h-5 bg-border mx-1"></div>',1),Po=x('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="w-px h-5 bg-border mx-1"></div> <!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),yo=x('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),$o=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"></path></svg></div> <div class="text-sm text-subtle mb-4"> </div> <audio controls="" class="w-full max-w-md"><source/> </audio></div>'),ko=x("<!> ",1),Io=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg></div> <p class="text-sm text-subtle mb-4"> </p> <!></div>'),So=x('<th class="border border-border px-2 py-1 text-left text-xs font-medium bg-muted"> </th>'),Co=x('<td class="border border-border px-2 py-1 text-xs"> </td>'),Fo=x("<tr></tr>"),Do=x('<div class="flex-1 overflow-auto p-4"><table class="w-full border-collapse"><thead><tr></tr></thead><tbody></tbody></table></div>'),To=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),Eo=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),Lo=x('<div class="h-full flex flex-col"><!></div>');function qt(A,_){if(new.target)return Xt({component:qt,...A});Gt(_,!0);const re=t=>{var o=xo(),u=ve(o);{let V=i(()=>d.editor_fileViewer_zoomOut_tooltip());Te(u,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:fe,get title(){return e(V)},children:(T,K)=>{dt(T,{get icon(){return Wa},size:"sm"})},$$slots:{default:!0}})}var w=g(u,2),$=C(w,!0),E=g(w,2);{let V=i(()=>d.editor_fileViewer_zoomIn_tooltip());Te(E,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:D,get title(){return e(V)},children:(T,K)=>{dt(T,{get icon(){return Na},size:"sm"})},$$slots:{default:!0}})}ot(2),I(()=>m($,e(Le))),s(t,o)},Be=Xa("FileViewer");let ee=de(_,"filePath",7),P=de(_,"fileContent",7,""),O=de(_,"sourceUrl",7),ae=de(_,"language",7),Ee=de(_,"isBinary",7),ye=de(_,"allowDownload",7,!0),be=de(_,"onDownload",7),oe=de(_,"downloading",7,!1);const et=t=>{const o=t.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","webp","bmp","ico","avif"].includes(o)?"image":o==="svg"?"svg":["mp4","webm","ogg","mov","avi"].includes(o)?"video":["mp3","wav","ogg","m4a","flac"].includes(o)?"audio":o==="pdf"?"pdf":["md","markdown"].includes(o)?"markdown":o==="json"?"json":o==="csv"?"csv":["yaml","yml"].includes(o)?"yaml":o==="xml"?"xml":["zip","tar","gz","rar","7z","bz2"].includes(o)?"archive":["exe","dll","so","dylib","wasm"].includes(o)?"binary":"text"},U=i(()=>et(ee())),B=i(()=>ee().split("/").pop()||d.editor_fileViewer_unknown_fallback());let pe=j(100),xe=j(0);const Le=i(()=>zr(e(pe)/100,{style:"percent",maximumFractionDigits:0}));let W=j(!1),$e=j(0),Ce=j(0),qe=j(0),Ve=j(0),Ke=j(!1),ue=null;function a(){const t=ue;ue=null,c(Ke,!1),t?.viewport.hasPointerCapture(t.pointerId)&&t.viewport.releasePointerCapture(t.pointerId)}function l(t){if(t.button!==0||!t.isPrimary||ue)return;const o=t.currentTarget;o.setPointerCapture(t.pointerId),ue={pointerId:t.pointerId,x:t.clientX,y:t.clientY,viewport:o},c(Ke,!0),t.preventDefault()}function q(t){if(!(!ue||t.pointerId!==ue.pointerId)){if((t.buttons&1)===0){a();return}c(qe,ue.viewport.scrollLeft,!0),c(Ve,ue.viewport.scrollTop,!0),c($e,e($e)+(t.clientX-ue.x)),c(Ce,e(Ce)+(t.clientY-ue.y)),ue.x=t.clientX,ue.y=t.clientY}}function v(t){t.pointerId===ue?.pointerId&&a()}se(()=>{ee(),O(),e(pe),e(xe),c(qe,0),c(Ve,0)}),se(()=>(ee(),O(),ur(()=>{a(),c($e,0),c(Ce,0)}),a));const f=t=>{const o=t.split(".").pop()?.toLowerCase();return o==="jpg"||o==="jpeg"?"image/jpeg":o==="png"?"image/png":o==="gif"?"image/gif":o==="webp"?"image/webp":"application/octet-stream"},ie=t=>{const o=t.split(".").pop()?.toLowerCase();if(o==="mp4")return"video/mp4";if(o==="webm")return"video/webm"},y=()=>{if(O())return O();if(typeof P()=="string")return P().startsWith("data:")||P().startsWith("http")?P():Ee()?`data:${f(ee())};base64,${P()}`:`data:${f(ee())};base64,${P()}`;if(P()instanceof ArrayBuffer){const o=new Uint8Array(P()).reduce((w,$)=>w+String.fromCharCode($),""),u=btoa(o);return`data:${f(ee())};base64,${u}`}return""},Z=()=>{if(O())return O();const t=ie(ee());if(!t)return"";if(typeof P()=="string")return P().startsWith("data:")||P().startsWith("http")?P():`data:${t};base64,${P()}`;const o=new Uint8Array(P()),u=[],w=32768;for(let $=0;$<o.length;$+=w)u.push(String.fromCharCode(...o.subarray($,$+w)));return`data:${t};base64,${btoa(u.join(""))}`},N=()=>{const t=typeof P()=="string"?new TextEncoder().encode(P()):new Uint8Array(P()),o=[],u=32768;for(let w=0;w<t.length;w+=u)o.push(String.fromCharCode(...t.subarray(w,w+u)));return`data:image/svg+xml;base64,${btoa(o.join(""))}`},D=()=>{c(pe,Math.min(e(pe)+25,500),!0)},fe=()=>{c(pe,Math.max(e(pe)-25,25),!0)},G=()=>{c(xe,(e(xe)+90)%360)},ne=()=>{if(!ye()||oe())return;if(be()){be()();return}const t=document.createElement("a");t.href=e(U)==="video"?Z():e(U)==="svg"?N():y(),t.download=e(B),t.click()},ft=async()=>{try{const t=y(),o=new Image;o.crossOrigin="anonymous";const u=await new Promise((w,$)=>{o.onload=()=>{const E=document.createElement("canvas");E.width=o.naturalWidth,E.height=o.naturalHeight;const V=E.getContext("2d");if(!V){$(new Error("Failed to get canvas context"));return}V.drawImage(o,0,0),E.toBlob(T=>{T?w(T):$(new Error("Failed to create blob from canvas"))},"image/png",1)},o.onerror=()=>$(new Error("Failed to load image")),o.src=t});await navigator.clipboard.write([new ClipboardItem({"image/png":u})]),c(W,!0),setTimeout(()=>c(W,!1),2e3)}catch(t){Be.error("Failed to copy image:",t)}},vt=t=>{try{const o=JSON.parse(t);return JSON.stringify(o,null,2)}catch{return t}},pt=t=>t.split(`
1
+ import{t as Xt,bo as de,_ as aa,bw as Yt,bs as ge,bq as pr,b as Zt,bm as d}from"./Fcr7AvC-.js";import{bs as Gt,ca as se,aD as e,bH as c,a5 as F,bA as k,W as s,bn as Jt,bV as j,c9 as i,aA as ce,c6 as Ht,ay as ve,be as ot,b$ as ct,b_ as I,bO as m,bS as g,bl as C,aB as x,bj as oa,aw as ut,ai as ia,c5 as ur,a as Lr,a7 as Ue,aj as yt,cd as na,br as la,bf as sa}from"./3SdAC2_C.js";import{i as Y}from"./BhYXv0ZM.js";import{k as Mr}from"./Cc0763mU.js";import{g as Ut}from"./CA6H1-bp.js";import{c as Nt}from"./2z64ELW5.js";import{s as Qe,g as jt,f as Kt}from"./BRCr02in.js";import{b as Rr}from"./Dn334wJv.js";import{JH as R,nZ as jr,wg as Ur,wf as Vr,LX as da,LY as ca,eK as ua,eL as fa,Ln as yr,m6 as nr,CI as $r,sI as kr,ol as va,Ad as pa,ad as Ir,n$ as ga,Ke as ma,Ku as _a,nz as ha,iX as wa,vI as ba,AG as xa,Lm as Pa}from"./D0qhIm1r.js";import{g as ya}from"./DWGXN6Nr.js";import{a as $a,h as ka,j as Ia,c as Sa,d as Ca,i as Fa,e as Da,f as Sr,g as Ta,b as lr}from"./D6H34kDj.js";import{bO as Ea,b$ as La,dI as Ma}from"./Cq6hdiVw.js";import{w as Cr,d as Ra}from"./wEnqV1Ol.js";import{f as ja}from"./CH7HNVC2.js";import{m as sr}from"./qB07BmZl.js";import{f as Te}from"./D-lOH49i.js";import{h as Ua}from"./pYdPYEfN.js";import"./CWfjuhY2.js";import{F as dt,ac as Va,au as za,aZ as Aa,b3 as Ot,ct as Wa,cu as Na,bm as Ba,cS as Ha,c9 as Oa}from"./ChHRVjww.js";import{E as qa,b as Ka,S as Fr}from"./CBbhUF1U.js";import{c as Xa}from"./ChTqQfQN.js";import"./DRMe5Ypb.js";import{$ as Ya}from"./C-vJzBpf.js";import{i as dr,b as Za,a as Ga}from"./H2jLkRRS.js";import{C as fr,p as Ja}from"./Bv-YmUA0.js";import{M as Qa}from"./Cym4zMqt.js";import{l as cr,m as zr}from"./C7b3vXLD.js";import"./CpK0xLH4.js";import"./CpIcQB5T.js";import{M as Bt}from"./CFDesZJP.js";import{V as eo}from"./CyZe9Esu.js";import{bT as to,b7 as ro}from"./Db6ExzGF.js";import{g as ao}from"./DJZIHUd7.js";import{H as oo}from"./Bqd7fdCF.js";import{g as io,W as no}from"./BiBCqvj8.js";import{b as lo,h as so}from"./B7nYGmHN.js";import{u as co}from"./UroPxNaS.js";const Dr=1024*1024,uo=5e3;function fo(A,_){if(A.length>Dr||new TextEncoder().encode(A).byteLength>Dr){_(null);return}let re;try{re=new Worker(new URL("/app/immutable/workers/html-file-preview.worker-BfFljPK-.js",import.meta.url),{type:"module"})}catch{_(null);return}let Be=!1;const ee=setTimeout(()=>O(null),uo);function P(){Be||(Be=!0,clearTimeout(ee),re.terminate())}function O(ae){Be||(P(),_(ae))}return re.onmessage=({data:ae})=>O(ae),re.onerror=ae=>{ae.preventDefault(),O(null)},re.postMessage(A),P}const Ar=R.createSelector((A,_)=>jr(A.pdfPreview.previews,_));var vo=x('<div class="flex shrink-0 flex-wrap items-center justify-center gap-2 border-b border-border p-2"><!> <span aria-live="polite"> </span> <!> <!> <span> </span> <!></div> <div class="min-h-0 flex-1 overflow-auto p-4"><canvas class="mx-auto block" role="img"></canvas></div>',1),po=x('<div class="flex h-full min-h-0 flex-col" data-testid="pdf-viewer"><!></div>');function vr(A,_){if(new.target)return Xt({component:vr,...A});Gt(_,!0);const re=()=>ge(ye,"$preview",Be),[Be,ee]=pr();let P=de(_,"workspaceId",7),O=de(_,"filePath",7),ae=de(_,"gitRootId",7);const Ee=crypto.randomUUID(),ye=Ar(Ee),be=new WeakMap;let oe=j(null),et=j(void 0),U=j(1),B=j(1),pe=j(!0),xe=j(!1),Le=j(null),W=j(0);const $e=i(()=>re()?.error??e(Le)),Ce=i(()=>e($e)==="missing"?d.file_pdf_missing_error():e($e)==="large"?d.file_pdf_large_error():e($e)==="invalid"?d.file_pdf_invalid_error():e($e)==="password"?d.file_pdf_password_error():d.file_pdf_load_error());se(()=>{const v=P(),f=O();e(W);const ie=crypto.randomUUID();return R.dispatch(Ur(Ee,ie,v,f,...ae()?[{gitRootId:ae()}]:[])),()=>{R.dispatch(Vr(Ee,ie))}}),se(()=>{const v=re()?.url;let f=!1,ie;if(c(oe,null),c(Le,null),c(pe,!0),c(U,1),c(B,1),!!v)return(async()=>{try{const{loadPdfDocument:y}=await aa(async()=>{const{loadPdfDocument:N}=await import("./cb1JHFKl.js");return{loadPdfDocument:N}},[],import.meta.url);if(f)return;ie=y(v);const Z=await ie.promise;f||c(oe,Z)}catch(y){if(f)return;c(Le,y instanceof Error&&y.name==="PasswordException"?"password":y instanceof Error&&y.name==="InvalidPDFException"?"invalid":"load",!0)}finally{f||c(pe,!1)}})(),()=>{f=!0,ie?.destroy()}}),se(()=>{const v=e(oe),f=e(et),ie=e(U),y=e(B);if(!v||!f)return;let Z=!1,N,D;const fe=()=>{if(!D)return;const G=(be.get(D)??1)-1;G?be.set(D,G):(be.delete(D),D.cleanup()),D=void 0};return c(xe,!0),(async()=>{try{if(D=await v.getPage(ie),be.set(D,(be.get(D)??0)+1),Z){fe();return}const G=D.getViewport({scale:y}),ne=Math.min(window.devicePixelRatio||1,2,Math.sqrt(16e6/(G.width*G.height)));f.width=Math.ceil(G.width*ne),f.height=Math.ceil(G.height*ne),f.style.width=`${G.width}px`,f.style.height=`${G.height}px`,N=D.render({canvas:f,viewport:G,transform:[ne,0,0,ne,0,0]}),await N.promise}catch{Z||c(Le,"invalid")}finally{Z||c(xe,!1)}})(),()=>{Z=!0,N?.cancel(),N?N.promise.then(fe,fe):fe()}});var qe={get workspaceId(){return P()},set workspaceId(v){P(v),ce()},get filePath(){return O()},set filePath(v){O(v),ce()},get gitRootId(){return ae()},set gitRootId(v){ae(v),ce()},$set:Yt,$on:(v,f)=>Zt(_,v,f)},Ve=po(),Ke=F(Ve);{var ue=v=>{{const f=y=>{ot();var Z=ct();I(()=>m(Z,e(Ce))),s(y,Z)};let ie=i(()=>d.ui_combobox_retry_label());qa(v,{onRetry:()=>Ht(W),get retryLabel(){return e(ie)},class:"m-auto",message:f,$$slots:{message:!0}})}},a=v=>{{let f=i(()=>d.file_pdf_loading_label());Ka(v,{get label(){return e(f)},count:1,class:"p-4"})}},l=v=>{var f=vo(),ie=ve(f),y=F(ie);{let me=i(()=>e(U)<=1);Te(y,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>Ht(U,-1),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.file_pdf_previous_label()]),s(Me,_e)},$$slots:{default:!0}})}var Z=g(y,2),N=C(Z,!0),D=g(Z,2);{let me=i(()=>e(U)>=e(oe).numPages);Te(D,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>Ht(U),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.file_pdf_next_label()]),s(Me,_e)},$$slots:{default:!0}})}var fe=g(D,2);{let me=i(()=>e(B)<=.25);Te(fe,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>c(B,Math.max(.25,e(B)-.25),!0),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.editor_fileViewer_zoomOut_tooltip()]),s(Me,_e)},$$slots:{default:!0}})}var G=g(fe,2),ne=C(G,!0),ft=g(G,2);{let me=i(()=>e(B)>=3);Te(ft,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>c(B,Math.min(3,e(B)+.25),!0),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.editor_fileViewer_zoomIn_tooltip()]),s(Me,_e)},$$slots:{default:!0}})}k(ie);var vt=g(ie,2),pt=F(vt);let bt;Rr(pt,me=>c(et,me),()=>e(et)),k(vt),I((me,Me,tt)=>{m(N,me),m(ne,Me),Qe(vt,"aria-busy",e(xe)),Qe(pt,"aria-label",tt),bt=jt(pt,"",bt,{visibility:e(xe)?"hidden":"visible"})},[()=>d.file_pdf_page_label({page:cr(e(U)),total:cr(e(oe).numPages)}),()=>zr(e(B),{style:"percent"}),()=>d.file_pdf_canvas_ariaLabel({name:O(),page:cr(e(U))})]),s(v,f)};Y(Ke,v=>{e($e)?v(ue):e(pe)||re()?.status==="loading"?v(a,1):e(oe)&&v(l,2)})}k(Ve),s(A,Ve);var q=Jt(qe);return ee(),q}const go=R.createSelector((A,_)=>jr(A.videoPreview.previews,_));var mo=x('<p role="status"> </p>'),_o=x('<p role="alert"> </p>'),ho=x('<div class="flex flex-col items-center gap-3 p-6 text-center text-sm text-subtle"><p class="break-all"> </p> <!> <!></div>'),wo=x('<video controls="" preload="metadata" playsinline="" class="max-w-full max-h-full" data-testid="file-video"> </video>',2),bo=x('<div class="min-h-0 flex-1 flex items-center justify-center bg-background"><!></div>');function Wr(A,_){if(new.target)return Xt({component:Wr,...A});Gt(_,!0);const re=()=>ge(et,"$preview",Be),[Be,ee]=pr();let P=de(_,"sourceUrl",7),O=de(_,"fileName",7),ae=de(_,"allowDownload",7),Ee=de(_,"downloading",7),ye=de(_,"onDownload",7),be=j(null);const oe=crypto.randomUUID(),et=go(oe),U=i(()=>re()?.status==="loading"),B=i(()=>e(be)??re()?.error);let pe=!1,xe=!1;oa(()=>{xe=!0,R.dispatch(da(oe))});function Le(){if(xe||e(U))return;const a=P().startsWith("workspace-file://")?new URL(P()):null;if(pe||!a||!a.pathname.toLowerCase().endsWith(".mp4")){c(be,"unsupported");return}pe=!0,a.searchParams.set("preview","h264"),R.dispatch(ca(oe,a.hostname,a.toString()))}function W(a){if(xe)return;const l=a.currentTarget.error?.code;l===2?c(be,"network"):l!==1&&Le()}var $e={get sourceUrl(){return P()},set sourceUrl(a){P(a),ce()},get fileName(){return O()},set fileName(a){O(a),ce()},get allowDownload(){return ae()},set allowDownload(a){ae(a),ce()},get downloading(){return Ee()},set downloading(a){Ee(a),ce()},get onDownload(){return ye()},set onDownload(a){ye(a),ce()},$set:Yt,$on:(a,l)=>Zt(_,a,l)},Ce=bo(),qe=F(Ce);{var Ve=a=>{var l=ho(),q=F(l),v=C(q,!0),f=g(q,2);{var ie=D=>{var fe=mo(),G=C(fe,!0);I(ne=>m(G,ne),[()=>d.editor_fileViewer_videoPreparing_label()]),s(D,fe)},y=D=>{var fe=_o(),G=C(fe,!0);I(ne=>m(G,ne),[()=>e(B)==="network"?d.editor_fileViewer_videoLoad_error():d.editor_fileViewer_videoUnsupported_label()]),s(D,fe)};Y(f,D=>{e(U)?D(ie):D(y,-1)})}var Z=g(f,2);{var N=D=>{Te(D,{variant:"secondary",size:"sm",get onclick(){return ye()},get disabled(){return Ee()},children:(fe,G)=>{ot();var ne=ct();I(ft=>m(ne,ft),[()=>d.layout_fileTab_downloadFile_label()]),s(fe,ne)},$$slots:{default:!0}})};Y(Z,D=>{ae()&&D(N)})}k(l),I(()=>m(v,O())),s(a,l)},Ke=a=>{var l=wo(),q=C(l,!0);I(v=>{Qe(l,"src",re()?.url??P()),m(q,v)},[()=>d.editor_fileViewer_videoUnsupported_label()]),ut("error",l,W),ut("loadedmetadata",l,v=>{v.currentTarget.videoWidth===0&&Le()}),s(a,l)};Y(qe,a=>{e(B)||e(U)?a(Ve):a(Ke,-1)})}k(Ce),s(A,Ce);var ue=Jt($e);return ee(),ue}var xo=x('<!> <span class="text-xs text-subtle min-w-[50px] text-center"> </span> <!> <div class="w-px h-5 bg-border mx-1"></div>',1),Po=x('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="w-px h-5 bg-border mx-1"></div> <!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),yo=x('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),$o=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"></path></svg></div> <div class="text-sm text-subtle mb-4"> </div> <audio controls="" class="w-full max-w-md"><source/> </audio></div>'),ko=x("<!> ",1),Io=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg></div> <p class="text-sm text-subtle mb-4"> </p> <!></div>'),So=x('<th class="border border-border px-2 py-1 text-left text-xs font-medium bg-muted"> </th>'),Co=x('<td class="border border-border px-2 py-1 text-xs"> </td>'),Fo=x("<tr></tr>"),Do=x('<div class="flex-1 overflow-auto p-4"><table class="w-full border-collapse"><thead><tr></tr></thead><tbody></tbody></table></div>'),To=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),Eo=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),Lo=x('<div class="h-full flex flex-col"><!></div>');function qt(A,_){if(new.target)return Xt({component:qt,...A});Gt(_,!0);const re=t=>{var o=xo(),u=ve(o);{let V=i(()=>d.editor_fileViewer_zoomOut_tooltip());Te(u,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:fe,get title(){return e(V)},children:(T,K)=>{dt(T,{get icon(){return Wa},size:"sm"})},$$slots:{default:!0}})}var w=g(u,2),$=C(w,!0),E=g(w,2);{let V=i(()=>d.editor_fileViewer_zoomIn_tooltip());Te(E,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:D,get title(){return e(V)},children:(T,K)=>{dt(T,{get icon(){return Na},size:"sm"})},$$slots:{default:!0}})}ot(2),I(()=>m($,e(Le))),s(t,o)},Be=Xa("FileViewer");let ee=de(_,"filePath",7),P=de(_,"fileContent",7,""),O=de(_,"sourceUrl",7),ae=de(_,"language",7),Ee=de(_,"isBinary",7),ye=de(_,"allowDownload",7,!0),be=de(_,"onDownload",7),oe=de(_,"downloading",7,!1);const et=t=>{const o=t.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","webp","bmp","ico","avif"].includes(o)?"image":o==="svg"?"svg":["mp4","webm","ogg","mov","avi"].includes(o)?"video":["mp3","wav","ogg","m4a","flac"].includes(o)?"audio":o==="pdf"?"pdf":["md","markdown"].includes(o)?"markdown":o==="json"?"json":o==="csv"?"csv":["yaml","yml"].includes(o)?"yaml":o==="xml"?"xml":["zip","tar","gz","rar","7z","bz2"].includes(o)?"archive":["exe","dll","so","dylib","wasm"].includes(o)?"binary":"text"},U=i(()=>et(ee())),B=i(()=>ee().split("/").pop()||d.editor_fileViewer_unknown_fallback());let pe=j(100),xe=j(0);const Le=i(()=>zr(e(pe)/100,{style:"percent",maximumFractionDigits:0}));let W=j(!1),$e=j(0),Ce=j(0),qe=j(0),Ve=j(0),Ke=j(!1),ue=null;function a(){const t=ue;ue=null,c(Ke,!1),t?.viewport.hasPointerCapture(t.pointerId)&&t.viewport.releasePointerCapture(t.pointerId)}function l(t){if(t.button!==0||!t.isPrimary||ue)return;const o=t.currentTarget;o.setPointerCapture(t.pointerId),ue={pointerId:t.pointerId,x:t.clientX,y:t.clientY,viewport:o},c(Ke,!0),t.preventDefault()}function q(t){if(!(!ue||t.pointerId!==ue.pointerId)){if((t.buttons&1)===0){a();return}c(qe,ue.viewport.scrollLeft,!0),c(Ve,ue.viewport.scrollTop,!0),c($e,e($e)+(t.clientX-ue.x)),c(Ce,e(Ce)+(t.clientY-ue.y)),ue.x=t.clientX,ue.y=t.clientY}}function v(t){t.pointerId===ue?.pointerId&&a()}se(()=>{ee(),O(),e(pe),e(xe),c(qe,0),c(Ve,0)}),se(()=>(ee(),O(),ur(()=>{a(),c($e,0),c(Ce,0)}),a));const f=t=>{const o=t.split(".").pop()?.toLowerCase();return o==="jpg"||o==="jpeg"?"image/jpeg":o==="png"?"image/png":o==="gif"?"image/gif":o==="webp"?"image/webp":"application/octet-stream"},ie=t=>{const o=t.split(".").pop()?.toLowerCase();if(o==="mp4")return"video/mp4";if(o==="webm")return"video/webm"},y=()=>{if(O())return O();if(typeof P()=="string")return P().startsWith("data:")||P().startsWith("http")?P():Ee()?`data:${f(ee())};base64,${P()}`:`data:${f(ee())};base64,${P()}`;if(P()instanceof ArrayBuffer){const o=new Uint8Array(P()).reduce((w,$)=>w+String.fromCharCode($),""),u=btoa(o);return`data:${f(ee())};base64,${u}`}return""},Z=()=>{if(O())return O();const t=ie(ee());if(!t)return"";if(typeof P()=="string")return P().startsWith("data:")||P().startsWith("http")?P():`data:${t};base64,${P()}`;const o=new Uint8Array(P()),u=[],w=32768;for(let $=0;$<o.length;$+=w)u.push(String.fromCharCode(...o.subarray($,$+w)));return`data:${t};base64,${btoa(u.join(""))}`},N=()=>{const t=typeof P()=="string"?new TextEncoder().encode(P()):new Uint8Array(P()),o=[],u=32768;for(let w=0;w<t.length;w+=u)o.push(String.fromCharCode(...t.subarray(w,w+u)));return`data:image/svg+xml;base64,${btoa(o.join(""))}`},D=()=>{c(pe,Math.min(e(pe)+25,500),!0)},fe=()=>{c(pe,Math.max(e(pe)-25,25),!0)},G=()=>{c(xe,(e(xe)+90)%360)},ne=()=>{if(!ye()||oe())return;if(be()){be()();return}const t=document.createElement("a");t.href=e(U)==="video"?Z():e(U)==="svg"?N():y(),t.download=e(B),t.click()},ft=async()=>{try{const t=y(),o=new Image;o.crossOrigin="anonymous";const u=await new Promise((w,$)=>{o.onload=()=>{const E=document.createElement("canvas");E.width=o.naturalWidth,E.height=o.naturalHeight;const V=E.getContext("2d");if(!V){$(new Error("Failed to get canvas context"));return}V.drawImage(o,0,0),E.toBlob(T=>{T?w(T):$(new Error("Failed to create blob from canvas"))},"image/png",1)},o.onerror=()=>$(new Error("Failed to load image")),o.src=t});await navigator.clipboard.write([new ClipboardItem({"image/png":u})]),c(W,!0),setTimeout(()=>c(W,!1),2e3)}catch(t){Be.error("Failed to copy image:",t)}},vt=t=>{try{const o=JSON.parse(t);return JSON.stringify(o,null,2)}catch{return t}},pt=t=>t.split(`
2
2
  `).map(u=>u.split(",").map(w=>w.trim()));var bt={get filePath(){return ee()},set filePath(t){ee(t),ce()},get fileContent(){return P()},set fileContent(t=""){P(t),ce()},get sourceUrl(){return O()},set sourceUrl(t){O(t),ce()},get language(){return ae()},set language(t){ae(t),ce()},get isBinary(){return Ee()},set isBinary(t){Ee(t),ce()},get allowDownload(){return ye()},set allowDownload(t=!0){ye(t),ce()},get onDownload(){return be()},set onDownload(t){be(t),ce()},get downloading(){return oe()},set downloading(t=!1){oe(t),ce()},$set:Yt,$on:(t,o)=>Zt(_,t,o)},me=Lo();ut("blur",Lr,a);var Me=F(me);{var tt=t=>{var o=Po(),u=F(o),w=F(u);re(w);var $=g(w,2);{let Pe=i(()=>d.editor_fileViewer_rotate_tooltip());Te($,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:G,get title(){return e(Pe)},children:(Ae,Ye)=>{dt(Ae,{get icon(){return Va},size:"sm"})},$$slots:{default:!0}})}var E=g($,4);{let Pe=i(()=>d.editor_fileViewer_copyImage_tooltip());Te(E,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ft,get title(){return e(Pe)},children:(Ae,Ye)=>{var rt=Ue(),Ze=ve(rt);{var kt=Fe=>{dt(Fe,{get icon(){return za},size:"sm",class:"text-green-500"})},Vt=Fe=>{dt(Fe,{get icon(){return Aa},size:"sm"})};Y(Ze,Fe=>{e(W)?Fe(kt):Fe(Vt,-1)})}s(Ae,rt)},$$slots:{default:!0}})}var V=g(E,2);{let Pe=i(()=>!ye()||oe()),Ae=i(()=>d.editor_fileViewer_download_tooltip());Te(V,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ne,get disabled(){return e(Pe)},get title(){return e(Ae)},children:(Ye,rt)=>{dt(Ye,{get icon(){return Ot},size:"sm"})},$$slots:{default:!0}})}var T=g(V,2),K=C(T,!0);k(u);var L=g(u,2),he=C(L);k(o),I(Pe=>{m(K,e(B)),Kt(L,1,`relative min-h-0 flex-1 overflow-auto bg-checkered flex items-center justify-center p-4 select-none ${e(Ke)?"cursor-grabbing":"cursor-grab"}`,"svelte-1uj35xu"),jt(L,`--pan-scroll-x: ${e(qe)??""}px; --pan-scroll-y: ${e(Ve)??""}px;`),Qe(he,"src",Pe),Qe(he,"alt",e(B)),jt(he,`translate: ${e($e)??""}px ${e(Ce)??""}px; transform: scale(${e(pe)/100}) rotate(${e(xe)??""}deg); transition: transform 0.2s;`)},[()=>y()]),yt("pointerdown",L,l),yt("pointermove",L,q),yt("pointerup",L,v),ut("pointercancel",L,v),ut("lostpointercapture",L,v),s(t,o)},_e=t=>{var o=yo(),u=F(o),w=F(u);re(w);var $=g(w,2);{let L=i(()=>!ye()||oe()),he=i(()=>d.editor_fileViewer_download_tooltip());Te($,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ne,get disabled(){return e(L)},get title(){return e(he)},children:(Pe,Ae)=>{dt(Pe,{get icon(){return Ot},size:"sm"})},$$slots:{default:!0}})}var E=g($,2),V=C(E,!0);k(u);var T=g(u,2),K=C(T);k(o),I(L=>{m(V,e(B)),Kt(T,1,`relative min-h-0 flex-1 overflow-auto bg-checkered flex items-center justify-center p-4 select-none ${e(Ke)?"cursor-grabbing":"cursor-grab"}`,"svelte-1uj35xu"),jt(T,`--pan-scroll-x: ${e(qe)??""}px; --pan-scroll-y: ${e(Ve)??""}px;`),Qe(K,"src",L),Qe(K,"alt",e(B)),jt(K,`translate: ${e($e)??""}px ${e(Ce)??""}px; transform: scale(${e(pe)/100});`)},[()=>N()]),yt("pointerdown",T,l),yt("pointermove",T,q),yt("pointerup",T,v),ut("pointercancel",T,v),ut("lostpointercapture",T,v),s(t,o)},Re=t=>{const o=i(Z);var u=Ue(),w=ve(u);Mr(w,()=>ee()+e(o),$=>{Wr($,{get sourceUrl(){return e(o)},get fileName(){return e(B)},get allowDownload(){return ye()},get downloading(){return oe()},onDownload:ne})}),s(t,u)},Qt=t=>{var o=$o(),u=g(F(o),2),w=C(u,!0),$=g(u,2),E=F($),V=g(E);k($),k(o),I((T,K)=>{m(w,e(B)),Qe(E,"src",T),m(V,` ${K??""}`)},[()=>y(),()=>d.editor_fileViewer_audioUnsupported_label()]),s(t,o)},$t=t=>{var o=Io(),u=g(F(o),2),w=C(u,!0),$=g(u,2);{let E=i(()=>!ye()||oe());Te($,{size:"sm",variant:"secondary",onclick:ne,get disabled(){return e(E)},children:(V,T)=>{var K=ko(),L=ve(K);dt(L,{get icon(){return Ot},size:"sm",class:"mr-2"});var he=g(L);I(Pe=>m(he,` ${Pe??""}`),[()=>d.editor_fileViewer_downloadPdf_label()]),s(V,K)},$$slots:{default:!0}})}k(o),I(E=>m(w,E),[()=>d.editor_fileViewer_pdfUnavailable_label()]),s(t,o)},er=t=>{{let o=i(()=>vt(P().toString()));fr(t,{get value(){return e(o)},language:"json",get fileName(){return ee()},lineNumbers:!0,readOnly:!0})}},tr=t=>{const o=i(()=>pt(P().toString()));var u=Do(),w=F(u),$=F(w),E=F($);Ut(E,23,()=>e(o)[0]||[],(T,K)=>`header-${K}-${T}`,(T,K)=>{var L=So(),he=C(L,!0);I(()=>m(he,e(K))),s(T,L)}),k(E),k($);var V=g($);Ut(V,23,()=>e(o).slice(1),(T,K)=>`row-${K}`,(T,K,L)=>{var he=Fo();Ut(he,23,()=>e(K),(Pe,Ae)=>`cell-${e(L)}-${Ae}`,(Pe,Ae)=>{var Ye=Co(),rt=C(Ye,!0);I(()=>m(rt,e(Ae))),s(Pe,Ye)}),k(he),s(T,he)}),k(V),k(w),k(u),s(t,u)},Xe=t=>{var o=To(),u=g(F(o),2),w=C(u,!0),$=g(u,2),E=C($,!0);k(o),I(V=>{m(w,e(B)),m(E,V)},[()=>d.editor_fileViewer_archive_label()]),s(t,o)},ze=t=>{var o=Eo(),u=g(F(o),2),w=C(u,!0),$=g(u,2),E=C($,!0);k(o),I(V=>{m(w,e(B)),m(E,V)},[()=>d.editor_fileViewer_binary_label()]),s(t,o)},rr=t=>{{let o=i(()=>P().toString());fr(t,{get value(){return e(o)},get language(){return ae()},get fileName(){return ee()},lineNumbers:!0,highlightActiveLine:!0})}};Y(Me,t=>{e(U)==="image"?t(tt):e(U)==="svg"?t(_e,1):e(U)==="video"?t(Re,2):e(U)==="audio"?t(Qt,3):e(U)==="pdf"?t($t,4):e(U)==="json"?t(er,5):e(U)==="csv"?t(tr,6):e(U)==="archive"?t(Xe,7):e(U)==="binary"?t(ze,8):t(rr,-1)})}return k(me),s(A,me),Jt(bt)}ia(["pointerdown","pointermove","pointerup"]);const Mo=/access denied|permission denied|outside (?:the )?workspace/i,Ro=/file not found|no such file or directory/i;function jo(A){return Mo.test(A)?"access-denied":A===d.files_read_notFound_error()||Ro.test(A)?"not-found":"generic"}function Uo(A){switch(A){case"access-denied":return d.layout_fileTab_errorAccessDenied_label();case"not-found":return d.layout_fileTab_errorNotFound_label();case"generic":return d.layout_fileTab_errorGeneric_label()}}var Vo=x("<!> <!>",1),zo=x("<!> <!> <!>",1),Ao=x('<div class="flex flex-col items-center justify-center h-full text-subtle gap-2"><p> </p> <p class="text-xs"> </p></div>'),Tr=x('<div class="flex h-full items-center justify-center p-4 text-subtle"><p role="alert"> </p></div>'),Wo=x('<div class="flex h-full items-center justify-center text-subtle"><p> </p></div>'),Er=x('<div class="flex items-center justify-center h-full text-subtle"><p> </p></div>'),No=x('<div class="flex items-center gap-3"><!> <!></div>'),Bo=x('<div class="flex flex-col h-full"><div class="flex-1 p-4 space-y-2"></div></div>'),Ho=x('<p class="text-xs"> </p>'),Oo=x("<li><!></li>"),qo=x('<p class="text-xs mt-2"> </p> <ul class="flex flex-col items-center gap-1"></ul>',1),Ko=x('<div class="flex flex-col items-center justify-center h-full text-subtle gap-2"><p class="text-danger" role="alert"> </p> <p class="text-xs font-mono"> </p> <!> <!></div>'),Xo=x('<div class="flex flex-col items-center justify-center h-full text-subtle gap-3 p-4"><p> </p> <p class="text-xs break-all"> </p> <!></div>'),Yo=x('<div class="h-full overflow-auto p-4"><!></div>'),Zo=x("<div><!></div>"),Go=x('<iframe sandbox="" referrerpolicy="no-referrer"></iframe>'),Jo=x('<div class="absolute inset-0 flex items-center justify-center text-subtle" role="status"> </div>'),Qo=x('<div class="relative size-full"><!> <!> <!></div>');function ei(A,_){if(new.target)return Xt({component:ei,...A});Gt(_,!0);const re=()=>ge(tr,"$workspace",W),Be=()=>ge(D,"$fileContentStore",W),ee=()=>ge(fe,"$fileLoadingStore",W),P=()=>ge(G,"$fileSavingStore",W),O=()=>ge(ne,"$fileErrorStore",W),ae=()=>ge(ft,"$fileErrorInfoStore",W),Ee=()=>ge(vt,"$homeView$",W),ye=()=>ge(pt,"$fileNotFoundCandidatesStore",W),be=()=>ge(bt,"$isFileBinaryStore",W),oe=()=>ge(me,"$isFileDirtyStore",W),et=()=>ge(Me,"$fileLastUpdatedStore",W),U=()=>ge(tt,"$ftChanges$",W),B=()=>ge(er,"$gutterRead$",W),pe=()=>ge(Ke,"$lineWrapping",W),xe=()=>ge(ue,"$diffIndicators",W),Le=()=>ge(Qt,"$rootMediaPreview",W),[W,$e]=pr(),Ce=(r,n=sa)=>{var b=Or,S=qr;{let le=i(()=>xe()?e(rt):[]),ke=i(()=>n()&&v());Rr(fr(r,{get value(){return b()},set value(J){S(J)},get language(){return e(or)},get readOnly(){return e(y)},get fileName(){return a().filePath},get workspaceId(){return l()},get filePath(){return a().filePath},get lineWrapping(){return pe()},get lineChanges(){return e(le)},get jumpTo(){return e(kt)},get externalContentVersion(){return e(Pe)},get isPanelFocused(){return e(ke)}}),J=>c(Ye,J,!0),()=>e(Ye))}},qe=r=>{var n=Vo(),b=ve(n);{var S=J=>{var He=Ue(),Ge=ve(He);Nt(Ge,()=>Bt,(nt,Tt)=>{Tt(nt,{get icon(){return Ba},get label(){return e(Ae)},disabled:!0})}),s(J,He)};Y(b,J=>{!e(It)&&!e(y)&&!e(L)&&J(S)})}var le=g(b,2);{var ke=J=>{{let He=i(()=>e(_t)?d.ui_viewSettings_htmlPreview_label():void 0),Ge=i(()=>!e(We)),nt=i(()=>!e(y)&&!e(We));eo(J,{embedded:!0,showFold:!1,showSplit:!1,get showPreview(){return e(wr)},get previewLabel(){return e(He)},get previewEnabled(){return e(Fe)},onTogglePreview:()=>c(Fe,!e(Fe)),get showWrap(){return e(Ge)},get wrapEnabled(){return pe()},onToggleWrap:()=>R.dispatch(_a()),get showDiff(){return e(nt)},get diffEnabled(){return xe()},onToggleDiff:()=>R.dispatch(ma())})}};Y(le,J=>{a().filePath&&!e(It)&&!e(L)&&J(ke)})}s(r,n)},Ve=r=>{var n=Ue(),b=ve(n);{var S=le=>{var ke=zo(),J=ve(ke);{var He=Oe=>{var at=Ue(),ht=ve(at);{let Et=i(()=>d.layout_fileTab_goToChanges_tooltip());Nt(ht,()=>Bt,(Lt,Mt)=>{Mt(Lt,{get icon(){return Oa},get label(){return e(Et)},onclick:Zr})})}s(Oe,at)};Y(J,Oe=>{e(Hr)&&Oe(He)})}var Ge=g(J,2);{var nt=Oe=>{var at=Ue(),ht=ve(at);{let Et=i(()=>d.layout_fileTab_downloadFile_label()),Lt=i(()=>!e(Ct)||e(mt));Nt(ht,()=>Bt,(Mt,ir)=>{ir(Mt,{get icon(){return Ot},get label(){return e(Et)},onclick:At,get disabled(){return e(Lt)}})})}s(Oe,at)};Y(Ge,Oe=>{e(it)&&Oe(nt)})}var Tt=g(Ge,2);{let Oe=i(()=>d.layout_fileTab_deleteFile_tooltip());Nt(Tt,()=>Bt,(at,ht)=>{ht(at,{get icon(){return Ha},get label(){return e(Oe)},onclick:Gr,destructive:!0})})}s(le,ke)};Y(b,le=>{a().filePath&&!e(It)&&!e(y)&&le(S)})}s(r,n)},Ke=to(),ue=ro();let a=de(_,"tab",7),l=de(_,"workspaceId",7),q=de(_,"isActive",7),v=de(_,"isPanelFocused",7);se(()=>{const r=l();if(!(!q()||!r||e(f)))return R.dispatch(ua(r,"files")),()=>R.dispatch(fa(r,"files"))});const f=i(()=>typeof a().data?.gitRootId=="string"?a().data.gitRootId:void 0),ie=i(()=>typeof a().data?.gitRootPath=="string"?a().data.gitRootPath:void 0),y=i(()=>!!e(f)),Z=i(()=>a().filePath?ja(a().filePath,e(f)):a().filePath),N=na(e(Z));se(()=>{N.set(e(Z))});const D=$a(l(),N),fe=ka(l(),N),G=Ia(l(),N),ne=Sa(l(),N),ft=Ca(l(),N),vt=co(l()),pt=Fa(l(),N),bt=Da(l(),N),me=Sr(l(),N),Me=Ta(l(),N),tt=Ea(l()),_e=ya(),Re=crypto.randomUUID(),Qt=Ar(Re),$t=`file-gutter:${crypto.randomUUID()}`,er=La(l(),$t),tr=Ma(l()),Xe=i(()=>re()?.worktreePath||re()?.repositoryPath||re()?.path||null),ze=i(Be),rr=io();se(()=>{e(ze)!==null&&e(ze)!==void 0&&rr?.markContentLoaded()});const t=i(ee),o=i(P),u=i(O),w=i(()=>e(u)?jo(e(u)):"generic"),$=i(()=>e(u)?lo(ae()):null);let E=j(0),V=!1;se(()=>{const r=Ee();if(!r||r.unavailable){V=!1;return}e($)&&!V&&(V=!0,ur(()=>Ht(E)))});const T=5,K=i(()=>(ye()??[]).slice(0,T)),L=i(be),he=i(oe),Pe=i(et),Ae=i(()=>e(o)?d.ui_saveIndicator_saving_tooltip():e(he)?d.ui_saveIndicator_autoSaving_tooltip():d.ui_saveIndicator_saved_tooltip());let Ye=j(null),rt=j(la([])),Ze=j(null),kt=j(void 0),Vt=j(void 0),Fe=j(!0),gr=j(null);se(()=>{const r=a().data?.line,n=a().data?.jumpTimestamp;!r||n!==void 0&&n===e(Vt)||(c(Vt,n,!0),c(kt,{line:r},!0),c(Fe,!1))});const gt=i(()=>e(f)?Cr(a().filePath,e(ie)):null),It=i(()=>e(f)?!e(gt):!!(a().filePath&&(Za(a().filePath)||e(Xe)&&Ga(a().filePath,e(Xe))))),St=i(()=>a().filePath&&e(Xe)?dr(a().filePath)?a().filePath:`${e(Xe)}/${a().filePath}`:null),xt=i(()=>!!a().filePath&&/\.pdf$/i.test(a().filePath)),Pt=i(()=>!!a().filePath&&/\.(?:png|jpe?g|gif|webp|mp4|webm)$/i.test(a().filePath)),it=i(()=>l()&&/^[A-Za-z0-9._-]+$/.test(l())?Cr(a().filePath,e(Xe)):null),Nr=i(()=>!e(f)&&e(it)?e(it).split("/").slice(0,-1).join("/"):void 0),ar=i(()=>e(xt)||e(Pt)?e(it):null),mr=i(()=>e(f)&&e(Pt)?{png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",mp4:"video/mp4",webm:"video/webm"}[a().filePath?.split(".").pop()?.toLowerCase()??""]:void 0);se(()=>{if(!q()||!e(f)||!e(gt)||!e(mr))return;const r=crypto.randomUUID();return R.dispatch(Ur(Re,r,l(),e(gt),{gitRootId:e(f),mimeType:e(mr)})),()=>R.dispatch(Vr(Re,r))});let mt=j(!1);const Ct=i(()=>!!e(it)&&!e(t)&&(!e(Pt)||e(Ze)===e(it))),_r=i(()=>e(Ze)&&l()?`workspace-file://${l()}/${e(Ze).split("/").map(encodeURIComponent).join("/")}`:null),or=i(()=>a().filePath?ga(a().filePath):"plaintext"),hr=i(()=>e(or)==="markdown"),_t=i(()=>/\.html?$/i.test(a().filePath??""));let Ft=j(void 0);const zt=i(()=>e(Ft)?.source===e(ze)),wr=i(()=>e(hr)||e(_t)&&!(e(zt)&&e(Ft)?.document===null)),We=i(()=>e(wr)&&e(Fe));se(()=>{if(!q()||!e(_t)||!e(We)||e(L)||e(u))return;const r=e(ze);if(!(r===null||e(zt)))return fo(r,n=>{c(Ft,{source:r,document:n}),n===null&&c(Fe,!1)})}),se(()=>{e(_t)&&!e(We)&&a().filePath&&c(gr,a().filePath,!0)}),se(()=>{if(!e(_t)||!e(We)||!q()||!v())return;function r(n){const b=n.detail?.line;b&&(c(kt,{line:b},!0),c(Fe,!1))}return window.addEventListener("workspace:go-to-line",r),()=>window.removeEventListener("workspace:go-to-line",r)}),se(()=>{if(!q()||e(xt)||e(f))return;const r=e(ar),n=a().filePath,b=l(),S=a().id;if(c(Ze,null),!r||!n||!b)return;let le=!1;const ke=()=>!le&&l()===b&&a().id===S&&a().filePath===n;return(async()=>{let J=!1;try{J=(await Ua("file.stat",{workspaceId:b,path:r}))?.isFile===!0}catch{}if(!ke())return;if(J){c(Ze,r,!0);return}if(!/\.(?:png|jpe?g|gif|webp|mp4|webm)$/i.test(r)){c(Ze,r,!0);return}const{candidates:He,truncated:Ge}=await Ya(b,r);if(ke()){if(!Ge&&He.length===1){R.dispatch(yr(b,n,He[0],S));return}c(Ze,r,!0)}})(),()=>{le=!0}});function Br(r,n){return!!(r.file===n||r.relativePath===n||r.relativePath&&n.endsWith("/"+r.relativePath)||r.file&&n.endsWith("/"+r.file)||r.relativePath&&r.relativePath.endsWith("/"+n)||r.file&&r.file.endsWith("/"+n))}const Dt=i(()=>e(y)||!a().filePath?null:U().find(r=>Br(r,a().filePath))??null),Hr=i(()=>!!e(Dt));se(()=>{if(e(y))return;const r=l(),n=a().filePath,b=e(Xe);return()=>{if(!r||!n)return;const S=lr.select(R.state,r,n);if(S?.kind!=="editable-text")return;const le=nr(S.localContent),ke=Sr.select(R.state,r,n),J=dr(n)?n:b?`${b}/${n}`:null;ke&&J&&R.dispatch($r(r,n,J,le))}}),se(()=>{const r=a().filePath,n=e(St),b=l();if(e(E),!q())return;const S=!e(f)&&!!r&&dr(r)&&!e(Xe);r&&b&&!e(It)&&!e(Pt)&&!e(xt)&&!S&&(e(f)&&e(gt)&&e(Z)?R.dispatch(kr(b,e(Z),n??r,{gitRoot:{id:e(f),relativePath:e(gt)}})):R.dispatch(kr(b,r,n??r)))});function Or(){return e(ze)??""}function qr(r){e(y)||e(L)||!a().filePath||!l()||!e(St)||R.dispatch(Pa(l(),a().filePath,nr(r)))}function Kr(){if(e(y)||e(L)||!a().filePath||!e(St)||e(ze)===null||e(o))return;const r=lr.select(R.state,l(),a().filePath);r?.kind==="editable-text"&&R.dispatch($r(l(),a().filePath,e(St),nr(r.localContent)))}function Xr(r){const n=a().filePath;!n||!l()||(R.dispatch(xa(l(),n)),R.dispatch(yr(l(),n,r,a().id)))}se(()=>{const r=a().filePath,n=e(Dt);if(!r||!n){c(rt,[],!0);return}if(!q())return;const b=l(),S=crypto.randomUUID();return R.dispatch(va(b,$t,S,{kind:"diffs",path:r,staged:n.stage==="staged"})),()=>{R.dispatch(pa(b,$t,S))}}),se(()=>{const r=B(),n=r?.result?.kind==="diffs"?r.result.chunks:[],b=n.find(S=>S.file===a().filePath)??n[0];c(rt,b?Ja(b.chunks.map(S=>({oldStart:S.oldStart,oldLines:S.oldLines,newStart:S.newStart,newLines:S.newLines,lines:S.lines.map(le=>(le.type===Ir.Addition?"+":le.type===Ir.Deletion?"-":" ")+le.content)}))):[],!0)});function Yr(r){const n=/Mac|iPhone|iPad|iPod/.test(navigator.userAgent),b=ke=>oo(r,ao(ke),n);if(b("editor.save")){r.preventDefault(),e(he)&&!e(o)&&Kr();return}const S=b("editor.undo")?"undo":b("editor.redo")?"redo":b("editor.toggle-task-list")?"toggle-task-list":b("editor.copy")?"copy":b("editor.select-all")?"select-all":null;if(!S||e(y)&&S!=="copy"&&S!=="select-all")return;S!=="toggle-task-list"&&e(Ye)?.runShortcut(S)&&r.preventDefault()}function Zr(r){if(!a().filePath||!e(Dt))return;const n=r?.metaKey||r?.ctrlKey||!1,S=r?.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0;R.dispatch(ba(l(),e(Dt),{filePath:a().filePath,changeId:e(Dt).id,openInAdjacentPanel:n,sourcePanelId:S}))}async function At(){const r=e(it);if(!(e(y)||!r||!l()||!e(Ct)||e(mt))){c(mt,!0);try{const n=await Ra(l(),r,e(Xe));!n?.success&&!n?.canceled&&sr.error(n?.error?.message||d.layout_fileTab_downloadFailed_error())}catch{sr.error(d.layout_fileTab_downloadFailed_error())}finally{c(mt,!1)}}}function Gr(){const r=e(St);if(e(y)||!a().filePath||!l()||!r)return;const n=ha(lr.select(R.state,l(),a().filePath));if(!n){sr.error(d.ui_reversibleActions_failed_error({message:d.fileExplorer_tree_undoUnavailable_error()}));return}R.dispatch(wa(l(),a().filePath,{absolutePath:r,tabId:a().id,snapshot:n}))}se(()=>{if(!_e||!q())return;const r={isDirty:!e(y)&&e(he),isSaving:!e(y)&&e(o)};ur(()=>{_e.registerActions({display:qe,actions:Ve}),_e.registerState(r)})});var Jr={get tab(){return a()},set tab(r){a(r),ce()},get workspaceId(){return l()},set workspaceId(r){l(r),ce()},get isActive(){return q()},set isActive(r){q(r),ce()},get isPanelFocused(){return v()},set isPanelFocused(r){v(r),ce()},$set:Yt,$on:(r,n)=>Zt(_,r,n)},br=Ue();ut("keydown",Lr,r=>q()&&Yr(r));var Qr=ve(br);{var ea=r=>{var n=Ue(),b=ve(n);Mr(b,()=>a().filePath,S=>{var le=Ue(),ke=ve(le);{var J=h=>{var p=Ao(),M=F(p),X=C(M,!0),z=g(M,2),je=C(z,!0);k(p),I(te=>{m(X,te),m(je,a().filePath)},[()=>d.layout_fileTab_outsideWorkspace_label()]),s(h,p)},He=h=>{var p=Ue(),M=ve(p);{var X=z=>{vr(z,{get workspaceId(){return l()},get filePath(){return e(gt)},get gitRootId(){return e(f)}})};Y(M,z=>{q()&&z(X)})}s(h,p)},Ge=h=>{var p=Ue(),M=ve(p);{var X=te=>{var Ie=Tr(),H=F(Ie),we=C(H,!0);k(Ie),I(Q=>m(we,Q),[()=>d.layout_fileTab_errorLoading_label()]),s(te,Ie)},z=te=>{qt(te,{get filePath(){return a().filePath},get sourceUrl(){return Le().url},allowDownload:!1})},je=te=>{var Ie=Wo(),H=F(Ie),we=C(H,!0);k(Ie),I(Q=>m(we,Q),[()=>d.layout_fileTab_preparing_label()]),s(te,Ie)};Y(M,te=>{Le()?.error?te(X):Le()?.url?te(z,1):te(je,-1)})}s(h,p)},nt=h=>{var p=Ue(),M=ve(p);{var X=z=>{vr(z,{get workspaceId(){return l()},get filePath(){return e(ar)}})};Y(M,z=>{q()&&z(X)})}s(h,p)},Tt=h=>{var p=Tr(),M=F(p),X=C(M,!0);k(p),I(z=>m(X,z),[()=>d.file_pdf_load_error()]),s(h,p)},Oe=h=>{{let p=i(()=>e(Ze)??a().filePath),M=i(()=>!e(y)&&e(Ct));qt(h,{get filePath(){return e(p)},get sourceUrl(){return e(_r)},onDownload:At,get allowDownload(){return e(M)},get downloading(){return e(mt)}})}},at=h=>{var p=Er(),M=F(p),X=C(M,!0);k(p),I(z=>m(X,z),[()=>d.layout_fileTab_preparing_label()]),s(h,p)},ht=h=>{var p=Bo(),M=F(p);Ut(M,20,()=>[...Array(20).keys()],X=>X,(X,z)=>{var je=No(),te=F(je);Fr(te,{class:"h-3 w-8 shrink-0"});var Ie=g(te,2);Fr(Ie,{class:"h-3",style:`width: ${30+Math.random()*60}%`}),k(je),s(X,je)}),k(M),k(p),s(h,p)},Et=h=>{{let p=i(()=>so(e($)));no(h,{get view(){return e(p)}})}},Lt=h=>{var p=Ko(),M=F(p),X=C(M,!0),z=g(M,2),je=C(z,!0),te=g(z,2);{var Ie=Q=>{var lt=Ho(),Je=C(lt,!0);I(()=>m(Je,e(u))),s(Q,lt)};Y(te,Q=>{e(w)==="generic"&&Q(Ie)})}var H=g(te,2);{var we=Q=>{var lt=qo(),Je=ve(lt),Rt=C(Je,!0),Wt=g(Je,2);Ut(Wt,20,()=>e(K),wt=>wt,(wt,De)=>{var Se=Oo(),Ne=F(Se);Te(Ne,{variant:"link",size:"compact",class:"h-auto p-0 font-mono text-xs",onclick:()=>Xr(De),children:(st,xr)=>{ot();var Pr=ct();I(()=>m(Pr,De)),s(st,Pr)},$$slots:{default:!0}}),k(Se),s(wt,Se)}),k(Wt),I(wt=>m(Rt,wt),[()=>d.layout_fileTab_didYouMean_label()]),s(Q,lt)};Y(H,Q=>{e(K).length>0&&Q(we)})}k(p),I(Q=>{m(X,Q),m(je,a().filePath)},[()=>Uo(e(w))]),s(h,p)},Mt=h=>{var p=Xo(),M=F(p),X=C(M,!0),z=g(M,2),je=C(z,!0),te=g(z,2);{var Ie=H=>{{let we=i(()=>!e(Ct)||e(mt));Te(H,{variant:"secondary",size:"sm",onclick:At,get disabled(){return e(we)},children:(Q,lt)=>{ot();var Je=ct();I(Rt=>m(Je,Rt),[()=>d.layout_fileTab_downloadFile_label()]),s(Q,Je)},$$slots:{default:!0}})}};Y(te,H=>{!e(y)&&e(it)&&H(Ie)})}k(p),I(H=>{m(X,H),m(je,a().filePath)},[()=>d.editor_fileViewer_binary_label()]),s(h,p)},ir=h=>{const p=i(()=>a().filePath?.toLowerCase().endsWith(".svg"));var M=Ue(),X=ve(M);{var z=H=>{{let we=i(()=>a().filePath||""),Q=i(()=>!e(y)&&e(Ct));qt(H,{get filePath(){return e(we)},get fileContent(){return e(ze)},get language(){return e(or)},get isBinary(){return e(L)},onDownload:At,get allowDownload(){return e(Q)},get downloading(){return e(mt)}})}},je=H=>{var we=Yo(),Q=F(we);Qa(Q,{get content(){return e(ze)},get workspaceId(){return l()},get relativeMediaBase(){return e(Nr)},renderRichFencesAsCode:!0,renderDiagrams:!0}),k(we),s(H,we)},te=H=>{var we=Qo(),Q=F(we);{var lt=De=>{var Se=Zo();let Ne;var st=F(Se);Ce(st,()=>!e(We)),k(Se),I(()=>{Ne=Kt(Se,1,"size-full",null,Ne,{invisible:e(We)}),Se.inert=e(We)}),s(De,Se)};Y(Q,De=>{(!e(We)||e(gr)===a().filePath)&&De(lt)})}var Je=g(Q,2);{var Rt=De=>{const Se=i(()=>e(We)&&e(zt));var Ne=Go();let st;I(xr=>{Qe(Ne,"title",xr),Qe(Ne,"srcdoc",e(Ft).document),st=Kt(Ne,1,"absolute inset-0 block size-full border-0 bg-background",null,st,{invisible:!e(Se)}),Ne.inert=!e(Se)},[()=>d.ui_viewSettings_htmlPreview_label()]),s(De,Ne)};Y(Je,De=>{e(Ft)?.document!=null&&De(Rt)})}var Wt=g(Je,2);{var wt=De=>{var Se=Jo(),Ne=C(Se,!0);I(st=>m(Ne,st),[()=>d.layout_fileTab_preparing_label()]),s(De,Se)};Y(Wt,De=>{e(We)&&!e(zt)&&De(wt)})}k(we),s(H,we)},Ie=H=>{Ce(H,()=>!0)};Y(X,H=>{e(p)?H(z):e(hr)&&e(We)?H(je,1):e(_t)?H(te,2):H(Ie,-1)})}s(h,M)},ra=h=>{var p=Er(),M=F(p),X=C(M,!0);k(p),I(z=>m(X,z),[()=>d.layout_fileTab_preparing_label()]),s(h,p)};Y(ke,h=>{e(It)?h(J):e(f)&&e(xt)&&e(gt)?h(He,1):e(f)&&e(Pt)?h(Ge,2):e(xt)&&e(ar)?h(nt,3):e(xt)?h(Tt,4):e(_r)?h(Oe,5):e(Pt)?h(at,6):e(t)&&(!e(_t)||e(ze)===null)?h(ht,7):e($)?h(Et,8):e(u)?h(Lt,9):e(L)?h(Mt,10):e(ze)!==null?h(ir,11):h(ra,-1)})}s(S,le)}),s(r,n)};Y(Qr,r=>{a().filePath&&r(ea)})}s(A,br);var ta=Jt(Jr);return $e(),ta}export{ei as default};
@@ -1,6 +1,6 @@
1
1
  var ft=e=>{throw TypeError(e)};var nn=(e,t,n)=>t.has(e)||ft("Cannot "+n);var k=(e,t,n)=>(nn(e,t,"read from private field"),n?n.call(e):t.get(e)),j=(e,t,n)=>t.has(e)?ft("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 ut,bV as U,aD as N,bH as C,c0 as Se,bX as rn,bP as on,c5 as an}from"./3SdAC2_C.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 sn(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function cn(e){return e.split("%25").map(decodeURI).join("%25")}function ln(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function Ve({href:e}){return e.split("#")[0]}function q(){}function fn(...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 un(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 dn=0;const dt=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"):dn,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)),dt(n,o)}}else window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&Q.delete(Oe(e)),dt(e,t));const Q=new Map;function hn(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=un(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 pn(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="${fn(...r)}"]`}return o}const gn=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/,_n=/^\/\((?:[^)]+)\)$/;function yn(e){const t=[];return{pattern:e==="/"||_n.test(e)?/^\/$/:new RegExp(`^${wn(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=gn.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 mn(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function wn(e){return e.slice(1).split("/").filter(mn)}function vn(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 bn({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}=yn(s),h={id:s,exec:p=>{const m=g.exec(p);if(m)return vn(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 ht(e,t,n=JSON.stringify){const o=n(t);try{sessionStorage[e]=o}catch{}}const I=globalThis.__sveltekit_c9aaa?.base??"",kn=globalThis.__sveltekit_c9aaa?.assets??I??"",Sn="1795742214209",xt="sveltekit:snapshot",jt="sveltekit:scroll",Qe="sveltekit:states",Ut="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 pt=new WeakSet,gt={"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&&En(e,t,n),n}function En(e,t,n){n!==null&&!pt.has(e)&&!gt[t].includes(n)&&(console.error(`Unexpected value for ${t} — should be one of ${gt[t].map(o=>JSON.stringify(o)).join(", ")}`,e),pt.add(e))}const _t={...Y,"":Y.hover};function Nt(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function Ct(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=Nt(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=Nt(s);function c(f){switch(f){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:_t[o??"off"],preload_data:_t[r??"off"],keepfocus:c(t),noscroll:c(n),reload:c(i),replace_state:c(a)}}function yt(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 Dt={v:q};function On(){const{set:e,subscribe:t}=We(!1);let n;async function o(){clearTimeout(n);try{const r=await fetch(`${kn}/app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const a=(await r.json()).version!==Sn;return a&&(e(!0),Dt.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 Nr(e){}const Bt=-1,mt=-2,$n=-3,An=-4,Rn=-5,Mt=-6,Tn=-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 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 jn(e){return Object.prototype.toString.call(e).slice(8,-1)}function Un(e){return typeof Buffer<"u"&&Buffer.isBuffer(e)}function Nn(e){switch(e){case'"':return'\\"';case"<":return"\\u003C";case"\\":return"\\\\";case`
3
+ `),c=e?s.includes("src/runtime/client/client.js"):dn,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)),dt(n,o)}}else window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&Q.delete(Oe(e)),dt(e,t));const Q=new Map;function hn(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=un(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 pn(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="${fn(...r)}"]`}return o}const gn=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/,_n=/^\/\((?:[^)]+)\)$/;function yn(e){const t=[];return{pattern:e==="/"||_n.test(e)?/^\/$/:new RegExp(`^${wn(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=gn.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 mn(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function wn(e){return e.slice(1).split("/").filter(mn)}function vn(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 bn({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}=yn(s),h={id:s,exec:p=>{const m=g.exec(p);if(m)return vn(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 ht(e,t,n=JSON.stringify){const o=n(t);try{sessionStorage[e]=o}catch{}}const I=globalThis.__sveltekit_6fot87?.base??"",kn=globalThis.__sveltekit_6fot87?.assets??I??"",Sn="1795751665493",xt="sveltekit:snapshot",jt="sveltekit:scroll",Qe="sveltekit:states",Ut="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 pt=new WeakSet,gt={"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&&En(e,t,n),n}function En(e,t,n){n!==null&&!pt.has(e)&&!gt[t].includes(n)&&(console.error(`Unexpected value for ${t} — should be one of ${gt[t].map(o=>JSON.stringify(o)).join(", ")}`,e),pt.add(e))}const _t={...Y,"":Y.hover};function Nt(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function Ct(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=Nt(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=Nt(s);function c(f){switch(f){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:_t[o??"off"],preload_data:_t[r??"off"],keepfocus:c(t),noscroll:c(n),reload:c(i),replace_state:c(a)}}function yt(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 Dt={v:q};function On(){const{set:e,subscribe:t}=We(!1);let n;async function o(){clearTimeout(n);try{const r=await fetch(`${kn}/app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const a=(await r.json()).version!==Sn;return a&&(e(!0),Dt.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 Nr(e){}const Bt=-1,mt=-2,$n=-3,An=-4,Rn=-5,Mt=-6,Tn=-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 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 jn(e){return Object.prototype.toString.call(e).slice(8,-1)}function Un(e){return typeof Buffer<"u"&&Buffer.isBuffer(e)}function Nn(e){switch(e){case'"':return'\\"';case"<":return"\\u003C";case"\\":return"\\\\";case`
4
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=Nn(i);a&&(t+=e.slice(n,r)+a,n=r+1)}return`"${n===0?e:t+e.slice(n)}"`}function Cn(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)}const Dn=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function wt(e){return Dn.test(e)?"."+e:"["+JSON.stringify(e)+"]"}function Bn(e){return!(!Number.isInteger(e)||e<0||e>Pn)}function Mn(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 Bn(+e)}function Vn(e){for(var t=e.length-1;t>=0&&!Mn(e[t]);t--);return t+1}function qn(e){const t=Object.keys(e);return t.length=Vn(t),t}function Fn(e){return new Uint8Array(e).toBase64()}function zn(e){return Buffer.from(e).toString("base64")}function Hn(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 Yn=typeof Uint8Array.fromBase64=="function",Gn=typeof process=="object"&&process.versions?.node!==void 0,Kn=Yn?Fn:Gn?zn:Hn;function Jn(e,t){return e}const Wn=Object.freeze({kind:"not-plain"}),Xn=Object.freeze({kind:"symbol-keys"}),Zn={identify:e=>e,typeOf:e=>e===null?"null":typeof e,toPrimitive:e=>e,tagOf:e=>jn(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=>(Un(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=>qn(e),shapeOf:e=>xn(e)?Cn(e).length>0?Xn:{kind:Object.getPrototypeOf(e)===null?"null-proto":"plain",keys:Object.keys(e)}:Wn,get:(e,t)=>e[t]},Qn=Object.freeze(Zn);Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get;typeof SharedArrayBuffer>"u"||Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype,"byteLength").get;function er(e,t,n){const o=tr(!1,e);return typeof o=="string"?o:`[${o.join(",")}]`}function tr(e,t,n,o){const r=Jn(Qn),i=[],a=new Map,s=[],c=[];let f=0;function u(d,h){const p=r.typeOf(d);if(p==="undefined")return Bt;let m;if(p==="number"){if(m=r.toPrimitive(d),Number.isNaN(m))return $n;if(m===1/0)return An;if(m===-1/0)return Rn;if(m===0&&1/m<0)return Mt}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=vt(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+=mt;else{const x=r.indicesOf(d),W=x.length,B=String($).length,re=($-W)*3,tn=4+B+W*(B+1);if(re>tn){l="["+Tn+","+$;for(let Be=0;Be<x.length;Be++){const Me=x[Be];c.push(`[${Me}]`),l+=","+Me+","+u(r.get(d,Me)),c.pop()}break}else y=!0,l+=mt}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),x=w!=="object"&&w!=="function"&&w!=="symbol";c.push(`.get(${x?vt(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","${Kn(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(wt($)),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(wt(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 vt(e){const t=typeof e;return t==="string"?M(e):e===void 0?Bt.toString():e===0&&1/e<0?Mt.toString():t==="bigint"?`["BigInt","${e}"]`:String(e)}function nr(e){function t(n,o){if(n)for(const r in n){if(r[0]==="_"||e.has(r))continue;const i=[...e.values()],a=rr(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 rr(e,t=".js"){const n=[];if(et.has(e)&&n.push(`+layout${t}`),Vt.has(e)&&n.push(`+page${t}`),qt.has(e)&&n.push(`+layout.server${t}`),or.has(e)&&n.push(`+page.server${t}`),ar.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"]),Vt=new Set([...et,"entries"]),qt=new Set([...et]),or=new Set([...qt,"actions","entries"]),ar=new Set(["GET","POST","PATCH","PUT","DELETE","OPTIONS","HEAD","fallback","prerender","trailingSlash","config","entries"]),sr=nr(Vt);function ir(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 cr(e){return e instanceof Ee?e.text:"Internal Error"}let A,se,Fe;const lr=ut.toString().includes("$$")||/function \w+\(\) \{\}/.test(ut.toString()),bt="a:";var ue,de,he,pe,ge,_e,ye,me,At,we,Rt,ve,Tt;lr?(A={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL(bt)},se={current:null},Fe={current:!1}):(A=new(At=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(bt)))}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,At),se=new(Rt=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,Rt),Fe=new(Tt=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,Tt),Dt.v=()=>Fe.current=!0);function Ft(e){Object.assign(A,e)}const{onMount:fr}=rn,ur=an??(e=>e()),dr=new Set(["icon","shortcut icon","apple-touch-icon"]);let oe=null;const z=It(jt)??{},ie=It(xt)??{};if(R&&Lt){let e=!1;const t=()=>{if(e)return;let r=new Error().stack?.split(`
5
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:yt({}),page:yt({}),navigating:We(null),updated:On()};function nt(e){z[e]=J()}function hr(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 zt(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(I||"/");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,Ht=new Set,pr=new Set,ee=new Set;let v={branch:[],error:null,url:null},Yt=!1,le=!1,kt=!0,fe=!1,ae=!1,Gt=!1,ot=!1,at,O,L,V;const Pe=new Set,St=new Map,Et=new Map;async function Mr(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
 
@@ -8,5 +8,5 @@ Consider wrapping it in an element:
8
8
 
9
9
  <div style="display: contents">
10
10
  %sveltekit.body%
11
- </div>`),globalThis.__sveltekit_c9aaa.data){const{q:i={},p:a={},l:s={},f:c={}}=globalThis.__sveltekit_c9aaa.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=bn(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 Lr(Ge,n)):(await te({type:"enter",url:Ue(S.hash?xr(new URL(location.href)):location.href),replace_state:!0}),r()),Tr()}function gr(){Re.length=0,ot=!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 Ot(){nt(O),ht(jt,z),Kt(L),ht(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){ot=!0,r=new Set;for(const[a,s]of St)for(const[c,f]of s)f.resource?.reset(),r.add(be(a,c));i=new Set;for(const[a,s]of Et)for(const c of s.keys())i.add(be(a,c))}t.invalidate&&t.invalidate.forEach(Ar)}}),t.invalidateAll&&Se().then(Se).then(()=>{for(const[a,s]of St)for(const[c,{resource:f}]of s)r?.has(be(a,c))&&f.start();for(const[a,s]of Et)for(const[c,{resource:f}]of s)i?.has(be(a,c))&&f.reconnect()})}async function $t(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},Ft(e.props.page),at=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 Ie({url:e,params:t,branch:n,errors:o,status:r,error:i,route:a,form:s}){let c="never";if(I&&(e.pathname===I||e.pathname===I+"/"))c="always";else for(const p of n)p?.slash!==void 0&&(c=p.slash);e.pathname=sn(e.pathname,c),e.search=e.search;const f={type:"loaded",state:{url:e,params:t,branch:n,error:i,route:a},props:{constructors:ir(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 st({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&&(sr(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 _r(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?pn(o,r.href,t):hn(o,t);return{resolved:r,promise:i}}function yr(e,t,n,o,r,i){if(ot)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 it(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function mr(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 wr({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!==xe(v.url):!1,g=v.route?r.id!==v.route.id:!1,d=mr(v.url,n);let h=!1;const p=f.map(async(_,l)=>{if(!_)return;const b=v.branch[l];return _[1]===b?.loader&&!yr(h,g,u,d,b.universal?.uses,o)?b:(h=!0,st({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:it(_[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 wr({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 zt(),await ce(n);E=await K(l,{params:o,url:n,route:{id:r.id}})}const T=await vr(_,m,a);return T?Ie({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 Ie({url:n,params:o,branch:m,errors:a,status:200,error:null,route:r,form:t?void 0:null})}async function vr(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 ct({status:e,error:t,url:n,route:o}){const r={};let i=null;try{const a=await st({loader:Ye,url:n,params:r,route:o,parent:()=>Promise.resolve({}),server_data_node:it(i)}),s={node:await Ae(),loader:Ae,universal:null,server:null,data:null};return Ie({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 br(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)=>_r(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,I,S.hash)){const n=await br(e);if(!n)return;const o=kr(n);for(const r of rt){const i=r.exec(o);if(i)return{id:xe(e),invalidating:t,route:r,params:ln(i),url:e}}}}function kr(e){return cn(S.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(I.length))||"/"}function xe(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=lt(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||Ht.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"?lt(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,I,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 ct({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 zt(),await ce(t,i);if(gr(),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,x={[G]:O+=w,[ne]:L+=w,[Qe]:a};(i?history.replaceState:history.pushState).call(history,x,"",t),i||hr(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(pr,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 x=p.navigation.to;v={...l.state,nav:{params:x.params,route:x.route,url:x.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,at.$set(l.props),oe&&Object.assign(l.props.page,oe),Ft(l.props.page),E=on?.()),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(kt){const w=n?n.scroll:r?J():null;w?scrollTo(w.x,w.y):(y=t.hash&&document.getElementById(en(t)))?y.scrollIntoView():scrollTo(0,0)}const $=document.activeElement!==T&&document.activeElement!==document.body;!o&&!$&&Ir(t,!y),kt=!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===je&&e.pathname===location.pathname&&!Yt)return await ct({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 Sr(){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=Ct(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,I,S.hash);if(g||d)return;const h=$e(c),p=u&&xe(v.url)===xe(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?$t(m).then(_=>{_.type==="loaded"&&_.state.error&&console.warn(`Preloading data for ${m.url.pathname} failed with the following error: ${_.state.error.message}
11
+ </div>`),globalThis.__sveltekit_6fot87.data){const{q:i={},p:a={},l:s={},f:c={}}=globalThis.__sveltekit_6fot87.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=bn(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 Lr(Ge,n)):(await te({type:"enter",url:Ue(S.hash?xr(new URL(location.href)):location.href),replace_state:!0}),r()),Tr()}function gr(){Re.length=0,ot=!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 Ot(){nt(O),ht(jt,z),Kt(L),ht(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){ot=!0,r=new Set;for(const[a,s]of St)for(const[c,f]of s)f.resource?.reset(),r.add(be(a,c));i=new Set;for(const[a,s]of Et)for(const c of s.keys())i.add(be(a,c))}t.invalidate&&t.invalidate.forEach(Ar)}}),t.invalidateAll&&Se().then(Se).then(()=>{for(const[a,s]of St)for(const[c,{resource:f}]of s)r?.has(be(a,c))&&f.start();for(const[a,s]of Et)for(const[c,{resource:f}]of s)i?.has(be(a,c))&&f.reconnect()})}async function $t(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},Ft(e.props.page),at=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 Ie({url:e,params:t,branch:n,errors:o,status:r,error:i,route:a,form:s}){let c="never";if(I&&(e.pathname===I||e.pathname===I+"/"))c="always";else for(const p of n)p?.slash!==void 0&&(c=p.slash);e.pathname=sn(e.pathname,c),e.search=e.search;const f={type:"loaded",state:{url:e,params:t,branch:n,error:i,route:a},props:{constructors:ir(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 st({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&&(sr(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 _r(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?pn(o,r.href,t):hn(o,t);return{resolved:r,promise:i}}function yr(e,t,n,o,r,i){if(ot)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 it(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function mr(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 wr({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!==xe(v.url):!1,g=v.route?r.id!==v.route.id:!1,d=mr(v.url,n);let h=!1;const p=f.map(async(_,l)=>{if(!_)return;const b=v.branch[l];return _[1]===b?.loader&&!yr(h,g,u,d,b.universal?.uses,o)?b:(h=!0,st({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:it(_[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 wr({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 zt(),await ce(n);E=await K(l,{params:o,url:n,route:{id:r.id}})}const T=await vr(_,m,a);return T?Ie({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 Ie({url:n,params:o,branch:m,errors:a,status:200,error:null,route:r,form:t?void 0:null})}async function vr(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 ct({status:e,error:t,url:n,route:o}){const r={};let i=null;try{const a=await st({loader:Ye,url:n,params:r,route:o,parent:()=>Promise.resolve({}),server_data_node:it(i)}),s={node:await Ae(),loader:Ae,universal:null,server:null,data:null};return Ie({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 br(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)=>_r(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,I,S.hash)){const n=await br(e);if(!n)return;const o=kr(n);for(const r of rt){const i=r.exec(o);if(i)return{id:xe(e),invalidating:t,route:r,params:ln(i),url:e}}}}function kr(e){return cn(S.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(I.length))||"/"}function xe(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=lt(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||Ht.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"?lt(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,I,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 ct({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 zt(),await ce(t,i);if(gr(),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,x={[G]:O+=w,[ne]:L+=w,[Qe]:a};(i?history.replaceState:history.pushState).call(history,x,"",t),i||hr(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(pr,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 x=p.navigation.to;v={...l.state,nav:{params:x.params,route:x.route,url:x.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,at.$set(l.props),oe&&Object.assign(l.props.page,oe),Ft(l.props.page),E=on?.()),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(kt){const w=n?n.scroll:r?J():null;w?scrollTo(w.x,w.y):(y=t.hash&&document.getElementById(en(t)))?y.scrollIntoView():scrollTo(0,0)}const $=document.activeElement!==T&&document.activeElement!==document.body;!o&&!$&&Ir(t,!y),kt=!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===je&&e.pathname===location.pathname&&!Yt)return await ct({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 Sr(){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=Ct(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,I,S.hash);if(g||d)return;const h=$e(c),p=u&&xe(v.url)===xe(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?$t(m).then(_=>{_.type==="loaded"&&_.state.error&&console.warn(`Preloading data for ${m.url.pathname} failed with the following error: ${_.state.error.message}
12
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`)}):$t(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,I,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=cr(e);return S.hooks.handleError({error:e,event:t,status:n,message:o})??{message:o}}function Er(e,t){fr(()=>(e.add(t),()=>{e.delete(t)}))}function Or(e){Er(ee,e)}function $r(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 Ar(e){if(typeof e=="function")Re.push(e);else{const{href:t}=new URL(e,location.href);Re.push(n=>n.href===t)}}function Rr(e,t){if(R){if(!le)throw new Error("Cannot call replaceState(...) before router is initialized");try{er(t)}catch(o){throw new Error(`Could not serialize state${o.path}`,{cause:o})}}const n={[G]:O,[ne]:L,[Ut]:A.url.href,[Qe]:t};history.replaceState(n,"",Ue(e)),A.state=t,at.$set({page:ur(()=>De(A))})}function Tr(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(Ot(),!fe){const o=lt(v,void 0,null,"leave"),r={...o.navigation,cancel:()=>{n=!0,o.reject(new Error("navigation cancelled"))}};Ht.forEach(i=>i(r))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ot()}),navigator.connection?.saveData||Sr(),D.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=Ct(t.composedPath()[0],D);if(!n)return;const{url:o,external:r,target:i,download:a}=He(n,I,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,I,!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[Ut]??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"))dr.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 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)),st({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:it(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 Ie({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 ct({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=en(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 lt(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 en(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 Vr=Object.freeze(Object.defineProperty({__proto__:null,afterNavigate:Or,goto:$r,replaceState:Rr},Symbol.toStringTag,{value:"Module"}));export{Or as a,Lt as b,F as c,$r as g,Nr as l,Vr as n,A as p,Rr as r,Mr as s};
@@ -1 +1 @@
1
- import{t as ee,bo as i,bw as te,b as ae,br as qe,bs as xe,bq as He,bp as Ke,bm as N}from"./Fcr7AvC-.js";import{bs as re,b_ as $,aD as t,W as h,bA as q,bn as se,c9 as v,aA as l,aB as z,bV as O,br as Ve,ca as Me,bH as C,a5 as Q,bl as Y,bS as M,bO as be,ay as B,a7 as ke,aw as ze,bz as Pe}from"./3SdAC2_C.js";import{f as W}from"./D-lOH49i.js";import{Z as Xe}from"./pYdPYEfN.js";import{F as I,cF as Ze,bF as Ae,d3 as Re,aC as Ge,cr as Je,bn as Qe,bi as Ye,bh as et,bg as tt}from"./ChHRVjww.js";import{az as at,aC as rt}from"./BBuvJMq5.js";import{f as st}from"./9ryMZ44V.js";import{g as nt,i as it,I as lt}from"./CA6H1-bp.js";import{s as E,g as ot,f as De}from"./BRCr02in.js";import{a as Ce}from"./ye-GTjqo.js";import{i as S}from"./BhYXv0ZM.js";import{n as J,l as Te,c as Le}from"./CxR-pcVt.js";import{m as ct}from"./C7b3vXLD.js";import{a as ut}from"./BMejr7u6.js";import{al as mt,j as pe}from"./D5vlW2SV.js";var dt=z('<span class="svelte-dywwvd"></span>'),vt=z('<span class="waveform svelte-dywwvd" aria-hidden="true" data-dictation-waveform=""></span>');function Ue(w,a){if(new.target)return ee({component:Ue,...w});re(a,!0);let g=i(a,"levels",7);const r=v(()=>{const s=g().slice(-Ce).map(m=>Number.isFinite(m)?Math.min(1,Math.max(0,m)):0);return[...new Array(Ce-s.length).fill(0),...s]});var d={get levels(){return g()},set levels(s){g(s),l()},$set:te,$on:(s,m)=>ae(a,s,m)},_=vt();return nt(_,21,()=>t(r),it,(s,m)=>{var c=dt();let x;$(()=>{E(c,"data-level",t(m)),x=ot(c,"",x,{height:`${2+t(m)*12}px`})}),h(s,c)}),q(_),h(w,_),se(d)}var gt=z('<span class="dictation-meter svelte-1oz1rct"><span class="elapsed svelte-1oz1rct" data-dictation-elapsed=""> </span> <!></span>');function Fe(w,a){if(new.target)return ee({component:Fe,...w});re(a,!0);let g=i(a,"levels",7),r=i(a,"startedAt",7,null),d=i(a,"elapsed",7),_=O(Ve(Date.now()));Me(()=>{if(!(d()!==void 0||r()===null))return C(_,Date.now(),!0),Xe.subscribe(new Date(r()),()=>C(_,Date.now(),!0),"second")});const s=v(()=>d()??st(r()===null?0:t(_)-r()));var m={get levels(){return g()},set levels(u){g(u),l()},get startedAt(){return r()},set startedAt(u=null){r(u),l()},get elapsed(){return d()},set elapsed(u){d(u),l()},$set:te,$on:(u,R)=>ae(a,u,R)},c=gt(),x=Q(c),P=Y(x,!0),T=M(x,2);return Ue(T,{get levels(){return g()}}),q(c),$(()=>be(P,t(s))),h(w,c),se(m)}var ft=new Set(["$$slots","$$events","$$legacy","class"]),pt=z("<!> <!>",1);function bt(w,a){if(new.target)return ee({component:bt,...w});re(a,!0);const g=()=>xe(c,"$levels$",d),r=()=>xe(x,"$startedAt$",d),[d,_]=He();let s=i(a,"class",7,""),m=Ke(a,ft);const c=at(),x=rt();var P={get class(){return s()},set class(u=""){s(u),l()},$set:te,$on:(u,R)=>ae(a,u,R)};{let u=v(()=>`dictation-stop-pill ${s()}`.trim());W(w,qe({variant:"ghost",size:"sm",get class(){return t(u)},"aria-pressed":"true"},()=>m,{children:(R,H)=>{var p=pt(),U=B(p);I(U,{get icon(){return Ze},size:14});var j=M(U,2);Fe(j,{get levels(){return g()},get startedAt(){return r()}}),h(R,p)},$$slots:{default:!0}}))}var T=se(P);return _(),T}var ht=z('<img class="w-full h-full object-cover"/>'),_t=z('<div class="flex size-full items-center justify-center bg-muted text-subtle"><!></div>'),yt=z("<div><!> <!></div> <!>",1),wt=z('<span class="tabular-nums opacity-70 shrink-0" data-testid="attachment-upload-progress"> </span>'),xt=z("<!> <!>",1),kt=z('<div class="w-4 h-4 rounded overflow-hidden shrink-0"><img class="w-full h-full object-cover"/></div>'),zt=z('<div><!> <span class="font-medium truncate max-w-30"> </span> <!> <!></div>');function Pt(w,a){if(new.target)return ee({component:Pt,...w});re(a,!0);let g=i(a,"id",7),r=i(a,"name",7),d=i(a,"type",7,""),_=i(a,"size",7),s=i(a,"file",7),m=i(a,"imageData",7),c=i(a,"imageMimeType",7),x=i(a,"imageUrl",7),P=i(a,"onRemove",7),T=i(a,"class",7,""),u=i(a,"variant",7,"chip"),R=i(a,"thumbnailClass",7,"w-16 h-16"),H=i(a,"disabled",7,!1),p=i(a,"placementStatus",7,void 0),U=i(a,"placementProgress",7,void 0),j=i(a,"placementError",7,void 0),K=i(a,"onRetry",7),V=O(null);const ne=v(()=>mt(c()||d()||s()?.type));let ie=O(null);const y=v(()=>t(ne)?m()&&c()?`data:${pe(c())};base64,${m()}`:x()??t(ie):null);Me(()=>{if(t(ne)&&!(m()&&c())&&s()){const e=URL.createObjectURL(s());return C(ie,e,!0),()=>URL.revokeObjectURL(e)}C(ie,null)});const Se=v(()=>{if(d()==="folder")return Qe;const e=pe(d()||c()||s()?.type);return e.startsWith("image")?Ae:e.includes("javascript")||e.includes("typescript")||e.includes("json")?Ye:e.includes("text")||e.includes("markdown")?et:tt}),le=v(()=>pe(d()||c()||s()?.type).startsWith("image")),Ie=v(()=>{if(p()!=="failed")return;const e=N.chat_attachmentPreview_placementFailed_tooltip({name:r()});return j()?`${e} — ${j()}`:e}),he=v(()=>{if(p()!=="placing"||U()===void 0)return;const e=Math.max(0,Math.min(1,U()));return ct(e,{style:"percent",maximumFractionDigits:0})});let oe=O(!1),ce=O(null);function _e(){u()==="thumbnail"&&t(le)&&t(y)&&C(oe,!0)}function Ee(e){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),_e())}function $e(e){e.stopPropagation(),P()?.(g())}var je={get id(){return g()},set id(e){g(e),l()},get name(){return r()},set name(e){r(e),l()},get type(){return d()},set type(e=""){d(e),l()},get size(){return _()},set size(e){_(e),l()},get file(){return s()},set file(e){s(e),l()},get imageData(){return m()},set imageData(e){m(e),l()},get imageMimeType(){return c()},set imageMimeType(e){c(e),l()},get imageUrl(){return x()},set imageUrl(e){x(e),l()},get onRemove(){return P()},set onRemove(e){P(e),l()},get class(){return T()},set class(e=""){T(e),l()},get variant(){return u()},set variant(e="chip"){u(e),l()},get thumbnailClass(){return R()},set thumbnailClass(e="w-16 h-16"){R(e),l()},get disabled(){return H()},set disabled(e=!1){H(e),l()},get placementStatus(){return p()},set placementStatus(e=void 0){p(e),l()},get placementProgress(){return U()},set placementProgress(e=void 0){U(e),l()},get placementError(){return j()},set placementError(e=void 0){j(e),l()},get onRetry(){return K()},set onRetry(e){K(e),l()},$set:te,$on:(e,b)=>ae(a,e,b)},ye=ke(),Ne=B(ye);{var Oe=e=>{var b=yt(),D=B(b),X=Q(D);{let A=v(()=>N.chat_attachmentPreview_viewFullSize_ariaLabel({name:r()})),F=v(()=>H()||!t(y));W(X,{variant:"plain",wrapContent:!1,type:"button",get class(){return`${R()??""} rounded-lg overflow-hidden cursor-pointer hover:opacity-90 transition-opacity`},onclick:_e,onkeydown:Ee,get"aria-label"(){return t(A)},get title(){return r()},get disabled(){return t(F)},get ref(){return t(ce)},set ref(L){C(ce,L,!0)},children:(L,ve)=>{var Z=ke(),ge=B(Z);{var n=o=>{var f=ht();$(()=>{E(f,"src",t(y)),E(f,"alt",r())}),ze("error",f,()=>C(V,t(y),!0)),Pe(f),h(o,f)},k=o=>{var f=_t(),G=Q(f);I(G,{get icon(){return Ae},size:"15"}),q(f),h(o,f)};S(ge,o=>{t(y)?o(n):o(k,-1)})}h(L,Z)},$$slots:{default:!0}})}var ue=M(X,2);{var me=A=>{{let F=v(()=>N.chat_attachmentPreview_remove_ariaLabel({name:r()}));W(A,{variant:"ghost",size:"icon-xs",class:"absolute top-0.5 right-0.5 opacity-0 group-hover:opacity-100 focus-visible:opacity-100 transition-opacity duration-spring-fast ease-spring-fast motion-reduce:transition-none bg-background/80 hover:bg-background shadow-sm",onclick:$e,get"aria-label"(){return t(F)},children:(L,ve)=>{I(L,{get icon(){return Re},size:"10"})},$$slots:{default:!0}})}};S(ue,A=>{P()&&A(me)})}q(D);var de=M(D,2);{let A=v(()=>t(y)??"");ut(de,{get imageUrl(){return t(A)},get imageName(){return r()},get openerElement(){return t(ce)},get open(){return t(oe)},set open(F){C(oe,F,!0)}})}$(()=>De(D,1,`relative group shrink-0 ${T()??""}`)),J(1,D,()=>Te,()=>({tier:"moderate",y:0,scale:.9})),J(2,D,()=>Le,()=>({tier:"fast"})),h(e,b)},Be=e=>{var b=zt(),D=Q(b);{var X=n=>{var k=xt(),o=B(k);lt(o,{size:15,class:"opacity-50 shrink-0"});var f=M(o,2);{var G=fe=>{var we=wt(),We=Y(we,!0);$(()=>be(We,t(he))),h(fe,we)};S(f,fe=>{t(he)!==void 0&&fe(G)})}h(n,k)},ue=n=>{I(n,{get icon(){return Ge},size:"15",class:"shrink-0"})},me=n=>{var k=kt(),o=Y(k);$(()=>{E(o,"src",t(y)),E(o,"alt",r())}),ze("error",o,()=>C(V,t(y),!0)),Pe(o),h(n,k)},de=n=>{I(n,{get icon(){return t(Se)},size:"15",class:"opacity-30 shrink-0"})};S(D,n=>{p()==="placing"?n(X):p()==="failed"?n(ue,1):t(le)&&t(y)&&t(V)!==t(y)?n(me,2):n(de,-1)})}var A=M(D,2),F=Y(A,!0),L=M(A,2);{var ve=n=>{{let k=v(()=>N.chat_attachmentPreview_retryPlacement_ariaLabel({name:r()}));W(n,{variant:"ghost-light",size:"icon-xs",class:"shrink-0 -my-1",onclick:o=>{o.stopPropagation(),K()(g())},get"aria-label"(){return t(k)},"data-testid":"attachment-retry",children:(o,f)=>{I(o,{get icon(){return Je},size:"10"})},$$slots:{default:!0}})}};S(L,n=>{p()==="failed"&&K()&&n(ve)})}var Z=M(L,2);{var ge=n=>{{let k=v(()=>p()==="failed"?"":"opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),o=v(()=>N.chat_attachmentPreview_removeAttachment_ariaLabel());W(n,{variant:"ghost-light",size:"icon-xs",get class(){return`shrink-0 ${t(k)??""} transition-opacity duration-spring-fast ease-spring-fast motion-reduce:transition-none -my-1 -mr-1`},onclick:()=>P()(g()),get"aria-label"(){return t(o)},children:(f,G)=>{I(f,{get icon(){return Re},size:"10"})},$$slots:{default:!0}})}};S(Z,n=>{P()&&n(ge)})}q(b),$(()=>{De(b,1,`flex items-center gap-1.5 px-2 py-0.5 rounded text-xs whitespace-nowrap group shrink-0 ${p()==="failed"?"bg-danger-background/10 text-danger border border-danger/40":"bg-muted/70 text-subtle"} ${T()??""}`),E(b,"data-placement-status",p()),E(b,"title",t(Ie)),be(F,r())}),J(1,b,()=>Te,()=>({tier:"moderate",y:0,scale:.9})),J(2,b,()=>Le,()=>({tier:"fast"})),h(e,b)};S(Ne,e=>{u()==="thumbnail"&&t(le)&&t(ne)&&(!t(y)||t(V)!==t(y))?e(Oe):e(Be,-1)})}return h(w,ye),se(je)}export{Pt as A,Fe as D,bt as a};
1
+ import{t as ee,bo as i,bw as te,b as ae,br as qe,bs as xe,bq as He,bp as Ke,bm as N}from"./Fcr7AvC-.js";import{bs as re,b_ as $,aD as t,W as h,bA as q,bn as se,c9 as v,aA as l,aB as z,bV as O,br as Ve,ca as Me,bH as C,a5 as Q,bl as Y,bS as M,bO as be,ay as B,a7 as ke,aw as ze,bz as Pe}from"./3SdAC2_C.js";import{f as W}from"./D-lOH49i.js";import{Z as Xe}from"./pYdPYEfN.js";import{F as I,cF as Ze,bF as Ae,d3 as Re,aC as Ge,cr as Je,bn as Qe,bi as Ye,bh as et,bg as tt}from"./ChHRVjww.js";import{az as at,aC as rt}from"./BBuvJMq5.js";import{f as st}from"./9ryMZ44V.js";import{g as nt,i as it,I as lt}from"./CA6H1-bp.js";import{s as E,g as ot,f as De}from"./BRCr02in.js";import{a as Ce}from"./3EQPKXoI.js";import{i as S}from"./BhYXv0ZM.js";import{n as J,l as Te,c as Le}from"./CxR-pcVt.js";import{m as ct}from"./C7b3vXLD.js";import{a as ut}from"./DqVocOV1.js";import{al as mt,j as pe}from"./Db6ExzGF.js";var dt=z('<span class="svelte-dywwvd"></span>'),vt=z('<span class="waveform svelte-dywwvd" aria-hidden="true" data-dictation-waveform=""></span>');function Ue(w,a){if(new.target)return ee({component:Ue,...w});re(a,!0);let g=i(a,"levels",7);const r=v(()=>{const s=g().slice(-Ce).map(m=>Number.isFinite(m)?Math.min(1,Math.max(0,m)):0);return[...new Array(Ce-s.length).fill(0),...s]});var d={get levels(){return g()},set levels(s){g(s),l()},$set:te,$on:(s,m)=>ae(a,s,m)},_=vt();return nt(_,21,()=>t(r),it,(s,m)=>{var c=dt();let x;$(()=>{E(c,"data-level",t(m)),x=ot(c,"",x,{height:`${2+t(m)*12}px`})}),h(s,c)}),q(_),h(w,_),se(d)}var gt=z('<span class="dictation-meter svelte-1oz1rct"><span class="elapsed svelte-1oz1rct" data-dictation-elapsed=""> </span> <!></span>');function Fe(w,a){if(new.target)return ee({component:Fe,...w});re(a,!0);let g=i(a,"levels",7),r=i(a,"startedAt",7,null),d=i(a,"elapsed",7),_=O(Ve(Date.now()));Me(()=>{if(!(d()!==void 0||r()===null))return C(_,Date.now(),!0),Xe.subscribe(new Date(r()),()=>C(_,Date.now(),!0),"second")});const s=v(()=>d()??st(r()===null?0:t(_)-r()));var m={get levels(){return g()},set levels(u){g(u),l()},get startedAt(){return r()},set startedAt(u=null){r(u),l()},get elapsed(){return d()},set elapsed(u){d(u),l()},$set:te,$on:(u,R)=>ae(a,u,R)},c=gt(),x=Q(c),P=Y(x,!0),T=M(x,2);return Ue(T,{get levels(){return g()}}),q(c),$(()=>be(P,t(s))),h(w,c),se(m)}var ft=new Set(["$$slots","$$events","$$legacy","class"]),pt=z("<!> <!>",1);function bt(w,a){if(new.target)return ee({component:bt,...w});re(a,!0);const g=()=>xe(c,"$levels$",d),r=()=>xe(x,"$startedAt$",d),[d,_]=He();let s=i(a,"class",7,""),m=Ke(a,ft);const c=at(),x=rt();var P={get class(){return s()},set class(u=""){s(u),l()},$set:te,$on:(u,R)=>ae(a,u,R)};{let u=v(()=>`dictation-stop-pill ${s()}`.trim());W(w,qe({variant:"ghost",size:"sm",get class(){return t(u)},"aria-pressed":"true"},()=>m,{children:(R,H)=>{var p=pt(),U=B(p);I(U,{get icon(){return Ze},size:14});var j=M(U,2);Fe(j,{get levels(){return g()},get startedAt(){return r()}}),h(R,p)},$$slots:{default:!0}}))}var T=se(P);return _(),T}var ht=z('<img class="w-full h-full object-cover"/>'),_t=z('<div class="flex size-full items-center justify-center bg-muted text-subtle"><!></div>'),yt=z("<div><!> <!></div> <!>",1),wt=z('<span class="tabular-nums opacity-70 shrink-0" data-testid="attachment-upload-progress"> </span>'),xt=z("<!> <!>",1),kt=z('<div class="w-4 h-4 rounded overflow-hidden shrink-0"><img class="w-full h-full object-cover"/></div>'),zt=z('<div><!> <span class="font-medium truncate max-w-30"> </span> <!> <!></div>');function Pt(w,a){if(new.target)return ee({component:Pt,...w});re(a,!0);let g=i(a,"id",7),r=i(a,"name",7),d=i(a,"type",7,""),_=i(a,"size",7),s=i(a,"file",7),m=i(a,"imageData",7),c=i(a,"imageMimeType",7),x=i(a,"imageUrl",7),P=i(a,"onRemove",7),T=i(a,"class",7,""),u=i(a,"variant",7,"chip"),R=i(a,"thumbnailClass",7,"w-16 h-16"),H=i(a,"disabled",7,!1),p=i(a,"placementStatus",7,void 0),U=i(a,"placementProgress",7,void 0),j=i(a,"placementError",7,void 0),K=i(a,"onRetry",7),V=O(null);const ne=v(()=>mt(c()||d()||s()?.type));let ie=O(null);const y=v(()=>t(ne)?m()&&c()?`data:${pe(c())};base64,${m()}`:x()??t(ie):null);Me(()=>{if(t(ne)&&!(m()&&c())&&s()){const e=URL.createObjectURL(s());return C(ie,e,!0),()=>URL.revokeObjectURL(e)}C(ie,null)});const Se=v(()=>{if(d()==="folder")return Qe;const e=pe(d()||c()||s()?.type);return e.startsWith("image")?Ae:e.includes("javascript")||e.includes("typescript")||e.includes("json")?Ye:e.includes("text")||e.includes("markdown")?et:tt}),le=v(()=>pe(d()||c()||s()?.type).startsWith("image")),Ie=v(()=>{if(p()!=="failed")return;const e=N.chat_attachmentPreview_placementFailed_tooltip({name:r()});return j()?`${e} — ${j()}`:e}),he=v(()=>{if(p()!=="placing"||U()===void 0)return;const e=Math.max(0,Math.min(1,U()));return ct(e,{style:"percent",maximumFractionDigits:0})});let oe=O(!1),ce=O(null);function _e(){u()==="thumbnail"&&t(le)&&t(y)&&C(oe,!0)}function Ee(e){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),_e())}function $e(e){e.stopPropagation(),P()?.(g())}var je={get id(){return g()},set id(e){g(e),l()},get name(){return r()},set name(e){r(e),l()},get type(){return d()},set type(e=""){d(e),l()},get size(){return _()},set size(e){_(e),l()},get file(){return s()},set file(e){s(e),l()},get imageData(){return m()},set imageData(e){m(e),l()},get imageMimeType(){return c()},set imageMimeType(e){c(e),l()},get imageUrl(){return x()},set imageUrl(e){x(e),l()},get onRemove(){return P()},set onRemove(e){P(e),l()},get class(){return T()},set class(e=""){T(e),l()},get variant(){return u()},set variant(e="chip"){u(e),l()},get thumbnailClass(){return R()},set thumbnailClass(e="w-16 h-16"){R(e),l()},get disabled(){return H()},set disabled(e=!1){H(e),l()},get placementStatus(){return p()},set placementStatus(e=void 0){p(e),l()},get placementProgress(){return U()},set placementProgress(e=void 0){U(e),l()},get placementError(){return j()},set placementError(e=void 0){j(e),l()},get onRetry(){return K()},set onRetry(e){K(e),l()},$set:te,$on:(e,b)=>ae(a,e,b)},ye=ke(),Ne=B(ye);{var Oe=e=>{var b=yt(),D=B(b),X=Q(D);{let A=v(()=>N.chat_attachmentPreview_viewFullSize_ariaLabel({name:r()})),F=v(()=>H()||!t(y));W(X,{variant:"plain",wrapContent:!1,type:"button",get class(){return`${R()??""} rounded-lg overflow-hidden cursor-pointer hover:opacity-90 transition-opacity`},onclick:_e,onkeydown:Ee,get"aria-label"(){return t(A)},get title(){return r()},get disabled(){return t(F)},get ref(){return t(ce)},set ref(L){C(ce,L,!0)},children:(L,ve)=>{var Z=ke(),ge=B(Z);{var n=o=>{var f=ht();$(()=>{E(f,"src",t(y)),E(f,"alt",r())}),ze("error",f,()=>C(V,t(y),!0)),Pe(f),h(o,f)},k=o=>{var f=_t(),G=Q(f);I(G,{get icon(){return Ae},size:"15"}),q(f),h(o,f)};S(ge,o=>{t(y)?o(n):o(k,-1)})}h(L,Z)},$$slots:{default:!0}})}var ue=M(X,2);{var me=A=>{{let F=v(()=>N.chat_attachmentPreview_remove_ariaLabel({name:r()}));W(A,{variant:"ghost",size:"icon-xs",class:"absolute top-0.5 right-0.5 opacity-0 group-hover:opacity-100 focus-visible:opacity-100 transition-opacity duration-spring-fast ease-spring-fast motion-reduce:transition-none bg-background/80 hover:bg-background shadow-sm",onclick:$e,get"aria-label"(){return t(F)},children:(L,ve)=>{I(L,{get icon(){return Re},size:"10"})},$$slots:{default:!0}})}};S(ue,A=>{P()&&A(me)})}q(D);var de=M(D,2);{let A=v(()=>t(y)??"");ut(de,{get imageUrl(){return t(A)},get imageName(){return r()},get openerElement(){return t(ce)},get open(){return t(oe)},set open(F){C(oe,F,!0)}})}$(()=>De(D,1,`relative group shrink-0 ${T()??""}`)),J(1,D,()=>Te,()=>({tier:"moderate",y:0,scale:.9})),J(2,D,()=>Le,()=>({tier:"fast"})),h(e,b)},Be=e=>{var b=zt(),D=Q(b);{var X=n=>{var k=xt(),o=B(k);lt(o,{size:15,class:"opacity-50 shrink-0"});var f=M(o,2);{var G=fe=>{var we=wt(),We=Y(we,!0);$(()=>be(We,t(he))),h(fe,we)};S(f,fe=>{t(he)!==void 0&&fe(G)})}h(n,k)},ue=n=>{I(n,{get icon(){return Ge},size:"15",class:"shrink-0"})},me=n=>{var k=kt(),o=Y(k);$(()=>{E(o,"src",t(y)),E(o,"alt",r())}),ze("error",o,()=>C(V,t(y),!0)),Pe(o),h(n,k)},de=n=>{I(n,{get icon(){return t(Se)},size:"15",class:"opacity-30 shrink-0"})};S(D,n=>{p()==="placing"?n(X):p()==="failed"?n(ue,1):t(le)&&t(y)&&t(V)!==t(y)?n(me,2):n(de,-1)})}var A=M(D,2),F=Y(A,!0),L=M(A,2);{var ve=n=>{{let k=v(()=>N.chat_attachmentPreview_retryPlacement_ariaLabel({name:r()}));W(n,{variant:"ghost-light",size:"icon-xs",class:"shrink-0 -my-1",onclick:o=>{o.stopPropagation(),K()(g())},get"aria-label"(){return t(k)},"data-testid":"attachment-retry",children:(o,f)=>{I(o,{get icon(){return Je},size:"10"})},$$slots:{default:!0}})}};S(L,n=>{p()==="failed"&&K()&&n(ve)})}var Z=M(L,2);{var ge=n=>{{let k=v(()=>p()==="failed"?"":"opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),o=v(()=>N.chat_attachmentPreview_removeAttachment_ariaLabel());W(n,{variant:"ghost-light",size:"icon-xs",get class(){return`shrink-0 ${t(k)??""} transition-opacity duration-spring-fast ease-spring-fast motion-reduce:transition-none -my-1 -mr-1`},onclick:()=>P()(g()),get"aria-label"(){return t(o)},children:(f,G)=>{I(f,{get icon(){return Re},size:"10"})},$$slots:{default:!0}})}};S(Z,n=>{P()&&n(ge)})}q(b),$(()=>{De(b,1,`flex items-center gap-1.5 px-2 py-0.5 rounded text-xs whitespace-nowrap group shrink-0 ${p()==="failed"?"bg-danger-background/10 text-danger border border-danger/40":"bg-muted/70 text-subtle"} ${T()??""}`),E(b,"data-placement-status",p()),E(b,"title",t(Ie)),be(F,r())}),J(1,b,()=>Te,()=>({tier:"moderate",y:0,scale:.9})),J(2,b,()=>Le,()=>({tier:"fast"})),h(e,b)};S(Ne,e=>{u()==="thumbnail"&&t(le)&&t(ne)&&(!t(y)||t(V)!==t(y))?e(Oe):e(Be,-1)})}return h(w,ye),se(je)}export{Pt as A,Fe as D,bt as a};
@@ -1,4 +1,4 @@
1
- import{t as Jt,bo as v,bm as F,bw as Xt,bs as Ye,bq as Zt,b as Qt}from"./Fcr7AvC-.js";import{bs as en,c5 as Je,ca as xe,aD as t,bH as H,a5 as A,bA as I,W as L,bn as tn,c9 as d,bV as ae,cd as pt,c6 as nn,aA as m,bS as O,b_ as j,bl as Xe,bO as J,aB as T,b$ as Pe,be as sn,a7 as an,ay as Ze}from"./3SdAC2_C.js";import{i as me}from"./BhYXv0ZM.js";import{g as on,i as rn}from"./CA6H1-bp.js";import{f as ln}from"./BRCr02in.js";import{f as cn}from"./CH7HNVC2.js";import{k as dn}from"./D6H34kDj.js";import{JH as Se,ol as fn,Ad as un,sI as bt,on as hn,ad as kt}from"./D0qhIm1r.js";import{b$ as gn,dI as vn}from"./Cq6hdiVw.js";import{c as mn}from"./ChTqQfQN.js";import{c as Lt,h as He,D as pn}from"./_fNgz67j.js";import{F as wt,ba as _t}from"./ChHRVjww.js";import{f as Qe}from"./D-lOH49i.js";import"./pYdPYEfN.js";import{S as Ie}from"./CBbhUF1U.js";import{l as bn}from"./C7b3vXLD.js";import{g as kn}from"./D_jEt7ej.js";function wn(q,c,oe,Re=1){const We=Lt(q,c,oe,"","",{context:3}),re=new Set,pe=new Set,X=_n(Re)-1,De=We.split(`
1
+ import{t as Jt,bo as v,bm as F,bw as Xt,bs as Ye,bq as Zt,b as Qt}from"./Fcr7AvC-.js";import{bs as en,c5 as Je,ca as xe,aD as t,bH as H,a5 as A,bA as I,W as L,bn as tn,c9 as d,bV as ae,cd as pt,c6 as nn,aA as m,bS as O,b_ as j,bl as Xe,bO as J,aB as T,b$ as Pe,be as sn,a7 as an,ay as Ze}from"./3SdAC2_C.js";import{i as me}from"./BhYXv0ZM.js";import{g as on,i as rn}from"./CA6H1-bp.js";import{f as ln}from"./BRCr02in.js";import{f as cn}from"./CH7HNVC2.js";import{k as dn}from"./D6H34kDj.js";import{JH as Se,ol as fn,Ad as un,sI as bt,on as hn,ad as kt}from"./D0qhIm1r.js";import{b$ as gn,dI as vn}from"./Cq6hdiVw.js";import{c as mn}from"./ChTqQfQN.js";import{c as Lt,h as He,D as pn}from"./B92LVVZl.js";import{F as wt,ba as _t}from"./ChHRVjww.js";import{f as Qe}from"./D-lOH49i.js";import"./pYdPYEfN.js";import{S as Ie}from"./CBbhUF1U.js";import{l as bn}from"./C7b3vXLD.js";import{g as kn}from"./D_jEt7ej.js";function wn(q,c,oe,Re=1){const We=Lt(q,c,oe,"","",{context:3}),re=new Set,pe=new Set,X=_n(Re)-1,De=We.split(`
2
2
  `);let s=0,R=0,le=!1;for(const $ of De)if($.startsWith("@@")){le=!0;const Z=$.match(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);Z&&(R=parseInt(Z[1],10),s=parseInt(Z[2],10))}else le&&($.startsWith("+")?(re.add(s+X),s++):$.startsWith("-")?(pe.add(R+X),R++):$.startsWith(" ")&&(s++,R++));return{additions:re,deletions:pe}}function _n(q){return Number.isFinite(q)&&q>1?Math.floor(q):1}var Ln=T("<div><!> <!></div>"),Cn=T('<div class="diff-skeleton svelte-1f4chm"><div class="diff-skeleton-header svelte-1f4chm"><!> <!></div> <div class="diff-skeleton-content svelte-1f4chm"></div></div>'),yn=T('<div class="error-state svelte-1f4chm"><!> <span class="text-danger text-sm ml-2"> </span></div>'),xn=T('<div class="error-state svelte-1f4chm"><!> <span class="text-subtle text-sm ml-2"> </span></div>'),Pn=T('<div class="empty-state svelte-1f4chm"><span class="text-subtle text-sm"><!></span></div>'),Sn=T('<span class="icon">+</span> ',1),Hn=T('<span class="icon">−</span> ',1),In=T('<div class="selection-action-bar svelte-1f4chm"><span class="selection-info"> </span> <!> <!></div>'),Rn=T('<div class="diff-wrapper svelte-1f4chm"><!> <div class="diff-content svelte-1f4chm"><!></div></div>'),Wn=T('<div class="tracked-change-diff-viewer svelte-1f4chm"><!></div>');function Dn(q,c){if(new.target)return Jt({component:Dn,...q});en(c,!0);const oe=()=>Ye(yt,"$read$",re),Re=()=>Ye(It,"$workspace$",re),We=()=>Ye(Rt,"$workingTreeFileContentStore",re),[re,pe]=Zt(),X=mn("TrackedChangeDiffViewer"),De=2*1024*1024;let s=v(c,"change",7),R=v(c,"active",7,!0),le=v(c,"workspaceId",7),$=v(c,"viewMode",7,"unified"),Z=v(c,"showHeader",7,!1),Ne=v(c,"foldUnchanged",7,!0),Ae=v(c,"lineWrapping",7,!1),M=v(c,"onStageHunk",7),U=v(c,"onUnstageHunk",7),et=v(c,"onOpenCommit",7),Me=v(c,"refreshKey",7),Ue=v(c,"branchBaseRef",7),Ee=v(c,"branchBaseCommitSha",7),ge=v(c,"useProvidedContent",7,!1),ce=v(c,"allowHeadReads",7,!0),Fe=v(c,"canReadHeadFiles",7),W=v(c,"lineOffset",7,1),tt=v(c,"lineStageIndicators",7),Oe=v(c,"annotations",23,()=>[]),Te=v(c,"renderAnnotation",7),$e=v(c,"virtualizer",7),G=v(c,"gitRootId",7,void 0),be=v(c,"gitRootPath",7,void 0);const de=Je(()=>le())??kn()?.workspaceId??"",Ct=Math.random().toString(36).substring(2,8),Be=`tracked-diff:${crypto.randomUUID()}`,yt=gn(de,Be),Q=d(()=>oe()?.result?.kind==="trackedDiff"?oe().result:void 0),ke=d(()=>oe()?.loading??!0),nt=d(()=>oe()?.error??null),ze=d(()=>(t(Q)?.oldContent.length??0)+(t(Q)?.newContent.length??0)>De),B=d(()=>t(ze)?"":t(Q)?.oldContent??""),V=d(()=>t(ze)?"":t(Q)?.newContent??""),ee=d(()=>ct(s()?.relativePath||s()?.file||"")),it=d(()=>t(Q)?.chunk?.chunks.length?Ut(t(Q).chunk,t(ee)):""),xt=d(()=>!t(B)&&!t(V)&&!t(it)),Pt=d(()=>!!s()?.gitlink||!!t(Q)?.gitlink),st=d(()=>W()>1?`
3
3
  `.repeat(W()-1):""),St=d(()=>t(st)+t(B)),Ht=d(()=>t(st)+t(V));let w=ae(null),Ke=ae(null),we=null,_e=ae(!1);const It=vn(de),at=pt(void 0),ot=pt(""),Rt=dn(ot,at),rt=d(Re),te=d(()=>be()||t(rt)?.worktreePath||t(rt)?.repositoryPath||""),Le=d(()=>s()?.relativePath||s()?.file||"file"),Wt=d(()=>Mt(t(Le)));let Ce=ae(null),lt=ae("");function ct(e){if(!e.startsWith("/")||!t(te))return e;const i=t(te).endsWith("/")?t(te).slice(0,-1):t(te);if(e.startsWith(i+"/"))return e.slice(i.length+1);if(e.startsWith(i)){const a=e.slice(i.length);return a.startsWith("/")?a.slice(1):a}return e}function Dt(e){return e?e.startsWith("/")?e:t(te)?`${t(te)}/${e}`:null:null}const dt=d(()=>W()>1),Nt=d(()=>t(dt)?`${t(Le)}:${He(t(B))}:off${W()}`:void 0),At=d(()=>t(dt)?`${t(Le)}:${He(t(V))}:off${W()}`:void 0);function Mt(e){const i=e.split(".").pop()?.toLowerCase();return i?{ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",py:"python",rs:"rust",go:"go",rb:"ruby",java:"java",kt:"kotlin",swift:"swift",cs:"csharp",cpp:"cpp",c:"c",h:"c",hpp:"cpp",json:"json",yaml:"yaml",yml:"yaml",toml:"toml",md:"markdown",html:"html",css:"css",scss:"scss",sql:"sql",sh:"bash",bash:"bash",zsh:"bash",svelte:"svelte",vue:"vue"}[i]:void 0}function Ut(e,i){const a=`a/${i}`,o=`b/${i}`,u=[`diff --git ${a} ${o}`,`--- ${a}`,`+++ ${o}`];for(const r of e.chunks){u.push(`@@ -${r.oldStart},${r.oldLines} +${r.newStart},${r.newLines} @@`);for(const h of r.lines){const l=h.type===kt.Addition?"+":h.type===kt.Deletion?"-":" ",g=h.content.endsWith(`
4
4
  `)?h.content.slice(0,-1):h.content;u.push(`${l}${g}`)}}return u.join(`
@@ -1 +1 @@
1
- import{g as l,r as m,d as n}from"./DOrnNMXq.js";import{p}from"./BdvX8QCl.js";import{b as t,ay as o}from"./Dp6gutm7.js";import{M as u,a as f}from"./BBfR26V0.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),y=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),d=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(d(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},N={parser:g,db:n,renderer:m,styles:l};export{N as diagram};
1
+ import{g as l,r as m,d as n}from"./BOOf6vKl.js";import{p}from"./TzUDDwaI.js";import{b as t,ay as o}from"./Cdwy3-nO.js";import{M as u,a as f}from"./BBfR26V0.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),y=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),d=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(d(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},N={parser:g,db:n,renderer:m,styles:l};export{N as diagram};
@@ -1,4 +1,4 @@
1
- import{p as Mt}from"./BdvX8QCl.js";import{aZ as Nt,U as zt,Y as Lt,b0 as Tt,V as Xt,a_ as At,b as u,a6 as Et,W as Yt,q as J,ay as Q,aX as It,B as Bt,r as Ft,X as V}from"./Dp6gutm7.js";import{p as Rt}from"./BBfR26V0.js";var G=u((o,r)=>{const e=o<=1?o*100:o;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return e},"toPercent"),X=u((o,r,e)=>({x:G(r,`${e} evolution`),y:G(o,`${e} visibility`)}),"toCoordinates"),K=u(o=>{if(o){if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward"}},"getFlowFromPort"),Ot=u(o=>{if(!o?.startsWith("+"))return{};const e=/^\+'([^']*)'/.exec(o)?.[1];return o.includes("<>")?{flow:"bidirectional",label:e}:o.includes("<")?{flow:"backward",label:e}:o.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Wt=u((o,r)=>{if(Mt(o,r),o.size&&r.setSize(o.size.width,o.size.height),o.evolution){const e=o.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),h=o.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);r.updateAxes({stages:e,stageBoundaries:h})}if(o.anchors.forEach(e=>{const h=X(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,h.x,h.y,"anchor")}),o.components.forEach(e=>{const h=X(e.visibility,e.evolution,`Component "${e.name}"`),a=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,w=e.decorator?.strategy;r.addNode(e.name,e.name,h.x,h.y,"component",a,d,e.inertia,w)}),o.notes.forEach(e=>{const h=X(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,h.x,h.y)}),o.pipelines.forEach(e=>{const h=r.getNode(e.parent);if(!h||typeof h.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const a=h.y;r.startPipeline(e.parent),e.components.forEach(d=>{const w=`${e.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,R=G(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(w,d.name,R,a,"pipeline-component",C,g),r.addPipelineComponent(e.parent,w)})}),o.links.forEach(e=>{const h=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let a=K(e.fromPort)??K(e.toPort);const{flow:d,label:w}=Ot(e.arrow);!a&&d&&(a=d);const C=e.linkLabel,g=w??C;r.addLink(r.resolveNodeId(e.from),r.resolveNodeId(e.to),h,g,a)}),o.evolves.forEach(e=>{const h=r.getNode(e.component);if(h?.y!==void 0){const a=G(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,a,h.y)}}),o.annotations.length>0){const e=o.annotations[0],h=X(e.x,e.y,"Annotations box");r.setAnnotationsBox(h.x,h.y)}o.annotation.forEach(e=>{const h=X(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:h.x,y:h.y}],e.text)}),o.accelerators.forEach(e=>{const h=X(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,h.x,h.y)}),o.deaccelerators.forEach(e=>{const h=X(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,h.x,h.y)})},"populateDb"),tt={parser:{yy:void 0},parse:u(async o=>{const r=await Rt("wardley",o);Q.debug(r);const e=tt.parser?.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Wt(r,e)},"parse")},E,Dt=(E=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(r){const e=this.nodes.get(r.id)??{id:r.id,label:r.label},h={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,h)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});const e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){const h=this.pipelines.get(r);h&&h.componentIds.push(e);const a=this.nodes.get(e);a&&(a.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}resolveNodeId(r){if(this.nodes.has(r))return r;for(const[e,h]of this.nodes)if(h.label===r)return e;return r}build(){const r=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},u(E,"WardleyBuilder"),E),k=new Dt;function et(){return V()["wardley-beta"]}u(et,"getConfig");function at(o,r,e,h,a,d,w,C,g){k.addNode({id:o,label:r,x:e,y:h,className:a,labelOffsetX:d,labelOffsetY:w,inertia:C,sourceStrategy:g})}u(at,"addNode");function rt(o,r,e=!1,h,a){k.addLink({source:o,target:r,dashed:e,label:h,flow:a})}u(rt,"addLink");function ot(o,r,e){k.addTrend({nodeId:o,targetX:r,targetY:e})}u(ot,"addTrend");function nt(o,r,e){k.addAnnotation({number:o,coordinates:r,text:e})}u(nt,"addAnnotation");function st(o,r,e){k.addNote({text:o,x:r,y:e})}u(st,"addNote");function it(o,r,e){k.addAccelerator({name:o,x:r,y:e})}u(it,"addAccelerator");function dt(o,r,e){k.addDeaccelerator({name:o,x:r,y:e})}u(dt,"addDeaccelerator");function lt(o,r){k.setAnnotationsBox(o,r)}u(lt,"setAnnotationsBox");function ct(o,r){k.setSize(o,r)}u(ct,"setSize");function pt(o){k.startPipeline(o)}u(pt,"startPipeline");function ft(o,r){k.addPipelineComponent(o,r)}u(ft,"addPipelineComponent");function ht(o){k.setAxes(o)}u(ht,"updateAxes");function xt(o){return k.getNode(o)}u(xt,"getNode");function gt(o){return k.resolveNodeId(o)}u(gt,"resolveNodeId");function yt(){return k.build()}u(yt,"getWardleyData");function ut(){k.clear(),Ft()}u(ut,"clear");var Gt={getConfig:et,addNode:at,addLink:rt,addTrend:ot,addAnnotation:nt,addNote:st,addAccelerator:it,addDeaccelerator:dt,setAnnotationsBox:lt,setSize:ct,startPipeline:pt,addPipelineComponent:ft,updateAxes:ht,getNode:xt,resolveNodeId:gt,getWardleyData:yt,clear:ut,setAccTitle:At,getAccTitle:Xt,setDiagramTitle:Tt,getDiagramTitle:Lt,getAccDescription:zt,setAccDescription:Nt},qt=["Genesis","Custom Built","Product","Commodity"],Ht=u(()=>{const{themeVariables:o}=V();return{backgroundColor:o.wardley?.backgroundColor??o.background??"#fff",axisColor:o.wardley?.axisColor??"#000",axisTextColor:o.wardley?.axisTextColor??o.primaryTextColor??"#222",gridColor:o.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:o.wardley?.componentFill??"#fff",componentStroke:o.wardley?.componentStroke??"#000",componentLabelColor:o.wardley?.componentLabelColor??o.primaryTextColor??"#222",linkStroke:o.wardley?.linkStroke??"#000",evolutionStroke:o.wardley?.evolutionStroke??"#dc3545",annotationStroke:o.wardley?.annotationStroke??"#000",annotationTextColor:o.wardley?.annotationTextColor??o.primaryTextColor??"#222",annotationFill:o.wardley?.annotationFill??o.background??"#fff"}},"getTheme"),jt=u(()=>{const o=V()["wardley-beta"];return{width:o?.width??900,height:o?.height??600,padding:o?.padding??48,nodeRadius:o?.nodeRadius??6,nodeLabelOffset:o?.nodeLabelOffset??8,axisFontSize:o?.axisFontSize??12,labelFontSize:o?.labelFontSize??10,showGrid:o?.showGrid??!1,useMaxWidth:o?.useMaxWidth??!0}},"getConfigValues"),Vt=u((o,r,e,h)=>{Q.debug(`Rendering Wardley map
1
+ import{p as Mt}from"./TzUDDwaI.js";import{aZ as Nt,U as zt,Y as Lt,b0 as Tt,V as Xt,a_ as At,b as u,a6 as Et,W as Yt,q as J,ay as Q,aX as It,B as Bt,r as Ft,X as V}from"./Cdwy3-nO.js";import{p as Rt}from"./BBfR26V0.js";var G=u((o,r)=>{const e=o<=1?o*100:o;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return e},"toPercent"),X=u((o,r,e)=>({x:G(r,`${e} evolution`),y:G(o,`${e} visibility`)}),"toCoordinates"),K=u(o=>{if(o){if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward"}},"getFlowFromPort"),Ot=u(o=>{if(!o?.startsWith("+"))return{};const e=/^\+'([^']*)'/.exec(o)?.[1];return o.includes("<>")?{flow:"bidirectional",label:e}:o.includes("<")?{flow:"backward",label:e}:o.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Wt=u((o,r)=>{if(Mt(o,r),o.size&&r.setSize(o.size.width,o.size.height),o.evolution){const e=o.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),h=o.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);r.updateAxes({stages:e,stageBoundaries:h})}if(o.anchors.forEach(e=>{const h=X(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,h.x,h.y,"anchor")}),o.components.forEach(e=>{const h=X(e.visibility,e.evolution,`Component "${e.name}"`),a=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,w=e.decorator?.strategy;r.addNode(e.name,e.name,h.x,h.y,"component",a,d,e.inertia,w)}),o.notes.forEach(e=>{const h=X(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,h.x,h.y)}),o.pipelines.forEach(e=>{const h=r.getNode(e.parent);if(!h||typeof h.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const a=h.y;r.startPipeline(e.parent),e.components.forEach(d=>{const w=`${e.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,R=G(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(w,d.name,R,a,"pipeline-component",C,g),r.addPipelineComponent(e.parent,w)})}),o.links.forEach(e=>{const h=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let a=K(e.fromPort)??K(e.toPort);const{flow:d,label:w}=Ot(e.arrow);!a&&d&&(a=d);const C=e.linkLabel,g=w??C;r.addLink(r.resolveNodeId(e.from),r.resolveNodeId(e.to),h,g,a)}),o.evolves.forEach(e=>{const h=r.getNode(e.component);if(h?.y!==void 0){const a=G(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,a,h.y)}}),o.annotations.length>0){const e=o.annotations[0],h=X(e.x,e.y,"Annotations box");r.setAnnotationsBox(h.x,h.y)}o.annotation.forEach(e=>{const h=X(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:h.x,y:h.y}],e.text)}),o.accelerators.forEach(e=>{const h=X(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,h.x,h.y)}),o.deaccelerators.forEach(e=>{const h=X(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,h.x,h.y)})},"populateDb"),tt={parser:{yy:void 0},parse:u(async o=>{const r=await Rt("wardley",o);Q.debug(r);const e=tt.parser?.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Wt(r,e)},"parse")},E,Dt=(E=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(r){const e=this.nodes.get(r.id)??{id:r.id,label:r.label},h={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,h)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});const e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){const h=this.pipelines.get(r);h&&h.componentIds.push(e);const a=this.nodes.get(e);a&&(a.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}resolveNodeId(r){if(this.nodes.has(r))return r;for(const[e,h]of this.nodes)if(h.label===r)return e;return r}build(){const r=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},u(E,"WardleyBuilder"),E),k=new Dt;function et(){return V()["wardley-beta"]}u(et,"getConfig");function at(o,r,e,h,a,d,w,C,g){k.addNode({id:o,label:r,x:e,y:h,className:a,labelOffsetX:d,labelOffsetY:w,inertia:C,sourceStrategy:g})}u(at,"addNode");function rt(o,r,e=!1,h,a){k.addLink({source:o,target:r,dashed:e,label:h,flow:a})}u(rt,"addLink");function ot(o,r,e){k.addTrend({nodeId:o,targetX:r,targetY:e})}u(ot,"addTrend");function nt(o,r,e){k.addAnnotation({number:o,coordinates:r,text:e})}u(nt,"addAnnotation");function st(o,r,e){k.addNote({text:o,x:r,y:e})}u(st,"addNote");function it(o,r,e){k.addAccelerator({name:o,x:r,y:e})}u(it,"addAccelerator");function dt(o,r,e){k.addDeaccelerator({name:o,x:r,y:e})}u(dt,"addDeaccelerator");function lt(o,r){k.setAnnotationsBox(o,r)}u(lt,"setAnnotationsBox");function ct(o,r){k.setSize(o,r)}u(ct,"setSize");function pt(o){k.startPipeline(o)}u(pt,"startPipeline");function ft(o,r){k.addPipelineComponent(o,r)}u(ft,"addPipelineComponent");function ht(o){k.setAxes(o)}u(ht,"updateAxes");function xt(o){return k.getNode(o)}u(xt,"getNode");function gt(o){return k.resolveNodeId(o)}u(gt,"resolveNodeId");function yt(){return k.build()}u(yt,"getWardleyData");function ut(){k.clear(),Ft()}u(ut,"clear");var Gt={getConfig:et,addNode:at,addLink:rt,addTrend:ot,addAnnotation:nt,addNote:st,addAccelerator:it,addDeaccelerator:dt,setAnnotationsBox:lt,setSize:ct,startPipeline:pt,addPipelineComponent:ft,updateAxes:ht,getNode:xt,resolveNodeId:gt,getWardleyData:yt,clear:ut,setAccTitle:At,getAccTitle:Xt,setDiagramTitle:Tt,getDiagramTitle:Lt,getAccDescription:zt,setAccDescription:Nt},qt=["Genesis","Custom Built","Product","Commodity"],Ht=u(()=>{const{themeVariables:o}=V();return{backgroundColor:o.wardley?.backgroundColor??o.background??"#fff",axisColor:o.wardley?.axisColor??"#000",axisTextColor:o.wardley?.axisTextColor??o.primaryTextColor??"#222",gridColor:o.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:o.wardley?.componentFill??"#fff",componentStroke:o.wardley?.componentStroke??"#000",componentLabelColor:o.wardley?.componentLabelColor??o.primaryTextColor??"#222",linkStroke:o.wardley?.linkStroke??"#000",evolutionStroke:o.wardley?.evolutionStroke??"#dc3545",annotationStroke:o.wardley?.annotationStroke??"#000",annotationTextColor:o.wardley?.annotationTextColor??o.primaryTextColor??"#222",annotationFill:o.wardley?.annotationFill??o.background??"#fff"}},"getTheme"),jt=u(()=>{const o=V()["wardley-beta"];return{width:o?.width??900,height:o?.height??600,padding:o?.padding??48,nodeRadius:o?.nodeRadius??6,nodeLabelOffset:o?.nodeLabelOffset??8,axisFontSize:o?.axisFontSize??12,labelFontSize:o?.labelFontSize??10,showGrid:o?.showGrid??!1,useMaxWidth:o?.useMaxWidth??!0}},"getConfigValues"),Vt=u((o,r,e,h)=>{Q.debug(`Rendering Wardley map
2
2
  `+o);const a=jt(),d=Ht(),w=a.nodeRadius*1.6,C=h.db,g=C.getWardleyData(),R=C.getDiagramTitle(),S=g.size?.width??a.width,b=g.size?.height??a.height,Y=It(r);Y.selectAll("*").remove(),Bt(Y,b,S,a.useMaxWidth),Y.attr("viewBox",`0 0 ${S} ${b}`);const v=Y.append("g").attr("class","wardley-map"),q=Y.append("defs");q.append("marker").attr("id",`arrow-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-end-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-start-${r}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),v.append("rect").attr("class","wardley-background").attr("width",S).attr("height",b).attr("fill",d.backgroundColor);const I=S-a.padding*2,B=b-a.padding*2;R&&v.append("text").attr("class","wardley-title").attr("x",S/2).attr("y",a.padding/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(R);const z=u(t=>a.padding+t/100*I,"projectX"),L=u(t=>b-a.padding-t/100*B,"projectY"),O=v.append("g").attr("class","wardley-axes");O.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1),O.append("line").attr("x1",a.padding).attr("x2",a.padding).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const wt=g.axes.xLabel??"Evolution",mt=g.axes.yLabel??"Visibility";O.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",a.padding+I/2).attr("y",b-a.padding/4).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(wt),O.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",a.padding/3).attr("y",a.padding+B/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${a.padding/3} ${a.padding+B/2})`).text(mt);const F=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:qt;if(F.length>0){const t=v.append("g").attr("class","wardley-stages"),s=g.axes.stageBoundaries,n=[];if(s&&s.length===F.length){let i=0;s.forEach(p=>{n.push({start:i,end:p}),i=p})}else{const i=1/F.length;F.forEach((p,l)=>{n.push({start:l*i,end:(l+1)*i})})}F.forEach((i,p)=>{const l=n[p],f=a.padding+l.start*I,x=a.padding+l.end*I,y=(f+x)/2;p>0&&t.append("line").attr("x1",f).attr("x2",f).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",y).attr("y",b-a.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(a.showGrid){const t=v.append("g").attr("class","wardley-grid");for(let s=1;s<4;s++){const n=s/4,i=a.padding+I*n;t.append("line").attr("x1",i).attr("x2",i).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding-B*n).attr("y2",b-a.padding-B*n).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:z(t.x),y:L(t.y),node:t})}),g.pipelines.length>0){const t=v.append("g").attr("class","wardley-pipelines"),s=v.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(n=>{if(n.componentIds.length===0)return;const i=n.componentIds.map(x=>({id:x,pos:c.get(x),node:g.nodes.find(y=>y.id===x)})).filter(x=>x.pos&&x.node).sort((x,y)=>x.node.x-y.node.x);for(let x=0;x<i.length-1;x++){const y=i[x],m=i[x+1];s.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",y.pos.x).attr("y1",y.pos.y).attr("x2",m.pos.x).attr("y2",m.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let p=1/0,l=-1/0,f=0;if(n.componentIds.forEach(x=>{const y=c.get(x);y&&(p=Math.min(p,y.x),l=Math.max(l,y.x),f=y.y)}),p!==1/0&&l!==-1/0){const y=a.nodeRadius*4,m=f-y/2,P=c.get(n.nodeId);if(P){const N=(p+l)/2;P.x=N,P.y=m-w/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",p-15).attr("y",m).attr("width",l-p+30).attr("height",y).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=v.append("g").attr("class","wardley-links"),Z=new Map;g.pipelines.forEach(t=>{Z.set(t.nodeId,new Set(t.componentIds))});const U=g.links.filter(t=>!(!c.has(t.source)||!c.has(t.target)||Z.get(t.target)?.has(t.source)));_.selectAll("line").data(U).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.x+l/x*p}).attr("y1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.y+f/x*p}).attr("x2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.x+l/x*p}).attr("y2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.y+f/x*p}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${r})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${r})`:null),_.selectAll("text").data(U.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=n.y-s.y,l=n.x-s.x,f=Math.sqrt(l*l+p*p),x=8,y=p/f;return i+y*x}).attr("y",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.y+n.y)/2,p=n.x-s.x,l=n.y-s.y,f=Math.sqrt(p*p+l*l),x=8,y=-p/f;return i+y*x}).attr("fill",d.axisTextColor).attr("font-size",a.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=(s.y+n.y)/2,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f),y=8,m=f/x,P=-l/x,N=i+m*y,W=p+P*y;let A=Math.atan2(f,l)*180/Math.PI;return(A>90||A<-90)&&(A+=180),`rotate(${A} ${N} ${W})`}).text(t=>t.label);const kt=v.append("g").attr("class","wardley-trends"),bt=g.trends.map(t=>{const s=c.get(t.nodeId);if(!s)return null;const n=z(t.targetX),i=L(t.targetY),p=n-s.x,l=i-s.y,f=Math.sqrt(p*p+l*l),x=a.nodeRadius+2,y=f>x?n-p/f*x:n,m=f>x?i-l/f*x:i;return{origin:s,targetX:n,targetY:i,adjustedX2:y,adjustedY2:m}}).filter(t=>t!==null);kt.selectAll("line").data(bt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${r})`);const M=v.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));M.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const T=M.filter(t=>t.sourceStrategy==="market");T.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const H=a.nodeRadius*.7,$=a.nodeRadius*1.2;if(T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),M.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-w/2).attr("y",t=>c.get(t.id).y-w/2).attr("width",w).attr("height",w).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const s=c.get(t.id);let n=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y1",t=>{const s=c.get(t.id),n=t.isPipelineParent?w:a.nodeRadius*2;return s.y-n/2}).attr("x2",t=>{const s=c.get(t.id);let n=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y2",t=>{const s=c.get(t.id),n=t.isPipelineParent?w:a.nodeRadius*2;return s.y+n/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),M.append("text").attr("x",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?s.x+t.labelOffsetX:s.x;let n=a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(n+=10);const i=t.labelOffsetX??n;return s.x+i}).attr("y",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?s.y+t.labelOffsetY:s.y-3;let n=-a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(n-=10);const i=t.labelOffsetY??n;return s.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",a.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=v.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(s=>{const n=s.coordinates.map(i=>({x:z(i.x),y:L(i.y)}));if(n.length>1)for(let i=0;i<n.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",n[i].x).attr("y1",n[i].y).attr("x2",n[i+1].x).attr("y2",n[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");n.forEach(i=>{const p=t.append("g").attr("class","wardley-annotation");p.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),p.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.number)})}),g.annotationsBox){let s=z(g.annotationsBox.x),n=L(g.annotationsBox.y);const i=10,p=16,l=11,f=t.append("g").attr("class","wardley-annotations-box"),x=[...g.annotations].filter(m=>m.text).sort((m,P)=>m.number-P.number),y=[];if(x.forEach((m,P)=>{const N=f.append("text").attr("x",s+i).attr("y",n+i+(P+1)*p).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${m.number}. ${m.text}`);y.push(N)}),y.length>0){let m=0,P=0;y.forEach(j=>{const D=j.node(),Ct=D.getComputedTextLength();m=Math.max(m,Ct);const St=D.getBBox();P=Math.max(P,St.height)});const N=m+i*2+105,W=x.length*p+i*2+P/2,A=a.padding,$t=S-a.padding-N,vt=a.padding,Pt=b-a.padding-W;s=Math.max(A,Math.min(s,$t)),n=Math.max(vt,Math.min(n,Pt)),y.forEach((j,D)=>{j.attr("x",s+i).attr("y",n+i+(D+1)*p)}),f.insert("rect","text").attr("x",s).attr("y",n).attr("width",N).attr("height",W).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=v.append("g").attr("class","wardley-notes");g.notes.forEach(s=>{const n=z(s.x),i=L(s.y);t.append("text").attr("x",n).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.text)})}if(g.accelerators.length>0){const t=v.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(s=>{const n=z(s.x),i=L(s.y),p=60,l=30,f=20,x=`
3
3
  M ${n} ${i-l/2}
4
4
  L ${n+p-f} ${i-l/2}