@shumai-one/shumai 0.4.5 → 0.4.7

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 (175) hide show
  1. package/bin/{chunk-ncqhp76x.js → chunk-05tnmf8h.js} +2 -2
  2. package/bin/chunk-0xsgx9ep.js +1 -0
  3. package/bin/{chunk-wnpjz2kw.js → chunk-0ygtayqf.js} +1 -1
  4. package/bin/{chunk-1yv06e0q.js → chunk-11c93g1m.js} +2 -2
  5. package/bin/chunk-1ajgdv26.js +1 -0
  6. package/bin/chunk-1ntn42d2.js +4 -0
  7. package/bin/chunk-2kxhdnma.js +3 -0
  8. package/bin/chunk-30dsxm8s.js +1 -0
  9. package/bin/chunk-3b6h719s.js +3 -0
  10. package/bin/{chunk-21e4gjvw.js → chunk-3g5pyw2e.js} +2 -2
  11. package/bin/{chunk-pdrmbxrt.js → chunk-3h9c5ak3.js} +2 -2
  12. package/bin/chunk-3m5kwcj7.js +2 -0
  13. package/bin/chunk-3p1bb08a.js +2 -0
  14. package/bin/{chunk-1b7gg0nx.js → chunk-3r5yc5wm.js} +11 -11
  15. package/bin/{chunk-tgee88jq.js → chunk-3tyk9xgf.js} +5 -5
  16. package/bin/chunk-4a88wwg2.js +2 -0
  17. package/bin/chunk-4f5pnnah.js +42 -0
  18. package/bin/{chunk-f3pb9mh9.js → chunk-4jgq9m51.js} +9 -9
  19. package/bin/{chunk-4k2bej3c.js → chunk-4m8gk79m.js} +2 -2
  20. package/bin/{chunk-1hnpvtvf.js → chunk-53vtc74g.js} +2 -2
  21. package/bin/{chunk-e1s1zgv0.js → chunk-58e1a3re.js} +2 -2
  22. package/bin/{chunk-20ee2pqp.js → chunk-5qkwpy8c.js} +2 -2
  23. package/bin/{chunk-qysf4mpk.js → chunk-5rk7dyx9.js} +61 -61
  24. package/bin/{chunk-z422yh6b.js → chunk-5v4s2kp4.js} +1 -1
  25. package/bin/{chunk-7v7mypc6.js → chunk-5vvvgjvz.js} +2 -2
  26. package/bin/{chunk-48rbc18e.js → chunk-5wp37g6w.js} +9 -9
  27. package/bin/{chunk-xgy6ppww.js → chunk-628k58ek.js} +2 -2
  28. package/bin/{chunk-erharpzt.js → chunk-6kdf411z.js} +1 -1
  29. package/bin/chunk-6ksrrayx.css +1 -0
  30. package/bin/chunk-6rjkbwz6.js +14 -0
  31. package/bin/{chunk-zcfehv0w.js → chunk-781990k7.js} +8 -8
  32. package/bin/{chunk-rq0n0vcc.js → chunk-80qz30dc.js} +2 -2
  33. package/bin/{chunk-j3kjscfj.js → chunk-887pj9xd.js} +2 -2
  34. package/bin/{chunk-psk38vp4.js → chunk-8b1w6bj9.js} +1 -1
  35. package/bin/{chunk-7t1r3sj3.js → chunk-8gna37dd.js} +2 -2
  36. package/bin/{chunk-azafjrm4.js → chunk-8sf106rq.js} +2 -2
  37. package/bin/{chunk-w3jmahea.js → chunk-8ystwvdt.js} +2 -2
  38. package/bin/{chunk-3mfdp2nh.js → chunk-9v6eqa3n.js} +2 -2
  39. package/bin/{chunk-dchtr0ap.js → chunk-9va1mzeq.js} +2 -2
  40. package/bin/{chunk-qqqarj5v.js → chunk-an6nsq1t.js} +2 -2
  41. package/bin/chunk-ayq8dskd.js +2 -0
  42. package/bin/{chunk-nkmr6gqc.js → chunk-b0rjvx5g.js} +2 -2
  43. package/bin/{chunk-v0201sn5.js → chunk-b3aqmcps.js} +2 -2
  44. package/bin/chunk-bgm76rzj.js +1 -0
  45. package/bin/chunk-btmxr226.js +1 -0
  46. package/bin/chunk-camzbwqh.js +2 -0
  47. package/bin/{chunk-1n1h09e9.js → chunk-ccvjwhqq.js} +1 -1
  48. package/bin/{chunk-7sc73pfr.js → chunk-dkzyv61a.js} +2 -2
  49. package/bin/{chunk-y8a3hans.js → chunk-dscq4a4k.js} +2 -2
  50. package/bin/{chunk-5trfc3xh.js → chunk-dyq6h9ha.js} +1 -1
  51. package/bin/chunk-e17daz1x.js +2 -0
  52. package/bin/{chunk-ncp007yb.js → chunk-ebf1r872.js} +5 -5
  53. package/bin/{chunk-k2aqztk1.js → chunk-ebx3bd4c.js} +1 -1
  54. package/bin/chunk-ee3mrvqp.js +2 -0
  55. package/bin/chunk-fg6zf2gb.js +2 -0
  56. package/bin/{chunk-cwfjvynz.js → chunk-fhazy8f9.js} +2 -2
  57. package/bin/chunk-fk712d68.js +2 -0
  58. package/bin/{chunk-zrxe6p0q.js → chunk-fvgb6rps.js} +2 -2
  59. package/bin/chunk-g9gmht89.js +2 -0
  60. package/bin/chunk-gc6m7agb.js +3 -0
  61. package/bin/{chunk-m5z5mzan.js → chunk-gf4n4ahk.js} +1 -1
  62. package/bin/{chunk-y78v01te.js → chunk-h3wr8nnk.js} +1 -1
  63. package/bin/chunk-htpjtarr.js +2 -0
  64. package/bin/{chunk-zp1sv030.js → chunk-hye75kp0.js} +2 -2
  65. package/bin/{chunk-wmkbkad1.js → chunk-j41mya13.js} +3 -3
  66. package/bin/chunk-j547gtag.js +2 -0
  67. package/bin/{chunk-xcwjsav0.js → chunk-jde9r5mj.js} +1 -1
  68. package/bin/chunk-jf4kcad0.js +1 -0
  69. package/bin/chunk-jt04mf5s.js +2 -0
  70. package/bin/{chunk-af1mcn9p.js → chunk-k3qypq3x.js} +1 -1
  71. package/bin/chunk-k5hnrtrt.js +1 -0
  72. package/bin/{chunk-3x80f4jk.js → chunk-k810fstm.js} +1 -1
  73. package/bin/{chunk-h4s1fgf1.js → chunk-kg2c445x.js} +1 -1
  74. package/bin/chunk-kq2qbwx1.js +2 -0
  75. package/bin/chunk-m2h7a172.js +1 -0
  76. package/bin/{chunk-2y6teq4s.js → chunk-m638fg4n.js} +7 -7
  77. package/bin/{chunk-42ygnm34.js → chunk-mm1a0zja.js} +1 -1
  78. package/bin/{chunk-23bg4h8n.js → chunk-njabdtvb.js} +2 -2
  79. package/bin/chunk-njqf50vw.js +2 -0
  80. package/bin/{chunk-c5dr9m1d.js → chunk-nn5hyf6f.js} +1 -1
  81. package/bin/{chunk-y13s3641.js → chunk-nnq8g9yy.js} +3 -3
  82. package/bin/{chunk-zg7a107s.js → chunk-ny7qjn6s.js} +1 -1
  83. package/bin/{chunk-gdg0tkbk.js → chunk-p5fwjk5c.js} +1 -1
  84. package/bin/{chunk-g6xgghnq.js → chunk-pa1fmskf.js} +1 -1
  85. package/bin/{chunk-qg1f1z3t.js → chunk-pcspeqwq.js} +4 -4
  86. package/bin/{chunk-ty71fdw9.js → chunk-q1d7x1cc.js} +2 -2
  87. package/bin/{chunk-3c0tcbga.js → chunk-q45n02fs.js} +1 -1
  88. package/bin/chunk-q6jsw0rr.js +211 -0
  89. package/bin/{chunk-18qzk2mm.js → chunk-qgkbxw1k.js} +2 -2
  90. package/bin/chunk-qjzyze00.js +1 -0
  91. package/bin/chunk-r55htzxr.js +2 -0
  92. package/bin/{chunk-46wfxyd7.js → chunk-r7e2fmmx.js} +2 -2
  93. package/bin/{chunk-7jtmwt5a.js → chunk-radcwage.js} +2 -2
  94. package/bin/chunk-rbagbd0e.js +1 -0
  95. package/bin/{chunk-cbpgrg5j.js → chunk-rdscv38p.js} +1 -1
  96. package/bin/chunk-rfhmk32e.js +1 -0
  97. package/bin/{chunk-p4yrnr37.js → chunk-rkafv27g.js} +2 -2
  98. package/bin/chunk-rkqpnyzx.js +2 -0
  99. package/bin/{chunk-brxwrh0b.js → chunk-s30fjvzs.js} +4 -4
  100. package/bin/{chunk-b5a77dzv.js → chunk-s41mgkse.js} +1 -1
  101. package/bin/chunk-s63vj79f.js +1 -0
  102. package/bin/{chunk-73evafrq.js → chunk-t3t7dcfq.js} +1 -1
  103. package/bin/{chunk-0z8tgn67.js → chunk-twyxs4z2.js} +1 -1
  104. package/bin/{chunk-nzggcbgk.js → chunk-typ46eqd.js} +6 -6
  105. package/bin/chunk-v1sgrg0r.js +1 -0
  106. package/bin/{chunk-jbt3e1ac.js → chunk-vdnmq163.js} +2 -2
  107. package/bin/{chunk-w9160hxz.js → chunk-vx66rms0.js} +3 -3
  108. package/bin/{chunk-ss0mcgbd.js → chunk-wvq717b5.js} +2 -2
  109. package/bin/chunk-xbge27m4.js +1 -0
  110. package/bin/chunk-xca338dw.js +5 -0
  111. package/bin/chunk-xcsz1wp7.js +1 -0
  112. package/bin/{chunk-a3j3hyx2.js → chunk-xznabrt2.js} +2 -2
  113. package/bin/{chunk-dqxh6dwz.js → chunk-xzyfnfck.js} +8 -8
  114. package/bin/{chunk-s0caa0zm.js → chunk-ycw3rwhx.js} +4 -4
  115. package/bin/{chunk-njswnpaq.js → chunk-yqvhgtez.js} +2 -2
  116. package/bin/{chunk-c51tvhra.js → chunk-yr03tf5r.js} +3 -3
  117. package/bin/chunk-z9jpgxf1.js +2 -0
  118. package/bin/chunk-zb0az2tq.js +2 -0
  119. package/bin/{chunk-gjp851vj.js → chunk-zbt4h7n0.js} +6 -6
  120. package/bin/chunk-zcdqsp1e.js +1 -0
  121. package/bin/chunk-zej27b5c.js +2 -0
  122. package/bin/{chunk-kfpfqxb3.js → chunk-zmjtv19e.js} +1 -1
  123. package/bin/{chunk-3x3sf7rp.js → chunk-zr11zfwc.js} +2 -2
  124. package/bin/{chunk-v2xt5p3x.js → chunk-zz0522zr.js} +4 -4
  125. package/bin/shumai-app.html +1 -1
  126. package/bin/shumai-app.js +408 -386
  127. package/package.json +7 -7
  128. package/prisma/migrations/20260914024424_add_asset_comment_reactions/migration.sql +22 -0
  129. package/prisma/migrations/20260914064432_limit_reaction_code_length/migration.sql +8 -0
  130. package/prisma/migrations/20260914092940_add_jpeg_preview_flags/migration.sql +5 -0
  131. package/prisma/schema.prisma +21 -0
  132. package/bin/chunk-20yset6k.js +0 -1
  133. package/bin/chunk-2swjkvxv.js +0 -211
  134. package/bin/chunk-3115qtvj.js +0 -2
  135. package/bin/chunk-3rwx54z7.js +0 -2
  136. package/bin/chunk-5xcjnbm9.js +0 -1
  137. package/bin/chunk-685gzbdg.js +0 -14
  138. package/bin/chunk-6kzm51c7.js +0 -2
  139. package/bin/chunk-813885jm.js +0 -1
  140. package/bin/chunk-8yg9zy53.js +0 -2
  141. package/bin/chunk-923agf2d.js +0 -1
  142. package/bin/chunk-942ksfnj.js +0 -2
  143. package/bin/chunk-99yzvkq5.js +0 -2
  144. package/bin/chunk-9by727gr.js +0 -2
  145. package/bin/chunk-9sr1z8kv.js +0 -42
  146. package/bin/chunk-a0fggks8.js +0 -2
  147. package/bin/chunk-a8x0dmec.js +0 -2
  148. package/bin/chunk-b80fgsdf.js +0 -1
  149. package/bin/chunk-bg6kp843.js +0 -1
  150. package/bin/chunk-da2w7c80.js +0 -2
  151. package/bin/chunk-fp8x63vs.js +0 -2
  152. package/bin/chunk-ft11rrhz.js +0 -1
  153. package/bin/chunk-fyszcddw.js +0 -2
  154. package/bin/chunk-g6hq18q1.js +0 -1
  155. package/bin/chunk-gy68h3x5.js +0 -2
  156. package/bin/chunk-hsv4v7na.js +0 -1
  157. package/bin/chunk-jrf90z42.js +0 -3
  158. package/bin/chunk-kyxramkk.js +0 -1
  159. package/bin/chunk-n48548fs.js +0 -4
  160. package/bin/chunk-ncnr223m.js +0 -2
  161. package/bin/chunk-nngp6fhe.js +0 -1
  162. package/bin/chunk-p1nb8wk8.js +0 -3
  163. package/bin/chunk-pc2dnpkh.js +0 -2
  164. package/bin/chunk-pmj9b8qt.js +0 -3
  165. package/bin/chunk-pve3zpta.js +0 -2
  166. package/bin/chunk-q3q0brsn.js +0 -2
  167. package/bin/chunk-qk7me5ra.js +0 -2
  168. package/bin/chunk-r0j962y1.js +0 -1
  169. package/bin/chunk-r5dxd4sx.js +0 -1
  170. package/bin/chunk-sa6k5ye7.js +0 -1
  171. package/bin/chunk-sz6cnm4q.css +0 -1
  172. package/bin/chunk-w88h5wtf.js +0 -1
  173. package/bin/chunk-wrbas9cg.js +0 -1
  174. package/bin/chunk-z5t4yxzb.js +0 -2
  175. package/bin/chunk-zwenq5zy.js +0 -2
