@shumai-one/shumai 0.3.5 → 0.3.6

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 (140) hide show
  1. package/bin/{chunk-th07gms7.js → chunk-0jesq6sm.js} +1 -1
  2. package/bin/{chunk-fnkrzqrn.js → chunk-0jr6q4j4.js} +2 -2
  3. package/bin/{chunk-nh4tzzn8.js → chunk-0sajh8fw.js} +2 -2
  4. package/bin/{chunk-xt9n0y9a.js → chunk-1b7shyfp.js} +1 -1
  5. package/bin/{chunk-bv642x5z.js → chunk-1f8rr3ef.js} +2 -2
  6. package/bin/{chunk-hbrndqpj.js → chunk-1fq10abj.js} +2 -2
  7. package/bin/chunk-1hn9v6hv.js +2 -0
  8. package/bin/{chunk-97y52q3a.js → chunk-20wtz3kc.js} +3 -3
  9. package/bin/chunk-2882s5sp.js +1 -0
  10. package/bin/{chunk-fcvtv783.js → chunk-29nhtrfv.js} +1 -1
  11. package/bin/chunk-3egeywt8.js +1 -0
  12. package/bin/{chunk-29203j0e.js → chunk-3htn4m2d.js} +2 -2
  13. package/bin/{chunk-g5mpp3nc.js → chunk-47093mwk.js} +1 -1
  14. package/bin/{chunk-6vn44e4d.js → chunk-4a9sdfyp.js} +2 -2
  15. package/bin/{chunk-v0cdg3n6.js → chunk-4ajat3xv.js} +57 -57
  16. package/bin/{chunk-8vc1m0kw.js → chunk-55myfmhy.js} +2 -2
  17. package/bin/{chunk-8vvr1ez5.js → chunk-5wrakb8p.js} +1 -1
  18. package/bin/{chunk-afzc5eae.js → chunk-6awkqp09.js} +1 -1
  19. package/bin/chunk-6bztpk7h.js +1 -0
  20. package/bin/{chunk-n67rfv86.js → chunk-6edadcpn.js} +2 -2
  21. package/bin/chunk-74zstxav.js +6 -0
  22. package/bin/chunk-76hs7g0x.js +2 -0
  23. package/bin/{chunk-7jkvjm4x.js → chunk-7b60a9sy.js} +2 -2
  24. package/bin/{chunk-3w9vybrh.js → chunk-7fm1hznx.js} +2 -2
  25. package/bin/{chunk-jkapr5we.js → chunk-800vdz5n.js} +1 -1
  26. package/bin/{chunk-4sdrjye2.js → chunk-89kqtj7x.js} +2 -2
  27. package/bin/chunk-8g0mhzsg.js +2 -0
  28. package/bin/{chunk-fgda7ncw.js → chunk-8jdgzy22.js} +2 -2
  29. package/bin/chunk-8js9m1j7.js +1 -0
  30. package/bin/{chunk-4b8ms2ct.js → chunk-9annjnj2.js} +2 -2
  31. package/bin/{chunk-g0jy85re.js → chunk-9hsfjqgq.js} +2 -2
  32. package/bin/{chunk-d4zx3r12.js → chunk-9p5n3m2z.js} +1 -1
  33. package/bin/{chunk-7mkk8ahk.js → chunk-9tnfhrnh.js} +2 -2
  34. package/bin/{chunk-fq6emqwq.js → chunk-a5fw02xq.js} +3 -3
  35. package/bin/chunk-adekdctx.css +1 -0
  36. package/bin/{chunk-ks8deg42.js → chunk-aeg4kya9.js} +1 -1
  37. package/bin/{chunk-zj1rz1s9.js → chunk-bq2aq6v8.js} +2 -2
  38. package/bin/{chunk-7w2tx08e.js → chunk-c9bpf8gp.js} +2 -2
  39. package/bin/{chunk-f7fevgv2.js → chunk-ce50f746.js} +2 -2
  40. package/bin/{chunk-3mprq5kb.js → chunk-crdvxq38.js} +2 -2
  41. package/bin/{chunk-rek85wwv.js → chunk-d2qp8g98.js} +2 -2
  42. package/bin/{chunk-xnzyt0kq.js → chunk-d8bpqbdw.js} +1 -1
  43. package/bin/{chunk-wknqst3v.js → chunk-dfzmqx1v.js} +3 -3
  44. package/bin/{chunk-hk7a2mgn.js → chunk-dmjzrdan.js} +2 -2
  45. package/bin/chunk-e5s7202g.js +2 -0
  46. package/bin/{chunk-fw5k0xrc.js → chunk-ef5v7gta.js} +2 -2
  47. package/bin/{chunk-bg10gwm1.js → chunk-ew4cxkcc.js} +2 -2
  48. package/bin/{chunk-v4re49f5.js → chunk-ex4qa7gv.js} +1 -1
  49. package/bin/{chunk-5r55htaw.js → chunk-f2eh802w.js} +1 -1
  50. package/bin/{chunk-r9s1zs4g.js → chunk-f44d9fpd.js} +2 -2
  51. package/bin/chunk-f5zg7b38.js +1 -0
  52. package/bin/chunk-fdm1yc29.js +1 -0
  53. package/bin/{chunk-c5esphve.js → chunk-fwbrcfaq.js} +2 -2
  54. package/bin/{chunk-w8vk30ze.js → chunk-fzaw1e34.js} +2 -2
  55. package/bin/{chunk-xqkwpr7s.js → chunk-g70eyttc.js} +2 -2
  56. package/bin/{chunk-avvzqqk2.js → chunk-gct52xks.js} +2 -2
  57. package/bin/{chunk-2jfbxefd.js → chunk-gewh7p42.js} +6 -6
  58. package/bin/chunk-gg1gwjtn.js +2 -0
  59. package/bin/chunk-gh64hag9.js +2 -0
  60. package/bin/{chunk-qm9w9fcv.js → chunk-ghz19a7t.js} +2 -2
  61. package/bin/{chunk-kn4tnhbw.js → chunk-gra3617w.js} +2 -2
  62. package/bin/{chunk-weean2ja.js → chunk-gx5rjm9m.js} +1 -1
  63. package/bin/chunk-h0p8yew4.js +1 -0
  64. package/bin/chunk-hgngnc1k.js +1 -0
  65. package/bin/chunk-hqbzjzsm.js +2 -0
  66. package/bin/{chunk-d1zpcags.js → chunk-j1awxx51.js} +2 -2
  67. package/bin/{chunk-52qe6z8w.js → chunk-js0genbf.js} +1 -1
  68. package/bin/chunk-jt4yh37q.js +62 -0
  69. package/bin/{chunk-8fsrs7mh.js → chunk-jtd7rydv.js} +1 -1
  70. package/bin/chunk-k0xpskyq.js +1 -0
  71. package/bin/{chunk-q0znwxfe.js → chunk-kaxwma6y.js} +1 -1
  72. package/bin/{chunk-p3k6nzhe.js → chunk-kk0gx8eg.js} +2 -2
  73. package/bin/{chunk-gd1x3rgn.js → chunk-mgbqjbfc.js} +1 -1
  74. package/bin/{chunk-sx1neqgr.js → chunk-mhj0pqq3.js} +2 -2
  75. package/bin/{chunk-4rz2105a.js → chunk-mmrtjcst.js} +1 -1
  76. package/bin/{chunk-8hq6sn31.js → chunk-mxee09jk.js} +2 -2
  77. package/bin/{chunk-f70xdh07.js → chunk-n198tewr.js} +2 -2
  78. package/bin/{chunk-6j6dejtd.js → chunk-n9cjmkky.js} +1 -1
  79. package/bin/{chunk-17bewdr0.js → chunk-nh31ma8d.js} +2 -2
  80. package/bin/{chunk-t58kqafx.js → chunk-nh8azwsx.js} +2 -2
  81. package/bin/chunk-nhc72y4x.js +2 -0
  82. package/bin/{chunk-7zdmpbt6.js → chunk-pm64et9d.js} +1 -1
  83. package/bin/chunk-px6q3jpz.js +1 -0
  84. package/bin/{chunk-jf5ytqxd.js → chunk-q7xfrtnj.js} +1 -1
  85. package/bin/{chunk-0bbhm7dp.js → chunk-rmm6y799.js} +2 -2
  86. package/bin/{chunk-b93djch5.js → chunk-snexx7ks.js} +1 -1
  87. package/bin/chunk-sx3by19j.js +1 -0
  88. package/bin/{chunk-p33nq4pp.js → chunk-sx7kparv.js} +2 -2
  89. package/bin/{chunk-vzb2b89p.js → chunk-t5561vz5.js} +1 -1
  90. package/bin/chunk-thj4cpev.js +2 -0
  91. package/bin/{chunk-8na8a41a.js → chunk-tqxmj05h.js} +2 -2
  92. package/bin/{chunk-54hmgj96.js → chunk-vgr9db5g.js} +2 -2
  93. package/bin/{chunk-gwxzjc0m.js → chunk-vqgz25av.js} +1 -1
  94. package/bin/{chunk-s0k2r6ym.js → chunk-vw1rhgjs.js} +2 -2
  95. package/bin/chunk-vz75bqvx.js +2 -0
  96. package/bin/{chunk-8skgcmxm.js → chunk-w16jgdfx.js} +1 -1
  97. package/bin/{chunk-x2z5zz01.js → chunk-w4ycztv5.js} +1 -1
  98. package/bin/{chunk-8mzg29m4.js → chunk-w98wvk17.js} +2 -2
  99. package/bin/chunk-wa8k9fwx.js +1 -0
  100. package/bin/{chunk-wg5tjyj9.js → chunk-y0yrmcf3.js} +2 -2
  101. package/bin/{chunk-3ydjrkbd.js → chunk-y1t47c7f.js} +1 -1
  102. package/bin/{chunk-c2a5x1pk.js → chunk-y8vw7zv1.js} +1 -1
  103. package/bin/{chunk-s0g0bc6t.js → chunk-ym47952x.js} +2 -2
  104. package/bin/{chunk-43mhpb0k.js → chunk-yzra1x8f.js} +2 -2
  105. package/bin/{chunk-arxd4qb9.js → chunk-z0tbq08w.js} +1 -1
  106. package/bin/{chunk-vpq224tm.js → chunk-z0zevgb6.js} +1 -1
  107. package/bin/{chunk-5yxngq5n.js → chunk-z2ef8zpz.js} +1 -1
  108. package/bin/chunk-z3p3qz9d.js +3 -0
  109. package/bin/chunk-zv85aqwb.css +1 -0
  110. package/bin/shumai-app.html +1 -1
  111. package/bin/shumai-app.js +484 -343
  112. package/package.json +7 -7
  113. package/prisma/migrations/20260810025327_add_mcp_servers/migration.sql +71 -0
  114. package/prisma/migrations/20260810074554_mcp_server_cleanup/migration.sql +12 -0
  115. package/prisma/migrations/20260810124707_add_mcp_server_instructions/migration.sql +2 -0
  116. package/prisma/schema.prisma +69 -0
  117. package/bin/chunk-1fqpgz02.js +0 -2
  118. package/bin/chunk-21hvrvzj.js +0 -2
  119. package/bin/chunk-23mj9p82.js +0 -1
  120. package/bin/chunk-24mag65w.js +0 -1
  121. package/bin/chunk-2jv9re91.js +0 -2
  122. package/bin/chunk-2rmceamt.js +0 -1
  123. package/bin/chunk-6kv3jyfc.js +0 -2
  124. package/bin/chunk-8ttfy5yy.js +0 -1
  125. package/bin/chunk-95qc4bkh.js +0 -2
  126. package/bin/chunk-9nd5m7hy.js +0 -1
  127. package/bin/chunk-ampyjbj4.js +0 -1
  128. package/bin/chunk-bkcf4hw5.js +0 -1
  129. package/bin/chunk-cbjfw47x.js +0 -62
  130. package/bin/chunk-h2tztyxs.js +0 -1
  131. package/bin/chunk-htrzgs2a.css +0 -1
  132. package/bin/chunk-jqyprvqd.js +0 -1
  133. package/bin/chunk-jyeyp8p3.js +0 -1
  134. package/bin/chunk-kwr4m6vh.js +0 -1
  135. package/bin/chunk-n62kyrh1.js +0 -1
  136. package/bin/chunk-ntxwp6aa.js +0 -3
  137. package/bin/chunk-qxwfhv63.js +0 -2
  138. package/bin/chunk-x217skr3.js +0 -2
  139. package/bin/chunk-y6aa5ee0.js +0 -2
  140. package/bin/{chunk-vvr179pz.js → chunk-hcvpb1hw.js} +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shumai-one/shumai",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
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.3.5",
31
- "@shumai-one/shumai-darwin-x64": "0.3.5",
32
- "@shumai-one/shumai-linux-arm64": "0.3.5",
33
- "@shumai-one/shumai-linux-x64": "0.3.5",
34
- "@shumai-one/shumai-win32-arm64": "0.3.5",
35
- "@shumai-one/shumai-win32-x64": "0.3.5"
30
+ "@shumai-one/shumai-darwin-arm64": "0.3.6",
31
+ "@shumai-one/shumai-darwin-x64": "0.3.6",
32
+ "@shumai-one/shumai-linux-arm64": "0.3.6",
33
+ "@shumai-one/shumai-linux-x64": "0.3.6",
34
+ "@shumai-one/shumai-win32-arm64": "0.3.6",
35
+ "@shumai-one/shumai-win32-x64": "0.3.6"
36
36
  },
