@shumai-one/shumai 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/bin/{chunk-2xgvs3as.js → chunk-07h4b77v.js} +2 -2
  2. package/bin/{chunk-gazp5662.js → chunk-0t4n4d5w.js} +2 -2
  3. package/bin/{chunk-x9akgj7w.js → chunk-1611z9jg.js} +2 -2
  4. package/bin/{chunk-kvnfgr29.js → chunk-1phqxp6z.js} +1 -1
  5. package/bin/chunk-23hckrrz.js +2 -0
  6. package/bin/{chunk-ymr5ybxk.js → chunk-30z44j1g.js} +2 -2
  7. package/bin/{chunk-fcsfssar.js → chunk-3j463k1g.js} +1 -1
  8. package/bin/{chunk-zye42cfp.js → chunk-4181tdds.js} +1 -1
  9. package/bin/chunk-480jtqng.js +4 -0
  10. package/bin/{chunk-m8z8jvdq.js → chunk-4c3g146q.js} +2 -2
  11. package/bin/chunk-4ca0zt5e.js +1 -0
  12. package/bin/chunk-4d9bgmf2.js +2 -0
  13. package/bin/{chunk-fvbd5dk7.js → chunk-4ev56fss.js} +5 -5
  14. package/bin/{chunk-zmyawgth.js → chunk-4gk52tjq.js} +1 -1
  15. package/bin/chunk-4mdqkj4d.js +1 -0
  16. package/bin/{chunk-mhps85dd.js → chunk-4r91fggc.js} +1 -1
  17. package/bin/chunk-50fb1x3w.js +1 -0
  18. package/bin/chunk-59gj1njz.js +1 -0
  19. package/bin/{chunk-j04sztp3.js → chunk-5pr0t7fb.js} +1 -1
  20. package/bin/chunk-5vewxmz7.js +3 -0
  21. package/bin/chunk-62zx96pe.js +2 -0
  22. package/bin/chunk-63y0eb07.js +2 -0
  23. package/bin/chunk-6d5xrgfx.js +2 -0
  24. package/bin/{chunk-etprs58p.js → chunk-6gbtz5bf.js} +2 -2
  25. package/bin/{chunk-wrgwjg2g.js → chunk-6gjg5egq.js} +1 -1
  26. package/bin/{chunk-4q782s34.js → chunk-6m4jz9s1.js} +3 -3
  27. package/bin/{chunk-wehhpcm1.js → chunk-6s4x525w.js} +1 -1
  28. package/bin/{chunk-xzag8w1v.js → chunk-6w2wmvqs.js} +1 -1
  29. package/bin/{chunk-r2shjtte.js → chunk-77d23vcn.js} +2 -2
  30. package/bin/{chunk-vhcqazqf.js → chunk-77m5p188.js} +2 -2
  31. package/bin/chunk-7bvx087f.js +1 -0
  32. package/bin/chunk-7pfjfrjg.js +5 -0
  33. package/bin/{chunk-1qr0ajc8.js → chunk-7q10s127.js} +1 -1
  34. package/bin/{chunk-c3msq02x.js → chunk-7thx8ctx.js} +2 -2
  35. package/bin/{chunk-vvhs586e.js → chunk-8t4s91gh.js} +1 -1
  36. package/bin/{chunk-k3r97v7j.js → chunk-98ey5p2e.js} +1 -1
  37. package/bin/{chunk-44edgqvy.js → chunk-9amndcyh.js} +3 -3
  38. package/bin/chunk-9bk23g9x.js +1 -0
  39. package/bin/chunk-9mkcfy43.js +1 -0
  40. package/bin/{chunk-0h8rjeyj.js → chunk-9t3nsq5n.js} +2 -2
  41. package/bin/{chunk-j536e9nx.js → chunk-9tjq99ds.js} +2 -2
  42. package/bin/chunk-9wm9rwh1.js +2 -0
  43. package/bin/{chunk-nz2v1jmd.js → chunk-ab16fyg4.js} +2 -2
  44. package/bin/chunk-arv0g2av.js +1 -0
  45. package/bin/{chunk-hx2mvd20.js → chunk-aytj4zxg.js} +2 -2
  46. package/bin/{chunk-02afmyqy.js → chunk-b1ypjqgp.js} +2 -2
  47. package/bin/{chunk-93ecxcy4.js → chunk-bdjv0ykq.js} +1 -1
  48. package/bin/chunk-c1k86mfa.js +10 -0
  49. package/bin/{chunk-wy2f6mby.js → chunk-caa96dgd.js} +1 -1
  50. package/bin/chunk-ce4v2yjy.js +1 -0
  51. package/bin/{chunk-m2tbft2c.js → chunk-cqh60y54.js} +2 -2
  52. package/bin/chunk-cvq7zgw7.js +1 -0
  53. package/bin/{chunk-tcm57j8r.js → chunk-d9mjbtp2.js} +2 -2
  54. package/bin/{chunk-xkhwj8mw.js → chunk-dn7sbjws.js} +2 -2
  55. package/bin/{chunk-p49h5fxs.js → chunk-dxyq9h8n.js} +1 -1
  56. package/bin/{chunk-3twtxs5m.js → chunk-e3cabksx.js} +1 -1
  57. package/bin/{chunk-52dr035y.js → chunk-egcrbj94.js} +2 -2
  58. package/bin/chunk-ev17v1mv.js +2 -0
  59. package/bin/chunk-evtpwg71.js +2 -0
  60. package/bin/{chunk-2rbexbv0.js → chunk-f3e0nsv2.js} +1 -1
  61. package/bin/chunk-f40gjqpq.js +2 -0
  62. package/bin/chunk-fe7822ak.js +299 -0
  63. package/bin/{chunk-4b7jcpgv.js → chunk-g8tkhw9j.js} +2 -2
  64. package/bin/{chunk-mgnxa0vy.js → chunk-g9r0p4t8.js} +1 -1
  65. package/bin/chunk-gbjyh9ms.js +1 -0
  66. package/bin/{chunk-thbfw1ed.js → chunk-gtbsb39v.js} +1 -1
  67. package/bin/{chunk-zh752hw8.js → chunk-gytz1q13.js} +1 -1
  68. package/bin/chunk-h0fxysxs.js +7 -0
  69. package/bin/{chunk-aw5zkdma.js → chunk-h8bdvsqt.js} +2 -2
  70. package/bin/{chunk-76433x4d.js → chunk-hag024w8.js} +2 -2
  71. package/bin/chunk-hc6w5nw4.js +7 -0
  72. package/bin/chunk-j69dqc48.js +2 -0
  73. package/bin/{chunk-yfqz6f72.js → chunk-jbtw1zym.js} +1 -1
  74. package/bin/{chunk-9k76s3y6.js → chunk-jc1vb7rj.js} +2 -2
  75. package/bin/{chunk-41d9gkx7.js → chunk-jdv78w9r.js} +1 -1
  76. package/bin/{chunk-dag45evp.js → chunk-jjs70y9v.js} +1 -1
  77. package/bin/{chunk-ysvhtgve.js → chunk-jmdar2gz.js} +2 -2
  78. package/bin/chunk-jvwz10n4.js +2 -0
  79. package/bin/{chunk-ck6msfch.js → chunk-k47md1g4.js} +2 -2
  80. package/bin/{chunk-yyjx8nbq.js → chunk-k4v0brcb.js} +1 -1
  81. package/bin/chunk-k6n7c07e.js +1 -0
  82. package/bin/{chunk-kjjhvrk1.js → chunk-kk2cstsg.js} +1 -1
  83. package/bin/{chunk-3r33kewe.js → chunk-knz4h56q.js} +3 -3
  84. package/bin/{chunk-j5rx3x1q.js → chunk-kqqtt6bd.js} +1 -1
  85. package/bin/{chunk-ez6veng7.js → chunk-kvyp1t4j.js} +1 -1
  86. package/bin/{chunk-djx2r4nj.js → chunk-kxskpgsq.js} +2 -2
  87. package/bin/{chunk-3gjn4pyp.js → chunk-m6srbjcs.js} +2 -2
  88. package/bin/{chunk-8956rryj.js → chunk-mcc1scxs.js} +2 -2
  89. package/bin/{chunk-0bfqrx5q.js → chunk-mq83a0kk.js} +2 -2
  90. package/bin/chunk-mxm8g4q0.js +1 -0
  91. package/bin/{chunk-6m1k317a.js → chunk-nhpgdqq5.js} +2 -2
  92. package/bin/{chunk-pdjar480.js → chunk-nne496aa.js} +2 -2
  93. package/bin/{chunk-s73c0brj.js → chunk-nqpb0r9h.js} +1 -1
  94. package/bin/chunk-ns0zww9g.js +2 -0
  95. package/bin/{chunk-9cmvymm5.js → chunk-ps4xfp23.js} +1 -1
  96. package/bin/chunk-pz2ec6xt.js +2 -0
  97. package/bin/{chunk-vkgxrn1h.js → chunk-q163k309.js} +2 -2
  98. package/bin/chunk-q1da61ps.js +1 -0
  99. package/bin/{chunk-7x1vkftb.js → chunk-qrf0ady6.js} +2 -2
  100. package/bin/{chunk-d7en47eh.js → chunk-qy28f25e.js} +1 -1
  101. package/bin/{chunk-xjnghr99.js → chunk-r7s4ypw1.js} +1 -1
  102. package/bin/chunk-ran23vm9.js +1 -0
  103. package/bin/chunk-rfvdc4n0.js +2 -0
  104. package/bin/{chunk-8rcfhfq5.js → chunk-rgthkvgx.js} +1 -1
  105. package/bin/chunk-s39n3yw3.js +2 -0
  106. package/bin/{chunk-xv5h4dv1.js → chunk-s7wdd0g7.js} +1 -1
  107. package/bin/{chunk-n8gsjwht.js → chunk-s88ha5kx.js} +2 -2
  108. package/bin/chunk-sf91bt9m.js +2 -0
  109. package/bin/{chunk-2x46963w.js → chunk-sjwbjf9j.js} +1 -1
  110. package/bin/chunk-t62076pv.js +1 -0
  111. package/bin/{chunk-he1ywtxx.js → chunk-tbbwss3v.js} +1 -1
  112. package/bin/{chunk-06spnkta.js → chunk-tjcc7a6y.js} +1 -1
  113. package/bin/{chunk-qac5hr5h.js → chunk-tp6ab26e.js} +1 -1
  114. package/bin/{chunk-md12a1sf.js → chunk-v2wxk9p5.js} +2 -2
  115. package/bin/chunk-vbk6y4hk.js +2 -0
  116. package/bin/{chunk-vcf2qk9h.js → chunk-vfgfg5fk.js} +2 -2
  117. package/bin/{chunk-gjnrd32m.js → chunk-vm6c3xx9.js} +2 -2
  118. package/bin/{chunk-agabtxrc.js → chunk-vsx96mt6.js} +1 -1
  119. package/bin/{chunk-et0cewj7.js → chunk-wbyw1shz.js} +2 -2
  120. package/bin/chunk-whh2vh50.css +1 -0
  121. package/bin/{chunk-792t2653.js → chunk-wjkcq65s.js} +2 -2
  122. package/bin/{chunk-5yhn31rd.js → chunk-wkefwkfp.js} +1 -1
  123. package/bin/{chunk-gcc6pte2.js → chunk-x7bsnk1e.js} +2 -2
  124. package/bin/{chunk-tn67sjb2.js → chunk-xbhw6bpz.js} +2 -2
  125. package/bin/{chunk-34kaja59.js → chunk-xg5yrcj5.js} +2 -2
  126. package/bin/{chunk-wzmpvadf.js → chunk-xw2gpcsh.js} +1 -1
  127. package/bin/{chunk-sx6y697s.js → chunk-ycq8ank7.js} +1 -1
  128. package/bin/chunk-yp9hvkc5.js +73 -0
  129. package/bin/{chunk-dkjkn8t3.js → chunk-ytypyfkc.js} +2 -2
  130. package/bin/{chunk-62ebss6h.js → chunk-z1kjmf60.js} +2 -2
  131. package/bin/chunk-z36bx86r.js +2 -0
  132. package/bin/chunk-z7hdnecp.js +3 -0
  133. package/bin/chunk-zeby1cq7.js +2 -0
  134. package/bin/chunk-zs5e8z1w.js +1 -0
  135. package/bin/chunk-zxnyefg5.js +2 -0
  136. package/bin/shumai-app.html +1 -1
  137. package/bin/shumai-app.js +312 -342
  138. package/package.json +7 -7
  139. package/prisma/schema.prisma +1 -1
  140. package/bin/chunk-045f1bw7.js +0 -2
  141. package/bin/chunk-0n1wfwcm.js +0 -2
  142. package/bin/chunk-1fwzepfn.js +0 -2
  143. package/bin/chunk-2xevs82j.js +0 -2
  144. package/bin/chunk-31y5j4hr.js +0 -1
  145. package/bin/chunk-34adtqqh.js +0 -1
  146. package/bin/chunk-4j8fbckp.js +0 -1
  147. package/bin/chunk-57s7yj35.js +0 -1
  148. package/bin/chunk-6tse78c7.js +0 -2
  149. package/bin/chunk-8nyve0cr.js +0 -7
  150. package/bin/chunk-ajndx51c.js +0 -2
  151. package/bin/chunk-bbyc2jfq.js +0 -1
  152. package/bin/chunk-br7d2qwc.js +0 -1
  153. package/bin/chunk-by6g0vye.js +0 -2
  154. package/bin/chunk-c24fvhm6.js +0 -1
  155. package/bin/chunk-c6aszz6p.js +0 -1
  156. package/bin/chunk-csqvmx1m.js +0 -2
  157. package/bin/chunk-dg8c91j5.js +0 -1
  158. package/bin/chunk-dk8vk17v.js +0 -2
  159. package/bin/chunk-ex2ym5pz.js +0 -2
  160. package/bin/chunk-f2zbsrc9.js +0 -2
  161. package/bin/chunk-gcpr2a24.js +0 -7
  162. package/bin/chunk-gpjkegdp.js +0 -1
  163. package/bin/chunk-jt6d0zb1.js +0 -2
  164. package/bin/chunk-jwgfkpek.js +0 -3
  165. package/bin/chunk-k2065y29.js +0 -2
  166. package/bin/chunk-k514bttd.js +0 -1
  167. package/bin/chunk-k7chm9a9.js +0 -2
  168. package/bin/chunk-kjgejwjp.css +0 -1
  169. package/bin/chunk-kqpzx5az.js +0 -73
  170. package/bin/chunk-kxr8fjsq.js +0 -2
  171. package/bin/chunk-mha3rsh7.js +0 -2
  172. package/bin/chunk-nn0px81k.js +0 -307
  173. package/bin/chunk-ns804tmv.js +0 -2
  174. package/bin/chunk-p1temt1j.js +0 -1
  175. package/bin/chunk-rkz6x3r0.js +0 -2
  176. package/bin/chunk-svz0ds0g.js +0 -1
  177. package/bin/chunk-t31basc5.js +0 -1
  178. package/bin/chunk-t6qdrw24.js +0 -1
  179. package/bin/chunk-wvwqgff4.js +0 -1
  180. package/bin/chunk-ww1cy08p.js +0 -1
  181. package/bin/chunk-xfp27ya9.js +0 -2
  182. package/bin/chunk-y0f4bc9f.js +0 -2
  183. package/bin/chunk-y2s0tjaa.js +0 -3
  184. package/bin/chunk-y3dy4pdt.js +0 -2
