@shumai-one/shumai 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/bin/{chunk-qag3w2dd.js → chunk-0aj303as.js} +1 -1
  2. package/bin/{chunk-976v5s8y.js → chunk-0qkj838r.js} +1 -1
  3. package/bin/{chunk-mg6fce5x.js → chunk-0rxhc7ka.js} +1 -1
  4. package/bin/chunk-0xbf8bcg.js +2 -0
  5. package/bin/{chunk-t1mxqskx.js → chunk-15sefy5t.js} +1 -1
  6. package/bin/{chunk-jfjcxyhf.js → chunk-1wm57c6y.js} +3 -3
  7. package/bin/{chunk-7ktvhtp1.js → chunk-1xpec5r8.js} +1 -1
  8. package/bin/chunk-23d3968z.js +2 -0
  9. package/bin/{chunk-y4s3xr4n.js → chunk-262hkppb.js} +2 -2
  10. package/bin/{chunk-qj2kpkje.js → chunk-29tx9qe2.js} +1 -1
  11. package/bin/{chunk-a5s5ny4z.js → chunk-2aamsc5v.js} +1 -1
  12. package/bin/{chunk-gd5xwgp6.js → chunk-2aascrtb.js} +1 -1
  13. package/bin/chunk-2g12s6mc.js +2 -0
  14. package/bin/{chunk-pv76qkym.js → chunk-31baz5n0.js} +1 -1
  15. package/bin/{chunk-hmsb7ehr.js → chunk-46ar48f9.js} +1 -1
  16. package/bin/chunk-4e3jbp84.js +1 -0
  17. package/bin/chunk-4jk0y1w1.js +1 -0
  18. package/bin/{chunk-ga0drqj7.js → chunk-4qpa7b5t.js} +1 -1
  19. package/bin/{chunk-99db4j0k.js → chunk-54tr7y2x.js} +1 -1
  20. package/bin/{chunk-9n783gva.js → chunk-5d2q46mx.js} +1 -1
  21. package/bin/{chunk-qf7n519d.js → chunk-5m9be8an.js} +2 -2
  22. package/bin/{chunk-1w9dnk5p.js → chunk-5r8858hx.js} +1 -1
  23. package/bin/{chunk-ydagqpny.js → chunk-5t6c3038.js} +1 -1
  24. package/bin/chunk-6z65xd0w.js +3 -0
  25. package/bin/{chunk-qjjr3fff.js → chunk-77r8w95d.js} +1 -1
  26. package/bin/chunk-7e06b2zb.js +2 -0
  27. package/bin/{chunk-58aabg1f.js → chunk-7hsgmjpa.js} +2 -2
  28. package/bin/{chunk-7mnezagc.js → chunk-88fg1sw7.js} +1 -1
  29. package/bin/{chunk-m11g9hx7.js → chunk-8mkfgcvb.js} +2 -2
  30. package/bin/chunk-8tf6kgdj.js +2 -0
  31. package/bin/{chunk-b9hb5jzt.js → chunk-8wqfkm4c.js} +1 -1
  32. package/bin/{chunk-ag35pxnb.js → chunk-922nnh39.js} +1 -1
  33. package/bin/{chunk-ymyyap80.js → chunk-925q4paa.js} +1 -1
  34. package/bin/{chunk-wfex9jw0.js → chunk-92xxys10.js} +6 -6
  35. package/bin/{chunk-0a5k9avd.js → chunk-97jzve52.js} +1 -1
  36. package/bin/{chunk-dzm2f82x.js → chunk-9ab6k4rq.js} +1 -1
  37. package/bin/{chunk-mwh2n8yt.js → chunk-9avkn3x1.js} +1 -1
  38. package/bin/{chunk-pmx9760x.js → chunk-9h027f50.js} +1 -1
  39. package/bin/chunk-av71yjaa.js +1 -0
  40. package/bin/{chunk-mjncyjwf.js → chunk-b8js74jk.js} +1 -1
  41. package/bin/{chunk-861dz0bf.js → chunk-bd71dp4j.js} +1 -1
  42. package/bin/{chunk-v3j7acwn.js → chunk-bs0fjz3w.js} +2 -2
  43. package/bin/chunk-byqc8tzq.js +1 -0
  44. package/bin/chunk-ccw7mjgq.js +5 -0
  45. package/bin/{chunk-kj751zje.js → chunk-cxhmr356.js} +1 -1
  46. package/bin/{chunk-hcz4snm7.js → chunk-d3wmdjze.js} +1 -1
  47. package/bin/{chunk-82w2419d.js → chunk-de99643r.js} +2 -2
  48. package/bin/{chunk-dwf5e5g3.js → chunk-dghtwyq1.js} +1 -1
  49. package/bin/{chunk-5k03xpzq.js → chunk-dqgv5yy1.js} +1 -1
  50. package/bin/{chunk-q72ax3m8.js → chunk-e3s3rz2e.js} +1 -1
  51. package/bin/{chunk-79n633wf.js → chunk-e52nga6c.js} +1 -1
  52. package/bin/{chunk-8abs8d48.js → chunk-e7ndw3hg.js} +2 -2
  53. package/bin/chunk-f14sqw1d.js +1 -0
  54. package/bin/chunk-f7sbkfmk.js +2 -0
  55. package/bin/{chunk-2xnys7v4.js → chunk-fa2g2wge.js} +1 -1
  56. package/bin/{chunk-044xt1se.js → chunk-fbte2rmd.js} +1 -1
  57. package/bin/{chunk-k1r17nfa.js → chunk-fcvtgx1y.js} +1 -1
  58. package/bin/chunk-fd5a3pdd.js +1 -0
  59. package/bin/{chunk-hqptebzb.js → chunk-fepymbka.js} +1 -1
  60. package/bin/{chunk-cpr05qng.js → chunk-fz88kkk1.js} +1 -1
  61. package/bin/chunk-g6zzg6v2.js +1 -0
  62. package/bin/{chunk-6724dtsx.js → chunk-g8th86na.js} +1 -1
  63. package/bin/chunk-gswbc6y9.js +2 -0
  64. package/bin/{chunk-pvy0gccg.js → chunk-gtrc5ka2.js} +1 -1
  65. package/bin/chunk-h0ytx8zc.js +2 -0
  66. package/bin/{chunk-mv8c5fky.js → chunk-hkbybhww.js} +1 -1
  67. package/bin/{chunk-e3c6hyz8.js → chunk-hr97a5j5.js} +1 -1
  68. package/bin/{chunk-7h75r7ep.js → chunk-j8qtab70.js} +1 -1
  69. package/bin/{chunk-jyjnt0s9.js → chunk-jf3vn5c3.js} +2 -2
  70. package/bin/{chunk-azfgjqjx.js → chunk-kfhtk3eh.js} +1 -1
  71. package/bin/chunk-kr06nrbx.js +2 -0
  72. package/bin/{chunk-nceqrqey.js → chunk-m4zpf9gg.js} +1 -1
  73. package/bin/{chunk-1ae8csk6.js → chunk-mqjzmn0e.js} +1 -1
  74. package/bin/{chunk-sp75qe28.js → chunk-mzg1h07d.js} +1 -1
  75. package/bin/{chunk-cj5qwc9c.js → chunk-nrwna4ha.js} +1 -1
  76. package/bin/chunk-nyhqy6q2.js +62 -0
  77. package/bin/{chunk-4zq8vxcy.css → chunk-pmswtfe3.css} +1 -1
  78. package/bin/chunk-pq18zenh.js +2 -0
  79. package/bin/{chunk-p3emandj.js → chunk-q24epdh8.js} +2 -2
  80. package/bin/{chunk-2djd6pq1.js → chunk-qksb0v3c.js} +2 -2
  81. package/bin/chunk-qqk51620.js +2 -0
  82. package/bin/chunk-r0w920zb.js +1 -0
  83. package/bin/{chunk-2dz8nn9v.js → chunk-re0b7sj7.js} +1 -1
  84. package/bin/{chunk-x9q2vzn8.js → chunk-rtngbgpk.js} +1 -1
  85. package/bin/{chunk-zn9jbc6t.js → chunk-ry33f2qk.js} +1 -1
  86. package/bin/{chunk-k5bekrrp.js → chunk-s46zwr4p.js} +1 -1
  87. package/bin/chunk-s8t74q9m.js +1 -0
  88. package/bin/chunk-sd86v1e6.js +1 -0
  89. package/bin/{chunk-v98yavtp.js → chunk-srn8t0v7.js} +1 -1
  90. package/bin/chunk-szzff7gd.js +1 -0
  91. package/bin/{chunk-46c5xkmn.js → chunk-t3t6021k.js} +1 -1
  92. package/bin/{chunk-jbde7evp.js → chunk-thsbcbay.js} +1 -1
  93. package/bin/chunk-tspps87j.js +1 -0
  94. package/bin/{chunk-v05d1aeq.js → chunk-w7dn1m95.js} +1 -1
  95. package/bin/{chunk-w1d5vmtc.js → chunk-wc8sc9r9.js} +1 -1
  96. package/bin/chunk-wg98cacx.js +2 -0
  97. package/bin/chunk-wsyg4rwg.js +2 -0
  98. package/bin/{chunk-ga3mh3cd.js → chunk-xcwbg4w9.js} +1 -1
  99. package/bin/{chunk-9bpjfkjf.js → chunk-xyjw8w3r.js} +1 -1
  100. package/bin/chunk-y2qp11v9.js +1 -0
  101. package/bin/{chunk-ngd23mtc.js → chunk-ybhgmvxa.js} +1 -1
  102. package/bin/{chunk-phw4ne8b.js → chunk-ygz6pawn.js} +1 -1
  103. package/bin/{chunk-hy50c4pw.js → chunk-ymeycphq.js} +2 -2
  104. package/bin/{chunk-c1v946wb.js → chunk-zemrvz79.js} +2 -2
  105. package/bin/{chunk-29pkpmvy.js → chunk-zzx99j8t.js} +1 -1
  106. package/bin/shumai-app.html +1 -1
  107. package/bin/shumai-app.js +248 -224
  108. package/package.json +7 -7
  109. package/prisma/migrations/20260723025234_add_ai_usage_table/migration.sql +28 -0
  110. package/prisma/migrations/20260723032755_add_ai_usage_unique_constraint/migration.sql +8 -0
  111. package/prisma/schema.prisma +25 -0
  112. package/bin/chunk-211y81mp.js +0 -1
  113. package/bin/chunk-25d1g086.js +0 -2
  114. package/bin/chunk-4fnak2zn.js +0 -2
  115. package/bin/chunk-50ebjdkv.js +0 -2
  116. package/bin/chunk-5j7axztv.js +0 -2
  117. package/bin/chunk-6h4ay2p8.js +0 -2
  118. package/bin/chunk-6w5cn6p3.js +0 -3
  119. package/bin/chunk-75jka5v9.js +0 -5
  120. package/bin/chunk-9evm8x70.js +0 -1
  121. package/bin/chunk-bepnbw1g.js +0 -2
  122. package/bin/chunk-bg24g9kk.js +0 -1
  123. package/bin/chunk-dqtq9t8e.js +0 -1
  124. package/bin/chunk-fgnxtqtk.js +0 -1
  125. package/bin/chunk-fxvb6g2r.js +0 -1
  126. package/bin/chunk-kjkmh26f.js +0 -1
  127. package/bin/chunk-m3dwydr3.js +0 -2
  128. package/bin/chunk-mk1jewvw.js +0 -2
  129. package/bin/chunk-q9sgjs4d.js +0 -1
  130. package/bin/chunk-s2725w64.js +0 -1
  131. package/bin/chunk-saq5797j.js +0 -1
  132. package/bin/chunk-sy8rqacm.js +0 -2
  133. package/bin/chunk-t84t3v6q.js +0 -1
  134. package/bin/chunk-ttsqdsxr.js +0 -2
  135. package/bin/chunk-vreq89j6.js +0 -1
  136. package/bin/chunk-wbhsmhgp.js +0 -2
  137. package/bin/chunk-wf4d1anc.js +0 -62
  138. package/bin/chunk-xv4mfppt.js +0 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shumai-one/shumai",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "A fullstack AI-powered media workspace and workflow engine",
