@intent-hq/web 2.286.0 → 2.286.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/web/app/immutable/chunks/{CDJ_ELzg.js → -4iKCYSl.js} +1 -1
- package/web/app/immutable/chunks/{Chf_Fl2B.js → 172GvQgx.js} +2 -2
- package/web/app/immutable/chunks/{D6COgTM-.js → 2FstYM1s.js} +1 -1
- package/web/app/immutable/chunks/{3Z97DIlM.js → 2LPpSBFe.js} +1 -1
- package/web/app/immutable/chunks/{Cs20ySp7.js → 2oaDc1nn.js} +1 -1
- package/web/app/immutable/chunks/{Dyliunfi.js → 3q61Z6zu.js} +1 -1
- package/web/app/immutable/chunks/{BQ3bMc6Z.js → 3sa2ZSPC.js} +1 -1
- package/web/app/immutable/chunks/{ntY1kBD_.js → 4LCvEsVS.js} +1 -1
- package/web/app/immutable/chunks/{C-mk0nP2.js → 9JjZRepm.js} +1 -1
- package/web/app/immutable/chunks/{B6gQoWXg.js → ALbX902-.js} +1 -1
- package/web/app/immutable/chunks/{DrSSXu2F.js → B-34RgWF.js} +1 -1
- package/web/app/immutable/chunks/{D_dLrI0U.js → B-jWalbO.js} +1 -1
- package/web/app/immutable/chunks/{DVTHNszZ.js → B0jdpkVd.js} +1 -1
- package/web/app/immutable/chunks/{Bn3u1qCw.js → B1kJVNhf.js} +1 -1
- package/web/app/immutable/chunks/{DkqK0dDf.js → B2SAFlE_.js} +1 -1
- package/web/app/immutable/chunks/{56xQ7UwB.js → B5NXv3LV.js} +5 -5
- package/web/app/immutable/chunks/{DzBZYbxf.js → B5OVBjIf.js} +1 -1
- package/web/app/immutable/chunks/{Ri4koGu7.js → B5VfU0KM.js} +1 -1
- package/web/app/immutable/chunks/{GLnb0LyE.js → B5WfnJ_I.js} +1 -1
- package/web/app/immutable/chunks/{DAr_Dvla.js → B78OjmQ3.js} +1 -1
- package/web/app/immutable/chunks/{B0cCp_Aa.js → B8N5zbP-.js} +1 -1
- package/web/app/immutable/chunks/{DiC8oKjq.js → BAEKjYyz.js} +1 -1
- package/web/app/immutable/chunks/{Bs4HUfJo.js → BB0aq9c_.js} +1 -1
- package/web/app/immutable/chunks/{D-pCMoMn.js → BCYRUItZ.js} +4 -4
- package/web/app/immutable/chunks/{C9qFBNQj.js → BCiyShif.js} +1 -1
- package/web/app/immutable/chunks/{DUzPnyGA.js → BDFJ3z4C.js} +1 -1
- package/web/app/immutable/chunks/{CjxObJZi.js → BGgB8Pc0.js} +2 -2
- package/web/app/immutable/chunks/{C9AXCraB.js → BHwB2t2J.js} +6 -6
- package/web/app/immutable/chunks/{BeMvzl_f.js → BIGmpOjZ.js} +1 -1
- package/web/app/immutable/chunks/{CdFYk_1W.js → BIY56SBV.js} +1 -1
- package/web/app/immutable/chunks/{BJHEhKgU.js → BKAT2tIv.js} +1 -1
- package/web/app/immutable/chunks/{B2TUPPiF.js → BOFk1KrL.js} +1 -1
- package/web/app/immutable/chunks/{DI0TMqPc.js → BR5lR6Td.js} +1 -1
- package/web/app/immutable/chunks/{B8dBdB7e.js → BTRxaITj.js} +1 -1
- package/web/app/immutable/chunks/{C0G0PX0u.js → BUqUwu2G.js} +1 -1
- package/web/app/immutable/chunks/{B7DCx2hz.js → BY3DTY8F.js} +1 -1
- package/web/app/immutable/chunks/BZXl3la6.js +1 -0
- package/web/app/immutable/chunks/{BFsOXNGt.js → B_IE7AMR.js} +1 -1
- package/web/app/immutable/chunks/{BGjb8Qjk.js → B_Ngo80M.js} +1 -1
- package/web/app/immutable/chunks/{DvxGhfNP.js → BaWkgFPr.js} +1 -1
- package/web/app/immutable/chunks/{PZFTHLU3.js → BbANJKYX.js} +1 -1
- package/web/app/immutable/chunks/{C02RZikS.js → BdMP-rwq.js} +1 -1
- package/web/app/immutable/chunks/{DBF6GPx0.js → BdvBYYZC.js} +1 -1
- package/web/app/immutable/chunks/{CIm4PPkq.js → Bg8XhRuy.js} +1 -1
- package/web/app/immutable/chunks/{D6KefGE1.js → BgX6IJDk.js} +1 -1
- package/web/app/immutable/chunks/{lewsHE8q.js → BhBL2il-.js} +1 -1
- package/web/app/immutable/chunks/{BNC8-4cK.js → BhIrT2jr.js} +2 -2
- package/web/app/immutable/chunks/{BQjY0tdo.js → BkBZtLYF.js} +1 -1
- package/web/app/immutable/chunks/{k7Ld4LMq.js → Bluyq349.js} +1 -1
- package/web/app/immutable/chunks/{DY68UZFm.js → BmnDHgDT.js} +1 -1
- package/web/app/immutable/chunks/{xVOajdtP.js → Bn4hj7HG.js} +1 -1
- package/web/app/immutable/chunks/{BCUnwbyv.js → BnDVzHAF.js} +1 -1
- package/web/app/immutable/chunks/{DmBGSw9-.js → BsKoK3Rk.js} +1 -1
- package/web/app/immutable/chunks/{CvV52h5m.js → BsNGkCax.js} +1 -1
- package/web/app/immutable/chunks/{Bicndtmn.js → BwixslcF.js} +1 -1
- package/web/app/immutable/chunks/{DaZZAAu8.js → BwqCA_Tg.js} +1 -1
- package/web/app/immutable/chunks/{B_6wEGEf.js → BxKmCVSh.js} +1 -1
- package/web/app/immutable/chunks/{CJmb8k0H.js → Bxc57npw.js} +1 -1
- package/web/app/immutable/chunks/{CaHgiqe9.js → Bz08MgGK.js} +1 -1
- package/web/app/immutable/chunks/{CSJZS0lA.js → C4Zcz5ig.js} +1 -1
- package/web/app/immutable/chunks/{B7DKu6qV.js → C4lY6YLh.js} +1 -1
- package/web/app/immutable/chunks/{kpFOTYnh.js → C5E1PJb6.js} +2 -2
- package/web/app/immutable/chunks/{COt9Pvf4.js → C5RdKv5y.js} +1 -1
- package/web/app/immutable/chunks/{Co0ihRW6.js → C68FzyYL.js} +1 -1
- package/web/app/immutable/chunks/{_rq_6KIb.js → C6RQmr0V.js} +1 -1
- package/web/app/immutable/chunks/{CmGMJu5O.js → C9129WmZ.js} +1 -1
- package/web/app/immutable/chunks/{l-Mx-Ot5.js → C9g8CU4z.js} +1 -1
- package/web/app/immutable/chunks/{Dlo6-weE.js → CC-oK8xP.js} +2 -2
- package/web/app/immutable/chunks/{TQpilk5Q.js → CDuyWy4D.js} +1 -1
- package/web/app/immutable/chunks/{mi0eelXX.js → CEiokx4X.js} +1 -1
- package/web/app/immutable/chunks/{BiD1HX8_.js → CG-WEY6g.js} +1 -1
- package/web/app/immutable/chunks/{CoiRuxwo.js → CJKeXT5H.js} +1 -1
- package/web/app/immutable/chunks/{CdI01xQ-.js → CJPP3n_b.js} +1 -1
- package/web/app/immutable/chunks/{CtkAP08J.js → CJlBFmXK.js} +1 -1
- package/web/app/immutable/chunks/{BkLUmk09.js → CM-RTisq.js} +1 -1
- package/web/app/immutable/chunks/{DAbHF0T4.js → CMieQf0P.js} +1 -1
- package/web/app/immutable/chunks/{BJLvjFp2.js → CN1yc9sw.js} +1 -1
- package/web/app/immutable/chunks/{DYsBpJwe.js → CN6UuCI4.js} +6 -6
- package/web/app/immutable/chunks/{C1cHuYQR.js → CNG6DDdt.js} +1 -1
- package/web/app/immutable/chunks/{C0pxlxBi.js → CQ8xUw8b.js} +1 -1
- package/web/app/immutable/chunks/{XM04eAeD.js → CQlclm_i.js} +1 -1
- package/web/app/immutable/chunks/{BMdDrmtC.js → CU9uaZDq.js} +1 -1
- package/web/app/immutable/chunks/{C-WAMDJQ.js → CaJjlkv1.js} +1 -1
- package/web/app/immutable/chunks/{5CUEdg-r.js → CbQJkQ1_.js} +1 -1
- package/web/app/immutable/chunks/{DbIMjJXa.js → Cbe4LDCb.js} +1 -1
- package/web/app/immutable/chunks/{BGZJQhsJ.js → Cc8gV_FE.js} +1 -1
- package/web/app/immutable/chunks/{D_cySYsU.js → CcDZ8sih.js} +4 -4
- package/web/app/immutable/chunks/{d89Xcl43.js → CcFGFqFC.js} +1 -1
- package/web/app/immutable/chunks/{dbkedfAT.js → CdEtW7wp.js} +1 -1
- package/web/app/immutable/chunks/{BcTp6STH.js → Cdv2uRTZ.js} +1 -1
- package/web/app/immutable/chunks/{D2B7k8JK.js → CeHlFtmN.js} +1 -1
- package/web/app/immutable/chunks/{C8ErG3Ti.js → Cf1Jz9Vb.js} +1 -1
- package/web/app/immutable/chunks/{BVS_SYYU.js → CfHaLL96.js} +1 -1
- package/web/app/immutable/chunks/{DruGfJeI.js → Cg71xtru.js} +1 -1
- package/web/app/immutable/chunks/{BG0oLquu.js → CgOfeXf8.js} +1 -1
- package/web/app/immutable/chunks/{ISHdJQIS.js → ChMhvUux.js} +1 -1
- package/web/app/immutable/chunks/{gJj2ll-C.js → ChOA9PWi.js} +1 -1
- package/web/app/immutable/chunks/{BNK82DII.js → Cic3Ymv4.js} +2 -2
- package/web/app/immutable/chunks/{CCFQ-Alr.js → CjOA3fQ_.js} +1 -1
- package/web/app/immutable/chunks/{B8m1QbYL.js → CjOWZNUy.js} +1 -1
- package/web/app/immutable/chunks/{dYWp2umn.js → CnT2T-Bp.js} +4 -4
- package/web/app/immutable/chunks/{B0SI3LHQ.js → CqwbuddS.js} +1 -1
- package/web/app/immutable/chunks/{OXZoGb0R.js → Ct7iVnk5.js} +2 -2
- package/web/app/immutable/chunks/{CVj2l_--.js → CusMGTEg.js} +1 -1
- package/web/app/immutable/chunks/{DfJuueNN.js → Cv6pFp-w.js} +1 -1
- package/web/app/immutable/chunks/{DnOJJY51.js → CzK2fiHA.js} +1 -1
- package/web/app/immutable/chunks/{BPTrqAAS.js → D4uZwrDX.js} +1 -1
- package/web/app/immutable/chunks/{DCH75OV4.js → D61mreVc.js} +1 -1
- package/web/app/immutable/chunks/{CcUy0MZb.js → D6eVIgjz.js} +1 -1
- package/web/app/immutable/chunks/{nueT549f.js → D7y4iPD0.js} +1 -1
- package/web/app/immutable/chunks/{CB3GX1yA.js → D9qYrFLr.js} +1 -1
- package/web/app/immutable/chunks/{DEdfIv3e.js → DAPK9slU.js} +1 -1
- package/web/app/immutable/chunks/{DwQIcgBv.js → DES0UXLU.js} +1 -1
- package/web/app/immutable/chunks/{Bzkdeh8y.js → DGWxO_aL.js} +1 -1
- package/web/app/immutable/chunks/{HlPO1bnj.js → DHLYr2dR.js} +1 -1
- package/web/app/immutable/chunks/{De1JVdD9.js → DJeS0Z6Z.js} +1 -1
- package/web/app/immutable/chunks/{C8rZ--zU.js → DKnyYiOE.js} +1 -1
- package/web/app/immutable/chunks/{uw1PkdUT.js → DLOFCVO4.js} +1 -1
- package/web/app/immutable/chunks/{DhGf56sV.js → DM4MRAyE.js} +1 -1
- package/web/app/immutable/chunks/{Div3O1DS.js → DNOilvOO.js} +1 -1
- package/web/app/immutable/chunks/{DjctxIWk.js → DQprfQGN.js} +1 -1
- package/web/app/immutable/chunks/{Dr_LoEnL.js → DU5u4CoB.js} +7 -7
- package/web/app/immutable/chunks/{7af0JAJg.js → DWvbS4mu.js} +1 -1
- package/web/app/immutable/chunks/{DJkPn6Gx.js → DZ2EweHv.js} +1 -1
- package/web/app/immutable/chunks/{CkrCogn1.js → DcOGngFl.js} +1 -1
- package/web/app/immutable/chunks/{DSQ3vRlg.js → DdZVLxLI.js} +1 -1
- package/web/app/immutable/chunks/{Mzah6e0Y.js → De60mY1u.js} +1 -1
- package/web/app/immutable/chunks/{Buurk15r.js → DeD2_APR.js} +1 -1
- package/web/app/immutable/chunks/{GpCuPOMi.js → DeMWATch.js} +1 -1
- package/web/app/immutable/chunks/{BTNf3wFt.js → Dh52so4o.js} +3 -3
- package/web/app/immutable/chunks/{DXB5HblX.js → DiBTM3GP.js} +1 -1
- package/web/app/immutable/chunks/{D5JRqy6x.js → Dj9OdxPP.js} +1 -1
- package/web/app/immutable/chunks/{NDbFoi5z.js → DoIwXvY5.js} +1 -1
- package/web/app/immutable/chunks/{L12CYOVO.js → DqkDKEMV.js} +1 -1
- package/web/app/immutable/chunks/{nwovZHdj.js → DrI7rzCm.js} +1 -1
- package/web/app/immutable/chunks/{JbMhibU_.js → Ds-FLOE0.js} +1 -1
- package/web/app/immutable/chunks/{DKV7MzlU.js → Du9ULB4g.js} +1 -1
- package/web/app/immutable/chunks/{DeZfFoGy.js → DuXpwSkB.js} +1 -1
- package/web/app/immutable/chunks/{B_W5YLJO.js → DuzQF9m7.js} +1 -1
- package/web/app/immutable/chunks/{DtOFraMI.js → DvDXb3dW.js} +1 -1
- package/web/app/immutable/chunks/{HldT4ikO.js → Dxitz0gG.js} +1 -1
- package/web/app/immutable/chunks/{BWrcajCX.js → DyjYgqtH.js} +1 -1
- package/web/app/immutable/chunks/{BhyIRQr5.js → Dz40TuR7.js} +1 -1
- package/web/app/immutable/chunks/{BQDw3Pte.js → F7QETuhI.js} +1 -1
- package/web/app/immutable/chunks/{DEKYlpc6.js → F9nw4iUp.js} +1 -1
- package/web/app/immutable/chunks/{DcGdAMCM.js → Fy3QvGgT.js} +1 -1
- package/web/app/immutable/chunks/{fomUVS1s.js → HHGL3CBU.js} +1 -1
- package/web/app/immutable/chunks/{eL1b8zaP.js → HjNzRj_q.js} +1 -1
- package/web/app/immutable/chunks/{DN_2OUdP.js → JktSJt1s.js} +1 -1
- package/web/app/immutable/chunks/{Dh5f48wP.js → O_LhoKyf.js} +1 -1
- package/web/app/immutable/chunks/{CqjtslkE.js → Ov_SEXEY.js} +1 -1
- package/web/app/immutable/chunks/{CaIUs75U.js → PSWhBTN5.js} +1 -1
- package/web/app/immutable/chunks/{CcV3kPLR.js → QOLdaLP0.js} +1 -1
- package/web/app/immutable/chunks/{B41oTkHx.js → R0wDqNpY.js} +1 -1
- package/web/app/immutable/chunks/{Dtkr3IzA.js → RNQdr-NN.js} +1 -1
- package/web/app/immutable/chunks/{CnIHDDU4.js → TKnaMJht.js} +1 -1
- package/web/app/immutable/chunks/{C7RFabs2.js → Uvf94Vit.js} +1 -1
- package/web/app/immutable/chunks/{Qm-8Rnhn.js → VwRqUxpW.js} +1 -1
- package/web/app/immutable/chunks/{DXJWuR1_.js → XgTDusK7.js} +1 -1
- package/web/app/immutable/chunks/{BXR-y2IP.js → YIljg4QC.js} +1 -1
- package/web/app/immutable/chunks/{BMncCJZO.js → aWlYJ1qq.js} +1 -1
- package/web/app/immutable/chunks/{BqwrnPhf.js → b7qEBWdv.js} +1 -1
- package/web/app/immutable/chunks/{BOIMw4Zi.js → bb6KeZoT.js} +1 -1
- package/web/app/immutable/chunks/{BwTELta_.js → cKTNBTNE.js} +1 -1
- package/web/app/immutable/chunks/{nAVCqI07.js → fsCYHFC5.js} +1 -1
- package/web/app/immutable/chunks/{CdJ_TYfc.js → gn8kmMF6.js} +1 -1
- package/web/app/immutable/chunks/{CgJ50q_P.js → hTe-_Fjh.js} +3 -3
- package/web/app/immutable/chunks/{_oQK0i74.js → kpgdVhmB.js} +1 -1
- package/web/app/immutable/chunks/{DsBaaPlG.js → l6-BV5ui.js} +1 -1
- package/web/app/immutable/chunks/{CcpIKHPS.js → l9lbU6dU.js} +1 -1
- package/web/app/immutable/chunks/{BqCv-GxN.js → lN-utS8K.js} +1 -1
- package/web/app/immutable/chunks/{DzQq420D.js → laFenviK.js} +3 -3
- package/web/app/immutable/chunks/{BzagSfa0.js → nvAK9EyO.js} +1 -1
- package/web/app/immutable/chunks/{C1KS3a3w.js → oTkHTTGI.js} +1 -1
- package/web/app/immutable/chunks/{C8o2LGLL.js → p20Ma5Ub.js} +1 -1
- package/web/app/immutable/chunks/{CdWs5u7R.js → pUHkzJ_d.js} +1 -1
- package/web/app/immutable/chunks/{BpmH_LJw.js → pqiENG4w.js} +1 -1
- package/web/app/immutable/chunks/{CT4vZdRl.js → qk0mFpjO.js} +1 -1
- package/web/app/immutable/chunks/{CwM2Qhat.js → qsyNpi2_.js} +1 -1
- package/web/app/immutable/chunks/{DytO0GHe.js → vkDSSzeI.js} +1 -1
- package/web/app/immutable/chunks/{BpfenzkQ.js → xpCT4rnW.js} +1 -1
- package/web/app/immutable/chunks/{CKgR37uW.js → zln0bEou.js} +1 -1
- package/web/app/immutable/entry/{app.1uhZRRjp.js → app.BvKW_t2N.js} +2 -2
- package/web/app/immutable/entry/start.CQ7TZDH6.js +1 -0
- package/web/app/immutable/nodes/{0.DLt-CtDX.js → 0.BYMSP7Y-.js} +1 -1
- package/web/app/immutable/nodes/{1.BPvEDLUK.js → 1.DIEji4Js.js} +1 -1
- package/web/app/immutable/nodes/{10.B5xDYK4a.js → 10.DvTvrgji.js} +1 -1
- package/web/app/immutable/nodes/{14.BQTbKD3r.js → 14.CJs3OY3_.js} +1 -1
- package/web/app/immutable/nodes/{16.pwQIYuiW.js → 16.DsO7YO_c.js} +2 -2
- package/web/app/immutable/nodes/{2.C-FkYY8y.js → 2.Cht0dQl2.js} +3 -3
- package/web/app/immutable/nodes/{3.BDZTjYux.js → 3.BGeidrSE.js} +1 -1
- package/web/app/immutable/nodes/{4.yZhJP9E2.js → 4.iguZO2rl.js} +1 -1
- package/web/app/immutable/nodes/{5.DGLDlDY1.js → 5.BppWO1IB.js} +1 -1
- package/web/app/immutable/nodes/{6.CsH42tzX.js → 6.ChXOvT3x.js} +1 -1
- package/web/app/immutable/nodes/{7.mSAj_Ru-.js → 7.CgsIeK3J.js} +1 -1
- package/web/app/immutable/nodes/{8.bwqgMCZl.js → 8.Bq2NzD4c.js} +2 -2
- package/web/app/immutable/nodes/{9.CPziyhjK.js → 9.CvEBRJEV.js} +1 -1
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/chunks/Dtgjfsuk.js +0 -1
- package/web/app/immutable/entry/start.CKsznvSy.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as a,c3 as o}from"./
|
|
1
|
+
import{f as a,c3 as o}from"./BHwB2t2J.js";var g=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{g};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var il=Object.defineProperty;var ll=(r,t,n)=>t in r?il(r,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[t]=n;var _n=(r,t,n)=>ll(r,typeof t!="symbol"?t+"":t,n);import{t as vt,bq as m,bo as g,a_ as W,by as ht,b as _t,bs as Un,bu as or,bt as dl,br as aa}from"./COCO5InB.js";import{bs as yt,a5 as D,bA as E,bS as R,bl as ie,ay as xe,aD as e,b_ as B,bO as J,W as f,c9 as s,bn as bt,bV as me,bH as z,aA as p,be as br,b$ as Vr,aB as T,bj as qn,c0 as In,c6 as cl,bo as xa,br as Xr,ca as Jt,bf as nr,a7 as Et,am as Mn,ax as Pn,bk as za,ai as sa,aj as jr,aw as Wa,bz as Vo,cb as Xa,c5 as Sa,aC as vr,cd as Ys,bv as ul}from"./B8o4lNgr.js";import{k as Ne,s as ne,a as un,j as Ja,l as oa,h as Dr,d as ft,f as Vt,i as Fn,I as fl,c as ia,p as gl,o as ml,C as pl}from"./Crs9I2MT.js";import{H as Kt,j as vl,s as Ko,p as $s,y as hl,u as _l,t as Mr,g as Kn,c as ra,E as Is,A as ss,D as Ha,S as yl}from"./Bqoyy9yx.js";import{b as fn}from"./D2g8BuR1.js";import{bH as Go,j as Ra,a2 as Ss,ah as Ua,E as bl,ap as Na,aG as wl,aJ as eo}from"./
|
|
1
|
+
var il=Object.defineProperty;var ll=(r,t,n)=>t in r?il(r,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[t]=n;var _n=(r,t,n)=>ll(r,typeof t!="symbol"?t+"":t,n);import{t as vt,bq as m,bo as g,a_ as W,by as ht,b as _t,bs as Un,bu as or,bt as dl,br as aa}from"./COCO5InB.js";import{bs as yt,a5 as D,bA as E,bS as R,bl as ie,ay as xe,aD as e,b_ as B,bO as J,W as f,c9 as s,bn as bt,bV as me,bH as z,aA as p,be as br,b$ as Vr,aB as T,bj as qn,c0 as In,c6 as cl,bo as xa,br as Xr,ca as Jt,bf as nr,a7 as Et,am as Mn,ax as Pn,bk as za,ai as sa,aj as jr,aw as Wa,bz as Vo,cb as Xa,c5 as Sa,aC as vr,cd as Ys,bv as ul}from"./B8o4lNgr.js";import{k as Ne,s as ne,a as un,j as Ja,l as oa,h as Dr,d as ft,f as Vt,i as Fn,I as fl,c as ia,p as gl,o as ml,C as pl}from"./Crs9I2MT.js";import{H as Kt,j as vl,s as Ko,p as $s,y as hl,u as _l,t as Mr,g as Kn,c as ra,E as Is,A as ss,D as Ha,S as yl}from"./Bqoyy9yx.js";import{b as fn}from"./D2g8BuR1.js";import{bH as Go,j as Ra,a2 as Ss,ah as Ua,E as bl,ap as Na,aG as wl,aJ as eo}from"./D6eVIgjz.js";import{t as Gn,q as xl,P as kl}from"./1jz3AJ7K.js";import{F as Ht,cz as Ds,ar as Qo,aU as Zo,aG as Il,c0 as Sl,a3 as Al,a4 as ja,aJ as Tl,cB as Cl,cA as Ml,a2 as Ya,at as Bs,ag as Pl,bn as Rl,aO as Nl,aS as El,bC as Ll,al as Ol,cr as ql,az as to,bb as kn,aL as ro,bU as os,aE as Aa,cK as $l,c2 as Dl,bi as Bl,b as Fl,cf as zl,ad as Wl,b5 as is,ch as la,cu as Hl,cU as Fs,X as Xo,a as Ul}from"./BDq7EC2K.js";import{c0 as Ea,aA as ba,cL as Jo,cN as $n,bR as es,i as jl,cF as Yo,cK as ts,cJ as ei,cH as ti,f as Tn,a9 as Vl,aa as Kl,av as Gl,r as Ql,J as Zl,V as no,u as ri,dG as Xl,as as Jl,j as Yl,t as ls,m as ed,N as td,n as rd,p as ni,q as ai,a5 as nd,R as ad,Q as sd,$ as od,k as id,cO as ld,a3 as dd,C as cd,w as ud,U as ao}from"./DUT4V6mb.js";import{G2 as lt,nv as fd,rA as La,mm as so,tf as si,th as oi,q1 as gd,vW as Va,L as md,sA as ii,mh as li,b9 as Oa,vX as pd,oU as vd,re as hd,t8 as di,mf as _d,lp as yd,g as bd,wn as wd,wk as xd,wm as kd}from"./BjFoJgFv.js";import{f as pt,am as zs,bs as Id,bw as ds,bK as Sd}from"./C5Xi5eLp.js";import{a4 as Ad,x as cs,a1 as Td,O as us,V as Cd,$ as Md,j as Pd,o as da,M as ea,p as Rd,F as Nd,u as Ed,s as Ld,L as fs,J as Od,y as qd,K as $d,_ as ma,Q as Ta,N as oo,m as io,E as Dd,c as gs,B as lo,z as Bd,v as co,H as pa,P as Fd,G as zd,i as Wd,R as Hd,T as Ud,A as jd,g as Vd,b as Kd,D as Gd,f as Qd,e as Zd,a as Xd,C as Jd,h as Yd,U as ci,a5 as ec,t as tc,k as rc,d as uo}from"./hTe-_Fjh.js";import{h as nc}from"./CaQ_vubD.js";import{b as ms}from"./C563feV7.js";import{M as ca,C as Ca}from"./CcDZ8sih.js";import{C as fo}from"./Bxc57npw.js";import"./3sa2ZSPC.js";import{P as ac}from"./BdMP-rwq.js";import"./DROi8p_h.js";import{c as ui}from"./ChTqQfQN.js";import{s as Rn}from"./Dck4Okga.js";import{S as sc}from"./DAPK9slU.js";import{D as go,M as oc}from"./BHwB2t2J.js";import{b as ic,s as Hn,c as Ka}from"./Cv6pFp-w.js";import{O as qa,y as ps,E as vs,B as hs,N as lc,m as dc,l as cc,d as Ga,C as mo,f as uc,e as fc,g as gc}from"./PSWhBTN5.js";import{j as fi,g as mc,s as po}from"./CjVTzfqV.js";import{f as pc}from"./BJzHxIyr.js";import{c as an}from"./Ck11Hn8r.js";import{A as vc,z as hc,c as _c}from"./bjkNeafo.js";import{o as _s,n as ys,t as vo,h as yc}from"./CbQJkQ1_.js";import"./BqRJyrRC.js";import{ay as On,t as bc}from"./BUVaYTVI.js";import"./B7mAnbbv.js";import{R as As,C as rs,n as wc,e as xc,d as kc,f as ho,P as Ic}from"./CJvhopKt.js";import"./BlJs0v1V.js";import{aU as Ir,A as $a,af as gi,n as mi,e as Sc,I as Ac,R as Tc,an as Cc,b as Mc,X as Pc}from"./BCYRUItZ.js";import{a0 as _o,N as ha,s as pi,k as Rc}from"./172GvQgx.js";import{B as Nc}from"./Du9ULB4g.js";import{r as Ec,e as Lc,o as Oc}from"./CdEtW7wp.js";import{o as vi}from"./C5E1PJb6.js";import{g as Ws}from"./-fWJi05-.js";import{a as qc,M as $c}from"./BY3Ptqbg.js";import{c as ua}from"./oALOmsvi.js";import{A as Dc}from"./CM-RTisq.js";import{f as Bc,d as Fc}from"./BKAT2tIv.js";import{E as zc,t as Wc,z as Hc,r as yo,y as Uc,n as jc}from"./DNOilvOO.js";import{b as Vc}from"./BONnxsQv.js";import{B as Kc}from"./Cdhgfy6h.js";import{S as Gc}from"./ulh-TYZ7.js";import{u as Qc,a as Zc,c as bo,S as Xc}from"./D2AmAQEr.js";import{T as Ts}from"./_cwefpRI.js";import{a as Jc}from"./3QmaYnff.js";import{b as wo}from"./C3hWtekV.js";import{a4 as Yc}from"./D62E6eA-.js";import{c as eu}from"./CN6UuCI4.js";function tu(r,t,n,a=!1){if(!r||!t)return{edit:!1,remove:!1,sendNow:!1};const i=r.messageMetadata?.fromPrincipalId??r.author?.principalId,o=zc(r)&&r.author?.principalId!==null&&i===t;return{edit:o,remove:o||t===n||a,sendNow:(o||a)&&!hi(r)}}function fa(r,t){if(t)return r.find(n=>n.editing&&n.editingMessageId?n.editingMessageId===t:n.id===t)}function hi(r){return r.messageMetadata?.type==="script_monitor_wake"&&typeof r.messageMetadata.monitorId=="string"}function xo(r,t=Date.now()){const n=r.messageMetadata,a=n?.fromPrincipalId,i=n&&Object.hasOwn(n,"humanAuthor")&&!(typeof a=="string"&&a.length>0),o=r.holdKind!==void 0&&Date.parse(r.holdUntil??"")>t;return!r.editing&&!o&&!i&&!hi(r)}const kh="pl-3.5! pr-2!";var ru=T("<!> ",1),nu=T('<div class="flex flex-col gap-2 px-4 py-3 bg-muted/30 border border-border rounded-lg my-4"><div class="flex items-center justify-between gap-2"><div class="flex items-center gap-2"><div class="shrink-0 text-subtle"><!></div> <div class="font-medium text-sm"> </div></div> <div class="flex items-center gap-1"><!> <!></div></div> <div class="text-xs text-subtle"> </div> <pre class="text-xs bg-background/50 rounded p-2 overflow-x-auto max-h-40 overflow-y-auto font-mono"> </pre></div>');function _i(r,t){if(new.target)return vt({component:_i,...r});yt(t,!0);let n=m(t,"name",7),a=m(t,"description",7),i=m(t,"content",7),o=m(t,"onUseScript",7),d=me(!1);function c(){navigator.clipboard.writeText(i()),z(d,!0),setTimeout(()=>{z(d,!1)},2e3)}function y(){o()?.({name:n(),description:a(),content:i()})}var _={get name(){return n()},set name(U){n(U),p()},get description(){return a()},set description(U){a(U),p()},get content(){return i()},set content(U){i(U),p()},get onUseScript(){return o()},set onUseScript(U){o(U),p()},$set:ht,$on:(U,oe)=>_t(t,U,oe)},b=nu(),S=D(b),w=D(S),G=D(w),x=D(G);Ht(x,{get icon(){return Ds},size:"sm"}),E(G);var L=R(G,2),K=ie(L,!0);E(w);var Q=R(w,2),N=D(Q);pt(N,{variant:"ghost-light",size:"sm",onclick:c,class:"h-7 px-2",children:(U,oe)=>{var fe=ru(),Ie=xe(fe);{let Ee=s(()=>e(d)?Qo:Zo);Ht(Ie,{get icon(){return e(Ee)},class:"mr-1"})}var pe=R(Ie);B(Ee=>J(pe,` ${Ee??""}`),[()=>e(d)?g.chat_shared_copied_label():g.chat_shared_copy_label()]),f(U,fe)},$$slots:{default:!0}});var P=R(N,2);{var k=U=>{pt(U,{variant:"ghost-light",size:"sm",onclick:y,class:"h-7 px-2",children:(oe,fe)=>{br();var Ie=Vr();B(pe=>J(Ie,pe),[()=>g.chat_setupScriptCard_useScript_label()]),f(oe,Ie)},$$slots:{default:!0}})};W(P,U=>{o()&&U(k)})}E(Q),E(S);var Y=R(S,2),A=ie(Y,!0),C=R(Y,2),Me=ie(C,!0);return E(b),B(()=>{J(K,n()),J(A,a()),J(Me,i())}),f(r,b),bt(_)}const pr={toolStart:/(?:\x1B\[\d+m)?🔧\s+(?:Tool call:\s+)?(.+?)(?:\x1B\[0m)?$/,toolDetail:/(?:[└├]─\s+(.+)$|^\s{3,}(.+)$)/,toolResult:/(?:\x1B\[\d+m)?📋\s+Tool result:\s+(.+?)(?:\x1B\[0m)?$/,toolSuccess:/[✓✔✅]\s+(.+)$/,toolError:/[❌✗❎]\s+(.+)$/,sessionInfo:/[Ss]ession:\s*([a-f0-9-]+)/,resumedSession:/📂?\s*Resumed session/i,assistantMarker:/🤖/,systemMarker:/💻/,userMarker:/👤/,thinkingMarker:/🤔\s*Thinking/i,waitingMarker:/^⏳\s+Running/i,indexingProgress:/^Indexing:\s*\[.*\]\s*\d+%/,agentDigest:/<agent_digest>([\s\S]*?)<\/agent_digest>/,setupScript:/<setup_script\s+name="([^"]+)"\s+description="([^"]+)">([\s\S]*?)<\/setup_script>/};class au{constructor(){_n(this,"buffer","");_n(this,"currentToolName",null);_n(this,"currentToolId",null);_n(this,"lastToolId",null);_n(this,"currentToolParams",[]);_n(this,"currentToolResultContent",[]);_n(this,"inToolResult",!1);_n(this,"inCodeBlock",!1);_n(this,"codeBlockLanguage","");_n(this,"codeBlockContent","");_n(this,"characterBuffer","");_n(this,"inCharacterMode",!1);_n(this,"emittedToolIds",new Set)}parseChunk(t){if(this.isMarkerLine(t.trim())){const i=[];if(this.inToolResult&&this.currentToolResultContent.length>0){const c=this.currentToolResultContent.some(_=>_.startsWith("❌")||_.startsWith("Error:")),y=this.currentToolResultContent.map(_=>_.replace(/^❌\s*/,"").replace(/^Error:\s*/,"")).join(`
|
|
2
2
|
`);i.push({type:"tool_result",content:y,metadata:{toolId:this.currentToolId,isError:c}}),this.lastToolId=this.currentToolId,this.currentToolId=null,this.inToolResult=!1,this.currentToolResultContent=[]}const o=t.indexOf("🤖"),d=t.substring(o+2);if(this.inCharacterMode=!0,this.characterBuffer="",d&&d.trim()&&d!==`
|
|
3
3
|
`){const c=d.replace(/^\n/,"");c&&(this.characterBuffer=c)}return i}if(this.inCharacterMode){if(t.trim()===""&&this.characterBuffer==="")return[];if(t.includes(`
|
|
4
4
|
`)&&this.characterBuffer.length>0){const i=t.substring(0,t.indexOf(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as Mt,bq as ee,_ as Vr,a_ as ce,by as Tt,bu as he,bs as Jt,b as Ut,bo as c}from"./COCO5InB.js";import{bs as Rt,ca as $e,aD as e,bH as u,a5 as M,bA as P,W as s,bn as zt,bV as H,c9 as i,aA as te,c6 as Nt,ay as de,be as Xe,b$ as Qe,b_ as D,bO as g,bS as p,bl as S,aB as C,bj as Er,aw as et,ai as Ar,c5 as vr,a as pr,a7 as Le,aj as ct,cd as Wr,br as Br}from"./B8o4lNgr.js";import{B as gr,D as Nr}from"./Cdhgfy6h.js";import{s as tt,l as bt,k as ar,h as xt}from"./Crs9I2MT.js";import{c as Ft}from"./oALOmsvi.js";import{b as mr}from"./D2g8BuR1.js";import{G2 as A,mu as _r,tC as hr,tB as wr,I8 as Or,I9 as Hr,ei as qr,ej as Gr,HC as or,kJ as Ot,zu as ir,qC as nr,mQ as Kr,xc as Xr,a3 as sr,Gy as Yr,GN as Jr,m5 as Zr,i0 as Qr,mw as ea,td as ta,xz as ra,HB as aa}from"./BjFoJgFv.js";import{g as oa}from"./CoSk1zgY.js";import{a as ia,g as na,i as sa,c as la,h as da,d as ca,e as lr,f as ua,b as Ht}from"./DROi8p_h.js";import{bx as fa,bK as va,dj as pa}from"./DUT4V6mb.js";import{w as dr,d as ga}from"./BCu94obu.js";import{f as ma}from"./B6LKhrY2.js";import{n as qt}from"./CJvhopKt.js";import{f as Se,ax as _a}from"./C5Xi5eLp.js";import"./Dck4Okga.js";import{F as Ze,a9 as ha,ar as wa,aU as ba,a_ as Dt,cj as xa,ck as ya,bh as Pa,cG as $a,c0 as ka}from"./BDq7EC2K.js";import{g as Ia,i as Ca,w as cr}from"./bjkNeafo.js";import{c as Fa}from"./ChTqQfQN.js";import"./BlJs0v1V.js";import{M as Sa}from"./56xQ7UwB.js";import{i as Gt,b as Da,a as ja}from"./H2jLkRRS.js";import{C as Xt,p as Ma}from"./DjZWf4AT.js";import{M as Ta}from"./D_cySYsU.js";import{t as Kt,u as br}from"./Bqoyy9yx.js";import"./hMX_6Iel.js";import"./1jz3AJ7K.js";import{M as St}from"./CpWqDujk.js";import{V as Ua}from"./DQPsLJmj.js";import{bC as Ra,aW as za}from"./CcUy0MZb.js";import{ag as La}from"./D-pCMoMn.js";const xr=A.createSelector((we,x)=>_r(we.pdfPreview.previews,x));var Va=C('<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),Ea=C('<div class="flex h-full min-h-0 flex-col" data-testid="pdf-viewer"><!></div>');function Yt(we,x){if(new.target)return Mt({component:Yt,...we});Rt(x,!0);const ke=()=>he(be,"$preview",rt),[rt,re]=Jt();let $=ee(x,"workspaceId",7),ae=ee(x,"filePath",7),Ie=ee(x,"gitRootId",7);const De=crypto.randomUUID(),be=xr(De),me=new WeakMap;let J=H(null),He=H(void 0),W=H(1),N=H(1),oe=H(!0),R=H(!1),Ve=H(null),Be=H(0);const xe=i(()=>ke()?.error??e(Ve)),je=i(()=>e(xe)==="missing"?c.file_pdf_missing_error():e(xe)==="large"?c.file_pdf_large_error():e(xe)==="invalid"?c.file_pdf_invalid_error():e(xe)==="password"?c.file_pdf_password_error():c.file_pdf_load_error());$e(()=>{const l=$(),y=ae();e(Be);const z=crypto.randomUUID();return A.dispatch(hr(De,z,l,y,...Ie()?[{gitRootId:Ie()}]:[])),()=>{A.dispatch(wr(De,z))}}),$e(()=>{const l=ke()?.url;let y=!1,z;if(u(J,null),u(Ve,null),u(oe,!0),u(W,1),u(N,1),!!l)return(async()=>{try{const{loadPdfDocument:K}=await Vr(async()=>{const{loadPdfDocument:_e}=await import("./BqoyBPEG.js");return{loadPdfDocument:_e}},[],import.meta.url);if(y)return;z=K(l);const ie=await z.promise;y||u(J,ie)}catch(K){if(y)return;u(Ve,K instanceof Error&&K.name==="PasswordException"?"password":K instanceof Error&&K.name==="InvalidPDFException"?"invalid":"load",!0)}finally{y||u(oe,!1)}})(),()=>{y=!0,z?.destroy()}}),$e(()=>{const l=e(J),y=e(He),z=e(W),K=e(N);if(!l||!y)return;let ie=!1,_e,U;const ne=()=>{if(!U)return;const X=(me.get(U)??1)-1;X?me.set(U,X):(me.delete(U),U.cleanup()),U=void 0};return u(R,!0),(async()=>{try{if(U=await l.getPage(z),me.set(U,(me.get(U)??0)+1),ie){ne();return}const X=U.getViewport({scale:K}),Z=Math.min(window.devicePixelRatio||1,2,Math.sqrt(16e6/(X.width*X.height)));y.width=Math.ceil(X.width*Z),y.height=Math.ceil(X.height*Z),y.style.width=`${X.width}px`,y.style.height=`${X.height}px`,_e=U.render({canvas:y,viewport:X,transform:[Z,0,0,Z,0,0]}),await _e.promise}catch{ie||u(Ve,"invalid")}finally{ie||u(R,!1)}})(),()=>{ie=!0,_e?.cancel(),_e?_e.promise.then(ne,ne):ne()}});var Ne={get workspaceId(){return $()},set workspaceId(l){$(l),te()},get filePath(){return ae()},set filePath(l){ae(l),te()},get gitRootId(){return Ie()},set gitRootId(l){Ie(l),te()},$set:Tt,$on:(l,y)=>Ut(x,l,y)},o=Ea(),d=M(o);{var T=l=>{{const y=K=>{Xe();var ie=Qe();D(()=>g(ie,e(je))),s(K,ie)};let z=i(()=>c.ui_combobox_retry_label());Ia(l,{onRetry:()=>Nt(Be),get retryLabel(){return e(z)},class:"m-auto",message:y,$$slots:{message:!0}})}},_=l=>{{let y=i(()=>c.file_pdf_loading_label());Ca(l,{get label(){return e(y)},count:1,class:"p-4"})}},w=l=>{var y=Va(),z=de(y),K=M(z);{let pe=i(()=>e(W)<=1);Se(K,{variant:"ghost",size:"compact",get disabled(){return e(pe)},onclick:()=>Nt(W,-1),children:(ye,Ge)=>{Xe();var Pe=Qe();D(ue=>g(Pe,ue),[()=>c.file_pdf_previous_label()]),s(ye,Pe)},$$slots:{default:!0}})}var ie=p(K,2),_e=S(ie,!0),U=p(ie,2);{let pe=i(()=>e(W)>=e(J).numPages);Se(U,{variant:"ghost",size:"compact",get disabled(){return e(pe)},onclick:()=>Nt(W),children:(ye,Ge)=>{Xe();var Pe=Qe();D(ue=>g(Pe,ue),[()=>c.file_pdf_next_label()]),s(ye,Pe)},$$slots:{default:!0}})}var ne=p(U,2);{let pe=i(()=>e(N)<=.25);Se(ne,{variant:"ghost",size:"compact",get disabled(){return e(pe)},onclick:()=>u(N,Math.max(.25,e(N)-.25),!0),children:(ye,Ge)=>{Xe();var Pe=Qe();D(ue=>g(Pe,ue),[()=>c.editor_fileViewer_zoomOut_tooltip()]),s(ye,Pe)},$$slots:{default:!0}})}var X=p(ne,2),Z=S(X,!0),at=p(X,2);{let pe=i(()=>e(N)>=3);Se(at,{variant:"ghost",size:"compact",get disabled(){return e(pe)},onclick:()=>u(N,Math.min(3,e(N)+.25),!0),children:(ye,Ge)=>{Xe();var Pe=Qe();D(ue=>g(Pe,ue),[()=>c.editor_fileViewer_zoomIn_tooltip()]),s(ye,Pe)},$$slots:{default:!0}})}P(z);var ot=p(z,2),qe=M(ot);let Ye;mr(qe,pe=>u(He,pe),()=>e(He)),P(ot),D((pe,ye,Ge)=>{g(_e,pe),g(Z,ye),tt(ot,"aria-busy",e(R)),tt(qe,"aria-label",Ge),Ye=bt(qe,"",Ye,{visibility:e(R)?"hidden":"visible"})},[()=>c.file_pdf_page_label({page:Kt(e(W)),total:Kt(e(J).numPages)}),()=>br(e(N),{style:"percent"}),()=>c.file_pdf_canvas_ariaLabel({name:ae(),page:Kt(e(W))})]),s(l,y)};ce(d,l=>{e(xe)?l(T):e(oe)||ke()?.status==="loading"?l(_,1):e(J)&&l(w,2)})}P(o),s(we,o);var Ee=zt(Ne);return re(),Ee}const Aa=A.createSelector((we,x)=>_r(we.videoPreview.previews,x));var Wa=C('<p role="status"> </p>'),Ba=C('<p role="alert"> </p>'),Na=C('<div class="flex flex-col items-center gap-3 p-6 text-center text-sm text-subtle"><p class="break-all"> </p> <!> <!></div>'),Oa=C('<video controls="" preload="metadata" playsinline="" class="max-w-full max-h-full" data-testid="file-video"> </video>',2),Ha=C('<div class="min-h-0 flex-1 flex items-center justify-center bg-background"><!></div>');function yr(we,x){if(new.target)return Mt({component:yr,...we});Rt(x,!0);const ke=()=>he(He,"$preview",rt),[rt,re]=Jt();let $=ee(x,"sourceUrl",7),ae=ee(x,"fileName",7),Ie=ee(x,"allowDownload",7),De=ee(x,"downloading",7),be=ee(x,"onDownload",7),me=H(null);const J=crypto.randomUUID(),He=Aa(J),W=i(()=>ke()?.status==="loading"),N=i(()=>e(me)??ke()?.error);let oe=!1,R=!1;Er(()=>{R=!0,A.dispatch(Or(J))});function Ve(){if(R||e(W))return;const _=$().startsWith("workspace-file://")?new URL($()):null;if(oe||!_||!_.pathname.toLowerCase().endsWith(".mp4")){u(me,"unsupported");return}oe=!0,_.searchParams.set("preview","h264"),A.dispatch(Hr(J,_.hostname,_.toString()))}function Be(_){if(R)return;const w=_.currentTarget.error?.code;w===2?u(me,"network"):w!==1&&Ve()}var xe={get sourceUrl(){return $()},set sourceUrl(_){$(_),te()},get fileName(){return ae()},set fileName(_){ae(_),te()},get allowDownload(){return Ie()},set allowDownload(_){Ie(_),te()},get downloading(){return De()},set downloading(_){De(_),te()},get onDownload(){return be()},set onDownload(_){be(_),te()},$set:Tt,$on:(_,w)=>Ut(x,_,w)},je=Ha(),Ne=M(je);{var o=_=>{var w=Na(),Ee=M(w),l=S(Ee,!0),y=p(Ee,2);{var z=U=>{var ne=Wa(),X=S(ne,!0);D(Z=>g(X,Z),[()=>c.editor_fileViewer_videoPreparing_label()]),s(U,ne)},K=U=>{var ne=Ba(),X=S(ne,!0);D(Z=>g(X,Z),[()=>e(N)==="network"?c.editor_fileViewer_videoLoad_error():c.editor_fileViewer_videoUnsupported_label()]),s(U,ne)};ce(y,U=>{e(W)?U(z):U(K,-1)})}var ie=p(y,2);{var _e=U=>{Se(U,{variant:"secondary",size:"sm",get onclick(){return be()},get disabled(){return De()},children:(ne,X)=>{Xe();var Z=Qe();D(at=>g(Z,at),[()=>c.layout_fileTab_downloadFile_label()]),s(ne,Z)},$$slots:{default:!0}})};ce(ie,U=>{Ie()&&U(_e)})}P(w),D(()=>g(l,ae())),s(_,w)},d=_=>{var w=Oa(),Ee=S(w,!0);D(l=>{tt(w,"src",ke()?.url??$()),g(Ee,l)},[()=>c.editor_fileViewer_videoUnsupported_label()]),et("error",w,Be),et("loadedmetadata",w,l=>{l.currentTarget.videoWidth===0&&Ve()}),s(_,w)};ce(Ne,_=>{e(N)||e(W)?_(o):_(d,-1)})}P(je),s(we,je);var T=zt(xe);return re(),T}var qa=C('<!> <span class="text-xs text-subtle min-w-[50px] text-center"> </span> <!> <div class="w-px h-5 bg-border mx-1"></div>',1),Ga=C('<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>'),Ka=C('<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>'),Xa=C('<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>'),Ya=C("<!> ",1),Ja=C('<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>'),Za=C('<th class="border border-border px-2 py-1 text-left text-xs font-medium bg-muted"> </th>'),Qa=C('<td class="border border-border px-2 py-1 text-xs"> </td>'),eo=C("<tr></tr>"),to=C('<div class="flex-1 overflow-auto p-4"><table class="w-full border-collapse"><thead><tr></tr></thead><tbody></tbody></table></div>'),ro=C('<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>'),ao=C('<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>'),oo=C('<div class="h-full flex flex-col"><!></div>');function jt(we,x){if(new.target)return Mt({component:jt,...we});Rt(x,!0);const ke=t=>{var a=qa(),f=de(a);{let O=i(()=>c.editor_fileViewer_zoomOut_tooltip());Se(f,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ne,get title(){return e(O)},children:(j,L)=>{Ze(j,{get icon(){return xa},size:"sm"})},$$slots:{default:!0}})}var m=p(f,2),h=S(m,!0),k=p(m,2);{let O=i(()=>c.editor_fileViewer_zoomIn_tooltip());Se(k,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:U,get title(){return e(O)},children:(j,L)=>{Ze(j,{get icon(){return ya},size:"sm"})},$$slots:{default:!0}})}Xe(2),D(()=>g(h,e(Ve))),s(t,a)},rt=Fa("FileViewer");let re=ee(x,"filePath",7),$=ee(x,"fileContent",7,""),ae=ee(x,"sourceUrl",7),Ie=ee(x,"language",7),De=ee(x,"isBinary",7),be=ee(x,"allowDownload",7,!0),me=ee(x,"onDownload",7),J=ee(x,"downloading",7,!1);const He=t=>{const a=t.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","webp","bmp","ico","avif"].includes(a)?"image":a==="svg"?"svg":["mp4","webm","ogg","mov","avi"].includes(a)?"video":["mp3","wav","ogg","m4a","flac"].includes(a)?"audio":a==="pdf"?"pdf":["md","markdown"].includes(a)?"markdown":a==="json"?"json":a==="csv"?"csv":["yaml","yml"].includes(a)?"yaml":a==="xml"?"xml":["zip","tar","gz","rar","7z","bz2"].includes(a)?"archive":["exe","dll","so","dylib","wasm"].includes(a)?"binary":"text"},W=i(()=>He(re())),N=i(()=>re().split("/").pop()||c.editor_fileViewer_unknown_fallback());let oe=H(100),R=H(0);const Ve=i(()=>br(e(oe)/100,{style:"percent",maximumFractionDigits:0}));let Be=H(!1),xe=H(0),je=H(0),Ne=H(0),o=H(0),d=H(!1),T=null;function _(){const t=T;T=null,u(d,!1),t?.viewport.hasPointerCapture(t.pointerId)&&t.viewport.releasePointerCapture(t.pointerId)}function w(t){if(t.button!==0||!t.isPrimary||T)return;const a=t.currentTarget;a.setPointerCapture(t.pointerId),T={pointerId:t.pointerId,x:t.clientX,y:t.clientY,viewport:a},u(d,!0),t.preventDefault()}function Ee(t){if(!(!T||t.pointerId!==T.pointerId)){if((t.buttons&1)===0){_();return}u(Ne,T.viewport.scrollLeft,!0),u(o,T.viewport.scrollTop,!0),u(xe,e(xe)+(t.clientX-T.x)),u(je,e(je)+(t.clientY-T.y)),T.x=t.clientX,T.y=t.clientY}}function l(t){t.pointerId===T?.pointerId&&_()}$e(()=>{re(),ae(),e(oe),e(R),u(Ne,0),u(o,0)}),$e(()=>(re(),ae(),vr(()=>{_(),u(xe,0),u(je,0)}),_));const y=t=>{const a=t.split(".").pop()?.toLowerCase();return a==="jpg"||a==="jpeg"?"image/jpeg":a==="png"?"image/png":a==="gif"?"image/gif":a==="webp"?"image/webp":"application/octet-stream"},z=t=>{const a=t.split(".").pop()?.toLowerCase();if(a==="mp4")return"video/mp4";if(a==="webm")return"video/webm"},K=()=>{if(ae())return ae();if(typeof $()=="string")return $().startsWith("data:")||$().startsWith("http")?$():De()?`data:${y(re())};base64,${$()}`:`data:${y(re())};base64,${$()}`;if($()instanceof ArrayBuffer){const a=new Uint8Array($()).reduce((m,h)=>m+String.fromCharCode(h),""),f=btoa(a);return`data:${y(re())};base64,${f}`}return""},ie=()=>{if(ae())return ae();const t=z(re());if(!t)return"";if(typeof $()=="string")return $().startsWith("data:")||$().startsWith("http")?$():`data:${t};base64,${$()}`;const a=new Uint8Array($()),f=[],m=32768;for(let h=0;h<a.length;h+=m)f.push(String.fromCharCode(...a.subarray(h,h+m)));return`data:${t};base64,${btoa(f.join(""))}`},_e=()=>{const t=typeof $()=="string"?new TextEncoder().encode($()):new Uint8Array($()),a=[],f=32768;for(let m=0;m<t.length;m+=f)a.push(String.fromCharCode(...t.subarray(m,m+f)));return`data:image/svg+xml;base64,${btoa(a.join(""))}`},U=()=>{u(oe,Math.min(e(oe)+25,500),!0)},ne=()=>{u(oe,Math.max(e(oe)-25,25),!0)},X=()=>{u(R,(e(R)+90)%360)},Z=()=>{if(!be()||J())return;if(me()){me()();return}const t=document.createElement("a");t.href=e(W)==="video"?ie():e(W)==="svg"?_e():K(),t.download=e(N),t.click()},at=async()=>{try{const t=K(),a=new Image;a.crossOrigin="anonymous";const f=await new Promise((m,h)=>{a.onload=()=>{const k=document.createElement("canvas");k.width=a.naturalWidth,k.height=a.naturalHeight;const O=k.getContext("2d");if(!O){h(new Error("Failed to get canvas context"));return}O.drawImage(a,0,0),k.toBlob(j=>{j?m(j):h(new Error("Failed to create blob from canvas"))},"image/png",1)},a.onerror=()=>h(new Error("Failed to load image")),a.src=t});await navigator.clipboard.write([new ClipboardItem({"image/png":f})]),u(Be,!0),setTimeout(()=>u(Be,!1),2e3)}catch(t){rt.error("Failed to copy image:",t)}},ot=t=>{try{const a=JSON.parse(t);return JSON.stringify(a,null,2)}catch{return t}},qe=t=>t.split(`
|
|
1
|
+
import{t as Mt,bq as ee,_ as Vr,a_ as ce,by as Tt,bu as he,bs as Jt,b as Ut,bo as c}from"./COCO5InB.js";import{bs as Rt,ca as $e,aD as e,bH as u,a5 as M,bA as P,W as s,bn as zt,bV as H,c9 as i,aA as te,c6 as Nt,ay as de,be as Xe,b$ as Qe,b_ as D,bO as g,bS as p,bl as S,aB as C,bj as Er,aw as et,ai as Ar,c5 as vr,a as pr,a7 as Le,aj as ct,cd as Wr,br as Br}from"./B8o4lNgr.js";import{B as gr,D as Nr}from"./Cdhgfy6h.js";import{s as tt,l as bt,k as ar,h as xt}from"./Crs9I2MT.js";import{c as Ft}from"./oALOmsvi.js";import{b as mr}from"./D2g8BuR1.js";import{G2 as A,mu as _r,tC as hr,tB as wr,I8 as Or,I9 as Hr,ei as qr,ej as Gr,HC as or,kJ as Ot,zu as ir,qC as nr,mQ as Kr,xc as Xr,a3 as sr,Gy as Yr,GN as Jr,m5 as Zr,i0 as Qr,mw as ea,td as ta,xz as ra,HB as aa}from"./BjFoJgFv.js";import{g as oa}from"./CoSk1zgY.js";import{a as ia,g as na,i as sa,c as la,h as da,d as ca,e as lr,f as ua,b as Ht}from"./DROi8p_h.js";import{bx as fa,bK as va,dj as pa}from"./DUT4V6mb.js";import{w as dr,d as ga}from"./BCu94obu.js";import{f as ma}from"./B6LKhrY2.js";import{n as qt}from"./CJvhopKt.js";import{f as Se,ax as _a}from"./C5Xi5eLp.js";import"./Dck4Okga.js";import{F as Ze,a9 as ha,ar as wa,aU as ba,a_ as Dt,cj as xa,ck as ya,bh as Pa,cG as $a,c0 as ka}from"./BDq7EC2K.js";import{g as Ia,i as Ca,w as cr}from"./bjkNeafo.js";import{c as Fa}from"./ChTqQfQN.js";import"./BlJs0v1V.js";import{M as Sa}from"./B5NXv3LV.js";import{i as Gt,b as Da,a as ja}from"./H2jLkRRS.js";import{C as Xt,p as Ma}from"./DjZWf4AT.js";import{M as Ta}from"./CcDZ8sih.js";import{t as Kt,u as br}from"./Bqoyy9yx.js";import"./hMX_6Iel.js";import"./1jz3AJ7K.js";import{M as St}from"./CpWqDujk.js";import{V as Ua}from"./DQPsLJmj.js";import{bC as Ra,aW as za}from"./D6eVIgjz.js";import{ag as La}from"./BCYRUItZ.js";const xr=A.createSelector((we,x)=>_r(we.pdfPreview.previews,x));var Va=C('<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),Ea=C('<div class="flex h-full min-h-0 flex-col" data-testid="pdf-viewer"><!></div>');function Yt(we,x){if(new.target)return Mt({component:Yt,...we});Rt(x,!0);const ke=()=>he(be,"$preview",rt),[rt,re]=Jt();let $=ee(x,"workspaceId",7),ae=ee(x,"filePath",7),Ie=ee(x,"gitRootId",7);const De=crypto.randomUUID(),be=xr(De),me=new WeakMap;let J=H(null),He=H(void 0),W=H(1),N=H(1),oe=H(!0),R=H(!1),Ve=H(null),Be=H(0);const xe=i(()=>ke()?.error??e(Ve)),je=i(()=>e(xe)==="missing"?c.file_pdf_missing_error():e(xe)==="large"?c.file_pdf_large_error():e(xe)==="invalid"?c.file_pdf_invalid_error():e(xe)==="password"?c.file_pdf_password_error():c.file_pdf_load_error());$e(()=>{const l=$(),y=ae();e(Be);const z=crypto.randomUUID();return A.dispatch(hr(De,z,l,y,...Ie()?[{gitRootId:Ie()}]:[])),()=>{A.dispatch(wr(De,z))}}),$e(()=>{const l=ke()?.url;let y=!1,z;if(u(J,null),u(Ve,null),u(oe,!0),u(W,1),u(N,1),!!l)return(async()=>{try{const{loadPdfDocument:K}=await Vr(async()=>{const{loadPdfDocument:_e}=await import("./BqoyBPEG.js");return{loadPdfDocument:_e}},[],import.meta.url);if(y)return;z=K(l);const ie=await z.promise;y||u(J,ie)}catch(K){if(y)return;u(Ve,K instanceof Error&&K.name==="PasswordException"?"password":K instanceof Error&&K.name==="InvalidPDFException"?"invalid":"load",!0)}finally{y||u(oe,!1)}})(),()=>{y=!0,z?.destroy()}}),$e(()=>{const l=e(J),y=e(He),z=e(W),K=e(N);if(!l||!y)return;let ie=!1,_e,U;const ne=()=>{if(!U)return;const X=(me.get(U)??1)-1;X?me.set(U,X):(me.delete(U),U.cleanup()),U=void 0};return u(R,!0),(async()=>{try{if(U=await l.getPage(z),me.set(U,(me.get(U)??0)+1),ie){ne();return}const X=U.getViewport({scale:K}),Z=Math.min(window.devicePixelRatio||1,2,Math.sqrt(16e6/(X.width*X.height)));y.width=Math.ceil(X.width*Z),y.height=Math.ceil(X.height*Z),y.style.width=`${X.width}px`,y.style.height=`${X.height}px`,_e=U.render({canvas:y,viewport:X,transform:[Z,0,0,Z,0,0]}),await _e.promise}catch{ie||u(Ve,"invalid")}finally{ie||u(R,!1)}})(),()=>{ie=!0,_e?.cancel(),_e?_e.promise.then(ne,ne):ne()}});var Ne={get workspaceId(){return $()},set workspaceId(l){$(l),te()},get filePath(){return ae()},set filePath(l){ae(l),te()},get gitRootId(){return Ie()},set gitRootId(l){Ie(l),te()},$set:Tt,$on:(l,y)=>Ut(x,l,y)},o=Ea(),d=M(o);{var T=l=>{{const y=K=>{Xe();var ie=Qe();D(()=>g(ie,e(je))),s(K,ie)};let z=i(()=>c.ui_combobox_retry_label());Ia(l,{onRetry:()=>Nt(Be),get retryLabel(){return e(z)},class:"m-auto",message:y,$$slots:{message:!0}})}},_=l=>{{let y=i(()=>c.file_pdf_loading_label());Ca(l,{get label(){return e(y)},count:1,class:"p-4"})}},w=l=>{var y=Va(),z=de(y),K=M(z);{let pe=i(()=>e(W)<=1);Se(K,{variant:"ghost",size:"compact",get disabled(){return e(pe)},onclick:()=>Nt(W,-1),children:(ye,Ge)=>{Xe();var Pe=Qe();D(ue=>g(Pe,ue),[()=>c.file_pdf_previous_label()]),s(ye,Pe)},$$slots:{default:!0}})}var ie=p(K,2),_e=S(ie,!0),U=p(ie,2);{let pe=i(()=>e(W)>=e(J).numPages);Se(U,{variant:"ghost",size:"compact",get disabled(){return e(pe)},onclick:()=>Nt(W),children:(ye,Ge)=>{Xe();var Pe=Qe();D(ue=>g(Pe,ue),[()=>c.file_pdf_next_label()]),s(ye,Pe)},$$slots:{default:!0}})}var ne=p(U,2);{let pe=i(()=>e(N)<=.25);Se(ne,{variant:"ghost",size:"compact",get disabled(){return e(pe)},onclick:()=>u(N,Math.max(.25,e(N)-.25),!0),children:(ye,Ge)=>{Xe();var Pe=Qe();D(ue=>g(Pe,ue),[()=>c.editor_fileViewer_zoomOut_tooltip()]),s(ye,Pe)},$$slots:{default:!0}})}var X=p(ne,2),Z=S(X,!0),at=p(X,2);{let pe=i(()=>e(N)>=3);Se(at,{variant:"ghost",size:"compact",get disabled(){return e(pe)},onclick:()=>u(N,Math.min(3,e(N)+.25),!0),children:(ye,Ge)=>{Xe();var Pe=Qe();D(ue=>g(Pe,ue),[()=>c.editor_fileViewer_zoomIn_tooltip()]),s(ye,Pe)},$$slots:{default:!0}})}P(z);var ot=p(z,2),qe=M(ot);let Ye;mr(qe,pe=>u(He,pe),()=>e(He)),P(ot),D((pe,ye,Ge)=>{g(_e,pe),g(Z,ye),tt(ot,"aria-busy",e(R)),tt(qe,"aria-label",Ge),Ye=bt(qe,"",Ye,{visibility:e(R)?"hidden":"visible"})},[()=>c.file_pdf_page_label({page:Kt(e(W)),total:Kt(e(J).numPages)}),()=>br(e(N),{style:"percent"}),()=>c.file_pdf_canvas_ariaLabel({name:ae(),page:Kt(e(W))})]),s(l,y)};ce(d,l=>{e(xe)?l(T):e(oe)||ke()?.status==="loading"?l(_,1):e(J)&&l(w,2)})}P(o),s(we,o);var Ee=zt(Ne);return re(),Ee}const Aa=A.createSelector((we,x)=>_r(we.videoPreview.previews,x));var Wa=C('<p role="status"> </p>'),Ba=C('<p role="alert"> </p>'),Na=C('<div class="flex flex-col items-center gap-3 p-6 text-center text-sm text-subtle"><p class="break-all"> </p> <!> <!></div>'),Oa=C('<video controls="" preload="metadata" playsinline="" class="max-w-full max-h-full" data-testid="file-video"> </video>',2),Ha=C('<div class="min-h-0 flex-1 flex items-center justify-center bg-background"><!></div>');function yr(we,x){if(new.target)return Mt({component:yr,...we});Rt(x,!0);const ke=()=>he(He,"$preview",rt),[rt,re]=Jt();let $=ee(x,"sourceUrl",7),ae=ee(x,"fileName",7),Ie=ee(x,"allowDownload",7),De=ee(x,"downloading",7),be=ee(x,"onDownload",7),me=H(null);const J=crypto.randomUUID(),He=Aa(J),W=i(()=>ke()?.status==="loading"),N=i(()=>e(me)??ke()?.error);let oe=!1,R=!1;Er(()=>{R=!0,A.dispatch(Or(J))});function Ve(){if(R||e(W))return;const _=$().startsWith("workspace-file://")?new URL($()):null;if(oe||!_||!_.pathname.toLowerCase().endsWith(".mp4")){u(me,"unsupported");return}oe=!0,_.searchParams.set("preview","h264"),A.dispatch(Hr(J,_.hostname,_.toString()))}function Be(_){if(R)return;const w=_.currentTarget.error?.code;w===2?u(me,"network"):w!==1&&Ve()}var xe={get sourceUrl(){return $()},set sourceUrl(_){$(_),te()},get fileName(){return ae()},set fileName(_){ae(_),te()},get allowDownload(){return Ie()},set allowDownload(_){Ie(_),te()},get downloading(){return De()},set downloading(_){De(_),te()},get onDownload(){return be()},set onDownload(_){be(_),te()},$set:Tt,$on:(_,w)=>Ut(x,_,w)},je=Ha(),Ne=M(je);{var o=_=>{var w=Na(),Ee=M(w),l=S(Ee,!0),y=p(Ee,2);{var z=U=>{var ne=Wa(),X=S(ne,!0);D(Z=>g(X,Z),[()=>c.editor_fileViewer_videoPreparing_label()]),s(U,ne)},K=U=>{var ne=Ba(),X=S(ne,!0);D(Z=>g(X,Z),[()=>e(N)==="network"?c.editor_fileViewer_videoLoad_error():c.editor_fileViewer_videoUnsupported_label()]),s(U,ne)};ce(y,U=>{e(W)?U(z):U(K,-1)})}var ie=p(y,2);{var _e=U=>{Se(U,{variant:"secondary",size:"sm",get onclick(){return be()},get disabled(){return De()},children:(ne,X)=>{Xe();var Z=Qe();D(at=>g(Z,at),[()=>c.layout_fileTab_downloadFile_label()]),s(ne,Z)},$$slots:{default:!0}})};ce(ie,U=>{Ie()&&U(_e)})}P(w),D(()=>g(l,ae())),s(_,w)},d=_=>{var w=Oa(),Ee=S(w,!0);D(l=>{tt(w,"src",ke()?.url??$()),g(Ee,l)},[()=>c.editor_fileViewer_videoUnsupported_label()]),et("error",w,Be),et("loadedmetadata",w,l=>{l.currentTarget.videoWidth===0&&Ve()}),s(_,w)};ce(Ne,_=>{e(N)||e(W)?_(o):_(d,-1)})}P(je),s(we,je);var T=zt(xe);return re(),T}var qa=C('<!> <span class="text-xs text-subtle min-w-[50px] text-center"> </span> <!> <div class="w-px h-5 bg-border mx-1"></div>',1),Ga=C('<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>'),Ka=C('<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>'),Xa=C('<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>'),Ya=C("<!> ",1),Ja=C('<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>'),Za=C('<th class="border border-border px-2 py-1 text-left text-xs font-medium bg-muted"> </th>'),Qa=C('<td class="border border-border px-2 py-1 text-xs"> </td>'),eo=C("<tr></tr>"),to=C('<div class="flex-1 overflow-auto p-4"><table class="w-full border-collapse"><thead><tr></tr></thead><tbody></tbody></table></div>'),ro=C('<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>'),ao=C('<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>'),oo=C('<div class="h-full flex flex-col"><!></div>');function jt(we,x){if(new.target)return Mt({component:jt,...we});Rt(x,!0);const ke=t=>{var a=qa(),f=de(a);{let O=i(()=>c.editor_fileViewer_zoomOut_tooltip());Se(f,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ne,get title(){return e(O)},children:(j,L)=>{Ze(j,{get icon(){return xa},size:"sm"})},$$slots:{default:!0}})}var m=p(f,2),h=S(m,!0),k=p(m,2);{let O=i(()=>c.editor_fileViewer_zoomIn_tooltip());Se(k,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:U,get title(){return e(O)},children:(j,L)=>{Ze(j,{get icon(){return ya},size:"sm"})},$$slots:{default:!0}})}Xe(2),D(()=>g(h,e(Ve))),s(t,a)},rt=Fa("FileViewer");let re=ee(x,"filePath",7),$=ee(x,"fileContent",7,""),ae=ee(x,"sourceUrl",7),Ie=ee(x,"language",7),De=ee(x,"isBinary",7),be=ee(x,"allowDownload",7,!0),me=ee(x,"onDownload",7),J=ee(x,"downloading",7,!1);const He=t=>{const a=t.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","webp","bmp","ico","avif"].includes(a)?"image":a==="svg"?"svg":["mp4","webm","ogg","mov","avi"].includes(a)?"video":["mp3","wav","ogg","m4a","flac"].includes(a)?"audio":a==="pdf"?"pdf":["md","markdown"].includes(a)?"markdown":a==="json"?"json":a==="csv"?"csv":["yaml","yml"].includes(a)?"yaml":a==="xml"?"xml":["zip","tar","gz","rar","7z","bz2"].includes(a)?"archive":["exe","dll","so","dylib","wasm"].includes(a)?"binary":"text"},W=i(()=>He(re())),N=i(()=>re().split("/").pop()||c.editor_fileViewer_unknown_fallback());let oe=H(100),R=H(0);const Ve=i(()=>br(e(oe)/100,{style:"percent",maximumFractionDigits:0}));let Be=H(!1),xe=H(0),je=H(0),Ne=H(0),o=H(0),d=H(!1),T=null;function _(){const t=T;T=null,u(d,!1),t?.viewport.hasPointerCapture(t.pointerId)&&t.viewport.releasePointerCapture(t.pointerId)}function w(t){if(t.button!==0||!t.isPrimary||T)return;const a=t.currentTarget;a.setPointerCapture(t.pointerId),T={pointerId:t.pointerId,x:t.clientX,y:t.clientY,viewport:a},u(d,!0),t.preventDefault()}function Ee(t){if(!(!T||t.pointerId!==T.pointerId)){if((t.buttons&1)===0){_();return}u(Ne,T.viewport.scrollLeft,!0),u(o,T.viewport.scrollTop,!0),u(xe,e(xe)+(t.clientX-T.x)),u(je,e(je)+(t.clientY-T.y)),T.x=t.clientX,T.y=t.clientY}}function l(t){t.pointerId===T?.pointerId&&_()}$e(()=>{re(),ae(),e(oe),e(R),u(Ne,0),u(o,0)}),$e(()=>(re(),ae(),vr(()=>{_(),u(xe,0),u(je,0)}),_));const y=t=>{const a=t.split(".").pop()?.toLowerCase();return a==="jpg"||a==="jpeg"?"image/jpeg":a==="png"?"image/png":a==="gif"?"image/gif":a==="webp"?"image/webp":"application/octet-stream"},z=t=>{const a=t.split(".").pop()?.toLowerCase();if(a==="mp4")return"video/mp4";if(a==="webm")return"video/webm"},K=()=>{if(ae())return ae();if(typeof $()=="string")return $().startsWith("data:")||$().startsWith("http")?$():De()?`data:${y(re())};base64,${$()}`:`data:${y(re())};base64,${$()}`;if($()instanceof ArrayBuffer){const a=new Uint8Array($()).reduce((m,h)=>m+String.fromCharCode(h),""),f=btoa(a);return`data:${y(re())};base64,${f}`}return""},ie=()=>{if(ae())return ae();const t=z(re());if(!t)return"";if(typeof $()=="string")return $().startsWith("data:")||$().startsWith("http")?$():`data:${t};base64,${$()}`;const a=new Uint8Array($()),f=[],m=32768;for(let h=0;h<a.length;h+=m)f.push(String.fromCharCode(...a.subarray(h,h+m)));return`data:${t};base64,${btoa(f.join(""))}`},_e=()=>{const t=typeof $()=="string"?new TextEncoder().encode($()):new Uint8Array($()),a=[],f=32768;for(let m=0;m<t.length;m+=f)a.push(String.fromCharCode(...t.subarray(m,m+f)));return`data:image/svg+xml;base64,${btoa(a.join(""))}`},U=()=>{u(oe,Math.min(e(oe)+25,500),!0)},ne=()=>{u(oe,Math.max(e(oe)-25,25),!0)},X=()=>{u(R,(e(R)+90)%360)},Z=()=>{if(!be()||J())return;if(me()){me()();return}const t=document.createElement("a");t.href=e(W)==="video"?ie():e(W)==="svg"?_e():K(),t.download=e(N),t.click()},at=async()=>{try{const t=K(),a=new Image;a.crossOrigin="anonymous";const f=await new Promise((m,h)=>{a.onload=()=>{const k=document.createElement("canvas");k.width=a.naturalWidth,k.height=a.naturalHeight;const O=k.getContext("2d");if(!O){h(new Error("Failed to get canvas context"));return}O.drawImage(a,0,0),k.toBlob(j=>{j?m(j):h(new Error("Failed to create blob from canvas"))},"image/png",1)},a.onerror=()=>h(new Error("Failed to load image")),a.src=t});await navigator.clipboard.write([new ClipboardItem({"image/png":f})]),u(Be,!0),setTimeout(()=>u(Be,!1),2e3)}catch(t){rt.error("Failed to copy image:",t)}},ot=t=>{try{const a=JSON.parse(t);return JSON.stringify(a,null,2)}catch{return t}},qe=t=>t.split(`
|
|
2
2
|
`).map(f=>f.split(",").map(m=>m.trim()));var Ye={get filePath(){return re()},set filePath(t){re(t),te()},get fileContent(){return $()},set fileContent(t=""){$(t),te()},get sourceUrl(){return ae()},set sourceUrl(t){ae(t),te()},get language(){return Ie()},set language(t){Ie(t),te()},get isBinary(){return De()},set isBinary(t){De(t),te()},get allowDownload(){return be()},set allowDownload(t=!0){be(t),te()},get onDownload(){return me()},set onDownload(t){me(t),te()},get downloading(){return J()},set downloading(t=!1){J(t),te()},$set:Tt,$on:(t,a)=>Ut(x,t,a)},pe=oo();et("blur",pr,_);var ye=M(pe);{var Ge=t=>{var a=Ga(),f=M(a),m=M(f);ke(m);var h=p(m,2);{let Q=i(()=>c.editor_fileViewer_rotate_tooltip());Se(h,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:X,get title(){return e(Q)},children:(ge,Me)=>{Ze(ge,{get icon(){return ha},size:"sm"})},$$slots:{default:!0}})}var k=p(h,4);{let Q=i(()=>c.editor_fileViewer_copyImage_tooltip());Se(k,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:at,get title(){return e(Q)},children:(ge,Me)=>{var Ce=Le(),Vt=de(Ce);{var ut=Fe=>{Ze(Fe,{get icon(){return wa},size:"sm",class:"text-green-500"})},kt=Fe=>{Ze(Fe,{get icon(){return ba},size:"sm"})};ce(Vt,Fe=>{e(Be)?Fe(ut):Fe(kt,-1)})}s(ge,Ce)},$$slots:{default:!0}})}var O=p(k,2);{let Q=i(()=>!be()||J()),ge=i(()=>c.editor_fileViewer_download_tooltip());Se(O,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:Z,get disabled(){return e(Q)},get title(){return e(ge)},children:(Me,Ce)=>{Ze(Me,{get icon(){return Dt},size:"sm"})},$$slots:{default:!0}})}var j=p(O,2),L=S(j,!0);P(f);var V=p(f,2),se=S(V);P(a),D(Q=>{g(L,e(N)),ar(V,1,`relative min-h-0 flex-1 overflow-auto bg-checkered flex items-center justify-center p-4 select-none ${e(d)?"cursor-grabbing":"cursor-grab"}`,"svelte-1uj35xu"),bt(V,`--pan-scroll-x: ${e(Ne)??""}px; --pan-scroll-y: ${e(o)??""}px;`),tt(se,"src",Q),tt(se,"alt",e(N)),bt(se,`translate: ${e(xe)??""}px ${e(je)??""}px; transform: scale(${e(oe)/100}) rotate(${e(R)??""}deg); transition: transform 0.2s;`)},[()=>K()]),ct("pointerdown",V,w),ct("pointermove",V,Ee),ct("pointerup",V,l),et("pointercancel",V,l),et("lostpointercapture",V,l),s(t,a)},Pe=t=>{var a=Ka(),f=M(a),m=M(f);ke(m);var h=p(m,2);{let V=i(()=>!be()||J()),se=i(()=>c.editor_fileViewer_download_tooltip());Se(h,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:Z,get disabled(){return e(V)},get title(){return e(se)},children:(Q,ge)=>{Ze(Q,{get icon(){return Dt},size:"sm"})},$$slots:{default:!0}})}var k=p(h,2),O=S(k,!0);P(f);var j=p(f,2),L=S(j);P(a),D(V=>{g(O,e(N)),ar(j,1,`relative min-h-0 flex-1 overflow-auto bg-checkered flex items-center justify-center p-4 select-none ${e(d)?"cursor-grabbing":"cursor-grab"}`,"svelte-1uj35xu"),bt(j,`--pan-scroll-x: ${e(Ne)??""}px; --pan-scroll-y: ${e(o)??""}px;`),tt(L,"src",V),tt(L,"alt",e(N)),bt(L,`translate: ${e(xe)??""}px ${e(je)??""}px; transform: scale(${e(oe)/100});`)},[()=>_e()]),ct("pointerdown",j,w),ct("pointermove",j,Ee),ct("pointerup",j,l),et("pointercancel",j,l),et("lostpointercapture",j,l),s(t,a)},ue=t=>{const a=i(ie);var f=Le(),m=de(f);gr(m,()=>re()+e(a),h=>{yr(h,{get sourceUrl(){return e(a)},get fileName(){return e(N)},get allowDownload(){return be()},get downloading(){return J()},onDownload:Z})}),s(t,f)},it=t=>{var a=Xa(),f=p(M(a),2),m=S(f,!0),h=p(f,2),k=M(h),O=p(k);P(h),P(a),D((j,L)=>{g(m,e(N)),tt(k,"src",j),g(O,` ${L??""}`)},[()=>K(),()=>c.editor_fileViewer_audioUnsupported_label()]),s(t,a)},yt=t=>{var a=Ja(),f=p(M(a),2),m=S(f,!0),h=p(f,2);{let k=i(()=>!be()||J());Se(h,{size:"sm",variant:"secondary",onclick:Z,get disabled(){return e(k)},children:(O,j)=>{var L=Ya(),V=de(L);Ze(V,{get icon(){return Dt},size:"sm",class:"mr-2"});var se=p(V);D(Q=>g(se,` ${Q??""}`),[()=>c.editor_fileViewer_downloadPdf_label()]),s(O,L)},$$slots:{default:!0}})}P(a),D(k=>g(m,k),[()=>c.editor_fileViewer_pdfUnavailable_label()]),s(t,a)},lt=t=>{{let a=i(()=>ot($().toString()));Xt(t,{get value(){return e(a)},language:"json",get fileName(){return re()},lineNumbers:!0,readOnly:!0})}},Pt=t=>{const a=i(()=>qe($().toString()));var f=to(),m=M(f),h=M(m),k=M(h);xt(k,23,()=>e(a)[0]||[],(j,L)=>`header-${L}-${j}`,(j,L)=>{var V=Za(),se=S(V,!0);D(()=>g(se,e(L))),s(j,V)}),P(k),P(h);var O=p(h);xt(O,23,()=>e(a).slice(1),(j,L)=>`row-${L}`,(j,L,V)=>{var se=eo();xt(se,23,()=>e(L),(Q,ge)=>`cell-${e(V)}-${ge}`,(Q,ge)=>{var Me=Qa(),Ce=S(Me,!0);D(()=>g(Ce,e(ge))),s(Q,Me)}),P(se),s(j,se)}),P(O),P(m),P(f),s(t,f)},Lt=t=>{var a=ro(),f=p(M(a),2),m=S(f,!0),h=p(f,2),k=S(h,!0);P(a),D(O=>{g(m,e(N)),g(k,O)},[()=>c.editor_fileViewer_archive_label()]),s(t,a)},$t=t=>{var a=ao(),f=p(M(a),2),m=S(f,!0),h=p(f,2),k=S(h,!0);P(a),D(O=>{g(m,e(N)),g(k,O)},[()=>c.editor_fileViewer_binary_label()]),s(t,a)},Je=t=>{{let a=i(()=>$().toString());Xt(t,{get value(){return e(a)},get language(){return Ie()},get fileName(){return re()},lineNumbers:!0,highlightActiveLine:!0})}};ce(ye,t=>{e(W)==="image"?t(Ge):e(W)==="svg"?t(Pe,1):e(W)==="video"?t(ue,2):e(W)==="audio"?t(it,3):e(W)==="pdf"?t(yt,4):e(W)==="json"?t(lt,5):e(W)==="csv"?t(Pt,6):e(W)==="archive"?t(Lt,7):e(W)==="binary"?t($t,8):t(Je,-1)})}return P(pe),s(we,pe),zt(Ye)}Ar(["pointerdown","pointermove","pointerup"]);var io=C("<!> <!>",1),no=C("<!> <!> <!>",1),so=C('<div class="flex flex-col items-center justify-center h-full text-subtle gap-2"><p> </p> <p class="text-xs"> </p></div>'),ur=C('<div class="flex h-full items-center justify-center p-4 text-subtle"><p role="alert"> </p></div>'),lo=C('<div class="flex h-full items-center justify-center text-subtle"><p> </p></div>'),fr=C('<div class="flex items-center justify-center h-full text-subtle"><p> </p></div>'),co=C('<div class="flex items-center gap-3"><!> <!></div>'),uo=C('<div class="flex flex-col h-full"><div class="flex-1 p-4 space-y-2"></div></div>'),fo=C("<li><!></li>"),vo=C('<p class="text-xs mt-2"> </p> <ul class="flex flex-col items-center gap-1"></ul>',1),po=C('<div class="flex flex-col items-center justify-center h-full text-subtle gap-2"><p class="text-danger"> </p> <p class="text-xs"> </p> <p class="text-xs font-mono"> </p> <!></div>'),go=C('<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>'),mo=C('<div class="h-full overflow-auto p-4"><!></div>');function _o(we,x){if(new.target)return Mt({component:_o,...we});Rt(x,!0);const ke=()=>he(Pe,"$workspace",R),rt=()=>he(K,"$fileContentStore",R),re=()=>he(ie,"$fileLoadingStore",R),$=()=>he(_e,"$fileSavingStore",R),ae=()=>he(U,"$fileErrorStore",R),Ie=()=>he(ne,"$fileNotFoundCandidatesStore",R),De=()=>he(X,"$isFileBinaryStore",R),be=()=>he(Z,"$isFileDirtyStore",R),me=()=>he(at,"$fileLastUpdatedStore",R),J=()=>he(ot,"$ftChanges$",R),He=()=>he(Ge,"$gutterRead$",R),W=()=>he(je,"$lineWrapping",R),N=()=>he(Ne,"$diffIndicators",R),oe=()=>he(pe,"$rootMediaPreview",R),[R,Ve]=Jt(),Be=r=>{var n=io(),I=de(n);{var F=ve=>{var Ae=Le(),Oe=de(Ae);Ft(Oe,()=>St,(dt,pt)=>{pt(dt,{get icon(){return Pa},get label(){return e(f)},disabled:!0})}),s(ve,Ae)};ce(I,ve=>{!e(se)&&!e(l)&&!e(Je)&&ve(F)})}var fe=p(I,2);{var Te=ve=>{{let Ae=i(()=>!e(It)||!e(L)),Oe=i(()=>!e(l)&&(!e(It)||!e(L)));Ua(ve,{embedded:!0,showFold:!1,showSplit:!1,get showPreview(){return e(It)},get previewEnabled(){return e(L)},onTogglePreview:()=>u(L,!e(L)),get showWrap(){return e(Ae)},get wrapEnabled(){return W()},onToggleWrap:()=>A.dispatch(Jr()),get showDiff(){return e(Oe)},get diffEnabled(){return N()},onToggleDiff:()=>A.dispatch(Yr())})}};ce(fe,ve=>{o().filePath&&!e(se)&&!e(Je)&&ve(Te)})}s(r,n)},xe=r=>{var n=Le(),I=de(n);{var F=fe=>{var Te=no(),ve=de(Te);{var Ae=We=>{var Ke=Le(),nt=de(Ke);{let gt=i(()=>c.layout_fileTab_goToChanges_tooltip());Ft(nt,()=>St,(mt,_t)=>{_t(mt,{get icon(){return ka},get label(){return e(gt)},onclick:Dr})})}s(We,Ke)};ce(ve,We=>{e($r)&&We(Ae)})}var Oe=p(ve,2);{var dt=We=>{var Ke=Le(),nt=de(Ke);{let gt=i(()=>c.layout_fileTab_downloadFile_label()),mt=i(()=>!e(ft)||e(Fe));Ft(nt,()=>St,(_t,At)=>{At(_t,{get icon(){return Dt},get label(){return e(gt)},onclick:Ct,get disabled(){return e(mt)}})})}s(We,Ke)};ce(Oe,We=>{e(Ce)&&We(dt)})}var pt=p(Oe,2);{let We=i(()=>c.layout_fileTab_deleteFile_tooltip());Ft(pt,()=>St,(Ke,nt)=>{nt(Ke,{get icon(){return $a},get label(){return e(We)},onclick:jr,destructive:!0})})}s(fe,Te)};ce(I,fe=>{o().filePath&&!e(se)&&!e(l)&&fe(F)})}s(r,n)},je=Ra(),Ne=za();let o=ee(x,"tab",7),d=ee(x,"workspaceId",7),T=ee(x,"isActive",7),_=ee(x,"isPanelFocused",7);$e(()=>{const r=d();if(!(!T()||!r||e(w)))return A.dispatch(qr(r,"files")),()=>A.dispatch(Gr(r,"files"))});const w=i(()=>typeof o().data?.gitRootId=="string"?o().data.gitRootId:void 0),Ee=i(()=>typeof o().data?.gitRootPath=="string"?o().data.gitRootPath:void 0),l=i(()=>!!e(w)),y=i(()=>o().filePath?ma(o().filePath,e(w)):o().filePath),z=Wr(e(y));$e(()=>{z.set(e(y))});const K=ia(d(),z),ie=na(d(),z),_e=sa(d(),z),U=la(d(),z),ne=da(d(),z),X=ca(d(),z),Z=lr(d(),z),at=ua(d(),z),ot=fa(d()),qe=oa(),Ye=crypto.randomUUID(),pe=xr(Ye),ye=`file-gutter:${crypto.randomUUID()}`,Ge=va(d(),ye),Pe=pa(d()),ue=i(()=>ke()?.worktreePath||ke()?.repositoryPath||ke()?.path||null),it=i(rt),yt=i(re),lt=i($),Pt=i(ae),Lt=5,$t=i(()=>(Ie()??[]).slice(0,Lt)),Je=i(De),t=i(be),a=i(me),f=i(()=>e(lt)?c.ui_saveIndicator_saving_tooltip():e(t)?c.ui_saveIndicator_autoSaving_tooltip():c.ui_saveIndicator_saved_tooltip());let m=H(null),h=H(Br([])),k=H(null),O=H(void 0),j=H(void 0),L=H(!0);$e(()=>{const r=o().data?.line,n=o().data?.jumpTimestamp;!r||n!==void 0&&n===e(j)||(u(j,n,!0),u(O,{line:r},!0),u(L,!1))});const V=i(()=>e(w)?dr(o().filePath,e(Ee)):null),se=i(()=>e(w)?!e(V):!!(o().filePath&&(Da(o().filePath)||e(ue)&&ja(o().filePath,e(ue))))),Q=i(()=>o().filePath&&e(ue)?Gt(o().filePath)?o().filePath:`${e(ue)}/${o().filePath}`:null),ge=i(()=>!!o().filePath&&/\.pdf$/i.test(o().filePath)),Me=i(()=>!!o().filePath&&/\.(?:png|jpe?g|gif|webp|mp4|webm)$/i.test(o().filePath)),Ce=i(()=>d()&&/^[A-Za-z0-9._-]+$/.test(d())?dr(o().filePath,e(ue)):null),Vt=i(()=>!e(w)&&e(Ce)?e(Ce).split("/").slice(0,-1).join("/"):void 0),ut=i(()=>e(ge)||e(Me)?e(Ce):null),kt=i(()=>e(w)&&e(Me)?{png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",mp4:"video/mp4",webm:"video/webm"}[o().filePath?.split(".").pop()?.toLowerCase()??""]:void 0);$e(()=>{if(!T()||!e(w)||!e(V)||!e(kt))return;const r=crypto.randomUUID();return A.dispatch(hr(Ye,r,d(),e(V),{gitRootId:e(w),mimeType:e(kt)})),()=>A.dispatch(wr(Ye,r))});let Fe=H(!1);const ft=i(()=>!!e(Ce)&&!e(yt)&&(!e(Me)||e(k)===e(Ce))),Zt=i(()=>e(k)&&d()?`workspace-file://${d()}/${e(k).split("/").map(encodeURIComponent).join("/")}`:null),Et=i(()=>o().filePath?ea(o().filePath):"plaintext"),It=i(()=>e(Et)==="markdown");$e(()=>{if(!T()||e(ge)||e(w))return;const r=e(ut),n=o().filePath,I=d(),F=o().id;if(u(k,null),!r||!n||!I)return;let fe=!1;const Te=()=>!fe&&d()===I&&o().id===F&&o().filePath===n;return(async()=>{let ve=!1;try{ve=(await _a("file.stat",{workspaceId:I,path:r}))?.isFile===!0}catch{}if(!Te())return;if(ve){u(k,r,!0);return}if(!/\.(?:png|jpe?g|gif|webp|mp4|webm)$/i.test(r)){u(k,r,!0);return}const{candidates:Ae,truncated:Oe}=await Sa(I,r);if(Te()){if(!Oe&&Ae.length===1){A.dispatch(or(I,n,Ae[0],F));return}u(k,r,!0)}})(),()=>{fe=!0}});function Pr(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 vt=i(()=>e(l)||!o().filePath?null:J().find(r=>Pr(r,o().filePath))??null),$r=i(()=>!!e(vt));$e(()=>{if(e(l))return;const r=d(),n=o().filePath,I=e(ue);return()=>{if(!r||!n)return;const F=Ht.select(A.state,r,n);if(F?.kind!=="editable-text")return;const fe=Ot(F.localContent),Te=lr.select(A.state,r,n),ve=Gt(n)?n:I?`${I}/${n}`:null;Te&&ve&&A.dispatch(ir(r,n,ve,fe))}}),$e(()=>{const r=o().filePath,n=e(Q),I=d();if(!T())return;const F=!e(w)&&!!r&&Gt(r)&&!e(ue);r&&I&&!e(se)&&!e(Me)&&!e(ge)&&!F&&(e(w)&&e(V)&&e(y)?A.dispatch(nr(I,e(y),n??r,{gitRoot:{id:e(w),relativePath:e(V)}})):A.dispatch(nr(I,r,n??r)))});function kr(){return e(it)??""}function Ir(r){e(l)||e(Je)||!o().filePath||!d()||!e(Q)||A.dispatch(aa(d(),o().filePath,Ot(r)))}function Cr(){if(e(l)||e(Je)||!o().filePath||!e(Q)||e(it)===null||e(lt))return;const r=Ht.select(A.state,d(),o().filePath);r?.kind==="editable-text"&&A.dispatch(ir(d(),o().filePath,e(Q),Ot(r.localContent)))}function Fr(r){const n=o().filePath;!n||!d()||(A.dispatch(ra(d(),n)),A.dispatch(or(d(),n,r,o().id)))}$e(()=>{const r=o().filePath,n=e(vt);if(!r||!n){u(h,[],!0);return}if(!T())return;const I=d(),F=crypto.randomUUID();return A.dispatch(Kr(I,ye,F,{kind:"diffs",path:r,staged:n.stage==="staged"})),()=>{A.dispatch(Xr(I,ye,F))}}),$e(()=>{const r=He(),n=r?.result?.kind==="diffs"?r.result.chunks:[],I=n.find(F=>F.file===o().filePath)??n[0];u(h,I?Ma(I.chunks.map(F=>({oldStart:F.oldStart,oldLines:F.oldLines,newStart:F.newStart,newLines:F.newLines,lines:F.lines.map(fe=>(fe.type===sr.Addition?"+":fe.type===sr.Deletion?"-":" ")+fe.content)}))):[],!0)});function Sr(r){const n=/Mac|iPhone|iPad|iPod/.test(navigator.userAgent),I=Te=>Nr(r,La(Te),n);if(I("editor.save")){r.preventDefault(),e(t)&&!e(lt)&&Cr();return}const F=I("editor.undo")?"undo":I("editor.redo")?"redo":I("editor.toggle-task-list")?"toggle-task-list":I("editor.copy")?"copy":I("editor.select-all")?"select-all":null;if(!F||e(l)&&F!=="copy"&&F!=="select-all")return;F!=="toggle-task-list"&&e(m)?.runShortcut(F)&&r.preventDefault()}function Dr(r){if(!o().filePath||!e(vt))return;const n=r?.metaKey||r?.ctrlKey||!1,F=r?.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0;A.dispatch(ta(d(),e(vt),{filePath:o().filePath,changeId:e(vt).id,openInAdjacentPanel:n,sourcePanelId:F}))}async function Ct(){const r=e(Ce);if(!(e(l)||!r||!d()||!e(ft)||e(Fe))){u(Fe,!0);try{const n=await ga(d(),r,e(ue));!n?.success&&!n?.canceled&&qt.error(n?.error?.message||c.layout_fileTab_downloadFailed_error())}catch{qt.error(c.layout_fileTab_downloadFailed_error())}finally{u(Fe,!1)}}}function jr(){const r=e(Q);if(e(l)||!o().filePath||!d()||!r)return;const n=Zr(Ht.select(A.state,d(),o().filePath));if(!n){qt.error(c.ui_reversibleActions_failed_error({message:c.fileExplorer_tree_undoUnavailable_error()}));return}A.dispatch(Qr(d(),o().filePath,{absolutePath:r,tabId:o().id,snapshot:n}))}$e(()=>{if(!qe||!T())return;const r={isDirty:!e(l)&&e(t),isSaving:!e(l)&&e(lt)};vr(()=>{qe.registerActions({display:Be,actions:xe}),qe.registerState(r)})});var Mr={get tab(){return o()},set tab(r){o(r),te()},get workspaceId(){return d()},set workspaceId(r){d(r),te()},get isActive(){return T()},set isActive(r){T(r),te()},get isPanelFocused(){return _()},set isPanelFocused(r){_(r),te()},$set:Tt,$on:(r,n)=>Ut(x,r,n)},Qt=Le();et("keydown",pr,r=>T()&&Sr(r));var Tr=de(Qt);{var Ur=r=>{var n=Le(),I=de(n);gr(I,()=>o().filePath,F=>{var fe=Le(),Te=de(fe);{var ve=b=>{var v=so(),E=M(v),q=S(E,!0),B=p(E,2),Ue=S(B,!0);P(v),D(Y=>{g(q,Y),g(Ue,o().filePath)},[()=>c.layout_fileTab_outsideWorkspace_label()]),s(b,v)},Ae=b=>{var v=Le(),E=de(v);{var q=B=>{Yt(B,{get workspaceId(){return d()},get filePath(){return e(V)},get gitRootId(){return e(w)}})};ce(E,B=>{T()&&B(q)})}s(b,v)},Oe=b=>{var v=Le(),E=de(v);{var q=Y=>{var G=ur(),le=M(G),Re=S(le,!0);P(G),D(ze=>g(Re,ze),[()=>c.layout_fileTab_errorLoading_label()]),s(Y,G)},B=Y=>{jt(Y,{get filePath(){return o().filePath},get sourceUrl(){return oe().url},allowDownload:!1})},Ue=Y=>{var G=lo(),le=M(G),Re=S(le,!0);P(G),D(ze=>g(Re,ze),[()=>c.layout_fileTab_preparing_label()]),s(Y,G)};ce(E,Y=>{oe()?.error?Y(q):oe()?.url?Y(B,1):Y(Ue,-1)})}s(b,v)},dt=b=>{var v=Le(),E=de(v);{var q=B=>{Yt(B,{get workspaceId(){return d()},get filePath(){return e(ut)}})};ce(E,B=>{T()&&B(q)})}s(b,v)},pt=b=>{var v=ur(),E=M(v),q=S(E,!0);P(v),D(B=>g(q,B),[()=>c.file_pdf_load_error()]),s(b,v)},We=b=>{{let v=i(()=>e(k)??o().filePath),E=i(()=>!e(l)&&e(ft));jt(b,{get filePath(){return e(v)},get sourceUrl(){return e(Zt)},onDownload:Ct,get allowDownload(){return e(E)},get downloading(){return e(Fe)}})}},Ke=b=>{var v=fr(),E=M(v),q=S(E,!0);P(v),D(B=>g(q,B),[()=>c.layout_fileTab_preparing_label()]),s(b,v)},nt=b=>{var v=uo(),E=M(v);xt(E,20,()=>[...Array(20).keys()],q=>q,(q,B)=>{var Ue=co(),Y=M(Ue);cr(Y,{class:"h-3 w-8 shrink-0"});var G=p(Y,2);cr(G,{class:"h-3",style:`width: ${30+Math.random()*60}%`}),P(Ue),s(q,Ue)}),P(E),P(v),s(b,v)},gt=b=>{var v=po(),E=M(v),q=S(E,!0),B=p(E,2),Ue=S(B,!0),Y=p(B,2),G=S(Y,!0),le=p(Y,2);{var Re=ze=>{var st=vo(),ht=de(st),Wt=S(ht,!0),er=p(ht,2);xt(er,20,()=>e($t),wt=>wt,(wt,tr)=>{var Bt=fo(),zr=M(Bt);Se(zr,{variant:"link",size:"compact",class:"h-auto p-0 font-mono text-xs",onclick:()=>Fr(tr),children:(Lr,ho)=>{Xe();var rr=Qe();D(()=>g(rr,tr)),s(Lr,rr)},$$slots:{default:!0}}),P(Bt),s(wt,Bt)}),P(er),D(wt=>g(Wt,wt),[()=>c.layout_fileTab_didYouMean_label()]),s(ze,st)};ce(le,ze=>{e($t).length>0&&ze(Re)})}P(v),D(ze=>{g(q,ze),g(Ue,e(Pt)),g(G,o().filePath)},[()=>c.layout_fileTab_errorLoading_label()]),s(b,v)},mt=b=>{var v=go(),E=M(v),q=S(E,!0),B=p(E,2),Ue=S(B,!0),Y=p(B,2);{var G=le=>{{let Re=i(()=>!e(ft)||e(Fe));Se(le,{variant:"secondary",size:"sm",onclick:Ct,get disabled(){return e(Re)},children:(ze,st)=>{Xe();var ht=Qe();D(Wt=>g(ht,Wt),[()=>c.layout_fileTab_downloadFile_label()]),s(ze,ht)},$$slots:{default:!0}})}};ce(Y,le=>{!e(l)&&e(Ce)&&le(G)})}P(v),D(le=>{g(q,le),g(Ue,o().filePath)},[()=>c.editor_fileViewer_binary_label()]),s(b,v)},_t=b=>{const v=i(()=>o().filePath?.toLowerCase().endsWith(".svg"));var E=Le(),q=de(E);{var B=G=>{{let le=i(()=>o().filePath||""),Re=i(()=>!e(l)&&e(ft));jt(G,{get filePath(){return e(le)},get fileContent(){return e(it)},get language(){return e(Et)},get isBinary(){return e(Je)},onDownload:Ct,get allowDownload(){return e(Re)},get downloading(){return e(Fe)}})}},Ue=G=>{var le=mo(),Re=M(le);Ta(Re,{get content(){return e(it)},get workspaceId(){return d()},get relativeMediaBase(){return e(Vt)},renderRichFencesAsCode:!0,renderDiagrams:!0}),P(le),s(G,le)},Y=G=>{var le=kr,Re=Ir;{let ze=i(()=>N()?e(h):[]);mr(Xt(G,{get value(){return le()},set value(st){Re(st)},get language(){return e(Et)},get readOnly(){return e(l)},get fileName(){return o().filePath},get workspaceId(){return d()},get filePath(){return o().filePath},get lineWrapping(){return W()},get lineChanges(){return e(ze)},get jumpTo(){return e(O)},get externalContentVersion(){return e(a)},get isPanelFocused(){return _()}}),st=>u(m,st,!0),()=>e(m))}};ce(q,G=>{e(v)?G(B):e(It)&&e(L)?G(Ue,1):G(Y,-1)})}s(b,E)},At=b=>{var v=fr(),E=M(v),q=S(E,!0);P(v),D(B=>g(q,B),[()=>c.layout_fileTab_preparing_label()]),s(b,v)};ce(Te,b=>{e(se)?b(ve):e(w)&&e(ge)&&e(V)?b(Ae,1):e(w)&&e(Me)?b(Oe,2):e(ge)&&e(ut)?b(dt,3):e(ge)?b(pt,4):e(Zt)?b(We,5):e(Me)?b(Ke,6):e(yt)?b(nt,7):e(Pt)?b(gt,8):e(Je)?b(mt,9):e(it)!==null?b(_t,10):b(At,-1)})}s(F,fe)}),s(r,n)};ce(Tr,r=>{o().filePath&&r(Ur)})}s(we,Qt);var Rr=zt(Mr);return Ve(),Rr}export{_o as default};
|