@@ -1,2 +0,0 @@
1
- import{Hh as b,Ih as G,Nh as B0}from"./chunk-9cmvymm5.js";import{Ci as y,xi as $0,yi as w0}from"./chunk-8nyve0cr.js";var c=Symbol.for("immer-nothing"),v=Symbol.for("immer-draftable"),X=Symbol.for("immer-state");function Y($,...w){throw Error(`[Immer] minified error nr: ${$}. Full error at: https://bit.ly/3cXEKWf`)}var z=Object.getPrototypeOf;function x($){return!!$&&!!$[X]}function U($){if(!$)return!1;return o($)||Array.isArray($)||!!$[v]||!!$.constructor?.[v]||L($)||R($)}var q0=Object.prototype.constructor.toString(),n=new WeakMap;function o($){if(!$||typeof $!=="object")return!1;let w=Object.getPrototypeOf($);if(w===null||w===Object.prototype)return!0;let B=Object.hasOwnProperty.call(w,"constructor")&&w.constructor;if(B===Object)return!0;if(typeof B!=="function")return!1;let W=n.get(B);if(W===void 0)W=Function.toString.call(B),n.set(B,W);return W===q0}function C($,w,B=!0){if(F($)===0)(B?Reflect.ownKeys($):Object.keys($)).forEach((q)=>{w(q,$[q],$)});else $.forEach((W,q)=>w(q,W,$))}function F($){let w=$[X];return w?w.type_:Array.isArray($)?1:L($)?2:R($)?3:0}function D($,w){return F($)===2?$.has(w):Object.prototype.hasOwnProperty.call($,w)}function r($,w,B){let W=F($);if(W===2)$.set(w,B);else if(W===3)$.add(B);else $[w]=B}function Z0($,w){if($===w)return $!==0||1/$===1/w;else return $!==$&&w!==w}function L($){return $ instanceof Map}function R($){return $ instanceof Set}function K($){return $.copy_||$.base_}function P($,w){if(L($))return new Map($);if(R($))return new Set($);if(Array.isArray($))return Array.prototype.slice.call($);let B=o($);if(w===!0||w==="class_only"&&!B){let W=Object.getOwnPropertyDescriptors($);delete W[X];let q=Reflect.ownKeys(W);for(let Z=0;Z<q.length;Z++){let J=q[Z],Q=W[J];if(Q.writable===!1)Q.writable=!0,Q.configurable=!0;if(Q.get||Q.set)W[J]={configurable:!0,writable:!0,enumerable:Q.enumerable,value:$[J]}}return Object.create(z($),W)}else{let W=z($);if(W!==null&&B)return{...$};let q=Object.create(W);return Object.assign(q,$)}}function g($,w=!1){if(E($)||x($)||!U($))return $;if(F($)>1)Object.defineProperties($,{set:O,add:O,clear:O,delete:O});if(Object.freeze($),w)Object.values($).forEach((B)=>g(B,!0));return $}function J0(){Y(2)}var O={value:J0};function E($){if($===null||typeof $!=="object")return!0;return Object.isFrozen($)}var Q0={};function I($){let w=Q0[$];if(!w)Y(0,$);return w}var M;function p(){return M}function X0($,w){return{drafts_:[],parent_:$,immer_:w,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function h($,w){if(w)I("Patches"),$.patches_=[],$.inversePatches_=[],$.patchListener_=w}function k($){A($),$.drafts_.forEach(Y0),$.drafts_=null}function A($){if($===M)M=$.parent_}function i($){return M=X0(M,$)}function Y0($){let w=$[X];if(w.type_===0||w.type_===1)w.revoke_();else w.revoked_=!0}function u($,w){w.unfinalizedDrafts_=w.drafts_.length;let B=w.drafts_[0];if($!==void 0&&$!==B){if(B[X].modified_)k(w),Y(4);if(U($)){if($=V(w,$),!w.parent_)f(w,$)}if(w.patches_)I("Patches").generateReplacementPatches_(B[X].base_,$,w.patches_,w.inversePatches_)}else $=V(w,B,[]);if(k(w),w.patches_)w.patchListener_(w.patches_,w.inversePatches_);return $!==c?$:void 0}function V($,w,B){if(E(w))return w;let W=$.immer_.shouldUseStrictIteration(),q=w[X];if(!q)return C(w,(Z,J)=>l($,q,w,Z,J,B),W),w;if(q.scope_!==$)return w;if(!q.modified_)return f($,q.base_,!0),q.base_;if(!q.finalized_){q.finalized_=!0,q.scope_.unfinalizedDrafts_--;let Z=q.copy_,J=Z,Q=!1;if(q.type_===3)J=new Set(Z),Z.clear(),Q=!0;if(C(J,(H,N)=>l($,q,Z,H,N,B,Q),W),f($,Z,!1),B&&$.patches_)I("Patches").generatePatches_(q,B,$.patches_,$.inversePatches_)}return q.copy_}function l($,w,B,W,q,Z,J){if(q==null)return;if(typeof q!=="object"&&!J)return;let Q=E(q);if(Q&&!J)return;if(x(q)){let H=Z&&w&&w.type_!==3&&!D(w.assigned_,W)?Z.concat(W):void 0,N=V($,q,H);if(r(B,W,N),x(N))$.canAutoFreeze_=!1;else return}else if(J)B.add(q);if(U(q)&&!Q){if(!$.immer_.autoFreeze_&&$.unfinalizedDrafts_<1)return;if(w&&w.base_&&w.base_[W]===q&&Q)return;if(V($,q),(!w||!w.scope_.parent_)&&typeof W!=="symbol"&&(L(B)?B.has(W):Object.prototype.propertyIsEnumerable.call(B,W)))f($,q)}}function f($,w,B=!1){if(!$.parent_&&$.immer_.autoFreeze_&&$.canAutoFreeze_)g(w,B)}function G0($,w){let B=Array.isArray($),W={type_:B?1:0,scope_:w?w.scope_:p(),modified_:!1,finalized_:!1,assigned_:{},parent_:w,base_:$,draft_:null,copy_:null,revoke_:null,isManual_:!1},q=W,Z=d;if(B)q=[W],Z=m;let{revoke:J,proxy:Q}=Proxy.revocable(q,Z);return W.draft_=Q,W.revoke_=J,Q}var d={get($,w){if(w===X)return $;let B=K($);if(!D(B,w))return H0($,B,w);let W=B[w];if($.finalized_||!U(W))return W;if(W===_($.base_,w))return j($),$.copy_[w]=S(W,$);return W},has($,w){return w in K($)},ownKeys($){return Reflect.ownKeys(K($))},set($,w,B){let W=s(K($),w);if(W?.set)return W.set.call($.draft_,B),!0;if(!$.modified_){let q=_(K($),w),Z=q?.[X];if(Z&&Z.base_===B)return $.copy_[w]=B,$.assigned_[w]=!1,!0;if(Z0(B,q)&&(B!==void 0||D($.base_,w)))return!0;j($),T($)}if($.copy_[w]===B&&(B!==void 0||(w in $.copy_))||Number.isNaN(B)&&Number.isNaN($.copy_[w]))return!0;return $.copy_[w]=B,$.assigned_[w]=!0,!0},deleteProperty($,w){if(_($.base_,w)!==void 0||w in $.base_)$.assigned_[w]=!1,j($),T($);else delete $.assigned_[w];if($.copy_)delete $.copy_[w];return!0},getOwnPropertyDescriptor($,w){let B=K($),W=Reflect.getOwnPropertyDescriptor(B,w);if(!W)return W;return{writable:!0,configurable:$.type_!==1||w!=="length",enumerable:W.enumerable,value:B[w]}},defineProperty(){Y(11)},getPrototypeOf($){return z($.base_)},setPrototypeOf(){Y(12)}},m={};C(d,($,w)=>{m[$]=function(){return arguments[0]=arguments[0][0],w.apply(this,arguments)}});m.deleteProperty=function($,w){return m.set.call(this,$,w,void 0)};m.set=function($,w,B){return d.set.call(this,$[0],w,B,$[0])};function _($,w){let B=$[X];return(B?K(B):$)[w]}function H0($,w,B){let W=s(w,B);return W?"value"in W?W.value:W.get?.call($.draft_):void 0}function s($,w){if(!(w in $))return;let B=z($);while(B){let W=Object.getOwnPropertyDescriptor(B,w);if(W)return W;B=z(B)}return}function T($){if(!$.modified_){if($.modified_=!0,$.parent_)T($.parent_)}}function j($){if(!$.copy_)$.copy_=P($.base_,$.scope_.immer_.useStrictShallowCopy_)}var K0=class{constructor($){if(this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(w,B,W)=>{if(typeof w==="function"&&typeof B!=="function"){let Z=B;B=w;let J=this;return function(H=Z,...N){return J.produce(H,(W0)=>B.call(this,W0,...N))}}if(typeof B!=="function")Y(6);if(W!==void 0&&typeof W!=="function")Y(7);let q;if(U(w)){let Z=i(this),J=S(w,void 0),Q=!0;try{q=B(J),Q=!1}finally{if(Q)k(Z);else A(Z)}return h(Z,W),u(q,Z)}else if(!w||typeof w!=="object"){if(q=B(w),q===void 0)q=w;if(q===c)q=void 0;if(this.autoFreeze_)g(q,!0);if(W){let Z=[],J=[];I("Patches").generateReplacementPatches_(w,q,Z,J),W(Z,J)}return q}else Y(1,w)},this.produceWithPatches=(w,B)=>{if(typeof w==="function")return(J,...Q)=>this.produceWithPatches(J,(H)=>w(H,...Q));let W,q;return[this.produce(w,B,(J,Q)=>{W=J,q=Q}),W,q]},typeof $?.autoFreeze==="boolean")this.setAutoFreeze($.autoFreeze);if(typeof $?.useStrictShallowCopy==="boolean")this.setUseStrictShallowCopy($.useStrictShallowCopy);if(typeof $?.useStrictIteration==="boolean")this.setUseStrictIteration($.useStrictIteration)}createDraft($){if(!U($))Y(8);if(x($))$=U0($);let w=i(this),B=S($,void 0);return B[X].isManual_=!0,A(w),B}finishDraft($,w){let B=$&&$[X];if(!B||!B.isManual_)Y(9);let{scope_:W}=B;return h(W,w),u(void 0,W)}setAutoFreeze($){this.autoFreeze_=$}setUseStrictShallowCopy($){this.useStrictShallowCopy_=$}setUseStrictIteration($){this.useStrictIteration_=$}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches($,w){let B;for(B=w.length-1;B>=0;B--){let q=w[B];if(q.path.length===0&&q.op==="replace"){$=q.value;break}}if(B>-1)w=w.slice(B+1);let W=I("Patches").applyPatches_;if(x($))return W($,w);return this.produce($,(q)=>W(q,w))}};function S($,w){let B=L($)?I("MapSet").proxyMap_($,w):R($)?I("MapSet").proxySet_($,w):G0($,w);return(w?w.scope_:p()).drafts_.push(B),B}function U0($){if(!x($))Y(10,$);return a($)}function a($){if(!U($)||E($))return $;let w=$[X],B,W=!0;if(w){if(!w.modified_)return w.base_;w.finalized_=!0,B=P($,w.scope_.immer_.useStrictShallowCopy_),W=w.scope_.immer_.shouldUseStrictIteration()}else B=P($,!0);if(C(B,(q,Z)=>{r(B,q,a(Z))},W),w)w.finalized_=!1;return B}var I0=new K0,t=I0.produce;var N0=($)=>(w,B,W)=>{return W.setState=(q,Z,...J)=>{let Q=typeof q==="function"?t(q):q;return w(Q,Z,...J)},$(W.setState,B,W)},e=N0;var f0=$0()(w0(e(($,w)=>({members:[],loading:!1,fetchMembers:async(B,W,q)=>{if(!q&&w().loadedTeamId===B&&w().loadedWithAgents===W)return;$({loading:!0});try{let Z=await y.api.teams[":teamId"].members.$get({param:{teamId:B},query:{includeAgents:W?"true":"false"}});if(!Z.ok)throw Error("failed to fetch members");let J=await Z.json();$({members:J||[],loadedTeamId:B,loadedProjectId:void 0,loadedWithAgents:W,loading:!1})}catch{$({loading:!1})}},fetchProjectMembers:async(B,W,q)=>{if(!q&&w().loadedProjectId===B&&w().loadedWithAgents===W)return;$({loading:!0});try{let Z=await y.api.projects[":projectId"].members.$get({param:{projectId:B},query:{includeAgents:W?"true":"false"}});if(!Z.ok)throw Error("failed to fetch project members");let J=await Z.json();$({members:J||[],loadedProjectId:B,loadedTeamId:void 0,loadedWithAgents:W,loading:!1})}catch{$({loading:!1})}}}))));function R0($){if(!$||$<=0)return"0 B";let w=1000,B=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],W=Math.floor(Math.log($)/Math.log(w));if(W<0)W=0;if(W>=B.length)W=B.length-1;let q=$/Math.pow(w,W);if(W===0)return`${Math.round(q)} B`;let Z=parseFloat(q.toFixed(2));if(Z>=1000&&W<B.length-1)return parseFloat(($/Math.pow(w,W+1)).toFixed(2))+" "+B[W+1];return`${Z} ${B[W]}`}function D0($,w,B){let W=G($,B?.in);if(isNaN(w))return b(B?.in||$,NaN);if(!w)return W;let q=W.getDate(),Z=b(B?.in||$,W.getTime());Z.setMonth(W.getMonth()+w+1,0);let J=Z.getDate();if(q>=J)return Z;else return W.setFullYear(Z.getFullYear(),Z.getMonth(),q),W}function A0($,w){let B=G($,w?.in),W=B.getMonth();return B.setFullYear(B.getFullYear(),W+1,0),B.setHours(23,59,59,999),B}function g0($,w){return G($,w?.in).getMonth()}function b0($,w){return G($,w?.in).getFullYear()}function h0($,w){let[B,W]=B0($,w.start,w.end);return{start:B,end:W}}
2
- export{D0 as Ef,A0 as Ff,h0 as Gf,g0 as Hf,b0 as If,R0 as Jf,f0 as Kf};
@@ -1 +0,0 @@
1
- import{o as a}from"./chunk-k7chm9a9.js";import"./chunk-f2zbsrc9.js";import"./chunk-by6g0vye.js";import"./chunk-gcpr2a24.js";import"./chunk-nn0px81k.js";import"./chunk-mha3rsh7.js";import"./chunk-jt6d0zb1.js";import"./chunk-4b7jcpgv.js";import"./chunk-djx2r4nj.js";import"./chunk-y3dy4pdt.js";import"./chunk-mgnxa0vy.js";import"./chunk-csqvmx1m.js";import"./chunk-ysvhtgve.js";import"./chunk-1fwzepfn.js";import"./chunk-ex2ym5pz.js";import"./chunk-34kaja59.js";import"./chunk-x9akgj7w.js";import"./chunk-ajndx51c.js";import"./chunk-93ecxcy4.js";import"./chunk-mhps85dd.js";import"./chunk-r2shjtte.js";import"./chunk-ns804tmv.js";import"./chunk-ymr5ybxk.js";import"./chunk-2xevs82j.js";import"./chunk-y2s0tjaa.js";import"./chunk-yyjx8nbq.js";import"./chunk-zye42cfp.js";import"./chunk-dk8vk17v.js";import"./chunk-rkz6x3r0.js";import"./chunk-7x1vkftb.js";import"./chunk-ck6msfch.js";import"./chunk-vhcqazqf.js";import"./chunk-tcm57j8r.js";import"./chunk-0bfqrx5q.js";import"./chunk-dkjkn8t3.js";import"./chunk-76433x4d.js";import"./chunk-2xgvs3as.js";import"./chunk-9cmvymm5.js";import"./chunk-6m1k317a.js";import"./chunk-kxr8fjsq.js";import"./chunk-02afmyqy.js";import"./chunk-8nyve0cr.js";import"./chunk-62ebss6h.js";import{Xi as e,gj as t}from"./chunk-kqpzx5az.js";import"./chunk-p49h5fxs.js";function o(){let{shareId:s,folderId:n}=r.useParams();return e(a,{shareId:s,initialFolderId:n})}var r=t("/share/$shareId/folders/$folderId")({component:o});export{r as Route};
@@ -1,2 +0,0 @@
1
- import{Ai as o,xi as a,zi as l}from"./chunk-8nyve0cr.js";var p=a()(o((i)=>({fileViewLeftSidebarCollapsed:!0,setFileViewLeftSidebarCollapsed:(e)=>i({fileViewLeftSidebarCollapsed:e}),fileViewRightSidebarCollapsed:!1,setFileViewRightSidebarCollapsed:(e)=>i({fileViewRightSidebarCollapsed:e}),fileListLeftSidebarCollapsed:!1,setFileListLeftSidebarCollapsed:(e)=>i({fileListLeftSidebarCollapsed:e}),fileListRightSidebarCollapsed:!0,setFileListRightSidebarCollapsed:(e)=>i({fileListRightSidebarCollapsed:e}),shareConfigLeftSidebarCollapsed:!1,setShareConfigLeftSidebarCollapsed:(e)=>i({shareConfigLeftSidebarCollapsed:e}),shareConfigRightSidebarCollapsed:!1,setShareConfigRightSidebarCollapsed:(e)=>i({shareConfigRightSidebarCollapsed:e}),viewModes:{},setViewMode:(e,d)=>i((s)=>({viewModes:{...s.viewModes,[e]:d}})),videoTimeDisplayMode:"standard",setVideoTimeDisplayMode:(e)=>i({videoTimeDisplayMode:e})}),{name:"ui-storage",storage:l(()=>localStorage)}));
2
- export{p as lg};
@@ -1 +0,0 @@
1
- import{d as x}from"./chunk-k2065y29.js";import"./chunk-6tse78c7.js";import"./chunk-0n1wfwcm.js";import"./chunk-by6g0vye.js";import"./chunk-gcpr2a24.js";import"./chunk-nn0px81k.js";import"./chunk-mha3rsh7.js";import"./chunk-jt6d0zb1.js";import"./chunk-4b7jcpgv.js";import"./chunk-djx2r4nj.js";import"./chunk-y3dy4pdt.js";import"./chunk-mgnxa0vy.js";import{ye as f}from"./chunk-3gjn4pyp.js";import{Ee as p}from"./chunk-y0f4bc9f.js";import"./chunk-j536e9nx.js";import"./chunk-ajndx51c.js";import"./chunk-93ecxcy4.js";import"./chunk-mhps85dd.js";import"./chunk-r2shjtte.js";import"./chunk-ns804tmv.js";import"./chunk-ymr5ybxk.js";import"./chunk-2xevs82j.js";import"./chunk-y2s0tjaa.js";import"./chunk-yyjx8nbq.js";import"./chunk-zye42cfp.js";import"./chunk-dk8vk17v.js";import"./chunk-rkz6x3r0.js";import"./chunk-7x1vkftb.js";import"./chunk-ck6msfch.js";import"./chunk-vhcqazqf.js";import"./chunk-tcm57j8r.js";import"./chunk-0bfqrx5q.js";import"./chunk-dkjkn8t3.js";import"./chunk-76433x4d.js";import"./chunk-2xgvs3as.js";import"./chunk-9cmvymm5.js";import"./chunk-6m1k317a.js";import"./chunk-kxr8fjsq.js";import{mi as h}from"./chunk-02afmyqy.js";import{Ci as c,ti as l,ui as r}from"./chunk-8nyve0cr.js";import"./chunk-62ebss6h.js";import{Vi as w,Xi as a,gj as o}from"./chunk-kqpzx5az.js";import{kn as m}from"./chunk-p49h5fxs.js";var g=m(w(),1);function v(){let{projectId:e}=d.useParams(),{teamId:s,ensureTeamIdForProject:n}=h();g.useEffect(()=>{n(e)},[e,n]);let{data:i}=r(f(e)),t=i?.rootFolder,{data:b}=l({queryKey:["folders",t],queryFn:()=>(async()=>{return await(await c.api.folders[":folderId"].$get({param:{folderId:t}})).json()})(),enabled:!!t});if(!s||!t||!b)return a(p,{});return a(x,{teamId:s,projectId:e,projectName:i.name??"",assetId:"recently-deleted",rootFolderId:t})}var d=o("/projects/$projectId/recently-deleted")({component:v});export{d as Route};
@@ -1 +0,0 @@
1
- import{g as x}from"./chunk-5yhn31rd.js";import"./chunk-0n1wfwcm.js";import"./chunk-djx2r4nj.js";import{Ae as f}from"./chunk-pdjar480.js";import{Ee as c}from"./chunk-y0f4bc9f.js";import"./chunk-y2s0tjaa.js";import"./chunk-yyjx8nbq.js";import"./chunk-zye42cfp.js";import"./chunk-dk8vk17v.js";import"./chunk-rkz6x3r0.js";import"./chunk-7x1vkftb.js";import"./chunk-ck6msfch.js";import"./chunk-vhcqazqf.js";import"./chunk-tcm57j8r.js";import"./chunk-2xgvs3as.js";import"./chunk-9cmvymm5.js";import{mi as s}from"./chunk-02afmyqy.js";import{Ci as b,ti as d,ui as l}from"./chunk-8nyve0cr.js";import{Vi as m,Xi as e,gj as p}from"./chunk-kqpzx5az.js";import{kn as u}from"./chunk-p49h5fxs.js";var g=u(m(),1);function v(){let{projectId:i}=k.useParams(),{teamId:r,ensureTeamIdForProject:t}=s();g.useEffect(()=>{t(i)},[i,t]);let{data:a}=l(f(i)),o=a?.rootFolder,{data:h}=d({queryKey:["folders",o],queryFn:async()=>{let n=await b.api.folders[":folderId"].$get({param:{folderId:o}});if(!n.ok)throw Error("failed to fetch folder");return await n.json()},enabled:!!o});if(!r||!o||!h)return e(c,{});return e(x,{teamId:r,projectId:i,projectName:a.name??"",assetId:o,rootFolderId:o,isRoot:!0})}var k=p("/projects/$projectId/agentsmd")({component:v});export{k as Route};
@@ -1 +0,0 @@
1
- import{ca as cz}from"./chunk-y3dy4pdt.js";import"./chunk-mgnxa0vy.js";import{Ne as pz}from"./chunk-j536e9nx.js";import"./chunk-76433x4d.js";import{Dh as dz}from"./chunk-2xgvs3as.js";import"./chunk-9cmvymm5.js";import{Yh as r}from"./chunk-6m1k317a.js";import{$h as wz,Zh as hz,_h as Sz}from"./chunk-kxr8fjsq.js";import{ai as C,ci as f,di as I,ei as w,ni as lz}from"./chunk-02afmyqy.js";import{Ci as X,Di as yz,Ei as bz,Fi as Dz,Gi as Cz,Hi as fz,Ii as Iz,Ji as gz,Ki as uz,Li as kz,Ni as qz,Oi as Az,Pi as Ez,Qi as Fz,Ri as Uz,Si as _z,oi as Mz,qi as i,ti as o,vi as q}from"./chunk-8nyve0cr.js";import{Ui as m}from"./chunk-62ebss6h.js";import{Aj as Lz,Dl as Jz,Ll as Kz,Nj as Rz,Pl as Zz,Vi as $z,Vj as a,Wi as P,Xi as z,Yi as J,bj as n,bl as Yz,gj as Bz,jm as F,lj as Vz,mj as Pz,mm as V,nm as j,uj as vz,wj as Gz,zj as Tz}from"./chunk-kqpzx5az.js";import{kn as Wz}from"./chunk-p49h5fxs.js";var k=Wz($z(),1);function Nz({open:Z,onOpenChange:T,mode:L,teamId:U,project:W}){let A=i(),K=n(),[H,O]=k.useState(""),[y,B]=k.useState(!0),[g,M]=k.useState(void 0),[b,N]=k.useState(void 0),[E,D]=k.useState(!1),v=k.useRef(null);k.useEffect(()=>{if(Z)if(L==="edit"&&W)O(W.name||""),M(W.coverImageKey),N(W.coverImage),B(W.enableNotification!==!1);else O(""),M(void 0),N(void 0),B(!0)},[Z,L,W]);let u=X.api.teams[":teamId"].projects.$post,{mutate:t}=q({mutationFn:async(Q)=>{let _=await u({param:{teamId:U},json:Q});if(!_.ok)throw Error(V.failed_create_project());return await _.json()},onSuccess:(Q)=>{A.invalidateQueries({queryKey:["teams",U,"projects"]}),T(!1);let _=Q;if(_&&typeof _.id==="string")K({to:"/projects/$projectId",params:{projectId:_.id}})}}),l=X.api.projects[":projectId"].$put,{mutate:s}=q({mutationFn:async(Q)=>{let _=await l({param:{projectId:W.id},json:Q});if(!_.ok)throw Error(V.failed_update_project());return await _.json()},onSuccess:()=>{A.invalidateQueries({queryKey:["teams",U,"projects"]}),T(!1)}}),e=X.api.teams[":teamId"].files.$post,{mutate:d}=q({mutationFn:async({file:Q})=>{let _=await e({param:{teamId:U},form:{file:Q}});if(!_.ok)throw Error(V.failed_upload_file());return await _.json()},onSuccess:(Q)=>{let _=Q;if(_&&typeof _.key==="string")M(_.key);D(!1)},onError:()=>{D(!1)}}),R=(Q)=>{let _=Q.target.files?.[0];if(_){D(!0);let zz=URL.createObjectURL(_);N(zz),d({file:_})}},h=()=>{v.current?.click()},p=(Q)=>{Q.stopPropagation(),M(void 0),N(void 0)},S=()=>{if(!H.trim())return;if(L==="create")t({name:H.trim(),coverImageKey:g,enableNotification:y});else if(L==="edit"&&W?.id)s({name:H.trim(),coverImageKey:g,enableNotification:y})};return z(kz,{open:Z,onOpenChange:T,children:J(qz,{className:"sm:max-w-[550px] overflow-hidden rounded-2xl border border-border/60 bg-background/95 backdrop-blur-md shadow-2xl p-0 gap-0",children:[J(Az,{className:"relative overflow-hidden bg-gradient-to-br from-primary/5 to-transparent p-6 border-b border-border/40",children:[z("div",{className:"absolute top-0 right-0 w-24 h-24 bg-primary/10 rounded-full blur-2xl pointer-events-none"}),z("div",{className:"absolute bottom-0 left-10 w-32 h-12 bg-primary/5 rounded-full blur-xl pointer-events-none"}),z("div",{className:"flex items-center gap-3",children:J("div",{children:[z(Fz,{className:"text-xl font-semibold tracking-tight text-foreground",children:L==="create"?V.create_new_project():V.project_settings()}),z(Uz,{className:"text-xs text-muted-foreground/80 mt-1",children:L==="create"?V.configure_new_project_description():V.manage_project_description()})]})})]}),J("div",{className:"space-y-6 p-6 max-h-[75vh] overflow-y-auto",children:[J("div",{className:"space-y-2",children:[z(m,{htmlFor:"name",className:"text-sm font-semibold tracking-tight text-foreground",children:V.project_name()}),J("div",{className:"relative",children:[z(j,{id:"name",value:H,onChange:(Q)=>O(Q.target.value),placeholder:V.project_name_placeholder(),className:"h-11 px-4 rounded-xl border-border/80 focus-visible:ring-ring/25 focus-visible:border-primary transition-all shadow-xs pr-10"}),H.trim()&&z("div",{className:"absolute inset-y-0 right-3 flex items-center",children:z(a,{className:"w-4 h-4 text-primary"})})]}),z("p",{className:"text-[11px] text-muted-foreground",children:V.project_name_hint()})]}),J("div",{className:"space-y-3 border-t border-border/40 pt-5",children:[J("div",{className:"flex items-center justify-between",children:[J(m,{className:"text-sm font-semibold tracking-tight text-foreground flex items-center gap-1.5",children:[z(Lz,{className:"w-4 h-4 text-primary"}),V.project_cover()]}),b&&J("button",{type:"button",onClick:p,className:"text-xs text-muted-foreground hover:text-destructive hover:bg-destructive/5 px-2.5 py-1 rounded-lg transition-all flex items-center gap-1 font-medium",children:[z(Kz,{className:"w-3.5 h-3.5"}),V.remove_cover()]})]}),J("div",{className:"relative aspect-square w-48 mx-auto rounded-2xl border border-dashed border-border flex items-center justify-center cursor-pointer overflow-hidden group shadow-inner bg-muted/20 transition-all duration-300 hover:border-primary/50 hover:bg-muted/40",onClick:h,children:[z("input",{type:"file",ref:v,className:"hidden",accept:"image/*",onChange:R}),E&&z("div",{className:"absolute inset-0 bg-background/70 backdrop-blur-xs flex flex-col items-center justify-center gap-2 z-20",children:J("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-background border rounded-full shadow-lg",children:[z(Gz,{className:"w-4 h-4 animate-spin text-primary"}),z("span",{className:"text-xs font-semibold text-foreground",children:V.uploading()})]})}),b?J(P,{children:[z("img",{src:b,alt:V.cover_preview(),className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"}),J("div",{className:"absolute inset-0 bg-black/45 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex flex-col items-center justify-center gap-1.5 text-white z-10",children:[z(Jz,{className:"w-5 h-5 transform translate-y-1 group-hover:translate-y-0 transition-transform duration-300"}),z("span",{className:"text-xs font-semibold",children:V.upload_image()})]})]}):J("div",{className:"flex flex-col items-center gap-2 text-center p-4",children:[z("div",{className:"p-2.5 rounded-full bg-background border shadow-xs group-hover:scale-110 transition-transform duration-300",children:z(Jz,{className:"w-4 h-4 text-muted-foreground"})}),J("div",{children:[z("p",{className:"text-xs font-medium text-foreground",children:V.upload_cover()}),z("p",{className:"text-[11px] text-muted-foreground mt-0.5 max-w-[140px] mx-auto leading-normal",children:V.upload_cover_hint()})]})]})]})]}),J("div",{className:"space-y-3 border-t border-border/40 pt-5",children:[J(m,{className:"text-sm font-semibold tracking-tight text-foreground flex items-center gap-1.5",children:[z(Tz,{className:"w-4 h-4 text-primary"}),V.project_preferences()]}),J("div",{className:"flex items-start justify-between rounded-xl border border-border/50 bg-muted/10 p-4 transition-all duration-300 hover:bg-muted/20",children:[J("div",{className:"space-y-1 pr-4",children:[J("div",{className:"text-sm font-semibold flex items-center gap-2 text-foreground",children:[z(Rz,{className:"w-4 h-4 text-primary"}),V.activity_notifications()]}),z("p",{className:"text-xs text-muted-foreground leading-normal",children:V.activity_notifications_description()})]}),z(r,{checked:y,onCheckedChange:B,disabled:E,className:"mt-0.5"})]})]})]}),J(Ez,{className:"flex items-center justify-end gap-3 px-6 py-4 bg-muted/20 border-t border-border/40",children:[z(F,{type:"button",variant:"ghost",onClick:()=>T(!1),disabled:E,className:"rounded-xl h-10 px-4 hover:bg-muted font-medium text-sm text-muted-foreground hover:text-foreground transition-colors",children:V.cancel()}),z(F,{type:"submit",onClick:S,disabled:!H.trim()||E,className:"rounded-xl h-10 px-5 bg-primary text-primary-foreground hover:bg-primary/90 font-semibold text-sm shadow-lg shadow-primary/10 hover:shadow-primary/20 active:scale-98 transition-all flex items-center gap-2",children:E?J(P,{children:[z(Gz,{className:"w-4 h-4 animate-spin"}),V.processing()]}):L==="create"?V.create_project():V.save_changes()})]})]})})}function Oz({sortBy:Z,sortDirection:T,onSortChange:L}){let U=(H)=>{L(H,T)},W=()=>{L(Z,T==="asc"?"desc":"asc")},A=(H)=>{switch(H){case"name":return V.sort_name();case"created_at":return V.sort_created();case"updated_at":return V.sort_updated();default:return H}},K=T==="asc";return J(C,{children:[z(f,{asChild:!0,children:J(F,{variant:"outline",className:"gap-2 bg-muted/50",children:[z("span",{className:"text-muted-foreground",children:V.sorted_by_label()}),z("span",{className:"font-medium text-foreground",children:A(Z)})]})}),J(I,{align:"end",className:"w-56 p-2",children:[z("div",{className:"text-xs font-semibold text-muted-foreground mb-2 px-2",children:V.sort_by()}),J(C,{children:[z(f,{asChild:!0,children:J(F,{variant:"ghost",className:"w-full justify-between font-normal px-2 h-10 bg-muted/50 hover:bg-muted mb-2 border",children:[z("span",{children:A(Z)}),z(Vz,{className:"h-4 w-4 opacity-50"})]})}),z(I,{className:"w-52",children:["name","created_at","updated_at"].map((H)=>J(w,{onClick:()=>U(H),className:"justify-between",children:[A(H),Z===H&&z(a,{className:"h-4 w-4"})]},H))})]}),J(F,{variant:"ghost",className:"w-full justify-between font-normal px-2 h-10 bg-muted/50 hover:bg-muted border",onClick:W,children:[z("span",{className:"text-muted-foreground",children:Z==="name"?K?z(P,{children:V.sort_a_to_z()}):z(P,{children:V.sort_z_to_a()}):K?z(P,{children:V.sort_oldest_to_newest()}):z(P,{children:V.sort_newest_to_oldest()})}),K?z(Pz,{className:"h-4 w-4 opacity-50"}):z(Vz,{className:"h-4 w-4 opacity-50"})]})]})]})}var $=Wz($z(),1);function JG(){let{teamId:Z}=VG.useParams(),{canEdit:T,canAdmin:L}=lz(),U=n(),W=i(),[A,K]=$.useState(null),[H,O]=$.useState(!1),[y,B]=$.useState("create"),[g,M]=$.useState(void 0),[b,N]=$.useState(!1),[E,D]=$.useState(void 0),[v,u]=$.useState(""),[t,l]=$.useState(!1),{metadata:s,setMetadata:e}=pz(),d=`team:${Z}:projects:sort`,R=s[d],[h,p]=$.useState(()=>R?.sortBy||"name"),[S,Q]=$.useState(()=>R?.sortDirection||"asc");$.useEffect(()=>{if(R?.sortBy&&R.sortBy!==h)p(R.sortBy);if(R?.sortDirection&&R.sortDirection!==S)Q(R.sortDirection)},[R]);let _=X.api.teams[":teamId"].projects.$get,{data:zz}=o({queryKey:["teams",Z,"projects",h,S],queryFn:async()=>{let G=await _({param:{teamId:Z},query:{sortBy:h,sortDirection:S}});if(!G.ok)throw Error("Failed to fetch projects");return await G.json()},placeholderData:Mz}),{data:Hz}=o({queryKey:["teams",Z,"members"],queryFn:async()=>{let G=await X.api.teams[":teamId"].members.$get({param:{teamId:Z},query:{}});if(!G.ok)throw Error("Failed to fetch members");return await G.json()}}),{data:Qz}=o({queryKey:["teams",Z,"me"],queryFn:async()=>{let G=await X.api.teams[":teamId"].me.$get({param:{teamId:Z}});if(!G.ok)throw Error("Failed to fetch me");return await G.json()}}),xz=X.api.teams[":teamId"].invite.$post,mz=q({mutationFn:async(G)=>{let Y=await xz(G);if(!Y.ok)throw Error("Failed to invite");return await Y.json()}}),c=q({mutationFn:async(G)=>{if(!(await X.api.projects[":projectId"].$delete({param:{projectId:G}})).ok)throw Error("Failed to delete project")},onSuccess:()=>{W.invalidateQueries({queryKey:["teams",Z,"projects"]})}}),iz=q({mutationFn:async(G)=>{let Y=await X.api.projects[":projectId"].$put({param:{projectId:G.id},json:{enableNotification:!G.enableNotification}});if(!Y.ok)throw Error("Failed to update project notification settings");return await Y.json()},onSuccess:()=>{W.invalidateQueries({queryKey:["teams",Z,"projects"]}),_z.success(V.project_notification_updated())},onError:(G)=>{_z.error(G instanceof Error?G.message:V.failed_update_project_notification())}}),Xz=()=>{B("create"),M(void 0),O(!0)},nz=()=>{K("create"),setTimeout(()=>{K(null)},100),setTimeout(()=>{Xz()},200)},az=(G)=>{B("edit"),M(G),O(!0)},jz=(G)=>{D(G),u(""),N(!0)},rz=async()=>{if(E&&v==="delete")try{await c.mutateAsync(E.id),N(!1)}catch(G){console.error(G)}},oz=(G,Y)=>{if(Y.detail>1)return;K(G),setTimeout(()=>{K(null)},100),setTimeout(()=>{U({to:"/projects/$projectId",params:{projectId:G}})},200)},tz=async(G)=>{return(await mz.mutateAsync({param:{teamId:Z},json:{role:G}})).code},sz=q({mutationFn:async({userId:G,role:Y})=>{if(!(await X.api.teams[":teamId"].members[":userId"].$patch({param:{teamId:Z,userId:G},json:{role:Y}})).ok)throw Error("Failed to update member role")},onSuccess:()=>{W.invalidateQueries({queryKey:["teams",Z,"members"]})}}),ez=q({mutationFn:async(G)=>{if(!(await X.api.teams[":teamId"].members[":userId"].$delete({param:{teamId:Z,userId:G}})).ok)throw Error("Failed to remove member")},onSuccess:()=>{W.invalidateQueries({queryKey:["teams",Z,"members"]})}}),zG=(G)=>{if(!G)return"??";return G.split(" ").map((Y)=>Y[0]).slice(0,2).join("").toUpperCase()},GG=(G,Y)=>{p(G),Q(Y),e(Z,d,{sortBy:G,sortDirection:Y})},x=Array.isArray(Hz)?Hz:[];return J("div",{className:"flex-1 overflow-y-auto p-4",children:[J("div",{className:"flex flex-wrap items-center justify-between mb-4 gap-4",children:[z("h1",{className:"text-2xl font-bold",children:V.projects()}),J("div",{className:"flex flex-wrap items-center gap-4",children:[J("div",{className:"flex items-center -space-x-2 cursor-pointer hover:opacity-90",onClick:()=>l(!0),"data-testid":"team-members-trigger",children:[x.slice(0,3).map((G)=>J(hz,{className:"border-2 border-background w-8 h-8",children:[G.image&&z(Sz,{src:G.image,alt:G.name,className:"object-cover"}),z(wz,{className:"text-[10px]",children:zG(G.name)})]},G.id)),x.length>3&&J("div",{className:"flex items-center justify-center w-8 h-8 rounded-full border-2 border-background bg-muted text-[10px] font-medium",children:["+",x.length-3]})]}),z(Oz,{sortBy:h,sortDirection:S,onSortChange:GG}),T&&J(F,{className:"bg-orange-600 hover:bg-orange-700 text-white gap-2",onClick:Xz,children:[z(Yz,{className:"w-4 h-4"}),V.create_project()]})]})]}),J("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 gap-4",children:[zz?.data?.map((G)=>z("div",{className:Zz("shadow-md relative border rounded-xl overflow-hidden cursor-pointer transition-transform duration-100 ease-in-out",A===G.id?"scale-95":"scale-100"),onClick:(Y)=>oz(G.id,Y),children:J("div",{className:"flex flex-col",children:[J("div",{className:"relative w-full h-full aspect-square flex items-center justify-center bg-zinc-400/20",children:[G.coverImage?z("img",{src:G.coverImage,alt:G.name,className:"w-full h-full object-cover rounded"}):J("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 180.95 164.7",preserveAspectRatio:"xMidYMid slice",className:"w-full h-full object-cover rounded",children:[z("polygon",{fill:"#FC9F8E",points:"0 18.5 0 76.0 151.69 164.7 180.95 164.7 180.95 113.6"}),z("polygon",{fill:"#FEBAB8",points:"0 0 74.58 61.5 90.53 51.6 110.33 63.9 180.95 18.9 180.95 0"}),z("polyline",{fill:"#FAA5A5",points:"0 18.5 74.58 61.5 90.53 51.6 110.33 63.9 180.95 18.9 180.95 0 0 0"}),z("polygon",{fill:"#EC5B6C",points:"0 76.0 0 164.7 151.69 164.7"}),z("polygon",{fill:"#E85C71",points:"180.95 18.9 110.33 63.9 117.37 68.0 117.26 73.4 180.95 113.6"}),z("polygon",{fill:"#C8405B",points:"117.26 73.4 117.37 99.0 90.53 114.9 174.35 164.7 180.95 164.7 180.95 113.6"}),z("polygon",{fill:"#FFCCBE",points:"90.53 51.6 63.69 68.1 90.53 83.4"}),z("path",{fill:"#FB9991",d:"M 90.53 51.6 L 90.53 61.3 L 100.87 67.4 L 90.53 73.5 L 90.53 83.4 L 117.37 68.0 C 117.15 67.6 90.53 51.6 90.53 51.6 Z"}),z("path",{fill:"#FFEACD",d:"M 63.69 68.1 C 63.47 68.5 64.02 99.3 64.02 99.3 C 64.02 99.3 64.46 99.6 64.9 99.9 L 90.53 83.4 L 63.69 68.1 Z"}),z("polygon",{fill:"#FFCFB5",points:"64.02 99.3 90.53 114.9 90.53 83.4"}),z("path",{fill:"#F67D73",d:"M 90.53 83.4 L 90.53 114.9 L 117.37 99.0 Z"}),z("path",{fill:"#F26560",d:"M 90.53 83.4 L 117.37 99.0 L 117.37 68.0 Z"}),z("polygon",{fill:"#EB5F5B",points:"80.08 67.5 90.53 73.5 90.53 61.3"}),z("polygon",{fill:"#DB4D50",points:"90.53 61.3 90.53 73.5 100.87 67.4"})]}),z("div",{className:"absolute bottom-0 left-0 w-full h-[65%] bg-linear-to-t from-black/35 to-black/0"}),z("p",{className:"absolute left-1 bottom-2 text-white",children:G.name})]}),J("div",{className:"px-2 h-10 flex justify-between items-center",children:[J("p",{className:"truncate pr-1 text-xs text-muted-foreground",children:[V.updated_ago()," ",dz(G.updatedAt??"")]}),z("div",{onClick:(Y)=>Y.stopPropagation(),children:J(C,{modal:!1,children:[z(f,{asChild:!0,children:z("button",{className:"hover:bg-muted outline-none flex px-1",children:z(vz,{className:"w-5 h-5 text-muted-foreground"})})}),J(I,{align:"end",children:[T&&z(w,{onClick:(Y)=>{Y.stopPropagation(),az(G)},children:V.project_settings()}),J(w,{className:"flex items-center justify-between gap-4 cursor-pointer",onSelect:(Y)=>{Y.preventDefault(),iz.mutate(G)},children:[z("span",{children:V.notification()}),z(r,{checked:G.enableNotification??!0,className:"pointer-events-none"})]}),L&&z(w,{className:"text-destructive focus:text-destructive",onClick:()=>jz(G),children:V.delete()})]})]})})]})]})},G.id)),T&&z("div",{className:Zz("shadow-md relative border rounded-xl overflow-hidden cursor-pointer transition-transform duration-100 ease-in-out border-dashed hover:border-orange-600/50 group",A==="create"?"scale-95":"scale-100"),onClick:nz,children:J("div",{className:"flex flex-col",children:[z("div",{className:"relative w-full aspect-square flex items-center justify-center bg-zinc-400/5 group-hover:bg-orange-600/5 transition-colors",children:z(Yz,{className:"w-8 h-8 text-zinc-400 group-hover:text-orange-600 transition-colors"})}),z("div",{className:"px-2 h-10 flex items-center justify-center bg-zinc-400/10 border-t group-hover:bg-orange-600/10 transition-colors",children:z("p",{className:"text-sm text-muted-foreground group-hover:text-orange-600 transition-colors",children:V.create_project()})})]})})]}),z(Nz,{open:H,onOpenChange:O,mode:y,teamId:Z,project:g}),z(yz,{open:b,onOpenChange:N,children:J(bz,{children:[J(Dz,{children:[z(fz,{children:V.are_you_sure()}),J(Iz,{children:[V.delete_project_warning({name:E?.name??""}),J("div",{className:"mt-4 flex flex-col gap-2 text-foreground",children:[z("span",{className:"text-sm font-medium",children:V.type_delete_to_confirm()}),z(j,{value:v,onChange:(G)=>u(G.target.value),placeholder:V.delete_placeholder(),className:"h-9",autoFocus:!0})]})]})]}),J(Cz,{children:[z(uz,{disabled:c.isPending,children:V.cancel()}),z(gz,{onClick:(G)=>{G.preventDefault(),rz()},disabled:v!=="delete"||c.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:c.isPending?V.deleting():V.delete()})]})]})}),z(cz,{open:t,onOpenChange:l,title:V.team_members(),type:"team",members:x,isOwner:Qz?.role==="owner",onInvite:tz,onUpdateRole:async(G,Y)=>{await sz.mutateAsync({userId:G,role:Y})},onRemoveMember:async(G)=>{await ez.mutateAsync(G)},currentUserId:Qz?.id})]})}var VG=Bz("/teams/$teamId/")({component:JG});export{VG as Route};
@@ -1 +0,0 @@
1
- import{o as s}from"./chunk-k7chm9a9.js";import"./chunk-f2zbsrc9.js";import"./chunk-by6g0vye.js";import"./chunk-gcpr2a24.js";import"./chunk-nn0px81k.js";import"./chunk-mha3rsh7.js";import"./chunk-jt6d0zb1.js";import"./chunk-4b7jcpgv.js";import"./chunk-djx2r4nj.js";import"./chunk-y3dy4pdt.js";import"./chunk-mgnxa0vy.js";import"./chunk-csqvmx1m.js";import"./chunk-ysvhtgve.js";import"./chunk-1fwzepfn.js";import"./chunk-ex2ym5pz.js";import"./chunk-34kaja59.js";import"./chunk-x9akgj7w.js";import"./chunk-ajndx51c.js";import"./chunk-93ecxcy4.js";import"./chunk-mhps85dd.js";import"./chunk-r2shjtte.js";import"./chunk-ns804tmv.js";import"./chunk-ymr5ybxk.js";import"./chunk-2xevs82j.js";import"./chunk-y2s0tjaa.js";import"./chunk-yyjx8nbq.js";import"./chunk-zye42cfp.js";import"./chunk-dk8vk17v.js";import"./chunk-rkz6x3r0.js";import"./chunk-7x1vkftb.js";import"./chunk-ck6msfch.js";import"./chunk-vhcqazqf.js";import"./chunk-tcm57j8r.js";import"./chunk-0bfqrx5q.js";import"./chunk-dkjkn8t3.js";import"./chunk-76433x4d.js";import"./chunk-2xgvs3as.js";import"./chunk-9cmvymm5.js";import"./chunk-6m1k317a.js";import"./chunk-kxr8fjsq.js";import"./chunk-02afmyqy.js";import"./chunk-8nyve0cr.js";import"./chunk-62ebss6h.js";import{Xi as t,gj as a}from"./chunk-kqpzx5az.js";import"./chunk-p49h5fxs.js";function h(){let{shareId:n,fileId:o}=e.useParams(),{start:r,version:i,compare:l,cmpLeft:c,cmpRight:p,cmpActive:d}=e.useSearch();return t(s,{shareId:n,initialFileId:o,startTime:r,versionId:i,compare:l,compareLeftId:c,compareRightId:p,compareActiveSide:d})}var e=a("/share/$shareId/files/$fileId")({component:h});export{e as Route};
@@ -1 +0,0 @@
1
- import{g as x}from"./chunk-5yhn31rd.js";import"./chunk-0n1wfwcm.js";import"./chunk-djx2r4nj.js";import{re as f}from"./chunk-792t2653.js";import{Ee as c}from"./chunk-y0f4bc9f.js";import"./chunk-y2s0tjaa.js";import"./chunk-yyjx8nbq.js";import"./chunk-zye42cfp.js";import"./chunk-dk8vk17v.js";import"./chunk-rkz6x3r0.js";import"./chunk-7x1vkftb.js";import"./chunk-ck6msfch.js";import"./chunk-vhcqazqf.js";import"./chunk-tcm57j8r.js";import"./chunk-2xgvs3as.js";import"./chunk-9cmvymm5.js";import{mi as s}from"./chunk-02afmyqy.js";import{Ci as b,ti as d,ui as l}from"./chunk-8nyve0cr.js";import{Vi as v,Xi as e,gj as p}from"./chunk-kqpzx5az.js";import{kn as m}from"./chunk-p49h5fxs.js";var g=m(v(),1);function k(){let{projectId:i,folderId:h}=y.useParams(),{teamId:r,ensureTeamIdForProject:t}=s();g.useEffect(()=>{t(i)},[i,t]);let{data:a}=l(f(i)),o=a?.rootFolder,{data:u}=d({queryKey:["folders",o],queryFn:async()=>{let n=await b.api.folders[":folderId"].$get({param:{folderId:o}});if(!n.ok)throw Error("failed to fetch folder");return await n.json()},enabled:!!o});if(!r||!o||!u)return e(c,{});return e(x,{teamId:r,projectId:i,projectName:a.name??"",assetId:h,rootFolderId:o,isRoot:!1})}var y=p("/projects/$projectId/folders/$folderId_/agentsmd")({component:k});export{y as Route};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Na as a}from"./chunk-m2tbft2c.js";import"./chunk-p49h5fxs.js";export default a();
@@ -1,2 +0,0 @@
1
- import{dh as f}from"./chunk-vhcqazqf.js";import{Xi as b,Yi as q}from"./chunk-kqpzx5az.js";function z(){return q("div",{className:"flex h-screen flex-col bg-background min-h-0",children:[q("div",{className:"flex h-14 items-center justify-between border-b px-6 shrink-0",children:[q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-4 w-24"}),b("span",{className:"text-muted-foreground",children:"/"}),b(f,{className:"h-4 w-32"})]}),q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-8 w-8 rounded-md"}),b(f,{className:"h-8 w-20 rounded-md"})]})]}),q("div",{className:"flex flex-1 overflow-hidden",children:[q("div",{className:"w-[240px] border-r p-4 space-y-4 hidden md:block shrink-0",children:[q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-4 w-4 rounded"}),b(f,{className:"h-4 w-24"})]}),q("div",{className:"pl-4 space-y-3",children:[q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-3 w-3 rounded"}),b(f,{className:"h-3 w-28"})]}),q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-3 w-3 rounded"}),b(f,{className:"h-3 w-20"})]}),q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-3 w-3 rounded"}),b(f,{className:"h-3 w-24"})]})]})]}),q("div",{className:"flex-1 p-6 space-y-6 overflow-y-auto",children:[q("div",{className:"flex items-center justify-between border-b pb-4",children:[q("div",{className:"flex items-center gap-4",children:[b(f,{className:"h-5 w-40"}),b(f,{className:"h-4 w-20"})]}),q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-8 w-8 rounded"}),b(f,{className:"h-8 w-8 rounded"}),b(f,{className:"h-8 w-32 rounded"})]})]}),q("div",{className:"space-y-4",children:[b("div",{className:"flex items-center gap-2",children:b(f,{className:"h-4 w-24"})}),b("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",children:Array.from({length:10}).map((w,v)=>q("div",{className:"flex flex-col rounded-lg border bg-card p-3 space-y-3",children:[b(f,{className:"aspect-square w-full rounded-md"}),q("div",{className:"space-y-2",children:[b(f,{className:"h-4 w-3/4"}),q("div",{className:"flex justify-between items-center",children:[b(f,{className:"h-3 w-1/4"}),b(f,{className:"h-3 w-1/3"})]})]})]},v))})]})]})]})]})}function A(){return q("div",{className:"h-screen flex flex-col bg-background",children:[q("div",{className:"flex h-14 items-center justify-between border-b px-6 shrink-0",children:[q("div",{className:"flex items-center gap-2",children:[b(f,{className:"h-4 w-16"}),b("span",{className:"text-muted-foreground",children:"/"}),b(f,{className:"h-4 w-28"}),b("span",{className:"text-muted-foreground",children:"/"}),b(f,{className:"h-4 w-32"})]}),b("div",{className:"flex items-center gap-2",children:b(f,{className:"h-8 w-20 rounded"})})]}),q("div",{className:"flex flex-1 overflow-hidden",children:[q("div",{className:"w-[280px] border-r p-4 flex flex-col gap-4 shrink-0 hidden md:flex",children:[b(f,{className:"h-5 w-24"}),b("div",{className:"space-y-3 flex-1 overflow-y-auto",children:Array.from({length:4}).map((w,v)=>q("div",{className:"flex gap-3 p-2 rounded border",children:[b(f,{className:"h-12 w-12 rounded bg-muted shrink-0"}),q("div",{className:"space-y-2 flex-1",children:[b(f,{className:"h-3 w-2/3"}),b(f,{className:"h-2 w-1/2"})]})]},v))})]}),q("div",{className:"flex-1 bg-muted/20 p-6 flex flex-col justify-between relative min-w-0",children:[b("div",{className:"flex-1 flex items-center justify-center",children:b(f,{className:"w-full max-w-4xl aspect-video rounded-lg shadow-lg"})}),q("div",{className:"mt-4 flex items-center justify-between shrink-0",children:[q("div",{className:"flex items-center gap-4",children:[b(f,{className:"h-8 w-8 rounded-full"}),b(f,{className:"h-4 w-32"})]}),b(f,{className:"h-4 w-24"})]})]}),q("div",{className:"w-[360px] border-l p-4 flex flex-col gap-6 shrink-0 hidden lg:flex bg-card",children:[q("div",{className:"space-y-4",children:[b(f,{className:"h-5 w-32"}),b("div",{className:"space-y-3",children:Array.from({length:3}).map((w,v)=>q("div",{className:"flex justify-between items-center py-1 border-b",children:[b(f,{className:"h-3 w-20"}),b(f,{className:"h-3 w-32"})]},v))})]}),q("div",{className:"flex-1 flex flex-col gap-4",children:[b(f,{className:"h-5 w-24"}),b("div",{className:"space-y-3 flex-1 overflow-y-auto",children:Array.from({length:3}).map((w,v)=>q("div",{className:"flex gap-3 p-3 rounded-lg border bg-muted/10",children:[b(f,{className:"h-8 w-8 rounded-full shrink-0"}),q("div",{className:"space-y-2 flex-1",children:[q("div",{className:"flex justify-between",children:[b(f,{className:"h-3 w-24"}),b(f,{className:"h-2 w-12"})]}),b(f,{className:"h-3 w-full"}),b(f,{className:"h-3 w-5/6"})]})]},v))})]})]})]})]})}
2
- export{z as Ee,A as Fe};
@@ -1,3 +0,0 @@
1
- import{Ci as F,Si as $,xi as w}from"./chunk-8nyve0cr.js";var z=null,c=w((J)=>({projectState:null,setProjectState:(D)=>{if(z)clearTimeout(z),z=null;J({projectState:D})},clearProjectState:()=>{if(z)clearTimeout(z);z=setTimeout(()=>{J({projectState:null}),z=null},10)}}));var T="shumai_selected_agent_id",M=()=>{if(typeof window<"u"&&window.localStorage)return localStorage.getItem(T);return null},K=w((J)=>({isChatbotOpen:!1,setIsChatbotOpen:(D)=>J({isChatbotOpen:D}),isHistoryMode:!1,setIsHistoryMode:(D)=>J({isHistoryMode:D}),currentSessionId:null,setCurrentSessionId:(D)=>J({currentSessionId:D}),chatAssets:[],addAssets:(D)=>J((H)=>{let L=new Set(H.chatAssets.map((V)=>V.id)),Q=D.filter((V)=>!L.has(V.id));return{chatAssets:[...H.chatAssets,...Q]}}),removeAsset:(D)=>J((H)=>({chatAssets:H.chatAssets.filter((L)=>L.id!==D)})),clearAssets:()=>J({chatAssets:[]}),messages:[],setMessages:(D)=>J({messages:D}),historySessions:[],setHistorySessions:(D)=>J({historySessions:D}),isStreaming:!1,setIsStreaming:(D)=>J({isStreaming:D}),selectedAgentId:M(),setSelectedAgentId:(D)=>{if(typeof window<"u"&&window.localStorage)if(D)localStorage.setItem(T,D);else localStorage.removeItem(T);J({selectedAgentId:D})},inputText:"",setInputText:(D)=>J({inputText:D}),scrollTop:0,isAtBottom:!0,setScrollState:(D,H)=>J({scrollTop:D,isAtBottom:H}),fetchHistorySessions:async(D)=>{try{let H=await F.api.teams[":teamId"].chat.sessions.$get({param:{teamId:D},query:{first:"50"}});if(H.ok){let L=await H.json();J({historySessions:L.data||[]})}}catch(H){console.error("Failed to fetch history sessions:",H)}},loadSession:async(D,H)=>{try{let L=await F.api.teams[":teamId"].chat.sessions[":sessionId"].messages.$get({param:{teamId:D,sessionId:H}});if(L.ok){let Q=await L.json(),U=K.getState().historySessions.find((P)=>P.id===H)?.agentId||null;J({currentSessionId:H,messages:Q,isHistoryMode:!1,scrollTop:0,isAtBottom:!0,...U?{selectedAgentId:U}:{}})}else throw Error("Failed to load session messages")}catch(L){let Q=L instanceof Error?L.message:"Failed to load session";$.error(Q)}},deleteSession:async(D,H)=>{try{if((await F.api.teams[":teamId"].chat.sessions[":sessionId"].$delete({param:{teamId:D,sessionId:H}})).ok)$.success("Session deleted successfully"),J((Q)=>({historySessions:Q.historySessions.filter((V)=>V.id!==H),currentSessionId:Q.currentSessionId===H?null:Q.currentSessionId,messages:Q.currentSessionId===H?[]:Q.messages}));else throw Error("Failed to delete session")}catch(L){let Q=L instanceof Error?L.message:"Failed to delete session";$.error(Q)}},startNewSession:()=>{let D=M();J({currentSessionId:null,messages:[],chatAssets:[],inputText:"",scrollTop:0,isAtBottom:!0,...D?{selectedAgentId:D}:{}})},sendMessage:async(D,H,L,Q,V)=>{let U=K.getState();if(U.isStreaming)return;let P=`temp-${Date.now()}`,b={id:P,role:"user",content:[{type:"text",text:H}],timestamp:Date.now()},v=[...U.messages];if(U.chatAssets.length>0){let B={id:`temp-context-${Date.now()}`,role:"custom",customType:"context_display_info",details:{assets:U.chatAssets.map((k)=>({id:k.id,name:k.name,type:k.type}))},timestamp:Date.now()-1};v.push(B)}v.push(b),J({messages:v,isStreaming:!0,chatAssets:[],isAtBottom:!0});let p=U.chatAssets.map((X)=>X.id),h=U.selectedAgentId;if(!h){$.error("No agent selected");return}try{let X=await F.api.teams[":teamId"].chat.$post({param:{teamId:D},json:{agentId:h,textPrompt:H,assetIds:p,sessionId:U.currentSessionId||void 0,contextAssetId:Q,projectId:L}});if(!X.ok)throw Error("Failed to start chat");let B=X.headers.get("x-session-id");if(B&&!U.currentSessionId)J({currentSessionId:B});let k=X.body?.getReader();if(!k)throw Error("No stream body");let j=new TextDecoder,G="";while(!0){let{done:S,value:x}=await k.read();if(S)break;G+=j.decode(x,{stream:!0});let C=G.split(`
2
- `);G=C.pop()||"";for(let y of C){let N=y.trim();if(!N)continue;if(N.startsWith("data: ")){let A=N.slice(6);try{let Z=JSON.parse(A);if(Z.type==="session"){if(!K.getState().currentSessionId)J({currentSessionId:Z.sessionId})}else if(Z.type==="entry"){let q=Z.entry,Y=q;if(Y.role==="toolResult"&&typeof Y.toolName==="string"&&["create_file","create_folder","create_version"].includes(Y.toolName)&&!Y.isError)V?.();J((_)=>{let R=_.messages.some((W)=>W.id===q.id),O=_.messages.filter((W)=>{if(q.role==="user"&&!R)return!(W.id.startsWith("temp-")&&!W.id.startsWith("temp-context-"));if(q.role==="custom"&&q.customType==="context_display_info"&&!R)return!W.id.startsWith("temp-context-");return!0}),f=O.findIndex((W)=>W.id===q.id);if(f!==-1){let W=[...O];return W[f]=q,{messages:W}}else return{messages:[...O,q]}})}else if(Z.type==="done"){if(Z.status==="failed")$.error(Z.error||"Workflow failed")}}catch(Z){console.error("Error parsing SSE line:",Z)}}}}K.getState().fetchHistorySessions(D)}catch(X){let B=X instanceof Error?X.message:"Failed to send message";$.error(B),J((k)=>({messages:k.messages.filter((j)=>j.id!==P)}))}finally{J({isStreaming:!1})}},abortActiveSession:async(D)=>{let{currentSessionId:H,isStreaming:L}=K.getState();if(!H||!L)return;try{if((await F.api.teams[":teamId"].chat.sessions[":sessionId"].abort.$post({param:{teamId:D,sessionId:H}})).ok)$.success("Agent execution stopped");else throw Error("Failed to abort agent execution")}catch(Q){let V=Q instanceof Error?Q.message:"Failed to abort execution";$.error(V)}}}));
3
- export{c as cg,K as dg};
@@ -1,2 +0,0 @@
1
- import{da as Vq}from"./chunk-mgnxa0vy.js";import{vh as o,wh as r,xh as m,yh as e}from"./chunk-76433x4d.js";import{$h as O,Zh as h,_h as C}from"./chunk-kxr8fjsq.js";import{ai as P,ci as k,di as G,fi as B,gi as Y}from"./chunk-02afmyqy.js";import{Di as qq,Ei as Eq,Fi as Jq,Gi as Kq,Hi as Nq,Ii as Qq,Ji as Wq,Ki as Xq,Li as Yq,Ni as Zq,Oi as _q,Qi as $q,Si as X}from"./chunk-8nyve0cr.js";import{Vi as Cq,Wi as t,Wj as H,Xi as E,Yi as K,ek as n,jm as W,mm as J,nm as Hq,wj as z,yl as s}from"./chunk-kqpzx5az.js";import{kn as hq}from"./chunk-p49h5fxs.js";var Z=hq(Cq(),1);function uq({open:fq,onOpenChange:Fq,title:zq,members:g,isOwner:_,onInvite:c,onUpdateRole:I,onRemoveMember:v,currentUserId:Pq,availableMembersToAdd:M,onAddMember:L,type:V="team"}){let[T,u]=Z.useState("editor"),[S,p]=Z.useState(null),[l,x]=Z.useState(!1),[D,U]=Z.useState(null),[f,A]=Z.useState(null),[j,i]=Z.useState({}),[$,F]=Z.useState(null),y=(q)=>{if(!q)return"";switch(q.toLowerCase()){case"owner":return J.owner();case"editor":return J.editor();case"reviewer":return J.reviewer();default:return q}},a=(q,N)=>{i((Q)=>({...Q,[q]:N}))},kq=async(q,N)=>{if(!I)return;U(q);try{await I(q,N),X.success(J.member_role_updated())}catch(Q){console.error(Q),X.error(J.failed_to_update_member_role())}finally{U(null)}},Gq=async()=>{if(!v||!f?.id)return;U(f.id);try{await v(f.id),X.success(J.member_removed()),A(null)}catch(q){console.error(q),X.error(J.failed_to_remove_member())}finally{U(null)}},Bq=async()=>{if(!c)return;x(!0);try{let q=await c(T),N=`${window.location.origin}/signup?inviteCode=${q}`;p(N)}catch(q){console.error(q),X.error(J.failed_to_generate_invite_link())}finally{x(!1)}},Lq=async()=>{if(S){if(await Vq(S))X.success(J.invite_link_copied())}},R=(q)=>{if(!q)return"??";return q.split(" ").map((N)=>N[0]).slice(0,2).join("").toUpperCase()},Sq=(q)=>{if(!q)p(null),u("editor"),i({}),F(null);Fq(q)},w=Array.isArray(g)?g:[],Uq=Array.isArray(M)?M:[],yq=V==="project"&&_?w.filter((q)=>q.role==="owner"||q.scope==="project"||q.hasCustomRole):w,d=V==="project"&&_?w.filter((q)=>q.scope==="team"&&q.role!=="owner"&&!q.hasCustomRole):[],b=V==="project"&&_?Uq.filter((q)=>q.scope==="project"):[];return E(Yq,{open:fq,onOpenChange:Sq,children:K(Zq,{className:"sm:max-w-xl",onOpenAutoFocus:(q)=>q.preventDefault(),children:[E(_q,{children:E($q,{children:zq})}),K("div",{className:"space-y-4",children:[E("div",{className:"max-h-[300px] overflow-y-auto space-y-2",children:yq.map((q)=>{let N=V==="team"&&q.scope==="project";return K("div",{className:"flex items-center justify-between p-2 rounded-lg hover:bg-muted/50",children:[K("div",{className:"flex items-center gap-3",children:[K(h,{children:[q.image&&E(C,{src:q.image,alt:q.name,className:"object-cover"}),E(O,{children:R(q.name)})]}),K("div",{className:"flex flex-col",children:[E("span",{className:"text-sm font-medium",children:q.name}),K("div",{className:"flex items-center gap-2",children:[!N&&E("span",{className:"text-xs text-muted-foreground capitalize",children:y(q.role)}),q.scope&&K(t,{children:[!N&&E("span",{className:"text-[10px] text-muted-foreground/70",children:"•"}),E("span",{className:"text-xs text-muted-foreground capitalize",children:q.scope==="team"?J.team_member():J.project_member()})]})]})]})]}),_&&q.role!=="owner"&&q.id!==Pq&&K("div",{className:"flex items-center gap-2",children:[N?E(o,{children:K(r,{children:[E(m,{asChild:!0,children:E("span",{children:E(W,{variant:"outline",size:"sm",className:"h-8 px-2 text-xs capitalize w-26 justify-between",disabled:!0,children:E(H,{className:"ml-auto h-3 w-3 opacity-50"})})})}),E(e,{side:"top",children:E("p",{className:"text-xs",children:J.project_member_role_tooltip()})})]})}):K(P,{children:[E(k,{asChild:!0,children:K(W,{variant:"outline",size:"sm",className:"h-8 px-2 text-xs capitalize w-26",disabled:D===q.id,children:[y(q.role),E(H,{className:"ml-1 h-3 w-3 opacity-50"})]})}),E(G,{children:K(B,{value:q.role,onValueChange:(Q)=>kq(q.id,Q),children:[E(Y,{value:"editor",className:"text-xs",children:J.editor()}),E(Y,{value:"reviewer",className:"text-xs",children:J.reviewer()})]})})]}),E(W,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>A(q),disabled:D===q.id,children:D===q.id?E(z,{className:"h-3 w-3 animate-spin"}):E(s,{className:"h-3 w-3"})})]})]},q.id)})}),E(qq,{open:!!f,onOpenChange:(q)=>!q&&A(null),children:K(Eq,{children:[K(Jq,{children:[E(Nq,{children:J.remove_member()}),E(Qq,{children:J.remove_member_confirmation({name:f?.name||"",type:V==="project"?J.project():J.team()})})]}),K(Kq,{children:[E(Xq,{children:J.cancel()}),E(Wq,{onClick:Gq,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:J.remove()})]})]})})," ",_&&L&&d.length>0&&K("div",{className:"border-t pt-4",children:[E("h4",{className:"text-sm font-medium mb-1",children:J.add_team_member_to_project()}),E("p",{className:"text-xs text-muted-foreground mb-3 font-normal",children:J.add_team_member_to_project_hint()}),E("div",{className:"max-h-[200px] overflow-y-auto space-y-2 pr-1",children:d.map((q)=>{let N=j[q.id]||"editor";return K("div",{className:"flex items-center justify-between p-2 rounded-lg hover:bg-muted/50",children:[K("div",{className:"flex items-center gap-3",children:[K(h,{children:[q.image&&E(C,{src:q.image,alt:q.name,className:"object-cover"}),E(O,{children:R(q.name)})]}),K("div",{className:"flex flex-col",children:[E("span",{className:"text-sm font-medium",children:q.name}),E("span",{className:"text-xs text-muted-foreground capitalize",children:q.scope==="team"?J.team_member():J.project_member()})]})]}),K("div",{className:"flex items-center gap-2",children:[K(P,{children:[E(k,{asChild:!0,children:K(W,{variant:"outline",size:"sm",className:"h-8 px-2 text-xs capitalize w-26",disabled:$===q.id,children:[y(N),E(H,{className:"ml-1 h-3 w-3 opacity-50"})]})}),E(G,{children:K(B,{value:N,onValueChange:(Q)=>a(q.id,Q),children:[E(Y,{value:"editor",className:"text-xs",children:J.editor()}),E(Y,{value:"reviewer",className:"text-xs",children:J.reviewer()})]})})]}),E(W,{onClick:async()=>{F(q.id);try{await L(q.id,N),X.success(J.added_member_successfully({name:q.name||""}))}catch(Q){console.error(Q),X.error(J.failed_to_add_member({name:q.name||""}))}finally{F(null)}},disabled:$!==null,size:"sm",className:"h-8 text-xs px-3",children:$===q.id?E(z,{className:"h-3 w-3 animate-spin"}):J.set_role()})]})]},q.id)})})]}),_&&L&&b.length>0&&K("div",{className:"border-t pt-4",children:[E("h4",{className:"text-sm font-medium mb-1",children:J.add_members_from_other_projects()}),E("p",{className:"text-xs text-muted-foreground mb-3 font-normal",children:J.add_members_from_other_projects_hint()}),E("div",{className:"max-h-[200px] overflow-y-auto space-y-2 pr-1",children:b.map((q)=>{let N=j[q.id]||"editor";return K("div",{className:"flex items-center justify-between p-2 rounded-lg hover:bg-muted/50",children:[K("div",{className:"flex items-center gap-3",children:[K(h,{children:[q.image&&E(C,{src:q.image,alt:q.name,className:"object-cover"}),E(O,{children:R(q.name)})]}),K("div",{className:"flex flex-col",children:[E("span",{className:"text-sm font-medium",children:q.name}),E("span",{className:"text-xs text-muted-foreground capitalize",children:q.scope==="team"?J.team_member():J.project_member()})]})]}),K("div",{className:"flex items-center gap-2",children:[K(P,{children:[E(k,{asChild:!0,children:K(W,{variant:"outline",size:"sm",className:"h-8 px-2 text-xs capitalize w-26",disabled:$===q.id,children:[y(N),E(H,{className:"ml-1 h-3 w-3 opacity-50"})]})}),E(G,{children:K(B,{value:N,onValueChange:(Q)=>a(q.id,Q),children:[E(Y,{value:"editor",className:"text-xs",children:J.editor()}),E(Y,{value:"reviewer",className:"text-xs",children:J.reviewer()})]})})]}),E(W,{onClick:async()=>{F(q.id);try{await L(q.id,N),X.success(J.added_member_successfully({name:q.name||""}))}catch(Q){console.error(Q),X.error(J.failed_to_add_member({name:q.name||""}))}finally{F(null)}},disabled:$!==null,size:"sm",className:"h-8 text-xs px-3",children:$===q.id?E(z,{className:"h-3 w-3 animate-spin"}):J.add_to_project()})]})]},q.id)})})]}),_&&c&&K("div",{className:"border-t pt-4",children:[E("h4",{className:"text-sm font-medium mb-3",children:J.invite_new_member()}),K("div",{className:"space-y-3",children:[K("div",{className:"flex gap-2",children:[K(P,{children:[E(k,{asChild:!0,children:K(W,{variant:"outline",className:"w-[120px] justify-between",children:[T==="editor"?J.editor():J.reviewer(),E(H,{className:"h-4 w-4 opacity-50"})]})}),E(G,{children:K(B,{value:T,onValueChange:(q)=>u(q),children:[E(Y,{value:"editor",children:J.editor()}),E(Y,{value:"reviewer",children:J.reviewer()})]})})]}),K(W,{onClick:Bq,disabled:l,className:"flex-1",children:[l&&E(z,{className:"mr-2 h-4 w-4 animate-spin"}),J.generate_link()]})]}),S&&K("div",{className:"flex gap-2",children:[E(Hq,{value:S,readOnly:!0}),E(W,{variant:"outline",size:"icon",onClick:Lq,children:E(n,{className:"h-4 w-4"})})]})]})]})]})]})})}
2
- export{uq as ca};