@shumai-one/shumai 0.1.9 → 0.2.0
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-09wp20mv.js +1 -0
- package/bin/{chunk-zd8tf4j1.js → chunk-2cmg5sfn.js} +1 -1
- package/bin/chunk-2s5a64nr.js +2 -0
- package/bin/chunk-33ee1cvv.js +2 -0
- package/bin/chunk-3m39v371.js +1 -0
- package/bin/{chunk-v1ax9cja.js → chunk-49ej1y67.js} +1 -1
- package/bin/{chunk-t1sv4zdb.js → chunk-4hnrd4qh.js} +2 -2
- package/bin/{chunk-e2ekkk1h.js → chunk-4kk5g619.js} +1 -1
- package/bin/chunk-4zq8vxcy.css +1 -0
- package/bin/{chunk-dh4tbp68.js → chunk-5tmf3c0g.js} +1 -1
- package/bin/chunk-6c4c7t0n.js +1 -0
- package/bin/chunk-6frqqxkv.js +1 -0
- package/bin/{chunk-by6reed2.js → chunk-6mn3jqm9.js} +1 -1
- package/bin/{chunk-22v60r4w.js → chunk-6r9w7z15.js} +1 -1
- package/bin/chunk-8s0ae37g.js +1 -0
- package/bin/{chunk-fjhbwem5.js → chunk-8wv3kdz9.js} +1 -1
- package/bin/{chunk-wsnrv2aa.js → chunk-ajqsprm0.js} +1 -1
- package/bin/{chunk-fybr479k.js → chunk-axx5bh38.js} +2 -2
- package/bin/{chunk-4ddrkmxq.js → chunk-cp18trqb.js} +1 -1
- package/bin/chunk-d0n8nxp3.js +3 -0
- package/bin/chunk-d22pyc5n.js +1 -0
- package/bin/chunk-dgx2zxze.js +320 -0
- package/bin/{chunk-62rqa4dq.js → chunk-e5833tbd.js} +1 -1
- package/bin/{chunk-9awf1xp6.js → chunk-frm7vz6v.js} +2 -2
- package/bin/{chunk-zyhr9ajx.js → chunk-fwf8yne2.js} +1 -1
- package/bin/chunk-g7wrxnmd.js +1 -0
- package/bin/{chunk-qzgkshc5.js → chunk-gk7158n4.js} +1 -1
- package/bin/chunk-hb5v9ees.js +2 -0
- package/bin/{chunk-2xx8j495.js → chunk-hdk93ghf.js} +1 -1
- package/bin/{chunk-qedhje78.js → chunk-j8q688sx.js} +1 -1
- package/bin/chunk-jrvrg4fx.js +1 -0
- package/bin/chunk-kef0rnwn.js +1 -0
- package/bin/{chunk-kqgfhhk4.js → chunk-kpy0kpna.js} +1 -1
- package/bin/{chunk-ej456cn5.js → chunk-m54p1cvp.js} +1 -1
- package/bin/{chunk-vqketj32.js → chunk-m7jfszqt.js} +1 -1
- package/bin/{chunk-mxwnzxmd.js → chunk-mnv6pj0k.js} +1 -1
- package/bin/chunk-nn8e9j7c.js +1 -0
- package/bin/chunk-nwtb6dt1.js +62 -0
- package/bin/{chunk-45yzs9sh.js → chunk-pf8edn5x.js} +1 -1
- package/bin/{chunk-vreyhvb6.js → chunk-pqm0g14r.js} +1 -1
- package/bin/chunk-ps4h3387.js +5 -0
- package/bin/chunk-q4f5vvtx.js +2 -0
- package/bin/{chunk-sj6fzxmd.js → chunk-r3n9zpfw.js} +1 -1
- package/bin/chunk-symna5cj.js +1 -0
- package/bin/chunk-twzgpwst.js +2 -0
- package/bin/chunk-vgvmt2m1.js +2 -0
- package/bin/{chunk-q9zn84ms.js → chunk-xpqcvxej.js} +2 -2
- package/bin/{chunk-2kp858g5.js → chunk-yk3k5g5w.js} +1 -1
- package/bin/{chunk-zxd1hrpf.js → chunk-z42cyc20.js} +1 -1
- package/bin/chunk-zsdwska1.js +1 -0
- package/bin/pdf.worker.min-szxdj13d.mjs +59109 -0
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +240 -217
- package/package.json +8 -7
- package/prisma/migrations/20260719042433_add_split_transcode_task_types/migration.sql +14 -0
- package/prisma/migrations/20260719132047_backfill_media_proxy_type/migration.sql +32 -0
- package/prisma/schema.prisma +6 -0
- package/bin/chunk-1rvy3h5v.js +0 -1
- package/bin/chunk-23ggq8gr.js +0 -1
- package/bin/chunk-2cqxd8de.js +0 -2
- package/bin/chunk-314ncj75.js +0 -2
- package/bin/chunk-749eqers.js +0 -1
- package/bin/chunk-abm6b5hq.js +0 -5
- package/bin/chunk-at2kt8kk.js +0 -1
- package/bin/chunk-dfsfh3pw.js +0 -2
- package/bin/chunk-dsnnmmd9.js +0 -62
- package/bin/chunk-e1gzv3p0.js +0 -2
- package/bin/chunk-f9v92x1z.js +0 -2
- package/bin/chunk-j8e6ytkh.css +0 -1
- package/bin/chunk-jdgf23w4.js +0 -1
- package/bin/chunk-jm7c1sd3.js +0 -1
- package/bin/chunk-jwdf5dkn.js +0 -1
- package/bin/chunk-m3eys85a.js +0 -1
- package/bin/chunk-n2n6etpd.js +0 -2
- package/bin/chunk-parn6mr0.js +0 -1
- package/bin/chunk-raxnhtb0.js +0 -2
- package/bin/chunk-s3eadfmq.js +0 -266
- package/bin/chunk-saq2g4j3.js +0 -1
- package/bin/chunk-ts1w9p9a.js +0 -1
- package/bin/chunk-ycx0497z.js +0 -1
- package/bin/chunk-ywzht1v9.js +0 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Yf as f}from"./chunk-
|
|
1
|
+
import{Yf as f}from"./chunk-mnv6pj0k.js";import{bg as b,cg as q}from"./chunk-nwtb6dt1.js";function z(){return q("div",{className:"flex h-screen flex-col bg-background min-h-0",children:[q("div",{className:"flex h-14 items-center justify-between border-b px-6 shrink-0",children:[q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-4 w-24"}),b("span",{className:"text-muted-foreground",children:"/"}),b(f,{className:"h-4 w-32"})]}),q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-8 w-8 rounded-md"}),b(f,{className:"h-8 w-20 rounded-md"})]})]}),q("div",{className:"flex flex-1 overflow-hidden",children:[q("div",{className:"w-[240px] border-r p-4 space-y-4 hidden md:block shrink-0",children:[q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-4 w-4 rounded"}),b(f,{className:"h-4 w-24"})]}),q("div",{className:"pl-4 space-y-3",children:[q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-3 w-3 rounded"}),b(f,{className:"h-3 w-28"})]}),q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-3 w-3 rounded"}),b(f,{className:"h-3 w-20"})]}),q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-3 w-3 rounded"}),b(f,{className:"h-3 w-24"})]})]})]}),q("div",{className:"flex-1 p-6 space-y-6 overflow-y-auto",children:[q("div",{className:"flex items-center justify-between border-b pb-4",children:[q("div",{className:"flex items-center gap-4",children:[b(f,{className:"h-5 w-40"}),b(f,{className:"h-4 w-20"})]}),q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-8 w-8 rounded"}),b(f,{className:"h-8 w-8 rounded"}),b(f,{className:"h-8 w-32 rounded"})]})]}),q("div",{className:"space-y-4",children:[b("div",{className:"flex items-center gap-2",children:b(f,{className:"h-4 w-24"})}),b("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",children:Array.from({length:10}).map((w,v)=>q("div",{className:"flex flex-col rounded-lg border bg-card p-3 space-y-3",children:[b(f,{className:"aspect-square w-full rounded-md"}),q("div",{className:"space-y-2",children:[b(f,{className:"h-4 w-3/4"}),q("div",{className:"flex justify-between items-center",children:[b(f,{className:"h-3 w-1/4"}),b(f,{className:"h-3 w-1/3"})]})]})]},v))})]})]})]})]})}function A(){return q("div",{className:"h-screen flex flex-col bg-background",children:[q("div",{className:"flex h-14 items-center justify-between border-b px-6 shrink-0",children:[q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-4 w-16"}),b("span",{className:"text-muted-foreground",children:"/"}),b(f,{className:"h-4 w-28"}),b("span",{className:"text-muted-foreground",children:"/"}),b(f,{className:"h-4 w-32"})]}),b("div",{className:"flex items-center gap-2",children:b(f,{className:"h-8 w-20 rounded"})})]}),q("div",{className:"flex flex-1 overflow-hidden",children:[q("div",{className:"w-[280px] border-r p-4 flex flex-col gap-4 shrink-0 hidden md:flex",children:[b(f,{className:"h-5 w-24"}),b("div",{className:"space-y-3 flex-1 overflow-y-auto",children:Array.from({length:4}).map((w,v)=>q("div",{className:"flex gap-3 p-2 rounded border",children:[b(f,{className:"h-12 w-12 rounded bg-muted shrink-0"}),q("div",{className:"space-y-2 flex-1",children:[b(f,{className:"h-3 w-2/3"}),b(f,{className:"h-2 w-1/2"})]})]},v))})]}),q("div",{className:"flex-1 bg-muted/20 p-6 flex flex-col justify-between relative min-w-0",children:[b("div",{className:"flex-1 flex items-center justify-center",children:b(f,{className:"w-full max-w-4xl aspect-video rounded-lg shadow-lg"})}),q("div",{className:"mt-4 flex items-center justify-between shrink-0",children:[q("div",{className:"flex items-center gap-4",children:[b(f,{className:"h-8 w-8 rounded-full"}),b(f,{className:"h-4 w-32"})]}),b(f,{className:"h-4 w-24"})]})]}),q("div",{className:"w-[360px] border-l p-4 flex flex-col gap-6 shrink-0 hidden lg:flex bg-card",children:[q("div",{className:"space-y-4",children:[b(f,{className:"h-5 w-32"}),b("div",{className:"space-y-3",children:Array.from({length:3}).map((w,v)=>q("div",{className:"flex justify-between items-center py-1 border-b",children:[b(f,{className:"h-3 w-20"}),b(f,{className:"h-3 w-32"})]},v))})]}),q("div",{className:"flex-1 flex flex-col gap-4",children:[b(f,{className:"h-5 w-24"}),b("div",{className:"space-y-3 flex-1 overflow-y-auto",children:Array.from({length:3}).map((w,v)=>q("div",{className:"flex gap-3 p-3 rounded-lg border bg-muted/10",children:[b(f,{className:"h-8 w-8 rounded-full shrink-0"}),q("div",{className:"space-y-2 flex-1",children:[q("div",{className:"flex justify-between",children:[b(f,{className:"h-3 w-24"}),b(f,{className:"h-2 w-12"})]}),b(f,{className:"h-3 w-full"}),b(f,{className:"h-3 w-5/6"})]})]},v))})]})]})]})]})}
|
|
2
2
|
export{z as Uf,A as Vf};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as q}from"./chunk-gk7158n4.js";import"./chunk-hb5v9ees.js";import"./chunk-ps4h3387.js";import"./chunk-dgx2zxze.js";import"./chunk-axx5bh38.js";import"./chunk-e5833tbd.js";import"./chunk-q4f5vvtx.js";import"./chunk-33ee1cvv.js";import"./chunk-kpy0kpna.js";import"./chunk-ajqsprm0.js";import"./chunk-xpqcvxej.js";import"./chunk-4hnrd4qh.js";import"./chunk-twzgpwst.js";import"./chunk-6mn3jqm9.js";import"./chunk-fwf8yne2.js";import"./chunk-cp18trqb.js";import"./chunk-8wv3kdz9.js";import"./chunk-j8q688sx.js";import"./chunk-pf8edn5x.js";import"./chunk-5a2maxwp.js";import"./chunk-4kk5g619.js";import"./chunk-mnv6pj0k.js";import{bg as f,sg as k}from"./chunk-nwtb6dt1.js";import"./chunk-kbzm1pwx.js";function w(){let{shareId:v}=A.useParams();return f(q,{shareId:v})}var A=k("/share/$shareId/")({component:w});export{A as Route};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as V}from"./chunk-vgvmt2m1.js";import"./chunk-49ej1y67.js";import"./chunk-2s5a64nr.js";import"./chunk-ps4h3387.js";import"./chunk-dgx2zxze.js";import"./chunk-axx5bh38.js";import"./chunk-e5833tbd.js";import"./chunk-q4f5vvtx.js";import"./chunk-33ee1cvv.js";import"./chunk-kpy0kpna.js";import"./chunk-ajqsprm0.js";import"./chunk-xpqcvxej.js";import"./chunk-4hnrd4qh.js";import{we as U}from"./chunk-yk3k5g5w.js";import"./chunk-fwf8yne2.js";import"./chunk-cp18trqb.js";import"./chunk-8wv3kdz9.js";import"./chunk-j8q688sx.js";import"./chunk-6r9w7z15.js";import"./chunk-pf8edn5x.js";import"./chunk-5a2maxwp.js";import"./chunk-4kk5g619.js";import{Uf as N}from"./chunk-5tmf3c0g.js";import"./chunk-mnv6pj0k.js";import{$f as Z,Eg as J,bg as q,fg as D,gg as G,ij as K,sg as H}from"./chunk-nwtb6dt1.js";import{Zj as Y}from"./chunk-kbzm1pwx.js";var W=Y(Z(),1);function _(){let{projectId:h}=$.useParams(),{teamId:v,ensureTeamIdForProject:w}=K();W.useEffect(()=>{w(h)},[h,w]);let{data:A}=G(U(h)),b=A?.rootFolder,{data:X}=D({queryKey:["folders",b],queryFn:async()=>{let B=await J.api.folders[":folderId"].$get({param:{folderId:b}});if(!B.ok)throw Error("failed to fetch folder");return await B.json()},enabled:!!b});if(!v||!b||!X)return q(N,{});return q(V,{teamId:v,projectId:h,projectName:A.name??"",assetId:b,rootFolderId:b})}var $=H("/projects/$projectId/")({component:_});export{$ as Route};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Pi as r,bg as o}from"./chunk-nwtb6dt1.js";function d({className:t,...a}){return o("div",{"data-slot":"card",className:r("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",t),...a})}function n({className:t,...a}){return o("div",{"data-slot":"card-header",className:r("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...a})}function c({className:t,...a}){return o("div",{"data-slot":"card-title",className:r("leading-none font-semibold",t),...a})}function s({className:t,...a}){return o("div",{"data-slot":"card-description",className:r("text-sm text-muted-foreground",t),...a})}function i({className:t,...a}){return o("div",{"data-slot":"card-content",className:r("px-6",t),...a})}function l({className:t,...a}){return o("div",{"data-slot":"card-footer",className:r("flex items-center px-6 [.border-t]:pt-6",t),...a})}
|
|
2
2
|
export{d as ye,n as ze,c as Ae,s as Be,i as Ce,l as De};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Eg as B,xg as F}from"./chunk-nwtb6dt1.js";var J=F((w,D)=>({metadata:{},isLoading:!1,error:null,fetchMetadata:async(A)=>{w({isLoading:!0,error:null});try{let h=await B.api.teams[":teamId"]["user-metadata"].$get({param:{teamId:A}});if(!h.ok)throw Error("failed to fetch user metadata");let C=(await h.json()).reduce((j,E)=>{return j[E.key]=E.value,j},{});w({metadata:C,isLoading:!1})}catch(h){w({error:h instanceof Error?h.message:String(h),isLoading:!1})}},setMetadata:async(A,h,q)=>{let C=D().metadata;w((j)=>({metadata:{...j.metadata,[h]:q}}));try{if(!(await B.api.teams[":teamId"]["user-metadata"][":key"].$put({param:{teamId:A,key:h},json:{value:q}})).ok)throw Error("failed to update user metadata")}catch(j){w({metadata:C}),console.error(j)}},getMetadata:(A,h)=>{let q=D().metadata[A];return q!==void 0?q:h}}));
|
|
2
2
|
export{J as Lf};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{P as lz}from"./chunk-e5833tbd.js";import{Za as a}from"./chunk-xpqcvxej.js";import{$a as Dz,_a as yz,ab as bz,bb as Cz,cb as fz,db as Iz,eb as gz,fb as uz}from"./chunk-4hnrd4qh.js";import{Kf as hz}from"./chunk-j8q688sx.js";import{Rf as c}from"./chunk-4kk5g619.js";import{$f as Xz,$g as Tz,Cg as Yz,Eg as X,Fg as Jz,Gg as Uz,Mg as Bz,Ng as zz,Pg as Wz,Pi as _z,Qg as $z,Ri as E,Si as Sz,Ti as Mz,Ui as vz,Vi as b,Xi as C,Yi as f,Zi as M,_h as Zz,ag as N,bg as z,cg as J,dg as x,fg as Vz,gg as Oz,gh as i,hg as k,hj as V,jj as wz,kj as n,lj as Rz,mj as Kz,ng as m,nj as kz,oj as qz,pi as Gz,pj as Az,qj as Ez,sg as Pz,wi as Lz}from"./chunk-nwtb6dt1.js";import{Zj as Qz}from"./chunk-kbzm1pwx.js";var K=Qz(Xz(),1);function Fz({open:Z,onOpenChange:$,mode:T,teamId:F,project:W}){let q=x(),R=m(),[H,O]=K.useState(""),[v,B]=K.useState(!0),[I,P]=K.useState(void 0),[h,U]=K.useState(void 0),[A,w]=K.useState(!1),S=K.useRef(null);K.useEffect(()=>{if(Z)if(T==="edit"&&W)O(W.name||""),P(W.coverImageKey),U(W.coverImage),B(W.enableNotification!==!1);else O(""),P(void 0),U(void 0),B(!0)},[Z,T,W]);let g=X.api.teams[":teamId"].projects.$post,{mutate:j}=k({mutationFn:async(Q)=>{let _=await g({param:{teamId:F},json:Q});if(!_.ok)throw Error(V.failed_create_project());return await _.json()},onSuccess:(Q)=>{q.invalidateQueries({queryKey:["teams",F,"projects"]}),$(!1);let _=Q;if(_&&typeof _.id==="string")R({to:"/projects/$projectId",params:{projectId:_.id}})}}),u=X.api.projects[":projectId"].$put,{mutate:y}=k({mutationFn:async(Q)=>{let _=await u({param:{projectId:W.id},json:Q});if(!_.ok)throw Error(V.failed_update_project());return await _.json()},onSuccess:()=>{q.invalidateQueries({queryKey:["teams",F,"projects"]}),$(!1)}}),r=X.api.teams[":teamId"].files.$post,{mutate:D}=k({mutationFn:async({file:Q})=>{let _=await r({param:{teamId:F},form:{file:Q}});if(!_.ok)throw Error(V.failed_upload_file());return await _.json()},onSuccess:(Q)=>{let _=Q;if(_&&typeof _.key==="string")P(_.key);w(!1)},onError:()=>{w(!1)}}),o=(Q)=>{let _=Q.target.files?.[0];if(_){w(!0);let e=URL.createObjectURL(_);U(e),D({file:_})}},t=()=>{S.current?.click()},s=(Q)=>{Q.stopPropagation(),P(void 0),U(void 0)},l=()=>{if(!H.trim())return;if(T==="create")j({name:H.trim(),coverImageKey:I,enableNotification:v});else if(T==="edit"&&W?.id)y({name:H.trim(),coverImageKey:I,enableNotification:v})};return z(Rz,{open:Z,onOpenChange:$,children:J(Kz,{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:[J(kz,{className:"relative overflow-hidden bg-gradient-to-br from-primary/5 to-transparent p-6 border-b border-border/40",children:[z("div",{className:"absolute top-0 right-0 w-24 h-24 bg-primary/10 rounded-full blur-2xl pointer-events-none"}),z("div",{className:"absolute bottom-0 left-10 w-32 h-12 bg-primary/5 rounded-full blur-xl pointer-events-none"}),z("div",{className:"flex items-center gap-3",children:J("div",{children:[z(Az,{className:"text-xl font-semibold tracking-tight text-foreground",children:T==="create"?V.create_new_project():V.project_settings()}),z(Ez,{className:"text-xs text-muted-foreground/80 mt-1",children:T==="create"?V.configure_new_project_description():V.manage_project_description()})]})})]}),J("div",{className:"space-y-6 p-6 max-h-[75vh] overflow-y-auto",children:[J("div",{className:"space-y-2",children:[z(c,{htmlFor:"name",className:"text-sm font-semibold tracking-tight text-foreground",children:V.project_name()}),J("div",{className:"relative",children:[z(n,{id:"name",value:H,onChange:(Q)=>O(Q.target.value),placeholder:V.project_name_placeholder(),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"}),H.trim()&&z("div",{className:"absolute inset-y-0 right-3 flex items-center",children:z(i,{className:"w-4 h-4 text-primary"})})]}),z("p",{className:"text-[11px] text-muted-foreground",children:V.project_name_hint()})]}),J("div",{className:"space-y-3 border-t border-border/40 pt-5",children:[J("div",{className:"flex items-center justify-between",children:[J(c,{className:"text-sm font-semibold tracking-tight text-foreground flex items-center gap-1.5",children:[z($z,{className:"w-4 h-4 text-primary"}),V.project_cover()]}),h&&J("button",{type:"button",onClick:s,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:[z(Lz,{className:"w-3.5 h-3.5"}),V.remove_cover()]})]}),J("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:t,children:[z("input",{type:"file",ref:S,className:"hidden",accept:"image/*",onChange:o}),A&&z("div",{className:"absolute inset-0 bg-background/70 backdrop-blur-xs flex flex-col items-center justify-center gap-2 z-20",children:J("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-background border rounded-full shadow-lg",children:[z(zz,{className:"w-4 h-4 animate-spin text-primary"}),z("span",{className:"text-xs font-semibold text-foreground",children:V.uploading()})]})}),h?J(N,{children:[z("img",{src:h,alt:V.cover_preview(),className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"}),J("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:[z(Gz,{className:"w-5 h-5 transform translate-y-1 group-hover:translate-y-0 transition-transform duration-300"}),z("span",{className:"text-xs font-semibold",children:V.upload_image()})]})]}):J("div",{className:"flex flex-col items-center gap-2 text-center p-4",children:[z("div",{className:"p-2.5 rounded-full bg-background border shadow-xs group-hover:scale-110 transition-transform duration-300",children:z(Gz,{className:"w-4 h-4 text-muted-foreground"})}),J("div",{children:[z("p",{className:"text-xs font-medium text-foreground",children:V.upload_cover()}),z("p",{className:"text-[11px] text-muted-foreground mt-0.5 max-w-[140px] mx-auto leading-normal",children:V.upload_cover_hint()})]})]})]})]}),J("div",{className:"space-y-3 border-t border-border/40 pt-5",children:[J(c,{className:"text-sm font-semibold tracking-tight text-foreground flex items-center gap-1.5",children:[z(Wz,{className:"w-4 h-4 text-primary"}),V.project_preferences()]}),J("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:[J("div",{className:"space-y-1 pr-4",children:[J("div",{className:"text-sm font-semibold flex items-center gap-2 text-foreground",children:[z(Tz,{className:"w-4 h-4 text-primary"}),V.activity_notifications()]}),z("p",{className:"text-xs text-muted-foreground leading-normal",children:V.activity_notifications_description()})]}),z(a,{checked:v,onCheckedChange:B,disabled:A,className:"mt-0.5"})]})]})]}),J(qz,{className:"flex items-center justify-end gap-3 px-6 py-4 bg-muted/20 border-t border-border/40",children:[z(E,{type:"button",variant:"ghost",onClick:()=>$(!1),disabled:A,className:"rounded-xl h-10 px-4 hover:bg-muted font-medium text-sm text-muted-foreground hover:text-foreground transition-colors",children:V.cancel()}),z(E,{type:"submit",onClick:l,disabled:!H.trim()||A,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:A?J(N,{children:[z(zz,{className:"w-4 h-4 animate-spin"}),V.processing()]}):T==="create"?V.create_project():V.save_changes()})]})]})})}function Nz({sortBy:Z,sortDirection:$,onSortChange:T}){let F=(H)=>{T(H,$)},W=()=>{T(Z,$==="asc"?"desc":"asc")},q=(H)=>{switch(H){case"name":return V.sort_name();case"created_at":return V.sort_created();case"updated_at":return V.sort_updated();default:return H}},R=$==="asc";return J(b,{children:[z(C,{asChild:!0,children:J(E,{variant:"outline",className:"gap-2 bg-muted/50",children:[z("span",{className:"text-muted-foreground",children:V.sorted_by_label()}),z("span",{className:"font-medium text-foreground",children:q(Z)})]})}),J(f,{align:"end",className:"w-56 p-2",children:[z("div",{className:"text-xs font-semibold text-muted-foreground mb-2 px-2",children:V.sort_by()}),J(b,{children:[z(C,{asChild:!0,children:J(E,{variant:"ghost",className:"w-full justify-between font-normal px-2 h-10 bg-muted/50 hover:bg-muted mb-2 border",children:[z("span",{children:q(Z)}),z(Jz,{className:"h-4 w-4 opacity-50"})]})}),z(f,{className:"w-52",children:["name","created_at","updated_at"].map((H)=>J(M,{onClick:()=>F(H),className:"justify-between",children:[q(H),Z===H&&z(i,{className:"h-4 w-4"})]},H))})]}),J(E,{variant:"ghost",className:"w-full justify-between font-normal px-2 h-10 bg-muted/50 hover:bg-muted border",onClick:W,children:[z("span",{className:"text-muted-foreground",children:Z==="name"?R?z(N,{children:V.sort_a_to_z()}):z(N,{children:V.sort_z_to_a()}):R?z(N,{children:V.sort_oldest_to_newest()}):z(N,{children:V.sort_newest_to_oldest()})}),R?z(Uz,{className:"h-4 w-4 opacity-50"}):z(Jz,{className:"h-4 w-4 opacity-50"})]})]})]})}var L=Qz(Xz(),1);function tz(){let{teamId:Z}=sz.useParams(),{canEdit:$,canAdmin:T}=wz(),F=m(),W=x(),[q,R]=L.useState(null),[H,O]=L.useState(!1),[v,B]=L.useState("create"),[I,P]=L.useState(void 0),[h,U]=L.useState(!1),[A,w]=L.useState(void 0),[S,g]=L.useState(""),[j,u]=L.useState(!1),[y,r]=L.useState("name"),[D,o]=L.useState("asc"),t=X.api.teams[":teamId"].projects.$get,{data:s}=Oz({queryKey:["teams",Z,"projects",y,D],queryFn:async()=>{let G=await t({param:{teamId:Z},query:{sortBy:y,sortDirection:D}});if(!G.ok)throw Error("Failed to fetch projects");return await G.json()}}),{data:l}=Vz({queryKey:["teams",Z,"members"],queryFn:async()=>{let G=await X.api.teams[":teamId"].members.$get({param:{teamId:Z},query:{}});if(!G.ok)throw Error("Failed to fetch members");return await G.json()}}),{data:Q}=Vz({queryKey:["teams",Z,"me"],queryFn:async()=>{let G=await X.api.teams[":teamId"].me.$get({param:{teamId:Z}});if(!G.ok)throw Error("Failed to fetch me");return await G.json()}}),_=X.api.teams[":teamId"].invite.$post,e=k({mutationFn:async(G)=>{let Y=await _(G);if(!Y.ok)throw Error("Failed to invite");return await Y.json()}}),d=k({mutationFn:async(G)=>{if(!(await X.api.projects[":projectId"].$delete({param:{projectId:G}})).ok)throw Error("Failed to delete project")},onSuccess:()=>{W.invalidateQueries({queryKey:["teams",Z,"projects"]})}}),dz=k({mutationFn:async(G)=>{let Y=await X.api.projects[":projectId"].$put({param:{projectId:G.id},json:{enableNotification:!G.enableNotification}});if(!Y.ok)throw Error("Failed to update project notification settings");return await Y.json()},onSuccess:()=>{W.invalidateQueries({queryKey:["teams",Z,"projects"]}),Yz.success(V.project_notification_updated())},onError:(G)=>{Yz.error(G instanceof Error?G.message:V.failed_update_project_notification())}}),Hz=()=>{B("create"),P(void 0),O(!0)},pz=()=>{R("create"),setTimeout(()=>{R(null)},100),setTimeout(()=>{Hz()},200)},cz=(G)=>{B("edit"),P(G),O(!0)},xz=(G)=>{w(G),g(""),U(!0)},mz=async()=>{if(A&&S==="delete")try{await d.mutateAsync(A.id),U(!1)}catch(G){console.error(G)}},iz=(G,Y)=>{if(Y.detail>1)return;R(G),setTimeout(()=>{R(null)},100),setTimeout(()=>{F({to:"/projects/$projectId",params:{projectId:G}})},200)},nz=async(G)=>{return(await e.mutateAsync({param:{teamId:Z},json:{role:G}})).code},az=k({mutationFn:async({userId:G,role:Y})=>{if(!(await X.api.teams[":teamId"].members[":userId"].$patch({param:{teamId:Z,userId:G},json:{role:Y}})).ok)throw Error("Failed to update member role")},onSuccess:()=>{W.invalidateQueries({queryKey:["teams",Z,"members"]})}}),jz=k({mutationFn:async(G)=>{if(!(await X.api.teams[":teamId"].members[":userId"].$delete({param:{teamId:Z,userId:G}})).ok)throw Error("Failed to remove member")},onSuccess:()=>{W.invalidateQueries({queryKey:["teams",Z,"members"]})}}),rz=(G)=>{if(!G)return"??";return G.split(" ").map((Y)=>Y[0]).slice(0,2).join("").toUpperCase()},oz=(G,Y)=>{r(G),o(Y)},p=Array.isArray(l)?l:[];return J("div",{className:"flex-1 overflow-y-auto p-4",children:[J("div",{className:"flex flex-wrap items-center justify-between mb-4 gap-4",children:[z("h1",{className:"text-2xl font-bold",children:V.projects()}),J("div",{className:"flex flex-wrap items-center gap-4",children:[J("div",{className:"flex items-center -space-x-2 cursor-pointer hover:opacity-90",onClick:()=>u(!0),children:[p.slice(0,3).map((G)=>J(Sz,{className:"border-2 border-background w-8 h-8",children:[G.image&&z(Mz,{src:G.image,alt:G.name,className:"object-cover"}),z(vz,{className:"text-[10px]",children:rz(G.name)})]},G.id)),p.length>3&&J("div",{className:"flex items-center justify-center w-8 h-8 rounded-full border-2 border-background bg-muted text-[10px] font-medium",children:["+",p.length-3]})]}),z(Nz,{sortBy:y,sortDirection:D,onSortChange:oz}),$&&J(E,{className:"bg-orange-600 hover:bg-orange-700 text-white gap-2",onClick:Hz,children:[z(Zz,{className:"w-4 h-4"}),V.create_project()]})]})]}),J("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:[s.data?.map((G)=>z("div",{className:_z("shadow-md relative border rounded-xl overflow-hidden cursor-pointer transition-transform duration-100 ease-in-out",q===G.id?"scale-95":"scale-100"),onClick:(Y)=>iz(G.id,Y),children:J("div",{className:"flex flex-col",children:[J("div",{className:"relative w-full h-full aspect-square flex items-center justify-center bg-zinc-400/20",children:[G.coverImage?z("img",{src:G.coverImage,alt:G.name,className:"w-full h-full object-cover rounded"}):J("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:[z("polygon",{fill:"#FC9F8E",points:"0 18.5 0 76.0 151.69 164.7 180.95 164.7 180.95 113.6"}),z("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"}),z("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"}),z("polygon",{fill:"#EC5B6C",points:"0 76.0 0 164.7 151.69 164.7"}),z("polygon",{fill:"#E85C71",points:"180.95 18.9 110.33 63.9 117.37 68.0 117.26 73.4 180.95 113.6"}),z("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"}),z("polygon",{fill:"#FFCCBE",points:"90.53 51.6 63.69 68.1 90.53 83.4"}),z("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"}),z("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"}),z("polygon",{fill:"#FFCFB5",points:"64.02 99.3 90.53 114.9 90.53 83.4"}),z("path",{fill:"#F67D73",d:"M 90.53 83.4 L 90.53 114.9 L 117.37 99.0 Z"}),z("path",{fill:"#F26560",d:"M 90.53 83.4 L 117.37 99.0 L 117.37 68.0 Z"}),z("polygon",{fill:"#EB5F5B",points:"80.08 67.5 90.53 73.5 90.53 61.3"}),z("polygon",{fill:"#DB4D50",points:"90.53 61.3 90.53 73.5 100.87 67.4"})]}),z("div",{className:"absolute bottom-0 left-0 w-full h-[65%] bg-linear-to-t from-black/35 to-black/0"}),z("p",{className:"absolute left-1 bottom-2 text-white",children:G.name})]}),J("div",{className:"px-2 h-10 flex justify-between items-center",children:[J("p",{className:"truncate pr-1 text-xs text-muted-foreground",children:[V.updated_ago()," ",hz(G.updatedAt??"")]}),z("div",{onClick:(Y)=>Y.stopPropagation(),children:J(b,{modal:!1,children:[z(C,{asChild:!0,children:z("button",{className:"hover:bg-muted outline-none flex px-1",children:z(Bz,{className:"w-5 h-5 text-muted-foreground"})})}),J(f,{align:"end",children:[$&&z(M,{onClick:(Y)=>{Y.stopPropagation(),cz(G)},children:V.project_settings()}),J(M,{className:"flex items-center justify-between gap-4 cursor-pointer",onSelect:(Y)=>{Y.preventDefault(),dz.mutate(G)},children:[z("span",{children:V.notification()}),z(a,{checked:G.enableNotification??!0,className:"pointer-events-none"})]}),T&&z(M,{className:"text-destructive focus:text-destructive",onClick:()=>xz(G),children:V.delete()})]})]})})]})]})},G.id)),$&&z("div",{className:_z("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",q==="create"?"scale-95":"scale-100"),onClick:pz,children:J("div",{className:"flex flex-col",children:[z("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:z(Zz,{className:"w-8 h-8 text-zinc-400 group-hover:text-orange-600 transition-colors"})}),z("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:z("p",{className:"text-sm text-muted-foreground group-hover:text-orange-600 transition-colors",children:V.create_project()})})]})})]}),z(Fz,{open:H,onOpenChange:O,mode:v,teamId:Z,project:I}),z(yz,{open:h,onOpenChange:U,children:J(Dz,{children:[J(bz,{children:[z(fz,{children:V.are_you_sure()}),J(Iz,{children:[V.delete_project_warning({name:A?.name??""}),J("div",{className:"mt-4 flex flex-col gap-2 text-foreground",children:[z("span",{className:"text-sm font-medium",children:V.type_delete_to_confirm()}),z(n,{value:S,onChange:(G)=>g(G.target.value),placeholder:V.delete_placeholder(),className:"h-9",autoFocus:!0})]})]})]}),J(Cz,{children:[z(uz,{disabled:d.isPending,children:V.cancel()}),z(gz,{onClick:(G)=>{G.preventDefault(),mz()},disabled:S!=="delete"||d.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:d.isPending?V.deleting():V.delete()})]})]})}),z(lz,{open:j,onOpenChange:u,title:V.team_members(),type:"team",members:p,isOwner:Q?.role==="owner",onInvite:nz,onUpdateRole:async(G,Y)=>{await az.mutateAsync({userId:G,role:Y})},onRemoveMember:async(G)=>{await jz.mutateAsync(G)},currentUserId:Q?.id})]})}var sz=Pz("/teams/$teamId/")({component:tz});export{sz as Route};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{$f as u,Cg as $,Eg as w,fg as z,wg as B,xg as J}from"./chunk-nwtb6dt1.js";import{Zj as b}from"./chunk-kbzm1pwx.js";var E=null,g=J((p)=>({projectState:null,setProjectState:(j)=>{if(E)clearTimeout(E),E=null;p({projectState:j})},clearProjectState:()=>{if(E)clearTimeout(E);E=setTimeout(()=>{p({projectState:null}),E=null},10)}}));var H=J((p)=>({isChatbotOpen:!1,setIsChatbotOpen:(j)=>p({isChatbotOpen:j}),isHistoryMode:!1,setIsHistoryMode:(j)=>p({isHistoryMode:j}),currentSessionId:null,setCurrentSessionId:(j)=>p({currentSessionId:j}),chatAssets:[],addAssets:(j)=>p((c)=>{let f=new Set(c.chatAssets.map((P)=>P.id)),F=j.filter((P)=>!f.has(P.id));return{chatAssets:[...c.chatAssets,...F]}}),removeAsset:(j)=>p((c)=>({chatAssets:c.chatAssets.filter((f)=>f.id!==j)})),clearAssets:()=>p({chatAssets:[]}),messages:[],setMessages:(j)=>p({messages:j}),historySessions:[],setHistorySessions:(j)=>p({historySessions:j}),isStreaming:!1,setIsStreaming:(j)=>p({isStreaming:j}),selectedAgentId:null,setSelectedAgentId:(j)=>p({selectedAgentId:j}),scrollTop:0,isAtBottom:!0,setScrollState:(j,c)=>p({scrollTop:j,isAtBottom:c}),fetchHistorySessions:async(j)=>{try{let c=await w.api.teams[":teamId"].chat.sessions.$get({param:{teamId:j},query:{first:"50"}});if(c.ok){let f=await c.json();p({historySessions:f.data||[]})}}catch(c){console.error("Failed to fetch history sessions:",c)}},loadSession:async(j,c)=>{try{let f=await w.api.teams[":teamId"].chat.sessions[":sessionId"].messages.$get({param:{teamId:j,sessionId:c}});if(f.ok){let F=await f.json(),T=H.getState().historySessions.find((O)=>O.id===c)?.agentId||null;p({currentSessionId:c,messages:F,isHistoryMode:!1,scrollTop:0,isAtBottom:!0,...T?{selectedAgentId:T}:{}})}else throw Error("Failed to load session messages")}catch(f){let F=f instanceof Error?f.message:"Failed to load session";$.error(F)}},deleteSession:async(j,c)=>{try{if((await w.api.teams[":teamId"].chat.sessions[":sessionId"].$delete({param:{teamId:j,sessionId:c}})).ok)$.success("Session deleted successfully"),p((F)=>({historySessions:F.historySessions.filter((P)=>P.id!==c),currentSessionId:F.currentSessionId===c?null:F.currentSessionId,messages:F.currentSessionId===c?[]:F.messages}));else throw Error("Failed to delete session")}catch(f){let F=f instanceof Error?f.message:"Failed to delete session";$.error(F)}},startNewSession:()=>{p({currentSessionId:null,messages:[],chatAssets:[],scrollTop:0,isAtBottom:!0})},sendMessage:async(j,c,f,F)=>{let P=H.getState();if(P.isStreaming)return;let T=`temp-${Date.now()}`,O={id:T,role:"user",content:[{type:"text",text:c}],timestamp:Date.now()},R=[...P.messages];if(P.chatAssets.length>0){let G={id:`temp-context-${Date.now()}`,role:"custom",customType:"context_display_info",details:{assets:P.chatAssets.map((k)=>({id:k.id,name:k.name,type:k.type}))},timestamp:Date.now()-1};R.push(G)}R.push(O),p({messages:R,isStreaming:!0,chatAssets:[],isAtBottom:!0});let v=P.chatAssets.map((K)=>K.id),Y=P.selectedAgentId;if(!Y){$.error("No agent selected");return}try{let K=await w.api.teams[":teamId"].chat.$post({param:{teamId:j},json:{agentId:Y,textPrompt:c,assetIds:v,sessionId:P.currentSessionId||void 0,contextAssetId:F,projectId:f}});if(!K.ok)throw Error("Failed to start chat");let G=K.headers.get("x-session-id");if(G&&!P.currentSessionId)p({currentSessionId:G});let k=K.body?.getReader();if(!k)throw Error("No stream body");let U=new TextDecoder,V="";while(!0){let{done:A,value:y}=await k.read();if(A)break;V+=U.decode(y,{stream:!0});let Z=V.split(`
|
|
2
2
|
`);V=Z.pop()||"";for(let C of Z){let W=C.trim();if(!W)continue;if(W.startsWith("data: ")){let M=W.slice(6);try{let Q=JSON.parse(M);if(Q.type==="session"){if(!H.getState().currentSessionId)p({currentSessionId:Q.sessionId})}else if(Q.type==="entry"){let D=Q.entry;p((_)=>{let h=_.messages.some((q)=>q.id===D.id),X=_.messages.filter((q)=>{if(D.role==="user"&&!h)return!(q.id.startsWith("temp-")&&!q.id.startsWith("temp-context-"));if(D.role==="custom"&&D.customType==="context_display_info"&&!h)return!q.id.startsWith("temp-context-");return!0}),N=X.findIndex((q)=>q.id===D.id);if(N!==-1){let q=[...X];return q[N]=D,{messages:q}}else return{messages:[...X,D]}})}else if(Q.type==="done"){if(Q.status==="failed")$.error(Q.error||"Workflow failed")}}catch(Q){console.error("Error parsing SSE line:",Q)}}}}H.getState().fetchHistorySessions(j)}catch(K){let G=K instanceof Error?K.message:"Failed to send message";$.error(G),p((k)=>({messages:k.messages.filter((U)=>U.id!==T)}))}finally{p({isStreaming:!1})}},abortActiveSession:async(j)=>{let{currentSessionId:c,isStreaming:f}=H.getState();if(!c||!f)return;try{if((await w.api.teams[":teamId"].chat.sessions[":sessionId"].abort.$post({param:{teamId:j,sessionId:c}})).ok)$.success("Agent execution stopped");else throw Error("Failed to abort agent execution")}catch(F){let P=F instanceof Error?F.message:"Failed to abort execution";$.error(P)}}}));var L=b(u(),1);function S(p){let j=p.match(/teams\/([^/]+)/);if(j)return{teamId:j[1]};let c=p.match(/projects\/([^/]+)/);if(c)return{projectId:c[1]};return{}}function t(){let[p,j]=L.useState(),c=B({select:(T)=>T.location.pathname}),{teamId:f,projectId:F}=S(c),{data:P}=z({queryKey:["projects",F,"team"],queryFn:async()=>{let T=await w.api.projects[":projectId"].team.$get({param:{projectId:F}});if(!T.ok)throw Error("failed to fetch project team");return await T.json()},enabled:!!F});return L.useEffect(()=>{if(f)j(f);else if(P?.teamId)j(P.teamId)},[f,P]),p}
|
|
3
3
|
export{t as lf,g as mf,H as nf};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ii as o,Pi as t,bg as r,cg as i}from"./chunk-nwtb6dt1.js";function m({className:e,children:l,...a}){return i(o.Root,{"data-slot":"scroll-area",className:t("relative",e),...a,children:[r(o.Viewport,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:l}),r(c,{}),r(o.Corner,{})]})}function c({className:e,orientation:l="vertical",...a}){return r(o.ScrollAreaScrollbar,{"data-slot":"scroll-area-scrollbar",orientation:l,className:t("flex touch-none p-px transition-colors select-none",l==="vertical"&&"h-full w-2.5 border-l border-l-transparent",l==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...a,children:r(o.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}
|
|
2
2
|
export{m as Xa,c as Ya};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{W as v}from"./chunk-314ncj75.js";import{Aa as D2,Ba as x2,Ca as _5,Da as h5,Ea as g5,Fa as m5,Ga as k1,Ha as P1,Ia as O1,Ja as b5,Ka as c5,La as X2,Ma as e5,Na as $1,Oa as J1,Pa as h,Qa as Y2,Ra as T1,Sa as Z1,ha as _,ia as T2,ja as S5,ka as _0,la as S2,ma as f5,na as f2,pa as y2,ra as E2,sa as E5,ta as I5,ua as D5,va as x5,wa as j5,xa as y5,ya as v5,za as I2}from"./chunk-kqgfhhk4.js";import{fb as m0}from"./chunk-q9zn84ms.js";import{lf as K2}from"./chunk-fjhbwem5.js";import{Af as W0,Ff as P2,pf as S0,qf as y,vf as K5}from"./chunk-qedhje78.js";import{Rf as F0}from"./chunk-e2ekkk1h.js";import{$i as C1,Ag as Y5,Dh as q1,Eh as B1,Gg as T0,Ii as f0,Mh as W1,Ri as a0,Sg as H1,Ti as e,Ug as K1,Ui as L0,Vi as R0,Wi as A0,Xi as L1,Zi as R1,_i as A1,ai as c2,bg as l,cg as Q2,dg as H,eg as R,ei as z1,fg as Q1,fi as G1,gh as N1,ih as H2,jg as b2,jh as w0,jj as I,kh as W5,ki as r0,kj as g0,lh as z5,li as M1,ni as U1,pi as F1,qh as G5,ti as w1,ui as V1,yi as V0,zg as n0}from"./chunk-dsnnmmd9.js";import{Zj as d}from"./chunk-kbzm1pwx.js";var r2=Symbol.for("immer-nothing"),l2=Symbol.for("immer-draftable"),b=Symbol.for("immer-state");function u($,...J){throw Error(`[Immer] minified error nr: ${$}. Full error at: https://bit.ly/3cXEKWf`)}var C0=Object.getPrototypeOf;function B0($){return!!$&&!!$[b]}function X0($){if(!$)return!1;return a2($)||Array.isArray($)||!!$[l2]||!!$.constructor?.[l2]||O0($)||p0($)}var v1=Object.prototype.constructor.toString(),p2=new WeakMap;function a2($){if(!$||typeof $!=="object")return!1;let J=Object.getPrototypeOf($);if(J===null||J===Object.prototype)return!0;let Z=Object.hasOwnProperty.call(J,"constructor")&&J.constructor;if(Z===Object)return!0;if(typeof Z!=="function")return!1;let X=p2.get(Z);if(X===void 0)X=Function.toString.call(Z),p2.set(Z,X);return X===v1}function c0($,J,Z=!0){if(l0($)===0)(Z?Reflect.ownKeys($):Object.keys($)).forEach((Y)=>{J(Y,$[Y],$)});else $.forEach((X,Y)=>J(Y,X,$))}function l0($){let J=$[b];return J?J.type_:Array.isArray($)?1:O0($)?2:p0($)?3:0}function W2($,J){return l0($)===2?$.has(J):Object.prototype.hasOwnProperty.call($,J)}function t2($,J,Z){let X=l0($);if(X===2)$.set(J,Z);else if(X===3)$.add(Z);else $[J]=Z}function _1($,J){if($===J)return $!==0||1/$===1/J;else return $!==$&&J!==J}function O0($){return $ instanceof Map}function p0($){return $ instanceof Set}function Z0($){return $.copy_||$.base_}function z2($,J){if(O0($))return new Map($);if(p0($))return new Set($);if(Array.isArray($))return Array.prototype.slice.call($);let Z=a2($);if(J===!0||J==="class_only"&&!Z){let X=Object.getOwnPropertyDescriptors($);delete X[b];let Y=Reflect.ownKeys(X);for(let N=0;N<Y.length;N++){let Q=Y[N],K=X[Q];if(K.writable===!1)K.writable=!0,K.configurable=!0;if(K.get||K.set)X[Q]={configurable:!0,writable:!0,enumerable:K.enumerable,value:$[Q]}}return Object.create(C0($),X)}else{let X=C0($);if(X!==null&&Z)return{...$};let Y=Object.create(X);return Object.assign(Y,$)}}function w2($,J=!1){if(i0($)||B0($)||!X0($))return $;if(l0($)>1)Object.defineProperties($,{set:b0,add:b0,clear:b0,delete:b0});if(Object.freeze($),J)Object.values($).forEach((Z)=>w2(Z,!0));return $}function h1(){u(2)}var b0={value:h1};function i0($){if($===null||typeof $!=="object")return!0;return Object.isFrozen($)}var g1={};function Y0($){let J=g1[$];if(!J)u(0,$);return J}var k0;function e2(){return k0}function m1($,J){return{drafts_:[],parent_:$,immer_:J,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function i2($,J){if(J)Y0("Patches"),$.patches_=[],$.inversePatches_=[],$.patchListener_=J}function G2($){M2($),$.drafts_.forEach(b1),$.drafts_=null}function M2($){if($===k0)k0=$.parent_}function n2($){return k0=m1(k0,$)}function b1($){let J=$[b];if(J.type_===0||J.type_===1)J.revoke_();else J.revoked_=!0}function o2($,J){J.unfinalizedDrafts_=J.drafts_.length;let Z=J.drafts_[0];if($!==void 0&&$!==Z){if(Z[b].modified_)G2(J),u(4);if(X0($)){if($=u0(J,$),!J.parent_)d0(J,$)}if(J.patches_)Y0("Patches").generateReplacementPatches_(Z[b].base_,$,J.patches_,J.inversePatches_)}else $=u0(J,Z,[]);if(G2(J),J.patches_)J.patchListener_(J.patches_,J.inversePatches_);return $!==r2?$:void 0}function u0($,J,Z){if(i0(J))return J;let X=$.immer_.shouldUseStrictIteration(),Y=J[b];if(!Y)return c0(J,(N,Q)=>s2($,Y,J,N,Q,Z),X),J;if(Y.scope_!==$)return J;if(!Y.modified_)return d0($,Y.base_,!0),Y.base_;if(!Y.finalized_){Y.finalized_=!0,Y.scope_.unfinalizedDrafts_--;let N=Y.copy_,Q=N,K=!1;if(Y.type_===3)Q=new Set(N),N.clear(),K=!0;if(c0(Q,(G,z)=>s2($,Y,N,G,z,Z,K),X),d0($,N,!1),Z&&$.patches_)Y0("Patches").generatePatches_(Y,Z,$.patches_,$.inversePatches_)}return Y.copy_}function s2($,J,Z,X,Y,N,Q){if(Y==null)return;if(typeof Y!=="object"&&!Q)return;let K=i0(Y);if(K&&!Q)return;if(B0(Y)){let G=N&&J&&J.type_!==3&&!W2(J.assigned_,X)?N.concat(X):void 0,z=u0($,Y,G);if(t2(Z,X,z),B0(z))$.canAutoFreeze_=!1;else return}else if(Q)Z.add(Y);if(X0(Y)&&!K){if(!$.immer_.autoFreeze_&&$.unfinalizedDrafts_<1)return;if(J&&J.base_&&J.base_[X]===Y&&K)return;if(u0($,Y),(!J||!J.scope_.parent_)&&typeof X!=="symbol"&&(O0(Z)?Z.has(X):Object.prototype.propertyIsEnumerable.call(Z,X)))d0($,Y)}}function d0($,J,Z=!1){if(!$.parent_&&$.immer_.autoFreeze_&&$.canAutoFreeze_)w2(J,Z)}function c1($,J){let Z=Array.isArray($),X={type_:Z?1:0,scope_:J?J.scope_:e2(),modified_:!1,finalized_:!1,assigned_:{},parent_:J,base_:$,draft_:null,copy_:null,revoke_:null,isManual_:!1},Y=X,N=V2;if(Z)Y=[X],N=P0;let{revoke:Q,proxy:K}=Proxy.revocable(Y,N);return X.draft_=K,X.revoke_=Q,K}var V2={get($,J){if(J===b)return $;let Z=Z0($);if(!W2(Z,J))return u1($,Z,J);let X=Z[J];if($.finalized_||!X0(X))return X;if(X===q2($.base_,J))return B2($),$.copy_[J]=F2(X,$);return X},has($,J){return J in Z0($)},ownKeys($){return Reflect.ownKeys(Z0($))},set($,J,Z){let X=$5(Z0($),J);if(X?.set)return X.set.call($.draft_,Z),!0;if(!$.modified_){let Y=q2(Z0($),J),N=Y?.[b];if(N&&N.base_===Z)return $.copy_[J]=Z,$.assigned_[J]=!1,!0;if(_1(Z,Y)&&(Z!==void 0||W2($.base_,J)))return!0;B2($),U2($)}if($.copy_[J]===Z&&(Z!==void 0||(J in $.copy_))||Number.isNaN(Z)&&Number.isNaN($.copy_[J]))return!0;return $.copy_[J]=Z,$.assigned_[J]=!0,!0},deleteProperty($,J){if(q2($.base_,J)!==void 0||J in $.base_)$.assigned_[J]=!1,B2($),U2($);else delete $.assigned_[J];if($.copy_)delete $.copy_[J];return!0},getOwnPropertyDescriptor($,J){let Z=Z0($),X=Reflect.getOwnPropertyDescriptor(Z,J);if(!X)return X;return{writable:!0,configurable:$.type_!==1||J!=="length",enumerable:X.enumerable,value:Z[J]}},defineProperty(){u(11)},getPrototypeOf($){return C0($.base_)},setPrototypeOf(){u(12)}},P0={};c0(V2,($,J)=>{P0[$]=function(){return arguments[0]=arguments[0][0],J.apply(this,arguments)}});P0.deleteProperty=function($,J){return P0.set.call(this,$,J,void 0)};P0.set=function($,J,Z){return V2.set.call(this,$[0],J,Z,$[0])};function q2($,J){let Z=$[b];return(Z?Z0(Z):$)[J]}function u1($,J,Z){let X=$5(J,Z);return X?"value"in X?X.value:X.get?.call($.draft_):void 0}function $5($,J){if(!(J in $))return;let Z=C0($);while(Z){let X=Object.getOwnPropertyDescriptor(Z,J);if(X)return X;Z=C0(Z)}return}function U2($){if(!$.modified_){if($.modified_=!0,$.parent_)U2($.parent_)}}function B2($){if(!$.copy_)$.copy_=z2($.base_,$.scope_.immer_.useStrictShallowCopy_)}var d1=class{constructor($){if(this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(J,Z,X)=>{if(typeof J==="function"&&typeof Z!=="function"){let N=Z;Z=J;let Q=this;return function(G=N,...z){return Q.produce(G,(M)=>Z.call(this,M,...z))}}if(typeof Z!=="function")u(6);if(X!==void 0&&typeof X!=="function")u(7);let Y;if(X0(J)){let N=n2(this),Q=F2(J,void 0),K=!0;try{Y=Z(Q),K=!1}finally{if(K)G2(N);else M2(N)}return i2(N,X),o2(Y,N)}else if(!J||typeof J!=="object"){if(Y=Z(J),Y===void 0)Y=J;if(Y===r2)Y=void 0;if(this.autoFreeze_)w2(Y,!0);if(X){let N=[],Q=[];Y0("Patches").generateReplacementPatches_(J,Y,N,Q),X(N,Q)}return Y}else u(1,J)},this.produceWithPatches=(J,Z)=>{if(typeof J==="function")return(Q,...K)=>this.produceWithPatches(Q,(G)=>J(G,...K));let X,Y;return[this.produce(J,Z,(Q,K)=>{X=Q,Y=K}),X,Y]},typeof $?.autoFreeze==="boolean")this.setAutoFreeze($.autoFreeze);if(typeof $?.useStrictShallowCopy==="boolean")this.setUseStrictShallowCopy($.useStrictShallowCopy);if(typeof $?.useStrictIteration==="boolean")this.setUseStrictIteration($.useStrictIteration)}createDraft($){if(!X0($))u(8);if(B0($))$=l1($);let J=n2(this),Z=F2($,void 0);return Z[b].isManual_=!0,M2(J),Z}finishDraft($,J){let Z=$&&$[b];if(!Z||!Z.isManual_)u(9);let{scope_:X}=Z;return i2(X,J),o2(void 0,X)}setAutoFreeze($){this.autoFreeze_=$}setUseStrictShallowCopy($){this.useStrictShallowCopy_=$}setUseStrictIteration($){this.useStrictIteration_=$}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches($,J){let Z;for(Z=J.length-1;Z>=0;Z--){let Y=J[Z];if(Y.path.length===0&&Y.op==="replace"){$=Y.value;break}}if(Z>-1)J=J.slice(Z+1);let X=Y0("Patches").applyPatches_;if(B0($))return X($,J);return this.produce($,(Y)=>X(Y,J))}};function F2($,J){let Z=O0($)?Y0("MapSet").proxyMap_($,J):p0($)?Y0("MapSet").proxySet_($,J):c1($,J);return(J?J.scope_:e2()).drafts_.push(Z),Z}function l1($){if(!B0($))u(10,$);return J5($)}function J5($){if(!X0($)||i0($))return $;let J=$[b],Z,X=!0;if(J){if(!J.modified_)return J.base_;J.finalized_=!0,Z=z2($,J.scope_.immer_.useStrictShallowCopy_),X=J.scope_.immer_.shouldUseStrictIteration()}else Z=z2($,!0);if(c0(Z,(Y,N)=>{t2(Z,Y,J5(N))},X),J)J.finalized_=!1;return Z}var p1=new d1,Z5=p1.produce;var i1=($)=>(J,Z,X)=>{return X.setState=(Y,N,...Q)=>{let K=typeof Y==="function"?Z5(Y):Y;return J(K,N,...Q)},$(X.setState,Z,X)},X5=i1;var o0=n0()(Y5(X5(($,J)=>({members:[],loading:!1,fetchMembers:async(Z,X,Y)=>{if(!Y&&J().loadedTeamId===Z&&J().loadedWithAgents===X)return;$({loading:!0});try{let N=await T0.api.teams[":teamId"].members.$get({param:{teamId:Z},query:{includeAgents:X?"true":"false"}});if(!N.ok)throw Error("failed to fetch members");let Q=await N.json();$({members:Q||[],loadedTeamId:Z,loadedWithAgents:X,loading:!1})}catch{$({loading:!1})}}}))));var Q5=n0(($)=>({fields:[],loadedProjectId:null,setFields:(J,Z)=>$({fields:J,loadedProjectId:Z}),updateFields:(J)=>$({fields:J})}));function L2($,J,Z){let X=y($,Z?.in);if(isNaN(J))return S0(Z?.in||$,NaN);if(!J)return X;let Y=X.getDate(),N=S0(Z?.in||$,X.getTime());N.setMonth(X.getMonth()+J+1,0);let Q=N.getDate();if(Y>=Q)return N;else return X.setFullYear(N.getFullYear(),N.getMonth(),Y),X}function H5($,J){let Z=y($,J?.in),X=Z.getMonth();return Z.setFullYear(Z.getFullYear(),X+1,0),Z.setHours(23,59,59,999),Z}function N5($,J){let[Z,X]=K5($,J.start,J.end);return{start:Z,end:X}}function q5($,J){let{start:Z,end:X}=N5(J?.in,$),Y=+Z>+X,N=Y?+Z:+X,Q=Y?X:Z;Q.setHours(0,0,0,0);let K=J?.step??1;if(!K)return[];if(K<0)K=-K,Y=!Y;let G=[];while(+Q<=N)G.push(S0(Z,Q)),Q.setDate(Q.getDate()+K),Q.setHours(0,0,0,0);return Y?G.reverse():G}function s0($,J){return y($,J?.in).getDate()}function B5($,J){return y($,J?.in).getDay()}function R2($,J){return y($,J?.in).getHours()}function A2($,J){return y($,J?.in).getMinutes()}function C2($,J){return y($,J?.in).getMonth()}function k2($,J){return y($,J?.in).getFullYear()}var r=d(l(),1);var n1=({value:$,config:J,onSave:Z,readOnly:X})=>{let Y=J?.date,[N,Q]=r.useState(!1),K=r.useRef(null),G=$?new Date($):new Date,z=W0(G)?G:new Date,[M,U]=r.useState(z);r.useEffect(()=>{if(N&&$){let q=new Date($);if(W0(q))U(q)}},[N,$]),r.useEffect(()=>{let q=(C)=>{if(K.current&&!K.current.contains(C.target)){if(N)Q(!1)}};return document.addEventListener("mousedown",q),()=>document.removeEventListener("mousedown",q)},[N]);let W=()=>{if(!X)Q(!0)},w=(q)=>{if(!q)return"";let C=new Date(q);if(!W0(C))return"Invalid Date";let T="PPP";if(Y?.displayFormat==="usa")T="MM/dd/yyyy";else if(Y?.displayFormat==="euro")T="dd/MM/yyyy";else if(Y?.displayFormat==="iso")T="yyyy-MM-dd";if(Y?.includeTime)if(Y?.timeFormat==="twenty_four_hour")T+=" HH:mm";else T+=" p";let D=P2(C,T);if(Y?.displayTimezone)D+=` (${Intl.DateTimeFormat().resolvedOptions().timeZone})`;return D},B=new Date(M.getFullYear(),M.getMonth(),1),O=H5(M),P=q5({start:B,end:O}),A=B5(B),S=(q)=>{let C=new Date(q);if(Y?.includeTime)C.setHours(R2(z)),C.setMinutes(A2(z));let T=C.toISOString();if(Z(T),!Y?.includeTime)Q(!1)},F=(q,C)=>{let T=$?new Date($):new Date;if(!W0(T))T.setTime(new Date().getTime());if(q==="hour")T.setHours(C);if(q==="minute")T.setMinutes(C);let D=T.toISOString();Z(D)},L=Array.from({length:24},(q,C)=>C),V=Array.from({length:12},(q,C)=>C*5);if(N)return R("div",{className:"relative w-full",ref:K,children:[H("div",{className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm shadow-sm min-h-[28px] flex items-center",children:$?w($):H("span",{className:"text-muted-foreground",children:"Select date..."})}),R("div",{className:"absolute z-50 top-full left-0 mt-1 bg-popover border border-border rounded-lg shadow-xl flex flex-col md:flex-row overflow-hidden min-w-[280px]",children:[R("div",{className:"p-4 w-64",children:[R("div",{className:"flex justify-between items-center mb-4",children:[H("button",{onClick:()=>U(L2(M,-1)),className:"p-1 hover:bg-accent rounded",children:H(W5,{className:"w-4 h-4"})}),H("span",{className:"font-semibold text-sm",children:P2(M,"MMMM yyyy")}),H("button",{onClick:()=>U(L2(M,1)),className:"p-1 hover:bg-accent rounded",children:H(z5,{className:"w-4 h-4"})})]}),H("div",{className:"grid grid-cols-7 gap-1 text-center text-xs mb-2 text-muted-foreground",children:["Su","Mo","Tu","We","Th","Fr","Sa"].map((q)=>H("div",{children:q},q))}),R("div",{className:"grid grid-cols-7 gap-1 text-center text-sm",children:[Array.from({length:A}).map((q,C)=>H("div",{},`empty-${C}`)),P.map((q)=>{let C=$?new Date($):null,T=C&&W0(C)&&s0(C)===s0(q)&&C2(C)===C2(q)&&k2(C)===k2(q);return H("button",{onClick:()=>S(q),className:`w-8 h-8 rounded-full flex items-center justify-center hover:bg-accent transition-colors ${T?"bg-primary text-primary-foreground hover:bg-primary/90":"text-foreground"}`,children:s0(q)},q.toString())})]})]}),Y?.includeTime&&R("div",{className:"border-l border-border bg-muted w-32 flex flex-col",children:[R("div",{className:"p-2 border-b border-border text-xs font-semibold text-muted-foreground flex items-center justify-center gap-1",children:[H(G5,{className:"w-3 h-3"})," Time"]}),R("div",{className:"flex flex-1 h-64",children:[H("div",{className:"flex-1 overflow-y-auto scrollbar-hide border-r border-border",children:L.map((q)=>H("div",{onClick:()=>F("hour",q),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${R2(z)===q?"bg-primary/10 font-medium text-primary":""}`,children:q.toString().padStart(2,"0")},q))}),H("div",{className:"flex-1 overflow-y-auto scrollbar-hide",children:V.map((q)=>H("div",{onClick:()=>F("minute",q),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${A2(z)===q?"bg-primary/10 font-medium text-primary":""}`,children:q.toString().padStart(2,"0")},q))})]})]})]})]});return H("div",{onClick:W,className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded border border-transparent transition-colors ${!X?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:$?w($):H("span",{className:"text-muted-foreground italic",children:"Empty"})})},M5=n1;var p=d(l(),1);var o1=({value:$,onSave:J,readOnly:Z})=>{let[X,Y]=p.useState(!1),[N,Q]=p.useState($||""),K=p.useRef(null),G=p.useRef(null),[z,M]=p.useState(!1);p.useEffect(()=>{Q($||"")},[$]),p.useEffect(()=>{if(X&&K.current)K.current.focus(),M(!1)},[X]),p.useEffect(()=>{let B=(O)=>{if(z&&G.current&&!G.current.contains(O.target))M(!1)};if(z)document.addEventListener("mousedown",B);return()=>{document.removeEventListener("mousedown",B)}},[z]);let U=()=>{Y(!1),J(N)},W=(B)=>{B.stopPropagation(),M(!0)},w=(B)=>{if(B.stopPropagation(),!Z)Y(!0)};if(X)return H("textarea",{ref:K,value:N,onChange:(B)=>Q(B.target.value),onBlur:U,className:"w-full min-h-[80px] p-2 border border-ring rounded bg-background text-sm outline-none shadow-sm resize-none"});return R("div",{ref:G,className:"relative w-full text-sm",children:[H("div",{onClick:W,className:`w-full text-foreground rounded border border-transparent transition-all px-2 py-1 line-clamp-2 max-h-[3rem] overflow-hidden ${!Z?"cursor-pointer hover:bg-accent hover:border-border":"cursor-pointer"}`,title:"Click to expand",children:$?$:H("span",{className:"text-muted-foreground italic",children:"Empty"})}),z&&H("div",{onClick:w,className:`absolute top-0 left-0 w-full min-h-full h-auto z-50 bg-background border border-ring rounded shadow-lg px-2 py-1 whitespace-pre-wrap ${!Z?"cursor-text":""}`,children:$?$:H("span",{className:"text-muted-foreground italic",children:"Empty"})})]})},U5=o1;var a=d(l(),1);var s1=({value:$,config:J,onSave:Z,readOnly:X})=>{let Y=J?.number,[N,Q]=a.useState(!1),[K,G]=a.useState(""),z=a.useRef(null);a.useEffect(()=>{G($!==void 0&&$!==null?$.toString():"")},[$]),a.useEffect(()=>{if(N&&z.current)z.current.focus()},[N]);let M=()=>{if(!X)Q(!0)},U=()=>{if(Q(!1),K==="")Z(void 0);else{let B=parseFloat(K);Z(isNaN(B)?void 0:B)}},W=(B)=>{if(B.key==="Enter")B.stopPropagation(),z.current?.blur()},w=(B)=>{if(B===void 0||B===null||isNaN(B))return"";return B.toFixed(Y?.scale)};if(N)return H("input",{ref:z,type:"number",step:1/Math.pow(10,Y?.scale||0),value:K,onChange:(B)=>G(B.target.value),onBlur:U,onKeyDown:W,onDoubleClick:(B)=>B.stopPropagation(),className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm outline-none shadow-sm text-left font-mono"});return H("div",{onClick:M,onDoubleClick:(B)=>B.stopPropagation(),className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded border border-transparent transition-colors text-left font-mono ${!X?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:$!==void 0&&$!==null?w($):H("span",{className:"text-muted-foreground italic font-sans text-left block",children:"Empty"})})},F5=s1;var w5=d(l(),1);var r1=({value:$,config:J,onSave:Z,readOnly:X})=>{let Y=J?.rating,N=Math.max(2,Math.min(6,Y?.maxValue||5)),[Q,K]=w5.useState(null),G=(M,U)=>{if(M.stopPropagation(),X)return;let W;if($===U)W=0;else W=U;Z(W)},z=Array.from({length:N},(M,U)=>U+1);return H("div",{className:"flex items-center gap-1 h-[28px]",onMouseLeave:()=>!X&&K(null),onDoubleClick:(M)=>M.stopPropagation(),children:z.map((M)=>{let U=Q!==null?M<=Q:M<=($||0);return H("button",{onClick:(W)=>G(W,M),onMouseEnter:()=>!X&&K(M),className:`focus:outline-none transition-transform ${!X?"cursor-pointer hover:scale-110":"cursor-default"}`,type:"button",disabled:X,children:H(r0,{className:`w-5 h-5 transition-colors ${U?"fill-yellow-400 text-yellow-400":"fill-muted text-muted-foreground/30"}`})},M)})})},V5=r1;var S1=d(l(),1);function i({...$}){return H(f0.Root,{"data-slot":"popover",...$})}function n({...$}){return H(f0.Trigger,{"data-slot":"popover-trigger",...$})}function o({className:$,align:J="center",sideOffset:Z=4,...X}){return H(f0.Portal,{children:H(f0.Content,{"data-slot":"popover-content",align:J,sideOffset:Z,className:a0("z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",$),...X})})}var Q0;(function($){$.Base32IncorrectEncoding="B32_ENC_INVALID",$.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",$.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",$.EncodeTimeNegative="ENC_TIME_NEG",$.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",$.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",$.PRNGDetectFailure="PRNG_DETECT",$.ULIDInvalid="ULID_INVALID",$.Unexpected="UNEXPECTED",$.UUIDInvalid="UUID_INVALID"})(Q0||(Q0={}));class z0 extends Error{constructor($,J){super(`${J} (${$})`);this.name="ULIDError",this.code=$}}function a1($){let J=Math.floor($()*32)%32;return"0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(J)}function t1($){let J=e1(),Z=J&&(J.crypto||J.msCrypto)||null;if(typeof Z?.getRandomValues==="function")return()=>{let X=new Uint8Array(1);return Z.getRandomValues(X),X[0]/256};else if(typeof Z?.randomBytes==="function")return()=>Z.randomBytes(1).readUInt8()/256;throw new z0(Q0.PRNGDetectFailure,"Failed to find a reliable PRNG")}function e1(){if(Z4())return self;if(typeof window<"u")return window;if(typeof global<"u")return global;if(typeof globalThis<"u")return globalThis;return null}function $4($,J){let Z="";for(;$>0;$--)Z=a1(J)+Z;return Z}function J4($,J=10){if(isNaN($))throw new z0(Q0.EncodeTimeValueMalformed,`Time must be a number: ${$}`);else if($>281474976710655)throw new z0(Q0.EncodeTimeSizeExceeded,`Cannot encode a time larger than 281474976710655: ${$}`);else if($<0)throw new z0(Q0.EncodeTimeNegative,`Time must be positive: ${$}`);else if(Number.isInteger($)===!1)throw new z0(Q0.EncodeTimeValueMalformed,`Time must be an integer: ${$}`);let Z,X="";for(let Y=J;Y>0;Y--)Z=$%32,X="0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(Z)+X,$=($-Z)/32;return X}function Z4(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function L5($,J){let Z=J||t1(),X=!$||isNaN($)?Date.now():$;return J4(X,10)+$4(16,Z)}var h0=d(l(),1);var{create:X4,defineProperty:u5,defineProperties:Y4,getOwnPropertyDescriptor:Q4,getOwnPropertyDescriptors:H4,getOwnPropertySymbols:Z2}=Object,d5=Object.prototype.hasOwnProperty,l5=Object.prototype.propertyIsEnumerable,K4=($,J)=>(J=Symbol[$])?J:Symbol.for("Symbol."+$),y0=($)=>{throw TypeError($)},j2=($,J,Z)=>(J in $)?u5($,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):$[J]=Z,R5=($,J)=>{for(var Z in J||(J={}))if(d5.call(J,Z))j2($,Z,J[Z]);if(Z2){for(var Z of Z2(J))if(l5.call(J,Z))j2($,Z,J[Z])}return $},A5=($,J)=>Y4($,H4(J)),N4=($,J)=>{var Z={};for(var X in $)if(d5.call($,X)&&J.indexOf(X)<0)Z[X]=$[X];if($!=null&&Z2){for(var X of Z2($))if(J.indexOf(X)<0&&l5.call($,X))Z[X]=$[X]}return Z},q4=($)=>{var J;return[,,,X4((J=void 0)!=null?J:null)]},p5=["class","method","getter","setter","accessor","field","value","get","set"],I0=($)=>$!==void 0&&typeof $!=="function"?y0("Function expected"):$,B4=($,J,Z,X,Y)=>({kind:p5[$],name:J,metadata:X,addInitializer:(N)=>Z._?y0("Already initialized"):Y.push(I0(N||null))}),W4=($,J)=>j2(J,K4("metadata"),$[3]),t0=($,J,Z,X)=>{for(var Y=0,N=$[J>>1],Q=N&&N.length;Y<Q;Y++)J&1?N[Y].call(Z):X=N[Y].call(Z,X);return X},i5=($,J,Z,X,Y,N)=>{var Q,K,G,z,M,U=J&7,W=!1,w=!1,B=$.length+1,O=p5[U+5],P=$[B-1]=[],A=$[B]||($[B]=[]),S=(Y=Y.prototype,Q4({get[Z](){return D0(this,N)},set[Z](L){return H0(this,N,L)}},Z));for(var F=X.length-1;F>=0;F--)if(z=B4(U,Z,G={},$[3],A),z.static=W,z.private=w,M=z.access={has:(L)=>(Z in L)},M.get=(L)=>L[Z],M.set=(L,V)=>L[Z]=V,K=(0,X[F])({get:S.get,set:S.set},z),G._=1,K===void 0)I0(K)&&(S[O]=K);else if(typeof K!=="object"||K===null)y0("Object expected");else I0(Q=K.get)&&(S.get=Q),I0(Q=K.set)&&(S.set=Q),I0(Q=K.init)&&P.unshift(Q);return S&&u5(Y,Z,S),Y},n5=($,J,Z)=>J.has($)||y0("Cannot "+Z),D0=($,J,Z)=>(n5($,J,"read from private field"),J.get($)),E0=($,J,Z)=>J.has($)?y0("Cannot add the same private member more than once"):J instanceof WeakSet?J.add($):J.set($,Z),H0=($,J,Z,X)=>(n5($,J,"write to private field"),J.set($,Z),Z);function K0($){return $ instanceof g2||$ instanceof r5}var e0=10,z4=class extends y2{constructor($){super($);let J=S5(()=>{let{dragOperation:X}=$;if(!x2(X.activatorEvent))return;if(!K0(X.source))return;if(X.status.initialized){let Y=$.registry.plugins.get(m5);if(Y)return Y.disable(),()=>Y.enable()}}),Z=$.monitor.addEventListener("dragmove",(X,Y)=>{queueMicrotask(()=>{if(this.disabled||X.defaultPrevented||!X.nativeEvent)return;let{dragOperation:N}=Y;if(!x2(X.nativeEvent))return;if(!K0(N.source))return;if(!N.shape)return;let{actions:Q,collisionObserver:K,registry:G}=Y,{by:z}=X;if(!z)return;let M=G4(z),{source:U,target:W}=N,{center:w}=N.shape.current,B=[],O=[];_(()=>{for(let V of G.droppables){let{id:q}=V;if(!V.accepts(U)||q===(W==null?void 0:W.id)&&K0(V)||!V.element)continue;let C=V.shape,T=new D2(V.element,{getBoundingClientRect:(D)=>I5(D,void 0,0.2)});if(!T.height||!T.width)continue;if(M=="down"&&w.y+e0<T.center.y||M=="up"&&w.y-e0>T.center.y||M=="left"&&w.x-e0>T.center.x||M=="right"&&w.x+e0<T.center.x)B.push(V),V.shape=T,O.push(()=>V.shape=C)}}),X.preventDefault(),K.disable();let P=K.computeCollisions(B,h5);_(()=>O.forEach((V)=>V()));let[A]=P;if(!A)return;let{id:S}=A,{index:F,group:L}=U.sortable;Q.setDropTarget(S).then(()=>{let{source:V,target:q,shape:C}=N;if(!V||!K0(V)||!C)return;let{index:T,group:D,target:x}=V.sortable,g=F!==T||L!==D,m=g?x:q==null?void 0:q.element;if(!m)return;y5(m);let k=new D2(m);if(!k)return;let f=f2.delta(k,f2.from(C.current.boundingRectangle),V.alignment);if(Q.move({by:f}),g)Q.setDropTarget(V.id).then(()=>K.enable());else K.enable()})})});this.destroy=()=>{Z(),J()}}};function G4($){let{x:J,y:Z}=$;if(J>0)return"right";else if(J<0)return"left";else if(Z>0)return"down";else if(Z<0)return"up"}var{defineProperty:M4,defineProperties:U4,getOwnPropertyDescriptors:F4,getOwnPropertySymbols:C5}=Object,w4=Object.prototype.hasOwnProperty,V4=Object.prototype.propertyIsEnumerable,k5=($,J,Z)=>(J in $)?M4($,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):$[J]=Z,G0=($,J)=>{for(var Z in J||(J={}))if(w4.call(J,Z))k5($,Z,J[Z]);if(C5){for(var Z of C5(J))if(V4.call(J,Z))k5($,Z,J[Z])}return $},M0=($,J)=>U4($,F4(J));function L4($,J,Z){if(J===Z)return $;let X=$.slice();return X.splice(Z,0,X.splice(J,1)[0]),X}function O2($){return"initialIndex"in $&&typeof $.initialIndex==="number"&&"index"in $&&typeof $.index==="number"}function R4($,J,Z){var X,Y,N;let{source:Q,target:K,canceled:G}=J.operation;if(!Q||!K||G){if("preventDefault"in J)J.preventDefault();return $}let z=(L,V)=>L===V||typeof L==="object"&&("id"in L)&&L.id===V;if(Array.isArray($)){let L=$.findIndex((q)=>z(q,Q.id)),V=$.findIndex((q)=>z(q,K.id));if(L===-1||V===-1){if(O2(Q)){let{initialIndex:q,index:C}=Q;if(q===C||q<0||q>=$.length){if("preventDefault"in J)J.preventDefault();return $}return Z($,q,C)}return $}if(!G&&"index"in Q&&typeof Q.index==="number"){let q=Q.index;if(q!==L)return Z($,L,q)}return Z($,L,V)}let M=Object.entries($),U=-1,W,w=-1,B;for(let[L,V]of M){if(U===-1){if(U=V.findIndex((q)=>z(q,Q.id)),U!==-1)W=L}if(w===-1){if(w=V.findIndex((q)=>z(q,K.id)),w!==-1)B=L}if(U!==-1&&w!==-1)break}if(U===-1&&O2(Q)){let{initialGroup:L,initialIndex:V,group:q,index:C}=Q;if(L==null||q==null||!(L in $)||!(q in $)){if("preventDefault"in J)J.preventDefault();return $}if(L===q&&V===C){if("preventDefault"in J)J.preventDefault();return $}if(L===q)return M0(G0({},$),{[L]:Z($[L],V,C)});let T=$[L][V];return M0(G0({},$),{[L]:[...$[L].slice(0,V),...$[L].slice(V+1)],[q]:[...$[q].slice(0,C),T,...$[q].slice(C)]})}if(!Q.manager)return $;let{dragOperation:O}=Q.manager,P=(Y=(X=O.shape)==null?void 0:X.current.center)!=null?Y:O.position.current;if(B==null){if(K.id in $){let L=K.shape&&P.y>K.shape.center.y?$[K.id].length:0;B=K.id,w=L}}if(W==null||B==null||W===B&&U===w){if(W!=null&&W===B&&U===w&&O2(Q)){let L=Q.group!=null&&Q.group!==W,V=Q.index!==U;if(L||V){let q=(N=Q.group)!=null?N:W;if(q in $){if(W===q)return M0(G0({},$),{[W]:Z($[W],U,Q.index)});let C=$[W][U];return M0(G0({},$),{[W]:[...$[W].slice(0,U),...$[W].slice(U+1)],[q]:[...$[q].slice(0,Q.index),C,...$[q].slice(Q.index)]})}}}if("preventDefault"in J)J.preventDefault();return $}if(W===B)return M0(G0({},$),{[W]:Z($[W],U,w)});let S=K.shape&&Math.round(P.y)>Math.round(K.shape.center.y)?1:0,F=$[W][U];return M0(G0({},$),{[W]:[...$[W].slice(0,U),...$[W].slice(U+1)],[B]:[...$[B].slice(0,w+S),F,...$[B].slice(w+S)]})}function A4($,J){return R4($,J,L4)}var P5="__default__",C4=class extends y2{constructor($){super($);let J=()=>{let X=new Map;for(let Y of $.registry.droppables)if(Y instanceof g2){let{sortable:N}=Y,{group:Q}=N,K=X.get(Q);if(!K)K=new Set,X.set(Q,K);K.add(N)}for(let[Y,N]of X)X.set(Y,new Set($2(N)));return X},Z=[$.monitor.addEventListener("dragover",(X,Y)=>{if(this.disabled)return;let{dragOperation:N}=Y,{source:Q,target:K}=N;if(!K0(Q)||!K0(K))return;if(Q.sortable===K.sortable)return;let G=J(),z=Q.sortable.group===K.sortable.group,M=G.get(Q.sortable.group),U=z?M:G.get(K.sortable.group);if(!M||!U)return;queueMicrotask(()=>{if(X.defaultPrevented)return;Y.renderer.rendering.then(()=>{var W,w,B;let O=J();for(let[x,g]of G.entries()){let m=Array.from(g).entries();for(let[k,f]of m)if(f.index!==k||f.group!==x||!((W=O.get(x))==null?void 0:W.has(f)))return}let P=Q.sortable.element,A=K.sortable.element;if(!A||!P)return;if(!z&&K.id===Q.sortable.group)return;let S=$2(M),F=z?S:$2(U),L=(w=Q.sortable.group)!=null?w:P5,V=(B=K.sortable.group)!=null?B:P5,q={[L]:S,[V]:F},C=A4(q,X);if(q===C)return;let T=C[V].indexOf(Q.sortable),D=C[V].indexOf(K.sortable);Y.collisionObserver.disable(),O5(P,T,A,D),_(()=>{for(let[x,g]of C[L].entries())g.index=x;if(!z)for(let[x,g]of C[V].entries())g.group=K.sortable.group,g.index=x}),Y.actions.setDropTarget(Q.id).then(()=>Y.collisionObserver.enable())})})}),$.monitor.addEventListener("dragend",(X,Y)=>{if(!X.canceled)return;let{dragOperation:N}=Y,{source:Q}=N;if(!K0(Q))return;if(Q.sortable.initialIndex===Q.sortable.index&&Q.sortable.initialGroup===Q.sortable.group)return;queueMicrotask(()=>{let K=J(),G=K.get(Q.sortable.initialGroup);if(!G)return;Y.renderer.rendering.then(()=>{for(let[w,B]of K.entries()){let O=Array.from(B).entries();for(let[P,A]of O)if(A.index!==P||A.group!==w)return}let z=$2(G),M=Q.sortable.element,U=z[Q.sortable.initialIndex],W=U==null?void 0:U.element;if(!U||!W||!M)return;O5(M,U.index,W,Q.index),_(()=>{for(let[w,B]of K.entries()){let O=Array.from(B).values();for(let P of O)P.index=P.initialIndex,P.group=P.initialGroup}})})})})];this.destroy=()=>{for(let X of Z)X()}}};function O5($,J,Z,X){let Y=X<J?"afterend":"beforebegin";Z.insertAdjacentElement(Y,$)}function k4($,J){return $.index-J.index}function $2($){return Array.from($).sort(k4)}var T5=[z4,C4],v2={duration:250,easing:"cubic-bezier(0.25, 1, 0.5, 1)",idle:!1},J2=new f5,o5,s5,t,_2,x0,j0,h2,U0;s5=[S2],o5=[S2];var v0=class{constructor($,J){E0(this,_2,t0(t,8,this)),t0(t,11,this),E0(this,x0),E0(this,j0),E0(this,h2,t0(t,12,this)),t0(t,15,this),E0(this,U0),this.register=()=>{return _(()=>{var W,w;(W=this.manager)==null||W.registry.register(this.droppable),(w=this.manager)==null||w.registry.register(this.draggable)}),()=>this.unregister()},this.unregister=()=>{_(()=>{var W,w;(W=this.manager)==null||W.registry.unregister(this.droppable),(w=this.manager)==null||w.registry.unregister(this.draggable)})},this.destroy=()=>{_(()=>{this.droppable.destroy(),this.draggable.destroy()})};var Z=$,{effects:X=()=>[],group:Y,index:N,sensors:Q,type:K,transition:G=v2,plugins:z}=Z,M=N4(Z,["effects","group","index","sensors","type","transition","plugins"]);let U=E2(z,T5);this.droppable=new g2(M,J,this),this.draggable=new r5(A5(R5({},M),{plugins:U,effects:()=>[()=>{var W,w,B;let O=(W=this.manager)==null?void 0:W.dragOperation.status;if((O==null?void 0:O.initializing)&&this.id===((B=(w=this.manager)==null?void 0:w.dragOperation.source)==null?void 0:B.id))J2.clear(this.manager);if(O==null?void 0:O.dragging)J2.set(this.manager,this.id,T2(()=>({initialIndex:this.index,initialGroup:this.group})))},()=>{let{index:W,group:w,manager:B}=this,O=D0(this,j0),P=D0(this,x0);if(W!==O||w!==P)H0(this,j0,W),H0(this,x0,w),this.animate()},()=>{var W,w;let{target:B}=this,{isDragSource:O}=this.draggable;if(((w=(W=this.draggable.pluginConfig(g5))==null?void 0:W.feedback)!=null?w:"default")==="move"&&O)this.droppable.disabled=!B},...X()],type:K,sensors:Q}),J,this),H0(this,U0,M.element),this.manager=J,this.index=N,H0(this,j0,N),this.group=Y,H0(this,x0,Y),this.type=K,this.transition=G}get initialIndex(){var $,J;return(J=($=J2.get(this.manager,this.id))==null?void 0:$.initialIndex)!=null?J:this.index}get initialGroup(){var $,J;return(J=($=J2.get(this.manager,this.id))==null?void 0:$.initialGroup)!=null?J:this.group}animate(){T2(()=>{let{manager:$,transition:J}=this,{shape:Z}=this.droppable;if(!$)return;let{idle:X}=$.dragOperation.status;if(!Z||!J||X&&!J.idle)return;$.renderer.rendering.then(()=>{let{element:Y}=this;if(!Y)return;for(let M of Y.getAnimations())if("transitionProperty"in M&&(M.transitionProperty==="transform"||M.transitionProperty==="translate"||M.transitionProperty==="scale"))M.cancel();let N=this.refreshShape();if(!N)return;let Q={x:Z.boundingRectangle.left-N.boundingRectangle.left,y:Z.boundingRectangle.top-N.boundingRectangle.top},{translate:K}=j5(Y),G=I2(Y,K,!1),z=I2(Y,K);if(Q.x||Q.y){let M=D5(E5(Y))?A5(R5({},J),{duration:0}):J;v5({element:Y,keyframes:{translate:[`${G.x+Q.x}px ${G.y+Q.y}px ${G.z}`,`${z.x}px ${z.y}px ${z.z}`]},options:M}).then(()=>{if(!$.dragOperation.status.dragging)this.droppable.shape=void 0})}})})}get manager(){return this.draggable.manager}set manager($){_(()=>{this.draggable.manager=$,this.droppable.manager=$})}set element($){_(()=>{let J=D0(this,U0),Z=this.droppable.element,X=this.draggable.element;if(!Z||Z===J)this.droppable.element=$;if(!X||X===J)this.draggable.element=$;H0(this,U0,$)})}get element(){var $,J;let Z=D0(this,U0);if(!Z)return;return(J=($=x5.get(Z))!=null?$:Z)!=null?J:this.droppable.element}set target($){this.droppable.element=$}get target(){return this.droppable.element}set source($){this.draggable.element=$}get source(){return this.draggable.element}get disabled(){return this.draggable.disabled&&this.droppable.disabled}set plugins($){this.draggable.plugins=E2($,T5)}set disabled($){_(()=>{this.droppable.disabled=$,this.draggable.disabled=$})}set data($){_(()=>{this.droppable.data=$,this.draggable.data=$})}set handle($){this.draggable.handle=$}set id($){this.droppable.id=$,this.draggable.id=$}get id(){return this.droppable.id}set sensors($){this.draggable.sensors=$}set modifiers($){this.draggable.modifiers=$}set collisionPriority($){this.droppable.collisionPriority=$}set collisionDetector($){this.droppable.collisionDetector=$!=null?$:_5}set alignment($){this.draggable.alignment=$}get alignment(){return this.draggable.alignment}set type($){_(()=>{this.droppable.type=$,this.draggable.type=$})}get type(){return this.draggable.type}set accept($){this.droppable.accept=$}get accept(){return this.droppable.accept}get isDropTarget(){return this.droppable.isDropTarget}get isDragSource(){return this.draggable.isDragSource}get isDragging(){return this.draggable.isDragging}get isDropping(){return this.draggable.isDropping}get status(){return this.draggable.status}refreshShape(){return this.droppable.refreshShape()}accepts($){return this.droppable.accepts($)}};t=q4();_2=new WeakMap;x0=new WeakMap;j0=new WeakMap;h2=new WeakMap;U0=new WeakMap;i5(t,4,"index",s5,v0,_2);i5(t,4,"group",o5,v0,h2);W4(t,v0);var r5=class extends b5{constructor($,J,Z){super($,J);this.sortable=Z}get index(){return this.sortable.index}get initialIndex(){return this.sortable.initialIndex}get group(){return this.sortable.group}get initialGroup(){return this.sortable.initialGroup}},g2=class extends c5{constructor($,J,Z){super($,J);this.sortable=Z}get index(){return this.sortable.index}get group(){return this.sortable.group}};var{defineProperty:P4,defineProperties:O4,getOwnPropertyDescriptors:T4,getOwnPropertySymbols:a5}=Object,S4=Object.prototype.hasOwnProperty,f4=Object.prototype.propertyIsEnumerable,t5=($,J,Z)=>(J in $)?P4($,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):$[J]=Z,m2=($,J)=>{for(var Z in J||(J={}))if(S4.call(J,Z))t5($,Z,J[Z]);if(a5){for(var Z of a5(J))if(f4.call(J,Z))t5($,Z,J[Z])}return $},E4=($,J)=>O4($,T4(J));function X1($){let{accept:J,collisionDetector:Z,collisionPriority:X,id:Y,data:N,element:Q,handle:K,index:G,group:z,disabled:M,modifiers:U,sensors:W,target:w,type:B,plugins:O}=$,P=m2(m2({},v2),$.transition),A=Z1((F)=>{return new v0(E4(m2({},$),{transition:P,register:!1,handle:X2(K),element:X2(Q),target:X2(w)}),F)}),S=$1(A,I4);return h(Y,()=>A.id=Y),e5(()=>{_(()=>{A.group=z,A.index=G})},[A,z,G]),h(B,()=>A.type=B),h(J,()=>A.accept=J,void 0,_0),h(N,()=>N&&(A.data=N)),h(G,()=>{var F;if(((F=A.manager)==null?void 0:F.dragOperation.status.idle)&&(P==null?void 0:P.idle))A.refreshShape()},J1),Y2(K,(F)=>A.handle=F),Y2(Q,(F)=>A.element=F),Y2(w,(F)=>A.target=F),h(M,()=>A.disabled=M===!0),h(W,()=>A.sensors=W),h(Z,()=>A.collisionDetector=Z),h(X,()=>A.collisionPriority=X),h(O,()=>A.plugins=O,void 0,_0),h(P,()=>A.transition=P,void 0,_0),h(U,()=>A.modifiers=U,void 0,_0),h($.alignment,()=>A.alignment=$.alignment),{sortable:S,get isDragging(){return S.isDragging},get isDropping(){return S.isDropping},get isDragSource(){return S.isDragSource},get isDropTarget(){return S.isDropTarget},handleRef:h0.useCallback((F)=>{A.handle=F!=null?F:void 0},[A]),ref:h0.useCallback((F)=>{var L,V;if(!F&&((L=A.element)==null?void 0:L.isConnected)&&!((V=A.manager)==null?void 0:V.dragOperation.status.idle))return;A.element=F!=null?F:void 0},[A]),sourceRef:h0.useCallback((F)=>{var L,V;if(!F&&((L=A.source)==null?void 0:L.isConnected)&&!((V=A.manager)==null?void 0:V.dragOperation.status.idle))return;A.source=F!=null?F:void 0},[A]),targetRef:h0.useCallback((F)=>{var L,V;if(!F&&((L=A.target)==null?void 0:L.isConnected)&&!((V=A.manager)==null?void 0:V.dragOperation.status.idle))return;A.target=F!=null?F:void 0},[A])}}function I4($,J,Z){if($==="isDragSource"&&!Z&&J)return!0;return!1}function Y1($,J,Z){let X=$.slice();return X.splice(Z,0,X.splice(J,1)[0]),X}async function H$($){let J=[],Z=[],X=$.items;if(X)for(let Q=0;Q<X.length;Q++){let K=X[Q];if(K.kind==="file"){let G=K.webkitGetAsEntry?.();if(G)Z.push({entry:G,path:""})}}else return Array.from($.files);let Y=(Q)=>{return new Promise((K)=>{Q.readEntries((G)=>K(G),()=>K([]))})},N=(Q)=>{return new Promise((K,G)=>{Q.file((z)=>K(z),(z)=>G(z))})};while(Z.length>0){let Q=Z.shift();if(!Q)continue;let{entry:K,path:G}=Q;if(K.isFile)try{let z=await N(K),M=G?`${G}/${z.name}`:z.name;Object.defineProperty(z,"webkitRelativePath",{value:M,writable:!1,configurable:!0}),J.push(z)}catch(z){console.error("Error reading file entry:",z)}else if(K.isDirectory){let z=K.createReader(),M=[],U=await Y(z);while(U.length>0)M=M.concat(U),U=await Y(z);let W=G?`${G}/${K.name}`:K.name;for(let w of M)Z.push({entry:w,path:W})}}return J}var c=d(l(),1);var D4=["red","orange","yellow","green","blue","purple","gray"],u2={red:{bg:"rgba(239, 68, 68, 0.15)",text:"#ef4444",hex:"#ef4444"},orange:{bg:"rgba(249, 115, 22, 0.15)",text:"#f97316",hex:"#f97316"},yellow:{bg:"rgba(234, 179, 8, 0.15)",text:"#ca8a04",hex:"#eab308"},green:{bg:"rgba(34, 197, 94, 0.15)",text:"#16a34a",hex:"#22c55e"},blue:{bg:"rgba(59, 130, 246, 0.15)",text:"#2563eb",hex:"#3b82f6"},purple:{bg:"rgba(168, 85, 247, 0.15)",text:"#9333ea",hex:"#a855f7"},gray:{bg:"rgba(128, 128, 128, 0.15)",text:"#4b5563",hex:"#808080"},system:{bg:"rgba(128, 128, 128, 0.1)",text:"#6b7280",hex:"#808080"}};function N0($){if(!$)return{backgroundColor:"rgba(128, 128, 128, 0.1)",color:"#6b7280"};let J=$.toLowerCase(),Z=u2[J];if(Z)return{backgroundColor:Z.bg,color:Z.text};if($.startsWith("#"))return{backgroundColor:`${$}33`,color:$};return{backgroundColor:"rgba(128, 128, 128, 0.1)",color:$}}var x4={[v.text]:F1,[v.longText]:K1,[v.select]:W1,[v.selectMulti]:M1,[v.rating]:r0,[v.number]:B1,[v.toggle]:U1,[v.date]:N1,[v.user]:w1,[v.userMulti]:V1};function j4({field:$,index:J,onVisibilityChange:Z}){let{ref:X,handleRef:Y}=X1({id:$.id,index:J}),N=$.config?.type?x4[$.config.type]:null;return R("div",{ref:X,className:"flex items-center justify-between p-2 rounded-md hover:bg-muted",children:[R("div",{className:"flex items-center gap-2",children:[H("div",{ref:Y,className:"cursor-grab",children:H(q1,{className:"h-4 w-4 text-muted-foreground"})}),N&&H(N,{className:"h-4 w-4 text-muted-foreground shrink-0"}),$.aiAutofill&&H(H1,{className:"h-4 w-4 text-muted-foreground shrink-0"}),H("span",{className:"text-sm truncate",children:$.config?.name})]}),H(m0,{checked:$.visible,onCheckedChange:(Q)=>Z($.id,Q)})]})}function O$({projectId:$,onManageFields:J,onSave:Z}){let{fields:X,updateFields:Y}=Q5(),[N,Q]=c.useState(""),[K,G]=c.useState("list"),[z,M]=c.useState(""),[U,W]=c.useState(""),[w,B]=c.useState(!1),[O,P]=c.useState(""),[A,S]=c.useState([]),F=Q1();c.useEffect(()=>{F.invalidateQueries({queryKey:["fields",$]})},[$,F]);let L=T0.api.projects[":projectId"].fields.order.$patch,{mutate:V}=b2({mutationFn:async(k)=>{if(!(await L(k)).ok)throw Error(I.failed_update_fields_order());return null}}),q=T0.api.projects[":projectId"].fields.$post,{mutate:C}=b2({mutationFn:async(k)=>{let f=await q(k);if(!f.ok)throw Error(I.failed_create_field());return await f.json()},onSuccess:(k)=>{let f={...k,visible:!0},E=[...X,f];Y(E),M(""),S([]),V({param:{projectId:$},json:E.map((j)=>({fieldId:j.id,visible:j.visible||!1}))}),Z?.()}}),T=c.useMemo(()=>X.filter((k)=>k.config?.name?.toLowerCase().includes(N.toLowerCase())),[X,N]),D=(k)=>{let{source:f,target:E}=k.operation;if(f&&E&&f.id!==E.id){let j=X.findIndex((q0)=>q0.id===f.id),y1=X.findIndex((q0)=>q0.id===E.id),d2=Y1(X,j,y1);Y(d2),V({param:{projectId:$},json:d2.map((q0)=>({fieldId:q0.id,visible:q0.visible||!1}))})}},x=(k,f)=>{let E=X.map((j)=>j.id===k?{...j,visible:f}:j);Y(E),V({param:{projectId:$},json:E.map((j)=>({fieldId:j.id,visible:j.visible||!1}))})},g=()=>{if(!z||!U)return;let k=U===v.select?{select:{options:A}}:U===v.selectMulti?{selectMulti:{options:A}}:{};C({param:{projectId:$},json:{config:{name:z,type:U,...k},label:z,aiAutofill:w,description:O}})},m=X.filter((k)=>k.visible).length;if(K==="create")return H("div",{className:"w-80 p-4",children:R("div",{className:"space-y-4",children:[R("div",{className:"space-y-2",children:[H(F0,{htmlFor:"field-name",children:I.field_name()}),H(g0,{id:"field-name",placeholder:I.new_field_placeholder(),value:z,onChange:(k)=>M(k.target.value),autoFocus:!0})]}),R("div",{className:"space-y-2",children:[H(F0,{children:I.field_type()}),R(L1,{children:[H(R1,{asChild:!0,children:R(e,{variant:"outline",className:"w-full justify-between font-normal",children:[U?H("span",{className:"capitalize",children:U.replace(/_/g," ")}):H("span",{className:"text-muted-foreground border-dashed",children:I.select_field_type()}),H(w0,{className:"ml-2 h-4 w-4 opacity-50"})]})}),H(A1,{className:"w-[--radix-dropdown-menu-trigger-width]",children:Object.values(v).map((k)=>H(C1,{onClick:()=>{W(k),S([])},className:"capitalize",children:k.replace(/_/g," ")},k))})]})]}),R("div",{className:"space-y-2",children:[H(F0,{htmlFor:"field-desc",children:I.description()}),H(g0,{id:"field-desc",placeholder:I.description_optional_placeholder(),value:O,onChange:(k)=>P(k.target.value)})]}),R("div",{className:"flex items-center space-x-2",children:[H(m0,{id:"ai-autofill",checked:w,onCheckedChange:B}),H(F0,{htmlFor:"ai-autofill",children:I.ai_autofill()})]}),(U===v.select||U===v.selectMulti)&&R("div",{className:"space-y-2",children:[R("div",{className:"flex items-center justify-between",children:[H(F0,{className:"text-sm font-medium",children:I.options()}),R(e,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>{let k={id:L5(),displayName:I.new_option(),color:"#808080"};S([...A,k])},children:[H(c2,{className:"h-4 w-4 mr-1"})," ",I.add_option()]})]}),H("div",{className:"space-y-2 max-h-40 overflow-y-auto pr-1",children:A.map((k,f)=>R("div",{className:"flex items-center gap-2",children:[H(g0,{value:k.displayName,onChange:(E)=>{let j=[...A];j[f]={...k,displayName:E.target.value},S(j)},placeholder:I.option_name_placeholder(),className:"h-8 flex-1"}),R(i,{children:[H(n,{asChild:!0,children:H("button",{type:"button",className:"w-6 h-6 rounded-full border shrink-0 cursor-pointer focus:outline-none hover:scale-105 transition-transform",style:{backgroundColor:u2[k.color||""]?.hex||k.color||"#808080"}})}),H(o,{className:"p-2 w-auto",align:"end",children:H("div",{className:"flex gap-1",children:D4.map((E)=>H("button",{type:"button",className:"w-5 h-5 rounded-full border cursor-pointer hover:scale-110 transition-transform",style:{backgroundColor:u2[E]?.hex||E},onClick:()=>{let j=[...A];j[f]={...k,color:E},S(j)}},E))})})]}),H(e,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>{S(A.filter((E,j)=>j!==f))},children:H(V0,{className:"h-4 w-4"})})]},k.id))})]}),R("div",{className:"flex gap-2 pt-2",children:[H(e,{variant:"secondary",className:"flex-1",onClick:()=>{G("list"),M(""),W(""),B(!1),P(""),S([])},children:I.cancel()}),H(e,{className:"flex-1",onClick:g,disabled:!z||!U,children:I.save()})]})]})});return R("div",{className:"w-80 p-4",children:[H("div",{className:"flex items-center justify-between mb-4",children:R("h3",{className:"font-semibold",children:[I.fields()," ",H("span",{className:"text-muted-foreground text-sm font-normal",children:I.visible_count({count:m})})]})}),R("div",{className:"relative mb-4",children:[H(z1,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),H(g0,{placeholder:I.search_fields_placeholder(),value:N,onChange:(k)=>Q(k.target.value),className:"pl-8"})]}),H("div",{className:"max-h-60 overflow-y-auto pr-2",children:H(T1,{sensors:[O1.configure({activationConstraints:[new P1.Distance({value:8})]}),k1],onDragEnd:D,children:T.map((k,f)=>H(j4,{field:k,index:f,onVisibilityChange:x},k.id))})}),J&&R("div",{className:"mt-4 space-y-2",children:[R(e,{variant:"secondary",className:"w-full",onClick:J,children:[H(G1,{className:"h-4 w-4 mr-2"}),I.manage_fields()]}),R(e,{className:"w-full",onClick:()=>G("create"),children:[H(c2,{className:"h-4 w-4 mr-2"}),I.new_field()]})]})]})}var y4=({value:$,config:J,onSave:Z,readOnly:X})=>{let Y=J?.select,[N,Q]=S1.useState(!1),K=Y?.options?.find((W)=>W.id===$),G=()=>{if(!X)Q(!0)},z=(W)=>{Z(W),Q(!1)};return H("div",{className:"relative w-full",onClick:(W)=>W.stopPropagation(),children:R(i,{open:!X&&N,onOpenChange:(W)=>{if(X)return;Q(W)},children:[H(n,{asChild:!0,children:R("div",{onClick:G,className:`flex items-center justify-between w-full min-h-[28px] px-2 py-1 rounded border border-transparent transition-colors ${!X?"cursor-pointer hover:bg-accent hover:border-border group":""}`,children:[((W)=>{if(!W)return H("span",{className:"text-muted-foreground italic",children:"Select an option"});return H("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:N0(W.color),children:W.displayName})})(K),!X&&H(w0,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),R(o,{className:"p-1 w-[--radix-popover-trigger-width] min-w-[150px] max-h-60 overflow-auto bg-popover border border-border rounded-lg shadow-lg",align:"start",children:[R("div",{onClick:()=>z(""),className:"px-3 py-2 text-sm text-muted-foreground hover:bg-accent cursor-pointer flex items-center gap-2",children:[H(V0,{className:"w-3 h-3"})," Clear"]}),Y?.options?.map((W)=>H("div",{onClick:()=>z(W.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center",children:H("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:N0(W.color),children:W.displayName})},W.id))]})]})})},f1=y4;var $0=d(l(),1);var v4=({value:$=[],config:J,onSave:Z,readOnly:X})=>{let Y=J?.selectMulti,N=$0.useRef(null),[Q,K]=$0.useState(!1),[G,z]=$0.useState(!1),[M,U]=$0.useState($.length),W=Y?.options?.filter((F)=>($||[]).includes(F.id))||[];$0.useLayoutEffect(()=>{if(Q||G){U(W.length);return}if(N.current){let F=N.current.offsetWidth,V=document.createElement("canvas").getContext("2d");if(V){V.font="12px ui-sans-serif, system-ui, sans-serif";let q=0,C=0,D=F-28;for(let x=0;x<W.length;x++){let m=V.measureText(W[x].displayName).width+16+4;if(q+m>D&&x<W.length-1)break;if(x===W.length-1){if(q+m<=F)C++;break}q+=m,C++}U(C)}}},[W,Q,G,$]);let w=(F)=>{let L=$||[],V;if(L.includes(F))V=L.filter((q)=>q!==F);else V=[...L,F];Z(V)},B=(F)=>{if(F.stopPropagation(),Q)return;let L=W.length-M;if(!G&&L>0)z(!0);else if(!X)K(!0)},O=(F)=>{if(F.stopPropagation(),!X)K(!0)},P=W.length-M;return H("div",{className:"relative w-full",onClick:(F)=>F.stopPropagation(),children:R(i,{open:!X&&(G&&!Q||Q),onOpenChange:(F)=>{if(X)return;if(!F)z(!1),K(!1)},children:[H(n,{asChild:!0,children:R("div",{ref:N,onClick:B,className:`w-full px-1 py-1 flex flex-wrap gap-1 rounded border border-transparent transition-all box-border h-[32px] overflow-hidden ${!X||P>0?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:[W.length===0&&H("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),W.slice(0,M).map((F)=>H("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium border border-transparent whitespace-nowrap h-[22px]",style:N0(F.color),children:F.displayName},F.id)),P>0&&R("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-muted text-muted-foreground h-[22px]",children:["+",P]})]})}),H(o,{className:`p-1 bg-popover border rounded-lg shadow-xl max-h-60 overflow-auto ${G&&!Q?"w-[--radix-popover-trigger-width] min-w-[200px] flex flex-wrap gap-1 border-ring min-h-[32px] h-auto cursor-pointer":"w-64 border-border"}`,align:"start",onClick:G&&!Q?O:void 0,children:G&&!Q?R(Q2,{children:[W.length===0&&H("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),W.map((F)=>H("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium border border-transparent whitespace-nowrap h-[22px]",style:N0(F.color),children:F.displayName},F.id))]}):Y?.options?.map((F)=>{let L=($||[]).includes(F.id);return R("div",{onClick:()=>w(F.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center justify-between",children:[H("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:N0(F.color),children:F.displayName}),L&&H(H2,{className:"w-4 h-4 text-primary"})]},F.id)})})]})})},E1=v4;var J0=d(l(),1);var _4=({value:$,onSave:J,readOnly:Z})=>{let[X,Y]=J0.useState(!1),[N,Q]=J0.useState($||""),K=J0.useRef(null);J0.useEffect(()=>{Q($||"")},[$]),J0.useEffect(()=>{if(X&&K.current)K.current.focus()},[X]);let G=()=>{if(!Z)Y(!0)},z=()=>{Y(!1),J(N)},M=(U)=>{if(U.key==="Enter")K.current?.blur()};if(X)return H("input",{ref:K,type:"text",value:N,onChange:(U)=>Q(U.target.value),onBlur:z,onKeyDown:M,className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm outline-none shadow-sm"});return H("div",{onClick:G,className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded truncate border border-transparent transition-colors ${!Z?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:$||H("span",{className:"text-muted-foreground italic",children:"Empty"})})},I1=_4;var h4=({value:$,onSave:J,readOnly:Z})=>{return H("div",{className:"flex items-center h-[28px] w-full",onClick:(Y)=>Y.stopPropagation(),children:H(m0,{checked:$,onCheckedChange:(Y)=>{if(!Z)J(Y)},disabled:Z,className:"cursor-pointer"})})},D1=h4;var N2=d(l(),1);var g4=({value:$,onSave:J,readOnly:Z})=>{let X=K2(),{members:Y,fetchMembers:N}=o0(),[Q,K]=N2.useState(!1);N2.useEffect(()=>{if(X)N(X)},[X,N]);let G=Y.find((B)=>B.id===$),z=()=>{if(!Z)K(!0)},M=(B)=>{J(B),K(!1)},U=(B)=>{if(Z)return;K(B)},W=(B)=>{return B.split(" ").map((O)=>O[0]).slice(0,2).join("").toUpperCase()};return H("div",{className:"relative w-full",onClick:(B)=>B.stopPropagation(),children:R(i,{open:!Z&&Q,onOpenChange:U,children:[H(n,{asChild:!0,children:R("div",{onClick:z,className:`flex items-center justify-between w-full h-[28px] px-2 rounded border border-transparent transition-colors ${!Z?"cursor-pointer hover:bg-accent hover:border-border group":""}`,children:[((B)=>{if(!B)return H("span",{className:"text-muted-foreground italic text-sm",children:"Select user"});return R("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-muted text-foreground border h-[22px]",children:[R(L0,{className:"w-4 h-4",children:[H(R0,{src:B.image,alt:B.name,className:"object-cover"}),H(A0,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:W(B.name)})]}),H("span",{className:"truncate max-w-[120px]",children:B.name})]})})(G),!Z&&H(w0,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),R(o,{className:"p-1 w-[--radix-popover-trigger-width] min-w-[200px] max-h-60 overflow-auto bg-popover border border-border rounded-lg shadow-lg",align:"start",children:[R("div",{onClick:()=>M(""),className:"px-3 py-2 text-sm text-muted-foreground hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[H(V0,{className:"w-3 h-3"})," Clear"]}),Y.map((B)=>R("div",{onClick:()=>M(B.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[R(L0,{className:"w-5 h-5",children:[H(R0,{src:B.image,alt:B.name,className:"object-cover"}),H(A0,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:W(B.name)})]}),H("span",{className:"text-sm font-medium text-foreground",children:B.name})]},B.id))]})]})})},x1=g4;var s=d(l(),1);var m4=({value:$=[],onSave:J,readOnly:Z})=>{let X=K2(),{members:Y,fetchMembers:N}=o0(),Q=s.useRef(null),[K,G]=s.useState(!1),[z,M]=s.useState(!1),[U,W]=s.useState($.length);s.useEffect(()=>{if(X)N(X)},[X,N]);let w=Y.filter((q)=>($||[]).includes(q.id)),B=(q)=>{return q.split(" ").map((C)=>C[0]).slice(0,2).join("").toUpperCase()};s.useLayoutEffect(()=>{if(K||z){W(w.length);return}if(Q.current){let q=Q.current.offsetWidth,T=document.createElement("canvas").getContext("2d");if(T){T.font="12px ui-sans-serif, system-ui, sans-serif";let D=0,x=0,m=q-28;for(let k=0;k<w.length;k++){let E=T.measureText(w[k].name).width+42;if(D+E>m&&k<w.length-1)break;if(k===w.length-1){if(D+E<=q)x++;break}D+=E,x++}W(x)}}},[w,K,z,$]);let O=(q)=>{let C=$||[],T;if(C.includes(q))T=C.filter((D)=>D!==q);else T=[...C,q];J(T)},P=(q)=>{if(q.stopPropagation(),K)return;let C=w.length-U;if(!z&&C>0)M(!0);else if(!Z)G(!0)},A=(q)=>{if(q.stopPropagation(),!Z)G(!0)},S=w.length-U,F=z&&!K||K,L=(q)=>{if(Z)return;if(!q)M(!1),G(!1)},V=(q)=>{return R("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-muted text-foreground border whitespace-nowrap h-[22px]",children:[R(L0,{className:"w-4 h-4",children:[H(R0,{src:q.image,alt:q.name,className:"object-cover"}),H(A0,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:B(q.name)})]}),H("span",{className:"truncate max-w-[100px]",children:q.name})]},q.id)};return H("div",{className:"relative w-full",onClick:(q)=>q.stopPropagation(),children:R(i,{open:!Z&&F,onOpenChange:L,children:[H(n,{asChild:!0,children:R("div",{ref:Q,onClick:P,className:`w-full px-1 py-1 flex flex-wrap gap-1 rounded border border-transparent transition-all box-border h-[32px] overflow-hidden ${!Z||S>0?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:[w.length===0&&H("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),w.slice(0,U).map(V),S>0&&R("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-muted text-muted-foreground h-[22px]",children:["+",S]})]})}),H(o,{className:`p-1 bg-popover border rounded-lg shadow-xl max-h-60 overflow-auto ${z&&!K?"w-[--radix-popover-trigger-width] min-w-[200px] flex flex-wrap gap-1 border-ring min-h-[32px] h-auto cursor-pointer":"w-64 border-border"}`,align:"start",onClick:z&&!K?A:void 0,children:z&&!K?R(Q2,{children:[w.length===0&&H("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),w.map(V)]}):Y.map((q)=>{let C=($||[]).includes(q.id);return R("div",{onClick:()=>O(q.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center justify-between rounded-sm",children:[R("div",{className:"flex items-center gap-2",children:[R(L0,{className:"w-5 h-5",children:[H(R0,{src:q.image,alt:q.name,className:"object-cover"}),H(A0,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:B(q.name)})]}),H("span",{className:"text-sm font-medium text-foreground",children:q.name})]}),C&&H(H2,{className:"w-4 h-4 text-primary"})]},q.id)})})]})})},j1=m4;var b4=($)=>{if(!$.config)return H("div",{children:"Unknown Field Type"});switch($.config.type){case"text":return H(I1,{...$,value:$.value,onSave:$.onSave});case"longText":return H(U5,{...$,value:$.value,onSave:$.onSave});case"select":return H(f1,{...$,value:$.value,onSave:$.onSave});case"selectMulti":return H(E1,{...$,value:$.value,onSave:$.onSave});case"rating":return H(V5,{...$,value:$.value,onSave:$.onSave});case"number":return H(F5,{...$,value:$.value,onSave:$.onSave});case"toggle":return H(D1,{...$,value:$.value,onSave:$.onSave});case"date":return H(M5,{...$,value:$.value,onSave:$.onSave});case"user":return H(x1,{...$,value:$.value,onSave:$.onSave});case"userMulti":return H(j1,{...$,value:$.value,onSave:$.onSave});default:return H("div",{children:"Unknown Field Type"})}},L6=b4;var c4=($)=>{if(isNaN($))return"00:00";let J=new Date($*1000),Z=J.getUTCHours(),X=J.getUTCMinutes().toString().padStart(2,"0"),Y=J.getUTCSeconds().toString().padStart(2,"0");if(Z)return`${Z}:${X}:${Y}`;return`${X}:${Y}`},A6=($,J,Z,X)=>{if(Z==="frames")return`${$} fr`;if(Z==="standard")return c4($/J);let Y=Math.round(J),N=J!==Y,Q=!1;if(N&&(Y===30||Y===60))Q=!0;let K=0;if(X){let B=X.match(/^([012]\d):(\d\d):(\d\d)(:|;|\.)(\d+)$/);if(B){let O=parseInt(B[1],10),P=parseInt(B[2],10),A=parseInt(B[3],10),S=parseInt(B[5],10);if(Q=B[4]!==":",K=(O*3600+P*60+A)*Y+S,Q){let F=O*60+P,L=J<30?2:4;K-=L*(F-Math.floor(F/10))}}}let G=$+K;if(Q){let B=J<30?2:4,O=Math.floor(G/(17982*B/2)),P=G%(17982*B/2);if(P<B)P=P+B;G+=9*B*O+B*Math.floor((P-B)/(1798*B/2))}let z=G%Y,M=Math.floor(G/Y)%60,U=Math.floor(G/(Y*60))%60,W=Math.floor(G/(Y*3600))%24,w=Q?";":":";return`${W.toString().padStart(2,"0")}:${U.toString().padStart(2,"0")}:${M.toString().padStart(2,"0")}${w}${z.toString().padStart(2,"0")}`};var C6=($,J)=>{if(!J)return 0;let Z=1/J;return $*Z+Z/2},u4=($)=>Math.max(100,3000/($||30)),k6=({dbTotalFrames:$,containerDuration:J,frameRate:Z})=>{let X=Z||30,Y=Math.round(J*X);if($<=0)return Y;let N=$/X,Q=J-N,K=u4(X)/1000;return Q>K?Y:$};var T6=({progress:$,className:J})=>{let X=2*Math.PI*20,Y=X-Math.min(100,Math.max(0,$))/100*X;return R("svg",{viewBox:"0 0 50 50",className:a0("w-12 h-12",J),children:[H("circle",{cx:"25",cy:"25",r:20,className:"stroke-muted",strokeWidth:"4",fill:"transparent"}),H("circle",{cx:"25",cy:"25",r:20,className:"stroke-primary transition-all duration-300 ease-out",strokeWidth:"4",fill:"transparent",strokeDasharray:X,strokeDashoffset:Y,transform:"rotate(-90 25 25)"}),H("text",{x:"50%",y:"50%",textAnchor:"middle",dy:".3em",className:"fill-foreground text-[10px] font-bold",children:`${Math.round($)}%`})]})};
|
|
2
|
-
export{L2 as o,H5 as p,N5 as q,C2 as r,k2 as s,Y1 as t,H$ as u,Q5 as v,L5 as w,
|
|
1
|
+
import{W as v}from"./chunk-q4f5vvtx.js";import{Aa as D2,Ba as x2,Ca as _5,Da as h5,Ea as g5,Fa as m5,Ga as k1,Ha as P1,Ia as O1,Ja as b5,Ka as c5,La as X2,Ma as e5,Na as $1,Oa as J1,Pa as h,Qa as Y2,Ra as T1,Sa as Z1,ha as _,ia as T2,ja as S5,ka as _0,la as S2,ma as f5,na as f2,pa as y2,ra as E2,sa as E5,ta as I5,ua as D5,va as x5,wa as j5,xa as y5,ya as v5,za as I2}from"./chunk-kpy0kpna.js";import{Za as m0}from"./chunk-xpqcvxej.js";import{lf as K2}from"./chunk-8wv3kdz9.js";import{Af as W0,Ff as P2,pf as S0,qf as y,vf as K5}from"./chunk-j8q688sx.js";import{Rf as F0}from"./chunk-4kk5g619.js";import{$f as l,Bh as q1,Ch as B1,Eg as T0,Gi as f0,Kh as W1,Pi as a0,Qg as H1,Ri as e,Sg as K1,Si as L0,Ti as R0,Ui as A0,Vi as L1,Xi as R1,Yi as A1,Zi as C1,_h as c2,ag as Q2,bg as H,cg as R,ci as z1,dg as Q1,di as G1,eh as N1,gh as H2,hg as b2,hh as w0,hj as I,ih as W5,ii as r0,jh as z5,ji as M1,kj as g0,li as U1,ni as F1,oh as G5,ri as w1,si as V1,wi as V0,xg as n0,yg as Y5}from"./chunk-nwtb6dt1.js";import{Zj as d}from"./chunk-kbzm1pwx.js";var r2=Symbol.for("immer-nothing"),l2=Symbol.for("immer-draftable"),b=Symbol.for("immer-state");function u($,...J){throw Error(`[Immer] minified error nr: ${$}. Full error at: https://bit.ly/3cXEKWf`)}var C0=Object.getPrototypeOf;function B0($){return!!$&&!!$[b]}function X0($){if(!$)return!1;return a2($)||Array.isArray($)||!!$[l2]||!!$.constructor?.[l2]||O0($)||p0($)}var v1=Object.prototype.constructor.toString(),p2=new WeakMap;function a2($){if(!$||typeof $!=="object")return!1;let J=Object.getPrototypeOf($);if(J===null||J===Object.prototype)return!0;let Z=Object.hasOwnProperty.call(J,"constructor")&&J.constructor;if(Z===Object)return!0;if(typeof Z!=="function")return!1;let X=p2.get(Z);if(X===void 0)X=Function.toString.call(Z),p2.set(Z,X);return X===v1}function c0($,J,Z=!0){if(l0($)===0)(Z?Reflect.ownKeys($):Object.keys($)).forEach((Y)=>{J(Y,$[Y],$)});else $.forEach((X,Y)=>J(Y,X,$))}function l0($){let J=$[b];return J?J.type_:Array.isArray($)?1:O0($)?2:p0($)?3:0}function W2($,J){return l0($)===2?$.has(J):Object.prototype.hasOwnProperty.call($,J)}function t2($,J,Z){let X=l0($);if(X===2)$.set(J,Z);else if(X===3)$.add(Z);else $[J]=Z}function _1($,J){if($===J)return $!==0||1/$===1/J;else return $!==$&&J!==J}function O0($){return $ instanceof Map}function p0($){return $ instanceof Set}function Z0($){return $.copy_||$.base_}function z2($,J){if(O0($))return new Map($);if(p0($))return new Set($);if(Array.isArray($))return Array.prototype.slice.call($);let Z=a2($);if(J===!0||J==="class_only"&&!Z){let X=Object.getOwnPropertyDescriptors($);delete X[b];let Y=Reflect.ownKeys(X);for(let N=0;N<Y.length;N++){let Q=Y[N],K=X[Q];if(K.writable===!1)K.writable=!0,K.configurable=!0;if(K.get||K.set)X[Q]={configurable:!0,writable:!0,enumerable:K.enumerable,value:$[Q]}}return Object.create(C0($),X)}else{let X=C0($);if(X!==null&&Z)return{...$};let Y=Object.create(X);return Object.assign(Y,$)}}function w2($,J=!1){if(i0($)||B0($)||!X0($))return $;if(l0($)>1)Object.defineProperties($,{set:b0,add:b0,clear:b0,delete:b0});if(Object.freeze($),J)Object.values($).forEach((Z)=>w2(Z,!0));return $}function h1(){u(2)}var b0={value:h1};function i0($){if($===null||typeof $!=="object")return!0;return Object.isFrozen($)}var g1={};function Y0($){let J=g1[$];if(!J)u(0,$);return J}var k0;function e2(){return k0}function m1($,J){return{drafts_:[],parent_:$,immer_:J,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function i2($,J){if(J)Y0("Patches"),$.patches_=[],$.inversePatches_=[],$.patchListener_=J}function G2($){M2($),$.drafts_.forEach(b1),$.drafts_=null}function M2($){if($===k0)k0=$.parent_}function n2($){return k0=m1(k0,$)}function b1($){let J=$[b];if(J.type_===0||J.type_===1)J.revoke_();else J.revoked_=!0}function o2($,J){J.unfinalizedDrafts_=J.drafts_.length;let Z=J.drafts_[0];if($!==void 0&&$!==Z){if(Z[b].modified_)G2(J),u(4);if(X0($)){if($=u0(J,$),!J.parent_)d0(J,$)}if(J.patches_)Y0("Patches").generateReplacementPatches_(Z[b].base_,$,J.patches_,J.inversePatches_)}else $=u0(J,Z,[]);if(G2(J),J.patches_)J.patchListener_(J.patches_,J.inversePatches_);return $!==r2?$:void 0}function u0($,J,Z){if(i0(J))return J;let X=$.immer_.shouldUseStrictIteration(),Y=J[b];if(!Y)return c0(J,(N,Q)=>s2($,Y,J,N,Q,Z),X),J;if(Y.scope_!==$)return J;if(!Y.modified_)return d0($,Y.base_,!0),Y.base_;if(!Y.finalized_){Y.finalized_=!0,Y.scope_.unfinalizedDrafts_--;let N=Y.copy_,Q=N,K=!1;if(Y.type_===3)Q=new Set(N),N.clear(),K=!0;if(c0(Q,(G,z)=>s2($,Y,N,G,z,Z,K),X),d0($,N,!1),Z&&$.patches_)Y0("Patches").generatePatches_(Y,Z,$.patches_,$.inversePatches_)}return Y.copy_}function s2($,J,Z,X,Y,N,Q){if(Y==null)return;if(typeof Y!=="object"&&!Q)return;let K=i0(Y);if(K&&!Q)return;if(B0(Y)){let G=N&&J&&J.type_!==3&&!W2(J.assigned_,X)?N.concat(X):void 0,z=u0($,Y,G);if(t2(Z,X,z),B0(z))$.canAutoFreeze_=!1;else return}else if(Q)Z.add(Y);if(X0(Y)&&!K){if(!$.immer_.autoFreeze_&&$.unfinalizedDrafts_<1)return;if(J&&J.base_&&J.base_[X]===Y&&K)return;if(u0($,Y),(!J||!J.scope_.parent_)&&typeof X!=="symbol"&&(O0(Z)?Z.has(X):Object.prototype.propertyIsEnumerable.call(Z,X)))d0($,Y)}}function d0($,J,Z=!1){if(!$.parent_&&$.immer_.autoFreeze_&&$.canAutoFreeze_)w2(J,Z)}function c1($,J){let Z=Array.isArray($),X={type_:Z?1:0,scope_:J?J.scope_:e2(),modified_:!1,finalized_:!1,assigned_:{},parent_:J,base_:$,draft_:null,copy_:null,revoke_:null,isManual_:!1},Y=X,N=V2;if(Z)Y=[X],N=P0;let{revoke:Q,proxy:K}=Proxy.revocable(Y,N);return X.draft_=K,X.revoke_=Q,K}var V2={get($,J){if(J===b)return $;let Z=Z0($);if(!W2(Z,J))return u1($,Z,J);let X=Z[J];if($.finalized_||!X0(X))return X;if(X===q2($.base_,J))return B2($),$.copy_[J]=F2(X,$);return X},has($,J){return J in Z0($)},ownKeys($){return Reflect.ownKeys(Z0($))},set($,J,Z){let X=$5(Z0($),J);if(X?.set)return X.set.call($.draft_,Z),!0;if(!$.modified_){let Y=q2(Z0($),J),N=Y?.[b];if(N&&N.base_===Z)return $.copy_[J]=Z,$.assigned_[J]=!1,!0;if(_1(Z,Y)&&(Z!==void 0||W2($.base_,J)))return!0;B2($),U2($)}if($.copy_[J]===Z&&(Z!==void 0||(J in $.copy_))||Number.isNaN(Z)&&Number.isNaN($.copy_[J]))return!0;return $.copy_[J]=Z,$.assigned_[J]=!0,!0},deleteProperty($,J){if(q2($.base_,J)!==void 0||J in $.base_)$.assigned_[J]=!1,B2($),U2($);else delete $.assigned_[J];if($.copy_)delete $.copy_[J];return!0},getOwnPropertyDescriptor($,J){let Z=Z0($),X=Reflect.getOwnPropertyDescriptor(Z,J);if(!X)return X;return{writable:!0,configurable:$.type_!==1||J!=="length",enumerable:X.enumerable,value:Z[J]}},defineProperty(){u(11)},getPrototypeOf($){return C0($.base_)},setPrototypeOf(){u(12)}},P0={};c0(V2,($,J)=>{P0[$]=function(){return arguments[0]=arguments[0][0],J.apply(this,arguments)}});P0.deleteProperty=function($,J){return P0.set.call(this,$,J,void 0)};P0.set=function($,J,Z){return V2.set.call(this,$[0],J,Z,$[0])};function q2($,J){let Z=$[b];return(Z?Z0(Z):$)[J]}function u1($,J,Z){let X=$5(J,Z);return X?"value"in X?X.value:X.get?.call($.draft_):void 0}function $5($,J){if(!(J in $))return;let Z=C0($);while(Z){let X=Object.getOwnPropertyDescriptor(Z,J);if(X)return X;Z=C0(Z)}return}function U2($){if(!$.modified_){if($.modified_=!0,$.parent_)U2($.parent_)}}function B2($){if(!$.copy_)$.copy_=z2($.base_,$.scope_.immer_.useStrictShallowCopy_)}var d1=class{constructor($){if(this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(J,Z,X)=>{if(typeof J==="function"&&typeof Z!=="function"){let N=Z;Z=J;let Q=this;return function(G=N,...z){return Q.produce(G,(M)=>Z.call(this,M,...z))}}if(typeof Z!=="function")u(6);if(X!==void 0&&typeof X!=="function")u(7);let Y;if(X0(J)){let N=n2(this),Q=F2(J,void 0),K=!0;try{Y=Z(Q),K=!1}finally{if(K)G2(N);else M2(N)}return i2(N,X),o2(Y,N)}else if(!J||typeof J!=="object"){if(Y=Z(J),Y===void 0)Y=J;if(Y===r2)Y=void 0;if(this.autoFreeze_)w2(Y,!0);if(X){let N=[],Q=[];Y0("Patches").generateReplacementPatches_(J,Y,N,Q),X(N,Q)}return Y}else u(1,J)},this.produceWithPatches=(J,Z)=>{if(typeof J==="function")return(Q,...K)=>this.produceWithPatches(Q,(G)=>J(G,...K));let X,Y;return[this.produce(J,Z,(Q,K)=>{X=Q,Y=K}),X,Y]},typeof $?.autoFreeze==="boolean")this.setAutoFreeze($.autoFreeze);if(typeof $?.useStrictShallowCopy==="boolean")this.setUseStrictShallowCopy($.useStrictShallowCopy);if(typeof $?.useStrictIteration==="boolean")this.setUseStrictIteration($.useStrictIteration)}createDraft($){if(!X0($))u(8);if(B0($))$=l1($);let J=n2(this),Z=F2($,void 0);return Z[b].isManual_=!0,M2(J),Z}finishDraft($,J){let Z=$&&$[b];if(!Z||!Z.isManual_)u(9);let{scope_:X}=Z;return i2(X,J),o2(void 0,X)}setAutoFreeze($){this.autoFreeze_=$}setUseStrictShallowCopy($){this.useStrictShallowCopy_=$}setUseStrictIteration($){this.useStrictIteration_=$}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches($,J){let Z;for(Z=J.length-1;Z>=0;Z--){let Y=J[Z];if(Y.path.length===0&&Y.op==="replace"){$=Y.value;break}}if(Z>-1)J=J.slice(Z+1);let X=Y0("Patches").applyPatches_;if(B0($))return X($,J);return this.produce($,(Y)=>X(Y,J))}};function F2($,J){let Z=O0($)?Y0("MapSet").proxyMap_($,J):p0($)?Y0("MapSet").proxySet_($,J):c1($,J);return(J?J.scope_:e2()).drafts_.push(Z),Z}function l1($){if(!B0($))u(10,$);return J5($)}function J5($){if(!X0($)||i0($))return $;let J=$[b],Z,X=!0;if(J){if(!J.modified_)return J.base_;J.finalized_=!0,Z=z2($,J.scope_.immer_.useStrictShallowCopy_),X=J.scope_.immer_.shouldUseStrictIteration()}else Z=z2($,!0);if(c0(Z,(Y,N)=>{t2(Z,Y,J5(N))},X),J)J.finalized_=!1;return Z}var p1=new d1,Z5=p1.produce;var i1=($)=>(J,Z,X)=>{return X.setState=(Y,N,...Q)=>{let K=typeof Y==="function"?Z5(Y):Y;return J(K,N,...Q)},$(X.setState,Z,X)},X5=i1;var o0=n0()(Y5(X5(($,J)=>({members:[],loading:!1,fetchMembers:async(Z,X,Y)=>{if(!Y&&J().loadedTeamId===Z&&J().loadedWithAgents===X)return;$({loading:!0});try{let N=await T0.api.teams[":teamId"].members.$get({param:{teamId:Z},query:{includeAgents:X?"true":"false"}});if(!N.ok)throw Error("failed to fetch members");let Q=await N.json();$({members:Q||[],loadedTeamId:Z,loadedWithAgents:X,loading:!1})}catch{$({loading:!1})}}}))));var Q5=n0(($)=>({fields:[],loadedProjectId:null,setFields:(J,Z)=>$({fields:J,loadedProjectId:Z}),updateFields:(J)=>$({fields:J})}));function L2($,J,Z){let X=y($,Z?.in);if(isNaN(J))return S0(Z?.in||$,NaN);if(!J)return X;let Y=X.getDate(),N=S0(Z?.in||$,X.getTime());N.setMonth(X.getMonth()+J+1,0);let Q=N.getDate();if(Y>=Q)return N;else return X.setFullYear(N.getFullYear(),N.getMonth(),Y),X}function H5($,J){let Z=y($,J?.in),X=Z.getMonth();return Z.setFullYear(Z.getFullYear(),X+1,0),Z.setHours(23,59,59,999),Z}function N5($,J){let[Z,X]=K5($,J.start,J.end);return{start:Z,end:X}}function q5($,J){let{start:Z,end:X}=N5(J?.in,$),Y=+Z>+X,N=Y?+Z:+X,Q=Y?X:Z;Q.setHours(0,0,0,0);let K=J?.step??1;if(!K)return[];if(K<0)K=-K,Y=!Y;let G=[];while(+Q<=N)G.push(S0(Z,Q)),Q.setDate(Q.getDate()+K),Q.setHours(0,0,0,0);return Y?G.reverse():G}function s0($,J){return y($,J?.in).getDate()}function B5($,J){return y($,J?.in).getDay()}function R2($,J){return y($,J?.in).getHours()}function A2($,J){return y($,J?.in).getMinutes()}function C2($,J){return y($,J?.in).getMonth()}function k2($,J){return y($,J?.in).getFullYear()}var r=d(l(),1);var n1=({value:$,config:J,onSave:Z,readOnly:X})=>{let Y=J?.date,[N,Q]=r.useState(!1),K=r.useRef(null),G=$?new Date($):new Date,z=W0(G)?G:new Date,[M,U]=r.useState(z);r.useEffect(()=>{if(N&&$){let q=new Date($);if(W0(q))U(q)}},[N,$]),r.useEffect(()=>{let q=(C)=>{if(K.current&&!K.current.contains(C.target)){if(N)Q(!1)}};return document.addEventListener("mousedown",q),()=>document.removeEventListener("mousedown",q)},[N]);let W=()=>{if(!X)Q(!0)},w=(q)=>{if(!q)return"";let C=new Date(q);if(!W0(C))return"Invalid Date";let T="PPP";if(Y?.displayFormat==="usa")T="MM/dd/yyyy";else if(Y?.displayFormat==="euro")T="dd/MM/yyyy";else if(Y?.displayFormat==="iso")T="yyyy-MM-dd";if(Y?.includeTime)if(Y?.timeFormat==="twenty_four_hour")T+=" HH:mm";else T+=" p";let D=P2(C,T);if(Y?.displayTimezone)D+=` (${Intl.DateTimeFormat().resolvedOptions().timeZone})`;return D},B=new Date(M.getFullYear(),M.getMonth(),1),O=H5(M),P=q5({start:B,end:O}),A=B5(B),S=(q)=>{let C=new Date(q);if(Y?.includeTime)C.setHours(R2(z)),C.setMinutes(A2(z));let T=C.toISOString();if(Z(T),!Y?.includeTime)Q(!1)},F=(q,C)=>{let T=$?new Date($):new Date;if(!W0(T))T.setTime(new Date().getTime());if(q==="hour")T.setHours(C);if(q==="minute")T.setMinutes(C);let D=T.toISOString();Z(D)},L=Array.from({length:24},(q,C)=>C),V=Array.from({length:12},(q,C)=>C*5);if(N)return R("div",{className:"relative w-full",ref:K,children:[H("div",{className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm shadow-sm min-h-[28px] flex items-center",children:$?w($):H("span",{className:"text-muted-foreground",children:"Select date..."})}),R("div",{className:"absolute z-50 top-full left-0 mt-1 bg-popover border border-border rounded-lg shadow-xl flex flex-col md:flex-row overflow-hidden min-w-[280px]",children:[R("div",{className:"p-4 w-64",children:[R("div",{className:"flex justify-between items-center mb-4",children:[H("button",{onClick:()=>U(L2(M,-1)),className:"p-1 hover:bg-accent rounded",children:H(W5,{className:"w-4 h-4"})}),H("span",{className:"font-semibold text-sm",children:P2(M,"MMMM yyyy")}),H("button",{onClick:()=>U(L2(M,1)),className:"p-1 hover:bg-accent rounded",children:H(z5,{className:"w-4 h-4"})})]}),H("div",{className:"grid grid-cols-7 gap-1 text-center text-xs mb-2 text-muted-foreground",children:["Su","Mo","Tu","We","Th","Fr","Sa"].map((q)=>H("div",{children:q},q))}),R("div",{className:"grid grid-cols-7 gap-1 text-center text-sm",children:[Array.from({length:A}).map((q,C)=>H("div",{},`empty-${C}`)),P.map((q)=>{let C=$?new Date($):null,T=C&&W0(C)&&s0(C)===s0(q)&&C2(C)===C2(q)&&k2(C)===k2(q);return H("button",{onClick:()=>S(q),className:`w-8 h-8 rounded-full flex items-center justify-center hover:bg-accent transition-colors ${T?"bg-primary text-primary-foreground hover:bg-primary/90":"text-foreground"}`,children:s0(q)},q.toString())})]})]}),Y?.includeTime&&R("div",{className:"border-l border-border bg-muted w-32 flex flex-col",children:[R("div",{className:"p-2 border-b border-border text-xs font-semibold text-muted-foreground flex items-center justify-center gap-1",children:[H(G5,{className:"w-3 h-3"})," Time"]}),R("div",{className:"flex flex-1 h-64",children:[H("div",{className:"flex-1 overflow-y-auto scrollbar-hide border-r border-border",children:L.map((q)=>H("div",{onClick:()=>F("hour",q),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${R2(z)===q?"bg-primary/10 font-medium text-primary":""}`,children:q.toString().padStart(2,"0")},q))}),H("div",{className:"flex-1 overflow-y-auto scrollbar-hide",children:V.map((q)=>H("div",{onClick:()=>F("minute",q),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${A2(z)===q?"bg-primary/10 font-medium text-primary":""}`,children:q.toString().padStart(2,"0")},q))})]})]})]})]});return H("div",{onClick:W,className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded border border-transparent transition-colors ${!X?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:$?w($):H("span",{className:"text-muted-foreground italic",children:"Empty"})})},M5=n1;var p=d(l(),1);var o1=({value:$,onSave:J,readOnly:Z})=>{let[X,Y]=p.useState(!1),[N,Q]=p.useState($||""),K=p.useRef(null),G=p.useRef(null),[z,M]=p.useState(!1);p.useEffect(()=>{Q($||"")},[$]),p.useEffect(()=>{if(X&&K.current)K.current.focus(),M(!1)},[X]),p.useEffect(()=>{let B=(O)=>{if(z&&G.current&&!G.current.contains(O.target))M(!1)};if(z)document.addEventListener("mousedown",B);return()=>{document.removeEventListener("mousedown",B)}},[z]);let U=()=>{Y(!1),J(N)},W=(B)=>{B.stopPropagation(),M(!0)},w=(B)=>{if(B.stopPropagation(),!Z)Y(!0)};if(X)return H("textarea",{ref:K,value:N,onChange:(B)=>Q(B.target.value),onBlur:U,className:"w-full min-h-[80px] p-2 border border-ring rounded bg-background text-sm outline-none shadow-sm resize-none"});return R("div",{ref:G,className:"relative w-full text-sm",children:[H("div",{onClick:W,className:`w-full text-foreground rounded border border-transparent transition-all px-2 py-1 line-clamp-2 max-h-[3rem] overflow-hidden ${!Z?"cursor-pointer hover:bg-accent hover:border-border":"cursor-pointer"}`,title:"Click to expand",children:$?$:H("span",{className:"text-muted-foreground italic",children:"Empty"})}),z&&H("div",{onClick:w,className:`absolute top-0 left-0 w-full min-h-full h-auto z-50 bg-background border border-ring rounded shadow-lg px-2 py-1 whitespace-pre-wrap ${!Z?"cursor-text":""}`,children:$?$:H("span",{className:"text-muted-foreground italic",children:"Empty"})})]})},U5=o1;var a=d(l(),1);var s1=({value:$,config:J,onSave:Z,readOnly:X})=>{let Y=J?.number,[N,Q]=a.useState(!1),[K,G]=a.useState(""),z=a.useRef(null);a.useEffect(()=>{G($!==void 0&&$!==null?$.toString():"")},[$]),a.useEffect(()=>{if(N&&z.current)z.current.focus()},[N]);let M=()=>{if(!X)Q(!0)},U=()=>{if(Q(!1),K==="")Z(void 0);else{let B=parseFloat(K);Z(isNaN(B)?void 0:B)}},W=(B)=>{if(B.key==="Enter")B.stopPropagation(),z.current?.blur()},w=(B)=>{if(B===void 0||B===null||isNaN(B))return"";return B.toFixed(Y?.scale)};if(N)return H("input",{ref:z,type:"number",step:1/Math.pow(10,Y?.scale||0),value:K,onChange:(B)=>G(B.target.value),onBlur:U,onKeyDown:W,onDoubleClick:(B)=>B.stopPropagation(),className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm outline-none shadow-sm text-left font-mono"});return H("div",{onClick:M,onDoubleClick:(B)=>B.stopPropagation(),className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded border border-transparent transition-colors text-left font-mono ${!X?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:$!==void 0&&$!==null?w($):H("span",{className:"text-muted-foreground italic font-sans text-left block",children:"Empty"})})},F5=s1;var w5=d(l(),1);var r1=({value:$,config:J,onSave:Z,readOnly:X})=>{let Y=J?.rating,N=Math.max(2,Math.min(6,Y?.maxValue||5)),[Q,K]=w5.useState(null),G=(M,U)=>{if(M.stopPropagation(),X)return;let W;if($===U)W=0;else W=U;Z(W)},z=Array.from({length:N},(M,U)=>U+1);return H("div",{className:"flex items-center gap-1 h-[28px]",onMouseLeave:()=>!X&&K(null),onDoubleClick:(M)=>M.stopPropagation(),children:z.map((M)=>{let U=Q!==null?M<=Q:M<=($||0);return H("button",{onClick:(W)=>G(W,M),onMouseEnter:()=>!X&&K(M),className:`focus:outline-none transition-transform ${!X?"cursor-pointer hover:scale-110":"cursor-default"}`,type:"button",disabled:X,children:H(r0,{className:`w-5 h-5 transition-colors ${U?"fill-yellow-400 text-yellow-400":"fill-muted text-muted-foreground/30"}`})},M)})})},V5=r1;var S1=d(l(),1);function i({...$}){return H(f0.Root,{"data-slot":"popover",...$})}function n({...$}){return H(f0.Trigger,{"data-slot":"popover-trigger",...$})}function o({className:$,align:J="center",sideOffset:Z=4,...X}){return H(f0.Portal,{children:H(f0.Content,{"data-slot":"popover-content",align:J,sideOffset:Z,className:a0("z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",$),...X})})}var Q0;(function($){$.Base32IncorrectEncoding="B32_ENC_INVALID",$.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",$.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",$.EncodeTimeNegative="ENC_TIME_NEG",$.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",$.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",$.PRNGDetectFailure="PRNG_DETECT",$.ULIDInvalid="ULID_INVALID",$.Unexpected="UNEXPECTED",$.UUIDInvalid="UUID_INVALID"})(Q0||(Q0={}));class z0 extends Error{constructor($,J){super(`${J} (${$})`);this.name="ULIDError",this.code=$}}function a1($){let J=Math.floor($()*32)%32;return"0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(J)}function t1($){let J=e1(),Z=J&&(J.crypto||J.msCrypto)||null;if(typeof Z?.getRandomValues==="function")return()=>{let X=new Uint8Array(1);return Z.getRandomValues(X),X[0]/256};else if(typeof Z?.randomBytes==="function")return()=>Z.randomBytes(1).readUInt8()/256;throw new z0(Q0.PRNGDetectFailure,"Failed to find a reliable PRNG")}function e1(){if(Z4())return self;if(typeof window<"u")return window;if(typeof global<"u")return global;if(typeof globalThis<"u")return globalThis;return null}function $4($,J){let Z="";for(;$>0;$--)Z=a1(J)+Z;return Z}function J4($,J=10){if(isNaN($))throw new z0(Q0.EncodeTimeValueMalformed,`Time must be a number: ${$}`);else if($>281474976710655)throw new z0(Q0.EncodeTimeSizeExceeded,`Cannot encode a time larger than 281474976710655: ${$}`);else if($<0)throw new z0(Q0.EncodeTimeNegative,`Time must be positive: ${$}`);else if(Number.isInteger($)===!1)throw new z0(Q0.EncodeTimeValueMalformed,`Time must be an integer: ${$}`);let Z,X="";for(let Y=J;Y>0;Y--)Z=$%32,X="0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(Z)+X,$=($-Z)/32;return X}function Z4(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function L5($,J){let Z=J||t1(),X=!$||isNaN($)?Date.now():$;return J4(X,10)+$4(16,Z)}var h0=d(l(),1);var{create:X4,defineProperty:u5,defineProperties:Y4,getOwnPropertyDescriptor:Q4,getOwnPropertyDescriptors:H4,getOwnPropertySymbols:Z2}=Object,d5=Object.prototype.hasOwnProperty,l5=Object.prototype.propertyIsEnumerable,K4=($,J)=>(J=Symbol[$])?J:Symbol.for("Symbol."+$),y0=($)=>{throw TypeError($)},j2=($,J,Z)=>(J in $)?u5($,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):$[J]=Z,R5=($,J)=>{for(var Z in J||(J={}))if(d5.call(J,Z))j2($,Z,J[Z]);if(Z2){for(var Z of Z2(J))if(l5.call(J,Z))j2($,Z,J[Z])}return $},A5=($,J)=>Y4($,H4(J)),N4=($,J)=>{var Z={};for(var X in $)if(d5.call($,X)&&J.indexOf(X)<0)Z[X]=$[X];if($!=null&&Z2){for(var X of Z2($))if(J.indexOf(X)<0&&l5.call($,X))Z[X]=$[X]}return Z},q4=($)=>{var J;return[,,,X4((J=void 0)!=null?J:null)]},p5=["class","method","getter","setter","accessor","field","value","get","set"],I0=($)=>$!==void 0&&typeof $!=="function"?y0("Function expected"):$,B4=($,J,Z,X,Y)=>({kind:p5[$],name:J,metadata:X,addInitializer:(N)=>Z._?y0("Already initialized"):Y.push(I0(N||null))}),W4=($,J)=>j2(J,K4("metadata"),$[3]),t0=($,J,Z,X)=>{for(var Y=0,N=$[J>>1],Q=N&&N.length;Y<Q;Y++)J&1?N[Y].call(Z):X=N[Y].call(Z,X);return X},i5=($,J,Z,X,Y,N)=>{var Q,K,G,z,M,U=J&7,W=!1,w=!1,B=$.length+1,O=p5[U+5],P=$[B-1]=[],A=$[B]||($[B]=[]),S=(Y=Y.prototype,Q4({get[Z](){return D0(this,N)},set[Z](L){return H0(this,N,L)}},Z));for(var F=X.length-1;F>=0;F--)if(z=B4(U,Z,G={},$[3],A),z.static=W,z.private=w,M=z.access={has:(L)=>(Z in L)},M.get=(L)=>L[Z],M.set=(L,V)=>L[Z]=V,K=(0,X[F])({get:S.get,set:S.set},z),G._=1,K===void 0)I0(K)&&(S[O]=K);else if(typeof K!=="object"||K===null)y0("Object expected");else I0(Q=K.get)&&(S.get=Q),I0(Q=K.set)&&(S.set=Q),I0(Q=K.init)&&P.unshift(Q);return S&&u5(Y,Z,S),Y},n5=($,J,Z)=>J.has($)||y0("Cannot "+Z),D0=($,J,Z)=>(n5($,J,"read from private field"),J.get($)),E0=($,J,Z)=>J.has($)?y0("Cannot add the same private member more than once"):J instanceof WeakSet?J.add($):J.set($,Z),H0=($,J,Z,X)=>(n5($,J,"write to private field"),J.set($,Z),Z);function K0($){return $ instanceof g2||$ instanceof r5}var e0=10,z4=class extends y2{constructor($){super($);let J=S5(()=>{let{dragOperation:X}=$;if(!x2(X.activatorEvent))return;if(!K0(X.source))return;if(X.status.initialized){let Y=$.registry.plugins.get(m5);if(Y)return Y.disable(),()=>Y.enable()}}),Z=$.monitor.addEventListener("dragmove",(X,Y)=>{queueMicrotask(()=>{if(this.disabled||X.defaultPrevented||!X.nativeEvent)return;let{dragOperation:N}=Y;if(!x2(X.nativeEvent))return;if(!K0(N.source))return;if(!N.shape)return;let{actions:Q,collisionObserver:K,registry:G}=Y,{by:z}=X;if(!z)return;let M=G4(z),{source:U,target:W}=N,{center:w}=N.shape.current,B=[],O=[];_(()=>{for(let V of G.droppables){let{id:q}=V;if(!V.accepts(U)||q===(W==null?void 0:W.id)&&K0(V)||!V.element)continue;let C=V.shape,T=new D2(V.element,{getBoundingClientRect:(D)=>I5(D,void 0,0.2)});if(!T.height||!T.width)continue;if(M=="down"&&w.y+e0<T.center.y||M=="up"&&w.y-e0>T.center.y||M=="left"&&w.x-e0>T.center.x||M=="right"&&w.x+e0<T.center.x)B.push(V),V.shape=T,O.push(()=>V.shape=C)}}),X.preventDefault(),K.disable();let P=K.computeCollisions(B,h5);_(()=>O.forEach((V)=>V()));let[A]=P;if(!A)return;let{id:S}=A,{index:F,group:L}=U.sortable;Q.setDropTarget(S).then(()=>{let{source:V,target:q,shape:C}=N;if(!V||!K0(V)||!C)return;let{index:T,group:D,target:x}=V.sortable,g=F!==T||L!==D,m=g?x:q==null?void 0:q.element;if(!m)return;y5(m);let k=new D2(m);if(!k)return;let f=f2.delta(k,f2.from(C.current.boundingRectangle),V.alignment);if(Q.move({by:f}),g)Q.setDropTarget(V.id).then(()=>K.enable());else K.enable()})})});this.destroy=()=>{Z(),J()}}};function G4($){let{x:J,y:Z}=$;if(J>0)return"right";else if(J<0)return"left";else if(Z>0)return"down";else if(Z<0)return"up"}var{defineProperty:M4,defineProperties:U4,getOwnPropertyDescriptors:F4,getOwnPropertySymbols:C5}=Object,w4=Object.prototype.hasOwnProperty,V4=Object.prototype.propertyIsEnumerable,k5=($,J,Z)=>(J in $)?M4($,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):$[J]=Z,G0=($,J)=>{for(var Z in J||(J={}))if(w4.call(J,Z))k5($,Z,J[Z]);if(C5){for(var Z of C5(J))if(V4.call(J,Z))k5($,Z,J[Z])}return $},M0=($,J)=>U4($,F4(J));function L4($,J,Z){if(J===Z)return $;let X=$.slice();return X.splice(Z,0,X.splice(J,1)[0]),X}function O2($){return"initialIndex"in $&&typeof $.initialIndex==="number"&&"index"in $&&typeof $.index==="number"}function R4($,J,Z){var X,Y,N;let{source:Q,target:K,canceled:G}=J.operation;if(!Q||!K||G){if("preventDefault"in J)J.preventDefault();return $}let z=(L,V)=>L===V||typeof L==="object"&&("id"in L)&&L.id===V;if(Array.isArray($)){let L=$.findIndex((q)=>z(q,Q.id)),V=$.findIndex((q)=>z(q,K.id));if(L===-1||V===-1){if(O2(Q)){let{initialIndex:q,index:C}=Q;if(q===C||q<0||q>=$.length){if("preventDefault"in J)J.preventDefault();return $}return Z($,q,C)}return $}if(!G&&"index"in Q&&typeof Q.index==="number"){let q=Q.index;if(q!==L)return Z($,L,q)}return Z($,L,V)}let M=Object.entries($),U=-1,W,w=-1,B;for(let[L,V]of M){if(U===-1){if(U=V.findIndex((q)=>z(q,Q.id)),U!==-1)W=L}if(w===-1){if(w=V.findIndex((q)=>z(q,K.id)),w!==-1)B=L}if(U!==-1&&w!==-1)break}if(U===-1&&O2(Q)){let{initialGroup:L,initialIndex:V,group:q,index:C}=Q;if(L==null||q==null||!(L in $)||!(q in $)){if("preventDefault"in J)J.preventDefault();return $}if(L===q&&V===C){if("preventDefault"in J)J.preventDefault();return $}if(L===q)return M0(G0({},$),{[L]:Z($[L],V,C)});let T=$[L][V];return M0(G0({},$),{[L]:[...$[L].slice(0,V),...$[L].slice(V+1)],[q]:[...$[q].slice(0,C),T,...$[q].slice(C)]})}if(!Q.manager)return $;let{dragOperation:O}=Q.manager,P=(Y=(X=O.shape)==null?void 0:X.current.center)!=null?Y:O.position.current;if(B==null){if(K.id in $){let L=K.shape&&P.y>K.shape.center.y?$[K.id].length:0;B=K.id,w=L}}if(W==null||B==null||W===B&&U===w){if(W!=null&&W===B&&U===w&&O2(Q)){let L=Q.group!=null&&Q.group!==W,V=Q.index!==U;if(L||V){let q=(N=Q.group)!=null?N:W;if(q in $){if(W===q)return M0(G0({},$),{[W]:Z($[W],U,Q.index)});let C=$[W][U];return M0(G0({},$),{[W]:[...$[W].slice(0,U),...$[W].slice(U+1)],[q]:[...$[q].slice(0,Q.index),C,...$[q].slice(Q.index)]})}}}if("preventDefault"in J)J.preventDefault();return $}if(W===B)return M0(G0({},$),{[W]:Z($[W],U,w)});let S=K.shape&&Math.round(P.y)>Math.round(K.shape.center.y)?1:0,F=$[W][U];return M0(G0({},$),{[W]:[...$[W].slice(0,U),...$[W].slice(U+1)],[B]:[...$[B].slice(0,w+S),F,...$[B].slice(w+S)]})}function A4($,J){return R4($,J,L4)}var P5="__default__",C4=class extends y2{constructor($){super($);let J=()=>{let X=new Map;for(let Y of $.registry.droppables)if(Y instanceof g2){let{sortable:N}=Y,{group:Q}=N,K=X.get(Q);if(!K)K=new Set,X.set(Q,K);K.add(N)}for(let[Y,N]of X)X.set(Y,new Set($2(N)));return X},Z=[$.monitor.addEventListener("dragover",(X,Y)=>{if(this.disabled)return;let{dragOperation:N}=Y,{source:Q,target:K}=N;if(!K0(Q)||!K0(K))return;if(Q.sortable===K.sortable)return;let G=J(),z=Q.sortable.group===K.sortable.group,M=G.get(Q.sortable.group),U=z?M:G.get(K.sortable.group);if(!M||!U)return;queueMicrotask(()=>{if(X.defaultPrevented)return;Y.renderer.rendering.then(()=>{var W,w,B;let O=J();for(let[x,g]of G.entries()){let m=Array.from(g).entries();for(let[k,f]of m)if(f.index!==k||f.group!==x||!((W=O.get(x))==null?void 0:W.has(f)))return}let P=Q.sortable.element,A=K.sortable.element;if(!A||!P)return;if(!z&&K.id===Q.sortable.group)return;let S=$2(M),F=z?S:$2(U),L=(w=Q.sortable.group)!=null?w:P5,V=(B=K.sortable.group)!=null?B:P5,q={[L]:S,[V]:F},C=A4(q,X);if(q===C)return;let T=C[V].indexOf(Q.sortable),D=C[V].indexOf(K.sortable);Y.collisionObserver.disable(),O5(P,T,A,D),_(()=>{for(let[x,g]of C[L].entries())g.index=x;if(!z)for(let[x,g]of C[V].entries())g.group=K.sortable.group,g.index=x}),Y.actions.setDropTarget(Q.id).then(()=>Y.collisionObserver.enable())})})}),$.monitor.addEventListener("dragend",(X,Y)=>{if(!X.canceled)return;let{dragOperation:N}=Y,{source:Q}=N;if(!K0(Q))return;if(Q.sortable.initialIndex===Q.sortable.index&&Q.sortable.initialGroup===Q.sortable.group)return;queueMicrotask(()=>{let K=J(),G=K.get(Q.sortable.initialGroup);if(!G)return;Y.renderer.rendering.then(()=>{for(let[w,B]of K.entries()){let O=Array.from(B).entries();for(let[P,A]of O)if(A.index!==P||A.group!==w)return}let z=$2(G),M=Q.sortable.element,U=z[Q.sortable.initialIndex],W=U==null?void 0:U.element;if(!U||!W||!M)return;O5(M,U.index,W,Q.index),_(()=>{for(let[w,B]of K.entries()){let O=Array.from(B).values();for(let P of O)P.index=P.initialIndex,P.group=P.initialGroup}})})})})];this.destroy=()=>{for(let X of Z)X()}}};function O5($,J,Z,X){let Y=X<J?"afterend":"beforebegin";Z.insertAdjacentElement(Y,$)}function k4($,J){return $.index-J.index}function $2($){return Array.from($).sort(k4)}var T5=[z4,C4],v2={duration:250,easing:"cubic-bezier(0.25, 1, 0.5, 1)",idle:!1},J2=new f5,o5,s5,t,_2,x0,j0,h2,U0;s5=[S2],o5=[S2];var v0=class{constructor($,J){E0(this,_2,t0(t,8,this)),t0(t,11,this),E0(this,x0),E0(this,j0),E0(this,h2,t0(t,12,this)),t0(t,15,this),E0(this,U0),this.register=()=>{return _(()=>{var W,w;(W=this.manager)==null||W.registry.register(this.droppable),(w=this.manager)==null||w.registry.register(this.draggable)}),()=>this.unregister()},this.unregister=()=>{_(()=>{var W,w;(W=this.manager)==null||W.registry.unregister(this.droppable),(w=this.manager)==null||w.registry.unregister(this.draggable)})},this.destroy=()=>{_(()=>{this.droppable.destroy(),this.draggable.destroy()})};var Z=$,{effects:X=()=>[],group:Y,index:N,sensors:Q,type:K,transition:G=v2,plugins:z}=Z,M=N4(Z,["effects","group","index","sensors","type","transition","plugins"]);let U=E2(z,T5);this.droppable=new g2(M,J,this),this.draggable=new r5(A5(R5({},M),{plugins:U,effects:()=>[()=>{var W,w,B;let O=(W=this.manager)==null?void 0:W.dragOperation.status;if((O==null?void 0:O.initializing)&&this.id===((B=(w=this.manager)==null?void 0:w.dragOperation.source)==null?void 0:B.id))J2.clear(this.manager);if(O==null?void 0:O.dragging)J2.set(this.manager,this.id,T2(()=>({initialIndex:this.index,initialGroup:this.group})))},()=>{let{index:W,group:w,manager:B}=this,O=D0(this,j0),P=D0(this,x0);if(W!==O||w!==P)H0(this,j0,W),H0(this,x0,w),this.animate()},()=>{var W,w;let{target:B}=this,{isDragSource:O}=this.draggable;if(((w=(W=this.draggable.pluginConfig(g5))==null?void 0:W.feedback)!=null?w:"default")==="move"&&O)this.droppable.disabled=!B},...X()],type:K,sensors:Q}),J,this),H0(this,U0,M.element),this.manager=J,this.index=N,H0(this,j0,N),this.group=Y,H0(this,x0,Y),this.type=K,this.transition=G}get initialIndex(){var $,J;return(J=($=J2.get(this.manager,this.id))==null?void 0:$.initialIndex)!=null?J:this.index}get initialGroup(){var $,J;return(J=($=J2.get(this.manager,this.id))==null?void 0:$.initialGroup)!=null?J:this.group}animate(){T2(()=>{let{manager:$,transition:J}=this,{shape:Z}=this.droppable;if(!$)return;let{idle:X}=$.dragOperation.status;if(!Z||!J||X&&!J.idle)return;$.renderer.rendering.then(()=>{let{element:Y}=this;if(!Y)return;for(let M of Y.getAnimations())if("transitionProperty"in M&&(M.transitionProperty==="transform"||M.transitionProperty==="translate"||M.transitionProperty==="scale"))M.cancel();let N=this.refreshShape();if(!N)return;let Q={x:Z.boundingRectangle.left-N.boundingRectangle.left,y:Z.boundingRectangle.top-N.boundingRectangle.top},{translate:K}=j5(Y),G=I2(Y,K,!1),z=I2(Y,K);if(Q.x||Q.y){let M=D5(E5(Y))?A5(R5({},J),{duration:0}):J;v5({element:Y,keyframes:{translate:[`${G.x+Q.x}px ${G.y+Q.y}px ${G.z}`,`${z.x}px ${z.y}px ${z.z}`]},options:M}).then(()=>{if(!$.dragOperation.status.dragging)this.droppable.shape=void 0})}})})}get manager(){return this.draggable.manager}set manager($){_(()=>{this.draggable.manager=$,this.droppable.manager=$})}set element($){_(()=>{let J=D0(this,U0),Z=this.droppable.element,X=this.draggable.element;if(!Z||Z===J)this.droppable.element=$;if(!X||X===J)this.draggable.element=$;H0(this,U0,$)})}get element(){var $,J;let Z=D0(this,U0);if(!Z)return;return(J=($=x5.get(Z))!=null?$:Z)!=null?J:this.droppable.element}set target($){this.droppable.element=$}get target(){return this.droppable.element}set source($){this.draggable.element=$}get source(){return this.draggable.element}get disabled(){return this.draggable.disabled&&this.droppable.disabled}set plugins($){this.draggable.plugins=E2($,T5)}set disabled($){_(()=>{this.droppable.disabled=$,this.draggable.disabled=$})}set data($){_(()=>{this.droppable.data=$,this.draggable.data=$})}set handle($){this.draggable.handle=$}set id($){this.droppable.id=$,this.draggable.id=$}get id(){return this.droppable.id}set sensors($){this.draggable.sensors=$}set modifiers($){this.draggable.modifiers=$}set collisionPriority($){this.droppable.collisionPriority=$}set collisionDetector($){this.droppable.collisionDetector=$!=null?$:_5}set alignment($){this.draggable.alignment=$}get alignment(){return this.draggable.alignment}set type($){_(()=>{this.droppable.type=$,this.draggable.type=$})}get type(){return this.draggable.type}set accept($){this.droppable.accept=$}get accept(){return this.droppable.accept}get isDropTarget(){return this.droppable.isDropTarget}get isDragSource(){return this.draggable.isDragSource}get isDragging(){return this.draggable.isDragging}get isDropping(){return this.draggable.isDropping}get status(){return this.draggable.status}refreshShape(){return this.droppable.refreshShape()}accepts($){return this.droppable.accepts($)}};t=q4();_2=new WeakMap;x0=new WeakMap;j0=new WeakMap;h2=new WeakMap;U0=new WeakMap;i5(t,4,"index",s5,v0,_2);i5(t,4,"group",o5,v0,h2);W4(t,v0);var r5=class extends b5{constructor($,J,Z){super($,J);this.sortable=Z}get index(){return this.sortable.index}get initialIndex(){return this.sortable.initialIndex}get group(){return this.sortable.group}get initialGroup(){return this.sortable.initialGroup}},g2=class extends c5{constructor($,J,Z){super($,J);this.sortable=Z}get index(){return this.sortable.index}get group(){return this.sortable.group}};var{defineProperty:P4,defineProperties:O4,getOwnPropertyDescriptors:T4,getOwnPropertySymbols:a5}=Object,S4=Object.prototype.hasOwnProperty,f4=Object.prototype.propertyIsEnumerable,t5=($,J,Z)=>(J in $)?P4($,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):$[J]=Z,m2=($,J)=>{for(var Z in J||(J={}))if(S4.call(J,Z))t5($,Z,J[Z]);if(a5){for(var Z of a5(J))if(f4.call(J,Z))t5($,Z,J[Z])}return $},E4=($,J)=>O4($,T4(J));function X1($){let{accept:J,collisionDetector:Z,collisionPriority:X,id:Y,data:N,element:Q,handle:K,index:G,group:z,disabled:M,modifiers:U,sensors:W,target:w,type:B,plugins:O}=$,P=m2(m2({},v2),$.transition),A=Z1((F)=>{return new v0(E4(m2({},$),{transition:P,register:!1,handle:X2(K),element:X2(Q),target:X2(w)}),F)}),S=$1(A,I4);return h(Y,()=>A.id=Y),e5(()=>{_(()=>{A.group=z,A.index=G})},[A,z,G]),h(B,()=>A.type=B),h(J,()=>A.accept=J,void 0,_0),h(N,()=>N&&(A.data=N)),h(G,()=>{var F;if(((F=A.manager)==null?void 0:F.dragOperation.status.idle)&&(P==null?void 0:P.idle))A.refreshShape()},J1),Y2(K,(F)=>A.handle=F),Y2(Q,(F)=>A.element=F),Y2(w,(F)=>A.target=F),h(M,()=>A.disabled=M===!0),h(W,()=>A.sensors=W),h(Z,()=>A.collisionDetector=Z),h(X,()=>A.collisionPriority=X),h(O,()=>A.plugins=O,void 0,_0),h(P,()=>A.transition=P,void 0,_0),h(U,()=>A.modifiers=U,void 0,_0),h($.alignment,()=>A.alignment=$.alignment),{sortable:S,get isDragging(){return S.isDragging},get isDropping(){return S.isDropping},get isDragSource(){return S.isDragSource},get isDropTarget(){return S.isDropTarget},handleRef:h0.useCallback((F)=>{A.handle=F!=null?F:void 0},[A]),ref:h0.useCallback((F)=>{var L,V;if(!F&&((L=A.element)==null?void 0:L.isConnected)&&!((V=A.manager)==null?void 0:V.dragOperation.status.idle))return;A.element=F!=null?F:void 0},[A]),sourceRef:h0.useCallback((F)=>{var L,V;if(!F&&((L=A.source)==null?void 0:L.isConnected)&&!((V=A.manager)==null?void 0:V.dragOperation.status.idle))return;A.source=F!=null?F:void 0},[A]),targetRef:h0.useCallback((F)=>{var L,V;if(!F&&((L=A.target)==null?void 0:L.isConnected)&&!((V=A.manager)==null?void 0:V.dragOperation.status.idle))return;A.target=F!=null?F:void 0},[A])}}function I4($,J,Z){if($==="isDragSource"&&!Z&&J)return!0;return!1}function Y1($,J,Z){let X=$.slice();return X.splice(Z,0,X.splice(J,1)[0]),X}async function H$($){let J=[],Z=[],X=$.items;if(X)for(let Q=0;Q<X.length;Q++){let K=X[Q];if(K.kind==="file"){let G=K.webkitGetAsEntry?.();if(G)Z.push({entry:G,path:""})}}else return Array.from($.files);let Y=(Q)=>{return new Promise((K)=>{Q.readEntries((G)=>K(G),()=>K([]))})},N=(Q)=>{return new Promise((K,G)=>{Q.file((z)=>K(z),(z)=>G(z))})};while(Z.length>0){let Q=Z.shift();if(!Q)continue;let{entry:K,path:G}=Q;if(K.isFile)try{let z=await N(K),M=G?`${G}/${z.name}`:z.name;Object.defineProperty(z,"webkitRelativePath",{value:M,writable:!1,configurable:!0}),J.push(z)}catch(z){console.error("Error reading file entry:",z)}else if(K.isDirectory){let z=K.createReader(),M=[],U=await Y(z);while(U.length>0)M=M.concat(U),U=await Y(z);let W=G?`${G}/${K.name}`:K.name;for(let w of M)Z.push({entry:w,path:W})}}return J}var c=d(l(),1);var D4=["red","orange","yellow","green","blue","purple","gray"],u2={red:{bg:"rgba(239, 68, 68, 0.15)",text:"#ef4444",hex:"#ef4444"},orange:{bg:"rgba(249, 115, 22, 0.15)",text:"#f97316",hex:"#f97316"},yellow:{bg:"rgba(234, 179, 8, 0.15)",text:"#ca8a04",hex:"#eab308"},green:{bg:"rgba(34, 197, 94, 0.15)",text:"#16a34a",hex:"#22c55e"},blue:{bg:"rgba(59, 130, 246, 0.15)",text:"#2563eb",hex:"#3b82f6"},purple:{bg:"rgba(168, 85, 247, 0.15)",text:"#9333ea",hex:"#a855f7"},gray:{bg:"rgba(128, 128, 128, 0.15)",text:"#4b5563",hex:"#808080"},system:{bg:"rgba(128, 128, 128, 0.1)",text:"#6b7280",hex:"#808080"}};function N0($){if(!$)return{backgroundColor:"rgba(128, 128, 128, 0.1)",color:"#6b7280"};let J=$.toLowerCase(),Z=u2[J];if(Z)return{backgroundColor:Z.bg,color:Z.text};if($.startsWith("#"))return{backgroundColor:`${$}33`,color:$};return{backgroundColor:"rgba(128, 128, 128, 0.1)",color:$}}var x4={[v.text]:F1,[v.longText]:K1,[v.select]:W1,[v.selectMulti]:M1,[v.rating]:r0,[v.number]:B1,[v.toggle]:U1,[v.date]:N1,[v.user]:w1,[v.userMulti]:V1};function j4({field:$,index:J,onVisibilityChange:Z}){let{ref:X,handleRef:Y}=X1({id:$.id,index:J}),N=$.config?.type?x4[$.config.type]:null;return R("div",{ref:X,className:"flex items-center justify-between p-2 rounded-md hover:bg-muted",children:[R("div",{className:"flex items-center gap-2",children:[H("div",{ref:Y,className:"cursor-grab",children:H(q1,{className:"h-4 w-4 text-muted-foreground"})}),N&&H(N,{className:"h-4 w-4 text-muted-foreground shrink-0"}),$.aiAutofill&&H(H1,{className:"h-4 w-4 text-muted-foreground shrink-0"}),H("span",{className:"text-sm truncate",children:$.config?.name})]}),H(m0,{checked:$.visible,onCheckedChange:(Q)=>Z($.id,Q)})]})}function O$({projectId:$,onManageFields:J,onSave:Z}){let{fields:X,updateFields:Y}=Q5(),[N,Q]=c.useState(""),[K,G]=c.useState("list"),[z,M]=c.useState(""),[U,W]=c.useState(""),[w,B]=c.useState(!1),[O,P]=c.useState(""),[A,S]=c.useState([]),F=Q1();c.useEffect(()=>{F.invalidateQueries({queryKey:["fields",$]})},[$,F]);let L=T0.api.projects[":projectId"].fields.order.$patch,{mutate:V}=b2({mutationFn:async(k)=>{if(!(await L(k)).ok)throw Error(I.failed_update_fields_order());return null}}),q=T0.api.projects[":projectId"].fields.$post,{mutate:C}=b2({mutationFn:async(k)=>{let f=await q(k);if(!f.ok)throw Error(I.failed_create_field());return await f.json()},onSuccess:(k)=>{let f={...k,visible:!0},E=[...X,f];Y(E),M(""),S([]),V({param:{projectId:$},json:E.map((j)=>({fieldId:j.id,visible:j.visible||!1}))}),Z?.()}}),T=c.useMemo(()=>X.filter((k)=>k.config?.name?.toLowerCase().includes(N.toLowerCase())),[X,N]),D=(k)=>{let{source:f,target:E}=k.operation;if(f&&E&&f.id!==E.id){let j=X.findIndex((q0)=>q0.id===f.id),y1=X.findIndex((q0)=>q0.id===E.id),d2=Y1(X,j,y1);Y(d2),V({param:{projectId:$},json:d2.map((q0)=>({fieldId:q0.id,visible:q0.visible||!1}))})}},x=(k,f)=>{let E=X.map((j)=>j.id===k?{...j,visible:f}:j);Y(E),V({param:{projectId:$},json:E.map((j)=>({fieldId:j.id,visible:j.visible||!1}))})},g=()=>{if(!z||!U)return;let k=U===v.select?{select:{options:A}}:U===v.selectMulti?{selectMulti:{options:A}}:{};C({param:{projectId:$},json:{config:{name:z,type:U,...k},label:z,aiAutofill:w,description:O}})},m=X.filter((k)=>k.visible).length;if(K==="create")return H("div",{className:"w-80 p-4",children:R("div",{className:"space-y-4",children:[R("div",{className:"space-y-2",children:[H(F0,{htmlFor:"field-name",children:I.field_name()}),H(g0,{id:"field-name",placeholder:I.new_field_placeholder(),value:z,onChange:(k)=>M(k.target.value),autoFocus:!0})]}),R("div",{className:"space-y-2",children:[H(F0,{children:I.field_type()}),R(L1,{children:[H(R1,{asChild:!0,children:R(e,{variant:"outline",className:"w-full justify-between font-normal",children:[U?H("span",{className:"capitalize",children:U.replace(/_/g," ")}):H("span",{className:"text-muted-foreground border-dashed",children:I.select_field_type()}),H(w0,{className:"ml-2 h-4 w-4 opacity-50"})]})}),H(A1,{className:"w-[--radix-dropdown-menu-trigger-width]",children:Object.values(v).map((k)=>H(C1,{onClick:()=>{W(k),S([])},className:"capitalize",children:k.replace(/_/g," ")},k))})]})]}),R("div",{className:"space-y-2",children:[H(F0,{htmlFor:"field-desc",children:I.description()}),H(g0,{id:"field-desc",placeholder:I.description_optional_placeholder(),value:O,onChange:(k)=>P(k.target.value)})]}),R("div",{className:"flex items-center space-x-2",children:[H(m0,{id:"ai-autofill",checked:w,onCheckedChange:B}),H(F0,{htmlFor:"ai-autofill",children:I.ai_autofill()})]}),(U===v.select||U===v.selectMulti)&&R("div",{className:"space-y-2",children:[R("div",{className:"flex items-center justify-between",children:[H(F0,{className:"text-sm font-medium",children:I.options()}),R(e,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>{let k={id:L5(),displayName:I.new_option(),color:"#808080"};S([...A,k])},children:[H(c2,{className:"h-4 w-4 mr-1"})," ",I.add_option()]})]}),H("div",{className:"space-y-2 max-h-40 overflow-y-auto pr-1",children:A.map((k,f)=>R("div",{className:"flex items-center gap-2",children:[H(g0,{value:k.displayName,onChange:(E)=>{let j=[...A];j[f]={...k,displayName:E.target.value},S(j)},placeholder:I.option_name_placeholder(),className:"h-8 flex-1"}),R(i,{children:[H(n,{asChild:!0,children:H("button",{type:"button",className:"w-6 h-6 rounded-full border shrink-0 cursor-pointer focus:outline-none hover:scale-105 transition-transform",style:{backgroundColor:u2[k.color||""]?.hex||k.color||"#808080"}})}),H(o,{className:"p-2 w-auto",align:"end",children:H("div",{className:"flex gap-1",children:D4.map((E)=>H("button",{type:"button",className:"w-5 h-5 rounded-full border cursor-pointer hover:scale-110 transition-transform",style:{backgroundColor:u2[E]?.hex||E},onClick:()=>{let j=[...A];j[f]={...k,color:E},S(j)}},E))})})]}),H(e,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>{S(A.filter((E,j)=>j!==f))},children:H(V0,{className:"h-4 w-4"})})]},k.id))})]}),R("div",{className:"flex gap-2 pt-2",children:[H(e,{variant:"secondary",className:"flex-1",onClick:()=>{G("list"),M(""),W(""),B(!1),P(""),S([])},children:I.cancel()}),H(e,{className:"flex-1",onClick:g,disabled:!z||!U,children:I.save()})]})]})});return R("div",{className:"w-80 p-4",children:[H("div",{className:"flex items-center justify-between mb-4",children:R("h3",{className:"font-semibold",children:[I.fields()," ",H("span",{className:"text-muted-foreground text-sm font-normal",children:I.visible_count({count:m})})]})}),R("div",{className:"relative mb-4",children:[H(z1,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),H(g0,{placeholder:I.search_fields_placeholder(),value:N,onChange:(k)=>Q(k.target.value),className:"pl-8"})]}),H("div",{className:"max-h-60 overflow-y-auto pr-2",children:H(T1,{sensors:[O1.configure({activationConstraints:[new P1.Distance({value:8})]}),k1],onDragEnd:D,children:T.map((k,f)=>H(j4,{field:k,index:f,onVisibilityChange:x},k.id))})}),J&&R("div",{className:"mt-4 space-y-2",children:[R(e,{variant:"secondary",className:"w-full",onClick:J,children:[H(G1,{className:"h-4 w-4 mr-2"}),I.manage_fields()]}),R(e,{className:"w-full",onClick:()=>G("create"),children:[H(c2,{className:"h-4 w-4 mr-2"}),I.new_field()]})]})]})}var y4=({value:$,config:J,onSave:Z,readOnly:X})=>{let Y=J?.select,[N,Q]=S1.useState(!1),K=Y?.options?.find((W)=>W.id===$),G=()=>{if(!X)Q(!0)},z=(W)=>{Z(W),Q(!1)};return H("div",{className:"relative w-full",onClick:(W)=>W.stopPropagation(),children:R(i,{open:!X&&N,onOpenChange:(W)=>{if(X)return;Q(W)},children:[H(n,{asChild:!0,children:R("div",{onClick:G,className:`flex items-center justify-between w-full min-h-[28px] px-2 py-1 rounded border border-transparent transition-colors ${!X?"cursor-pointer hover:bg-accent hover:border-border group":""}`,children:[((W)=>{if(!W)return H("span",{className:"text-muted-foreground italic",children:"Select an option"});return H("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:N0(W.color),children:W.displayName})})(K),!X&&H(w0,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),R(o,{className:"p-1 w-[--radix-popover-trigger-width] min-w-[150px] max-h-60 overflow-auto bg-popover border border-border rounded-lg shadow-lg",align:"start",children:[R("div",{onClick:()=>z(""),className:"px-3 py-2 text-sm text-muted-foreground hover:bg-accent cursor-pointer flex items-center gap-2",children:[H(V0,{className:"w-3 h-3"})," Clear"]}),Y?.options?.map((W)=>H("div",{onClick:()=>z(W.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center",children:H("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:N0(W.color),children:W.displayName})},W.id))]})]})})},f1=y4;var $0=d(l(),1);var v4=({value:$=[],config:J,onSave:Z,readOnly:X})=>{let Y=J?.selectMulti,N=$0.useRef(null),[Q,K]=$0.useState(!1),[G,z]=$0.useState(!1),[M,U]=$0.useState($.length),W=Y?.options?.filter((F)=>($||[]).includes(F.id))||[];$0.useLayoutEffect(()=>{if(Q||G){U(W.length);return}if(N.current){let F=N.current.offsetWidth,V=document.createElement("canvas").getContext("2d");if(V){V.font="12px ui-sans-serif, system-ui, sans-serif";let q=0,C=0,D=F-28;for(let x=0;x<W.length;x++){let m=V.measureText(W[x].displayName).width+16+4;if(q+m>D&&x<W.length-1)break;if(x===W.length-1){if(q+m<=F)C++;break}q+=m,C++}U(C)}}},[W,Q,G,$]);let w=(F)=>{let L=$||[],V;if(L.includes(F))V=L.filter((q)=>q!==F);else V=[...L,F];Z(V)},B=(F)=>{if(F.stopPropagation(),Q)return;let L=W.length-M;if(!G&&L>0)z(!0);else if(!X)K(!0)},O=(F)=>{if(F.stopPropagation(),!X)K(!0)},P=W.length-M;return H("div",{className:"relative w-full",onClick:(F)=>F.stopPropagation(),children:R(i,{open:!X&&(G&&!Q||Q),onOpenChange:(F)=>{if(X)return;if(!F)z(!1),K(!1)},children:[H(n,{asChild:!0,children:R("div",{ref:N,onClick:B,className:`w-full px-1 py-1 flex flex-wrap gap-1 rounded border border-transparent transition-all box-border h-[32px] overflow-hidden ${!X||P>0?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:[W.length===0&&H("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),W.slice(0,M).map((F)=>H("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium border border-transparent whitespace-nowrap h-[22px]",style:N0(F.color),children:F.displayName},F.id)),P>0&&R("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-muted text-muted-foreground h-[22px]",children:["+",P]})]})}),H(o,{className:`p-1 bg-popover border rounded-lg shadow-xl max-h-60 overflow-auto ${G&&!Q?"w-[--radix-popover-trigger-width] min-w-[200px] flex flex-wrap gap-1 border-ring min-h-[32px] h-auto cursor-pointer":"w-64 border-border"}`,align:"start",onClick:G&&!Q?O:void 0,children:G&&!Q?R(Q2,{children:[W.length===0&&H("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),W.map((F)=>H("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium border border-transparent whitespace-nowrap h-[22px]",style:N0(F.color),children:F.displayName},F.id))]}):Y?.options?.map((F)=>{let L=($||[]).includes(F.id);return R("div",{onClick:()=>w(F.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center justify-between",children:[H("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:N0(F.color),children:F.displayName}),L&&H(H2,{className:"w-4 h-4 text-primary"})]},F.id)})})]})})},E1=v4;var J0=d(l(),1);var _4=({value:$,onSave:J,readOnly:Z})=>{let[X,Y]=J0.useState(!1),[N,Q]=J0.useState($||""),K=J0.useRef(null);J0.useEffect(()=>{Q($||"")},[$]),J0.useEffect(()=>{if(X&&K.current)K.current.focus()},[X]);let G=()=>{if(!Z)Y(!0)},z=()=>{Y(!1),J(N)},M=(U)=>{if(U.key==="Enter")K.current?.blur()};if(X)return H("input",{ref:K,type:"text",value:N,onChange:(U)=>Q(U.target.value),onBlur:z,onKeyDown:M,className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm outline-none shadow-sm"});return H("div",{onClick:G,className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded truncate border border-transparent transition-colors ${!Z?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:$||H("span",{className:"text-muted-foreground italic",children:"Empty"})})},I1=_4;var h4=({value:$,onSave:J,readOnly:Z})=>{return H("div",{className:"flex items-center h-[28px] w-full",onClick:(Y)=>Y.stopPropagation(),children:H(m0,{checked:$,onCheckedChange:(Y)=>{if(!Z)J(Y)},disabled:Z,className:"cursor-pointer"})})},D1=h4;var N2=d(l(),1);var g4=({value:$,onSave:J,readOnly:Z})=>{let X=K2(),{members:Y,fetchMembers:N}=o0(),[Q,K]=N2.useState(!1);N2.useEffect(()=>{if(X)N(X)},[X,N]);let G=Y.find((B)=>B.id===$),z=()=>{if(!Z)K(!0)},M=(B)=>{J(B),K(!1)},U=(B)=>{if(Z)return;K(B)},W=(B)=>{return B.split(" ").map((O)=>O[0]).slice(0,2).join("").toUpperCase()};return H("div",{className:"relative w-full",onClick:(B)=>B.stopPropagation(),children:R(i,{open:!Z&&Q,onOpenChange:U,children:[H(n,{asChild:!0,children:R("div",{onClick:z,className:`flex items-center justify-between w-full h-[28px] px-2 rounded border border-transparent transition-colors ${!Z?"cursor-pointer hover:bg-accent hover:border-border group":""}`,children:[((B)=>{if(!B)return H("span",{className:"text-muted-foreground italic text-sm",children:"Select user"});return R("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-muted text-foreground border h-[22px]",children:[R(L0,{className:"w-4 h-4",children:[H(R0,{src:B.image,alt:B.name,className:"object-cover"}),H(A0,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:W(B.name)})]}),H("span",{className:"truncate max-w-[120px]",children:B.name})]})})(G),!Z&&H(w0,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),R(o,{className:"p-1 w-[--radix-popover-trigger-width] min-w-[200px] max-h-60 overflow-auto bg-popover border border-border rounded-lg shadow-lg",align:"start",children:[R("div",{onClick:()=>M(""),className:"px-3 py-2 text-sm text-muted-foreground hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[H(V0,{className:"w-3 h-3"})," Clear"]}),Y.map((B)=>R("div",{onClick:()=>M(B.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[R(L0,{className:"w-5 h-5",children:[H(R0,{src:B.image,alt:B.name,className:"object-cover"}),H(A0,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:W(B.name)})]}),H("span",{className:"text-sm font-medium text-foreground",children:B.name})]},B.id))]})]})})},x1=g4;var s=d(l(),1);var m4=({value:$=[],onSave:J,readOnly:Z})=>{let X=K2(),{members:Y,fetchMembers:N}=o0(),Q=s.useRef(null),[K,G]=s.useState(!1),[z,M]=s.useState(!1),[U,W]=s.useState($.length);s.useEffect(()=>{if(X)N(X)},[X,N]);let w=Y.filter((q)=>($||[]).includes(q.id)),B=(q)=>{return q.split(" ").map((C)=>C[0]).slice(0,2).join("").toUpperCase()};s.useLayoutEffect(()=>{if(K||z){W(w.length);return}if(Q.current){let q=Q.current.offsetWidth,T=document.createElement("canvas").getContext("2d");if(T){T.font="12px ui-sans-serif, system-ui, sans-serif";let D=0,x=0,m=q-28;for(let k=0;k<w.length;k++){let E=T.measureText(w[k].name).width+42;if(D+E>m&&k<w.length-1)break;if(k===w.length-1){if(D+E<=q)x++;break}D+=E,x++}W(x)}}},[w,K,z,$]);let O=(q)=>{let C=$||[],T;if(C.includes(q))T=C.filter((D)=>D!==q);else T=[...C,q];J(T)},P=(q)=>{if(q.stopPropagation(),K)return;let C=w.length-U;if(!z&&C>0)M(!0);else if(!Z)G(!0)},A=(q)=>{if(q.stopPropagation(),!Z)G(!0)},S=w.length-U,F=z&&!K||K,L=(q)=>{if(Z)return;if(!q)M(!1),G(!1)},V=(q)=>{return R("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-muted text-foreground border whitespace-nowrap h-[22px]",children:[R(L0,{className:"w-4 h-4",children:[H(R0,{src:q.image,alt:q.name,className:"object-cover"}),H(A0,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:B(q.name)})]}),H("span",{className:"truncate max-w-[100px]",children:q.name})]},q.id)};return H("div",{className:"relative w-full",onClick:(q)=>q.stopPropagation(),children:R(i,{open:!Z&&F,onOpenChange:L,children:[H(n,{asChild:!0,children:R("div",{ref:Q,onClick:P,className:`w-full px-1 py-1 flex flex-wrap gap-1 rounded border border-transparent transition-all box-border h-[32px] overflow-hidden ${!Z||S>0?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:[w.length===0&&H("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),w.slice(0,U).map(V),S>0&&R("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-muted text-muted-foreground h-[22px]",children:["+",S]})]})}),H(o,{className:`p-1 bg-popover border rounded-lg shadow-xl max-h-60 overflow-auto ${z&&!K?"w-[--radix-popover-trigger-width] min-w-[200px] flex flex-wrap gap-1 border-ring min-h-[32px] h-auto cursor-pointer":"w-64 border-border"}`,align:"start",onClick:z&&!K?A:void 0,children:z&&!K?R(Q2,{children:[w.length===0&&H("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),w.map(V)]}):Y.map((q)=>{let C=($||[]).includes(q.id);return R("div",{onClick:()=>O(q.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center justify-between rounded-sm",children:[R("div",{className:"flex items-center gap-2",children:[R(L0,{className:"w-5 h-5",children:[H(R0,{src:q.image,alt:q.name,className:"object-cover"}),H(A0,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:B(q.name)})]}),H("span",{className:"text-sm font-medium text-foreground",children:q.name})]}),C&&H(H2,{className:"w-4 h-4 text-primary"})]},q.id)})})]})})},j1=m4;var b4=($)=>{if(!$.config)return H("div",{children:"Unknown Field Type"});switch($.config.type){case"text":return H(I1,{...$,value:$.value,onSave:$.onSave});case"longText":return H(U5,{...$,value:$.value,onSave:$.onSave});case"select":return H(f1,{...$,value:$.value,onSave:$.onSave});case"selectMulti":return H(E1,{...$,value:$.value,onSave:$.onSave});case"rating":return H(V5,{...$,value:$.value,onSave:$.onSave});case"number":return H(F5,{...$,value:$.value,onSave:$.onSave});case"toggle":return H(D1,{...$,value:$.value,onSave:$.onSave});case"date":return H(M5,{...$,value:$.value,onSave:$.onSave});case"user":return H(x1,{...$,value:$.value,onSave:$.onSave});case"userMulti":return H(j1,{...$,value:$.value,onSave:$.onSave});default:return H("div",{children:"Unknown Field Type"})}},L6=b4;var C6=({progress:$,className:J})=>{let X=2*Math.PI*20,Y=X-Math.min(100,Math.max(0,$))/100*X;return R("svg",{viewBox:"0 0 50 50",className:a0("w-12 h-12",J),children:[H("circle",{cx:"25",cy:"25",r:20,className:"stroke-muted",strokeWidth:"4",fill:"transparent"}),H("circle",{cx:"25",cy:"25",r:20,className:"stroke-primary transition-all duration-300 ease-out",strokeWidth:"4",fill:"transparent",strokeDasharray:X,strokeDashoffset:Y,transform:"rotate(-90 25 25)"}),H("text",{x:"50%",y:"50%",textAnchor:"middle",dy:".3em",className:"fill-foreground text-[10px] font-bold",children:`${Math.round($)}%`})]})};var c4=($)=>{if(isNaN($))return"00:00";let J=new Date($*1000),Z=J.getUTCHours(),X=J.getUTCMinutes().toString().padStart(2,"0"),Y=J.getUTCSeconds().toString().padStart(2,"0");if(Z)return`${Z}:${X}:${Y}`;return`${X}:${Y}`},O6=($,J,Z,X)=>{if(Z==="frames")return`${$} fr`;if(Z==="standard")return c4($/J);let Y=Math.round(J),N=J!==Y,Q=!1;if(N&&(Y===30||Y===60))Q=!0;let K=0;if(X){let B=X.match(/^([012]\d):(\d\d):(\d\d)(:|;|\.)(\d+)$/);if(B){let O=parseInt(B[1],10),P=parseInt(B[2],10),A=parseInt(B[3],10),S=parseInt(B[5],10);if(Q=B[4]!==":",K=(O*3600+P*60+A)*Y+S,Q){let F=O*60+P,L=J<30?2:4;K-=L*(F-Math.floor(F/10))}}}let G=$+K;if(Q){let B=J<30?2:4,O=Math.floor(G/(17982*B/2)),P=G%(17982*B/2);if(P<B)P=P+B;G+=9*B*O+B*Math.floor((P-B)/(1798*B/2))}let z=G%Y,M=Math.floor(G/Y)%60,U=Math.floor(G/(Y*60))%60,W=Math.floor(G/(Y*3600))%24,w=Q?";":":";return`${W.toString().padStart(2,"0")}:${U.toString().padStart(2,"0")}:${M.toString().padStart(2,"0")}${w}${z.toString().padStart(2,"0")}`};var T6=($,J)=>{if(!J)return 0;let Z=1/J;return $*Z+Z/2},u4=($)=>Math.max(100,3000/($||30)),S6=({dbTotalFrames:$,containerDuration:J,frameRate:Z})=>{let X=Z||30,Y=Math.round(J*X);if($<=0)return Y;let N=$/X,Q=J-N,K=u4(X)/1000;return Q>K?Y:$};
|
|
2
|
+
export{L2 as o,H5 as p,N5 as q,C2 as r,k2 as s,Y1 as t,H$ as u,Q5 as v,L5 as w,C6 as x,V5 as y,i as z,n as A,o as B,X1 as C,D4 as D,u2 as E,N0 as F,x4 as G,O$ as H,o0 as I,L6 as J,c4 as K,O6 as L,T6 as M,u4 as N,S6 as O};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Ci as k,Pi as F,Qi as A,Ri as V,dg as t,eg as R}from"./chunk-dsnnmmd9.js";import{ak as l}from"./chunk-kbzm1pwx.js";function D(a,b){var f=a.length;a.push(b);a:for(;0<f;){var g=f-1>>>1,d=a[g];if(0<q(d,b))a[g]=b,a[f]=d,f=g;else break a}}function C(a){return a.length===0?null:a[0]}function H(a){if(a.length===0)return null;var b=a[0],f=a.pop();if(f!==b){a[0]=f;a:for(var g=0,d=a.length,Z=d>>>1;g<Z;){var $=2*(g+1)-1,P=a[$],N=$+1,G=a[N];if(0>q(P,f))N<d&&0>q(G,P)?(a[g]=G,a[N]=f,g=N):(a[g]=P,a[$]=f,g=$);else if(N<d&&0>q(G,f))a[g]=G,a[N]=f,g=N;else break a}}return b}function q(a,b){var f=a.sortIndex-b.sortIndex;return f!==0?f:a.id-b.id}function S(a){for(var b=C(o);b!==null;){if(b.callback===null)H(o);else if(b.startTime<=a)H(o),b.sortIndex=b.expirationTime,D(w,b);else break;b=C(o)}}function c(a){if(K=!1,S(a),!J)if(C(w)!==null)J=!0,E||(E=!0,B());else{var b=C(o);b!==null&&I(c,b.startTime-a)}}function m(){return n?!0:_()-L<p?!1:!0}function U(){if(n=!1,E){var a=_();L=a;var b=!0;try{a:{J=!1,K&&(K=!1,j(X),X=-1),T=!0;var f=O;try{t:{S(a);for(z=C(w);z!==null&&!(z.expirationTime>a&&m());){var g=z.callback;if(typeof g==="function"){z.callback=null,O=z.priorityLevel;var d=g(z.expirationTime<=a);if(a=_(),typeof d==="function"){z.callback=d,S(a),b=!0;break t}z===C(w)&&H(w),S(a)}else H(w);z=C(w)}if(z!==null)b=!0;else{var Z=C(o);Z!==null&&I(c,Z.startTime-a),b=!1}}break a}finally{z=null,O=f,T=!1}b=void 0}}finally{b?B():E=!1}}}function I(a,b){X=u(function(){a(_())},b)}var _=void 0,M,v,W,w,o,h=1,z=null,O=3,T=!1,J=!1,K=!1,n=!1,u,j,s,E=!1,X=-1,p=5,L=-1,B,Q,y,i=5,r=1,e=4,aa=3,ta=2,ba=function(a){a.callback=null},fa=function(){return O},ga=function(){n=!0},da=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var f=O;O=a;try{return b()}finally{O=f}},za=function(a,b,f){var g=_();switch(typeof f==="object"&&f!==null?(f=f.delay,f=typeof f==="number"&&0<f?g+f:g):f=g,a){case 1:var d=-1;break;case 2:d=250;break;case 5:d=1073741823;break;case 4:d=1e4;break;default:d=5000}return d=f+d,a={id:h++,callback:b,priorityLevel:a,startTime:f,expirationTime:d,sortIndex:-1},f>g?(a.sortIndex=f,D(o,a),C(w)===null&&a===C(o)&&(K?(j(X),X=-1):K=!0,I(c,f-g))):(a.sortIndex=d,D(w,a),J||T||(J=!0,E||(E=!0,B()))),a},Ca;var wa=l(()=>{if(typeof performance==="object"&&typeof performance.now==="function")M=performance,_=function(){return M.now()};else v=Date,W=v.now(),_=function(){return v.now()-W};w=[],o=[],u=typeof setTimeout==="function"?setTimeout:null,j=typeof clearTimeout==="function"?clearTimeout:null,s=typeof setImmediate<"u"?setImmediate:null;if(typeof s==="function")B=function(){s(U)};else if(typeof MessageChannel<"u")Q=new MessageChannel,y=Q.port2,Q.port1.onmessage=U,B=function(){y.postMessage(null)};else B=function(){u(U,0)};Ca=m});function Na({className:a,orientation:b="horizontal",...f}){return t(F.Root,{"data-slot":"tabs","data-orientation":b,orientation:b,className:V("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",a),...f})}var x=k("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Va({className:a,variant:b="default",...f}){return t(F.List,{"data-slot":"tabs-list","data-variant":b,className:V(x({variant:b}),a),...f})}function Aa({className:a,...b}){return t(F.Trigger,{"data-slot":"tabs-trigger",className:V("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",a),...b})}function Oa({className:a,...b}){return t(F.Content,{"data-slot":"tabs-content",className:V("flex-1 outline-none",a),...b})}function Ka({delayDuration:a=0,...b}){return t(A.Provider,{"data-slot":"tooltip-provider",delayDuration:a,...b})}function Xa({...a}){return t(A.Root,{"data-slot":"tooltip",...a})}function Za({...a}){return t(A.Trigger,{"data-slot":"tooltip-trigger",...a})}function $a({className:a,sideOffset:b=0,children:f,...g}){return t(A.Portal,{children:R(A.Content,{"data-slot":"tooltip-content",sideOffset:b,className:V("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",a),...g,children:[f,t(A.Arrow,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}var Y={viewBox:"0 -960 960 960",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},qa=(a)=>t("svg",{...Y,...a,children:t("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm120-80v-560H200v560h120Zm80 0h360v-560H400v560Z"})}),va=(a)=>t("svg",{...Y,...a,children:t("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm360-80v-560H200v560h360Zm200 0v-560H640v560h120Z"})}),Sa=(a)=>t("svg",{...Y,...a,children:t("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm560-80v-560H400v560h360Z"})}),Qa=(a)=>t("svg",{...Y,...a,children:t("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm360-80v-560H200v560h360Z"})}),Ha=(a)=>R("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...a,children:[t("path",{d:"M12 8V4H8"}),t("path",{d:"M6 7H18A3 3 0 0 1 21 10V18A3 3 0 0 1 18 21H6A3 3 0 0 1 3 18V10A3 3 0 0 1 6 7ZM8 13V15A1 1 0 0 0 10 15V13A1 1 0 0 0 8 13ZM14 13V15A1 1 0 0 0 16 15V13A1 1 0 0 0 14 13Z",fill:"currentColor",stroke:"none"}),t("path",{d:"M2 14h2"}),t("path",{d:"M20 14h2"})]}),Pa=(a)=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:30,height:30,viewBox:"120 -792 720 720",fill:"none","aria-hidden":"true",focusable:"false",...a,children:t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M 160 -180 v -72 h 80 v -252 q 0 -74.7 50 -132.75 T 420 -712.8 v -25.2 q 0 -22.5 17.5 -38.25 T 480 -792 q 25 0 42.5 15.75 T 540 -738 v 25.2 q 80 18 130 76.05 T 720 -504 v 252 h 80 v 72 H 160 Z M 480 -72 q -33 0 -56.5 -21.15 T 400 -144 h 160 q 0 29.7 -23.5 50.85 T 480 -72 Z",fill:"currentColor"})}),Ua=(a)=>R("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",...a,children:[t("path",{d:"M10.77 10.377a1 1 0 0 0-.132.437l-.105 1.665a.5.5 0 0 0 .793.436l1.32-.96a1 1 0 0 0 .278-.309l3.912-6.775a1.25 1.25 0 1 0-2.165-1.25l-3.901 6.756Z",fill:"currentColor"}),t("path",{d:"M11.016 6.75a.758.758 0 0 1-.758.748c-2.938 0-4.882 1.71-5.517 3.95-.708 2.499.245 4.459 1.979 5.851 1.767 1.42 4.31 2.203 6.547 2.203.415 0 .749.335.745.748a.758.758 0 0 1-.758.748c-2.536 0-5.421-.873-7.485-2.531-2.098-1.686-3.38-4.225-2.475-7.414.818-2.883 3.354-5.051 6.977-5.051.415 0 .749.335.745.748Z",fill:"currentColor"}),t("path",{d:"M17.147 8.315a.767.767 0 0 1 1.058-.168c1.666 1.188 2.508 2.542 2.733 3.876a4.5 4.5 0 0 1-.805 3.392c-.919 1.434-2.714 2.074-4.479 2.185-1.799.113-3.78-.302-5.292-1.216a.733.733 0 0 1-.242-1.022.768.768 0 0 1 1.042-.246c1.216.734 2.881 1.096 4.409 1 1.553-.097 2.755-.647 3.292-1.5l.015-.022.015-.021a3.025 3.025 0 0 0 .553-2.294c-.148-.876-.72-1.915-2.137-2.926a.733.733 0 0 1-.162-1.038Z",fill:"currentColor"})]}),Da=(a)=>{return R("svg",{viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a,children:[t("defs",{children:t("clipPath",{id:"bg-clip",children:t("rect",{x:"5",y:"5",width:"90",height:"90",rx:"22"})})}),t("rect",{x:"5",y:"5",width:"90",height:"90",rx:"22",fill:"#D95A66"}),t("path",{d:"M 35 75 L 65 75 L 80 60 L 75 30 L 175 130 L 135 175 Z",fill:"#A8384D",clipPath:"url(#bg-clip)"}),t("path",{d:"M 25 30 Q 38 36 50 42 L 35 55 L 35 75 L 20 60 Z",fill:"#FDF0D5"}),t("path",{d:"M 50 42 Q 62 36 75 30 L 80 60 L 65 75 L 65 55 Z",fill:"#E77A65"}),t("path",{d:"M 35 75 L 65 75 L 65 55 L 50 42 L 35 55 Z",fill:"#F5B895"}),t("path",{d:"M 50 42 Q 38 36 25 30 Q 38 26 50 20 Q 62 26 75 30 Q 62 36 50 42 Z",fill:"#F4B8B8"}),t("path",{d:"M 50 25 L 42 30 L 50 35 Z",fill:"#E57A5F"}),t("path",{d:"M 50 25 L 58 30 L 50 35 Z",fill:"#C2523C"})]})},Ma=(a)=>t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"24 24 152 152",fill:"none","aria-hidden":"true",focusable:"false",...a,children:t("path",{d:"M 44 170 L 44 100 L 24 100 L 100 30 L 126 54 L 126 36 L 142 36 L 142 69 L 176 100 L 156 100 L 156 170 L 120 170 L 120 136 A 20 20 0 0 0 80 136 L 80 170 Z",fill:"currentColor"})});function Wa({uploading:a=!1,className:b="",...f}){return R("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"15 15 70 70",width:30,height:30,className:`${b} ${a?"animate-upload-breathing":""}`,"aria-hidden":"true",focusable:"false",style:a?{transformOrigin:"center"}:void 0,...f,children:[a&&t("defs",{children:R("linearGradient",{id:"upload-gradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[t("stop",{offset:"0%",stopColor:"#3b82f6",children:t("animate",{attributeName:"stop-color",values:"#3b82f6;#ec4899;#8b5cf6;#3b82f6",dur:"3s",repeatCount:"indefinite"})}),t("stop",{offset:"50%",stopColor:"#8b5cf6",children:t("animate",{attributeName:"stop-color",values:"#8b5cf6;#3b82f6;#ec4899;#8b5cf6",dur:"3s",repeatCount:"indefinite"})}),t("stop",{offset:"100%",stopColor:"#ec4899",children:t("animate",{attributeName:"stop-color",values:"#ec4899;#8b5cf6;#3b82f6;#ec4899",dur:"3s",repeatCount:"indefinite"})})]})}),t("path",{d:"M 44.1 75 H 30 A 15 15 0 0 1 30 45 A 20 20 0 0 1 70 45 A 15 15 0 0 1 70 75 H 55.9 V 60.2 H 61.9 L 50 45.3 L 38.1 60.2 H 44.1 Z",fill:a?"url(#upload-gradient)":"currentColor"})]})}
|
|
1
|
+
import{Ai as k,Ni as F,Oi as A,Pi as V,bg as t,cg as R}from"./chunk-nwtb6dt1.js";import{ak as l}from"./chunk-kbzm1pwx.js";function D(a,b){var f=a.length;a.push(b);a:for(;0<f;){var g=f-1>>>1,d=a[g];if(0<q(d,b))a[g]=b,a[f]=d,f=g;else break a}}function C(a){return a.length===0?null:a[0]}function H(a){if(a.length===0)return null;var b=a[0],f=a.pop();if(f!==b){a[0]=f;a:for(var g=0,d=a.length,Z=d>>>1;g<Z;){var $=2*(g+1)-1,P=a[$],N=$+1,G=a[N];if(0>q(P,f))N<d&&0>q(G,P)?(a[g]=G,a[N]=f,g=N):(a[g]=P,a[$]=f,g=$);else if(N<d&&0>q(G,f))a[g]=G,a[N]=f,g=N;else break a}}return b}function q(a,b){var f=a.sortIndex-b.sortIndex;return f!==0?f:a.id-b.id}function S(a){for(var b=C(o);b!==null;){if(b.callback===null)H(o);else if(b.startTime<=a)H(o),b.sortIndex=b.expirationTime,D(w,b);else break;b=C(o)}}function c(a){if(K=!1,S(a),!J)if(C(w)!==null)J=!0,E||(E=!0,B());else{var b=C(o);b!==null&&I(c,b.startTime-a)}}function m(){return n?!0:_()-L<p?!1:!0}function U(){if(n=!1,E){var a=_();L=a;var b=!0;try{a:{J=!1,K&&(K=!1,j(X),X=-1),T=!0;var f=O;try{t:{S(a);for(z=C(w);z!==null&&!(z.expirationTime>a&&m());){var g=z.callback;if(typeof g==="function"){z.callback=null,O=z.priorityLevel;var d=g(z.expirationTime<=a);if(a=_(),typeof d==="function"){z.callback=d,S(a),b=!0;break t}z===C(w)&&H(w),S(a)}else H(w);z=C(w)}if(z!==null)b=!0;else{var Z=C(o);Z!==null&&I(c,Z.startTime-a),b=!1}}break a}finally{z=null,O=f,T=!1}b=void 0}}finally{b?B():E=!1}}}function I(a,b){X=u(function(){a(_())},b)}var _=void 0,M,v,W,w,o,h=1,z=null,O=3,T=!1,J=!1,K=!1,n=!1,u,j,s,E=!1,X=-1,p=5,L=-1,B,Q,y,i=5,r=1,e=4,aa=3,ta=2,ba=function(a){a.callback=null},fa=function(){return O},ga=function(){n=!0},da=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var f=O;O=a;try{return b()}finally{O=f}},za=function(a,b,f){var g=_();switch(typeof f==="object"&&f!==null?(f=f.delay,f=typeof f==="number"&&0<f?g+f:g):f=g,a){case 1:var d=-1;break;case 2:d=250;break;case 5:d=1073741823;break;case 4:d=1e4;break;default:d=5000}return d=f+d,a={id:h++,callback:b,priorityLevel:a,startTime:f,expirationTime:d,sortIndex:-1},f>g?(a.sortIndex=f,D(o,a),C(w)===null&&a===C(o)&&(K?(j(X),X=-1):K=!0,I(c,f-g))):(a.sortIndex=d,D(w,a),J||T||(J=!0,E||(E=!0,B()))),a},Ca;var wa=l(()=>{if(typeof performance==="object"&&typeof performance.now==="function")M=performance,_=function(){return M.now()};else v=Date,W=v.now(),_=function(){return v.now()-W};w=[],o=[],u=typeof setTimeout==="function"?setTimeout:null,j=typeof clearTimeout==="function"?clearTimeout:null,s=typeof setImmediate<"u"?setImmediate:null;if(typeof s==="function")B=function(){s(U)};else if(typeof MessageChannel<"u")Q=new MessageChannel,y=Q.port2,Q.port1.onmessage=U,B=function(){y.postMessage(null)};else B=function(){u(U,0)};Ca=m});function Na({className:a,orientation:b="horizontal",...f}){return t(F.Root,{"data-slot":"tabs","data-orientation":b,orientation:b,className:V("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",a),...f})}var x=k("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Va({className:a,variant:b="default",...f}){return t(F.List,{"data-slot":"tabs-list","data-variant":b,className:V(x({variant:b}),a),...f})}function Aa({className:a,...b}){return t(F.Trigger,{"data-slot":"tabs-trigger",className:V("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",a),...b})}function Oa({className:a,...b}){return t(F.Content,{"data-slot":"tabs-content",className:V("flex-1 outline-none",a),...b})}function Ka({delayDuration:a=0,...b}){return t(A.Provider,{"data-slot":"tooltip-provider",delayDuration:a,...b})}function Xa({...a}){return t(A.Root,{"data-slot":"tooltip",...a})}function Za({...a}){return t(A.Trigger,{"data-slot":"tooltip-trigger",...a})}function $a({className:a,sideOffset:b=0,children:f,...g}){return t(A.Portal,{children:R(A.Content,{"data-slot":"tooltip-content",sideOffset:b,className:V("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",a),...g,children:[f,t(A.Arrow,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}var Y={viewBox:"0 -960 960 960",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},qa=(a)=>t("svg",{...Y,...a,children:t("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm120-80v-560H200v560h120Zm80 0h360v-560H400v560Z"})}),va=(a)=>t("svg",{...Y,...a,children:t("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm360-80v-560H200v560h360Zm200 0v-560H640v560h120Z"})}),Sa=(a)=>t("svg",{...Y,...a,children:t("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm560-80v-560H400v560h360Z"})}),Qa=(a)=>t("svg",{...Y,...a,children:t("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm360-80v-560H200v560h360Z"})}),Ha=(a)=>R("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...a,children:[t("path",{d:"M12 8V4H8"}),t("path",{d:"M6 7H18A3 3 0 0 1 21 10V18A3 3 0 0 1 18 21H6A3 3 0 0 1 3 18V10A3 3 0 0 1 6 7ZM8 13V15A1 1 0 0 0 10 15V13A1 1 0 0 0 8 13ZM14 13V15A1 1 0 0 0 16 15V13A1 1 0 0 0 14 13Z",fill:"currentColor",stroke:"none"}),t("path",{d:"M2 14h2"}),t("path",{d:"M20 14h2"})]}),Pa=(a)=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:30,height:30,viewBox:"120 -792 720 720",fill:"none","aria-hidden":"true",focusable:"false",...a,children:t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M 160 -180 v -72 h 80 v -252 q 0 -74.7 50 -132.75 T 420 -712.8 v -25.2 q 0 -22.5 17.5 -38.25 T 480 -792 q 25 0 42.5 15.75 T 540 -738 v 25.2 q 80 18 130 76.05 T 720 -504 v 252 h 80 v 72 H 160 Z M 480 -72 q -33 0 -56.5 -21.15 T 400 -144 h 160 q 0 29.7 -23.5 50.85 T 480 -72 Z",fill:"currentColor"})}),Ua=(a)=>R("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",...a,children:[t("path",{d:"M10.77 10.377a1 1 0 0 0-.132.437l-.105 1.665a.5.5 0 0 0 .793.436l1.32-.96a1 1 0 0 0 .278-.309l3.912-6.775a1.25 1.25 0 1 0-2.165-1.25l-3.901 6.756Z",fill:"currentColor"}),t("path",{d:"M11.016 6.75a.758.758 0 0 1-.758.748c-2.938 0-4.882 1.71-5.517 3.95-.708 2.499.245 4.459 1.979 5.851 1.767 1.42 4.31 2.203 6.547 2.203.415 0 .749.335.745.748a.758.758 0 0 1-.758.748c-2.536 0-5.421-.873-7.485-2.531-2.098-1.686-3.38-4.225-2.475-7.414.818-2.883 3.354-5.051 6.977-5.051.415 0 .749.335.745.748Z",fill:"currentColor"}),t("path",{d:"M17.147 8.315a.767.767 0 0 1 1.058-.168c1.666 1.188 2.508 2.542 2.733 3.876a4.5 4.5 0 0 1-.805 3.392c-.919 1.434-2.714 2.074-4.479 2.185-1.799.113-3.78-.302-5.292-1.216a.733.733 0 0 1-.242-1.022.768.768 0 0 1 1.042-.246c1.216.734 2.881 1.096 4.409 1 1.553-.097 2.755-.647 3.292-1.5l.015-.022.015-.021a3.025 3.025 0 0 0 .553-2.294c-.148-.876-.72-1.915-2.137-2.926a.733.733 0 0 1-.162-1.038Z",fill:"currentColor"})]}),Da=(a)=>{return R("svg",{viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a,children:[t("defs",{children:t("clipPath",{id:"bg-clip",children:t("rect",{x:"5",y:"5",width:"90",height:"90",rx:"22"})})}),t("rect",{x:"5",y:"5",width:"90",height:"90",rx:"22",fill:"#D95A66"}),t("path",{d:"M 35 75 L 65 75 L 80 60 L 75 30 L 175 130 L 135 175 Z",fill:"#A8384D",clipPath:"url(#bg-clip)"}),t("path",{d:"M 25 30 Q 38 36 50 42 L 35 55 L 35 75 L 20 60 Z",fill:"#FDF0D5"}),t("path",{d:"M 50 42 Q 62 36 75 30 L 80 60 L 65 75 L 65 55 Z",fill:"#E77A65"}),t("path",{d:"M 35 75 L 65 75 L 65 55 L 50 42 L 35 55 Z",fill:"#F5B895"}),t("path",{d:"M 50 42 Q 38 36 25 30 Q 38 26 50 20 Q 62 26 75 30 Q 62 36 50 42 Z",fill:"#F4B8B8"}),t("path",{d:"M 50 25 L 42 30 L 50 35 Z",fill:"#E57A5F"}),t("path",{d:"M 50 25 L 58 30 L 50 35 Z",fill:"#C2523C"})]})},Ma=(a)=>t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"24 24 152 152",fill:"none","aria-hidden":"true",focusable:"false",...a,children:t("path",{d:"M 44 170 L 44 100 L 24 100 L 100 30 L 126 54 L 126 36 L 142 36 L 142 69 L 176 100 L 156 100 L 156 170 L 120 170 L 120 136 A 20 20 0 0 0 80 136 L 80 170 Z",fill:"currentColor"})});function Wa({uploading:a=!1,className:b="",...f}){return R("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"15 15 70 70",width:30,height:30,className:`${b} ${a?"animate-upload-breathing":""}`,"aria-hidden":"true",focusable:"false",style:a?{transformOrigin:"center"}:void 0,...f,children:[a&&t("defs",{children:R("linearGradient",{id:"upload-gradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[t("stop",{offset:"0%",stopColor:"#3b82f6",children:t("animate",{attributeName:"stop-color",values:"#3b82f6;#ec4899;#8b5cf6;#3b82f6",dur:"3s",repeatCount:"indefinite"})}),t("stop",{offset:"50%",stopColor:"#8b5cf6",children:t("animate",{attributeName:"stop-color",values:"#8b5cf6;#3b82f6;#ec4899;#8b5cf6",dur:"3s",repeatCount:"indefinite"})}),t("stop",{offset:"100%",stopColor:"#ec4899",children:t("animate",{attributeName:"stop-color",values:"#ec4899;#8b5cf6;#3b82f6;#ec4899",dur:"3s",repeatCount:"indefinite"})})]})}),t("path",{d:"M 44.1 75 H 30 A 15 15 0 0 1 30 45 A 20 20 0 0 1 70 45 A 15 15 0 0 1 70 75 H 55.9 V 60.2 H 61.9 L 50 45.3 L 38.1 60.2 H 44.1 Z",fill:a?"url(#upload-gradient)":"currentColor"})]})}
|
|
2
2
|
export{_ as Ie,i as Je,r as Ke,e as Le,aa as Me,ta as Ne,ba as Oe,fa as Pe,ga as Qe,da as Re,za as Se,Ca as Te,wa as Ue,Ka as Ve,Xa as We,Za as Xe,$a as Ye,Na as Ze,Va as _e,Aa as $e,Oa as af,qa as bf,va as cf,Sa as df,Qa as ef,Ha as ff,Pa as gf,Ua as hf,Da as if,Ma as jf,Wa as kf};
|