37
37
  "repository": {
38
38
  "type": "git",
@@ -0,0 +1,71 @@
1
+ -- CreateEnum
2
+ CREATE TYPE "McpTransport" AS ENUM ('streamable_http', 'sse');
3
+
4
+ -- CreateTable
5
+ CREATE TABLE "mcp_servers" (
6
+ "id" TEXT NOT NULL,
7
+ "name" TEXT NOT NULL,
8
+ "url" TEXT NOT NULL,
9
+ "transport" "McpTransport" NOT NULL DEFAULT 'streamable_http',
10
+ "authConfig" JSONB DEFAULT '{}',
11
+ "config" JSONB DEFAULT '{}',
12
+ "enabled" BOOLEAN NOT NULL DEFAULT true,
13
+ "permission" "TeamMemberRole" NOT NULL DEFAULT 'reviewer',
14
+ "tools" JSONB DEFAULT '[]',
15
+ "status" TEXT NOT NULL DEFAULT 'not_connected',
16
+ "last_error" TEXT,
17
+ "last_connected_at" TIMESTAMP(3),
18
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
19
+ "updated_at" TIMESTAMP(3) NOT NULL,
20
+ "team_id" TEXT NOT NULL,
21
+
22
+ CONSTRAINT "mcp_servers_pkey" PRIMARY KEY ("id")
23
+ );
24
+
25
+ -- CreateTable
26
+ CREATE TABLE "agent_mcp_servers" (
27
+ "id" TEXT NOT NULL,
28
+ "agent_id" TEXT NOT NULL,
29
+ "mcp_server_id" TEXT NOT NULL,
30
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
31
+ "updated_at" TIMESTAMP(3) NOT NULL,
32
+
33
+ CONSTRAINT "agent_mcp_servers_pkey" PRIMARY KEY ("id")
34
+ );
35
+
36
+ -- CreateTable
37
+ CREATE TABLE "mcp_server_credentials" (
38
+ "id" TEXT NOT NULL,
39
+ "server_id" TEXT NOT NULL,
40
+ "server_url" TEXT NOT NULL,
41
+ "tokens" JSONB,
42
+ "clientInfo" JSONB,
43
+ "code_verifier" TEXT,
44
+ "oauth_state" TEXT,
45
+ "pending_auth" JSONB,
46
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
47
+ "updated_at" TIMESTAMP(3) NOT NULL,
48
+
49
+ CONSTRAINT "mcp_server_credentials_pkey" PRIMARY KEY ("id")
50
+ );
51
+
52
+ -- CreateIndex
53
+ CREATE UNIQUE INDEX "mcp_servers_team_id_name_key" ON "mcp_servers"("team_id", "name");
54
+
55
+ -- CreateIndex
56
+ CREATE UNIQUE INDEX "agent_mcp_servers_agent_id_mcp_server_id_key" ON "agent_mcp_servers"("agent_id", "mcp_server_id");
57
+
58
+ -- CreateIndex
59
+ CREATE UNIQUE INDEX "mcp_server_credentials_server_id_key" ON "mcp_server_credentials"("server_id");
60
+
61
+ -- AddForeignKey
62
+ ALTER TABLE "mcp_servers" ADD CONSTRAINT "mcp_servers_team_id_fkey" FOREIGN KEY ("team_id") REFERENCES "teams"("id") ON DELETE CASCADE ON UPDATE CASCADE;
63
+
64
+ -- AddForeignKey
65
+ ALTER TABLE "agent_mcp_servers" ADD CONSTRAINT "agent_mcp_servers_agent_id_fkey" FOREIGN KEY ("agent_id") REFERENCES "agents"("id") ON DELETE CASCADE ON UPDATE CASCADE;
66
+
67
+ -- AddForeignKey
68
+ ALTER TABLE "agent_mcp_servers" ADD CONSTRAINT "agent_mcp_servers_mcp_server_id_fkey" FOREIGN KEY ("mcp_server_id") REFERENCES "mcp_servers"("id") ON DELETE CASCADE ON UPDATE CASCADE;
69
+
70
+ -- AddForeignKey
71
+ ALTER TABLE "mcp_server_credentials" ADD CONSTRAINT "mcp_server_credentials_server_id_fkey" FOREIGN KEY ("server_id") REFERENCES "mcp_servers"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,12 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to drop the column `enabled` on the `mcp_servers` table. All the data in the column will be lost.
5
+
6
+ */
7
+ -- DropIndex
8
+ DROP INDEX "mcp_servers_team_id_name_key";
9
+
10
+ -- AlterTable
11
+ ALTER TABLE "mcp_servers" DROP COLUMN "enabled",
12
+ ADD COLUMN "description" TEXT;
@@ -0,0 +1,2 @@
1
+ -- AlterTable
2
+ ALTER TABLE "mcp_servers" ADD COLUMN "instructions" TEXT;
@@ -252,6 +252,7 @@ model Team {
252
252
  userMetadata UserMetadata[] @relation("TeamToUserMetadata")
253
253
  providers Provider[] @relation("TeamToProvider")
254
254
  skills Skill[] @relation("TeamToSkill")
255
+ mcpServers McpServer[] @relation("TeamToMcpServer")
255
256
  sandbox Sandbox? @relation("TeamToSandbox")
256
257
  agents Agent[] @relation("TeamToAgent")
257
258
  aiUsages AiUsage[] @relation("TeamToAiUsage")
@@ -754,6 +755,7 @@ model Agent {
754
755
  updatedAt DateTime @updatedAt @map("updated_at")
755
756
  agentSessions AgentSession[]
756
757
  skills AgentSkill[]
758
+ mcpServers AgentMcpServer[]
757
759
 
758
760
  @@map("agents")
759
761
  }
@@ -771,6 +773,73 @@ model AgentSkill {
771
773
  @@map("agent_skills")
772
774
  }
773
775
 
776
+ model McpServer {
777
+ id String @id @default(ulid())
778
+ name String
779
+ description String?
780
+ instructions String?
781
+ url String
782
+ transport McpTransport @default(streamable_http)
783
+ /// [McpServerAuthConfig]
784
+ authConfig Json? @default("{}")
785
+ /// [McpServerConfig]
786
+ config Json? @default("{}")
787
+ permission TeamMemberRole @default(reviewer)
788
+ /// [McpToolInfo[]]
789
+ tools Json? @default("[]")
790
+ status String @default("not_connected")
791
+ lastError String? @map("last_error")
792
+ lastConnectedAt DateTime? @map("last_connected_at")
793
+ createdAt DateTime @default(now()) @map("created_at")
794
+ updatedAt DateTime @updatedAt @map("updated_at")
795
+
796
+ teamId String @map("team_id")
797
+ team Team @relation("TeamToMcpServer", fields: [teamId], references: [id], onDelete: Cascade)
798
+
799
+ credential McpServerCredential?
800
+ agentMcpServers AgentMcpServer[]
801
+
802
+ @@map("mcp_servers")
803
+ }
804
+
805
+ // Join table: which agents get which MCP servers (mirrors AgentSkill).
806
+ model AgentMcpServer {
807
+ id String @id @default(ulid())
808
+ agentId String @map("agent_id")
809
+ agent Agent @relation(fields: [agentId], references: [id], onDelete: Cascade)
810
+ mcpServerId String @map("mcp_server_id")
811
+ mcpServer McpServer @relation(fields: [mcpServerId], references: [id], onDelete: Cascade)
812
+ createdAt DateTime @default(now()) @map("created_at")
813
+ updatedAt DateTime @updatedAt @map("updated_at")
814
+
815
+ @@unique([agentId, mcpServerId])
816
+ @@map("agent_mcp_servers")
817
+ }
818
+
819
+ model McpServerCredential {
820
+ id String @id @default(ulid())
821
+ serverId String @unique @map("server_id")
822
+ server McpServer @relation(fields: [serverId], references: [id], onDelete: Cascade)
823
+ serverUrl String @map("server_url")
824
+ /// [McpStoredTokens]
825
+ tokens Json?
826
+ /// [McpStoredClientInfo]
827
+ clientInfo Json?
828
+ codeVerifier String? @map("code_verifier")
829
+ oauthState String? @map("oauth_state")
830
+ /// [McpPendingAuth]
831
+ pendingAuth Json? @map("pending_auth")
832
+ createdAt DateTime @default(now()) @map("created_at")
833
+ updatedAt DateTime @updatedAt @map("updated_at")
834
+
835
+ @@map("mcp_server_credentials")
836
+ }
837
+
838
+ enum McpTransport {
839
+ streamable_http
840
+ sse
841
+ }
842
+
774
843
  model AgentSession {
775
844
  id String @id @default(ulid())
776
845
  agentId String @map("agent_id")
@@ -1,2 +0,0 @@
1
- import{e as RA}from"./chunk-y6aa5ee0.js";import{f as yA,g as DA}from"./chunk-8na8a41a.js";import{l as xA}from"./chunk-v0cdg3n6.js";import{o as wA}from"./chunk-29203j0e.js";import{J as NA,w as OA}from"./chunk-6kv3jyfc.js";import{V as MA}from"./chunk-s0k2r6ym.js";import{Ea as qA,Ha as kA,Ja as i,ra as y,ua as QA,va as UA}from"./chunk-fw5k0xrc.js";import{tf as WA,uf as l}from"./chunk-fnkrzqrn.js";import{vf as EA}from"./chunk-6vn44e4d.js";import{dg as LA}from"./chunk-t58kqafx.js";import{xg as zA}from"./chunk-8mzg29m4.js";import{Ag as J1,Bg as c,Cg as B,Dg as U,Eg as VA,Gj as TA,Hg as o,Jg as $A,Kg as r,Pg as HA,eh as H,yj as KA}from"./chunk-cbjfw47x.js";import{Kk as G1}from"./chunk-gd1x3rgn.js";var X=G1(J1(),1);function BA(Y,J,q,Z,E,K){let h=Y.type==="folder",T=J.type==="folder";if(h!==T)return null;let L=T?Z:E,k=L.findIndex(($)=>$.id===q),O=L.findIndex(($)=>$.id===J.id);if(k===-1||O===-1)return null;let C=Math.min(k,O),F=Math.max(k,O),M=L.slice(C,F+1),_=new Set(K);return M.forEach(($)=>{if($.id)_.add($.id)}),_}function X1({teamId:Y,projectId:J,projectName:q,assetId:Z,rootFolderId:E,collection:K,onUpdateCollection:h}){let T=HA(),L=VA(),{canEdit:k}=zA(J),{setFields:O}=OA(),C=H.api.files[":fileId"].metadata.$patch,{mutate:F}=$A({mutationFn:async(A)=>{if(!(await C(A)).ok)throw Error("Failed to patch metadata");return null}}),{data:M}=o({queryKey:["fields",J],queryFn:async()=>{let A=await H.api.projects[":projectId"].fields.$get({param:{projectId:J}});if(!A.ok)throw Error("Failed to fetch fields");return await A.json()},enabled:!!J});X.useEffect(()=>{if(M)O(M,J)},[M,J,O]);let _=Z==="recently-deleted",[$,g]=X.useState(null),[W,D]=X.useState(new Set),[u,a]=X.useState(null),[PA,vA]=X.useState(240),[bA,hA]=X.useState(360),{isChatbotOpen:f}=l(),{members:CA,fetchMembers:d}=NA(),{metadata:FA,fetchMetadata:s,setMetadata:gA}=LA();X.useEffect(()=>{if(Y)d(Y),s(Y)},[Y,d,s]);let S=X.useMemo(()=>{return K?.filter?.searchFilter?.conditions||[]},[K]),[N,j]=X.useState(S);X.useEffect(()=>{j(S)},[S]);let t=`project:${J}:sort`,w=FA[t]||{field:"custom",order:"asc"},uA=(A)=>{if(A)gA(Y,t,A)},z=!!K,p=N.length>0||z,{fileListLeftSidebarCollapsed:e,setFileListLeftSidebarCollapsed:fA,fileListRightSidebarCollapsed:AA,setFileListRightSidebarCollapsed:SA,viewModes:jA}=EA(),GA=jA[J]??"card",pA=X.useRef(null),{data:P}=_?{data:void 0}:o({queryKey:["folders",Z],queryFn:async()=>{let A=await H.api.folders[":folderId"].$get({param:{folderId:Z}});if(!A.ok)throw Error("failed to fetch folder");return await A.json()}}),{setProjectState:JA,clearProjectState:XA}=WA();X.useEffect(()=>{return JA({teamId:Y,projectId:J,projectName:q,ancestorFolders:P?.ancestorFolders??[],currentAsset:_?{name:"Recently Deleted",type:"folder"}:z?{name:K.name,type:"folder"}:{name:P?.name,type:"folder"},isRootFolder:!_&&!z&&Z===E,onFolderClick:(A)=>{T({to:"/projects/$projectId/folders/$folderId",params:{projectId:J,folderId:A}})}}),()=>XA()},[Y,J,q,P,_,Z,E,JA,XA,T]);let{data:m,fetchNextPage:mA,hasNextPage:nA,isFetchingNextPage:IA}=r({queryKey:_?["projects",J,"recently-deleted","folder"]:["search",Y,Z,"folder",N,w,z],queryFn:async({pageParam:A})=>{if(_||z){if(_){let V=await H.api.projects[":projectId"]["recently-deleted"].$get({param:{projectId:J},query:{assetType:"folder",after:A}});if(!V.ok)throw Error("failed to fetch recently deleted folders");return await V.json()}return{data:[],pageInfo:{total:0}}}if(p)return{data:[],pageInfo:{total:0}};let G=await H.api.folders[":folderId"].search.$post({param:{folderId:Z},json:{assetType:"folder",after:A,recursively:!1,sort:w,conditions:[]}});if(!G.ok)throw Error("failed to search folders");return await G.json()},enabled:!p,initialPageParam:"",getNextPageParam:(A)=>{return A.pageInfo?.cursor||void 0}}),{data:n,fetchNextPage:cA,hasNextPage:oA,isFetchingNextPage:rA}=r({queryKey:_?["projects",J,"recently-deleted","file"]:["search",Y,Z,"file",N,w,z],queryFn:async({pageParam:A})=>{if(_){let V=await H.api.projects[":projectId"]["recently-deleted"].$get({param:{projectId:J},query:{assetType:"file",after:A}});if(!V.ok)throw Error("failed to fetch recently deleted files");return await V.json()}let G=await H.api.folders[":folderId"].search.$post({param:{folderId:Z},json:{assetType:"file",after:A,recursively:p||z,conditions:N,sort:w}});if(!G.ok)throw Error("failed to search files");return await G.json()},initialPageParam:"",getNextPageParam:(A)=>{return A.pageInfo?.cursor||void 0}}),v=m?.pages.flatMap((A)=>A.data??[])??[],Q=n?.pages.flatMap((A)=>A.data??[])??[],lA=m?.pages[0]?.pageInfo?.total,iA=n?.pages[0]?.pageInfo?.total,aA=m?.pages[0]?.pageInfo?.totalSize,dA=n?.pages[0]?.pageInfo?.totalSize,YA=()=>{D(new Set),g(null),a(null)},{dragState:x,handleDragStart:sA,handleDragEnd:tA}=DA({teamId:Y,projectId:J,assetId:Z,folders:v,files:Q,selectedIds:W,onClearSelection:YA}),I=X.useMemo(()=>{if(W.size!==1)return null;let A=Array.from(W)[0];return Q.find((V)=>V.id===A)||null},[W,Q]),eA=(A)=>{if(_)return;if(A.type==="folder")j([]),T({to:"/projects/$projectId/folders/$folderId",params:{projectId:J,folderId:A.id}});else T({to:"/projects/$projectId/files/$fileId",params:{projectId:J,fileId:A.versionStack?A.versionStack.id:A.id},search:{version:void 0}})},A1=(A,G)=>{let V=G.metaKey||G.ctrlKey;if(G.shiftKey&&u){let _A=[...v,...Q].find((b)=>b.id===u);if(_A){let b=BA(_A,A,u,v,Q,W);if(b){D(b),g(A);return}}}if(V){let R=new Set(W);if(R.has(A.id))R.delete(A.id);else R.add(A.id);D(R)}else D(new Set([A.id]));a(A.id),g(A)},ZA=(A,G,V)=>{F({param:{fileId:A},json:[{key:G,value:V}]},{onSuccess:()=>{L.invalidateQueries({queryKey:["folders",Z,"children",{assetType:"file"}]}),L.invalidateQueries({queryKey:["search",Y,Z]})}})};return U(qA,{modifiers:[yA.configure({anchor:{x:0,y:0}})],plugins:(A)=>A.map((G)=>{if(G===y)return y.configure({dropAnimation:null});if(typeof G==="object"&&G!==null&&"plugin"in G&&G.plugin===y)return y.configure({dropAnimation:null});return G}),sensors:_||!k?[]:[UA.configure({activationConstraints:[new QA.Distance({value:10})]})],onDragStart:sA,onDragEnd:tA,children:[B("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:U("div",{ref:pA,className:"flex flex-1 overflow-hidden relative",children:[!e&&B("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>fA(!0)}),(!AA||f)&&B("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>{SA(!0),l.getState().setIsChatbotOpen(!1)}}),!e&&U(c,{children:[B("div",{className:"bg-background",style:{width:PA},children:B(MA,{teamId:Y,projectId:J,projectName:q,rootFolderId:E,dragState:x,ancestorFolders:P?.ancestorFolders??[]})}),B(i,{onResize:(A)=>{vA((G)=>Math.max(180,Math.min(400,G+A)))},className:"hidden md:block"})]}),B(wA,{teamId:Y,projectId:J,assetId:Z,folders:v,files:Q,totalFolders:lA,totalFiles:iA,totalFoldersSize:aA,totalFilesSize:dA,selectedItem:$,selectedIds:W,onItemSelect:A1,onItemDoubleClick:eA,onSaveField:ZA,displayStyle:GA,onClearSelection:YA,fetchNextFoldersPage:mA,hasNextFoldersPage:nA||!1,isFetchingNextFoldersPage:IA,fetchNextFilesPage:cA,hasNextFilesPage:oA||!1,isFetchingNextFilesPage:rA,isRecentlyDeleted:_,filterConditions:N,onFilterChange:j,sort:w,onSortChange:uA,dragState:x,collection:K,onUpdateCollection:h,rootFolderId:E}),(!AA||f)&&U(c,{children:[B(i,{onResize:(A)=>{hA((G)=>Math.max(240,Math.min(600,G-A)))},className:"hidden md:block"}),B("div",{style:{width:bA},className:"bg-background flex flex-col flex-shrink-0",children:f?B(RA,{projectId:J,contextAssetId:Z}):I?B(xA,{teamId:Y,projectId:J,file:I,onSaveField:(A,G)=>ZA(I.id,A,G),members:CA,hideAnnotationControl:!0}):B("div",{className:"flex h-full items-center justify-center p-4 text-center text-sm text-muted-foreground",children:TA.select_asset_to_view_details()})})]})]})}),B(kA,{children:x?.isActive?B("div",{className:KA("flex items-center gap-2 rounded-md bg-popover px-3 py-2 text-sm font-medium text-popover-foreground shadow-md ring-1 ring-border cursor-grabbing",GA==="list"&&"w-30 h-[40px] px-0 flex-none overflow-hidden justify-center"),style:{transform:"translate(0px, 0px)"},children:U("span",{children:["Moving ",x.itemCount," item",x.itemCount!==1?"s":""]})}):null})]})}
2
- export{X1 as d};
@@ -1,2 +0,0 @@
1
- import{ig as e}from"./chunk-r9s1zs4g.js";import{Cg as v,sj as U,yj as P}from"./chunk-cbjfw47x.js";var x={human:"human",agent:"agent"};var l={editor:"editor",reviewer:"reviewer"};var S={team:"team",project:"project"};var h={chat:"chat",autofill:"autofill",embedding:"embedding"};var n=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 ge=e.object({name:e.string()}),w=e.object({id:e.string(),name:e.string(),rootFolder:e.string().optional(),updatedAt:e.union([e.string(),e.date()])});var ye=e.object({data:e.array(w),pageInfo:n}),ue=e.object({teamId:e.string(),userId:e.string()}),xe=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()}),Se=e.object({name:e.string().optional(),imageKey:e.string().nullable().optional()}),he=e.object({id:e.string(),name:e.string(),role:e.enum(["owner","editor","reviewer","bot","unknown"]),email:e.string().optional(),type:e.nativeEnum(x).optional(),image:e.string().optional(),scope:e.nativeEnum(S).optional()}),be=e.object({includeAgents:e.string().optional().transform((o)=>o==="true")}),C={best_match:"best_match",all:"all"},_e=e.union([e.object({key:e.literal("transcode.videoStrategy"),value:e.nativeEnum(C)})]),Re=e.object({allowedDomains:e.array(e.string()),pendingDomains:e.array(e.string()).default([])});var je=e.object({role:e.enum(["editor","reviewer"])});var b=e.nativeEnum(h),_=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()}),Te=e.object({id:e.string(),name:e.string(),type:b,enabled:e.boolean(),avatar:e.string().optional(),providerId:e.string().optional(),modelId:e.string().optional(),thinkingLevel:_.optional().default("off"),systemPrompt:e.string().optional(),soul:e.string().optional(),skills:e.array(F).optional(),deniedTools:e.array(e.string()).optional()}),R=e.object({name:e.string().min(1),type:b,enabled:e.boolean().optional().default(!0),avatar:e.string().optional(),providerId:e.string().optional(),modelId:e.string().optional(),thinkingLevel:_.optional().default("off"),systemPrompt:e.string().optional(),soul:e.string().optional(),skills:e.array(e.string()).optional(),deniedTools:e.array(e.string()).optional()}),ve=R.superRefine((o,r)=>{if(o.type==="chat"||o.type==="autofill"){if(!o.providerId)r.addIssue({code:e.ZodIssueCode.custom,message:"providerId is required for chat/autofill agents",path:["providerId"]});if(!o.modelId)r.addIssue({code:e.ZodIssueCode.custom,message:"modelId is required for chat/autofill agents",path:["modelId"]})}}),Ue=R.superRefine((o,r)=>{if(o.type==="chat"||o.type==="autofill"){if(!o.providerId)r.addIssue({code:e.ZodIssueCode.custom,message:"providerId is required for chat/autofill agents",path:["providerId"]});if(!o.modelId)r.addIssue({code:e.ZodIssueCode.custom,message:"modelId is required for chat/autofill agents",path:["modelId"]})}}),Pe=e.object({id:e.string(),sessionId:e.string(),entry:e.unknown()}),Me=e.object({id:e.string(),name:e.string().nullable().optional(),type:e.string(),createdAt:e.string(),creator:e.object({id:e.string(),name:e.string().nullable().optional(),email:e.string().nullable().optional(),image:e.string().nullable().optional()}).nullable().optional(),agentId:e.string().optional()});var Fe=e.object({apiKey:e.string().optional(),baseUrl:e.string().optional(),chatModels:e.array(e.string()).optional()}),N=e.enum(["1h","24h","7d","30d"]),Ne=e.object({timeframe:N.default("30d"),userId:e.string().optional()});var Oe=e.object({data:e.array(e.lazy(()=>V)),pageInfo:n}),j=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:j.nullable()}),s=e.object({id:e.string(),name:e.string(),image:e.string().optional()}),E=e.object({fieldId:e.string(),value:e.any()}),W=e.object({id:e.string(),name:e.string()}),O=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()}),V=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:j.nullable().optional(),createdAt:e.string(),updatedAt:e.string(),deletedAt:e.string().nullable().optional(),projectId:e.string().optional().nullable(),creator:s.nullable().optional(),fieldValues:e.array(E).optional(),sortIndex:e.string().optional().nullable(),startTime:e.number().optional().nullable(),endTime:e.number().optional().nullable(),media:e.object({original:e.object({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()})).optional(),imageTranscodes:e.array(e.object({id:e.string(),url:e.string(),key:e.string(),width:e.number(),height:e.number(),size:e.number()})).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:O.optional()}).optional(),ancestorFolders:e.array(W).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()}),Ve=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()}),Qe=e.object({assetId:e.string()}),Ke=e.object({id:e.string(),name:e.string()}),De=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())}),Q=e.object({id:e.string(),assetId:e.string(),url:e.string(),proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional()}),K=e.object({id:e.string(),assetId:e.string(),message:e.string().nullable(),annotations:e.any(),second:e.number().nullable(),creator:s,replies:e.array(e.lazy(()=>K)),attachments:e.array(Q),mentions:e.array(s),createdAt:e.string(),updatedAt:e.string(),sessionId:e.string().nullable(),isCompleted:e.boolean(),completionLastChangedBy:s.nullable()}),Be=e.object({isCompleted:e.boolean()}),Ge=e.object({newParentId:e.string(),assetIds:e.array(e.string()),creatorId:e.string().optional()}),Je=e.object({newParentId:e.string(),assetIds:e.array(e.string()),withComments:e.boolean().default(!1),creatorId:e.string().optional()}),Ye=e.object({name:e.string()}),He=e.object({beforeIndex:e.string().optional(),afterIndex:e.string().optional()}),Xe=e.object({ids:e.array(e.string())}),$e=e.object({ids:e.array(e.string())}),Ae=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())}),D=e.object({id:e.string(),name:e.string(),url:e.string()}),rt=e.object({files:e.array(D)});var st=e.object({userCount:e.number()}),it=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 Z=e.enum(["is","eq","neq","gt","gte","lt","lte","contains","notContains","isEmpty","isNotEmpty","in","notIn","hasAny","hasAll","hasNone","isWithin"]),B=e.object({field:e.string(),operator:Z,value:e.any()}),G=e.enum(["asc","desc"]),J=e.object({field:e.string(),order:G}),Y=e.enum(["AND","OR"]),H=e.enum(["file","folder"]),m=e.object({operator:Y.optional().default("AND"),conditions:e.array(B).optional().default([]),sort:J.optional(),assetType:H.optional(),showSymlink:e.boolean().optional(),recursively:e.boolean().optional().default(!0),query:e.string().optional(),isSemantic:e.boolean().optional().default(!1)}),ft=m.extend(a.shape);var f=e.object({sourceFolderId:e.string(),searchFilter:m}),X=e.object({id:e.string(),name:e.string(),filter:f,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()}),xt=e.object({name:e.string(),filter:f}),St=e.object({name:e.string().optional(),filter:f.optional()});var ht=e.object({data:e.array(X),pageInfo:e.object({cursor:e.string().optional(),total:e.number().optional()})});var Rt=e.object({name:e.string(),parentId:e.string()}),jt=e.object({name:e.string()}),kt=e.object({ids:e.array(e.string())}),It=e.object({ids:e.array(e.string())});var Ut=e.object({code:e.string(),role:e.string(),teamId:e.string(),teamName:e.string(),projectId:e.string().optional(),projectName:e.string().optional(),inviterName:e.string(),isUsed:e.boolean()}),Pt=e.object({role:e.nativeEnum(l)}),Mt=e.object({role:e.nativeEnum(l)}),wt=e.object({code:e.string()});var Et={text:"text",longText:"longText",select:"select",selectMulti:"selectMulti",rating:"rating",number:"number",toggle:"toggle",date:"date",user:"user",userMulti:"userMulti"},Wt=e.object({id:e.string(),displayName:e.string(),color:e.string().optional()}),d=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()}),Ot=e.object({key:e.string().optional(),label:e.string().optional(),scope:e.string().optional(),config:d,aiAutofill:e.boolean().default(!1),description:e.string().default("")}),Vt=e.object({label:e.string().optional(),config:d,aiAutofill:e.boolean().optional(),description:e.string().optional()}),$=e.object({fieldId:e.string(),visible:e.boolean()}),Qt=e.array($),A=e.object({key:e.string(),value:e.any()}),Kt=e.array(A),Dt=e.object({id:e.string(),config:d,scope:e.string(),readOnly:e.boolean(),visible:e.boolean(),description:e.string(),aiAutofill:e.boolean()});var k=e.object({id:e.string().optional(),name:e.string().optional(),role:e.string().optional()}),I=e.object({id:e.string().optional(),name:e.string().optional()}),z=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:k.optional(),type:e.string().optional(),team:I.optional(),project:I.optional(),asset:z.optional(),user:k.optional(),createdAt:e.string().optional(),isRead:e.boolean().optional()}),Jt=e.object({unreadOnly:e.union([e.boolean(),e.string()]).transform((o)=>o===!0||o==="true").optional(),after:e.string().optional(),pageSize:e.coerce.number().optional()}),Yt=e.object({notificationId:e.string().min(1)}),Ht=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 zt=e.object({name:e.string(),coverImageKey:e.string().optional(),enableNotification:e.boolean().default(!0)}),eo=e.object({name:e.string().optional(),coverImageKey:e.string().optional(),enableNotification:e.boolean().optional()}),ee=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()])}),to=e.object({sortBy:e.string().optional(),sortDirection:e.enum(["asc","desc"]).optional()}).merge(a),oo=e.object({data:e.array(ee),pageInfo:n}),ro=e.object({teamId:e.string()}),ao=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(),hasCustomRole:e.boolean().optional()}),no=e.object({id:e.string(),name:e.string()}),so=e.object({assetType:e.string(),sort:e.enum(["createdAt","name","size"]).optional(),order:e.enum(["asc","desc"]).optional()}).merge(a),io=e.object({role:e.enum(["editor","reviewer"])}),po=e.object({userId:e.string(),role:e.enum(["owner","editor","reviewer"])}),co=e.object({id:e.string(),name:e.string(),role:e.enum(["owner","editor","reviewer","bot","unknown"]),image:e.string().optional()});var q=["openai-completions","mistral-conversations","openai-responses","azure-openai-responses","openai-codex-responses","anthropic-messages","bedrock-converse-stream","google-generative-ai","google-vertex"],te=e.object({api:e.enum(q).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)})}),g=e.object({id:e.string().optional(),modelId:e.string().min(1,"Model ID is required"),name:e.string().min(0).default(""),config:te}),y=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(q),headers:e.record(e.string(),e.string()).optional(),authHeader:e.boolean().optional()}),fo=e.object({name:e.string().min(1,"Provider name is required"),config:y,models:e.array(g).min(1,"At least one model is required")}),go=e.object({config:y,models:e.array(g).min(1,"At least one model is required")}),yo=e.object({id:e.string(),name:e.string(),isBuiltin:e.boolean(),config:y,models:e.array(g).optional(),modelsCount:e.number().optional(),createdAt:e.date(),updatedAt:e.date()});var ho=e.object({name:e.string().min(1),expireAt:e.string().datetime().optional(),password:e.string().optional(),isDisabled:e.boolean().optional(),allowDownload:e.boolean().optional(),defaultSortOrder:e.string().optional(),viewMode:e.string().optional()}),bo=e.object({name:e.string().min(1).optional(),expireAt:e.string().datetime().optional().nullable(),password:e.string().optional().nullable(),isDisabled:e.boolean().optional(),allowDownload:e.boolean().optional(),defaultSortOrder:e.string().optional().nullable(),viewMode:e.string().optional().nullable(),fieldVisibility:e.record(e.string(),e.boolean()).optional().nullable()}),_o=a.extend({projectId:e.string().optional()}),Ro=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()}),qo=e.object({config:e.object({environmentVariables:e.array(e.object({name:e.string(),default:e.string().optional()}))})}),To=e.object({permission:e.enum(["owner","editor","reviewer"])});var T=e.lazy(()=>e.object({name:e.string(),id:e.string(),size:e.number(),children:e.array(T),type:e.string(),mediaType:e.string().optional()})),Po=e.object({parentId:e.string(),files:e.array(T)}),oe=e.object({id:e.string(),fileId:e.string(),url:e.string()}),Mo=e.object({taskId:e.string(),presignedUrls:e.array(oe),createdAssets:e.array(e.object({tempId:e.string(),assetId:e.string()})).optional()}),wo=e.object({fileId:e.string(),errorMessage:e.string().optional()}),Co=e.object({id:e.string(),name:e.string(),total:e.number(),uploaded:e.number(),createdAt:e.string()}),Fo=e.object({bucket:e.string(),key:e.string(),Signature:e.string()}),No=e.object({file:e.instanceof(File)});var re=e.object({key:e.string(),value:e.unknown()}),Wo=e.object({value:e.unknown()}),Oo=e.array(re);var Ko=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((o,r)=>{let p=o.textPrompt&&o.textPrompt.trim().length>0,c=o.attachedFiles&&o.attachedFiles.length>0,M=o.assetIds&&o.assetIds.length>0;if(!p&&!c&&!M)r.addIssue({code:e.ZodIssueCode.custom,message:"At least one of textPrompt, attachedFiles, or assetIds must be provided.",path:["textPrompt"]})}),Jo=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()}),Yo=e.intersection(e.object({id:e.string()}),e.unknown());var i;((t)=>{t.team_create="team_create";t.team_update="team_update";t.team_delete="team_delete";t.team_member_add="team_member_add";t.team_member_update="team_member_update";t.team_member_remove="team_member_remove";t.project_create="project_create";t.project_update="project_update";t.project_delete="project_delete";t.project_empty_trash="project_empty_trash";t.project_member_add="project_member_add";t.project_member_update="project_member_update";t.project_member_remove="project_member_remove";t.file_create="file_create";t.file_update="file_update";t.file_delete="file_delete";t.folder_create="folder_create";t.folder_update="folder_update";t.folder_delete="folder_delete";t.asset_reparent="asset_reparent";t.asset_copy="asset_copy";t.share_create="share_create";t.share_update="share_update";t.share_delete="share_delete";t.agent_create="agent_create";t.agent_update="agent_update";t.agent_delete="agent_delete";t.skill_create="skill_create";t.skill_update="skill_update";t.skill_delete="skill_delete";t.provider_create="provider_create";t.provider_update="provider_update";t.provider_delete="provider_delete";t.invite_create="invite_create";t.invite_revoke="invite_revoke";t.metadata_field_create="metadata_field_create";t.metadata_field_update="metadata_field_update";t.metadata_field_delete="metadata_field_delete";t.comment_create="comment_create";t.comment_update="comment_update";t.comment_delete="comment_delete";t.comment_complete="comment_complete"})(i||={});var ae=e.object({id:e.string(),action:e.nativeEnum(i),teamId:e.string(),userId:e.string().nullable().optional(),projectId:e.string().nullable().optional(),itemId:e.string().nullable().optional(),createdAt:e.string()}),$o=e.object({first:e.coerce.number().optional(),after:e.string().optional(),actions:e.union([e.nativeEnum(i),e.array(e.nativeEnum(i))]).transform((o)=>Array.isArray(o)?o:[o]).optional(),userIds:e.union([e.string(),e.array(e.string())]).transform((o)=>Array.isArray(o)?o:[o]).optional(),itemId:e.string().optional()}),Ao=e.object({nodes:e.array(ae),pageInfo:e.object({hasNextPage:e.boolean(),endCursor:e.string().nullable()}),total:e.number()});var ne=e.object({id:e.string(),type:e.literal("text"),x:e.number().min(0).max(1),y:e.number().min(0).max(1),opacity:e.number().min(0).max(1),rotation:e.number().min(-180).max(180),text:e.string(),size:e.number().positive().max(1),color:e.string()}),se=e.object({id:e.string(),type:e.literal("image"),x:e.number().min(0).max(1),y:e.number().min(0).max(1),opacity:e.number().min(0).max(1),rotation:e.number().min(-180).max(180),imageAssetKey:e.string().min(1),imageAssetUrl:e.string().optional(),size:e.number().positive().max(1)}),ie=e.discriminatedUnion("type",[ne,se]),u=e.object({blocks:e.array(ie)}),tr=e.object({name:e.string().min(1),teamId:e.string().optional(),config:u}),or=e.object({name:e.string().min(1).optional(),config:u.optional()}),rr=e.object({enabled:e.boolean(),config:u.optional()}).superRefine((o,r)=>{if(o.enabled&&(!o.config||o.config.blocks.length===0))r.addIssue({code:"custom",path:["config"],message:"Watermark configuration is required when enabling watermark"})});function Mr({className:o,orientation:r="horizontal",decorative:p=!0,...c}){return v(U.Root,{"data-slot":"separator",decorative:p,orientation:r,className:P("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",o),...c})}
2
- export{_ as Wa,Et as Xa,q as Ya,g as Za,y as _a,C as $a,i as ab,Mr as bb};
@@ -1 +0,0 @@
1
- import{d as _}from"./chunk-1fqpgz02.js";import"./chunk-y6aa5ee0.js";import"./chunk-8na8a41a.js";import"./chunk-v0cdg3n6.js";import"./chunk-sx1neqgr.js";import"./chunk-29203j0e.js";import"./chunk-6kv3jyfc.js";import"./chunk-d1zpcags.js";import"./chunk-s0g0bc6t.js";import"./chunk-s0k2r6ym.js";import"./chunk-fw5k0xrc.js";import"./chunk-8vc1m0kw.js";import"./chunk-nh4tzzn8.js";import"./chunk-21hvrvzj.js";import"./chunk-avvzqqk2.js";import"./chunk-4rz2105a.js";import"./chunk-f7fevgv2.js";import"./chunk-rek85wwv.js";import{Ae as Z,ze as Y}from"./chunk-c5esphve.js";import"./chunk-8hq6sn31.js";import"./chunk-zj1rz1s9.js";import"./chunk-fnkrzqrn.js";import"./chunk-6vn44e4d.js";import"./chunk-f70xdh07.js";import"./chunk-qm9w9fcv.js";import"./chunk-n67rfv86.js";import"./chunk-t58kqafx.js";import"./chunk-7jkvjm4x.js";import"./chunk-r9s1zs4g.js";import"./chunk-3w9vybrh.js";import{wg as X}from"./chunk-8mzg29m4.js";import{Ag as O,Cg as w,Gj as W,Hg as A,Ig as N,Jg as U,Ug as V,eh as B}from"./chunk-cbjfw47x.js";import{Kk as M}from"./chunk-gd1x3rgn.js";var h=M(O(),1);function R(){let{projectId:k,collectionId:D}=P.useParams(),{teamId:G,ensureTeamIdForProject:H}=X();h.useEffect(()=>{H(k)},[k,H]);let{data:J}=N(Y(k)),{data:v,refetch:z}=A({...Z(D)}),{mutate:E}=U({mutationFn:async(q)=>{let K=await B.api.collections[":collectionId"].$patch({param:{collectionId:D},json:q});if(!K.ok)throw Error("Failed to update collection");return await K.json()},onSuccess:()=>{z()}}),b=J?.rootFolder,{data:L}=A({queryKey:["folders",b],queryFn:async()=>{let q=await B.api.folders[":folderId"].$get({param:{folderId:b}});if(!q.ok)throw Error("Failed to fetch folder");return await q.json()},enabled:!!b});if(!G||!b||!L||!v)return w("div",{children:W.loading_collection()});let $=v.filter.sourceFolderId||b;return w(_,{teamId:G,projectId:k,projectName:J.name??"",assetId:$,rootFolderId:b,collection:v,onUpdateCollection:E})}var P=V("/projects/$projectId/collections/$collectionId")({component:R});export{P as Route};
@@ -1 +0,0 @@
1
- import{a as v}from"./chunk-qxwfhv63.js";import"./chunk-2jv9re91.js";import"./chunk-v0cdg3n6.js";import"./chunk-sx1neqgr.js";import"./chunk-29203j0e.js";import"./chunk-6kv3jyfc.js";import"./chunk-d1zpcags.js";import"./chunk-s0g0bc6t.js";import"./chunk-s0k2r6ym.js";import"./chunk-fw5k0xrc.js";import"./chunk-8vc1m0kw.js";import"./chunk-nh4tzzn8.js";import"./chunk-21hvrvzj.js";import"./chunk-avvzqqk2.js";import"./chunk-4rz2105a.js";import"./chunk-f7fevgv2.js";import"./chunk-rek85wwv.js";import"./chunk-fgda7ncw.js";import"./chunk-8hq6sn31.js";import"./chunk-zj1rz1s9.js";import"./chunk-fnkrzqrn.js";import"./chunk-6vn44e4d.js";import"./chunk-f70xdh07.js";import"./chunk-qm9w9fcv.js";import"./chunk-n67rfv86.js";import"./chunk-54hmgj96.js";import"./chunk-7jkvjm4x.js";import"./chunk-r9s1zs4g.js";import"./chunk-3w9vybrh.js";import"./chunk-8mzg29m4.js";import{Cg as k,Ug as q}from"./chunk-cbjfw47x.js";import"./chunk-gd1x3rgn.js";function B(){let{shareId:w,folderId:A}=C.useParams();return k(v,{shareId:w,initialFolderId:A})}var C=q("/share/$shareId/folders/$folderId")({component:B});export{C as Route};
@@ -1,2 +0,0 @@
1
- import{h as t,j as e,k as y}from"./chunk-v0cdg3n6.js";import{kg as _G,mg as $G,ng as QG,og as XG}from"./chunk-8mzg29m4.js";import{$h as WG,Ag as gG,Bg as r,Cg as H,Dg as O,Gj as v,Hg as NG,Kh as HG,Lh as JG,dj as YG,eh as l,ph as S,ui as a,yj as p,zi as s}from"./chunk-cbjfw47x.js";import{Kk as SG}from"./chunk-gd1x3rgn.js";function cG({file:Y,mediaControllerRef:X,onPlay:K,onPause:N,onTimeUpdate:V,annotations:_,startTime:U,shareId:Z,allowDownload:L,children:B}){let M=y(Y).viewer;return H(M,{ref:X,file:Y,onPlay:K,onPause:N,onTimeUpdate:V,annotations:_,startTime:U,shareId:Z,allowDownload:L,children:B},Y.id)}var J=SG(gG(),1);function GG({activeState:Y,activeAsset:X,previewUrl:K,isFullScreen:N,onTogglePlay:V,onToggleLoop:_,onSeek:U,onVolumeChange:Z,onToggleMute:L,onChangePlaybackRate:B,onChangeResolution:F,onZoomIn:M,onZoomOut:R,onFit:z,onDownload:b,onToggleFullScreen:w,allowDownload:T=!0}){if(Y?.kind==="video"&&Y.video&&X){let $=Y.video,f=$.totalFrames/$.frameRate,x=$.currentFrame/$.frameRate,g={isPlaying:$.isPlaying,progress:f>0?x/f*100:0,currentTime:x,duration:f,volume:$.volume,isMuted:$.isMuted,isLooping:$.isLooping,playbackRate:$.playbackRate,isFullScreen:N,showFrames:!1,currentResolution:$.currentResolution},u=K&&!X.media?.videoPreview?{...X,media:{...X.media,videoPreview:{url:K}}}:X;return H(t,{state:g,zoom:Y.zoom,isControlsVisible:!0,floatOverlayInFullScreen:!1,buffered:$.buffered,data:u,resolutions:$.resolutions,togglePlay:V,toggleLoop:_,toggleMute:L,handleVolumeChange:Z,changePlaybackRate:B,changeResolution:(k)=>F(k.resolution),handleDownload:(k)=>b(k),toggleFullScreen:w,onZoomChange:(k)=>k>=Y.zoom?M():R(),onZoomReset:z,frameRate:$.frameRate,totalFrames:$.totalFrames,currentFrame:$.currentFrame,seekToFrame:U,allowDownload:T})}if(Y?.kind==="image")return H(e,{zoom:Y.zoom,onZoomIn:M,onZoomOut:R,onFit:z,onDownload:()=>b(),canDownload:!!X?.media?.original?.key,fullscreen:{isFullScreen:N,onToggle:w},allowDownload:T});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:w,className:"text-foreground transition-colors hover:text-primary",title:"Fullscreen",children:N?H(s,{className:"h-5 w-5"}):H(a,{className:"h-5 w-5"})})})}function c({side:Y,fileName:X,version:K,activeVersionId:N,versions:V,isActive:_,onActivate:U,onSwitchVersion:Z,onExit:L}){let B=p("flex-shrink-0 rounded p-1 transition-colors hover:bg-muted",_?"text-foreground":"text-muted-foreground hover:text-foreground"),F=H("button",{onClick:L,title:v.exit_compare(),className:B,children:H(YG,{className:"h-4 w-4"})}),M=O("button",{onClick:U,className:p("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:p("flex-shrink-0 rounded border px-1 py-0 text-xs",_?"border-foreground/40":"border-border"),children:["v",K]})]}),R=O(_G,{children:[H($G,{onClick:U,title:v.switch_version(),className:B,children:H(JG,{className:"h-4 w-4"})}),H(QG,{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 b=z.id===N;return O(XG,{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(WG,{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"})]}),b&&H(HG,{className:"ml-auto h-4 w-4 flex-shrink-0 text-primary"})]},z.id)})})})]});return H("div",{onMouseDown:U,className:p("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(r,{children:[F,M,R]}):O(r,{children:[M,R,H("div",{className:"ml-auto"}),F]})})}function KG(Y,X,K){return NG({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 l.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 l.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 zH({isPublic:Y=!1,shareId:X,versions:K,leftId:N,rightId:V,activeSide:_,annotations:U,seekRequest:Z,onActiveSideChange:L,onSwitchVersion:B,onExit:F,onActiveAssetChange:M,onPlay:R,onTimeUpdate:z,allowDownload:b=!0}){let w=J.useRef(null),T=J.useRef(null),$=J.useRef(null),[f,x]=J.useState(null),[g,u]=J.useState(null),[k,zG]=J.useState(1),[OG,n]=J.useState(!1),[qG,VG]=J.useState(!1),{data:E,isLoading:ZG}=KG(N,Y,X),{data:P,isLoading:MG}=KG(V,Y,X),UG=y(E),LG=y(P),I=!!E&&!!P&&UG.id===LG.id,m=_==="left"?E:P,h=_==="left"?f:g,D=J.useCallback(()=>_==="left"?T.current:$.current,[_]),d=J.useCallback(()=>_==="left"?$.current:T.current,[_]);J.useEffect(()=>{M(m??null)},[m,M]),J.useEffect(()=>{if(!Z)return;let G=D();if(G?.seekToSecond(Z.second),G?.pause(),I){let W=d();W?.seekToSecond(Z.second),W?.pause()}},[Z?.nonce]),J.useEffect(()=>{let G=()=>VG(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",G),()=>document.removeEventListener("fullscreenchange",G)},[]);let BG=J.useCallback((G)=>x(G),[]),DG=J.useCallback((G)=>u(G),[]),q=J.useCallback((G)=>{let W=D();if(W)G(W);if(I){let Q=d();if(Q)G(Q)}},[D,d,I]),j=J.useCallback(()=>{let G=!h?.video?.isPlaying;q((W)=>G?W.play():W.pause())},[h?.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 A=W.key===" ",C=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(A&&C)return;if(W.key===" "||W.key.toLowerCase()==="k")W.preventDefault(),j()};return window.addEventListener("keydown",G),()=>{window.removeEventListener("keydown",G)}},[j]);let FG=J.useCallback((G)=>q((W)=>W.seekToFrame(G)),[q]),EG=J.useCallback(()=>D()?.toggleLoop(),[D]),PG=J.useCallback((G)=>{zG(G),n(G===0)},[]),RG=J.useCallback(()=>n((G)=>!G),[]),wG=J.useCallback((G)=>q((W)=>W.setPlaybackRate(G)),[q]),TG=J.useCallback((G)=>D()?.changeResolution(G),[D]),kG=J.useCallback(()=>q((G)=>G.zoomBy(1.2)),[q]),IG=J.useCallback(()=>q((G)=>G.zoomBy(0.8)),[q]),bG=J.useCallback(()=>q((G)=>G.fit()),[q]),yG=J.useCallback((G)=>{D()?.download(G)},[D]),fG=J.useCallback(()=>{if(!w.current)return;if(!document.fullscreenElement)w.current.requestFullscreen();else document.exitFullscreen()},[]),mG=J.useCallback((G,W)=>{if(I)$.current?.panBy(G,W)},[I]),jG=J.useCallback((G,W)=>{if(I)T.current?.panBy(G,W)},[I]),CG=J.useCallback(()=>j(),[j]),o=J.useCallback((G)=>K.find((W)=>W.id===G)?.version,[K]),pG=J.useMemo(()=>m?.media?.videoPreview?.url,[m?.media?.videoPreview?.url]),i=(G,W)=>{let A=y(W)?.comparePane;if(!A)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 C=_===G;return H(A,{ref:G==="left"?T:$,file:W,shareId:X,isActive:C,annotations:C?U:[],onStateChange:G==="left"?BG:DG,onUserPan:G==="left"?mG:jG,onActivate:()=>L(G),muted:C?OG:!0,volume:k,onPlay:R,onTimeUpdate:z,onRequestTogglePlay:CG},W.id)},xG=!!E&&!!P,AG=ZG||MG;return O("div",{ref:w,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:[E&&H(c,{side:"left",fileName:E.name,version:o(N),activeVersionId:N,versions:K,isActive:_==="left",onActivate:()=>L("left"),onSwitchVersion:(G)=>B("left",G),onExit:F}),H("div",{className:"relative flex min-h-0 flex-1",children:E?i("left",E):H("div",{className:"flex flex-1 items-center justify-center",children:H(S,{className:"h-6 w-6 animate-spin text-foreground"})})})]}),O("div",{className:"flex min-w-0 flex-1 flex-col",children:[P&&H(c,{side:"right",fileName:P.name,version:o(V),activeVersionId:V,versions:K,isActive:_==="right",onActivate:()=>L("right"),onSwitchVersion:(G)=>B("right",G),onExit:F}),H("div",{className:"relative flex min-h-0 flex-1",children:P?i("right",P):H("div",{className:"flex flex-1 items-center justify-center",children:H(S,{className:"h-6 w-6 animate-spin text-foreground"})})})]})]}),AG&&!xG&&H("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/30",children:H(S,{className:"h-8 w-8 animate-spin text-foreground"})}),H(GG,{activeState:h,activeAsset:m??null,previewUrl:pG,isFullScreen:qG,onTogglePlay:j,onToggleLoop:EG,onSeek:FG,onVolumeChange:PG,onToggleMute:RG,onChangePlaybackRate:wG,onChangeResolution:TG,onZoomIn:kG,onZoomOut:IG,onFit:bG,onDownload:yG,onToggleFullScreen:fG,allowDownload:b})]})}
2
- export{cG as b,zH as c};
@@ -1 +0,0 @@
1
- import{d as U}from"./chunk-1fqpgz02.js";import"./chunk-y6aa5ee0.js";import"./chunk-8na8a41a.js";import"./chunk-v0cdg3n6.js";import"./chunk-sx1neqgr.js";import"./chunk-29203j0e.js";import"./chunk-6kv3jyfc.js";import"./chunk-d1zpcags.js";import"./chunk-s0g0bc6t.js";import"./chunk-s0k2r6ym.js";import"./chunk-fw5k0xrc.js";import"./chunk-8vc1m0kw.js";import"./chunk-nh4tzzn8.js";import"./chunk-21hvrvzj.js";import"./chunk-avvzqqk2.js";import"./chunk-4rz2105a.js";import"./chunk-f7fevgv2.js";import"./chunk-rek85wwv.js";import{Ke as N}from"./chunk-3mprq5kb.js";import{Pe as K}from"./chunk-g0jy85re.js";import"./chunk-8hq6sn31.js";import"./chunk-zj1rz1s9.js";import"./chunk-fnkrzqrn.js";import"./chunk-6vn44e4d.js";import"./chunk-f70xdh07.js";import"./chunk-qm9w9fcv.js";import"./chunk-n67rfv86.js";import"./chunk-t58kqafx.js";import"./chunk-7jkvjm4x.js";import"./chunk-r9s1zs4g.js";import"./chunk-3w9vybrh.js";import{wg as J}from"./chunk-8mzg29m4.js";import{Ag as Z,Cg as q,Hg as B,Ig as D,Ug as G,eh as H}from"./chunk-cbjfw47x.js";import{Kk as Y}from"./chunk-gd1x3rgn.js";var V=Y(Z(),1);function _(){let{projectId:h,folderId:W}=z.useParams(),{teamId:v,ensureTeamIdForProject:w}=J();V.useEffect(()=>{w(h)},[h,w]);let{data:A}=D(N(h)),b=A?.rootFolder,{data:X}=B({queryKey:["folders",b],queryFn:()=>(async()=>{return await(await H.api.folders[":folderId"].$get({param:{folderId:b}})).json()})(),enabled:!!b});if(!v||!b||!X)return q(K,{});return q(U,{teamId:v,projectId:h,projectName:A.name??"",assetId:W,rootFolderId:b})}var z=G("/projects/$projectId/folders/$folderId")({component:_});export{z as Route};
@@ -1,2 +0,0 @@
1
- import{S as n,T as o,U as r}from"./chunk-s0g0bc6t.js";import{$ as I5,Aa as J1,Ba as Z1,Ca as h,Da as X2,Ea as S1,Fa as X1,W as v,X as O2,Y as E5,Z as _0,_ as S2,aa as E2,ca as y2,ea as I2,fa as D5,ga as f5,ha as x5,ia as j5,ja as y5,ka as _5,la as v5,ma as D2,na as f2,oa as x2,pa as h5,qa as g5,ra as m5,sa as b5,ta as P1,ua as T1,va as O1,wa as c5,xa as u5,ya as Z2,za as $1}from"./chunk-fw5k0xrc.js";import{Xa as _}from"./chunk-21hvrvzj.js";import{fb as g0}from"./chunk-f7fevgv2.js";import{sf as K2}from"./chunk-fnkrzqrn.js";import{Df as S0,Ef as y,Jf as q5,Of as B0,Tf as P2}from"./chunk-n67rfv86.js";import{jg as U0}from"./chunk-3w9vybrh.js";import{kg as L1,mg as R1,ng as k1,og as C1}from"./chunk-8mzg29m4.js";import{$i as A1,Ag as u,Aj as $0,Bg as Q2,Bj as V0,Cg as K,Cj as A0,Dg as A,Dj as L0,Eg as H1,Gi as c2,Gj as I,Hj as h0,Ih as N1,Jg as b2,Kh as H2,Lh as w0,Li as G1,Mh as z5,Mi as M1,Nh as G5,Ri as s0,Si as U1,Th as M5,Ui as w1,Wi as F1,Zg as n0,_g as Q5,_i as V1,dj as F0,eh as O0,fi as B1,gi as W1,pi as z1,sh as K1,tj as m0,uh as q1,yj as R0}from"./chunk-cbjfw47x.js";import{Kk as c}from"./chunk-gd1x3rgn.js";function v1($){let J=$.lastIndexOf(".");if(J>0)return[0,J];return[0,$.length]}function i4($){$.focus();let[J,Z]=v1($.value);if(typeof $.setSelectionRange==="function")$.setSelectionRange(J,Z);else $.select()}var a2=Symbol.for("immer-nothing"),p2=Symbol.for("immer-draftable"),b=Symbol.for("immer-state");function l($,...J){throw Error(`[Immer] minified error nr: ${$}. Full error at: https://bit.ly/3cXEKWf`)}var k0=Object.getPrototypeOf;function N0($){return!!$&&!!$[b]}function Y0($){if(!$)return!1;return t2($)||Array.isArray($)||!!$[p2]||!!$.constructor?.[p2]||T0($)||p0($)}var h1=Object.prototype.constructor.toString(),i2=new WeakMap;function t2($){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=i2.get(Z);if(X===void 0)X=Function.toString.call(Z),i2.set(Z,X);return X===h1}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:T0($)?2:p0($)?3:0}function W2($,J){return l0($)===2?$.has(J):Object.prototype.hasOwnProperty.call($,J)}function e2($,J,Z){let X=l0($);if(X===2)$.set(J,Z);else if(X===3)$.add(Z);else $[J]=Z}function g1($,J){if($===J)return $!==0||1/$===1/J;else return $!==$&&J!==J}function T0($){return $ instanceof Map}function p0($){return $ instanceof Set}function X0($){return $.copy_||$.base_}function z2($,J){if(T0($))return new Map($);if(p0($))return new Set($);if(Array.isArray($))return Array.prototype.slice.call($);let Z=t2($);if(J===!0||J==="class_only"&&!Z){let X=Object.getOwnPropertyDescriptors($);delete X[b];let Y=Reflect.ownKeys(X);for(let q=0;q<Y.length;q++){let Q=Y[q],H=X[Q];if(H.writable===!1)H.writable=!0,H.configurable=!0;if(H.get||H.set)X[Q]={configurable:!0,writable:!0,enumerable:H.enumerable,value:$[Q]}}return Object.create(k0($),X)}else{let X=k0($);if(X!==null&&Z)return{...$};let Y=Object.create(X);return Object.assign(Y,$)}}function F2($,J=!1){if(i0($)||N0($)||!Y0($))return $;if(l0($)>1)Object.defineProperties($,{set:b0,add:b0,clear:b0,delete:b0});if(Object.freeze($),J)Object.values($).forEach((Z)=>F2(Z,!0));return $}function m1(){l(2)}var b0={value:m1};function i0($){if($===null||typeof $!=="object")return!0;return Object.isFrozen($)}var b1={};function Q0($){let J=b1[$];if(!J)l(0,$);return J}var C0;function $5(){return C0}function c1($,J){return{drafts_:[],parent_:$,immer_:J,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function n2($,J){if(J)Q0("Patches"),$.patches_=[],$.inversePatches_=[],$.patchListener_=J}function G2($){M2($),$.drafts_.forEach(u1),$.drafts_=null}function M2($){if($===C0)C0=$.parent_}function o2($){return C0=c1(C0,$)}function u1($){let J=$[b];if(J.type_===0||J.type_===1)J.revoke_();else J.revoked_=!0}function r2($,J){J.unfinalizedDrafts_=J.drafts_.length;let Z=J.drafts_[0];if($!==void 0&&$!==Z){if(Z[b].modified_)G2(J),l(4);if(Y0($)){if($=u0(J,$),!J.parent_)d0(J,$)}if(J.patches_)Q0("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 $!==a2?$:void 0}function u0($,J,Z){if(i0(J))return J;let X=$.immer_.shouldUseStrictIteration(),Y=J[b];if(!Y)return c0(J,(q,Q)=>s2($,Y,J,q,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 q=Y.copy_,Q=q,H=!1;if(Y.type_===3)Q=new Set(q),q.clear(),H=!0;if(c0(Q,(G,z)=>s2($,Y,q,G,z,Z,H),X),d0($,q,!1),Z&&$.patches_)Q0("Patches").generatePatches_(Y,Z,$.patches_,$.inversePatches_)}return Y.copy_}function s2($,J,Z,X,Y,q,Q){if(Y==null)return;if(typeof Y!=="object"&&!Q)return;let H=i0(Y);if(H&&!Q)return;if(N0(Y)){let G=q&&J&&J.type_!==3&&!W2(J.assigned_,X)?q.concat(X):void 0,z=u0($,Y,G);if(e2(Z,X,z),N0(z))$.canAutoFreeze_=!1;else return}else if(Q)Z.add(Y);if(Y0(Y)&&!H){if(!$.immer_.autoFreeze_&&$.unfinalizedDrafts_<1)return;if(J&&J.base_&&J.base_[X]===Y&&H)return;if(u0($,Y),(!J||!J.scope_.parent_)&&typeof X!=="symbol"&&(T0(Z)?Z.has(X):Object.prototype.propertyIsEnumerable.call(Z,X)))d0($,Y)}}function d0($,J,Z=!1){if(!$.parent_&&$.immer_.autoFreeze_&&$.canAutoFreeze_)F2(J,Z)}function d1($,J){let Z=Array.isArray($),X={type_:Z?1:0,scope_:J?J.scope_:$5(),modified_:!1,finalized_:!1,assigned_:{},parent_:J,base_:$,draft_:null,copy_:null,revoke_:null,isManual_:!1},Y=X,q=V2;if(Z)Y=[X],q=P0;let{revoke:Q,proxy:H}=Proxy.revocable(Y,q);return X.draft_=H,X.revoke_=Q,H}var V2={get($,J){if(J===b)return $;let Z=X0($);if(!W2(Z,J))return l1($,Z,J);let X=Z[J];if($.finalized_||!Y0(X))return X;if(X===N2($.base_,J))return B2($),$.copy_[J]=w2(X,$);return X},has($,J){return J in X0($)},ownKeys($){return Reflect.ownKeys(X0($))},set($,J,Z){let X=J5(X0($),J);if(X?.set)return X.set.call($.draft_,Z),!0;if(!$.modified_){let Y=N2(X0($),J),q=Y?.[b];if(q&&q.base_===Z)return $.copy_[J]=Z,$.assigned_[J]=!1,!0;if(g1(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(N2($.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=X0($),X=Reflect.getOwnPropertyDescriptor(Z,J);if(!X)return X;return{writable:!0,configurable:$.type_!==1||J!=="length",enumerable:X.enumerable,value:Z[J]}},defineProperty(){l(11)},getPrototypeOf($){return k0($.base_)},setPrototypeOf(){l(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 N2($,J){let Z=$[b];return(Z?X0(Z):$)[J]}function l1($,J,Z){let X=J5(J,Z);return X?"value"in X?X.value:X.get?.call($.draft_):void 0}function J5($,J){if(!(J in $))return;let Z=k0($);while(Z){let X=Object.getOwnPropertyDescriptor(Z,J);if(X)return X;Z=k0(Z)}return}function U2($){if(!$.modified_){if($.modified_=!0,$.parent_)U2($.parent_)}}function B2($){if(!$.copy_)$.copy_=z2($.base_,$.scope_.immer_.useStrictShallowCopy_)}var p1=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 q=Z;Z=J;let Q=this;return function(G=q,...z){return Q.produce(G,(M)=>Z.call(this,M,...z))}}if(typeof Z!=="function")l(6);if(X!==void 0&&typeof X!=="function")l(7);let Y;if(Y0(J)){let q=o2(this),Q=w2(J,void 0),H=!0;try{Y=Z(Q),H=!1}finally{if(H)G2(q);else M2(q)}return n2(q,X),r2(Y,q)}else if(!J||typeof J!=="object"){if(Y=Z(J),Y===void 0)Y=J;if(Y===a2)Y=void 0;if(this.autoFreeze_)F2(Y,!0);if(X){let q=[],Q=[];Q0("Patches").generateReplacementPatches_(J,Y,q,Q),X(q,Q)}return Y}else l(1,J)},this.produceWithPatches=(J,Z)=>{if(typeof J==="function")return(Q,...H)=>this.produceWithPatches(Q,(G)=>J(G,...H));let X,Y;return[this.produce(J,Z,(Q,H)=>{X=Q,Y=H}),X,Y]},typeof $?.autoFreeze==="boolean")this.setAutoFreeze($.autoFreeze);if(typeof $?.useStrictShallowCopy==="boolean")this.setUseStrictShallowCopy($.useStrictShallowCopy);if(typeof $?.useStrictIteration==="boolean")this.setUseStrictIteration($.useStrictIteration)}createDraft($){if(!Y0($))l(8);if(N0($))$=i1($);let J=o2(this),Z=w2($,void 0);return Z[b].isManual_=!0,M2(J),Z}finishDraft($,J){let Z=$&&$[b];if(!Z||!Z.isManual_)l(9);let{scope_:X}=Z;return n2(X,J),r2(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=Q0("Patches").applyPatches_;if(N0($))return X($,J);return this.produce($,(Y)=>X(Y,J))}};function w2($,J){let Z=T0($)?Q0("MapSet").proxyMap_($,J):p0($)?Q0("MapSet").proxySet_($,J):d1($,J);return(J?J.scope_:$5()).drafts_.push(Z),Z}function i1($){if(!N0($))l(10,$);return Z5($)}function Z5($){if(!Y0($)||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,q)=>{e2(Z,Y,Z5(q))},X),J)J.finalized_=!1;return Z}var n1=new p1,X5=n1.produce;var o1=($)=>(J,Z,X)=>{return X.setState=(Y,q,...Q)=>{let H=typeof Y==="function"?X5(Y):Y;return J(H,q,...Q)},$(X.setState,Z,X)},Y5=o1;var o0=n0()(Q5(Y5(($,J)=>({members:[],loading:!1,fetchMembers:async(Z,X,Y)=>{if(!Y&&J().loadedTeamId===Z&&J().loadedWithAgents===X)return;$({loading:!0});try{let q=await O0.api.teams[":teamId"].members.$get({param:{teamId:Z},query:{includeAgents:X?"true":"false"}});if(!q.ok)throw Error("failed to fetch members");let Q=await q.json();$({members:Q||[],loadedTeamId:Z,loadedWithAgents:X,loading:!1})}catch{$({loading:!1})}}}))));var H5=n0(($)=>({fields:[],loadedProjectId:null,setFields:(J,Z)=>$({fields:J,loadedProjectId:Z}),updateFields:(J)=>$({fields:J})}));function A2($,J,Z){let X=y($,Z?.in);if(isNaN(J))return S0(Z?.in||$,NaN);if(!J)return X;let Y=X.getDate(),q=S0(Z?.in||$,X.getTime());q.setMonth(X.getMonth()+J+1,0);let Q=q.getDate();if(Y>=Q)return q;else return X.setFullYear(q.getFullYear(),q.getMonth(),Y),X}function K5($,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]=q5($,J.start,J.end);return{start:Z,end:X}}function B5($,J){let{start:Z,end:X}=N5(J?.in,$),Y=+Z>+X,q=Y?+Z:+X,Q=Y?X:Z;Q.setHours(0,0,0,0);let H=J?.step??1;if(!H)return[];if(H<0)H=-H,Y=!Y;let G=[];while(+Q<=q)G.push(S0(Z,Q)),Q.setDate(Q.getDate()+H),Q.setHours(0,0,0,0);return Y?G.reverse():G}function r0($,J){return y($,J?.in).getDate()}function W5($,J){return y($,J?.in).getDay()}function L2($,J){return y($,J?.in).getHours()}function R2($,J){return y($,J?.in).getMinutes()}function k2($,J){return y($,J?.in).getMonth()}function C2($,J){return y($,J?.in).getFullYear()}var a=c(u(),1);var r1=({value:$,config:J,onSave:Z,readOnly:X})=>{let Y=J?.date,[q,Q]=a.useState(!1),H=a.useRef(null),G=$?new Date($):new Date,z=B0(G)?G:new Date,[M,U]=a.useState(z);a.useEffect(()=>{if(q&&$){let N=new Date($);if(B0(N))U(N)}},[q,$]),a.useEffect(()=>{let N=(k)=>{if(H.current&&!H.current.contains(k.target)){if(q)Q(!1)}};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[q]);let W=()=>{if(!X)Q(!0)},F=(N)=>{if(!N)return"";let k=new Date(N);if(!B0(k))return"Invalid Date";let O="PPP";if(Y?.displayFormat==="usa")O="MM/dd/yyyy";else if(Y?.displayFormat==="euro")O="dd/MM/yyyy";else if(Y?.displayFormat==="iso")O="yyyy-MM-dd";if(Y?.includeTime)if(Y?.timeFormat==="twenty_four_hour")O+=" HH:mm";else O+=" p";let D=P2(k,O);if(Y?.displayTimezone)D+=` (${Intl.DateTimeFormat().resolvedOptions().timeZone})`;return D},B=new Date(M.getFullYear(),M.getMonth(),1),T=K5(M),P=B5({start:B,end:T}),R=W5(B),S=(N)=>{let k=new Date(N);if(Y?.includeTime)k.setHours(L2(z)),k.setMinutes(R2(z));let O=k.toISOString();if(Z(O),!Y?.includeTime)Q(!1)},w=(N,k)=>{let O=$?new Date($):new Date;if(!B0(O))O.setTime(new Date().getTime());if(N==="hour")O.setHours(k);if(N==="minute")O.setMinutes(k);let D=O.toISOString();Z(D)},L=Array.from({length:24},(N,k)=>k),V=Array.from({length:12},(N,k)=>k*5);if(q)return A("div",{className:"relative w-full",ref:H,children:[K("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:$?F($):K("span",{className:"text-muted-foreground",children:"Select date..."})}),A("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:[A("div",{className:"p-4 w-64",children:[A("div",{className:"flex justify-between items-center mb-4",children:[K("button",{onClick:()=>U(A2(M,-1)),className:"p-1 hover:bg-accent rounded",children:K(z5,{className:"w-4 h-4"})}),K("span",{className:"font-semibold text-sm",children:P2(M,"MMMM yyyy")}),K("button",{onClick:()=>U(A2(M,1)),className:"p-1 hover:bg-accent rounded",children:K(G5,{className:"w-4 h-4"})})]}),K("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((N)=>K("div",{children:N},N))}),A("div",{className:"grid grid-cols-7 gap-1 text-center text-sm",children:[Array.from({length:R}).map((N,k)=>K("div",{},`empty-${k}`)),P.map((N)=>{let k=$?new Date($):null,O=k&&B0(k)&&r0(k)===r0(N)&&k2(k)===k2(N)&&C2(k)===C2(N);return K("button",{onClick:()=>S(N),className:`w-8 h-8 rounded-full flex items-center justify-center hover:bg-accent transition-colors ${O?"bg-primary text-primary-foreground hover:bg-primary/90":"text-foreground"}`,children:r0(N)},N.toString())})]})]}),Y?.includeTime&&A("div",{className:"border-l border-border bg-muted w-32 flex flex-col",children:[A("div",{className:"p-2 border-b border-border text-xs font-semibold text-muted-foreground flex items-center justify-center gap-1",children:[K(M5,{className:"w-3 h-3"})," Time"]}),A("div",{className:"flex flex-1 h-64",children:[K("div",{className:"flex-1 overflow-y-auto scrollbar-hide border-r border-border",children:L.map((N)=>K("div",{onClick:()=>w("hour",N),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${L2(z)===N?"bg-primary/10 font-medium text-primary":""}`,children:N.toString().padStart(2,"0")},N))}),K("div",{className:"flex-1 overflow-y-auto scrollbar-hide",children:V.map((N)=>K("div",{onClick:()=>w("minute",N),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${R2(z)===N?"bg-primary/10 font-medium text-primary":""}`,children:N.toString().padStart(2,"0")},N))})]})]})]})]});return K("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:$?F($):K("span",{className:"text-muted-foreground italic",children:"Empty"})})},U5=r1;var p=c(u(),1);var s1=({value:$,onSave:J,readOnly:Z})=>{let[X,Y]=p.useState(!1),[q,Q]=p.useState($||""),H=p.useRef(null),G=p.useRef(null),[z,M]=p.useState(!1);p.useEffect(()=>{Q($||"")},[$]),p.useEffect(()=>{if(X&&H.current)H.current.focus(),M(!1)},[X]),p.useEffect(()=>{let B=(T)=>{if(z&&G.current&&!G.current.contains(T.target))M(!1)};if(z)document.addEventListener("mousedown",B);return()=>{document.removeEventListener("mousedown",B)}},[z]);let U=()=>{Y(!1),J(q)},W=(B)=>{B.stopPropagation(),M(!0)},F=(B)=>{if(B.stopPropagation(),!Z)Y(!0)};if(X)return K("textarea",{ref:H,value:q,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 A("div",{ref:G,className:"relative w-full text-sm",children:[K("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:$?$:K("span",{className:"text-muted-foreground italic",children:"Empty"})}),z&&K("div",{onClick:F,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:$?$:K("span",{className:"text-muted-foreground italic",children:"Empty"})})]})},w5=s1;var t=c(u(),1);var a1=({value:$,config:J,onSave:Z,readOnly:X})=>{let Y=J?.number,[q,Q]=t.useState(!1),[H,G]=t.useState(""),z=t.useRef(null);t.useEffect(()=>{G($!==void 0&&$!==null?$.toString():"")},[$]),t.useEffect(()=>{if(q&&z.current)z.current.focus()},[q]);let M=()=>{if(!X)Q(!0)},U=()=>{if(Q(!1),H==="")Z(void 0);else{let B=parseFloat(H);Z(isNaN(B)?void 0:B)}},W=(B)=>{if(B.key==="Enter")B.stopPropagation(),z.current?.blur()},F=(B)=>{if(B===void 0||B===null||isNaN(B))return"";return B.toFixed(Y?.scale)};if(q)return K("input",{ref:z,type:"number",step:1/Math.pow(10,Y?.scale||0),value:H,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 K("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?F($):K("span",{className:"text-muted-foreground italic font-sans text-left block",children:"Empty"})})},F5=a1;var V5=c(u(),1);var t1=({value:$,config:J,onSave:Z,readOnly:X})=>{let Y=J?.rating,q=Math.max(2,Math.min(6,Y?.maxValue||5)),[Q,H]=V5.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:q},(M,U)=>U+1);return K("div",{className:"flex items-center gap-1 h-[28px]",onMouseLeave:()=>!X&&H(null),onDoubleClick:(M)=>M.stopPropagation(),children:z.map((M)=>{let U=Q!==null?M<=Q:M<=($||0);return K("button",{onClick:(W)=>G(W,M),onMouseEnter:()=>!X&&H(M),className:`focus:outline-none transition-transform ${!X?"cursor-pointer hover:scale-110":"cursor-default"}`,type:"button",disabled:X,children:K(s0,{className:`w-5 h-5 transition-colors ${U?"fill-yellow-400 text-yellow-400":"fill-muted text-muted-foreground/30"}`})},M)})})},A5=t1;var E1=c(u(),1);var H0;(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"})(H0||(H0={}));class W0 extends Error{constructor($,J){super(`${J} (${$})`);this.name="ULIDError",this.code=$}}function e1($){let J=Math.floor($()*32)%32;return"0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(J)}function $4($){let J=J4(),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 W0(H0.PRNGDetectFailure,"Failed to find a reliable PRNG")}function J4(){if(Y4())return self;if(typeof window<"u")return window;if(typeof global<"u")return global;if(typeof globalThis<"u")return globalThis;return null}function Z4($,J){let Z="";for(;$>0;$--)Z=e1(J)+Z;return Z}function X4($,J=10){if(isNaN($))throw new W0(H0.EncodeTimeValueMalformed,`Time must be a number: ${$}`);else if($>281474976710655)throw new W0(H0.EncodeTimeSizeExceeded,`Cannot encode a time larger than 281474976710655: ${$}`);else if($<0)throw new W0(H0.EncodeTimeNegative,`Time must be positive: ${$}`);else if(Number.isInteger($)===!1)throw new W0(H0.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 Y4(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function L5($,J){let Z=J||$4(),X=!$||isNaN($)?Date.now():$;return X4(X,10)+Z4(16,Z)}var v0=c(u(),1);var{create:Q4,defineProperty:d5,defineProperties:H4,getOwnPropertyDescriptor:K4,getOwnPropertyDescriptors:q4,getOwnPropertySymbols:J2}=Object,l5=Object.prototype.hasOwnProperty,p5=Object.prototype.propertyIsEnumerable,N4=($,J)=>(J=Symbol[$])?J:Symbol.for("Symbol."+$),j0=($)=>{throw TypeError($)},j2=($,J,Z)=>(J in $)?d5($,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):$[J]=Z,R5=($,J)=>{for(var Z in J||(J={}))if(l5.call(J,Z))j2($,Z,J[Z]);if(J2){for(var Z of J2(J))if(p5.call(J,Z))j2($,Z,J[Z])}return $},k5=($,J)=>H4($,q4(J)),B4=($,J)=>{var Z={};for(var X in $)if(l5.call($,X)&&J.indexOf(X)<0)Z[X]=$[X];if($!=null&&J2){for(var X of J2($))if(J.indexOf(X)<0&&p5.call($,X))Z[X]=$[X]}return Z},W4=($)=>{var J;return[,,,Q4((J=void 0)!=null?J:null)]},i5=["class","method","getter","setter","accessor","field","value","get","set"],I0=($)=>$!==void 0&&typeof $!=="function"?j0("Function expected"):$,z4=($,J,Z,X,Y)=>({kind:i5[$],name:J,metadata:X,addInitializer:(q)=>Z._?j0("Already initialized"):Y.push(I0(q||null))}),G4=($,J)=>j2(J,N4("metadata"),$[3]),a0=($,J,Z,X)=>{for(var Y=0,q=$[J>>1],Q=q&&q.length;Y<Q;Y++)J&1?q[Y].call(Z):X=q[Y].call(Z,X);return X},n5=($,J,Z,X,Y,q)=>{var Q,H,G,z,M,U=J&7,W=!1,F=!1,B=$.length+1,T=i5[U+5],P=$[B-1]=[],R=$[B]||($[B]=[]),S=(Y=Y.prototype,K4({get[Z](){return D0(this,q)},set[Z](L){return K0(this,q,L)}},Z));for(var w=X.length-1;w>=0;w--)if(z=z4(U,Z,G={},$[3],R),z.static=W,z.private=F,M=z.access={has:(L)=>(Z in L)},M.get=(L)=>L[Z],M.set=(L,V)=>L[Z]=V,H=(0,X[w])({get:S.get,set:S.set},z),G._=1,H===void 0)I0(H)&&(S[T]=H);else if(typeof H!=="object"||H===null)j0("Object expected");else I0(Q=H.get)&&(S.get=Q),I0(Q=H.set)&&(S.set=Q),I0(Q=H.init)&&P.unshift(Q);return S&&d5(Y,Z,S),Y},o5=($,J,Z)=>J.has($)||j0("Cannot "+Z),D0=($,J,Z)=>(o5($,J,"read from private field"),J.get($)),E0=($,J,Z)=>J.has($)?j0("Cannot add the same private member more than once"):J instanceof WeakSet?J.add($):J.set($,Z),K0=($,J,Z,X)=>(o5($,J,"write to private field"),J.set($,Z),Z);function i($){return $ instanceof g2||$ instanceof a5}var t0=10,M4=class extends y2{constructor($){super($);let J=E5(()=>{let{dragOperation:X}=$;if(!x2(X.activatorEvent))return;if(!i(X.source))return;if(X.status.initialized){let Y=$.registry.plugins.get(b5);if(Y)return Y.disable(),()=>Y.enable()}}),Z=$.monitor.addEventListener("dragmove",(X,Y)=>{queueMicrotask(()=>{if(this.disabled||X.defaultPrevented||!X.nativeEvent)return;let{dragOperation:q}=Y;if(!x2(X.nativeEvent))return;if(!i(q.source))return;if(!q.shape)return;let{actions:Q,collisionObserver:H,registry:G}=Y,{by:z}=X;if(!z)return;let M=U4(z),{source:U,target:W}=q,{center:F}=q.shape.current,B=[],T=[];v(()=>{for(let V of G.droppables){let{id:N}=V;if(!V.accepts(U)||N===(W==null?void 0:W.id)&&i(V)||!V.element)continue;let k=V.shape,O=new f2(V.element,{getBoundingClientRect:(D)=>f5(D,void 0,0.2)});if(!O.height||!O.width)continue;if(M=="down"&&F.y+t0<O.center.y||M=="up"&&F.y-t0>O.center.y||M=="left"&&F.x-t0>O.center.x||M=="right"&&F.x+t0<O.center.x)B.push(V),V.shape=O,T.push(()=>V.shape=k)}}),X.preventDefault(),H.disable();let P=H.computeCollisions(B,g5);v(()=>T.forEach((V)=>V()));let[R]=P;if(!R)return;let{id:S}=R,{index:w,group:L}=U.sortable;Q.setDropTarget(S).then(()=>{let{source:V,target:N,shape:k}=q;if(!V||!i(V)||!k)return;let{index:O,group:D,target:f}=V.sortable,g=w!==O||L!==D,m=g?f:N==null?void 0:N.element;if(!m)return;_5(m);let C=new f2(m);if(!C)return;let E=E2.delta(C,E2.from(k.current.boundingRectangle),V.alignment);if(Q.move({by:E}),g)Q.setDropTarget(V.id).then(()=>H.enable());else H.enable()})})});this.destroy=()=>{Z(),J()}}};function U4($){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:w4,defineProperties:F4,getOwnPropertyDescriptors:V4,getOwnPropertySymbols:C5}=Object,A4=Object.prototype.hasOwnProperty,L4=Object.prototype.propertyIsEnumerable,P5=($,J,Z)=>(J in $)?w4($,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):$[J]=Z,z0=($,J)=>{for(var Z in J||(J={}))if(A4.call(J,Z))P5($,Z,J[Z]);if(C5){for(var Z of C5(J))if(L4.call(J,Z))P5($,Z,J[Z])}return $},G0=($,J)=>F4($,V4(J));function R4($,J,Z){if(J===Z)return $;let X=$.slice();return X.splice(Z,0,X.splice(J,1)[0]),X}function T2($){return"initialIndex"in $&&typeof $.initialIndex==="number"&&"index"in $&&typeof $.index==="number"}function k4($,J,Z){var X,Y,q;let{source:Q,target:H,canceled:G}=J.operation;if(!Q||!H||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((N)=>z(N,Q.id)),V=$.findIndex((N)=>z(N,H.id));if(L===-1||V===-1){if(T2(Q)){let{initialIndex:N,index:k}=Q;if(N===k||N<0||N>=$.length){if("preventDefault"in J)J.preventDefault();return $}return Z($,N,k)}return $}if(!G&&"index"in Q&&typeof Q.index==="number"){let N=Q.index;if(N!==L)return Z($,L,N)}return Z($,L,V)}let M=Object.entries($),U=-1,W,F=-1,B;for(let[L,V]of M){if(U===-1){if(U=V.findIndex((N)=>z(N,Q.id)),U!==-1)W=L}if(F===-1){if(F=V.findIndex((N)=>z(N,H.id)),F!==-1)B=L}if(U!==-1&&F!==-1)break}if(U===-1&&T2(Q)){let{initialGroup:L,initialIndex:V,group:N,index:k}=Q;if(L==null||N==null||!(L in $)||!(N in $)){if("preventDefault"in J)J.preventDefault();return $}if(L===N&&V===k){if("preventDefault"in J)J.preventDefault();return $}if(L===N)return G0(z0({},$),{[L]:Z($[L],V,k)});let O=$[L][V];return G0(z0({},$),{[L]:[...$[L].slice(0,V),...$[L].slice(V+1)],[N]:[...$[N].slice(0,k),O,...$[N].slice(k)]})}if(!Q.manager)return $;let{dragOperation:T}=Q.manager,P=(Y=(X=T.shape)==null?void 0:X.current.center)!=null?Y:T.position.current;if(B==null){if(H.id in $){let L=H.shape&&P.y>H.shape.center.y?$[H.id].length:0;B=H.id,F=L}}if(W==null||B==null||W===B&&U===F){if(W!=null&&W===B&&U===F&&T2(Q)){let L=Q.group!=null&&Q.group!==W,V=Q.index!==U;if(L||V){let N=(q=Q.group)!=null?q:W;if(N in $){if(W===N)return G0(z0({},$),{[W]:Z($[W],U,Q.index)});let k=$[W][U];return G0(z0({},$),{[W]:[...$[W].slice(0,U),...$[W].slice(U+1)],[N]:[...$[N].slice(0,Q.index),k,...$[N].slice(Q.index)]})}}}if("preventDefault"in J)J.preventDefault();return $}if(W===B)return G0(z0({},$),{[W]:Z($[W],U,F)});let S=H.shape&&Math.round(P.y)>Math.round(H.shape.center.y)?1:0,w=$[W][U];return G0(z0({},$),{[W]:[...$[W].slice(0,U),...$[W].slice(U+1)],[B]:[...$[B].slice(0,F+S),w,...$[B].slice(F+S)]})}function C4($,J){return k4($,J,R4)}var T5="__default__",P4=class extends y2{constructor($){super($);let J=()=>{let X=new Map;for(let Y of $.registry.droppables)if(Y instanceof g2){let{sortable:q}=Y,{group:Q}=q,H=X.get(Q);if(!H)H=new Set,X.set(Q,H);H.add(q)}for(let[Y,q]of X)X.set(Y,new Set(e0(q)));return X},Z=[$.monitor.addEventListener("dragover",(X,Y)=>{if(this.disabled)return;let{dragOperation:q}=Y,{source:Q,target:H}=q;if(!i(Q)||!i(H))return;if(Q.sortable===H.sortable)return;let G=J(),z=Q.sortable.group===H.sortable.group,M=G.get(Q.sortable.group),U=z?M:G.get(H.sortable.group);if(!M||!U)return;queueMicrotask(()=>{if(X.defaultPrevented)return;Y.renderer.rendering.then(()=>{var W,F,B;let T=J();for(let[f,g]of G.entries()){let m=Array.from(g).entries();for(let[C,E]of m)if(E.index!==C||E.group!==f||!((W=T.get(f))==null?void 0:W.has(E)))return}let P=Q.sortable.element,R=H.sortable.element;if(!R||!P)return;if(!z&&H.id===Q.sortable.group)return;let S=e0(M),w=z?S:e0(U),L=(F=Q.sortable.group)!=null?F:T5,V=(B=H.sortable.group)!=null?B:T5,N={[L]:S,[V]:w},k=C4(N,X);if(N===k)return;let O=k[V].indexOf(Q.sortable),D=k[V].indexOf(H.sortable);Y.collisionObserver.disable(),O5(P,O,R,D),v(()=>{for(let[f,g]of k[L].entries())g.index=f;if(!z)for(let[f,g]of k[V].entries())g.group=H.sortable.group,g.index=f}),Y.actions.setDropTarget(Q.id).then(()=>Y.collisionObserver.enable())})})}),$.monitor.addEventListener("dragend",(X,Y)=>{if(!X.canceled)return;let{dragOperation:q}=Y,{source:Q}=q;if(!i(Q))return;if(Q.sortable.initialIndex===Q.sortable.index&&Q.sortable.initialGroup===Q.sortable.group)return;queueMicrotask(()=>{let H=J(),G=H.get(Q.sortable.initialGroup);if(!G)return;Y.renderer.rendering.then(()=>{for(let[F,B]of H.entries()){let T=Array.from(B).entries();for(let[P,R]of T)if(R.index!==P||R.group!==F)return}let z=e0(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),v(()=>{for(let[F,B]of H.entries()){let T=Array.from(B).values();for(let P of T)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 T4($,J){return $.index-J.index}function e0($){return Array.from($).sort(T4)}var S5=[M4,P4],_2={duration:250,easing:"cubic-bezier(0.25, 1, 0.5, 1)",idle:!1},$2=new I5,r5,s5,e,v2,f0,x0,h2,M0;s5=[S2],r5=[S2];var y0=class{constructor($,J){E0(this,v2,a0(e,8,this)),a0(e,11,this),E0(this,f0),E0(this,x0),E0(this,h2,a0(e,12,this)),a0(e,15,this),E0(this,M0),this.register=()=>{return v(()=>{var W,F;(W=this.manager)==null||W.registry.register(this.droppable),(F=this.manager)==null||F.registry.register(this.draggable)}),()=>this.unregister()},this.unregister=()=>{v(()=>{var W,F;(W=this.manager)==null||W.registry.unregister(this.droppable),(F=this.manager)==null||F.registry.unregister(this.draggable)})},this.destroy=()=>{v(()=>{this.droppable.destroy(),this.draggable.destroy()})};var Z=$,{effects:X=()=>[],group:Y,index:q,sensors:Q,type:H,transition:G=_2,plugins:z}=Z,M=B4(Z,["effects","group","index","sensors","type","transition","plugins"]);let U=I2(z,S5);this.droppable=new g2(M,J,this),this.draggable=new a5(k5(R5({},M),{plugins:U,effects:()=>[()=>{var W,F,B;let T=(W=this.manager)==null?void 0:W.dragOperation.status;if((T==null?void 0:T.initializing)&&this.id===((B=(F=this.manager)==null?void 0:F.dragOperation.source)==null?void 0:B.id))$2.clear(this.manager);if(T==null?void 0:T.dragging)$2.set(this.manager,this.id,O2(()=>({initialIndex:this.index,initialGroup:this.group})))},()=>{let{index:W,group:F,manager:B}=this,T=D0(this,x0),P=D0(this,f0);if(W!==T||F!==P)K0(this,x0,W),K0(this,f0,F),this.animate()},()=>{var W,F;let{target:B}=this,{isDragSource:T}=this.draggable;if(((F=(W=this.draggable.pluginConfig(m5))==null?void 0:W.feedback)!=null?F:"default")==="move"&&T)this.droppable.disabled=!B},...X()],type:H,sensors:Q}),J,this),K0(this,M0,M.element),this.manager=J,this.index=q,K0(this,x0,q),this.group=Y,K0(this,f0,Y),this.type=H,this.transition=G}get initialIndex(){var $,J;return(J=($=$2.get(this.manager,this.id))==null?void 0:$.initialIndex)!=null?J:this.index}get initialGroup(){var $,J;return(J=($=$2.get(this.manager,this.id))==null?void 0:$.initialGroup)!=null?J:this.group}animate(){O2(()=>{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 q=this.refreshShape();if(!q)return;let Q={x:Z.boundingRectangle.left-q.boundingRectangle.left,y:Z.boundingRectangle.top-q.boundingRectangle.top},{translate:H}=y5(Y),G=D2(Y,H,!1),z=D2(Y,H);if(Q.x||Q.y){let M=x5(D5(Y))?k5(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($){v(()=>{this.draggable.manager=$,this.droppable.manager=$})}set element($){v(()=>{let J=D0(this,M0),Z=this.droppable.element,X=this.draggable.element;if(!Z||Z===J)this.droppable.element=$;if(!X||X===J)this.draggable.element=$;K0(this,M0,$)})}get element(){var $,J;let Z=D0(this,M0);if(!Z)return;return(J=($=j5.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=I2($,S5)}set disabled($){v(()=>{this.droppable.disabled=$,this.draggable.disabled=$})}set data($){v(()=>{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?$:h5}set alignment($){this.draggable.alignment=$}get alignment(){return this.draggable.alignment}set type($){v(()=>{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($)}};e=W4();v2=new WeakMap;f0=new WeakMap;x0=new WeakMap;h2=new WeakMap;M0=new WeakMap;n5(e,4,"index",s5,y0,v2);n5(e,4,"group",r5,y0,h2);G4(e,y0);var a5=class extends c5{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 u5{constructor($,J,Z){super($,J);this.sortable=Z}get index(){return this.sortable.index}get group(){return this.sortable.group}};var{defineProperty:O4,defineProperties:S4,getOwnPropertyDescriptors:E4,getOwnPropertySymbols:t5}=Object,I4=Object.prototype.hasOwnProperty,D4=Object.prototype.propertyIsEnumerable,e5=($,J,Z)=>(J in $)?O4($,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):$[J]=Z,m2=($,J)=>{for(var Z in J||(J={}))if(I4.call(J,Z))e5($,Z,J[Z]);if(t5){for(var Z of t5(J))if(D4.call(J,Z))e5($,Z,J[Z])}return $},f4=($,J)=>S4($,E4(J));function Y1($){let{accept:J,collisionDetector:Z,collisionPriority:X,id:Y,data:q,element:Q,handle:H,index:G,group:z,disabled:M,modifiers:U,sensors:W,target:F,type:B,plugins:T}=$,P=m2(m2({},_2),$.transition),R=X1((w)=>{return new y0(f4(m2({},$),{transition:P,register:!1,handle:Z2(H),element:Z2(Q),target:Z2(F)}),w)}),S=J1(R,x4);return h(Y,()=>R.id=Y),$1(()=>{v(()=>{R.group=z,R.index=G})},[R,z,G]),h(B,()=>R.type=B),h(J,()=>R.accept=J,void 0,_0),h(q,()=>q&&(R.data=q)),h(G,()=>{var w;if(((w=R.manager)==null?void 0:w.dragOperation.status.idle)&&(P==null?void 0:P.idle))R.refreshShape()},Z1),X2(H,(w)=>R.handle=w),X2(Q,(w)=>R.element=w),X2(F,(w)=>R.target=w),h(M,()=>R.disabled=M===!0),h(W,()=>R.sensors=W),h(Z,()=>R.collisionDetector=Z),h(X,()=>R.collisionPriority=X),h(T,()=>R.plugins=T,void 0,_0),h(P,()=>R.transition=P,void 0,_0),h(U,()=>R.modifiers=U,void 0,_0),h($.alignment,()=>R.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:v0.useCallback((w)=>{R.handle=w!=null?w:void 0},[R]),ref:v0.useCallback((w)=>{var L,V;if(!w&&((L=R.element)==null?void 0:L.isConnected)&&!((V=R.manager)==null?void 0:V.dragOperation.status.idle))return;R.element=w!=null?w:void 0},[R]),sourceRef:v0.useCallback((w)=>{var L,V;if(!w&&((L=R.source)==null?void 0:L.isConnected)&&!((V=R.manager)==null?void 0:V.dragOperation.status.idle))return;R.source=w!=null?w:void 0},[R]),targetRef:v0.useCallback((w)=>{var L,V;if(!w&&((L=R.target)==null?void 0:L.isConnected)&&!((V=R.manager)==null?void 0:V.dragOperation.status.idle))return;R.target=w!=null?w:void 0},[R])}}function x4($,J,Z){if($==="isDragSource"&&!Z&&J)return!0;return!1}function j4($,J,Z){let X=$.slice();return X.splice(Z,0,X.splice(J,1)[0]),X}function Q1($,J,Z,X){if(Z===X)return $;let Y=j4(J,Z,X),q=new Set(J.map((H)=>H.id)),Q=0;return $.map((H)=>q.has(H.id)?Y[Q++]:H)}async function N$($){let J=[],Z=[],X=$.items;if(X)for(let Q=0;Q<X.length;Q++){let H=X[Q];if(H.kind==="file"){let G=H.webkitGetAsEntry?.();if(G)Z.push({entry:G,path:""})}}else return Array.from($.files);let Y=(Q)=>{return new Promise((H)=>{Q.readEntries((G)=>H(G),()=>H([]))})},q=(Q)=>{return new Promise((H,G)=>{Q.file((z)=>H(z),(z)=>G(z))})};while(Z.length>0){let Q=Z.shift();if(!Q)continue;let{entry:H,path:G}=Q;if(H.isFile)try{let z=await q(H),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(H.isDirectory){let z=H.createReader(),M=[],U=await Y(z);while(U.length>0)M=M.concat(U),U=await Y(z);let W=G?`${G}/${H.name}`:H.name;for(let F of M)Z.push({entry:F,path:W})}}return J}var d=c(u(),1);var Y2=["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 q0($){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:$}}function y4($=[]){let J=new Set($.map((X)=>X.color?.toLowerCase()).filter(Boolean)),Z=Y2.filter((X)=>!J.has(X.toLowerCase()));if(Z.length>0)return Z[Math.floor(Math.random()*Z.length)];return Y2[Math.floor(Math.random()*Y2.length)]}var _4={[_.text]:F1,[_.longText]:q1,[_.select]:z1,[_.selectMulti]:U1,[_.rating]:s0,[_.number]:W1,[_.toggle]:w1,[_.date]:N1,[_.user]:V1,[_.userMulti]:A1};function v4({field:$,index:J,onVisibilityChange:Z}){let{ref:X,handleRef:Y}=Y1({id:$.id,index:J}),q=$.config?.type?_4[$.config.type]:null;return A("div",{ref:X,className:"flex items-center justify-between p-2 rounded-md hover:bg-muted",children:[A("div",{className:"flex items-center gap-2",children:[K("div",{ref:Y,className:"cursor-grab",children:K(B1,{className:"h-4 w-4 text-muted-foreground"})}),q&&K(q,{className:"h-4 w-4 text-muted-foreground shrink-0"}),$.aiAutofill&&K(K1,{className:"h-4 w-4 text-muted-foreground shrink-0"}),K("span",{className:"text-sm truncate",children:$.config?.name})]}),K(g0,{checked:$.visible,onCheckedChange:(Q)=>Z($.id,Q)})]})}function E$({projectId:$,onManageFields:J,onSave:Z}){let{fields:X,updateFields:Y}=H5(),[q,Q]=d.useState(""),[H,G]=d.useState("list"),[z,M]=d.useState(""),[U,W]=d.useState(""),[F,B]=d.useState(!1),[T,P]=d.useState(""),[R,S]=d.useState([]),w=H1();d.useEffect(()=>{w.invalidateQueries({queryKey:["fields",$]})},[$,w]);let L=O0.api.projects[":projectId"].fields.order.$patch,{mutate:V}=b2({mutationFn:async(C)=>{if(!(await L(C)).ok)throw Error(I.failed_update_fields_order());return null}}),N=O0.api.projects[":projectId"].fields.$post,{mutate:k}=b2({mutationFn:async(C)=>{let E=await N(C);if(!E.ok)throw Error(I.failed_create_field());return await E.json()},onSuccess:(C)=>{let E={...C,visible:!0},x=[...X,E];Y(x),M(""),S([]),V({param:{projectId:$},json:x.map((j)=>({fieldId:j.id,visible:j.visible||!1}))}),Z?.()}}),O=d.useMemo(()=>X.filter((C)=>C.config?.name?.toLowerCase().includes(q.toLowerCase())),[X,q]),D=(C)=>{if(C.canceled)return;let{source:E}=C.operation;if(!i(E))return;let{initialIndex:x,index:j}=E;if(x===j)return;let d2=Q1(X,O,x,j);Y(d2),V({param:{projectId:$},json:d2.map((l2)=>({fieldId:l2.id,visible:l2.visible||!1}))})},f=(C,E)=>{let x=X.map((j)=>j.id===C?{...j,visible:E}:j);Y(x),V({param:{projectId:$},json:x.map((j)=>({fieldId:j.id,visible:j.visible||!1}))})},g=()=>{if(!z||!U)return;let C=U===_.select?{select:{options:R}}:U===_.selectMulti?{selectMulti:{options:R}}:{};k({param:{projectId:$},json:{config:{name:z,type:U,...C},label:z,aiAutofill:F,description:T}})},m=X.filter((C)=>C.visible).length;if(H==="create")return K("div",{className:"w-80 p-4",children:A("div",{className:"space-y-4",children:[A("div",{className:"space-y-2",children:[K(U0,{htmlFor:"field-name",children:I.field_name()}),K(h0,{id:"field-name",placeholder:I.new_field_placeholder(),value:z,onChange:(C)=>M(C.target.value),autoFocus:!0})]}),A("div",{className:"space-y-2",children:[K(U0,{children:I.field_type()}),A(L1,{children:[K(R1,{asChild:!0,children:A($0,{variant:"outline",className:"w-full justify-between font-normal",children:[U?K("span",{className:"capitalize",children:U.replace(/_/g," ")}):K("span",{className:"text-muted-foreground border-dashed",children:I.select_field_type()}),K(w0,{className:"ml-2 h-4 w-4 opacity-50"})]})}),K(k1,{className:"w-[--radix-dropdown-menu-trigger-width]",children:Object.values(_).map((C)=>K(C1,{onClick:()=>{W(C),S([])},className:"capitalize",children:C.replace(/_/g," ")},C))})]})]}),A("div",{className:"space-y-2",children:[K(U0,{htmlFor:"field-desc",children:I.description()}),K(h0,{id:"field-desc",placeholder:I.description_optional_placeholder(),value:T,onChange:(C)=>P(C.target.value)})]}),A("div",{className:"flex items-center space-x-2",children:[K(g0,{id:"ai-autofill",checked:F,onCheckedChange:B}),K(U0,{htmlFor:"ai-autofill",children:I.ai_autofill()})]}),(U===_.select||U===_.selectMulti)&&A("div",{className:"space-y-2",children:[A("div",{className:"flex items-center justify-between",children:[K(U0,{className:"text-sm font-medium",children:I.options()}),A($0,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>{let C={id:L5(),displayName:I.new_option(),color:y4(R)};S([...R,C])},children:[K(c2,{className:"h-4 w-4 mr-1"})," ",I.add_option()]})]}),K("div",{className:"space-y-2 max-h-40 overflow-y-auto pr-1",children:R.map((C,E)=>A("div",{className:"flex items-center gap-2",children:[K(h0,{value:C.displayName,onChange:(x)=>{let j=[...R];j[E]={...C,displayName:x.target.value},S(j)},placeholder:I.option_name_placeholder(),className:"h-8 flex-1"}),A(n,{children:[K(o,{asChild:!0,children:K("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[C.color||""]?.hex||C.color||"#808080"}})}),K(r,{className:"p-2 w-auto",align:"end",children:K("div",{className:"flex gap-1",children:Y2.map((x)=>K("button",{type:"button",className:"w-5 h-5 rounded-full border cursor-pointer hover:scale-110 transition-transform",style:{backgroundColor:u2[x]?.hex||x},onClick:()=>{let j=[...R];j[E]={...C,color:x},S(j)}},x))})})]}),K($0,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>{S(R.filter((x,j)=>j!==E))},children:K(F0,{className:"h-4 w-4"})})]},C.id))})]}),A("div",{className:"flex gap-2 pt-2",children:[K($0,{variant:"secondary",className:"flex-1",onClick:()=>{G("list"),M(""),W(""),B(!1),P(""),S([])},children:I.cancel()}),K($0,{className:"flex-1",onClick:g,disabled:!z||!U,children:I.save()})]})]})});return A("div",{className:"w-80 p-4",children:[K("div",{className:"flex items-center justify-between mb-4",children:A("h3",{className:"font-semibold",children:[I.fields()," ",K("span",{className:"text-muted-foreground text-sm font-normal",children:I.visible_count({count:m})})]})}),A("div",{className:"relative mb-4",children:[K(G1,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),K(h0,{placeholder:I.search_fields_placeholder(),value:q,onChange:(C)=>Q(C.target.value),className:"pl-8"})]}),K("div",{className:"max-h-60 overflow-y-auto pr-2",children:K(S1,{sensors:[O1.configure({activationConstraints:[new T1.Distance({value:8})]}),P1],onDragEnd:D,children:O.map((C,E)=>K(v4,{field:C,index:E,onVisibilityChange:f},C.id))})}),J&&A("div",{className:"mt-4 space-y-2",children:[A($0,{variant:"secondary",className:"w-full",onClick:J,children:[K(M1,{className:"h-4 w-4 mr-2"}),I.manage_fields()]}),A($0,{className:"w-full",onClick:()=>G("create"),children:[K(c2,{className:"h-4 w-4 mr-2"}),I.new_field()]})]})]})}var h4=({value:$,config:J,onSave:Z,readOnly:X})=>{let Y=J?.select,[q,Q]=E1.useState(!1),H=Y?.options?.find((W)=>W.id===$),G=()=>{if(!X)Q(!0)},z=(W)=>{Z(W),Q(!1)};return K("div",{className:"relative w-full",onClick:(W)=>W.stopPropagation(),children:A(n,{open:!X&&q,onOpenChange:(W)=>{if(X)return;Q(W)},children:[K(o,{asChild:!0,children:A("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 K("span",{className:"text-muted-foreground italic",children:"Select an option"});return K("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:q0(W.color),children:W.displayName})})(H),!X&&K(w0,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),A(r,{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:[A("div",{onClick:()=>z(""),className:"px-3 py-2 text-sm text-muted-foreground hover:bg-accent cursor-pointer flex items-center gap-2",children:[K(F0,{className:"w-3 h-3"})," Clear"]}),Y?.options?.map((W)=>K("div",{onClick:()=>z(W.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center",children:K("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:q0(W.color),children:W.displayName})},W.id))]})]})})},I1=h4;var J0=c(u(),1);var g4=({value:$=[],config:J,onSave:Z,readOnly:X})=>{let Y=J?.selectMulti,q=J0.useRef(null),[Q,H]=J0.useState(!1),[G,z]=J0.useState(!1),[M,U]=J0.useState($.length),W=Y?.options?.filter((w)=>($||[]).includes(w.id))||[];J0.useLayoutEffect(()=>{if(Q||G){U(W.length);return}if(q.current){let w=q.current.offsetWidth,V=document.createElement("canvas").getContext("2d");if(V){V.font="12px ui-sans-serif, system-ui, sans-serif";let N=0,k=0,D=w-28;for(let f=0;f<W.length;f++){let m=V.measureText(W[f].displayName).width+16+4;if(N+m>D&&f<W.length-1)break;if(f===W.length-1){if(N+m<=w)k++;break}N+=m,k++}U(k)}}},[W,Q,G,$]);let F=(w)=>{let L=$||[],V;if(L.includes(w))V=L.filter((N)=>N!==w);else V=[...L,w];Z(V)},B=(w)=>{if(w.stopPropagation(),Q)return;let L=W.length-M;if(!G&&L>0)z(!0);else if(!X)H(!0)},T=(w)=>{if(w.stopPropagation(),!X)H(!0)},P=W.length-M;return K("div",{className:"relative w-full",onClick:(w)=>w.stopPropagation(),children:A(n,{open:!X&&(G&&!Q||Q),onOpenChange:(w)=>{if(X)return;if(!w)z(!1),H(!1)},children:[K(o,{asChild:!0,children:A("div",{ref:q,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&&K("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),W.slice(0,M).map((w)=>K("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:q0(w.color),children:w.displayName},w.id)),P>0&&A("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]})]})}),K(r,{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?T:void 0,children:G&&!Q?A(Q2,{children:[W.length===0&&K("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),W.map((w)=>K("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:q0(w.color),children:w.displayName},w.id))]}):Y?.options?.map((w)=>{let L=($||[]).includes(w.id);return A("div",{onClick:()=>F(w.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center justify-between",children:[K("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:q0(w.color),children:w.displayName}),L&&K(H2,{className:"w-4 h-4 text-primary"})]},w.id)})})]})})},D1=g4;var Z0=c(u(),1);var m4=({value:$,onSave:J,readOnly:Z})=>{let[X,Y]=Z0.useState(!1),[q,Q]=Z0.useState($||""),H=Z0.useRef(null);Z0.useEffect(()=>{Q($||"")},[$]),Z0.useEffect(()=>{if(X&&H.current)H.current.focus()},[X]);let G=()=>{if(!Z)Y(!0)},z=()=>{Y(!1),J(q)},M=(U)=>{if(U.key==="Enter")H.current?.blur()};if(X)return K("input",{ref:H,type:"text",value:q,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 K("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:$||K("span",{className:"text-muted-foreground italic",children:"Empty"})})},f1=m4;var b4=({value:$,onSave:J,readOnly:Z})=>{return K("div",{className:"flex items-center h-[28px] w-full",onClick:(Y)=>Y.stopPropagation(),children:K(g0,{checked:$,onCheckedChange:(Y)=>{if(!Z)J(Y)},disabled:Z,className:"cursor-pointer"})})},x1=b4;var q2=c(u(),1);var c4=({value:$,onSave:J,readOnly:Z})=>{let X=K2(),{members:Y,fetchMembers:q}=o0(),[Q,H]=q2.useState(!1);q2.useEffect(()=>{if(X)q(X)},[X,q]);let G=Y.find((B)=>B.id===$),z=()=>{if(!Z)H(!0)},M=(B)=>{J(B),H(!1)},U=(B)=>{if(Z)return;H(B)},W=(B)=>{return B.split(" ").map((T)=>T[0]).slice(0,2).join("").toUpperCase()};return K("div",{className:"relative w-full",onClick:(B)=>B.stopPropagation(),children:A(n,{open:!Z&&Q,onOpenChange:U,children:[K(o,{asChild:!0,children:A("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 K("span",{className:"text-muted-foreground italic text-sm",children:"Select user"});return A("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:[A(V0,{className:"w-4 h-4",children:[K(A0,{src:B.image,alt:B.name,className:"object-cover"}),K(L0,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:W(B.name)})]}),K("span",{className:"truncate max-w-[120px]",children:B.name})]})})(G),!Z&&K(w0,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),A(r,{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:[A("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:[K(F0,{className:"w-3 h-3"})," Clear"]}),Y.map((B)=>A("div",{onClick:()=>M(B.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[A(V0,{className:"w-5 h-5",children:[K(A0,{src:B.image,alt:B.name,className:"object-cover"}),K(L0,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:W(B.name)})]}),K("span",{className:"text-sm font-medium text-foreground",children:B.name})]},B.id))]})]})})},j1=c4;var s=c(u(),1);var u4=({value:$=[],onSave:J,readOnly:Z})=>{let X=K2(),{members:Y,fetchMembers:q}=o0(),Q=s.useRef(null),[H,G]=s.useState(!1),[z,M]=s.useState(!1),[U,W]=s.useState($.length);s.useEffect(()=>{if(X)q(X)},[X,q]);let F=Y.filter((N)=>($||[]).includes(N.id)),B=(N)=>{return N.split(" ").map((k)=>k[0]).slice(0,2).join("").toUpperCase()};s.useLayoutEffect(()=>{if(H||z){W(F.length);return}if(Q.current){let N=Q.current.offsetWidth,O=document.createElement("canvas").getContext("2d");if(O){O.font="12px ui-sans-serif, system-ui, sans-serif";let D=0,f=0,m=N-28;for(let C=0;C<F.length;C++){let x=O.measureText(F[C].name).width+42;if(D+x>m&&C<F.length-1)break;if(C===F.length-1){if(D+x<=N)f++;break}D+=x,f++}W(f)}}},[F,H,z,$]);let T=(N)=>{let k=$||[],O;if(k.includes(N))O=k.filter((D)=>D!==N);else O=[...k,N];J(O)},P=(N)=>{if(N.stopPropagation(),H)return;let k=F.length-U;if(!z&&k>0)M(!0);else if(!Z)G(!0)},R=(N)=>{if(N.stopPropagation(),!Z)G(!0)},S=F.length-U,w=z&&!H||H,L=(N)=>{if(Z)return;if(!N)M(!1),G(!1)},V=(N)=>{return A("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:[A(V0,{className:"w-4 h-4",children:[K(A0,{src:N.image,alt:N.name,className:"object-cover"}),K(L0,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:B(N.name)})]}),K("span",{className:"truncate max-w-[100px]",children:N.name})]},N.id)};return K("div",{className:"relative w-full",onClick:(N)=>N.stopPropagation(),children:A(n,{open:!Z&&w,onOpenChange:L,children:[K(o,{asChild:!0,children:A("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:[F.length===0&&K("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),F.slice(0,U).map(V),S>0&&A("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]})]})}),K(r,{className:`p-1 bg-popover border rounded-lg shadow-xl max-h-60 overflow-auto ${z&&!H?"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&&!H?R:void 0,children:z&&!H?A(Q2,{children:[F.length===0&&K("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),F.map(V)]}):Y.map((N)=>{let k=($||[]).includes(N.id);return A("div",{onClick:()=>T(N.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center justify-between rounded-sm",children:[A("div",{className:"flex items-center gap-2",children:[A(V0,{className:"w-5 h-5",children:[K(A0,{src:N.image,alt:N.name,className:"object-cover"}),K(L0,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:B(N.name)})]}),K("span",{className:"text-sm font-medium text-foreground",children:N.name})]}),k&&K(H2,{className:"w-4 h-4 text-primary"})]},N.id)})})]})})},y1=u4;var d4=($)=>{if(!$.config)return K("div",{children:"Unknown Field Type"});switch($.config.type){case"text":return K(f1,{...$,value:$.value,onSave:$.onSave});case"longText":return K(w5,{...$,value:$.value,onSave:$.onSave});case"select":return K(I1,{...$,value:$.value,onSave:$.onSave});case"selectMulti":return K(D1,{...$,value:$.value,onSave:$.onSave});case"rating":return K(A5,{...$,value:$.value,onSave:$.onSave});case"number":return K(F5,{...$,value:$.value,onSave:$.onSave});case"toggle":return K(x1,{...$,value:$.value,onSave:$.onSave});case"date":return K(U5,{...$,value:$.value,onSave:$.onSave});case"user":return K(j1,{...$,value:$.value,onSave:$.onSave});case"userMulti":return K(y1,{...$,value:$.value,onSave:$.onSave});default:return K("div",{children:"Unknown Field Type"})}},k6=d4;var T6=({progress:$,className:J})=>{let X=2*Math.PI*20,Y=X-Math.min(100,Math.max(0,$))/100*X;return A("svg",{viewBox:"0 0 50 50",className:R0("w-12 h-12",J),children:[K("circle",{cx:"25",cy:"25",r:20,className:"stroke-muted",strokeWidth:"4",fill:"transparent"}),K("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)"}),K("text",{x:"50%",y:"50%",textAnchor:"middle",dy:".3em",className:"fill-foreground text-[10px] font-bold",children:`${Math.round($)}%`})]})};var l4=($)=>{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}`},E6=($,J,Z,X)=>{if(Z==="frames")return`${$} fr`;if(Z==="standard")return l4($/J);let Y=Math.round(J),q=J!==Y,Q=!1;if(q&&(Y===30||Y===60))Q=!0;let H=0;if(X){let B=X.match(/^([012]\d):(\d\d):(\d\d)(:|;|\.)(\d+)$/);if(B){let T=parseInt(B[1],10),P=parseInt(B[2],10),R=parseInt(B[3],10),S=parseInt(B[5],10);if(Q=B[4]!==":",H=(T*3600+P*60+R)*Y+S,Q){let w=T*60+P,L=J<30?2:4;H-=L*(w-Math.floor(w/10))}}}let G=$+H;if(Q){let B=J<30?2:4,T=Math.floor(G/(17982*B/2)),P=G%(17982*B/2);if(P<B)P=P+B;G+=9*B*T+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,F=Q?";":":";return`${W.toString().padStart(2,"0")}:${U.toString().padStart(2,"0")}:${M.toString().padStart(2,"0")}${F}${z.toString().padStart(2,"0")}`};var I6=($,J)=>{if(!J)return 0;let Z=1/J;return $*Z+Z/2},p4=($)=>Math.max(100,3000/($||30)),D6=({dbTotalFrames:$,containerDuration:J,frameRate:Z})=>{let X=Z||30,Y=Math.round(J*X);if($<=0)return Y;let q=$/X,Q=J-q,H=p4(X)/1000;return Q>H?Y:$};var _1=c(u(),1);function y6({className:$,defaultValue:J,value:Z,min:X=0,max:Y=100,...q}){let Q=_1.useMemo(()=>Array.isArray(Z)?Z:Array.isArray(J)?J:[X,Y],[Z,J,X,Y]);return A(m0.Root,{"data-slot":"slider",defaultValue:J,value:Z,min:X,max:Y,className:R0("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",$),...q,children:[K(m0.Track,{"data-slot":"slider-track",className:R0("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:K(m0.Range,{"data-slot":"slider-range",className:R0("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:Q.length},(H,G)=>K(m0.Thumb,{"data-slot":"slider-thumb",className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},G))]})}
2
- export{A2 as p,K5 as q,N5 as r,k2 as s,C2 as t,Q1 as u,N$ as v,H5 as w,L5 as x,T6 as y,i4 as z,A5 as A,i as B,Y1 as C,Y2 as D,u2 as E,q0 as F,y4 as G,_4 as H,E$ as I,o0 as J,k6 as K,l4 as L,E6 as M,I6 as N,p4 as O,D6 as P,y6 as Q};