5
5
  "type": "module",
6
6
  "bin": {
@@ -27,12 +27,12 @@
27
27
  "zod": "4.4.3"
28
28
  },
29
29
  "optionalDependencies": {
30
- "@shumai-one/shumai-darwin-arm64": "0.2.1",
31
- "@shumai-one/shumai-darwin-x64": "0.2.1",
32
- "@shumai-one/shumai-linux-arm64": "0.2.1",
33
- "@shumai-one/shumai-linux-x64": "0.2.1",
34
- "@shumai-one/shumai-win32-arm64": "0.2.1",
35
- "@shumai-one/shumai-win32-x64": "0.2.1"
30
+ "@shumai-one/shumai-darwin-arm64": "0.2.2",
31
+ "@shumai-one/shumai-darwin-x64": "0.2.2",
32
+ "@shumai-one/shumai-linux-arm64": "0.2.2",
33
+ "@shumai-one/shumai-linux-x64": "0.2.2",
34
+ "@shumai-one/shumai-win32-arm64": "0.2.2",
35
+ "@shumai-one/shumai-win32-x64": "0.2.2"
36
36
  },
37
37
  "repository": {
38
38
  "type": "git",
@@ -0,0 +1,28 @@
1
+ -- CreateTable
2
+ CREATE TABLE "ai_usages" (
3
+ "id" TEXT NOT NULL,
4
+ "team_id" TEXT NOT NULL,
5
+ "user_id" TEXT,
6
+ "period_start" TIMESTAMP(3) NOT NULL,
7
+ "input_tokens" INTEGER NOT NULL DEFAULT 0,
8
+ "output_tokens" INTEGER NOT NULL DEFAULT 0,
9
+ "cache_read_tokens" INTEGER NOT NULL DEFAULT 0,
10
+ "total_tokens" INTEGER NOT NULL DEFAULT 0,
11
+ "cost" DOUBLE PRECISION NOT NULL DEFAULT 0,
12
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
13
+ "updated_at" TIMESTAMP(3) NOT NULL,
14
+
15
+ CONSTRAINT "ai_usages_pkey" PRIMARY KEY ("id")
16
+ );
17
+
18
+ -- CreateIndex
19
+ CREATE INDEX "ai_usages_team_id_period_start_idx" ON "ai_usages"("team_id", "period_start");
20
+
21
+ -- CreateIndex
22
+ CREATE INDEX "ai_usages_team_id_user_id_period_start_idx" ON "ai_usages"("team_id", "user_id", "period_start");
23
+
24
+ -- AddForeignKey
25
+ ALTER TABLE "ai_usages" ADD CONSTRAINT "ai_usages_team_id_fkey" FOREIGN KEY ("team_id") REFERENCES "teams"("id") ON DELETE CASCADE ON UPDATE CASCADE;
26
+
27
+ -- AddForeignKey
28
+ ALTER TABLE "ai_usages" ADD CONSTRAINT "ai_usages_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;
@@ -0,0 +1,8 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - A unique constraint covering the columns `[team_id,user_id,period_start]` on the table `ai_usages` will be added. If there are existing duplicate values, this will fail.
5
+
6
+ */
7
+ -- CreateIndex
8
+ CREATE UNIQUE INDEX "ai_usages_team_id_user_id_period_start_key" ON "ai_usages"("team_id", "user_id", "period_start");
@@ -155,6 +155,7 @@ model User {
155
155
  collections Collection[] @relation("UserToCollection")
156
156
  shareLinks ShareLink[] @relation("UserToShareLink")
157
157
  apiTokens ApiToken[] @relation("UserToApiToken")
158
+ aiUsages AiUsage[] @relation("UserToAiUsage")
158
159
 
159
160
  @@map("users")
160
161
  }
@@ -237,6 +238,7 @@ model Team {
237
238
  skills Skill[] @relation("TeamToSkill")
238
239
  sandbox Sandbox? @relation("TeamToSandbox")
239
240
  agents Agent[] @relation("TeamToAgent")
241
+ aiUsages AiUsage[] @relation("TeamToAiUsage")
240
242
 
241
243
  @@map("teams")
242
244
  }
@@ -814,3 +816,26 @@ model ApiToken {
814
816
 
815
817
  @@map("api_tokens")
816
818
  }
819
+
820
+ model AiUsage {
821
+ id String @id @default(ulid())
822
+ teamId String @map("team_id")
823
+ userId String? @map("user_id")
824
+ periodStart DateTime @map("period_start")
825
+ inputTokens Int @default(0) @map("input_tokens")
826
+ outputTokens Int @default(0) @map("output_tokens")
827
+ cacheReadTokens Int @default(0) @map("cache_read_tokens")
828
+ totalTokens Int @default(0) @map("total_tokens")
829
+ cost Float @default(0) @map("cost")
830
+ createdAt DateTime @default(now()) @map("created_at")
831
+ updatedAt DateTime @updatedAt @map("updated_at")
832
+
833
+ team Team @relation("TeamToAiUsage", fields: [teamId], references: [id], onDelete: Cascade)
834
+ user User? @relation("UserToAiUsage", fields: [userId], references: [id], onDelete: SetNull)
835
+
836
+ @@map("ai_usages")
837
+ @@unique([teamId, userId, periodStart])
838
+ @@index([teamId, periodStart])
839
+ @@index([teamId, userId, periodStart])
840
+ }
841
+
@@ -1 +0,0 @@
1
- import{g as B}from"./chunk-50ebjdkv.js";import"./chunk-5j7axztv.js";import"./chunk-9bpjfkjf.js";import"./chunk-75jka5v9.js";import"./chunk-4fnak2zn.js";import"./chunk-6h4ay2p8.js";import"./chunk-mk1jewvw.js";import"./chunk-v98yavtp.js";import"./chunk-azfgjqjx.js";import"./chunk-m3dwydr3.js";import"./chunk-mjncyjwf.js";import"./chunk-sy8rqacm.js";import"./chunk-25d1g086.js";import"./chunk-t1mxqskx.js";import"./chunk-qjjr3fff.js";import"./chunk-46c5xkmn.js";import"./chunk-99db4j0k.js";import"./chunk-7ktvhtp1.js";import"./chunk-mg6fce5x.js";import"./chunk-2xnys7v4.js";import"./chunk-cpr05qng.js";import"./chunk-dwf5e5g3.js";import{Tg as q,ih as w}from"./chunk-wf4d1anc.js";import"./chunk-976v5s8y.js";function O(){let{shareId:C,fileId:D}=k.useParams(),{start:E,version:G,compare:H,cmpLeft:J,cmpRight:K,cmpActive:N}=k.useSearch();return q(B,{shareId:C,initialFileId:D,startTime:E,versionId:G,compare:H,compareLeftId:J,compareRightId:K,compareActiveSide:N})}var k=w("/share/$shareId/files/$fileId")({component:O});export{k as Route};
@@ -1,2 +0,0 @@
1
- import{Of as Rf,Pf as Lf,Qf as Vf,Rf as Cf,Wf as Hf,Xf as Jf,Yf as Kf,Zf as Qf,_f as Wf,bg as _f}from"./chunk-qjjr3fff.js";import{hg as Zf,ig as Gf}from"./chunk-99db4j0k.js";import{jg as zf}from"./chunk-7ktvhtp1.js";import{pg as $f}from"./chunk-2xnys7v4.js";import{$j as Xf,Ah as x,Ai as ff,Fj as D,Lj as Sf,Mj as a,Nj as Nf,Oj as Uf,Pj as W,Sg as O,Sj as qf,Tg as f,Th as e,Tj as g,Ug as V,Uj as p,Vj as l,Wj as c,Yh as j,Zh as r,Zj as X,dh as u,fh as d,mi as n,ti as o,uh as i,wi as s}from"./chunk-wf4d1anc.js";function Yf({teamId:K,projectId:L,projectName:_,ancestorFolders:B,currentAsset:U,isRootFolder:Y,displayStyle:E,onDisplayStyleChange:h,isLeftSidebarCollapsed:P,onLeftSidebarToggle:T,isRightSidebarCollapsed:$,onRightSidebarToggle:v,isChatbotOpen:Z=!1,onChatbotToggle:N,isPublic:Q=!1,onFolderClick:w,fileId:q,shareId:G,downloadInfo:z,versions:S,compareMode:J=!1,canCompareVersions:b=!1,onCompareVersions:A}){let k=u(),{canEdit:y}=Xf(L),I=!1,m=(R)=>{if(!q)return;if(Q&&G){k({to:"/share/$shareId/files/$fileId",params:{shareId:G,fileId:q},search:(C)=>({...C,version:R})});return}if(!L)return;k({to:"/projects/$projectId/files/$fileId",params:{projectId:L,fileId:q},search:(C)=>({...C,version:R})})},M=async(R)=>{if(!q)return;try{let C=G?await i.api.shares[":shareId"].files[":fileId"]["download-url"].$post({param:{shareId:G,fileId:q},json:{key:R}}):await i.api.files["download-url"].$post({json:{key:R,assetId:q}});if(!C.ok)return;let{url:H}=await C.json(),F=document.createElement("a");F.href=H,F.download="",document.body.appendChild(F),F.click(),document.body.removeChild(F)}catch{}},Bf=U.proxyType!=="audio"&&z?.videoTranscodes&&z.videoTranscodes.filter((R)=>!R.isRaw).length>0,Ef=Q?[{name:_,id:"root"},...B.slice().reverse().map((R)=>({name:R.name||"",id:R.id}))]:[{name:X.all_projects(),path:`/teams/${K}`,isMuted:!0},{name:_,path:`/projects/${L}`},...B.slice().reverse().map((R)=>({name:R.name||"",path:`/projects/${L}/folders/${R.id}`}))];return V("div",{className:"flex h-14 flex-wrap items-center justify-between gap-2 border-b border-border bg-card px-4 py-2",children:[V("div",{className:"flex min-w-0 flex-shrink items-center gap-1",children:[Ef.map((R,C)=>V("div",{className:"flex items-center gap-1",children:[C>0&&f("span",{className:"text-muted-foreground",children:"/"}),R.path?f(d,{to:R.path,className:D("truncate rounded px-2 py-1 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground",R.isMuted?"text-muted-foreground":"text-foreground"),children:R.name}):f("button",{onClick:()=>R.id&&w?.(R.id),className:"truncate rounded px-2 py-1 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground text-foreground",children:R.name})]},C)),!Y&&!J&&V("div",{className:"flex items-center gap-1",children:[f("span",{className:"text-muted-foreground",children:"/"}),U.type==="folder"?f("span",{className:"truncate rounded px-2 py-1 text-sm font-medium text-foreground",children:U.name}):V(Sf,{children:[V(Nf,{className:"flex items-center gap-1 truncate rounded px-2 py-1 text-sm font-medium text-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:[f("span",{children:U.name}),U.version!==void 0&&V(zf,{variant:"outline",className:"px-1 py-0 text-xs",children:["v",U.version]}),f(r,{className:"h-4 w-4"})]}),V(Uf,{className:"w-56",children:[Bf?V(p,{children:[f(l,{className:"flex items-center gap-2",children:f("span",{children:X.download()})}),f(a,{children:V(c,{className:"w-48",children:[f(qf,{children:X.download()}),z?.videoTranscodes?.filter((R)=>!R.isRaw).map((R)=>{let C=Math.max(R.width,R.height),H=`${R.height}p`;if(C>=3840)H="2160p";else if(C>=1920)H="1080p";else if(C>=1280)H="720p";else if(C>=960)H="540p";else if(C>=640)H="360p";else if(C>=320)H="180p";return V(W,{onClick:()=>M(R.key),className:"flex items-center justify-between",children:[f("span",{children:H}),f("span",{className:"text-xs text-muted-foreground",children:"MP4"})]},H)}),z?.originalKey&&V(O,{children:[f(g,{}),V(W,{onClick:()=>M(z.originalKey),className:"flex items-center justify-between",children:[f("span",{children:"Original"}),f("span",{className:"text-xs text-muted-foreground",children:U.name?.split(".").pop()?.toUpperCase()||"RAW"})]})]})]})})]}):f(W,{onClick:()=>z?.originalKey&&M(z.originalKey),disabled:!z?.originalKey,children:X.download()}),y&&f(W,{onClick:()=>console.log("Rename"),children:"Rename"}),y&&f(W,{onClick:()=>console.log("Delete"),children:"Delete"}),b&&A&&V(O,{children:[f(g,{}),V(W,{onClick:()=>A(),children:[f(x,{className:"h-4 w-4"}),f("span",{children:X.compare_versions()})]})]}),S&&S.length>0&&V(O,{children:[f(g,{}),V(p,{children:[V(l,{className:"flex items-center gap-2",children:[f(o,{className:"h-4 w-4"}),f("span",{children:"Versions"})]}),f(a,{children:V(c,{className:"w-80 p-1",children:[f("div",{className:"flex flex-col gap-1 max-h-96 overflow-y-auto",children:S.map((R)=>{let C=U.version===R.version;return V(W,{onClick:()=>m(R.id),className:"flex items-center gap-3 py-2 px-3 rounded-md cursor-pointer focus:bg-accent focus:text-accent-foreground",children:[V("div",{className:"flex-shrink-0 flex items-center justify-center bg-muted dark:bg-muted-foreground/20 text-muted-foreground dark:text-muted-foreground rounded-full px-2 py-0.5 text-xs font-semibold select-none min-w-[2rem]",children:["v",R.version]}),f("div",{className:"h-10 w-16 flex-shrink-0 overflow-hidden rounded-md border border-border bg-muted flex items-center justify-center",children:R.previewUrl?f("img",{src:R.previewUrl,alt:R.name||void 0,className:"h-full w-full object-cover"}):f(n,{className:"h-4 w-4 text-muted-foreground"})}),V("div",{className:"flex flex-col flex-1 min-w-0 text-left",children:[f("span",{className:"truncate text-sm font-semibold text-foreground",children:R.name}),f("span",{className:"truncate text-xs text-muted-foreground",children:R.creator?.name||"Unknown"})]}),C&&f(j,{className:"h-4 w-4 text-primary ml-auto flex-shrink-0"})]},R.id)})}),f(g,{}),f("div",{className:"p-1",children:f("button",{className:"w-full text-center text-xs font-medium py-2 px-3 rounded-md bg-muted/80 hover:bg-muted text-foreground transition-colors",onClick:()=>console.log("Manage versions"),children:"Manage versions..."})})]})})]})]})]})]})]})]}),V("div",{className:"flex items-center gap-2",children:[V("div",{className:"flex flex-shrink-0 items-center gap-1 rounded-md border border-border bg-background p-1",children:[!q&&!Q&&T&&f("button",{onClick:T,className:"rounded p-1.5 text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",title:P?"Show Left Sidebar":"Hide Left Sidebar",children:P?f(Hf,{className:"h-4 w-4"}):f(Kf,{className:"h-4 w-4 fill-primary stroke-0"})}),!q&&!Q&&E&&h&&V(O,{children:[f("button",{onClick:()=>h("card"),className:`rounded p-1.5 transition-colors ${E==="card"?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,title:"Card View",children:f(s,{className:"h-4 w-4"})}),f("button",{onClick:()=>h("list"),className:`rounded p-1.5 transition-colors ${E==="list"?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,title:"List View",children:f(ff,{className:"h-4 w-4"})})]}),f("button",{onClick:v,className:`rounded p-1.5 transition-colors ${!$&&!Z?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,title:$?"Show Right Sidebar":"Hide Right Sidebar",children:!$&&!Z?f(Qf,{className:"h-4 w-4 fill-primary stroke-0"}):f(Jf,{className:"h-4 w-4"})})]}),!Q&&N&&f(Rf,{children:V(Lf,{children:[f(Vf,{asChild:!0,children:f("span",{children:f("button",{disabled:!1,onClick:N,className:D("h-9 w-9 flex items-center justify-center rounded-full border border-border bg-background transition-colors",Z?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent hover:text-foreground",!1),children:Z?f(Wf,{className:"h-6 w-6 text-primary transition-colors"}):f(e,{className:"h-6 w-6 text-muted-foreground transition-colors"})})})}),f(Cf,{children:f("p",{children:Z?X.hide_chatbot():X.show_chatbot()})})]})})]})]})}function cf(){let{projectState:K}=Zf(),L=$f(),{isChatbotOpen:_,setIsChatbotOpen:B}=Gf();if(!K)return f(hf,{});let{teamId:U,projectId:Y,projectName:E,ancestorFolders:h,currentAsset:P,isRootFolder:T,fileId:$,downloadInfo:v,versions:Z,isPublic:N,shareId:Q,onFolderClick:w,compareMode:q,canCompareVersions:G,onCompareVersions:z}=K,S=!!$,J=!!Q&&!S,b=S?L.fileViewLeftSidebarCollapsed:J?L.shareConfigLeftSidebarCollapsed:L.fileListLeftSidebarCollapsed,A=N?void 0:()=>S?L.setFileViewLeftSidebarCollapsed(!L.fileViewLeftSidebarCollapsed):J?L.setShareConfigLeftSidebarCollapsed(!L.shareConfigLeftSidebarCollapsed):L.setFileListLeftSidebarCollapsed(!L.fileListLeftSidebarCollapsed),k=N&&K.isRightSidebarCollapsed!==void 0?K.isRightSidebarCollapsed:S?L.fileViewRightSidebarCollapsed:J?L.shareConfigRightSidebarCollapsed:L.fileListRightSidebarCollapsed,y=N&&K.onRightSidebarToggle?K.onRightSidebarToggle:()=>{if(!N&&_)if(B(!1),S)L.setFileViewRightSidebarCollapsed(!1);else if(J)L.setShareConfigRightSidebarCollapsed(!1);else L.setFileListRightSidebarCollapsed(!1);else if(S)L.setFileViewRightSidebarCollapsed(!L.fileViewRightSidebarCollapsed);else if(J)L.setShareConfigRightSidebarCollapsed(!L.shareConfigRightSidebarCollapsed);else L.setFileListRightSidebarCollapsed(!L.fileListRightSidebarCollapsed)},I=N?void 0:()=>{B(!_)},m=Y?L.viewModes[Y]??"card":"card";return f(Yf,{teamId:U,projectId:Y,projectName:E,ancestorFolders:h,currentAsset:P,isRootFolder:T,displayStyle:S||J?void 0:m,onDisplayStyleChange:S||J?void 0:N?void 0:(t)=>{if(Y)L.setViewMode(Y,t)},isLeftSidebarCollapsed:b,onLeftSidebarToggle:A,isRightSidebarCollapsed:k,onRightSidebarToggle:y,isChatbotOpen:!N&&_,onChatbotToggle:I,isPublic:N,shareId:Q,fileId:$,downloadInfo:v,versions:Z,onFolderClick:w,compareMode:q,canCompareVersions:G,onCompareVersions:z})}function hf(){return f("div",{className:"flex h-14 flex-wrap items-center justify-center gap-2 border-b border-border bg-card px-4 py-2 flex-shrink-0",children:f(_f,{className:"w-10 h-10 text-orange-600"})})}
2
- export{cf as pf};
@@ -1,2 +0,0 @@
1
- import{$ as v}from"./chunk-6h4ay2p8.js";import{Aa as x2,Ba as _5,Ca as h5,Da as g5,Ea as m5,Fa as k1,Ga as P1,Ha as O1,Ia as b5,Ja as c5,Ka as X2,La as e5,Ma as $1,Na as J1,Oa as h,Pa as Y2,Qa as T1,Ra as Z1,ga as _,ha as T2,ia as S5,ja as _0,ka as S2,la as f5,ma as f2,oa as y2,qa as E2,ra as E5,sa as I5,ta as D5,ua as x5,va as j5,wa as y5,xa as v5,ya as I2,za as D2}from"./chunk-v98yavtp.js";import{Za as m0}from"./chunk-mjncyjwf.js";import{gg as K2}from"./chunk-99db4j0k.js";import{Dg as W0,Ig as P2,sg as S0,tg as y,yg as K5}from"./chunk-cpr05qng.js";import{Og as F0}from"./chunk-dwf5e5g3.js";import{$h as z5,$i as M1,Ai as W1,Fj as a0,Gh as H1,Hj as e,Ih as K1,Ij as L0,Jj as R0,Kj as A0,Lj as L1,Nj as R1,Oj as A1,Pj as C1,Qi as c2,Rg as l,Sg as Q2,Tg as H,Ug as R,Ui as z1,Vg as Q1,Vi as G1,Wh as N1,Yh as H2,Zg as b2,Zh as w0,Zj as I,_h as W5,_i as r0,ak as g0,bj as U1,dj as F1,ei as G5,hj as w1,ij as V1,mj as V0,nh as n0,oh as Y5,ri as q1,si as B1,uh as T0,wj as f0}from"./chunk-wf4d1anc.js";import{Pk as d}from"./chunk-976v5s8y.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 u,H5 as v,N5 as w,C2 as x,k2 as y,Y1 as z,H$ as A,Q5 as B,L5 as C,C6 as D,V5 as E,i as F,n as G,o as H,X1 as I,D4 as J,u2 as K,N0 as L,x4 as M,O$ as N,o0 as O,L6 as P,c4 as Q,O6 as R,T6 as S,u4 as T,S6 as U};
@@ -1,2 +0,0 @@
1
- import{h as WG,i as VG}from"./chunk-5j7axztv.js";import{p as qG,s as BG}from"./chunk-9bpjfkjf.js";import{t as zG}from"./chunk-75jka5v9.js";import{Va as HG}from"./chunk-v98yavtp.js";import{pf as _G}from"./chunk-25d1g086.js";import{qf as v,rf as g,sf as F,uf as u}from"./chunk-t1mxqskx.js";import{hg as ZG}from"./chunk-99db4j0k.js";import{Bi as UG,Dh as P,Hj as XG,Rg as oG,Sg as JG,Tg as O,Ug as z,Xg as N,Zj as YG,_g as w,ak as $G,dh as KG,uh as B,xh as OG}from"./chunk-wf4d1anc.js";import{Pk as nG}from"./chunk-976v5s8y.js";var X=nG(oG(),1);function $J({shareId:K,initialFolderId:QG,initialFileId:f,startTime:TG,versionId:V,compare:MG,compareLeftId:b,compareRightId:A,compareActiveSide:p="left"}){let H=KG(),W=!!MG&&!!b&&!!A,[Z,h]=X.useState(()=>{return localStorage.getItem(`share_pwd_${K}`)||""}),[D,NG]=X.useState(""),{data:U,error:Q,isLoading:yG}=N({queryKey:["share-info",K,Z],queryFn:async()=>{let G=await B.api.shares[":shareId"].info.$get({param:{shareId:K}},{headers:{"x-share-password":Z}});if(G.status===401)throw Error("Unauthorized");if(G.status===403){let J=await G.json();throw Error(J.error||"Forbidden")}if(!G.ok)throw Error("Failed to fetch share info");return await G.json()},retry:!1}),Y=QG||U?.rootFolderId,_=f||null,m=V||_,[c,l]=X.useState([]),{data:R}=N({queryKey:["public-share-folder",K,Y,Z],queryFn:async()=>{let G=await B.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:K,fileId:Y}},{headers:{"x-share-password":Z}});if(G.status===401)throw Error("Unauthorized");return await G.json()},enabled:!!U&&!!Y});X.useEffect(()=>{if(R?.ancestorFolders&&U){let G=R.ancestorFolders.findIndex((J)=>J.id===U.rootFolderId);if(G!==-1)l(R.ancestorFolders.slice(0,G));else if(Y===U.rootFolderId)l([])}},[R,U,Y]);let[y,E]=X.useState(new Set),[EG,LG]=X.useState(360),[j,kG]=X.useState(()=>!f),L=X.useRef(null),[I,C]=X.useState([]),[bG,n]=X.useState(0),[AG,o]=X.useState(null),[d,RG]=X.useState(null),[PG,DG]=X.useState(void 0),{data:i,fetchNextPage:jG,hasNextPage:CG,isFetchingNextPage:SG,error:t}=w({queryKey:["public-share-children",K,Y,"folder",Z],queryFn:async({pageParam:G})=>{let J=await B.api.shares[":shareId"].folders[":folderId"].children.$get({param:{shareId:K,folderId:Y},query:{assetType:"folder",after:G}},{headers:{"x-share-password":Z}});if(J.status===401)throw Error("Unauthorized");if(J.status===403)throw Error("Expired");return await J.json()},enabled:!!U&&!!Y,initialPageParam:"",getNextPageParam:(G)=>G.pageInfo?.cursor||void 0,retry:!1}),{data:a,fetchNextPage:xG,hasNextPage:wG,isFetchingNextPage:vG}=w({queryKey:["public-share-children",K,Y,"file",Z],queryFn:async({pageParam:G})=>{let J=await B.api.shares[":shareId"].folders[":folderId"].children.$get({param:{shareId:K,folderId:Y},query:{assetType:"file",after:G}},{headers:{"x-share-password":Z}});if(J.status===401)throw Error("Unauthorized");if(J.status===403)throw Error("Expired");return await J.json()},enabled:!!U&&!!Y,initialPageParam:"",getNextPageParam:(G)=>G.pageInfo?.cursor||void 0,retry:!1}),{data:gG}=N({queryKey:["public-share-fields",K,Z],queryFn:async()=>{let G=await B.api.shares[":shareId"].fields.$get({param:{shareId:K}},{headers:{"x-share-password":Z}});if(G.status===401)throw Error("Unauthorized");return await G.json()},enabled:!!U}),{data:q,isLoading:FG}=N({queryKey:["public-share-file",K,_,Z],queryFn:async()=>{let G=await B.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:K,fileId:_}},{headers:{"x-share-password":Z}});if(G.status===401)throw Error("Unauthorized");return await G.json()},enabled:!!_&&!!U}),{data:uG,isLoading:fG}=N({queryKey:["public-share-file",K,V,Z],queryFn:async()=>{let G=await B.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:K,fileId:V}},{headers:{"x-share-password":Z}});if(G.status===401)throw Error("Unauthorized");return await G.json()},enabled:!!V&&!!U}),$=V?uG:q,pG=FG||!!V&&fG;X.useEffect(()=>{if(t?.message==="Unauthorized")h(""),localStorage.removeItem(`share_pwd_${K}`)},[t,K]);let k=X.useMemo(()=>i?.pages.flatMap((G)=>G.data??[])??[],[i]),S=X.useMemo(()=>a?.pages.flatMap((G)=>G.data??[])??[],[a]),s=X.useMemo(()=>{if($)return $;if(y.size!==1)return null;let G=Array.from(y)[0];return[...k,...S].find((J)=>J.id===G)||null},[y,k,S,$]),hG=(G)=>{G.preventDefault(),h(D),localStorage.setItem(`share_pwd_${K}`,D)},mG=(G)=>{if(G.type==="folder"||G.targetType==="folder")H({to:"/share/$shareId/folders/$folderId",params:{shareId:K,folderId:G.id}});else H({to:"/share/$shareId/files/$fileId",params:{shareId:K,fileId:G.versionStack?G.versionStack.id:G.id}});E(new Set)},cG=(G)=>{if(!U)return;let J=G==="root"?U.rootFolderId:G;if(J===U.rootFolderId)H({to:"/share/$shareId",params:{shareId:K}});else H({to:"/share/$shareId/folders/$folderId",params:{shareId:K,folderId:J}});E(new Set)},lG=(G)=>{o(G.id||null);let J=G.annotations;if(J&&J.length>0)C(J);else C([]);if(W){if(G.second!==null&&G.second!==void 0)DG({second:G.second,nonce:Date.now()});return}if(G.second!==null&&G.second!==void 0)L.current?.seekTo(G.second),L.current?.pause();else if(J&&J.length>0)L.current?.pause()},r=()=>{C([]),o(null)},x=(G)=>{if(!_)return;H({to:"/share/$shareId/files/$fileId",params:{shareId:K,fileId:_},search:(J)=>({...J,...G})})},IG=()=>{x({compare:void 0,cmpLeft:void 0,cmpRight:void 0,cmpActive:void 0,version:p==="left"?b:A})},{setProjectState:e,clearProjectState:GG}=ZG();X.useEffect(()=>{if(U&&Y){let G=Y===U.rootFolderId?U.name:k.find((J)=>J.id===Y)?.name||U.name;e({teamId:"",projectId:U.projectId,projectName:U.name,ancestorFolders:c,currentAsset:{name:$?.name||G,type:_?"file":"folder",version:q?.versionStack?q.versionStack.versions.find((J)=>J.id===m)?.version??q.versionStack.versions.length:void 0,proxyType:$?.proxyType||null},isRootFolder:Y===U.rootFolderId&&!_,isPublic:!0,shareId:K,fileId:_||void 0,downloadInfo:$?{originalKey:$.media?.original?.key,videoTranscodes:$.media?.videoTranscodes?.map((J)=>({key:J.key,width:J.width,height:J.height,isRaw:J.isRaw}))}:void 0,onFolderClick:cG,isRightSidebarCollapsed:j,onRightSidebarToggle:()=>kG((J)=>!J),versions:q?.versionStack?.versions,compareMode:W,canCompareVersions:(q?.versionStack?.versions?.length??0)>=2,onCompareVersions:()=>{let J=qG(q?.versionStack?.versions);if(!J||!_)return;H({to:"/share/$shareId/files/$fileId",params:{shareId:K,fileId:_},search:(M)=>({...M,compare:!0,cmpLeft:J.left.id,cmpRight:J.right.id,cmpActive:"left"})})}})}return()=>GG()},[U,Y,k,$,q,m,_,c,e,GG,j,W,H,K]);let T;if(yG&&!Q)T=O("div",{className:"flex flex-1 items-center justify-center bg-background",children:O(P,{className:"h-8 w-8 animate-spin text-foreground"})});else if(Q)if(Q.message==="Unauthorized"){let G=Z!=="";T=O("div",{className:"flex flex-1 items-center justify-center p-4",children:z(v,{className:"w-full max-w-md",children:[z(g,{className:"text-center",children:[O("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-primary/10",children:O(UG,{className:"h-6 w-6 text-primary"})}),O(F,{children:YG.password_protected()})]}),O(u,{children:z("form",{onSubmit:hG,className:"space-y-4",children:[z("div",{className:"space-y-2",children:[O($G,{type:"password",placeholder:"Enter password",value:D,onChange:(J)=>NG(J.target.value),autoFocus:!0}),G&&O("p",{className:"text-sm font-medium text-destructive",children:"Incorrect password. Please try again."})]}),O(XG,{type:"submit",className:"w-full",children:"Access Share"})]})})]})})}else{let G=Q.message.includes("expired"),J=Q.message.includes("disabled");T=O("div",{className:"flex flex-1 items-center justify-center p-4",children:z(v,{className:"w-full max-w-md",children:[z(g,{className:"text-center",children:[O("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-destructive/10",children:O(OG,{className:"h-6 w-6 text-destructive"})}),O(F,{children:G?"Share Expired":J?"Share Disabled":"Error"})]}),O(u,{className:"text-center text-muted-foreground",children:Q.message})]})})}else if(!U)T=O("div",{className:"flex flex-1 items-center justify-center bg-background",children:O(P,{className:"h-8 w-8 animate-spin text-foreground"})});else T=z("div",{className:"flex flex-1 overflow-hidden relative",children:[_?z("div",{className:"flex-1 relative bg-muted/30",children:[pG&&!W&&O("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/50",children:O(P,{className:"h-8 w-8 animate-spin text-foreground"})}),W&&b&&A?O(VG,{isPublic:!0,shareId:K,versions:$?.versionStack?.versions??[],leftId:b,rightId:A,activeSide:p,annotations:I,seekRequest:PG,onActiveSideChange:(G)=>x({cmpActive:G}),onSwitchVersion:(G,J)=>x(G==="left"?{cmpLeft:J}:{cmpRight:J}),onExit:IG,onActiveAssetChange:RG,onPlay:r,onTimeUpdate:n}):$&&O(WG,{file:$,mediaControllerRef:L,onPlay:r,onTimeUpdate:n,annotations:I,startTime:TG,shareId:K})]}):Y&&O(zG,{teamId:"",projectId:U.projectId,assetId:Y,folders:k,files:S,selectedItem:null,selectedIds:y,onItemSelect:(G,J)=>{if(J.metaKey||J.ctrlKey){let M=new Set(y);if(M.has(G.id))M.delete(G.id);else M.add(G.id);E(M)}else E(new Set([G.id]))},onItemDoubleClick:mG,onSaveField:()=>{},displayStyle:U.viewMode??"card",onClearSelection:()=>E(new Set),fetchNextFoldersPage:jG,hasNextFoldersPage:CG,isFetchingNextFoldersPage:SG,fetchNextFilesPage:xG,hasNextFilesPage:wG,isFetchingNextFilesPage:vG,isShareView:!0,isPublic:!0}),!j&&z(JG,{children:[O(HG,{onResize:(G)=>LG((J)=>Math.max(240,Math.min(600,J-G)))}),O("div",{style:{width:EG},className:"flex-shrink-0 border-l",children:O(BG,{teamId:"",projectId:U.projectId,file:W?d:s,onSaveField:()=>{},members:[],readOnly:!0,publicFields:gG,onCommentSelect:lG,isPublic:!0,shareId:K,currentTime:bG,onTyping:()=>{L.current?.pause()},selectedCommentId:AG,hideAnnotationControl:(W?d:s)?.proxyType==="audio"})})]})]});return z("div",{className:"flex h-screen flex-col bg-background",children:[O(_G,{}),T]})}
2
- export{$J as g};
@@ -1,2 +0,0 @@
1
- import{o as s,q as t,r as b}from"./chunk-9bpjfkjf.js";import{Dh as A,Fi as i,Fj as C,Ji as a,Lj as YG,Nj as _G,Oj as $G,Pj as QG,Rg as SG,Sg as d,Tg as H,Ug as O,Xg as KG,Yh as GG,Zh as HG,Zj as r,mi as JG,mj as WG,uh as c}from"./chunk-wf4d1anc.js";import{Pk as AG}from"./chunk-976v5s8y.js";function vG({file:Y,mediaControllerRef:X,onPlay:K,onPause:N,onTimeUpdate:V,annotations:_,startTime:M,shareId:Z,children:U}){let L=b(Y).viewer;return H(L,{ref:X,file:Y,onPlay:K,onPause:N,onTimeUpdate:V,annotations:_,startTime:M,shareId:Z,children:U},Y.id)}var J=AG(SG(),1);function e({activeState:Y,activeAsset:X,previewUrl:K,isFullScreen:N,onTogglePlay:V,onToggleLoop:_,onSeek:M,onVolumeChange:Z,onToggleMute:U,onChangePlaybackRate:B,onChangeResolution:L,onZoomIn:w,onZoomOut:T,onFit:z,onDownload:F,onToggleFullScreen:E}){if(Y?.kind==="video"&&Y.video&&X){let $=Y.video,y=$.totalFrames/$.frameRate,p=$.currentFrame/$.frameRate,S={isPlaying:$.isPlaying,progress:y>0?p/y*100:0,currentTime:p,duration:y,volume:$.volume,isMuted:$.isMuted,isLooping:$.isLooping,playbackRate:$.playbackRate,isFullScreen:N,showFrames:!1,currentResolution:$.currentResolution},g=K&&!X.media?.videoPreview?{...X,media:{...X.media,videoPreview:{url:K}}}:X;return H(s,{state:S,zoom:Y.zoom,isControlsVisible:!0,floatOverlayInFullScreen:!1,buffered:$.buffered,data:g,resolutions:$.resolutions,togglePlay:V,toggleLoop:_,toggleMute:U,handleVolumeChange:Z,changePlaybackRate:B,changeResolution:(k)=>L(k.resolution),handleDownload:(k)=>F(k),toggleFullScreen:E,onZoomChange:(k)=>k>=Y.zoom?w():T(),onZoomReset:z,frameRate:$.frameRate,totalFrames:$.totalFrames,currentFrame:$.currentFrame,seekToFrame:M})}if(Y?.kind==="image")return H(t,{zoom:Y.zoom,onZoomIn:w,onZoomOut:T,onFit:z,onDownload:()=>F(),canDownload:!!X?.media?.original?.key,fullscreen:{isFullScreen:N,onToggle:E}});return H("div",{className:"relative z-10 flex items-center justify-end gap-2 border-t border-border bg-card px-4 py-3",children:H("button",{onClick:E,className:"text-foreground transition-colors hover:text-primary",title:"Fullscreen",children:N?H(a,{className:"h-5 w-5"}):H(i,{className:"h-5 w-5"})})})}function v({side:Y,fileName:X,version:K,activeVersionId:N,versions:V,isActive:_,onActivate:M,onSwitchVersion:Z,onExit:U}){let B=C("flex-shrink-0 rounded p-1 transition-colors hover:bg-muted",_?"text-foreground":"text-muted-foreground hover:text-foreground"),L=H("button",{onClick:U,title:r.exit_compare(),className:B,children:H(WG,{className:"h-4 w-4"})}),w=O("button",{onClick:M,className:C("flex min-w-0 items-center gap-1 rounded px-2 py-1 text-sm font-medium transition-colors hover:bg-muted",_?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[H("span",{className:"truncate",children:X}),K!==void 0&&O("span",{className:C("flex-shrink-0 rounded border px-1 py-0 text-xs",_?"border-foreground/40":"border-border"),children:["v",K]})]}),T=O(YG,{children:[H(_G,{onClick:M,title:r.switch_version(),className:B,children:H(HG,{className:"h-4 w-4"})}),H($G,{align:Y==="left"?"start":"end",className:"w-80 p-1",children:H("div",{className:"flex max-h-96 flex-col gap-1 overflow-y-auto",children:V.map((z)=>{let F=z.id===N;return O(QG,{onClick:()=>Z(z.id),className:"flex cursor-pointer items-center gap-3 rounded-md px-3 py-2",children:[O("div",{className:"flex min-w-[2rem] flex-shrink-0 items-center justify-center rounded-full bg-muted px-2 py-0.5 text-xs font-semibold text-muted-foreground select-none",children:["v",z.version]}),H("div",{className:"flex h-10 w-16 flex-shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:z.previewUrl?H("img",{src:z.previewUrl,alt:z.name||void 0,className:"h-full w-full object-cover"}):H(JG,{className:"h-4 w-4 text-muted-foreground"})}),O("div",{className:"flex min-w-0 flex-1 flex-col text-left",children:[H("span",{className:"truncate text-sm font-semibold text-foreground",children:z.name}),H("span",{className:"truncate text-xs text-muted-foreground",children:z.creator?.name||"Unknown"})]}),F&&H(GG,{className:"ml-auto h-4 w-4 flex-shrink-0 text-primary"})]},z.id)})})})]});return H("div",{onMouseDown:M,className:C("dark flex h-10 flex-shrink-0 items-center gap-1 border-b bg-background px-2 transition-colors",_?"border-b-2 border-primary":"border-border"),children:Y==="left"?O(d,{children:[L,w,T]}):O(d,{children:[w,T,H("div",{className:"ml-auto"}),L]})})}function XG(Y,X,K){return KG({queryKey:X?["public-share-file",K,Y,localStorage.getItem(`share_pwd_${K}`)||""]:["files",Y],queryFn:async()=>{if(X){let V=localStorage.getItem(`share_pwd_${K}`)||"",_=await c.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:K,fileId:Y}},{headers:{"x-share-password":V}});if(!_.ok)throw Error("Failed to fetch version asset");return await _.json()}let N=await c.api.files[":fileId"].$get({param:{fileId:Y}});if(!N.ok)throw Error("Failed to fetch version asset");return await N.json()},enabled:!!Y&&(!X||!!K)})}function NH({isPublic:Y=!1,shareId:X,versions:K,leftId:N,rightId:V,activeSide:_,annotations:M,seekRequest:Z,onActiveSideChange:U,onSwitchVersion:B,onExit:L,onActiveAssetChange:w,onPlay:T,onTimeUpdate:z}){let F=J.useRef(null),E=J.useRef(null),$=J.useRef(null),[y,p]=J.useState(null),[S,g]=J.useState(null),[k,NG]=J.useState(1),[zG,l]=J.useState(!1),[OG,qG]=J.useState(!1),{data:P,isLoading:VG}=XG(N,Y,X),{data:R,isLoading:ZG}=XG(V,Y,X),MG=b(P),UG=b(R),I=!!P&&!!R&&MG.id===UG.id,f=_==="left"?P:R,u=_==="left"?y:S,D=J.useCallback(()=>_==="left"?E.current:$.current,[_]),h=J.useCallback(()=>_==="left"?$.current:E.current,[_]);J.useEffect(()=>{w(f??null)},[f,w]),J.useEffect(()=>{if(!Z)return;let G=D();if(G?.seekToSecond(Z.second),G?.pause(),I){let W=h();W?.seekToSecond(Z.second),W?.pause()}},[Z?.nonce]),J.useEffect(()=>{let G=()=>qG(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",G),()=>document.removeEventListener("fullscreenchange",G)},[]);let LG=J.useCallback((G)=>p(G),[]),DG=J.useCallback((G)=>g(G),[]),q=J.useCallback((G)=>{let W=D();if(W)G(W);if(I){let Q=h();if(Q)G(Q)}},[D,h,I]),m=J.useCallback(()=>{let G=!u?.video?.isPlaying;q((W)=>G?W.play():W.pause())},[u?.video?.isPlaying,q]);J.useEffect(()=>{let G=(W)=>{let Q=document.activeElement;if(Q&&(Q.tagName==="INPUT"||Q.tagName==="TEXTAREA"||Q instanceof HTMLElement&&Q.isContentEditable))return;let x=W.key===" ",j=Q&&(Q.tagName==="BUTTON"||Q.tagName==="A"||Q.tagName==="SELECT"||Q.tagName==="OPTION"||Q.getAttribute("role")==="button"||Q.getAttribute("role")==="link"||Q.getAttribute("role")==="checkbox"||Q.getAttribute("role")==="radio"||Q.getAttribute("role")==="menuitem");if(x&&j)return;if(W.key===" "||W.key.toLowerCase()==="k")W.preventDefault(),m()};return window.addEventListener("keydown",G),()=>{window.removeEventListener("keydown",G)}},[m]);let BG=J.useCallback((G)=>q((W)=>W.seekToFrame(G)),[q]),wG=J.useCallback(()=>D()?.toggleLoop(),[D]),FG=J.useCallback((G)=>{NG(G),l(G===0)},[]),EG=J.useCallback(()=>l((G)=>!G),[]),PG=J.useCallback((G)=>q((W)=>W.setPlaybackRate(G)),[q]),RG=J.useCallback((G)=>D()?.changeResolution(G),[D]),TG=J.useCallback(()=>q((G)=>G.zoomBy(1.2)),[q]),kG=J.useCallback(()=>q((G)=>G.zoomBy(0.8)),[q]),IG=J.useCallback(()=>q((G)=>G.fit()),[q]),bG=J.useCallback((G)=>{D()?.download(G)},[D]),yG=J.useCallback(()=>{if(!F.current)return;if(!document.fullscreenElement)F.current.requestFullscreen();else document.exitFullscreen()},[]),fG=J.useCallback((G,W)=>{if(I)$.current?.panBy(G,W)},[I]),mG=J.useCallback((G,W)=>{if(I)E.current?.panBy(G,W)},[I]),jG=J.useCallback(()=>m(),[m]),n=J.useCallback((G)=>K.find((W)=>W.id===G)?.version,[K]),CG=J.useMemo(()=>f?.media?.videoPreview?.url,[f?.media?.videoPreview?.url]),o=(G,W)=>{let x=b(W)?.comparePane;if(!x)return H("div",{className:"flex flex-1 items-center justify-center bg-gray-100 dark:bg-gray-950",children:H("p",{className:"text-muted-foreground",children:"Preview unavailable"})});let j=_===G;return H(x,{ref:G==="left"?E:$,file:W,shareId:X,isActive:j,annotations:j?M:[],onStateChange:G==="left"?LG:DG,onUserPan:G==="left"?fG:mG,onActivate:()=>U(G),muted:j?zG:!0,volume:k,onPlay:T,onTimeUpdate:z,onRequestTogglePlay:jG},W.id)},pG=!!P&&!!R,xG=VG||ZG;return O("div",{ref:F,className:"flex h-full flex-1 flex-col bg-background",children:[O("div",{className:"flex min-h-0 flex-1",children:[O("div",{className:"flex min-w-0 flex-1 flex-col border-r border-zinc-800",children:[P&&H(v,{side:"left",fileName:P.name,version:n(N),activeVersionId:N,versions:K,isActive:_==="left",onActivate:()=>U("left"),onSwitchVersion:(G)=>B("left",G),onExit:L}),H("div",{className:"relative flex min-h-0 flex-1",children:P?o("left",P):H("div",{className:"flex flex-1 items-center justify-center",children:H(A,{className:"h-6 w-6 animate-spin text-foreground"})})})]}),O("div",{className:"flex min-w-0 flex-1 flex-col",children:[R&&H(v,{side:"right",fileName:R.name,version:n(V),activeVersionId:V,versions:K,isActive:_==="right",onActivate:()=>U("right"),onSwitchVersion:(G)=>B("right",G),onExit:L}),H("div",{className:"relative flex min-h-0 flex-1",children:R?o("right",R):H("div",{className:"flex flex-1 items-center justify-center",children:H(A,{className:"h-6 w-6 animate-spin text-foreground"})})})]})]}),xG&&!pG&&H("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/30",children:H(A,{className:"h-8 w-8 animate-spin text-foreground"})}),H(e,{activeState:u,activeAsset:f??null,previewUrl:CG,isFullScreen:OG,onTogglePlay:m,onToggleLoop:wG,onSeek:BG,onVolumeChange:FG,onToggleMute:EG,onChangePlaybackRate:PG,onChangeResolution:RG,onZoomIn:TG,onZoomOut:kG,onFit:IG,onDownload:bG,onToggleFullScreen:yG})]})}
2
- export{vG as h,NH as i};
@@ -1,2 +0,0 @@
1
- import{ng as e}from"./chunk-mg6fce5x.js";import{Aj as U,Fj as s,Tg as r,Ug as l,Yh as x,Zh as f,ai as b,zj as n}from"./chunk-wf4d1anc.js";function ae({...t}){return r(n.Root,{"data-slot":"select",...t})}function se({...t}){return r(n.Value,{"data-slot":"select-value",...t})}function pe({className:t,size:o="default",children:i,...p}){return l(n.Trigger,{"data-slot":"select-trigger","data-size":o,className:s("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",t),...p,children:[i,r(n.Icon,{asChild:!0,children:r(f,{className:"size-4 opacity-50"})})]})}function ce({className:t,children:o,position:i="item-aligned",align:p="center",...d}){return r(n.Portal,{children:l(n.Content,{"data-slot":"select-content",className:s("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md 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",i==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:i,align:p,...d,children:[r(w,{}),r(n.Viewport,{className:s("p-1",i==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:o}),r(T,{})]})})}function le({className:t,children:o,...i}){return l(n.Item,{"data-slot":"select-item",className:s("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...i,children:[r("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:r(n.ItemIndicator,{children:r(x,{className:"size-4"})})}),r(n.ItemText,{children:o})]})}function w({className:t,...o}){return r(n.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:s("flex cursor-default items-center justify-center py-1",t),...o,children:r(b,{className:"size-4"})})}function T({className:t,...o}){return r(n.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:s("flex cursor-default items-center justify-center py-1",t),...o,children:r(f,{className:"size-4"})})}var c=e.object({cursor:e.string().optional(),total:e.number().optional(),totalSize:e.number().optional()}),a=e.object({first:e.coerce.number().optional(),after:e.string().optional()});var Se=e.object({name:e.string()}),N=e.object({id:e.string(),name:e.string(),rootFolder:e.string().optional(),updatedAt:e.union([e.string(),e.date()])});var he=e.object({data:e.array(N),pageInfo:c}),xe=e.object({teamId:e.string(),userId:e.string()}),be=e.object({id:e.string(),name:e.string(),email:e.string().optional(),role:e.enum(["owner","editor","reviewer","bot","unknown"]),image:e.string().optional(),unreadNotificationCount:e.number().optional()}),Re=e.object({name:e.string().optional(),imageKey:e.string().nullable().optional()}),Ie=e.object({id:e.string(),name:e.string(),role:e.enum(["owner","editor","reviewer","bot","unknown"]),email:e.string().optional(),type:e.enum(["human","agent"]).optional(),image:e.string().optional(),scope:e.enum(["team","project"]).optional()}),ve=e.object({includeAgents:e.string().optional().transform((t)=>t==="true")}),A={best_match:"best_match",all:"all"},qe=e.union([e.object({key:e.literal("transcode.videoStrategy"),value:e.nativeEnum(A)})]),je=e.object({allowedDomains:e.array(e.string()),pendingDomains:e.array(e.string()).default([])});var Pe=e.object({role:e.enum(["editor","reviewer"])});var R=e.enum(["chat","autofill","embedding"]),I=e.enum(["off","minimal","low","medium","high","xhigh"]),F=e.object({id:e.string().optional(),skillId:e.string(),skill:e.object({id:e.string(),name:e.string()}).optional()}),Ue=e.object({id:e.string(),name:e.string(),type:R,enabled:e.boolean(),avatar:e.string().optional(),providerId:e.string().optional(),modelId:e.string().optional(),thinkingLevel:I.optional().default("off"),systemPrompt:e.string().optional(),soul:e.string().optional(),skills:e.array(F).optional(),deniedTools:e.array(e.string()).optional()}),v=e.object({name:e.string().min(1),type:R,enabled:e.boolean().optional().default(!0),avatar:e.string().optional(),providerId:e.string().optional(),modelId:e.string().optional(),thinkingLevel:I.optional().default("off"),systemPrompt:e.string().optional(),soul:e.string().optional(),skills:e.array(e.string()).optional(),deniedTools:e.array(e.string()).optional()}),we=v.superRefine((t,o)=>{if(t.type==="chat"||t.type==="autofill"){if(!t.providerId)o.addIssue({code:e.ZodIssueCode.custom,message:"providerId is required for chat/autofill agents",path:["providerId"]});if(!t.modelId)o.addIssue({code:e.ZodIssueCode.custom,message:"modelId is required for chat/autofill agents",path:["modelId"]})}}),Te=v.superRefine((t,o)=>{if(t.type==="chat"||t.type==="autofill"){if(!t.providerId)o.addIssue({code:e.ZodIssueCode.custom,message:"providerId is required for chat/autofill agents",path:["providerId"]});if(!t.modelId)o.addIssue({code:e.ZodIssueCode.custom,message:"modelId is required for chat/autofill agents",path:["modelId"]})}}),Ne=e.object({id:e.string(),sessionId:e.string(),entry:e.unknown()});var Le=e.object({apiKey:e.string().optional(),baseUrl:e.string().optional(),chatModels:e.array(e.string()).optional()});var Oe=e.object({data:e.array(e.lazy(()=>O)),pageInfo:c}),q=e.object({proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional(),thumbnailUrl:e.string().optional(),originalHeight:e.number().optional(),originalWidth:e.number().optional(),spriteUrl:e.string().optional(),duration:e.number().optional(),pageCount:e.number().optional()}),L=e.object({type:e.string().nullable(),preview:q.nullable()}),m=e.object({id:e.string(),name:e.string(),image:e.string().optional()}),M=e.object({fieldId:e.string(),value:e.any()}),V=e.object({id:e.string(),name:e.string()}),B=e.object({duration:e.number().optional(),originalWidth:e.number().optional(),originalHeight:e.number().optional(),frameRate:e.number().optional(),totalFrames:e.number().optional(),startTimecode:e.string().optional()}),O=e.object({id:e.string(),name:e.string(),sizeByte:e.number(),fileCount:e.number(),type:e.string(),targetType:e.string().optional().nullable(),status:e.string(),proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional(),latestChildren:e.array(L).optional(),preview:q.nullable().optional(),createdAt:e.string(),updatedAt:e.string(),deletedAt:e.string().nullable().optional(),projectId:e.string().optional().nullable(),creator:m.nullable().optional(),fieldValues:e.array(M).optional(),sortIndex:e.string().optional().nullable(),startTime:e.number().optional().nullable(),endTime:e.number().optional().nullable(),media:e.object({original:e.object({downloadUrl:e.string(),key:e.string().optional()}).optional(),videoTranscodes:e.array(e.object({id:e.string(),url:e.string(),key:e.string(),width:e.number(),height:e.number(),size:e.number(),isRaw:e.boolean()})).optional(),imageTranscodes:e.array(e.object({id:e.string(),url:e.string(),key:e.string(),width:e.number(),height:e.number(),size:e.number(),isRaw:e.boolean()})).optional(),videoPreview:e.object({url:e.string(),key:e.string().optional()}).optional(),pdfTranscode:e.object({url:e.string(),key:e.string().optional()}).optional(),proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional(),metadata:B.optional()}).optional(),ancestorFolders:e.array(V).optional(),versionStack:e.object({id:e.string(),versions:e.array(e.object({version:e.number(),current:e.boolean(),id:e.string(),name:e.string().optional().nullable(),previewUrl:e.string().optional().nullable(),creator:e.object({id:e.string(),name:e.string().nullable()}).nullable().optional()}))}).optional().nullable()}),De=e.object({name:e.string(),type:e.string(),projectId:e.string().optional(),parentId:e.string().optional(),key:e.string().optional(),sizeByte:e.number().optional(),contentType:e.string().optional(),creatorId:e.string().optional()}),Ee=e.object({assetId:e.string()}),_e=e.object({id:e.string(),name:e.string()}),Ge=e.object({assetId:e.string().optional(),assetType:e.string(),projectId:e.string().optional(),showDeleted:e.boolean().optional(),prefix:e.string().optional(),sort:e.string().optional(),order:e.string().optional(),...a.shape}),Ze=e.object({assetId:e.string(),userId:e.string(),replyToId:e.string().optional(),message:e.string(),annotations:e.any().optional(),second:e.number().optional(),attachmentIds:e.array(e.string())}),D=e.object({id:e.string(),assetId:e.string(),url:e.string(),proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional()}),E=e.object({id:e.string(),assetId:e.string(),message:e.string().nullable(),annotations:e.any(),second:e.number().nullable(),creator:m,replies:e.array(e.lazy(()=>E)),attachments:e.array(D),mentions:e.array(m),createdAt:e.string(),updatedAt:e.string(),sessionId:e.string().nullable(),isCompleted:e.boolean(),completionLastChangedBy:m.nullable()}),Ke=e.object({isCompleted:e.boolean()}),Qe=e.object({newParentId:e.string(),assetIds:e.array(e.string()),creatorId:e.string().optional()}),He=e.object({newParentId:e.string(),assetIds:e.array(e.string()),withComments:e.boolean().default(!1),creatorId:e.string().optional()}),Je=e.object({name:e.string()}),We=e.object({beforeIndex:e.string().optional(),afterIndex:e.string().optional()}),Xe=e.object({ids:e.array(e.string())}),Ye=e.object({ids:e.array(e.string())}),$e=e.object({file:e.instanceof(File)}),ze=e.object({key:e.string()}),et=e.object({fileName:e.string(),contentType:e.string(),size:e.number()}),tt=e.object({id:e.string(),uploadUrl:e.string()}),ot=e.object({ids:e.array(e.string())}),_=e.object({id:e.string(),name:e.string(),url:e.string()}),rt=e.object({files:e.array(_)});var at=e.object({userCount:e.number()}),st=e.object({name:e.string().min(1,"Name is required").max(100,"Name is too long")}),pt=e.object({id:e.string(),token:e.string(),name:e.string(),createdAt:e.string()});var G=e.enum(["is","eq","neq","gt","gte","lt","lte","contains","notContains","isEmpty","isNotEmpty","in","notIn","hasAny","hasAll","hasNone","isWithin"]),Z=e.object({field:e.string(),operator:G,value:e.any()}),K=e.enum(["asc","desc"]),Q=e.object({field:e.string(),order:K}),H=e.enum(["AND","OR"]),J=e.enum(["file","folder"]),u=e.object({operator:H.optional().default("AND"),conditions:e.array(Z).optional().default([]),sort:Q.optional(),assetType:J.optional(),showSymlink:e.boolean().optional(),recursively:e.boolean().optional().default(!0),query:e.string().optional(),isSemantic:e.boolean().optional().default(!1)}),dt=u.extend(a.shape);var g=e.object({sourceFolderId:e.string(),searchFilter:u}),W=e.object({id:e.string(),name:e.string(),filter:g,projectId:e.string(),createdAt:e.string(),updatedAt:e.string(),creator:e.object({id:e.string(),name:e.string(),image:e.string().optional().nullable()}).optional().nullable()}),St=e.object({name:e.string(),filter:g}),ht=e.object({name:e.string().optional(),filter:g.optional()});var xt=e.object({data:e.array(W),pageInfo:e.object({cursor:e.string().optional(),total:e.number().optional()})});var It=e.object({name:e.string(),parentId:e.string()}),vt=e.object({name:e.string()}),qt=e.object({ids:e.array(e.string())}),jt=e.object({ids:e.array(e.string())});var Ct=e.object({code:e.string(),role:e.enum(["editor","reviewer","owner"]),teamId:e.string(),teamName:e.string(),projectId:e.string().optional(),projectName:e.string().optional(),inviterName:e.string(),isUsed:e.boolean()}),Ut=e.object({role:e.enum(["editor","reviewer"])}),wt=e.object({role:e.enum(["editor","reviewer"])}),Tt=e.object({code:e.string()});var Ft={text:"text",longText:"longText",select:"select",selectMulti:"selectMulti",rating:"rating",number:"number",toggle:"toggle",date:"date",user:"user",userMulti:"userMulti"},Lt=e.object({id:e.string(),displayName:e.string(),color:e.string().optional()}),y=e.object({name:e.string(),type:e.enum(["text","longText","select","selectMulti","rating","number","toggle","date","user","userMulti"]),text:e.any().optional(),longText:e.any().optional(),select:e.any().optional(),selectMulti:e.any().optional(),rating:e.any().optional(),number:e.any().optional(),toggle:e.any().optional(),date:e.any().optional(),user:e.any().optional(),userMulti:e.any().optional()}),Mt=e.object({key:e.string().optional(),label:e.string().optional(),scope:e.string().optional(),config:y,aiAutofill:e.boolean().default(!1),description:e.string().default("")}),Vt=e.object({label:e.string().optional(),config:y,aiAutofill:e.boolean().optional(),description:e.string().optional()}),X=e.object({fieldId:e.string(),visible:e.boolean()}),Bt=e.array(X),Y=e.object({key:e.string(),value:e.any()}),Ot=e.array(Y),Dt=e.object({id:e.string(),config:y,scope:e.string(),readOnly:e.boolean(),visible:e.boolean(),description:e.string(),aiAutofill:e.boolean()});var j=e.object({id:e.string().optional(),name:e.string().optional(),role:e.string().optional()}),P=e.object({id:e.string().optional(),name:e.string().optional()}),$=e.object({id:e.string().optional(),proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional(),name:e.string().optional(),preview:e.string().optional(),thumbnailUrl:e.string().optional(),originalWidth:e.number().optional(),originalHeight:e.number().optional()}),Gt=e.object({id:e.string().optional(),creator:j.optional(),type:e.string().optional(),team:P.optional(),project:P.optional(),asset:$.optional(),user:j.optional(),createdAt:e.string().optional(),isRead:e.boolean().optional()}),Zt=e.object({unreadOnly:e.union([e.boolean(),e.string()]).transform((t)=>t===!0||t==="true").optional(),after:e.string().optional(),pageSize:e.coerce.number().optional()}),Kt=e.object({notificationId:e.string().min(1)}),Qt=e.object({comments:e.boolean().default(!0),replies:e.boolean().default(!0),mentions:e.boolean().default(!0),yourUploads:e.boolean().default(!1),otherUploads:e.boolean().default(!0),statusUpdates:e.boolean().default(!0)});var Xt=e.object({name:e.string(),coverImageKey:e.string().optional(),enableNotification:e.boolean().default(!0)}),Yt=e.object({name:e.string().optional(),coverImageKey:e.string().optional(),enableNotification:e.boolean().optional()}),z=e.object({id:e.string(),name:e.string(),teamId:e.string(),rootFolder:e.string().optional(),coverImage:e.string().optional(),coverImageKey:e.string().optional(),enableNotification:e.boolean(),updatedAt:e.union([e.string(),e.date()])}),$t=e.object({sortBy:e.string().optional(),sortDirection:e.enum(["asc","desc"]).optional()}).merge(a),zt=e.object({data:e.array(z),pageInfo:c}),eo=e.object({teamId:e.string()}),to=e.object({id:e.string(),name:e.string(),role:e.enum(["owner","editor","reviewer","bot","unknown"]),image:e.string().optional(),scope:e.enum(["team","project"]).optional()}),oo=e.object({id:e.string(),name:e.string()}),ro=e.object({assetType:e.string(),sort:e.enum(["createdAt","name","size"]).optional(),order:e.enum(["asc","desc"]).optional()}).merge(a),no=e.object({role:e.enum(["editor","reviewer"])}),io=e.object({userId:e.string(),role:e.enum(["owner","editor","reviewer"])}),ao=e.object({id:e.string(),name:e.string(),role:e.enum(["owner","editor","reviewer","bot","unknown"]),image:e.string().optional()});var k=["openai-completions","mistral-conversations","openai-responses","azure-openai-responses","openai-codex-responses","anthropic-messages","bedrock-converse-stream","google-generative-ai","google-vertex"],ee=e.object({api:e.enum(k).optional(),reasoning:e.boolean().default(!1),input:e.array(e.enum(["text","image"])).default(["text"]),contextWindow:e.number().int().positive().default(128000),maxTokens:e.number().int().positive().default(4096),cost:e.object({input:e.number().nonnegative().default(0),output:e.number().nonnegative().default(0),cacheRead:e.number().nonnegative().default(0),cacheWrite:e.number().nonnegative().default(0)})}),S=e.object({id:e.string().optional(),modelId:e.string().min(1,"Model ID is required"),name:e.string().min(0).default(""),config:ee}),h=e.object({baseUrl:e.string().url("Must be a valid URL").optional().or(e.literal("")),apiKey:e.string().optional().or(e.literal("")),api:e.enum(k),headers:e.record(e.string(),e.string()).optional(),authHeader:e.boolean().optional()}),co=e.object({name:e.string().min(1,"Provider name is required"),config:h,models:e.array(S).min(1,"At least one model is required")}),lo=e.object({config:h,models:e.array(S).min(1,"At least one model is required")}),mo=e.object({id:e.string(),name:e.string(),isBuiltin:e.boolean(),config:h,models:e.array(S).optional(),modelsCount:e.number().optional(),createdAt:e.date(),updatedAt:e.date()});var yo=e.object({name:e.string().min(1),expireAt:e.string().datetime().optional(),password:e.string().optional(),isDisabled:e.boolean().optional(),defaultSortOrder:e.string().optional(),viewMode:e.string().optional()}),So=e.object({name:e.string().min(1).optional(),expireAt:e.string().datetime().optional().nullable(),password:e.string().optional().nullable(),isDisabled:e.boolean().optional(),defaultSortOrder:e.string().optional().nullable(),viewMode:e.string().optional().nullable(),fieldVisibility:e.record(e.string(),e.boolean()).optional().nullable()}),ho=a.extend({projectId:e.string().optional()}),xo=e.object({assetIds:e.array(e.string().min(1)).min(1)});var Io=e.object({assetId:e.string().optional(),githubUrl:e.string().optional(),override:e.boolean().optional()}),vo=e.object({config:e.object({environmentVariables:e.array(e.object({name:e.string(),default:e.string().optional()}))})}),qo=e.object({permission:e.enum(["owner","editor","reviewer"])});var C=e.lazy(()=>e.object({name:e.string(),id:e.string(),size:e.number(),children:e.array(C),type:e.string(),mediaType:e.string().optional()})),ko=e.object({parentId:e.string(),files:e.array(C)}),te=e.object({id:e.string(),fileId:e.string(),url:e.string()}),Co=e.object({taskId:e.string(),presignedUrls:e.array(te),createdAssets:e.array(e.object({tempId:e.string(),assetId:e.string()})).optional()}),Uo=e.object({fileId:e.string(),errorMessage:e.string().optional()}),wo=e.object({id:e.string(),name:e.string(),total:e.number(),uploaded:e.number(),createdAt:e.string()}),To=e.object({bucket:e.string(),key:e.string(),Signature:e.string()}),No=e.object({file:e.instanceof(File)});var oe=e.object({key:e.string(),value:e.unknown()}),Lo=e.object({value:e.unknown()}),Mo=e.array(oe);var Oo=e.object({fileIds:e.array(e.string())}),Do=e.object({fileId:e.string(),beforeId:e.string()});var Go=e.object({agentId:e.string(),textPrompt:e.string().optional(),attachedFiles:e.array(e.string()).optional(),assetIds:e.array(e.string()).optional(),sessionId:e.string().optional(),contextAssetId:e.string().optional(),projectId:e.string().optional()}).superRefine((t,o)=>{let i=t.textPrompt&&t.textPrompt.trim().length>0,p=t.attachedFiles&&t.attachedFiles.length>0,d=t.assetIds&&t.assetIds.length>0;if(!i&&!p&&!d)o.addIssue({code:e.ZodIssueCode.custom,message:"At least one of textPrompt, attachedFiles, or assetIds must be provided.",path:["textPrompt"]})}),Zo=e.object({id:e.string(),agentId:e.string(),userId:e.string().nullable(),assetId:e.string().nullable(),userCommentId:e.string().nullable(),name:e.string().nullable().optional(),createdAt:e.string(),updatedAt:e.string()}),Ko=e.intersection(e.object({id:e.string()}),e.unknown());function Sr({className:t,orientation:o="horizontal",decorative:i=!0,...p}){return r(U.Root,{"data-slot":"separator",decorative:i,orientation:o,className:s("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...p})}
2
- export{ae as V,se as W,pe as X,ce as Y,le as Z,I as _,Ft as $,k as aa,S as ba,h as ca,A as da,Sr as ea};