@shumai-one/shumai 0.3.10 → 0.3.11

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 (180) hide show
  1. package/bin/{chunk-94yxj3yy.js → chunk-02b97gsf.js} +2 -2
  2. package/bin/chunk-0ash207y.js +2 -0
  3. package/bin/{chunk-p31qe5mc.js → chunk-0g0gt4bj.js} +1 -1
  4. package/bin/chunk-0j3yb84c.js +1 -0
  5. package/bin/{chunk-e26p9vrv.js → chunk-0vqefpcw.js} +1 -1
  6. package/bin/chunk-0wgqr4jg.js +2 -0
  7. package/bin/{chunk-y7b5gy17.js → chunk-0xqf53hc.js} +1 -1
  8. package/bin/{chunk-62ag2nfa.js → chunk-12ps84z8.js} +1 -1
  9. package/bin/{chunk-42f9r1sg.js → chunk-12r8a5ev.js} +2 -2
  10. package/bin/{chunk-pv4scagf.js → chunk-1dzby9bb.js} +1 -1
  11. package/bin/chunk-1tby7q3f.js +1 -0
  12. package/bin/{chunk-y8ffp5zj.js → chunk-2s97ngr8.js} +2 -2
  13. package/bin/{chunk-g5qfxnz1.js → chunk-31f07jzm.js} +2 -2
  14. package/bin/{chunk-d4ktgq49.js → chunk-393g7z2g.js} +1 -1
  15. package/bin/{chunk-m3ghgqc2.js → chunk-3j47y8ah.js} +1 -1
  16. package/bin/{chunk-rakz3pe6.js → chunk-3qva5sqr.js} +1 -1
  17. package/bin/{chunk-kmhkhcy6.js → chunk-3ztat2q9.js} +2 -2
  18. package/bin/chunk-48yphy68.js +73 -0
  19. package/bin/{chunk-qk9npww4.js → chunk-4pj17byj.js} +2 -2
  20. package/bin/chunk-4t2qcxp5.js +1 -0
  21. package/bin/{chunk-t16qt2ka.js → chunk-4yke5y3z.js} +3 -3
  22. package/bin/{chunk-7xwmj4ew.js → chunk-50vzkdc8.js} +1 -1
  23. package/bin/{chunk-42et2rqa.js → chunk-5dfy6173.js} +2 -2
  24. package/bin/{chunk-enq1hf8g.js → chunk-5nk7y4ec.js} +2 -2
  25. package/bin/chunk-68bfd8x7.js +3 -0
  26. package/bin/{chunk-wwjqqqr4.js → chunk-69at8jm8.js} +1 -1
  27. package/bin/{chunk-emyax05s.js → chunk-6edh2e59.js} +1 -1
  28. package/bin/{chunk-k2w676wz.js → chunk-6qzcnkgx.js} +1 -1
  29. package/bin/{chunk-p48npmbh.js → chunk-6ts5az6h.js} +1 -1
  30. package/bin/chunk-72nj00dp.js +1 -0
  31. package/bin/{chunk-41de755j.js → chunk-77c2xm0z.js} +1 -1
  32. package/bin/{chunk-bv5mh0e0.js → chunk-7888x3vz.js} +2 -2
  33. package/bin/chunk-7anqxpyv.js +2 -0
  34. package/bin/{chunk-zdmcc6ps.js → chunk-7t31qfw5.js} +2 -2
  35. package/bin/chunk-8b11b9cj.js +2 -0
  36. package/bin/{chunk-gra1fhdp.js → chunk-8bv8qsb8.js} +2 -2
  37. package/bin/chunk-8ekjxb5q.js +2 -0
  38. package/bin/chunk-8qg6jjz4.js +2 -0
  39. package/bin/{chunk-39s0cxq1.js → chunk-8zar6cc4.js} +2 -2
  40. package/bin/chunk-9m9bn55a.js +1 -0
  41. package/bin/{chunk-7r6h3fta.js → chunk-9qytehed.js} +2 -2
  42. package/bin/{chunk-k33qdrdp.js → chunk-a5ja6d97.js} +1 -1
  43. package/bin/chunk-aq7q5e36.js +2 -0
  44. package/bin/{chunk-ag0pavv1.js → chunk-axnvvkdf.js} +2 -2
  45. package/bin/chunk-ayr3tsz3.js +2 -0
  46. package/bin/{chunk-0fpgfrv8.js → chunk-b78s1cxz.js} +2 -2
  47. package/bin/{chunk-a80aab0f.js → chunk-bthrbggg.js} +2 -2
  48. package/bin/{chunk-6529sh41.js → chunk-byjze6hm.js} +2 -2
  49. package/bin/{chunk-gtenq4kq.js → chunk-c16vvzdj.js} +1 -1
  50. package/bin/{chunk-34f4hk54.js → chunk-cmd0feyq.js} +2 -2
  51. package/bin/chunk-csh1ggtt.js +1 -0
  52. package/bin/{chunk-mnhg12fm.js → chunk-ctx1ms5t.js} +2 -2
  53. package/bin/{chunk-2sk6e4q0.js → chunk-cyjh5qsk.js} +1 -1
  54. package/bin/chunk-day0vn14.js +2 -0
  55. package/bin/{chunk-1qd83phd.js → chunk-dhhfwbns.js} +1 -1
  56. package/bin/chunk-dwkv3bx5.js +65 -0
  57. package/bin/{chunk-6w395tfy.js → chunk-dyen2t1p.js} +2 -2
  58. package/bin/chunk-e5r6rnt9.js +2 -0
  59. package/bin/{chunk-1ev668rp.js → chunk-esa954t1.js} +2 -2
  60. package/bin/{chunk-0hbqkcsd.js → chunk-f5c9g4y9.js} +1 -1
  61. package/bin/{chunk-hcaw54dj.js → chunk-f9ydhm8q.js} +2 -2
  62. package/bin/{chunk-g2bkj92r.js → chunk-fsj3kxya.js} +2 -2
  63. package/bin/{chunk-8zmk029n.js → chunk-fv14er33.js} +1 -1
  64. package/bin/chunk-ghw914d2.js +2 -0
  65. package/bin/{chunk-tsym31yb.js → chunk-gwzk0fvn.js} +2 -2
  66. package/bin/{chunk-vwz2pa54.js → chunk-gx410cm2.js} +2 -2
  67. package/bin/chunk-gx8sz5bw.js +2 -0
  68. package/bin/chunk-gydktfnx.js +2 -0
  69. package/bin/chunk-h5j1dqc0.js +1 -0
  70. package/bin/chunk-h7kyj2g2.js +2 -0
  71. package/bin/chunk-har4xctf.js +2 -0
  72. package/bin/chunk-hks5k0tm.js +7 -0
  73. package/bin/chunk-hpm4razn.js +2 -0
  74. package/bin/chunk-hv4t9h3e.js +9 -0
  75. package/bin/chunk-jsqsrcse.js +7 -0
  76. package/bin/{chunk-qphebjbv.js → chunk-k1jcdr0n.js} +1 -1
  77. package/bin/{chunk-j6dea33m.js → chunk-kbw63gr4.js} +2 -2
  78. package/bin/{chunk-ch25gq27.js → chunk-kcg7d7pk.js} +1 -1
  79. package/bin/chunk-kchbbtdm.js +2 -0
  80. package/bin/chunk-knh1stxe.js +4 -0
  81. package/bin/chunk-mkwrrdme.js +2 -0
  82. package/bin/{chunk-vgwjg37a.js → chunk-mm995mvc.js} +2 -2
  83. package/bin/{chunk-stggq92k.js → chunk-mvkqjrcd.js} +1 -1
  84. package/bin/chunk-mz9pthjh.js +2 -0
  85. package/bin/{chunk-bxexm2hd.js → chunk-n2ae527q.js} +44 -44
  86. package/bin/chunk-n3xn2ve1.js +1 -0
  87. package/bin/{chunk-z7b132c0.js → chunk-ntqn09r0.js} +2 -2
  88. package/bin/{chunk-y5ptk39s.js → chunk-nzrrvn6c.js} +2 -2
  89. package/bin/{chunk-y45tzhdn.js → chunk-ps2hw0ps.js} +1 -1
  90. package/bin/{chunk-v1ybpqrz.js → chunk-pz7ms4n2.js} +1 -1
  91. package/bin/chunk-q3fdffq5.js +1 -0
  92. package/bin/{chunk-dgvcraag.js → chunk-qh3w5w8e.js} +2 -2
  93. package/bin/chunk-qrhf20g2.js +2 -0
  94. package/bin/{chunk-02tqxzgz.js → chunk-qrnw89xg.js} +2 -2
  95. package/bin/{chunk-0qcp4v52.js → chunk-qz3kfrpr.js} +1 -1
  96. package/bin/{chunk-g6aq2cyq.js → chunk-r18tcdds.js} +1 -1
  97. package/bin/chunk-rd2n0rs6.js +1 -0
  98. package/bin/{chunk-at5ksmqs.js → chunk-res6r4tm.js} +1 -1
  99. package/bin/chunk-rr12edz4.js +2 -0
  100. package/bin/chunk-s04f76tb.js +2 -0
  101. package/bin/chunk-s0jy7grq.js +2 -0
  102. package/bin/{chunk-2mxqjx3x.js → chunk-sdjss6ja.js} +1 -1
  103. package/bin/{chunk-rjga1vn2.js → chunk-sepsqqdf.js} +2 -2
  104. package/bin/chunk-sqy50q9g.js +1 -0
  105. package/bin/chunk-sttc4axf.js +1 -0
  106. package/bin/chunk-szf2q87p.js +2 -0
  107. package/bin/{chunk-94fyesf6.js → chunk-t2z4qys8.js} +1 -1
  108. package/bin/chunk-t6pmgmg2.js +1 -0
  109. package/bin/chunk-tdp1jjv1.js +2 -0
  110. package/bin/chunk-txpqhfqw.js +1 -0
  111. package/bin/{chunk-2t2wjzme.js → chunk-ty32j999.js} +1 -1
  112. package/bin/{chunk-60xawsa6.js → chunk-v073nwjn.js} +1 -1
  113. package/bin/chunk-vrdbqapq.js +2 -0
  114. package/bin/{chunk-28axgckk.js → chunk-vvx62hp4.js} +1 -1
  115. package/bin/chunk-vwa17b2r.js +1 -0
  116. package/bin/{chunk-n3vzdzdw.js → chunk-wch8ygpt.js} +2 -2
  117. package/bin/{chunk-7m07t899.js → chunk-wdgwymdp.js} +1 -1
  118. package/bin/{chunk-fk9pd7ra.js → chunk-whm06pnc.js} +1 -1
  119. package/bin/chunk-wqwvxskj.js +1 -0
  120. package/bin/chunk-wr3q8a9n.js +1 -0
  121. package/bin/chunk-wt01m93x.js +1 -0
  122. package/bin/chunk-xfzk0mrt.js +2 -0
  123. package/bin/{chunk-mk5hqjjd.js → chunk-xsgxk1fj.js} +1 -1
  124. package/bin/{chunk-1whn0v5n.js → chunk-xsqk7ek2.js} +1 -1
  125. package/bin/chunk-y0k1f3gk.js +2 -0
  126. package/bin/chunk-y1pnq12c.js +2 -0
  127. package/bin/{chunk-69sf7kb1.js → chunk-z8crenxd.js} +1 -1
  128. package/bin/{chunk-4shqnfq1.js → chunk-zvjx64p5.js} +1 -1
  129. package/bin/shumai-app.html +1 -1
  130. package/bin/shumai-app.js +217 -197
  131. package/package.json +7 -7
  132. package/prisma/migrations/20260825080704_add_recent_file_items/migration.sql +28 -0
  133. package/prisma/schema.prisma +22 -2
  134. package/bin/chunk-09c03qdg.js +0 -2
  135. package/bin/chunk-0te5kcy3.js +0 -2
  136. package/bin/chunk-15zbprbe.js +0 -1
  137. package/bin/chunk-2sp0gkaw.js +0 -2
  138. package/bin/chunk-301pewt3.js +0 -1
  139. package/bin/chunk-33hax7fe.js +0 -66
  140. package/bin/chunk-484yr1a7.js +0 -1
  141. package/bin/chunk-63emv4q3.js +0 -1
  142. package/bin/chunk-661mcdxj.js +0 -2
  143. package/bin/chunk-6gx6gdnk.js +0 -2
  144. package/bin/chunk-7735r8d7.js +0 -1
  145. package/bin/chunk-90jcmarf.js +0 -2
  146. package/bin/chunk-9rhckjgf.js +0 -2
  147. package/bin/chunk-9ykcjdsv.js +0 -3
  148. package/bin/chunk-9yn5r2hh.js +0 -2
  149. package/bin/chunk-cc9fftnv.js +0 -2
  150. package/bin/chunk-csky7q56.js +0 -2
  151. package/bin/chunk-day61cfg.js +0 -2
  152. package/bin/chunk-f03whbny.js +0 -2
  153. package/bin/chunk-fscyvjzb.js +0 -2
  154. package/bin/chunk-gh6j1nsm.js +0 -1
  155. package/bin/chunk-h5jre78a.js +0 -2
  156. package/bin/chunk-hsemzjvr.js +0 -2
  157. package/bin/chunk-hte6gd36.js +0 -1
  158. package/bin/chunk-j99cr9mz.js +0 -2
  159. package/bin/chunk-jn805ccq.js +0 -1
  160. package/bin/chunk-kp4kn4b4.js +0 -2
  161. package/bin/chunk-m84qgdyj.js +0 -2
  162. package/bin/chunk-pbztc6kv.js +0 -1
  163. package/bin/chunk-pg55qp08.js +0 -2
  164. package/bin/chunk-q0hrd0yw.js +0 -2
  165. package/bin/chunk-qev7trtm.js +0 -2
  166. package/bin/chunk-rt8yqz51.js +0 -1
  167. package/bin/chunk-s542e1y0.js +0 -1
  168. package/bin/chunk-s6e91ky2.js +0 -2
  169. package/bin/chunk-s9s9hhet.js +0 -2
  170. package/bin/chunk-sjsn35mp.js +0 -1
  171. package/bin/chunk-tc5evq8x.js +0 -2
  172. package/bin/chunk-tjrdsmdw.js +0 -1
  173. package/bin/chunk-tkh0s7hg.js +0 -2
  174. package/bin/chunk-vbkwteh4.js +0 -1
  175. package/bin/chunk-vevscfh2.js +0 -2
  176. package/bin/chunk-vg33qt6z.js +0 -11
  177. package/bin/chunk-we3vdyhb.js +0 -1
  178. package/bin/chunk-whn6dvak.js +0 -1
  179. package/bin/chunk-xvpttxen.js +0 -7
  180. package/bin/chunk-yfgwknpa.js +0 -78
