@shumai-one/shumai 0.4.2 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/chunk-071x515q.js +4 -0
- package/bin/{chunk-adekdctx.css → chunk-0ccg9ddn.css} +1 -1
- package/bin/chunk-0cmx7k4c.js +1 -0
- package/bin/chunk-0qaq0sp8.js +5 -0
- package/bin/chunk-0qjfahk9.js +2 -0
- package/bin/chunk-0zv3bks2.js +2 -0
- package/bin/chunk-16xax8kk.js +1 -0
- package/bin/chunk-1gvscz88.js +5 -0
- package/bin/chunk-1j27fzy1.js +2 -0
- package/bin/chunk-1t167cvj.js +11 -0
- package/bin/chunk-1xh34aew.js +2 -0
- package/bin/chunk-1zwajpwf.js +8 -0
- package/bin/chunk-2w5xqhjm.js +1 -0
- package/bin/chunk-3tedzb2j.js +54 -0
- package/bin/chunk-3ttrhqy3.js +2 -0
- package/bin/chunk-3zkasqb8.js +1 -0
- package/bin/chunk-453ykvaw.js +2 -0
- package/bin/chunk-4991gz3y.js +13 -0
- package/bin/chunk-4hkkdm2q.js +2 -0
- package/bin/chunk-4mjywsj8.js +3 -0
- package/bin/chunk-4v41a1r9.js +6 -0
- package/bin/chunk-4wy87hwd.js +3 -0
- package/bin/chunk-579e4wv4.js +3 -0
- package/bin/chunk-5adsx8x4.js +2 -0
- package/bin/chunk-5hg6kcfz.js +45 -0
- package/bin/chunk-5nm2jvg5.js +32 -0
- package/bin/chunk-5tcdwep5.js +11 -0
- package/bin/chunk-5vzrpz50.js +2 -0
- package/bin/chunk-6ghcj4a9.js +3 -0
- package/bin/chunk-77fmkpdz.js +10 -0
- package/bin/chunk-7bcxj1jd.js +2 -0
- package/bin/chunk-7gmdnsdg.js +2 -0
- package/bin/chunk-7jtmwt5a.js +3 -0
- package/bin/chunk-7kjgvxqa.js +2 -0
- package/bin/chunk-7pw1550a.js +2 -0
- package/bin/chunk-7rhz2gze.js +211 -0
- package/bin/chunk-837fky18.js +3 -0
- package/bin/chunk-84as6x83.js +1 -0
- package/bin/chunk-8e28hcny.js +2 -0
- package/bin/chunk-914bp49r.js +4 -0
- package/bin/chunk-97f2af6d.js +12 -0
- package/bin/chunk-98715kc3.js +2 -0
- package/bin/chunk-9ccw540k.js +2 -0
- package/bin/chunk-9t8n2des.js +2 -0
- package/bin/chunk-9ybt6vbm.js +1 -0
- package/bin/chunk-a6gx7f5q.js +1 -0
- package/bin/chunk-avwgktxb.js +2 -0
- package/bin/chunk-bkr5zm4h.js +2 -0
- package/bin/chunk-cbgq517y.js +2 -0
- package/bin/chunk-d27mm390.js +1 -0
- package/bin/chunk-dj92fss9.js +2 -0
- package/bin/chunk-dqxeztfa.js +2 -0
- package/bin/chunk-drepsbb4.js +2 -0
- package/bin/chunk-f6svp4dp.js +2 -0
- package/bin/chunk-fahk9h62.js +8 -0
- package/bin/chunk-fb40xxz3.js +3 -0
- package/bin/chunk-fnmwksnb.js +3 -0
- package/bin/chunk-fpc4p0j8.js +3 -0
- package/bin/chunk-fsyzs0tf.js +1 -0
- package/bin/chunk-fxecgp5k.js +1 -0
- package/bin/chunk-g3fpmyyn.js +3 -0
- package/bin/chunk-gc5sbfa5.js +2 -0
- package/bin/chunk-gdm6yfqq.js +2 -0
- package/bin/chunk-gk2q9a3f.js +2 -0
- package/bin/chunk-gt4csat6.js +3 -0
- package/bin/chunk-gye8gabk.js +2 -0
- package/bin/chunk-hk5rc6cd.js +24 -0
- package/bin/chunk-hm0dkzed.js +3 -0
- package/bin/chunk-hmpwg5za.js +16 -0
- package/bin/chunk-j1tkmcae.js +3 -0
- package/bin/chunk-j2bvj2yn.js +2 -0
- package/bin/chunk-jffktpqg.js +1 -0
- package/bin/chunk-jgs8an3h.js +18 -0
- package/bin/chunk-jmpb5633.js +2 -0
- package/bin/chunk-jrjnqx78.js +2 -0
- package/bin/chunk-k2k9vjq6.js +1 -0
- package/bin/chunk-kpgfqkp0.js +3 -0
- package/bin/chunk-ks8xzc95.js +3 -0
- package/bin/chunk-kswvyqq1.js +2 -0
- package/bin/chunk-m9pr03kn.js +2 -0
- package/bin/chunk-mfn9qjm4.js +2 -0
- package/bin/chunk-msfw3jmc.js +3 -0
- package/bin/chunk-mz0yjra0.js +5 -0
- package/bin/chunk-nbdw8fen.js +1 -0
- package/bin/chunk-nkdk229f.js +2 -0
- package/bin/chunk-nr20tvnw.js +3 -0
- package/bin/chunk-pazjhrnf.js +12 -0
- package/bin/chunk-q806pqeh.js +1 -0
- package/bin/chunk-qka4mkmj.js +2 -0
- package/bin/chunk-qsr1a0rp.js +2 -0
- package/bin/chunk-rchsme43.js +3 -0
- package/bin/chunk-reyxk4bw.js +2 -0
- package/bin/chunk-rhvv1vvk.js +3 -0
- package/bin/chunk-rq0n0vcc.js +2 -0
- package/bin/chunk-rqf7999q.js +42 -0
- package/bin/chunk-rssgmj7x.js +2 -0
- package/bin/chunk-ryzz5fht.js +2 -0
- package/bin/chunk-s2fnfyn9.js +2 -0
- package/bin/chunk-s2k4qntr.js +3 -0
- package/bin/chunk-snhsjs4x.js +299 -0
- package/bin/chunk-t2hy6tj9.js +2 -0
- package/bin/chunk-t7nsgg5k.js +4 -0
- package/bin/chunk-tm7f32c7.js +14 -0
- package/bin/chunk-trveq4wg.js +3 -0
- package/bin/chunk-vap4k11j.js +20 -0
- package/bin/chunk-vm5fx7td.js +3 -0
- package/bin/chunk-vy8gntez.js +1 -0
- package/bin/chunk-vyzptrea.js +2 -0
- package/bin/chunk-w4ghe71n.js +2 -0
- package/bin/chunk-wdsf44hs.js +2 -0
- package/bin/chunk-wjyaezs7.js +2 -0
- package/bin/chunk-wndm3px3.js +1 -0
- package/bin/chunk-x5jwwvs0.js +1 -0
- package/bin/chunk-x92cq59c.js +1 -0
- package/bin/chunk-xa18z1py.js +3 -0
- package/bin/chunk-xarsrs08.js +2 -0
- package/bin/chunk-xtf3c29c.css +1 -0
- package/bin/chunk-xx337zcw.js +2 -0
- package/bin/chunk-xz6713tj.js +2 -0
- package/bin/chunk-yfnem6se.js +2 -0
- package/bin/chunk-ytdwk2fq.js +2 -0
- package/bin/chunk-ze20rm02.js +7 -0
- package/bin/chunk-zw86wnwe.js +7 -0
- package/bin/chunk-zxk7q0zk.js +2 -0
- package/bin/{pdf.worker.min-szxdj13d.mjs → pdf.worker.min-vf48er29.mjs} +14423 -13889
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +841 -678
- package/package.json +18 -18
- package/prisma/migrations/20260904022457_add_agent_id_to_assets_and_audit_logs/migration.sql +17 -0
- package/prisma/migrations/20260906081230_default_denied_tools_delete_asset/migration.sql +15 -0
- package/prisma/migrations/20260907021754_add_asset_upload_id/migration.sql +2 -0
- package/prisma/schema.prisma +10 -0
- package/bin/chunk-07h4b77v.js +0 -2
- package/bin/chunk-0t4n4d5w.js +0 -4
- package/bin/chunk-1611z9jg.js +0 -2
- package/bin/chunk-1phqxp6z.js +0 -3
- package/bin/chunk-23hckrrz.js +0 -2
- package/bin/chunk-30z44j1g.js +0 -2
- package/bin/chunk-3j463k1g.js +0 -1
- package/bin/chunk-4181tdds.js +0 -14
- package/bin/chunk-480jtqng.js +0 -4
- package/bin/chunk-4c3g146q.js +0 -2
- package/bin/chunk-4ca0zt5e.js +0 -1
- package/bin/chunk-4d9bgmf2.js +0 -2
- package/bin/chunk-4ev56fss.js +0 -9
- package/bin/chunk-4gk52tjq.js +0 -45
- package/bin/chunk-4mdqkj4d.js +0 -1
- package/bin/chunk-4r91fggc.js +0 -2
- package/bin/chunk-50fb1x3w.js +0 -1
- package/bin/chunk-59gj1njz.js +0 -1
- package/bin/chunk-5pr0t7fb.js +0 -2
- package/bin/chunk-5vewxmz7.js +0 -3
- package/bin/chunk-62zx96pe.js +0 -2
- package/bin/chunk-63y0eb07.js +0 -2
- package/bin/chunk-6d5xrgfx.js +0 -2
- package/bin/chunk-6gbtz5bf.js +0 -67
- package/bin/chunk-6gjg5egq.js +0 -3
- package/bin/chunk-6m4jz9s1.js +0 -44
- package/bin/chunk-6s4x525w.js +0 -2
- package/bin/chunk-6w2wmvqs.js +0 -3
- package/bin/chunk-77d23vcn.js +0 -2
- package/bin/chunk-77m5p188.js +0 -2
- package/bin/chunk-7bvx087f.js +0 -1
- package/bin/chunk-7pfjfrjg.js +0 -5
- package/bin/chunk-7q10s127.js +0 -4
- package/bin/chunk-7thx8ctx.js +0 -3
- package/bin/chunk-8t4s91gh.js +0 -2
- package/bin/chunk-98ey5p2e.js +0 -3
- package/bin/chunk-9amndcyh.js +0 -6
- package/bin/chunk-9bk23g9x.js +0 -1
- package/bin/chunk-9mkcfy43.js +0 -1
- package/bin/chunk-9t3nsq5n.js +0 -2
- package/bin/chunk-9tjq99ds.js +0 -2
- package/bin/chunk-9wm9rwh1.js +0 -2
- package/bin/chunk-ab16fyg4.js +0 -4
- package/bin/chunk-arv0g2av.js +0 -1
- package/bin/chunk-aytj4zxg.js +0 -3
- package/bin/chunk-b1ypjqgp.js +0 -2
- package/bin/chunk-bdjv0ykq.js +0 -2
- package/bin/chunk-c1k86mfa.js +0 -10
- package/bin/chunk-caa96dgd.js +0 -2
- package/bin/chunk-ce4v2yjy.js +0 -1
- package/bin/chunk-cqh60y54.js +0 -3
- package/bin/chunk-cvq7zgw7.js +0 -1
- package/bin/chunk-d9mjbtp2.js +0 -2
- package/bin/chunk-dn7sbjws.js +0 -3
- package/bin/chunk-dxyq9h8n.js +0 -3
- package/bin/chunk-e3cabksx.js +0 -3
- package/bin/chunk-egcrbj94.js +0 -2
- package/bin/chunk-ev17v1mv.js +0 -2
- package/bin/chunk-evtpwg71.js +0 -2
- package/bin/chunk-f3e0nsv2.js +0 -2
- package/bin/chunk-f40gjqpq.js +0 -2
- package/bin/chunk-fe7822ak.js +0 -299
- package/bin/chunk-g8tkhw9j.js +0 -2
- package/bin/chunk-g9r0p4t8.js +0 -2
- package/bin/chunk-gbjyh9ms.js +0 -1
- package/bin/chunk-gtbsb39v.js +0 -3
- package/bin/chunk-gytz1q13.js +0 -13
- package/bin/chunk-h0fxysxs.js +0 -7
- package/bin/chunk-h8bdvsqt.js +0 -2
- package/bin/chunk-hag024w8.js +0 -2
- package/bin/chunk-hc6w5nw4.js +0 -7
- package/bin/chunk-j69dqc48.js +0 -2
- package/bin/chunk-jbtw1zym.js +0 -8
- package/bin/chunk-jc1vb7rj.js +0 -5
- package/bin/chunk-jdv78w9r.js +0 -2
- package/bin/chunk-jjs70y9v.js +0 -3
- package/bin/chunk-jmdar2gz.js +0 -2
- package/bin/chunk-jvwz10n4.js +0 -2
- package/bin/chunk-k47md1g4.js +0 -2
- package/bin/chunk-k4v0brcb.js +0 -2
- package/bin/chunk-k6n7c07e.js +0 -1
- package/bin/chunk-kk2cstsg.js +0 -2
- package/bin/chunk-knz4h56q.js +0 -12
- package/bin/chunk-kqqtt6bd.js +0 -3
- package/bin/chunk-kvyp1t4j.js +0 -7
- package/bin/chunk-kxskpgsq.js +0 -5
- package/bin/chunk-m6srbjcs.js +0 -2
- package/bin/chunk-mcc1scxs.js +0 -12
- package/bin/chunk-mq83a0kk.js +0 -2
- package/bin/chunk-mxm8g4q0.js +0 -1
- package/bin/chunk-nhpgdqq5.js +0 -2
- package/bin/chunk-nne496aa.js +0 -2
- package/bin/chunk-nqpb0r9h.js +0 -11
- package/bin/chunk-ns0zww9g.js +0 -2
- package/bin/chunk-ps4xfp23.js +0 -2
- package/bin/chunk-pz2ec6xt.js +0 -2
- package/bin/chunk-q163k309.js +0 -2
- package/bin/chunk-q1da61ps.js +0 -1
- package/bin/chunk-qrf0ady6.js +0 -68
- package/bin/chunk-qy28f25e.js +0 -2
- package/bin/chunk-r7s4ypw1.js +0 -2
- package/bin/chunk-ran23vm9.js +0 -1
- package/bin/chunk-rfvdc4n0.js +0 -2
- package/bin/chunk-rgthkvgx.js +0 -3
- package/bin/chunk-s39n3yw3.js +0 -2
- package/bin/chunk-s7wdd0g7.js +0 -8
- package/bin/chunk-s88ha5kx.js +0 -3
- package/bin/chunk-sf91bt9m.js +0 -2
- package/bin/chunk-sjwbjf9j.js +0 -2
- package/bin/chunk-t62076pv.js +0 -1
- package/bin/chunk-tbbwss3v.js +0 -3
- package/bin/chunk-tjcc7a6y.js +0 -24
- package/bin/chunk-tp6ab26e.js +0 -2
- package/bin/chunk-v2wxk9p5.js +0 -4
- package/bin/chunk-vbk6y4hk.js +0 -2
- package/bin/chunk-vfgfg5fk.js +0 -2
- package/bin/chunk-vm6c3xx9.js +0 -2
- package/bin/chunk-vsx96mt6.js +0 -3
- package/bin/chunk-wbyw1shz.js +0 -6
- package/bin/chunk-whh2vh50.css +0 -1
- package/bin/chunk-wjkcq65s.js +0 -2
- package/bin/chunk-wkefwkfp.js +0 -41
- package/bin/chunk-x7bsnk1e.js +0 -2
- package/bin/chunk-xbhw6bpz.js +0 -3
- package/bin/chunk-xg5yrcj5.js +0 -2
- package/bin/chunk-xg9xscqz.js +0 -1
- package/bin/chunk-xw2gpcsh.js +0 -3
- package/bin/chunk-ycq8ank7.js +0 -2
- package/bin/chunk-yp9hvkc5.js +0 -73
- package/bin/chunk-ytypyfkc.js +0 -65
- package/bin/chunk-z1kjmf60.js +0 -2
- package/bin/chunk-z36bx86r.js +0 -2
- package/bin/chunk-z7hdnecp.js +0 -3
- package/bin/chunk-zeby1cq7.js +0 -2
- package/bin/chunk-zs5e8z1w.js +0 -1
- package/bin/chunk-zxnyefg5.js +0 -2
- /package/bin/{chunk-24ke0th1.css → chunk-kegybs91.css} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,Fe}from"./chunk-7rhz2gze.js";import"./chunk-tm7f32c7.js";import"./chunk-7kjgvxqa.js";import"./chunk-gc5sbfa5.js";import"./chunk-rssgmj7x.js";import"./chunk-8e28hcny.js";import"./chunk-snhsjs4x.js";import"./chunk-77fmkpdz.js";import"./chunk-914bp49r.js";import"./chunk-f6svp4dp.js";import"./chunk-0qaq0sp8.js";import{ha}from"./chunk-vyzptrea.js";import"./chunk-98715kc3.js";import"./chunk-m9pr03kn.js";import"./chunk-j2bvj2yn.js";import"./chunk-cbgq517y.js";import"./chunk-gk2q9a3f.js";import"./chunk-9t8n2des.js";import"./chunk-ytdwk2fq.js";import"./chunk-0zv3bks2.js";function s(){let{shareId:e,folderId:a}=n.useParams();return t(ha,{shareId:e,initialFolderId:a})}var n=Fe("/share/$shareId/folders/$folderId")({component:s});export{n as Route};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{h,w,u,C,B,t,o,K,U,A,L,$r,be,pt,vt,Ms,fe,S,ge,Ae,ye,W,ke,Wa,qm,at,Nc,Oc,Xm,j_,q_,ph,mh,hh,qf,Hf,$f,Gf,gl,Zh,Kf,Wf,Qh,Vh,dp,hg,Ng,Ip,EI,kp,Pp,Je,Xe,et,tt,rt,nt,ot,st,pe,ue,me,$e,de,Tt,H,Pt,Mt,R,Kr,dn,tA}from"./chunk-7rhz2gze.js";import{Yc,Jc,Xc,eu,tu}from"./chunk-tm7f32c7.js";import{Bo}from"./chunk-7kjgvxqa.js";import{so}from"./chunk-9t8n2des.js";C();var Se=[];function Ll({teamId:r,projectId:y,assetId:m,folders:a,files:l,totalFolders:Me,totalFiles:Re,totalFoldersSize:ze,totalFilesSize:Ue,selectedItem:J,selectedIds:D,onItemSelect:X,onItemDoubleClick:Y,onSaveField:Be,onClearSelection:qe,fetchNextFoldersPage:Z,hasNextFoldersPage:ee,isFetchingNextFoldersPage:b,fetchNextFilesPage:te,hasNextFilesPage:oe,isFetchingNextFilesPage:x,isRecentlyDeleted:k=!1,isRecents:N=!1,isLoading:se=!1,isShareView:q=!1,isPublic:ie=!1,shareId:Oe,allowDownload:re=!0}){let d=K(),{canEdit:_,canAdmin:We}=Pt(y),ne=w(null),ae=w(null),[O,je]=u(!0),[j,Qe]=u(!0),[He,F]=u(!1),[I,le]=u(""),[Ke,Q]=u(!1),ce=Me??a.length,he=Re??l.length,ve=ze??(a.length>0?a.reduce((e,s)=>e+(s.sizeByte||0),0):-1),we=Ue??(l.length>0?l.reduce((e,s)=>e+(s.sizeByte||0),0):-1),Le=ve>-1,Pe=we>-1,De=(e,s)=>{if(s)return e===1?Hf({count:e}):qf({count:e});else return e===1?Gf({count:e}):$f({count:e})},{editingItemId:xe,setEditingItemId:Ce,handleAction:Ne,onRenameSubmit:_e,isDeleteDialogOpen:Ve,setIsDeleteDialogOpen:Ge,confirmDelete:Ye,isDownloadDialogOpen:Ze,setIsDownloadDialogOpen:P,isLoadingLinks:T,resolvedFiles:Fe,startDownload:it}=tu({teamId:r,projectId:y,assetId:m,folders:a,files:l,selectedIds:D,isPublic:ie,shareId:Oe}),{ref:lt,inView:Ie}=Mt();h(()=>{if(Ie){if(ee&&!b)Z();else if(oe&&!x)te()}},[Ie,ee,b,oe,x,Z,te]);let dt=dn((e)=>e.startTask),ct=A.api.teams[":teamId"].upload.tasks.$post,{mutate:mt}=U({mutationFn:async(e)=>{let s=await ct(e);if(!s.ok)throw Error("Failed to create upload task");return await s.json()},onMutate:()=>({files:[...Se]}),onSuccess:async(e,s,n)=>{let p=n?.files||[],f=p.map((i)=>{let v=e.createdAssets?.find((c)=>c.tempId===i.id),M=e.presignedUrls?.find((c)=>c.id===i.id);return{fileId:v?.assetId||M?.fileId||i.id,name:i.file.name,size:i.file.size}}).filter((i)=>!!i.fileId),g=p.filter((i)=>!i.file.name.startsWith(".")),E=g.length===1?g[0].file.name:`${g.length} Items`;if(e.taskId)dt(e.taskId,E,f);d.invalidateQueries({queryKey:["search",r,m]}),d.invalidateQueries({queryKey:["teams",r,"upload","tasks"]}),await Jc({files:p,taskId:e.taskId,teamId:r,storageBackend:e.storageBackend||"local",createdAssets:e.createdAssets,presignedUrls:e.presignedUrls,onFileFinished:async()=>{await d.invalidateQueries({queryKey:["search",r,m]})}}),d.invalidateQueries({queryKey:["search",r,m]}),d.invalidateQueries({queryKey:["teams",r,"upload","tasks"]})}}),Te=(e)=>{if(!e||e.length===0)return;let s=[],n=[],p=new Map;for(let f of e){let g=(f.webkitRelativePath||f.name).split("/");if(g.some((z)=>z.startsWith(".")))continue;let E=g.pop(),i=n,v="";for(let z of g)if(v=`${v}/${z}`,!p.has(v)){let G=[],Dt={name:z,type:"folder",id:Bo(),children:G,size:0};i.push(Dt),p.set(v,G),i=G}else i=p.get(v);let M={file:f,id:Bo()};s.push(M);let c=f.type;if(E.toLowerCase().endsWith(".wma")&&c?.startsWith("video/"))c=c.replace(/^video\//,"audio/");i.push({name:E,size:f.size,type:"file",id:M.id,children:[],mediaType:c})}Se=s,mt({param:{teamId:r},json:{parentId:m,files:n}})},ut=A.api.folders.$post,{mutate:ft,isPending:Ee}=U({mutationFn:async(e)=>{let s=await ut({json:{name:e,parentId:m}});if(!s.ok)throw Error("Failed to create folder");return await s.json()},onSuccess:()=>{R.success(gl()),F(!1),le(""),d.invalidateQueries({queryKey:["search",r,m]}),d.invalidateQueries({queryKey:["folders"]})},onError:(e)=>{R.error(`Error: ${e.message}`)}}),{mutate:gt,isPending:V}=U({mutationFn:async()=>{let e=await A.api.projects[":projectId"]["empty-trash"].$post({param:{projectId:y}});if(!e.ok)throw Error("Failed to empty trash");return await e.json()},onSuccess:()=>{R.success(EI()),d.invalidateQueries({queryKey:["projects",y,"recently-deleted"]}),qe(),Q(!1)},onError:(e)=>{R.error(`Error: ${e.message}`)}}),ht=(e)=>{if(e.preventDefault(),!I.trim())return;ft(I.trim())},wt=!se&&a.length===0&&l.length===0&&!b&&!x;return o("div",{className:"flex-1 flex flex-col min-h-0 bg-background overflow-hidden relative",children:[_&&o(B,{children:[t("input",{type:"file",ref:ne,multiple:!0,className:"hidden",onChange:(e)=>{if(e.target.files)Te(e.target.files)}}),t("input",{type:"file",ref:ae,multiple:!0,webkitdirectory:"true",className:"hidden",onChange:(e)=>{if(e.target.files)Te(e.target.files)}})]}),k&&o("div",{className:"flex items-center justify-between px-4 py-2.5 bg-muted/20 border-b border-border text-sm shrink-0",children:[o("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t($r,{className:"h-4 w-4 text-amber-500 shrink-0"}),t("span",{className:"text-xs",children:dp()})]}),We&&t(S,{variant:"destructive",size:"sm",disabled:V||a.length===0&&l.length===0,onClick:()=>Q(!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"})]}),o("div",{className:"flex-1 overflow-y-auto min-h-0 p-3 pb-24",children:[se&&a.length===0&&l.length===0?t(tA,{}):o("div",{className:"max-w-lg mx-auto w-full",children:[ce>0&&o("div",{className:"mb-4",children:[o("button",{onClick:()=>je(!O),className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground mb-3 font-medium select-none cursor-pointer",children:[O?t(be,{className:"h-4 w-4"}):t(pt,{className:"h-4 w-4"}),o("span",{children:[De(ce,!1),Le?` • ${Kr(ve)}`:""]})]}),O&&t("div",{className:"grid grid-cols-1 gap-4 w-full",children:a.map((e)=>t(eu,{item:e,isSelected:J?.id===e.id,isChecked:D.has(e.id),isEditing:xe===e.id,onSelect:X,onDoubleClick:Y,onContextMenu:()=>{},onDragStart:()=>{},onDrop:()=>{},onRename:(s)=>_e(e,s),onFinishEditing:()=>Ce(null),onAction:(s,n)=>Ne(s,n),isRecentlyDeleted:k,isRecents:N,selectedCount:D.size,canEdit:_,isShareView:q,allowDownload:re},e.id))})]}),he>0&&o("div",{className:"mb-4",children:[o("button",{onClick:()=>Qe(!j),className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground mb-3 font-medium select-none cursor-pointer",children:[j?t(be,{className:"h-4 w-4"}):t(pt,{className:"h-4 w-4"}),o("span",{children:[De(he,!0),Pe?` • ${Kr(we)}`:""]})]}),j&&t("div",{className:"grid grid-cols-1 gap-4 w-full",children:l.map((e)=>t(Xc,{teamId:r,item:e,isSelected:J?.id===e.id,isChecked:D.has(e.id),isEditing:xe===e.id,onSelect:X,onDoubleClick:Y,onContextMenu:()=>{},onDragStart:()=>{},onDrop:()=>{},onRename:(s)=>_e(e,s),onFinishEditing:()=>Ce(null),onSaveField:(s,n)=>Be?.(e.id,s,n),fields:[],onAction:(s,n)=>Ne(s,n),isRecentlyDeleted:k,isRecents:N,selectedCount:D.size,canEdit:_,isShareView:q,allowDownload:re},e.id))})]})]}),wt&&t("div",{className:"flex flex-col items-center justify-center h-64 text-sm text-muted-foreground p-6 text-center",children:N?o("div",{className:"flex flex-col items-center gap-2",children:[t(Ms,{className:"h-10 w-10 text-muted-foreground/40 mb-1"}),t("p",{className:"font-medium text-foreground",children:Kf()}),t("p",{className:"text-xs text-muted-foreground",children:Wf()})]}):t("span",{children:Ip()})}),t("div",{ref:lt,className:"py-4 flex justify-center items-center min-h-6",children:(b||x)&&t(L,{className:"h-5 w-5 animate-spin text-muted-foreground"})})]}),_&&!k&&!N&&!q&&!ie&&t("div",{className:"fixed bottom-6 right-6 z-30",children:o(ge,{modal:!1,children:[t(Ae,{asChild:!0,children:t(S,{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:t(fe,{className:"h-6 w-6"})})}),o(ye,{align:"end",side:"top",className:"w-48 mb-2",children:[o(W,{onClick:()=>ne.current?.click(),className:"flex items-center gap-2.5 py-2 cursor-pointer",children:[t(so,{className:"h-4 w-4"}),t("span",{children:kp()})]}),o(W,{onClick:()=>ae.current?.click(),className:"flex items-center gap-2.5 py-2 cursor-pointer",children:[t(so,{className:"h-4 w-4"}),t("span",{children:Pp()})]}),o(W,{onClick:()=>F(!0),className:"flex items-center gap-2.5 py-2 cursor-pointer",children:[t(Yc,{className:"h-4 w-4"}),t("span",{children:gl()})]})]})]})}),t(pe,{open:He,onOpenChange:F,children:t(ue,{className:"sm:max-w-md",children:o("form",{onSubmit:ht,children:[o(me,{children:[t(de,{children:gl()}),t(Tt,{children:mh()})]}),t("div",{className:"py-4",children:t(H,{autoFocus:!0,placeholder:mh(),value:I,onChange:(e)=>le(e.target.value)})}),o($e,{children:[t(S,{type:"button",variant:"outline",onClick:()=>F(!1),children:ke()}),o(S,{type:"submit",disabled:!I.trim()||Ee,children:[Ee?t(L,{className:"h-4 w-4 animate-spin mr-2"}):null,Wa()]})]})]})})}),t(Je,{open:Ve,onOpenChange:Ge,children:o(Xe,{children:[o(et,{children:[t(rt,{children:Oc()}),t(nt,{children:Nc()})]}),o(tt,{children:[t(st,{children:ke()}),t(ot,{onClick:()=>Ye(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:at()})]})]})}),t(Je,{open:Ke,onOpenChange:Q,children:o(Xe,{children:[o(et,{children:[t(rt,{children:q_()}),t(nt,{children:j_()})]}),o(tt,{children:[t(st,{children:ke()}),t(ot,{onClick:()=>gt(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",disabled:V,children:V?"Deleting...":at()})]})]})}),t(pe,{open:Ze,onOpenChange:P,children:o(ue,{className:"sm:max-w-md",children:[o(me,{children:[t(de,{children:T?Qh():qm()}),t(Tt,{children:T?hg():ph()})]}),T?o("div",{className:"space-y-4 py-6 flex flex-col items-center justify-center",children:[t(L,{className:"h-8 w-8 animate-spin text-primary"}),t("span",{className:"text-sm font-medium text-muted-foreground mt-2",children:Vh()})]}):o("div",{className:"space-y-4 py-2",children:[t("div",{className:"text-sm text-muted-foreground",children:Xm({count:Fe.length})}),o("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:[t($r,{className:"h-5 w-5 shrink-0 mt-0.5"}),o("div",{children:[t("p",{className:"font-semibold",children:Zh()}),t("p",{className:"mt-0.5 text-xs text-amber-700/90 dark:text-amber-400/90",children:hh()})]})]})]}),t($e,{children:!T?o(B,{children:[t(S,{variant:"outline",onClick:()=>P(!1),children:ke()}),o(S,{onClick:it,className:"gap-2",disabled:Fe.length===0,children:[t(vt,{className:"h-4 w-4"}),Ng()]})]}):t(S,{variant:"outline",onClick:()=>P(!1),children:ke()})})]})})]})}
|
|
2
|
+
export{Ll};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{yn,C,t,o,Z,A,MA,OA,Af,ld,Of,ux,TC,mp,yg,dE,Tp,Mp,cn,pe,ue,me,de,Tt,Cn,Yg,ro,xo,le}from"./chunk-7rhz2gze.js";import{Co}from"./chunk-j2bvj2yn.js";C();var y=(g)=>g.replace(/<@([a-zA-Z0-9_-]+)>/g,"@$1").replace(/^\[([^\]]+)\]:/gm,"\\[$1\\]:");function Ul({sessionId:g,open:N,onOpenChange:_}){let{data:x,isLoading:S}=Z({queryKey:["agent-sessions",g,"entries"],queryFn:async()=>{if(!g)return[];let s=await A.api["agent-sessions"][":sessionId"].entries.$get({param:{sessionId:g}});if(!s.ok)throw Error("Failed to fetch session logs");return await s.json()},enabled:N&&!!g});return t(pe,{open:N,onOpenChange:_,children:o(ue,{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:[o(me,{className:"pb-4 border-b border-foreground/15",children:[o(de,{className:"flex items-center gap-2 text-xl font-bold",children:[t(Co,{className:"w-5 h-5 text-violet-500"}),OA()]}),t(Tt,{children:MA()})]}),t("div",{className:"flex-1 overflow-y-auto pr-1 py-4 space-y-4 min-h-0 select-text",children:S?o("div",{className:"space-y-4",children:[o("div",{className:"flex gap-4",children:[t(le,{className:"h-5 w-5 rounded-full shrink-0"}),o("div",{className:"flex-1 space-y-2",children:[t(le,{className:"h-4 w-1/4"}),t(le,{className:"h-20 w-full"})]})]}),o("div",{className:"flex gap-4",children:[t(le,{className:"h-5 w-5 rounded-full shrink-0"}),o("div",{className:"flex-1 space-y-2",children:[t(le,{className:"h-4 w-1/4"}),t(le,{className:"h-12 w-full"})]})]})]}):x&&x.length>0?t("div",{className:"flex flex-col",children:x.map((s)=>{let a=s.entry,b=a?.timestamp||s.timestamp,f="";if(typeof b==="string"||typeof b==="number"){let e=new Date(b);if(!isNaN(e.getTime()))f=Cn(e.toISOString())}if(a&&typeof a==="object"){if(a.type==="custom_message"){if(a.customType==="context")return null;if(a.customType==="shumai_message"){let e=Yg(a.details),m=typeof a.content==="string"?a.content:"",p=e?`${m}
|
|
2
|
+
|
|
3
|
+
${e}`.trim():m,w="bg-primary/10 text-primary",v=yg();return o("div",{className:"relative pl-6 pb-6 last:pb-0",children:[t("div",{className:"absolute left-[9px] top-2 bottom-0 w-0.5 bg-foreground/10 last:hidden"}),t("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"}),o("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:[o("div",{className:"flex items-center justify-between gap-2",children:[o("div",{className:"flex items-center gap-2 flex-wrap",children:[t("span",{className:"text-[10px] px-2 py-0.5 rounded-full font-semibold uppercase tracking-wider bg-primary/10 text-primary",children:v}),o("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:ld(),children:[ld(),": ",s.id]})]}),t("span",{className:"text-[10px] text-muted-foreground/60 shrink-0",children:f})]}),t("div",{className:"text-xs text-foreground/90 whitespace-pre-wrap leading-relaxed font-sans",children:p})]})]},s.id)}}if(a.type==="message"&&a.message){let e=a.message,m="bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200",p=String(e.role||"");if(e.role==="user")m="bg-primary/10 text-primary",p=yg();else if(e.role==="assistant")m="bg-violet-100 text-violet-800 dark:bg-violet-900/30 dark:text-violet-300",p=TC();else if(e.role==="toolResult")m=e.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",p=Mp({name:String(e.toolName||cn())});else if(e.role==="thought")m="bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-300",p=mp();let w=(n)=>{let r=n;if(typeof n==="string")try{r=JSON.parse(n)}catch{}if(r&&typeof r==="object"&&!Array.isArray(r))return t("div",{className:"mt-1 space-y-1.5 pt-3",children:Object.entries(r).map(([l,i])=>{let c=i&&typeof i==="object"?JSON.stringify(i,null,2):String(i);return o("div",{className:"text-xs leading-relaxed break-words",children:[o("span",{className:"font-semibold text-violet-600 dark:text-violet-400",children:[l,":"]})," ",t("span",{className:"text-foreground/90 font-mono whitespace-pre-wrap",children:c})]},l)})});return t("div",{className:"text-xs font-mono whitespace-pre-wrap",children:String(n)})},v=()=>{let n=e.content;if(!n)return null;if(typeof n==="string"){if(!n.trim())return null;return t("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:t(xo,{children:y(n)})})}if(Array.isArray(n)){let r=[];if(n.forEach((d,l)=>{if(!d)return;if(typeof d==="string"){if(!d.trim())return;r.push(t("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:t(xo,{children:y(d)})},`str-${l}`));return}if(typeof d==="object"){let i=d,c=i.type;if(c==="text"){let u=i.text;if(typeof u!=="string"||!u.trim())return;r.push(t("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:t(xo,{children:y(u)})},`txt-${l}`));return}if(c==="toolCall"){let u=String(i.name||i.toolName||cn()),h=i.arguments||i.args;r.push(o("div",{className:"text-xs space-y-2 py-1",children:[o("div",{className:"font-semibold text-violet-600 dark:text-violet-400 flex items-center gap-1.5",children:[Af()," ",t("span",{className:"font-mono bg-violet-500/10 px-1 py-0.5 rounded text-[11px]",children:u})]}),!!h&&o("div",{className:"space-y-1 pt-3",children:[t("div",{className:"text-[10px] text-muted-foreground/60 uppercase font-bold tracking-wider",children:Tp()}),w(h)]})]},`tool-${l}`));return}if(c==="image"){r.push(t("div",{className:"text-xs text-muted-foreground italic flex items-center gap-1.5 py-1",children:Of()},`img-${l}`));return}let k=JSON.stringify(d,null,2);if(k==="{}")return;r.push(t("pre",{className:"text-xs text-foreground/80 font-mono whitespace-pre-wrap break-words bg-muted/20 p-2 rounded",children:k},`other-${l}`))}}),r.length===0)return null;return t("div",{className:"space-y-3 w-full",children:r.map((d,l)=>o(yn,{children:[l>0&&t(ro,{className:"my-3 opacity-50"}),d]},l))})}return null};return o("div",{className:"relative pl-6 pb-6 last:pb-0",children:[t("div",{className:"absolute left-[9px] top-2 bottom-0 w-0.5 bg-foreground/10 last:hidden"}),t("div",{className:`absolute left-0 top-1.5 h-5 w-5 rounded-full border-4 border-background flex items-center justify-center ${e.role==="user"?"bg-primary":e.role==="assistant"?"bg-violet-500":e.role==="toolResult"?e.isError?"bg-red-500":"bg-emerald-500":"bg-amber-500"}`}),o("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:[o("div",{className:"flex items-center justify-between gap-2",children:[o("div",{className:"flex items-center gap-2 flex-wrap",children:[t("span",{className:`text-[10px] px-2 py-0.5 rounded-full font-semibold uppercase tracking-wider ${m}`,children:p}),o("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:ld(),children:[ld(),": ",s.id]})]}),t("span",{className:"text-[10px] text-muted-foreground/60 shrink-0",children:f})]}),v()]})]},s.id)}}return o("div",{className:"relative pl-6 pb-6 last:pb-0",children:[t("div",{className:"absolute left-[9px] top-2 bottom-0 w-0.5 bg-foreground/10 last:hidden"}),t("div",{className:"absolute left-0 top-1.5 h-5 w-5 rounded-full border-4 border-background bg-gray-400"}),o("div",{className:"bg-muted/30 p-3 rounded-lg border border-foreground/5",children:[o("div",{className:"flex items-center justify-between gap-2 mb-1.5 flex-wrap",children:[o("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: ",s.id]}),t("div",{className:"text-[10px] text-muted-foreground/60",children:f})]}),t("pre",{className:"text-xs text-foreground/80 font-mono whitespace-pre-wrap break-words",children:JSON.stringify(s.entry,null,2)})]})]},s.id)})}):o("div",{className:"flex flex-col items-center justify-center py-12 text-center text-muted-foreground",children:[t(Co,{className:"w-8 h-8 text-muted-foreground/40 mb-2 animate-pulse"}),t("p",{className:"text-sm font-medium",children:ux()}),t("p",{className:"text-xs text-muted-foreground/60 mt-1",children:dE()})]})})]})})}
|
|
4
|
+
export{Ul};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Mu,Ru,ku}from"./chunk-rhvv1vvk.js";import{z,v}from"./chunk-fnmwksnb.js";var iE=v(function(IE){Object.defineProperty(IE,"__esModule",{value:!0});IE.createConstMap=void 0;function ps(E){let e={},T=E.length;for(let _=0;_<T;_++){let S=E[_];if(S)e[String(S).toUpperCase().replace(/[-.]/g,"_")]=S}return e}IE.createConstMap=ps});var V_=v(function(L_){Object.defineProperty(L_,"__esModule",{value:!0});L_.SEMATTRS_NET_HOST_CARRIER_ICC=L_.SEMATTRS_NET_HOST_CARRIER_MNC=L_.SEMATTRS_NET_HOST_CARRIER_MCC=L_.SEMATTRS_NET_HOST_CARRIER_NAME=L_.SEMATTRS_NET_HOST_CONNECTION_SUBTYPE=L_.SEMATTRS_NET_HOST_CONNECTION_TYPE=L_.SEMATTRS_NET_HOST_NAME=L_.SEMATTRS_NET_HOST_PORT=L_.SEMATTRS_NET_HOST_IP=L_.SEMATTRS_NET_PEER_NAME=L_.SEMATTRS_NET_PEER_PORT=L_.SEMATTRS_NET_PEER_IP=L_.SEMATTRS_NET_TRANSPORT=L_.SEMATTRS_FAAS_INVOKED_REGION=L_.SEMATTRS_FAAS_INVOKED_PROVIDER=L_.SEMATTRS_FAAS_INVOKED_NAME=L_.SEMATTRS_FAAS_COLDSTART=L_.SEMATTRS_FAAS_CRON=L_.SEMATTRS_FAAS_TIME=L_.SEMATTRS_FAAS_DOCUMENT_NAME=L_.SEMATTRS_FAAS_DOCUMENT_TIME=L_.SEMATTRS_FAAS_DOCUMENT_OPERATION=L_.SEMATTRS_FAAS_DOCUMENT_COLLECTION=L_.SEMATTRS_FAAS_EXECUTION=L_.SEMATTRS_FAAS_TRIGGER=L_.SEMATTRS_EXCEPTION_ESCAPED=L_.SEMATTRS_EXCEPTION_STACKTRACE=L_.SEMATTRS_EXCEPTION_MESSAGE=L_.SEMATTRS_EXCEPTION_TYPE=L_.SEMATTRS_DB_SQL_TABLE=L_.SEMATTRS_DB_MONGODB_COLLECTION=L_.SEMATTRS_DB_REDIS_DATABASE_INDEX=L_.SEMATTRS_DB_HBASE_NAMESPACE=L_.SEMATTRS_DB_CASSANDRA_COORDINATOR_DC=L_.SEMATTRS_DB_CASSANDRA_COORDINATOR_ID=L_.SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT=L_.SEMATTRS_DB_CASSANDRA_IDEMPOTENCE=L_.SEMATTRS_DB_CASSANDRA_TABLE=L_.SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL=L_.SEMATTRS_DB_CASSANDRA_PAGE_SIZE=L_.SEMATTRS_DB_CASSANDRA_KEYSPACE=L_.SEMATTRS_DB_MSSQL_INSTANCE_NAME=L_.SEMATTRS_DB_OPERATION=L_.SEMATTRS_DB_STATEMENT=L_.SEMATTRS_DB_NAME=L_.SEMATTRS_DB_JDBC_DRIVER_CLASSNAME=L_.SEMATTRS_DB_USER=L_.SEMATTRS_DB_CONNECTION_STRING=L_.SEMATTRS_DB_SYSTEM=L_.SEMATTRS_AWS_LAMBDA_INVOKED_ARN=void 0;L_.SEMATTRS_MESSAGING_DESTINATION_KIND=L_.SEMATTRS_MESSAGING_DESTINATION=L_.SEMATTRS_MESSAGING_SYSTEM=L_.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES=L_.SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS=L_.SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT=L_.SEMATTRS_AWS_DYNAMODB_COUNT=L_.SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS=L_.SEMATTRS_AWS_DYNAMODB_SEGMENT=L_.SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD=L_.SEMATTRS_AWS_DYNAMODB_TABLE_COUNT=L_.SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE=L_.SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES=L_.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES=L_.SEMATTRS_AWS_DYNAMODB_SELECT=L_.SEMATTRS_AWS_DYNAMODB_INDEX_NAME=L_.SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET=L_.SEMATTRS_AWS_DYNAMODB_LIMIT=L_.SEMATTRS_AWS_DYNAMODB_PROJECTION=L_.SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ=L_.SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY=L_.SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY=L_.SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS=L_.SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY=L_.SEMATTRS_AWS_DYNAMODB_TABLE_NAMES=L_.SEMATTRS_HTTP_CLIENT_IP=L_.SEMATTRS_HTTP_ROUTE=L_.SEMATTRS_HTTP_SERVER_NAME=L_.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED=L_.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH=L_.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED=L_.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH=L_.SEMATTRS_HTTP_USER_AGENT=L_.SEMATTRS_HTTP_FLAVOR=L_.SEMATTRS_HTTP_STATUS_CODE=L_.SEMATTRS_HTTP_SCHEME=L_.SEMATTRS_HTTP_HOST=L_.SEMATTRS_HTTP_TARGET=L_.SEMATTRS_HTTP_URL=L_.SEMATTRS_HTTP_METHOD=L_.SEMATTRS_CODE_LINENO=L_.SEMATTRS_CODE_FILEPATH=L_.SEMATTRS_CODE_NAMESPACE=L_.SEMATTRS_CODE_FUNCTION=L_.SEMATTRS_THREAD_NAME=L_.SEMATTRS_THREAD_ID=L_.SEMATTRS_ENDUSER_SCOPE=L_.SEMATTRS_ENDUSER_ROLE=L_.SEMATTRS_ENDUSER_ID=L_.SEMATTRS_PEER_SERVICE=void 0;L_.DBSYSTEMVALUES_FILEMAKER=L_.DBSYSTEMVALUES_DERBY=L_.DBSYSTEMVALUES_FIREBIRD=L_.DBSYSTEMVALUES_ADABAS=L_.DBSYSTEMVALUES_CACHE=L_.DBSYSTEMVALUES_EDB=L_.DBSYSTEMVALUES_FIRSTSQL=L_.DBSYSTEMVALUES_INGRES=L_.DBSYSTEMVALUES_HANADB=L_.DBSYSTEMVALUES_MAXDB=L_.DBSYSTEMVALUES_PROGRESS=L_.DBSYSTEMVALUES_HSQLDB=L_.DBSYSTEMVALUES_CLOUDSCAPE=L_.DBSYSTEMVALUES_HIVE=L_.DBSYSTEMVALUES_REDSHIFT=L_.DBSYSTEMVALUES_POSTGRESQL=L_.DBSYSTEMVALUES_DB2=L_.DBSYSTEMVALUES_ORACLE=L_.DBSYSTEMVALUES_MYSQL=L_.DBSYSTEMVALUES_MSSQL=L_.DBSYSTEMVALUES_OTHER_SQL=L_.SemanticAttributes=L_.SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE=L_.SEMATTRS_MESSAGE_COMPRESSED_SIZE=L_.SEMATTRS_MESSAGE_ID=L_.SEMATTRS_MESSAGE_TYPE=L_.SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE=L_.SEMATTRS_RPC_JSONRPC_ERROR_CODE=L_.SEMATTRS_RPC_JSONRPC_REQUEST_ID=L_.SEMATTRS_RPC_JSONRPC_VERSION=L_.SEMATTRS_RPC_GRPC_STATUS_CODE=L_.SEMATTRS_RPC_METHOD=L_.SEMATTRS_RPC_SERVICE=L_.SEMATTRS_RPC_SYSTEM=L_.SEMATTRS_MESSAGING_KAFKA_TOMBSTONE=L_.SEMATTRS_MESSAGING_KAFKA_PARTITION=L_.SEMATTRS_MESSAGING_KAFKA_CLIENT_ID=L_.SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP=L_.SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY=L_.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY=L_.SEMATTRS_MESSAGING_CONSUMER_ID=L_.SEMATTRS_MESSAGING_OPERATION=L_.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES=L_.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES=L_.SEMATTRS_MESSAGING_CONVERSATION_ID=L_.SEMATTRS_MESSAGING_MESSAGE_ID=L_.SEMATTRS_MESSAGING_URL=L_.SEMATTRS_MESSAGING_PROTOCOL_VERSION=L_.SEMATTRS_MESSAGING_PROTOCOL=L_.SEMATTRS_MESSAGING_TEMP_DESTINATION=void 0;L_.FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD=L_.FaasDocumentOperationValues=L_.FAASDOCUMENTOPERATIONVALUES_DELETE=L_.FAASDOCUMENTOPERATIONVALUES_EDIT=L_.FAASDOCUMENTOPERATIONVALUES_INSERT=L_.FaasTriggerValues=L_.FAASTRIGGERVALUES_OTHER=L_.FAASTRIGGERVALUES_TIMER=L_.FAASTRIGGERVALUES_PUBSUB=L_.FAASTRIGGERVALUES_HTTP=L_.FAASTRIGGERVALUES_DATASOURCE=L_.DbCassandraConsistencyLevelValues=L_.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL=L_.DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL=L_.DBCASSANDRACONSISTENCYLEVELVALUES_ANY=L_.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE=L_.DBCASSANDRACONSISTENCYLEVELVALUES_THREE=L_.DBCASSANDRACONSISTENCYLEVELVALUES_TWO=L_.DBCASSANDRACONSISTENCYLEVELVALUES_ONE=L_.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM=L_.DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM=L_.DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM=L_.DBCASSANDRACONSISTENCYLEVELVALUES_ALL=L_.DbSystemValues=L_.DBSYSTEMVALUES_COCKROACHDB=L_.DBSYSTEMVALUES_MEMCACHED=L_.DBSYSTEMVALUES_ELASTICSEARCH=L_.DBSYSTEMVALUES_GEODE=L_.DBSYSTEMVALUES_NEO4J=L_.DBSYSTEMVALUES_DYNAMODB=L_.DBSYSTEMVALUES_COSMOSDB=L_.DBSYSTEMVALUES_COUCHDB=L_.DBSYSTEMVALUES_COUCHBASE=L_.DBSYSTEMVALUES_REDIS=L_.DBSYSTEMVALUES_MONGODB=L_.DBSYSTEMVALUES_HBASE=L_.DBSYSTEMVALUES_CASSANDRA=L_.DBSYSTEMVALUES_COLDFUSION=L_.DBSYSTEMVALUES_H2=L_.DBSYSTEMVALUES_VERTICA=L_.DBSYSTEMVALUES_TERADATA=L_.DBSYSTEMVALUES_SYBASE=L_.DBSYSTEMVALUES_SQLITE=L_.DBSYSTEMVALUES_POINTBASE=L_.DBSYSTEMVALUES_PERVASIVE=L_.DBSYSTEMVALUES_NETEZZA=L_.DBSYSTEMVALUES_MARIADB=L_.DBSYSTEMVALUES_INTERBASE=L_.DBSYSTEMVALUES_INSTANTDB=L_.DBSYSTEMVALUES_INFORMIX=void 0;L_.MESSAGINGOPERATIONVALUES_RECEIVE=L_.MessagingDestinationKindValues=L_.MESSAGINGDESTINATIONKINDVALUES_TOPIC=L_.MESSAGINGDESTINATIONKINDVALUES_QUEUE=L_.HttpFlavorValues=L_.HTTPFLAVORVALUES_QUIC=L_.HTTPFLAVORVALUES_SPDY=L_.HTTPFLAVORVALUES_HTTP_2_0=L_.HTTPFLAVORVALUES_HTTP_1_1=L_.HTTPFLAVORVALUES_HTTP_1_0=L_.NetHostConnectionSubtypeValues=L_.NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA=L_.NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA=L_.NETHOSTCONNECTIONSUBTYPEVALUES_NR=L_.NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN=L_.NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA=L_.NETHOSTCONNECTIONSUBTYPEVALUES_GSM=L_.NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP=L_.NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD=L_.NETHOSTCONNECTIONSUBTYPEVALUES_LTE=L_.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B=L_.NETHOSTCONNECTIONSUBTYPEVALUES_IDEN=L_.NETHOSTCONNECTIONSUBTYPEVALUES_HSPA=L_.NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA=L_.NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA=L_.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT=L_.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A=L_.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0=L_.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA=L_.NETHOSTCONNECTIONSUBTYPEVALUES_UMTS=L_.NETHOSTCONNECTIONSUBTYPEVALUES_EDGE=L_.NETHOSTCONNECTIONSUBTYPEVALUES_GPRS=L_.NetHostConnectionTypeValues=L_.NETHOSTCONNECTIONTYPEVALUES_UNKNOWN=L_.NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE=L_.NETHOSTCONNECTIONTYPEVALUES_CELL=L_.NETHOSTCONNECTIONTYPEVALUES_WIRED=L_.NETHOSTCONNECTIONTYPEVALUES_WIFI=L_.NetTransportValues=L_.NETTRANSPORTVALUES_OTHER=L_.NETTRANSPORTVALUES_INPROC=L_.NETTRANSPORTVALUES_PIPE=L_.NETTRANSPORTVALUES_UNIX=L_.NETTRANSPORTVALUES_IP=L_.NETTRANSPORTVALUES_IP_UDP=L_.NETTRANSPORTVALUES_IP_TCP=L_.FaasInvokedProviderValues=L_.FAASINVOKEDPROVIDERVALUES_GCP=L_.FAASINVOKEDPROVIDERVALUES_AZURE=L_.FAASINVOKEDPROVIDERVALUES_AWS=void 0;L_.MessageTypeValues=L_.MESSAGETYPEVALUES_RECEIVED=L_.MESSAGETYPEVALUES_SENT=L_.RpcGrpcStatusCodeValues=L_.RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED=L_.RPCGRPCSTATUSCODEVALUES_DATA_LOSS=L_.RPCGRPCSTATUSCODEVALUES_UNAVAILABLE=L_.RPCGRPCSTATUSCODEVALUES_INTERNAL=L_.RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED=L_.RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE=L_.RPCGRPCSTATUSCODEVALUES_ABORTED=L_.RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION=L_.RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED=L_.RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED=L_.RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS=L_.RPCGRPCSTATUSCODEVALUES_NOT_FOUND=L_.RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED=L_.RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT=L_.RPCGRPCSTATUSCODEVALUES_UNKNOWN=L_.RPCGRPCSTATUSCODEVALUES_CANCELLED=L_.RPCGRPCSTATUSCODEVALUES_OK=L_.MessagingOperationValues=L_.MESSAGINGOPERATIONVALUES_PROCESS=void 0;var W=iE(),pE="aws.lambda.invoked_arn",lE="db.system",VE="db.connection_string",fE="db.user",mE="db.jdbc.driver_classname",BE="db.name",GE="db.statement",YE="db.operation",xE="db.mssql.instance_name",HE="db.cassandra.keyspace",gE="db.cassandra.page_size",yE="db.cassandra.consistency_level",bE="db.cassandra.table",FE="db.cassandra.idempotence",hE="db.cassandra.speculative_execution_count",KE="db.cassandra.coordinator.id",wE="db.cassandra.coordinator.dc",vE="db.hbase.namespace",WE="db.redis.database_index",$E="db.mongodb.collection",jE="db.sql.table",kE="exception.type",XE="exception.message",qE="exception.stacktrace",QE="exception.escaped",JE="faas.trigger",ZE="faas.execution",zE="faas.document.collection",Ee="faas.document.operation",ee="faas.document.time",Se="faas.document.name",Te="faas.time",te="faas.cron",_e="faas.coldstart",Ae="faas.invoked_name",re="faas.invoked_provider",se="faas.invoked_region",oe="net.transport",ne="net.peer.ip",Re="net.peer.port",Oe="net.peer.name",Me="net.host.ip",ie="net.host.port",ce="net.host.name",De="net.host.connection.type",Pe="net.host.connection.subtype",Le="net.host.carrier.name",de="net.host.carrier.mcc",Ue="net.host.carrier.mnc",Ie="net.host.carrier.icc",ue="peer.service",pe="enduser.id",le="enduser.role",Ve="enduser.scope",fe="thread.id",me="thread.name",Be="code.function",Ge="code.namespace",Ye="code.filepath",xe="code.lineno",He="http.method",ge="http.url",ye="http.target",be="http.host",Fe="http.scheme",he="http.status_code",Ke="http.flavor",we="http.user_agent",ve="http.request_content_length",We="http.request_content_length_uncompressed",$e="http.response_content_length",je="http.response_content_length_uncompressed",ke="http.server_name",Xe="http.route",qe="http.client_ip",Qe="aws.dynamodb.table_names",Je="aws.dynamodb.consumed_capacity",Ze="aws.dynamodb.item_collection_metrics",ze="aws.dynamodb.provisioned_read_capacity",ES="aws.dynamodb.provisioned_write_capacity",eS="aws.dynamodb.consistent_read",SS="aws.dynamodb.projection",TS="aws.dynamodb.limit",tS="aws.dynamodb.attributes_to_get",_S="aws.dynamodb.index_name",AS="aws.dynamodb.select",rS="aws.dynamodb.global_secondary_indexes",sS="aws.dynamodb.local_secondary_indexes",oS="aws.dynamodb.exclusive_start_table",nS="aws.dynamodb.table_count",RS="aws.dynamodb.scan_forward",NS="aws.dynamodb.segment",OS="aws.dynamodb.total_segments",MS="aws.dynamodb.count",aS="aws.dynamodb.scanned_count",iS="aws.dynamodb.attribute_definitions",cS="aws.dynamodb.global_secondary_index_updates",CS="messaging.system",DS="messaging.destination",PS="messaging.destination_kind",LS="messaging.temp_destination",dS="messaging.protocol",US="messaging.protocol_version",IS="messaging.url",uS="messaging.message_id",pS="messaging.conversation_id",lS="messaging.message_payload_size_bytes",VS="messaging.message_payload_compressed_size_bytes",fS="messaging.operation",mS="messaging.consumer_id",BS="messaging.rabbitmq.routing_key",GS="messaging.kafka.message_key",YS="messaging.kafka.consumer_group",xS="messaging.kafka.client_id",HS="messaging.kafka.partition",gS="messaging.kafka.tombstone",yS="rpc.system",bS="rpc.service",FS="rpc.method",hS="rpc.grpc.status_code",KS="rpc.jsonrpc.version",wS="rpc.jsonrpc.request_id",vS="rpc.jsonrpc.error_code",WS="rpc.jsonrpc.error_message",$S="message.type",jS="message.id",kS="message.compressed_size",XS="message.uncompressed_size";L_.SEMATTRS_AWS_LAMBDA_INVOKED_ARN=pE;L_.SEMATTRS_DB_SYSTEM=lE;L_.SEMATTRS_DB_CONNECTION_STRING=VE;L_.SEMATTRS_DB_USER=fE;L_.SEMATTRS_DB_JDBC_DRIVER_CLASSNAME=mE;L_.SEMATTRS_DB_NAME=BE;L_.SEMATTRS_DB_STATEMENT=GE;L_.SEMATTRS_DB_OPERATION=YE;L_.SEMATTRS_DB_MSSQL_INSTANCE_NAME=xE;L_.SEMATTRS_DB_CASSANDRA_KEYSPACE=HE;L_.SEMATTRS_DB_CASSANDRA_PAGE_SIZE=gE;L_.SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL=yE;L_.SEMATTRS_DB_CASSANDRA_TABLE=bE;L_.SEMATTRS_DB_CASSANDRA_IDEMPOTENCE=FE;L_.SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT=hE;L_.SEMATTRS_DB_CASSANDRA_COORDINATOR_ID=KE;L_.SEMATTRS_DB_CASSANDRA_COORDINATOR_DC=wE;L_.SEMATTRS_DB_HBASE_NAMESPACE=vE;L_.SEMATTRS_DB_REDIS_DATABASE_INDEX=WE;L_.SEMATTRS_DB_MONGODB_COLLECTION=$E;L_.SEMATTRS_DB_SQL_TABLE=jE;L_.SEMATTRS_EXCEPTION_TYPE=kE;L_.SEMATTRS_EXCEPTION_MESSAGE=XE;L_.SEMATTRS_EXCEPTION_STACKTRACE=qE;L_.SEMATTRS_EXCEPTION_ESCAPED=QE;L_.SEMATTRS_FAAS_TRIGGER=JE;L_.SEMATTRS_FAAS_EXECUTION=ZE;L_.SEMATTRS_FAAS_DOCUMENT_COLLECTION=zE;L_.SEMATTRS_FAAS_DOCUMENT_OPERATION=Ee;L_.SEMATTRS_FAAS_DOCUMENT_TIME=ee;L_.SEMATTRS_FAAS_DOCUMENT_NAME=Se;L_.SEMATTRS_FAAS_TIME=Te;L_.SEMATTRS_FAAS_CRON=te;L_.SEMATTRS_FAAS_COLDSTART=_e;L_.SEMATTRS_FAAS_INVOKED_NAME=Ae;L_.SEMATTRS_FAAS_INVOKED_PROVIDER=re;L_.SEMATTRS_FAAS_INVOKED_REGION=se;L_.SEMATTRS_NET_TRANSPORT=oe;L_.SEMATTRS_NET_PEER_IP=ne;L_.SEMATTRS_NET_PEER_PORT=Re;L_.SEMATTRS_NET_PEER_NAME=Oe;L_.SEMATTRS_NET_HOST_IP=Me;L_.SEMATTRS_NET_HOST_PORT=ie;L_.SEMATTRS_NET_HOST_NAME=ce;L_.SEMATTRS_NET_HOST_CONNECTION_TYPE=De;L_.SEMATTRS_NET_HOST_CONNECTION_SUBTYPE=Pe;L_.SEMATTRS_NET_HOST_CARRIER_NAME=Le;L_.SEMATTRS_NET_HOST_CARRIER_MCC=de;L_.SEMATTRS_NET_HOST_CARRIER_MNC=Ue;L_.SEMATTRS_NET_HOST_CARRIER_ICC=Ie;L_.SEMATTRS_PEER_SERVICE=ue;L_.SEMATTRS_ENDUSER_ID=pe;L_.SEMATTRS_ENDUSER_ROLE=le;L_.SEMATTRS_ENDUSER_SCOPE=Ve;L_.SEMATTRS_THREAD_ID=fe;L_.SEMATTRS_THREAD_NAME=me;L_.SEMATTRS_CODE_FUNCTION=Be;L_.SEMATTRS_CODE_NAMESPACE=Ge;L_.SEMATTRS_CODE_FILEPATH=Ye;L_.SEMATTRS_CODE_LINENO=xe;L_.SEMATTRS_HTTP_METHOD=He;L_.SEMATTRS_HTTP_URL=ge;L_.SEMATTRS_HTTP_TARGET=ye;L_.SEMATTRS_HTTP_HOST=be;L_.SEMATTRS_HTTP_SCHEME=Fe;L_.SEMATTRS_HTTP_STATUS_CODE=he;L_.SEMATTRS_HTTP_FLAVOR=Ke;L_.SEMATTRS_HTTP_USER_AGENT=we;L_.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH=ve;L_.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED=We;L_.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH=$e;L_.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED=je;L_.SEMATTRS_HTTP_SERVER_NAME=ke;L_.SEMATTRS_HTTP_ROUTE=Xe;L_.SEMATTRS_HTTP_CLIENT_IP=qe;L_.SEMATTRS_AWS_DYNAMODB_TABLE_NAMES=Qe;L_.SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY=Je;L_.SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS=Ze;L_.SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY=ze;L_.SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY=ES;L_.SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ=eS;L_.SEMATTRS_AWS_DYNAMODB_PROJECTION=SS;L_.SEMATTRS_AWS_DYNAMODB_LIMIT=TS;L_.SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET=tS;L_.SEMATTRS_AWS_DYNAMODB_INDEX_NAME=_S;L_.SEMATTRS_AWS_DYNAMODB_SELECT=AS;L_.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES=rS;L_.SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES=sS;L_.SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE=oS;L_.SEMATTRS_AWS_DYNAMODB_TABLE_COUNT=nS;L_.SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD=RS;L_.SEMATTRS_AWS_DYNAMODB_SEGMENT=NS;L_.SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS=OS;L_.SEMATTRS_AWS_DYNAMODB_COUNT=MS;L_.SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT=aS;L_.SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS=iS;L_.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES=cS;L_.SEMATTRS_MESSAGING_SYSTEM=CS;L_.SEMATTRS_MESSAGING_DESTINATION=DS;L_.SEMATTRS_MESSAGING_DESTINATION_KIND=PS;L_.SEMATTRS_MESSAGING_TEMP_DESTINATION=LS;L_.SEMATTRS_MESSAGING_PROTOCOL=dS;L_.SEMATTRS_MESSAGING_PROTOCOL_VERSION=US;L_.SEMATTRS_MESSAGING_URL=IS;L_.SEMATTRS_MESSAGING_MESSAGE_ID=uS;L_.SEMATTRS_MESSAGING_CONVERSATION_ID=pS;L_.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES=lS;L_.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES=VS;L_.SEMATTRS_MESSAGING_OPERATION=fS;L_.SEMATTRS_MESSAGING_CONSUMER_ID=mS;L_.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY=BS;L_.SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY=GS;L_.SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP=YS;L_.SEMATTRS_MESSAGING_KAFKA_CLIENT_ID=xS;L_.SEMATTRS_MESSAGING_KAFKA_PARTITION=HS;L_.SEMATTRS_MESSAGING_KAFKA_TOMBSTONE=gS;L_.SEMATTRS_RPC_SYSTEM=yS;L_.SEMATTRS_RPC_SERVICE=bS;L_.SEMATTRS_RPC_METHOD=FS;L_.SEMATTRS_RPC_GRPC_STATUS_CODE=hS;L_.SEMATTRS_RPC_JSONRPC_VERSION=KS;L_.SEMATTRS_RPC_JSONRPC_REQUEST_ID=wS;L_.SEMATTRS_RPC_JSONRPC_ERROR_CODE=vS;L_.SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE=WS;L_.SEMATTRS_MESSAGE_TYPE=$S;L_.SEMATTRS_MESSAGE_ID=jS;L_.SEMATTRS_MESSAGE_COMPRESSED_SIZE=kS;L_.SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE=XS;L_.SemanticAttributes=W.createConstMap([pE,lE,VE,fE,mE,BE,GE,YE,xE,HE,gE,yE,bE,FE,hE,KE,wE,vE,WE,$E,jE,kE,XE,qE,QE,JE,ZE,zE,Ee,ee,Se,Te,te,_e,Ae,re,se,oe,ne,Re,Oe,Me,ie,ce,De,Pe,Le,de,Ue,Ie,ue,pe,le,Ve,fe,me,Be,Ge,Ye,xe,He,ge,ye,be,Fe,he,Ke,we,ve,We,$e,je,ke,Xe,qe,Qe,Je,Ze,ze,ES,eS,SS,TS,tS,_S,AS,rS,sS,oS,nS,RS,NS,OS,MS,aS,iS,cS,CS,DS,PS,LS,dS,US,IS,uS,pS,lS,VS,fS,mS,BS,GS,YS,xS,HS,gS,yS,bS,FS,hS,KS,wS,vS,WS,$S,jS,kS,XS]);var qS="other_sql",QS="mssql",JS="mysql",ZS="oracle",zS="db2",ET="postgresql",eT="redshift",ST="hive",TT="cloudscape",tT="hsqldb",_T="progress",AT="maxdb",rT="hanadb",sT="ingres",oT="firstsql",nT="edb",RT="cache",NT="adabas",OT="firebird",MT="derby",aT="filemaker",iT="informix",cT="instantdb",CT="interbase",DT="mariadb",PT="netezza",LT="pervasive",dT="pointbase",UT="sqlite",IT="sybase",uT="teradata",pT="vertica",lT="h2",VT="coldfusion",fT="cassandra",mT="hbase",BT="mongodb",GT="redis",YT="couchbase",xT="couchdb",HT="cosmosdb",gT="dynamodb",yT="neo4j",bT="geode",FT="elasticsearch",hT="memcached",KT="cockroachdb";L_.DBSYSTEMVALUES_OTHER_SQL=qS;L_.DBSYSTEMVALUES_MSSQL=QS;L_.DBSYSTEMVALUES_MYSQL=JS;L_.DBSYSTEMVALUES_ORACLE=ZS;L_.DBSYSTEMVALUES_DB2=zS;L_.DBSYSTEMVALUES_POSTGRESQL=ET;L_.DBSYSTEMVALUES_REDSHIFT=eT;L_.DBSYSTEMVALUES_HIVE=ST;L_.DBSYSTEMVALUES_CLOUDSCAPE=TT;L_.DBSYSTEMVALUES_HSQLDB=tT;L_.DBSYSTEMVALUES_PROGRESS=_T;L_.DBSYSTEMVALUES_MAXDB=AT;L_.DBSYSTEMVALUES_HANADB=rT;L_.DBSYSTEMVALUES_INGRES=sT;L_.DBSYSTEMVALUES_FIRSTSQL=oT;L_.DBSYSTEMVALUES_EDB=nT;L_.DBSYSTEMVALUES_CACHE=RT;L_.DBSYSTEMVALUES_ADABAS=NT;L_.DBSYSTEMVALUES_FIREBIRD=OT;L_.DBSYSTEMVALUES_DERBY=MT;L_.DBSYSTEMVALUES_FILEMAKER=aT;L_.DBSYSTEMVALUES_INFORMIX=iT;L_.DBSYSTEMVALUES_INSTANTDB=cT;L_.DBSYSTEMVALUES_INTERBASE=CT;L_.DBSYSTEMVALUES_MARIADB=DT;L_.DBSYSTEMVALUES_NETEZZA=PT;L_.DBSYSTEMVALUES_PERVASIVE=LT;L_.DBSYSTEMVALUES_POINTBASE=dT;L_.DBSYSTEMVALUES_SQLITE=UT;L_.DBSYSTEMVALUES_SYBASE=IT;L_.DBSYSTEMVALUES_TERADATA=uT;L_.DBSYSTEMVALUES_VERTICA=pT;L_.DBSYSTEMVALUES_H2=lT;L_.DBSYSTEMVALUES_COLDFUSION=VT;L_.DBSYSTEMVALUES_CASSANDRA=fT;L_.DBSYSTEMVALUES_HBASE=mT;L_.DBSYSTEMVALUES_MONGODB=BT;L_.DBSYSTEMVALUES_REDIS=GT;L_.DBSYSTEMVALUES_COUCHBASE=YT;L_.DBSYSTEMVALUES_COUCHDB=xT;L_.DBSYSTEMVALUES_COSMOSDB=HT;L_.DBSYSTEMVALUES_DYNAMODB=gT;L_.DBSYSTEMVALUES_NEO4J=yT;L_.DBSYSTEMVALUES_GEODE=bT;L_.DBSYSTEMVALUES_ELASTICSEARCH=FT;L_.DBSYSTEMVALUES_MEMCACHED=hT;L_.DBSYSTEMVALUES_COCKROACHDB=KT;L_.DbSystemValues=W.createConstMap([qS,QS,JS,ZS,zS,ET,eT,ST,TT,tT,_T,AT,rT,sT,oT,nT,RT,NT,OT,MT,aT,iT,cT,CT,DT,PT,LT,dT,UT,IT,uT,pT,lT,VT,fT,mT,BT,GT,YT,xT,HT,gT,yT,bT,FT,hT,KT]);var wT="all",vT="each_quorum",WT="quorum",$T="local_quorum",jT="one",kT="two",XT="three",qT="local_one",QT="any",JT="serial",ZT="local_serial";L_.DBCASSANDRACONSISTENCYLEVELVALUES_ALL=wT;L_.DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM=vT;L_.DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM=WT;L_.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM=$T;L_.DBCASSANDRACONSISTENCYLEVELVALUES_ONE=jT;L_.DBCASSANDRACONSISTENCYLEVELVALUES_TWO=kT;L_.DBCASSANDRACONSISTENCYLEVELVALUES_THREE=XT;L_.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE=qT;L_.DBCASSANDRACONSISTENCYLEVELVALUES_ANY=QT;L_.DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL=JT;L_.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL=ZT;L_.DbCassandraConsistencyLevelValues=W.createConstMap([wT,vT,WT,$T,jT,kT,XT,qT,QT,JT,ZT]);var zT="datasource",Et="http",et="pubsub",St="timer",Tt="other";L_.FAASTRIGGERVALUES_DATASOURCE=zT;L_.FAASTRIGGERVALUES_HTTP=Et;L_.FAASTRIGGERVALUES_PUBSUB=et;L_.FAASTRIGGERVALUES_TIMER=St;L_.FAASTRIGGERVALUES_OTHER=Tt;L_.FaasTriggerValues=W.createConstMap([zT,Et,et,St,Tt]);var tt="insert",_t="edit",At="delete";L_.FAASDOCUMENTOPERATIONVALUES_INSERT=tt;L_.FAASDOCUMENTOPERATIONVALUES_EDIT=_t;L_.FAASDOCUMENTOPERATIONVALUES_DELETE=At;L_.FaasDocumentOperationValues=W.createConstMap([tt,_t,At]);var rt="alibaba_cloud",st="aws",ot="azure",nt="gcp";L_.FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD=rt;L_.FAASINVOKEDPROVIDERVALUES_AWS=st;L_.FAASINVOKEDPROVIDERVALUES_AZURE=ot;L_.FAASINVOKEDPROVIDERVALUES_GCP=nt;L_.FaasInvokedProviderValues=W.createConstMap([rt,st,ot,nt]);var Rt="ip_tcp",Nt="ip_udp",Ot="ip",Mt="unix",at="pipe",it="inproc",ct="other";L_.NETTRANSPORTVALUES_IP_TCP=Rt;L_.NETTRANSPORTVALUES_IP_UDP=Nt;L_.NETTRANSPORTVALUES_IP=Ot;L_.NETTRANSPORTVALUES_UNIX=Mt;L_.NETTRANSPORTVALUES_PIPE=at;L_.NETTRANSPORTVALUES_INPROC=it;L_.NETTRANSPORTVALUES_OTHER=ct;L_.NetTransportValues=W.createConstMap([Rt,Nt,Ot,Mt,at,it,ct]);var Ct="wifi",Pt="wired",Lt="cell",dt="unavailable",Ut="unknown";L_.NETHOSTCONNECTIONTYPEVALUES_WIFI=Ct;L_.NETHOSTCONNECTIONTYPEVALUES_WIRED=Pt;L_.NETHOSTCONNECTIONTYPEVALUES_CELL=Lt;L_.NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE=dt;L_.NETHOSTCONNECTIONTYPEVALUES_UNKNOWN=Ut;L_.NetHostConnectionTypeValues=W.createConstMap([Ct,Pt,Lt,dt,Ut]);var It="gprs",ut="edge",pt="umts",lt="cdma",Vt="evdo_0",ft="evdo_a",mt="cdma2000_1xrtt",Bt="hsdpa",Gt="hsupa",Yt="hspa",xt="iden",Ht="evdo_b",gt="lte",yt="ehrpd",bt="hspap",Ft="gsm",ht="td_scdma",Kt="iwlan",wt="nr",vt="nrnsa",$t="lte_ca";L_.NETHOSTCONNECTIONSUBTYPEVALUES_GPRS=It;L_.NETHOSTCONNECTIONSUBTYPEVALUES_EDGE=ut;L_.NETHOSTCONNECTIONSUBTYPEVALUES_UMTS=pt;L_.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA=lt;L_.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0=Vt;L_.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A=ft;L_.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT=mt;L_.NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA=Bt;L_.NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA=Gt;L_.NETHOSTCONNECTIONSUBTYPEVALUES_HSPA=Yt;L_.NETHOSTCONNECTIONSUBTYPEVALUES_IDEN=xt;L_.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B=Ht;L_.NETHOSTCONNECTIONSUBTYPEVALUES_LTE=gt;L_.NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD=yt;L_.NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP=bt;L_.NETHOSTCONNECTIONSUBTYPEVALUES_GSM=Ft;L_.NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA=ht;L_.NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN=Kt;L_.NETHOSTCONNECTIONSUBTYPEVALUES_NR=wt;L_.NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA=vt;L_.NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA=$t;L_.NetHostConnectionSubtypeValues=W.createConstMap([It,ut,pt,lt,Vt,ft,mt,Bt,Gt,Yt,xt,Ht,gt,yt,bt,Ft,ht,Kt,wt,vt,$t]);var jt="1.0",kt="1.1",Xt="2.0",qt="SPDY",Qt="QUIC";L_.HTTPFLAVORVALUES_HTTP_1_0=jt;L_.HTTPFLAVORVALUES_HTTP_1_1=kt;L_.HTTPFLAVORVALUES_HTTP_2_0=Xt;L_.HTTPFLAVORVALUES_SPDY=qt;L_.HTTPFLAVORVALUES_QUIC=Qt;L_.HttpFlavorValues={HTTP_1_0:jt,HTTP_1_1:kt,HTTP_2_0:Xt,SPDY:qt,QUIC:Qt};var Jt="queue",Zt="topic";L_.MESSAGINGDESTINATIONKINDVALUES_QUEUE=Jt;L_.MESSAGINGDESTINATIONKINDVALUES_TOPIC=Zt;L_.MessagingDestinationKindValues=W.createConstMap([Jt,Zt]);var E_="receive",e_="process";L_.MESSAGINGOPERATIONVALUES_RECEIVE=E_;L_.MESSAGINGOPERATIONVALUES_PROCESS=e_;L_.MessagingOperationValues=W.createConstMap([E_,e_]);var S_=0,T_=1,t_=2,__=3,A_=4,r_=5,s_=6,o_=7,n_=8,R_=9,N_=10,O_=11,M_=12,a_=13,i_=14,c_=15,C_=16;L_.RPCGRPCSTATUSCODEVALUES_OK=S_;L_.RPCGRPCSTATUSCODEVALUES_CANCELLED=T_;L_.RPCGRPCSTATUSCODEVALUES_UNKNOWN=t_;L_.RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT=__;L_.RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED=A_;L_.RPCGRPCSTATUSCODEVALUES_NOT_FOUND=r_;L_.RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS=s_;L_.RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED=o_;L_.RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED=n_;L_.RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION=R_;L_.RPCGRPCSTATUSCODEVALUES_ABORTED=N_;L_.RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE=O_;L_.RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED=M_;L_.RPCGRPCSTATUSCODEVALUES_INTERNAL=a_;L_.RPCGRPCSTATUSCODEVALUES_UNAVAILABLE=i_;L_.RPCGRPCSTATUSCODEVALUES_DATA_LOSS=c_;L_.RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED=C_;L_.RpcGrpcStatusCodeValues={OK:S_,CANCELLED:T_,UNKNOWN:t_,INVALID_ARGUMENT:__,DEADLINE_EXCEEDED:A_,NOT_FOUND:r_,ALREADY_EXISTS:s_,PERMISSION_DENIED:o_,RESOURCE_EXHAUSTED:n_,FAILED_PRECONDITION:R_,ABORTED:N_,OUT_OF_RANGE:O_,UNIMPLEMENTED:M_,INTERNAL:a_,UNAVAILABLE:i_,DATA_LOSS:c_,UNAUTHENTICATED:C_};var D_="SENT",P_="RECEIVED";L_.MESSAGETYPEVALUES_SENT=D_;L_.MESSAGETYPEVALUES_RECEIVED=P_;L_.MessageTypeValues=W.createConstMap([D_,P_])});var f_=v(function(Z){var mO=Z&&Z.__createBinding||(Object.create?function(E,e,T,_){if(_===void 0)_=T;var S=Object.getOwnPropertyDescriptor(e,T);if(!S||("get"in S?!e.__esModule:S.writable||S.configurable))S={enumerable:!0,get:function(){return e[T]}};Object.defineProperty(E,_,S)}:function(E,e,T,_){if(_===void 0)_=T;E[_]=e[T]}),BO=Z&&Z.__exportStar||function(E,e){for(var T in E)if(T!=="default"&&!Object.prototype.hasOwnProperty.call(e,T))mO(e,E,T)};Object.defineProperty(Z,"__esModule",{value:!0});BO(V_(),Z)});var rs=v(function(Ts){Object.defineProperty(Ts,"__esModule",{value:!0});Ts.SEMRESATTRS_K8S_STATEFULSET_NAME=Ts.SEMRESATTRS_K8S_STATEFULSET_UID=Ts.SEMRESATTRS_K8S_DEPLOYMENT_NAME=Ts.SEMRESATTRS_K8S_DEPLOYMENT_UID=Ts.SEMRESATTRS_K8S_REPLICASET_NAME=Ts.SEMRESATTRS_K8S_REPLICASET_UID=Ts.SEMRESATTRS_K8S_CONTAINER_NAME=Ts.SEMRESATTRS_K8S_POD_NAME=Ts.SEMRESATTRS_K8S_POD_UID=Ts.SEMRESATTRS_K8S_NAMESPACE_NAME=Ts.SEMRESATTRS_K8S_NODE_UID=Ts.SEMRESATTRS_K8S_NODE_NAME=Ts.SEMRESATTRS_K8S_CLUSTER_NAME=Ts.SEMRESATTRS_HOST_IMAGE_VERSION=Ts.SEMRESATTRS_HOST_IMAGE_ID=Ts.SEMRESATTRS_HOST_IMAGE_NAME=Ts.SEMRESATTRS_HOST_ARCH=Ts.SEMRESATTRS_HOST_TYPE=Ts.SEMRESATTRS_HOST_NAME=Ts.SEMRESATTRS_HOST_ID=Ts.SEMRESATTRS_FAAS_MAX_MEMORY=Ts.SEMRESATTRS_FAAS_INSTANCE=Ts.SEMRESATTRS_FAAS_VERSION=Ts.SEMRESATTRS_FAAS_ID=Ts.SEMRESATTRS_FAAS_NAME=Ts.SEMRESATTRS_DEVICE_MODEL_NAME=Ts.SEMRESATTRS_DEVICE_MODEL_IDENTIFIER=Ts.SEMRESATTRS_DEVICE_ID=Ts.SEMRESATTRS_DEPLOYMENT_ENVIRONMENT=Ts.SEMRESATTRS_CONTAINER_IMAGE_TAG=Ts.SEMRESATTRS_CONTAINER_IMAGE_NAME=Ts.SEMRESATTRS_CONTAINER_RUNTIME=Ts.SEMRESATTRS_CONTAINER_ID=Ts.SEMRESATTRS_CONTAINER_NAME=Ts.SEMRESATTRS_AWS_LOG_STREAM_ARNS=Ts.SEMRESATTRS_AWS_LOG_STREAM_NAMES=Ts.SEMRESATTRS_AWS_LOG_GROUP_ARNS=Ts.SEMRESATTRS_AWS_LOG_GROUP_NAMES=Ts.SEMRESATTRS_AWS_EKS_CLUSTER_ARN=Ts.SEMRESATTRS_AWS_ECS_TASK_REVISION=Ts.SEMRESATTRS_AWS_ECS_TASK_FAMILY=Ts.SEMRESATTRS_AWS_ECS_TASK_ARN=Ts.SEMRESATTRS_AWS_ECS_LAUNCHTYPE=Ts.SEMRESATTRS_AWS_ECS_CLUSTER_ARN=Ts.SEMRESATTRS_AWS_ECS_CONTAINER_ARN=Ts.SEMRESATTRS_CLOUD_PLATFORM=Ts.SEMRESATTRS_CLOUD_AVAILABILITY_ZONE=Ts.SEMRESATTRS_CLOUD_REGION=Ts.SEMRESATTRS_CLOUD_ACCOUNT_ID=Ts.SEMRESATTRS_CLOUD_PROVIDER=void 0;Ts.CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE=Ts.CLOUDPLATFORMVALUES_AZURE_APP_SERVICE=Ts.CLOUDPLATFORMVALUES_AZURE_FUNCTIONS=Ts.CLOUDPLATFORMVALUES_AZURE_AKS=Ts.CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES=Ts.CLOUDPLATFORMVALUES_AZURE_VM=Ts.CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK=Ts.CLOUDPLATFORMVALUES_AWS_LAMBDA=Ts.CLOUDPLATFORMVALUES_AWS_EKS=Ts.CLOUDPLATFORMVALUES_AWS_ECS=Ts.CLOUDPLATFORMVALUES_AWS_EC2=Ts.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC=Ts.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS=Ts.CloudProviderValues=Ts.CLOUDPROVIDERVALUES_GCP=Ts.CLOUDPROVIDERVALUES_AZURE=Ts.CLOUDPROVIDERVALUES_AWS=Ts.CLOUDPROVIDERVALUES_ALIBABA_CLOUD=Ts.SemanticResourceAttributes=Ts.SEMRESATTRS_WEBENGINE_DESCRIPTION=Ts.SEMRESATTRS_WEBENGINE_VERSION=Ts.SEMRESATTRS_WEBENGINE_NAME=Ts.SEMRESATTRS_TELEMETRY_AUTO_VERSION=Ts.SEMRESATTRS_TELEMETRY_SDK_VERSION=Ts.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE=Ts.SEMRESATTRS_TELEMETRY_SDK_NAME=Ts.SEMRESATTRS_SERVICE_VERSION=Ts.SEMRESATTRS_SERVICE_INSTANCE_ID=Ts.SEMRESATTRS_SERVICE_NAMESPACE=Ts.SEMRESATTRS_SERVICE_NAME=Ts.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION=Ts.SEMRESATTRS_PROCESS_RUNTIME_VERSION=Ts.SEMRESATTRS_PROCESS_RUNTIME_NAME=Ts.SEMRESATTRS_PROCESS_OWNER=Ts.SEMRESATTRS_PROCESS_COMMAND_ARGS=Ts.SEMRESATTRS_PROCESS_COMMAND_LINE=Ts.SEMRESATTRS_PROCESS_COMMAND=Ts.SEMRESATTRS_PROCESS_EXECUTABLE_PATH=Ts.SEMRESATTRS_PROCESS_EXECUTABLE_NAME=Ts.SEMRESATTRS_PROCESS_PID=Ts.SEMRESATTRS_OS_VERSION=Ts.SEMRESATTRS_OS_NAME=Ts.SEMRESATTRS_OS_DESCRIPTION=Ts.SEMRESATTRS_OS_TYPE=Ts.SEMRESATTRS_K8S_CRONJOB_NAME=Ts.SEMRESATTRS_K8S_CRONJOB_UID=Ts.SEMRESATTRS_K8S_JOB_NAME=Ts.SEMRESATTRS_K8S_JOB_UID=Ts.SEMRESATTRS_K8S_DAEMONSET_NAME=Ts.SEMRESATTRS_K8S_DAEMONSET_UID=void 0;Ts.TelemetrySdkLanguageValues=Ts.TELEMETRYSDKLANGUAGEVALUES_WEBJS=Ts.TELEMETRYSDKLANGUAGEVALUES_RUBY=Ts.TELEMETRYSDKLANGUAGEVALUES_PYTHON=Ts.TELEMETRYSDKLANGUAGEVALUES_PHP=Ts.TELEMETRYSDKLANGUAGEVALUES_NODEJS=Ts.TELEMETRYSDKLANGUAGEVALUES_JAVA=Ts.TELEMETRYSDKLANGUAGEVALUES_GO=Ts.TELEMETRYSDKLANGUAGEVALUES_ERLANG=Ts.TELEMETRYSDKLANGUAGEVALUES_DOTNET=Ts.TELEMETRYSDKLANGUAGEVALUES_CPP=Ts.OsTypeValues=Ts.OSTYPEVALUES_Z_OS=Ts.OSTYPEVALUES_SOLARIS=Ts.OSTYPEVALUES_AIX=Ts.OSTYPEVALUES_HPUX=Ts.OSTYPEVALUES_DRAGONFLYBSD=Ts.OSTYPEVALUES_OPENBSD=Ts.OSTYPEVALUES_NETBSD=Ts.OSTYPEVALUES_FREEBSD=Ts.OSTYPEVALUES_DARWIN=Ts.OSTYPEVALUES_LINUX=Ts.OSTYPEVALUES_WINDOWS=Ts.HostArchValues=Ts.HOSTARCHVALUES_X86=Ts.HOSTARCHVALUES_PPC64=Ts.HOSTARCHVALUES_PPC32=Ts.HOSTARCHVALUES_IA64=Ts.HOSTARCHVALUES_ARM64=Ts.HOSTARCHVALUES_ARM32=Ts.HOSTARCHVALUES_AMD64=Ts.AwsEcsLaunchtypeValues=Ts.AWSECSLAUNCHTYPEVALUES_FARGATE=Ts.AWSECSLAUNCHTYPEVALUES_EC2=Ts.CloudPlatformValues=Ts.CLOUDPLATFORMVALUES_GCP_APP_ENGINE=Ts.CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS=Ts.CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE=Ts.CLOUDPLATFORMVALUES_GCP_CLOUD_RUN=void 0;var EE=iE(),m_="cloud.provider",B_="cloud.account.id",G_="cloud.region",Y_="cloud.availability_zone",x_="cloud.platform",H_="aws.ecs.container.arn",g_="aws.ecs.cluster.arn",y_="aws.ecs.launchtype",b_="aws.ecs.task.arn",F_="aws.ecs.task.family",h_="aws.ecs.task.revision",K_="aws.eks.cluster.arn",w_="aws.log.group.names",v_="aws.log.group.arns",W_="aws.log.stream.names",$_="aws.log.stream.arns",j_="container.name",k_="container.id",X_="container.runtime",q_="container.image.name",Q_="container.image.tag",J_="deployment.environment",Z_="device.id",z_="device.model.identifier",EA="device.model.name",eA="faas.name",SA="faas.id",TA="faas.version",tA="faas.instance",_A="faas.max_memory",AA="host.id",rA="host.name",sA="host.type",oA="host.arch",nA="host.image.name",RA="host.image.id",NA="host.image.version",OA="k8s.cluster.name",MA="k8s.node.name",aA="k8s.node.uid",iA="k8s.namespace.name",cA="k8s.pod.uid",CA="k8s.pod.name",DA="k8s.container.name",PA="k8s.replicaset.uid",LA="k8s.replicaset.name",dA="k8s.deployment.uid",UA="k8s.deployment.name",IA="k8s.statefulset.uid",uA="k8s.statefulset.name",pA="k8s.daemonset.uid",lA="k8s.daemonset.name",VA="k8s.job.uid",fA="k8s.job.name",mA="k8s.cronjob.uid",BA="k8s.cronjob.name",GA="os.type",YA="os.description",xA="os.name",HA="os.version",gA="process.pid",yA="process.executable.name",bA="process.executable.path",FA="process.command",hA="process.command_line",KA="process.command_args",wA="process.owner",vA="process.runtime.name",WA="process.runtime.version",$A="process.runtime.description",jA="service.name",kA="service.namespace",XA="service.instance.id",qA="service.version",QA="telemetry.sdk.name",JA="telemetry.sdk.language",ZA="telemetry.sdk.version",zA="telemetry.auto.version",Er="webengine.name",er="webengine.version",Sr="webengine.description";Ts.SEMRESATTRS_CLOUD_PROVIDER=m_;Ts.SEMRESATTRS_CLOUD_ACCOUNT_ID=B_;Ts.SEMRESATTRS_CLOUD_REGION=G_;Ts.SEMRESATTRS_CLOUD_AVAILABILITY_ZONE=Y_;Ts.SEMRESATTRS_CLOUD_PLATFORM=x_;Ts.SEMRESATTRS_AWS_ECS_CONTAINER_ARN=H_;Ts.SEMRESATTRS_AWS_ECS_CLUSTER_ARN=g_;Ts.SEMRESATTRS_AWS_ECS_LAUNCHTYPE=y_;Ts.SEMRESATTRS_AWS_ECS_TASK_ARN=b_;Ts.SEMRESATTRS_AWS_ECS_TASK_FAMILY=F_;Ts.SEMRESATTRS_AWS_ECS_TASK_REVISION=h_;Ts.SEMRESATTRS_AWS_EKS_CLUSTER_ARN=K_;Ts.SEMRESATTRS_AWS_LOG_GROUP_NAMES=w_;Ts.SEMRESATTRS_AWS_LOG_GROUP_ARNS=v_;Ts.SEMRESATTRS_AWS_LOG_STREAM_NAMES=W_;Ts.SEMRESATTRS_AWS_LOG_STREAM_ARNS=$_;Ts.SEMRESATTRS_CONTAINER_NAME=j_;Ts.SEMRESATTRS_CONTAINER_ID=k_;Ts.SEMRESATTRS_CONTAINER_RUNTIME=X_;Ts.SEMRESATTRS_CONTAINER_IMAGE_NAME=q_;Ts.SEMRESATTRS_CONTAINER_IMAGE_TAG=Q_;Ts.SEMRESATTRS_DEPLOYMENT_ENVIRONMENT=J_;Ts.SEMRESATTRS_DEVICE_ID=Z_;Ts.SEMRESATTRS_DEVICE_MODEL_IDENTIFIER=z_;Ts.SEMRESATTRS_DEVICE_MODEL_NAME=EA;Ts.SEMRESATTRS_FAAS_NAME=eA;Ts.SEMRESATTRS_FAAS_ID=SA;Ts.SEMRESATTRS_FAAS_VERSION=TA;Ts.SEMRESATTRS_FAAS_INSTANCE=tA;Ts.SEMRESATTRS_FAAS_MAX_MEMORY=_A;Ts.SEMRESATTRS_HOST_ID=AA;Ts.SEMRESATTRS_HOST_NAME=rA;Ts.SEMRESATTRS_HOST_TYPE=sA;Ts.SEMRESATTRS_HOST_ARCH=oA;Ts.SEMRESATTRS_HOST_IMAGE_NAME=nA;Ts.SEMRESATTRS_HOST_IMAGE_ID=RA;Ts.SEMRESATTRS_HOST_IMAGE_VERSION=NA;Ts.SEMRESATTRS_K8S_CLUSTER_NAME=OA;Ts.SEMRESATTRS_K8S_NODE_NAME=MA;Ts.SEMRESATTRS_K8S_NODE_UID=aA;Ts.SEMRESATTRS_K8S_NAMESPACE_NAME=iA;Ts.SEMRESATTRS_K8S_POD_UID=cA;Ts.SEMRESATTRS_K8S_POD_NAME=CA;Ts.SEMRESATTRS_K8S_CONTAINER_NAME=DA;Ts.SEMRESATTRS_K8S_REPLICASET_UID=PA;Ts.SEMRESATTRS_K8S_REPLICASET_NAME=LA;Ts.SEMRESATTRS_K8S_DEPLOYMENT_UID=dA;Ts.SEMRESATTRS_K8S_DEPLOYMENT_NAME=UA;Ts.SEMRESATTRS_K8S_STATEFULSET_UID=IA;Ts.SEMRESATTRS_K8S_STATEFULSET_NAME=uA;Ts.SEMRESATTRS_K8S_DAEMONSET_UID=pA;Ts.SEMRESATTRS_K8S_DAEMONSET_NAME=lA;Ts.SEMRESATTRS_K8S_JOB_UID=VA;Ts.SEMRESATTRS_K8S_JOB_NAME=fA;Ts.SEMRESATTRS_K8S_CRONJOB_UID=mA;Ts.SEMRESATTRS_K8S_CRONJOB_NAME=BA;Ts.SEMRESATTRS_OS_TYPE=GA;Ts.SEMRESATTRS_OS_DESCRIPTION=YA;Ts.SEMRESATTRS_OS_NAME=xA;Ts.SEMRESATTRS_OS_VERSION=HA;Ts.SEMRESATTRS_PROCESS_PID=gA;Ts.SEMRESATTRS_PROCESS_EXECUTABLE_NAME=yA;Ts.SEMRESATTRS_PROCESS_EXECUTABLE_PATH=bA;Ts.SEMRESATTRS_PROCESS_COMMAND=FA;Ts.SEMRESATTRS_PROCESS_COMMAND_LINE=hA;Ts.SEMRESATTRS_PROCESS_COMMAND_ARGS=KA;Ts.SEMRESATTRS_PROCESS_OWNER=wA;Ts.SEMRESATTRS_PROCESS_RUNTIME_NAME=vA;Ts.SEMRESATTRS_PROCESS_RUNTIME_VERSION=WA;Ts.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION=$A;Ts.SEMRESATTRS_SERVICE_NAME=jA;Ts.SEMRESATTRS_SERVICE_NAMESPACE=kA;Ts.SEMRESATTRS_SERVICE_INSTANCE_ID=XA;Ts.SEMRESATTRS_SERVICE_VERSION=qA;Ts.SEMRESATTRS_TELEMETRY_SDK_NAME=QA;Ts.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE=JA;Ts.SEMRESATTRS_TELEMETRY_SDK_VERSION=ZA;Ts.SEMRESATTRS_TELEMETRY_AUTO_VERSION=zA;Ts.SEMRESATTRS_WEBENGINE_NAME=Er;Ts.SEMRESATTRS_WEBENGINE_VERSION=er;Ts.SEMRESATTRS_WEBENGINE_DESCRIPTION=Sr;Ts.SemanticResourceAttributes=EE.createConstMap([m_,B_,G_,Y_,x_,H_,g_,y_,b_,F_,h_,K_,w_,v_,W_,$_,j_,k_,X_,q_,Q_,J_,Z_,z_,EA,eA,SA,TA,tA,_A,AA,rA,sA,oA,nA,RA,NA,OA,MA,aA,iA,cA,CA,DA,PA,LA,dA,UA,IA,uA,pA,lA,VA,fA,mA,BA,GA,YA,xA,HA,gA,yA,bA,FA,hA,KA,wA,vA,WA,$A,jA,kA,XA,qA,QA,JA,ZA,zA,Er,er,Sr]);var Tr="alibaba_cloud",tr="aws",_r="azure",Ar="gcp";Ts.CLOUDPROVIDERVALUES_ALIBABA_CLOUD=Tr;Ts.CLOUDPROVIDERVALUES_AWS=tr;Ts.CLOUDPROVIDERVALUES_AZURE=_r;Ts.CLOUDPROVIDERVALUES_GCP=Ar;Ts.CloudProviderValues=EE.createConstMap([Tr,tr,_r,Ar]);var rr="alibaba_cloud_ecs",sr="alibaba_cloud_fc",or="aws_ec2",nr="aws_ecs",Rr="aws_eks",Nr="aws_lambda",Or="aws_elastic_beanstalk",Mr="azure_vm",ar="azure_container_instances",ir="azure_aks",cr="azure_functions",Cr="azure_app_service",Dr="gcp_compute_engine",Pr="gcp_cloud_run",Ur="gcp_kubernetes_engine",Ir="gcp_cloud_functions",ur="gcp_app_engine";Ts.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS=rr;Ts.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC=sr;Ts.CLOUDPLATFORMVALUES_AWS_EC2=or;Ts.CLOUDPLATFORMVALUES_AWS_ECS=nr;Ts.CLOUDPLATFORMVALUES_AWS_EKS=Rr;Ts.CLOUDPLATFORMVALUES_AWS_LAMBDA=Nr;Ts.CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK=Or;Ts.CLOUDPLATFORMVALUES_AZURE_VM=Mr;Ts.CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES=ar;Ts.CLOUDPLATFORMVALUES_AZURE_AKS=ir;Ts.CLOUDPLATFORMVALUES_AZURE_FUNCTIONS=cr;Ts.CLOUDPLATFORMVALUES_AZURE_APP_SERVICE=Cr;Ts.CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE=Dr;Ts.CLOUDPLATFORMVALUES_GCP_CLOUD_RUN=Pr;Ts.CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE=Ur;Ts.CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS=Ir;Ts.CLOUDPLATFORMVALUES_GCP_APP_ENGINE=ur;Ts.CloudPlatformValues=EE.createConstMap([rr,sr,or,nr,Rr,Nr,Or,Mr,ar,ir,cr,Cr,Dr,Pr,Ur,Ir,ur]);var pr="ec2",lr="fargate";Ts.AWSECSLAUNCHTYPEVALUES_EC2=pr;Ts.AWSECSLAUNCHTYPEVALUES_FARGATE=lr;Ts.AwsEcsLaunchtypeValues=EE.createConstMap([pr,lr]);var Vr="amd64",fr="arm32",mr="arm64",Br="ia64",Gr="ppc32",Yr="ppc64",xr="x86";Ts.HOSTARCHVALUES_AMD64=Vr;Ts.HOSTARCHVALUES_ARM32=fr;Ts.HOSTARCHVALUES_ARM64=mr;Ts.HOSTARCHVALUES_IA64=Br;Ts.HOSTARCHVALUES_PPC32=Gr;Ts.HOSTARCHVALUES_PPC64=Yr;Ts.HOSTARCHVALUES_X86=xr;Ts.HostArchValues=EE.createConstMap([Vr,fr,mr,Br,Gr,Yr,xr]);var Hr="windows",gr="linux",yr="darwin",br="freebsd",Fr="netbsd",hr="openbsd",Kr="dragonflybsd",wr="hpux",vr="aix",Wr="solaris",$r="z_os";Ts.OSTYPEVALUES_WINDOWS=Hr;Ts.OSTYPEVALUES_LINUX=gr;Ts.OSTYPEVALUES_DARWIN=yr;Ts.OSTYPEVALUES_FREEBSD=br;Ts.OSTYPEVALUES_NETBSD=Fr;Ts.OSTYPEVALUES_OPENBSD=hr;Ts.OSTYPEVALUES_DRAGONFLYBSD=Kr;Ts.OSTYPEVALUES_HPUX=wr;Ts.OSTYPEVALUES_AIX=vr;Ts.OSTYPEVALUES_SOLARIS=Wr;Ts.OSTYPEVALUES_Z_OS=$r;Ts.OsTypeValues=EE.createConstMap([Hr,gr,yr,br,Fr,hr,Kr,wr,vr,Wr,$r]);var jr="cpp",kr="dotnet",Xr="erlang",qr="go",Qr="java",Jr="nodejs",zr="php",Es="python",es="ruby",Ss="webjs";Ts.TELEMETRYSDKLANGUAGEVALUES_CPP=jr;Ts.TELEMETRYSDKLANGUAGEVALUES_DOTNET=kr;Ts.TELEMETRYSDKLANGUAGEVALUES_ERLANG=Xr;Ts.TELEMETRYSDKLANGUAGEVALUES_GO=qr;Ts.TELEMETRYSDKLANGUAGEVALUES_JAVA=Qr;Ts.TELEMETRYSDKLANGUAGEVALUES_NODEJS=Jr;Ts.TELEMETRYSDKLANGUAGEVALUES_PHP=zr;Ts.TELEMETRYSDKLANGUAGEVALUES_PYTHON=Es;Ts.TELEMETRYSDKLANGUAGEVALUES_RUBY=es;Ts.TELEMETRYSDKLANGUAGEVALUES_WEBJS=Ss;Ts.TelemetrySdkLanguageValues=EE.createConstMap([jr,kr,Xr,qr,Qr,Jr,zr,Es,es,Ss])});var ss=v(function(eE){var ni=eE&&eE.__createBinding||(Object.create?function(E,e,T,_){if(_===void 0)_=T;var S=Object.getOwnPropertyDescriptor(e,T);if(!S||("get"in S?!e.__esModule:S.writable||S.configurable))S={enumerable:!0,get:function(){return e[T]}};Object.defineProperty(E,_,S)}:function(E,e,T,_){if(_===void 0)_=T;E[_]=e[T]}),Ri=eE&&eE.__exportStar||function(E,e){for(var T in E)if(T!=="default"&&!Object.prototype.hasOwnProperty.call(e,T))ni(e,E,T)};Object.defineProperty(eE,"__esModule",{value:!0});Ri(rs(),eE)});var os=v(function(q){var Ni=q&&q.__createBinding||(Object.create?function(E,e,T,_){if(_===void 0)_=T;var S=Object.getOwnPropertyDescriptor(e,T);if(!S||("get"in S?!e.__esModule:S.writable||S.configurable))S={enumerable:!0,get:function(){return e[T]}};Object.defineProperty(E,_,S)}:function(E,e,T,_){if(_===void 0)_=T;E[_]=e[T]}),_E=q&&q.__exportStar||function(E,e){for(var T in E)if(T!=="default"&&!Object.prototype.hasOwnProperty.call(e,T))Ni(e,E,T)};Object.defineProperty(q,"__esModule",{value:!0});_E(f_(),q);_E(ss(),q);_E(Mu(),q);_E(Ru(),q);_E(ku(),q)});var sE=Object.create(null),TE=(E)=>globalThis.process?.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(E?sE:globalThis),zt=new Proxy(sE,{get(E,e){return TE()[e]??sE[e]},has(E,e){return e in TE()||e in sE},set(E,e,T){let _=TE(!0);return _[e]=T,!0},deleteProperty(E,e){if(!e)return!1;let T=TE(!0);return delete T[e],!0},ownKeys(){let E=TE(!0);return Object.keys(E)}});function is(E){return E?E!=="false":!1}var oE=typeof process<"u"&&process.env&&"production"||"",_i=oE==="production",el=()=>oE==="dev"||oE==="development",Ba=()=>oE==="test"||is(zt.TEST);function Wt(E,e){if(typeof process<"u"&&process.env)return process.env[E]??e;if(typeof Deno<"u")return Deno.env.get(E)??e;if(typeof Bun<"u")return Bun.env[E]??e;return e}function cf(E,e=!0){let T=Wt(E);if(!T)return e;return T!=="0"&&T.toLowerCase()!=="false"&&T!==""}var im=Object.freeze({get BETTER_AUTH_SECRET(){return Wt("BETTER_AUTH_SECRET")},get AUTH_SECRET(){return Wt("AUTH_SECRET")},get BETTER_AUTH_TELEMETRY(){return Wt("BETTER_AUTH_TELEMETRY")},get BETTER_AUTH_TELEMETRY_ID(){return Wt("BETTER_AUTH_TELEMETRY_ID")},get NODE_ENV(){return Wt("NODE_ENV","development")},get PACKAGE_VERSION(){return Wt("PACKAGE_VERSION","0.0.0")},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return Wt("BETTER_AUTH_TELEMETRY_ENDPOINT","")}});var tE=1,x=4,Q=8,K=24,CE={eterm:x,cons25:x,console:x,cygwin:x,dtterm:x,gnome:x,hurd:x,jfbterm:x,konsole:x,kterm:x,mlterm:x,mosh:K,putty:x,st:x,"rxvt-unicode-24bit":K,terminator:K,"xterm-kitty":K},cs=new Map(Object.entries({APPVEYOR:Q,BUILDKITE:Q,CIRCLECI:K,DRONE:Q,GITEA_ACTIONS:K,GITHUB_ACTIONS:K,GITLAB_CI:Q,TRAVIS:Q})),Cs=[/ansi/,/color/,/linux/,/direct/,/^con[0-9]*x[0-9]/,/^rxvt/,/^screen/,/^xterm/,/^vt100/,/^vt220/];function nE(){if(Wt("FORCE_COLOR")!==void 0)switch(Wt("FORCE_COLOR")){case"":case"1":case"true":return x;case"2":return Q;case"3":return K;default:return tE}if(Wt("NODE_DISABLE_COLORS")!==void 0&&Wt("NODE_DISABLE_COLORS")!==""||Wt("NO_COLOR")!==void 0&&Wt("NO_COLOR")!==""||Wt("TERM")==="dumb")return tE;if(Wt("TMUX"))return K;if("TF_BUILD"in zt&&"AGENT_NAME"in zt)return x;if("CI"in zt){for(let{0:E,1:e}of cs)if(E in zt)return e;if(Wt("CI_NAME")==="codeship")return Q;return tE}if("TEAMCITY_VERSION"in zt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.exec(Wt("TEAMCITY_VERSION"))!==null?x:tE;switch(Wt("TERM_PROGRAM")){case"iTerm.app":if(!Wt("TERM_PROGRAM_VERSION")||/^[0-2]\./.exec(Wt("TERM_PROGRAM_VERSION"))!==null)return Q;return K;case"HyperTerm":case"MacTerm":return K;case"Apple_Terminal":return Q}if(Wt("COLORTERM")==="truecolor"||Wt("COLORTERM")==="24bit")return K;if(Wt("TERM")){if(/truecolor/.exec(Wt("TERM"))!==null)return K;if(/^xterm-256/.exec(Wt("TERM"))!==null)return Q;let E=Wt("TERM").toLowerCase();if(CE[E])return CE[E];if(Cs.some((e)=>e.exec(E)!==null))return x}if(Wt("COLORTERM"))return x;return tE}var G={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",undim:"\x1B[22m",underscore:"\x1B[4m",blink:"\x1B[5m",reverse:"\x1B[7m",hidden:"\x1B[8m",fg:{black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m"},bg:{black:"\x1B[40m",red:"\x1B[41m",green:"\x1B[42m",yellow:"\x1B[43m",blue:"\x1B[44m",magenta:"\x1B[45m",cyan:"\x1B[46m",white:"\x1B[47m"}},ME=["debug","info","success","warn","error"];function gc(E,e){return ME.indexOf(e)>=ME.indexOf(E)}var Ds={info:G.fg.blue,success:G.fg.green,warn:G.fg.yellow,error:G.fg.red,debug:G.fg.magenta},Ps=(E,e,T)=>{let _=new Date().toISOString();if(T)return`${G.dim}${_}${G.reset} ${Ds[E]}${E.toUpperCase()}${G.reset} ${G.bright}[Better Auth]:${G.reset} ${e}`;return`${_} ${E.toUpperCase()} [Better Auth]: ${e}`},Ua=(E)=>{let e=E?.disabled!==!0,T=E?.level??"warn",_=E?.disableColors!==void 0?!E.disableColors:nE()!==1,S=(R,s,l=[])=>{if(!e||!gc(T,R))return;let D=Ps(R,s,_);if(!E||typeof E.log!=="function"){if(R==="error")console.error(D,...l);else if(R==="warn")console.warn(D,...l);else console.log(D,...l);return}E.log(R==="success"?"info":R,s,...l)};return{...Object.fromEntries(ME.map((R)=>[R,(...[s,...l])=>S(R,s,l)])),get level(){return T}}},Ce=Ua();function Ls(){let E=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");if(E===void 0)return Object.isExtensible(Error);return Object.prototype.hasOwnProperty.call(E,"writable")?E.writable:E.set!==void 0}function ds(E){let e=E.split(`
|
|
3
|
+
at `);if(e.length<=1)return E;return e.splice(1,1),e.join(`
|
|
4
|
+
at `)}function Us(E,e){class T extends E{#E;constructor(..._){if(Ls()){let R=Error.stackTraceLimit;Error.stackTraceLimit=0;super(..._);Error.stackTraceLimit=R}else super(..._);let S=Error().stack;if(S)this.#E=ds(S.replace(/^Error/,this.name))}get errorStack(){return this.#E}}return Object.defineProperty(T.prototype,"constructor",{get(){return e},enumerable:!1,configurable:!0}),T}var Is={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511},DE=class extends Error{constructor(E="INTERNAL_SERVER_ERROR",e=void 0,T={},_=typeof E==="number"?E:Is[E]){super(e?.message,e?.cause?{cause:e.cause}:void 0);this.status=E,this.body=e,this.headers=T,this.statusCode=_,this.name="APIError",this.status=E,this.headers=T,this.statusCode=_,this.body=e}},Ac=class extends DE{constructor(E,e){super(400,{message:E,code:"VALIDATION_ERROR"});this.message=E,this.issues=e,this.issues=e}},Eu=class extends Error{constructor(E){super(E);this.name="BetterCallError"}},ta=Symbol.for("better-call:api-error-headers"),po=Us(DE,Error);var ae=class extends Error{constructor(E,e){super(E,e);this.name="BetterAuthError",this.message=E,this.stack=""}},j=class E extends po{constructor(...e){super(...e)}static fromStatus(e,T){return new E(e,T)}static from(e,T){return new E(e,{message:T.message,code:T.code})}};var Qn=(E)=>{let e=(E.plugins??[]).reduce((m,h)=>{let k=h.schema;if(!k)return m;for(let[d,F]of Object.entries(k))m[d]={fields:{...m[d]?.fields,...F.fields},modelName:F.modelName||d};return m},{}),T=E.rateLimit?.storage==="database",_={rateLimit:{modelName:E.rateLimit?.modelName||"rateLimit",fields:{key:{type:"string",unique:!0,required:!0,fieldName:E.rateLimit?.fields?.key||"key"},count:{type:"number",required:!0,fieldName:E.rateLimit?.fields?.count||"count"},lastRequest:{type:"number",bigint:!0,required:!0,fieldName:E.rateLimit?.fields?.lastRequest||"lastRequest",defaultValue:()=>Date.now()}}}},{user:S,session:R,account:s,verification:l,...D}=e,g={verification:{modelName:E.verification?.modelName||"verification",fields:{identifier:{type:"string",required:!0,fieldName:E.verification?.fields?.identifier||"identifier",index:!0},value:{type:"string",required:!0,fieldName:E.verification?.fields?.value||"value"},expiresAt:{type:"date",required:!0,fieldName:E.verification?.fields?.expiresAt||"expiresAt"},createdAt:{type:"date",required:!0,defaultValue:()=>new Date,fieldName:E.verification?.fields?.createdAt||"createdAt"},updatedAt:{type:"date",required:!0,defaultValue:()=>new Date,onUpdate:()=>new Date,fieldName:E.verification?.fields?.updatedAt||"updatedAt"},...l?.fields,...E.verification?.additionalFields},order:4}},L={session:{modelName:E.session?.modelName||"session",fields:{expiresAt:{type:"date",required:!0,fieldName:E.session?.fields?.expiresAt||"expiresAt"},token:{type:"string",required:!0,fieldName:E.session?.fields?.token||"token",unique:!0},createdAt:{type:"date",required:!0,fieldName:E.session?.fields?.createdAt||"createdAt",defaultValue:()=>new Date},updatedAt:{type:"date",required:!0,fieldName:E.session?.fields?.updatedAt||"updatedAt",onUpdate:()=>new Date},ipAddress:{type:"string",required:!1,fieldName:E.session?.fields?.ipAddress||"ipAddress"},userAgent:{type:"string",required:!1,fieldName:E.session?.fields?.userAgent||"userAgent"},userId:{type:"string",fieldName:E.session?.fields?.userId||"userId",references:{model:E.user?.modelName||"user",field:"id",onDelete:"cascade"},required:!0,index:!0},...R?.fields,...E.session?.additionalFields},order:2}};return{user:{modelName:E.user?.modelName||"user",fields:{name:{type:"string",required:!0,fieldName:E.user?.fields?.name||"name",sortable:!0},email:{type:"string",unique:!0,required:!0,fieldName:E.user?.fields?.email||"email",sortable:!0},emailVerified:{type:"boolean",defaultValue:!1,required:!0,fieldName:E.user?.fields?.emailVerified||"emailVerified",input:!1},image:{type:"string",required:!1,fieldName:E.user?.fields?.image||"image"},createdAt:{type:"date",defaultValue:()=>new Date,required:!0,fieldName:E.user?.fields?.createdAt||"createdAt"},updatedAt:{type:"date",defaultValue:()=>new Date,onUpdate:()=>new Date,required:!0,fieldName:E.user?.fields?.updatedAt||"updatedAt"},...S?.fields,...E.user?.additionalFields},order:1},...!E.secondaryStorage||E.session?.storeSessionInDatabase?L:{},account:{modelName:E.account?.modelName||"account",fields:{accountId:{type:"string",required:!0,fieldName:E.account?.fields?.accountId||"accountId"},providerId:{type:"string",required:!0,fieldName:E.account?.fields?.providerId||"providerId"},userId:{type:"string",references:{model:E.user?.modelName||"user",field:"id",onDelete:"cascade"},required:!0,fieldName:E.account?.fields?.userId||"userId",index:!0},accessToken:{type:"string",required:!1,returned:!1,fieldName:E.account?.fields?.accessToken||"accessToken"},refreshToken:{type:"string",required:!1,returned:!1,fieldName:E.account?.fields?.refreshToken||"refreshToken"},idToken:{type:"string",required:!1,returned:!1,fieldName:E.account?.fields?.idToken||"idToken"},accessTokenExpiresAt:{type:"date",required:!1,returned:!1,fieldName:E.account?.fields?.accessTokenExpiresAt||"accessTokenExpiresAt"},refreshTokenExpiresAt:{type:"date",required:!1,returned:!1,fieldName:E.account?.fields?.refreshTokenExpiresAt||"refreshTokenExpiresAt"},scope:{type:"string",required:!1,fieldName:E.account?.fields?.scope||"scope"},password:{type:"string",required:!1,returned:!1,fieldName:E.account?.fields?.password||"password"},createdAt:{type:"date",required:!0,fieldName:E.account?.fields?.createdAt||"createdAt",defaultValue:()=>new Date},updatedAt:{type:"date",required:!0,fieldName:E.account?.fields?.updatedAt||"updatedAt",onUpdate:()=>new Date},...s?.fields,...E.account?.additionalFields},order:3},...!E.secondaryStorage||E.verification?.storeInDatabase?g:{},...D,...T?_:{}}};var us=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;function PE(E){if(typeof E==="string"&&us.test(E)){let e=new Date(E);if(!isNaN(e.getTime()))return e}return E}function aE(E){if(E===null||E===void 0)return E;if(typeof E==="string")return PE(E);if(E instanceof Date)return E;if(Array.isArray(E))return E.map(aE);if(typeof E==="object"){let e={};for(let T of Object.keys(E))e[T]=aE(E[T]);return e}return E}function dr(E){try{if(typeof E!=="string"){if(E===null||E===void 0)return null;return aE(E)}return JSON.parse(E,(e,T)=>PE(T))}catch(e){return Ce.error("Error parsing JSON",{error:e}),null}}var w=({usePlural:E,schema:e})=>(_)=>{if(E&&_.charAt(_.length-1)==="s"){let R=_.slice(0,-1),s=e[R]?R:void 0;if(!s)s=Object.entries(e).find(([l,D])=>D.modelName===R)?.[0];if(s)return s}let S=e[_]?_:void 0;if(!S)S=Object.entries(e).find(([R,s])=>s.modelName===_)?.[0];if(!S)throw new ae(`Model "${_}" not found in schema`);return S};var SE=({schema:E,usePlural:e})=>{let T=w({schema:E,usePlural:e});return({field:S,model:R})=>{if(S==="id"||S==="_id")return"id";let s=T(R),l=E[s]?.fields[S];if(!l){let D=Object.entries(E[s].fields).find(([g,L])=>L.fieldName===S);if(D)l=D[1],S=D[0]}if(!l)throw new ae(`Field ${S} not found in model ${s}`);return S}};function LE(E){switch(E){case"a-z":return"abcdefghijklmnopqrstuvwxyz";case"A-Z":return"ABCDEFGHIJKLMNOPQRSTUVWXYZ";case"0-9":return"0123456789";case"-_":return"-_";default:throw Error(`Unsupported alphabet: ${E}`)}}function tl(...E){let e=E.map(LE).join("");if(e.length===0)throw Error("No valid characters provided for random string generation.");let T=e.length;return(_,...S)=>{if(_<=0)throw Error("Length must be a positive integer.");let R=e,s=T;if(S.length>0)R=S.map(LE).join(""),s=R.length;let l=Math.floor(256/s)*s,D=new Uint8Array(_*2),g=D.length,L="",m=g,h;while(L.length<_){if(m>=g)crypto.getRandomValues(D),m=0;if(h=D[m++],h<l)L+=R[h%s]}return L}}var Ho=(E)=>tl("a-z","A-Z","0-9")(E||32);var RE=({usePlural:E,schema:e,disableIdGeneration:T,options:_,customIdGenerator:S,supportsUUIDs:R})=>{let s=w({usePlural:E,schema:e});return({customModelName:D,forceAllowId:g})=>{let L=_.advanced?.database?.generateId==="serial",m=_.advanced?.database?.generateId==="uuid",h=(()=>{if(T)return!1;else if(L&&!g)return!1;else if(m)return!R;else return!0})(),k=s(D??"id");return{type:L?"number":"string",required:h?!0:!1,...h?{defaultValue(){if(T)return;let d=_.advanced?.database?.generateId;if(d===!1||d==="serial")return;if(typeof d==="function")return d({model:k});if(d==="uuid")return crypto.randomUUID();if(S)return S({model:k});return Ho()}}:{},transform:{input:(d)=>{if(!d)return;if(L){let F=Number(d);if(isNaN(F))return;return F}if(m){if(h&&!g)return d;if(T)return;if(g&&typeof d==="string")if(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(d))return d;else{let F=Error().stack?.split(`
|
|
5
|
+
`).filter((X,AE)=>AE!==1).join(`
|
|
6
|
+
`).replace("Error:","");Ce.warn("[Adapter Factory] - Invalid UUID value for field `id` provided when `forceAllowId` is true. Generating a new UUID.",F)}if(R)return;if(typeof d!=="string"&&!R)return crypto.randomUUID();return}return d},output:(d)=>{if(!d)return;return String(d)}}}}};var dE=({usePlural:E,schema:e,options:T,customIdGenerator:_,disableIdGeneration:S})=>{let R=w({usePlural:E,schema:e}),s=SE({usePlural:E,schema:e}),l=RE({usePlural:E,schema:e,options:T,customIdGenerator:_,disableIdGeneration:S});return({model:g,field:L})=>{let m=R(g),h=s({field:L,model:m}),k=e[m].fields;k.id=l({customModelName:m});let d=k[h];if(!d)throw new ae(`Field ${L} not found in model ${g}`);return d}};var Iu=({schema:E,usePlural:e})=>{let T=w({schema:E,usePlural:e}),_=SE({schema:E,usePlural:e});function S({model:R,field:s}){let l=T(R),D=_({model:l,field:s});return E[l]?.fields[D]?.fieldName||D}return S};var Tu=({usePlural:E,schema:e})=>{let T=w({schema:e,usePlural:E});return(S)=>{let R=T(S);if(e&&e[R]&&e[R].modelName!==S)return E?`${e[R].modelName}s`:e[R].modelName;return E?`${S}s`:S}};function UE(E,e,T){if(T==="update"){if(E===void 0&&e.onUpdate!==void 0){if(typeof e.onUpdate==="function")return e.onUpdate();return e.onUpdate}return E}if(T==="create"){if(E===void 0||e.required===!0&&E===null){if(e.defaultValue!==void 0){if(typeof e.defaultValue==="function")return e.defaultValue();return e.defaultValue}}}return E}var Ne=z(os(),1),rl="better_auth.operation_id",Lr="better_auth.hook.type",Zr="better_auth.context";function Oi(){let E={end(){},setAttribute(e,T){},setStatus(e){},recordException(e){},updateName(e){return E}};return E}function Mi(E){function e(T,..._){let S=_[_.length-1];return S(E)}return{startActiveSpan:e}}function ai(){let E=Mi(Oi());return{getTracer(e,T){return E},getActiveSpan(){}}}function ii(){return{SpanStatusCode:{UNSET:0,OK:1,ERROR:2},trace:ai()}}var ns=ii();var Rs,Ns;function cE(){if(!Rs)Rs=import("./chunk-xz6713tj.js").then((m)=>z(m.default,1)).then((E)=>{Ns=E}).catch(()=>{return});return Ns??ns}var ci="better-auth",Ci="1.6.11";function Di(E){if(E!=null&&typeof E==="object"&&"name"in E&&E.name==="APIError"&&"statusCode"in E){let e=E.statusCode;return e>=300&&e<400}return!1}function Os(E,e){let{SpanStatusCode:T}=cE();if(Di(e))E.setAttribute(Ne.ATTR_HTTP_RESPONSE_STATUS_CODE,e.statusCode),E.setStatus({code:T.OK});else E.recordException(e),E.setStatus({code:T.ERROR,message:String(e?.message??e)});E.end()}function Dt(E,e,T){let{trace:_}=cE();return _.getTracer(ci,Ci).startActiveSpan(E,{attributes:e},(S)=>{try{let R=T();if(R instanceof Promise)return R.then((s)=>(S.end(),s)).catch((s)=>{throw Os(S,s),s});return S.end(),R}catch(R){throw Os(S,R),R}})}var NE=[],H=-1,Pi=(E)=>(e)=>e(E),xs=({adapter:E,config:e})=>(T)=>{let _=Math.random().toString(36).substring(2,15),S={...e,supportsBooleans:e.supportsBooleans??!0,supportsDates:e.supportsDates??!0,supportsJSON:e.supportsJSON??!1,adapterName:e.adapterName??e.adapterId,supportsNumericIds:e.supportsNumericIds??!0,supportsUUIDs:e.supportsUUIDs??!1,supportsArrays:e.supportsArrays??!1,transaction:e.transaction??!1,disableTransformInput:e.disableTransformInput??!1,disableTransformOutput:e.disableTransformOutput??!1,disableTransformJoin:e.disableTransformJoin??!1};if(T.advanced?.database?.generateId==="serial"&&S.supportsNumericIds===!1)throw new ae(`[${S.adapterName}] Your database or database adapter does not support numeric ids. Please disable "useNumberId" in your config.`);let R=Qn(T),s=(...t)=>{if(S.debugLogs===!0||typeof S.debugLogs==="object"){let N=Ua({level:"info"});if(typeof S.debugLogs==="object"&&"isRunningAdapterTests"in S.debugLogs){if(S.debugLogs.isRunningAdapterTests)t.shift(),NE.push({instance:_,args:t});return}if(typeof S.debugLogs==="object"&&S.debugLogs.logCondition&&!S.debugLogs.logCondition?.())return;if(typeof t[0]==="object"&&"method"in t[0]){let o=t.shift().method;if(typeof S.debugLogs==="object"){if(o==="create"&&!S.debugLogs.create)return;else if(o==="update"&&!S.debugLogs.update)return;else if(o==="updateMany"&&!S.debugLogs.updateMany)return;else if(o==="findOne"&&!S.debugLogs.findOne)return;else if(o==="findMany"&&!S.debugLogs.findMany)return;else if(o==="delete"&&!S.debugLogs.delete)return;else if(o==="deleteMany"&&!S.debugLogs.deleteMany)return;else if(o==="consumeOne"&&!S.debugLogs.consumeOne)return;else if(o==="count"&&!S.debugLogs.count)return}N.info(`[${S.adapterName}]`,...t)}else N.info(`[${S.adapterName}]`,...t)}},l=Ua(T.logger),D=w({usePlural:S.usePlural,schema:R}),g=SE({usePlural:S.usePlural,schema:R}),L=Tu({usePlural:S.usePlural,schema:R}),m=Iu({schema:R,usePlural:S.usePlural}),h=RE({schema:R,options:T,usePlural:S.usePlural,disableIdGeneration:S.disableIdGeneration,customIdGenerator:S.customIdGenerator,supportsUUIDs:S.supportsUUIDs}),k=dE({schema:R,options:T,usePlural:S.usePlural,disableIdGeneration:S.disableIdGeneration,customIdGenerator:S.customIdGenerator}),d=async(t,N,o,A)=>{let r={},O=R[N].fields,C=S.mapKeysTransformInput??{},M=T.advanced?.database?.generateId==="serial";O.id=h({customModelName:N,forceAllowId:A&&"id"in t});for(let c in O){let i=t[c],n=O[c],P=C[c]||O[c].fieldName||c;if(i===void 0&&(n.defaultValue===void 0&&!n.transform?.input&&!(o==="update"&&n.onUpdate)||o==="update"&&!n.onUpdate))continue;if(n&&n.type==="date"&&!(i instanceof Date)&&typeof i==="string")try{i=new Date(i)}catch{l.error("[Adapter Factory] Failed to convert string to date",{value:i,field:c})}let a=UE(i,n,o);if(n.transform?.input)a=await n.transform.input(a);if(n.references?.field==="id"&&M)if(Array.isArray(a))a=a.map((Y)=>Y!==null?Number(Y):null);else a=a!==null?Number(a):null;else if(S.supportsJSON===!1&&typeof a==="object"&&n.type==="json")a=JSON.stringify(a);else if(S.supportsArrays===!1&&Array.isArray(a)&&(n.type==="string[]"||n.type==="number[]"))a=JSON.stringify(a);else if(S.supportsDates===!1&&a instanceof Date&&n.type==="date")a=a.toISOString();else if(S.supportsBooleans===!1&&typeof a==="boolean")a=a?1:0;if(S.customTransformInput)a=S.customTransformInput({data:a,action:o,field:P,fieldAttributes:n,model:L(N),schema:R,options:T});if(a!==void 0)r[P]=a}return r},F=async(t,N,o=[],A)=>{let r=async(M,c,i=[])=>{if(!M)return null;let n=S.mapKeysTransformOutput??{},P={},a=R[D(c)].fields,Y=Object.entries(n).find(([V,f])=>f==="id")?.[0];a[Y??"id"]={type:T.advanced?.database?.generateId==="serial"?"number":"string"};for(let V in a){if(i.length&&!i.includes(V))continue;let f=a[V];if(f){let b=f.fieldName||V,U=M[Object.entries(n).find(([Li,as])=>as===b)?.[0]||b];if(f.transform?.output)U=await f.transform.output(U);let J=n[V]||V;if(b==="id"||f.references?.field==="id"){if(typeof U<"u"&&U!==null)U=String(U)}else if(S.supportsJSON===!1&&typeof U==="string"&&f.type==="json")U=dr(U);else if(S.supportsArrays===!1&&typeof U==="string"&&(f.type==="string[]"||f.type==="number[]"))U=dr(U);else if(S.supportsDates===!1&&typeof U==="string"&&f.type==="date")U=new Date(U);else if(S.supportsBooleans===!1&&typeof U==="number"&&f.type==="boolean")U=U===1;if(S.customTransformOutput)U=S.customTransformOutput({data:U,field:J,fieldAttributes:f,select:i,model:L(c),schema:R,options:T});P[J]=U}}return P};if(!A||Object.keys(A).length===0)return await r(t,N,o);N=D(N);let O=await r(t,N,o),C=Object.entries(A).map(([M,c])=>({modelName:L(M),defaultModelName:D(M),joinConfig:c}));if(!t)return null;for(let{modelName:M,defaultModelName:c,joinConfig:i}of C){let n=await(async()=>{if(T.experimental?.joins)return t[M];else return await Ms({baseModel:N,baseData:O,joinModel:M,specificJoinConfig:i})})();if(n===void 0||n===null)n=i.relation==="one-to-one"?null:[];if(i.relation==="one-to-many"&&!Array.isArray(n))n=[n];let P=[];if(Array.isArray(n))for(let a of n){let Y=await r(a,M,[]);P.push(Y)}else{let a=await r(n,M,[]);P.push(a)}O[c]=(i.relation==="one-to-one"?P[0]:P)??null}return O},X=({model:t,where:N,action:o})=>{if(!N)return;let A=S.mapKeysTransformInput??{};return N.map((r)=>{let{field:O,value:C,operator:M="eq",connector:c="AND",mode:i="sensitive"}=r;if(M==="in"){if(!Array.isArray(C))throw new ae("Value must be an array")}let n=C,P=D(t),a=g({field:O,model:t}),Y=A[a]||m({field:a,model:P}),V=k({field:a,model:P}),f=T.advanced?.database?.generateId==="serial";if(a==="id"||V.references?.field==="id"){if(f)if(Array.isArray(C))n=C.map(Number);else n=Number(C)}if(V.type==="date"&&C instanceof Date&&!S.supportsDates)n=C.toISOString();if(V.type==="boolean"&&typeof n==="string")n=n==="true";if(V.type==="number"){if(typeof n==="string"&&n.trim()!==""){let b=Number(n);if(!Number.isNaN(b))n=b}else if(Array.isArray(n)){let b=n.map((U)=>typeof U==="string"&&U.trim()!==""?Number(U):NaN);if(b.every((U)=>!Number.isNaN(U)))n=b}}if(V.type==="boolean"&&typeof n==="boolean"&&!S.supportsBooleans)n=n?1:0;if(V.type==="json"&&typeof C==="object"&&!S.supportsJSON)try{n=JSON.stringify(C)}catch(b){throw Error(`Failed to stringify JSON value for field ${Y}`,{cause:b})}if(S.customTransformInput)n=S.customTransformInput({data:n,fieldAttributes:V,field:Y,model:L(t),schema:R,options:T,action:o});return{operator:M,connector:c,field:Y,value:n,mode:i}})},AE=(t,N,o)=>{if(!N)return;if(Object.keys(N).length===0)return;let A={};for(let[r,O]of Object.entries(N)){if(!O)continue;let C=D(r),M=D(t),c=Object.entries(R[C].fields).filter(([U,J])=>J.references&&D(J.references.model)===M),i=!0;if(!c.length)c=Object.entries(R[M].fields).filter(([U,J])=>J.references&&D(J.references.model)===C),i=!1;if(!c.length)throw new ae(`No foreign key found for model ${r} and base model ${t} while performing join operation.`);else if(c.length>1)throw new ae(`Multiple foreign keys found for model ${r} and base model ${t} while performing join operation. Only one foreign key is supported.`);let[n,P]=c[0];if(!P.references)throw new ae(`No references found for foreign key ${n} on model ${r} while performing join operation.`);let a,Y,V;if(i)V=P.references.field,a=m({model:t,field:V}),Y=m({model:r,field:n});else V=n,a=m({model:t,field:V}),Y=m({model:r,field:P.references.field});if(o&&!o.includes(V))o.push(V);let f=Y==="id"?!0:P.unique??!1,b=T.advanced?.database?.defaultFindManyLimit??100;if(f)b=1;else if(typeof O==="object"&&typeof O.limit==="number")b=O.limit;A[L(r)]={on:{from:a,to:Y},limit:b,relation:f?"one-to-one":"one-to-many"}}return{join:A,select:o}},Ms=async({baseModel:t,baseData:N,joinModel:o,specificJoinConfig:A})=>{if(!N)return N;let r=L(o),O=A.on.to,C=N[g({field:A.on.from,model:t})];if(C===null||C===void 0)return A.relation==="one-to-one"?null:[];let M,c=X({model:r,where:[{field:O,value:C,operator:"eq",connector:"AND"}],action:"findOne"});try{if(A.relation==="one-to-one")M=await Dt(`db findOne ${r}`,{[Ne.ATTR_DB_OPERATION_NAME]:"findOne",[Ne.ATTR_DB_COLLECTION_NAME]:r},()=>y.findOne({model:r,where:c}));else{let i=A.limit??T.advanced?.database?.defaultFindManyLimit??100;M=await Dt(`db findMany ${r}`,{[Ne.ATTR_DB_OPERATION_NAME]:"findMany",[Ne.ATTR_DB_COLLECTION_NAME]:r},()=>y.findMany({model:r,where:c,limit:i}))}}catch(i){throw l.error(`Failed to query fallback join for model ${r}:`,{where:c,limit:A.limit}),console.error(i),i}return M},y=E({options:T,schema:R,debugLog:s,getFieldName:m,getModelName:L,getDefaultModelName:D,getDefaultFieldName:g,getFieldAttributes:k,transformInput:d,transformOutput:F,transformWhereClause:X}),rE=null,OE={transaction:async(t)=>{if(!rE)if(!S.transaction)rE=Pi(OE);else l.debug(`[${S.adapterName}] - Using provided transaction implementation.`),rE=S.transaction;return rE(t)},create:async({data:t,model:N,select:o,forceAllowId:A=!1})=>{H++;let r=H,O=L(N);if(N=D(N),"id"in t&&typeof t.id<"u"&&!A){l.warn(`[${S.adapterName}] - You are trying to create a record with an id. This is not allowed as we handle id generation for you, unless you pass in the \`forceAllowId\` parameter. The id will be ignored.`);let i=Error().stack?.split(`
|
|
7
|
+
`).filter((n,P)=>P!==1).join(`
|
|
8
|
+
`).replace("Error:","Create method with `id` being called at:");console.log(i),t.id=void 0}s({method:"create"},`${I(r)} ${u(1,4)}`,`${p("create")} ${B("Unsafe Input")}:`,{model:O,data:t});let C=t;if(!S.disableTransformInput)C=await d(t,N,"create",A);s({method:"create"},`${I(r)} ${u(2,4)}`,`${p("create")} ${B("Parsed Input")}:`,{model:O,data:C});let M=await Dt(`db create ${O}`,{[Ne.ATTR_DB_OPERATION_NAME]:"create",[Ne.ATTR_DB_COLLECTION_NAME]:O},()=>y.create({data:C,model:O}));s({method:"create"},`${I(r)} ${u(3,4)}`,`${p("create")} ${B("DB Result")}:`,{model:O,res:M});let c=M;if(!S.disableTransformOutput)c=await F(M,N,o,void 0);return s({method:"create"},`${I(r)} ${u(4,4)}`,`${p("create")} ${B("Parsed Result")}:`,{model:O,data:c}),c},update:async({model:t,where:N,update:o})=>{H++;let A=H;t=D(t);let r=L(t),O=X({model:t,where:N,action:"update"});s({method:"update"},`${I(A)} ${u(1,4)}`,`${p("update")} ${B("Unsafe Input")}:`,{model:r,data:o});let C=o;if(!S.disableTransformInput)C=await d(o,t,"update");s({method:"update"},`${I(A)} ${u(2,4)}`,`${p("update")} ${B("Parsed Input")}:`,{model:r,data:C});let M=await Dt(`db update ${r}`,{[Ne.ATTR_DB_OPERATION_NAME]:"update",[Ne.ATTR_DB_COLLECTION_NAME]:r},()=>y.update({model:r,where:O,update:C}));s({method:"update"},`${I(A)} ${u(3,4)}`,`${p("update")} ${B("DB Result")}:`,{model:r,data:M});let c=M;if(!S.disableTransformOutput)c=await F(M,t,void 0,void 0);return s({method:"update"},`${I(A)} ${u(4,4)}`,`${p("update")} ${B("Parsed Result")}:`,{model:r,data:c}),c},updateMany:async({model:t,where:N,update:o})=>{H++;let A=H,r=L(t),O=X({model:t,where:N,action:"updateMany"});t=D(t),s({method:"updateMany"},`${I(A)} ${u(1,4)}`,`${p("updateMany")} ${B("Unsafe Input")}:`,{model:r,data:o});let C=o;if(!S.disableTransformInput)C=await d(o,t,"update");s({method:"updateMany"},`${I(A)} ${u(2,4)}`,`${p("updateMany")} ${B("Parsed Input")}:`,{model:r,data:C});let M=await Dt(`db updateMany ${r}`,{[Ne.ATTR_DB_OPERATION_NAME]:"updateMany",[Ne.ATTR_DB_COLLECTION_NAME]:r},()=>y.updateMany({model:r,where:O,update:C}));return s({method:"updateMany"},`${I(A)} ${u(3,4)}`,`${p("updateMany")} ${B("DB Result")}:`,{model:r,data:M}),s({method:"updateMany"},`${I(A)} ${u(4,4)}`,`${p("updateMany")} ${B("Parsed Result")}:`,{model:r,data:M}),M},findOne:async({model:t,where:N,select:o,join:A})=>{H++;let r=H,O=L(t),C=X({model:t,where:N,action:"findOne"});t=D(t);let M,c=!0;if(!S.disableTransformJoin){let P=AE(t,A,o);if(P)M=P.join,o=P.select;if(!T.experimental?.joins&&M&&Object.keys(M).length>0)c=!1}else M=A;s({method:"findOne"},`${I(r)} ${u(1,3)}`,`${p("findOne")}:`,{model:O,where:C,select:o,join:M});let i=await Dt(`db findOne ${O}`,{[Ne.ATTR_DB_OPERATION_NAME]:"findOne",[Ne.ATTR_DB_COLLECTION_NAME]:O},()=>y.findOne({model:O,where:C,select:o,join:c?M:void 0}));s({method:"findOne"},`${I(r)} ${u(2,3)}`,`${p("findOne")} ${B("DB Result")}:`,{model:O,data:i});let n=i;if(!S.disableTransformOutput)n=await F(i,t,o,M);return s({method:"findOne"},`${I(r)} ${u(3,3)}`,`${p("findOne")} ${B("Parsed Result")}:`,{model:O,data:n}),n},findMany:async({model:t,where:N,limit:o,select:A,sortBy:r,offset:O,join:C})=>{H++;let M=H,c=o??T.advanced?.database?.defaultFindManyLimit??100,i=L(t),n=X({model:t,where:N,action:"findMany"});t=D(t);let P,a=!0;if(!S.disableTransformJoin){let f=AE(t,C,A);if(f)P=f.join,A=f.select;if(!T.experimental?.joins&&P&&Object.keys(P).length>0)a=!1}else P=C;s({method:"findMany"},`${I(M)} ${u(1,3)}`,`${p("findMany")}:`,{model:i,where:n,limit:c,sortBy:r,offset:O,join:P});let Y=await Dt(`db findMany ${i}`,{[Ne.ATTR_DB_OPERATION_NAME]:"findMany",[Ne.ATTR_DB_COLLECTION_NAME]:i},()=>y.findMany({model:i,where:n,limit:c,select:A,sortBy:r,offset:O,join:a?P:void 0}));s({method:"findMany"},`${I(M)} ${u(2,3)}`,`${p("findMany")} ${B("DB Result")}:`,{model:i,data:Y});let V=Y;if(!S.disableTransformOutput)V=await Promise.all(Y.map(async(f)=>await F(f,t,void 0,P)));return s({method:"findMany"},`${I(M)} ${u(3,3)}`,`${p("findMany")} ${B("Parsed Result")}:`,{model:i,data:V}),V},delete:async({model:t,where:N})=>{H++;let o=H,A=L(t),r=X({model:t,where:N,action:"delete"});t=D(t),s({method:"delete"},`${I(o)} ${u(1,2)}`,`${p("delete")}:`,{model:A,where:r}),await Dt(`db delete ${A}`,{[Ne.ATTR_DB_OPERATION_NAME]:"delete",[Ne.ATTR_DB_COLLECTION_NAME]:A},()=>y.delete({model:A,where:r})),s({method:"delete"},`${I(o)} ${u(2,2)}`,`${p("delete")} ${B("DB Result")}:`,{model:A})},deleteMany:async({model:t,where:N})=>{H++;let o=H,A=L(t),r=X({model:t,where:N,action:"deleteMany"});t=D(t),s({method:"deleteMany"},`${I(o)} ${u(1,2)}`,`${p("deleteMany")} ${B("DeleteMany")}:`,{model:A,where:r});let O=await Dt(`db deleteMany ${A}`,{[Ne.ATTR_DB_OPERATION_NAME]:"deleteMany",[Ne.ATTR_DB_COLLECTION_NAME]:A},()=>y.deleteMany({model:A,where:r}));return s({method:"deleteMany"},`${I(o)} ${u(2,2)}`,`${p("deleteMany")} ${B("DB Result")}:`,{model:A,data:O}),O},consumeOne:async({model:t,where:N})=>{H++;let o=H,A=L(t),r=X({model:t,where:N,action:"consumeOne"});t=D(t),s({method:"consumeOne"},`${I(o)} ${u(1,3)}`,`${p("consumeOne")} ${B("ConsumeOne")}:`,{model:A,where:r});let O,C=!0;if(y.consumeOne)O=await Dt(`db consumeOne ${A}`,{[Ne.ATTR_DB_OPERATION_NAME]:"consumeOne",[Ne.ATTR_DB_COLLECTION_NAME]:A},()=>y.consumeOne({model:A,where:r}));else O=await Dt(`db consumeOne ${A}`,{[Ne.ATTR_DB_OPERATION_NAME]:"consumeOne",[Ne.ATTR_DB_COLLECTION_NAME]:A},()=>OE.transaction(async(c)=>{let i=(await c.findMany({model:t,where:N,limit:1}))[0];if(!i)return null;return await c.deleteMany({model:t,where:[...N,{field:"id",value:i.id,operator:"eq",connector:"AND",mode:"sensitive"}]})>0?i:null})),C=!1;s({method:"consumeOne"},`${I(o)} ${u(2,3)}`,`${p("consumeOne")} ${B("DB Result")}:`,{model:A,data:O});let M=O;if(!S.disableTransformOutput&&C&&O)M=await F(O,t,void 0,void 0);return s({method:"consumeOne"},`${I(o)} ${u(3,3)}`,`${p("consumeOne")} ${B("Parsed Result")}:`,{model:A,data:M}),M},count:async({model:t,where:N})=>{H++;let o=H,A=L(t),r=X({model:t,where:N,action:"count"});t=D(t),s({method:"count"},`${I(o)} ${u(1,2)}`,`${p("count")}:`,{model:A,where:r});let O=await Dt(`db count ${A}`,{[Ne.ATTR_DB_OPERATION_NAME]:"count",[Ne.ATTR_DB_COLLECTION_NAME]:A},()=>y.count({model:A,where:r}));return s({method:"count"},`${I(o)} ${u(2,2)}`,`${p("count")}:`,{model:A,data:O}),O},createSchema:y.createSchema?async(t,N)=>{let o=Qn(T);if(T.secondaryStorage&&!T.session?.storeSessionInDatabase)delete o.session;return y.createSchema({file:N,tables:o})}:void 0,options:{adapterConfig:S,...y.options??{}},id:S.adapterId,...S.debugLogs?.isRunningAdapterTests?{adapterTestDebugLogs:{resetDebugLogs(){NE=NE.filter((t)=>t.instance!==_)},printDebugLogs(){let t="\u2500".repeat(80),N=NE.filter((A)=>A.instance===_);if(N.length===0)return;let o=N.reverse().map((A)=>(A.args[0]=`
|
|
9
|
+
${A.args[0]}`,[...A.args,`
|
|
10
|
+
`])).reduce((A,r)=>[...r,...A],[`
|
|
11
|
+
${t}`]);console.log(...o)}}}:{}};return OE};function I(E){if(nE()<8)return`#${E}`;return`${G.fg.magenta}#${E}${G.reset}`}function u(E,e){return`${G.bg.black}${G.fg.yellow}[${E}/${e}]${G.reset}`}function p(E){return`${G.bright}${E}${G.reset}`}function B(E){return`${G.dim}(${E})${G.reset}`}
|
|
12
|
+
export{Qn,zt,_i,el,Ba,Wt,cf,im,gc,Ua,Ce,Ac,Eu,ta,po,ae,j,tl,Ho,Iu,Tu,dr,Ne,rl,Lr,Zr,Dt,xs};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{kt}from"./chunk-5tcdwep5.js";import{He}from"./chunk-jgs8an3h.js";import{z}from"./chunk-fnmwksnb.js";var _=z(kt()),N=z(He()),yc="AWS_ACCESS_KEY_ID",_c="AWS_SECRET_ACCESS_KEY",S="AWS_SESSION_TOKEN",C="AWS_CREDENTIAL_EXPIRATION",A="AWS_CREDENTIAL_SCOPE",p="AWS_ACCOUNT_ID",Pu=(e)=>async()=>{e?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");let o=process.env[yc],E=process.env[_c],r=process.env[S],n=process.env[C],s=process.env[A],t=process.env[p];if(o&&E){let c={accessKeyId:o,secretAccessKey:E,...r&&{sessionToken:r},...n&&{expiration:new Date(n)},...s&&{credentialScope:s},...t&&{accountId:t}};return _.setCredentialFeature(c,"CREDENTIALS_ENV_VARS","g"),c}throw new N.CredentialsProviderError("Unable to find environment variable credentials.",{logger:e?.logger})};export{yc,_c,Pu};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h,C,t,Z,Fe,A,it,_t,Gp}from"./chunk-7rhz2gze.js";import"./chunk-7kjgvxqa.js";import"./chunk-tm7f32c7.js";import"./chunk-gc5sbfa5.js";import"./chunk-77fmkpdz.js";import"./chunk-1j27fzy1.js";import"./chunk-7pw1550a.js";import"./chunk-rssgmj7x.js";import"./chunk-8e28hcny.js";import"./chunk-914bp49r.js";import"./chunk-snhsjs4x.js";import"./chunk-0qaq0sp8.js";import{qn}from"./chunk-dj92fss9.js";import{er}from"./chunk-5vzrpz50.js";import"./chunk-98715kc3.js";import"./chunk-m9pr03kn.js";import"./chunk-5adsx8x4.js";import"./chunk-j2bvj2yn.js";import"./chunk-cbgq517y.js";import"./chunk-gk2q9a3f.js";import"./chunk-9t8n2des.js";import"./chunk-ytdwk2fq.js";import"./chunk-0zv3bks2.js";C();function l(){let{projectId:o,folderId:n}=c.useParams(),{teamId:r,ensureTeamIdForProject:a}=it();h(()=>{a(o)},[o,a]);let{data:s}=er(Gp(o)),e=s?.rootFolder,{data:i}=Z({queryKey:["folders",e],queryFn:()=>(async()=>await(await A.api.folders[":folderId"].$get({param:{folderId:e}})).json())(),enabled:!!e});if(!r||!e||!i)return t(_t,{});return t(qn,{teamId:r,projectId:o,projectName:s.name??"",assetId:n,rootFolderId:e})}var c=Fe("/projects/$projectId/folders/$folderId")({component:l});export{c as Route};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h,w,u,C,B,t,o,K,wi,Z,U,Re,Fe,A,T,cr,L,Me,fe,De,E,S,Ee,Ie,Te,ge,Ae,ye,W,uA,dA,My,ke,_0,L0,F0,_f,at,A_,y_,E_,ob,Eb,Ib,Dc,Bw,xx,gS,_S,xS,SS,CS,ES,IS,Yh,TS,hC,Ds,Bc,xl,SE,Sl,Uc,Fc,EE,zc,TE,eI,RI,NI,DI,LI,Np,Op,Je,Xe,et,tt,rt,nt,ot,st,pe,ue,me,$e,de,Tt,H,Pt,R,Vg,V,qe,Lo}from"./chunk-7rhz2gze.js";import{Fl}from"./chunk-rssgmj7x.js";import{Pl}from"./chunk-453ykvaw.js";import{ui}from"./chunk-qka4mkmj.js";import{so}from"./chunk-9t8n2des.js";import{rn}from"./chunk-ytdwk2fq.js";import"./chunk-0zv3bks2.js";var Le=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]],te=T("arrow-down-wide-narrow",Le);var Ke=[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]],se=T("sliders-vertical",Ke);C();function ie({open:a,onOpenChange:c,mode:d,teamId:v,project:l}){let f=K(),p=Re(),[n,b]=u(""),[k,N]=u(!0),[F,x]=u(void 0),[_,y]=u(void 0),[g,M]=u(!1),D=w(null);h(()=>{if(a)if(d==="edit"&&l)b(l.name||""),x(l.coverImageKey),y(l.coverImage),N(l.enableNotification!==!1);else b(""),x(void 0),y(void 0),N(!0)},[a,d,l]);let P=A.api.teams[":teamId"].projects.$post,{mutate:Y}=U({mutationFn:async(i)=>{let s=await P({param:{teamId:v},json:i});if(!s.ok)throw Error(ob());return await s.json()},onSuccess:(i)=>{f.invalidateQueries({queryKey:["teams",v,"projects"]}),c(!1);let s=i;if(s&&typeof s.id==="string")p({to:"/projects/$projectId",params:{projectId:s.id}})}}),q=A.api.projects[":projectId"].$put,{mutate:G}=U({mutationFn:async(i)=>{let s=await q({param:{projectId:l.id},json:i});if(!s.ok)throw Error(Eb());return await s.json()},onSuccess:()=>{f.invalidateQueries({queryKey:["teams",v,"projects"]}),c(!1)}}),J=A.api.teams[":teamId"].files.$post,{mutate:O}=U({mutationFn:async({file:i})=>{let s=await J({param:{teamId:v},form:{file:i}});if(!s.ok)throw Error(Dc());return await s.json()},onSuccess:(i)=>{let s=i;if(s&&typeof s.key==="string")x(s.key);M(!1)},onError:()=>{M(!1)}}),m=(i)=>{let s=i.target.files?.[0];if(s){M(!0);let ee=URL.createObjectURL(s);y(ee),O({file:s})}},j=()=>{D.current?.click()},z=(i)=>{i.stopPropagation(),x(void 0),y(void 0)},I=()=>{if(!n.trim())return;if(d==="create")Y({name:n.trim(),coverImageKey:F,enableNotification:k});else if(d==="edit"&&l?.id)G({name:n.trim(),coverImageKey:F,enableNotification:k})};return t(pe,{open:a,onOpenChange:c,children:o(ue,{className:"sm:max-w-[550px] overflow-hidden rounded-2xl border border-border/60 bg-background/95 backdrop-blur-md shadow-2xl p-0 gap-0",children:[o(me,{className:"relative overflow-hidden bg-gradient-to-br from-primary/5 to-transparent p-6 border-b border-border/40",children:[t("div",{className:"absolute top-0 right-0 w-24 h-24 bg-primary/10 rounded-full blur-2xl pointer-events-none"}),t("div",{className:"absolute bottom-0 left-10 w-32 h-12 bg-primary/5 rounded-full blur-xl pointer-events-none"}),t("div",{className:"flex items-center gap-3",children:o("div",{children:[t(de,{className:"text-xl font-semibold tracking-tight text-foreground",children:d==="create"?F0():Yh()}),t(Tt,{className:"text-xs text-muted-foreground/80 mt-1",children:d==="create"?_0():Bw()})]})})]}),o("div",{className:"space-y-6 p-6 max-h-[75vh] overflow-y-auto",children:[o("div",{className:"space-y-2",children:[t(V,{htmlFor:"name",className:"text-sm font-semibold tracking-tight text-foreground",children:xS()}),o("div",{className:"relative",children:[t(H,{id:"name",value:n,onChange:(i)=>b(i.target.value),placeholder:CS(),className:"h-11 px-4 rounded-xl border-border/80 focus-visible:ring-ring/25 focus-visible:border-primary transition-all shadow-xs pr-10"}),n.trim()&&t("div",{className:"absolute inset-y-0 right-3 flex items-center",children:t(Me,{className:"w-4 h-4 text-primary"})})]}),t("p",{className:"text-[11px] text-muted-foreground",children:SS()})]}),o("div",{className:"space-y-3 border-t border-border/40 pt-5",children:[o("div",{className:"flex items-center justify-between",children:[o(V,{className:"text-sm font-semibold tracking-tight text-foreground flex items-center gap-1.5",children:[t(rn,{className:"w-4 h-4 text-primary"}),_S()]}),_&&o("button",{type:"button",onClick:z,className:"text-xs text-muted-foreground hover:text-destructive hover:bg-destructive/5 px-2.5 py-1 rounded-lg transition-all flex items-center gap-1 font-medium",children:[t(De,{className:"w-3.5 h-3.5"}),hC()]})]}),o("div",{className:"relative aspect-square w-48 mx-auto rounded-2xl border border-dashed border-border flex items-center justify-center cursor-pointer overflow-hidden group shadow-inner bg-muted/20 transition-all duration-300 hover:border-primary/50 hover:bg-muted/40",onClick:j,children:[t("input",{type:"file",ref:D,className:"hidden",accept:"image/*",onChange:m}),g&&t("div",{className:"absolute inset-0 bg-background/70 backdrop-blur-xs flex flex-col items-center justify-center gap-2 z-20",children:o("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-background border rounded-full shadow-lg",children:[t(L,{className:"w-4 h-4 animate-spin text-primary"}),t("span",{className:"text-xs font-semibold text-foreground",children:Op()})]})}),_?o(B,{children:[t("img",{src:_,alt:L0(),className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"}),o("div",{className:"absolute inset-0 bg-black/45 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex flex-col items-center justify-center gap-1.5 text-white z-10",children:[t(so,{className:"w-5 h-5 transform translate-y-1 group-hover:translate-y-0 transition-transform duration-300"}),t("span",{className:"text-xs font-semibold",children:Np()})]})]}):o("div",{className:"flex flex-col items-center gap-2 text-center p-4",children:[t("div",{className:"p-2.5 rounded-full bg-background border shadow-xs group-hover:scale-110 transition-transform duration-300",children:t(so,{className:"w-4 h-4 text-muted-foreground"})}),o("div",{children:[t("p",{className:"text-xs font-medium text-foreground",children:DI()}),t("p",{className:"text-[11px] text-muted-foreground mt-0.5 max-w-[140px] mx-auto leading-normal",children:LI()})]})]})]})]}),o("div",{className:"space-y-3 border-t border-border/40 pt-5",children:[o(V,{className:"text-sm font-semibold tracking-tight text-foreground flex items-center gap-1.5",children:[t(se,{className:"w-4 h-4 text-primary"}),IS()]}),o("div",{className:"flex items-start justify-between rounded-xl border border-border/50 bg-muted/10 p-4 transition-all duration-300 hover:bg-muted/20",children:[o("div",{className:"space-y-1 pr-4",children:[o("div",{className:"text-sm font-semibold flex items-center gap-2 text-foreground",children:[t(ui,{className:"w-4 h-4 text-primary"}),uA()]}),t("p",{className:"text-xs text-muted-foreground leading-normal",children:dA()})]}),t(qe,{checked:k,onCheckedChange:N,disabled:g,className:"mt-0.5"})]})]})]}),o($e,{className:"flex items-center justify-end gap-3 px-6 py-4 bg-muted/20 border-t border-border/40",children:[t(S,{type:"button",variant:"ghost",onClick:()=>c(!1),disabled:g,className:"rounded-xl h-10 px-4 hover:bg-muted font-medium text-sm text-muted-foreground hover:text-foreground transition-colors",children:ke()}),t(S,{type:"submit",onClick:I,disabled:!n.trim()||g,className:"rounded-xl h-10 px-5 bg-primary text-primary-foreground hover:bg-primary/90 font-semibold text-sm shadow-lg shadow-primary/10 hover:shadow-primary/20 active:scale-98 transition-all flex items-center gap-2",children:g?o(B,{children:[t(L,{className:"w-4 h-4 animate-spin"}),gS()]}):d==="create"?_f():Ds()})]})]})})}function le({sortBy:a,sortDirection:c,onSortChange:d}){let v=(n)=>{d(n,c)},l=()=>{d(a,c==="asc"?"desc":"asc")},f=(n)=>{switch(n){case"name":return Sl();case"created_at":return SE();case"updated_at":return EE();default:return n}},p=c==="asc";return o(ge,{children:[t(Ae,{asChild:!0,children:o(S,{variant:"outline",className:"gap-2 bg-muted/50",children:[t("span",{className:"text-muted-foreground",children:TE()}),t("span",{className:"font-medium text-foreground",children:f(a)})]})}),o(ye,{align:"end",className:"w-56 p-2",children:[t("div",{className:"text-xs font-semibold text-muted-foreground mb-2 px-2",children:xl()}),o(ge,{children:[t(Ae,{asChild:!0,children:o(S,{variant:"ghost",className:"w-full justify-between font-normal px-2 h-10 bg-muted/50 hover:bg-muted mb-2 border",children:[t("span",{children:f(a)}),t(te,{className:"h-4 w-4 opacity-50"})]})}),t(ye,{className:"w-52",children:["name","created_at","updated_at"].map((n)=>o(W,{onClick:()=>v(n),className:"justify-between",children:[f(n),a===n&&t(Me,{className:"h-4 w-4"})]},n))})]}),o(S,{variant:"ghost",className:"w-full justify-between font-normal px-2 h-10 bg-muted/50 hover:bg-muted border",onClick:l,children:[t("span",{className:"text-muted-foreground",children:a==="name"?p?t(B,{children:Bc()}):t(B,{children:zc()}):p?t(B,{children:Fc()}):t(B,{children:Uc()})}),p?t(Pl,{className:"h-4 w-4 opacity-50"}):t(te,{className:"h-4 w-4 opacity-50"})]})]})]})}C();function Ue(){let{teamId:a}=Oe.useParams(),{canEdit:c,canAdmin:d}=Pt(),v=Re(),l=K(),[f,p]=u(null),[n,b]=u(!1),[k,N]=u("create"),[F,x]=u(void 0),[_,y]=u(!1),[g,M]=u(void 0),[D,P]=u(""),[Y,q]=u(!1),{metadata:G,setMetadata:J}=Lo(),O=`team:${a}:projects:sort`,m=G[O],[j,z]=u(()=>m?.sortBy||"name"),[I,i]=u(()=>m?.sortDirection||"asc");h(()=>{if(m?.sortBy&&m.sortBy!==j)z(m.sortBy);if(m?.sortDirection&&m.sortDirection!==I)i(m.sortDirection)},[m]);let s=A.api.teams[":teamId"].projects.$get,{data:ee}=Z({queryKey:["teams",a,"projects",j,I],queryFn:async()=>{let e=await s({param:{teamId:a},query:{sortBy:j,sortDirection:I}});if(!e.ok)throw Error("Failed to fetch projects");return await e.json()},placeholderData:wi}),{data:oe}=Z({queryKey:["teams",a,"members"],queryFn:async()=>{let e=await A.api.teams[":teamId"].members.$get({param:{teamId:a},query:{}});if(!e.ok)throw Error("Failed to fetch members");return await e.json()}}),{data:re}=Z({queryKey:["teams",a,"me"],queryFn:async()=>{let e=await A.api.teams[":teamId"].me.$get({param:{teamId:a}});if(!e.ok)throw Error("Failed to fetch me");return await e.json()}}),ce=A.api.teams[":teamId"].invite.$post,ve=U({mutationFn:async(e)=>{let r=await ce(e);if(!r.ok)throw Error("Failed to invite");return await r.json()}}),Q=U({mutationFn:async(e)=>{if(!(await A.api.projects[":projectId"].$delete({param:{projectId:e}})).ok)throw Error("Failed to delete project")},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"projects"]})}}),he=U({mutationFn:async(e)=>{let r=await A.api.projects[":projectId"].$put({param:{projectId:e.id},json:{enableNotification:!e.enableNotification}});if(!r.ok)throw Error("Failed to update project notification settings");return await r.json()},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"projects"]}),R.success(ES())},onError:(e)=>{R.error(e instanceof Error?e.message:Ib())}}),ae=()=>{N("create"),x(void 0),b(!0)},be=()=>{p("create"),setTimeout(()=>{p(null)},100),setTimeout(()=>{ae()},200)},we=(e)=>{N("edit"),x(e),b(!0)},xe=(e)=>{M(e),P(""),y(!0)},Ne=async()=>{if(g&&D==="delete")try{await Q.mutateAsync(g.id),y(!1)}catch(e){console.error(e)}},je=(e,r)=>{if(r.detail>1)return;p(e),setTimeout(()=>{p(null)},100),setTimeout(()=>{v({to:"/projects/$projectId",params:{projectId:e}})},200)},Ce=async(e)=>(await ve.mutateAsync({param:{teamId:a},json:{role:e}})).code,_e=U({mutationFn:async({userId:e,role:r})=>{if(!(await A.api.teams[":teamId"].members[":userId"].$patch({param:{teamId:a,userId:e},json:{role:r}})).ok)throw Error("Failed to update member role")},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"members"]})}}),Pe=U({mutationFn:async(e)=>{if(!(await A.api.teams[":teamId"].members[":userId"].$delete({param:{teamId:a,userId:e}})).ok)throw Error("Failed to remove member")},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"members"]})}}),Be=(e)=>{if(!e)return"??";return e.split(" ").map((r)=>r[0]).slice(0,2).join("").toUpperCase()},Se=(e,r)=>{z(e),i(r),J(a,O,{sortBy:e,sortDirection:r})},X=Array.isArray(oe)?oe:[];return o("div",{className:"flex-1 overflow-y-auto p-4",children:[o("div",{className:"flex flex-wrap items-center justify-between mb-4 gap-4",children:[t("h1",{className:"text-2xl font-bold",children:TS()}),o("div",{className:"flex flex-wrap items-center gap-4",children:[o("div",{className:"flex items-center -space-x-2 cursor-pointer hover:opacity-90",onClick:()=>q(!0),"data-testid":"team-members-trigger",children:[X.slice(0,3).map((e)=>o(Ee,{className:"border-2 border-background w-8 h-8",children:[e.image&&t(Ie,{src:e.image,alt:e.name,className:"object-cover"}),t(Te,{className:"text-[10px]",children:Be(e.name)})]},e.id)),X.length>3&&o("div",{className:"flex items-center justify-center w-8 h-8 rounded-full border-2 border-background bg-muted text-[10px] font-medium",children:["+",X.length-3]})]}),t(le,{sortBy:j,sortDirection:I,onSortChange:Se}),c&&o(S,{className:"bg-orange-600 hover:bg-orange-700 text-white gap-2",onClick:ae,children:[t(fe,{className:"w-4 h-4"}),_f()]})]})]}),o("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 gap-4",children:[ee?.data?.map((e)=>t("div",{className:E("shadow-md relative border rounded-xl overflow-hidden cursor-pointer transition-transform duration-100 ease-in-out",f===e.id?"scale-95":"scale-100"),onClick:(r)=>je(e.id,r),children:o("div",{className:"flex flex-col",children:[o("div",{className:"relative w-full h-full aspect-square flex items-center justify-center bg-zinc-400/20",children:[e.coverImage?t("img",{src:e.coverImage,alt:e.name,className:"w-full h-full object-cover rounded"}):o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 180.95 164.7",preserveAspectRatio:"xMidYMid slice",className:"w-full h-full object-cover rounded",children:[t("polygon",{fill:"#FC9F8E",points:"0 18.5 0 76.0 151.69 164.7 180.95 164.7 180.95 113.6"}),t("polygon",{fill:"#FEBAB8",points:"0 0 74.58 61.5 90.53 51.6 110.33 63.9 180.95 18.9 180.95 0"}),t("polyline",{fill:"#FAA5A5",points:"0 18.5 74.58 61.5 90.53 51.6 110.33 63.9 180.95 18.9 180.95 0 0 0"}),t("polygon",{fill:"#EC5B6C",points:"0 76.0 0 164.7 151.69 164.7"}),t("polygon",{fill:"#E85C71",points:"180.95 18.9 110.33 63.9 117.37 68.0 117.26 73.4 180.95 113.6"}),t("polygon",{fill:"#C8405B",points:"117.26 73.4 117.37 99.0 90.53 114.9 174.35 164.7 180.95 164.7 180.95 113.6"}),t("polygon",{fill:"#FFCCBE",points:"90.53 51.6 63.69 68.1 90.53 83.4"}),t("path",{fill:"#FB9991",d:"M 90.53 51.6 L 90.53 61.3 L 100.87 67.4 L 90.53 73.5 L 90.53 83.4 L 117.37 68.0 C 117.15 67.6 90.53 51.6 90.53 51.6 Z"}),t("path",{fill:"#FFEACD",d:"M 63.69 68.1 C 63.47 68.5 64.02 99.3 64.02 99.3 C 64.02 99.3 64.46 99.6 64.9 99.9 L 90.53 83.4 L 63.69 68.1 Z"}),t("polygon",{fill:"#FFCFB5",points:"64.02 99.3 90.53 114.9 90.53 83.4"}),t("path",{fill:"#F67D73",d:"M 90.53 83.4 L 90.53 114.9 L 117.37 99.0 Z"}),t("path",{fill:"#F26560",d:"M 90.53 83.4 L 117.37 99.0 L 117.37 68.0 Z"}),t("polygon",{fill:"#EB5F5B",points:"80.08 67.5 90.53 73.5 90.53 61.3"}),t("polygon",{fill:"#DB4D50",points:"90.53 61.3 90.53 73.5 100.87 67.4"})]}),t("div",{className:"absolute bottom-0 left-0 w-full h-[65%] bg-linear-to-t from-black/35 to-black/0"}),t("p",{className:"absolute left-1 bottom-2 text-white",children:e.name})]}),o("div",{className:"px-2 h-10 flex justify-between items-center",children:[o("p",{className:"truncate pr-1 text-xs text-muted-foreground",children:[NI()," ",Vg(e.updatedAt??"")]}),t("div",{onClick:(r)=>r.stopPropagation(),children:o(ge,{modal:!1,children:[t(Ae,{asChild:!0,children:t("button",{className:"hover:bg-muted outline-none flex px-1",children:t(cr,{className:"w-5 h-5 text-muted-foreground"})})}),o(ye,{align:"end",children:[c&&t(W,{onClick:(r)=>{r.stopPropagation(),we(e)},children:Yh()}),o(W,{className:"flex items-center justify-between gap-4 cursor-pointer",onSelect:(r)=>{r.preventDefault(),he.mutate(e)},children:[t("span",{children:xx()}),t(qe,{checked:e.enableNotification??!0,className:"pointer-events-none"})]}),d&&t(W,{className:"text-destructive focus:text-destructive",onClick:()=>xe(e),children:at()})]})]})})]})]})},e.id)),c&&t("div",{className:E("shadow-md relative border rounded-xl overflow-hidden cursor-pointer transition-transform duration-100 ease-in-out border-dashed hover:border-orange-600/50 group",f==="create"?"scale-95":"scale-100"),onClick:be,children:o("div",{className:"flex flex-col",children:[t("div",{className:"relative w-full aspect-square flex items-center justify-center bg-zinc-400/5 group-hover:bg-orange-600/5 transition-colors",children:t(fe,{className:"w-8 h-8 text-zinc-400 group-hover:text-orange-600 transition-colors"})}),t("div",{className:"px-2 h-10 flex items-center justify-center bg-zinc-400/10 border-t group-hover:bg-orange-600/10 transition-colors",children:t("p",{className:"text-sm text-muted-foreground group-hover:text-orange-600 transition-colors",children:_f()})})]})})]}),t(ie,{open:n,onOpenChange:b,mode:k,teamId:a,project:F}),t(Je,{open:_,onOpenChange:y,children:o(Xe,{children:[o(et,{children:[t(rt,{children:My()}),o(nt,{children:[y_({name:g?.name??""}),o("div",{className:"mt-4 flex flex-col gap-2 text-foreground",children:[t("span",{className:"text-sm font-medium",children:RI()}),t(H,{value:D,onChange:(e)=>P(e.target.value),placeholder:A_(),className:"h-9",autoFocus:!0})]})]})]}),o(tt,{children:[t(st,{disabled:Q.isPending,children:ke()}),t(ot,{onClick:(e)=>{e.preventDefault(),Ne()},disabled:D!=="delete"||Q.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Q.isPending?E_():at()})]})]})}),t(Fl,{open:Y,onOpenChange:q,title:eI(),type:"team",members:X,isOwner:re?.role==="owner",onInvite:Ce,onUpdateRole:async(e,r)=>{await _e.mutateAsync({userId:e,role:r})},onRemoveMember:async(e)=>{await Pe.mutateAsync(e)},currentUserId:re?.id})]})}var Oe=Fe("/teams/$teamId/")({component:Ue});export{Oe as Route};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ss,$o}from"./chunk-vap4k11j.js";import{Go}from"./chunk-1gvscz88.js";import{Qo,mo,kt}from"./chunk-5tcdwep5.js";import{an,nr,He,Jr,Jt,go,jt}from"./chunk-jgs8an3h.js";var{awsEndpointFunctions:me,emitWarningIfUnsupportedVersion:xe,createDefaultUserAgentProvider:fe,NODE_APP_ID_CONFIG_OPTIONS:Se,getAwsRegionExtensionConfiguration:ve,resolveAwsRegionExtensionConfiguration:Pe,resolveUserAgentConfig:Ie,resolveHostHeaderConfig:Ce,getUserAgentPlugin:Ae,getHostHeaderPlugin:ye,getLoggerPlugin:Te,getRecursionDetectionPlugin:Oe}=kt(),{NoAuthSigner:Re,getHttpAuthSchemeEndpointRuleSetPlugin:De,DefaultIdentityProviderConfig:ke,getHttpSigningPlugin:$e}=mo(),{normalizeProvider:j,getSmithyContext:we,ServiceException:Ne,NoOpLogger:be,emitWarningIfUnsupportedVersion:Ue,loadConfigsForDefaultMode:Fe,getDefaultExtensionConfiguration:qe,resolveDefaultRuntimeConfig:Me,Client:K,makeBuilder:Ge,createAggregatedClient:je}=nr(),{Command:Ke}=nr();var Ur=Ke,Fr=K;var{resolveDefaultsModeConfig:Ve,loadConfig:h,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:ze,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:Le,NODE_REGION_CONFIG_OPTIONS:Be,NODE_REGION_CONFIG_FILE_OPTIONS:We,resolveRegionConfig:Ye}=He(),{BinaryDecisionDiagram:Je,EndpointCache:Xe,decideEndpoint:Qe,customEndpointFunctions:Ze,resolveEndpointConfig:et,getEndpointPlugin:tt}=Jr(),{parseUrl:rt,getHttpHandlerExtensionConfiguration:ot,resolveHttpHandlerRuntimeConfig:nt,getContentLengthPlugin:st}=jt(),{DEFAULT_RETRY_MODE:it,NODE_RETRY_MODE_CONFIG_OPTIONS:ct,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:at,resolveRetryConfig:pt,getRetryPlugin:dt}=Qo(),{TypeRegistry:V,getSchemaSerdePlugin:ut}=an(),{resolveAwsSdkSigV4Config:lt,AwsSdkSigV4Signer:ht,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:_t}=$o(),{toUtf8:gt,fromUtf8:Et,toBase64:mt,fromBase64:xt,calculateBodyLength:ft}=Jt(),{streamCollector:St,NodeHttpHandler:vt}=Go(),{AwsRestJsonProtocol:Pt}=Ss(),{Sha256:It}=go(),Ct=async(e,t,n)=>({operation:we(t).operation,region:await j(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function At(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(t,n)=>({signingProperties:{config:t,context:n}})}}function yt(e){return{schemeId:"smithy.api#noAuth"}}var Tt=(e)=>{let t=[];switch(e.operation){case"CreateToken":{t.push(yt());break}default:t.push(At(e))}return t},Ot=(e)=>{let t=lt(e);return Object.assign(t,{authSchemePreference:j(e.authSchemePreference??[])})},Rt=(e)=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}),Dt={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},$t="3.997.43",wt={version:$t},E="ref",_=-1,x=!0,q="isSet",z="PartitionResult",f="booleanEquals",w="getAttr",H={[E]:"Endpoint"},N={[E]:z},g={},M=[{[E]:"Region"}],G={conditions:[[q,[H]],[q,M],["aws.partition",M,z],[f,[{[E]:"UseFIPS"},x]],[f,[{[E]:"UseDualStack"},x]],[f,[{fn:w,argv:[N,"supportsDualStack"]},x]],[f,[{fn:w,argv:[N,"supportsFIPS"]},x]],["stringEquals",[{fn:w,argv:[N,"name"]},"aws-us-gov"]]],results:[[_],[_,"Invalid Configuration: FIPS and custom endpoint are not supported"],[_,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[H,g],["https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",g],[_,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://oidc.{Region}.amazonaws.com",g],["https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",g],[_,"FIPS is enabled but this partition does not support FIPS"],["https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",g],[_,"DualStack is enabled but this partition does not support DualStack"],["https://oidc.{Region}.{PartitionResult#dnsSuffix}",g],[_,"Invalid Configuration: Missing Region"]]},Nt=2,c=1e8,bt=new Int32Array([-1,1,-1,0,13,3,1,4,c+12,2,5,c+12,3,8,6,4,7,c+11,5,c+9,c+10,4,11,9,6,10,c+8,7,c+6,c+7,5,12,c+5,6,c+4,c+5,3,c+1,14,4,c+2,c+3]),Ut=Je.from(bt,Nt,G.conditions,G.results),Ft=new Xe({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),qt=(e,t={})=>Ft.get(e,()=>Qe(Ut,{endpointParams:e,logger:t.logger}));Ze.aws=me;class i extends Ne{constructor(e){super(e);Object.setPrototypeOf(this,i.prototype)}}class S extends i{name="AccessDeniedException";$fault="client";error;reason;error_description;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});Object.setPrototypeOf(this,S.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class v extends i{name="AuthorizationPendingException";$fault="client";error;error_description;constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e});Object.setPrototypeOf(this,v.prototype),this.error=e.error,this.error_description=e.error_description}}class P extends i{name="ExpiredTokenException";$fault="client";error;error_description;constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e});Object.setPrototypeOf(this,P.prototype),this.error=e.error,this.error_description=e.error_description}}class I extends i{name="InternalServerException";$fault="server";error;error_description;constructor(e){super({name:"InternalServerException",$fault:"server",...e});Object.setPrototypeOf(this,I.prototype),this.error=e.error,this.error_description=e.error_description}}class C extends i{name="InvalidClientException";$fault="client";error;error_description;constructor(e){super({name:"InvalidClientException",$fault:"client",...e});Object.setPrototypeOf(this,C.prototype),this.error=e.error,this.error_description=e.error_description}}class A extends i{name="InvalidGrantException";$fault="client";error;error_description;constructor(e){super({name:"InvalidGrantException",$fault:"client",...e});Object.setPrototypeOf(this,A.prototype),this.error=e.error,this.error_description=e.error_description}}class y extends i{name="InvalidRequestException";$fault="client";error;reason;error_description;constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});Object.setPrototypeOf(this,y.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class T extends i{name="InvalidScopeException";$fault="client";error;error_description;constructor(e){super({name:"InvalidScopeException",$fault:"client",...e});Object.setPrototypeOf(this,T.prototype),this.error=e.error,this.error_description=e.error_description}}class O extends i{name="SlowDownException";$fault="client";error;error_description;constructor(e){super({name:"SlowDownException",$fault:"client",...e});Object.setPrototypeOf(this,O.prototype),this.error=e.error,this.error_description=e.error_description}}class R extends i{name="UnauthorizedClientException";$fault="client";error;error_description;constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e});Object.setPrototypeOf(this,R.prototype),this.error=e.error,this.error_description=e.error_description}}class D extends i{name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e});Object.setPrototypeOf(this,D.prototype),this.error=e.error,this.error_description=e.error_description}}var Ht="AccessDeniedException",Mt="AuthorizationPendingException",Gt="AccessToken",Kt="ClientSecret",Vt="CreateToken",zt="CreateTokenRequest",Lt="CreateTokenResponse",Bt="CodeVerifier",Wt="ExpiredTokenException",Yt="InvalidClientException",Xt="InvalidGrantException",Qt="InvalidRequestException",Zt="InternalServerException",er="InvalidScopeException",tr="IdToken",rr="RefreshToken",or="SlowDownException",sr="UnauthorizedClientException",ir="UnsupportedGrantTypeException",cr="accessToken",l="client",ar="clientId",pr="clientSecret",dr="codeVerifier",ur="code",lr="deviceCode",r="error",hr="expiresIn",d="error_description",_r="grantType",gr="http",u="httpError",Er="idToken",L="reason",B="refreshToken",mr="redirectUri",W="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc",xr="scope",fr="server",Sr="tokenType",o="com.amazonaws.ssooidc",Y=V.for(W),J=[-3,W,"SSOOIDCServiceException",0,[],[]];Y.registerError(J,i);var a=V.for(o),X=[-3,o,Ht,{[r]:l,[u]:400},[r,L,d],[0,0,0]];a.registerError(X,S);var Q=[-3,o,Mt,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(Q,v);var Z=[-3,o,Wt,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(Z,P);var ee=[-3,o,Zt,{[r]:fr,[u]:500},[r,d],[0,0]];a.registerError(ee,I);var te=[-3,o,Yt,{[r]:l,[u]:401},[r,d],[0,0]];a.registerError(te,C);var re=[-3,o,Xt,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(re,A);var oe=[-3,o,Qt,{[r]:l,[u]:400},[r,L,d],[0,0,0]];a.registerError(oe,y);var ne=[-3,o,er,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(ne,T);var se=[-3,o,or,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(se,O);var ie=[-3,o,sr,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(ie,R);var ce=[-3,o,ir,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(ce,D);var ae=[Y,a],vr=[0,o,Gt,8,0],Pr=[0,o,Kt,8,0],Ir=[0,o,Bt,8,0],Cr=[0,o,tr,8,0],pe=[0,o,rr,8,0],de=[3,o,zt,0,[ar,pr,_r,lr,ur,B,xr,mr,dr],[0,[()=>Pr,0],0,0,0,[()=>pe,0],64,0,[()=>Ir,0]],3],ue=[3,o,Lt,0,[cr,Sr,hr,B,Er],[[()=>vr,0],0,1,[()=>pe,0],[()=>Cr,0]]],le=[9,o,Vt,{[gr]:["POST","/token",200]},()=>de,()=>ue],Ar=(e)=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??xt,base64Encoder:e?.base64Encoder??mt,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??qt,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Tt,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(t)=>t.getIdentityProvider("aws.auth#sigv4"),signer:new ht},{schemeId:"smithy.api#noAuth",identityProvider:(t)=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Re}],logger:e?.logger??new be,protocol:e?.protocol??Pt,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.ssooidc",errorTypeRegistries:ae,version:"2019-06-10",serviceTarget:"AWSSSOOIDCService"},serviceId:e?.serviceId??"SSO OIDC",sha256:e?.sha256??It,urlParser:e?.urlParser??rt,utf8Decoder:e?.utf8Decoder??Et,utf8Encoder:e?.utf8Encoder??gt}),yr=(e)=>{Ue(process.version);let t=Ve(e),n=()=>t().then(Fe),p=Ar(e);xe(process.version);let s={profile:e?.profile,logger:p.logger};return{...p,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??h(_t,s),bodyLengthChecker:e?.bodyLengthChecker??ft,defaultUserAgentProvider:e?.defaultUserAgentProvider??fe({serviceId:p.serviceId,clientVersion:wt.version}),maxAttempts:e?.maxAttempts??h(at,e),region:e?.region??h(Be,{...We,...s}),requestHandler:vt.create(e?.requestHandler??n),retryMode:e?.retryMode??h({...ct,default:async()=>(await n()).retryMode||it},e),streamCollector:e?.streamCollector??St,useDualstackEndpoint:e?.useDualstackEndpoint??h(Le,s),useFipsEndpoint:e?.useFipsEndpoint??h(ze,s),userAgentAppId:e?.userAgentAppId??h(Se,s)}},Tr=(e)=>{let{httpAuthSchemes:t,httpAuthSchemeProvider:n,credentials:p}=e;return{setHttpAuthScheme(s){let m=t.findIndex((k)=>k.schemeId===s.schemeId);if(m===-1)t.push(s);else t.splice(m,1,s)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(s){n=s},httpAuthSchemeProvider(){return n},setCredentials(s){p=s},credentials(){return p}}},Or=(e)=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),Rr=(e,t)=>{let n=Object.assign(ve(e),qe(e),ot(e),Tr(e));return t.forEach((p)=>p.configure(n)),Object.assign(e,Pe(n),Me(n),nt(n),Or(n))};class b extends K{config;constructor(...[e]){let t=yr(e||{});super(t);this.initConfig=t;let n=Rt(t),p=Ie(n),s=pt(p),m=Ye(s),k=Ce(m),he=et(k),_e=Ot(he),ge=Rr(_e,e?.extensions||[]);this.config=ge,this.middlewareStack.use(ut(this.config)),this.middlewareStack.use(Ae(this.config)),this.middlewareStack.use(dt(this.config)),this.middlewareStack.use(st(this.config)),this.middlewareStack.use(ye(this.config)),this.middlewareStack.use(Te(this.config)),this.middlewareStack.use(Oe(this.config)),this.middlewareStack.use(De(this.config,{httpAuthSchemeParametersProvider:Ct,identityProviderConfigProvider:async(Ee)=>new ke({"aws.auth#sigv4":Ee.credentials})})),this.middlewareStack.use($e(this.config))}destroy(){super.destroy()}}var Dr=Ge(Dt,"AWSSSOOIDCService","SSOOIDCClient",tt),kr={},$r=(e,t,n,p)=>[];class U extends Dr(kr,$r,"CreateToken",le){}var wr={CreateTokenCommand:U};class F extends b{}je(wr,F);var Nr={KMS_ACCESS_DENIED:"KMS_AccessDeniedException"},br={KMS_DISABLED_KEY:"KMS_DisabledException",KMS_INVALID_KEY_USAGE:"KMS_InvalidKeyUsageException",KMS_INVALID_STATE:"KMS_InvalidStateException",KMS_KEY_NOT_FOUND:"KMS_NotFoundException"};var qr=S,Hr=X,Mr=Nr,Gr=v,jr=Q,Kr=le,Vr=U,zr=de,Lr=ue,Br=P,Wr=Z,Yr=I,Xr=ee,Qr=C,Zr=te,eo=A,to=re,ro=y,oo=oe,no=br,so=T,io=ne,co=F,ao=b,po=i,uo=J,lo=O,ho=se,_o=R,Eo=ie,xo=D,fo=ce,So=ae;export{Ur as $Command,Fr as __Client,qr as AccessDeniedException,Hr as AccessDeniedException$,Mr as AccessDeniedExceptionReason,Gr as AuthorizationPendingException,jr as AuthorizationPendingException$,Kr as CreateToken$,Vr as CreateTokenCommand,zr as CreateTokenRequest$,Lr as CreateTokenResponse$,Br as ExpiredTokenException,Wr as ExpiredTokenException$,Yr as InternalServerException,Xr as InternalServerException$,Qr as InvalidClientException,Zr as InvalidClientException$,eo as InvalidGrantException,to as InvalidGrantException$,ro as InvalidRequestException,oo as InvalidRequestException$,no as InvalidRequestExceptionReason,so as InvalidScopeException,io as InvalidScopeException$,co as SSOOIDC,ao as SSOOIDCClient,po as SSOOIDCServiceException,uo as SSOOIDCServiceException$,lo as SlowDownException,ho as SlowDownException$,_o as UnauthorizedClientException,Eo as UnauthorizedClientException$,xo as UnsupportedGrantTypeException,fo as UnsupportedGrantTypeException$,So as errorTypeRegistries};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{T}from"./chunk-7rhz2gze.js";var e=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Hn=T("user",e);var c=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],oo=T("users",c);
|
|
2
|
+
export{Hn,oo};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h,C,t,Z,Fe,A,it,_t,Fp}from"./chunk-7rhz2gze.js";import"./chunk-7kjgvxqa.js";import"./chunk-tm7f32c7.js";import"./chunk-gc5sbfa5.js";import"./chunk-77fmkpdz.js";import"./chunk-1j27fzy1.js";import"./chunk-7pw1550a.js";import"./chunk-rssgmj7x.js";import"./chunk-8e28hcny.js";import"./chunk-914bp49r.js";import"./chunk-snhsjs4x.js";import"./chunk-0qaq0sp8.js";import{qn}from"./chunk-dj92fss9.js";import{er}from"./chunk-5vzrpz50.js";import"./chunk-98715kc3.js";import"./chunk-m9pr03kn.js";import"./chunk-5adsx8x4.js";import"./chunk-j2bvj2yn.js";import"./chunk-cbgq517y.js";import"./chunk-gk2q9a3f.js";import"./chunk-9t8n2des.js";import"./chunk-ytdwk2fq.js";import"./chunk-0zv3bks2.js";C();function i(){let{projectId:o}=l.useParams(),{teamId:r,ensureTeamIdForProject:a}=it();h(()=>{a(o)},[o,a]);let{data:s}=er(Fp(o)),e=s?.rootFolder,{data:n}=Z({queryKey:["folders",e],queryFn:()=>(async()=>await(await A.api.folders[":folderId"].$get({param:{folderId:e}})).json())(),enabled:!!e});if(!r||!e||!n)return t(_t,{});return t(qn,{teamId:r,projectId:o,projectName:s.name??"",assetId:"recents",rootFolderId:e})}var l=Fe("/projects/$projectId/recents")({component:i});export{l as Route};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{h,O,w,u,C,B,t,o,K,Z,U,ut,Re,A,E,dg,fg,HC,Pt,us,kr,un,jn,qc,Ar,en,Ur,Qt,yr,Do,Lo}from"./chunk-7rhz2gze.js";import{Or}from"./chunk-7kjgvxqa.js";import{Aa}from"./chunk-tm7f32c7.js";import{ga}from"./chunk-1j27fzy1.js";import{oi,Dl}from"./chunk-7pw1550a.js";import{Ll}from"./chunk-8e28hcny.js";import{ba}from"./chunk-snhsjs4x.js";import{Sr}from"./chunk-0qaq0sp8.js";C();function Ce(i,s,F,r,c,f){let D=i.type==="folder",g=s.type==="folder";if(D!==g)return null;let x=g?r:c,b=x.findIndex((a)=>a.id===F),S=x.findIndex((a)=>a.id===s.id);if(b===-1||S===-1)return null;let T=Math.min(b,S),q=Math.max(b,S),v=x.slice(T,q+1),l=new Set(f);return v.forEach((a)=>{if(a.id)l.add(a.id)}),l}function qn({teamId:i,projectId:s,projectName:F,assetId:r,rootFolderId:c,collection:f,onUpdateCollection:D}){let g=Re(),x=K(),{canEdit:b}=Pt(s),{setFields:S}=Or(),T=A.api.files[":fileId"].metadata.$patch,{mutate:q}=U({mutationFn:async(e)=>{if(!(await T(e)).ok)throw Error("Failed to patch metadata");return null}}),{data:v}=Z({queryKey:["fields",s],queryFn:async()=>{let e=await A.api.projects[":projectId"].fields.$get({param:{projectId:s}});if(!e.ok)throw Error("Failed to fetch fields");return await e.json()},enabled:!!s});h(()=>{if(v)S(v,s)},[v,s,S]);let l=r==="recently-deleted",a=r==="recents",[te,Q]=u(null),[p,L]=u(new Set),[W,se]=u(null),[Pe,ke]=u(240),[Ne,Me]=u(360),{isChatbotOpen:_}=yr(),{members:Ae,fetchMembers:oe}=Ur(),{metadata:ze,fetchMetadata:ne,setMetadata:Le}=Lo();h(()=>{if(i)oe(i),ne(i)},[i,oe,ne]);let H=O(()=>f?.filter?.searchFilter?.conditions||[],[f]),[I,V]=u(H);h(()=>{V(H)},[H]);let ae=`project:${s}:sort`,P=ze[ae]||{field:"custom",order:"asc"},je=(e)=>{if(e)Le(i,ae,e)},m=!!f,R=I.length>0||m,{fileListLeftSidebarCollapsed:re,setFileListLeftSidebarCollapsed:De,fileListRightSidebarCollapsed:ie,setFileListRightSidebarCollapsed:$e,viewModes:Te}=Qt(),le=Te[s]??"card",qe=w(null),{data:k}=l||a?{data:void 0}:Z({queryKey:["folders",r],queryFn:async()=>{let e=await A.api.folders[":folderId"].$get({param:{folderId:r}});if(!e.ok)throw Error("failed to fetch folder");return await e.json()}}),{setProjectState:de,clearProjectState:ce}=en();h(()=>(de({teamId:i,projectId:s,projectName:F,rootFolderId:c,ancestorFolders:k?.ancestorFolders??[],currentAsset:l?{name:dg(),type:"folder"}:a?{name:fg(),type:"folder"}:m?{id:f.id,name:f.name,type:"folder"}:{id:k?.id||r,name:k?.name,type:"folder"},isRootFolder:!l&&!a&&!m&&r===c,onFolderClick:(e)=>{g({to:"/projects/$projectId/folders/$folderId",params:{projectId:s,folderId:e}})}}),()=>ce()),[i,s,F,k,l,a,r,c,de,ce,g]);let{data:X,fetchNextPage:fe,hasNextPage:pe,isFetchingNextPage:ue,isLoading:Ee}=ut({queryKey:l?["projects",s,"recently-deleted","folder"]:a?["projects",s,"recents","folder"]:["search",i,r,"folder",I,P,m],queryFn:async({pageParam:e})=>{if(l||m||a){if(l){let d=await A.api.projects[":projectId"]["recently-deleted"].$get({param:{projectId:s},query:{assetType:"folder",after:e}});if(!d.ok)throw Error("failed to fetch recently deleted folders");return await d.json()}return{data:[],pageInfo:{total:0}}}if(R)return{data:[],pageInfo:{total:0}};let n=await A.api.folders[":folderId"].search.$post({param:{folderId:r},json:{assetType:"folder",after:e,recursively:!1,sort:P,conditions:[]}});if(!n.ok)throw Error("failed to search folders");return await n.json()},enabled:!R&&!a,initialPageParam:"",getNextPageParam:(e)=>e.pageInfo?.cursor||void 0}),{data:G,fetchNextPage:ge,hasNextPage:me,isFetchingNextPage:he,isLoading:Ke}=ut({queryKey:l?["projects",s,"recently-deleted","file"]:a?["projects",s,"recents","file"]:["search",i,r,"file",I,P,m],queryFn:async({pageParam:e})=>{if(l){let d=await A.api.projects[":projectId"]["recently-deleted"].$get({param:{projectId:s},query:{assetType:"file",after:e}});if(!d.ok)throw Error("failed to fetch recently deleted files");return await d.json()}if(a){let d=await A.api.projects[":projectId"].recents.$get({param:{projectId:s},query:{after:e,first:"20"}});if(!d.ok)throw Error("failed to fetch recent files");return await d.json()}let n=await A.api.folders[":folderId"].search.$post({param:{folderId:r},json:{assetType:"file",after:e,recursively:R||m,conditions:I,sort:P}});if(!n.ok)throw Error("failed to search files");return await n.json()},initialPageParam:"",getNextPageParam:(e)=>e.pageInfo?.cursor||void 0}),N=X?.pages.flatMap((e)=>e.data??[])??[],y=G?.pages.flatMap((e)=>e.data??[])??[],ye=(!R&&!a?Ee:!1)||Ke,xe=X?.pages[0]?.pageInfo?.total,Se=G?.pages[0]?.pageInfo?.total,Fe=X?.pages[0]?.pageInfo?.totalSize,we=G?.pages[0]?.pageInfo?.totalSize,J=()=>{L(new Set),Q(null),se(null)},{dragState:M,handleDragStart:Qe,handleDragEnd:Oe}=Dl({teamId:i,projectId:s,assetId:r,folders:N,files:y,selectedIds:p,onClearSelection:J}),Y=O(()=>{if(p.size!==1)return null;let e=Array.from(p)[0];return y.find((d)=>d.id===e)||null},[p,y]),be=(e)=>{if(l)return;if(e.type==="folder")V([]),g({to:"/projects/$projectId/folders/$folderId",params:{projectId:s,folderId:e.id}});else g({to:"/projects/$projectId/files/$fileId",params:{projectId:s,fileId:e.versionStack?e.versionStack.id:e.id},search:{version:void 0}})},ve=(e,n)=>{let d=n.metaKey||n.ctrlKey;if(n.shiftKey&&W){let Ie=[...N,...y].find((j)=>j.id===W);if(Ie){let j=Ce(Ie,e,W,N,y,p);if(j){L(j),Q(e);return}}}if(d){let z=new Set(p);if(z.has(e.id))z.delete(e.id);else z.add(e.id);L(z)}else L(new Set([e.id]));se(e.id),Q(e)},ee=(e,n,d)=>{q({param:{fileId:e},json:[{key:n,value:d}]},{onSuccess:()=>{x.invalidateQueries({queryKey:["folders",r,"children",{assetType:"file"}]}),x.invalidateQueries({queryKey:["search",i,r]})}})};if(Do())return t(Ll,{teamId:i,projectId:s,assetId:r,folders:N,files:y,totalFolders:xe,totalFiles:Se,totalFoldersSize:Fe,totalFilesSize:we,selectedItem:te,selectedIds:p,onItemSelect:ve,onItemDoubleClick:be,onSaveField:ee,onClearSelection:J,fetchNextFoldersPage:fe,hasNextFoldersPage:pe||!1,isFetchingNextFoldersPage:ue,fetchNextFilesPage:ge,hasNextFilesPage:me||!1,isFetchingNextFilesPage:he,isRecentlyDeleted:l,isRecents:a,isLoading:ye,rootFolderId:c});return o(jn,{modifiers:[oi.configure({anchor:{x:0,y:0}})],plugins:(e)=>e.map((n)=>{if(n===us)return us.configure({dropAnimation:null});if(typeof n==="object"&&n!==null&&"plugin"in n&&n.plugin===us)return us.configure({dropAnimation:null});return n}),sensors:l||a||!b?[]:[un.configure({activationConstraints:[new kr.Distance({value:10})]})],onDragStart:Qe,onDragEnd:Oe,children:[t("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:o("div",{ref:qe,className:"flex flex-1 overflow-hidden relative",children:[!re&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>De(!0)}),(!ie||_)&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>{$e(!0),yr.getState().setIsChatbotOpen(!1)}}),!re&&o(B,{children:[t("div",{className:"bg-background",style:{width:Pe},children:t(Ar,{teamId:i,projectId:s,projectName:F,rootFolderId:c,dragState:M,ancestorFolders:k?.ancestorFolders??[]})}),t(Sr,{onResize:(e)=>{ke((n)=>Math.max(180,Math.min(400,n+e)))},className:"hidden md:block"})]}),t(Aa,{teamId:i,projectId:s,assetId:r,folders:N,files:y,totalFolders:xe,totalFiles:Se,totalFoldersSize:Fe,totalFilesSize:we,selectedItem:te,selectedIds:p,onItemSelect:ve,onItemDoubleClick:be,onSaveField:ee,displayStyle:le,onClearSelection:J,fetchNextFoldersPage:fe,hasNextFoldersPage:pe||!1,isFetchingNextFoldersPage:ue,fetchNextFilesPage:ge,hasNextFilesPage:me||!1,isFetchingNextFilesPage:he,isRecentlyDeleted:l,isRecents:a,isLoading:ye,filterConditions:I,onFilterChange:V,sort:P,onSortChange:je,dragState:M,collection:f,onUpdateCollection:D,rootFolderId:c}),(!ie||_)&&o(B,{children:[t(Sr,{onResize:(e)=>{Me((n)=>Math.max(240,Math.min(600,n-e)))},className:"hidden md:block"}),t("div",{style:{width:Ne},className:"bg-background flex flex-col flex-shrink-0",children:_?t(ga,{projectId:s,contextAssetId:r}):Y?t(ba,{teamId:i,projectId:s,file:Y,onSaveField:(e,n)=>ee(Y.id,e,n),members:Ae,hideAnnotationControl:!0}):t("div",{className:"flex h-full items-center justify-center p-4 text-center text-sm text-muted-foreground",children:HC()})})]})]})}),t(qc,{children:M?.isActive?t("div",{className:E("flex items-center gap-2 rounded-md bg-popover px-3 py-2 text-sm font-medium text-popover-foreground shadow-md ring-1 ring-border cursor-grabbing",le==="list"&&"w-30 h-[40px] px-0 flex-none overflow-hidden justify-center"),style:{transform:"translate(0px, 0px)"},children:o("span",{children:["Moving ",M.itemCount," item",M.itemCount!==1?"s":""]})}):null})]})}
|
|
2
|
+
export{qn};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{T,op,sp,ap,ip,bd,wd,vd,xd,Sd,Kc}from"./chunk-7rhz2gze.js";import{So}from"./chunk-5adsx8x4.js";import{Co}from"./chunk-j2bvj2yn.js";var o=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Fs=T("activity",o);var a=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],no=T("cpu",a);var r=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Uo=T("gauge",r);var c=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],fn=T("server",c);var n=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],jl=T("shield-alert",n);var i=[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],ci=T("user-check",i);var u=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],li=T("dollar-sign",u);var zi={agent_total_tokens:{label:()=>Sd(),icon:no,unit:"tokens"},agent_cost:{label:()=>wd(),icon:li,unit:"$"},agent_mcp_call_count:{label:()=>vd(),icon:fn,unit:"calls"},agent_bash_call_count:{label:()=>bd(),icon:Co,unit:"calls"},agent_tool_call_count:{label:()=>xd(),icon:So,unit:"calls"}};function Ca(e,t){if(e==="agent_cost")return`$${t.toFixed(2)}`;return t.toLocaleString()}function ql(e){switch(Kc(e)){case"1hour":return sp();case"5hour":return ap();case"1day":return op();case"7day":return ip();default:return e}}
|
|
2
|
+
export{Fs,no,li,Uo,fn,jl,ci,zi,Ca,ql};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{kt}from"./chunk-5tcdwep5.js";import{He,jt}from"./chunk-jgs8an3h.js";import{z}from"./chunk-fnmwksnb.js";var A=z(kt()),f=z(He());var g=z(He()),P=z(jt());import{createHash as F,createPrivateKey as L,createPublicKey as O,sign as H}from"crypto";import{promises as x}from"fs";import{homedir as K}from"os";import{dirname as _,join as I}from"path";class h{profileData;init;callerClientConfig;static REFRESH_THRESHOLD=300000;constructor(e,t,s){this.profileData=e,this.init=t,this.callerClientConfig=s}async loadCredentials(){let e=await this.loadToken();if(!e)throw new g.CredentialsProviderError(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`,{tryNextLink:!1,logger:this.logger});let t=e.accessToken,s=Date.now();if(new Date(t.expiresAt).getTime()-s<=h.REFRESH_THRESHOLD)return this.refresh(e);return this.toCredentials(e.accessToken)}get logger(){return this.init?.logger}get loginSession(){return this.profileData.login_session}toCredentials(e){return{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,sessionToken:e.sessionToken,accountId:e.accountId,expiration:new Date(e.expiresAt)}}async refresh(e){let t=await this.loadToken().catch(()=>e),s=Date.now(),r=new Date(t.accessToken.expiresAt).getTime(),n=new Date(e.accessToken.expiresAt).getTime(),o=r<=s&&n>s?e:t;if(new Date(o.accessToken.expiresAt).getTime()-Date.now()>h.REFRESH_THRESHOLD)return this.toCredentials(o.accessToken);let{SigninClient:p,CreateOAuth2TokenCommand:w}=await import("./chunk-0qjfahk9.js"),{logger:y,userAgentAppId:m}=this.callerClientConfig??{},T=((i)=>i?.metadata?.handlerProtocol==="h2")(this.callerClientConfig?.requestHandler)?void 0:this.callerClientConfig?.requestHandler,d=this.profileData.region??await this.callerClientConfig?.region?.()??process.env.AWS_REGION,u=new p({credentials:{accessKeyId:"",secretAccessKey:""},region:d,requestHandler:T,logger:y,userAgentAppId:m,...this.init?.clientConfig});this.createDPoPInterceptor(u.middlewareStack);let S={tokenInput:{clientId:o.clientId,refreshToken:o.refreshToken,grantType:"refresh_token"}};try{let i=await u.send(new w(S)),{accessKeyId:c,secretAccessKey:k,sessionToken:l}=i.tokenOutput?.accessToken??{},{refreshToken:D,expiresIn:N}=i.tokenOutput??{};if(!c||!k||!l||!D)throw new g.CredentialsProviderError("Token refresh response missing required fields",{logger:this.logger,tryNextLink:!1});let R=(N??900)*1000,b=new Date(Date.now()+R),C={...o,accessToken:{...o.accessToken,accessKeyId:c,secretAccessKey:k,sessionToken:l,expiresAt:b.toISOString()},refreshToken:D};return await this.saveToken(C),this.toCredentials(C.accessToken)}catch(i){if(i.name==="AccessDeniedException"){let k=i.error,l;switch(k){case"TOKEN_EXPIRED":l="Your session has expired. Please reauthenticate.";break;case"USER_CREDENTIALS_CHANGED":l="Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password.";break;case"INSUFFICIENT_PERMISSIONS":l="Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action.";break;default:l=`Failed to refresh token: ${String(i)}. Please re-authenticate using \`aws login\``}throw new g.CredentialsProviderError(l,{logger:this.logger,tryNextLink:!1})}if(new Date(o.accessToken.expiresAt).getTime()>Date.now())return this.logger?.warn?.(`Failed to refresh token: ${String(i)}. Using existing token until expiry.`),this.toCredentials(o.accessToken);throw new g.CredentialsProviderError(`Failed to refresh token: ${String(i)}. Please re-authenticate using aws login`,{logger:this.logger})}}async loadToken(){let e=this.getTokenFilePath();try{let t=await x.readFile(e,"utf8"),s=JSON.parse(t),r=["accessToken","clientId","refreshToken","dpopKey"].filter((n)=>!s[n]);if(!s.accessToken?.accountId)r.push("accountId");if(r.length>0)throw new g.CredentialsProviderError(`Token validation failed, missing fields: ${r.join(", ")}`,{logger:this.logger,tryNextLink:!1});return s}catch(t){throw new g.CredentialsProviderError(`Failed to load token from ${e}: ${String(t)}`,{logger:this.logger,tryNextLink:!1})}}async saveToken(e){let t=this.getTokenFilePath(),s=_(t);try{await x.mkdir(s,{recursive:!0})}catch(r){}await x.writeFile(t,JSON.stringify(e,null,2),"utf8")}getTokenFilePath(){let e=process.env.AWS_LOGIN_CACHE_DIRECTORY??I(K(),".aws","login","cache"),t=Buffer.from(this.loginSession,"utf8"),s=F("sha256").update(t).digest("hex");return I(e,`${s}.json`)}derToRawSignature(e){let t=2;if(e[t]!==2)throw Error("Invalid DER signature");t++;let s=e[t++],r=e.subarray(t,t+s);if(t+=s,e[t]!==2)throw Error("Invalid DER signature");t++;let n=e[t++],o=e.subarray(t,t+n);r=r[0]===0?r.subarray(1):r,o=o[0]===0?o.subarray(1):o;let a=Buffer.concat([Buffer.alloc(32-r.length),r]),p=Buffer.concat([Buffer.alloc(32-o.length),o]);return Buffer.concat([a,p])}createDPoPInterceptor(e){e.add((t)=>async(s)=>{if(P.HttpRequest.isInstance(s.request)){let r=s.request,n=`${r.protocol}//${r.hostname}${r.port?`:${r.port}`:""}${r.path}`,o=await this.generateDpop(r.method,n);r.headers={...r.headers,DPoP:o}}return t(s)},{step:"finalizeRequest",name:"dpopInterceptor",override:!0})}async generateDpop(e="POST",t){let s=await this.loadToken();try{let r=L({key:s.dpopKey,format:"pem",type:"sec1"}),o=O(r).export({format:"der",type:"spki"}),a=-1;for(let c=0;c<o.length;c++)if(o[c]===4){a=c;break}let p=o.slice(a+1,a+33),w=o.slice(a+33,a+65),y={alg:"ES256",typ:"dpop+jwt",jwk:{kty:"EC",crv:"P-256",x:p.toString("base64url"),y:w.toString("base64url")}},m={jti:crypto.randomUUID(),htm:e,htu:t,iat:Math.floor(Date.now()/1000)},E=Buffer.from(JSON.stringify(y)).toString("base64url"),T=Buffer.from(JSON.stringify(m)).toString("base64url"),d=`${E}.${T}`,u=H("sha256",Buffer.from(d),r),i=this.derToRawSignature(u).toString("base64url");return`${d}.${i}`}catch(r){throw new g.CredentialsProviderError(`Failed to generate Dpop proof: ${r instanceof Error?r.message:String(r)}`,{logger:this.logger,tryNextLink:!1})}}}var v=(e)=>async({callerClientConfig:t}={})=>{e?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials");let s=await f.parseKnownFiles(e||{}),r=f.getProfileName({profile:e?.profile??t?.profile}),n=s[r];if(!n?.login_session)throw new f.CredentialsProviderError(`Profile ${r} does not contain login_session.`,{tryNextLink:!0,logger:e?.logger});let a=await new h(n,e,t).loadCredentials();return A.setCredentialFeature(a,"CREDENTIALS_LOGIN","AD")};export{v as fromLoginCredentials};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{N,h,O,w,u,C,B,t,o,K,Z,U,ut,A,T,wr,L,ko,Me,be,Gr,pt,vt,Xt,ve,De,E,S,ge,Ga,Ae,ye,W,Qr,Gt,Qa,Va,Ka,py,ke,od,at,Nc,Oc,gr,id,rb,Ab,Ti,Lf,Ov,Oh,Dh,bl,Kh,tp,No,Oo,kd,Je,Xe,et,tt,rt,nt,ot,st,pe,ue,me,$e,de,H,ie,Pt,Mt,R,wo,vo,Vr,En,we,Ur,Hd}from"./chunk-7rhz2gze.js";import{ya,_a,ru,nu,fs,Zi,ou}from"./chunk-snhsjs4x.js";import{Or,ps,hs}from"./chunk-7kjgvxqa.js";import{Us}from"./chunk-77fmkpdz.js";var ct=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Qe=T("pencil",ct);function ni({file:i,mediaControllerRef:a,onPlay:r,onPause:l,onTimeUpdate:D,annotations:c,startTime:I,shareId:v,allowDownload:y,children:m}){let b=fs(i),z=b.viewer;return t(z,{ref:a,file:i,onPlay:r,onPause:l,onTimeUpdate:D,annotations:c,startTime:I,shareId:v,allowDownload:y,children:m},b.id)}C();C();function Ge({teamId:i,projectId:a,file:r,onSaveField:l,members:D,onCommentSelect:c,hideAnnotationControl:I=!1,readOnly:v=!1,publicFields:y,isPublic:m=!1,shareId:b,currentTime:z,onTyping:te,selectedCommentId:f,heightPercent:_,onHeightPercentChange:Q}){let{canEdit:j}=Pt(a),{fields:p,setFields:J}=Or(),se=K(),{ref:re,inView:fe}=Mt(),[s,P]=u(null),[q,ne]=u(!1),[Ne,Ee]=u(null),G=w(!1),ze=w(0),Y=w(_),je=(e)=>{G.current=!0,ze.current=e.clientY,Y.current=_,e.target.setPointerCapture?.(e.pointerId)},Pe=N((e)=>{if(!G.current)return;let k=(ze.current-e.clientY)/window.innerHeight*100,oe=Math.min(85,Math.max(10,Y.current+k));Q(oe)},[Q]),Te=(e)=>{G.current=!1;try{e.target.releasePointerCapture?.(e.pointerId)}catch{}},{data:ee}=Z({queryKey:["fields",a],queryFn:async()=>{let e=await A.api.projects[":projectId"].fields.$get({param:{projectId:a}});if(!e.ok)throw Error("Failed to fetch fields");return await e.json()},enabled:!!a&&!y}),M=fs(r);h(()=>{if(y)J(y,a);else if(ee)J(ee,a)},[ee,y,a,J]);let{data:he,fetchNextPage:X,hasNextPage:Ie}=ut({queryKey:m?["shares",b,"files",r?.id,"comments"]:["files",r?.id,"comments"],queryFn:async({pageParam:e})=>{if(m){let d=localStorage.getItem(`share_pwd_${b}`)||"",k=await A.api.shares[":shareId"].files[":fileId"].comments.$get({param:{shareId:b,fileId:r.id},query:{after:e}},{headers:{"x-share-password":d}});if(!k.ok)throw Error("Failed to fetch comments");return await k.json()}else{let d=await A.api.files[":fileId"].comments.$get({param:{fileId:r.id},query:{after:e}});if(!d.ok)throw Error("Failed to fetch comments");return await d.json()}},enabled:!!r?.id&&(!m||!!b),initialPageParam:"",refetchInterval:2000,getNextPageParam:(e)=>e.pageInfo?.cursor||void 0}),{mutate:Fe}=U({mutationFn:async({text:e,attachmentIds:d,annotations:k,replyToId:oe,guestUserId:xe,second:Ce})=>{if(m){let le=localStorage.getItem(`share_pwd_${b}`)||"",Be=await A.api.shares[":shareId"].files[":fileId"].comments.$post({param:{shareId:b,fileId:r.id},json:{message:e,attachmentIds:d,replyToId:oe??void 0,annotations:k,second:Ce??void 0}},{headers:{"x-share-password":le,...xe?{"x-guest-user-id":xe}:{}}});if(!Be.ok)throw Error("Failed to create comment");return await Be.json()}else{let le=await A.api.files[":fileId"].comments.$post({param:{fileId:r.id},json:{message:e,attachmentIds:d,replyToId:oe??void 0,annotations:k,second:Ce??void 0}});if(!le.ok)throw Error("Failed to create comment");return await le.json()}},onSuccess:()=>{se.invalidateQueries({queryKey:m?["shares",b,"files",r?.id,"comments"]:["files",r?.id,"comments"]})},onError:()=>{R.error(Ab?.()||"Failed to post comment")}}),Se=he?.pages?.[0]?.pageInfo?.total??he?.pages.reduce((e,d)=>e+(d.data?.length||0),0)??0;h(()=>{if(fe&&Ie)X()},[fe,X,Ie]);let V=O(()=>(r?.fieldValues||[]).reduce((e,d)=>(e[d.fieldId]=d,e),{}),[r?.fieldValues]),ae=O(()=>[...p].sort((e,d)=>{let k=e.config?.name?.toLowerCase()||"",oe=d.config?.name?.toLowerCase()||"";if(k<oe)return-1;if(k>oe)return 1;return 0}),[p]),Ve=he?.pages.flatMap((e)=>e.data??[])??[],_e=(e,d,k=[],oe,xe)=>{if(!e.trim()&&d.length===0&&k.length===0)return;let Ce=oe||s?.id||null;if(m){let le=localStorage.getItem(`guest_user_id_${b}`);if(!le)Ee({text:e,attachmentIds:d,annotations:k,replyToId:Ce,second:xe}),ne(!0);else Fe({text:e,attachmentIds:d,annotations:k,replyToId:Ce,guestUserId:le,second:xe})}else Fe({text:e,attachmentIds:d,annotations:k,replyToId:Ce,second:xe});P(null)},Oe=(e)=>{if(Ne)Fe({...Ne,guestUserId:e}),Ee(null),P(null)},Re=(e)=>{let d=D.find((k)=>k.id===e);if(d)return d;return{id:"unknown",name:"Unknown",role:"unknown"}},Le=_<=15;return o("div",{style:{height:`${_}dvh`},className:"shrink-0 flex flex-col bg-background border-t border-border shadow-2xl rounded-t-2xl overflow-hidden select-none z-20","data-testid":"mobile-bottom-sheet",children:[t("div",{onPointerDown:je,onPointerMove:Pe,onPointerUp:Te,onPointerCancel:Te,className:"w-full pt-2 pb-1.5 flex flex-col items-center justify-center cursor-grab active:cursor-grabbing touch-none shrink-0","aria-label":"Drag to resize bottom sheet",children:t("div",{className:"w-10 h-1 rounded-full bg-muted-foreground/30 hover:bg-muted-foreground/50 transition-colors"})}),o(wo,{defaultValue:"comments",className:"flex-1 flex flex-col min-h-0 px-2 pb-1 overflow-hidden",children:[o(vo,{className:"w-full shrink-0 h-9 bg-muted/60 p-1",children:[o(Vr,{value:"comments",className:"flex-1 text-xs font-semibold py-1",children:[od()," ",Se>0&&`(${Se})`]}),t(Vr,{value:"fields",className:"flex-1 text-xs font-semibold py-1",children:Ti()})]}),o(En,{value:"comments",className:E("flex-1 flex flex-col overflow-hidden min-h-0 mt-2",Le&&"hidden"),children:[t("div",{className:"flex items-center justify-between px-2 pb-1.5 shrink-0 border-b border-border/50",children:o("span",{className:"text-xs font-bold text-foreground",children:[py?.()||"All comments",Se>0?` (${Se})`:""]})}),t(ie,{className:"flex-1 min-h-0 px-2 py-2 [&>div>div]:block!",children:Ve.length===0?t("div",{className:"py-8 text-center text-xs text-muted-foreground",children:Dh()}):o("div",{className:"space-y-3",children:[Ve.map((e)=>o("div",{children:[t(Zi,{teamId:i,message:e,getUser:Re,onReply:P,hasReplies:!!e.replies?.length,formatTimestamp:M?.commentsConfig?.formatTimestamp,frameRate:M?.commentsConfig?.hasTimestamp?r?.media?.metadata?.frameRate||30:void 0,startTimecode:M?.commentsConfig?.hasTimestamp?r?.media?.metadata?.startTimecode:void 0,isSelected:f===e.id,onSelect:()=>{c?.(e)}}),e.replies?.map((d,k)=>t("div",{children:t(Zi,{teamId:i,isReply:!0,message:d,getUser:Re,onReply:P,hasReplies:!1,isLastReply:k===(e.replies?.length??0)-1,formatTimestamp:M?.commentsConfig?.formatTimestamp,frameRate:M?.commentsConfig?.hasTimestamp?r?.media?.metadata?.frameRate||30:void 0,startTimecode:M?.commentsConfig?.hasTimestamp?r?.media?.metadata?.startTimecode:void 0,isSelected:f===d.id,onSelect:()=>{c?.(d)}})},d.id))]},e.id)),t("div",{ref:re})]})}),(!v||m)&&t("div",{className:"mt-auto shrink-0 bg-background border-t border-border pt-1",children:t(ou,{isOpen:q,onClose:()=>ne(!1),onSuccess:Oe,children:t(Us,{projectId:a,onSendMessage:_e,replyingTo:s,onCancelReply:()=>P(null),hideAnnotationControl:I,disableMentions:m,currentTime:M?.commentsConfig?.hasTimestamp?z:void 0,formatTimestamp:M?.commentsConfig?.formatTimestamp,frameRate:M?.commentsConfig?.hasTimestamp?r?.media?.metadata?.frameRate||30:void 0,startTimecode:M?.commentsConfig?.hasTimestamp?r?.media?.metadata?.startTimecode:void 0,onTyping:te})})})]}),t(En,{value:"fields",className:E("flex-1 flex flex-col overflow-hidden min-h-0 mt-2",Le&&"hidden"),children:t(ie,{className:"flex-1 px-3 py-2 min-h-0 [&>div>div]:block!",children:ae&&ae.length>0?t("div",{className:"space-y-4 pb-6",children:ae.map((e)=>o("div",{className:"space-y-1.5",children:[t("label",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:e.config?.name}),t("div",{className:"min-h-[32px]",children:t(hs,{fieldId:e.id,config:e.config,value:V[e.id]?.value,onSave:j?(d)=>l(e.id,d):void 0,readOnly:v||e.readOnly||!j})})]},e.id))}):t("div",{className:"py-8 text-center text-xs text-muted-foreground",children:"No custom fields defined"})})})]})]})}function Ye({fileName:i,folderName:a,version:r,versions:l,activeFileId:D,isPublic:c=!1,shareId:I,allowDownload:v=!0,downloadInfo:y,canEdit:m=!1,onBack:b,onPrevFile:z,onNextFile:te,hasPrevFile:f=!1,hasNextFile:_=!1,onSelectVersion:Q,onRename:j,onDelete:p,onLinkedTasks:J,linkedTaskCount:se=0}){let re=async(s)=>{try{let P=c&&I?await A.api.shares[":shareId"].files[":fileId"]["download-url"].$post({param:{shareId:I,fileId:D},json:{key:s}}):await A.api.files["download-url"].$post({json:{key:s,assetId:D}});if(!P.ok)return;let{url:q}=await P.json(),ne=document.createElement("a");ne.href=q,ne.download="",document.body.appendChild(ne),ne.click(),document.body.removeChild(ne)}catch{}},fe=(y?.videoTranscodes?.length??0)>0;return o("header",{className:"flex h-12 w-full items-center justify-between border-b border-border bg-card px-2 py-1.5 shrink-0 select-none z-30",children:[t("div",{className:"flex items-center",children:t(S,{variant:"ghost",size:"icon",onClick:b,className:"h-8 w-8 text-foreground hover:bg-accent cursor-pointer","aria-label":tp(),children:t(Gr,{className:"h-5 w-5"})})}),o("div",{className:"flex flex-1 items-center justify-center gap-1 min-w-0 px-1",children:[o("div",{className:"flex items-center min-w-0 max-w-[65vw]",children:[a&&o(B,{children:[t("span",{className:"truncate text-xs font-medium text-muted-foreground max-w-[80px]",children:a}),t("span",{className:"text-muted-foreground mx-1 text-xs",children:"/"})]}),l&&l.length>1?o(ge,{modal:!1,children:[t(Ae,{asChild:!0,children:o("button",{className:"flex items-center gap-1 min-w-0 truncate text-xs font-medium text-foreground hover:bg-accent rounded px-1 py-0.5 transition-colors cursor-pointer",children:[t("span",{className:"truncate max-w-[120px] font-semibold",children:i}),r!==void 0&&o(we,{variant:"outline",className:"px-1 py-0 text-[10px] shrink-0 font-normal",children:["v",r]}),t(be,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]})}),o(ye,{align:"center",className:"w-48 z-40",children:[t(Qr,{className:"text-xs",children:kd()}),l.map((s)=>o(W,{onClick:()=>Q?.(s.id),className:E("flex items-center justify-between text-xs cursor-pointer",s.id===D?"bg-accent font-semibold text-accent-foreground":""),children:[o("span",{children:["v",s.version]}),t("span",{className:"text-[11px] text-muted-foreground truncate max-w-[120px]",children:s.name||i})]},s.id))]})]}):o("div",{className:"flex items-center gap-1 min-w-0 truncate",children:[t("span",{className:"truncate text-xs font-semibold text-foreground max-w-[140px]",children:i}),r!==void 0&&o(we,{variant:"outline",className:"px-1 py-0 text-[10px] shrink-0 font-normal",children:["v",r]})]})]}),(f||_)&&o("div",{className:"flex items-center gap-0.5 shrink-0 bg-muted/60 rounded p-0.5 ml-1",children:[t(S,{variant:"ghost",size:"icon",disabled:!f,onClick:z,className:"h-5 w-5 p-0 text-muted-foreground hover:text-foreground disabled:opacity-30 cursor-pointer",title:Kh(),"aria-label":Kh(),children:t(Gr,{className:"h-3.5 w-3.5"})}),t(S,{variant:"ghost",size:"icon",disabled:!_,onClick:te,className:"h-5 w-5 p-0 text-muted-foreground hover:text-foreground disabled:opacity-30 cursor-pointer",title:Oh(),"aria-label":Oh(),children:t(pt,{className:"h-3.5 w-3.5"})})]})]}),t("div",{className:"flex items-center gap-1",children:o(ge,{modal:!1,children:[t(Ae,{asChild:!0,children:t(S,{variant:"ghost",size:"icon",className:"h-8 w-8 text-foreground hover:bg-accent cursor-pointer","aria-label":Ov(),children:t(wr,{className:"h-4 w-4"})})}),o(ye,{align:"end",className:"w-52 z-40",children:[v&&(fe?o(Qa,{children:[o(Va,{className:"flex items-center gap-2 text-xs cursor-pointer",children:[t(vt,{className:"h-3.5 w-3.5"}),t("span",{children:gr()})]}),t(Ga,{children:o(Ka,{className:"w-48 z-50",children:[t(Qr,{className:"text-xs",children:gr()}),y?.videoTranscodes?.map((s)=>{let P=Math.max(s.width,s.height),q=`${s.height}p`;if(P>=3840)q="2160p";else if(P>=1920)q="1080p";else if(P>=1280)q="720p";else if(P>=960)q="540p";else if(P>=640)q="360p";else if(P>=320)q="180p";return o(W,{onClick:()=>re(s.key),className:"flex items-center justify-between text-xs cursor-pointer",children:[t("span",{children:q}),t("span",{className:"text-[10px] text-muted-foreground",children:"MP4"})]},q)}),y?.originalKey&&o(B,{children:[t(Gt,{}),o(W,{onClick:()=>re(y.originalKey),className:"flex items-center justify-between text-xs cursor-pointer",children:[t("span",{children:bl?.()||"Original"}),t("span",{className:"text-[10px] text-muted-foreground",children:i.split(".").pop()?.toUpperCase()||"RAW"})]})]})]})})]}):o(W,{onClick:()=>y?.originalKey&&re(y.originalKey),disabled:!y?.originalKey,className:"flex items-center gap-2 text-xs cursor-pointer",children:[t(vt,{className:"h-3.5 w-3.5"}),t("span",{children:gr()})]})),l&&l.length>1&&Q&&o(Qa,{children:[t(Va,{className:"flex items-center gap-2 text-xs cursor-pointer",children:t("span",{children:kd?.()||"Switch version"})}),t(Ga,{children:o(Ka,{className:"w-48 z-50",children:[t(Qr,{className:"text-xs",children:kd?.()||"Switch version"}),l.map((s)=>o(W,{onClick:()=>Q(s.id),className:E("flex items-center justify-between text-xs cursor-pointer",s.id===D?"bg-accent font-semibold text-accent-foreground":""),children:[o("span",{children:["v",s.version]}),t("span",{className:"text-[10px] text-muted-foreground truncate max-w-[120px]",children:s.name||i})]},s.id))]})})]}),J&&o(W,{onClick:J,className:"flex items-center justify-between text-xs cursor-pointer",children:[o("span",{className:"flex items-center gap-2",children:[t(ko,{className:"h-3.5 w-3.5"}),t("span",{children:Lf?.()||"Linked Tasks"})]}),se>0&&t("span",{className:"inline-flex items-center justify-center px-1.5 py-0.2 text-[10px] font-semibold rounded-full bg-muted-foreground/15 text-foreground",children:se})]}),m&&j&&o(W,{onClick:j,className:"flex items-center gap-2 text-xs cursor-pointer",children:[t(Qe,{className:"h-3.5 w-3.5"}),t("span",{children:No()})]}),m&&p&&o(B,{children:[t(Gt,{}),o(W,{onClick:p,className:"flex items-center gap-2 text-xs text-destructive focus:text-destructive cursor-pointer",children:[t(ve,{className:"h-3.5 w-3.5"}),t("span",{children:at()})]})]})]})]})})]})}function Nl({projectId:i,teamId:a="",fileId:r,file:l,projectInfo:D,ancestorFolders:c=[],versions:I,activeFileId:v,startTime:y,isPublic:m=!1,shareId:b,allowDownload:z=!0,publicFields:te,siblingFiles:f=[],onNavigateToFile:_,onNavigateBack:Q,onRenameFile:j,onDeleteFile:p,onSaveField:J,onSelectVersion:se}){let{canEdit:re}=Pt(i),{members:fe}=Ur(),s=w(null),[P,q]=u(50),[ne,Ne]=u([]),[Ee,G]=u(0),[ze,Y]=u(null),[je,Pe]=u(!1),[Te,ee]=u(""),M=w(null),[he,X]=u(!1),[Ie,Fe]=u(!1),[Se,V]=u(!1),[ae,Ve]=u(!1),{data:_e}=Z({queryKey:["teams",a,"kanban","assets",v,"tasks"],queryFn:async()=>{if(!a||!v||m)return{data:[],total:0};let x=await A.api.teams[":teamId"].kanban.assets[":assetId"].tasks.$get({param:{teamId:a,assetId:v}});if(!x.ok)return{data:[],total:0};return await x.json()},enabled:!!a&&!!v&&!m}),Oe=_e?.total??_e?.data?.length??0,{prevFile:Re,nextFile:Le}=O(()=>{if(!f||f.length===0)return{prevFile:null,nextFile:null};let x=f.findIndex((ce)=>ce.id===r||ce.id===v);if(x===-1)return{prevFile:null,nextFile:null};return{prevFile:x>0?f[x-1]:null,nextFile:x<f.length-1?f[x+1]:null}},[f,r,v]),e=c.length>0?c[0]?.name:D?.name,k=I?.find((x)=>x.id===v)?.version??(I&&I.length>0?I.length:void 0),oe=O(()=>({originalKey:l.media?.original?.key,videoTranscodes:l.media?.videoTranscodes?.map((x)=>({key:x.key,width:x.width,height:x.height}))}),[l.media]),xe=()=>{Ne([]),Y(null)},Ce=(x)=>{Y(x.id||null);let ce=x.annotations;if(ce&&ce.length>0)Ne(ce);else Ne([]);if(x.second!==null&&x.second!==void 0)s.current?.seekTo(x.second),s.current?.pause();else if(ce&&ce.length>0)s.current?.pause()},le=async(x)=>{if(x?.preventDefault(),!Te.trim()||!j)return;try{Fe(!0),await j(Te.trim()),Pe(!1)}finally{Fe(!1)}},Be=async()=>{if(!p)return;try{X(!0),await p(),V(!1)}finally{X(!1)}};return h(()=>{G(0),Y(null),Ne([])},[l?.id]),o("div",{className:"flex h-[100dvh] w-full flex-col bg-background overflow-hidden relative",children:[t(Ye,{fileName:l.name,folderName:e,version:k,versions:I,activeFileId:v,isPublic:m,shareId:b,allowDownload:z,downloadInfo:oe,canEdit:re,onBack:Q,hasPrevFile:!!Re,hasNextFile:!!Le,onPrevFile:()=>Re&&_(Re.id),onNextFile:()=>Le&&_(Le.id),onSelectVersion:se,onRename:()=>{ee(l.name),Pe(!0)},onDelete:()=>V(!0),onLinkedTasks:!m?()=>Ve(!0):void 0,linkedTaskCount:Oe}),t("div",{className:"relative flex-1 min-h-0 bg-background overflow-hidden flex flex-col",children:t(ni,{file:l,mediaControllerRef:s,onPlay:xe,onTimeUpdate:G,annotations:ne,startTime:y,shareId:b,allowDownload:z})}),t(Ge,{teamId:a,projectId:i,file:l,onSaveField:J,members:fe,onCommentSelect:Ce,hideAnnotationControl:l.proxyType==="audio",readOnly:m||!re,publicFields:te,isPublic:m,shareId:b,currentTime:Ee,onTyping:()=>s.current?.pause(),selectedCommentId:ze,heightPercent:P,onHeightPercentChange:q}),!m&&ae&&t(Hd,{teamId:a,assetId:v,assetName:l.name,isOpen:ae,onClose:()=>Ve(!1)}),!m&&t(pe,{open:je,onOpenChange:Pe,children:t(ue,{children:o("form",{onSubmit:le,children:[t(me,{children:t(de,{children:No()})}),t("div",{className:"py-4",children:t(H,{ref:M,value:Te,onChange:(x)=>ee(x.target.value),placeholder:id?.()||"Enter new name",onFocus:()=>{setTimeout(()=>{if(M.current)ps(M.current)},0)},autoFocus:!0})}),o($e,{children:[t(S,{type:"button",variant:"outline",onClick:()=>Pe(!1),children:ke()}),o(S,{type:"submit",disabled:Ie||!Te.trim(),children:[Ie&&t(L,{className:"mr-2 h-4 w-4 animate-spin"}),Oo()]})]})]})})}),!m&&t(Je,{open:Se,onOpenChange:V,children:o(Xe,{children:[o(et,{children:[t(rt,{children:Oc?.()||"Delete Asset?"}),t(nt,{children:Nc?.()||"Deleted items can be recovered for 30 days before being permanently deleted."})]}),o(tt,{children:[t(st,{children:ke()}),o(ot,{onClick:Be,disabled:he,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[he&&t(L,{className:"mr-2 h-4 w-4 animate-spin"}),at()]})]})]})})]})}C();function We({activeState:i,activeAsset:a,previewUrl:r,isFullScreen:l,onTogglePlay:D,onToggleLoop:c,onSeek:I,onVolumeChange:v,onToggleMute:y,onChangePlaybackRate:m,onChangeResolution:b,onZoomIn:z,onZoomOut:te,onFit:f,onDownload:_,onToggleFullScreen:Q,allowDownload:j=!0}){if(i?.kind==="video"&&i.video&&a){let p=i.video,J=p.totalFrames/p.frameRate,se=p.currentFrame/p.frameRate,re={isPlaying:p.isPlaying,progress:J>0?se/J*100:0,currentTime:se,duration:J,volume:p.volume,isMuted:p.isMuted,isLooping:p.isLooping,playbackRate:p.playbackRate,isFullScreen:l,showFrames:!1,currentResolution:p.currentResolution},fe=r&&!a.media?.videoPreview?{...a,media:{...a.media,videoPreview:{url:r}}}:a;return t(ru,{state:re,zoom:i.zoom,isControlsVisible:!0,floatOverlayInFullScreen:!1,buffered:p.buffered,data:fe,resolutions:p.resolutions,togglePlay:D,toggleLoop:c,toggleMute:y,handleVolumeChange:v,changePlaybackRate:m,changeResolution:(s)=>b(s.resolution),handleDownload:(s)=>_(s),toggleFullScreen:Q,onZoomChange:(s)=>s>=i.zoom?z():te(),onZoomReset:f,frameRate:p.frameRate,totalFrames:p.totalFrames,currentFrame:p.currentFrame,seekToFrame:I,allowDownload:j})}if(i?.kind==="image")return t(nu,{zoom:i.zoom,onZoomIn:z,onZoomOut:te,onFit:f,onDownload:()=>_(),canDownload:!!a?.media?.original?.key,fullscreen:{isFullScreen:l,onToggle:Q},allowDownload:j});return t("div",{className:"relative z-10 flex items-center justify-end gap-2 border-t border-border bg-card px-4 py-3",children:t("button",{onClick:Q,className:"text-foreground transition-colors hover:text-primary",title:"Fullscreen",children:l?t(_a,{className:"h-5 w-5"}):t(ya,{className:"h-5 w-5"})})})}function Ke({side:i,fileName:a,version:r,activeVersionId:l,versions:D,isActive:c,onActivate:I,onSwitchVersion:v,onExit:y}){let m=E("flex-shrink-0 rounded p-1 transition-colors hover:bg-muted",c?"text-foreground":"text-muted-foreground hover:text-foreground"),b=t("button",{onClick:y,title:rb(),className:m,children:t(De,{className:"h-4 w-4"})}),z=o("button",{onClick:I,className:E("flex min-w-0 items-center gap-1 rounded px-2 py-1 text-sm font-medium transition-colors hover:bg-muted",c?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[t("span",{className:"truncate",children:a}),r!==void 0&&o("span",{className:E("flex-shrink-0 rounded border px-1 py-0 text-xs",c?"border-foreground/40":"border-border"),children:["v",r]})]}),te=o(ge,{children:[t(Ae,{onClick:I,title:kd(),className:m,children:t(be,{className:"h-4 w-4"})}),t(ye,{align:i==="left"?"start":"end",className:"w-80 p-1",children:t("div",{className:"flex max-h-96 flex-col gap-1 overflow-y-auto",children:D.map((f)=>{let _=f.id===l;return o(W,{onClick:()=>v(f.id),className:"flex cursor-pointer items-center gap-3 rounded-md px-3 py-2",children:[o("div",{className:"flex min-w-[2rem] flex-shrink-0 items-center justify-center rounded-full bg-muted px-2 py-0.5 text-xs font-semibold text-muted-foreground select-none",children:["v",f.version]}),t("div",{className:"flex h-10 w-16 flex-shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:f.previewUrl?t("img",{src:f.previewUrl,alt:f.name||void 0,className:"h-full w-full object-cover"}):t(Xt,{className:"h-4 w-4 text-muted-foreground"})}),o("div",{className:"flex min-w-0 flex-1 flex-col text-left",children:[t("span",{className:"truncate text-sm font-semibold text-foreground",children:f.name}),t("span",{className:"truncate text-xs text-muted-foreground",children:f.creator?.name||"Unknown"})]}),_&&t(Me,{className:"ml-auto h-4 w-4 flex-shrink-0 text-primary"})]},f.id)})})})]});return t("div",{onMouseDown:I,className:E("dark flex h-10 flex-shrink-0 items-center gap-1 border-b bg-background px-2 transition-colors",c?"border-b-2 border-primary":"border-border"),children:i==="left"?o(B,{children:[b,z,te]}):o(B,{children:[z,te,t("div",{className:"ml-auto"}),b]})})}function it(i,a,r){return Z({queryKey:a?["public-share-file",r,i,localStorage.getItem(`share_pwd_${r}`)||""]:["files",i],queryFn:async()=>{if(a){let D=localStorage.getItem(`share_pwd_${r}`)||"",c=await A.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:r,fileId:i}},{headers:{"x-share-password":D}});if(!c.ok)throw Error("Failed to fetch version asset");return await c.json()}let l=await A.api.files[":fileId"].$get({param:{fileId:i}});if(!l.ok)throw Error("Failed to fetch version asset");return await l.json()},enabled:!!i&&(!a||!!r)})}function Ol({isPublic:i=!1,shareId:a,versions:r,leftId:l,rightId:D,activeSide:c,annotations:I,seekRequest:v,onActiveSideChange:y,onSwitchVersion:m,onExit:b,onActiveAssetChange:z,onPlay:te,onTimeUpdate:f,allowDownload:_=!0}){let Q=w(null),j=w(null),p=w(null),[J,se]=u(null),[re,fe]=u(null),[s,P]=u(1),[q,ne]=u(!1),[Ne,Ee]=u(!1),{data:G,isLoading:ze}=it(l,i,a),{data:Y,isLoading:je}=it(D,i,a),Pe=fs(G),Te=fs(Y),ee=!!G&&!!Y&&Pe.id===Te.id,M=c==="left"?G:Y,he=c==="left"?J:re,X=N(()=>c==="left"?j.current:p.current,[c]),Ie=N(()=>c==="left"?p.current:j.current,[c]);h(()=>{z(M??null)},[M,z]),h(()=>{if(!v)return;let n=X();if(n?.seekToSecond(v.second),n?.pause(),ee){let g=Ie();g?.seekToSecond(v.second),g?.pause()}},[v?.nonce]),h(()=>{let n=()=>Ee(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",n),()=>document.removeEventListener("fullscreenchange",n)},[]);let Fe=N((n)=>se(n),[]),Se=N((n)=>fe(n),[]),V=N((n)=>{let g=X();if(g)n(g);if(ee){let F=Ie();if(F)n(F)}},[X,Ie,ee]),ae=N(()=>{let n=!he?.video?.isPlaying;V((g)=>n?g.play():g.pause())},[he?.video?.isPlaying,V]);h(()=>{let n=(g)=>{let F=document.activeElement;if(F&&(F.tagName==="INPUT"||F.tagName==="TEXTAREA"||F instanceof HTMLElement&&F.isContentEditable))return;let He=g.key===" ",Ue=F&&(F.tagName==="BUTTON"||F.tagName==="A"||F.tagName==="SELECT"||F.tagName==="OPTION"||F.getAttribute("role")==="button"||F.getAttribute("role")==="link"||F.getAttribute("role")==="checkbox"||F.getAttribute("role")==="radio"||F.getAttribute("role")==="menuitem");if(He&&Ue)return;if(g.key===" "||g.key.toLowerCase()==="k")g.preventDefault(),ae()};return window.addEventListener("keydown",n),()=>{window.removeEventListener("keydown",n)}},[ae]);let Ve=N((n)=>V((g)=>g.seekToFrame(n)),[V]),_e=N(()=>X()?.toggleLoop(),[X]),Oe=N((n)=>{P(n),ne(n===0)},[]),Re=N(()=>ne((n)=>!n),[]),Le=N((n)=>V((g)=>g.setPlaybackRate(n)),[V]),e=N((n)=>X()?.changeResolution(n),[X]),d=N(()=>V((n)=>n.zoomBy(1.2)),[V]),k=N(()=>V((n)=>n.zoomBy(0.8)),[V]),oe=N(()=>V((n)=>n.fit()),[V]),xe=N((n)=>{X()?.download(n)},[X]),Ce=N(()=>{let n=Q.current;if(!n||typeof n.requestFullscreen!=="function")return;if(!document.fullscreenElement)n.requestFullscreen().catch(()=>{});else if(document.exitFullscreen)document.exitFullscreen().catch(()=>{})},[]),le=N((n,g)=>{if(ee)p.current?.panBy(n,g)},[ee]),Be=N((n,g)=>{if(ee)j.current?.panBy(n,g)},[ee]),x=N(()=>ae(),[ae]),ce=N((n)=>r.find((g)=>g.id===n)?.version,[r]),lt=O(()=>M?.media?.videoPreview?.url,[M?.media?.videoPreview?.url]),Ze=(n,g)=>{let He=fs(g)?.comparePane;if(!He)return t("div",{className:"flex flex-1 items-center justify-center bg-gray-100 dark:bg-gray-950",children:t("p",{className:"text-muted-foreground",children:"Preview unavailable"})});let Ue=c===n;return t(He,{ref:n==="left"?j:p,file:g,shareId:a,isActive:Ue,annotations:Ue?I:[],onStateChange:n==="left"?Fe:Se,onUserPan:n==="left"?le:Be,onActivate:()=>y(n),muted:Ue?q:!0,volume:s,onPlay:te,onTimeUpdate:f,onRequestTogglePlay:x},g.id)},dt=!!G&&!!Y,mt=ze||je;return o("div",{ref:Q,className:"flex h-full flex-1 flex-col bg-background",children:[o("div",{className:"flex min-h-0 flex-1",children:[o("div",{className:"flex min-w-0 flex-1 flex-col border-r border-zinc-800",children:[G&&t(Ke,{side:"left",fileName:G.name,version:ce(l),activeVersionId:l,versions:r,isActive:c==="left",onActivate:()=>y("left"),onSwitchVersion:(n)=>m("left",n),onExit:b}),t("div",{className:"relative flex min-h-0 flex-1",children:G?Ze("left",G):t("div",{className:"flex flex-1 items-center justify-center",children:t(L,{className:"h-6 w-6 animate-spin text-foreground"})})})]}),o("div",{className:"flex min-w-0 flex-1 flex-col",children:[Y&&t(Ke,{side:"right",fileName:Y.name,version:ce(D),activeVersionId:D,versions:r,isActive:c==="right",onActivate:()=>y("right"),onSwitchVersion:(n)=>m("right",n),onExit:b}),t("div",{className:"relative flex min-h-0 flex-1",children:Y?Ze("right",Y):t("div",{className:"flex flex-1 items-center justify-center",children:t(L,{className:"h-6 w-6 animate-spin text-foreground"})})})]})]}),mt&&!dt&&t("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/30",children:t(L,{className:"h-8 w-8 animate-spin text-foreground"})}),t(We,{activeState:he,activeAsset:M??null,previewUrl:lt,isFullScreen:Ne,onTogglePlay:ae,onToggleLoop:_e,onSeek:Ve,onVolumeChange:Oe,onToggleMute:Re,onChangePlaybackRate:Le,onChangeResolution:e,onZoomIn:d,onZoomOut:k,onFit:oe,onDownload:xe,onToggleFullScreen:Ce,allowDownload:_})]})}
|
|
2
|
+
export{ni,Nl,Ol};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Wr}from"./chunk-mz0yjra0.js";import{ar}from"./chunk-579e4wv4.js";import{on,Na}from"./chunk-rchsme43.js";import{hc,Xi,Yt}from"./chunk-nr20tvnw.js";class g extends Error{code;diagnosticDetails;constructor(r,t,n){super(r);this.name="PiMessagesResponseError",this.code=t,this.diagnosticDetails=n}}function x(r){try{let t=JSON.parse(r),n=t?.error;return t&&typeof n==="object"&&n!==null&&!Array.isArray(n)?t:void 0}catch{return}}function m(r){return r.length>8192?`${r.slice(0,8192)}\u2026`:r}function y(r,t,n){let e=typeof n?.error?.message==="string"?n.error.message:void 0,s=typeof n?.error?.code==="string"?n.error.code:void 0,a=e??t,o=s?` (${s})`:"";return`${r.status} ${r.statusText}: ${a}${o}`}function w(r,t,n,e){let s=x(e),a=typeof s?.error?.code==="string"?s.error.code:void 0;return new g(y(n,e,s),a,{version:1,provider:r.provider,model:r.id,url:t.toString(),status:n.status,statusText:n.statusText,error:s?.error,body:s?void 0:m(e),timestampMs:Date.now()})}function h(){return{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}}}function l(r,t){if(!t)return;Xi(r,{type:"pi_messages_rewrite",timestamp:Date.now(),details:{...t}})}function b(r){let t={role:"assistant",content:[],api:r.api,provider:r.provider,model:r.id,usage:h(),stopReason:"stop",timestamp:Date.now()},n=new Map;return(e)=>{switch(e.type){case"done":return Object.assign(t,{stopReason:e.reason,usage:e.usage,responseId:e.responseId}),l(t,e.rewrite),{type:"done",reason:e.reason,message:t};case"error":return Object.assign(t,{stopReason:e.reason,usage:e.usage,errorMessage:e.errorMessage,responseId:e.responseId}),l(t,e.rewrite),{type:"error",reason:e.reason,error:t};case"start":break;case"text_start":t.content[e.contentIndex]={type:"text",text:""};break;case"text_delta":t.content[e.contentIndex].text+=e.delta;break;case"text_end":Object.assign(t.content[e.contentIndex],{text:e.content,textSignature:e.contentSignature});break;case"thinking_start":t.content[e.contentIndex]={type:"thinking",thinking:""};break;case"thinking_delta":t.content[e.contentIndex].thinking+=e.delta;break;case"thinking_end":Object.assign(t.content[e.contentIndex],{thinking:e.content,thinkingSignature:e.contentSignature,redacted:e.redacted});break;case"toolcall_start":t.content[e.contentIndex]={type:"toolCall",id:e.id,name:e.toolName,arguments:{}},n.set(e.contentIndex,"");break;case"toolcall_delta":{let s=`${n.get(e.contentIndex)??""}${e.delta}`;n.set(e.contentIndex,s),t.content[e.contentIndex].arguments=Wr(s);break}case"toolcall_end":return Object.assign(t.content[e.contentIndex],e.toolCall),n.delete(e.contentIndex),{type:"toolcall_end",contentIndex:e.contentIndex,toolCall:t.content[e.contentIndex],partial:t}}return{...e,partial:t}}}async function*I(r){let t=new TextDecoder,n=r.getReader(),e="";try{while(!0){let{done:s,value:a}=await n.read();e+=s?t.decode():t.decode(a,{stream:!0}),e=e.replace(/\r\n/g,`
|
|
3
|
+
`);let o=e.indexOf(`
|
|
4
|
+
|
|
5
|
+
`);while(o!==-1){let c=f(e.slice(0,o));if(c)yield c;e=e.slice(o+2),o=e.indexOf(`
|
|
6
|
+
|
|
7
|
+
`)}if(s)break}if(e.trim()){let s=f(e);if(s)yield s}}finally{n.releaseLock()}}function f(r){let t=r.split(`
|
|
8
|
+
`).find((n)=>n.startsWith("data:"))?.slice(5).trim();return t&&t!=="[DONE]"?JSON.parse(t):void 0}function k(r,t,n){let e=n?"aborted":"error",s={role:"assistant",content:[],api:r.api,provider:r.provider,model:r.id,usage:h(),stopReason:e,errorMessage:t instanceof Error?t.message:String(t),timestamp:Date.now()};if(!n&&t instanceof g)Xi(s,hc("pi_messages_response_failure",t,t.diagnosticDetails));return{type:"error",reason:e,error:s}}function E(r,t){if(r)return r;return ar("PI_CACHE_RETENTION",t)==="long"?"long":void 0}var R=(r,t,n)=>{let e=new Yt,s=b(r);return(async()=>{try{let a=n?.apiKey;if(!a)throw Error(`No API key provided for provider "${r.provider}"`);let o=new URL(`${r.baseUrl.replace(/\/+$/u,"")}/messages`);if(n?.debug)o.searchParams.set("debug","1");let c={model:r.id,context:t,options:{temperature:n?.temperature,maxTokens:n?.maxTokens,reasoning:n?.reasoning,cacheRetention:E(n?.cacheRetention,n?.env),sessionId:n?.sessionId,toolChoice:n?.toolChoice}},p=await n?.onPayload?.(c,r);if(p!==void 0)c=p;let i=await fetch(o,{method:"POST",headers:{authorization:`Bearer ${a}`,accept:"text/event-stream","content-type":"application/json",...Na(n?.headers)},body:JSON.stringify(c),signal:n?.signal});if(await n?.onResponse?.({status:i.status,headers:on(i.headers)},r),!i.ok){let d=await i.text();throw w(r,o,i,d)}if(!i.body)throw Error(`${r.provider} response has no body`);for await(let d of I(i.body)){let u=s(d);if(e.push(u),u.type==="done"||u.type==="error")return}throw Error(`${r.provider} stream ended without a terminal event`)}catch(a){e.push(k(r,a,n?.signal?.aborted??!1))}})(),e},P=(r,t,n)=>{let e=n;return R(r,t,{...n,reasoning:n?.reasoning,toolChoice:e?.toolChoice,debug:e?.debug})};export{g as PiMessagesResponseError,R as stream,P as streamSimple};
|