@@ -1,12 +1,12 @@
1
1
  // @bun
2
- import{Wr}from"./chunk-s0caa0zm.js";import{ws}from"./chunk-46wfxyd7.js";import{je,tc,rc,io,Hi,lo}from"./chunk-21e4gjvw.js";import{sn}from"./chunk-ncqhp76x.js";function v(i,o){let a={v:1,id:i};if(o)a.phase=o;return JSON.stringify(a)}function C(i){if(!i)return;if(i.startsWith("{"))try{let o=JSON.parse(i);if(o.v===1&&typeof o.id==="string"){if(o.phase==="commentary"||o.phase==="final_answer")return{id:o.id,phase:o.phase};return{id:o.id}}}catch{}return{id:i}}function J(i,o){let a=o.filter((l)=>l.type==="text").map((l)=>l.text).join(`
3
- `),u=o.filter((l)=>l.type==="image"),p=a.length>0;if(u.length===0||!i.input.includes("image"))return je(p?a:u.length>0?"(see attached image)":"(no tool output)");let f=[];if(p)f.push({type:"input_text",text:je(a)});for(let l of u)f.push({type:"input_image",detail:"auto",image_url:`data:${l.mimeType};base64,${l.data}`});return f}function Vs(i,o,a,u){let p=[],f=new Set,l=(r)=>{let c=r.replace(/[^a-zA-Z0-9_-]/g,"_");return(c.length>64?c.slice(0,64):c).replace(/_+$/,"")},y=(r)=>{let c=`fc_${ws(r)}`;return c.length>64?c.slice(0,64):c},m=(r,c,t)=>{if(!a.has(i.provider))return l(r);if(!r.includes("|"))return l(r);let[e,n]=r.split("|"),s=l(e),g=t.provider!==i.provider||t.api!==i.api?y(n):l(n);if(!g.startsWith("fc_"))g=l(`fc_${g}`);return`${s}|${g}`},h=lo(o.messages,i,m);if((u?.includeSystemPrompt??!0)&&o.systemPrompt){let r=i.compat,c=i.reasoning&&r?.supportsDeveloperRole!==!1?"developer":"system";p.push({role:c,content:je(o.systemPrompt)})}let x=0;for(let r of h){if(r.role==="user")if(typeof r.content==="string")p.push({role:"user",content:[{type:"input_text",text:je(r.content)}]});else{let c=r.content.map((t)=>{if(t.type==="text")return{type:"input_text",text:je(t.text)};return{type:"input_image",detail:"auto",image_url:`data:${t.mimeType};base64,${t.data}`}});if(c.length===0)continue;p.push({role:"user",content:c})}else if(r.role==="assistant"){let c=[],t=r,e=t.model!==i.id&&t.provider===i.provider&&t.api===i.api,n=0;for(let s of r.content)if(s.type==="thinking"){if(s.thinkingSignature){let d=JSON.parse(s.thinkingSignature);c.push(d)}}else if(s.type==="text"){let d=s,g=C(d.textSignature),b=n===0?`msg_pi_${x}`:`msg_pi_${x}_${n}`;n++;let _=g?.id;if(!_)_=b;else if(_.length>64)_=`msg_${ws(_)}`;c.push({type:"message",role:"assistant",content:[{type:"output_text",text:je(d.text),annotations:[]}],status:"completed",id:_,phase:g?.phase})}else if(s.type==="toolCall"){let d=s,[g,b]=d.id.split("|"),_=u?.grammarToolInputProperties?.get(d.name),k=b;if(e&&k?.startsWith("fc_")||_===void 0&&!k?.startsWith("fc_"))k=void 0;if(_!==void 0)c.push({type:"custom_tool_call",id:k,call_id:g,name:d.name,input:je(tc(d.name,d.arguments,_))});else c.push({type:"function_call",id:k,call_id:g,name:d.name,arguments:JSON.stringify(d.arguments)})}if(c.length===0)continue;p.push(...c)}else if(r.role==="toolResult"){let[c]=r.toolCallId.split("|"),t=J(i,r.content);if(u?.grammarToolInputProperties?.has(r.toolName))p.push({type:"custom_tool_call_output",call_id:c,output:t});else p.push({type:"function_call_output",call_id:c,output:t});let e=[];for(let n of r.addedToolNames??[]){let s=u?.deferredTools?.get(n);if(!s||f.has(n))continue;f.add(n),e.push(s)}if(e.length>0){let n=e.map((d)=>d.name),s=`pi_tool_load_${ws(`${r.toolCallId}:${n.join(",")}`)}`;p.push({type:"tool_search_call",call_id:s,execution:"client",status:"completed",arguments:{query:n.join(" "),limit:n.length}}),p.push({type:"tool_search_output",call_id:s,execution:"client",status:"completed",tools:Ks(e,{...u?.toolOptions,deferLoading:!0})})}}x++}return p}function Ks(i,o){let a=o?.strict===void 0?!1:o.strict,u=o?.supportsStrictMode??!0,p=o?.supportsOpenAIGrammarTools??!1;return i.map((f)=>{let l=Hi(f,p);if(l)return{type:"custom",name:f.name,description:f.description,format:{type:"grammar",syntax:l.format,definition:l.definition},...o?.deferLoading?{defer_loading:!0}:{}};let y=io(f,u),m={type:"function",name:f.name,description:f.description,parameters:f.parameters,...o?.deferLoading?{defer_loading:!0}:{}};if(u)m.strict=y??a;return m})}function T(i){let o=i.customInput?.property;if(o===void 0)return"";let a=i.arguments[o];return typeof a==="string"?a:""}function S(i,o,a){let u=i.customInput;if(!u)return;let p=rc(u.jsonBuffer,u.property,o,a);return i.arguments={[u.property]:o},p}async function Ws(i,o,a,u,p){let f=!1,l=new Map,y=new Map,m=(t,e)=>{let n=l.get(t);return n?.type===e?n:void 0},h=(t,e)=>{if(e===void 0)return;a.push({type:"toolcall_delta",contentIndex:t.contentIndex,delta:e,partial:o})},I=(t,e)=>{if(e.type==="reasoning"){let n={type:"thinking",thinking:""};o.content.push(n);let s={type:"thinking",block:n,contentIndex:o.content.length-1};return l.set(t,s),a.push({type:"thinking_start",contentIndex:s.contentIndex,partial:o}),s}if(e.type==="message"){let n={type:"text",text:""};o.content.push(n);let s={type:"text",block:n,contentIndex:o.content.length-1};return l.set(t,s),a.push({type:"text_start",contentIndex:s.contentIndex,partial:o}),s}if(e.type==="function_call"){let n={type:"toolCall",id:`${e.call_id}|${e.id}`,name:e.name,arguments:{},partialJson:e.arguments||""};o.content.push(n);let s={type:"toolCall",block:n,contentIndex:o.content.length-1};return l.set(t,s),a.push({type:"toolcall_start",contentIndex:s.contentIndex,partial:o}),s}if(e.type==="custom_tool_call"){let n=p?.grammarToolInputProperties?.get(e.name)??"input",s=e.input||"",d={type:"toolCall",id:`${e.call_id}|${e.id}`,name:e.name,arguments:{[n]:s},customInput:{property:n,jsonBuffer:{input:"",started:!1,closed:!1}}};o.content.push(d);let g={type:"toolCall",block:d,contentIndex:o.content.length-1};return l.set(t,g),a.push({type:"toolcall_start",contentIndex:g.contentIndex,partial:o}),g}return},x=(t,e)=>l.get(t)??I(t,e),r=(t)=>{for(let e of t){if(e.type!=="reasoning"||!e.encrypted_content)continue;let n=y.get(e.id);if(!n?.thinkingSignature)continue;let s=JSON.parse(n.thinkingSignature);if(s.encrypted_content)continue;n.thinkingSignature=JSON.stringify({...s,encrypted_content:e.encrypted_content})}},c=(t)=>{if(f=!0,r(t.output??[]),t?.id)o.responseId=t.id;if(t?.usage){let e=t.usage.input_tokens_details,n=e?.cached_tokens||0,s=e?.cache_write_tokens||0;o.usage={input:Math.max(0,(t.usage.input_tokens||0)-n-s),output:t.usage.output_tokens||0,cacheRead:n,cacheWrite:s,reasoning:t.usage.output_tokens_details?.reasoning_tokens||0,totalTokens:t.usage.total_tokens||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}}}if(sn(u,o.usage),p?.applyServiceTierPricing){let e=p.resolveServiceTier?p.resolveServiceTier(t?.service_tier,p.serviceTier):t?.service_tier??p.serviceTier;p.applyServiceTierPricing(o.usage,e)}if(o.stopReason=w(t?.status),o.content.some((e)=>e.type==="toolCall")&&o.stopReason==="stop")o.stopReason="toolUse"};for await(let t of i)if(t.type==="response.created")o.responseId=t.response.id;else if(t.type==="response.output_item.added")I(t.output_index,t.item);else if(t.type==="response.reasoning_summary_text.delta"){let e=m(t.output_index,"thinking");if(!e)continue;e.block.thinking+=t.delta,a.push({type:"thinking_delta",contentIndex:e.contentIndex,delta:t.delta,partial:o})}else if(t.type==="response.reasoning_summary_part.done"){let e=m(t.output_index,"thinking");if(!e)continue;e.block.thinking+=`
2
+ import{Yr}from"./chunk-ycw3rwhx.js";import{xs}from"./chunk-r7e2fmmx.js";import{qe,sc,ac,uo,Vi,fo}from"./chunk-3g5pyw2e.js";import{cn}from"./chunk-05tnmf8h.js";function v(i,o){let a={v:1,id:i};if(o)a.phase=o;return JSON.stringify(a)}function C(i){if(!i)return;if(i.startsWith("{"))try{let o=JSON.parse(i);if(o.v===1&&typeof o.id==="string"){if(o.phase==="commentary"||o.phase==="final_answer")return{id:o.id,phase:o.phase};return{id:o.id}}}catch{}return{id:i}}function J(i,o){let a=o.filter((l)=>l.type==="text").map((l)=>l.text).join(`
3
+ `),u=o.filter((l)=>l.type==="image"),p=a.length>0;if(u.length===0||!i.input.includes("image"))return qe(p?a:u.length>0?"(see attached image)":"(no tool output)");let f=[];if(p)f.push({type:"input_text",text:qe(a)});for(let l of u)f.push({type:"input_image",detail:"auto",image_url:`data:${l.mimeType};base64,${l.data}`});return f}function Ws(i,o,a,u){let p=[],f=new Set,l=(r)=>{let c=r.replace(/[^a-zA-Z0-9_-]/g,"_");return(c.length>64?c.slice(0,64):c).replace(/_+$/,"")},y=(r)=>{let c=`fc_${xs(r)}`;return c.length>64?c.slice(0,64):c},m=(r,c,t)=>{if(!a.has(i.provider))return l(r);if(!r.includes("|"))return l(r);let[e,n]=r.split("|"),s=l(e),g=t.provider!==i.provider||t.api!==i.api?y(n):l(n);if(!g.startsWith("fc_"))g=l(`fc_${g}`);return`${s}|${g}`},h=fo(o.messages,i,m);if((u?.includeSystemPrompt??!0)&&o.systemPrompt){let r=i.compat,c=i.reasoning&&r?.supportsDeveloperRole!==!1?"developer":"system";p.push({role:c,content:qe(o.systemPrompt)})}let x=0;for(let r of h){if(r.role==="user")if(typeof r.content==="string")p.push({role:"user",content:[{type:"input_text",text:qe(r.content)}]});else{let c=r.content.map((t)=>{if(t.type==="text")return{type:"input_text",text:qe(t.text)};return{type:"input_image",detail:"auto",image_url:`data:${t.mimeType};base64,${t.data}`}});if(c.length===0)continue;p.push({role:"user",content:c})}else if(r.role==="assistant"){let c=[],t=r,e=t.model!==i.id&&t.provider===i.provider&&t.api===i.api,n=0;for(let s of r.content)if(s.type==="thinking"){if(s.thinkingSignature){let d=JSON.parse(s.thinkingSignature);c.push(d)}}else if(s.type==="text"){let d=s,g=C(d.textSignature),b=n===0?`msg_pi_${x}`:`msg_pi_${x}_${n}`;n++;let _=g?.id;if(!_)_=b;else if(_.length>64)_=`msg_${xs(_)}`;c.push({type:"message",role:"assistant",content:[{type:"output_text",text:qe(d.text),annotations:[]}],status:"completed",id:_,phase:g?.phase})}else if(s.type==="toolCall"){let d=s,[g,b]=d.id.split("|"),_=u?.grammarToolInputProperties?.get(d.name),k=b;if(e&&k?.startsWith("fc_")||_===void 0&&!k?.startsWith("fc_"))k=void 0;if(_!==void 0)c.push({type:"custom_tool_call",id:k,call_id:g,name:d.name,input:qe(sc(d.name,d.arguments,_))});else c.push({type:"function_call",id:k,call_id:g,name:d.name,arguments:JSON.stringify(d.arguments)})}if(c.length===0)continue;p.push(...c)}else if(r.role==="toolResult"){let[c]=r.toolCallId.split("|"),t=J(i,r.content);if(u?.grammarToolInputProperties?.has(r.toolName))p.push({type:"custom_tool_call_output",call_id:c,output:t});else p.push({type:"function_call_output",call_id:c,output:t});let e=[];for(let n of r.addedToolNames??[]){let s=u?.deferredTools?.get(n);if(!s||f.has(n))continue;f.add(n),e.push(s)}if(e.length>0){let n=e.map((d)=>d.name),s=`pi_tool_load_${xs(`${r.toolCallId}:${n.join(",")}`)}`;p.push({type:"tool_search_call",call_id:s,execution:"client",status:"completed",arguments:{query:n.join(" "),limit:n.length}}),p.push({type:"tool_search_output",call_id:s,execution:"client",status:"completed",tools:Ys(e,{...u?.toolOptions,deferLoading:!0})})}}x++}return p}function Ys(i,o){let a=o?.strict===void 0?!1:o.strict,u=o?.supportsStrictMode??!0,p=o?.supportsOpenAIGrammarTools??!1;return i.map((f)=>{let l=Vi(f,p);if(l)return{type:"custom",name:f.name,description:f.description,format:{type:"grammar",syntax:l.format,definition:l.definition},...o?.deferLoading?{defer_loading:!0}:{}};let y=uo(f,u),m={type:"function",name:f.name,description:f.description,parameters:f.parameters,...o?.deferLoading?{defer_loading:!0}:{}};if(u)m.strict=y??a;return m})}function T(i){let o=i.customInput?.property;if(o===void 0)return"";let a=i.arguments[o];return typeof a==="string"?a:""}function S(i,o,a){let u=i.customInput;if(!u)return;let p=ac(u.jsonBuffer,u.property,o,a);return i.arguments={[u.property]:o},p}async function Js(i,o,a,u,p){let f=!1,l=new Map,y=new Map,m=(t,e)=>{let n=l.get(t);return n?.type===e?n:void 0},h=(t,e)=>{if(e===void 0)return;a.push({type:"toolcall_delta",contentIndex:t.contentIndex,delta:e,partial:o})},I=(t,e)=>{if(e.type==="reasoning"){let n={type:"thinking",thinking:""};o.content.push(n);let s={type:"thinking",block:n,contentIndex:o.content.length-1};return l.set(t,s),a.push({type:"thinking_start",contentIndex:s.contentIndex,partial:o}),s}if(e.type==="message"){let n={type:"text",text:""};o.content.push(n);let s={type:"text",block:n,contentIndex:o.content.length-1};return l.set(t,s),a.push({type:"text_start",contentIndex:s.contentIndex,partial:o}),s}if(e.type==="function_call"){let n={type:"toolCall",id:`${e.call_id}|${e.id}`,name:e.name,arguments:{},partialJson:e.arguments||""};o.content.push(n);let s={type:"toolCall",block:n,contentIndex:o.content.length-1};return l.set(t,s),a.push({type:"toolcall_start",contentIndex:s.contentIndex,partial:o}),s}if(e.type==="custom_tool_call"){let n=p?.grammarToolInputProperties?.get(e.name)??"input",s=e.input||"",d={type:"toolCall",id:`${e.call_id}|${e.id}`,name:e.name,arguments:{[n]:s},customInput:{property:n,jsonBuffer:{input:"",started:!1,closed:!1}}};o.content.push(d);let g={type:"toolCall",block:d,contentIndex:o.content.length-1};return l.set(t,g),a.push({type:"toolcall_start",contentIndex:g.contentIndex,partial:o}),g}return},x=(t,e)=>l.get(t)??I(t,e),r=(t)=>{for(let e of t){if(e.type!=="reasoning"||!e.encrypted_content)continue;let n=y.get(e.id);if(!n?.thinkingSignature)continue;let s=JSON.parse(n.thinkingSignature);if(s.encrypted_content)continue;n.thinkingSignature=JSON.stringify({...s,encrypted_content:e.encrypted_content})}},c=(t)=>{if(f=!0,r(t.output??[]),t?.id)o.responseId=t.id;if(t?.usage){let e=t.usage.input_tokens_details,n=e?.cached_tokens||0,s=e?.cache_write_tokens||0;o.usage={input:Math.max(0,(t.usage.input_tokens||0)-n-s),output:t.usage.output_tokens||0,cacheRead:n,cacheWrite:s,reasoning:t.usage.output_tokens_details?.reasoning_tokens||0,totalTokens:t.usage.total_tokens||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}}}if(cn(u,o.usage),p?.applyServiceTierPricing){let e=p.resolveServiceTier?p.resolveServiceTier(t?.service_tier,p.serviceTier):t?.service_tier??p.serviceTier;p.applyServiceTierPricing(o.usage,e)}if(o.stopReason=w(t?.status),o.content.some((e)=>e.type==="toolCall")&&o.stopReason==="stop")o.stopReason="toolUse"};for await(let t of i)if(t.type==="response.created")o.responseId=t.response.id;else if(t.type==="response.output_item.added")I(t.output_index,t.item);else if(t.type==="response.reasoning_summary_text.delta"){let e=m(t.output_index,"thinking");if(!e)continue;e.block.thinking+=t.delta,a.push({type:"thinking_delta",contentIndex:e.contentIndex,delta:t.delta,partial:o})}else if(t.type==="response.reasoning_summary_part.done"){let e=m(t.output_index,"thinking");if(!e)continue;e.block.thinking+=`
4
4
 
5
5
  `,a.push({type:"thinking_delta",contentIndex:e.contentIndex,delta:`
6
6
 
7
- `,partial:o})}else if(t.type==="response.reasoning_text.delta"){let e=m(t.output_index,"thinking");if(!e)continue;e.block.thinking+=t.delta,a.push({type:"thinking_delta",contentIndex:e.contentIndex,delta:t.delta,partial:o})}else if(t.type==="response.output_text.delta"){let e=m(t.output_index,"text");if(!e)continue;e.block.text+=t.delta,a.push({type:"text_delta",contentIndex:e.contentIndex,delta:t.delta,partial:o})}else if(t.type==="response.refusal.delta"){let e=m(t.output_index,"text");if(!e)continue;e.block.text+=t.delta,a.push({type:"text_delta",contentIndex:e.contentIndex,delta:t.delta,partial:o})}else if(t.type==="response.function_call_arguments.delta"){let e=m(t.output_index,"toolCall");if(!e||e.block.partialJson===void 0)continue;e.block.partialJson+=t.delta,e.block.arguments=Wr(e.block.partialJson),h(e,t.delta)}else if(t.type==="response.function_call_arguments.done"){let e=m(t.output_index,"toolCall");if(!e||e.block.partialJson===void 0)continue;let n=e.block.partialJson;if(e.block.partialJson=t.arguments,e.block.arguments=Wr(e.block.partialJson),t.arguments.startsWith(n)){let s=t.arguments.slice(n.length);if(s.length>0)h(e,s)}}else if(t.type==="response.custom_tool_call_input.delta"){let e=m(t.output_index,"toolCall");if(!e||!e.block.customInput)continue;h(e,S(e.block,T(e.block)+t.delta,!1))}else if(t.type==="response.custom_tool_call_input.done"){let e=m(t.output_index,"toolCall");if(!e||!e.block.customInput)continue;h(e,S(e.block,t.input,!0))}else if(t.type==="response.output_item.done"){let e=t.item,n=x(t.output_index,e);if(e.type==="reasoning"&&n?.type==="thinking"){let s=e.summary?.map((g)=>g.text).join(`
7
+ `,partial:o})}else if(t.type==="response.reasoning_text.delta"){let e=m(t.output_index,"thinking");if(!e)continue;e.block.thinking+=t.delta,a.push({type:"thinking_delta",contentIndex:e.contentIndex,delta:t.delta,partial:o})}else if(t.type==="response.output_text.delta"){let e=m(t.output_index,"text");if(!e)continue;e.block.text+=t.delta,a.push({type:"text_delta",contentIndex:e.contentIndex,delta:t.delta,partial:o})}else if(t.type==="response.refusal.delta"){let e=m(t.output_index,"text");if(!e)continue;e.block.text+=t.delta,a.push({type:"text_delta",contentIndex:e.contentIndex,delta:t.delta,partial:o})}else if(t.type==="response.function_call_arguments.delta"){let e=m(t.output_index,"toolCall");if(!e||e.block.partialJson===void 0)continue;e.block.partialJson+=t.delta,e.block.arguments=Yr(e.block.partialJson),h(e,t.delta)}else if(t.type==="response.function_call_arguments.done"){let e=m(t.output_index,"toolCall");if(!e||e.block.partialJson===void 0)continue;let n=e.block.partialJson;if(e.block.partialJson=t.arguments,e.block.arguments=Yr(e.block.partialJson),t.arguments.startsWith(n)){let s=t.arguments.slice(n.length);if(s.length>0)h(e,s)}}else if(t.type==="response.custom_tool_call_input.delta"){let e=m(t.output_index,"toolCall");if(!e||!e.block.customInput)continue;h(e,S(e.block,T(e.block)+t.delta,!1))}else if(t.type==="response.custom_tool_call_input.done"){let e=m(t.output_index,"toolCall");if(!e||!e.block.customInput)continue;h(e,S(e.block,t.input,!0))}else if(t.type==="response.output_item.done"){let e=t.item,n=x(t.output_index,e);if(e.type==="reasoning"&&n?.type==="thinking"){let s=e.summary?.map((g)=>g.text).join(`
8
8
 
9
9
  `)||"",d=e.content?.map((g)=>g.text).join(`
10
10
 
11
- `)||"";n.block.thinking=s||d||n.block.thinking,n.block.thinkingSignature=JSON.stringify(e),y.set(e.id,n.block),a.push({type:"thinking_end",contentIndex:n.contentIndex,content:n.block.thinking,partial:o}),l.delete(t.output_index)}else if(e.type==="message"&&n?.type==="text")n.block.text=e.content?.map((s)=>s.type==="output_text"?s.text:s.refusal).join("")||"",n.block.textSignature=v(e.id,e.phase??void 0),a.push({type:"text_end",contentIndex:n.contentIndex,content:n.block.text,partial:o}),l.delete(t.output_index);else if(e.type==="function_call"&&n?.type==="toolCall"&&n.block.partialJson!==void 0)n.block.arguments=Wr(e.arguments||n.block.partialJson||"{}"),delete n.block.partialJson,a.push({type:"toolcall_end",contentIndex:n.contentIndex,toolCall:n.block,partial:o}),l.delete(t.output_index);else if(e.type==="custom_tool_call"&&n?.type==="toolCall"&&n.block.customInput)h(n,S(n.block,e.input??T(n.block),!0)),delete n.block.customInput,a.push({type:"toolcall_end",contentIndex:n.contentIndex,toolCall:n.block,partial:o}),l.delete(t.output_index)}else if(t.type==="response.completed"||t.type==="response.incomplete")c(t.response);else if(t.type==="error")throw Error(`Error Code ${t.code}: ${t.message}`||"Unknown error");else if(t.type==="response.failed"){f=!0;let e=t.response?.error,n=t.response?.incomplete_details,s=e?`${e.code||"unknown"}: ${e.message||"no message"}`:n?.reason?`incomplete: ${n.reason}`:"Unknown error (no error details in response)";throw Error(s)}if(!f)throw Error("OpenAI Responses stream ended before a terminal response event")}function w(i){if(!i)return"stop";switch(i){case"completed":return"stop";case"incomplete":return"length";case"failed":case"cancelled":return"error";case"in_progress":case"queued":return"stop";default:throw Error(`Unhandled stop reason: ${i}`)}}
12
- export{Vs,Ks,Ws};
11
+ `)||"";n.block.thinking=s||d||n.block.thinking,n.block.thinkingSignature=JSON.stringify(e),y.set(e.id,n.block),a.push({type:"thinking_end",contentIndex:n.contentIndex,content:n.block.thinking,partial:o}),l.delete(t.output_index)}else if(e.type==="message"&&n?.type==="text")n.block.text=e.content?.map((s)=>s.type==="output_text"?s.text:s.refusal).join("")||"",n.block.textSignature=v(e.id,e.phase??void 0),a.push({type:"text_end",contentIndex:n.contentIndex,content:n.block.text,partial:o}),l.delete(t.output_index);else if(e.type==="function_call"&&n?.type==="toolCall"&&n.block.partialJson!==void 0)n.block.arguments=Yr(e.arguments||n.block.partialJson||"{}"),delete n.block.partialJson,a.push({type:"toolcall_end",contentIndex:n.contentIndex,toolCall:n.block,partial:o}),l.delete(t.output_index);else if(e.type==="custom_tool_call"&&n?.type==="toolCall"&&n.block.customInput)h(n,S(n.block,e.input??T(n.block),!0)),delete n.block.customInput,a.push({type:"toolcall_end",contentIndex:n.contentIndex,toolCall:n.block,partial:o}),l.delete(t.output_index)}else if(t.type==="response.completed"||t.type==="response.incomplete")c(t.response);else if(t.type==="error")throw Error(`Error Code ${t.code}: ${t.message}`||"Unknown error");else if(t.type==="response.failed"){f=!0;let e=t.response?.error,n=t.response?.incomplete_details,s=e?`${e.code||"unknown"}: ${e.message||"no message"}`:n?.reason?`incomplete: ${n.reason}`:"Unknown error (no error details in response)";throw Error(s)}if(!f)throw Error("OpenAI Responses stream ended before a terminal response event")}function w(i){if(!i)return"stop";switch(i){case"completed":return"stop";case"incomplete":return"length";case"failed":case"cancelled":return"error";case"in_progress":case"queued":return"stop";default:throw Error(`Unhandled stop reason: ${i}`)}}
12
+ export{Ws,Ys,Js};
@@ -0,0 +1,2 @@
1
+ import{h,b,u,S,L,t,o,K,B,A,F,Gr,ve,bt,vt,Os,fe,E,he,ge,Ae,W,Ne,Xa,Jm,it,Fc,Lc,ch,ob,sb,Sh,Eh,Ch,Yf,Jf,Xf,ep,yl,Jh,np,op,lg,cg,yp,kg,Qg,Op,J1,Bp,Up,Je,Xe,et,tt,rt,nt,ot,st,ue,ie,me,Ge,le,Tt,H,Pt,Nt,k,Kr,_n,AA}from"./chunk-q6jsw0rr.js";import{tu,ru,nu,ou,su}from"./chunk-6rjkbwz6.js";import{Zo}from"./chunk-5rk7dyx9.js";import{lo}from"./chunk-q1d7x1cc.js";S();var Se=[];function Bl({teamId:r,projectId:D,assetId:m,folders:a,files:l,totalFolders:Me,totalFiles:Re,totalFoldersSize:ze,totalFilesSize:Ue,selectedItem:J,selectedIds:w,onItemSelect:X,onItemDoubleClick:Y,onSaveField:Be,onClearSelection:qe,fetchNextFoldersPage:Z,hasNextFoldersPage:ee,isFetchingNextFoldersPage:y,fetchNextFilesPage:te,hasNextFilesPage:oe,isFetchingNextFilesPage:x,isRecentlyDeleted:C=!1,isRecents:N=!1,isLoading:se=!1,isShareView:q=!1,isPublic:re=!1,shareId:$e,allowDownload:ne=!0}){let d=K(),{canEdit:_,canAdmin:Oe}=Pt(D),ae=b(null),de=b(null),[O,We]=u(!0),[j,je]=u(!0),[Qe,I]=u(!1),[T,ce]=u(""),[He,Q]=u(!1),pe=Me??a.length,we=Re??l.length,De=ze??(a.length>0?a.reduce((e,s)=>e+(s.sizeByte||0),0):-1),ye=Ue??(l.length>0?l.reduce((e,s)=>e+(s.sizeByte||0),0):-1),Ke=De>-1,Le=ye>-1,be=(e,s)=>{if(s)return e===1?Jf({count:e}):Yf({count:e});else return e===1?ep({count:e}):Xf({count:e})},{editingItemId:xe,setEditingItemId:ke,handleAction:Ce,onRenameSubmit:_e,isDeleteDialogOpen:Pe,setIsDeleteDialogOpen:Ve,confirmDelete:Ye,isDownloadDialogOpen:Ze,setIsDownloadDialogOpen:P,isLoadingLinks:M,resolvedFiles:Fe,startDownload:at}=su({teamId:r,projectId:D,assetId:m,folders:a,files:l,selectedIds:w,isPublic:re,shareId:$e}),{ref:lt,inView:Ie}=Nt();h(()=>{if(Ie){if(ee&&!y)Z();else if(oe&&!x)te()}},[Ie,ee,y,oe,x,Z,te]);let dt=_n((e)=>e.startTask),ct=A.api.teams[":teamId"].upload.tasks.$post,{mutate:mt}=B({mutationFn:async(e)=>{let s=await ct(e);if(!s.ok)throw Error("Failed to create upload task");return await s.json()},onMutate:()=>({files:[...Se]}),onSuccess:async(e,s,n)=>{let p=n?.files||[],f=p.map((i)=>{let v=e.createdAssets?.find((c)=>c.tempId===i.id),z=e.presignedUrls?.find((c)=>c.id===i.id);return{fileId:v?.assetId||z?.fileId||i.id,name:i.file.name,size:i.file.size}}).filter((i)=>!!i.fileId),g=p.filter((i)=>!i.file.name.startsWith(".")),R=g.length===1?g[0].file.name:`${g.length} Items`;if(e.taskId)dt(e.taskId,R,f);d.invalidateQueries({queryKey:["search",r,m]}),d.invalidateQueries({queryKey:["teams",r,"upload","tasks"]}),await ru({files:p,taskId:e.taskId,teamId:r,storageBackend:e.storageBackend||"local",createdAssets:e.createdAssets,presignedUrls:e.presignedUrls,onFileFinished:async()=>{await d.invalidateQueries({queryKey:["search",r,m]})}}),d.invalidateQueries({queryKey:["search",r,m]}),d.invalidateQueries({queryKey:["teams",r,"upload","tasks"]})}}),Te=(e)=>{if(!e||e.length===0)return;let s=[],n=[],p=new Map;for(let f of e){let g=(f.webkitRelativePath||f.name).split("/");if(g.some((U)=>U.startsWith(".")))continue;let R=g.pop(),i=n,v="";for(let U of g)if(v=`${v}/${U}`,!p.has(v)){let G=[],wt={name:U,type:"folder",id:Zo(),children:G,size:0};i.push(wt),p.set(v,G),i=G}else i=p.get(v);let z={file:f,id:Zo()};s.push(z);let c=f.type;if(R.toLowerCase().endsWith(".wma")&&c?.startsWith("video/"))c=c.replace(/^video\//,"audio/");i.push({name:R,size:f.size,type:"file",id:z.id,children:[],mediaType:c})}Se=s,mt({param:{teamId:r},json:{parentId:m,files:n}})},pt=A.api.folders.$post,{mutate:ut,isPending:Ee}=B({mutationFn:async(e)=>{let s=await pt({json:{name:e,parentId:m}});if(!s.ok)throw Error("Failed to create folder");return await s.json()},onSuccess:()=>{k.success(yl()),I(!1),ce(""),d.invalidateQueries({queryKey:["search",r,m]}),d.invalidateQueries({queryKey:["folders"]})},onError:(e)=>{k.error(`Error: ${e.message}`)}}),{mutate:ft,isPending:V}=B({mutationFn:async()=>{let e=await A.api.projects[":projectId"]["empty-trash"].$post({param:{projectId:D}});if(!e.ok)throw Error("Failed to empty trash");return await e.json()},onSuccess:()=>{k.success(J1()),d.invalidateQueries({queryKey:["projects",D,"recently-deleted"]}),qe(),Q(!1)},onError:(e)=>{k.error(`Error: ${e.message}`)}}),gt=(e)=>{if(e.preventDefault(),!T.trim())return;ut(T.trim())},ht=!se&&a.length===0&&l.length===0&&!y&&!x;return o("div",{className:"flex-1 flex flex-col min-h-0 bg-background overflow-hidden relative",children:[_&&o(L,{children:[t("input",{type:"file",ref:ae,multiple:!0,className:"hidden",onChange:(e)=>{if(e.target.files)Te(e.target.files)}}),t("input",{type:"file",ref:de,multiple:!0,webkitdirectory:"true",className:"hidden",onChange:(e)=>{if(e.target.files)Te(e.target.files)}})]}),C&&o("div",{className:"flex items-center justify-between px-4 py-2.5 bg-muted/20 border-b border-border text-sm shrink-0",children:[o("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t(Gr,{className:"h-4 w-4 text-amber-500 shrink-0"}),t("span",{className:"text-xs",children:yp()})]}),Oe&&t(E,{variant:"destructive",size:"sm",disabled:V||a.length===0&&l.length===0,onClick:()=>Q(!0),className:"h-7 px-2.5 text-xs font-medium bg-destructive/10 text-destructive border border-destructive/20 hover:bg-destructive hover:text-destructive-foreground",children:"Delete"})]}),o("div",{className:"flex-1 overflow-y-auto min-h-0 p-3 pb-24",children:[se&&a.length===0&&l.length===0?t(AA,{}):o("div",{className:"max-w-lg mx-auto w-full",children:[pe>0&&o("div",{className:"mb-4",children:[o("button",{onClick:()=>We(!O),className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground mb-3 font-medium select-none cursor-pointer",children:[O?t(ve,{className:"h-4 w-4"}):t(bt,{className:"h-4 w-4"}),o("span",{children:[be(pe,!1),Ke?` • ${Kr(De)}`:""]})]}),O&&t("div",{className:"grid grid-cols-1 gap-4 w-full",children:a.map((e)=>t(ou,{item:e,isSelected:J?.id===e.id,isChecked:w.has(e.id),isEditing:xe===e.id,onSelect:X,onDoubleClick:Y,onContextMenu:()=>{},onDragStart:()=>{},onDrop:()=>{},onRename:(s)=>_e(e,s),onFinishEditing:()=>ke(null),onAction:(s,n)=>Ce(s,n),isRecentlyDeleted:C,isRecents:N,selectedCount:w.size,canEdit:_,isShareView:q,allowDownload:ne},e.id))})]}),we>0&&o("div",{className:"mb-4",children:[o("button",{onClick:()=>je(!j),className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground mb-3 font-medium select-none cursor-pointer",children:[j?t(ve,{className:"h-4 w-4"}):t(bt,{className:"h-4 w-4"}),o("span",{children:[be(we,!0),Le?` • ${Kr(ye)}`:""]})]}),j&&t("div",{className:"grid grid-cols-1 gap-4 w-full",children:l.map((e)=>t(nu,{teamId:r,item:e,isSelected:J?.id===e.id,isChecked:w.has(e.id),isEditing:xe===e.id,onSelect:X,onDoubleClick:Y,onContextMenu:()=>{},onDragStart:()=>{},onDrop:()=>{},onRename:(s)=>_e(e,s),onFinishEditing:()=>ke(null),onSaveField:(s,n)=>Be?.(e.id,s,n),fields:[],onAction:(s,n)=>Ce(s,n),isRecentlyDeleted:C,isRecents:N,selectedCount:w.size,canEdit:_,isShareView:q,allowDownload:ne},e.id))})]})]}),ht&&t("div",{className:"flex flex-col items-center justify-center h-64 text-sm text-muted-foreground p-6 text-center",children:N?o("div",{className:"flex flex-col items-center gap-2",children:[t(Os,{className:"h-10 w-10 text-muted-foreground/40 mb-1"}),t("p",{className:"font-medium text-foreground",children:np()}),t("p",{className:"text-xs text-muted-foreground",children:op()})]}):t("span",{children:Op()})}),t("div",{ref:lt,className:"py-4 flex justify-center items-center min-h-6",children:(y||x)&&t(F,{className:"h-5 w-5 animate-spin text-muted-foreground"})})]}),_&&!C&&!N&&!q&&!re&&t("div",{className:"fixed bottom-6 right-6 z-30",children:o(he,{modal:!1,children:[t(ge,{asChild:!0,children:t(E,{size:"icon",className:"h-14 w-14 rounded-full bg-primary text-primary-foreground shadow-lg shadow-primary/25 hover:bg-primary/90 flex items-center justify-center","aria-label":"Actions",children:t(fe,{className:"h-6 w-6"})})}),o(Ae,{align:"end",side:"top",className:"w-48 mb-2",children:[o(W,{onClick:()=>ae.current?.click(),className:"flex items-center gap-2.5 py-2 cursor-pointer",children:[t(lo,{className:"h-4 w-4"}),t("span",{children:Bp()})]}),o(W,{onClick:()=>de.current?.click(),className:"flex items-center gap-2.5 py-2 cursor-pointer",children:[t(lo,{className:"h-4 w-4"}),t("span",{children:Up()})]}),o(W,{onClick:()=>I(!0),className:"flex items-center gap-2.5 py-2 cursor-pointer",children:[t(tu,{className:"h-4 w-4"}),t("span",{children:yl()})]})]})]})}),t(ue,{open:Qe,onOpenChange:I,children:t(ie,{className:"sm:max-w-md",children:o("form",{onSubmit:gt,children:[o(me,{children:[t(le,{children:yl()}),t(Tt,{children:Eh()})]}),t("div",{className:"py-4",children:t(H,{autoFocus:!0,placeholder:Eh(),value:T,onChange:(e)=>ce(e.target.value)})}),o(Ge,{children:[t(E,{type:"button",variant:"outline",onClick:()=>I(!1),children:Ne()}),o(E,{type:"submit",disabled:!T.trim()||Ee,children:[Ee?t(F,{className:"h-4 w-4 animate-spin mr-2"}):null,Xa()]})]})]})})}),t(Je,{open:Pe,onOpenChange:Ve,children:o(Xe,{children:[o(et,{children:[t(rt,{children:Lc()}),t(nt,{children:Fc()})]}),o(tt,{children:[t(st,{children:Ne()}),t(ot,{onClick:()=>Ye(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:it()})]})]})}),t(Je,{open:He,onOpenChange:Q,children:o(Xe,{children:[o(et,{children:[t(rt,{children:sb()}),t(nt,{children:ob()})]}),o(tt,{children:[t(st,{children:Ne()}),t(ot,{onClick:()=>ft(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",disabled:V,children:V?"Deleting...":it()})]})]})}),t(ue,{open:Ze,onOpenChange:P,children:o(ie,{className:"sm:max-w-md",children:[o(me,{children:[t(le,{children:M?lg():Jm()}),t(Tt,{children:M?kg():Sh()})]}),M?o("div",{className:"space-y-4 py-6 flex flex-col items-center justify-center",children:[t(F,{className:"h-8 w-8 animate-spin text-primary"}),t("span",{className:"text-sm font-medium text-muted-foreground mt-2",children:cg()})]}):o("div",{className:"space-y-4 py-2",children:[t("div",{className:"text-sm text-muted-foreground",children:ch({count:Fe.length})}),o("div",{className:"flex items-start gap-3 p-3 text-sm rounded-lg bg-amber-50 dark:bg-amber-950/30 text-amber-800 dark:text-amber-300 border border-amber-200 dark:border-amber-900/30",children:[t(Gr,{className:"h-5 w-5 shrink-0 mt-0.5"}),o("div",{children:[t("p",{className:"font-semibold",children:Jh()}),t("p",{className:"mt-0.5 text-xs text-amber-700/90 dark:text-amber-400/90",children:Ch()})]})]})]}),t(Ge,{children:!M?o(L,{children:[t(E,{variant:"outline",onClick:()=>P(!1),children:Ne()}),o(E,{onClick:at,className:"gap-2",disabled:Fe.length===0,children:[t(vt,{className:"h-4 w-4"}),Qg()]})]}):t(E,{variant:"outline",onClick:()=>P(!1),children:Ne()})})]})})]})}
2
+ export{Bl};