@shumai-one/shumai 0.4.0 → 0.4.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/bin/chunk-082zg4nr.js +307 -0
- package/bin/chunk-09pe07g6.js +7 -0
- package/bin/chunk-0qdzjcny.js +2 -0
- package/bin/chunk-0z1p2pvf.js +1 -0
- package/bin/{chunk-xkhwj8mw.js → chunk-116p639c.js} +2 -2
- package/bin/{chunk-yfqz6f72.js → chunk-13ypr8v0.js} +1 -1
- package/bin/{chunk-tcm57j8r.js → chunk-16txy3r1.js} +2 -2
- package/bin/{chunk-vhcqazqf.js → chunk-1vs91e4q.js} +2 -2
- package/bin/{chunk-br7d2qwc.js → chunk-29e0mb43.js} +1 -1
- package/bin/chunk-2a0egvsg.js +1 -0
- package/bin/{chunk-kxr8fjsq.js → chunk-2f35h4fn.js} +2 -2
- package/bin/{chunk-pdjar480.js → chunk-2jsjrqw4.js} +1 -1
- package/bin/{chunk-ns804tmv.js → chunk-2q7ew7yz.js} +2 -2
- package/bin/{chunk-9cmvymm5.js → chunk-2sc2jxd3.js} +1 -1
- package/bin/chunk-2vc6pw8q.js +2 -0
- package/bin/{chunk-8956rryj.js → chunk-3gqdepkd.js} +2 -2
- package/bin/chunk-44370df5.js +4 -0
- package/bin/{chunk-mha3rsh7.js → chunk-44xtwvd7.js} +1 -1
- package/bin/{chunk-5yhn31rd.js → chunk-47r5b77s.js} +1 -1
- package/bin/chunk-4azttb3w.js +1 -0
- package/bin/{chunk-j04sztp3.js → chunk-4ee336e3.js} +1 -1
- package/bin/{chunk-02afmyqy.js → chunk-4k2d8w9w.js} +2 -2
- package/bin/{chunk-djx2r4nj.js → chunk-4yhd7bmp.js} +1 -1
- package/bin/chunk-4yybby29.js +2 -0
- package/bin/{chunk-md12a1sf.js → chunk-5395g4kq.js} +1 -1
- package/bin/{chunk-34kaja59.js → chunk-5bkj2n94.js} +2 -2
- package/bin/{chunk-gjnrd32m.js → chunk-5c4h0t33.js} +1 -1
- package/bin/{chunk-ex2ym5pz.js → chunk-6nrynqdw.js} +2 -2
- package/bin/{chunk-ysvhtgve.js → chunk-6tv7rm3x.js} +2 -2
- package/bin/{chunk-7x1vkftb.js → chunk-785kxysj.js} +2 -2
- package/bin/{chunk-1qr0ajc8.js → chunk-78cxvbjd.js} +1 -1
- package/bin/{chunk-dk8vk17v.js → chunk-7g2k89gq.js} +2 -2
- package/bin/chunk-7psq38hv.js +1 -0
- package/bin/{chunk-xzag8w1v.js → chunk-7qzt5nhz.js} +1 -1
- package/bin/{chunk-gcc6pte2.js → chunk-7sf0gbbm.js} +1 -1
- package/bin/{chunk-9k76s3y6.js → chunk-7wvw67f3.js} +2 -2
- package/bin/chunk-7xcyn1ba.js +2 -0
- package/bin/{chunk-wehhpcm1.js → chunk-7zgvmn5q.js} +1 -1
- package/bin/{chunk-nz2v1jmd.js → chunk-8pfgh13x.js} +2 -2
- package/bin/{chunk-0h8rjeyj.js → chunk-8yt4m2pb.js} +1 -1
- package/bin/{chunk-0bfqrx5q.js → chunk-90tbc5f4.js} +2 -2
- package/bin/{chunk-41d9gkx7.js → chunk-92yvt66q.js} +1 -1
- package/bin/chunk-93v3tm93.js +1 -0
- package/bin/{chunk-aw5zkdma.js → chunk-9f83pnfc.js} +1 -1
- package/bin/chunk-a5b3aevg.js +2 -0
- package/bin/{chunk-kjjhvrk1.js → chunk-af6m9p1d.js} +1 -1
- package/bin/chunk-ajryg2e2.js +1 -0
- package/bin/{chunk-62ebss6h.js → chunk-axb1f1ae.js} +2 -2
- package/bin/{chunk-fvbd5dk7.js → chunk-b0cqsrse.js} +2 -2
- package/bin/chunk-b27jgdsf.css +1 -0
- package/bin/{chunk-k3r97v7j.js → chunk-bbar8rsh.js} +1 -1
- package/bin/{chunk-x9akgj7w.js → chunk-be9a7kc6.js} +2 -2
- package/bin/{chunk-dkjkn8t3.js → chunk-bkbqvxfv.js} +2 -2
- package/bin/chunk-bwyph9a0.js +1 -0
- package/bin/{chunk-2x46963w.js → chunk-c43nmcfq.js} +1 -1
- package/bin/{chunk-4q782s34.js → chunk-c97vh5wb.js} +3 -3
- package/bin/{chunk-s73c0brj.js → chunk-cerjktz2.js} +1 -1
- package/bin/chunk-cyvx7gcx.js +2 -0
- package/bin/{chunk-zye42cfp.js → chunk-d6d1j7qq.js} +2 -2
- package/bin/{chunk-zh752hw8.js → chunk-d9sh922y.js} +1 -1
- package/bin/chunk-dbjc1vxt.js +1 -0
- package/bin/{chunk-06spnkta.js → chunk-djkajvn7.js} +1 -1
- package/bin/{chunk-vcf2qk9h.js → chunk-dyvmwafa.js} +1 -1
- package/bin/{chunk-wzmpvadf.js → chunk-ewge52nq.js} +1 -1
- package/bin/{chunk-6m1k317a.js → chunk-f32kxe6c.js} +2 -2
- package/bin/{chunk-mhps85dd.js → chunk-f4d3v0nc.js} +2 -2
- package/bin/{chunk-52dr035y.js → chunk-f8ysqfyv.js} +1 -1
- package/bin/{chunk-xjnghr99.js → chunk-fcsar7p0.js} +1 -1
- package/bin/{chunk-44edgqvy.js → chunk-gfdfkqrc.js} +2 -2
- package/bin/chunk-gr30nssh.js +1 -0
- package/bin/{chunk-t6qdrw24.js → chunk-gtwhwdbs.js} +1 -1
- package/bin/{chunk-dag45evp.js → chunk-gyaem1t4.js} +1 -1
- package/bin/chunk-hk6tvf7b.js +1 -0
- package/bin/{chunk-yyjx8nbq.js → chunk-hmmzbyy1.js} +2 -2
- package/bin/chunk-hzz4hsss.js +1 -0
- package/bin/{chunk-ymr5ybxk.js → chunk-j10gz94w.js} +2 -2
- package/bin/{chunk-gazp5662.js → chunk-j9q9rjvd.js} +2 -2
- package/bin/{chunk-etprs58p.js → chunk-jw00fmkp.js} +1 -1
- package/bin/chunk-k1f3gj25.js +3 -0
- package/bin/{chunk-he1ywtxx.js → chunk-k20w9eaz.js} +1 -1
- package/bin/{chunk-r2shjtte.js → chunk-kejt7kcr.js} +2 -2
- package/bin/{chunk-d7en47eh.js → chunk-kkveddbn.js} +1 -1
- package/bin/chunk-ktvmxqfg.js +5 -0
- package/bin/{chunk-792t2653.js → chunk-m49g5tf4.js} +1 -1
- package/bin/{chunk-wy2f6mby.js → chunk-me3xj7na.js} +1 -1
- package/bin/{chunk-3twtxs5m.js → chunk-mgytr7nc.js} +1 -1
- package/bin/{chunk-y3dy4pdt.js → chunk-mkb4dycy.js} +1 -1
- package/bin/chunk-n21a21vx.js +2 -0
- package/bin/{chunk-qac5hr5h.js → chunk-nndzhn3n.js} +1 -1
- package/bin/{chunk-m8z8jvdq.js → chunk-pcxjm1re.js} +1 -1
- package/bin/{chunk-m2tbft2c.js → chunk-pg00gkr4.js} +1 -1
- package/bin/{chunk-thbfw1ed.js → chunk-pn94h6x7.js} +1 -1
- package/bin/{chunk-93ecxcy4.js → chunk-pt51m9h1.js} +2 -2
- package/bin/{chunk-vkgxrn1h.js → chunk-px2cvc1n.js} +1 -1
- package/bin/{chunk-3gjn4pyp.js → chunk-q059y3wx.js} +1 -1
- package/bin/{chunk-kvnfgr29.js → chunk-q46rc697.js} +1 -1
- package/bin/{chunk-wrgwjg2g.js → chunk-r6g1srb3.js} +1 -1
- package/bin/chunk-r88vwaxc.js +1 -0
- package/bin/chunk-r9pzpqst.js +2 -0
- package/bin/{chunk-tn67sjb2.js → chunk-rar0gk7s.js} +2 -2
- package/bin/chunk-rfrpb986.js +1 -0
- package/bin/{chunk-2xgvs3as.js → chunk-rfsbzd39.js} +2 -2
- package/bin/{chunk-8nyve0cr.js → chunk-s503pcvb.js} +2 -2
- package/bin/{chunk-vvhs586e.js → chunk-s9sgkkjp.js} +1 -1
- package/bin/{chunk-4b7jcpgv.js → chunk-srs9jq8f.js} +1 -1
- package/bin/chunk-t77dwtcc.js +2 -0
- package/bin/{chunk-zmyawgth.js → chunk-tcqw0q8x.js} +1 -1
- package/bin/{chunk-fcsfssar.js → chunk-thd9zasr.js} +1 -1
- package/bin/chunk-tkgpc6c9.js +2 -0
- package/bin/{chunk-76433x4d.js → chunk-ts10cfmc.js} +2 -2
- package/bin/{chunk-p49h5fxs.js → chunk-txkmks1h.js} +1 -1
- package/bin/{chunk-jwgfkpek.js → chunk-v9hbssqd.js} +1 -1
- package/bin/{chunk-31y5j4hr.js → chunk-v9zc56qr.js} +1 -1
- package/bin/{chunk-et0cewj7.js → chunk-vh7eb7tp.js} +1 -1
- package/bin/chunk-w9p59ahz.js +73 -0
- package/bin/{chunk-3r33kewe.js → chunk-wfee9d83.js} +2 -2
- package/bin/{chunk-agabtxrc.js → chunk-wxsq9zmf.js} +1 -1
- package/bin/chunk-wzdnsgwq.js +2 -0
- package/bin/chunk-x2nnv4j8.js +1 -0
- package/bin/chunk-xxtcmzcv.js +2 -0
- package/bin/{chunk-sx6y697s.js → chunk-xyzmew7g.js} +1 -1
- package/bin/{chunk-ck6msfch.js → chunk-ygsbmfcy.js} +2 -2
- package/bin/{chunk-ez6veng7.js → chunk-ym9xavj0.js} +1 -1
- package/bin/{chunk-xv5h4dv1.js → chunk-z340qkez.js} +1 -1
- package/bin/{chunk-c3msq02x.js → chunk-za7ga4bf.js} +1 -1
- package/bin/{chunk-j536e9nx.js → chunk-zqvavykq.js} +2 -2
- package/bin/{chunk-2rbexbv0.js → chunk-zt15ht52.js} +1 -1
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +269 -311
- package/package.json +7 -7
- package/prisma/schema.prisma +1 -1
- package/bin/chunk-045f1bw7.js +0 -2
- package/bin/chunk-0n1wfwcm.js +0 -2
- package/bin/chunk-1fwzepfn.js +0 -2
- package/bin/chunk-2xevs82j.js +0 -2
- package/bin/chunk-34adtqqh.js +0 -1
- package/bin/chunk-4j8fbckp.js +0 -1
- package/bin/chunk-57s7yj35.js +0 -1
- package/bin/chunk-6tse78c7.js +0 -2
- package/bin/chunk-ajndx51c.js +0 -2
- package/bin/chunk-bbyc2jfq.js +0 -1
- package/bin/chunk-by6g0vye.js +0 -2
- package/bin/chunk-c24fvhm6.js +0 -1
- package/bin/chunk-c6aszz6p.js +0 -1
- package/bin/chunk-csqvmx1m.js +0 -2
- package/bin/chunk-dg8c91j5.js +0 -1
- package/bin/chunk-f2zbsrc9.js +0 -2
- package/bin/chunk-gcpr2a24.js +0 -7
- package/bin/chunk-gpjkegdp.js +0 -1
- package/bin/chunk-jt6d0zb1.js +0 -2
- package/bin/chunk-k2065y29.js +0 -2
- package/bin/chunk-k514bttd.js +0 -1
- package/bin/chunk-k7chm9a9.js +0 -2
- package/bin/chunk-kjgejwjp.css +0 -1
- package/bin/chunk-kqpzx5az.js +0 -73
- package/bin/chunk-nn0px81k.js +0 -307
- package/bin/chunk-p1temt1j.js +0 -1
- package/bin/chunk-rkz6x3r0.js +0 -2
- package/bin/chunk-svz0ds0g.js +0 -1
- package/bin/chunk-t31basc5.js +0 -1
- package/bin/chunk-wvwqgff4.js +0 -1
- package/bin/chunk-ww1cy08p.js +0 -1
- package/bin/chunk-xfp27ya9.js +0 -2
- package/bin/chunk-y0f4bc9f.js +0 -2
- package/bin/chunk-y2s0tjaa.js +0 -3
- /package/bin/{chunk-xg9xscqz.js → chunk-kryt6pg3.js} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t as KJ,u as QJ,v as XJ}from"./chunk-09pe07g6.js";import{I as zG}from"./chunk-44xtwvd7.js";import{hf as L}from"./chunk-xxtcmzcv.js";import{Kf as MG}from"./chunk-2q7ew7yz.js";import{rg as JJ}from"./chunk-7xcyn1ba.js";import{kh as GJ}from"./chunk-16txy3r1.js";import{gi as iG,ii as lG,ji as tG,ki as j,ti as eG}from"./chunk-4k2d8w9w.js";import{Bi as C,Ii as S,Ji as s,Ki as e,Li as GG,Mi as JG,Ni as KG,Oi as QG,Pi as XG,Qi as YG,Ri as ZG,Ti as _G,Ui as BG,Vi as HG,Wi as $G,Xi as WG,Yi as T,wi as nG}from"./chunk-s503pcvb.js";import{$i as IJ,Dj as F,Kl as t,Lj as a,aj as d,bj as J,bk as i,cj as Q,dk as l,il as aG,ok as rG,qm as O,tm as K,uk as oG,um as sG,wk as dG}from"./chunk-w9p59ahz.js";import{rn as jJ}from"./chunk-txkmks1h.js";var W=jJ(IJ(),1);var cG=[];function ZK({teamId:$,projectId:y,assetId:U,folders:A,files:q,totalFolders:YJ,totalFiles:ZJ,totalFoldersSize:_J,totalFilesSize:BJ,selectedItem:VG,selectedIds:v,onItemSelect:AG,onItemDoubleClick:qG,onSaveField:HJ,onClearSelection:$J,fetchNextFoldersPage:bG,hasNextFoldersPage:OG,isFetchingNextFoldersPage:P,fetchNextFilesPage:UG,hasNextFilesPage:TG,isFetchingNextFilesPage:w,isRecentlyDeleted:N=!1,isRecents:D=!1,isLoading:LG=!1,isShareView:I=!1,isPublic:EG=!1,shareId:WJ,allowDownload:RG=!0}){let b=nG(),{canEdit:h,canAdmin:MJ}=eG(y),vG=W.useRef(null),kG=W.useRef(null),[f,zJ]=W.useState(!0),[x,VJ]=W.useState(!0),[AJ,u]=W.useState(!1),[p,CG]=W.useState(""),[qJ,c]=W.useState(!1),SG=YJ??A.length,yG=ZJ??q.length,PG=_J??(A.length>0?A.reduce((G,X)=>G+(X.sizeByte||0),0):-1),wG=BJ??(q.length>0?q.reduce((G,X)=>G+(X.sizeByte||0),0):-1),bJ=PG>-1,OJ=wG>-1,NG=(G,X)=>{if(X)return G===1?K.n_assets_singular({count:G}):K.n_assets_plural({count:G});else return G===1?K.n_folders_singular({count:G}):K.n_folders_plural({count:G})},{editingItemId:DG,setEditingItemId:hG,handleAction:uG,onRenameSubmit:pG,isDeleteDialogOpen:UJ,setIsDeleteDialogOpen:TJ,confirmDelete:LJ,isDownloadDialogOpen:EJ,setIsDownloadDialogOpen:n,isLoadingLinks:g,resolvedFiles:gG,startDownload:RJ}=XJ({teamId:$,projectId:y,assetId:U,folders:A,files:q,selectedIds:v,isPublic:EG,shareId:WJ}),{ref:vJ,inView:mG}=GJ();W.default.useEffect(()=>{if(mG){if(OG&&!P)bG();else if(TG&&!w)UG()}},[mG,OG,P,TG,w,bG,UG]);let kJ=L((G)=>G.increment),CJ=L((G)=>G.decrement),SJ=L((G)=>G.startTask),yJ=L((G)=>G.updateFileProgress),PJ=L((G)=>G.completeFile),FG=L((G)=>G.failFile),wJ=S.api.teams[":teamId"].upload.tasks[":taskId"].$patch,{mutateAsync:r}=C({mutationFn:async(G)=>{let X=await wJ(G);if(!X.ok)throw Error("Failed to confirm upload");return await X.json()}}),NJ=async(G,X,_)=>{let M=X?.reduce((B,Y)=>{if(Y.id)B[Y.id]={url:Y.url||"",fileId:Y.fileId||""};return B},{});if(!M)return;let V=5,z=[...G],E=async()=>{while(z.length>0){let B=z.shift();if(B){let Y=M[B.id];if(Y&&Y.url){kJ();try{let Z=new XMLHttpRequest,R=await new Promise((m,fG)=>{Z.open("PUT",Y.url),Z.setRequestHeader("Content-Type",B.file.type),Z.upload.onprogress=(xG)=>{if(xG.lengthComputable)yJ(_,Y.fileId,xG.loaded)},Z.onload=()=>{if(Z.status>=200&&Z.status<300)m({ok:!0,status:Z.status});else m({ok:!1,status:Z.status})},Z.onerror=()=>fG(Error("Network error")),Z.onabort=()=>fG(Error("Upload aborted")),Z.send(B.file)});if(R.ok)PJ(_,Y.fileId),await r({param:{teamId:$,taskId:_},json:{fileId:Y.fileId}});else{FG(_,Y.fileId),T.error(`Failed to upload file: ${B.file.name}`),await r({param:{teamId:$,taskId:_},json:{fileId:Y.fileId,errorMessage:`upload failed with status: ${R.status}`}});return}}catch(Z){FG(_,Y.fileId),T.error(`Failed to upload file: ${B.file.name}`),await r({param:{teamId:$,taskId:_},json:{fileId:Y.fileId,errorMessage:`upload failed with error: ${Z instanceof Error?Z.message:String(Z)}`}});return}finally{CJ(),b.invalidateQueries({queryKey:["search",$,U]})}}}}},H=Array(V).fill(null).map(()=>E());await Promise.all(H)},DJ=S.api.teams[":teamId"].upload.tasks.$post,{mutate:hJ}=C({mutationFn:async(G)=>{let X=await DJ(G);if(!X.ok)throw Error("Failed to create upload task");return await X.json()},onMutate:()=>{return{files:[...cG]}},onSuccess:async(G,X,_)=>{let M=_?.files||[],V=M.map((H)=>{return{fileId:G.presignedUrls?.find((Y)=>Y.id===H.id)?.fileId||H.id,name:H.file.name,size:H.file.size}}).filter((H)=>!!H.fileId),z=M.filter((H)=>!H.file.name.startsWith(".")),E=z.length===1?z[0].file.name:`${z.length} Items`;if(G.taskId)SJ(G.taskId,E,V);b.invalidateQueries({queryKey:["search",$,U]}),b.invalidateQueries({queryKey:["teams",$,"upload","tasks"]}),await NJ(M,G.presignedUrls,G.taskId),b.invalidateQueries({queryKey:["search",$,U]}),b.invalidateQueries({queryKey:["teams",$,"upload","tasks"]})}}),jG=(G)=>{if(!G||G.length===0)return;let X=[],_=[],M=new Map;for(let V of G){let z=(V.webkitRelativePath||V.name).split("/");if(z.some((k)=>k.startsWith(".")))continue;let E=z.pop(),H=_,B="";for(let k of z)if(B=`${B}/${k}`,!M.has(B)){let R=[],m={name:k,type:"folder",id:zG(),children:R,size:0};H.push(m),M.set(B,R),H=R}else H=M.get(B);let Y={file:V,id:zG()};X.push(Y);let Z=V.type;if(E.toLowerCase().endsWith(".wma")&&Z?.startsWith("video/"))Z=Z.replace(/^video\//,"audio/");H.push({name:E,size:V.size,type:"file",id:Y.id,children:[],mediaType:Z})}cG=X,hJ({param:{teamId:$},json:{parentId:U,files:_}})},uJ=S.api.folders.$post,{mutate:pJ,isPending:IG}=C({mutationFn:async(G)=>{let X=await uJ({json:{name:G,parentId:U}});if(!X.ok)throw Error("Failed to create folder");return await X.json()},onSuccess:()=>{T.success(K.new_folder()),u(!1),CG(""),b.invalidateQueries({queryKey:["search",$,U]}),b.invalidateQueries({queryKey:["folders"]})},onError:(G)=>{T.error(`Error: ${G.message}`)}}),{mutate:gJ,isPending:o}=C({mutationFn:async()=>{let G=await S.api.projects[":projectId"]["empty-trash"].$post({param:{projectId:y}});if(!G.ok)throw Error("Failed to empty trash");return await G.json()},onSuccess:()=>{T.success(K.trash_emptied_successfully()),b.invalidateQueries({queryKey:["projects",y,"recently-deleted"]}),$J(),c(!1)},onError:(G)=>{T.error(`Error: ${G.message}`)}}),mJ=(G)=>{if(G.preventDefault(),!p.trim())return;pJ(p.trim())},FJ=!LG&&A.length===0&&q.length===0&&!P&&!w;return Q("div",{className:"flex-1 flex flex-col min-h-0 bg-background overflow-hidden relative",children:[h&&Q(d,{children:[J("input",{type:"file",ref:vG,multiple:!0,className:"hidden",onChange:(G)=>{if(G.target.files)jG(G.target.files)}}),J("input",{type:"file",ref:kG,multiple:!0,webkitdirectory:"true",className:"hidden",onChange:(G)=>{if(G.target.files)jG(G.target.files)}})]}),N&&Q("div",{className:"flex items-center justify-between px-4 py-2.5 bg-muted/20 border-b border-border text-sm shrink-0",children:[Q("div",{className:"flex items-center gap-2 text-muted-foreground",children:[J(a,{className:"h-4 w-4 text-amber-500 shrink-0"}),J("span",{className:"text-xs",children:K.recently_deleted_notice()})]}),MJ&&J(O,{variant:"destructive",size:"sm",disabled:o||A.length===0&&q.length===0,onClick:()=>c(!0),className:"h-7 px-2.5 text-xs font-medium bg-destructive/10 text-destructive border border-destructive/20 hover:bg-destructive hover:text-destructive-foreground",children:"Delete"})]}),Q("div",{className:"flex-1 overflow-y-auto min-h-0 p-3 pb-24",children:[LG&&A.length===0&&q.length===0?J(JJ,{}):Q("div",{className:"max-w-lg mx-auto w-full",children:[SG>0&&Q("div",{className:"mb-4",children:[Q("button",{onClick:()=>zJ(!f),className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground mb-3 font-medium select-none cursor-pointer",children:[f?J(i,{className:"h-4 w-4"}):J(l,{className:"h-4 w-4"}),Q("span",{children:[NG(SG,!1),bJ?` • ${MG(PG)}`:""]})]}),f&&J("div",{className:"grid grid-cols-1 gap-4 w-full",children:A.map((G)=>J(QJ,{item:G,isSelected:VG?.id===G.id,isChecked:v.has(G.id),isEditing:DG===G.id,onSelect:AG,onDoubleClick:qG,onContextMenu:()=>{},onDragStart:()=>{},onDrop:()=>{},onRename:(X)=>pG(G,X),onFinishEditing:()=>hG(null),onAction:(X,_)=>uG(X,_),isRecentlyDeleted:N,isRecents:D,selectedCount:v.size,canEdit:h,isShareView:I,allowDownload:RG},G.id))})]}),yG>0&&Q("div",{className:"mb-4",children:[Q("button",{onClick:()=>VJ(!x),className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground mb-3 font-medium select-none cursor-pointer",children:[x?J(i,{className:"h-4 w-4"}):J(l,{className:"h-4 w-4"}),Q("span",{children:[NG(yG,!0),OJ?` • ${MG(wG)}`:""]})]}),x&&J("div",{className:"grid grid-cols-1 gap-4 w-full",children:q.map((G)=>J(KJ,{teamId:$,item:G,isSelected:VG?.id===G.id,isChecked:v.has(G.id),isEditing:DG===G.id,onSelect:AG,onDoubleClick:qG,onContextMenu:()=>{},onDragStart:()=>{},onDrop:()=>{},onRename:(X)=>pG(G,X),onFinishEditing:()=>hG(null),onSaveField:(X,_)=>HJ?.(G.id,X,_),fields:[],onAction:(X,_)=>uG(X,_),isRecentlyDeleted:N,isRecents:D,selectedCount:v.size,canEdit:h,isShareView:I,allowDownload:RG},G.id))})]})]}),FJ&&J("div",{className:"flex flex-col items-center justify-center h-64 text-sm text-muted-foreground p-6 text-center",children:D?Q("div",{className:"flex flex-col items-center gap-2",children:[J(oG,{className:"h-10 w-10 text-muted-foreground/40 mb-1"}),J("p",{className:"font-medium text-foreground",children:K.no_recent_files()}),J("p",{className:"text-xs text-muted-foreground",children:K.no_recent_files_description()})]}):J("span",{children:K.this_folder_is_empty()})}),J("div",{ref:vJ,className:"py-4 flex justify-center items-center min-h-6",children:(P||w)&&J(F,{className:"h-5 w-5 animate-spin text-muted-foreground"})})]}),h&&!N&&!D&&!I&&!EG&&J("div",{className:"fixed bottom-6 right-6 z-30",children:Q(iG,{modal:!1,children:[J(lG,{asChild:!0,children:J(O,{size:"icon",className:"h-14 w-14 rounded-full bg-primary text-primary-foreground shadow-lg shadow-primary/25 hover:bg-primary/90 flex items-center justify-center","aria-label":"Actions",children:J(aG,{className:"h-6 w-6"})})}),Q(tG,{align:"end",side:"top",className:"w-48 mb-2",children:[Q(j,{onClick:()=>vG.current?.click(),className:"flex items-center gap-2.5 py-2 cursor-pointer",children:[J(t,{className:"h-4 w-4"}),J("span",{children:K.upload_file()})]}),Q(j,{onClick:()=>kG.current?.click(),className:"flex items-center gap-2.5 py-2 cursor-pointer",children:[J(t,{className:"h-4 w-4"}),J("span",{children:K.upload_folder()})]}),Q(j,{onClick:()=>u(!0),className:"flex items-center gap-2.5 py-2 cursor-pointer",children:[J(dG,{className:"h-4 w-4"}),J("span",{children:K.new_folder()})]})]})]})}),J(ZG,{open:AJ,onOpenChange:u,children:J(_G,{className:"sm:max-w-md",children:Q("form",{onSubmit:mJ,children:[Q(BG,{children:[J($G,{children:K.new_folder()}),J(WG,{children:K.folder_name()})]}),J("div",{className:"py-4",children:J(sG,{autoFocus:!0,placeholder:K.folder_name(),value:p,onChange:(G)=>CG(G.target.value)})}),Q(HG,{children:[J(O,{type:"button",variant:"outline",onClick:()=>u(!1),children:K.cancel()}),Q(O,{type:"submit",disabled:!p.trim()||IG,children:[IG?J(F,{className:"h-4 w-4 animate-spin mr-2"}):null,K.confirm()]})]})]})})}),J(s,{open:UJ,onOpenChange:TJ,children:Q(e,{children:[Q(GG,{children:[J(KG,{children:K.delete_asset_title()}),J(QG,{children:K.delete_asset_description()})]}),Q(JG,{children:[J(YG,{children:K.cancel()}),J(XG,{onClick:()=>LJ(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:K.delete()})]})]})}),J(s,{open:qJ,onOpenChange:c,children:Q(e,{children:[Q(GG,{children:[J(KG,{children:K.empty_trash_title()}),J(QG,{children:K.empty_trash_description()})]}),Q(JG,{children:[J(YG,{children:K.cancel()}),J(XG,{onClick:()=>gJ(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",disabled:o,children:o?"Deleting...":K.delete()})]})]})}),J(ZG,{open:EJ,onOpenChange:n,children:Q(_G,{className:"sm:max-w-md",children:[Q(BG,{children:[J($G,{children:g?K.preparing_download():K.confirm_download()}),J(WG,{children:g?K.resolving_files_wait():K.folder_files_download_description()})]}),g?Q("div",{className:"space-y-4 py-6 flex flex-col items-center justify-center",children:[J(F,{className:"h-8 w-8 animate-spin text-primary"}),J("span",{className:"text-sm font-medium text-muted-foreground mt-2",children:K.preparing_download_links()})]}):Q("div",{className:"space-y-4 py-2",children:[J("div",{className:"text-sm text-muted-foreground",children:K.download_includes_files({count:gG.length})}),Q("div",{className:"flex items-start gap-3 p-3 text-sm rounded-lg bg-amber-50 dark:bg-amber-950/30 text-amber-800 dark:text-amber-300 border border-amber-200 dark:border-amber-900/30",children:[J(a,{className:"h-5 w-5 shrink-0 mt-0.5"}),Q("div",{children:[J("p",{className:"font-semibold",children:K.no_folder_structure()}),J("p",{className:"mt-0.5 text-xs text-amber-700/90 dark:text-amber-400/90",children:K.folder_structure_warning()})]})]})]}),J(HG,{children:!g?Q(d,{children:[J(O,{variant:"outline",onClick:()=>n(!1),children:K.cancel()}),Q(O,{onClick:RJ,className:"gap-2",disabled:gG.length===0,children:[J(rG,{className:"h-4 w-4"}),K.start_download()]})]}):J(O,{variant:"outline",onClick:()=>n(!1),children:K.cancel()})})]})})]})}
|
|
2
|
+
export{ZK as s};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Cm as D}from"./chunk-ewge52nq.js";import{Im as B}from"./chunk-7wvw67f3.js";import{Xm as h,Ym as z,Zm as C,_m as b,dn as k}from"./chunk-wxsq9zmf.js";import{en as H}from"./chunk-k20w9eaz.js";import{ln as P}from"./chunk-116p639c.js";function T(U,L){let X={v:1,id:U};if(L)X.phase=L;return JSON.stringify(X)}function x(U){if(!U)return;if(U.startsWith("{"))try{let L=JSON.parse(U);if(L.v===1&&typeof L.id==="string"){if(L.phase==="commentary"||L.phase==="final_answer")return{id:L.id,phase:L.phase};return{id:L.id}}}catch{}return{id:U}}function S(U,L){let X=L.filter((Y)=>Y.type==="text").map((Y)=>Y.text).join(`
|
|
3
3
|
`),F=L.filter((Y)=>Y.type==="image"),$=X.length>0;if(F.length===0||!U.input.includes("image"))return H($?X:F.length>0?"(see attached image)":"(no tool output)");let V=[];if($)V.push({type:"input_text",text:H(X)});for(let Y of F)V.push({type:"input_image",detail:"auto",image_url:`data:${Y.mimeType};base64,${Y.data}`});return V}function p(U,L,X,F){let $=[],V=new Set,Y=(Z)=>{let _=Z.replace(/[^a-zA-Z0-9_-]/g,"_");return(_.length>64?_.slice(0,64):_).replace(/_+$/,"")},O=(Z)=>{let _=`fc_${D(Z)}`;return _.length>64?_.slice(0,64):_},W=(Z,_,q)=>{if(!X.has(U.provider))return Y(Z);if(!Z.includes("|"))return Y(Z);let[j,K]=Z.split("|"),Q=Y(j),N=q.provider!==U.provider||q.api!==U.api?O(K):Y(K);if(!N.startsWith("fc_"))N=Y(`fc_${N}`);return`${Q}|${N}`},G=k(L.messages,U,W);if((F?.includeSystemPrompt??!0)&&L.systemPrompt){let Z=U.compat,_=U.reasoning&&Z?.supportsDeveloperRole!==!1?"developer":"system";$.push({role:_,content:H(L.systemPrompt)})}let w=0;for(let Z of G){if(Z.role==="user")if(typeof Z.content==="string")$.push({role:"user",content:[{type:"input_text",text:H(Z.content)}]});else{let _=Z.content.map((q)=>{if(q.type==="text")return{type:"input_text",text:H(q.text)};return{type:"input_image",detail:"auto",image_url:`data:${q.mimeType};base64,${q.data}`}});if(_.length===0)continue;$.push({role:"user",content:_})}else if(Z.role==="assistant"){let _=[],q=Z,j=q.model!==U.id&&q.provider===U.provider&&q.api===U.api,K=0;for(let Q of Z.content)if(Q.type==="thinking"){if(Q.thinkingSignature){let A=JSON.parse(Q.thinkingSignature);_.push(A)}}else if(Q.type==="text"){let A=Q,N=x(A.textSignature),R=K===0?`msg_pi_${w}`:`msg_pi_${w}_${K}`;K++;let E=N?.id;if(!E)E=R;else if(E.length>64)E=`msg_${D(E)}`;_.push({type:"message",role:"assistant",content:[{type:"output_text",text:H(A.text),annotations:[]}],status:"completed",id:E,phase:N?.phase})}else if(Q.type==="toolCall"){let A=Q,[N,R]=A.id.split("|"),E=F?.grammarToolInputProperties?.get(A.name),J=R;if(j&&J?.startsWith("fc_")||E===void 0&&!J?.startsWith("fc_"))J=void 0;if(E!==void 0)_.push({type:"custom_tool_call",id:J,call_id:N,name:A.name,input:H(h(A.name,A.arguments,E))});else _.push({type:"function_call",id:J,call_id:N,name:A.name,arguments:JSON.stringify(A.arguments)})}if(_.length===0)continue;$.push(..._)}else if(Z.role==="toolResult"){let[_]=Z.toolCallId.split("|"),q=S(U,Z.content);if(F?.grammarToolInputProperties?.has(Z.toolName))$.push({type:"custom_tool_call_output",call_id:_,output:q});else $.push({type:"function_call_output",call_id:_,output:q});let j=[];for(let K of Z.addedToolNames??[]){let Q=F?.deferredTools?.get(K);if(!Q||V.has(K))continue;V.add(K),j.push(Q)}if(j.length>0){let K=j.map((A)=>A.name),Q=`pi_tool_load_${D(`${Z.toolCallId}:${K.join(",")}`)}`;$.push({type:"tool_search_call",call_id:Q,execution:"client",status:"completed",arguments:{query:K.join(" "),limit:K.length}}),$.push({type:"tool_search_output",call_id:Q,execution:"client",status:"completed",tools:v(j,{...F?.toolOptions,deferLoading:!0})})}}w++}return $}function v(U,L){let X=L?.strict===void 0?!1:L.strict,F=L?.supportsStrictMode??!0,$=L?.supportsOpenAIGrammarTools??!1;return U.map((V)=>{let Y=b(V,$);if(Y)return{type:"custom",name:V.name,description:V.description,format:{type:"grammar",syntax:Y.format,definition:Y.definition},...L?.deferLoading?{defer_loading:!0}:{}};let O=C(V,F),W={type:"function",name:V.name,description:V.description,parameters:V.parameters,...L?.deferLoading?{defer_loading:!0}:{}};if(F)W.strict=O??X;return W})}function y(U){let L=U.customInput?.property;if(L===void 0)return"";let X=U.arguments[L];return typeof X==="string"?X:""}function f(U,L,X){let F=U.customInput;if(!F)return;let $=z(F.jsonBuffer,F.property,L,X);return U.arguments={[F.property]:L},$}async function a(U,L,X,F,$){let V=!1,Y=new Map,O=new Map,W=(q,j)=>{let K=Y.get(q);return K?.type===j?K:void 0},G=(q,j)=>{if(j===void 0)return;X.push({type:"toolcall_delta",contentIndex:q.contentIndex,delta:j,partial:L})},M=(q,j)=>{if(j.type==="reasoning"){let K={type:"thinking",thinking:""};L.content.push(K);let Q={type:"thinking",block:K,contentIndex:L.content.length-1};return Y.set(q,Q),X.push({type:"thinking_start",contentIndex:Q.contentIndex,partial:L}),Q}if(j.type==="message"){let K={type:"text",text:""};L.content.push(K);let Q={type:"text",block:K,contentIndex:L.content.length-1};return Y.set(q,Q),X.push({type:"text_start",contentIndex:Q.contentIndex,partial:L}),Q}if(j.type==="function_call"){let K={type:"toolCall",id:`${j.call_id}|${j.id}`,name:j.name,arguments:{},partialJson:j.arguments||""};L.content.push(K);let Q={type:"toolCall",block:K,contentIndex:L.content.length-1};return Y.set(q,Q),X.push({type:"toolcall_start",contentIndex:Q.contentIndex,partial:L}),Q}if(j.type==="custom_tool_call"){let K=$?.grammarToolInputProperties?.get(j.name)??"input",Q=j.input||"",A={type:"toolCall",id:`${j.call_id}|${j.id}`,name:j.name,arguments:{[K]:Q},customInput:{property:K,jsonBuffer:{input:"",started:!1,closed:!1}}};L.content.push(A);let N={type:"toolCall",block:A,contentIndex:L.content.length-1};return Y.set(q,N),X.push({type:"toolcall_start",contentIndex:N.contentIndex,partial:L}),N}return},w=(q,j)=>{return Y.get(q)??M(q,j)},Z=(q)=>{for(let j of q){if(j.type!=="reasoning"||!j.encrypted_content)continue;let K=O.get(j.id);if(!K?.thinkingSignature)continue;let Q=JSON.parse(K.thinkingSignature);if(Q.encrypted_content)continue;K.thinkingSignature=JSON.stringify({...Q,encrypted_content:j.encrypted_content})}},_=(q)=>{if(V=!0,Z(q.output??[]),q?.id)L.responseId=q.id;if(q?.usage){let j=q.usage.input_tokens_details,K=j?.cached_tokens||0,Q=j?.cache_write_tokens||0;L.usage={input:Math.max(0,(q.usage.input_tokens||0)-K-Q),output:q.usage.output_tokens||0,cacheRead:K,cacheWrite:Q,reasoning:q.usage.output_tokens_details?.reasoning_tokens||0,totalTokens:q.usage.total_tokens||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}}}if(P(F,L.usage),$?.applyServiceTierPricing){let j=$.resolveServiceTier?$.resolveServiceTier(q?.service_tier,$.serviceTier):q?.service_tier??$.serviceTier;$.applyServiceTierPricing(L.usage,j)}if(L.stopReason=I(q?.status),L.content.some((j)=>j.type==="toolCall")&&L.stopReason==="stop")L.stopReason="toolUse"};for await(let q of U)if(q.type==="response.created")L.responseId=q.response.id;else if(q.type==="response.output_item.added")M(q.output_index,q.item);else if(q.type==="response.reasoning_summary_text.delta"){let j=W(q.output_index,"thinking");if(!j)continue;j.block.thinking+=q.delta,X.push({type:"thinking_delta",contentIndex:j.contentIndex,delta:q.delta,partial:L})}else if(q.type==="response.reasoning_summary_part.done"){let j=W(q.output_index,"thinking");if(!j)continue;j.block.thinking+=`
|
|
4
4
|
|
|
5
5
|
`,X.push({type:"thinking_delta",contentIndex:j.contentIndex,delta:`
|
|
@@ -9,4 +9,4 @@ import{vm as D}from"./chunk-wzmpvadf.js";import{Bm as B}from"./chunk-9k76s3y6.js
|
|
|
9
9
|
`)||"",A=j.content?.map((N)=>N.text).join(`
|
|
10
10
|
|
|
11
11
|
`)||"";K.block.thinking=Q||A||K.block.thinking,K.block.thinkingSignature=JSON.stringify(j),O.set(j.id,K.block),X.push({type:"thinking_end",contentIndex:K.contentIndex,content:K.block.thinking,partial:L}),Y.delete(q.output_index)}else if(j.type==="message"&&K?.type==="text")K.block.text=j.content?.map((Q)=>Q.type==="output_text"?Q.text:Q.refusal).join("")||"",K.block.textSignature=T(j.id,j.phase??void 0),X.push({type:"text_end",contentIndex:K.contentIndex,content:K.block.text,partial:L}),Y.delete(q.output_index);else if(j.type==="function_call"&&K?.type==="toolCall"&&K.block.partialJson!==void 0)K.block.arguments=B(j.arguments||K.block.partialJson||"{}"),delete K.block.partialJson,X.push({type:"toolcall_end",contentIndex:K.contentIndex,toolCall:K.block,partial:L}),Y.delete(q.output_index);else if(j.type==="custom_tool_call"&&K?.type==="toolCall"&&K.block.customInput)G(K,f(K.block,j.input??y(K.block),!0)),delete K.block.customInput,X.push({type:"toolcall_end",contentIndex:K.contentIndex,toolCall:K.block,partial:L}),Y.delete(q.output_index)}else if(q.type==="response.completed"||q.type==="response.incomplete")_(q.response);else if(q.type==="error")throw Error(`Error Code ${q.code}: ${q.message}`||"Unknown error");else if(q.type==="response.failed"){V=!0;let j=q.response?.error,K=q.response?.incomplete_details,Q=j?`${j.code||"unknown"}: ${j.message||"no message"}`:K?.reason?`incomplete: ${K.reason}`:"Unknown error (no error details in response)";throw Error(Q)}if(!V)throw Error("OpenAI Responses stream ended before a terminal response event")}function I(U){if(!U)return"stop";switch(U){case"completed":return"stop";case"incomplete":return"length";case"failed":case"cancelled":return"error";case"in_progress":case"queued":return"stop";default:throw Error(`Unhandled stop reason: ${U}`)}}
|
|
12
|
-
export{p as
|
|
12
|
+
export{p as ym,v as zm,a as Am};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{cg as k}from"./chunk-ktvmxqfg.js";import{lg as L}from"./chunk-d6d1j7qq.js";import{mg as c}from"./chunk-7g2k89gq.js";import{jh as F}from"./chunk-1vs91e4q.js";import{Ih as u}from"./chunk-rfsbzd39.js";import{Ii as A,Ri as O,Ti as C,Ui as S,Wi as E,Xi as b,zi as v}from"./chunk-s503pcvb.js";import{$i as l,Dl as B,bj as G,cj as J,tm as K}from"./chunk-w9p59ahz.js";import{rn as d}from"./chunk-txkmks1h.js";var y=d(l(),1);var w=(H)=>{return H.replace(/<@([a-zA-Z0-9_-]+)>/g,"@$1").replace(/^\[([^\]]+)\]:/gm,"\\[$1\\]:")};function e({sessionId:H,open:M,onOpenChange:p}){let{data:h,isLoading:g}=v({queryKey:["agent-sessions",H,"entries"],queryFn:async()=>{if(!H)return[];let V=await A.api["agent-sessions"][":sessionId"].entries.$get({param:{sessionId:H}});if(!V.ok)throw Error("Failed to fetch session logs");return await V.json()},enabled:M&&!!H});return G(O,{open:M,onOpenChange:p,children:J(C,{className:"sm:max-w-2xl max-h-[80vh] flex flex-col p-6 overflow-hidden bg-background/95 backdrop-blur-md border border-foreground/15 shadow-2xl",children:[J(S,{className:"pb-4 border-b border-foreground/15",children:[J(E,{className:"flex items-center gap-2 text-xl font-bold",children:[G(B,{className:"w-5 h-5 text-violet-500"}),K.agent_session_logs()]}),G(b,{children:K.agent_logs_description()})]}),G("div",{className:"flex-1 overflow-y-auto pr-1 py-4 space-y-4 min-h-0 select-text",children:g?J("div",{className:"space-y-4",children:[J("div",{className:"flex gap-4",children:[G(F,{className:"h-5 w-5 rounded-full shrink-0"}),J("div",{className:"flex-1 space-y-2",children:[G(F,{className:"h-4 w-1/4"}),G(F,{className:"h-20 w-full"})]})]}),J("div",{className:"flex gap-4",children:[G(F,{className:"h-5 w-5 rounded-full shrink-0"}),J("div",{className:"flex-1 space-y-2",children:[G(F,{className:"h-4 w-1/4"}),G(F,{className:"h-12 w-full"})]})]})]}):h&&h.length>0?G("div",{className:"flex flex-col",children:h.map((V)=>{let W=V.entry,f=W?.timestamp||V.timestamp,X="";if(typeof f==="string"||typeof f==="number"){let P=new Date(f);if(!isNaN(P.getTime()))X=u(P.toISOString())}if(W&&typeof W==="object"){if(W.type==="custom_message"){if(W.customType==="context")return null;if(W.customType==="shumai_message"){let P=k(W.details),q=typeof W.content==="string"?W.content:"",z=P?`${q}
|
|
2
|
+
|
|
3
|
+
${P}`.trim():q,N="bg-primary/10 text-primary",D=K.role_user();return J("div",{className:"relative pl-6 pb-6 last:pb-0",children:[G("div",{className:"absolute left-[9px] top-2 bottom-0 w-0.5 bg-foreground/10 last:hidden"}),G("div",{className:"absolute left-0 top-1.5 h-5 w-5 rounded-full border-4 border-background flex items-center justify-center bg-primary"}),J("div",{className:"flex flex-col gap-1.5 bg-muted/30 dark:bg-muted/10 p-3 rounded-lg border border-foreground/5 backdrop-blur-xs w-full",children:[J("div",{className:"flex items-center justify-between gap-2",children:[J("div",{className:"flex items-center gap-2 flex-wrap",children:[G("span",{className:"text-[10px] px-2 py-0.5 rounded-full font-semibold uppercase tracking-wider bg-primary/10 text-primary",children:D}),J("span",{className:"text-[10px] font-mono text-muted-foreground bg-muted/50 px-1.5 py-0.5 rounded border border-foreground/10 select-all",title:K.entry_id(),children:[K.entry_id(),": ",V.id]})]}),G("span",{className:"text-[10px] text-muted-foreground/60 shrink-0",children:X})]}),G("div",{className:"text-xs text-foreground/90 whitespace-pre-wrap leading-relaxed font-sans",children:z})]})]},V.id)}}if(W.type==="message"&&W.message){let P=W.message,q="bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200",z=String(P.role||"");if(P.role==="user")q="bg-primary/10 text-primary",z=K.role_user();else if(P.role==="assistant")q="bg-violet-100 text-violet-800 dark:bg-violet-900/30 dark:text-violet-300",z=K.role_agent();else if(P.role==="toolResult")q=P.isError?"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300":"bg-emerald-100 text-emerald-800 dark:bg-emerald-900/30 dark:text-emerald-300",z=K.tool_result_with_name({name:String(P.toolName||K.unknown())});else if(P.role==="thought")q="bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-300",z=K.role_thinking();let N=(Y)=>{let U=Y;if(typeof Y==="string")try{U=JSON.parse(Y)}catch{}if(U&&typeof U==="object"&&!Array.isArray(U))return G("div",{className:"mt-1 space-y-1.5 pt-3",children:Object.entries(U).map(([Z,_])=>{let Q=_&&typeof _==="object"?JSON.stringify(_,null,2):String(_);return J("div",{className:"text-xs leading-relaxed break-words",children:[J("span",{className:"font-semibold text-violet-600 dark:text-violet-400",children:[Z,":"]})," ",G("span",{className:"text-foreground/90 font-mono whitespace-pre-wrap",children:Q})]},Z)})});return G("div",{className:"text-xs font-mono whitespace-pre-wrap",children:String(Y)})},D=()=>{let Y=P.content;if(!Y)return null;if(typeof Y==="string"){if(!Y.trim())return null;return G("div",{className:"text-xs text-foreground/80 dark:text-foreground/95 leading-relaxed prose prose-sm dark:prose-invert max-w-none break-words",children:G(L,{children:w(Y)})})}if(Array.isArray(Y)){let U=[];if(Y.forEach(($,Z)=>{if(!$)return;if(typeof $==="string"){if(!$.trim())return;U.push(G("div",{className:"text-xs text-foreground/80 dark:text-foreground/95 leading-relaxed prose prose-sm dark:prose-invert max-w-none break-words",children:G(L,{children:w($)})},`str-${Z}`));return}if(typeof $==="object"){let _=$,Q=_.type;if(Q==="text"){let R=_.text;if(typeof R!=="string"||!R.trim())return;U.push(G("div",{className:"text-xs text-foreground/80 dark:text-foreground/95 leading-relaxed prose prose-sm dark:prose-invert max-w-none break-words",children:G(L,{children:w(R)})},`txt-${Z}`));return}if(Q==="toolCall"){let R=String(_.name||_.toolName||K.unknown()),I=_.arguments||_.args;U.push(J("div",{className:"text-xs space-y-2 py-1",children:[J("div",{className:"font-semibold text-violet-600 dark:text-violet-400 flex items-center gap-1.5",children:[K.calling_tool()," ",G("span",{className:"font-mono bg-violet-500/10 px-1 py-0.5 rounded text-[11px]",children:R})]}),!!I&&J("div",{className:"space-y-1 pt-3",children:[G("div",{className:"text-[10px] text-muted-foreground/60 uppercase font-bold tracking-wider",children:K.tool_arguments()}),N(I)]})]},`tool-${Z}`));return}if(Q==="image"){U.push(G("div",{className:"text-xs text-muted-foreground italic flex items-center gap-1.5 py-1",children:K.image_object()},`img-${Z}`));return}let T=JSON.stringify($,null,2);if(T==="{}")return;U.push(G("pre",{className:"text-xs text-foreground/80 font-mono whitespace-pre-wrap break-words bg-muted/20 p-2 rounded",children:T},`other-${Z}`))}}),U.length===0)return null;return G("div",{className:"space-y-3 w-full",children:U.map(($,Z)=>J(y.default.Fragment,{children:[Z>0&&G(c,{className:"my-3 opacity-50"}),$]},Z))})}return null};return J("div",{className:"relative pl-6 pb-6 last:pb-0",children:[G("div",{className:"absolute left-[9px] top-2 bottom-0 w-0.5 bg-foreground/10 last:hidden"}),G("div",{className:`absolute left-0 top-1.5 h-5 w-5 rounded-full border-4 border-background flex items-center justify-center ${P.role==="user"?"bg-primary":P.role==="assistant"?"bg-violet-500":P.role==="toolResult"?P.isError?"bg-red-500":"bg-emerald-500":"bg-amber-500"}`}),J("div",{className:"flex flex-col gap-1.5 bg-muted/30 dark:bg-muted/10 p-3 rounded-lg border border-foreground/5 backdrop-blur-xs w-full",children:[J("div",{className:"flex items-center justify-between gap-2",children:[J("div",{className:"flex items-center gap-2 flex-wrap",children:[G("span",{className:`text-[10px] px-2 py-0.5 rounded-full font-semibold uppercase tracking-wider ${q}`,children:z}),J("span",{className:"text-[10px] font-mono text-muted-foreground bg-muted/50 px-1.5 py-0.5 rounded border border-foreground/10 select-all",title:K.entry_id(),children:[K.entry_id(),": ",V.id]})]}),G("span",{className:"text-[10px] text-muted-foreground/60 shrink-0",children:X})]}),D()]})]},V.id)}}return J("div",{className:"relative pl-6 pb-6 last:pb-0",children:[G("div",{className:"absolute left-[9px] top-2 bottom-0 w-0.5 bg-foreground/10 last:hidden"}),G("div",{className:"absolute left-0 top-1.5 h-5 w-5 rounded-full border-4 border-background bg-gray-400"}),J("div",{className:"bg-muted/30 p-3 rounded-lg border border-foreground/5",children:[J("div",{className:"flex items-center justify-between gap-2 mb-1.5 flex-wrap",children:[J("span",{className:"text-[10px] font-mono text-muted-foreground bg-muted/50 px-1.5 py-0.5 rounded border border-foreground/10 select-all",title:"Entry ID",children:["ID: ",V.id]}),G("div",{className:"text-[10px] text-muted-foreground/60",children:X})]}),G("pre",{className:"text-xs text-foreground/80 font-mono whitespace-pre-wrap break-words",children:JSON.stringify(V.entry,null,2)})]})]},V.id)})}):J("div",{className:"flex flex-col items-center justify-center py-12 text-center text-muted-foreground",children:[G(B,{className:"w-8 h-8 text-muted-foreground/40 mb-2 animate-pulse"}),G("p",{className:"text-sm font-medium",children:K.no_logs_found()}),G("p",{className:"text-xs text-muted-foreground/60 mt-1",children:K.session_no_entries_yet()})]})})]})})}
|
|
4
|
+
export{e as _};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{$ as O2,aa as F0}from"./chunk-4b7jcpgv.js";import{xf as w0,yf as U2,zf as y2}from"./chunk-mhps85dd.js";import{Ef as y0,Ff as r0,Gf as x0,Hf as h0,If as L0,Kf as T0}from"./chunk-ns804tmv.js";import{Mf as o,Nf as u,Of as j,Tf as h,Uf as t}from"./chunk-2xevs82j.js";import{Lg as w2,Mg as T2,Ng as C2,Wg as R2}from"./chunk-7x1vkftb.js";import{Hh as l0,Ih as r,Sh as K0,Xh as O0}from"./chunk-9cmvymm5.js";import{Yh as S0}from"./chunk-6m1k317a.js";import{$h as b0,Zh as Q0,_h as q0}from"./chunk-kxr8fjsq.js";import{ai as F2,ci as V2,di as S2,ei as m2}from"./chunk-02afmyqy.js";import{Ci as $0,Li as k2,Mi as K2,Ni as J2,Oi as Z2,Qi as X2,Ri as Y2,Si as H0,qi as H2,vi as E0,xi as D0}from"./chunk-8nyve0cr.js";import{Ui as Z0}from"./chunk-62ebss6h.js";import{Aj as v0,Dj as Q2,Gl as v2,Hl as c2,Lk as G2,Ll as _0,Mj as $2,Pl as B0,Qj as c0,Tj as q2,Vi as I,Vj as m0,Wj as X0,Xi as P,Xj as j0,Yi as J,Yj as n0,bl as k0,ck as i0,dm as A0,jm as x,kl as Y0,ml as M2,mm as G,nm as G0,qj as f0,sl as W0,tk as b2,uk as B2,ul as A2,xl as g2,zl as W2}from"./chunk-kqpzx5az.js";import{kn as E}from"./chunk-p49h5fxs.js";function l2(N){let $=N.lastIndexOf(".");if($>0)return[0,$];return[0,N.length]}function z5(N){N.focus();let[$,k]=l2(N.value);if(typeof N.setSelectionRange==="function")N.setSelectionRange($,k);else N.select()}var i=D0((N)=>({fields:[],loadedProjectId:null,setFields:($,k)=>N({fields:$,loadedProjectId:k}),updateFields:($)=>N({fields:$})}));function o0(N,$){let{start:k,end:K}=x0($?.in,N),X=+k>+K,M=X?+k:+K,z=X?K:k;z.setHours(0,0,0,0);let Y=$?.step??1;if(!Y)return[];if(Y<0)Y=-Y,X=!X;let H=[];while(+z<=M)H.push(l0(k,z)),z.setDate(z.getDate()+Y),z.setHours(0,0,0,0);return X?H.reverse():H}function g0(N,$){return r(N,$?.in).getDate()}function u0(N,$){return r(N,$?.in).getDay()}function R0(N,$){return r(N,$?.in).getHours()}function U0(N,$){return r(N,$?.in).getMinutes()}var a=E(I(),1);var x2=({value:N,config:$,onSave:k,readOnly:K})=>{let X=$?.date,[M,z]=a.useState(!1),Y=a.useRef(null),H=N?new Date(N):new Date,Q=K0(H)?H:new Date,[q,b]=a.useState(Q);a.useEffect(()=>{if(M&&N){let g=new Date(N);if(K0(g))b(g)}},[M,N]),a.useEffect(()=>{let g=(_)=>{if(Y.current&&!Y.current.contains(_.target)){if(M)z(!1)}};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[M]);let v=()=>{if(!K)z(!0)},S=(g)=>{if(!g)return"";let _=new Date(g);if(!K0(_))return"Invalid Date";let c="PPP";if(X?.displayFormat==="usa")c="MM/dd/yyyy";else if(X?.displayFormat==="euro")c="dd/MM/yyyy";else if(X?.displayFormat==="iso")c="yyyy-MM-dd";if(X?.includeTime)if(X?.timeFormat==="twenty_four_hour")c+=" HH:mm";else c+=" p";let C=O0(_,c);if(X?.displayTimezone)C+=` (${Intl.DateTimeFormat().resolvedOptions().timeZone})`;return C},Z=new Date(q.getFullYear(),q.getMonth(),1),F=r0(q),w=o0({start:Z,end:F}),y=u0(Z),A=(g)=>{let _=new Date(g);if(X?.includeTime)_.setHours(R0(Q)),_.setMinutes(U0(Q));let c=_.toISOString();if(k(c),!X?.includeTime)z(!1)},T=(g,_)=>{let c=N?new Date(N):new Date;if(!K0(c))c.setTime(new Date().getTime());if(g==="hour")c.setHours(_);if(g==="minute")c.setMinutes(_);let C=c.toISOString();k(C)},W=Array.from({length:24},(g,_)=>_),O=Array.from({length:12},(g,_)=>_*5);if(M)return J("div",{className:"relative w-full",ref:Y,children:[P("div",{className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm shadow-sm min-h-[28px] flex items-center",children:N?S(N):P("span",{className:"text-muted-foreground",children:"Select date..."})}),J("div",{className:"absolute z-50 top-full left-0 mt-1 bg-popover border border-border rounded-lg shadow-xl flex flex-col md:flex-row overflow-hidden min-w-[280px]",children:[J("div",{className:"p-4 w-64",children:[J("div",{className:"flex justify-between items-center mb-4",children:[P("button",{onClick:()=>b(y0(q,-1)),className:"p-1 hover:bg-accent rounded",children:P(j0,{className:"w-4 h-4"})}),P("span",{className:"font-semibold text-sm",children:O0(q,"MMMM yyyy")}),P("button",{onClick:()=>b(y0(q,1)),className:"p-1 hover:bg-accent rounded",children:P(n0,{className:"w-4 h-4"})})]}),P("div",{className:"grid grid-cols-7 gap-1 text-center text-xs mb-2 text-muted-foreground",children:["Su","Mo","Tu","We","Th","Fr","Sa"].map((g)=>P("div",{children:g},g))}),J("div",{className:"grid grid-cols-7 gap-1 text-center text-sm",children:[Array.from({length:y}).map((g,_)=>P("div",{},`empty-${_}`)),w.map((g)=>{let _=N?new Date(N):null,c=_&&K0(_)&&g0(_)===g0(g)&&h0(_)===h0(g)&&L0(_)===L0(g);return P("button",{onClick:()=>A(g),className:`w-8 h-8 rounded-full flex items-center justify-center hover:bg-accent transition-colors ${c?"bg-primary text-primary-foreground hover:bg-primary/90":"text-foreground"}`,children:g0(g)},g.toString())})]})]}),X?.includeTime&&J("div",{className:"border-l border-border bg-muted w-32 flex flex-col",children:[J("div",{className:"p-2 border-b border-border text-xs font-semibold text-muted-foreground flex items-center justify-center gap-1",children:[P(i0,{className:"w-3 h-3"})," Time"]}),J("div",{className:"flex flex-1 h-64",children:[P("div",{className:"flex-1 overflow-y-auto scrollbar-hide border-r border-border",children:W.map((g)=>P("div",{onClick:()=>T("hour",g),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${R0(Q)===g?"bg-primary/10 font-medium text-primary":""}`,children:g.toString().padStart(2,"0")},g))}),P("div",{className:"flex-1 overflow-y-auto scrollbar-hide",children:O.map((g)=>P("div",{onClick:()=>T("minute",g),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${U0(Q)===g?"bg-primary/10 font-medium text-primary":""}`,children:g.toString().padStart(2,"0")},g))})]})]})]})]});return P("div",{onClick:v,className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded border border-transparent transition-colors ${!K?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:N?S(N):P("span",{className:"text-muted-foreground italic",children:"Empty"})})},a0=x2;var l=E(I(),1);var o2=({value:N,onSave:$,readOnly:k})=>{let[K,X]=l.useState(!1),[M,z]=l.useState(N||""),Y=l.useRef(null),H=l.useRef(null),[Q,q]=l.useState(!1);l.useEffect(()=>{z(N||"")},[N]),l.useEffect(()=>{if(K&&Y.current)Y.current.focus(),q(!1)},[K]),l.useEffect(()=>{let Z=(F)=>{if(Q&&H.current&&!H.current.contains(F.target))q(!1)};if(Q)document.addEventListener("mousedown",Z);return()=>{document.removeEventListener("mousedown",Z)}},[Q]);let b=()=>{X(!1),$(M)},v=(Z)=>{Z.stopPropagation(),q(!0)},S=(Z)=>{if(Z.stopPropagation(),!k)X(!0)};if(K)return P("textarea",{ref:Y,value:M,onChange:(Z)=>z(Z.target.value),onBlur:b,className:"w-full min-h-[80px] p-2 border border-ring rounded bg-background text-sm outline-none shadow-sm resize-none"});return J("div",{ref:H,className:"relative w-full text-sm",children:[P("div",{onClick:v,className:`w-full text-foreground rounded border border-transparent transition-all px-2 py-1 h-[48px] line-clamp-2 whitespace-pre-wrap overflow-hidden ${!k?"cursor-pointer hover:bg-accent hover:border-border":"cursor-pointer"}`,title:"Click to expand",children:N?N:P("span",{className:"text-muted-foreground italic",children:"Empty"})}),Q&&P("div",{onClick:S,className:`absolute top-0 left-0 w-full min-h-full h-auto z-50 bg-background border border-ring rounded shadow-lg px-2 py-1 whitespace-pre-wrap ${!k?"cursor-text":""}`,children:N?N:P("span",{className:"text-muted-foreground italic",children:"Empty"})})]})},d0=o2;var d=E(I(),1);var u2=({value:N,config:$,onSave:k,readOnly:K})=>{let X=$?.number,[M,z]=d.useState(!1),[Y,H]=d.useState(""),Q=d.useRef(null);d.useEffect(()=>{H(N!==void 0&&N!==null?N.toString():"")},[N]),d.useEffect(()=>{if(M&&Q.current)Q.current.focus()},[M]);let q=()=>{if(!K)z(!0)},b=()=>{if(z(!1),Y==="")k(void 0);else{let Z=parseFloat(Y);k(isNaN(Z)?void 0:Z)}},v=(Z)=>{if(Z.key==="Enter")Z.stopPropagation(),Q.current?.blur()},S=(Z)=>{if(Z===void 0||Z===null||isNaN(Z))return"";return Z.toFixed(X?.scale)};if(M)return P("input",{ref:Q,type:"number",step:1/Math.pow(10,X?.scale||0),value:Y,onChange:(Z)=>H(Z.target.value),onBlur:b,onKeyDown:v,onDoubleClick:(Z)=>Z.stopPropagation(),className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm outline-none shadow-sm text-left font-mono"});return P("div",{onClick:q,onDoubleClick:(Z)=>Z.stopPropagation(),className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded border border-transparent transition-colors text-left font-mono ${!K?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:N!==void 0&&N!==null?S(N):P("span",{className:"text-muted-foreground italic font-sans text-left block",children:"Empty"})})},t0=u2;var s0=E(I(),1);var j2=({value:N,config:$,onSave:k,readOnly:K})=>{let X=$?.rating,M=Math.max(2,Math.min(6,X?.maxValue||5)),[z,Y]=s0.useState(null),H=(q,b)=>{if(q.stopPropagation(),K)return;let v;if(N===b)v=0;else v=b;k(v)},Q=Array.from({length:M},(q,b)=>b+1);return P("div",{className:"flex items-center gap-1 h-[28px]",onMouseLeave:()=>!K&&Y(null),onDoubleClick:(q)=>q.stopPropagation(),children:Q.map((q)=>{let b=z!==null?q<=z:q<=(N||0);return P("button",{onClick:(v)=>H(v,q),onMouseEnter:()=>!K&&Y(q),className:`focus:outline-none transition-transform ${!K?"cursor-pointer hover:scale-110":"cursor-default"}`,type:"button",disabled:K,children:P(W0,{className:`w-5 h-5 transition-colors ${b?"fill-yellow-400 text-yellow-400":"fill-muted text-muted-foreground/30"}`})},q)})})},e0=j2;var p0=E(I(),1);var P0;(function(N){N.Base32IncorrectEncoding="B32_ENC_INVALID",N.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",N.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",N.EncodeTimeNegative="ENC_TIME_NEG",N.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",N.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",N.PRNGDetectFailure="PRNG_DETECT",N.ULIDInvalid="ULID_INVALID",N.Unexpected="UNEXPECTED",N.UUIDInvalid="UUID_INVALID"})(P0||(P0={}));class J0 extends Error{constructor(N,$){super(`${$} (${N})`);this.name="ULIDError",this.code=N}}function n2(N){let $=Math.floor(N()*32)%32;return"0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt($)}function i2(N){let $=r2(),k=$&&($.crypto||$.msCrypto)||null;if(typeof k?.getRandomValues==="function")return()=>{let K=new Uint8Array(1);return k.getRandomValues(K),K[0]/256};else if(typeof k?.randomBytes==="function")return()=>k.randomBytes(1).readUInt8()/256;throw new J0(P0.PRNGDetectFailure,"Failed to find a reliable PRNG")}function r2(){if(t2())return self;if(typeof window<"u")return window;if(typeof global<"u")return global;if(typeof globalThis<"u")return globalThis;return null}function a2(N,$){let k="";for(;N>0;N--)k=n2($)+k;return k}function d2(N,$=10){if(isNaN(N))throw new J0(P0.EncodeTimeValueMalformed,`Time must be a number: ${N}`);else if(N>281474976710655)throw new J0(P0.EncodeTimeSizeExceeded,`Cannot encode a time larger than 281474976710655: ${N}`);else if(N<0)throw new J0(P0.EncodeTimeNegative,`Time must be positive: ${N}`);else if(Number.isInteger(N)===!1)throw new J0(P0.EncodeTimeValueMalformed,`Time must be an integer: ${N}`);let k,K="";for(let X=$;X>0;X--)k=N%32,K="0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(k)+K,N=(N-k)/32;return K}function t2(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function N2(N,$){let k=$||i2(),K=!N||isNaN(N)?Date.now():N;return d2(K,10)+a2(16,k)}function s2(N,$,k){let K=N.slice();return K.splice(k,0,K.splice($,1)[0]),K}function P2(N,$,k,K){if(k===K)return N;let X=s2($,k,K),M=new Set($.map((Y)=>Y.id)),z=0;return N.map((Y)=>M.has(Y.id)?X[z++]:Y)}async function l5(N){let $=[],k=[],K=N.items;if(K)for(let z=0;z<K.length;z++){let Y=K[z];if(Y.kind==="file"){let H=Y.webkitGetAsEntry?.();if(H)k.push({entry:H,path:""})}}else return Array.from(N.files);let X=(z)=>{return new Promise((Y)=>{z.readEntries((H)=>Y(H),()=>Y([]))})},M=(z)=>{return new Promise((Y,H)=>{z.file((Q)=>Y(Q),(Q)=>H(Q))})};while(k.length>0){let z=k.shift();if(!z)continue;let{entry:Y,path:H}=z;if(Y.isFile)try{let Q=await M(Y),q=H?`${H}/${Q.name}`:Q.name;Object.defineProperty(Q,"webkitRelativePath",{value:q,writable:!1,configurable:!0}),$.push(Q)}catch(Q){console.error("Error reading file entry:",Q)}else if(Y.isDirectory){let Q=Y.createReader(),q=[],b=await X(Q);while(b.length>0)q=q.concat(b),b=await X(Q);let v=H?`${H}/${Y.name}`:Y.name;for(let S of q)k.push({entry:S,path:v})}}return $}var p=E(I(),1);var _2=E(I(),1);function z2(){let[N,$]=_2.useState(!1);return J(k2,{open:N,onOpenChange:$,children:[P(K2,{asChild:!0,children:J(x,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-transparent text-muted-foreground hover:text-foreground inline-flex items-center justify-center shrink-0 ml-1",title:G.autofill_source_help_title(),children:[P(f0,{className:"h-3.5 w-3.5"}),P("span",{className:"sr-only",children:G.autofill_source_help_title()})]})}),J(J2,{className:"sm:max-w-[500px]",children:[J(Z2,{children:[J(X2,{className:"flex items-center gap-2",children:[P(f0,{className:"h-5 w-5 text-muted-foreground"}),G.autofill_source_help_title()]}),P(Y2,{children:G.autofill_source_help_desc()})]}),J("div",{className:"space-y-4 py-2",children:[J("div",{className:"rounded-lg border p-3.5 space-y-1.5 bg-muted/30",children:[J("div",{className:"flex items-center gap-2 font-medium text-sm",children:[P($2,{className:"h-4 w-4 text-muted-foreground shrink-0"}),P("span",{children:G.autofill_source_none()})]}),P("p",{className:"text-xs text-muted-foreground leading-relaxed",children:G.autofill_source_none_desc()}),P("p",{className:"text-xs italic text-muted-foreground/80",children:G.autofill_source_none_example()})]}),J("div",{className:"rounded-lg border p-3.5 space-y-1.5 bg-muted/30",children:[J("div",{className:"flex items-center gap-2 font-medium text-sm",children:[P(v0,{className:"h-4 w-4 text-amber-500 shrink-0"}),P("span",{children:G.autofill_source_content()})]}),P("p",{className:"text-xs text-muted-foreground leading-relaxed",children:G.autofill_source_content_desc()}),P("p",{className:"text-xs italic text-muted-foreground/80",children:G.autofill_source_content_example()})]}),J("div",{className:"rounded-lg border p-3.5 space-y-1.5 bg-muted/30",children:[J("div",{className:"flex items-center gap-2 font-medium text-sm",children:[P(c0,{className:"h-4 w-4 text-blue-500 shrink-0"}),P("span",{children:G.autofill_source_creation_context()})]}),P("p",{className:"text-xs text-muted-foreground leading-relaxed",children:G.autofill_source_creation_context_desc()}),P("p",{className:"text-xs italic text-muted-foreground/80",children:G.autofill_source_creation_context_example()})]})]})]})]})}var V0=["red","orange","yellow","green","blue","purple","gray"],I0={red:{bg:"rgba(239, 68, 68, 0.15)",text:"#ef4444",hex:"#ef4444"},orange:{bg:"rgba(249, 115, 22, 0.15)",text:"#f97316",hex:"#f97316"},yellow:{bg:"rgba(234, 179, 8, 0.15)",text:"#ca8a04",hex:"#eab308"},green:{bg:"rgba(34, 197, 94, 0.15)",text:"#16a34a",hex:"#22c55e"},blue:{bg:"rgba(59, 130, 246, 0.15)",text:"#2563eb",hex:"#3b82f6"},purple:{bg:"rgba(168, 85, 247, 0.15)",text:"#9333ea",hex:"#a855f7"},gray:{bg:"rgba(128, 128, 128, 0.15)",text:"#4b5563",hex:"#808080"},system:{bg:"rgba(128, 128, 128, 0.1)",text:"#6b7280",hex:"#808080"}};function z0(N){if(!N)return{backgroundColor:"rgba(128, 128, 128, 0.1)",color:"#6b7280"};let $=N.toLowerCase(),k=I0[$];if(k)return{backgroundColor:k.bg,color:k.text};if(N.startsWith("#"))return{backgroundColor:`${N}33`,color:N};return{backgroundColor:"rgba(128, 128, 128, 0.1)",color:N}}function M0(N=[]){let $=new Set(N.map((K)=>K.color?.toLowerCase()).filter(Boolean)),k=V0.filter((K)=>!$.has(K.toLowerCase()));if(k.length>0)return k[Math.floor(Math.random()*k.length)];return V0[Math.floor(Math.random()*V0.length)]}var e2={[h.text]:W2,[h.longText]:Q2,[h.select]:G2,[h.selectMulti]:A2,[h.rating]:W0,[h.number]:B2,[h.toggle]:g2,[h.date]:q2,[h.user]:v2,[h.userMulti]:c2};function N5({field:N,index:$,onVisibilityChange:k}){let{ref:K,handleRef:X}=y2({id:N.id,index:$}),M=N.config?.type?e2[N.config.type]:null;return J("div",{ref:K,className:"flex items-center justify-between p-2 rounded-md hover:bg-muted",children:[J("div",{className:"flex items-center gap-2",children:[P("div",{ref:X,className:"cursor-grab",children:P(b2,{className:"h-4 w-4 text-muted-foreground"})}),M&&P(M,{className:"h-4 w-4 text-muted-foreground shrink-0"}),N.config?.autofillSource===t.CONTENT&&P(v0,{className:"h-4 w-4 text-muted-foreground shrink-0"}),N.config?.autofillSource===t.CREATION_CONTEXT&&P(c0,{className:"h-4 w-4 text-muted-foreground shrink-0"}),P("span",{className:"text-sm truncate",children:N.config?.name})]}),P(S0,{checked:N.visible,onCheckedChange:(z)=>k(N.id,z)})]})}function b1({projectId:N,onManageFields:$,onSave:k}){let{fields:K,updateFields:X}=i(),[M,z]=p.useState(""),[Y,H]=p.useState("list"),[Q,q]=p.useState(""),[b,v]=p.useState(""),[S,Z]=p.useState(t.NONE),[F,w]=p.useState(""),[y,A]=p.useState([]),T=H2();p.useEffect(()=>{T.invalidateQueries({queryKey:["fields",N]})},[N,T]);let W=$0.api.projects[":projectId"].fields.order.$patch,{mutate:O}=E0({mutationFn:async(B)=>{if(!(await W(B)).ok)throw Error(G.failed_update_fields_order());return null}}),g=$0.api.projects[":projectId"].fields.$post,{mutate:_}=E0({mutationFn:async(B)=>{let m=await g(B);if(!m.ok)throw Error(G.failed_create_field());return await m.json()},onSuccess:(B)=>{let m={...B,visible:!0},U=[...K,m];X(U),q(""),A([]),O({param:{projectId:N},json:U.map((V)=>({fieldId:V.id,visible:V.visible||!1}))}),k?.()}}),c=p.useMemo(()=>K.filter((B)=>B.config?.name?.toLowerCase().includes(M.toLowerCase())),[K,M]),C=(B)=>{if(B.canceled)return;let{source:m}=B.operation;if(!U2(m))return;let{initialIndex:U,index:V}=m;if(U===V)return;let D=P2(K,c,U,V);X(D),O({param:{projectId:N},json:D.map((N0)=>({fieldId:N0.id,visible:N0.visible||!1}))})},L=(B,m)=>{let U=K.map((V)=>V.id===B?{...V,visible:m}:V);X(U),O({param:{projectId:N},json:U.map((V)=>({fieldId:V.id,visible:V.visible||!1}))})},R=()=>{if(!Q||!b)return;let B=b===h.select?{select:{options:y}}:b===h.selectMulti?{selectMulti:{options:y}}:{};_({param:{projectId:N},json:{config:{name:Q,type:b,autofillSource:S,...B},label:Q,description:F}})},f=K.filter((B)=>B.visible).length;if(Y==="create")return P("div",{className:"w-80 p-4",children:J("div",{className:"space-y-4",children:[J("div",{className:"space-y-2",children:[P(Z0,{htmlFor:"field-name",children:G.field_name()}),P(G0,{id:"field-name",placeholder:G.new_field_placeholder(),value:Q,onChange:(B)=>q(B.target.value),autoFocus:!0})]}),J("div",{className:"space-y-2",children:[P(Z0,{children:G.field_type()}),J(F2,{children:[P(V2,{asChild:!0,children:J(x,{variant:"outline",className:"w-full justify-between font-normal",children:[b?P("span",{className:"capitalize",children:b.replace(/_/g," ")}):P("span",{className:"text-muted-foreground border-dashed",children:G.select_field_type()}),P(X0,{className:"ml-2 h-4 w-4 opacity-50"})]})}),P(S2,{className:"w-[--radix-dropdown-menu-trigger-width]",children:Object.values(h).map((B)=>P(m2,{onClick:()=>{v(B),A([])},className:"capitalize",children:B.replace(/_/g," ")},B))})]})]}),J("div",{className:"space-y-2",children:[P(Z0,{htmlFor:"field-desc",children:G.description()}),P(G0,{id:"field-desc",placeholder:G.description_optional_placeholder(),value:F,onChange:(B)=>w(B.target.value)})]}),J("div",{className:"space-y-2",children:[J("div",{className:"flex items-center gap-1",children:[P(Z0,{children:G.autofill_source()}),P(z2,{})]}),J(O2,{type:"single",value:S,onValueChange:(B)=>{if(B)Z(B)},className:"w-full grid grid-cols-3 border rounded-md p-1 gap-1",children:[P(F0,{value:t.NONE,className:"text-[11px] leading-tight py-1 px-1 h-auto min-h-[32px] w-full text-center justify-center whitespace-normal font-medium",children:G.autofill_source_none()}),P(F0,{value:t.CONTENT,className:"text-[11px] leading-tight py-1 px-1 h-auto min-h-[32px] w-full text-center justify-center whitespace-normal font-medium",children:G.autofill_source_content()}),P(F0,{value:t.CREATION_CONTEXT,className:"text-[11px] leading-tight py-1 px-1 h-auto min-h-[32px] w-full text-center justify-center whitespace-normal font-medium",children:G.autofill_source_creation_context()})]})]}),(b===h.select||b===h.selectMulti)&&J("div",{className:"space-y-2",children:[J("div",{className:"flex items-center justify-between",children:[P(Z0,{className:"text-sm font-medium",children:G.options()}),J(x,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>{let B={id:N2(),displayName:G.new_option(),color:M0(y)};A([...y,B])},children:[P(k0,{className:"h-4 w-4 mr-1"})," ",G.add_option()]})]}),P("div",{className:"space-y-2 max-h-40 overflow-y-auto pr-1",children:y.map((B,m)=>J("div",{className:"flex items-center gap-2",children:[P(G0,{value:B.displayName,onChange:(U)=>{let V=[...y];V[m]={...B,displayName:U.target.value},A(V)},placeholder:G.option_name_placeholder(),className:"h-8 flex-1"}),J(o,{children:[P(u,{asChild:!0,children:P("button",{type:"button",className:"w-6 h-6 rounded-full border shrink-0 cursor-pointer focus:outline-none hover:scale-105 transition-transform",style:{backgroundColor:I0[B.color||""]?.hex||B.color||"#808080"}})}),P(j,{className:"p-2 w-auto",align:"end",children:P("div",{className:"flex gap-1",children:V0.map((U)=>P("button",{type:"button",className:"w-5 h-5 rounded-full border cursor-pointer hover:scale-110 transition-transform",style:{backgroundColor:I0[U]?.hex||U},onClick:()=>{let V=[...y];V[m]={...B,color:U},A(V)}},U))})})]}),P(x,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>{A(y.filter((U,V)=>V!==m))},children:P(_0,{className:"h-4 w-4"})})]},B.id))})]}),J("div",{className:"flex gap-2 pt-2",children:[P(x,{variant:"secondary",className:"flex-1",onClick:()=>{H("list"),q(""),v(""),Z(t.NONE),w(""),A([])},children:G.cancel()}),P(x,{className:"flex-1",onClick:R,disabled:!Q||!b,children:G.save()})]})]})});return J("div",{className:"w-80 p-4",children:[P("div",{className:"flex items-center justify-between mb-4",children:J("h3",{className:"font-semibold",children:[G.fields()," ",P("span",{className:"text-muted-foreground text-sm font-normal",children:G.visible_count({count:f})})]})}),J("div",{className:"relative mb-4",children:[P(Y0,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),P(G0,{placeholder:G.search_fields_placeholder(),value:M,onChange:(B)=>z(B.target.value),className:"pl-8"})]}),P("div",{className:"max-h-60 overflow-y-auto pr-2",children:P(R2,{sensors:[C2.configure({activationConstraints:[new T2.Distance({value:8})]}),w2],onDragEnd:C,children:c.map((B,m)=>P(N5,{field:B,index:m,onVisibilityChange:L},B.id))})}),$&&J("div",{className:"mt-4 space-y-2",children:[J(x,{variant:"secondary",className:"w-full",onClick:$,children:[P(M2,{className:"h-4 w-4 mr-2"}),G.manage_fields()]}),J(x,{className:"w-full",onClick:()=>H("create"),children:[P(k0,{className:"h-4 w-4 mr-2"}),G.new_field()]})]})]})}var P5=({value:N,config:$,onSave:k,readOnly:K,fieldId:X})=>{let M=$?.select,z=M?.options||[],[Y,H]=p0.useState(!1),[Q,q]=p0.useState(""),b=z.find((W)=>W.id===N),v=Q.trim(),S=z.filter((W)=>W.displayName.toLowerCase().includes(v.toLowerCase())),Z=z.some((W)=>W.displayName.trim().toLowerCase()===v.toLowerCase()||W.id.toLowerCase()===v.toLowerCase()),F=()=>{if(!K)H(!0)},w=(W)=>{k(W),H(!1),q("")},y=(W)=>{if(K)return;if(H(W),!W)q("")},A=async()=>{if(!v)return;let W={id:v.toLowerCase().replace(/\s+/g,"-"),displayName:v,color:M0(z)},O=[...z,W],g={...$,select:{...M,options:O}};if(X)try{let _=await $0.api.fields[":fieldId"].$put({param:{fieldId:X},json:{config:g}});if(!_.ok){H0.error(G.failed_update_field());return}let c=await _.json(),L=i.getState().fields.map((R)=>R.id===c.id?{...R,...c,visible:R.visible}:R);i.getState().updateFields(L)}catch{H0.error(G.failed_update_field());return}k(W.id),q(""),H(!1)};return P("div",{className:"relative w-full",onClick:(W)=>W.stopPropagation(),children:J(o,{open:!K&&Y,onOpenChange:y,children:[P(u,{asChild:!0,children:J("div",{onClick:F,className:`flex items-center justify-between w-full h-[28px] px-2 rounded border border-transparent transition-colors ${!K?"cursor-pointer hover:bg-accent hover:border-border group":""}`,children:[((W)=>{if(!W)return P("span",{className:"text-muted-foreground italic text-sm",children:"Select an option"});return P("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium h-[22px]",style:z0(W.color),children:W.displayName})})(b),!K&&P(X0,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),J(j,{side:"bottom",align:"start",sideOffset:4,className:"p-1.5 w-64 max-h-72 flex flex-col bg-popover border border-border rounded-lg shadow-lg",children:[J("div",{className:"relative pb-1.5 border-b border-border mb-1",onClick:(W)=>W.stopPropagation(),children:[P(Y0,{className:"w-3.5 h-3.5 absolute left-2 top-2 text-muted-foreground"}),P("input",{type:"text",className:"w-full pl-7 pr-2 py-1 text-xs bg-muted/50 border border-input rounded-md focus:outline-none focus:ring-1 focus:ring-ring text-foreground",placeholder:G.search_options_placeholder(),value:Q,onChange:(W)=>q(W.target.value),autoFocus:!0})]}),J("div",{className:"overflow-y-auto max-h-48 min-h-[120px] space-y-0.5",children:[Q===""&&J("div",{onClick:()=>w(""),className:"px-2.5 py-1.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded cursor-pointer flex items-center gap-2",children:[P(_0,{className:"w-3.5 h-3.5"})," Clear"]}),S.map((W)=>P("div",{onClick:()=>w(W.id),className:`px-2.5 py-1.5 text-xs hover:bg-accent rounded cursor-pointer flex items-center justify-between ${N===W.id?"bg-accent/50 font-medium":""}`,children:P("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:z0(W.color),children:W.displayName})},W.id)),S.length===0&&!v&&P("div",{className:"px-2.5 py-2 text-xs text-muted-foreground italic text-center",children:G.no_options_found()}),v!==""&&!Z&&J("div",{onClick:A,className:"px-2.5 py-1.5 text-xs text-primary hover:bg-accent rounded cursor-pointer flex items-center gap-1.5 font-medium border-t border-border mt-1 pt-1.5",children:[P(k0,{className:"w-3.5 h-3.5 shrink-0"}),P("span",{className:"truncate",children:G.add_option_with_name({name:v})})]})]})]})]})})},h2=P5;var s=E(I(),1);var $5=({value:N=[],config:$,onSave:k,readOnly:K,fieldId:X})=>{let M=$?.selectMulti,z=M?.options||[],Y=s.useRef(null),[H,Q]=s.useState(!1),[q,b]=s.useState(N.length),[v,S]=s.useState(""),Z=z.filter((_)=>(N||[]).includes(_.id))||[],F=v.trim(),w=z.filter((_)=>_.displayName.toLowerCase().includes(F.toLowerCase())),y=z.some((_)=>_.displayName.trim().toLowerCase()===F.toLowerCase()||_.id.toLowerCase()===F.toLowerCase());s.useLayoutEffect(()=>{if(H){b(Z.length);return}if(Y.current){let _=Y.current.clientWidth-8,C=document.createElement("canvas").getContext("2d");if(C&&_>0){C.font="500 12px ui-sans-serif, system-ui, sans-serif";let L=4,R=Z.map((D)=>Math.ceil(C.measureText(D.displayName).width)+18);if(R.reduce((D,N0)=>D+N0,0)+Math.max(0,R.length-1)*L<=_){b(Z.length);return}let m=_-32-L,U=0,V=0;for(let D=0;D<R.length;D++){let N0=V>0?U+L+R[D]:R[D];if(N0>m)break;U=N0,V++}b(V)}}},[Z,H,N]);let A=(_)=>{let c=N||[],C;if(c.includes(_))C=c.filter((L)=>L!==_);else C=[...c,_];k(C)},T=async()=>{if(!F)return;let _={id:F.toLowerCase().replace(/\s+/g,"-"),displayName:F,color:M0(z)},c=[...z,_],C={...$,selectMulti:{...M,options:c}};if(X)try{let L=await $0.api.fields[":fieldId"].$put({param:{fieldId:X},json:{config:C}});if(!L.ok){H0.error(G.failed_update_field());return}let R=await L.json(),B=i.getState().fields.map((m)=>m.id===R.id?{...m,...R,visible:m.visible}:m);i.getState().updateFields(B)}catch{H0.error(G.failed_update_field());return}k([...N||[],_.id]),S("")},W=(_)=>{if(_.stopPropagation(),!K)Q(!0)},O=Z.length-q;return P("div",{className:"relative w-full",onClick:(_)=>_.stopPropagation(),children:J(o,{open:!K&&H,onOpenChange:(_)=>{if(K)return;if(Q(_),!_)S("")},children:[P(u,{asChild:!0,children:J("div",{ref:Y,onClick:W,className:`w-full px-1 py-1 flex flex-wrap gap-1 rounded border border-transparent transition-all box-border h-[32px] overflow-hidden ${!K||O>0?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:[Z.length===0&&P("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),Z.slice(0,q).map((_)=>P("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium border border-transparent whitespace-nowrap h-[22px]",style:z0(_.color),children:_.displayName},_.id)),O>0&&J("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-muted text-muted-foreground h-[22px]",children:["+",O]})]})}),J(j,{side:"bottom",align:"start",sideOffset:4,className:"p-1.5 w-64 max-h-72 flex flex-col bg-popover border border-border rounded-lg shadow-lg",children:[J("div",{className:"relative pb-1.5 border-b border-border mb-1",onClick:(_)=>_.stopPropagation(),children:[P(Y0,{className:"w-3.5 h-3.5 absolute left-2 top-2 text-muted-foreground"}),P("input",{type:"text",className:"w-full pl-7 pr-2 py-1 text-xs bg-muted/50 border border-input rounded-md focus:outline-none focus:ring-1 focus:ring-ring text-foreground",placeholder:G.search_options_placeholder(),value:v,onChange:(_)=>S(_.target.value),autoFocus:!0})]}),J("div",{className:"overflow-y-auto max-h-48 min-h-[120px] space-y-0.5",children:[w.map((_)=>{let c=(N||[]).includes(_.id);return J("div",{onClick:()=>A(_.id),className:`px-2.5 py-1.5 hover:bg-accent rounded cursor-pointer flex items-center justify-between text-xs ${c?"bg-accent/30 font-medium":""}`,children:[P("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:z0(_.color),children:_.displayName}),c&&P(m0,{className:"w-3.5 h-3.5 text-primary"})]},_.id)}),w.length===0&&!F&&P("div",{className:"px-2.5 py-2 text-xs text-muted-foreground italic text-center",children:G.no_options_found()}),F!==""&&!y&&J("div",{onClick:T,className:"px-2.5 py-1.5 text-xs text-primary hover:bg-accent rounded cursor-pointer flex items-center gap-1.5 font-medium border-t border-border mt-1 pt-1.5",children:[P(k0,{className:"w-3.5 h-3.5 shrink-0"}),P("span",{className:"truncate",children:G.add_option_with_name({name:F})})]})]})]})]})})},L2=$5;var e=E(I(),1);var k5=({value:N,onSave:$,readOnly:k})=>{let[K,X]=e.useState(!1),[M,z]=e.useState(N||""),Y=e.useRef(null);e.useEffect(()=>{z(N||"")},[N]),e.useEffect(()=>{if(K&&Y.current)Y.current.focus()},[K]);let H=()=>{if(!k)X(!0)},Q=()=>{X(!1),$(M)},q=(b)=>{if(b.key==="Enter")Y.current?.blur()};if(K)return P("input",{ref:Y,type:"text",value:M,onChange:(b)=>z(b.target.value),onBlur:Q,onKeyDown:q,className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm outline-none shadow-sm"});return P("div",{onClick:H,className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded truncate border border-transparent transition-colors ${!k?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:N||P("span",{className:"text-muted-foreground italic",children:"Empty"})})},f2=k5;var K5=({value:N,onSave:$,readOnly:k})=>{return P("div",{className:"flex items-center h-[28px] w-full",onClick:(X)=>X.stopPropagation(),children:P(S0,{checked:N,onCheckedChange:(X)=>{if(!k)$(X)},disabled:k,className:"cursor-pointer"})})},E2=K5;var C0=E(I(),1);var J5=({value:N,onSave:$,readOnly:k})=>{let K=w0(),{members:X,fetchMembers:M}=T0(),[z,Y]=C0.useState(!1);C0.useEffect(()=>{if(K)M(K)},[K,M]);let H=X.find((Z)=>Z.id===N),Q=()=>{if(!k)Y(!0)},q=(Z)=>{$(Z),Y(!1)},b=(Z)=>{if(k)return;Y(Z)},v=(Z)=>{return Z.split(" ").map((F)=>F[0]).slice(0,2).join("").toUpperCase()};return P("div",{className:"relative w-full",onClick:(Z)=>Z.stopPropagation(),children:J(o,{open:!k&&z,onOpenChange:b,children:[P(u,{asChild:!0,children:J("div",{onClick:Q,className:`flex items-center justify-between w-full h-[28px] px-2 rounded border border-transparent transition-colors ${!k?"cursor-pointer hover:bg-accent hover:border-border group":""}`,children:[((Z)=>{if(!Z)return P("span",{className:"text-muted-foreground italic text-sm",children:"Select user"});return J("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-muted text-foreground border h-[22px]",children:[J(Q0,{className:"w-4 h-4",children:[P(q0,{src:Z.image,alt:Z.name,className:"object-cover"}),P(b0,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:v(Z.name)})]}),P("span",{className:"truncate max-w-[120px]",children:Z.name})]})})(H),!k&&P(X0,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),J(j,{className:"p-1 w-[--radix-popover-trigger-width] min-w-[200px] max-h-60 overflow-auto bg-popover border border-border rounded-lg shadow-lg",align:"start",children:[J("div",{onClick:()=>q(""),className:"px-3 py-2 text-sm text-muted-foreground hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[P(_0,{className:"w-3 h-3"})," Clear"]}),X.map((Z)=>J("div",{onClick:()=>q(Z.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[J(Q0,{className:"w-5 h-5",children:[P(q0,{src:Z.image,alt:Z.name,className:"object-cover"}),P(b0,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:v(Z.name)})]}),P("span",{className:"text-sm font-medium text-foreground",children:Z.name})]},Z.id))]})]})})},I2=J5;var n=E(I(),1);var Z5=({value:N=[],onSave:$,readOnly:k})=>{let K=w0(),{members:X,fetchMembers:M}=T0(),z=n.useRef(null),[Y,H]=n.useState(!1),[Q,q]=n.useState(N.length);n.useEffect(()=>{if(K)M(K)},[K,M]);let b=X.filter((A)=>(N||[]).includes(A.id)),v=(A)=>{return A.split(" ").map((T)=>T[0]).slice(0,2).join("").toUpperCase()};n.useLayoutEffect(()=>{if(Y){q(b.length);return}if(z.current){let A=z.current.clientWidth-8,W=document.createElement("canvas").getContext("2d");if(W&&A>0){W.font="500 12px ui-sans-serif, system-ui, sans-serif";let O=4,g=b.map((f)=>{return Math.min(100,Math.ceil(W.measureText(f.name).width))+40});if(g.reduce((f,B)=>f+B,0)+Math.max(0,g.length-1)*O<=A){q(b.length);return}let C=A-32-O,L=0,R=0;for(let f=0;f<g.length;f++){let B=R>0?L+O+g[f]:g[f];if(B>C)break;L=B,R++}q(R)}}},[b,Y,N]);let S=(A)=>{let T=N||[],W;if(T.includes(A))W=T.filter((O)=>O!==A);else W=[...T,A];$(W)},Z=(A)=>{if(A.stopPropagation(),!k)H(!0)},F=b.length-Q,w=(A)=>{if(k)return;H(A)},y=(A)=>{return J("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-muted text-foreground border whitespace-nowrap h-[22px]",children:[J(Q0,{className:"w-4 h-4",children:[P(q0,{src:A.image,alt:A.name,className:"object-cover"}),P(b0,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:v(A.name)})]}),P("span",{className:"truncate max-w-[100px]",children:A.name})]},A.id)};return P("div",{className:"relative w-full",onClick:(A)=>A.stopPropagation(),children:J(o,{open:!k&&Y,onOpenChange:w,children:[P(u,{asChild:!0,children:J("div",{ref:z,onClick:Z,className:`w-full px-1 py-1 flex flex-wrap gap-1 rounded border border-transparent transition-all box-border h-[32px] overflow-hidden ${!k||F>0?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:[b.length===0&&P("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),b.slice(0,Q).map(y),F>0&&J("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-muted text-muted-foreground h-[22px]",children:["+",F]})]})}),P(j,{className:"p-1 w-[--radix-popover-trigger-width] min-w-[200px] max-h-60 overflow-auto bg-popover border border-border rounded-lg shadow-lg",align:"start",children:X.map((A)=>{let T=(N||[]).includes(A.id);return J("div",{onClick:()=>S(A.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center justify-between rounded-sm",children:[J("div",{className:"flex items-center gap-2",children:[J(Q0,{className:"w-5 h-5",children:[P(q0,{src:A.image,alt:A.name,className:"object-cover"}),P(b0,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:v(A.name)})]}),P("span",{className:"text-sm font-medium text-foreground",children:A.name})]}),T&&P(m0,{className:"w-4 h-4 text-primary"})]},A.id)})})]})})},p2=Z5;var X5=(N)=>{if(!N.config)return P("div",{children:"Unknown Field Type"});switch(N.config.type){case"text":return P(f2,{...N,value:N.value,onSave:N.onSave});case"longText":return P(d0,{...N,value:N.value,onSave:N.onSave});case"select":return P(h2,{...N,value:N.value,onSave:N.onSave});case"selectMulti":return P(L2,{...N,value:N.value,onSave:N.onSave});case"rating":return P(e0,{...N,value:N.value,onSave:N.onSave});case"number":return P(t0,{...N,value:N.value,onSave:N.onSave});case"toggle":return P(E2,{...N,value:N.value,onSave:N.onSave});case"date":return P(a0,{...N,value:N.value,onSave:N.onSave});case"user":return P(I2,{...N,value:N.value,onSave:N.onSave});case"userMulti":return P(p2,{...N,value:N.value,onSave:N.onSave});default:return P("div",{children:"Unknown Field Type"})}},GN=X5;var gN=({progress:N,className:$})=>{let K=2*Math.PI*20,X=K-Math.min(100,Math.max(0,N))/100*K;return J("svg",{viewBox:"0 0 50 50",className:B0("w-12 h-12",$),children:[P("circle",{cx:"25",cy:"25",r:20,className:"stroke-muted",strokeWidth:"4",fill:"transparent"}),P("circle",{cx:"25",cy:"25",r:20,className:"stroke-primary transition-all duration-300 ease-out",strokeWidth:"4",fill:"transparent",strokeDasharray:K,strokeDashoffset:X,transform:"rotate(-90 25 25)"}),P("text",{x:"50%",y:"50%",textAnchor:"middle",dy:".3em",className:"fill-foreground text-[10px] font-bold",children:`${Math.round(N)}%`})]})};var Y5=(N)=>{if(isNaN(N))return"00:00";let $=new Date(N*1000),k=$.getUTCHours(),K=$.getUTCMinutes().toString().padStart(2,"0"),X=$.getUTCSeconds().toString().padStart(2,"0");if(k)return`${k}:${K}:${X}`;return`${K}:${X}`},cN=(N,$,k,K)=>{if(k==="frames")return`${N} fr`;if(k==="standard")return Y5(N/$);let X=Math.round($),M=$!==X,z=!1;if(M&&(X===30||X===60))z=!0;let Y=0;if(K){let Z=K.match(/^([012]\d):(\d\d):(\d\d)(:|;|\.)(\d+)$/);if(Z){let F=parseInt(Z[1],10),w=parseInt(Z[2],10),y=parseInt(Z[3],10),A=parseInt(Z[5],10);if(z=Z[4]!==":",Y=(F*3600+w*60+y)*X+A,z){let T=F*60+w,W=$<30?2:4;Y-=W*(T-Math.floor(T/10))}}}let H=N+Y;if(z){let Z=$<30?2:4,F=Math.floor(H/(17982*Z/2)),w=H%(17982*Z/2);if(w<Z)w=w+Z;H+=9*Z*F+Z*Math.floor((w-Z)/(1798*Z/2))}let Q=H%X,q=Math.floor(H/X)%60,b=Math.floor(H/(X*60))%60,v=Math.floor(H/(X*3600))%24,S=z?";":":";return`${v.toString().padStart(2,"0")}:${b.toString().padStart(2,"0")}:${q.toString().padStart(2,"0")}${S}${Q.toString().padStart(2,"0")}`};var FN=(N,$)=>{if(!$)return 0;let k=1/$;return N*k+k/2},_5=(N)=>Math.max(100,3000/(N||30)),VN=({dbTotalFrames:N,containerDuration:$,frameRate:k})=>{let K=k||30,X=Math.round($*K);if(N<=0)return X;let M=N/K,z=$-M,Y=_5(K)/1000;return z>Y?X:N};var D2=E(I(),1);function TN({className:N,defaultValue:$,value:k,min:K=0,max:X=100,...M}){let z=D2.useMemo(()=>Array.isArray(k)?k:Array.isArray($)?$:[K,X],[k,$,K,X]);return J(A0.Root,{"data-slot":"slider",defaultValue:$,value:k,min:K,max:X,className:B0("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",N),...M,children:[P(A0.Track,{"data-slot":"slider-track",className:B0("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:P(A0.Range,{"data-slot":"slider-range",className:B0("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:z.length},(Y,H)=>P(A0.Thumb,{"data-slot":"slider-thumb",className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},H))]})}
|
|
1
|
+
import{$ as O2,aa as F0}from"./chunk-srs9jq8f.js";import{wf as w0,xf as U2,yf as y2}from"./chunk-f4d3v0nc.js";import{Ff as y0,Gf as r0,Hf as x0,If as h0,Jf as L0,Lf as T0}from"./chunk-2q7ew7yz.js";import{Nf as o,Of as u,Pf as j,Uf as h,Vf as t}from"./chunk-ktvmxqfg.js";import{Rg as w2,Sg as T2,Tg as C2,ah as R2}from"./chunk-785kxysj.js";import{Nh as l0,Oh as r,Yh as K0,bi as O0}from"./chunk-2sc2jxd3.js";import{ci as S0}from"./chunk-f32kxe6c.js";import{di as Q0,ei as q0,fi as b0}from"./chunk-2f35h4fn.js";import{gi as F2,ii as V2,ji as S2,ki as m2}from"./chunk-4k2d8w9w.js";import{Bi as E0,Di as D0,Ii as $0,Ri as k2,Si as K2,Ti as J2,Ui as Z2,Wi as X2,Xi as Y2,Yi as H0,wi as H2}from"./chunk-s503pcvb.js";import{_i as Z0}from"./chunk-axb1f1ae.js";import{$i as I,Ak as b2,Bk as B2,Bl as A2,El as g2,Gl as W2,Hj as v0,Kj as Q2,Nl as v2,Ol as c2,Sk as G2,Sl as _0,Tj as $2,Wl as B0,Xj as c0,_j as q2,ak as m0,bj as P,bk as X0,cj as J,ck as j0,dk as n0,il as k0,jk as i0,km as A0,qm as x,rl as Y0,tl as M2,tm as G,um as G0,wj as f0,zl as W0}from"./chunk-w9p59ahz.js";import{rn as E}from"./chunk-txkmks1h.js";function l2(N){let $=N.lastIndexOf(".");if($>0)return[0,$];return[0,N.length]}function z5(N){N.focus();let[$,k]=l2(N.value);if(typeof N.setSelectionRange==="function")N.setSelectionRange($,k);else N.select()}var i=D0((N)=>({fields:[],loadedProjectId:null,setFields:($,k)=>N({fields:$,loadedProjectId:k}),updateFields:($)=>N({fields:$})}));function o0(N,$){let{start:k,end:K}=x0($?.in,N),X=+k>+K,M=X?+k:+K,z=X?K:k;z.setHours(0,0,0,0);let Y=$?.step??1;if(!Y)return[];if(Y<0)Y=-Y,X=!X;let H=[];while(+z<=M)H.push(l0(k,z)),z.setDate(z.getDate()+Y),z.setHours(0,0,0,0);return X?H.reverse():H}function g0(N,$){return r(N,$?.in).getDate()}function u0(N,$){return r(N,$?.in).getDay()}function R0(N,$){return r(N,$?.in).getHours()}function U0(N,$){return r(N,$?.in).getMinutes()}var a=E(I(),1);var x2=({value:N,config:$,onSave:k,readOnly:K})=>{let X=$?.date,[M,z]=a.useState(!1),Y=a.useRef(null),H=N?new Date(N):new Date,Q=K0(H)?H:new Date,[q,b]=a.useState(Q);a.useEffect(()=>{if(M&&N){let g=new Date(N);if(K0(g))b(g)}},[M,N]),a.useEffect(()=>{let g=(_)=>{if(Y.current&&!Y.current.contains(_.target)){if(M)z(!1)}};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[M]);let v=()=>{if(!K)z(!0)},S=(g)=>{if(!g)return"";let _=new Date(g);if(!K0(_))return"Invalid Date";let c="PPP";if(X?.displayFormat==="usa")c="MM/dd/yyyy";else if(X?.displayFormat==="euro")c="dd/MM/yyyy";else if(X?.displayFormat==="iso")c="yyyy-MM-dd";if(X?.includeTime)if(X?.timeFormat==="twenty_four_hour")c+=" HH:mm";else c+=" p";let C=O0(_,c);if(X?.displayTimezone)C+=` (${Intl.DateTimeFormat().resolvedOptions().timeZone})`;return C},Z=new Date(q.getFullYear(),q.getMonth(),1),F=r0(q),w=o0({start:Z,end:F}),y=u0(Z),A=(g)=>{let _=new Date(g);if(X?.includeTime)_.setHours(R0(Q)),_.setMinutes(U0(Q));let c=_.toISOString();if(k(c),!X?.includeTime)z(!1)},T=(g,_)=>{let c=N?new Date(N):new Date;if(!K0(c))c.setTime(new Date().getTime());if(g==="hour")c.setHours(_);if(g==="minute")c.setMinutes(_);let C=c.toISOString();k(C)},W=Array.from({length:24},(g,_)=>_),O=Array.from({length:12},(g,_)=>_*5);if(M)return J("div",{className:"relative w-full",ref:Y,children:[P("div",{className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm shadow-sm min-h-[28px] flex items-center",children:N?S(N):P("span",{className:"text-muted-foreground",children:"Select date..."})}),J("div",{className:"absolute z-50 top-full left-0 mt-1 bg-popover border border-border rounded-lg shadow-xl flex flex-col md:flex-row overflow-hidden min-w-[280px]",children:[J("div",{className:"p-4 w-64",children:[J("div",{className:"flex justify-between items-center mb-4",children:[P("button",{onClick:()=>b(y0(q,-1)),className:"p-1 hover:bg-accent rounded",children:P(j0,{className:"w-4 h-4"})}),P("span",{className:"font-semibold text-sm",children:O0(q,"MMMM yyyy")}),P("button",{onClick:()=>b(y0(q,1)),className:"p-1 hover:bg-accent rounded",children:P(n0,{className:"w-4 h-4"})})]}),P("div",{className:"grid grid-cols-7 gap-1 text-center text-xs mb-2 text-muted-foreground",children:["Su","Mo","Tu","We","Th","Fr","Sa"].map((g)=>P("div",{children:g},g))}),J("div",{className:"grid grid-cols-7 gap-1 text-center text-sm",children:[Array.from({length:y}).map((g,_)=>P("div",{},`empty-${_}`)),w.map((g)=>{let _=N?new Date(N):null,c=_&&K0(_)&&g0(_)===g0(g)&&h0(_)===h0(g)&&L0(_)===L0(g);return P("button",{onClick:()=>A(g),className:`w-8 h-8 rounded-full flex items-center justify-center hover:bg-accent transition-colors ${c?"bg-primary text-primary-foreground hover:bg-primary/90":"text-foreground"}`,children:g0(g)},g.toString())})]})]}),X?.includeTime&&J("div",{className:"border-l border-border bg-muted w-32 flex flex-col",children:[J("div",{className:"p-2 border-b border-border text-xs font-semibold text-muted-foreground flex items-center justify-center gap-1",children:[P(i0,{className:"w-3 h-3"})," Time"]}),J("div",{className:"flex flex-1 h-64",children:[P("div",{className:"flex-1 overflow-y-auto scrollbar-hide border-r border-border",children:W.map((g)=>P("div",{onClick:()=>T("hour",g),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${R0(Q)===g?"bg-primary/10 font-medium text-primary":""}`,children:g.toString().padStart(2,"0")},g))}),P("div",{className:"flex-1 overflow-y-auto scrollbar-hide",children:O.map((g)=>P("div",{onClick:()=>T("minute",g),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${U0(Q)===g?"bg-primary/10 font-medium text-primary":""}`,children:g.toString().padStart(2,"0")},g))})]})]})]})]});return P("div",{onClick:v,className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded border border-transparent transition-colors ${!K?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:N?S(N):P("span",{className:"text-muted-foreground italic",children:"Empty"})})},a0=x2;var l=E(I(),1);var o2=({value:N,onSave:$,readOnly:k})=>{let[K,X]=l.useState(!1),[M,z]=l.useState(N||""),Y=l.useRef(null),H=l.useRef(null),[Q,q]=l.useState(!1);l.useEffect(()=>{z(N||"")},[N]),l.useEffect(()=>{if(K&&Y.current)Y.current.focus(),q(!1)},[K]),l.useEffect(()=>{let Z=(F)=>{if(Q&&H.current&&!H.current.contains(F.target))q(!1)};if(Q)document.addEventListener("mousedown",Z);return()=>{document.removeEventListener("mousedown",Z)}},[Q]);let b=()=>{X(!1),$(M)},v=(Z)=>{Z.stopPropagation(),q(!0)},S=(Z)=>{if(Z.stopPropagation(),!k)X(!0)};if(K)return P("textarea",{ref:Y,value:M,onChange:(Z)=>z(Z.target.value),onBlur:b,className:"w-full min-h-[80px] p-2 border border-ring rounded bg-background text-sm outline-none shadow-sm resize-none"});return J("div",{ref:H,className:"relative w-full text-sm",children:[P("div",{onClick:v,className:`w-full text-foreground rounded border border-transparent transition-all px-2 py-1 h-[48px] line-clamp-2 whitespace-pre-wrap overflow-hidden ${!k?"cursor-pointer hover:bg-accent hover:border-border":"cursor-pointer"}`,title:"Click to expand",children:N?N:P("span",{className:"text-muted-foreground italic",children:"Empty"})}),Q&&P("div",{onClick:S,className:`absolute top-0 left-0 w-full min-h-full h-auto z-50 bg-background border border-ring rounded shadow-lg px-2 py-1 whitespace-pre-wrap ${!k?"cursor-text":""}`,children:N?N:P("span",{className:"text-muted-foreground italic",children:"Empty"})})]})},d0=o2;var d=E(I(),1);var u2=({value:N,config:$,onSave:k,readOnly:K})=>{let X=$?.number,[M,z]=d.useState(!1),[Y,H]=d.useState(""),Q=d.useRef(null);d.useEffect(()=>{H(N!==void 0&&N!==null?N.toString():"")},[N]),d.useEffect(()=>{if(M&&Q.current)Q.current.focus()},[M]);let q=()=>{if(!K)z(!0)},b=()=>{if(z(!1),Y==="")k(void 0);else{let Z=parseFloat(Y);k(isNaN(Z)?void 0:Z)}},v=(Z)=>{if(Z.key==="Enter")Z.stopPropagation(),Q.current?.blur()},S=(Z)=>{if(Z===void 0||Z===null||isNaN(Z))return"";return Z.toFixed(X?.scale)};if(M)return P("input",{ref:Q,type:"number",step:1/Math.pow(10,X?.scale||0),value:Y,onChange:(Z)=>H(Z.target.value),onBlur:b,onKeyDown:v,onDoubleClick:(Z)=>Z.stopPropagation(),className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm outline-none shadow-sm text-left font-mono"});return P("div",{onClick:q,onDoubleClick:(Z)=>Z.stopPropagation(),className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded border border-transparent transition-colors text-left font-mono ${!K?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:N!==void 0&&N!==null?S(N):P("span",{className:"text-muted-foreground italic font-sans text-left block",children:"Empty"})})},t0=u2;var s0=E(I(),1);var j2=({value:N,config:$,onSave:k,readOnly:K})=>{let X=$?.rating,M=Math.max(2,Math.min(6,X?.maxValue||5)),[z,Y]=s0.useState(null),H=(q,b)=>{if(q.stopPropagation(),K)return;let v;if(N===b)v=0;else v=b;k(v)},Q=Array.from({length:M},(q,b)=>b+1);return P("div",{className:"flex items-center gap-1 h-[28px]",onMouseLeave:()=>!K&&Y(null),onDoubleClick:(q)=>q.stopPropagation(),children:Q.map((q)=>{let b=z!==null?q<=z:q<=(N||0);return P("button",{onClick:(v)=>H(v,q),onMouseEnter:()=>!K&&Y(q),className:`focus:outline-none transition-transform ${!K?"cursor-pointer hover:scale-110":"cursor-default"}`,type:"button",disabled:K,children:P(W0,{className:`w-5 h-5 transition-colors ${b?"fill-yellow-400 text-yellow-400":"fill-muted text-muted-foreground/30"}`})},q)})})},e0=j2;var p0=E(I(),1);var P0;(function(N){N.Base32IncorrectEncoding="B32_ENC_INVALID",N.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",N.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",N.EncodeTimeNegative="ENC_TIME_NEG",N.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",N.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",N.PRNGDetectFailure="PRNG_DETECT",N.ULIDInvalid="ULID_INVALID",N.Unexpected="UNEXPECTED",N.UUIDInvalid="UUID_INVALID"})(P0||(P0={}));class J0 extends Error{constructor(N,$){super(`${$} (${N})`);this.name="ULIDError",this.code=N}}function n2(N){let $=Math.floor(N()*32)%32;return"0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt($)}function i2(N){let $=r2(),k=$&&($.crypto||$.msCrypto)||null;if(typeof k?.getRandomValues==="function")return()=>{let K=new Uint8Array(1);return k.getRandomValues(K),K[0]/256};else if(typeof k?.randomBytes==="function")return()=>k.randomBytes(1).readUInt8()/256;throw new J0(P0.PRNGDetectFailure,"Failed to find a reliable PRNG")}function r2(){if(t2())return self;if(typeof window<"u")return window;if(typeof global<"u")return global;if(typeof globalThis<"u")return globalThis;return null}function a2(N,$){let k="";for(;N>0;N--)k=n2($)+k;return k}function d2(N,$=10){if(isNaN(N))throw new J0(P0.EncodeTimeValueMalformed,`Time must be a number: ${N}`);else if(N>281474976710655)throw new J0(P0.EncodeTimeSizeExceeded,`Cannot encode a time larger than 281474976710655: ${N}`);else if(N<0)throw new J0(P0.EncodeTimeNegative,`Time must be positive: ${N}`);else if(Number.isInteger(N)===!1)throw new J0(P0.EncodeTimeValueMalformed,`Time must be an integer: ${N}`);let k,K="";for(let X=$;X>0;X--)k=N%32,K="0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(k)+K,N=(N-k)/32;return K}function t2(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function N2(N,$){let k=$||i2(),K=!N||isNaN(N)?Date.now():N;return d2(K,10)+a2(16,k)}function s2(N,$,k){let K=N.slice();return K.splice(k,0,K.splice($,1)[0]),K}function P2(N,$,k,K){if(k===K)return N;let X=s2($,k,K),M=new Set($.map((Y)=>Y.id)),z=0;return N.map((Y)=>M.has(Y.id)?X[z++]:Y)}async function l5(N){let $=[],k=[],K=N.items;if(K)for(let z=0;z<K.length;z++){let Y=K[z];if(Y.kind==="file"){let H=Y.webkitGetAsEntry?.();if(H)k.push({entry:H,path:""})}}else return Array.from(N.files);let X=(z)=>{return new Promise((Y)=>{z.readEntries((H)=>Y(H),()=>Y([]))})},M=(z)=>{return new Promise((Y,H)=>{z.file((Q)=>Y(Q),(Q)=>H(Q))})};while(k.length>0){let z=k.shift();if(!z)continue;let{entry:Y,path:H}=z;if(Y.isFile)try{let Q=await M(Y),q=H?`${H}/${Q.name}`:Q.name;Object.defineProperty(Q,"webkitRelativePath",{value:q,writable:!1,configurable:!0}),$.push(Q)}catch(Q){console.error("Error reading file entry:",Q)}else if(Y.isDirectory){let Q=Y.createReader(),q=[],b=await X(Q);while(b.length>0)q=q.concat(b),b=await X(Q);let v=H?`${H}/${Y.name}`:Y.name;for(let S of q)k.push({entry:S,path:v})}}return $}var p=E(I(),1);var _2=E(I(),1);function z2(){let[N,$]=_2.useState(!1);return J(k2,{open:N,onOpenChange:$,children:[P(K2,{asChild:!0,children:J(x,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-transparent text-muted-foreground hover:text-foreground inline-flex items-center justify-center shrink-0 ml-1",title:G.autofill_source_help_title(),children:[P(f0,{className:"h-3.5 w-3.5"}),P("span",{className:"sr-only",children:G.autofill_source_help_title()})]})}),J(J2,{className:"sm:max-w-[500px]",children:[J(Z2,{children:[J(X2,{className:"flex items-center gap-2",children:[P(f0,{className:"h-5 w-5 text-muted-foreground"}),G.autofill_source_help_title()]}),P(Y2,{children:G.autofill_source_help_desc()})]}),J("div",{className:"space-y-4 py-2",children:[J("div",{className:"rounded-lg border p-3.5 space-y-1.5 bg-muted/30",children:[J("div",{className:"flex items-center gap-2 font-medium text-sm",children:[P($2,{className:"h-4 w-4 text-muted-foreground shrink-0"}),P("span",{children:G.autofill_source_none()})]}),P("p",{className:"text-xs text-muted-foreground leading-relaxed",children:G.autofill_source_none_desc()}),P("p",{className:"text-xs italic text-muted-foreground/80",children:G.autofill_source_none_example()})]}),J("div",{className:"rounded-lg border p-3.5 space-y-1.5 bg-muted/30",children:[J("div",{className:"flex items-center gap-2 font-medium text-sm",children:[P(v0,{className:"h-4 w-4 text-amber-500 shrink-0"}),P("span",{children:G.autofill_source_content()})]}),P("p",{className:"text-xs text-muted-foreground leading-relaxed",children:G.autofill_source_content_desc()}),P("p",{className:"text-xs italic text-muted-foreground/80",children:G.autofill_source_content_example()})]}),J("div",{className:"rounded-lg border p-3.5 space-y-1.5 bg-muted/30",children:[J("div",{className:"flex items-center gap-2 font-medium text-sm",children:[P(c0,{className:"h-4 w-4 text-blue-500 shrink-0"}),P("span",{children:G.autofill_source_creation_context()})]}),P("p",{className:"text-xs text-muted-foreground leading-relaxed",children:G.autofill_source_creation_context_desc()}),P("p",{className:"text-xs italic text-muted-foreground/80",children:G.autofill_source_creation_context_example()})]})]})]})]})}var V0=["red","orange","yellow","green","blue","purple","gray"],I0={red:{bg:"rgba(239, 68, 68, 0.15)",text:"#ef4444",hex:"#ef4444"},orange:{bg:"rgba(249, 115, 22, 0.15)",text:"#f97316",hex:"#f97316"},yellow:{bg:"rgba(234, 179, 8, 0.15)",text:"#ca8a04",hex:"#eab308"},green:{bg:"rgba(34, 197, 94, 0.15)",text:"#16a34a",hex:"#22c55e"},blue:{bg:"rgba(59, 130, 246, 0.15)",text:"#2563eb",hex:"#3b82f6"},purple:{bg:"rgba(168, 85, 247, 0.15)",text:"#9333ea",hex:"#a855f7"},gray:{bg:"rgba(128, 128, 128, 0.15)",text:"#4b5563",hex:"#808080"},system:{bg:"rgba(128, 128, 128, 0.1)",text:"#6b7280",hex:"#808080"}};function z0(N){if(!N)return{backgroundColor:"rgba(128, 128, 128, 0.1)",color:"#6b7280"};let $=N.toLowerCase(),k=I0[$];if(k)return{backgroundColor:k.bg,color:k.text};if(N.startsWith("#"))return{backgroundColor:`${N}33`,color:N};return{backgroundColor:"rgba(128, 128, 128, 0.1)",color:N}}function M0(N=[]){let $=new Set(N.map((K)=>K.color?.toLowerCase()).filter(Boolean)),k=V0.filter((K)=>!$.has(K.toLowerCase()));if(k.length>0)return k[Math.floor(Math.random()*k.length)];return V0[Math.floor(Math.random()*V0.length)]}var e2={[h.text]:W2,[h.longText]:Q2,[h.select]:G2,[h.selectMulti]:A2,[h.rating]:W0,[h.number]:B2,[h.toggle]:g2,[h.date]:q2,[h.user]:v2,[h.userMulti]:c2};function N5({field:N,index:$,onVisibilityChange:k}){let{ref:K,handleRef:X}=y2({id:N.id,index:$}),M=N.config?.type?e2[N.config.type]:null;return J("div",{ref:K,className:"flex items-center justify-between p-2 rounded-md hover:bg-muted",children:[J("div",{className:"flex items-center gap-2",children:[P("div",{ref:X,className:"cursor-grab",children:P(b2,{className:"h-4 w-4 text-muted-foreground"})}),M&&P(M,{className:"h-4 w-4 text-muted-foreground shrink-0"}),N.config?.autofillSource===t.CONTENT&&P(v0,{className:"h-4 w-4 text-muted-foreground shrink-0"}),N.config?.autofillSource===t.CREATION_CONTEXT&&P(c0,{className:"h-4 w-4 text-muted-foreground shrink-0"}),P("span",{className:"text-sm truncate",children:N.config?.name})]}),P(S0,{checked:N.visible,onCheckedChange:(z)=>k(N.id,z)})]})}function b1({projectId:N,onManageFields:$,onSave:k}){let{fields:K,updateFields:X}=i(),[M,z]=p.useState(""),[Y,H]=p.useState("list"),[Q,q]=p.useState(""),[b,v]=p.useState(""),[S,Z]=p.useState(t.NONE),[F,w]=p.useState(""),[y,A]=p.useState([]),T=H2();p.useEffect(()=>{T.invalidateQueries({queryKey:["fields",N]})},[N,T]);let W=$0.api.projects[":projectId"].fields.order.$patch,{mutate:O}=E0({mutationFn:async(B)=>{if(!(await W(B)).ok)throw Error(G.failed_update_fields_order());return null}}),g=$0.api.projects[":projectId"].fields.$post,{mutate:_}=E0({mutationFn:async(B)=>{let m=await g(B);if(!m.ok)throw Error(G.failed_create_field());return await m.json()},onSuccess:(B)=>{let m={...B,visible:!0},U=[...K,m];X(U),q(""),A([]),O({param:{projectId:N},json:U.map((V)=>({fieldId:V.id,visible:V.visible||!1}))}),k?.()}}),c=p.useMemo(()=>K.filter((B)=>B.config?.name?.toLowerCase().includes(M.toLowerCase())),[K,M]),C=(B)=>{if(B.canceled)return;let{source:m}=B.operation;if(!U2(m))return;let{initialIndex:U,index:V}=m;if(U===V)return;let D=P2(K,c,U,V);X(D),O({param:{projectId:N},json:D.map((N0)=>({fieldId:N0.id,visible:N0.visible||!1}))})},L=(B,m)=>{let U=K.map((V)=>V.id===B?{...V,visible:m}:V);X(U),O({param:{projectId:N},json:U.map((V)=>({fieldId:V.id,visible:V.visible||!1}))})},R=()=>{if(!Q||!b)return;let B=b===h.select?{select:{options:y}}:b===h.selectMulti?{selectMulti:{options:y}}:{};_({param:{projectId:N},json:{config:{name:Q,type:b,autofillSource:S,...B},label:Q,description:F}})},f=K.filter((B)=>B.visible).length;if(Y==="create")return P("div",{className:"w-80 p-4",children:J("div",{className:"space-y-4",children:[J("div",{className:"space-y-2",children:[P(Z0,{htmlFor:"field-name",children:G.field_name()}),P(G0,{id:"field-name",placeholder:G.new_field_placeholder(),value:Q,onChange:(B)=>q(B.target.value),autoFocus:!0})]}),J("div",{className:"space-y-2",children:[P(Z0,{children:G.field_type()}),J(F2,{children:[P(V2,{asChild:!0,children:J(x,{variant:"outline",className:"w-full justify-between font-normal",children:[b?P("span",{className:"capitalize",children:b.replace(/_/g," ")}):P("span",{className:"text-muted-foreground border-dashed",children:G.select_field_type()}),P(X0,{className:"ml-2 h-4 w-4 opacity-50"})]})}),P(S2,{className:"w-[--radix-dropdown-menu-trigger-width]",children:Object.values(h).map((B)=>P(m2,{onClick:()=>{v(B),A([])},className:"capitalize",children:B.replace(/_/g," ")},B))})]})]}),J("div",{className:"space-y-2",children:[P(Z0,{htmlFor:"field-desc",children:G.description()}),P(G0,{id:"field-desc",placeholder:G.description_optional_placeholder(),value:F,onChange:(B)=>w(B.target.value)})]}),J("div",{className:"space-y-2",children:[J("div",{className:"flex items-center gap-1",children:[P(Z0,{children:G.autofill_source()}),P(z2,{})]}),J(O2,{type:"single",value:S,onValueChange:(B)=>{if(B)Z(B)},className:"w-full grid grid-cols-3 border rounded-md p-1 gap-1",children:[P(F0,{value:t.NONE,className:"text-[11px] leading-tight py-1 px-1 h-auto min-h-[32px] w-full text-center justify-center whitespace-normal font-medium",children:G.autofill_source_none()}),P(F0,{value:t.CONTENT,className:"text-[11px] leading-tight py-1 px-1 h-auto min-h-[32px] w-full text-center justify-center whitespace-normal font-medium",children:G.autofill_source_content()}),P(F0,{value:t.CREATION_CONTEXT,className:"text-[11px] leading-tight py-1 px-1 h-auto min-h-[32px] w-full text-center justify-center whitespace-normal font-medium",children:G.autofill_source_creation_context()})]})]}),(b===h.select||b===h.selectMulti)&&J("div",{className:"space-y-2",children:[J("div",{className:"flex items-center justify-between",children:[P(Z0,{className:"text-sm font-medium",children:G.options()}),J(x,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>{let B={id:N2(),displayName:G.new_option(),color:M0(y)};A([...y,B])},children:[P(k0,{className:"h-4 w-4 mr-1"})," ",G.add_option()]})]}),P("div",{className:"space-y-2 max-h-40 overflow-y-auto pr-1",children:y.map((B,m)=>J("div",{className:"flex items-center gap-2",children:[P(G0,{value:B.displayName,onChange:(U)=>{let V=[...y];V[m]={...B,displayName:U.target.value},A(V)},placeholder:G.option_name_placeholder(),className:"h-8 flex-1"}),J(o,{children:[P(u,{asChild:!0,children:P("button",{type:"button",className:"w-6 h-6 rounded-full border shrink-0 cursor-pointer focus:outline-none hover:scale-105 transition-transform",style:{backgroundColor:I0[B.color||""]?.hex||B.color||"#808080"}})}),P(j,{className:"p-2 w-auto",align:"end",children:P("div",{className:"flex gap-1",children:V0.map((U)=>P("button",{type:"button",className:"w-5 h-5 rounded-full border cursor-pointer hover:scale-110 transition-transform",style:{backgroundColor:I0[U]?.hex||U},onClick:()=>{let V=[...y];V[m]={...B,color:U},A(V)}},U))})})]}),P(x,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>{A(y.filter((U,V)=>V!==m))},children:P(_0,{className:"h-4 w-4"})})]},B.id))})]}),J("div",{className:"flex gap-2 pt-2",children:[P(x,{variant:"secondary",className:"flex-1",onClick:()=>{H("list"),q(""),v(""),Z(t.NONE),w(""),A([])},children:G.cancel()}),P(x,{className:"flex-1",onClick:R,disabled:!Q||!b,children:G.save()})]})]})});return J("div",{className:"w-80 p-4",children:[P("div",{className:"flex items-center justify-between mb-4",children:J("h3",{className:"font-semibold",children:[G.fields()," ",P("span",{className:"text-muted-foreground text-sm font-normal",children:G.visible_count({count:f})})]})}),J("div",{className:"relative mb-4",children:[P(Y0,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),P(G0,{placeholder:G.search_fields_placeholder(),value:M,onChange:(B)=>z(B.target.value),className:"pl-8"})]}),P("div",{className:"max-h-60 overflow-y-auto pr-2",children:P(R2,{sensors:[C2.configure({activationConstraints:[new T2.Distance({value:8})]}),w2],onDragEnd:C,children:c.map((B,m)=>P(N5,{field:B,index:m,onVisibilityChange:L},B.id))})}),$&&J("div",{className:"mt-4 space-y-2",children:[J(x,{variant:"secondary",className:"w-full",onClick:$,children:[P(M2,{className:"h-4 w-4 mr-2"}),G.manage_fields()]}),J(x,{className:"w-full",onClick:()=>H("create"),children:[P(k0,{className:"h-4 w-4 mr-2"}),G.new_field()]})]})]})}var P5=({value:N,config:$,onSave:k,readOnly:K,fieldId:X})=>{let M=$?.select,z=M?.options||[],[Y,H]=p0.useState(!1),[Q,q]=p0.useState(""),b=z.find((W)=>W.id===N),v=Q.trim(),S=z.filter((W)=>W.displayName.toLowerCase().includes(v.toLowerCase())),Z=z.some((W)=>W.displayName.trim().toLowerCase()===v.toLowerCase()||W.id.toLowerCase()===v.toLowerCase()),F=()=>{if(!K)H(!0)},w=(W)=>{k(W),H(!1),q("")},y=(W)=>{if(K)return;if(H(W),!W)q("")},A=async()=>{if(!v)return;let W={id:v.toLowerCase().replace(/\s+/g,"-"),displayName:v,color:M0(z)},O=[...z,W],g={...$,select:{...M,options:O}};if(X)try{let _=await $0.api.fields[":fieldId"].$put({param:{fieldId:X},json:{config:g}});if(!_.ok){H0.error(G.failed_update_field());return}let c=await _.json(),L=i.getState().fields.map((R)=>R.id===c.id?{...R,...c,visible:R.visible}:R);i.getState().updateFields(L)}catch{H0.error(G.failed_update_field());return}k(W.id),q(""),H(!1)};return P("div",{className:"relative w-full",onClick:(W)=>W.stopPropagation(),children:J(o,{open:!K&&Y,onOpenChange:y,children:[P(u,{asChild:!0,children:J("div",{onClick:F,className:`flex items-center justify-between w-full h-[28px] px-2 rounded border border-transparent transition-colors ${!K?"cursor-pointer hover:bg-accent hover:border-border group":""}`,children:[((W)=>{if(!W)return P("span",{className:"text-muted-foreground italic text-sm",children:"Select an option"});return P("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium h-[22px]",style:z0(W.color),children:W.displayName})})(b),!K&&P(X0,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),J(j,{side:"bottom",align:"start",sideOffset:4,className:"p-1.5 w-64 max-h-72 flex flex-col bg-popover border border-border rounded-lg shadow-lg",children:[J("div",{className:"relative pb-1.5 border-b border-border mb-1",onClick:(W)=>W.stopPropagation(),children:[P(Y0,{className:"w-3.5 h-3.5 absolute left-2 top-2 text-muted-foreground"}),P("input",{type:"text",className:"w-full pl-7 pr-2 py-1 text-xs bg-muted/50 border border-input rounded-md focus:outline-none focus:ring-1 focus:ring-ring text-foreground",placeholder:G.search_options_placeholder(),value:Q,onChange:(W)=>q(W.target.value),autoFocus:!0})]}),J("div",{className:"overflow-y-auto max-h-48 min-h-[120px] space-y-0.5",children:[Q===""&&J("div",{onClick:()=>w(""),className:"px-2.5 py-1.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded cursor-pointer flex items-center gap-2",children:[P(_0,{className:"w-3.5 h-3.5"})," Clear"]}),S.map((W)=>P("div",{onClick:()=>w(W.id),className:`px-2.5 py-1.5 text-xs hover:bg-accent rounded cursor-pointer flex items-center justify-between ${N===W.id?"bg-accent/50 font-medium":""}`,children:P("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:z0(W.color),children:W.displayName})},W.id)),S.length===0&&!v&&P("div",{className:"px-2.5 py-2 text-xs text-muted-foreground italic text-center",children:G.no_options_found()}),v!==""&&!Z&&J("div",{onClick:A,className:"px-2.5 py-1.5 text-xs text-primary hover:bg-accent rounded cursor-pointer flex items-center gap-1.5 font-medium border-t border-border mt-1 pt-1.5",children:[P(k0,{className:"w-3.5 h-3.5 shrink-0"}),P("span",{className:"truncate",children:G.add_option_with_name({name:v})})]})]})]})]})})},h2=P5;var s=E(I(),1);var $5=({value:N=[],config:$,onSave:k,readOnly:K,fieldId:X})=>{let M=$?.selectMulti,z=M?.options||[],Y=s.useRef(null),[H,Q]=s.useState(!1),[q,b]=s.useState(N.length),[v,S]=s.useState(""),Z=z.filter((_)=>(N||[]).includes(_.id))||[],F=v.trim(),w=z.filter((_)=>_.displayName.toLowerCase().includes(F.toLowerCase())),y=z.some((_)=>_.displayName.trim().toLowerCase()===F.toLowerCase()||_.id.toLowerCase()===F.toLowerCase());s.useLayoutEffect(()=>{if(H){b(Z.length);return}if(Y.current){let _=Y.current.clientWidth-8,C=document.createElement("canvas").getContext("2d");if(C&&_>0){C.font="500 12px ui-sans-serif, system-ui, sans-serif";let L=4,R=Z.map((D)=>Math.ceil(C.measureText(D.displayName).width)+18);if(R.reduce((D,N0)=>D+N0,0)+Math.max(0,R.length-1)*L<=_){b(Z.length);return}let m=_-32-L,U=0,V=0;for(let D=0;D<R.length;D++){let N0=V>0?U+L+R[D]:R[D];if(N0>m)break;U=N0,V++}b(V)}}},[Z,H,N]);let A=(_)=>{let c=N||[],C;if(c.includes(_))C=c.filter((L)=>L!==_);else C=[...c,_];k(C)},T=async()=>{if(!F)return;let _={id:F.toLowerCase().replace(/\s+/g,"-"),displayName:F,color:M0(z)},c=[...z,_],C={...$,selectMulti:{...M,options:c}};if(X)try{let L=await $0.api.fields[":fieldId"].$put({param:{fieldId:X},json:{config:C}});if(!L.ok){H0.error(G.failed_update_field());return}let R=await L.json(),B=i.getState().fields.map((m)=>m.id===R.id?{...m,...R,visible:m.visible}:m);i.getState().updateFields(B)}catch{H0.error(G.failed_update_field());return}k([...N||[],_.id]),S("")},W=(_)=>{if(_.stopPropagation(),!K)Q(!0)},O=Z.length-q;return P("div",{className:"relative w-full",onClick:(_)=>_.stopPropagation(),children:J(o,{open:!K&&H,onOpenChange:(_)=>{if(K)return;if(Q(_),!_)S("")},children:[P(u,{asChild:!0,children:J("div",{ref:Y,onClick:W,className:`w-full px-1 py-1 flex flex-wrap gap-1 rounded border border-transparent transition-all box-border h-[32px] overflow-hidden ${!K||O>0?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:[Z.length===0&&P("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),Z.slice(0,q).map((_)=>P("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium border border-transparent whitespace-nowrap h-[22px]",style:z0(_.color),children:_.displayName},_.id)),O>0&&J("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-muted text-muted-foreground h-[22px]",children:["+",O]})]})}),J(j,{side:"bottom",align:"start",sideOffset:4,className:"p-1.5 w-64 max-h-72 flex flex-col bg-popover border border-border rounded-lg shadow-lg",children:[J("div",{className:"relative pb-1.5 border-b border-border mb-1",onClick:(_)=>_.stopPropagation(),children:[P(Y0,{className:"w-3.5 h-3.5 absolute left-2 top-2 text-muted-foreground"}),P("input",{type:"text",className:"w-full pl-7 pr-2 py-1 text-xs bg-muted/50 border border-input rounded-md focus:outline-none focus:ring-1 focus:ring-ring text-foreground",placeholder:G.search_options_placeholder(),value:v,onChange:(_)=>S(_.target.value),autoFocus:!0})]}),J("div",{className:"overflow-y-auto max-h-48 min-h-[120px] space-y-0.5",children:[w.map((_)=>{let c=(N||[]).includes(_.id);return J("div",{onClick:()=>A(_.id),className:`px-2.5 py-1.5 hover:bg-accent rounded cursor-pointer flex items-center justify-between text-xs ${c?"bg-accent/30 font-medium":""}`,children:[P("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:z0(_.color),children:_.displayName}),c&&P(m0,{className:"w-3.5 h-3.5 text-primary"})]},_.id)}),w.length===0&&!F&&P("div",{className:"px-2.5 py-2 text-xs text-muted-foreground italic text-center",children:G.no_options_found()}),F!==""&&!y&&J("div",{onClick:T,className:"px-2.5 py-1.5 text-xs text-primary hover:bg-accent rounded cursor-pointer flex items-center gap-1.5 font-medium border-t border-border mt-1 pt-1.5",children:[P(k0,{className:"w-3.5 h-3.5 shrink-0"}),P("span",{className:"truncate",children:G.add_option_with_name({name:F})})]})]})]})]})})},L2=$5;var e=E(I(),1);var k5=({value:N,onSave:$,readOnly:k})=>{let[K,X]=e.useState(!1),[M,z]=e.useState(N||""),Y=e.useRef(null);e.useEffect(()=>{z(N||"")},[N]),e.useEffect(()=>{if(K&&Y.current)Y.current.focus()},[K]);let H=()=>{if(!k)X(!0)},Q=()=>{X(!1),$(M)},q=(b)=>{if(b.key==="Enter")Y.current?.blur()};if(K)return P("input",{ref:Y,type:"text",value:M,onChange:(b)=>z(b.target.value),onBlur:Q,onKeyDown:q,className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm outline-none shadow-sm"});return P("div",{onClick:H,className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded truncate border border-transparent transition-colors ${!k?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:N||P("span",{className:"text-muted-foreground italic",children:"Empty"})})},f2=k5;var K5=({value:N,onSave:$,readOnly:k})=>{return P("div",{className:"flex items-center h-[28px] w-full",onClick:(X)=>X.stopPropagation(),children:P(S0,{checked:N,onCheckedChange:(X)=>{if(!k)$(X)},disabled:k,className:"cursor-pointer"})})},E2=K5;var C0=E(I(),1);var J5=({value:N,onSave:$,readOnly:k})=>{let K=w0(),{members:X,fetchMembers:M}=T0(),[z,Y]=C0.useState(!1);C0.useEffect(()=>{if(K)M(K)},[K,M]);let H=X.find((Z)=>Z.id===N),Q=()=>{if(!k)Y(!0)},q=(Z)=>{$(Z),Y(!1)},b=(Z)=>{if(k)return;Y(Z)},v=(Z)=>{return Z.split(" ").map((F)=>F[0]).slice(0,2).join("").toUpperCase()};return P("div",{className:"relative w-full",onClick:(Z)=>Z.stopPropagation(),children:J(o,{open:!k&&z,onOpenChange:b,children:[P(u,{asChild:!0,children:J("div",{onClick:Q,className:`flex items-center justify-between w-full h-[28px] px-2 rounded border border-transparent transition-colors ${!k?"cursor-pointer hover:bg-accent hover:border-border group":""}`,children:[((Z)=>{if(!Z)return P("span",{className:"text-muted-foreground italic text-sm",children:"Select user"});return J("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-muted text-foreground border h-[22px]",children:[J(Q0,{className:"w-4 h-4",children:[P(q0,{src:Z.image,alt:Z.name,className:"object-cover"}),P(b0,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:v(Z.name)})]}),P("span",{className:"truncate max-w-[120px]",children:Z.name})]})})(H),!k&&P(X0,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),J(j,{className:"p-1 w-[--radix-popover-trigger-width] min-w-[200px] max-h-60 overflow-auto bg-popover border border-border rounded-lg shadow-lg",align:"start",children:[J("div",{onClick:()=>q(""),className:"px-3 py-2 text-sm text-muted-foreground hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[P(_0,{className:"w-3 h-3"})," Clear"]}),X.map((Z)=>J("div",{onClick:()=>q(Z.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[J(Q0,{className:"w-5 h-5",children:[P(q0,{src:Z.image,alt:Z.name,className:"object-cover"}),P(b0,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:v(Z.name)})]}),P("span",{className:"text-sm font-medium text-foreground",children:Z.name})]},Z.id))]})]})})},I2=J5;var n=E(I(),1);var Z5=({value:N=[],onSave:$,readOnly:k})=>{let K=w0(),{members:X,fetchMembers:M}=T0(),z=n.useRef(null),[Y,H]=n.useState(!1),[Q,q]=n.useState(N.length);n.useEffect(()=>{if(K)M(K)},[K,M]);let b=X.filter((A)=>(N||[]).includes(A.id)),v=(A)=>{return A.split(" ").map((T)=>T[0]).slice(0,2).join("").toUpperCase()};n.useLayoutEffect(()=>{if(Y){q(b.length);return}if(z.current){let A=z.current.clientWidth-8,W=document.createElement("canvas").getContext("2d");if(W&&A>0){W.font="500 12px ui-sans-serif, system-ui, sans-serif";let O=4,g=b.map((f)=>{return Math.min(100,Math.ceil(W.measureText(f.name).width))+40});if(g.reduce((f,B)=>f+B,0)+Math.max(0,g.length-1)*O<=A){q(b.length);return}let C=A-32-O,L=0,R=0;for(let f=0;f<g.length;f++){let B=R>0?L+O+g[f]:g[f];if(B>C)break;L=B,R++}q(R)}}},[b,Y,N]);let S=(A)=>{let T=N||[],W;if(T.includes(A))W=T.filter((O)=>O!==A);else W=[...T,A];$(W)},Z=(A)=>{if(A.stopPropagation(),!k)H(!0)},F=b.length-Q,w=(A)=>{if(k)return;H(A)},y=(A)=>{return J("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-muted text-foreground border whitespace-nowrap h-[22px]",children:[J(Q0,{className:"w-4 h-4",children:[P(q0,{src:A.image,alt:A.name,className:"object-cover"}),P(b0,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:v(A.name)})]}),P("span",{className:"truncate max-w-[100px]",children:A.name})]},A.id)};return P("div",{className:"relative w-full",onClick:(A)=>A.stopPropagation(),children:J(o,{open:!k&&Y,onOpenChange:w,children:[P(u,{asChild:!0,children:J("div",{ref:z,onClick:Z,className:`w-full px-1 py-1 flex flex-wrap gap-1 rounded border border-transparent transition-all box-border h-[32px] overflow-hidden ${!k||F>0?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:[b.length===0&&P("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),b.slice(0,Q).map(y),F>0&&J("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-muted text-muted-foreground h-[22px]",children:["+",F]})]})}),P(j,{className:"p-1 w-[--radix-popover-trigger-width] min-w-[200px] max-h-60 overflow-auto bg-popover border border-border rounded-lg shadow-lg",align:"start",children:X.map((A)=>{let T=(N||[]).includes(A.id);return J("div",{onClick:()=>S(A.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center justify-between rounded-sm",children:[J("div",{className:"flex items-center gap-2",children:[J(Q0,{className:"w-5 h-5",children:[P(q0,{src:A.image,alt:A.name,className:"object-cover"}),P(b0,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:v(A.name)})]}),P("span",{className:"text-sm font-medium text-foreground",children:A.name})]}),T&&P(m0,{className:"w-4 h-4 text-primary"})]},A.id)})})]})})},p2=Z5;var X5=(N)=>{if(!N.config)return P("div",{children:"Unknown Field Type"});switch(N.config.type){case"text":return P(f2,{...N,value:N.value,onSave:N.onSave});case"longText":return P(d0,{...N,value:N.value,onSave:N.onSave});case"select":return P(h2,{...N,value:N.value,onSave:N.onSave});case"selectMulti":return P(L2,{...N,value:N.value,onSave:N.onSave});case"rating":return P(e0,{...N,value:N.value,onSave:N.onSave});case"number":return P(t0,{...N,value:N.value,onSave:N.onSave});case"toggle":return P(E2,{...N,value:N.value,onSave:N.onSave});case"date":return P(a0,{...N,value:N.value,onSave:N.onSave});case"user":return P(I2,{...N,value:N.value,onSave:N.onSave});case"userMulti":return P(p2,{...N,value:N.value,onSave:N.onSave});default:return P("div",{children:"Unknown Field Type"})}},GN=X5;var gN=({progress:N,className:$})=>{let K=2*Math.PI*20,X=K-Math.min(100,Math.max(0,N))/100*K;return J("svg",{viewBox:"0 0 50 50",className:B0("w-12 h-12",$),children:[P("circle",{cx:"25",cy:"25",r:20,className:"stroke-muted",strokeWidth:"4",fill:"transparent"}),P("circle",{cx:"25",cy:"25",r:20,className:"stroke-primary transition-all duration-300 ease-out",strokeWidth:"4",fill:"transparent",strokeDasharray:K,strokeDashoffset:X,transform:"rotate(-90 25 25)"}),P("text",{x:"50%",y:"50%",textAnchor:"middle",dy:".3em",className:"fill-foreground text-[10px] font-bold",children:`${Math.round(N)}%`})]})};var Y5=(N)=>{if(isNaN(N))return"00:00";let $=new Date(N*1000),k=$.getUTCHours(),K=$.getUTCMinutes().toString().padStart(2,"0"),X=$.getUTCSeconds().toString().padStart(2,"0");if(k)return`${k}:${K}:${X}`;return`${K}:${X}`},cN=(N,$,k,K)=>{if(k==="frames")return`${N} fr`;if(k==="standard")return Y5(N/$);let X=Math.round($),M=$!==X,z=!1;if(M&&(X===30||X===60))z=!0;let Y=0;if(K){let Z=K.match(/^([012]\d):(\d\d):(\d\d)(:|;|\.)(\d+)$/);if(Z){let F=parseInt(Z[1],10),w=parseInt(Z[2],10),y=parseInt(Z[3],10),A=parseInt(Z[5],10);if(z=Z[4]!==":",Y=(F*3600+w*60+y)*X+A,z){let T=F*60+w,W=$<30?2:4;Y-=W*(T-Math.floor(T/10))}}}let H=N+Y;if(z){let Z=$<30?2:4,F=Math.floor(H/(17982*Z/2)),w=H%(17982*Z/2);if(w<Z)w=w+Z;H+=9*Z*F+Z*Math.floor((w-Z)/(1798*Z/2))}let Q=H%X,q=Math.floor(H/X)%60,b=Math.floor(H/(X*60))%60,v=Math.floor(H/(X*3600))%24,S=z?";":":";return`${v.toString().padStart(2,"0")}:${b.toString().padStart(2,"0")}:${q.toString().padStart(2,"0")}${S}${Q.toString().padStart(2,"0")}`};var FN=(N,$)=>{if(!$)return 0;let k=1/$;return N*k+k/2},_5=(N)=>Math.max(100,3000/(N||30)),VN=({dbTotalFrames:N,containerDuration:$,frameRate:k})=>{let K=k||30,X=Math.round($*K);if(N<=0)return X;let M=N/K,z=$-M,Y=_5(K)/1000;return z>Y?X:N};var D2=E(I(),1);function TN({className:N,defaultValue:$,value:k,min:K=0,max:X=100,...M}){let z=D2.useMemo(()=>Array.isArray(k)?k:Array.isArray($)?$:[K,X],[k,$,K,X]);return J(A0.Root,{"data-slot":"slider",defaultValue:$,value:k,min:K,max:X,className:B0("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",N),...M,children:[P(A0.Track,{"data-slot":"slider-track",className:B0("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:P(A0.Range,{"data-slot":"slider-range",className:B0("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:z.length},(Y,H)=>P(A0.Thumb,{"data-slot":"slider-thumb",className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},H))]})}
|
|
2
2
|
export{P2 as F,l5 as G,i as H,N2 as I,gN as J,z5 as K,e0 as L,z2 as M,V0 as N,I0 as O,z0 as P,M0 as Q,e2 as R,b1 as S,GN as T,Y5 as U,cN as V,FN as W,_5 as X,VN as Y,TN as Z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as US}from"./chunk-0n1wfwcm.js";import{ba as Hf}from"./chunk-djx2r4nj.js";import{cg as WS,dg as HS}from"./chunk-y2s0tjaa.js";import{kg as PS}from"./chunk-dk8vk17v.js";import{lg as zS}from"./chunk-rkz6x3r0.js";import{ah as BS}from"./chunk-7x1vkftb.js";import{bh as AS}from"./chunk-ck6msfch.js";import{ni as kS}from"./chunk-02afmyqy.js";import{Ci as ui,qi as DS,ti as Ra,vi as wS}from"./chunk-8nyve0cr.js";import{Al as ES,Bk as pS,Bl as bS,Hk as _S,Jk as mS,Kk as CS,Lk as xS,Ll as FS,Mk as IS,Oj as uS,Vi as Bt,Vj as $S,Wi as qo,Xi as w,Yi as Tt,bj as $a,cj as ob,dk as dS,dl as yS,el as SS,hl as NS,jl as zf,jm as LS,mm as Fn,oj as RS,tl as TS,vk as fS,wk as gS,xk as hS}from"./chunk-kqpzx5az.js";import{kn as Dt,ln as TO,mn as at}from"./chunk-p49h5fxs.js";var uf=TO((lR,Sa)=>{var EO=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{},H=function(t){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,o={},r={manual:t.Prism&&t.Prism.manual,disableWorkerMessageHandler:t.Prism&&t.Prism.disableWorkerMessageHandler,util:{encode:function g(_){if(_ instanceof s)return new s(_.type,g(_.content),_.alias);else if(Array.isArray(_))return _.map(g);else return _.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(g){return Object.prototype.toString.call(g).slice(8,-1)},objId:function(g){if(!g.__id)Object.defineProperty(g,"__id",{value:++n});return g.__id},clone:function g(_,m){m=m||{};var C,x;switch(r.util.type(_)){case"Object":if(x=r.util.objId(_),m[x])return m[x];C={},m[x]=C;for(var N in _)if(_.hasOwnProperty(N))C[N]=g(_[N],m);return C;case"Array":if(x=r.util.objId(_),m[x])return m[x];return C=[],m[x]=C,_.forEach(function(T,y){C[y]=g(T,m)}),C;default:return _}},getLanguage:function(g){while(g){var _=e.exec(g.className);if(_)return _[1].toLowerCase();g=g.parentElement}return"none"},setLanguage:function(g,_){g.className=g.className.replace(RegExp(e,"gi"),""),g.classList.add("language-"+_)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw Error()}catch(C){var g=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(C.stack)||[])[1];if(g){var _=document.getElementsByTagName("script");for(var m in _)if(_[m].src==g)return _[m]}return null}},isActive:function(g,_,m){var C="no-"+_;while(g){var x=g.classList;if(x.contains(_))return!0;if(x.contains(C))return!1;g=g.parentElement}return!!m}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(g,_){var m=r.util.clone(r.languages[g]);for(var C in _)m[C]=_[C];return m},insertBefore:function(g,_,m,C){C=C||r.languages;var x=C[g],N={};for(var T in x)if(x.hasOwnProperty(T)){if(T==_){for(var y in m)if(m.hasOwnProperty(y))N[y]=m[y]}if(!m.hasOwnProperty(T))N[T]=x[T]}var S=C[g];return C[g]=N,r.languages.DFS(r.languages,function(E,O){if(O===S&&E!=g)this[E]=N}),N},DFS:function g(_,m,C,x){x=x||{};var N=r.util.objId;for(var T in _)if(_.hasOwnProperty(T)){m.call(_,T,_[T],C||T);var y=_[T],S=r.util.type(y);if(S==="Object"&&!x[N(y)])x[N(y)]=!0,g(y,m,null,x);else if(S==="Array"&&!x[N(y)])x[N(y)]=!0,g(y,m,T,x)}}},plugins:{},highlightAll:function(g,_){r.highlightAllUnder(document,g,_)},highlightAllUnder:function(g,_,m){var C={callback:m,container:g,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",C),C.elements=Array.prototype.slice.apply(C.container.querySelectorAll(C.selector)),r.hooks.run("before-all-elements-highlight",C);for(var x=0,N;N=C.elements[x++];)r.highlightElement(N,_===!0,C.callback)},highlightElement:function(g,_,m){var C=r.util.getLanguage(g),x=r.languages[C];r.util.setLanguage(g,C);var N=g.parentElement;if(N&&N.nodeName.toLowerCase()==="pre")r.util.setLanguage(N,C);var T=g.textContent,y={element:g,language:C,grammar:x,code:T};function S(O){y.highlightedCode=O,r.hooks.run("before-insert",y),y.element.innerHTML=y.highlightedCode,r.hooks.run("after-highlight",y),r.hooks.run("complete",y),m&&m.call(y.element)}if(r.hooks.run("before-sanity-check",y),N=y.element.parentElement,N&&N.nodeName.toLowerCase()==="pre"&&!N.hasAttribute("tabindex"))N.setAttribute("tabindex","0");if(!y.code){r.hooks.run("complete",y),m&&m.call(y.element);return}if(r.hooks.run("before-highlight",y),!y.grammar){S(r.util.encode(y.code));return}if(_&&t.Worker){var E=new Worker(r.filename);E.onmessage=function(O){S(O.data)},E.postMessage(JSON.stringify({language:y.language,code:y.code,immediateClose:!0}))}else S(r.highlight(y.code,y.grammar,y.language))},highlight:function(g,_,m){var C={code:g,grammar:_,language:m};if(r.hooks.run("before-tokenize",C),!C.grammar)throw Error('The language "'+C.language+'" has no grammar.');return C.tokens=r.tokenize(C.code,C.grammar),r.hooks.run("after-tokenize",C),s.stringify(r.util.encode(C.tokens),C.language)},tokenize:function(g,_){var m=_.rest;if(m){for(var C in m)_[C]=m[C];delete _.rest}var x=new a;return c(x,x.head,g),l(g,x,_,x.head,0),d(x)},hooks:{all:{},add:function(g,_){var m=r.hooks.all;m[g]=m[g]||[],m[g].push(_)},run:function(g,_){var m=r.hooks.all[g];if(!m||!m.length)return;for(var C=0,x;x=m[C++];)x(_)}},Token:s};t.Prism=r;function s(g,_,m,C){this.type=g,this.content=_,this.alias=m,this.length=(C||"").length|0}s.stringify=function g(_,m){if(typeof _=="string")return _;if(Array.isArray(_)){var C="";return _.forEach(function(S){C+=g(S,m)}),C}var x={type:_.type,content:g(_.content,m),tag:"span",classes:["token",_.type],attributes:{},language:m},N=_.alias;if(N)if(Array.isArray(N))Array.prototype.push.apply(x.classes,N);else x.classes.push(N);r.hooks.run("wrap",x);var T="";for(var y in x.attributes)T+=" "+y+'="'+(x.attributes[y]||"").replace(/"/g,""")+'"';return"<"+x.tag+' class="'+x.classes.join(" ")+'"'+T+">"+x.content+"</"+x.tag+">"};function i(g,_,m,C){g.lastIndex=_;var x=g.exec(m);if(x&&C&&x[1]){var N=x[1].length;x.index+=N,x[0]=x[0].slice(N)}return x}function l(g,_,m,C,x,N){for(var T in m){if(!m.hasOwnProperty(T)||!m[T])continue;var y=m[T];y=Array.isArray(y)?y:[y];for(var S=0;S<y.length;++S){if(N&&N.cause==T+","+S)return;var E=y[S],O=E.inside,$=!!E.lookbehind,I=!!E.greedy,k=E.alias;if(I&&!E.pattern.global){var L=E.pattern.toString().match(/[imsuy]*$/)[0];E.pattern=RegExp(E.pattern.source,L+"g")}var z=E.pattern||E;for(var M=C.next,Z=x;M!==_.tail;Z+=M.value.length,M=M.next){if(N&&Z>=N.reach)break;var ot=M.value;if(_.length>g.length)return;if(ot instanceof s)continue;var gt=1,rt;if(I){if(rt=i(z,Z,g,$),!rt||rt.index>=g.length)break;var Mt=rt.index,$e=rt.index+rt[0].length,ae=Z;ae+=M.value.length;while(Mt>=ae)M=M.next,ae+=M.value.length;if(ae-=M.value.length,Z=ae,M.value instanceof s)continue;for(var j=M;j!==_.tail&&(ae<$e||typeof j.value==="string");j=j.next)gt++,ae+=j.value.length;gt--,ot=g.slice(Z,ae),rt.index-=Z}else if(rt=i(z,0,ot,$),!rt)continue;var Mt=rt.index,vt=rt[0],Ie=ot.slice(0,Mt),ce=ot.slice(Mt+vt.length),Ce=Z+ot.length;if(N&&Ce>N.reach)N.reach=Ce;var ue=M.prev;if(Ie)ue=c(_,ue,Ie),Z+=Ie.length;u(_,ue,gt);var Fe=new s(T,O?r.tokenize(vt,O):vt,k,vt);if(M=c(_,ue,Fe),ce)c(_,M,ce);if(gt>1){var Je={cause:T+","+S,reach:Ce};if(l(g,_,m,M.prev,Z,Je),N&&Je.reach>N.reach)N.reach=Je.reach}}}}}function a(){var g={value:null,prev:null,next:null},_={value:null,prev:g,next:null};g.next=_,this.head=g,this.tail=_,this.length=0}function c(g,_,m){var C=_.next,x={value:m,prev:_,next:C};return _.next=x,C.prev=x,g.length++,x}function u(g,_,m){var C=_.next;for(var x=0;x<m&&C!==g.tail;x++)C=C.next;_.next=C,C.prev=_,g.length-=x}function d(g){var _=[],m=g.head.next;while(m!==g.tail)_.push(m.value),m=m.next;return _}if(!t.document){if(!t.addEventListener)return r;if(!r.disableWorkerMessageHandler)t.addEventListener("message",function(g){var _=JSON.parse(g.data),m=_.language,C=_.code,x=_.immediateClose;if(t.postMessage(r.highlight(C,r.languages[m],m)),x)t.close()},!1);return r}var f=r.util.currentScript();if(f){if(r.filename=f.src,f.hasAttribute("data-manual"))r.manual=!0}function h(){if(!r.manual)r.highlightAll()}if(!r.manual){var p=document.readyState;if(p==="loading"||p==="interactive"&&f&&f.defer)document.addEventListener("DOMContentLoaded",h);else if(window.requestAnimationFrame)window.requestAnimationFrame(h);else window.setTimeout(h,16)}return r}(EO);if(typeof Sa<"u"&&Sa.exports)Sa.exports=H;if(typeof global<"u")global.Prism=H;H.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};H.languages.markup.tag.inside["attr-value"].inside.entity=H.languages.markup.entity;H.languages.markup.doctype.inside["internal-subset"].inside=H.languages.markup;H.hooks.add("wrap",function(t){if(t.type==="entity")t.attributes.title=t.content.replace(/&/,"&")});Object.defineProperty(H.languages.markup.tag,"addInlined",{value:function(e,n){var o={};o["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:H.languages[n]},o.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:o}};r["language-"+n]={pattern:/[\s\S]+/,inside:H.languages[n]};var s={};s[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:r},H.languages.insertBefore("markup","cdata",s)}});Object.defineProperty(H.languages.markup.tag,"addAttribute",{value:function(t,e){H.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:H.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});H.languages.html=H.languages.markup;H.languages.mathml=H.languages.markup;H.languages.svg=H.languages.markup;H.languages.xml=H.languages.extend("markup",{});H.languages.ssml=H.languages.xml;H.languages.atom=H.languages.xml;H.languages.rss=H.languages.xml;(function(t){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var n=t.languages.markup;if(n)n.tag.addInlined("style","css"),n.tag.addAttribute("style","css")})(H);H.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};H.languages.javascript=H.languages.extend("clike",{"class-name":[H.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});H.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;H.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:H.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:H.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:H.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:H.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:H.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});H.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:H.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});H.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});if(H.languages.markup)H.languages.markup.tag.addInlined("script","javascript"),H.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript");H.languages.js=H.languages.javascript;(function(){if(typeof H>"u"||typeof document>"u")return;if(!Element.prototype.matches)Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;var t="Loading…",e=function(f,h){return"✖ Error "+f+" while fetching file: "+h},n="✖ Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},r="data-src-status",s="loading",i="loaded",l="failed",a="pre[data-src]:not(["+r+'="'+i+'"]):not(['+r+'="'+s+'"])';function c(f,h,p){var g=new XMLHttpRequest;g.open("GET",f,!0),g.onreadystatechange=function(){if(g.readyState==4)if(g.status<400&&g.responseText)h(g.responseText);else if(g.status>=400)p(e(g.status,g.statusText));else p(n)},g.send(null)}function u(f){var h=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(f||"");if(h){var p=Number(h[1]),g=h[2],_=h[3];if(!g)return[p,p];if(!_)return[p,void 0];return[p,Number(_)]}return}H.hooks.add("before-highlightall",function(f){f.selector+=", "+a}),H.hooks.add("before-sanity-check",function(f){var h=f.element;if(h.matches(a)){f.code="",h.setAttribute(r,s);var p=h.appendChild(document.createElement("CODE"));p.textContent=t;var g=h.getAttribute("data-src"),_=f.language;if(_==="none"){var m=(/\.(\w+)$/.exec(g)||[,"none"])[1];_=o[m]||m}H.util.setLanguage(p,_),H.util.setLanguage(h,_);var C=H.plugins.autoloader;if(C)C.loadLanguages(_);c(g,function(x){h.setAttribute(r,i);var N=u(h.getAttribute("data-range"));if(N){var T=x.split(/\r\n?|\n/g),y=N[0],S=N[1]==null?T.length:N[1];if(y<0)y+=T.length;if(y=Math.max(0,Math.min(y-1,T.length)),S<0)S+=T.length;if(S=Math.max(0,Math.min(S,T.length)),x=T.slice(y,S).join(`
|
|
1
|
+
import{h as US}from"./chunk-0qdzjcny.js";import{ba as Hf}from"./chunk-4yhd7bmp.js";import{eg as WS,fg as HS}from"./chunk-k1f3gj25.js";import{mg as PS}from"./chunk-7g2k89gq.js";import{ng as zS}from"./chunk-7xcyn1ba.js";import{gh as BS}from"./chunk-785kxysj.js";import{hh as AS}from"./chunk-ygsbmfcy.js";import{ti as kS}from"./chunk-4k2d8w9w.js";import{Bi as wS,Ii as ui,wi as DS,zi as Ra}from"./chunk-s503pcvb.js";import{$i as Bt,Al as TS,Ck as fS,Dk as gS,Ek as hS,Hl as ES,Ik as pS,Il as bS,Ok as _S,Qk as mS,Rk as CS,Sk as xS,Sl as FS,Tk as IS,Vj as uS,aj as qo,ak as $S,bj as w,cj as Tt,hj as $a,ij as ob,kk as dS,kl as yS,ll as SS,ol as NS,ql as zf,qm as LS,tm as Fn,uj as RS}from"./chunk-w9p59ahz.js";import{rn as Dt,sn as TO,tn as at}from"./chunk-txkmks1h.js";var uf=TO((lR,Sa)=>{var EO=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{},H=function(t){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,o={},r={manual:t.Prism&&t.Prism.manual,disableWorkerMessageHandler:t.Prism&&t.Prism.disableWorkerMessageHandler,util:{encode:function g(_){if(_ instanceof s)return new s(_.type,g(_.content),_.alias);else if(Array.isArray(_))return _.map(g);else return _.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(g){return Object.prototype.toString.call(g).slice(8,-1)},objId:function(g){if(!g.__id)Object.defineProperty(g,"__id",{value:++n});return g.__id},clone:function g(_,m){m=m||{};var C,x;switch(r.util.type(_)){case"Object":if(x=r.util.objId(_),m[x])return m[x];C={},m[x]=C;for(var N in _)if(_.hasOwnProperty(N))C[N]=g(_[N],m);return C;case"Array":if(x=r.util.objId(_),m[x])return m[x];return C=[],m[x]=C,_.forEach(function(T,y){C[y]=g(T,m)}),C;default:return _}},getLanguage:function(g){while(g){var _=e.exec(g.className);if(_)return _[1].toLowerCase();g=g.parentElement}return"none"},setLanguage:function(g,_){g.className=g.className.replace(RegExp(e,"gi"),""),g.classList.add("language-"+_)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw Error()}catch(C){var g=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(C.stack)||[])[1];if(g){var _=document.getElementsByTagName("script");for(var m in _)if(_[m].src==g)return _[m]}return null}},isActive:function(g,_,m){var C="no-"+_;while(g){var x=g.classList;if(x.contains(_))return!0;if(x.contains(C))return!1;g=g.parentElement}return!!m}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(g,_){var m=r.util.clone(r.languages[g]);for(var C in _)m[C]=_[C];return m},insertBefore:function(g,_,m,C){C=C||r.languages;var x=C[g],N={};for(var T in x)if(x.hasOwnProperty(T)){if(T==_){for(var y in m)if(m.hasOwnProperty(y))N[y]=m[y]}if(!m.hasOwnProperty(T))N[T]=x[T]}var S=C[g];return C[g]=N,r.languages.DFS(r.languages,function(E,O){if(O===S&&E!=g)this[E]=N}),N},DFS:function g(_,m,C,x){x=x||{};var N=r.util.objId;for(var T in _)if(_.hasOwnProperty(T)){m.call(_,T,_[T],C||T);var y=_[T],S=r.util.type(y);if(S==="Object"&&!x[N(y)])x[N(y)]=!0,g(y,m,null,x);else if(S==="Array"&&!x[N(y)])x[N(y)]=!0,g(y,m,T,x)}}},plugins:{},highlightAll:function(g,_){r.highlightAllUnder(document,g,_)},highlightAllUnder:function(g,_,m){var C={callback:m,container:g,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",C),C.elements=Array.prototype.slice.apply(C.container.querySelectorAll(C.selector)),r.hooks.run("before-all-elements-highlight",C);for(var x=0,N;N=C.elements[x++];)r.highlightElement(N,_===!0,C.callback)},highlightElement:function(g,_,m){var C=r.util.getLanguage(g),x=r.languages[C];r.util.setLanguage(g,C);var N=g.parentElement;if(N&&N.nodeName.toLowerCase()==="pre")r.util.setLanguage(N,C);var T=g.textContent,y={element:g,language:C,grammar:x,code:T};function S(O){y.highlightedCode=O,r.hooks.run("before-insert",y),y.element.innerHTML=y.highlightedCode,r.hooks.run("after-highlight",y),r.hooks.run("complete",y),m&&m.call(y.element)}if(r.hooks.run("before-sanity-check",y),N=y.element.parentElement,N&&N.nodeName.toLowerCase()==="pre"&&!N.hasAttribute("tabindex"))N.setAttribute("tabindex","0");if(!y.code){r.hooks.run("complete",y),m&&m.call(y.element);return}if(r.hooks.run("before-highlight",y),!y.grammar){S(r.util.encode(y.code));return}if(_&&t.Worker){var E=new Worker(r.filename);E.onmessage=function(O){S(O.data)},E.postMessage(JSON.stringify({language:y.language,code:y.code,immediateClose:!0}))}else S(r.highlight(y.code,y.grammar,y.language))},highlight:function(g,_,m){var C={code:g,grammar:_,language:m};if(r.hooks.run("before-tokenize",C),!C.grammar)throw Error('The language "'+C.language+'" has no grammar.');return C.tokens=r.tokenize(C.code,C.grammar),r.hooks.run("after-tokenize",C),s.stringify(r.util.encode(C.tokens),C.language)},tokenize:function(g,_){var m=_.rest;if(m){for(var C in m)_[C]=m[C];delete _.rest}var x=new a;return c(x,x.head,g),l(g,x,_,x.head,0),d(x)},hooks:{all:{},add:function(g,_){var m=r.hooks.all;m[g]=m[g]||[],m[g].push(_)},run:function(g,_){var m=r.hooks.all[g];if(!m||!m.length)return;for(var C=0,x;x=m[C++];)x(_)}},Token:s};t.Prism=r;function s(g,_,m,C){this.type=g,this.content=_,this.alias=m,this.length=(C||"").length|0}s.stringify=function g(_,m){if(typeof _=="string")return _;if(Array.isArray(_)){var C="";return _.forEach(function(S){C+=g(S,m)}),C}var x={type:_.type,content:g(_.content,m),tag:"span",classes:["token",_.type],attributes:{},language:m},N=_.alias;if(N)if(Array.isArray(N))Array.prototype.push.apply(x.classes,N);else x.classes.push(N);r.hooks.run("wrap",x);var T="";for(var y in x.attributes)T+=" "+y+'="'+(x.attributes[y]||"").replace(/"/g,""")+'"';return"<"+x.tag+' class="'+x.classes.join(" ")+'"'+T+">"+x.content+"</"+x.tag+">"};function i(g,_,m,C){g.lastIndex=_;var x=g.exec(m);if(x&&C&&x[1]){var N=x[1].length;x.index+=N,x[0]=x[0].slice(N)}return x}function l(g,_,m,C,x,N){for(var T in m){if(!m.hasOwnProperty(T)||!m[T])continue;var y=m[T];y=Array.isArray(y)?y:[y];for(var S=0;S<y.length;++S){if(N&&N.cause==T+","+S)return;var E=y[S],O=E.inside,$=!!E.lookbehind,I=!!E.greedy,k=E.alias;if(I&&!E.pattern.global){var L=E.pattern.toString().match(/[imsuy]*$/)[0];E.pattern=RegExp(E.pattern.source,L+"g")}var z=E.pattern||E;for(var M=C.next,Z=x;M!==_.tail;Z+=M.value.length,M=M.next){if(N&&Z>=N.reach)break;var ot=M.value;if(_.length>g.length)return;if(ot instanceof s)continue;var gt=1,rt;if(I){if(rt=i(z,Z,g,$),!rt||rt.index>=g.length)break;var Mt=rt.index,$e=rt.index+rt[0].length,ae=Z;ae+=M.value.length;while(Mt>=ae)M=M.next,ae+=M.value.length;if(ae-=M.value.length,Z=ae,M.value instanceof s)continue;for(var j=M;j!==_.tail&&(ae<$e||typeof j.value==="string");j=j.next)gt++,ae+=j.value.length;gt--,ot=g.slice(Z,ae),rt.index-=Z}else if(rt=i(z,0,ot,$),!rt)continue;var Mt=rt.index,vt=rt[0],Ie=ot.slice(0,Mt),ce=ot.slice(Mt+vt.length),Ce=Z+ot.length;if(N&&Ce>N.reach)N.reach=Ce;var ue=M.prev;if(Ie)ue=c(_,ue,Ie),Z+=Ie.length;u(_,ue,gt);var Fe=new s(T,O?r.tokenize(vt,O):vt,k,vt);if(M=c(_,ue,Fe),ce)c(_,M,ce);if(gt>1){var Je={cause:T+","+S,reach:Ce};if(l(g,_,m,M.prev,Z,Je),N&&Je.reach>N.reach)N.reach=Je.reach}}}}}function a(){var g={value:null,prev:null,next:null},_={value:null,prev:g,next:null};g.next=_,this.head=g,this.tail=_,this.length=0}function c(g,_,m){var C=_.next,x={value:m,prev:_,next:C};return _.next=x,C.prev=x,g.length++,x}function u(g,_,m){var C=_.next;for(var x=0;x<m&&C!==g.tail;x++)C=C.next;_.next=C,C.prev=_,g.length-=x}function d(g){var _=[],m=g.head.next;while(m!==g.tail)_.push(m.value),m=m.next;return _}if(!t.document){if(!t.addEventListener)return r;if(!r.disableWorkerMessageHandler)t.addEventListener("message",function(g){var _=JSON.parse(g.data),m=_.language,C=_.code,x=_.immediateClose;if(t.postMessage(r.highlight(C,r.languages[m],m)),x)t.close()},!1);return r}var f=r.util.currentScript();if(f){if(r.filename=f.src,f.hasAttribute("data-manual"))r.manual=!0}function h(){if(!r.manual)r.highlightAll()}if(!r.manual){var p=document.readyState;if(p==="loading"||p==="interactive"&&f&&f.defer)document.addEventListener("DOMContentLoaded",h);else if(window.requestAnimationFrame)window.requestAnimationFrame(h);else window.setTimeout(h,16)}return r}(EO);if(typeof Sa<"u"&&Sa.exports)Sa.exports=H;if(typeof global<"u")global.Prism=H;H.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};H.languages.markup.tag.inside["attr-value"].inside.entity=H.languages.markup.entity;H.languages.markup.doctype.inside["internal-subset"].inside=H.languages.markup;H.hooks.add("wrap",function(t){if(t.type==="entity")t.attributes.title=t.content.replace(/&/,"&")});Object.defineProperty(H.languages.markup.tag,"addInlined",{value:function(e,n){var o={};o["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:H.languages[n]},o.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:o}};r["language-"+n]={pattern:/[\s\S]+/,inside:H.languages[n]};var s={};s[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:r},H.languages.insertBefore("markup","cdata",s)}});Object.defineProperty(H.languages.markup.tag,"addAttribute",{value:function(t,e){H.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:H.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});H.languages.html=H.languages.markup;H.languages.mathml=H.languages.markup;H.languages.svg=H.languages.markup;H.languages.xml=H.languages.extend("markup",{});H.languages.ssml=H.languages.xml;H.languages.atom=H.languages.xml;H.languages.rss=H.languages.xml;(function(t){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var n=t.languages.markup;if(n)n.tag.addInlined("style","css"),n.tag.addAttribute("style","css")})(H);H.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};H.languages.javascript=H.languages.extend("clike",{"class-name":[H.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});H.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;H.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:H.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:H.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:H.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:H.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:H.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});H.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:H.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});H.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});if(H.languages.markup)H.languages.markup.tag.addInlined("script","javascript"),H.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript");H.languages.js=H.languages.javascript;(function(){if(typeof H>"u"||typeof document>"u")return;if(!Element.prototype.matches)Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;var t="Loading…",e=function(f,h){return"✖ Error "+f+" while fetching file: "+h},n="✖ Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},r="data-src-status",s="loading",i="loaded",l="failed",a="pre[data-src]:not(["+r+'="'+i+'"]):not(['+r+'="'+s+'"])';function c(f,h,p){var g=new XMLHttpRequest;g.open("GET",f,!0),g.onreadystatechange=function(){if(g.readyState==4)if(g.status<400&&g.responseText)h(g.responseText);else if(g.status>=400)p(e(g.status,g.statusText));else p(n)},g.send(null)}function u(f){var h=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(f||"");if(h){var p=Number(h[1]),g=h[2],_=h[3];if(!g)return[p,p];if(!_)return[p,void 0];return[p,Number(_)]}return}H.hooks.add("before-highlightall",function(f){f.selector+=", "+a}),H.hooks.add("before-sanity-check",function(f){var h=f.element;if(h.matches(a)){f.code="",h.setAttribute(r,s);var p=h.appendChild(document.createElement("CODE"));p.textContent=t;var g=h.getAttribute("data-src"),_=f.language;if(_==="none"){var m=(/\.(\w+)$/.exec(g)||[,"none"])[1];_=o[m]||m}H.util.setLanguage(p,_),H.util.setLanguage(h,_);var C=H.plugins.autoloader;if(C)C.loadLanguages(_);c(g,function(x){h.setAttribute(r,i);var N=u(h.getAttribute("data-range"));if(N){var T=x.split(/\r\n?|\n/g),y=N[0],S=N[1]==null?T.length:N[1];if(y<0)y+=T.length;if(y=Math.max(0,Math.min(y-1,T.length)),S<0)S+=T.length;if(S=Math.max(0,Math.min(S,T.length)),x=T.slice(y,S).join(`
|
|
2
2
|
`),!h.hasAttribute("data-start"))h.setAttribute("data-start",String(y+1))}p.textContent=x,H.highlightElement(p)},function(x){h.setAttribute(r,l),p.textContent=x})}}),H.plugins.fileHighlight={highlight:function(h){var p=(h||document).querySelectorAll(a);for(var g=0,_;_=p[g++];)H.highlightElement(_)}};var d=!1;H.fileHighlight=function(){if(!d)console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),d=!0;H.plugins.fileHighlight.highlight.apply(this,arguments)}})()});var di=Dt(Bt(),1);var Kt=Dt(Bt(),1);var rs=Dt(Bt(),1);var La={};at(La,{useLexicalComposerContext:()=>XS,createLexicalComposerContext:()=>VS,LexicalComposerContext:()=>Uf});var fi=Dt(Bt(),1),Uf=fi.createContext(null);function VS(t,e){let n=null;return t!=null&&(n=t[1]),{getTheme:function(){return e!=null?e:n!=null?n.getTheme():null}}}function XS(){let t=fi.useContext(Uf);return t==null&&function(e,...n){let o=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(let s of n)r.append("v",s);throw o.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${o.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),t}var ka=La,Yf=ka.LexicalComposerContext,Gf=ka.createLexicalComposerContext,mt=ka.useLexicalComposerContext;var du={};at(du,{toggleTextFormatType:()=>Ns,shallowMergeConfig:()=>ZT,setNodeIndentFromDOM:()=>fp,setDOMUnmanaged:()=>IT,safeCast:()=>qT,resetRandomKey:()=>NT,removeFromParent:()=>oo,removeClassNamesFromElement:()=>jT,normalizeClassNames:()=>$s,mergeRegister:()=>yp,makeStepwiseIterator:()=>lu,isSelectionWithinEditor:()=>Ms,isSelectionCapturedInDecoratorInput:()=>Yc,isModifierMatch:()=>op,isLexicalEditor:()=>Ji,isInlineDomNode:()=>dp,isHTMLElement:()=>de,isHTMLAnchorElement:()=>wT,isExactShortcutMatch:()=>dt,isDocumentFragment:()=>up,isDOMUnmanaged:()=>gp,isDOMTextNode:()=>pn,isDOMNode:()=>Er,isDOMDocumentNode:()=>qh,isCurrentlyReadOnlyMode:()=>Sr,isBlockDomNode:()=>_c,getTransformSetFromKlass:()=>Jh,getTextDirection:()=>ET,getStaticNodeConfig:()=>ws,getRegisteredNodeOrThrow:()=>Hc,getRegisteredNode:()=>Uc,getNearestEditorFromDOMNode:()=>Gc,getEditorPropertyFromDOMNode:()=>As,getDOMTextNode:()=>$o,getDOMSelectionFromTarget:()=>cp,getDOMSelection:()=>nn,getDOMOwnerDocument:()=>Qc,flipDirection:()=>co,defineExtension:()=>JT,declarePeerDependency:()=>XT,createState:()=>ON,createSharedNodeState:()=>Jg,createEditor:()=>yT,createCommand:()=>V,configExtension:()=>VT,buildImportMap:()=>VN,addClassNamesToElement:()=>QT,UNDO_COMMAND:()=>wc,TextNode:()=>ko,TabNode:()=>yr,TEXT_TYPE_TO_FORMAT:()=>ne,SKIP_SELECTION_FOCUS_TAG:()=>fc,SKIP_SCROLL_INTO_VIEW_TAG:()=>Ah,SKIP_DOM_SELECTION_TAG:()=>vh,SKIP_COLLAB_TAG:()=>QN,SELECT_ALL_COMMAND:()=>ic,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:()=>$N,SELECTION_CHANGE_COMMAND:()=>bc,RootNode:()=>Nr,REMOVE_TEXT_COMMAND:()=>sc,REDO_COMMAND:()=>Rc,ParagraphNode:()=>Tr,PASTE_TAG:()=>ZN,PASTE_COMMAND:()=>Dc,OUTDENT_CONTENT_COMMAND:()=>LN,NODE_STATE_KEY:()=>SN,MOVE_TO_START:()=>oh,MOVE_TO_END:()=>eh,LineBreakNode:()=>xr,KEY_TAB_COMMAND:()=>uh,KEY_SPACE_COMMAND:()=>ih,KEY_MODIFIER_COMMAND:()=>mh,KEY_ESCAPE_COMMAND:()=>ah,KEY_ENTER_COMMAND:()=>Di,KEY_DOWN_COMMAND:()=>$c,KEY_DELETE_COMMAND:()=>ch,KEY_BACKSPACE_COMMAND:()=>lh,KEY_ARROW_UP_COMMAND:()=>rh,KEY_ARROW_RIGHT_COMMAND:()=>th,KEY_ARROW_LEFT_COMMAND:()=>nh,KEY_ARROW_DOWN_COMMAND:()=>sh,IS_UNDERLINE:()=>rN,IS_SUPERSCRIPT:()=>lN,IS_SUBSCRIPT:()=>iN,IS_STRIKETHROUGH:()=>oN,IS_ITALIC:()=>nN,IS_HIGHLIGHT:()=>yc,IS_CODE:()=>sN,IS_BOLD:()=>eN,IS_ALL_FORMATTING:()=>aN,INTERNAL_$isBlock:()=>Wn,INSERT_TAB_COMMAND:()=>IN,INSERT_PARAGRAPH_COMMAND:()=>rc,INSERT_LINE_BREAK_COMMAND:()=>as,INPUT_COMMAND:()=>Mc,INDENT_CONTENT_COMMAND:()=>FN,HISTORY_PUSH_TAG:()=>qN,HISTORY_MERGE_TAG:()=>Si,HISTORIC_TAG:()=>XN,FORMAT_TEXT_COMMAND:()=>to,FORMAT_ELEMENT_COMMAND:()=>kN,FOCUS_COMMAND:()=>ph,ElementNode:()=>Bo,DecoratorNode:()=>Gi,DROP_COMMAND:()=>dh,DRAGSTART_COMMAND:()=>fh,DRAGOVER_COMMAND:()=>gh,DRAGEND_COMMAND:()=>hh,DELETE_WORD_COMMAND:()=>xs,DELETE_LINE_COMMAND:()=>ys,DELETE_CHARACTER_COMMAND:()=>Cs,CUT_COMMAND:()=>Fc,COPY_COMMAND:()=>Ic,CONTROLLED_TEXT_INSERTION_COMMAND:()=>fr,COMPOSITION_START_TAG:()=>Dh,COMPOSITION_START_COMMAND:()=>Ac,COMPOSITION_END_TAG:()=>wh,COMPOSITION_END_COMMAND:()=>vc,COMMAND_PRIORITY_NORMAL:()=>mT,COMMAND_PRIORITY_LOW:()=>_T,COMMAND_PRIORITY_HIGH:()=>CT,COMMAND_PRIORITY_EDITOR:()=>ur,COMMAND_PRIORITY_CRITICAL:()=>xT,COLLABORATION_TAG:()=>Mh,CLICK_COMMAND:()=>jg,CLEAR_HISTORY_COMMAND:()=>KN,CLEAR_EDITOR_COMMAND:()=>PN,CAN_UNDO_COMMAND:()=>WN,CAN_REDO_COMMAND:()=>BN,BLUR_COMMAND:()=>_h,BEFORE_INPUT_COMMAND:()=>Oc,ArtificialNode__DO_NOT_USE:()=>Wc,$updateRangeSelectionFromCaretRange:()=>hs,$splitNode:()=>DT,$splitAtPointCaretNext:()=>GT,$setState:()=>AN,$setSelectionFromCaretRange:()=>_p,$setSelection:()=>ye,$setPointFromCaret:()=>Cr,$setCompositionKey:()=>Ht,$selectAll:()=>OT,$rewindSiblingCaret:()=>br,$removeTextFromCaretRange:()=>mp,$parseSerializedNode:()=>gT,$onUpdate:()=>ip,$normalizeSelection__EXPERIMENTAL:()=>bi,$normalizeCaret:()=>Xe,$nodesOfType:()=>MT,$isTokenOrTab:()=>no,$isTokenOrSegmented:()=>Kn,$isTextPointCaretSlice:()=>zT,$isTextPointCaret:()=>Hn,$isTextNode:()=>B,$isTabNode:()=>kc,$isSiblingCaret:()=>Lo,$isRootOrShadowRoot:()=>ke,$isRootNode:()=>Zt,$isRangeSelection:()=>G,$isParagraphNode:()=>Yh,$isNodeSelection:()=>bs,$isNodeCaret:()=>PT,$isLineBreakNode:()=>vo,$isLeafNode:()=>bT,$isInlineElementOrDecoratorNode:()=>vT,$isExtendableTextPointCaret:()=>Cp,$isElementNode:()=>D,$isEditorState:()=>hT,$isDecoratorNode:()=>Ct,$isChildCaret:()=>Qe,$isBlockElementNode:()=>iT,$insertNodes:()=>cT,$hasUpdateTag:()=>AT,$hasAncestor:()=>ki,$getWritableNodeState:()=>Ec,$getTextPointCaretSlice:()=>Cc,$getTextPointCaret:()=>so,$getTextNodeOffset:()=>je,$getTextContent:()=>uT,$getStateChange:()=>MN,$getState:()=>Ei,$getSiblingCaret:()=>Gt,$getSelection:()=>ct,$getRoot:()=>Me,$getPreviousSelection:()=>Ko,$getNodeFromDOMNode:()=>Jc,$getNodeByKeyOrThrow:()=>ap,$getNodeByKey:()=>Ft,$getNearestRootOrShadowRoot:()=>lp,$getNearestNodeFromDOMNode:()=>Xi,$getEditor:()=>eu,$getCommonAncestorResultBranchOrder:()=>cu,$getCommonAncestor:()=>gs,$getCollapsedCaretRange:()=>pp,$getChildCaretOrSelf:()=>hp,$getChildCaretAtIndex:()=>xp,$getChildCaret:()=>Un,$getCharacterOffsets:()=>gc,$getCaretRangeInDirection:()=>uu,$getCaretRange:()=>io,$getCaretInDirection:()=>ao,$getAdjacentSiblingOrParentSiblingCaret:()=>HT,$getAdjacentNode:()=>rp,$getAdjacentChildCaret:()=>mr,$findMatchingParent:()=>fs,$extendCaretToRange:()=>iu,$createTextNode:()=>Wt,$createTabNode:()=>zi,$createRangeSelectionFromDom:()=>lT,$createRangeSelection:()=>Ph,$createPoint:()=>tn,$createParagraphNode:()=>zn,$createNodeSelection:()=>Pc,$createLineBreakNode:()=>pr,$create:()=>FT,$copyNode:()=>tu,$comparePointCaretNext:()=>au,$cloneWithPropertiesEphemeral:()=>$T,$cloneWithProperties:()=>nu,$caretRangeFromSelection:()=>xc,$caretFromPoint:()=>lo,$applyNodeReplacement:()=>Ds,$addUpdateTag:()=>qi});function R(t,...e){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(let r of e)o.append("v",r);throw n.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Pg(t,...e){let n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(let r of e)o.append("v",r);n.search=o.toString(),console.warn(`Minified Lexical warning #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var en=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,qS=en&&"documentMode"in document?document.documentMode:null,Ve=en&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ro=en&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Ti=!(!en||!("InputEvent"in window)||qS)&&"getTargetRanges"in new window.InputEvent("input"),Pi=en&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Es=en&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ZS=en&&/Android/.test(navigator.userAgent),Kg=en&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Va=en&&ZS&&Kg,Ki=en&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Ve&&!Kg,QS=0,jS=1,tN=2,eN=1,nN=2,oN=4,rN=8,sN=16,iN=32,lN=64,yc=128,aN=2047,cN=1,uN=2,dN=3,fN=4,gN=5,hN=6,ps=Pi||Es||Ki?" ":"",Bi=`
|
|
3
3
|
|
|
4
4
|
`,Sc=ro?" ":ps,Bg="֑-߿יִ-﷽ﹰ-ﻼ",Wg="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",pN=new RegExp("^[^"+Wg+"]*["+Bg+"]"),_N=new RegExp("^[^"+Bg+"]*["+Wg+"]"),ne={bold:1,capitalize:1024,code:16,highlight:yc,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},mN={directionless:1,unmergeable:2},Xa={center:2,end:6,justify:4,left:1,right:3,start:5},CN={[uN]:"center",[hN]:"end",[fN]:"justify",[cN]:"left",[dN]:"right",[gN]:"start"},xN={normal:0,segmented:2,token:1},yN={[QS]:"normal",[tN]:"segmented",[jS]:"token"},SN="$",Jf="$config";function zg(t,e,n,o,r,s){let i=t.getFirstChild();for(;i!==null;){let l=i.__key;i.__parent===e&&(D(i)&&zg(i,l,n,o,r,s),n.has(l)||s.delete(l),r.push(l)),i=i.getNextSibling()}}var qa=!1,Nc=0;function NN(t){Nc=t.timeStamp}function Pa(t,e,n){let o=t.nodeName==="BR",r=e.__lexicalLineBreak;return r&&(t===r||o&&t.previousSibling===r)||o&&Vi(t,n)!==void 0}function TN(t,e,n){let o=nn(Ae(n)),r=null,s=null;o!==null&&o.anchorNode===t&&(r=o.anchorOffset,s=o.focusOffset);let i=t.nodeValue;i!==null&&qc(e,i,r,s,!1)}function EN(t,e,n){if(G(t)){let o=t.anchor.getNode();if(o.is(n)&&t.format!==o.getFormat())return!1}return pn(e)&&n.isAttached()}function bN(t,e,n,o){for(let r=t;r&&!gp(r);r=vs(r)){let s=Vi(r,e);if(s!==void 0){let i=Ft(s,n);if(i)return Ct(i)||!de(r)?void 0:[r,i]}else if(r===o)return[o,jh(n)]}}function Hg(t,e,n){qa=!0;let o=performance.now()-Nc>100;try{hn(t,()=>{let r=ct()||function(f){return f.getEditorState().read(()=>{let h=ct();return h!==null?h.clone():null})}(t),s=new Map,i=t.getRootElement(),l=t._editorState,a=t._blockCursorElement,c=!1,u="";for(let f=0;f<e.length;f++){let h=e[f],p=h.type,g=h.target,_=bN(g,t,l,i);if(!_)continue;let[m,C]=_;if(p==="characterData")o&&B(C)&&pn(g)&&EN(r,g,C)&&TN(g,C,t);else if(p==="childList"){c=!0;let x=h.addedNodes;for(let y=0;y<x.length;y++){let S=x[y],E=Jc(S),O=S.parentNode;if(O!=null&&S!==a&&E===null&&!Pa(S,O,t)){if(ro){let $=(de(S)?S.innerText:null)||S.nodeValue;$&&(u+=$)}O.removeChild(S)}}let N=h.removedNodes,T=N.length;if(T>0){let y=0;for(let S=0;S<T;S++){let E=N[S];(Pa(E,g,t)||a===E)&&(g.appendChild(E),y++)}T!==y&&s.set(m,C)}}}if(s.size>0)for(let[f,h]of s)h.reconcileObservedMutation(f,t);let d=n.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){let h=d[f],p=h.addedNodes,g=h.target;for(let _=0;_<p.length;_++){let m=p[_],C=m.parentNode;C==null||m.nodeName!=="BR"||Pa(m,g,t)||C.removeChild(m)}}n.takeRecords()}r!==null&&(c&&ye(r),ro&&sp(t)&&r.insertRawText(u))})}finally{qa=!1}}function Ug(t){let e=t._observer;if(e!==null)Hg(t,e.takeRecords(),e)}function Yg(t){(function(e){Nc===0&&Ae(e).addEventListener("textInput",NN,!0)})(t),t._observer=new MutationObserver((e,n)=>{Hg(t,e,n)})}class Gg{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(t,e){this.key=t,this.parse=e.parse.bind(e),this.unparse=(e.unparse||vN).bind(e),this.isEqual=(e.isEqual||Object.is).bind(e),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=e.resetOnCopyNode||!1}}function ON(t,e){return new Gg(t,e)}function Ei(t,e,n="latest"){let o=(n==="latest"?t.getLatest():t).__state;return o?o.getValue(e):e.defaultValue}function MN(t,e,n){let o=Ei(t,n,"direct"),r=Ei(e,n,"direct");return n.isEqual(o,r)?null:[o,r]}function AN(t,e,n){let o;if(zt(),typeof n=="function"){let s=t.getLatest(),i=Ei(s,e);if(o=n(i),e.isEqual(i,o))return s}else o=n;let r=t.getWritable();return Ec(r).updateFromKnown(e,o),r}function Jg(t){let e=new Map,n=new Set;for(let o=typeof t=="function"?t:t.replace;o.prototype&&o.prototype.getType!==void 0;o=Object.getPrototypeOf(o)){let{ownNodeConfig:r}=ws(o);if(r&&r.stateConfigs)for(let s of r.stateConfigs){let i;"stateConfig"in s?(i=s.stateConfig,s.flat&&n.add(i.key)):i=s,e.set(i.key,i)}}return{flatKeys:n,sharedConfigMap:e}}class Tc{node;knownState;unknownState;sharedNodeState;size;constructor(t,e,n=void 0,o=new Map,r=void 0){this.node=t,this.sharedNodeState=e,this.unknownState=n,this.knownState=o;let{sharedConfigMap:s}=this.sharedNodeState,i=r!==void 0?r:function(l,a,c){let u=c.size;if(a)for(let d in a){let f=l.get(d);f&&c.has(f)||u++}return u}(s,n,o);this.size=i}getValue(t){let e=this.knownState.get(t);if(e!==void 0)return e;this.sharedNodeState.sharedConfigMap.set(t.key,t);let n=t.defaultValue;if(this.unknownState&&t.key in this.unknownState){let o=this.unknownState[t.key];o!==void 0&&(n=t.parse(o)),this.updateFromKnown(t,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let t={...this.unknownState},e={};for(let[n,o]of this.knownState)n.isEqual(o,n.defaultValue)?delete t[n.key]:t[n.key]=n.unparse(o);for(let n of this.sharedNodeState.flatKeys)n in t&&(e[n]=t[n],delete t[n]);return Vf(t)&&(e.$=t),e}getWritable(t){if(this.node===t)return this;let{sharedNodeState:e,unknownState:n}=this,o=new Map(this.knownState);return new Tc(t,e,function(r,s,i){let l;if(i)for(let[a,c]of Object.entries(i)){let u=r.get(a);u?s.has(u)||s.set(u,u.parse(c)):(l=l||{},l[a]=c)}return l}(e.sharedConfigMap,o,n),o,this.size)}resetOnCopyNode(){for(let t of this.knownState.keys())t.resetOnCopyNode&&this.knownState.set(t,t.defaultValue);return this}updateFromKnown(t,e){let n=t.key;this.sharedNodeState.sharedConfigMap.set(n,t);let{knownState:o,unknownState:r}=this;o.has(t)||r&&n in r||(r&&(delete r[n],this.unknownState=Vf(r)),this.size++),o.set(t,e)}updateFromUnknown(t,e){let n=this.sharedNodeState.sharedConfigMap.get(t);n?this.updateFromKnown(n,n.parse(e)):(this.unknownState=this.unknownState||{},(t in this.unknownState)||this.size++,this.unknownState[t]=e)}updateFromJSON(t){let{knownState:e}=this;for(let n of e.keys())e.set(n,n.defaultValue);if(this.size=e.size,this.unknownState=void 0,t)for(let[n,o]of Object.entries(t))this.updateFromUnknown(n,o)}}function Ec(t){let e=t.getWritable(),n=e.__state?e.__state.getWritable(e):new Tc(e,Vg(e));return e.__state=n,n}function Vg(t){return t.__state?t.__state.sharedNodeState:Hc(eu(),t.getType()).sharedNodeState}function Vf(t){if(t)for(let e in t)return t}function vN(t){return t}function Xf(t,e,n){for(let[o,r]of e.knownState){if(t.has(o.key))continue;t.add(o.key);let s=n?n.getValue(o):o.defaultValue;if(s!==r&&!o.isEqual(s,r))return!0}return!1}function qf(t,e,n){let{unknownState:o}=e,r=n?n.unknownState:void 0;if(o)for(let[s,i]of Object.entries(o)){if(t.has(s))continue;if(t.add(s),i!==(r?r[s]:void 0))return!0}return!1}function Zf(t,e){let n=t.__state;return n&&n.node===t?n.getWritable(e):n}function Qf(t,e){let{__mode:n,__format:o,__style:r}=t,s=e.__mode,i=e.__format,l=e.__style,a=t.__state,c=e.__state;return(n===null||n===s)&&(o===null||o===i)&&(r===null||r===l)&&(t.__state===null||a===c||function(u,d){if(u===d)return!0;if(u&&d&&u.size!==d.size)return!1;let f=new Set;return!(u&&Xf(f,u,d)||d&&Xf(f,d,u)||u&&qf(f,u,d)||d&&qf(f,d,u))}(a,c))}function jf(t,e){let n=t.mergeWithSibling(e),o=_t()._normalizedNodes;return o.add(t.__key),o.add(e.__key),n}function tg(t){let e,n,o=t;if(o.__text!==""||!o.isSimpleText()||o.isUnmergeable()){for(;(e=o.getPreviousSibling())!==null&&B(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Qf(e,o)){o=jf(e,o);break}break}e.remove()}for(;(n=o.getNextSibling())!==null&&B(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(Qf(o,n)){o=jf(o,n);break}break}n.remove()}}else o.remove()}function bi(t){return eg(t.anchor),eg(t.focus),t}function eg(t){for(;t.type==="element";){let e=t.getNode(),n=t.offset,o,r;if(n===e.getChildrenSize()?(o=e.getChildAtIndex(n-1),r=!0):(o=e.getChildAtIndex(n),r=!1),B(o)){t.set(o.__key,r?o.getTextContentSize():0,"text",!0);break}if(!D(o))break;t.set(o.__key,r?o.getChildrenSize():0,"element",!0)}}var Do,Qt,_s,Wi,Za,Qa,wo,qe,ja,ms,It="",gn=null,Mo=null,ar=!1,Oi=!1;function Mi(t,e){let n=wo.get(t);if(e!==null){let o=oc(t);o.parentNode===e&&e.removeChild(o)}if(qe.has(t)||Qt._keyToDOMMap.delete(t),D(n)){let o=vi(n,wo);tc(o,0,o.length-1,null)}n!==void 0&&Zc(ms,_s,Wi,n,"destroyed")}function tc(t,e,n,o){for(let r=e;r<=n;++r){let s=t[r];s!==void 0&&Mi(s,o)}}function Oo(t,e){t.setProperty("text-align",e)}var DN="40px";function Xg(t,e){let n=Do.theme.indent;if(typeof n=="string"){let r=t.classList.contains(n);e>0&&!r?t.classList.add(n):e<1&&r&&t.classList.remove(n)}if(e===0)return void t.style.setProperty("padding-inline-start","");let o=getComputedStyle(Qt._rootElement||t).getPropertyValue("--lexical-indent-base-value")||DN;t.style.setProperty("padding-inline-start",`calc(${e} * ${o})`)}function qg(t,e){let n=t.style;e===0?Oo(n,""):e===1?Oo(n,"left"):e===2?Oo(n,"center"):e===3?Oo(n,"right"):e===4?Oo(n,"justify"):e===5?Oo(n,"start"):e===6&&Oo(n,"end")}function ec(t,e){let n=function(o){let r=o.__dir;if(r!==null)return r;if(Zt(o))return null;let s=o.getParentOrThrow();return Zt(s)&&s.__dir===null?"auto":null}(e);n!==null?t.dir=n:t.removeAttribute("dir")}function Ai(t,e){let n=qe.get(t);n===void 0&&R(60);let o=n.createDOM(Do,Qt);if(function(r,s,i){let l=i._keyToDOMMap;(function(a,c,u){let d=`__lexicalKey_${c._key}`;a[d]=u})(s,i,r),l.set(r,s)}(t,o,Qt),B(n)?o.setAttribute("data-lexical-text","true"):Ct(n)&&o.setAttribute("data-lexical-decorator","true"),D(n)){let{__indent:r,__size:s}=n;if(ec(o,n),r!==0&&Xg(o,r),s!==0){let l=s-1;nc(vi(n,qe),n,0,l,n.getDOMSlot(o))}let i=n.__format;i!==0&&qg(o,i),n.isInline()||Zg(null,n,o)}else{let r=n.getTextContent();if(Ct(n)){let s=n.decorate(Qt,Do);s!==null&&Qg(t,s),o.contentEditable="false"}It+=r}return e!==null&&e.insertChild(o),Zc(ms,_s,Wi,n,"created"),o}function nc(t,e,n,o,r){let s=It;It="";let i=n;for(;i<=o;++i){Ai(t[i],r);let l=qe.get(t[i]);l!==null&&B(l)?gn===null&&(gn=l.getFormat(),Mo=l.getStyle()):D(l)&&i<o&&!l.isInline()&&(It+=Bi)}r.element.__lexicalTextContent=It,It=s+It}function ng(t,e){if(t){let n=t.__last;if(n){let o=e.get(n);if(o)return vo(o)?"line-break":Ct(o)&&o.isInline()?"decorator":null}return"empty"}return null}function Zg(t,e,n){let o=ng(t,wo),r=ng(e,qe);o!==r&&e.getDOMSlot(n).setManagedLineBreak(r)}function wN(t,e,n){var o;gn=null,Mo=null,function(r,s,i){let l=It,a=r.__size,c=s.__size;It="";let u=i.element;if(a===1&&c===1){let d=r.__first,f=s.__first;if(d===f)mi(d,u);else{let p=oc(d),g=Ai(f,null);try{u.replaceChild(g,p)}catch(_){if(typeof _=="object"&&_!=null){let m=`${_.toString()} Parent: ${u.tagName}, new child: {tag: ${g.tagName} key: ${f}}, old child: {tag: ${p.tagName}, key: ${d}}.`;throw Error(m)}throw _}Mi(d,null)}let h=qe.get(f);B(h)&&gn===null&&(gn=h.getFormat(),Mo=h.getStyle())}else{let d=vi(r,wo),f=vi(s,qe);if(d.length!==a&&R(227),f.length!==c&&R(228),a===0)c!==0&&nc(f,0,0,c-1,i);else if(c===0){if(a!==0){let h=i.after==null&&i.before==null&&i.element.__lexicalLineBreak==null;tc(d,0,a-1,h?null:u),h&&(u.textContent="")}}else(function(h,p,g,_,m,C){let x=_-1,N=m-1,T,y,S=C.getFirstChild(),E=0,O=0;for(;E<=x&&O<=N;){let k=p[E],L=g[O];if(k===L)S=Ka(mi(L,C.element)),E++,O++;else{if(y===void 0&&(y=og(g,O)),T===void 0)T=og(p,E);else if(!T.has(k)){E++;continue}if(!y.has(k)){S=Ka(oc(k)),Mi(k,C.element),E++,T.delete(k);continue}if(T.has(L)){let M=_r(Qt,L);M!==S&&C.withBefore(S).insertChild(M),S=Ka(mi(L,C.element)),E++,O++}else Ai(L,C.withBefore(S)),O++}let z=qe.get(L);z!==null&&B(z)?gn===null&&(gn=z.getFormat(),Mo=z.getStyle()):D(z)&&O<=N&&!z.isInline()&&(It+=Bi)}let $=E>x,I=O>N;if($&&!I){let k=g[N+1],L=k===void 0?null:Qt.getElementByKey(k);nc(g,0,O,N,C.withBefore(L))}else I&&!$&&tc(p,E,x,C.element)})(0,d,f,a,c,i)}u.__lexicalTextContent=It,It=l+It}(t,e,e.getDOMSlot(n)),o=e,gn==null||gn===o.__textFormat||Oi||o.setTextFormat(gn),function(r){Mo==null||Mo===r.__textStyle||Oi||r.setTextStyle(Mo)}(e)}function vi(t,e){let n=[],o=t.__first;for(;o!==null;){let r=e.get(o);r===void 0&&R(101),n.push(o),o=r.__next}return n}function mi(t,e){let n=wo.get(t),o=qe.get(t);n!==void 0&&o!==void 0||R(61);let r=ar||Qa.has(t)||Za.has(t),s=_r(Qt,t);if(n===o&&!r){let i;if(D(n)){let l=s.__lexicalTextContent;typeof l=="string"?i=l:(i=n.getTextContent(),s.__lexicalTextContent=i)}else i=n.getTextContent();return It+=i,s}if(n!==o&&r&&Zc(ms,_s,Wi,o,"updated"),o.updateDOM(n,s,Do)){let i=Ai(t,null);return e===null&&R(62),e.replaceChild(i,s),Mi(t,null),i}if(D(n)){D(o)||R(334,t);let i=o.__indent;(ar||i!==n.__indent)&&Xg(s,i);let l=o.__format;if((ar||l!==n.__format)&&qg(s,l),r)wN(n,o,s),Zt(o)||o.isInline()||Zg(n,o,s);else{let a=s.__lexicalTextContent,c;typeof a=="string"?c=a:(c=n.getTextContent(),s.__lexicalTextContent=c),It+=c}if((ar||o.__dir!==n.__dir)&&(ec(s,o),Zt(o)&&!ar)){for(let a of o.getChildren())if(D(a))ec(_r(Qt,a.getKey()),a)}}else{let i=o.getTextContent();if(Ct(o)){let l=o.decorate(Qt,Do);l!==null&&Qg(t,l)}It+=i}if(!Oi&&Zt(o)&&o.__cachedText!==It){let i=o.getWritable();i.__cachedText=It,o=i}return s}function Qg(t,e){let{_pendingDecorators:n,_decorators:o}=Qt;if(n===null){if(o[t]===e)return;n=Qh(Qt)}n[t]=e}function Ka(t){let e=t.nextSibling;return e!==null&&e===Qt._blockCursorElement&&(e=e.nextSibling),e}function og(t,e){let n=new Set;for(let o=e;o<t.length;o++)n.add(t[o]);return n}function RN(t,e,n,o,r,s){It="",ar=o===2,Qt=n,Do=n._config,_s=n._nodes,Wi=Qt._listeners.mutation,Za=r,Qa=s,wo=t._nodeMap,qe=e._nodeMap,Oi=e._readOnly,ja=new Map(n._keyToDOMMap);let i=new Map;return ms=i,mi("root",null),Qt=void 0,_s=void 0,Za=void 0,Qa=void 0,wo=void 0,qe=void 0,Do=void 0,ja=void 0,ms=void 0,i}function oc(t){let e=ja.get(t);return e===void 0&&R(75,t),e}function V(t){return{type:t}}var bc=V("SELECTION_CHANGE_COMMAND"),$N=V("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),jg=V("CLICK_COMMAND"),Oc=V("BEFORE_INPUT_COMMAND"),Mc=V("INPUT_COMMAND"),Ac=V("COMPOSITION_START_COMMAND"),vc=V("COMPOSITION_END_COMMAND"),Cs=V("DELETE_CHARACTER_COMMAND"),as=V("INSERT_LINE_BREAK_COMMAND"),rc=V("INSERT_PARAGRAPH_COMMAND"),fr=V("CONTROLLED_TEXT_INSERTION_COMMAND"),Dc=V("PASTE_COMMAND"),sc=V("REMOVE_TEXT_COMMAND"),xs=V("DELETE_WORD_COMMAND"),ys=V("DELETE_LINE_COMMAND"),to=V("FORMAT_TEXT_COMMAND"),wc=V("UNDO_COMMAND"),Rc=V("REDO_COMMAND"),$c=V("KEYDOWN_COMMAND"),th=V("KEY_ARROW_RIGHT_COMMAND"),eh=V("MOVE_TO_END"),nh=V("KEY_ARROW_LEFT_COMMAND"),oh=V("MOVE_TO_START"),rh=V("KEY_ARROW_UP_COMMAND"),sh=V("KEY_ARROW_DOWN_COMMAND"),Di=V("KEY_ENTER_COMMAND"),ih=V("KEY_SPACE_COMMAND"),lh=V("KEY_BACKSPACE_COMMAND"),ah=V("KEY_ESCAPE_COMMAND"),ch=V("KEY_DELETE_COMMAND"),uh=V("KEY_TAB_COMMAND"),IN=V("INSERT_TAB_COMMAND"),FN=V("INDENT_CONTENT_COMMAND"),LN=V("OUTDENT_CONTENT_COMMAND"),dh=V("DROP_COMMAND"),kN=V("FORMAT_ELEMENT_COMMAND"),fh=V("DRAGSTART_COMMAND"),gh=V("DRAGOVER_COMMAND"),hh=V("DRAGEND_COMMAND"),Ic=V("COPY_COMMAND"),Fc=V("CUT_COMMAND"),ic=V("SELECT_ALL_COMMAND"),PN=V("CLEAR_EDITOR_COMMAND"),KN=V("CLEAR_HISTORY_COMMAND"),BN=V("CAN_REDO_COMMAND"),WN=V("CAN_UNDO_COMMAND"),ph=V("FOCUS_COMMAND"),_h=V("BLUR_COMMAND"),mh=V("KEY_MODIFIER_COMMAND"),Ln=Object.freeze({}),lc=[["keydown",function(t,e){if(Ss=t.timeStamp,Ch=t.key,e.isComposing())return;P(e,$c,t)}],["pointerdown",function(t,e){let{target:n,pointerType:o}=t;Er(n)&&o!=="touch"&&o!=="pen"&&t.button===0&&hn(e,()=>{Xh(n)||(uc=!0)})}],["compositionstart",function(t,e){P(e,Ac,t)}],["compositionend",function(t,e){ro?ls=!0:Es||!Pi&&!Ki?P(e,vc,t):(Ci=!0,xi=t.data)}],["input",function(t,e){t.stopPropagation(),hn(e,()=>{e.dispatchCommand(Mc,t)},{event:t}),cr=null}],["click",function(t,e){hn(e,()=>{let n=ct(),o=nn(Ae(e)),r=Ko();if(o){if(G(n)){let s=n.anchor,i=s.getNode();if(s.type==="element"&&s.offset===0&&n.isCollapsed()&&!Zt(i)&&Me().getChildrenSize()===1&&i.getTopLevelElementOrThrow().isEmpty()&&r!==null&&n.is(r))o.removeAllRanges(),n.dirty=!0;else if(t.detail===3&&!n.isCollapsed()){if(i!==n.focus.getNode()){let l=fs(i,(a)=>D(a)&&!a.isInline());D(l)&&l.select(0)}}}else if(t.pointerType==="touch"||t.pointerType==="pen"){let s=o.anchorNode;if(de(s)||pn(s))ye(Ui(r,o,e,t))}}P(e,jg,t)})}],["cut",Ln],["copy",Ln],["dragstart",Ln],["dragover",Ln],["dragend",Ln],["paste",Ln],["focus",Ln],["blur",Ln],["drop",Ln]];Ti&&lc.push(["beforeinput",(t,e)=>function(n,o){let r=n.inputType;if(r==="deleteCompositionText"||ro&&sp(o))return;if(r==="insertCompositionText")return;P(o,Oc,n)}(t,e)]);var Ss=0,Ch=null,xh=0,cr=null,ac=new WeakMap,wi=new WeakMap,cc=!1,uc=!1,cs=!1,ls=!1,Ci=!1,xi="",Ao=null,yh=[0,"",0,"root",0];function Sh(t,e,n,o,r){let{anchor:s,focus:i}=t,l=s.getNode(),a=_t(),c=nn(Ae(a)),u=c!==null?c.anchorNode:null,d=s.key,f=a.getElementByKey(d),h=n.length;return d!==i.key||!B(l)||(!r&&(!Ti||xh<o+50)||l.isDirty()&&h<2||tp(n))&&s.offset!==i.offset&&!l.isComposing()||Kn(l)||l.isDirty()&&h>1||(r||!Ti)&&f!==null&&!l.isComposing()&&u!==$o(f)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||!l.isComposing()&&(l.getFormat()!==t.format||l.getStyle()!==t.style)||function(p,g){if(g.isSegmented())return!0;if(!p.isCollapsed())return!1;let _=p.anchor.offset,m=g.getParentOrThrow(),C=no(g);return _===0?!g.canInsertTextBefore()||!m.canInsertTextBefore()&&!g.isComposing()||C||function(x){let N=x.getPreviousSibling();return(B(N)||D(N)&&N.isInline())&&!N.canInsertTextAfter()}(g):_===g.getTextContentSize()&&(!g.canInsertTextAfter()||!m.canInsertTextAfter()&&!g.isComposing()||C)}(t,l)}function rg(t,e){return pn(t)&&t.nodeValue!==null&&e!==0&&e!==t.nodeValue.length}function sg(t,e,n){let{anchorNode:o,anchorOffset:r,focusNode:s,focusOffset:i}=t;cc&&(cc=!1,rg(o,r)&&rg(s,i)&&!Ao)||hn(e,()=>{if(!n)return void ye(null);if(!Ms(e,o,s))return;let l=ct();if(Ao&&G(l)&&l.isCollapsed()){let a=l.anchor,c=Ao.anchor;(a.key===c.key&&a.offset===c.offset+1||a.offset===1&&c.getNode().is(a.getNode().getPreviousSibling()))&&(l=Ao.clone(),ye(l))}if(Ao=null,G(l)){let a=l.anchor,c=a.getNode();if(l.isCollapsed()){t.type==="Range"&&t.anchorNode===t.focusNode&&(l.dirty=!0);let u=Ae(e).event,d=u?u.timeStamp:performance.now(),[f,h,p,g,_]=yh,m=Me(),C=e.isComposing()===!1&&m.getTextContent()==="";if(d<_+200&&a.offset===p&&a.key===g)yi(l,f,h);else if(a.type==="text")B(c)||R(141),Nh(l,c);else if(a.type==="element"&&!C){D(c)||R(259);let x=a.getNode();x.isEmpty()?function(N,T){let y=T.getTextFormat(),S=T.getTextStyle();yi(N,y,S)}(l,x):yi(l,l.format,"")}}else{let u=a.key,d=l.focus.key,f=l.getNodes(),h=f.length,p=l.isBackward(),g=p?i:r,_=p?r:i,m=p?d:u,C=p?u:d,x=2047,N=!1;for(let T=0;T<h;T++){let y=f[T],S=y.getTextContentSize();if(B(y)&&S!==0&&!(T===0&&y.__key===m&&g===S||T===h-1&&y.__key===C&&_===0)&&(N=!0,x&=y.getFormat(),x===0))break}l.format=N?x:0}}P(e,bc,void 0)})}function yi(t,e,n){t.format===e&&t.style===n||(t.format=e,t.style=n,t.dirty=!0)}function Nh(t,e){yi(t,e.getFormat(),e.getStyle())}function Th(t){if(!t.getTargetRanges)return null;let e=t.getTargetRanges();return e.length===0?null:e[0]}function zN(t){let e=t.inputType,n=Th(t),o=_t(),r=ct();if(e==="deleteContentBackward"){if(r===null){let d=Ko();if(!G(d))return!0;ye(d.clone())}if(G(r)){let d=r.anchor.key===r.focus.key;if(s=t.timeStamp,Ch==="MediaLast"&&s<Ss+30&&o.isComposing()&&d){if(Ht(null),Ss=0,setTimeout(()=>{hn(o,()=>{Ht(null)})},30),G(r)){let f=r.anchor.getNode();f.markDirty(),B(f)||R(142),Nh(r,f)}}else{Ht(null),t.preventDefault();let f=r.anchor.getNode(),h=f.getTextContent(),p=f.canInsertTextAfter(),g=r.anchor.offset===0&&r.focus.offset===h.length,_=Va&&d&&!g&&p;if(_&&r.isCollapsed()&&(_=!Ct(rp(r.anchor,!0))),!_){P(o,Cs,!0);let m=ct();Va&&G(m)&&m.isCollapsed()&&(Ao=m,setTimeout(()=>Ao=null))}}return!0}}var s;if(!G(r))return!0;let i=t.data;cr!==null&&Xc(!1,o,cr),r.dirty&&cr===null||!r.isCollapsed()||Zt(r.anchor.getNode())||n===null||r.applyDOMRange(n),cr=null;let{anchor:l,focus:a}=r,c=l.getNode(),u=a.getNode();if(e==="insertText"||e==="insertTranspose"){if(i===`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as Y1}from"./chunk-0qdzjcny.js";import{p as w1,q as K1,r as J1}from"./chunk-4yybby29.js";import{E as X1,y as y1}from"./chunk-082zg4nr.js";import{K as z1}from"./chunk-44xtwvd7.js";import"./chunk-44370df5.js";import"./chunk-srs9jq8f.js";import{ba as G1}from"./chunk-4yhd7bmp.js";import"./chunk-6tv7rm3x.js";import"./chunk-t77dwtcc.js";import"./chunk-6nrynqdw.js";import"./chunk-5bkj2n94.js";import{vf as tz}from"./chunk-pt51m9h1.js";import"./chunk-f4d3v0nc.js";import"./chunk-kejt7kcr.js";import{Lf as rz}from"./chunk-2q7ew7yz.js";import"./chunk-j10gz94w.js";import"./chunk-ktvmxqfg.js";import{eg as az,fg as iz}from"./chunk-k1f3gj25.js";import"./chunk-hmmzbyy1.js";import"./chunk-d6d1j7qq.js";import"./chunk-7g2k89gq.js";import{ng as sz,pg as ez}from"./chunk-7xcyn1ba.js";import"./chunk-785kxysj.js";import"./chunk-ygsbmfcy.js";import"./chunk-1vs91e4q.js";import{kh as Lz}from"./chunk-16txy3r1.js";import"./chunk-90tbc5f4.js";import"./chunk-bkbqvxfv.js";import"./chunk-ts10cfmc.js";import"./chunk-rfsbzd39.js";import"./chunk-2sc2jxd3.js";import"./chunk-f32kxe6c.js";import"./chunk-2f35h4fn.js";import{si as oz}from"./chunk-4k2d8w9w.js";import{Bi as l,Ii as H,Ji as Sz,Ki as vz,Li as Dz,Mi as fz,Ni as Fz,Oi as jz,Pi as pz,Qi as mz,Ri as cz,Ti as uz,Ui as Iz,Vi as dz,Wi as lz,Yi as j,ui as Kz,wi as Az,zi as F}from"./chunk-s503pcvb.js";import"./chunk-axb1f1ae.js";import{$i as Pz,Dj as C,Sj as hz,Wl as Nz,aj as xz,bj as y,cj as _,hj as Rz,jj as bz,mj as Cz,qm as Xz,rk as Ez,tm as U,um as nz}from"./chunk-w9p59ahz.js";import{rn as qz}from"./chunk-txkmks1h.js";var Q=qz(Pz(),1);var p1=({item:w})=>{if(w.preview?.thumbnailUrl)return y("img",{src:w.preview.thumbnailUrl,alt:"Preview",className:"w-full h-full object-cover"});if(w.preview?.proxyType==="audio"||w.proxyType==="audio")return y("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:y(hz,{className:"w-5 h-5 text-muted-foreground"})});return y("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:y(Ez,{className:"w-5 h-5 text-muted-foreground"})})},Mz=({projectId:w,currentAssetId:G,parentFolderId:V,initialFiles:W,initialNextCursor:b})=>{let{ref:J,inView:L}=Lz({threshold:0,rootMargin:"200px"}),q=Q.useRef(null),M=Q.useRef(!0),[B,h]=Q.useState(W),[$,S]=Q.useState(b),[v,p]=Q.useState(!!b),[g,E]=Q.useState(!1);return Q.useEffect(()=>{h(W),S(b),p(!!b),M.current=!0},[W,b]),Q.useEffect(()=>{(async()=>{if(!$||g||!L||!v)return;E(!0);try{let k=await H.api.folders[":folderId"].search.$post({param:{folderId:V},json:{assetType:"file",after:$,first:200,recursively:!1,conditions:[]}});if(!k.ok)throw Error("Failed to fetch next page");let D=await k.json(),x=D.data||[];h((n)=>[...n,...x]),S(D.pageInfo?.cursor||void 0),p(!!D.pageInfo?.cursor&&x.length>0)}catch(k){console.error("Error fetching next page:",k)}finally{E(!1)}})()},[L,$,v,g,V]),Q.useEffect(()=>{if(B.some((k)=>k?.id===G)&&q.current)if(M.current)q.current.scrollIntoView({block:"center",inline:"center",behavior:"auto"}),M.current=!1;else q.current.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},[B,G]),y("div",{className:"h-24 md:h-full w-full md:w-24 bg-gray-100 dark:bg-gray-950 flex flex-row md:flex-col flex-shrink-0 select-none",children:_("div",{className:"flex-1 overflow-x-auto overflow-y-hidden md:overflow-y-auto md:overflow-x-hidden px-4 md:px-0 py-2 md:py-4 flex flex-row md:flex-col items-center gap-3 no-scrollbar",children:[B.map((T)=>{if(!T)return null;let k=T.id===G;return y("div",{ref:T.id===G?q:null,className:"flex-shrink-0",children:y(bz,{to:"/projects/$projectId/files/$fileId",params:{projectId:w,fileId:T.id},search:{version:void 0},className:Nz("rounded-lg border overflow-hidden flex items-center justify-center transition-all bg-muted/30 block",k?"w-[62px] h-[62px] opacity-100":"w-[52px] h-[52px] opacity-60 hover:opacity-100"),children:y(p1,{item:T})})},T.id)}),v&&y("div",{ref:J,className:"px-2 md:px-0 py-2 md:py-4 flex justify-center items-center h-full md:w-full flex-shrink-0",children:g&&y(C,{className:"h-5 w-5 animate-spin text-muted-foreground"})})]})})};var X=qz(Pz(),1);function m1(){let{projectId:w,fileId:G}=gz.useParams(),V=gz.useSearch(),W=V.version,b=V.start,J=W||G,L=V.cmpLeft,q=V.cmpRight,M=V.cmpActive??"left",B=!!V.compare&&!!L&&!!q,h=X.useRef(null),{teamId:$,ensureTeamIdForProject:S}=oz(),[v,p]=X.useState(360),[g,E]=X.useState([]),{fileViewRightSidebarCollapsed:T}=sz(),{isChatbotOpen:k}=iz(),[D,x]=X.useState(0),[n,m]=X.useState(null),[Gz,Z1]=X.useState(null),[_1,U1]=X.useState(void 0),[A,o]=X.useState({show:!1,files:[],nextCursor:void 0,folderId:void 0}),W1=H.api.files[":fileId"].metadata.$patch,{mutate:B1}=l({mutationFn:async(z)=>{let K=await W1(z);if(!K.ok)throw Error("Failed to patch metadata");return await K.json()}}),f=Az(),{members:$1,fetchProjectMembers:Jz}=rz(),H1=tz();X.useEffect(()=>{S(w)},[w,S]),X.useEffect(()=>{if(w)Jz(w,!0)},[w,Jz]),X.useEffect(()=>{if(w&&G)H.api.projects[":projectId"].recents.view.$post({param:{projectId:w},json:{assetId:G}}).catch(()=>{})},[w,G]);let{data:Yz,isLoading:Q1,isError:k1,isFetching:T1}=F({queryKey:["files",G],queryFn:async()=>{let z=await H.api.files[":fileId"].$get({param:{fileId:G}});if(!z.ok)throw Error("Failed to fetch stack");return await z.json()},enabled:!!$,placeholderData:Kz}),{data:O1,isLoading:V1,isError:q1,isFetching:P1}=F({queryKey:["files",W],queryFn:async()=>{let z=await H.api.files[":fileId"].$get({param:{fileId:W}});if(!z.ok)throw Error("Failed to fetch version");return await z.json()},enabled:!!$&&!!W,placeholderData:Kz}),{data:b1}=F({queryKey:["version_stacks",G,"versions"],queryFn:async()=>{let z=await H.api.version_stacks[":stackId"].versions.$get({param:{stackId:G}});if(!z.ok)throw Error("Failed to fetch versions");return await z.json()},enabled:!!w&&!!G&&(!!W||B)}),{data:N}=F({queryKey:["projects",w],queryFn:async()=>{let z=await H.api.projects[":projectId"].$get({param:{projectId:w}});if(!z.ok)throw Error("Failed to fetch project");return await z.json()}}),O=Rz(),{setProjectState:Zz,clearProjectState:_z}=az(),h1=Q1||!!W&&V1,E1=k1||!!W&&q1,N1=T1||!!W&&P1,Y=O1||Yz,P=W?b1:Yz?.versionStack?.versions,Z=Y?.ancestorFolders?.[0]?.id??N?.rootFolder??"",[a,c]=X.useState(!1),[u,Uz]=X.useState(""),r=X.useRef(null),s=X.useRef(!1),[L1,i]=X.useState(!1),M1=H.api.files[":fileId"].$put,{mutate:g1,mutateAsync:x1,isPending:Wz}=l({mutationFn:async(z)=>{let K=await M1(z);if(!K.ok)throw Error("Failed to rename file");return await K.json()},onSuccess:()=>{f.invalidateQueries({queryKey:["files"]}),f.invalidateQueries({queryKey:["version_stacks"]}),j.success(U.renamed_successfully?.()||"Renamed successfully"),c(!1)},onError:()=>{j.error(U.failed_to_rename?.()||"Failed to rename")}}),A1=H.api.files.$delete,{mutate:R1,mutateAsync:C1,isPending:Bz}=l({mutationFn:async(z)=>{if(!(await A1(z)).ok)throw Error("Failed to delete file")},onSuccess:()=>{if(f.invalidateQueries({queryKey:["files"]}),f.invalidateQueries({queryKey:["version_stacks"]}),j.success(U.deleted?.()||"Deleted"),i(!1),Z&&Z!==N?.rootFolder)O({to:"/projects/$projectId/folders/$folderId",params:{projectId:w,folderId:Z}});else O({to:"/projects/$projectId",params:{projectId:w}})},onError:()=>{j.error(U.failed_to_delete?.()||"Failed to delete")}}),S1=(z)=>{if(z?.preventDefault(),!u.trim()||!J)return;g1({param:{fileId:J},json:{name:u.trim()}})},v1=()=>{if(!J)return;R1({json:{ids:[J]}})};X.useEffect(()=>{if(Y&&N&&$)Zz({teamId:$,projectId:w,projectName:N.name??"",ancestorFolders:Y.ancestorFolders??[],currentAsset:{id:J||G,name:Y.name,type:"file",version:P?P.find((z)=>z.id===J)?.version??P.length:void 0,proxyType:Y.proxyType},isRootFolder:!1,fileId:G,downloadInfo:{originalKey:Y.media?.original?.key,videoTranscodes:Y.media?.videoTranscodes?.map((z)=>({key:z.key,width:z.width,height:z.height}))},versions:P,compareMode:B,canCompareVersions:(P?.length??0)>=2,onCompareVersions:()=>{let z=y1(P);if(!z)return;O({to:"/projects/$projectId/files/$fileId",params:{projectId:w,fileId:G},search:(K)=>({...K,version:void 0,compare:!0,cmpLeft:z.left.id,cmpRight:z.right.id,cmpActive:"left"})})},onFolderClick:(z)=>{O({to:"/projects/$projectId/folders/$folderId",params:{projectId:w,folderId:z}})},onRename:()=>{s.current=!1,Uz(Y?.name??""),c(!0)},onDelete:()=>{i(!0)}});return()=>_z()},[$,w,N,Y,P,J,G,B,Zz,_z,O]),X.useEffect(()=>{if(!a)return;let z=setTimeout(()=>{s.current=!0},1000);return()=>clearTimeout(z)},[a]);let D1=()=>{if(s.current)return;setTimeout(()=>{if(r.current)z1(r.current)},0)};if(X.useEffect(()=>{if(!Z||!J)return;if(A.folderId===Z)return;let z=!0;return(async()=>{try{let I="",kz=!1,zz=[],yz=void 0;for(let Tz=0;Tz<5;Tz++){let Oz=await H.api.folders[":folderId"].search.$post({param:{folderId:Z},json:{assetType:"file",after:I,first:200,recursively:!1,conditions:[]}});if(!Oz.ok)throw Error("Failed to search parent folder for carousel");let R=await Oz.json(),wz=R.data||[];if(zz.push(...wz),wz.some((d)=>d.id===J)){if(kz=!0,yz=R.pageInfo?.cursor||void 0,R.pageInfo?.cursor)try{let d=await H.api.folders[":folderId"].search.$post({param:{folderId:Z},json:{assetType:"file",after:R.pageInfo.cursor,first:200,recursively:!1,conditions:[]}});if(d.ok){let Vz=await d.json(),j1=Vz.data||[];zz.push(...j1),yz=Vz.pageInfo?.cursor||void 0}}catch{}break}if(!R.pageInfo?.cursor||wz.length<200)break;I=R.pageInfo.cursor}if(z)if(kz)o({show:!0,files:zz,nextCursor:yz,folderId:Z});else o({show:!1,files:[],nextCursor:void 0,folderId:Z})}catch(I){if(console.error(I),z)o({show:!1,files:[],nextCursor:void 0,folderId:Z})}})(),()=>{z=!1}},[Z,J,A.folderId]),X.useEffect(()=>{x(0),m(null),E([])},[Y?.id]),X.useEffect(()=>{m(null),E([])},[Gz?.id]),h1&&!Y)return y(ez,{});if(E1||!Y||!N||!$)return y("div",{children:U.file_not_found()});let t=B?Gz:Y,$z=t?.id??J,Hz=(z,K)=>{if(!$)return;B1({param:{fileId:$z},json:[{key:z,value:K}]},{onSuccess:()=>{f.invalidateQueries({queryKey:["files",$z]})}})},e=(z)=>{O({to:"/projects/$projectId/files/$fileId",params:{projectId:w,fileId:G},search:(K)=>({...K,...z})})},f1=()=>{e({compare:void 0,cmpLeft:void 0,cmpRight:void 0,cmpActive:void 0,version:M==="left"?L:q})},F1=(z)=>{m(z.id||null);let K=z.annotations;if(K&&K.length>0)E(K);else E([]);if(B){if(z.second!==null&&z.second!==void 0)U1({second:z.second,nonce:Date.now()});return}if(z.second!==null&&z.second!==void 0)h.current?.seekTo(z.second),h.current?.pause();else if(K&&K.length>0)h.current?.pause()},Qz=()=>{E([]),m(null)};if(H1&&!B)return y(K1,{projectId:w,teamId:$,fileId:G,file:Y,projectInfo:N,ancestorFolders:Y.ancestorFolders??[],parentFolderId:Z,versions:P,activeFileId:J,startTime:b,siblingFiles:A.files,onNavigateToFile:(z)=>{O({to:"/projects/$projectId/files/$fileId",params:{projectId:w,fileId:z}})},onNavigateBack:()=>{if(Z&&Z!==N?.rootFolder)O({to:"/projects/$projectId/folders/$folderId",params:{projectId:w,folderId:Z}});else O({to:"/projects/$projectId",params:{projectId:w}})},onSelectVersion:(z)=>{O({to:"/projects/$projectId/files/$fileId",params:{projectId:w,fileId:G},search:(K)=>({...K,version:z})})},onRenameFile:async(z)=>{await x1({param:{fileId:J},json:{name:z}})},onDeleteFile:async()=>{await C1({json:{ids:[J]}})},onSaveField:Hz});return _("div",{className:"h-full flex flex-1 flex-col bg-background",children:[_("div",{className:"h-full flex flex-1 overflow-hidden",children:[_("div",{className:"flex-1 relative",children:[N1&&!B&&y("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/50",children:y(C,{className:"h-8 w-8 animate-spin text-foreground"})}),B&&L&&q?y(J1,{versions:P??[],leftId:L,rightId:q,activeSide:M,annotations:g,seekRequest:_1,onActiveSideChange:(z)=>e({cmpActive:z}),onSwitchVersion:(z,K)=>e(z==="left"?{cmpLeft:K}:{cmpRight:K}),onExit:f1,onActiveAssetChange:Z1,onPlay:Qz,onTimeUpdate:x}):y(w1,{file:Y,mediaControllerRef:h,onPlay:Qz,onTimeUpdate:x,annotations:g,startTime:b,children:A.show&&y(Mz,{projectId:w,currentAssetId:J,parentFolderId:Z,initialFiles:A.files,initialNextCursor:A.nextCursor})})]}),(!T||k)&&_(xz,{children:[y(G1,{onResize:(z)=>{p((K)=>Math.max(300,Math.min(600,K-z)))},className:"hidden md:block"}),y("div",{style:{width:v},className:"flex-shrink-0 bg-background flex flex-col",children:k?y(Y1,{projectId:w,contextAssetId:J}):y(X1,{teamId:$,projectId:w,file:t,onSaveField:Hz,members:$1,onCommentSelect:F1,currentTime:D,onTyping:()=>{if(B)return;h.current?.pause()},selectedCommentId:n,hideAnnotationControl:t?.proxyType==="audio"})})]})]}),y(cz,{open:a,onOpenChange:c,children:y(uz,{children:_("form",{onSubmit:S1,children:[y(Iz,{children:y(lz,{children:U.rename()})}),y("div",{className:"py-4",children:y(nz,{ref:r,value:u,onChange:(z)=>Uz(z.target.value),placeholder:U.enter_new_name?.()||"Enter new name",onFocus:D1,autoFocus:!0})}),_(dz,{children:[y(Xz,{type:"button",variant:"outline",onClick:()=>c(!1),children:U.cancel()}),_(Xz,{type:"submit",disabled:Wz||!u.trim(),children:[Wz&&y(C,{className:"mr-2 h-4 w-4 animate-spin"}),U.save()]})]})]})})}),y(Sz,{open:L1,onOpenChange:i,children:_(vz,{children:[_(Dz,{children:[y(Fz,{children:U.delete_asset_title?.()||"Delete Asset?"}),y(jz,{children:U.delete_asset_description?.()||"Deleted items can be recovered for 30 days before being permanently deleted."})]}),_(fz,{children:[y(mz,{children:U.cancel()}),_(pz,{onClick:v1,disabled:Bz,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[Bz&&y(C,{className:"mr-2 h-4 w-4 animate-spin"}),U.delete()]})]})]})})]})}var gz=Cz("/projects/$projectId/files/$fileId")({component:m1});export{gz as Route};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Am as E,ym as h,zm as z}from"./chunk-3gqdepkd.js";import{Bm as S}from"./chunk-bbar8rsh.js";import"./chunk-ewge52nq.js";import{Em as f}from"./chunk-djkajvn7.js";import{Fm as R}from"./chunk-mgytr7nc.js";import{Gm as $}from"./chunk-rar0gk7s.js";import"./chunk-7wvw67f3.js";import{Vm as M,Wm as V}from"./chunk-pn94h6x7.js";import{$m as C,bn as _}from"./chunk-wxsq9zmf.js";import"./chunk-k20w9eaz.js";import{fn as k}from"./chunk-7qzt5nhz.js";import{mn as L}from"./chunk-116p639c.js";import{nn as D}from"./chunk-q46rc697.js";import"./chunk-txkmks1h.js";var O="v1",g=new Set(["openai","openai-codex","opencode","azure-openai-responses"]),A=16;function T(w){let G=new Map;if(!w)return G;for(let j of w.split(",")){let Q=j.trim();if(!Q)continue;let[W,J]=Q.split("=",2);if(!W||!J)continue;G.set(W.trim(),J.trim())}return G}function I(w,G){if(G?.azureDeploymentName)return G.azureDeploymentName;return T($("AZURE_OPENAI_DEPLOYMENT_NAME_MAP",G?.env)).get(w.id)||w.id}function b(w){return V(M(w),"Azure OpenAI API error")}var y=(w,G,j)=>{let Q=new D;return(async()=>{let W=I(w,j),J={role:"assistant",content:[],api:"azure-openai-responses",provider:w.provider,model:w.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{let X=j?.apiKey;if(!X)throw Error(`No API key for provider: ${w.provider}`);let Y=U(w,X,j),F=C(G.tools,w.compat?.supportsOpenAIGrammarTools??!1),q=x(w,G,j,W,F),H=await j?.onPayload?.(q,w);if(H!==void 0)q=H;let K={...j?.signal?{signal:j.signal}:{},...j?.timeoutMs!==void 0?{timeout:j.timeoutMs}:{},maxRetries:0},{data:B,response:Z}=await R(()=>Y.responses.create(q,K).withResponse(),{maxRetries:j?.maxRetries,maxRetryDelayMs:j?.maxRetryDelayMs,signal:j?.signal});if(await j?.onResponse?.({status:Z.status,headers:k(Z.headers)},w),Q.push({type:"start",partial:J}),await E(B,J,Q,w,{grammarToolInputProperties:F}),j?.signal?.aborted)throw Error("Request was aborted");if(J.stopReason==="aborted"||J.stopReason==="error")throw Error("An unknown error occurred");Q.push({type:"done",reason:J.stopReason,message:J}),Q.end()}catch(X){for(let Y of J.content)delete Y.index,delete Y.partialJson,delete Y.customInput;J.stopReason=j?.signal?.aborted?"aborted":"error",J.errorMessage=b(X),Q.push({type:"error",reason:J.stopReason,error:J}),Q.end()}})(),Q},t=(w,G,j)=>{let Q=j?.apiKey;if(!Q)throw Error(`No API key for provider: ${w.provider}`);let W=_(w,G,j,Q),J=j?.reasoning?L(w,j.reasoning):void 0;return y(w,G,{...W,reasoningEffort:J==="off"?void 0:J})};function v(w){let G=w.trim().replace(/\/+$/,""),j;try{j=new URL(G)}catch{throw Error(`Invalid Azure OpenAI base URL: ${w}`)}let Q=j.hostname.endsWith(".openai.azure.com")||j.hostname.endsWith(".cognitiveservices.azure.com")||j.hostname.endsWith(".ai.azure.com"),W=j.pathname.replace(/\/+$/,"");if(Q&&(W===""||W==="/"||W==="/openai"||W==="/openai/v1/responses"))j.pathname="/openai/v1",j.search="";return j.toString().replace(/\/+$/,"")}function N(w){return`https://${w}.openai.azure.com/openai/v1`}function P(w,G){let j=G?.azureApiVersion||$("AZURE_OPENAI_API_VERSION",G?.env)||O,Q=G?.azureBaseUrl?.trim()||$("AZURE_OPENAI_BASE_URL",G?.env)?.trim()||void 0,W=G?.azureResourceName||$("AZURE_OPENAI_RESOURCE_NAME",G?.env),J=Q;if(!J&&W)J=N(W);if(!J&&w.baseUrl)J=w.baseUrl;if(!J)throw Error("Azure OpenAI base URL is required. Set AZURE_OPENAI_BASE_URL or AZURE_OPENAI_RESOURCE_NAME, or pass azureBaseUrl, azureResourceName, or model.baseUrl.");return{baseUrl:v(J),apiVersion:j}}function U(w,G,j){let Q={...w.headers};if(j?.headers)Object.assign(Q,j.headers);let{baseUrl:W,apiVersion:J}=P(w,j);return new f({apiKey:G,apiVersion:J,dangerouslyAllowBrowser:!0,defaultHeaders:Q,baseURL:W})}function x(w,G,j,Q,W=C(G.tools,w.compat?.supportsOpenAIGrammarTools??!1)){let J=h(w,G,g,{grammarToolInputProperties:W}),X={model:Q,input:J,stream:!0,prompt_cache_key:S(j?.sessionId),store:!1};if(j?.maxTokens)X.max_output_tokens=Math.max(j.maxTokens,A);if(j?.temperature!==void 0)X.temperature=j?.temperature;if(G.tools&&G.tools.length>0)X.tools=z(G.tools,{supportsStrictMode:w.compat?.supportsStrictMode??!0,supportsOpenAIGrammarTools:w.compat?.supportsOpenAIGrammarTools??!1});if(w.reasoning){if(j?.reasoningEffort||j?.reasoningSummary){let Y=j?.reasoningEffort?w.thinkingLevelMap?.[j.reasoningEffort]??j.reasoningEffort:"medium";X.reasoning={effort:Y,summary:j?.reasoningSummary||"auto"},X.include=["reasoning.encrypted_content"]}else if(w.thinkingLevelMap?.off!==null)X.reasoning={effort:w.thinkingLevelMap?.off??"none"}}return X}export{t as streamSimple,y as stream};
|