@@ -1,2 +1,2 @@
1
- import{nh as b,oh as H,th as wW}from"./chunk-y45tzhdn.js";import{Ai as y,vi as WW,wi as qW}from"./chunk-yfgwknpa.js";var c=Symbol.for("immer-nothing"),v=Symbol.for("immer-draftable"),Y=Symbol.for("immer-state");function G(W,...q){throw Error(`[Immer] minified error nr: ${W}. Full error at: https://bit.ly/3cXEKWf`)}var z=Object.getPrototypeOf;function x(W){return!!W&&!!W[Y]}function U(W){if(!W)return!1;return o(W)||Array.isArray(W)||!!W[v]||!!W.constructor?.[v]||M(W)||f(W)}var JW=Object.prototype.constructor.toString(),n=new WeakMap;function o(W){if(!W||typeof W!=="object")return!1;let q=Object.getPrototypeOf(W);if(q===null||q===Object.prototype)return!0;let w=Object.hasOwnProperty.call(q,"constructor")&&q.constructor;if(w===Object)return!0;if(typeof w!=="function")return!1;let $=n.get(w);if($===void 0)$=Function.toString.call(w),n.set(w,$);return $===JW}function C(W,q,w=!0){if(F(W)===0)(w?Reflect.ownKeys(W):Object.keys(W)).forEach((J)=>{q(J,W[J],W)});else W.forEach(($,J)=>q(J,$,W))}function F(W){let q=W[Y];return q?q.type_:Array.isArray(W)?1:M(W)?2:f(W)?3:0}function D(W,q){return F(W)===2?W.has(q):Object.prototype.hasOwnProperty.call(W,q)}function r(W,q,w){let $=F(W);if($===2)W.set(q,w);else if($===3)W.add(w);else W[q]=w}function QW(W,q){if(W===q)return W!==0||1/W===1/q;else return W!==W&&q!==q}function M(W){return W instanceof Map}function f(W){return W instanceof Set}function K(W){return W.copy_||W.base_}function P(W,q){if(M(W))return new Map(W);if(f(W))return new Set(W);if(Array.isArray(W))return Array.prototype.slice.call(W);let w=o(W);if(q===!0||q==="class_only"&&!w){let $=Object.getOwnPropertyDescriptors(W);delete $[Y];let J=Reflect.ownKeys($);for(let Q=0;Q<J.length;Q++){let X=J[Q],Z=$[X];if(Z.writable===!1)Z.writable=!0,Z.configurable=!0;if(Z.get||Z.set)$[X]={configurable:!0,writable:!0,enumerable:Z.enumerable,value:W[X]}}return Object.create(z(W),$)}else{let $=z(W);if($!==null&&w)return{...W};let J=Object.create($);return Object.assign(J,W)}}function g(W,q=!1){if(E(W)||x(W)||!U(W))return W;if(F(W)>1)Object.defineProperties(W,{set:O,add:O,clear:O,delete:O});if(Object.freeze(W),q)Object.values(W).forEach((w)=>g(w,!0));return W}function XW(){G(2)}var O={value:XW};function E(W){if(W===null||typeof W!=="object")return!0;return Object.isFrozen(W)}var ZW={};function I(W){let q=ZW[W];if(!q)G(0,W);return q}var m;function p(){return m}function YW(W,q){return{drafts_:[],parent_:W,immer_:q,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function h(W,q){if(q)I("Patches"),W.patches_=[],W.inversePatches_=[],W.patchListener_=q}function k(W){A(W),W.drafts_.forEach(GW),W.drafts_=null}function A(W){if(W===m)m=W.parent_}function i(W){return m=YW(m,W)}function GW(W){let q=W[Y];if(q.type_===0||q.type_===1)q.revoke_();else q.revoked_=!0}function u(W,q){q.unfinalizedDrafts_=q.drafts_.length;let w=q.drafts_[0];if(W!==void 0&&W!==w){if(w[Y].modified_)k(q),G(4);if(U(W)){if(W=V(q,W),!q.parent_)R(q,W)}if(q.patches_)I("Patches").generateReplacementPatches_(w[Y].base_,W,q.patches_,q.inversePatches_)}else W=V(q,w,[]);if(k(q),q.patches_)q.patchListener_(q.patches_,q.inversePatches_);return W!==c?W:void 0}function V(W,q,w){if(E(q))return q;let $=W.immer_.shouldUseStrictIteration(),J=q[Y];if(!J)return C(q,(Q,X)=>l(W,J,q,Q,X,w),$),q;if(J.scope_!==W)return q;if(!J.modified_)return R(W,J.base_,!0),J.base_;if(!J.finalized_){J.finalized_=!0,J.scope_.unfinalizedDrafts_--;let Q=J.copy_,X=Q,Z=!1;if(J.type_===3)X=new Set(Q),Q.clear(),Z=!0;if(C(X,(B,N)=>l(W,J,Q,B,N,w,Z),$),R(W,Q,!1),w&&W.patches_)I("Patches").generatePatches_(J,w,W.patches_,W.inversePatches_)}return J.copy_}function l(W,q,w,$,J,Q,X){if(J==null)return;if(typeof J!=="object"&&!X)return;let Z=E(J);if(Z&&!X)return;if(x(J)){let B=Q&&q&&q.type_!==3&&!D(q.assigned_,$)?Q.concat($):void 0,N=V(W,J,B);if(r(w,$,N),x(N))W.canAutoFreeze_=!1;else return}else if(X)w.add(J);if(U(J)&&!Z){if(!W.immer_.autoFreeze_&&W.unfinalizedDrafts_<1)return;if(q&&q.base_&&q.base_[$]===J&&Z)return;if(V(W,J),(!q||!q.scope_.parent_)&&typeof $!=="symbol"&&(M(w)?w.has($):Object.prototype.propertyIsEnumerable.call(w,$)))R(W,J)}}function R(W,q,w=!1){if(!W.parent_&&W.immer_.autoFreeze_&&W.canAutoFreeze_)g(q,w)}function HW(W,q){let w=Array.isArray(W),$={type_:w?1:0,scope_:q?q.scope_:p(),modified_:!1,finalized_:!1,assigned_:{},parent_:q,base_:W,draft_:null,copy_:null,revoke_:null,isManual_:!1},J=$,Q=d;if(w)J=[$],Q=L;let{revoke:X,proxy:Z}=Proxy.revocable(J,Q);return $.draft_=Z,$.revoke_=X,Z}var d={get(W,q){if(q===Y)return W;let w=K(W);if(!D(w,q))return BW(W,w,q);let $=w[q];if(W.finalized_||!U($))return $;if($===_(W.base_,q))return j(W),W.copy_[q]=S($,W);return $},has(W,q){return q in K(W)},ownKeys(W){return Reflect.ownKeys(K(W))},set(W,q,w){let $=s(K(W),q);if($?.set)return $.set.call(W.draft_,w),!0;if(!W.modified_){let J=_(K(W),q),Q=J?.[Y];if(Q&&Q.base_===w)return W.copy_[q]=w,W.assigned_[q]=!1,!0;if(QW(w,J)&&(w!==void 0||D(W.base_,q)))return!0;j(W),T(W)}if(W.copy_[q]===w&&(w!==void 0||(q in W.copy_))||Number.isNaN(w)&&Number.isNaN(W.copy_[q]))return!0;return W.copy_[q]=w,W.assigned_[q]=!0,!0},deleteProperty(W,q){if(_(W.base_,q)!==void 0||q in W.base_)W.assigned_[q]=!1,j(W),T(W);else delete W.assigned_[q];if(W.copy_)delete W.copy_[q];return!0},getOwnPropertyDescriptor(W,q){let w=K(W),$=Reflect.getOwnPropertyDescriptor(w,q);if(!$)return $;return{writable:!0,configurable:W.type_!==1||q!=="length",enumerable:$.enumerable,value:w[q]}},defineProperty(){G(11)},getPrototypeOf(W){return z(W.base_)},setPrototypeOf(){G(12)}},L={};C(d,(W,q)=>{L[W]=function(){return arguments[0]=arguments[0][0],q.apply(this,arguments)}});L.deleteProperty=function(W,q){return L.set.call(this,W,q,void 0)};L.set=function(W,q,w){return d.set.call(this,W[0],q,w,W[0])};function _(W,q){let w=W[Y];return(w?K(w):W)[q]}function BW(W,q,w){let $=s(q,w);return $?"value"in $?$.value:$.get?.call(W.draft_):void 0}function s(W,q){if(!(q in W))return;let w=z(W);while(w){let $=Object.getOwnPropertyDescriptor(w,q);if($)return $;w=z(w)}return}function T(W){if(!W.modified_){if(W.modified_=!0,W.parent_)T(W.parent_)}}function j(W){if(!W.copy_)W.copy_=P(W.base_,W.scope_.immer_.useStrictShallowCopy_)}var KW=class{constructor(W){if(this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(q,w,$)=>{if(typeof q==="function"&&typeof w!=="function"){let Q=w;w=q;let X=this;return function(B=Q,...N){return X.produce(B,($W)=>w.call(this,$W,...N))}}if(typeof w!=="function")G(6);if($!==void 0&&typeof $!=="function")G(7);let J;if(U(q)){let Q=i(this),X=S(q,void 0),Z=!0;try{J=w(X),Z=!1}finally{if(Z)k(Q);else A(Q)}return h(Q,$),u(J,Q)}else if(!q||typeof q!=="object"){if(J=w(q),J===void 0)J=q;if(J===c)J=void 0;if(this.autoFreeze_)g(J,!0);if($){let Q=[],X=[];I("Patches").generateReplacementPatches_(q,J,Q,X),$(Q,X)}return J}else G(1,q)},this.produceWithPatches=(q,w)=>{if(typeof q==="function")return(X,...Z)=>this.produceWithPatches(X,(B)=>q(B,...Z));let $,J;return[this.produce(q,w,(X,Z)=>{$=X,J=Z}),$,J]},typeof W?.autoFreeze==="boolean")this.setAutoFreeze(W.autoFreeze);if(typeof W?.useStrictShallowCopy==="boolean")this.setUseStrictShallowCopy(W.useStrictShallowCopy);if(typeof W?.useStrictIteration==="boolean")this.setUseStrictIteration(W.useStrictIteration)}createDraft(W){if(!U(W))G(8);if(x(W))W=UW(W);let q=i(this),w=S(W,void 0);return w[Y].isManual_=!0,A(q),w}finishDraft(W,q){let w=W&&W[Y];if(!w||!w.isManual_)G(9);let{scope_:$}=w;return h($,q),u(void 0,$)}setAutoFreeze(W){this.autoFreeze_=W}setUseStrictShallowCopy(W){this.useStrictShallowCopy_=W}setUseStrictIteration(W){this.useStrictIteration_=W}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(W,q){let w;for(w=q.length-1;w>=0;w--){let J=q[w];if(J.path.length===0&&J.op==="replace"){W=J.value;break}}if(w>-1)q=q.slice(w+1);let $=I("Patches").applyPatches_;if(x(W))return $(W,q);return this.produce(W,(J)=>$(J,q))}};function S(W,q){let w=M(W)?I("MapSet").proxyMap_(W,q):f(W)?I("MapSet").proxySet_(W,q):HW(W,q);return(q?q.scope_:p()).drafts_.push(w),w}function UW(W){if(!x(W))G(10,W);return a(W)}function a(W){if(!U(W)||E(W))return W;let q=W[Y],w,$=!0;if(q){if(!q.modified_)return q.base_;q.finalized_=!0,w=P(W,q.scope_.immer_.useStrictShallowCopy_),$=q.scope_.immer_.shouldUseStrictIteration()}else w=P(W,!0);if(C(w,(J,Q)=>{r(w,J,a(Q))},$),q)q.finalized_=!1;return w}var IW=new KW,t=IW.produce;var NW=(W)=>(q,w,$)=>{return $.setState=(J,Q,...X)=>{let Z=typeof J==="function"?t(J):J;return q(Z,Q,...X)},W($.setState,w,$)},e=NW;var RW=WW()(qW(e((W,q)=>({members:[],loading:!1,fetchMembers:async(w,$,J)=>{if(!J&&q().loadedTeamId===w&&q().loadedWithAgents===$)return;W({loading:!0});try{let Q=await y.api.teams[":teamId"].members.$get({param:{teamId:w},query:{includeAgents:$?"true":"false"}});if(!Q.ok)throw Error("failed to fetch members");let X=await Q.json();W({members:X||[],loadedTeamId:w,loadedProjectId:void 0,loadedWithAgents:$,loading:!1})}catch{W({loading:!1})}},fetchProjectMembers:async(w,$,J)=>{if(!J&&q().loadedProjectId===w&&q().loadedWithAgents===$)return;W({loading:!0});try{let Q=await y.api.projects[":projectId"].members.$get({param:{projectId:w},query:{includeAgents:$?"true":"false"}});if(!Q.ok)throw Error("failed to fetch project members");let X=await Q.json();W({members:X||[],loadedProjectId:w,loadedTeamId:void 0,loadedWithAgents:$,loading:!1})}catch{W({loading:!1})}}}))));function _W(W,q,w){let $=H(W,w?.in);if(isNaN(q))return b(w?.in||W,NaN);if(!q)return $;let J=$.getDate(),Q=b(w?.in||W,$.getTime());Q.setMonth($.getMonth()+q+1,0);let X=Q.getDate();if(J>=X)return Q;else return $.setFullYear(Q.getFullYear(),Q.getMonth(),J),$}function PW(W,q){let w=H(W,q?.in),$=w.getMonth();return w.setFullYear(w.getFullYear(),$+1,0),w.setHours(23,59,59,999),w}function TW(W,q){return H(W,q?.in).getMonth()}function dW(W,q){return H(W,q?.in).getFullYear()}function vW(W,q){let[w,$]=wW(W,q.start,q.end);return{start:w,end:$}}
2
- export{_W as xf,PW as yf,vW as zf,TW as Af,dW as Bf,RW as Cf};
1
+ import{Bh as wW,vh as b,wh as H}from"./chunk-ps2hw0ps.js";import{li as WW,mi as qW,qi as y}from"./chunk-jsqsrcse.js";var c=Symbol.for("immer-nothing"),v=Symbol.for("immer-draftable"),Y=Symbol.for("immer-state");function G(W,...q){throw Error(`[Immer] minified error nr: ${W}. Full error at: https://bit.ly/3cXEKWf`)}var z=Object.getPrototypeOf;function x(W){return!!W&&!!W[Y]}function U(W){if(!W)return!1;return o(W)||Array.isArray(W)||!!W[v]||!!W.constructor?.[v]||M(W)||f(W)}var JW=Object.prototype.constructor.toString(),n=new WeakMap;function o(W){if(!W||typeof W!=="object")return!1;let q=Object.getPrototypeOf(W);if(q===null||q===Object.prototype)return!0;let w=Object.hasOwnProperty.call(q,"constructor")&&q.constructor;if(w===Object)return!0;if(typeof w!=="function")return!1;let $=n.get(w);if($===void 0)$=Function.toString.call(w),n.set(w,$);return $===JW}function C(W,q,w=!0){if(F(W)===0)(w?Reflect.ownKeys(W):Object.keys(W)).forEach((J)=>{q(J,W[J],W)});else W.forEach(($,J)=>q(J,$,W))}function F(W){let q=W[Y];return q?q.type_:Array.isArray(W)?1:M(W)?2:f(W)?3:0}function D(W,q){return F(W)===2?W.has(q):Object.prototype.hasOwnProperty.call(W,q)}function r(W,q,w){let $=F(W);if($===2)W.set(q,w);else if($===3)W.add(w);else W[q]=w}function QW(W,q){if(W===q)return W!==0||1/W===1/q;else return W!==W&&q!==q}function M(W){return W instanceof Map}function f(W){return W instanceof Set}function K(W){return W.copy_||W.base_}function P(W,q){if(M(W))return new Map(W);if(f(W))return new Set(W);if(Array.isArray(W))return Array.prototype.slice.call(W);let w=o(W);if(q===!0||q==="class_only"&&!w){let $=Object.getOwnPropertyDescriptors(W);delete $[Y];let J=Reflect.ownKeys($);for(let Q=0;Q<J.length;Q++){let X=J[Q],Z=$[X];if(Z.writable===!1)Z.writable=!0,Z.configurable=!0;if(Z.get||Z.set)$[X]={configurable:!0,writable:!0,enumerable:Z.enumerable,value:W[X]}}return Object.create(z(W),$)}else{let $=z(W);if($!==null&&w)return{...W};let J=Object.create($);return Object.assign(J,W)}}function g(W,q=!1){if(E(W)||x(W)||!U(W))return W;if(F(W)>1)Object.defineProperties(W,{set:O,add:O,clear:O,delete:O});if(Object.freeze(W),q)Object.values(W).forEach((w)=>g(w,!0));return W}function XW(){G(2)}var O={value:XW};function E(W){if(W===null||typeof W!=="object")return!0;return Object.isFrozen(W)}var ZW={};function I(W){let q=ZW[W];if(!q)G(0,W);return q}var m;function p(){return m}function YW(W,q){return{drafts_:[],parent_:W,immer_:q,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function h(W,q){if(q)I("Patches"),W.patches_=[],W.inversePatches_=[],W.patchListener_=q}function k(W){A(W),W.drafts_.forEach(GW),W.drafts_=null}function A(W){if(W===m)m=W.parent_}function i(W){return m=YW(m,W)}function GW(W){let q=W[Y];if(q.type_===0||q.type_===1)q.revoke_();else q.revoked_=!0}function u(W,q){q.unfinalizedDrafts_=q.drafts_.length;let w=q.drafts_[0];if(W!==void 0&&W!==w){if(w[Y].modified_)k(q),G(4);if(U(W)){if(W=V(q,W),!q.parent_)R(q,W)}if(q.patches_)I("Patches").generateReplacementPatches_(w[Y].base_,W,q.patches_,q.inversePatches_)}else W=V(q,w,[]);if(k(q),q.patches_)q.patchListener_(q.patches_,q.inversePatches_);return W!==c?W:void 0}function V(W,q,w){if(E(q))return q;let $=W.immer_.shouldUseStrictIteration(),J=q[Y];if(!J)return C(q,(Q,X)=>l(W,J,q,Q,X,w),$),q;if(J.scope_!==W)return q;if(!J.modified_)return R(W,J.base_,!0),J.base_;if(!J.finalized_){J.finalized_=!0,J.scope_.unfinalizedDrafts_--;let Q=J.copy_,X=Q,Z=!1;if(J.type_===3)X=new Set(Q),Q.clear(),Z=!0;if(C(X,(B,N)=>l(W,J,Q,B,N,w,Z),$),R(W,Q,!1),w&&W.patches_)I("Patches").generatePatches_(J,w,W.patches_,W.inversePatches_)}return J.copy_}function l(W,q,w,$,J,Q,X){if(J==null)return;if(typeof J!=="object"&&!X)return;let Z=E(J);if(Z&&!X)return;if(x(J)){let B=Q&&q&&q.type_!==3&&!D(q.assigned_,$)?Q.concat($):void 0,N=V(W,J,B);if(r(w,$,N),x(N))W.canAutoFreeze_=!1;else return}else if(X)w.add(J);if(U(J)&&!Z){if(!W.immer_.autoFreeze_&&W.unfinalizedDrafts_<1)return;if(q&&q.base_&&q.base_[$]===J&&Z)return;if(V(W,J),(!q||!q.scope_.parent_)&&typeof $!=="symbol"&&(M(w)?w.has($):Object.prototype.propertyIsEnumerable.call(w,$)))R(W,J)}}function R(W,q,w=!1){if(!W.parent_&&W.immer_.autoFreeze_&&W.canAutoFreeze_)g(q,w)}function HW(W,q){let w=Array.isArray(W),$={type_:w?1:0,scope_:q?q.scope_:p(),modified_:!1,finalized_:!1,assigned_:{},parent_:q,base_:W,draft_:null,copy_:null,revoke_:null,isManual_:!1},J=$,Q=d;if(w)J=[$],Q=L;let{revoke:X,proxy:Z}=Proxy.revocable(J,Q);return $.draft_=Z,$.revoke_=X,Z}var d={get(W,q){if(q===Y)return W;let w=K(W);if(!D(w,q))return BW(W,w,q);let $=w[q];if(W.finalized_||!U($))return $;if($===_(W.base_,q))return j(W),W.copy_[q]=S($,W);return $},has(W,q){return q in K(W)},ownKeys(W){return Reflect.ownKeys(K(W))},set(W,q,w){let $=s(K(W),q);if($?.set)return $.set.call(W.draft_,w),!0;if(!W.modified_){let J=_(K(W),q),Q=J?.[Y];if(Q&&Q.base_===w)return W.copy_[q]=w,W.assigned_[q]=!1,!0;if(QW(w,J)&&(w!==void 0||D(W.base_,q)))return!0;j(W),T(W)}if(W.copy_[q]===w&&(w!==void 0||(q in W.copy_))||Number.isNaN(w)&&Number.isNaN(W.copy_[q]))return!0;return W.copy_[q]=w,W.assigned_[q]=!0,!0},deleteProperty(W,q){if(_(W.base_,q)!==void 0||q in W.base_)W.assigned_[q]=!1,j(W),T(W);else delete W.assigned_[q];if(W.copy_)delete W.copy_[q];return!0},getOwnPropertyDescriptor(W,q){let w=K(W),$=Reflect.getOwnPropertyDescriptor(w,q);if(!$)return $;return{writable:!0,configurable:W.type_!==1||q!=="length",enumerable:$.enumerable,value:w[q]}},defineProperty(){G(11)},getPrototypeOf(W){return z(W.base_)},setPrototypeOf(){G(12)}},L={};C(d,(W,q)=>{L[W]=function(){return arguments[0]=arguments[0][0],q.apply(this,arguments)}});L.deleteProperty=function(W,q){return L.set.call(this,W,q,void 0)};L.set=function(W,q,w){return d.set.call(this,W[0],q,w,W[0])};function _(W,q){let w=W[Y];return(w?K(w):W)[q]}function BW(W,q,w){let $=s(q,w);return $?"value"in $?$.value:$.get?.call(W.draft_):void 0}function s(W,q){if(!(q in W))return;let w=z(W);while(w){let $=Object.getOwnPropertyDescriptor(w,q);if($)return $;w=z(w)}return}function T(W){if(!W.modified_){if(W.modified_=!0,W.parent_)T(W.parent_)}}function j(W){if(!W.copy_)W.copy_=P(W.base_,W.scope_.immer_.useStrictShallowCopy_)}var KW=class{constructor(W){if(this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(q,w,$)=>{if(typeof q==="function"&&typeof w!=="function"){let Q=w;w=q;let X=this;return function(B=Q,...N){return X.produce(B,($W)=>w.call(this,$W,...N))}}if(typeof w!=="function")G(6);if($!==void 0&&typeof $!=="function")G(7);let J;if(U(q)){let Q=i(this),X=S(q,void 0),Z=!0;try{J=w(X),Z=!1}finally{if(Z)k(Q);else A(Q)}return h(Q,$),u(J,Q)}else if(!q||typeof q!=="object"){if(J=w(q),J===void 0)J=q;if(J===c)J=void 0;if(this.autoFreeze_)g(J,!0);if($){let Q=[],X=[];I("Patches").generateReplacementPatches_(q,J,Q,X),$(Q,X)}return J}else G(1,q)},this.produceWithPatches=(q,w)=>{if(typeof q==="function")return(X,...Z)=>this.produceWithPatches(X,(B)=>q(B,...Z));let $,J;return[this.produce(q,w,(X,Z)=>{$=X,J=Z}),$,J]},typeof W?.autoFreeze==="boolean")this.setAutoFreeze(W.autoFreeze);if(typeof W?.useStrictShallowCopy==="boolean")this.setUseStrictShallowCopy(W.useStrictShallowCopy);if(typeof W?.useStrictIteration==="boolean")this.setUseStrictIteration(W.useStrictIteration)}createDraft(W){if(!U(W))G(8);if(x(W))W=UW(W);let q=i(this),w=S(W,void 0);return w[Y].isManual_=!0,A(q),w}finishDraft(W,q){let w=W&&W[Y];if(!w||!w.isManual_)G(9);let{scope_:$}=w;return h($,q),u(void 0,$)}setAutoFreeze(W){this.autoFreeze_=W}setUseStrictShallowCopy(W){this.useStrictShallowCopy_=W}setUseStrictIteration(W){this.useStrictIteration_=W}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(W,q){let w;for(w=q.length-1;w>=0;w--){let J=q[w];if(J.path.length===0&&J.op==="replace"){W=J.value;break}}if(w>-1)q=q.slice(w+1);let $=I("Patches").applyPatches_;if(x(W))return $(W,q);return this.produce(W,(J)=>$(J,q))}};function S(W,q){let w=M(W)?I("MapSet").proxyMap_(W,q):f(W)?I("MapSet").proxySet_(W,q):HW(W,q);return(q?q.scope_:p()).drafts_.push(w),w}function UW(W){if(!x(W))G(10,W);return a(W)}function a(W){if(!U(W)||E(W))return W;let q=W[Y],w,$=!0;if(q){if(!q.modified_)return q.base_;q.finalized_=!0,w=P(W,q.scope_.immer_.useStrictShallowCopy_),$=q.scope_.immer_.shouldUseStrictIteration()}else w=P(W,!0);if(C(w,(J,Q)=>{r(w,J,a(Q))},$),q)q.finalized_=!1;return w}var IW=new KW,t=IW.produce;var NW=(W)=>(q,w,$)=>{return $.setState=(J,Q,...X)=>{let Z=typeof J==="function"?t(J):J;return q(Z,Q,...X)},W($.setState,w,$)},e=NW;var RW=WW()(qW(e((W,q)=>({members:[],loading:!1,fetchMembers:async(w,$,J)=>{if(!J&&q().loadedTeamId===w&&q().loadedWithAgents===$)return;W({loading:!0});try{let Q=await y.api.teams[":teamId"].members.$get({param:{teamId:w},query:{includeAgents:$?"true":"false"}});if(!Q.ok)throw Error("failed to fetch members");let X=await Q.json();W({members:X||[],loadedTeamId:w,loadedProjectId:void 0,loadedWithAgents:$,loading:!1})}catch{W({loading:!1})}},fetchProjectMembers:async(w,$,J)=>{if(!J&&q().loadedProjectId===w&&q().loadedWithAgents===$)return;W({loading:!0});try{let Q=await y.api.projects[":projectId"].members.$get({param:{projectId:w},query:{includeAgents:$?"true":"false"}});if(!Q.ok)throw Error("failed to fetch project members");let X=await Q.json();W({members:X||[],loadedProjectId:w,loadedTeamId:void 0,loadedWithAgents:$,loading:!1})}catch{W({loading:!1})}}}))));function _W(W,q,w){let $=H(W,w?.in);if(isNaN(q))return b(w?.in||W,NaN);if(!q)return $;let J=$.getDate(),Q=b(w?.in||W,$.getTime());Q.setMonth($.getMonth()+q+1,0);let X=Q.getDate();if(J>=X)return Q;else return $.setFullYear(Q.getFullYear(),Q.getMonth(),J),$}function PW(W,q){let w=H(W,q?.in),$=w.getMonth();return w.setFullYear(w.getFullYear(),$+1,0),w.setHours(23,59,59,999),w}function TW(W,q){return H(W,q?.in).getMonth()}function dW(W,q){return H(W,q?.in).getFullYear()}function vW(W,q){let[w,$]=wW(W,q.start,q.end);return{start:w,end:$}}
2
+ export{_W as uf,PW as vf,vW as wf,TW as xf,dW as yf,RW as zf};
@@ -0,0 +1,2 @@
1
+ import{Zf as R}from"./chunk-esa954t1.js";import{_f as b}from"./chunk-ctx1ms5t.js";import{Tg as Z}from"./chunk-dyen2t1p.js";import{qh as I}from"./chunk-4pj17byj.js";import{hi as B,qi as M,ri as v,ti as A,ui as C,wi as O,xi as S}from"./chunk-jsqsrcse.js";import{$l as K,Ji as l,Li as z,Mi as G,jl as D}from"./chunk-48yphy68.js";import{Zm as g}from"./chunk-69at8jm8.js";var u=g(l(),1);var T=(_)=>{return _.replace(/<@([a-zA-Z0-9_-]+)>/g,"@$1").replace(/^\[([^\]]+)\]:/gm,"\\[$1\\]:")};function t({sessionId:_,open:E,onOpenChange:k}){let{data:h,isLoading:y}=B({queryKey:["agent-sessions",_,"entries"],queryFn:async()=>{if(!_)return[];let X=await M.api["agent-sessions"][":sessionId"].entries.$get({param:{sessionId:_}});if(!X.ok)throw Error("Failed to fetch session logs");return await X.json()},enabled:E&&!!_});return z(v,{open:E,onOpenChange:k,children:G(A,{className:"sm:max-w-2xl max-h-[80vh] flex flex-col p-6 overflow-hidden bg-background/95 backdrop-blur-md border border-foreground/15 shadow-2xl",children:[G(C,{className:"pb-4 border-b border-foreground/15",children:[G(O,{className:"flex items-center gap-2 text-xl font-bold",children:[z(D,{className:"w-5 h-5 text-violet-500"}),K.agent_session_logs()]}),z(S,{children:K.agent_logs_description()})]}),z("div",{className:"flex-1 overflow-y-auto pr-1 py-4 space-y-4 min-h-0 select-text",children:y?G("div",{className:"space-y-4",children:[G("div",{className:"flex gap-4",children:[z(Z,{className:"h-5 w-5 rounded-full shrink-0"}),G("div",{className:"flex-1 space-y-2",children:[z(Z,{className:"h-4 w-1/4"}),z(Z,{className:"h-20 w-full"})]})]}),G("div",{className:"flex gap-4",children:[z(Z,{className:"h-5 w-5 rounded-full shrink-0"}),G("div",{className:"flex-1 space-y-2",children:[z(Z,{className:"h-4 w-1/4"}),z(Z,{className:"h-12 w-full"})]})]})]}):h&&h.length>0?z("div",{className:"flex flex-col",children:h.map((X)=>{let $=X.entry,L=$?.timestamp||X.timestamp,f="";if(typeof L==="string"||typeof L==="number"){let J=new Date(L);if(!isNaN(J.getTime()))f=I(J.toISOString())}if($&&typeof $==="object"){if($.type==="message"&&$.message){let J=$.message,q="bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200",F=String(J.role||"");if(J.role==="user")q="bg-slate-100 text-slate-800 dark:bg-slate-900/30 dark:text-slate-300",F=K.role_user();else if(J.role==="assistant")q="bg-violet-100 text-violet-800 dark:bg-violet-900/30 dark:text-violet-300",F=K.role_agent();else if(J.role==="toolResult")q=J.isError?"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300":"bg-emerald-100 text-emerald-800 dark:bg-emerald-900/30 dark:text-emerald-300",F=K.tool_result_with_name({name:String(J.toolName||K.unknown())});else if(J.role==="thought")q="bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-300",F=K.role_thinking();let c=(U)=>{let P=U;if(typeof U==="string")try{P=JSON.parse(U)}catch{}if(P&&typeof P==="object"&&!Array.isArray(P))return z("div",{className:"mt-1 space-y-1.5 pt-3",children:Object.entries(P).map(([V,W])=>{let H=W&&typeof W==="object"?JSON.stringify(W,null,2):String(W);return G("div",{className:"text-xs leading-relaxed break-words",children:[G("span",{className:"font-semibold text-violet-600 dark:text-violet-400",children:[V,":"]})," ",z("span",{className:"text-foreground/90 font-mono whitespace-pre-wrap",children:H})]},V)})});return z("div",{className:"text-xs font-mono whitespace-pre-wrap",children:String(U)})},p=()=>{let U=J.content;if(!U)return null;if(typeof U==="string"){if(!U.trim())return null;return z("div",{className:"text-xs text-foreground/80 dark:text-foreground/95 leading-relaxed prose prose-sm dark:prose-invert max-w-none break-words",children:z(R,{children:T(U)})})}if(Array.isArray(U)){let P=[];if(U.forEach((Y,V)=>{if(!Y)return;if(typeof Y==="string"){if(!Y.trim())return;P.push(z("div",{className:"text-xs text-foreground/80 dark:text-foreground/95 leading-relaxed prose prose-sm dark:prose-invert max-w-none break-words",children:z(R,{children:T(Y)})},`str-${V}`));return}if(typeof Y==="object"){let W=Y,H=W.type;if(H==="text"){let Q=W.text;if(typeof Q!=="string"||!Q.trim())return;P.push(z("div",{className:"text-xs text-foreground/80 dark:text-foreground/95 leading-relaxed prose prose-sm dark:prose-invert max-w-none break-words",children:z(R,{children:T(Q)})},`txt-${V}`));return}if(H==="toolCall"){let Q=String(W.name||W.toolName||K.unknown()),w=W.arguments||W.args;P.push(G("div",{className:"text-xs space-y-2 py-1",children:[G("div",{className:"font-semibold text-violet-600 dark:text-violet-400 flex items-center gap-1.5",children:[K.calling_tool()," ",z("span",{className:"font-mono bg-violet-500/10 px-1 py-0.5 rounded text-[11px]",children:Q})]}),!!w&&G("div",{className:"space-y-1 pt-3",children:[z("div",{className:"text-[10px] text-muted-foreground/60 uppercase font-bold tracking-wider",children:K.tool_arguments()}),c(w)]})]},`tool-${V}`));return}if(H==="image"){P.push(z("div",{className:"text-xs text-muted-foreground italic flex items-center gap-1.5 py-1",children:K.image_object()},`img-${V}`));return}let N=JSON.stringify(Y,null,2);if(N==="{}")return;P.push(z("pre",{className:"text-xs text-foreground/80 font-mono whitespace-pre-wrap break-words bg-muted/20 p-2 rounded",children:N},`other-${V}`))}}),P.length===0)return null;return z("div",{className:"space-y-3 w-full",children:P.map((Y,V)=>G(u.default.Fragment,{children:[V>0&&z(b,{className:"my-3 opacity-50"}),Y]},V))})}return null};return G("div",{className:"relative pl-6 pb-6 last:pb-0",children:[z("div",{className:"absolute left-[9px] top-2 bottom-0 w-0.5 bg-foreground/10 last:hidden"}),z("div",{className:`absolute left-0 top-1.5 h-5 w-5 rounded-full border-4 border-background flex items-center justify-center ${J.role==="user"?"bg-slate-500":J.role==="assistant"?"bg-violet-500":J.role==="toolResult"?J.isError?"bg-red-500":"bg-emerald-500":"bg-amber-500"}`}),G("div",{className:"flex flex-col gap-1.5 bg-muted/30 dark:bg-muted/10 p-3 rounded-lg border border-foreground/5 backdrop-blur-xs w-full",children:[G("div",{className:"flex items-center justify-between gap-2",children:[G("div",{className:"flex items-center gap-2 flex-wrap",children:[z("span",{className:`text-[10px] px-2 py-0.5 rounded-full font-semibold uppercase tracking-wider ${q}`,children:F}),G("span",{className:"text-[10px] font-mono text-muted-foreground bg-muted/50 px-1.5 py-0.5 rounded border border-foreground/10 select-all",title:"Entry ID",children:["ID: ",X.id]})]}),z("span",{className:"text-[10px] text-muted-foreground/60 shrink-0",children:f})]}),p()]})]},X.id)}}return G("div",{className:"relative pl-6 pb-6 last:pb-0",children:[z("div",{className:"absolute left-[9px] top-2 bottom-0 w-0.5 bg-foreground/10 last:hidden"}),z("div",{className:"absolute left-0 top-1.5 h-5 w-5 rounded-full border-4 border-background bg-gray-400"}),G("div",{className:"bg-muted/30 p-3 rounded-lg border border-foreground/5",children:[G("div",{className:"flex items-center justify-between gap-2 mb-1.5 flex-wrap",children:[G("span",{className:"text-[10px] font-mono text-muted-foreground bg-muted/50 px-1.5 py-0.5 rounded border border-foreground/10 select-all",title:"Entry ID",children:["ID: ",X.id]}),z("div",{className:"text-[10px] text-muted-foreground/60",children:f})]}),z("pre",{className:"text-xs text-foreground/80 font-mono whitespace-pre-wrap break-words",children:JSON.stringify(X.entry,null,2)})]})]},X.id)})}):G("div",{className:"flex flex-col items-center justify-center py-12 text-center text-muted-foreground",children:[z(D,{className:"w-8 h-8 text-muted-foreground/40 mb-2 animate-pulse"}),z("p",{className:"text-sm font-medium",children:K.no_logs_found()}),z("p",{className:"text-xs text-muted-foreground/60 mt-1",children:K.session_no_entries_yet()})]})})]})})}
2
+ export{t as S};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{Dc as JG,Ec as r,Fc as u,Jc as H,Pc as W,Qc as l,Sc as N,Tc as k,Wc as E,Yc as J,_c as I,bd as V,dd as X,gd as _}from"./chunk-2t2wjzme.js";function q(G,Q){let Y={};if(!Object.keys(Q).length)return Y=G,Y;for(let[K,B]of Object.entries(G)){let O=Q[K];if(O===null)continue;Y[O??K]=B}return Y}function UG(G){let Q={};for(let[Y,K]of Object.entries(G))if(typeof K<"u")Q[Y]=K;return Q}class C extends Error{rawValue;rawMessage;static[Symbol.hasInstance](G){if(!(G instanceof Error))return!1;if(!("rawValue"in G))return!1;if(!("rawMessage"in G))return!1;if(!("pretty"in G))return!1;if(typeof G.pretty!=="function")return!1;return!0}constructor(G,Q,Y){super(`${G}: ${Q}`);this.name="SDKValidationError",this.cause=Q,this.rawValue=Y,this.rawMessage=G}pretty(){if(this.cause instanceof r)return`${this.rawMessage}
2
+ import{Dc as JG,Ec as r,Fc as u,Jc as H,Pc as W,Qc as l,Sc as N,Tc as k,Wc as E,Yc as J,_c as I,bd as V,dd as X,gd as _}from"./chunk-ty32j999.js";function q(G,Q){let Y={};if(!Object.keys(Q).length)return Y=G,Y;for(let[K,B]of Object.entries(G)){let O=Q[K];if(O===null)continue;Y[O??K]=B}return Y}function UG(G){let Q={};for(let[Y,K]of Object.entries(G))if(typeof K<"u")Q[Y]=K;return Q}class C extends Error{rawValue;rawMessage;static[Symbol.hasInstance](G){if(!(G instanceof Error))return!1;if(!("rawValue"in G))return!1;if(!("rawMessage"in G))return!1;if(!("pretty"in G))return!1;if(typeof G.pretty!=="function")return!1;return!0}constructor(G,Q,Y){super(`${G}: ${Q}`);this.name="SDKValidationError",this.cause=Q,this.rawValue=Y,this.rawMessage=G}pretty(){if(this.cause instanceof r)return`${this.rawMessage}
3
3
  ${yG(this.cause)}`;else return this.toString()}}function yG(G){return u(G)}function t(G){return{ok:!0,value:G}}function s(G){return{ok:!1,error:G}}async function vG(G){let Q=await G;if(!Q.ok)throw Q.error;return Q.value}function i(G,Q,Y){try{return t(Q(G))}catch(K){return s(new C(Y,K,G))}}var o=J({prompt_tokens:W().default(0),completion_tokens:W().default(0),total_tokens:W().default(0),prompt_audio_seconds:_(W()).optional()}).catchall(N()).transform((G)=>{return q(G,{prompt_tokens:"promptTokens",completion_tokens:"completionTokens",total_tokens:"totalTokens",prompt_audio_seconds:"promptAudioSeconds"})}),hG=J({promptTokens:W().default(0),completionTokens:W().default(0),totalTokens:W().default(0),promptAudioSeconds:_(W()).optional()}).catchall(N()).transform((G)=>{return{...q(G,{promptTokens:"prompt_tokens",completionTokens:"completion_tokens",totalTokens:"total_tokens",promptAudioSeconds:"prompt_audio_seconds"})}});function j(G){return z++,G}var z=0,a=0;function P(){a++;let G=z;return{end:(Q)=>{let Y=z-G;if(z=G+(Q??Y),--a===0)z=0;return Y}}}function M(G){let Q=Object.values(G);return I([...Q.map((Y)=>X(Y)),H().transform((Y)=>j(Y))])}function lG(G){let Q=Object.values(G).filter((Y)=>typeof Y==="number");return I([...Q.map((Y)=>X(Y)),W().transform((Y)=>j(Y))])}function f(G){return H()}function cG(G){return W()}var e=Symbol("UNKNOWN");function n(G){return typeof G==="object"&&G!==null&&e in G}function GG(G,Q,Y={}){let{unknownValue:K="UNKNOWN",outputPropertyName:B}=Y;return k().transform((O)=>{let w=Object.defineProperties({raw:O,[B??G]:K,isUnknown:!0},{[e]:{value:!0,enumerable:!1,configurable:!1}});if(!(typeof O==="object"&&O!==null))return w;let F=O[G];if(typeof F!=="string")return w;if(!(F in Q))return w;let $=Q[F];if(!$)return w;let T=P(),y=$.safeParse(O);if(!y.success)return T.end(0),w;if(T.end(),B)y.data[B]=F;return y.data})}var HG=/^\d{4}-\d{2}-\d{2}$/;class v{serialized;static today(){return new v(new Date)}constructor(G){if(typeof G==="string"&&!HG.test(G))throw RangeError("RFCDate: date strings must be in the format YYYY-MM-DD: "+G);let Q=new Date(G);if(isNaN(+Q))throw RangeError("RFCDate: invalid date provided: "+G);if(this.serialized=Q.toISOString().slice(0,10),!HG.test(this.serialized))throw TypeError(`RFCDate: failed to build valid date with given value: ${G} serialized to ${this.serialized}`)}toJSON(){return this.toString()}toString(){return this.serialized}}function Z(G){return k().transform((Q,Y)=>{let K=[],B=G.map(()=>[]),O=P();for(let[D,F]of G.entries()){let $=P(),T=F.safeParse(Q),y=$.end(),xG=0;if(T.success){K.push({data:T.data,inexactCount:y,zeroDefaultCount:0,fieldCount:-1});continue}B[D].push(...T.error.issues)}if(K.length===0)return O.end(0),Y.addIssue({input:Q,code:"invalid_union",errors:B}),JG;let w=K[0];for(let D of K){if(K.length>1)D.fieldCount=PG(D.data);w=zG(D,w)}return O.end(w.inexactCount),w.data})}function zG(G,Q){let Y=G.inexactCount===0,K=Q.inexactCount===0;if(Y!==K)return Y?G:Q;let B=G.fieldCount-G.zeroDefaultCount,O=Q.fieldCount-Q.zeroDefaultCount;if(B!==O)return B>O?G:Q;return G.inexactCount<Q.inexactCount?G:Q}function PG(G){let Q=0,Y=[G],K=0;while(K<Y.length){let B=Y[K++];if(B===void 0||n(B))continue;let O=typeof B;if(B===null||O==="number"||O==="string"||O==="boolean"||O==="bigint"||B instanceof Date||B instanceof v){Q++;continue}if(Array.isArray(B)){Y.push(...B);continue}if(O==="object")Y.push(...Object.values(B))}return Q}var QG=J({type:X("input_audio"),input_audio:H()}).transform((G)=>{return q(G,{input_audio:"inputAudio"})}),XG=J({type:X("input_audio"),inputAudio:H()}).transform((G)=>{return q(G,{inputAudio:"input_audio"})});var YG=J({type:X("document_url").default("document_url"),document_url:H(),document_name:_(H()).optional()}).transform((G)=>{return q(G,{document_url:"documentUrl",document_name:"documentName"})}),_G=J({type:X("document_url").default("document_url"),documentUrl:H(),documentName:_(H()).optional()}).transform((G)=>{return q(G,{documentUrl:"document_url",documentName:"document_name"})});var ZG=J({type:X("file").default("file"),file_id:H()}).transform((G)=>{return q(G,{file_id:"fileId"})}),WG=J({type:X("file").default("file"),fileId:H()}).transform((G)=>{return q(G,{fileId:"file_id"})});var qG={Low:"low",Auto:"auto",High:"high"},BG=M(qG),KG=f(qG);var b=J({url:H(),detail:_(BG).optional()}),p=J({url:H(),detail:_(KG).optional()});var BH=Z([b,H()]),KH=Z([p,H()]);var OG=J({type:X("image_url").default("image_url"),image_url:Z([b,H()])}).transform((G)=>{return q(G,{image_url:"imageUrl"})}),AG=J({type:X("image_url").default("image_url"),imageUrl:Z([p,H()])}).transform((G)=>{return q(G,{imageUrl:"image_url"})});var wH=Z([W(),H()]),NH=Z([W(),H()]);var L=J({type:X("reference").default("reference"),reference_ids:E(Z([W(),H()]))}).transform((G)=>{return q(G,{reference_ids:"referenceIds"})}),R=J({type:X("reference").default("reference"),referenceIds:E(Z([W(),H()]))}).transform((G)=>{return q(G,{referenceIds:"reference_ids"})});var x=J({type:X("text").default("text"),text:H()}),U=J({type:X("text").default("text"),text:H()});var EG={WebSearch:"web_search",WebSearchPremium:"web_search_premium",CodeInterpreter:"code_interpreter",ImageGeneration:"image_generation",DocumentLibrary:"document_library"},h=M(EG),g=f(EG);var yH=Z([h,H()]),zH=Z([g,H()]);var d=J({type:X("tool_reference").default("tool_reference"),tool:Z([h,H()]),title:H(),url:_(H()).optional(),favicon:_(H()).optional(),description:_(H()).optional()}),m=J({type:X("tool_reference").default("tool_reference"),tool:Z([g,H()]),title:H(),url:_(H()).optional(),favicon:_(H()).optional(),description:_(H()).optional()});var UH=Z([d,x,L]),$H=Z([m,U,R]);var wG=J({type:X("thinking").default("thinking"),thinking:E(Z([d,x,L])),signature:_(H()).optional(),closed:l().optional()}),NG=J({type:X("thinking").default("thinking"),thinking:E(Z([m,U,R])),signature:_(H()).optional(),closed:l().optional()});var c=GG("type",{image_url:OG.and(J({type:X("image_url")})),document_url:YG.and(J({type:X("document_url")})),text:x.and(J({type:X("text")})),reference:L.and(J({type:X("reference")})),file:ZG.and(J({type:X("file")})),thinking:wG.and(J({type:X("thinking")})),input_audio:QG}),gH=I([AG.and(J({type:X("image_url")})),_G.and(J({type:X("document_url")})),U.and(J({type:X("text")})),R.and(J({type:X("reference")})),WG.and(J({type:X("file")})),NG.and(J({type:X("thinking")})),XG]);var lH=Z([V(H(),N()),H()]),cH=Z([V(H(),N()),H()]);var VG=J({name:H(),arguments:Z([V(H(),N()),H()])}),DG=J({name:H(),arguments:Z([V(H(),N()),H()])});var FG=J({id:H().default("null"),type:H().optional(),function:VG,index:W().default(0)}),tH=J({id:H().default("null"),type:H().optional(),function:DG,index:W().default(0)});var nH=Z([H(),E(c)]);var TG=J({role:_(H()).optional(),content:_(Z([H(),E(c)])).optional(),tool_calls:_(E(FG)).optional(),tool_call_id:_(H()).optional(),index:_(W()).optional(),metadata:_(V(H(),N())).optional()}).transform((G)=>{return q(G,{tool_calls:"toolCalls",tool_call_id:"toolCallId"})});var IG={Stop:"stop",Length:"length",Error:"error",ToolCalls:"tool_calls"},LG=M(IG),MG=J({index:W(),delta:TG,finish_reason:_(LG)}).transform((G)=>{return q(G,{finish_reason:"finishReason"})});var RG=J({id:H(),object:H().optional(),created:W().optional(),model:H(),usage:o.optional(),choices:E(MG)});function ZJ(G){return i(G,(Q)=>RG.parse(JSON.parse(Q)),"Failed to parse 'CompletionChunk' from JSON")}
4
4
  export{yG as Y,t as Z,s as _,vG as $,i as aa,q as ba,UG as ca,M as da,lG as ea,f as fa,cG as ga,GG as ha,Z as ia,YG as ja,_G as ka,WG as la,OG as ma,AG as na,x as oa,U as pa,h as qa,g as ra,d as sa,m as ta,wG as ua,NG as va,c as wa,gH as xa,FG as ya,tH as za,TG as Aa,o as Ba,hG as Ca,RG as Da,ZJ as Ea};
@@ -0,0 +1 @@
1
+ import{He as y1,Ie as L1,Je as q1,Le as k_,Me as u_,Ne as D1,Oe as p1,Pe as T1,Qe as m1}from"./chunk-gx8sz5bw.js";import{Re as r_}from"./chunk-byjze6hm.js";import{Se as L_}from"./chunk-gx410cm2.js";import"./chunk-6ts5az6h.js";import"./chunk-31f07jzm.js";import"./chunk-02b97gsf.js";import"./chunk-mm995mvc.js";import{Ff as l,Gf as j_,Rf as s}from"./chunk-8b11b9cj.js";import{Uf as V_,Vf as Q_,Wf as f_,Xf as N_,Yf as d}from"./chunk-ntqn09r0.js";import"./chunk-esa954t1.js";import"./chunk-ctx1ms5t.js";import"./chunk-day0vn14.js";import{Ag as U1,Bg as P1,Cg as b1,Lg as O1,Ng as F1,Pg as Z_,Qg as m_}from"./chunk-3ztat2q9.js";import{Rg as y_}from"./chunk-2s97ngr8.js";import{Ug as E1}from"./chunk-sepsqqdf.js";import"./chunk-dwkv3bx5.js";import{Lh as l_,wh as V1}from"./chunk-ps2hw0ps.js";import{Mh as S1}from"./chunk-qrnw89xg.js";import{Nh as X_,Oh as H_,Ph as z_}from"./chunk-5dfy6173.js";import{Qh as P_,Sh as b_,Th as O_,Uh as Y_}from"./chunk-qrhf20g2.js";import{Ai as A_,Bi as G_,Ci as C_,Di as S_,Ei as D_,Fi as p_,Gi as T_,Hi as c_,ei as o,hi as i,ji as x,ki as K1,qi as G,ri as M_,ti as w_,ui as F_,vi as B_,wi as K_,xi as Y1,yi as c}from"./chunk-jsqsrcse.js";import{Ii as k}from"./chunk-8zar6cc4.js";import{$j as v1,$l as W,Ej as $_,Hj as h1,Hk as w1,Ji as __,Ki as q_,Li as _,Lj as X1,Mi as J,Mj as H1,Qk as t,Wi as g1,Wl as m,Yl as P,am as E_,ek as C1,ij as R_,il as n,kj as g,ll as U_,mj as Z1,oj as f1,sj as N1,tl as _1,uk as M1,ul as $1,yk as o_,yl as J1}from"./chunk-48yphy68.js";import{Zm as e}from"./chunk-69at8jm8.js";var r=e(__(),1);function W1({scope:$,onScopeChange:H,selectedGoal:F,onClearGoal:h,onCreateTask:L,canCreateTask:B=!0}){return J("header",{className:"h-14 border-b border-border bg-card/60 backdrop-blur-sm px-4 flex items-center justify-between gap-3 shrink-0 select-none",children:[J("div",{className:"flex items-center gap-3 min-w-0",children:[J("div",{className:"flex items-center bg-muted/60 p-0.5 rounded-lg border border-border/50",children:[J(P,{variant:$==="team"?"secondary":"ghost",size:"sm",onClick:()=>H("team"),className:`h-7 px-2.5 text-xs font-medium gap-1.5 transition-all ${$==="team"?"bg-background text-foreground shadow-xs":"text-muted-foreground hover:text-foreground"}`,children:[_($1,{className:"w-3.5 h-3.5"}),_("span",{children:W.team_tasks()})]}),J(P,{variant:$==="my"?"secondary":"ghost",size:"sm",onClick:()=>H("my"),className:`h-7 px-2.5 text-xs font-medium gap-1.5 transition-all ${$==="my"?"bg-background text-foreground shadow-xs":"text-muted-foreground hover:text-foreground"}`,children:[_(_1,{className:"w-3.5 h-3.5"}),_("span",{children:W.my_tasks()})]})]}),F&&J("div",{className:"hidden sm:flex items-center gap-1.5 px-2 py-1 rounded-md bg-sidebar-accent border border-sidebar-border text-xs text-sidebar-accent-foreground min-w-0 max-w-[200px] md:max-w-[280px]",children:[_(n,{className:"w-3.5 h-3.5 text-sidebar-primary shrink-0"}),_("span",{className:"truncate font-medium",children:F.id===s?W.unassigned():F.title}),_(P,{variant:"ghost",size:"icon-xs",onClick:h,className:"h-4 w-4 p-0 ml-0.5 text-muted-foreground hover:text-foreground",title:W.clear_filter(),children:_(J1,{className:"w-3 h-3"})})]})]}),B&&_("div",{className:"flex items-center gap-2 shrink-0",children:J(P,{size:"sm",onClick:L,className:"h-8 px-3 text-xs gap-1.5 shadow-xs",children:[_(t,{className:"w-3.5 h-3.5"}),_("span",{children:W.create_task()})]})})]})}var W_=e(__(),1);var J_=e(__(),1);function d_({teamId:$,isOpen:H,onClose:F,goalToEdit:h}){let L=o(),[B,U]=J_.useState(""),[M,b]=J_.useState("");J_.useEffect(()=>{if(h)U(h.title),b(h.description||"");else U(""),b("")},[h,H]);let{mutate:y,isPending:C}=x({mutationFn:async()=>{let X=await G.api.teams[":teamId"].kanban.goals.$post({param:{teamId:$},json:{title:B.trim(),description:M.trim()||void 0}});if(!X.ok){let w=await X.json().catch(()=>({message:W.error()}));throw Error(w.message||W.error())}return await X.json()},onSuccess:()=>{L.invalidateQueries({queryKey:["teams",$,"kanban","goals"]}),c.success(W.goal_created()),F()},onError:(X)=>{c.error(X.message)}}),{mutate:S,isPending:O}=x({mutationFn:async()=>{if(!h)return;let X=await G.api.teams[":teamId"].kanban.goals[":goalId"].$patch({param:{teamId:$,goalId:h.id},json:{title:B.trim(),description:M.trim()||null}});if(!X.ok){let w=await X.json().catch(()=>({message:W.error()}));throw Error(w.message||W.error())}return await X.json()},onSuccess:()=>{L.invalidateQueries({queryKey:["teams",$,"kanban","goals"]}),c.success(W.goal_updated()),F()},onError:(X)=>{c.error(X.message)}}),T=(X)=>{if(X.preventDefault(),!B.trim())return;if(h)S();else y()},Q=C||O;return _(M_,{open:H,onOpenChange:(X)=>!X&&F(),children:_(w_,{className:"sm:max-w-xl",children:J("form",{onSubmit:T,className:"space-y-4",children:[J(F_,{children:[_(K_,{children:h?W.edit_goal():W.create_goal()}),_(Y1,{children:h?W.edit_goal():W.create_first_goal()})]}),J("div",{className:"space-y-3 py-2",children:[J("div",{className:"space-y-1.5",children:[_(k,{htmlFor:"goal-title",children:W.goal_title()}),_(E_,{id:"goal-title",value:B,onChange:(X)=>U(X.target.value),placeholder:W.goal_title_placeholder(),required:!0,autoFocus:!0})]}),J("div",{className:"space-y-1.5",children:[_(k,{htmlFor:"goal-description",children:W.goal_description()}),_(L_,{id:"goal-description",value:M,onChange:(X)=>b(X.target.value),placeholder:W.goal_description_placeholder(),rows:3})]})]}),J(B_,{children:[_(P,{type:"button",variant:"outline",onClick:F,disabled:Q,children:W.cancel()}),J(P,{type:"submit",disabled:!B.trim()||Q,children:[Q&&_(g,{className:"w-4 h-4 mr-1.5 animate-spin"}),h?W.save_changes():W.create()]})]})]})})})}function z1({teamId:$,selectedGoalId:H,onSelectGoal:F,isOwnerOrEditor:h=!0}){let L=o(),[B,U]=W_.useState(!1),[M,b]=W_.useState(null),[y,C]=W_.useState(null),[S,O]=W_.useState(!1),{data:T,isLoading:Q}=i({queryKey:["teams",$,"kanban","goals"],queryFn:async()=>{let z=await G.api.teams[":teamId"].kanban.goals.$get({param:{teamId:$},query:{}});if(!z.ok)throw Error("Failed to fetch goals");return await z.json()},enabled:!!$}),X=T?.data||[],w=X.reduce((z,Z)=>z+(Z.taskCount||0),0),{mutate:q,isPending:V}=x({mutationFn:async(z)=>{let Z=await G.api.teams[":teamId"].kanban.goals[":goalId"].$delete({param:{teamId:$,goalId:z}});if(!Z.ok){let N=await Z.json().catch(()=>({message:W.error()}));throw Error(N.message||W.error())}return await Z.json()},onSuccess:(z,Z)=>{if(L.invalidateQueries({queryKey:["teams",$,"kanban","goals"]}),L.invalidateQueries({queryKey:["teams",$,"kanban","tasks"]}),c.success(W.goal_deleted()),H===Z)F(null);C(null)},onError:(z)=>{c.error(z.message)}});if(S)return J("div",{className:"border-r border-sidebar-border bg-sidebar flex flex-col items-center w-12 shrink-0 transition-all duration-300",children:[_("div",{className:"h-14 flex items-center justify-center border-b border-sidebar-border w-full shrink-0",children:_(P,{variant:"ghost",size:"icon-sm",onClick:()=>O(!1),title:W.goals(),className:"text-sidebar-foreground/70 hover:text-sidebar-foreground",children:_(H1,{className:"w-4 h-4"})})}),J("div",{className:"mt-3 flex flex-col items-center gap-2",children:[_(P,{variant:H===null?"secondary":"ghost",size:"icon-sm",onClick:()=>F(null),title:W.all_tasks(),className:m("w-8 h-8 rounded-md",H===null&&"bg-sidebar-accent text-sidebar-accent-foreground"),children:_(o_,{className:"w-4 h-4"})}),_(P,{variant:"ghost",size:"icon-sm",onClick:()=>U(!0),title:W.new_goal(),className:"w-8 h-8 rounded-md text-sidebar-foreground/70 hover:text-sidebar-foreground",children:_(t,{className:"w-4 h-4"})})]}),B&&_(d_,{teamId:$,isOpen:B,onClose:()=>U(!1)})]});return J("aside",{className:"w-64 border-r border-sidebar-border bg-sidebar flex flex-col shrink-0 transition-all duration-300 select-none",children:[J("div",{className:"h-14 px-3 flex items-center justify-between border-b border-sidebar-border shrink-0",children:[J("div",{className:"flex items-center gap-2 font-semibold text-xs tracking-wider uppercase text-sidebar-foreground/70",children:[_(n,{className:"w-4 h-4 text-sidebar-primary"}),_("span",{children:W.goals()})]}),J("div",{className:"flex items-center gap-1",children:[h&&_(P,{variant:"ghost",size:"icon-sm",onClick:()=>U(!0),className:"h-7 w-7 text-sidebar-foreground/70 hover:text-sidebar-foreground",title:W.new_goal(),children:_(t,{className:"w-4 h-4"})}),_(P,{variant:"ghost",size:"icon-sm",onClick:()=>O(!0),className:"h-7 w-7 text-sidebar-foreground/70 hover:text-sidebar-foreground",title:"Collapse",children:_(X1,{className:"w-4 h-4"})})]})]}),_(y_,{className:"flex-1 p-2",children:J("div",{className:"space-y-1",children:[J("div",{onClick:()=>F(null),className:m("flex items-center justify-between px-2.5 py-1 rounded-md text-xs font-medium cursor-pointer transition-colors group h-8 min-h-[32px]",H===null?"bg-sidebar-accent text-sidebar-accent-foreground font-semibold shadow-xs":"text-sidebar-foreground/70 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground"),children:[J("div",{className:"flex items-center gap-2 truncate min-w-0",children:[_(o_,{className:"w-3.5 h-3.5 shrink-0 text-sidebar-primary"}),_("span",{className:"truncate",children:W.all_tasks()})]}),w>0&&_("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-sidebar-border text-sidebar-foreground/60 shrink-0",children:w})]}),Q?_("div",{className:"flex items-center justify-center p-4",children:_(g,{className:"w-4 h-4 animate-spin text-muted-foreground"})}):X.length===0?_("div",{className:"px-2.5 py-4 text-center text-xs text-muted-foreground",children:W.no_goals_yet()}):X.map((z)=>{let Z=H===z.id,N=z.id===s,K=N?W.unassigned():z.title,v=h&&!N;return J("div",{onClick:()=>F(z.id),className:m("flex items-center justify-between px-2.5 py-1 rounded-md text-xs font-medium cursor-pointer transition-colors group relative min-h-[32px]",Z?"bg-sidebar-accent text-sidebar-accent-foreground font-semibold shadow-xs":"text-sidebar-foreground/70 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground"),children:[J("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[_(n,{className:m("w-3.5 h-3.5 shrink-0",Z?"text-sidebar-primary":"text-muted-foreground")}),_("span",{className:"line-clamp-2 break-words leading-tight",title:K,children:K})]}),_("div",{className:"flex items-center shrink-0 ml-1",children:v?J(q_,{children:[(z.taskCount??0)>0&&_("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-sidebar-border text-sidebar-foreground/60 group-hover:hidden group-focus-within:hidden [&:has(~_div_[data-state=open])]:hidden",children:z.taskCount}),_("div",{className:"hidden group-hover:flex group-focus-within:flex [&:has([data-state=open])]:flex items-center",onClick:(f)=>f.stopPropagation(),children:J(P_,{modal:!1,children:[_(b_,{asChild:!0,children:_(P,{variant:"ghost",size:"icon-xs",className:"h-6 w-6 p-0 text-muted-foreground hover:text-foreground",children:_(R_,{className:"w-3.5 h-3.5"})})}),J(O_,{align:"end",className:"w-36",children:[J(Y_,{onClick:()=>{b(z)},children:[_(Z1,{className:"w-3.5 h-3.5 mr-2"}),W.edit()]}),J(Y_,{className:"text-destructive focus:text-destructive focus:bg-destructive/10",onClick:()=>{C(z)},children:[_(U_,{className:"w-3.5 h-3.5 mr-2"}),W.delete()]})]})]})})]}):(z.taskCount??0)>0&&_("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded-full bg-sidebar-border text-sidebar-foreground/60",children:z.taskCount})})]},z.id)})]})}),(B||M)&&_(d_,{teamId:$,isOpen:B||!!M,goalToEdit:M,onClose:()=>{U(!1),b(null)}}),y&&_(A_,{open:!!y,onOpenChange:(z)=>!z&&C(null),children:J(G_,{children:[J(C_,{children:[_(D_,{children:W.delete_goal()}),_(p_,{children:W.delete_goal_confirm({title:y.title})})]}),J(S_,{children:[_(c_,{disabled:V,children:W.cancel()}),J(T_,{onClick:()=>q(y.id),disabled:V,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[V&&_(g,{className:"w-4 h-4 mr-1.5 animate-spin"}),W.delete()]})]})]})})]})}var A1=e(__(),1);var g_=e(__(),1);function Q1($){return+V1($)<Date.now()}function B1({task:$,onClick:H,onDelete:F,disabled:h,isFirst:L,isLast:B,showBottomIndicator:U,currentUserId:M,currentUserRole:b}){let{source:y}=m_(),C=!!y,S=b?.toLowerCase()==="owner",O=b?.toLowerCase()==="editor",T=!!M&&$.creator?.id===M,Q=$.reporter?.id===M||T,X=$.assignee?.id===M,w=S||O||Q||X,q=T||S||Q,V=h||!w,{ref:z,isDragging:Z}=F1({id:$.id,data:{type:"kanban_task",task:$},disabled:V}),{ref:N,isDropTarget:K}=Z_({id:`reorder-before-${$.id}`,data:{type:"reorder",task:$,position:"before"},disabled:Z||h}),{ref:v,isDropTarget:f}=Z_({id:`reorder-after-${$.id}`,data:{type:"reorder",task:$,position:"after"},disabled:Z||h}),R=$.isAgentTask,A=$.status===l.BLOCKED,E=$.dueDate?Q1(new Date($.dueDate))&&$.status!==l.DONE:!1;return J("div",{className:"relative",children:[_("div",{ref:N,className:m("absolute left-0 right-0 z-20",L?"-top-6 h-[calc(50%+24px)]":"-top-1 h-[calc(50%+4px)]",C&&!Z?"pointer-events-auto":"pointer-events-none")}),_("div",{ref:v,className:m("absolute bottom-0 left-0 right-0 z-20",B?"-bottom-6 h-[calc(50%+24px)]":"h-1/2",C&&!Z?"pointer-events-auto":"pointer-events-none")}),K&&!Z&&_("div",{className:"absolute -top-1.5 left-0 right-0 h-[3px] rounded-full bg-primary shadow-[0_0_8px_rgba(var(--primary),0.6)] z-30 pointer-events-none"}),(f||U)&&!Z&&_("div",{className:"absolute -bottom-1.5 left-0 right-0 h-[3px] rounded-full bg-primary shadow-[0_0_8px_rgba(var(--primary),0.6)] z-30 pointer-events-none"}),J("div",{ref:z,onClick:()=>H($),className:m("group relative flex flex-col gap-2 p-3 rounded-lg border text-card-foreground transition-all duration-200 cursor-pointer select-none",Z&&"opacity-40 scale-95 shadow-lg ring-2 ring-primary",!Z&&"hover:shadow-md","border-border/80 bg-card hover:border-primary/50 shadow-2xs",A&&"border-red-500/60 bg-red-500/[0.03] ring-1 ring-red-500/20"),children:[J("div",{className:"flex items-center justify-between gap-1.5 min-w-0",children:[J("div",{className:"flex items-center gap-1.5 min-w-0 flex-1",children:[_("span",{className:m("px-1.5 py-0.5 rounded text-[10px] font-medium border uppercase tracking-wider shrink-0",u_($.priority)),children:k_($.priority)}),R&&J("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-semibold bg-orange-500/15 text-orange-600 dark:text-orange-400 border border-orange-500/30 shrink-0",children:[_($_,{className:"w-3 h-3"}),_("span",{children:W.task_type_agent()})]}),$.goal&&J("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-muted text-muted-foreground border border-border/70 truncate max-w-[130px]",children:[_(n,{className:"w-2.5 h-2.5 shrink-0"}),_("span",{className:"truncate",children:$.goal.title})]})]}),_("div",{className:"flex items-center gap-1 shrink-0",children:q&&_("div",{className:"opacity-0 group-hover:opacity-100 [&:has([data-state=open])]:opacity-100 focus-within:opacity-100 transition-opacity flex items-center",onClick:(I)=>I.stopPropagation(),children:J(P_,{modal:!1,children:[_(b_,{asChild:!0,children:_(P,{variant:"ghost",size:"icon-xs",className:"h-5 w-5 p-0 text-muted-foreground hover:text-foreground",children:_(R_,{className:"w-3.5 h-3.5"})})}),_(O_,{align:"end",className:"w-32",children:J(Y_,{className:"text-destructive focus:text-destructive focus:bg-destructive/10",onClick:()=>F?.($),children:[_(U_,{className:"w-3.5 h-3.5 mr-2"}),W.delete()]})})]})})})]}),_("h4",{className:"text-xs font-semibold leading-snug line-clamp-2 text-foreground break-words",children:$.title}),A&&J("div",{className:"flex items-start gap-1.5 p-1.5 rounded bg-red-500/10 border border-red-500/20 text-[11px] text-red-600 dark:text-red-400",children:[_(N1,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),_("span",{className:"line-clamp-2 break-words",children:$.latestStatusEvent?.blockReason||$.latestStatusEvent?.reason||$.latestStatusEvent?.summary||W.status_blocked()})]}),$.status===l.IN_REVIEW&&$.latestStatusEvent?.summary&&J("div",{className:"flex items-start gap-1.5 p-1.5 rounded bg-purple-500/10 border border-purple-500/20 text-[11px] text-purple-600 dark:text-purple-400",children:[_(f1,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),_("span",{className:"line-clamp-2 break-words",children:$.latestStatusEvent.summary})]}),J("div",{className:"flex items-center justify-between gap-2 pt-1 mt-auto border-t border-border/40 text-[11px] text-muted-foreground",children:[_("div",{className:"flex items-center gap-1.5 min-w-0",children:$.assignee?J(q_,{children:[R?_("div",{className:"w-5 h-5 rounded-full bg-orange-500/15 border border-orange-500/30 flex items-center justify-center shrink-0",children:_($_,{className:"w-3 h-3 text-orange-600 dark:text-orange-400"})}):J(X_,{size:"sm",className:"w-5 h-5 border border-border",children:[_(H_,{src:$.assignee.image}),_(z_,{className:"text-[9px]",children:$.assignee.name.slice(0,2).toUpperCase()})]}),_("span",{className:"truncate text-xs font-medium text-foreground/80 max-w-[90px]",children:$.assignee.name})]}):_("span",{className:"text-[11px] italic text-muted-foreground/60",children:W.unassigned()})}),J("div",{className:"flex items-center gap-2 shrink-0",children:[$.dueDate&&J("div",{className:m("flex items-center gap-1 text-[10px] font-mono",E?"text-red-500 font-semibold":"text-muted-foreground"),title:l_(new Date($.dueDate),"yyyy/MM/dd HH:mm"),children:[_(h1,{className:"w-3 h-3"}),_("span",{children:l_(new Date($.dueDate),"MM/dd")})]}),$.assetCount>0&&J("div",{className:"flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground",title:W.linked_assets_count({count:$.assetCount}),children:[_(v1,{className:"w-3 h-3"}),_("span",{children:$.assetCount})]}),$.dependencyCount>0&&J("div",{className:"flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground",title:`${$.dependencyCount} dependencies`,children:[_(M1,{className:"w-3 h-3"}),_("span",{children:$.dependencyCount})]}),$.commentCount>0&&J("div",{className:"flex items-center gap-0.5 text-[10px] text-muted-foreground hover:text-foreground",title:`${$.commentCount} comments`,children:[_(w1,{className:"w-3 h-3"}),_("span",{children:$.commentCount})]})]})]})]})]})}function R1({teamId:$,status:H,selectedGoalId:F,scope:h,currentUserId:L,currentUserRole:B,onTaskClick:U,onDeleteTask:M,onCreateTaskInColumn:b}){let y=B?.toLowerCase()==="owner"||B?.toLowerCase()==="editor",C=h==="my"?L:void 0,{data:S,fetchNextPage:O,hasNextPage:T,isFetchingNextPage:Q,isLoading:X}=K1({queryKey:["teams",$,"kanban","tasks",{status:H,goalId:F,assigneeId:C}],queryFn:async({pageParam:D=""})=>{let j=await G.api.teams[":teamId"].kanban.tasks.$get({param:{teamId:$},query:{status:H,goalId:F||void 0,assigneeId:C||void 0,first:"20",after:D||void 0}});if(!j.ok)throw Error("Failed to fetch column tasks");return await j.json()},initialPageParam:"",getNextPageParam:(D)=>D.pageInfo?.cursor||void 0,refetchInterval:5000,enabled:!!$}),{ref:w,inView:q}=E1({threshold:0.1});g_.useEffect(()=>{if(q&&T&&!Q)O()},[q,T,Q,O]);let V=g_.useMemo(()=>{return S?.pages?.flatMap((D)=>Array.isArray(D?.data)?D.data:[])||[]},[S]),{source:z,target:Z}=m_(),N=V.filter((D)=>D.id!==z?.id).at(-1),{ref:K,isDropTarget:v}=Z_({id:H,data:{type:"kanban_column",status:H,lastTask:N}}),f=z?.data?.type==="kanban_task",R=f&&(v||Z?.data?.type==="kanban_column"&&Z.data.status===H||Z?.data?.type==="reorder"&&Z.data.task?.status===H),A=f&&Z?.data?.type==="kanban_column"&&Z.data.status===H,E=S?.pages?.[0]?.pageInfo?.total??V.length,I=q1(H);return J("div",{ref:K,className:m("flex flex-col h-full max-h-full w-80 md:w-84 shrink-0 rounded-xl bg-card/60 border border-border/70 shadow-xs transition-colors duration-200 overflow-hidden select-none",R&&"ring-2 ring-primary/60 bg-primary/[0.03] border-primary/40"),children:[J("div",{className:"h-11 px-3.5 flex items-center justify-between border-b border-border/60 bg-card/80 shrink-0",children:[J("div",{className:"flex items-center gap-2 min-w-0",children:[_("div",{className:m("w-2.5 h-2.5 rounded-full shrink-0",I.dot)}),_("h3",{className:"text-xs font-bold tracking-wide uppercase text-foreground/90 truncate",children:L1(H)})]}),_("div",{className:"flex items-center gap-1 shrink-0",children:_("span",{className:"text-[11px] font-mono px-2 py-0.5 rounded-full bg-muted font-medium text-muted-foreground",children:E})})]}),_(y_,{className:"flex-1 min-h-0 [&>div>div]:block!",children:J("div",{className:"p-2.5 space-y-2.5 min-h-full flex flex-col",children:[X?_("div",{className:"flex items-center justify-center py-10",children:_(g,{className:"w-5 h-5 animate-spin text-muted-foreground"})}):V.length===0?_("div",{className:"flex flex-col items-center justify-center py-10 px-4 text-center",children:_("p",{className:"text-xs text-muted-foreground/70",children:W.no_tasks_in_column()})}):V.map((D,j)=>_(B1,{task:D,onClick:U,onDelete:M,isFirst:j===0,isLast:j===V.length-1,showBottomIndicator:A&&D.id===N?.id,currentUserId:L,currentUserRole:B},D.id)),_("div",{ref:w,className:"h-2"}),Q&&_("div",{className:"flex justify-center py-2",children:_(g,{className:"w-4 h-4 animate-spin text-muted-foreground"})})]})}),y&&_("div",{className:"p-2 border-t border-border/50 bg-card/90 shrink-0",children:J(P,{variant:"ghost",size:"sm",onClick:()=>b(H),className:"w-full justify-center h-8 text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted/80 border border-dashed border-border/80",children:[_(t,{className:"w-3.5 h-3.5 mr-1.5"}),_("span",{children:W.create_task()})]})})]})}function G1({teamId:$,selectedGoalId:H,scope:F,currentUserId:h,currentUserRole:L,onTaskClick:B,onCreateTaskInColumn:U}){let M=o(),[b,y]=A1.useState(null),{mutate:C,isPending:S}=x({mutationFn:async(Q)=>{let X=await G.api.teams[":teamId"].kanban.tasks[":taskId"].$delete({param:{teamId:$,taskId:Q}});if(!X.ok){let w=await X.json().catch(()=>({message:W.error()}));throw Error(w.message||W.error())}return await X.json()},onSuccess:()=>{M.invalidateQueries({queryKey:["teams",$,"kanban","tasks"]}),M.invalidateQueries({queryKey:["teams",$,"kanban","goals"]}),c.success(W.task_deleted()),y(null)},onError:(Q)=>{c.error(Q.message)}}),{mutate:O}=x({mutationFn:async({taskId:Q,fromStatus:X,status:w,reason:q,beforeIndex:V,afterIndex:z})=>{let Z=await G.api.teams[":teamId"].kanban.tasks[":taskId"].$patch({param:{teamId:$,taskId:Q},json:{fromStatus:X,status:w,reason:q,beforeIndex:V,afterIndex:z}});if(!Z.ok){let N=await Z.json().catch(()=>({message:W.error()}));throw Error(N.message||W.error())}return await Z.json()},onMutate:async({taskId:Q,status:X,targetTaskId:w,position:q})=>{await M.cancelQueries({queryKey:["teams",$,"kanban","tasks"]});let V=M.getQueriesData({queryKey:["teams",$,"kanban","tasks"]}),z=null,Z=(N)=>{return N[0]==="teams"&&N[1]===$&&N[2]==="kanban"&&N[3]==="tasks"&&typeof N[4]==="object"&&N[4]!==null&&"status"in N[4]};if(M.setQueriesData({predicate:(N)=>Z(N.queryKey)},(N)=>{if(!N||!Array.isArray(N.pages))return N;let K=!1,v=N.pages.map((f)=>{if(!f||!Array.isArray(f.data))return f;let R=f.data.find((A)=>A.id===Q);if(R)return z={...R,status:X},K=!0,{...f,data:f.data.filter((A)=>A.id!==Q),pageInfo:{...f.pageInfo,total:Math.max(0,(f.pageInfo?.total??f.data.length)-1)}};return f});return K?{...N,pages:v}:N}),z){let N=z;M.setQueriesData({predicate:(K)=>{if(!Z(K.queryKey))return!1;return K.queryKey[4]?.status===X}},(K)=>{if(!K||!Array.isArray(K.pages))return K;let v=K.pages.flatMap((E)=>E?.data??[]).filter((E)=>E.id!==Q),f=v.length;if(w){let E=v.findIndex((I)=>I.id===w);if(E!==-1)f=q==="before"?E:E+1}v.splice(f,0,N);let R=0,A=K.pages.map((E,I)=>{let D=E?.data?E.data.length:0,j=I===0&&D===0?1:I===K.pages.length-1?v.length-R:D,h_=v.slice(R,R+j);return R+=j,{...E,data:h_,pageInfo:{...E?.pageInfo,total:(E?.pageInfo?.total??0)+1}}});if(R<v.length&&A.length>0){let E=A.length-1;A[E]={...A[E],data:[...A[E]?.data??[],...v.slice(R)]}}return{...K,pages:A}})}return{previousQueries:V}},onError:(Q,X,w)=>{if(w?.previousQueries)for(let[q,V]of w.previousQueries)M.setQueryData(q,V);c.error(Q.message)},onSettled:()=>{M.invalidateQueries({queryKey:["teams",$,"kanban","tasks"]})}}),T=(Q)=>{if(Q.canceled)return;let{source:X,target:w}=Q.operation;if(!X||!w)return;let q=X.data;if(q?.type!=="kanban_task"||!q.task)return;let V=q.task,z=L?.toLowerCase()==="owner",Z=L?.toLowerCase()==="editor",N=V.reporter?.id===h||V.creator?.id===h,K=V.assignee?.id===h;if(!z&&!Z&&!N&&!K){c.error(W.cannot_change_task_status_permission());return}let v=w.data;if(!v)return;if(v.type==="reorder"&&v.task&&v.position){let f=v.task,R=f.status;if(V.id===f.id)return;let A=v.position==="before"?f.sortIndex??void 0:void 0,E=v.position==="after"?f.sortIndex??void 0:void 0;O({taskId:V.id,fromStatus:V.status,status:R,beforeIndex:A,afterIndex:E,targetTaskId:f.id,position:v.position});return}if(v.type==="kanban_column"&&v.status){let{status:f,lastTask:R}=v;if(R){if(V.id===R.id){if(V.status===f)return;O({taskId:V.id,fromStatus:V.status,status:f});return}O({taskId:V.id,fromStatus:V.status,status:f,afterIndex:R.sortIndex??void 0,targetTaskId:R.id,position:"after"});return}if(V.status===f)return;O({taskId:V.id,fromStatus:V.status,status:f})}};return J(O1,{sensors:[b1.configure({activationConstraints:[new P1.Distance({value:8})]}),U1],onDragEnd:T,children:[_("div",{className:"flex-1 min-h-0 overflow-x-auto overflow-y-hidden p-4 bg-background/50",children:_("div",{className:"flex gap-4 h-full min-w-max pb-2",children:y1.map((Q)=>_(R1,{teamId:$,status:Q,selectedGoalId:H,scope:F,currentUserId:h,currentUserRole:L,onTaskClick:B,onDeleteTask:(X)=>y(X),onCreateTaskInColumn:U},Q))})}),b&&_(A_,{open:!!b,onOpenChange:(Q)=>!Q&&y(null),children:J(G_,{children:[J(C_,{children:[_(D_,{children:W.delete_task()}),_(p_,{children:W.delete_task_confirm({title:b.title})})]}),J(S_,{children:[_(c_,{disabled:S,children:W.cancel()}),J(T_,{onClick:()=>C(b.id),disabled:S,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[S&&_(g,{className:"w-4 h-4 mr-1.5 animate-spin"}),W.delete()]})]})]})})]})}var p=e(__(),1);function c1({teamId:$,isOpen:H,onClose:F,initialGoalId:h}){let L=o(),B=h===s||!h?"none":h,[U,M]=p.useState(""),[b,y]=p.useState(""),[C,S]=p.useState(!1),[O,T]=p.useState(j_.MEDIUM),[Q,X]=p.useState(B),[w,q]=p.useState("none"),[V,z]=p.useState("none"),[Z,N]=p.useState(void 0),[K,v]=p.useState(void 0),[f,R]=p.useState(null),[A,E]=p.useState(null),[I,D]=p.useState(null),[j,h_]=p.useState([]),[I_,x_]=p.useState([]),[a_,t_]=p.useState(!1),{data:s_}=i({queryKey:["teams",$,"me"],queryFn:async()=>{let Y=await G.api.teams[":teamId"].me.$get({param:{teamId:$}});if(!Y.ok)return null;return await Y.json()},enabled:!!$&&H});p.useEffect(()=>{if(H)M(""),y(""),S(!1),T(j_.MEDIUM),X(B),q("none"),z(s_?.id||"none"),N(void 0),v(void 0),R(null),E(null),D(null),h_([]),x_([])},[H,B,s_?.id]);let{data:e_=[]}=i({queryKey:["teams",$,"members","human"],queryFn:async()=>{let Y=await G.api.teams[":teamId"].members.$get({param:{teamId:$},query:{includeAgents:"false"}});if(!Y.ok)return[];let u=await Y.json();return Array.isArray(u)?u:[]},enabled:!!$&&H}),{data:j1=[]}=i({queryKey:["teams",$,"agents"],queryFn:async()=>{let Y=await G.api.teams[":teamId"].agents.$get({param:{teamId:$}});if(!Y.ok)return[];return await Y.json()||[]},enabled:!!$&&H}),{data:I1}=i({queryKey:["teams",$,"kanban","goals"],queryFn:async()=>{let Y=await G.api.teams[":teamId"].kanban.goals.$get({param:{teamId:$},query:{}});if(!Y.ok)return{data:[]};return await Y.json()},enabled:!!$&&H}),x1=I1?.data||[],{mutate:i1,isPending:v_}=x({mutationFn:async()=>{let Y=await G.api.teams[":teamId"].kanban.tasks.$post({param:{teamId:$},json:{title:U.trim(),description:b.trim()||void 0,isAgentTask:C,priority:O,goalId:Q!=="none"?Q:void 0,assigneeId:w!=="none"?w:void 0,reporterId:V!=="none"?V:void 0,startDate:Z?Z.toISOString():void 0,dueDate:K?K.toISOString():void 0,projectId:f||void 0,targetFolderId:A||void 0,parentIds:j.length>0?j:void 0,assetIds:I_.length>0?I_.map((u)=>u.id):void 0}});if(!Y.ok){let u=await Y.text().catch(()=>""),a=W.error();if(u)try{let n_=JSON.parse(u);if(n_&&typeof n_.message==="string")a=n_.message}catch{a=u}throw Error(a)}return await Y.json()},onSuccess:()=>{L.invalidateQueries({queryKey:["teams",$,"kanban","tasks"]}),L.invalidateQueries({queryKey:["teams",$,"kanban","goals"]}),c.success(W.task_created()),F()},onError:(Y)=>{c.error(Y.message)}}),n1=(Y)=>{if(Y.preventDefault(),!U.trim()||v_)return;i1()},i_=C;return _(M_,{open:H,onOpenChange:(Y)=>!Y&&F(),children:J(w_,{className:"sm:max-w-3xl max-h-[90vh] overflow-y-auto",children:[J("form",{onSubmit:n1,className:"space-y-4",children:[_(F_,{children:_(K_,{children:W.create_task()})}),J("div",{className:"space-y-3.5 py-1",children:[J("div",{className:"space-y-1.5",children:[_(k,{htmlFor:"create-task-title",children:W.task_title()}),_(E_,{id:"create-task-title",value:U,onChange:(Y)=>M(Y.target.value),placeholder:W.task_title_placeholder(),required:!0,autoFocus:!0})]}),J("div",{className:"space-y-1.5",children:[_(k,{htmlFor:"create-task-desc",children:W.task_description()}),_(L_,{id:"create-task-desc",value:b,onChange:(Y)=>y(Y.target.value),placeholder:W.task_description_placeholder(),rows:3})]}),J("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[J("div",{className:"sm:col-span-2 flex items-center justify-between space-x-2 rounded-lg border border-border/80 bg-muted/30 p-2.5 h-14",children:[J("div",{className:"space-y-0.5 min-w-0 pr-2",children:[J(k,{htmlFor:"create-is-agent-task",className:"text-xs font-medium cursor-pointer flex items-center gap-1.5",children:[_($_,{className:"w-3.5 h-3.5 text-orange-500"}),_("span",{children:W.task_type_agent()})]}),_("p",{className:"text-[11px] text-muted-foreground line-clamp-1",children:W.task_type_agent_desc()})]}),_(S1,{id:"create-is-agent-task",checked:C,onCheckedChange:(Y)=>{S(Y),q("none")}})]}),J("div",{className:"space-y-1.5",children:[_(k,{className:"text-xs font-medium text-muted-foreground",children:W.task_priority()}),J(V_,{value:O,onValueChange:(Y)=>T(Y),children:[_(f_,{className:"w-full h-9 text-xs",children:_(Q_,{})}),_(N_,{children:Object.values(j_).map((Y)=>_(d,{value:Y,children:_("span",{className:m("px-1.5 py-0.5 rounded text-[10px] uppercase font-medium",u_(Y)),children:k_(Y)})},Y))})]})]}),J("div",{className:"space-y-1.5",children:[_(k,{className:"text-xs font-medium text-muted-foreground",children:W.goals()}),J(V_,{value:Q,onValueChange:X,children:[_(f_,{className:"w-full h-9 text-xs",children:_(Q_,{placeholder:"None"})}),J(N_,{children:[_(d,{value:"none",children:_("span",{className:"text-muted-foreground italic",children:"None"})}),x1.filter((Y)=>Y.id!==s).map((Y)=>_(d,{value:Y.id,children:J("div",{className:"flex items-center gap-2",children:[_(n,{className:"w-3.5 h-3.5 text-primary"}),_("span",{children:Y.title})]})},Y.id))]})]})]}),J("div",{className:"space-y-1.5",children:[_(k,{className:"text-xs font-medium text-muted-foreground",children:i_?W.select_agent():W.assignee()}),J(V_,{value:w,onValueChange:q,children:[_(f_,{className:"w-full h-9 text-xs",children:_(Q_,{placeholder:W.unassigned()})}),J(N_,{children:[_(d,{value:"none",children:_("span",{className:"text-muted-foreground italic",children:W.unassigned()})}),i_?j1.map((Y)=>_(d,{value:Y.id,children:J("div",{className:"flex items-center gap-2",children:[_($_,{className:"w-3.5 h-3.5 text-purple-500"}),_("span",{children:Y.name})]})},Y.id)):e_.map((Y)=>_(d,{value:Y.id,children:J("div",{className:"flex items-center gap-2",children:[J(X_,{size:"sm",className:"w-4 h-4",children:[_(H_,{src:Y.image}),_(z_,{className:"text-[8px]",children:Y.name.slice(0,2).toUpperCase()})]}),_("span",{children:Y.name})]})},Y.id))]})]})]}),J("div",{className:"space-y-1.5",children:[_(k,{className:"text-xs font-medium text-muted-foreground",children:W.reporter()}),J(V_,{value:V,onValueChange:z,children:[_(f_,{className:"w-full h-9 text-xs",children:_(Q_,{placeholder:W.unassigned()})}),J(N_,{children:[_(d,{value:"none",children:_("span",{className:"text-muted-foreground italic",children:W.unassigned()})}),e_.map((Y)=>_(d,{value:Y.id,children:J("div",{className:"flex items-center gap-2",children:[J(X_,{size:"sm",className:"w-4 h-4",children:[_(H_,{src:Y.image}),_(z_,{className:"text-[8px]",children:Y.name.slice(0,2).toUpperCase()})]}),_("span",{children:Y.name})]})},Y.id))]})]})]}),i_&&J("div",{className:"sm:col-span-2 space-y-1.5",children:[_(k,{className:"text-xs font-medium text-muted-foreground",children:W.target_folder()}),J(P,{type:"button",variant:"outline",size:"sm",onClick:()=>t_(!0),className:"w-full justify-start h-9 text-xs truncate font-normal",children:[_(C1,{className:"w-3.5 h-3.5 mr-2 text-primary shrink-0"}),_("span",{className:"truncate",children:I||W.select_target_folder()})]})]}),J("div",{className:"space-y-1.5",children:[_(k,{className:"text-xs font-medium text-muted-foreground",children:W.start_date()}),_(r_,{value:Z,onChange:N,placeholder:W.start_date(),className:"h-9 text-xs"})]}),J("div",{className:"space-y-1.5",children:[_(k,{className:"text-xs font-medium text-muted-foreground",children:W.due_date()}),_(r_,{value:K,onChange:v,placeholder:W.due_date(),className:"h-9 text-xs"})]}),J("div",{className:"sm:col-span-2 space-y-1.5",children:[_(k,{className:"text-xs font-medium text-muted-foreground",children:W.parent_tasks()}),_(D1,{teamId:$,value:j,onChange:h_})]}),_("div",{className:"sm:col-span-2 pt-1",children:_(p1,{teamId:$,projectId:f,assets:I_,onAddAssets:(Y)=>x_((u)=>[...u,...Y]),onRemoveAsset:(Y)=>x_((u)=>u.filter((a)=>a.id!==Y))})})]})]}),J(B_,{children:[_(P,{type:"button",variant:"outline",onClick:F,disabled:v_,children:W.cancel()}),J(P,{type:"submit",disabled:!U.trim()||v_,children:[v_&&_(g,{className:"w-4 h-4 mr-1.5 animate-spin"}),W.create()]})]})]}),a_&&_(T1,{teamId:$,currentProjectId:f,currentTargetFolderId:A,isOpen:a_,onClose:()=>t_(!1),onSelect:(Y,u,a)=>{R(Y),E(u),D(a||"Selected Folder")}})]})})}function k1({teamId:$,initialTaskId:H}){let[F,h]=r.useState("team"),[L,B]=r.useState(null),[U,M]=r.useState(H??null),[b,y]=r.useState(!1);r.useEffect(()=>{if(H)M(H)},[H]);let[C,S]=r.useState(l.TODO),{data:O,isLoading:T}=i({queryKey:["teams",$,"me"],queryFn:async()=>{let Z=await G.api.teams[":teamId"].me.$get({param:{teamId:$}});if(!Z.ok)throw Error("Failed to fetch me");return await Z.json()},enabled:!!$}),{data:Q}=i({queryKey:["teams",$,"kanban","goals"],queryFn:async()=>{let Z=await G.api.teams[":teamId"].kanban.goals.$get({param:{teamId:$},query:{}});if(!Z.ok)return{data:[]};return await Z.json()},enabled:!!$}),X=Q?.data||[],w=L?X.find((Z)=>Z.id===L)||null:null,q=O?.role?.toLowerCase()==="owner"||O?.role?.toLowerCase()==="editor",V=(Z=l.TODO)=>{S(Z),y(!0)},z=(Z)=>{M(Z.id)};if(T)return _("div",{className:"flex h-full items-center justify-center",children:_(g,{className:"w-8 h-8 animate-spin text-muted-foreground"})});return J("div",{className:"flex flex-row h-full bg-background overflow-hidden font-sans",children:[_(z1,{teamId:$,selectedGoalId:L,onSelectGoal:B,isOwnerOrEditor:q}),J("div",{className:"flex-1 flex flex-col min-w-0 h-full overflow-hidden",children:[_(W1,{scope:F,onScopeChange:h,selectedGoal:w,onClearGoal:()=>B(null),onCreateTask:()=>V(l.TODO),canCreateTask:q}),_(G1,{teamId:$,selectedGoalId:L,scope:F,currentUserId:O?.id,currentUserRole:O?.role,onTaskClick:z,onCreateTaskInColumn:(Z)=>V(Z)})]}),U&&_(m1,{teamId:$,taskId:U,isOpen:!!U,onClose:()=>M(null),canEdit:q}),b&&_(c1,{teamId:$,isOpen:b,initialStatus:C,initialGoalId:L,onClose:()=>y(!1)})]})}function d1(){let{teamId:$}=u1.useParams(),{taskId:H}=u1.useSearch();return _(k1,{teamId:$,initialTaskId:H})}var u1=g1("/teams/$teamId/kanban")({component:d1});export{u1 as Route};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{cm as C,dm as E,em as I,fm as b,gm as h,hm as B,im as x}from"./chunk-42f9r1sg.js";import{nm as M}from"./chunk-t16qt2ka.js";import{om as G,pm as K}from"./chunk-7m07t899.js";import{wm as T}from"./chunk-g6aq2cyq.js";import{zm as S}from"./chunk-d4ktgq49.js";import{Bm as O}from"./chunk-1whn0v5n.js";import{Gm as v,Hm as y}from"./chunk-34f4hk54.js";import{Im as P}from"./chunk-k33qdrdp.js";import"./chunk-wwjqqqr4.js";var k=0,D=(q,N,w)=>{let J=new P;return(async()=>{let j={role:"assistant",content:[],api:"google-generative-ai",provider:q.provider,model:q.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{let X=w?.apiKey;if(!X)throw Error(`No API key for provider: ${q.provider}`);let V=a(q,X,w?.headers),Y=m(q,N,w),$=await w?.onPayload?.(Y,q);if($!==void 0)Y=$;let g=await V.models.generateContentStream(Y);J.push({type:"start",partial:j});let Q=null,H=j.content,W=()=>H.length-1;for await(let Z of g){j.responseId||=Z.responseId;let z=Z.candidates?.[0];if(z?.content?.parts)for(let U of z.content.parts){if(U.text!==void 0){let _=C(U);if(!Q||_&&Q.type!=="thinking"||!_&&Q.type!=="text"){if(Q)if(Q.type==="text")J.push({type:"text_end",contentIndex:H.length-1,content:Q.text,partial:j});else J.push({type:"thinking_end",contentIndex:W(),content:Q.thinking,partial:j});if(_)Q={type:"thinking",thinking:"",thinkingSignature:void 0},j.content.push(Q),J.push({type:"thinking_start",contentIndex:W(),partial:j});else Q={type:"text",text:""},j.content.push(Q),J.push({type:"text_start",contentIndex:W(),partial:j})}if(Q.type==="thinking")Q.thinking+=U.text,Q.thinkingSignature=E(Q.thinkingSignature,U.thoughtSignature),J.push({type:"thinking_delta",contentIndex:W(),delta:U.text,partial:j});else Q.text+=U.text,Q.textSignature=E(Q.textSignature,U.thoughtSignature),J.push({type:"text_delta",contentIndex:W(),delta:U.text,partial:j})}if(U.functionCall){if(Q){if(Q.type==="text")J.push({type:"text_end",contentIndex:W(),content:Q.text,partial:j});else J.push({type:"thinking_end",contentIndex:W(),content:Q.thinking,partial:j});Q=null}let _=U.functionCall.id,A={type:"toolCall",id:!_||j.content.some((R)=>R.type==="toolCall"&&R.id===_)?`${U.functionCall.name}_${Date.now()}_${++k}`:_,name:U.functionCall.name||"",arguments:U.functionCall.args??{},...U.thoughtSignature&&{thoughtSignature:U.thoughtSignature}};j.content.push(A),J.push({type:"toolcall_start",contentIndex:W(),partial:j}),J.push({type:"toolcall_delta",contentIndex:W(),delta:JSON.stringify(A.arguments),partial:j}),J.push({type:"toolcall_end",contentIndex:W(),toolCall:A,partial:j})}}if(z?.finishReason){if(j.stopReason=x(z.finishReason),j.content.some((U)=>U.type==="toolCall"))j.stopReason="toolUse"}if(Z.usageMetadata)j.usage={input:(Z.usageMetadata.promptTokenCount||0)-(Z.usageMetadata.cachedContentTokenCount||0),output:(Z.usageMetadata.candidatesTokenCount||0)+(Z.usageMetadata.thoughtsTokenCount||0),cacheRead:Z.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:Z.usageMetadata.thoughtsTokenCount||0,totalTokens:Z.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},v(q,j.usage)}if(Q)if(Q.type==="text")J.push({type:"text_end",contentIndex:W(),content:Q.text,partial:j});else J.push({type:"thinking_end",contentIndex:W(),content:Q.thinking,partial:j});if(w?.signal?.aborted)throw Error("Request was aborted");if(j.stopReason==="aborted"||j.stopReason==="error")throw Error("An unknown error occurred");J.push({type:"done",reason:j.stopReason,message:j}),J.end()}catch(X){for(let V of j.content)if("index"in V)delete V.index;j.stopReason=w?.signal?.aborted?"aborted":"error",j.errorMessage=K(G(X)),J.push({type:"error",reason:j.stopReason,error:j}),J.end()}})(),J},qj=(q,N,w)=>{let J=w?.apiKey;if(!J)throw Error(`No API key for provider: ${q.provider}`);let j=T(q,N,w,J);if(!w?.reasoning)return D(q,N,{...j,thinking:{enabled:!1}});let X=y(q,w.reasoning),V=X==="off"?"high":X,Y=q;if(F(Y)||f(Y)||L(Y))return D(q,N,{...j,thinking:{enabled:!0,level:d(V,Y)}});return D(q,N,{...j,thinking:{enabled:!0,budgetTokens:c(Y,V,w.thinkingBudgets)}})};function a(q,N,w){let J={};if(q.baseUrl)J.baseUrl=q.baseUrl,J.apiVersion="";let j=O({...q.headers,...w});if(j)J.headers=j;return new M({apiKey:N,httpOptions:Object.keys(J).length>0?J:void 0})}function m(q,N,w={}){let J=I(q,N),j={};if(w.temperature!==void 0)j.temperature=w.temperature;if(w.maxTokens!==void 0)j.maxOutputTokens=w.maxTokens;let X=N.tools?.length?B(N.tools,w.toolChoice,h(q.id)):void 0,V={...Object.keys(j).length>0&&j,...N.systemPrompt&&{systemInstruction:S(N.systemPrompt)},...N.tools&&N.tools.length>0&&{tools:b(N.tools)},...X!==void 0&&{toolConfig:{functionCallingConfig:{mode:X}}}};if(w.thinking?.enabled&&q.reasoning){let $={includeThoughts:!0};if(w.thinking.level!==void 0)$.thinkingLevel=w.thinking.level;else if(w.thinking.budgetTokens!==void 0)$.thinkingBudget=w.thinking.budgetTokens;V.thinkingConfig=$}else if(q.reasoning&&w.thinking&&!w.thinking.enabled)V.thinkingConfig=u(q);if(w.signal){if(w.signal.aborted)throw Error("Request aborted");V.abortSignal=w.signal}return{model:q.id,contents:J,config:V}}function L(q){return/gemma-?4/.test(q.id.toLowerCase())}function F(q){return/gemini-3(?:\.\d+)?-pro/.test(q.id.toLowerCase())}function f(q){let N=q.id.toLowerCase();return/gemini-3(?:\.\d+)?-flash/.test(N)||N==="gemini-flash-latest"||N==="gemini-flash-lite-latest"}function u(q){if(F(q))return{thinkingLevel:"LOW"};if(f(q))return{thinkingLevel:"MINIMAL"};if(L(q))return{thinkingLevel:"MINIMAL"};return{thinkingBudget:0}}function d(q,N){if(F(N))switch(q){case"minimal":case"low":return"LOW";case"medium":case"high":return"HIGH"}if(L(N))switch(q){case"minimal":case"low":return"MINIMAL";case"medium":case"high":return"HIGH"}switch(q){case"minimal":return"MINIMAL";case"low":return"LOW";case"medium":return"MEDIUM";case"high":return"HIGH"}}function c(q,N,w){if(w?.[N]!==void 0)return w[N];if(q.id.includes("2.5-pro"))return{minimal:128,low:2048,medium:8192,high:32768}[N];if(q.id.includes("2.5-flash-lite"))return{minimal:512,low:2048,medium:8192,high:24576}[N];if(q.id.includes("2.5-flash"))return{minimal:128,low:2048,medium:8192,high:24576}[N];return-1}export{qj as streamSimple,D as stream};
2
+ import{pm as C,qm as E,rm as I,sm as b,tm as h,um as B,vm as x}from"./chunk-12r8a5ev.js";import{Am as M}from"./chunk-4yke5y3z.js";import{Bm as G,Cm as K}from"./chunk-wdgwymdp.js";import{Jm as T}from"./chunk-r18tcdds.js";import{Mm as S}from"./chunk-393g7z2g.js";import{Om as O}from"./chunk-xsqk7ek2.js";import{Tm as v,Um as y}from"./chunk-cmd0feyq.js";import{Vm as P}from"./chunk-a5ja6d97.js";import"./chunk-69at8jm8.js";var k=0,D=(q,N,w)=>{let J=new P;return(async()=>{let j={role:"assistant",content:[],api:"google-generative-ai",provider:q.provider,model:q.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{let X=w?.apiKey;if(!X)throw Error(`No API key for provider: ${q.provider}`);let V=a(q,X,w?.headers),Y=m(q,N,w),$=await w?.onPayload?.(Y,q);if($!==void 0)Y=$;let g=await V.models.generateContentStream(Y);J.push({type:"start",partial:j});let Q=null,H=j.content,W=()=>H.length-1;for await(let Z of g){j.responseId||=Z.responseId;let z=Z.candidates?.[0];if(z?.content?.parts)for(let U of z.content.parts){if(U.text!==void 0){let _=C(U);if(!Q||_&&Q.type!=="thinking"||!_&&Q.type!=="text"){if(Q)if(Q.type==="text")J.push({type:"text_end",contentIndex:H.length-1,content:Q.text,partial:j});else J.push({type:"thinking_end",contentIndex:W(),content:Q.thinking,partial:j});if(_)Q={type:"thinking",thinking:"",thinkingSignature:void 0},j.content.push(Q),J.push({type:"thinking_start",contentIndex:W(),partial:j});else Q={type:"text",text:""},j.content.push(Q),J.push({type:"text_start",contentIndex:W(),partial:j})}if(Q.type==="thinking")Q.thinking+=U.text,Q.thinkingSignature=E(Q.thinkingSignature,U.thoughtSignature),J.push({type:"thinking_delta",contentIndex:W(),delta:U.text,partial:j});else Q.text+=U.text,Q.textSignature=E(Q.textSignature,U.thoughtSignature),J.push({type:"text_delta",contentIndex:W(),delta:U.text,partial:j})}if(U.functionCall){if(Q){if(Q.type==="text")J.push({type:"text_end",contentIndex:W(),content:Q.text,partial:j});else J.push({type:"thinking_end",contentIndex:W(),content:Q.thinking,partial:j});Q=null}let _=U.functionCall.id,A={type:"toolCall",id:!_||j.content.some((R)=>R.type==="toolCall"&&R.id===_)?`${U.functionCall.name}_${Date.now()}_${++k}`:_,name:U.functionCall.name||"",arguments:U.functionCall.args??{},...U.thoughtSignature&&{thoughtSignature:U.thoughtSignature}};j.content.push(A),J.push({type:"toolcall_start",contentIndex:W(),partial:j}),J.push({type:"toolcall_delta",contentIndex:W(),delta:JSON.stringify(A.arguments),partial:j}),J.push({type:"toolcall_end",contentIndex:W(),toolCall:A,partial:j})}}if(z?.finishReason){if(j.stopReason=x(z.finishReason),j.content.some((U)=>U.type==="toolCall"))j.stopReason="toolUse"}if(Z.usageMetadata)j.usage={input:(Z.usageMetadata.promptTokenCount||0)-(Z.usageMetadata.cachedContentTokenCount||0),output:(Z.usageMetadata.candidatesTokenCount||0)+(Z.usageMetadata.thoughtsTokenCount||0),cacheRead:Z.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:Z.usageMetadata.thoughtsTokenCount||0,totalTokens:Z.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},v(q,j.usage)}if(Q)if(Q.type==="text")J.push({type:"text_end",contentIndex:W(),content:Q.text,partial:j});else J.push({type:"thinking_end",contentIndex:W(),content:Q.thinking,partial:j});if(w?.signal?.aborted)throw Error("Request was aborted");if(j.stopReason==="aborted"||j.stopReason==="error")throw Error("An unknown error occurred");J.push({type:"done",reason:j.stopReason,message:j}),J.end()}catch(X){for(let V of j.content)if("index"in V)delete V.index;j.stopReason=w?.signal?.aborted?"aborted":"error",j.errorMessage=K(G(X)),J.push({type:"error",reason:j.stopReason,error:j}),J.end()}})(),J},qj=(q,N,w)=>{let J=w?.apiKey;if(!J)throw Error(`No API key for provider: ${q.provider}`);let j=T(q,N,w,J);if(!w?.reasoning)return D(q,N,{...j,thinking:{enabled:!1}});let X=y(q,w.reasoning),V=X==="off"?"high":X,Y=q;if(F(Y)||f(Y)||L(Y))return D(q,N,{...j,thinking:{enabled:!0,level:d(V,Y)}});return D(q,N,{...j,thinking:{enabled:!0,budgetTokens:c(Y,V,w.thinkingBudgets)}})};function a(q,N,w){let J={};if(q.baseUrl)J.baseUrl=q.baseUrl,J.apiVersion="";let j=O({...q.headers,...w});if(j)J.headers=j;return new M({apiKey:N,httpOptions:Object.keys(J).length>0?J:void 0})}function m(q,N,w={}){let J=I(q,N),j={};if(w.temperature!==void 0)j.temperature=w.temperature;if(w.maxTokens!==void 0)j.maxOutputTokens=w.maxTokens;let X=N.tools?.length?B(N.tools,w.toolChoice,h(q.id)):void 0,V={...Object.keys(j).length>0&&j,...N.systemPrompt&&{systemInstruction:S(N.systemPrompt)},...N.tools&&N.tools.length>0&&{tools:b(N.tools)},...X!==void 0&&{toolConfig:{functionCallingConfig:{mode:X}}}};if(w.thinking?.enabled&&q.reasoning){let $={includeThoughts:!0};if(w.thinking.level!==void 0)$.thinkingLevel=w.thinking.level;else if(w.thinking.budgetTokens!==void 0)$.thinkingBudget=w.thinking.budgetTokens;V.thinkingConfig=$}else if(q.reasoning&&w.thinking&&!w.thinking.enabled)V.thinkingConfig=u(q);if(w.signal){if(w.signal.aborted)throw Error("Request aborted");V.abortSignal=w.signal}return{model:q.id,contents:J,config:V}}function L(q){return/gemma-?4/.test(q.id.toLowerCase())}function F(q){return/gemini-3(?:\.\d+)?-pro/.test(q.id.toLowerCase())}function f(q){let N=q.id.toLowerCase();return/gemini-3(?:\.\d+)?-flash/.test(N)||N==="gemini-flash-latest"||N==="gemini-flash-lite-latest"}function u(q){if(F(q))return{thinkingLevel:"LOW"};if(f(q))return{thinkingLevel:"MINIMAL"};if(L(q))return{thinkingLevel:"MINIMAL"};return{thinkingBudget:0}}function d(q,N){if(F(N))switch(q){case"minimal":case"low":return"LOW";case"medium":case"high":return"HIGH"}if(L(N))switch(q){case"minimal":case"low":return"MINIMAL";case"medium":case"high":return"HIGH"}switch(q){case"minimal":return"MINIMAL";case"low":return"LOW";case"medium":return"MEDIUM";case"high":return"HIGH"}}function c(q,N,w){if(w?.[N]!==void 0)return w[N];if(q.id.includes("2.5-pro"))return{minimal:128,low:2048,medium:8192,high:32768}[N];if(q.id.includes("2.5-flash-lite"))return{minimal:512,low:2048,medium:8192,high:24576}[N];if(q.id.includes("2.5-flash"))return{minimal:128,low:2048,medium:8192,high:24576}[N];return-1}export{qj as streamSimple,D as stream};
@@ -0,0 +1,2 @@
1
+ import{Tf as p}from"./chunk-wch8ygpt.js";import{ig as j,kg as F}from"./chunk-3ztat2q9.js";import{ei as q,ji as P,qi as f,yi as _}from"./chunk-jsqsrcse.js";import{Ji as s}from"./chunk-48yphy68.js";import{Zm as l}from"./chunk-69at8jm8.js";var i={x:0.5,y:0.5};class D extends F{apply({activatorEvent:Z,shape:L,transform:E}){if(!L||!(Z instanceof PointerEvent))return E;let M=this.options?.anchor??i,{boundingRectangle:G}=L.initial,Q=G.left+G.width*M.x,J=G.top+G.height*M.y;return{x:E.x+Z.clientX-Q,y:E.y+Z.clientY-J}}static configure=j(D)}var C=l(s(),1);function YO({teamId:Z,projectId:L,assetId:E,folders:M,files:G,selectedIds:Q,onClearSelection:J}){let T=q(),[N,A]=C.useState(void 0),y=(Y,R)=>{let h=["search",Z,E,Y?"folder":"file"],U=T.getQueriesData({queryKey:h}),H=(X)=>{if(typeof X!=="object"||X===null)return!1;let O=X;return"field"in O&&"order"in O&&typeof O.field==="string"&&(O.order==="asc"||O.order==="desc")};for(let[X,O]of U){if(!O||!Array.isArray(O.pages))continue;let z=X.find(H),k=O.pages.flatMap((w)=>w.data??[]),K=k.findIndex((w)=>w.id===R.id);if(K===-1)continue;if(k[K]={...k[K],...R},z?.field==="custom"){let w=z.order==="desc";k.sort((B,x)=>{let $=B.sortIndex??"",b=x.sortIndex??"";if($===b)return 0;if(w)return $<b?1:-1;else return $<b?-1:1})}let V=0,o=O.pages.map((w)=>{let B=w.data?w.data.length:0,x=k.slice(V,V+B);return V+=B,{...w,data:x}});T.setQueryData(X,{...O,pages:o})}},v=f.api.projects[":projectId"].reparent.$post,{mutate:c}=P({mutationFn:async(Y)=>{if(!(await v(Y)).ok)throw Error("Failed to move assets");return null}}),n=f.api.folders[":folderId"].order.$patch,{mutate:u}=P({mutationFn:async(Y)=>{let R=await n(Y);if(!R.ok)throw Error("Failed to reorder folder");return await R.json()}}),m=f.api.files[":fileId"].order.$patch,{mutate:S}=P({mutationFn:async(Y)=>{let R=await m(Y);if(!R.ok)throw Error("Failed to reorder file");return await R.json()}}),I=f.api.shares[":shareId"].assets.$post,{mutate:g}=P({mutationFn:async(Y)=>{let R=await I(Y);if(!R.ok)throw Error("Failed to add asset to share");return await R.json()}});return{dragState:N,handleDragStart:(Y)=>{let R=Y.operation.source;if(!R)return;let W=R.id.split(":").pop(),h=R.data;if(!h)return;let U,H;if(Q.has(W))U=new Set(Q),H=[...M,...G].filter((O)=>Q.has(O.id));else U=new Set([W]),H=[h.item];let X=H.some((O)=>O.type==="folder");A({isActive:!0,draggedIds:U,hasFolders:X,itemCount:U.size})},handleDragEnd:(Y)=>{let{target:R}=Y.operation;if(R&&N){let W=R.id.split(":").pop(),h=R.data;if(h?.type==="chatbot-sidebar"){let X=[...M,...G].filter((O)=>N.draggedIds.has(O.id)).map((O)=>({id:O.id,name:O.name||"Unnamed",type:O.type}));p.getState().addAssets(X),J(),A(void 0);return}if(h?.type==="share-link"){let H=W,X=Array.from(N.draggedIds);g({param:{shareId:H},json:{assetIds:X}},{onSuccess:(O)=>{if(O.addedCount===0)_.info("Assets already exists in share");else _.success(`Added ${O.addedCount} item(s) to share link`);T.invalidateQueries({queryKey:["shares",L]}),J()},onError:(O)=>{_.error(`Failed to add to share: ${O.message}`)}}),A(void 0);return}let U=!1;if(h&&!N.draggedIds.has(W)){if(h.type==="folder"||h.type==="reorder")U=!0;else if(h.type==="file"){if(!N.hasFolders&&N.itemCount===1)U=!0}}if(h?.type==="reorder"){let{position:H,item:X}=h,O=N.hasFolders,z=Array.from(N.draggedIds)[0];if(O)u({param:{folderId:z},json:H==="before"?{beforeIndex:X.sortIndex??void 0}:{afterIndex:X.sortIndex??void 0}},{onSuccess:(k)=>{_.success("Folder reordered"),y(!0,k),J()},onError:(k)=>{_.error(`Failed to reorder: ${k.message}`)}});else S({param:{fileId:z},json:H==="before"?{beforeIndex:X.sortIndex??void 0}:{afterIndex:X.sortIndex??void 0}},{onSuccess:(k)=>{_.success("File reordered"),y(!1,k),J()},onError:(k)=>{_.error(`Failed to reorder: ${k.message}`)}})}else if(U)c({param:{projectId:L},json:{assetIds:Array.from(N.draggedIds),newParentId:W}},{onSuccess:()=>{_.success("Assets moved successfully"),T.invalidateQueries({queryKey:["search",Z,E]}),T.invalidateQueries({queryKey:["folders"]}),J()},onError:()=>{_.error("Failed to move assets")}})}A(void 0)}}}
2
+ export{D as e,YO as f};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Yl as L}from"./chunk-v1ybpqrz.js";import{_l as E}from"./chunk-8zmk029n.js";import{om as M,pm as S}from"./chunk-7m07t899.js";import{zm as O}from"./chunk-d4ktgq49.js";import{Am as b,Bm as q}from"./chunk-1whn0v5n.js";import"./chunk-wwjqqqr4.js";var y=async(B,J,D)=>{let F={api:B.api,provider:B.provider,model:B.id,output:[],stopReason:"stop",timestamp:Date.now()};try{let G=D?.apiKey;if(!G)throw Error(`No API key for provider: ${B.provider}`);let V=C(B,G,D?.headers),Q=H(B,J),X=await D?.onPayload?.(Q,B);if(X!==void 0)Q=X;let N={...D?.signal?{signal:D.signal}:{},...D?.timeoutMs!==void 0?{timeout:D.timeoutMs}:{},maxRetries:0},{data:z,response:A}=await E(()=>V.chat.completions.create(Q,N).withResponse(),{maxRetries:D?.maxRetries,maxRetryDelayMs:D?.maxRetryDelayMs,signal:D?.signal});await D?.onResponse?.({status:A.status,headers:b(A.headers)},B);let Y=z;if(F.responseId=Y.id,Y.usage)F.usage=K(Y.usage,B);let Z=Y.choices[0];if(Z){let _=Z.message.content;if(typeof _==="string"&&_.length>0)F.output.push({type:"text",text:_});for(let $ of Z.message.images??[]){let I=typeof $.image_url==="string"?$.image_url:$.image_url?.url;if(!I?.startsWith("data:"))continue;let f=I.match(/^data:([^;]+);base64,(.+)$/);if(!f)continue;F.output.push({type:"image",mimeType:f[1],data:f[2]})}}return F}catch(G){return F.stopReason=D?.signal?.aborted?"aborted":"error",F.errorMessage=S(M(G)),F}};function C(B,J,D){return new L({apiKey:J,baseURL:B.baseUrl,dangerouslyAllowBrowser:!0,defaultHeaders:q({...B.headers,...D})})}function H(B,J){let D=J.input.map((F)=>{if(F.type==="text")return{type:"text",text:O(F.text)};return{type:"image_url",image_url:{url:`data:${F.mimeType};base64,${F.data}`}}});return{model:B.id,messages:[{role:"user",content:D}],stream:!1,modalities:B.output.includes("text")?["image","text"]:["image"]}}function K(B,J){let D=B.prompt_tokens||0,F=B.prompt_tokens_details?.cached_tokens||0,G=B.prompt_tokens_details?.cache_write_tokens||0,V=G>0?Math.max(0,F-G):F,Q=Math.max(0,D-V-G),X=B.completion_tokens||0,N={input:Q,output:X,cacheRead:V,cacheWrite:G,totalTokens:Q+X+V+G,cost:{input:J.cost.input/1e6*Q,output:J.cost.output/1e6*X,cacheRead:J.cost.cacheRead/1e6*V,cacheWrite:J.cost.cacheWrite/1e6*G,total:0}};return N.cost.total=N.cost.input+N.cost.output+N.cost.cacheRead+N.cost.cacheWrite,N}export{y as generateImages};
2
+ import{jm as L}from"./chunk-pz7ms4n2.js";import{lm as E}from"./chunk-fv14er33.js";import{Bm as M,Cm as S}from"./chunk-wdgwymdp.js";import{Mm as O}from"./chunk-393g7z2g.js";import{Nm as b,Om as q}from"./chunk-xsqk7ek2.js";import"./chunk-69at8jm8.js";var y=async(B,J,D)=>{let F={api:B.api,provider:B.provider,model:B.id,output:[],stopReason:"stop",timestamp:Date.now()};try{let G=D?.apiKey;if(!G)throw Error(`No API key for provider: ${B.provider}`);let V=C(B,G,D?.headers),Q=H(B,J),X=await D?.onPayload?.(Q,B);if(X!==void 0)Q=X;let N={...D?.signal?{signal:D.signal}:{},...D?.timeoutMs!==void 0?{timeout:D.timeoutMs}:{},maxRetries:0},{data:z,response:A}=await E(()=>V.chat.completions.create(Q,N).withResponse(),{maxRetries:D?.maxRetries,maxRetryDelayMs:D?.maxRetryDelayMs,signal:D?.signal});await D?.onResponse?.({status:A.status,headers:b(A.headers)},B);let Y=z;if(F.responseId=Y.id,Y.usage)F.usage=K(Y.usage,B);let Z=Y.choices[0];if(Z){let _=Z.message.content;if(typeof _==="string"&&_.length>0)F.output.push({type:"text",text:_});for(let $ of Z.message.images??[]){let I=typeof $.image_url==="string"?$.image_url:$.image_url?.url;if(!I?.startsWith("data:"))continue;let f=I.match(/^data:([^;]+);base64,(.+)$/);if(!f)continue;F.output.push({type:"image",mimeType:f[1],data:f[2]})}}return F}catch(G){return F.stopReason=D?.signal?.aborted?"aborted":"error",F.errorMessage=S(M(G)),F}};function C(B,J,D){return new L({apiKey:J,baseURL:B.baseUrl,dangerouslyAllowBrowser:!0,defaultHeaders:q({...B.headers,...D})})}function H(B,J){let D=J.input.map((F)=>{if(F.type==="text")return{type:"text",text:O(F.text)};return{type:"image_url",image_url:{url:`data:${F.mimeType};base64,${F.data}`}}});return{model:B.id,messages:[{role:"user",content:D}],stream:!1,modalities:B.output.includes("text")?["image","text"]:["image"]}}function K(B,J){let D=B.prompt_tokens||0,F=B.prompt_tokens_details?.cached_tokens||0,G=B.prompt_tokens_details?.cache_write_tokens||0,V=G>0?Math.max(0,F-G):F,Q=Math.max(0,D-V-G),X=B.completion_tokens||0,N={input:Q,output:X,cacheRead:V,cacheWrite:G,totalTokens:Q+X+V+G,cost:{input:J.cost.input/1e6*Q,output:J.cost.output/1e6*X,cacheRead:J.cost.cacheRead/1e6*V,cacheWrite:J.cost.cacheWrite/1e6*G,total:0}};return N.cost.total=N.cost.input+N.cost.output+N.cost.cacheRead+N.cost.cacheWrite,N}export{y as generateImages};
@@ -1,2 +1,2 @@
1
- import{Yh as m,_h as o,al as d,ql as p,sl as i}from"./chunk-yfgwknpa.js";import{Mm as c}from"./chunk-wwjqqqr4.js";var n=c(m(),1);var l=d("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 min-w-9 px-2",sm:"h-8 min-w-8 px-1.5",lg:"h-10 min-w-10 px-2.5"}},defaultVariants:{variant:"default",size:"default"}});var u=n.createContext({size:"default",variant:"default",spacing:0});function y({className:s,variant:r,size:a,spacing:e=0,children:g,...t}){return o(p.Root,{"data-slot":"toggle-group","data-variant":r,"data-size":a,"data-spacing":e,style:{"--gap":e},className:i("group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",s),...t,children:o(u.Provider,{value:{variant:r,size:a,spacing:e},children:g})})}function R({className:s,children:r,variant:a,size:e,...g}){let t=n.useContext(u);return o(p.Item,{"data-slot":"toggle-group-item","data-variant":t.variant||a,"data-size":t.size||e,"data-spacing":t.spacing,className:i(l({variant:t.variant||a,size:t.size||e}),"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10","data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",s),...g,children:r})}
1
+ import{Cl as d,Ji as m,Li as o,Ul as p,Wl as i}from"./chunk-48yphy68.js";import{Zm as c}from"./chunk-69at8jm8.js";var n=c(m(),1);var l=d("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 min-w-9 px-2",sm:"h-8 min-w-8 px-1.5",lg:"h-10 min-w-10 px-2.5"}},defaultVariants:{variant:"default",size:"default"}});var u=n.createContext({size:"default",variant:"default",spacing:0});function y({className:s,variant:r,size:a,spacing:e=0,children:g,...t}){return o(p.Root,{"data-slot":"toggle-group","data-variant":r,"data-size":a,"data-spacing":e,style:{"--gap":e},className:i("group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",s),...t,children:o(u.Provider,{value:{variant:r,size:a,spacing:e},children:g})})}function R({className:s,children:r,variant:a,size:e,...g}){let t=n.useContext(u);return o(p.Item,{"data-slot":"toggle-group-item","data-variant":t.variant||a,"data-size":t.size||e,"data-spacing":t.spacing,className:i(l({variant:t.variant||a,size:t.size||e}),"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10","data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",s),...g,children:r})}
2
2
  export{y as T,R as U};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{jm as L,lm as A}from"./chunk-t16qt2ka.js";import{sm as x,ym as T}from"./chunk-g6aq2cyq.js";import{zm as K}from"./chunk-d4ktgq49.js";function P(b){return b.thought===!0}function d(b,q){if(typeof q==="string"&&q.length>0)return q;return b}var F=/^[A-Za-z0-9+/]+={0,2}$/;function V(b){if(!b)return!1;if(b.length%4!==0)return!1;return F.test(b)}function W(b,q){return b&&V(q)?q:void 0}function X(b){return b.startsWith("claude-")||b.startsWith("gpt-oss-")}function f(b){let q=b.toLowerCase().match(/^gemini(?:-live)?-(\d+)/);if(!q)return;return Number.parseInt(q[1],10)}function B(b){let q=f(b);if(q!==void 0)return q>=3;return!0}function g(b,q){let z=[],N=(D)=>{if(!X(b.id))return D;return D.replace(/[^a-zA-Z0-9_-]/g,"_").slice(0,64)},Q=T(q.messages,b,N);for(let D of Q)if(D.role==="user")if(typeof D.content==="string")z.push({role:"user",parts:[{text:K(D.content)}]});else{let G=D.content.map((E)=>{if(E.type==="text")return{text:K(E.text)};else return{inlineData:{mimeType:E.mimeType,data:E.data}}});if(G.length===0)continue;z.push({role:"user",parts:G})}else if(D.role==="assistant"){let G=[],E=D.provider===b.provider&&D.model===b.id;for(let w of D.content)if(w.type==="text"){if(!w.text||w.text.trim()==="")continue;let H=W(E,w.textSignature);G.push({text:K(w.text),...H&&{thoughtSignature:H}})}else if(w.type==="thinking"){if(!w.thinking||w.thinking.trim()==="")continue;if(E){let H=W(E,w.thinkingSignature);G.push({thought:!0,text:K(w.thinking),...H&&{thoughtSignature:H}})}else G.push({text:K(w.thinking)})}else if(w.type==="toolCall"){let H=W(E,w.thoughtSignature),O={functionCall:{name:w.name,args:w.arguments??{},...X(b.id)?{id:w.id}:{}},...H&&{thoughtSignature:H}};G.push(O)}if(G.length===0)continue;z.push({role:"model",parts:G})}else if(D.role==="toolResult"){let E=D.content.filter((J)=>J.type==="text").map((J)=>J.text).join(`
2
+ import{wm as L,ym as A}from"./chunk-4yke5y3z.js";import{Fm as x,Lm as T}from"./chunk-r18tcdds.js";import{Mm as K}from"./chunk-393g7z2g.js";function P(b){return b.thought===!0}function d(b,q){if(typeof q==="string"&&q.length>0)return q;return b}var F=/^[A-Za-z0-9+/]+={0,2}$/;function V(b){if(!b)return!1;if(b.length%4!==0)return!1;return F.test(b)}function W(b,q){return b&&V(q)?q:void 0}function X(b){return b.startsWith("claude-")||b.startsWith("gpt-oss-")}function f(b){let q=b.toLowerCase().match(/^gemini(?:-live)?-(\d+)/);if(!q)return;return Number.parseInt(q[1],10)}function B(b){let q=f(b);if(q!==void 0)return q>=3;return!0}function g(b,q){let z=[],N=(D)=>{if(!X(b.id))return D;return D.replace(/[^a-zA-Z0-9_-]/g,"_").slice(0,64)},Q=T(q.messages,b,N);for(let D of Q)if(D.role==="user")if(typeof D.content==="string")z.push({role:"user",parts:[{text:K(D.content)}]});else{let G=D.content.map((E)=>{if(E.type==="text")return{text:K(E.text)};else return{inlineData:{mimeType:E.mimeType,data:E.data}}});if(G.length===0)continue;z.push({role:"user",parts:G})}else if(D.role==="assistant"){let G=[],E=D.provider===b.provider&&D.model===b.id;for(let w of D.content)if(w.type==="text"){if(!w.text||w.text.trim()==="")continue;let H=W(E,w.textSignature);G.push({text:K(w.text),...H&&{thoughtSignature:H}})}else if(w.type==="thinking"){if(!w.thinking||w.thinking.trim()==="")continue;if(E){let H=W(E,w.thinkingSignature);G.push({thought:!0,text:K(w.thinking),...H&&{thoughtSignature:H}})}else G.push({text:K(w.thinking)})}else if(w.type==="toolCall"){let H=W(E,w.thoughtSignature),O={functionCall:{name:w.name,args:w.arguments??{},...X(b.id)?{id:w.id}:{}},...H&&{thoughtSignature:H}};G.push(O)}if(G.length===0)continue;z.push({role:"model",parts:G})}else if(D.role==="toolResult"){let E=D.content.filter((J)=>J.type==="text").map((J)=>J.text).join(`
3
3
  `),w=b.input.includes("image")?D.content.filter((J)=>J.type==="image"):[],H=E.length>0,O=w.length>0,Y=B(b.id),Z=H?K(E):O?"(see attached image)":"",_=w.map((J)=>({inlineData:{mimeType:J.mimeType,data:J.data}})),y=X(b.id),$={functionResponse:{name:D.toolName,response:D.isError?{error:Z}:{output:Z},...O&&Y&&{parts:_},...y?{id:D.toolCallId}:{}}},U=z[z.length-1];if(U?.role==="user"&&U.parts?.some((J)=>J.functionResponse))U.parts.push($);else z.push({role:"user",parts:[$]});if(O&&!Y)z.push({role:"user",parts:[{text:"Tool result image:"},..._]})}return z}var R=new Set(["$schema","$id","$anchor","$dynamicAnchor","$vocabulary","$comment","$defs","definitions"]);function j(b){if(typeof b!=="object"||b===null||Array.isArray(b))return b;let q={};for(let[z,N]of Object.entries(b)){if(R.has(z))continue;q[z]=j(N)}return q}function p(b,q=!1){if(b.length===0)return;return[{functionDeclarations:b.map((z)=>({name:z.name,description:z.description,...q?{parameters:j(z.parameters)}:{parametersJsonSchema:z.parameters}}))}]}function C(b){let q=f(b);return q!==void 0&&q>=3}function v(b){switch(b){case"auto":return L.AUTO;case"none":return L.NONE;case"any":return L.ANY;default:return L.AUTO}}function u(b,q,z){let N=b.some((Q)=>x(Q,z)===!0);if(q==="none"||q==="any")return v(q);if(N)return L.VALIDATED;return q?v(q):void 0}function h(b){switch(b){case A.STOP:return"stop";case A.MAX_TOKENS:return"length";case A.BLOCKLIST:case A.PROHIBITED_CONTENT:case A.SPII:case A.SAFETY:case A.IMAGE_SAFETY:case A.IMAGE_PROHIBITED_CONTENT:case A.IMAGE_RECITATION:case A.IMAGE_OTHER:case A.RECITATION:case A.FINISH_REASON_UNSPECIFIED:case A.OTHER:case A.LANGUAGE:case A.MALFORMED_FUNCTION_CALL:case A.UNEXPECTED_TOOL_CALL:case A.NO_IMAGE:return"error";default:throw Error(`Unhandled stop reason: ${b}`)}}
4
- export{P as cm,d as dm,g as em,p as fm,C as gm,u as hm,h as im};
4
+ export{P as pm,d as qm,g as rm,p as sm,C as tm,u as um,h as vm};