@shumai-one/shumai 0.2.0 → 0.2.1

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 (156) hide show
  1. package/bin/{chunk-fcb14agg.js → chunk-044xt1se.js} +1 -1
  2. package/bin/chunk-0a5k9avd.js +4 -0
  3. package/bin/{chunk-xh2ntgmk.js → chunk-14fh4s1a.js} +2 -2
  4. package/bin/{chunk-y1xs4c5j.js → chunk-1ae8csk6.js} +1 -1
  5. package/bin/{chunk-yk3k5g5w.js → chunk-1w9dnk5p.js} +2 -2
  6. package/bin/chunk-211y81mp.js +1 -0
  7. package/bin/{chunk-twzgpwst.js → chunk-25d1g086.js} +2 -2
  8. package/bin/chunk-29pkpmvy.js +2 -0
  9. package/bin/{chunk-9rw65s3e.js → chunk-2djd6pq1.js} +2 -2
  10. package/bin/chunk-2dsmsa6a.js +3 -0
  11. package/bin/{chunk-08m8mzfa.js → chunk-2dz8nn9v.js} +1 -1
  12. package/bin/{chunk-mnv6pj0k.js → chunk-2xnys7v4.js} +2 -2
  13. package/bin/{chunk-a5kfa0k9.js → chunk-3rmc8nz6.js} +1 -1
  14. package/bin/{chunk-fwf8yne2.js → chunk-46c5xkmn.js} +2 -2
  15. package/bin/{chunk-axx5bh38.js → chunk-4fnak2zn.js} +2 -2
  16. package/bin/{chunk-gk7158n4.js → chunk-50ebjdkv.js} +2 -2
  17. package/bin/{chunk-29ectt6g.js → chunk-58aabg1f.js} +2 -2
  18. package/bin/{chunk-hb5v9ees.js → chunk-5j7axztv.js} +2 -2
  19. package/bin/chunk-5k03xpzq.js +6 -0
  20. package/bin/chunk-6724dtsx.js +2 -0
  21. package/bin/{chunk-q4f5vvtx.js → chunk-6h4ay2p8.js} +2 -2
  22. package/bin/chunk-6w5cn6p3.js +3 -0
  23. package/bin/{chunk-ps4h3387.js → chunk-75jka5v9.js} +2 -2
  24. package/bin/chunk-79n633wf.js +3 -0
  25. package/bin/chunk-7b17fb36.js +6 -0
  26. package/bin/{chunk-dypsm6m2.js → chunk-7h75r7ep.js} +1 -1
  27. package/bin/{chunk-pf8edn5x.js → chunk-7ktvhtp1.js} +2 -2
  28. package/bin/{chunk-6r9w7z15.js → chunk-7mnezagc.js} +2 -2
  29. package/bin/chunk-7we7ex0m.js +3 -0
  30. package/bin/{chunk-z42cyc20.js → chunk-82w2419d.js} +2 -2
  31. package/bin/chunk-861dz0bf.js +8 -0
  32. package/bin/chunk-891h8br6.js +3 -0
  33. package/bin/chunk-8abs8d48.js +12 -0
  34. package/bin/chunk-8qg47kj6.js +3 -0
  35. package/bin/{chunk-kbzm1pwx.js → chunk-976v5s8y.js} +1 -1
  36. package/bin/{chunk-8wv3kdz9.js → chunk-99db4j0k.js} +2 -2
  37. package/bin/{chunk-dgx2zxze.js → chunk-9bpjfkjf.js} +2 -2
  38. package/bin/chunk-9evm8x70.js +1 -0
  39. package/bin/{chunk-ec88pb09.js → chunk-9h3ds7rn.js} +2 -2
  40. package/bin/{chunk-ehfk24cf.js → chunk-9n783gva.js} +1 -1
  41. package/bin/chunk-a5s5ny4z.js +2 -0
  42. package/bin/{chunk-3rajscaz.js → chunk-ag35pxnb.js} +1 -1
  43. package/bin/{chunk-ajqsprm0.js → chunk-azfgjqjx.js} +2 -2
  44. package/bin/{chunk-s8d2045p.js → chunk-b9hb5jzt.js} +1 -1
  45. package/bin/chunk-bepnbw1g.js +2 -0
  46. package/bin/chunk-bg24g9kk.js +1 -0
  47. package/bin/{chunk-1fpqq6ed.js → chunk-c1v946wb.js} +2 -2
  48. package/bin/chunk-c45rh4hk.js +3 -0
  49. package/bin/{chunk-acxm86fh.js → chunk-cj5qwc9c.js} +1 -1
  50. package/bin/{chunk-j8q688sx.js → chunk-cpr05qng.js} +2 -2
  51. package/bin/chunk-d2vxmn9v.js +3 -0
  52. package/bin/chunk-dqtq9t8e.js +1 -0
  53. package/bin/{chunk-4kk5g619.js → chunk-dwf5e5g3.js} +2 -2
  54. package/bin/{chunk-w4y97tzy.js → chunk-dzm2f82x.js} +1 -1
  55. package/bin/chunk-e3c6hyz8.js +4 -0
  56. package/bin/chunk-fgnxtqtk.js +1 -0
  57. package/bin/chunk-fxvb6g2r.js +1 -0
  58. package/bin/{chunk-7ddaxdpf.js → chunk-ga0drqj7.js} +1 -1
  59. package/bin/{chunk-n5hfy93f.js → chunk-ga3mh3cd.js} +3 -3
  60. package/bin/chunk-gd5xwgp6.js +2 -0
  61. package/bin/chunk-hcz4snm7.js +8 -0
  62. package/bin/{chunk-dyybbn07.js → chunk-hmsb7ehr.js} +1 -1
  63. package/bin/{chunk-49ej1y67.js → chunk-hqptebzb.js} +2 -2
  64. package/bin/{chunk-mv79zk8q.js → chunk-hy50c4pw.js} +3 -3
  65. package/bin/chunk-jbde7evp.js +8 -0
  66. package/bin/{chunk-mjan6b09.js → chunk-jfjcxyhf.js} +3 -3
  67. package/bin/{chunk-hdk93ghf.js → chunk-jyjnt0s9.js} +2 -2
  68. package/bin/chunk-k1r17nfa.js +7 -0
  69. package/bin/{chunk-3qdn3pty.js → chunk-k5bekrrp.js} +1 -1
  70. package/bin/{chunk-3x62t1m0.js → chunk-kj751zje.js} +1 -1
  71. package/bin/chunk-kjkmh26f.js +1 -0
  72. package/bin/{chunk-m7jfszqt.js → chunk-m11g9hx7.js} +2 -2
  73. package/bin/{chunk-e5833tbd.js → chunk-m3dwydr3.js} +2 -2
  74. package/bin/{chunk-5a2maxwp.js → chunk-mg6fce5x.js} +2 -2
  75. package/bin/{chunk-xpqcvxej.js → chunk-mjncyjwf.js} +1 -1
  76. package/bin/{chunk-33ee1cvv.js → chunk-mk1jewvw.js} +2 -2
  77. package/bin/{chunk-gdm6y33a.js → chunk-mv8c5fky.js} +1 -1
  78. package/bin/chunk-mwh2n8yt.js +3 -0
  79. package/bin/{chunk-ysq64j13.js → chunk-n4meg9wb.js} +1 -1
  80. package/bin/{chunk-k5w64spz.js → chunk-nceqrqey.js} +2 -2
  81. package/bin/{chunk-wv4fe1fj.js → chunk-ngd23mtc.js} +2 -2
  82. package/bin/{chunk-m54p1cvp.js → chunk-p3emandj.js} +2 -2
  83. package/bin/{chunk-1wq9hjjr.js → chunk-phw4ne8b.js} +1 -1
  84. package/bin/{chunk-22dje1f5.js → chunk-pmx9760x.js} +1 -1
  85. package/bin/chunk-pv76qkym.js +2 -0
  86. package/bin/{chunk-d1ka11hc.js → chunk-pvy0gccg.js} +1 -1
  87. package/bin/chunk-pxw97qbq.js +3 -0
  88. package/bin/chunk-q09dfja5.js +3 -0
  89. package/bin/chunk-q72ax3m8.js +12 -0
  90. package/bin/{chunk-zsdwska1.js → chunk-q9sgjs4d.js} +1 -1
  91. package/bin/chunk-qag3w2dd.js +3 -0
  92. package/bin/{chunk-2cmg5sfn.js → chunk-qf7n519d.js} +2 -2
  93. package/bin/{chunk-3n1k9qt5.js → chunk-qj2kpkje.js} +1 -1
  94. package/bin/{chunk-cp18trqb.js → chunk-qjjr3fff.js} +2 -2
  95. package/bin/{chunk-fwe9g818.js → chunk-s1n39qte.js} +1 -1
  96. package/bin/chunk-s2725w64.js +1 -0
  97. package/bin/{chunk-09wp20mv.js → chunk-saq5797j.js} +1 -1
  98. package/bin/{chunk-d2y3rbjm.js → chunk-sp75qe28.js} +1 -1
  99. package/bin/{chunk-4hnrd4qh.js → chunk-sy8rqacm.js} +1 -1
  100. package/bin/{chunk-6mn3jqm9.js → chunk-t1mxqskx.js} +2 -2
  101. package/bin/chunk-t84t3v6q.js +1 -0
  102. package/bin/{chunk-eadb78m8.js → chunk-ta7bfdrn.js} +1 -1
  103. package/bin/{chunk-2s5a64nr.js → chunk-ttsqdsxr.js} +2 -2
  104. package/bin/chunk-v05d1aeq.js +2 -0
  105. package/bin/{chunk-yhj8c5re.js → chunk-v3j7acwn.js} +2 -2
  106. package/bin/{chunk-kpy0kpna.js → chunk-v98yavtp.js} +2 -2
  107. package/bin/chunk-vreq89j6.js +1 -0
  108. package/bin/{chunk-pqm0g14r.js → chunk-w1d5vmtc.js} +2 -2
  109. package/bin/chunk-w88219ex.js +3 -0
  110. package/bin/{chunk-vgvmt2m1.js → chunk-wbhsmhgp.js} +2 -2
  111. package/bin/{chunk-nwtb6dt1.js → chunk-wf4d1anc.js} +5 -5
  112. package/bin/{chunk-frm7vz6v.js → chunk-wfex9jw0.js} +2 -2
  113. package/bin/chunk-x9q2vzn8.js +7 -0
  114. package/bin/chunk-xv4mfppt.js +2 -0
  115. package/bin/{chunk-r3n9zpfw.js → chunk-y4s3xr4n.js} +2 -2
  116. package/bin/{chunk-9n0etqsy.js → chunk-ydagqpny.js} +1 -1
  117. package/bin/{chunk-aakzq0w1.js → chunk-ymyyap80.js} +1 -1
  118. package/bin/{chunk-5tmf3c0g.js → chunk-zn9jbc6t.js} +2 -2
  119. package/bin/{chunk-3rt9mnj3.js → chunk-ztmj61z9.js} +1 -1
  120. package/bin/shumai-app.html +1 -1
  121. package/bin/shumai-app.js +248 -247
  122. package/package.json +7 -7
  123. package/prisma/migrations/20260722022359_add_skill_permission/migration.sql +2 -0
  124. package/prisma/schema.prisma +1 -0
  125. package/bin/chunk-0at8vxt5.js +0 -3
  126. package/bin/chunk-0zv7f9ca.js +0 -2
  127. package/bin/chunk-2k4vp654.js +0 -2
  128. package/bin/chunk-2tbya52d.js +0 -2
  129. package/bin/chunk-2vs3evc7.js +0 -14
  130. package/bin/chunk-33169en9.js +0 -8
  131. package/bin/chunk-3m39v371.js +0 -1
  132. package/bin/chunk-6c4c7t0n.js +0 -1
  133. package/bin/chunk-6frqqxkv.js +0 -1
  134. package/bin/chunk-7rhjej0x.js +0 -3
  135. package/bin/chunk-7wvgtw25.js +0 -3
  136. package/bin/chunk-8s0ae37g.js +0 -1
  137. package/bin/chunk-94h8644q.js +0 -2
  138. package/bin/chunk-ac2ky3q0.js +0 -12
  139. package/bin/chunk-cthpdt54.js +0 -11
  140. package/bin/chunk-d0earxhc.js +0 -4
  141. package/bin/chunk-d0n8nxp3.js +0 -3
  142. package/bin/chunk-d22pyc5n.js +0 -1
  143. package/bin/chunk-dmgjse02.js +0 -4
  144. package/bin/chunk-g7wrxnmd.js +0 -1
  145. package/bin/chunk-jrvrg4fx.js +0 -1
  146. package/bin/chunk-k712q1zj.js +0 -2
  147. package/bin/chunk-kef0rnwn.js +0 -1
  148. package/bin/chunk-n296vcfw.js +0 -3
  149. package/bin/chunk-n6jgyv4y.js +0 -3
  150. package/bin/chunk-nar4s9v9.js +0 -3
  151. package/bin/chunk-nn8e9j7c.js +0 -1
  152. package/bin/chunk-qqesrgjk.js +0 -7
  153. package/bin/chunk-qz9xht6d.js +0 -2
  154. package/bin/chunk-symna5cj.js +0 -1
  155. package/bin/chunk-w4t9n9te.js +0 -6
  156. package/bin/chunk-z14hh99h.js +0 -2
@@ -1,2 +1,2 @@
1
- import{Ai as k,Ni as F,Oi as A,Pi as V,bg as t,cg as R}from"./chunk-nwtb6dt1.js";import{ak as l}from"./chunk-kbzm1pwx.js";function D(a,b){var f=a.length;a.push(b);a:for(;0<f;){var g=f-1>>>1,d=a[g];if(0<q(d,b))a[g]=b,a[f]=d,f=g;else break a}}function C(a){return a.length===0?null:a[0]}function H(a){if(a.length===0)return null;var b=a[0],f=a.pop();if(f!==b){a[0]=f;a:for(var g=0,d=a.length,Z=d>>>1;g<Z;){var $=2*(g+1)-1,P=a[$],N=$+1,G=a[N];if(0>q(P,f))N<d&&0>q(G,P)?(a[g]=G,a[N]=f,g=N):(a[g]=P,a[$]=f,g=$);else if(N<d&&0>q(G,f))a[g]=G,a[N]=f,g=N;else break a}}return b}function q(a,b){var f=a.sortIndex-b.sortIndex;return f!==0?f:a.id-b.id}function S(a){for(var b=C(o);b!==null;){if(b.callback===null)H(o);else if(b.startTime<=a)H(o),b.sortIndex=b.expirationTime,D(w,b);else break;b=C(o)}}function c(a){if(K=!1,S(a),!J)if(C(w)!==null)J=!0,E||(E=!0,B());else{var b=C(o);b!==null&&I(c,b.startTime-a)}}function m(){return n?!0:_()-L<p?!1:!0}function U(){if(n=!1,E){var a=_();L=a;var b=!0;try{a:{J=!1,K&&(K=!1,j(X),X=-1),T=!0;var f=O;try{t:{S(a);for(z=C(w);z!==null&&!(z.expirationTime>a&&m());){var g=z.callback;if(typeof g==="function"){z.callback=null,O=z.priorityLevel;var d=g(z.expirationTime<=a);if(a=_(),typeof d==="function"){z.callback=d,S(a),b=!0;break t}z===C(w)&&H(w),S(a)}else H(w);z=C(w)}if(z!==null)b=!0;else{var Z=C(o);Z!==null&&I(c,Z.startTime-a),b=!1}}break a}finally{z=null,O=f,T=!1}b=void 0}}finally{b?B():E=!1}}}function I(a,b){X=u(function(){a(_())},b)}var _=void 0,M,v,W,w,o,h=1,z=null,O=3,T=!1,J=!1,K=!1,n=!1,u,j,s,E=!1,X=-1,p=5,L=-1,B,Q,y,i=5,r=1,e=4,aa=3,ta=2,ba=function(a){a.callback=null},fa=function(){return O},ga=function(){n=!0},da=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var f=O;O=a;try{return b()}finally{O=f}},za=function(a,b,f){var g=_();switch(typeof f==="object"&&f!==null?(f=f.delay,f=typeof f==="number"&&0<f?g+f:g):f=g,a){case 1:var d=-1;break;case 2:d=250;break;case 5:d=1073741823;break;case 4:d=1e4;break;default:d=5000}return d=f+d,a={id:h++,callback:b,priorityLevel:a,startTime:f,expirationTime:d,sortIndex:-1},f>g?(a.sortIndex=f,D(o,a),C(w)===null&&a===C(o)&&(K?(j(X),X=-1):K=!0,I(c,f-g))):(a.sortIndex=d,D(w,a),J||T||(J=!0,E||(E=!0,B()))),a},Ca;var wa=l(()=>{if(typeof performance==="object"&&typeof performance.now==="function")M=performance,_=function(){return M.now()};else v=Date,W=v.now(),_=function(){return v.now()-W};w=[],o=[],u=typeof setTimeout==="function"?setTimeout:null,j=typeof clearTimeout==="function"?clearTimeout:null,s=typeof setImmediate<"u"?setImmediate:null;if(typeof s==="function")B=function(){s(U)};else if(typeof MessageChannel<"u")Q=new MessageChannel,y=Q.port2,Q.port1.onmessage=U,B=function(){y.postMessage(null)};else B=function(){u(U,0)};Ca=m});function Na({className:a,orientation:b="horizontal",...f}){return t(F.Root,{"data-slot":"tabs","data-orientation":b,orientation:b,className:V("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",a),...f})}var x=k("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Va({className:a,variant:b="default",...f}){return t(F.List,{"data-slot":"tabs-list","data-variant":b,className:V(x({variant:b}),a),...f})}function Aa({className:a,...b}){return t(F.Trigger,{"data-slot":"tabs-trigger",className:V("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",a),...b})}function Oa({className:a,...b}){return t(F.Content,{"data-slot":"tabs-content",className:V("flex-1 outline-none",a),...b})}function Ka({delayDuration:a=0,...b}){return t(A.Provider,{"data-slot":"tooltip-provider",delayDuration:a,...b})}function Xa({...a}){return t(A.Root,{"data-slot":"tooltip",...a})}function Za({...a}){return t(A.Trigger,{"data-slot":"tooltip-trigger",...a})}function $a({className:a,sideOffset:b=0,children:f,...g}){return t(A.Portal,{children:R(A.Content,{"data-slot":"tooltip-content",sideOffset:b,className:V("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",a),...g,children:[f,t(A.Arrow,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}var Y={viewBox:"0 -960 960 960",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},qa=(a)=>t("svg",{...Y,...a,children:t("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm120-80v-560H200v560h120Zm80 0h360v-560H400v560Z"})}),va=(a)=>t("svg",{...Y,...a,children:t("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm360-80v-560H200v560h360Zm200 0v-560H640v560h120Z"})}),Sa=(a)=>t("svg",{...Y,...a,children:t("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm560-80v-560H400v560h360Z"})}),Qa=(a)=>t("svg",{...Y,...a,children:t("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm360-80v-560H200v560h360Z"})}),Ha=(a)=>R("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...a,children:[t("path",{d:"M12 8V4H8"}),t("path",{d:"M6 7H18A3 3 0 0 1 21 10V18A3 3 0 0 1 18 21H6A3 3 0 0 1 3 18V10A3 3 0 0 1 6 7ZM8 13V15A1 1 0 0 0 10 15V13A1 1 0 0 0 8 13ZM14 13V15A1 1 0 0 0 16 15V13A1 1 0 0 0 14 13Z",fill:"currentColor",stroke:"none"}),t("path",{d:"M2 14h2"}),t("path",{d:"M20 14h2"})]}),Pa=(a)=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:30,height:30,viewBox:"120 -792 720 720",fill:"none","aria-hidden":"true",focusable:"false",...a,children:t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M 160 -180 v -72 h 80 v -252 q 0 -74.7 50 -132.75 T 420 -712.8 v -25.2 q 0 -22.5 17.5 -38.25 T 480 -792 q 25 0 42.5 15.75 T 540 -738 v 25.2 q 80 18 130 76.05 T 720 -504 v 252 h 80 v 72 H 160 Z M 480 -72 q -33 0 -56.5 -21.15 T 400 -144 h 160 q 0 29.7 -23.5 50.85 T 480 -72 Z",fill:"currentColor"})}),Ua=(a)=>R("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",...a,children:[t("path",{d:"M10.77 10.377a1 1 0 0 0-.132.437l-.105 1.665a.5.5 0 0 0 .793.436l1.32-.96a1 1 0 0 0 .278-.309l3.912-6.775a1.25 1.25 0 1 0-2.165-1.25l-3.901 6.756Z",fill:"currentColor"}),t("path",{d:"M11.016 6.75a.758.758 0 0 1-.758.748c-2.938 0-4.882 1.71-5.517 3.95-.708 2.499.245 4.459 1.979 5.851 1.767 1.42 4.31 2.203 6.547 2.203.415 0 .749.335.745.748a.758.758 0 0 1-.758.748c-2.536 0-5.421-.873-7.485-2.531-2.098-1.686-3.38-4.225-2.475-7.414.818-2.883 3.354-5.051 6.977-5.051.415 0 .749.335.745.748Z",fill:"currentColor"}),t("path",{d:"M17.147 8.315a.767.767 0 0 1 1.058-.168c1.666 1.188 2.508 2.542 2.733 3.876a4.5 4.5 0 0 1-.805 3.392c-.919 1.434-2.714 2.074-4.479 2.185-1.799.113-3.78-.302-5.292-1.216a.733.733 0 0 1-.242-1.022.768.768 0 0 1 1.042-.246c1.216.734 2.881 1.096 4.409 1 1.553-.097 2.755-.647 3.292-1.5l.015-.022.015-.021a3.025 3.025 0 0 0 .553-2.294c-.148-.876-.72-1.915-2.137-2.926a.733.733 0 0 1-.162-1.038Z",fill:"currentColor"})]}),Da=(a)=>{return R("svg",{viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a,children:[t("defs",{children:t("clipPath",{id:"bg-clip",children:t("rect",{x:"5",y:"5",width:"90",height:"90",rx:"22"})})}),t("rect",{x:"5",y:"5",width:"90",height:"90",rx:"22",fill:"#D95A66"}),t("path",{d:"M 35 75 L 65 75 L 80 60 L 75 30 L 175 130 L 135 175 Z",fill:"#A8384D",clipPath:"url(#bg-clip)"}),t("path",{d:"M 25 30 Q 38 36 50 42 L 35 55 L 35 75 L 20 60 Z",fill:"#FDF0D5"}),t("path",{d:"M 50 42 Q 62 36 75 30 L 80 60 L 65 75 L 65 55 Z",fill:"#E77A65"}),t("path",{d:"M 35 75 L 65 75 L 65 55 L 50 42 L 35 55 Z",fill:"#F5B895"}),t("path",{d:"M 50 42 Q 38 36 25 30 Q 38 26 50 20 Q 62 26 75 30 Q 62 36 50 42 Z",fill:"#F4B8B8"}),t("path",{d:"M 50 25 L 42 30 L 50 35 Z",fill:"#E57A5F"}),t("path",{d:"M 50 25 L 58 30 L 50 35 Z",fill:"#C2523C"})]})},Ma=(a)=>t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"24 24 152 152",fill:"none","aria-hidden":"true",focusable:"false",...a,children:t("path",{d:"M 44 170 L 44 100 L 24 100 L 100 30 L 126 54 L 126 36 L 142 36 L 142 69 L 176 100 L 156 100 L 156 170 L 120 170 L 120 136 A 20 20 0 0 0 80 136 L 80 170 Z",fill:"currentColor"})});function Wa({uploading:a=!1,className:b="",...f}){return R("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"15 15 70 70",width:30,height:30,className:`${b} ${a?"animate-upload-breathing":""}`,"aria-hidden":"true",focusable:"false",style:a?{transformOrigin:"center"}:void 0,...f,children:[a&&t("defs",{children:R("linearGradient",{id:"upload-gradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[t("stop",{offset:"0%",stopColor:"#3b82f6",children:t("animate",{attributeName:"stop-color",values:"#3b82f6;#ec4899;#8b5cf6;#3b82f6",dur:"3s",repeatCount:"indefinite"})}),t("stop",{offset:"50%",stopColor:"#8b5cf6",children:t("animate",{attributeName:"stop-color",values:"#8b5cf6;#3b82f6;#ec4899;#8b5cf6",dur:"3s",repeatCount:"indefinite"})}),t("stop",{offset:"100%",stopColor:"#ec4899",children:t("animate",{attributeName:"stop-color",values:"#ec4899;#8b5cf6;#3b82f6;#ec4899",dur:"3s",repeatCount:"indefinite"})})]})}),t("path",{d:"M 44.1 75 H 30 A 15 15 0 0 1 30 45 A 20 20 0 0 1 70 45 A 15 15 0 0 1 70 75 H 55.9 V 60.2 H 61.9 L 50 45.3 L 38.1 60.2 H 44.1 Z",fill:a?"url(#upload-gradient)":"currentColor"})]})}
2
- export{_ as Ie,i as Je,r as Ke,e as Le,aa as Me,ta as Ne,ba as Oe,fa as Pe,ga as Qe,da as Re,za as Se,Ca as Te,wa as Ue,Ka as Ve,Xa as We,Za as Xe,$a as Ye,Na as Ze,Va as _e,Aa as $e,Oa as af,qa as bf,va as cf,Sa as df,Qa as ef,Ha as ff,Pa as gf,Ua as hf,Da as if,Ma as jf,Wa as kf};
1
+ import{Dj as F,Ej as A,Fj as V,Tg as t,Ug as R,qj as k}from"./chunk-wf4d1anc.js";import{Sk as l}from"./chunk-976v5s8y.js";function D(a,b){var f=a.length;a.push(b);a:for(;0<f;){var g=f-1>>>1,d=a[g];if(0<q(d,b))a[g]=b,a[f]=d,f=g;else break a}}function C(a){return a.length===0?null:a[0]}function H(a){if(a.length===0)return null;var b=a[0],f=a.pop();if(f!==b){a[0]=f;a:for(var g=0,d=a.length,Z=d>>>1;g<Z;){var $=2*(g+1)-1,P=a[$],N=$+1,G=a[N];if(0>q(P,f))N<d&&0>q(G,P)?(a[g]=G,a[N]=f,g=N):(a[g]=P,a[$]=f,g=$);else if(N<d&&0>q(G,f))a[g]=G,a[N]=f,g=N;else break a}}return b}function q(a,b){var f=a.sortIndex-b.sortIndex;return f!==0?f:a.id-b.id}function S(a){for(var b=C(o);b!==null;){if(b.callback===null)H(o);else if(b.startTime<=a)H(o),b.sortIndex=b.expirationTime,D(w,b);else break;b=C(o)}}function c(a){if(K=!1,S(a),!J)if(C(w)!==null)J=!0,E||(E=!0,B());else{var b=C(o);b!==null&&I(c,b.startTime-a)}}function m(){return n?!0:_()-L<p?!1:!0}function U(){if(n=!1,E){var a=_();L=a;var b=!0;try{a:{J=!1,K&&(K=!1,j(X),X=-1),T=!0;var f=O;try{t:{S(a);for(z=C(w);z!==null&&!(z.expirationTime>a&&m());){var g=z.callback;if(typeof g==="function"){z.callback=null,O=z.priorityLevel;var d=g(z.expirationTime<=a);if(a=_(),typeof d==="function"){z.callback=d,S(a),b=!0;break t}z===C(w)&&H(w),S(a)}else H(w);z=C(w)}if(z!==null)b=!0;else{var Z=C(o);Z!==null&&I(c,Z.startTime-a),b=!1}}break a}finally{z=null,O=f,T=!1}b=void 0}}finally{b?B():E=!1}}}function I(a,b){X=u(function(){a(_())},b)}var _=void 0,M,v,W,w,o,h=1,z=null,O=3,T=!1,J=!1,K=!1,n=!1,u,j,s,E=!1,X=-1,p=5,L=-1,B,Q,y,i=5,r=1,e=4,aa=3,ta=2,ba=function(a){a.callback=null},fa=function(){return O},ga=function(){n=!0},da=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var f=O;O=a;try{return b()}finally{O=f}},za=function(a,b,f){var g=_();switch(typeof f==="object"&&f!==null?(f=f.delay,f=typeof f==="number"&&0<f?g+f:g):f=g,a){case 1:var d=-1;break;case 2:d=250;break;case 5:d=1073741823;break;case 4:d=1e4;break;default:d=5000}return d=f+d,a={id:h++,callback:b,priorityLevel:a,startTime:f,expirationTime:d,sortIndex:-1},f>g?(a.sortIndex=f,D(o,a),C(w)===null&&a===C(o)&&(K?(j(X),X=-1):K=!0,I(c,f-g))):(a.sortIndex=d,D(w,a),J||T||(J=!0,E||(E=!0,B()))),a},Ca;var wa=l(()=>{if(typeof performance==="object"&&typeof performance.now==="function")M=performance,_=function(){return M.now()};else v=Date,W=v.now(),_=function(){return v.now()-W};w=[],o=[],u=typeof setTimeout==="function"?setTimeout:null,j=typeof clearTimeout==="function"?clearTimeout:null,s=typeof setImmediate<"u"?setImmediate:null;if(typeof s==="function")B=function(){s(U)};else if(typeof MessageChannel<"u")Q=new MessageChannel,y=Q.port2,Q.port1.onmessage=U,B=function(){y.postMessage(null)};else B=function(){u(U,0)};Ca=m});function Na({className:a,orientation:b="horizontal",...f}){return t(F.Root,{"data-slot":"tabs","data-orientation":b,orientation:b,className:V("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",a),...f})}var x=k("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function Va({className:a,variant:b="default",...f}){return t(F.List,{"data-slot":"tabs-list","data-variant":b,className:V(x({variant:b}),a),...f})}function Aa({className:a,...b}){return t(F.Trigger,{"data-slot":"tabs-trigger",className:V("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",a),...b})}function Oa({className:a,...b}){return t(F.Content,{"data-slot":"tabs-content",className:V("flex-1 outline-none",a),...b})}function Ka({delayDuration:a=0,...b}){return t(A.Provider,{"data-slot":"tooltip-provider",delayDuration:a,...b})}function Xa({...a}){return t(A.Root,{"data-slot":"tooltip",...a})}function Za({...a}){return t(A.Trigger,{"data-slot":"tooltip-trigger",...a})}function $a({className:a,sideOffset:b=0,children:f,...g}){return t(A.Portal,{children:R(A.Content,{"data-slot":"tooltip-content",sideOffset:b,className:V("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",a),...g,children:[f,t(A.Arrow,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}var Y={viewBox:"0 -960 960 960",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},qa=(a)=>t("svg",{...Y,...a,children:t("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm120-80v-560H200v560h120Zm80 0h360v-560H400v560Z"})}),va=(a)=>t("svg",{...Y,...a,children:t("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm360-80v-560H200v560h360Zm200 0v-560H640v560h120Z"})}),Sa=(a)=>t("svg",{...Y,...a,children:t("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm560-80v-560H400v560h360Z"})}),Qa=(a)=>t("svg",{...Y,...a,children:t("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm360-80v-560H200v560h360Z"})}),Ha=(a)=>R("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...a,children:[t("path",{d:"M12 8V4H8"}),t("path",{d:"M6 7H18A3 3 0 0 1 21 10V18A3 3 0 0 1 18 21H6A3 3 0 0 1 3 18V10A3 3 0 0 1 6 7ZM8 13V15A1 1 0 0 0 10 15V13A1 1 0 0 0 8 13ZM14 13V15A1 1 0 0 0 16 15V13A1 1 0 0 0 14 13Z",fill:"currentColor",stroke:"none"}),t("path",{d:"M2 14h2"}),t("path",{d:"M20 14h2"})]}),Pa=(a)=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:30,height:30,viewBox:"120 -792 720 720",fill:"none","aria-hidden":"true",focusable:"false",...a,children:t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M 160 -180 v -72 h 80 v -252 q 0 -74.7 50 -132.75 T 420 -712.8 v -25.2 q 0 -22.5 17.5 -38.25 T 480 -792 q 25 0 42.5 15.75 T 540 -738 v 25.2 q 80 18 130 76.05 T 720 -504 v 252 h 80 v 72 H 160 Z M 480 -72 q -33 0 -56.5 -21.15 T 400 -144 h 160 q 0 29.7 -23.5 50.85 T 480 -72 Z",fill:"currentColor"})}),Ua=(a)=>R("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",...a,children:[t("path",{d:"M10.77 10.377a1 1 0 0 0-.132.437l-.105 1.665a.5.5 0 0 0 .793.436l1.32-.96a1 1 0 0 0 .278-.309l3.912-6.775a1.25 1.25 0 1 0-2.165-1.25l-3.901 6.756Z",fill:"currentColor"}),t("path",{d:"M11.016 6.75a.758.758 0 0 1-.758.748c-2.938 0-4.882 1.71-5.517 3.95-.708 2.499.245 4.459 1.979 5.851 1.767 1.42 4.31 2.203 6.547 2.203.415 0 .749.335.745.748a.758.758 0 0 1-.758.748c-2.536 0-5.421-.873-7.485-2.531-2.098-1.686-3.38-4.225-2.475-7.414.818-2.883 3.354-5.051 6.977-5.051.415 0 .749.335.745.748Z",fill:"currentColor"}),t("path",{d:"M17.147 8.315a.767.767 0 0 1 1.058-.168c1.666 1.188 2.508 2.542 2.733 3.876a4.5 4.5 0 0 1-.805 3.392c-.919 1.434-2.714 2.074-4.479 2.185-1.799.113-3.78-.302-5.292-1.216a.733.733 0 0 1-.242-1.022.768.768 0 0 1 1.042-.246c1.216.734 2.881 1.096 4.409 1 1.553-.097 2.755-.647 3.292-1.5l.015-.022.015-.021a3.025 3.025 0 0 0 .553-2.294c-.148-.876-.72-1.915-2.137-2.926a.733.733 0 0 1-.162-1.038Z",fill:"currentColor"})]}),Da=(a)=>{return R("svg",{viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a,children:[t("defs",{children:t("clipPath",{id:"bg-clip",children:t("rect",{x:"5",y:"5",width:"90",height:"90",rx:"22"})})}),t("rect",{x:"5",y:"5",width:"90",height:"90",rx:"22",fill:"#D95A66"}),t("path",{d:"M 35 75 L 65 75 L 80 60 L 75 30 L 175 130 L 135 175 Z",fill:"#A8384D",clipPath:"url(#bg-clip)"}),t("path",{d:"M 25 30 Q 38 36 50 42 L 35 55 L 35 75 L 20 60 Z",fill:"#FDF0D5"}),t("path",{d:"M 50 42 Q 62 36 75 30 L 80 60 L 65 75 L 65 55 Z",fill:"#E77A65"}),t("path",{d:"M 35 75 L 65 75 L 65 55 L 50 42 L 35 55 Z",fill:"#F5B895"}),t("path",{d:"M 50 42 Q 38 36 25 30 Q 38 26 50 20 Q 62 26 75 30 Q 62 36 50 42 Z",fill:"#F4B8B8"}),t("path",{d:"M 50 25 L 42 30 L 50 35 Z",fill:"#E57A5F"}),t("path",{d:"M 50 25 L 58 30 L 50 35 Z",fill:"#C2523C"})]})},Ma=(a)=>t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"24 24 152 152",fill:"none","aria-hidden":"true",focusable:"false",...a,children:t("path",{d:"M 44 170 L 44 100 L 24 100 L 100 30 L 126 54 L 126 36 L 142 36 L 142 69 L 176 100 L 156 100 L 156 170 L 120 170 L 120 136 A 20 20 0 0 0 80 136 L 80 170 Z",fill:"currentColor"})});function Wa({uploading:a=!1,className:b="",...f}){return R("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"15 15 70 70",width:30,height:30,className:`${b} ${a?"animate-upload-breathing":""}`,"aria-hidden":"true",focusable:"false",style:a?{transformOrigin:"center"}:void 0,...f,children:[a&&t("defs",{children:R("linearGradient",{id:"upload-gradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[t("stop",{offset:"0%",stopColor:"#3b82f6",children:t("animate",{attributeName:"stop-color",values:"#3b82f6;#ec4899;#8b5cf6;#3b82f6",dur:"3s",repeatCount:"indefinite"})}),t("stop",{offset:"50%",stopColor:"#8b5cf6",children:t("animate",{attributeName:"stop-color",values:"#8b5cf6;#3b82f6;#ec4899;#8b5cf6",dur:"3s",repeatCount:"indefinite"})}),t("stop",{offset:"100%",stopColor:"#ec4899",children:t("animate",{attributeName:"stop-color",values:"#ec4899;#8b5cf6;#3b82f6;#ec4899",dur:"3s",repeatCount:"indefinite"})})]})}),t("path",{d:"M 44.1 75 H 30 A 15 15 0 0 1 30 45 A 20 20 0 0 1 70 45 A 15 15 0 0 1 70 75 H 55.9 V 60.2 H 61.9 L 50 45.3 L 38.1 60.2 H 44.1 Z",fill:a?"url(#upload-gradient)":"currentColor"})]})}
2
+ export{_ as Bf,i as Cf,r as Df,e as Ef,aa as Ff,ta as Gf,ba as Hf,fa as If,ga as Jf,da as Kf,za as Lf,Ca as Mf,wa as Nf,Ka as Of,Xa as Pf,Za as Qf,$a as Rf,Na as Sf,Va as Tf,Aa as Uf,Oa as Vf,qa as Wf,va as Xf,Sa as Yf,Qa as Zf,Ha as _f,Pa as $f,Ua as ag,Da as bg,Ma as cg,Wa as dg};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  function f(b){if(b===void 0)return;let d=Array.from(b);if(d.length<=64)return b;return d.slice(0,64).join("")}
3
- export{f as Aj};
3
+ export{f as Yb};
@@ -0,0 +1 @@
1
+ import{g as q}from"./chunk-50ebjdkv.js";import"./chunk-5j7axztv.js";import"./chunk-9bpjfkjf.js";import"./chunk-75jka5v9.js";import"./chunk-4fnak2zn.js";import"./chunk-6h4ay2p8.js";import"./chunk-mk1jewvw.js";import"./chunk-v98yavtp.js";import"./chunk-azfgjqjx.js";import"./chunk-m3dwydr3.js";import"./chunk-mjncyjwf.js";import"./chunk-sy8rqacm.js";import"./chunk-25d1g086.js";import"./chunk-t1mxqskx.js";import"./chunk-qjjr3fff.js";import"./chunk-46c5xkmn.js";import"./chunk-99db4j0k.js";import"./chunk-7ktvhtp1.js";import"./chunk-mg6fce5x.js";import"./chunk-2xnys7v4.js";import"./chunk-cpr05qng.js";import"./chunk-dwf5e5g3.js";import{Tg as f,ih as k}from"./chunk-wf4d1anc.js";import"./chunk-976v5s8y.js";function w(){let{shareId:v}=A.useParams();return f(q,{shareId:v})}var A=k("/share/$shareId/")({component:w});export{A as Route};
@@ -1 +1 @@
1
- import{b as RB,c as bB}from"./chunk-hb5v9ees.js";import{g as gB}from"./chunk-2s5a64nr.js";import{k as LB,n as MB}from"./chunk-dgx2zxze.js";import{I as NB}from"./chunk-axx5bh38.js";import"./chunk-q4f5vvtx.js";import{Wa as DB}from"./chunk-kpy0kpna.js";import"./chunk-ajqsprm0.js";import"./chunk-xpqcvxej.js";import"./chunk-4hnrd4qh.js";import"./chunk-cp18trqb.js";import{mf as VB,nf as wB}from"./chunk-8wv3kdz9.js";import"./chunk-j8q688sx.js";import"./chunk-5a2maxwp.js";import"./chunk-4kk5g619.js";import{Vf as kB}from"./chunk-5tmf3c0g.js";import{Wf as $B,Xf as EB}from"./chunk-mnv6pj0k.js";import{$f as XB,Eg as q,Ng as p,Pi as UB,Zf as d,_g as ZB,ag as zB,bg as G,cg as D,dg as HB,fg as j,hg as QB,hj as yB,ij as PB,ng as qB,pg as YB,sg as TB,wh as _B}from"./chunk-nwtb6dt1.js";import{Zj as KB}from"./chunk-kbzm1pwx.js";var $=KB(XB(),1);var tB=({item:J})=>{if(J.preview?.thumbnailUrl)return G("img",{src:J.preview.thumbnailUrl,alt:"Preview",className:"w-full h-full object-cover"});if(J.preview?.proxyType==="audio"||J.proxyType==="audio")return G("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:G(ZB,{className:"w-5 h-5 text-muted-foreground"})});return G("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:G(_B,{className:"w-5 h-5 text-muted-foreground"})})},OB=({projectId:J,currentAssetId:X,parentFolderId:Q,initialFiles:_,initialNextCursor:w})=>{let{ref:z,inView:k}=$B({threshold:0,rootMargin:"200px"}),T=$.useRef(null),N=$.useRef(!1),[O,y]=$.useState(_),[Z,R]=$.useState(w),[b,S]=$.useState(!!w),[L,P]=$.useState(!1);return $.useEffect(()=>{y(_),R(w),S(!!w),N.current=!1},[_,w]),$.useEffect(()=>{(async()=>{if(!Z||L||!k||!b)return;P(!0);try{let W=await q.api.folders[":folderId"].search.$post({param:{folderId:Q},json:{assetType:"file",after:Z,first:200,recursively:!1,conditions:[]}});if(!W.ok)throw Error("Failed to fetch next page");let g=await W.json(),M=g.data||[];y((f)=>[...f,...M]),R(g.pageInfo?.cursor||void 0),S(!!g.pageInfo?.cursor&&M.length>0)}catch(W){console.error("Error fetching next page:",W)}finally{P(!1)}})()},[k,Z,b,L,Q]),$.useEffect(()=>{N.current=!1},[X]),$.useEffect(()=>{if(O.some((W)=>W?.id===X)&&T.current&&!N.current)T.current.scrollIntoView({block:"center",inline:"center",behavior:"smooth"}),N.current=!0},[O,X]),G("div",{className:"h-24 md:h-full w-full md:w-24 bg-gray-100 dark:bg-gray-950 flex flex-row md:flex-col flex-shrink-0 select-none",children:D("div",{className:"flex-1 overflow-x-auto overflow-y-hidden md:overflow-y-auto md:overflow-x-hidden px-4 md:px-0 py-2 md:py-4 flex flex-row md:flex-col items-center gap-3 no-scrollbar",children:[O.map((H)=>{if(!H)return null;let W=H.id===X;return G("div",{ref:H.id===X?T:null,className:"flex-shrink-0",children:G(YB,{to:"/projects/$projectId/files/$fileId",params:{projectId:J,fileId:H.id},search:{version:void 0},className:UB("rounded-lg border overflow-hidden flex items-center justify-center transition-all bg-muted/30 block",W?"w-[62px] h-[62px] opacity-100":"w-[52px] h-[52px] opacity-60 hover:opacity-100"),children:G(tB,{item:H})})},H.id)}),b&&G("div",{ref:z,className:"px-2 md:px-0 py-2 md:py-4 flex justify-center items-center h-full md:w-full flex-shrink-0",children:L&&G(p,{className:"h-5 w-5 animate-spin text-muted-foreground"})})]})})};var Y=KB(XB(),1);function eB(){let{projectId:J,fileId:X}=WB.useParams(),Q=WB.useSearch(),_=Q.version,w=Q.start,z=_||X,k=Q.cmpLeft,T=Q.cmpRight,N=Q.cmpActive??"left",O=!!Q.compare&&!!k&&!!T,y=Y.useRef(null),{teamId:Z,ensureTeamIdForProject:R}=PB(),[b,S]=Y.useState(360),[L,P]=Y.useState([]),{fileViewRightSidebarCollapsed:H}=EB(),{isChatbotOpen:W}=wB(),[g,M]=Y.useState(0),[f,C]=Y.useState(null),[l,AB]=Y.useState(null),[xB,jB]=Y.useState(void 0),[A,I]=Y.useState({show:!1,files:[],nextCursor:void 0,folderId:void 0}),SB=q.api.files[":fileId"].metadata.$patch,{mutate:CB}=QB({mutationFn:async(B)=>{let K=await SB(B);if(!K.ok)throw Error("Failed to patch metadata");return await K.json()}}),hB=HB(),{members:FB,fetchMembers:n}=NB();Y.useEffect(()=>{R(J)},[J,R]),Y.useEffect(()=>{if(Z)n(Z,!0)},[Z,n]);let{data:o,isLoading:vB,isError:pB,isFetching:fB}=j({queryKey:["files",X],queryFn:async()=>{let B=await q.api.files[":fileId"].$get({param:{fileId:X}});if(!B.ok)throw Error("Failed to fetch stack");return await B.json()},enabled:!!Z,placeholderData:d}),{data:IB,isLoading:mB,isError:uB,isFetching:cB}=j({queryKey:["files",_],queryFn:async()=>{let B=await q.api.files[":fileId"].$get({param:{fileId:_}});if(!B.ok)throw Error("Failed to fetch version");return await B.json()},enabled:!!Z&&!!_,placeholderData:d}),{data:dB}=j({queryKey:["version_stacks",X,"versions"],queryFn:async()=>{let B=await q.api.version_stacks[":stackId"].versions.$get({param:{stackId:X}});if(!B.ok)throw Error("Failed to fetch versions");return await B.json()},enabled:!!J&&!!X&&(!!_||O)}),{data:x}=j({queryKey:["projects",J],queryFn:async()=>{let B=await q.api.projects[":projectId"].$get({param:{projectId:J}});if(!B.ok)throw Error("Failed to fetch project");return await B.json()}}),h=qB(),{setProjectState:a,clearProjectState:r}=VB(),lB=vB||!!_&&mB,nB=pB||!!_&&uB,oB=fB||!!_&&cB,U=IB||o,V=_?dB:o?.versionStack?.versions;Y.useEffect(()=>{if(U&&x&&Z)a({teamId:Z,projectId:J,projectName:x.name??"",ancestorFolders:U.ancestorFolders??[],currentAsset:{name:U.name,type:"file",version:V?V.find((B)=>B.id===z)?.version??V.length:void 0,proxyType:U.proxyType},isRootFolder:!1,fileId:X,downloadInfo:{originalKey:U.media?.original?.key,videoTranscodes:U.media?.videoTranscodes?.map((B)=>({key:B.key,width:B.width,height:B.height,isRaw:B.isRaw}))},versions:V,compareMode:O,canCompareVersions:(V?.length??0)>=2,onCompareVersions:()=>{let B=LB(V);if(!B)return;h({to:"/projects/$projectId/files/$fileId",params:{projectId:J,fileId:X},search:(K)=>({...K,version:void 0,compare:!0,cmpLeft:B.left.id,cmpRight:B.right.id,cmpActive:"left"})})},onFolderClick:(B)=>{h({to:"/projects/$projectId/folders/$folderId",params:{projectId:J,folderId:B}})}});return()=>r()},[Z,J,x,U,V,z,X,O,a,r,h]);let E=U?.ancestorFolders?.[0]?.id??x?.rootFolder??"";if(Y.useEffect(()=>{if(!E||!z)return;if(A.folderId===E)return;let B=!0;return(async()=>{try{let F="",t=!1,e=[],BB=void 0;for(let GB=0;GB<5;GB++){let JB=await q.api.folders[":folderId"].search.$post({param:{folderId:E},json:{assetType:"file",after:F,first:200,recursively:!1,conditions:[]}});if(!JB.ok)throw Error("Failed to search parent folder for carousel");let v=await JB.json(),c=v.data||[];if(e.push(...c),c.some((sB)=>sB.id===z)){t=!0,BB=v.pageInfo?.cursor||void 0;break}if(!v.pageInfo?.cursor||c.length<200)break;F=v.pageInfo.cursor}if(B)if(t)I({show:!0,files:e,nextCursor:BB,folderId:E});else I({show:!1,files:[],nextCursor:void 0,folderId:E})}catch(F){if(console.error(F),B)I({show:!1,files:[],nextCursor:void 0,folderId:E})}})(),()=>{B=!1}},[E,z,A.folderId]),Y.useEffect(()=>{M(0),C(null),P([])},[U?.id]),Y.useEffect(()=>{C(null),P([])},[l?.id]),lB&&!U)return G(kB,{});if(nB||!U||!x||!Z)return G("div",{children:yB.file_not_found()});let m=O?l:U,i=m?.id??z,aB=(B,K)=>{if(!Z)return;CB({param:{fileId:i},json:[{key:B,value:K}]},{onSuccess:()=>{hB.invalidateQueries({queryKey:["files",i]})}})},u=(B)=>{h({to:"/projects/$projectId/files/$fileId",params:{projectId:J,fileId:X},search:(K)=>({...K,...B})})},rB=()=>{u({compare:void 0,cmpLeft:void 0,cmpRight:void 0,cmpActive:void 0,version:N==="left"?k:T})},iB=(B)=>{C(B.id||null);let K=B.annotations;if(K&&K.length>0)P(K);else P([]);if(O){if(B.second!==null&&B.second!==void 0)jB({second:B.second,nonce:Date.now()});return}if(B.second!==null&&B.second!==void 0)y.current?.seekTo(B.second),y.current?.pause();else if(K&&K.length>0)y.current?.pause()},s=()=>{P([]),C(null)};return G("div",{className:"h-full flex flex-1 flex-col bg-background",children:D("div",{className:"h-full flex flex-1 overflow-hidden",children:[D("div",{className:"flex-1 relative",children:[oB&&!O&&G("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/50",children:G(p,{className:"h-8 w-8 animate-spin text-foreground"})}),O&&k&&T?G(bB,{versions:V??[],leftId:k,rightId:T,activeSide:N,annotations:L,seekRequest:xB,onActiveSideChange:(B)=>u({cmpActive:B}),onSwitchVersion:(B,K)=>u(B==="left"?{cmpLeft:K}:{cmpRight:K}),onExit:rB,onActiveAssetChange:AB,onPlay:s,onTimeUpdate:M}):G(RB,{file:U,mediaControllerRef:y,onPlay:s,onTimeUpdate:M,annotations:L,startTime:w,children:A.show&&G(OB,{projectId:J,currentAssetId:z,parentFolderId:E,initialFiles:A.files,initialNextCursor:A.nextCursor})})]}),(!H||W)&&D(zB,{children:[G(DB,{onResize:(B)=>{S((K)=>Math.max(300,Math.min(600,K-B)))},className:"hidden md:block"}),G("div",{style:{width:b},className:"flex-shrink-0 bg-background flex flex-col",children:W?G(gB,{projectId:J,contextAssetId:z}):G(MB,{teamId:Z,projectId:J,file:m,onSaveField:aB,members:FB,onCommentSelect:iB,currentTime:g,onTyping:()=>{if(O)return;y.current?.pause()},selectedCommentId:f,hideAnnotationControl:m?.proxyType==="audio"})})]})]})})}var WB=TB("/projects/$projectId/files/$fileId")({component:eB});export{WB as Route};
1
+ import{h as RB,i as bB}from"./chunk-5j7axztv.js";import{k as gB}from"./chunk-ttsqdsxr.js";import{p as LB,s as MB}from"./chunk-9bpjfkjf.js";import{O as NB}from"./chunk-4fnak2zn.js";import"./chunk-6h4ay2p8.js";import{Va as DB}from"./chunk-v98yavtp.js";import"./chunk-azfgjqjx.js";import"./chunk-mjncyjwf.js";import"./chunk-sy8rqacm.js";import{Af as kB}from"./chunk-zn9jbc6t.js";import"./chunk-qjjr3fff.js";import{hg as VB,ig as wB}from"./chunk-99db4j0k.js";import"./chunk-mg6fce5x.js";import{og as $B,pg as EB}from"./chunk-2xnys7v4.js";import"./chunk-cpr05qng.js";import"./chunk-dwf5e5g3.js";import{Dh as p,Fj as UB,Pg as d,Qh as ZB,Rg as XB,Sg as zB,Tg as G,Ug as D,Vg as HB,Xg as j,Zg as QB,Zj as yB,_j as PB,dh as qB,fh as YB,ih as TB,mi as _B,uh as q}from"./chunk-wf4d1anc.js";import{Pk as KB}from"./chunk-976v5s8y.js";var $=KB(XB(),1);var tB=({item:J})=>{if(J.preview?.thumbnailUrl)return G("img",{src:J.preview.thumbnailUrl,alt:"Preview",className:"w-full h-full object-cover"});if(J.preview?.proxyType==="audio"||J.proxyType==="audio")return G("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:G(ZB,{className:"w-5 h-5 text-muted-foreground"})});return G("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:G(_B,{className:"w-5 h-5 text-muted-foreground"})})},OB=({projectId:J,currentAssetId:X,parentFolderId:Q,initialFiles:_,initialNextCursor:w})=>{let{ref:z,inView:k}=$B({threshold:0,rootMargin:"200px"}),T=$.useRef(null),N=$.useRef(!1),[O,y]=$.useState(_),[Z,R]=$.useState(w),[b,S]=$.useState(!!w),[L,P]=$.useState(!1);return $.useEffect(()=>{y(_),R(w),S(!!w),N.current=!1},[_,w]),$.useEffect(()=>{(async()=>{if(!Z||L||!k||!b)return;P(!0);try{let W=await q.api.folders[":folderId"].search.$post({param:{folderId:Q},json:{assetType:"file",after:Z,first:200,recursively:!1,conditions:[]}});if(!W.ok)throw Error("Failed to fetch next page");let g=await W.json(),M=g.data||[];y((f)=>[...f,...M]),R(g.pageInfo?.cursor||void 0),S(!!g.pageInfo?.cursor&&M.length>0)}catch(W){console.error("Error fetching next page:",W)}finally{P(!1)}})()},[k,Z,b,L,Q]),$.useEffect(()=>{N.current=!1},[X]),$.useEffect(()=>{if(O.some((W)=>W?.id===X)&&T.current&&!N.current)T.current.scrollIntoView({block:"center",inline:"center",behavior:"smooth"}),N.current=!0},[O,X]),G("div",{className:"h-24 md:h-full w-full md:w-24 bg-gray-100 dark:bg-gray-950 flex flex-row md:flex-col flex-shrink-0 select-none",children:D("div",{className:"flex-1 overflow-x-auto overflow-y-hidden md:overflow-y-auto md:overflow-x-hidden px-4 md:px-0 py-2 md:py-4 flex flex-row md:flex-col items-center gap-3 no-scrollbar",children:[O.map((H)=>{if(!H)return null;let W=H.id===X;return G("div",{ref:H.id===X?T:null,className:"flex-shrink-0",children:G(YB,{to:"/projects/$projectId/files/$fileId",params:{projectId:J,fileId:H.id},search:{version:void 0},className:UB("rounded-lg border overflow-hidden flex items-center justify-center transition-all bg-muted/30 block",W?"w-[62px] h-[62px] opacity-100":"w-[52px] h-[52px] opacity-60 hover:opacity-100"),children:G(tB,{item:H})})},H.id)}),b&&G("div",{ref:z,className:"px-2 md:px-0 py-2 md:py-4 flex justify-center items-center h-full md:w-full flex-shrink-0",children:L&&G(p,{className:"h-5 w-5 animate-spin text-muted-foreground"})})]})})};var Y=KB(XB(),1);function eB(){let{projectId:J,fileId:X}=WB.useParams(),Q=WB.useSearch(),_=Q.version,w=Q.start,z=_||X,k=Q.cmpLeft,T=Q.cmpRight,N=Q.cmpActive??"left",O=!!Q.compare&&!!k&&!!T,y=Y.useRef(null),{teamId:Z,ensureTeamIdForProject:R}=PB(),[b,S]=Y.useState(360),[L,P]=Y.useState([]),{fileViewRightSidebarCollapsed:H}=EB(),{isChatbotOpen:W}=wB(),[g,M]=Y.useState(0),[f,C]=Y.useState(null),[l,AB]=Y.useState(null),[xB,jB]=Y.useState(void 0),[A,I]=Y.useState({show:!1,files:[],nextCursor:void 0,folderId:void 0}),SB=q.api.files[":fileId"].metadata.$patch,{mutate:CB}=QB({mutationFn:async(B)=>{let K=await SB(B);if(!K.ok)throw Error("Failed to patch metadata");return await K.json()}}),hB=HB(),{members:FB,fetchMembers:n}=NB();Y.useEffect(()=>{R(J)},[J,R]),Y.useEffect(()=>{if(Z)n(Z,!0)},[Z,n]);let{data:o,isLoading:vB,isError:pB,isFetching:fB}=j({queryKey:["files",X],queryFn:async()=>{let B=await q.api.files[":fileId"].$get({param:{fileId:X}});if(!B.ok)throw Error("Failed to fetch stack");return await B.json()},enabled:!!Z,placeholderData:d}),{data:IB,isLoading:mB,isError:uB,isFetching:cB}=j({queryKey:["files",_],queryFn:async()=>{let B=await q.api.files[":fileId"].$get({param:{fileId:_}});if(!B.ok)throw Error("Failed to fetch version");return await B.json()},enabled:!!Z&&!!_,placeholderData:d}),{data:dB}=j({queryKey:["version_stacks",X,"versions"],queryFn:async()=>{let B=await q.api.version_stacks[":stackId"].versions.$get({param:{stackId:X}});if(!B.ok)throw Error("Failed to fetch versions");return await B.json()},enabled:!!J&&!!X&&(!!_||O)}),{data:x}=j({queryKey:["projects",J],queryFn:async()=>{let B=await q.api.projects[":projectId"].$get({param:{projectId:J}});if(!B.ok)throw Error("Failed to fetch project");return await B.json()}}),h=qB(),{setProjectState:a,clearProjectState:r}=VB(),lB=vB||!!_&&mB,nB=pB||!!_&&uB,oB=fB||!!_&&cB,U=IB||o,V=_?dB:o?.versionStack?.versions;Y.useEffect(()=>{if(U&&x&&Z)a({teamId:Z,projectId:J,projectName:x.name??"",ancestorFolders:U.ancestorFolders??[],currentAsset:{name:U.name,type:"file",version:V?V.find((B)=>B.id===z)?.version??V.length:void 0,proxyType:U.proxyType},isRootFolder:!1,fileId:X,downloadInfo:{originalKey:U.media?.original?.key,videoTranscodes:U.media?.videoTranscodes?.map((B)=>({key:B.key,width:B.width,height:B.height,isRaw:B.isRaw}))},versions:V,compareMode:O,canCompareVersions:(V?.length??0)>=2,onCompareVersions:()=>{let B=LB(V);if(!B)return;h({to:"/projects/$projectId/files/$fileId",params:{projectId:J,fileId:X},search:(K)=>({...K,version:void 0,compare:!0,cmpLeft:B.left.id,cmpRight:B.right.id,cmpActive:"left"})})},onFolderClick:(B)=>{h({to:"/projects/$projectId/folders/$folderId",params:{projectId:J,folderId:B}})}});return()=>r()},[Z,J,x,U,V,z,X,O,a,r,h]);let E=U?.ancestorFolders?.[0]?.id??x?.rootFolder??"";if(Y.useEffect(()=>{if(!E||!z)return;if(A.folderId===E)return;let B=!0;return(async()=>{try{let F="",t=!1,e=[],BB=void 0;for(let GB=0;GB<5;GB++){let JB=await q.api.folders[":folderId"].search.$post({param:{folderId:E},json:{assetType:"file",after:F,first:200,recursively:!1,conditions:[]}});if(!JB.ok)throw Error("Failed to search parent folder for carousel");let v=await JB.json(),c=v.data||[];if(e.push(...c),c.some((sB)=>sB.id===z)){t=!0,BB=v.pageInfo?.cursor||void 0;break}if(!v.pageInfo?.cursor||c.length<200)break;F=v.pageInfo.cursor}if(B)if(t)I({show:!0,files:e,nextCursor:BB,folderId:E});else I({show:!1,files:[],nextCursor:void 0,folderId:E})}catch(F){if(console.error(F),B)I({show:!1,files:[],nextCursor:void 0,folderId:E})}})(),()=>{B=!1}},[E,z,A.folderId]),Y.useEffect(()=>{M(0),C(null),P([])},[U?.id]),Y.useEffect(()=>{C(null),P([])},[l?.id]),lB&&!U)return G(kB,{});if(nB||!U||!x||!Z)return G("div",{children:yB.file_not_found()});let m=O?l:U,i=m?.id??z,aB=(B,K)=>{if(!Z)return;CB({param:{fileId:i},json:[{key:B,value:K}]},{onSuccess:()=>{hB.invalidateQueries({queryKey:["files",i]})}})},u=(B)=>{h({to:"/projects/$projectId/files/$fileId",params:{projectId:J,fileId:X},search:(K)=>({...K,...B})})},rB=()=>{u({compare:void 0,cmpLeft:void 0,cmpRight:void 0,cmpActive:void 0,version:N==="left"?k:T})},iB=(B)=>{C(B.id||null);let K=B.annotations;if(K&&K.length>0)P(K);else P([]);if(O){if(B.second!==null&&B.second!==void 0)jB({second:B.second,nonce:Date.now()});return}if(B.second!==null&&B.second!==void 0)y.current?.seekTo(B.second),y.current?.pause();else if(K&&K.length>0)y.current?.pause()},s=()=>{P([]),C(null)};return G("div",{className:"h-full flex flex-1 flex-col bg-background",children:D("div",{className:"h-full flex flex-1 overflow-hidden",children:[D("div",{className:"flex-1 relative",children:[oB&&!O&&G("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/50",children:G(p,{className:"h-8 w-8 animate-spin text-foreground"})}),O&&k&&T?G(bB,{versions:V??[],leftId:k,rightId:T,activeSide:N,annotations:L,seekRequest:xB,onActiveSideChange:(B)=>u({cmpActive:B}),onSwitchVersion:(B,K)=>u(B==="left"?{cmpLeft:K}:{cmpRight:K}),onExit:rB,onActiveAssetChange:AB,onPlay:s,onTimeUpdate:M}):G(RB,{file:U,mediaControllerRef:y,onPlay:s,onTimeUpdate:M,annotations:L,startTime:w,children:A.show&&G(OB,{projectId:J,currentAssetId:z,parentFolderId:E,initialFiles:A.files,initialNextCursor:A.nextCursor})})]}),(!H||W)&&D(zB,{children:[G(DB,{onResize:(B)=>{S((K)=>Math.max(300,Math.min(600,K-B)))},className:"hidden md:block"}),G("div",{style:{width:b},className:"flex-shrink-0 bg-background flex flex-col",children:W?G(gB,{projectId:J,contextAssetId:z}):G(MB,{teamId:Z,projectId:J,file:m,onSaveField:aB,members:FB,onCommentSelect:iB,currentTime:g,onTyping:()=>{if(O)return;y.current?.pause()},selectedCommentId:f,hideAnnotationControl:m?.proxyType==="audio"})})]})]})})}var WB=TB("/projects/$projectId/files/$fileId")({component:eB});export{WB as Route};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Bj as b}from"./chunk-w4y97tzy.js";import{Gj as q}from"./chunk-n296vcfw.js";import{Yj as A}from"./chunk-eadb78m8.js";import"./chunk-kbzm1pwx.js";var j=async(f,E,v)=>{let B={api:f.api,provider:f.provider,model:f.id,output:[],stopReason:"stop",timestamp:Date.now()};try{let D=v?.apiKey;if(!D)throw Error(`No API key for provider: ${f.provider}`);let J=L(f,D,v?.headers),G=M(f,E),N=await v?.onPayload?.(G,f);if(N!==void 0)G=N;let F={...v?.signal?{signal:v.signal}:{},...v?.timeoutMs!==void 0?{timeout:v.timeoutMs}:{},maxRetries:v?.maxRetries??0},{data:I,response:_}=await J.chat.completions.create(G,F).withResponse();await v?.onResponse?.({status:_.status,headers:q(_.headers)},f);let Q=I;if(B.responseId=Q.id,Q.usage)B.usage=S(Q.usage,f);let V=Q.choices[0];if(V){let X=V.message.content;if(typeof X==="string"&&X.length>0)B.output.push({type:"text",text:X});for(let Y of V.message.images??[]){let $=typeof Y.image_url==="string"?Y.image_url:Y.image_url?.url;if(!$?.startsWith("data:"))continue;let Z=$.match(/^data:([^;]+);base64,(.+)$/);if(!Z)continue;B.output.push({type:"image",mimeType:Z[1],data:Z[2]})}}return B}catch(D){return B.stopReason=v?.signal?.aborted?"aborted":"error",B.errorMessage=D instanceof Error?D.message:JSON.stringify(D),B}};function L(f,E,v){return new b({apiKey:E,baseURL:f.baseUrl,dangerouslyAllowBrowser:!0,defaultHeaders:{...f.headers,...v}})}function M(f,E){let v=E.input.map((B)=>{if(B.type==="text")return{type:"text",text:A(B.text)};return{type:"image_url",image_url:{url:`data:${B.mimeType};base64,${B.data}`}}});return{model:f.id,messages:[{role:"user",content:v}],stream:!1,modalities:f.output.includes("text")?["image","text"]:["image"]}}function S(f,E){let v=f.prompt_tokens||0,B=f.prompt_tokens_details?.cached_tokens||0,D=f.prompt_tokens_details?.cache_write_tokens||0,J=D>0?Math.max(0,B-D):B,G=Math.max(0,v-J-D),N=f.completion_tokens||0,F={input:G,output:N,cacheRead:J,cacheWrite:D,totalTokens:G+N+J+D,cost:{input:E.cost.input/1e6*G,output:E.cost.output/1e6*N,cacheRead:E.cost.cacheRead/1e6*J,cacheWrite:E.cost.cacheWrite/1e6*D,total:0}};return F.cost.total=F.cost.input+F.cost.output+F.cost.cacheRead+F.cost.cacheWrite,F}export{j as generateImagesOpenRouter};
2
+ import{rk as b}from"./chunk-dzm2f82x.js";import{wk as q}from"./chunk-ga0drqj7.js";import{Ok as A}from"./chunk-pmx9760x.js";import"./chunk-976v5s8y.js";var j=async(f,E,v)=>{let B={api:f.api,provider:f.provider,model:f.id,output:[],stopReason:"stop",timestamp:Date.now()};try{let D=v?.apiKey;if(!D)throw Error(`No API key for provider: ${f.provider}`);let J=L(f,D,v?.headers),G=M(f,E),N=await v?.onPayload?.(G,f);if(N!==void 0)G=N;let F={...v?.signal?{signal:v.signal}:{},...v?.timeoutMs!==void 0?{timeout:v.timeoutMs}:{},maxRetries:v?.maxRetries??0},{data:I,response:_}=await J.chat.completions.create(G,F).withResponse();await v?.onResponse?.({status:_.status,headers:q(_.headers)},f);let Q=I;if(B.responseId=Q.id,Q.usage)B.usage=S(Q.usage,f);let V=Q.choices[0];if(V){let X=V.message.content;if(typeof X==="string"&&X.length>0)B.output.push({type:"text",text:X});for(let Y of V.message.images??[]){let $=typeof Y.image_url==="string"?Y.image_url:Y.image_url?.url;if(!$?.startsWith("data:"))continue;let Z=$.match(/^data:([^;]+);base64,(.+)$/);if(!Z)continue;B.output.push({type:"image",mimeType:Z[1],data:Z[2]})}}return B}catch(D){return B.stopReason=v?.signal?.aborted?"aborted":"error",B.errorMessage=D instanceof Error?D.message:JSON.stringify(D),B}};function L(f,E,v){return new b({apiKey:E,baseURL:f.baseUrl,dangerouslyAllowBrowser:!0,defaultHeaders:{...f.headers,...v}})}function M(f,E){let v=E.input.map((B)=>{if(B.type==="text")return{type:"text",text:A(B.text)};return{type:"image_url",image_url:{url:`data:${B.mimeType};base64,${B.data}`}}});return{model:f.id,messages:[{role:"user",content:v}],stream:!1,modalities:f.output.includes("text")?["image","text"]:["image"]}}function S(f,E){let v=f.prompt_tokens||0,B=f.prompt_tokens_details?.cached_tokens||0,D=f.prompt_tokens_details?.cache_write_tokens||0,J=D>0?Math.max(0,B-D):B,G=Math.max(0,v-J-D),N=f.completion_tokens||0,F={input:G,output:N,cacheRead:J,cacheWrite:D,totalTokens:G+N+J+D,cost:{input:E.cost.input/1e6*G,output:E.cost.output/1e6*N,cacheRead:E.cost.cacheRead/1e6*J,cacheWrite:E.cost.cacheWrite/1e6*D,total:0}};return F.cost.total=F.cost.input+F.cost.output+F.cost.cacheRead+F.cost.cacheWrite,F}export{j as generateImagesOpenRouter};
@@ -1,2 +1,2 @@
1
- import{Ci as o,Pi as l,Ri as n,bg as e,cg as d}from"./chunk-nwtb6dt1.js";function u({...t}){return e(o.Root,{"data-slot":"alert-dialog",...t})}function s({...t}){return e(o.Portal,{"data-slot":"alert-dialog-portal",...t})}function g({className:t,...a}){return e(o.Overlay,{"data-slot":"alert-dialog-overlay",className:l("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",t),...a})}function f({className:t,size:a="default",...i}){return d(s,{children:[e(g,{}),e(o.Content,{"data-slot":"alert-dialog-content","data-size":a,className:l("group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[size=default]:sm:max-w-lg",t),...i})]})}function P({className:t,...a}){return e("div",{"data-slot":"alert-dialog-header",className:l("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",t),...a})}function A({className:t,...a}){return e("div",{"data-slot":"alert-dialog-footer",className:l("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",t),...a})}function D({className:t,...a}){return e(o.Title,{"data-slot":"alert-dialog-title",className:l("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",t),...a})}function v({className:t,...a}){return e(o.Description,{"data-slot":"alert-dialog-description",className:l("text-sm text-muted-foreground",t),...a})}function z({className:t,variant:a="default",size:i="default",...r}){return e(n,{variant:a,size:i,asChild:!0,children:e(o.Action,{"data-slot":"alert-dialog-action",className:l(t),...r})})}function C({className:t,variant:a="outline",size:i="default",...r}){return e(n,{variant:a,size:i,asChild:!0,children:e(o.Cancel,{"data-slot":"alert-dialog-cancel",className:l(t),...r})})}
1
+ import{Fj as l,Hj as n,Tg as e,Ug as d,sj as o}from"./chunk-wf4d1anc.js";function u({...t}){return e(o.Root,{"data-slot":"alert-dialog",...t})}function s({...t}){return e(o.Portal,{"data-slot":"alert-dialog-portal",...t})}function g({className:t,...a}){return e(o.Overlay,{"data-slot":"alert-dialog-overlay",className:l("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",t),...a})}function f({className:t,size:a="default",...i}){return d(s,{children:[e(g,{}),e(o.Content,{"data-slot":"alert-dialog-content","data-size":a,className:l("group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[size=default]:sm:max-w-lg",t),...i})]})}function P({className:t,...a}){return e("div",{"data-slot":"alert-dialog-header",className:l("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",t),...a})}function A({className:t,...a}){return e("div",{"data-slot":"alert-dialog-footer",className:l("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",t),...a})}function D({className:t,...a}){return e(o.Title,{"data-slot":"alert-dialog-title",className:l("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",t),...a})}function v({className:t,...a}){return e(o.Description,{"data-slot":"alert-dialog-description",className:l("text-sm text-muted-foreground",t),...a})}function z({className:t,variant:a="default",size:i="default",...r}){return e(n,{variant:a,size:i,asChild:!0,children:e(o.Action,{"data-slot":"alert-dialog-action",className:l(t),...r})})}function C({className:t,variant:a="outline",size:i="default",...r}){return e(n,{variant:a,size:i,asChild:!0,children:e(o.Cancel,{"data-slot":"alert-dialog-cancel",className:l(t),...r})})}
2
2
  export{u as _a,f as $a,P as ab,A as bb,D as cb,v as db,z as eb,C as fb};
@@ -1,2 +1,2 @@
1
- import{Pi as r,bg as o}from"./chunk-nwtb6dt1.js";function d({className:t,...a}){return o("div",{"data-slot":"card",className:r("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",t),...a})}function n({className:t,...a}){return o("div",{"data-slot":"card-header",className:r("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...a})}function c({className:t,...a}){return o("div",{"data-slot":"card-title",className:r("leading-none font-semibold",t),...a})}function s({className:t,...a}){return o("div",{"data-slot":"card-description",className:r("text-sm text-muted-foreground",t),...a})}function i({className:t,...a}){return o("div",{"data-slot":"card-content",className:r("px-6",t),...a})}function l({className:t,...a}){return o("div",{"data-slot":"card-footer",className:r("flex items-center px-6 [.border-t]:pt-6",t),...a})}
2
- export{d as ye,n as ze,c as Ae,s as Be,i as Ce,l as De};
1
+ import{Fj as r,Tg as o}from"./chunk-wf4d1anc.js";function d({className:t,...a}){return o("div",{"data-slot":"card",className:r("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",t),...a})}function n({className:t,...a}){return o("div",{"data-slot":"card-header",className:r("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...a})}function c({className:t,...a}){return o("div",{"data-slot":"card-title",className:r("leading-none font-semibold",t),...a})}function s({className:t,...a}){return o("div",{"data-slot":"card-description",className:r("text-sm text-muted-foreground",t),...a})}function i({className:t,...a}){return o("div",{"data-slot":"card-content",className:r("px-6",t),...a})}function l({className:t,...a}){return o("div",{"data-slot":"card-footer",className:r("flex items-center px-6 [.border-t]:pt-6",t),...a})}
2
+ export{d as qf,n as rf,c as sf,s as tf,i as uf,l as vf};
@@ -0,0 +1 @@
1
+ import{j as V}from"./chunk-wbhsmhgp.js";import"./chunk-ttsqdsxr.js";import"./chunk-hqptebzb.js";import"./chunk-9bpjfkjf.js";import"./chunk-75jka5v9.js";import"./chunk-4fnak2zn.js";import"./chunk-6h4ay2p8.js";import"./chunk-mk1jewvw.js";import"./chunk-v98yavtp.js";import"./chunk-azfgjqjx.js";import"./chunk-m3dwydr3.js";import"./chunk-mjncyjwf.js";import"./chunk-sy8rqacm.js";import{wf as U}from"./chunk-1w9dnk5p.js";import"./chunk-7mnezagc.js";import{zf as N}from"./chunk-zn9jbc6t.js";import"./chunk-qjjr3fff.js";import"./chunk-46c5xkmn.js";import"./chunk-99db4j0k.js";import"./chunk-7ktvhtp1.js";import"./chunk-mg6fce5x.js";import"./chunk-2xnys7v4.js";import"./chunk-cpr05qng.js";import"./chunk-dwf5e5g3.js";import{Rg as Z,Tg as q,Xg as D,Yg as G,_j as K,ih as H,uh as J}from"./chunk-wf4d1anc.js";import{Pk as Y}from"./chunk-976v5s8y.js";var W=Y(Z(),1);function _(){let{projectId:h}=$.useParams(),{teamId:v,ensureTeamIdForProject:w}=K();W.useEffect(()=>{w(h)},[h,w]);let{data:A}=G(U(h)),b=A?.rootFolder,{data:X}=D({queryKey:["folders",b],queryFn:async()=>{let B=await J.api.folders[":folderId"].$get({param:{folderId:b}});if(!B.ok)throw Error("failed to fetch folder");return await B.json()},enabled:!!b});if(!v||!b||!X)return q(N,{});return q(V,{teamId:v,projectId:h,projectName:A.name??"",assetId:b,rootFolderId:b})}var $=H("/projects/$projectId/")({component:_});export{$ as Route};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  function f(b){return b.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,"")}
3
- export{f as Yj};
3
+ export{f as kc};
@@ -1,2 +1,2 @@
1
- import{i as S}from"./chunk-dgx2zxze.js";import{Q as Jz,R as Xz,S as Yz,T as Zz,U as _z}from"./chunk-q4f5vvtx.js";import{Va as $z}from"./chunk-kpy0kpna.js";import{Xa as A}from"./chunk-ajqsprm0.js";import{nf as H}from"./chunk-8wv3kdz9.js";import{Jf as zz}from"./chunk-j8q688sx.js";import{$f as Hz,Dh as b,Eg as a,Ng as n,Pi as B,Wg as r,Yg as o,_h as e,ag as M,bg as z,bh as R,cg as J,ch as t,fg as c,hh as f,hj as Y,ij as Gz,mi as h,vi as s}from"./chunk-nwtb6dt1.js";import{Zj as Fz}from"./chunk-kbzm1pwx.js";var _=Fz(Hz(),1);function Sz({projectId:P,contextAssetId:v}){let{isHistoryMode:U,setIsHistoryMode:u,currentSessionId:qz,chatAssets:p,removeAsset:Kz,messages:D,historySessions:I,isStreaming:O,fetchHistorySessions:g,loadSession:Qz,deleteSession:Uz,startNewSession:Vz,sendMessage:Wz,abortActiveSession:Lz,selectedAgentId:E,setSelectedAgentId:T}=H(),{teamId:Z,ensureTeamIdForProject:l}=Gz();_.useEffect(()=>{if(P)l(P)},[P,l]);let{data:Nz=[]}=c({queryKey:["agents",Z],queryFn:async()=>{if(!Z)return[];let G=await a.api.teams[":teamId"].agents.$get({param:{teamId:Z}});if(!G.ok)throw Error("failed to fetch agents");return G.json()},enabled:!!Z}),C=Nz.filter((G)=>G.type==="chat"&&G.enabled);_.useEffect(()=>{if(C.length>0){if(!C.some((X)=>X.id===E))T(C[0].id)}},[C,E,T]);let[F,m]=_.useState(""),j=_.useRef(null),y=_.useRef(null),w=_.useRef(!0),k=_.useRef(!0);_.useEffect(()=>{k.current=!0,w.current=!0},[P,v,U]),_.useEffect(()=>{let G=y.current?.querySelector('[data-slot="scroll-area-viewport"]');if(!G)return;let{scrollTop:X,isAtBottom:$}=H.getState(),Q=setTimeout(()=>{if($)G.scrollTop=G.scrollHeight;else G.scrollTop=X;let L=setTimeout(()=>{k.current=!1},50);return()=>clearTimeout(L)},0);return()=>clearTimeout(Q)},[P,v,U]),_.useEffect(()=>{let G=y.current?.querySelector('[data-slot="scroll-area-viewport"]');if(!G)return;let X=()=>{if(k.current)return;let $=G.scrollTop,Q=G.scrollHeight-$-G.clientHeight<10;H.getState().setScrollState($,Q)};return G.addEventListener("scroll",X),()=>{G.removeEventListener("scroll",X)}},[P,v,U]);let{ref:Pz,isDropTarget:Oz}=$z({id:"chatbot-sidebar",data:{type:"chatbot-sidebar"}});_.useEffect(()=>{if(!U){let{isAtBottom:G}=H.getState();if(G||O){let X=w.current?"auto":"smooth";j.current?.scrollIntoView({behavior:X})}w.current=!1}},[D,O,U]),_.useEffect(()=>{if(U&&Z)g(Z)},[U,g,Z]);let d=()=>{if(!F.trim()||O||!Z)return;Wz(Z,F,P,v),m("")},Dz=(G)=>{if(G.nativeEvent.isComposing)return;if(G.key==="Enter"&&!G.shiftKey)G.preventDefault(),d()},i=(G)=>{if(typeof G==="string")return G;if(Array.isArray(G))return G.map((X)=>{if(typeof X==="string")return X;if(X&&typeof X==="object"&&"type"in X&&X.type==="text"&&"text"in X)return String(X.text);return""}).join("");return""},x=(G)=>{return G.replace(/<@([a-zA-Z0-9_-]+)>/g,"@$1").replace(/^\[([^\]]+)\]:/gm,"\\[$1\\]:")},Cz=(G)=>{switch(G.role){case"user":return z("div",{className:"flex justify-end w-full",children:z("div",{className:"bg-primary text-primary-foreground rounded-lg px-3 py-2 max-w-[85%] text-sm whitespace-pre-wrap shadow-xs break-words",children:i(G.content)})},G.id);case"assistant":{let $=G.content;if(!$)return null;let Q=[];if($.forEach((q,V)=>{if(!q||typeof q!=="object")return;let W=q;switch(W.type){case"text":{let K=W.text;if(typeof K!=="string"||!K.trim())return;Q.push(z("div",{className:"text-sm leading-[1.8] prose prose-sm dark:prose-invert max-w-none break-words",children:z(S,{components:{pre:({node:N,...Ez})=>z("pre",{className:"whitespace-pre-wrap break-all break-words bg-muted text-foreground p-4 rounded-md border border-border/50 font-mono text-sm",...Ez})},children:x(K)})},`txt-${V}`));break}case"thinking":{let K=W.thinking;if(typeof K!=="string"||!K.trim())return;Q.push(J("details",{className:"group border border-border/50 rounded-lg bg-muted/20 my-2 overflow-hidden",children:[J("summary",{className:"flex items-center gap-2 p-2.5 text-xs font-medium text-muted-foreground select-none cursor-pointer hover:bg-muted/40 transition-colors list-none [&::-webkit-details-marker]:hidden",children:[z(t,{className:"h-3.5 w-3.5 text-primary/70 animate-pulse"}),z("span",{children:Y.role_thinking()||"Thinking"}),z(f,{className:"h-3 w-3 ml-auto transition-transform group-open:rotate-180"})]}),z("div",{className:"p-3 pt-0 text-xs text-muted-foreground/90 border-t border-border/40 bg-muted/10 leading-relaxed prose prose-sm dark:prose-invert max-w-none whitespace-pre-wrap font-sans",children:z(S,{children:x(K)})})]},`think-${V}`));break}case"toolCall":{let K=String(W.name||W.toolName||Y.unknown()),N=W.arguments||W.args;Q.push(J("details",{className:"group border border-border/50 rounded-lg bg-violet-500/5 my-2 overflow-hidden",children:[J("summary",{className:"flex items-center gap-2 p-2.5 text-xs font-semibold text-violet-600 dark:text-violet-400 select-none cursor-pointer hover:bg-violet-500/10 transition-colors list-none [&::-webkit-details-marker]:hidden",children:[z(s,{className:"h-3.5 w-3.5"}),z("span",{children:Y.calling_tool()}),z("span",{className:"font-mono bg-violet-500/10 px-1.5 py-0.5 rounded text-[11px] text-violet-700 dark:text-violet-300",children:K}),z(f,{className:"h-3 w-3 ml-auto transition-transform group-open:rotate-180"})]}),!!N&&J("div",{className:"p-3 pt-0 text-[10px] text-muted-foreground/90 border-t border-border/40 bg-violet-500/5 font-sans",children:[z("div",{className:"text-[9px] text-muted-foreground/60 uppercase font-bold tracking-wider mb-1.5",children:Y.tool_arguments()||"Arguments"}),z("pre",{className:"font-mono bg-muted/30 p-2 rounded border border-border/30 overflow-x-auto max-h-32",children:JSON.stringify(N,null,2)})]})]},`tool-${V}`));break}case"image":{let K=String(W.mimeType||"image/png"),N=String(W.data||"");Q.push(z("div",{className:"my-2 max-w-full",children:N?z("img",{src:N.startsWith("data:")?N:`data:${K};base64,${N}`,alt:"Attached asset",className:"max-h-60 rounded border border-border/50 object-contain shadow-xs"}):z("div",{className:"text-xs text-muted-foreground italic flex items-center gap-1.5 py-1",children:Y.image_object()})},`img-${V}`));break}default:{let K=JSON.stringify(q,null,2);if(K==="{}")return;Q.push(z("pre",{className:"text-xs text-foreground/80 font-mono whitespace-pre-wrap break-words bg-muted/20 p-2 rounded",children:K},`other-${V}`))}}}),Q.length===0)return null;let L=!1;if($.length>0){let q=$[$.length-1];if(typeof q==="string"&&q.trim().length>0)L=!0;else if(q&&typeof q==="object"){let V=q;if(V.type==="text"&&typeof V.text==="string"&&V.text.trim().length>0)L=!0}}return J("div",{className:"flex flex-col w-full space-y-1",children:[z("div",{className:"space-y-2 w-full",children:Q}),L&&z("div",{className:"text-[10px] text-muted-foreground self-start italic pt-1",children:Y.created_by_agent()})]},G.id)}case"toolResult":return z("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/40 p-2 rounded-md border border-border/50",children:z("span",{className:"font-semibold",children:Y.tool_result_with_name({name:G.toolName||"tool"})})},G.id);case"thinking_level_change":case"custom":{let X=G;if(X.customType==="context_display_info"){let L=X.details?.assets||[];if(L.length===0)return null;return J("div",{className:"text-xs text-muted-foreground bg-muted/40 p-2.5 rounded-lg border border-border/50 space-y-1 my-1",children:[z("div",{className:"font-semibold",children:Y.assets_added_to_context()}),z("ul",{className:"list-disc list-inside space-y-0.5",children:L.map((q)=>J("li",{className:"truncate",children:[q.name," ",J("span",{className:"text-muted-foreground/70",children:["(",q.type,")"]})]},q.id))})]},G.id)}let $=X.content||"";return z("div",{className:"text-center text-xs text-muted-foreground italic bg-muted/20 py-1.5 rounded",children:i($)},G.id)}default:return null}};return J("div",{ref:Pz,className:B("relative flex flex-col h-full bg-background transition-colors duration-200 min-h-0"),children:[Oz&&z("div",{className:"absolute inset-0 bg-accent/30 border-2 border-primary z-50 pointer-events-none flex items-center justify-center p-6 text-center animate-in fade-in duration-150",children:J("div",{className:"bg-background/95 text-foreground px-4 py-3 rounded-xl border border-border/80 flex flex-col items-center gap-2 shadow-lg max-w-[80%] animate-in zoom-in-95 duration-150",children:[z(R,{className:"h-6 w-6 text-primary animate-bounce"}),z("span",{className:"text-sm font-semibold text-foreground",children:Y.chatbot_drag_drop_hint()||"Drop assets here"})]})}),z("div",{className:"flex items-center justify-between p-4 pt-[0.7rem] flex-shrink-0",children:U?J(M,{children:[z("div",{className:"flex items-center gap-2 font-semibold",children:z("span",{children:Y.history()})}),z("button",{onClick:()=>u(!1),className:"p-1.5 hover:bg-accent rounded-md text-muted-foreground hover:text-foreground transition-colors",title:"Close History",children:z(r,{className:"h-4 w-4"})})]}):J(M,{children:[z("div",{className:"flex items-center gap-2 font-semibold",children:z("span",{children:Y.shumai_agent()})}),J("div",{className:"flex items-center gap-1",children:[z("button",{onClick:Vz,className:"p-1.5 hover:bg-accent rounded-md text-muted-foreground hover:text-foreground transition-colors",title:Y.new_chat(),children:z(e,{className:"h-4 w-4"})}),z("button",{onClick:()=>u(!0),className:"p-1.5 hover:bg-accent rounded-md text-muted-foreground hover:text-foreground transition-colors",title:Y.history(),children:z(b,{className:"h-4 w-4"})})]})]})}),U?z(A,{className:"flex-1 p-4 min-h-0",children:I.length===0?J("div",{className:"flex flex-col items-center justify-center h-48 text-muted-foreground p-4 text-center",children:[z(b,{className:"h-8 w-8 mb-2 opacity-50 text-muted-foreground"}),z("p",{className:"text-sm",children:Y.no_history_sessions()})]}):z("div",{className:"space-y-2 pb-4",children:I.map((G)=>{let X=G.id===qz;return J("div",{className:B("group relative flex items-center justify-between p-3 border rounded-lg transition-all cursor-pointer bg-card",X?"border-primary":"border-border hover:bg-accent/30"),children:[J("div",{onClick:()=>Z&&Qz(Z,G.id),className:"flex-1 min-w-0 pr-6",children:[z("div",{className:"text-sm font-semibold text-foreground truncate",children:G.name||Y.new_chat()}),z("div",{className:"text-xs text-muted-foreground mt-0.5",children:zz(G.createdAt)})]}),z("button",{onClick:($)=>{if($.stopPropagation(),Z&&confirm(Y.delete_session_confirm()))Uz(Z,G.id)},className:"absolute right-3 opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity text-muted-foreground hover:text-destructive p-1 rounded hover:bg-muted",title:"Delete Session",children:z(h,{className:"h-4 w-4"})})]},G.id)})})}):J(M,{children:[z(A,{ref:y,className:"flex-1 p-4 min-h-0 [&>div>div]:!block",children:D.length===0?J("div",{className:"flex flex-col items-center justify-center h-48 border-2 border-dashed border-border rounded-lg text-muted-foreground p-4 text-center",children:[z(R,{className:"h-8 w-8 mb-2 opacity-50 text-muted-foreground"}),z("p",{className:"text-sm",children:Y.chatbot_drag_drop_hint()})]}):J("div",{className:"space-y-4 pb-4",children:[D.map(Cz),O&&D.length>0&&D[D.length-1].role==="user"&&J("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground italic",children:[z(n,{className:"h-3 w-3 animate-spin text-primary"}),z("span",{children:"Thinking..."})]}),z("div",{ref:j})]})}),z("div",{className:"p-2 flex-shrink-0 bg-background",children:J("div",{className:"relative flex flex-col w-full border border-foreground/20 rounded-2xl shadow-xs transition-all duration-200 focus-within:ring-2 focus-within:ring-primary focus-within:border-transparent bg-background overflow-hidden",children:[p.length>0&&z("div",{className:"flex flex-col gap-1.5 min-h-0 max-h-[160px] overflow-y-auto border-b border-border bg-muted/5 p-3 divide-y divide-border/50",children:p.map((G)=>J("div",{className:"flex items-center justify-between py-1.5 text-xs group",children:[J("div",{className:"flex items-baseline gap-1.5 min-w-0 pr-2",children:[z("span",{className:"truncate font-medium text-foreground",children:G.name}),z("span",{className:"text-[9px] text-muted-foreground uppercase flex-shrink-0",children:G.type})]}),z("button",{onClick:()=>Kz(G.id),className:"text-muted-foreground hover:text-destructive transition-colors p-0.5",title:Y.remove_from_context(),children:z(h,{className:"h-3.5 w-3.5"})})]},G.id))}),z("textarea",{value:F,onChange:(G)=>m(G.target.value),onKeyDown:Dz,placeholder:"Type a message...",rows:2,className:"w-full bg-transparent border-none focus:ring-0 focus:outline-hidden resize-none min-h-[44px] max-h-[120px] px-3 py-2 text-sm focus-visible:outline-hidden focus:ring-transparent focus:border-transparent focus-visible:ring-0",disabled:O}),J("div",{className:"flex justify-between items-center px-3 pb-2 pt-1",children:[z("div",{className:"flex items-center gap-1.5 min-w-0 max-w-[70%]",children:C.length>0?J(Jz,{value:E||"",onValueChange:(G)=>T(G),disabled:O,children:[z(Yz,{className:"h-8 border-none bg-transparent hover:bg-muted text-muted-foreground hover:text-foreground focus:ring-0 focus:ring-offset-0 px-2 py-0 gap-1.5 text-xs shrink-0 select-none shadow-none max-w-full",children:z(Xz,{placeholder:Y.select_agent()})}),z(Zz,{children:C.map((G)=>z(_z,{value:G.id,children:J("div",{className:"flex items-center gap-2",children:[G.avatar?z("img",{src:G.avatar,alt:G.name,className:"w-4 h-4 rounded-full object-cover"}):z(R,{className:"w-4 h-4 text-muted-foreground"}),z("span",{className:"text-xs",children:G.name})]})},G.id))})]}):z("div",{className:"flex items-center gap-1.5 px-2 py-1 text-[11px] text-muted-foreground/60 italic select-none",children:z("span",{children:Y.no_chat_agents_warning()})})}),O?z("button",{onClick:()=>{if(Z)Lz(Z)},className:"p-2 rounded-full transition-all duration-200 flex items-center justify-center shrink-0 shadow-sm bg-destructive text-destructive-foreground hover:bg-destructive/90 transform hover:-translate-y-0.5",title:"Stop generation",children:z("div",{className:"h-4 w-4 flex items-center justify-center",children:z("div",{className:"h-3 w-3 bg-current rounded-[2px] bg-white"})})}):z("button",{onClick:d,disabled:!F.trim()||!E,className:B("p-2 rounded-full transition-all duration-200 flex items-center justify-center shrink-0 shadow-sm",F.trim()&&E?"bg-primary text-primary-foreground hover:bg-primary/95 transform hover:-translate-y-0.5":"bg-muted text-muted-foreground cursor-not-allowed opacity-50"),children:z(o,{className:"h-4 w-4"})})]})]})})]})]})}
2
- export{Sz as g};
1
+ import{n as S}from"./chunk-9bpjfkjf.js";import{V as Jz,W as Xz,X as Yz,Y as Zz,Z as _z}from"./chunk-6h4ay2p8.js";import{Ua as $z}from"./chunk-v98yavtp.js";import{Wa as A}from"./chunk-azfgjqjx.js";import{ig as H}from"./chunk-99db4j0k.js";import{Mg as zz}from"./chunk-cpr05qng.js";import{Dh as n,Fj as B,Mh as r,Oh as o,Qi as e,Rg as Hz,Sg as M,Tg as z,Th as R,Ug as J,Uh as t,Xg as c,Zh as f,Zj as Y,_j as Gz,cj as h,lj as s,ti as b,uh as a}from"./chunk-wf4d1anc.js";import{Pk as Fz}from"./chunk-976v5s8y.js";var _=Fz(Hz(),1);function Sz({projectId:P,contextAssetId:v}){let{isHistoryMode:U,setIsHistoryMode:u,currentSessionId:qz,chatAssets:p,removeAsset:Kz,messages:D,historySessions:I,isStreaming:O,fetchHistorySessions:g,loadSession:Qz,deleteSession:Uz,startNewSession:Vz,sendMessage:Wz,abortActiveSession:Lz,selectedAgentId:E,setSelectedAgentId:T}=H(),{teamId:Z,ensureTeamIdForProject:l}=Gz();_.useEffect(()=>{if(P)l(P)},[P,l]);let{data:Nz=[]}=c({queryKey:["agents",Z],queryFn:async()=>{if(!Z)return[];let G=await a.api.teams[":teamId"].agents.$get({param:{teamId:Z}});if(!G.ok)throw Error("failed to fetch agents");return G.json()},enabled:!!Z}),C=Nz.filter((G)=>G.type==="chat"&&G.enabled);_.useEffect(()=>{if(C.length>0){if(!C.some((X)=>X.id===E))T(C[0].id)}},[C,E,T]);let[F,m]=_.useState(""),j=_.useRef(null),y=_.useRef(null),w=_.useRef(!0),k=_.useRef(!0);_.useEffect(()=>{k.current=!0,w.current=!0},[P,v,U]),_.useEffect(()=>{let G=y.current?.querySelector('[data-slot="scroll-area-viewport"]');if(!G)return;let{scrollTop:X,isAtBottom:$}=H.getState(),Q=setTimeout(()=>{if($)G.scrollTop=G.scrollHeight;else G.scrollTop=X;let L=setTimeout(()=>{k.current=!1},50);return()=>clearTimeout(L)},0);return()=>clearTimeout(Q)},[P,v,U]),_.useEffect(()=>{let G=y.current?.querySelector('[data-slot="scroll-area-viewport"]');if(!G)return;let X=()=>{if(k.current)return;let $=G.scrollTop,Q=G.scrollHeight-$-G.clientHeight<10;H.getState().setScrollState($,Q)};return G.addEventListener("scroll",X),()=>{G.removeEventListener("scroll",X)}},[P,v,U]);let{ref:Pz,isDropTarget:Oz}=$z({id:"chatbot-sidebar",data:{type:"chatbot-sidebar"}});_.useEffect(()=>{if(!U){let{isAtBottom:G}=H.getState();if(G||O){let X=w.current?"auto":"smooth";j.current?.scrollIntoView({behavior:X})}w.current=!1}},[D,O,U]),_.useEffect(()=>{if(U&&Z)g(Z)},[U,g,Z]);let d=()=>{if(!F.trim()||O||!Z)return;Wz(Z,F,P,v),m("")},Dz=(G)=>{if(G.nativeEvent.isComposing)return;if(G.key==="Enter"&&!G.shiftKey)G.preventDefault(),d()},i=(G)=>{if(typeof G==="string")return G;if(Array.isArray(G))return G.map((X)=>{if(typeof X==="string")return X;if(X&&typeof X==="object"&&"type"in X&&X.type==="text"&&"text"in X)return String(X.text);return""}).join("");return""},x=(G)=>{return G.replace(/<@([a-zA-Z0-9_-]+)>/g,"@$1").replace(/^\[([^\]]+)\]:/gm,"\\[$1\\]:")},Cz=(G)=>{switch(G.role){case"user":return z("div",{className:"flex justify-end w-full",children:z("div",{className:"bg-primary text-primary-foreground rounded-lg px-3 py-2 max-w-[85%] text-sm whitespace-pre-wrap shadow-xs break-words",children:i(G.content)})},G.id);case"assistant":{let $=G.content;if(!$)return null;let Q=[];if($.forEach((q,V)=>{if(!q||typeof q!=="object")return;let W=q;switch(W.type){case"text":{let K=W.text;if(typeof K!=="string"||!K.trim())return;Q.push(z("div",{className:"text-sm leading-[1.8] prose prose-sm dark:prose-invert max-w-none break-words",children:z(S,{components:{pre:({node:N,...Ez})=>z("pre",{className:"whitespace-pre-wrap break-all break-words bg-muted text-foreground p-4 rounded-md border border-border/50 font-mono text-sm",...Ez})},children:x(K)})},`txt-${V}`));break}case"thinking":{let K=W.thinking;if(typeof K!=="string"||!K.trim())return;Q.push(J("details",{className:"group border border-border/50 rounded-lg bg-muted/20 my-2 overflow-hidden",children:[J("summary",{className:"flex items-center gap-2 p-2.5 text-xs font-medium text-muted-foreground select-none cursor-pointer hover:bg-muted/40 transition-colors list-none [&::-webkit-details-marker]:hidden",children:[z(t,{className:"h-3.5 w-3.5 text-primary/70 animate-pulse"}),z("span",{children:Y.role_thinking()||"Thinking"}),z(f,{className:"h-3 w-3 ml-auto transition-transform group-open:rotate-180"})]}),z("div",{className:"p-3 pt-0 text-xs text-muted-foreground/90 border-t border-border/40 bg-muted/10 leading-relaxed prose prose-sm dark:prose-invert max-w-none whitespace-pre-wrap font-sans",children:z(S,{children:x(K)})})]},`think-${V}`));break}case"toolCall":{let K=String(W.name||W.toolName||Y.unknown()),N=W.arguments||W.args;Q.push(J("details",{className:"group border border-border/50 rounded-lg bg-violet-500/5 my-2 overflow-hidden",children:[J("summary",{className:"flex items-center gap-2 p-2.5 text-xs font-semibold text-violet-600 dark:text-violet-400 select-none cursor-pointer hover:bg-violet-500/10 transition-colors list-none [&::-webkit-details-marker]:hidden",children:[z(s,{className:"h-3.5 w-3.5"}),z("span",{children:Y.calling_tool()}),z("span",{className:"font-mono bg-violet-500/10 px-1.5 py-0.5 rounded text-[11px] text-violet-700 dark:text-violet-300",children:K}),z(f,{className:"h-3 w-3 ml-auto transition-transform group-open:rotate-180"})]}),!!N&&J("div",{className:"p-3 pt-0 text-[10px] text-muted-foreground/90 border-t border-border/40 bg-violet-500/5 font-sans",children:[z("div",{className:"text-[9px] text-muted-foreground/60 uppercase font-bold tracking-wider mb-1.5",children:Y.tool_arguments()||"Arguments"}),z("pre",{className:"font-mono bg-muted/30 p-2 rounded border border-border/30 overflow-x-auto max-h-32",children:JSON.stringify(N,null,2)})]})]},`tool-${V}`));break}case"image":{let K=String(W.mimeType||"image/png"),N=String(W.data||"");Q.push(z("div",{className:"my-2 max-w-full",children:N?z("img",{src:N.startsWith("data:")?N:`data:${K};base64,${N}`,alt:"Attached asset",className:"max-h-60 rounded border border-border/50 object-contain shadow-xs"}):z("div",{className:"text-xs text-muted-foreground italic flex items-center gap-1.5 py-1",children:Y.image_object()})},`img-${V}`));break}default:{let K=JSON.stringify(q,null,2);if(K==="{}")return;Q.push(z("pre",{className:"text-xs text-foreground/80 font-mono whitespace-pre-wrap break-words bg-muted/20 p-2 rounded",children:K},`other-${V}`))}}}),Q.length===0)return null;let L=!1;if($.length>0){let q=$[$.length-1];if(typeof q==="string"&&q.trim().length>0)L=!0;else if(q&&typeof q==="object"){let V=q;if(V.type==="text"&&typeof V.text==="string"&&V.text.trim().length>0)L=!0}}return J("div",{className:"flex flex-col w-full space-y-1",children:[z("div",{className:"space-y-2 w-full",children:Q}),L&&z("div",{className:"text-[10px] text-muted-foreground self-start italic pt-1",children:Y.created_by_agent()})]},G.id)}case"toolResult":return z("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/40 p-2 rounded-md border border-border/50",children:z("span",{className:"font-semibold",children:Y.tool_result_with_name({name:G.toolName||"tool"})})},G.id);case"thinking_level_change":case"custom":{let X=G;if(X.customType==="context_display_info"){let L=X.details?.assets||[];if(L.length===0)return null;return J("div",{className:"text-xs text-muted-foreground bg-muted/40 p-2.5 rounded-lg border border-border/50 space-y-1 my-1",children:[z("div",{className:"font-semibold",children:Y.assets_added_to_context()}),z("ul",{className:"list-disc list-inside space-y-0.5",children:L.map((q)=>J("li",{className:"truncate",children:[q.name," ",J("span",{className:"text-muted-foreground/70",children:["(",q.type,")"]})]},q.id))})]},G.id)}let $=X.content||"";return z("div",{className:"text-center text-xs text-muted-foreground italic bg-muted/20 py-1.5 rounded",children:i($)},G.id)}default:return null}};return J("div",{ref:Pz,className:B("relative flex flex-col h-full bg-background transition-colors duration-200 min-h-0"),children:[Oz&&z("div",{className:"absolute inset-0 bg-accent/30 border-2 border-primary z-50 pointer-events-none flex items-center justify-center p-6 text-center animate-in fade-in duration-150",children:J("div",{className:"bg-background/95 text-foreground px-4 py-3 rounded-xl border border-border/80 flex flex-col items-center gap-2 shadow-lg max-w-[80%] animate-in zoom-in-95 duration-150",children:[z(R,{className:"h-6 w-6 text-primary animate-bounce"}),z("span",{className:"text-sm font-semibold text-foreground",children:Y.chatbot_drag_drop_hint()||"Drop assets here"})]})}),z("div",{className:"flex items-center justify-between p-4 pt-[0.7rem] flex-shrink-0",children:U?J(M,{children:[z("div",{className:"flex items-center gap-2 font-semibold",children:z("span",{children:Y.history()})}),z("button",{onClick:()=>u(!1),className:"p-1.5 hover:bg-accent rounded-md text-muted-foreground hover:text-foreground transition-colors",title:"Close History",children:z(r,{className:"h-4 w-4"})})]}):J(M,{children:[z("div",{className:"flex items-center gap-2 font-semibold",children:z("span",{children:Y.shumai_agent()})}),J("div",{className:"flex items-center gap-1",children:[z("button",{onClick:Vz,className:"p-1.5 hover:bg-accent rounded-md text-muted-foreground hover:text-foreground transition-colors",title:Y.new_chat(),children:z(e,{className:"h-4 w-4"})}),z("button",{onClick:()=>u(!0),className:"p-1.5 hover:bg-accent rounded-md text-muted-foreground hover:text-foreground transition-colors",title:Y.history(),children:z(b,{className:"h-4 w-4"})})]})]})}),U?z(A,{className:"flex-1 p-4 min-h-0",children:I.length===0?J("div",{className:"flex flex-col items-center justify-center h-48 text-muted-foreground p-4 text-center",children:[z(b,{className:"h-8 w-8 mb-2 opacity-50 text-muted-foreground"}),z("p",{className:"text-sm",children:Y.no_history_sessions()})]}):z("div",{className:"space-y-2 pb-4",children:I.map((G)=>{let X=G.id===qz;return J("div",{className:B("group relative flex items-center justify-between p-3 border rounded-lg transition-all cursor-pointer bg-card",X?"border-primary":"border-border hover:bg-accent/30"),children:[J("div",{onClick:()=>Z&&Qz(Z,G.id),className:"flex-1 min-w-0 pr-6",children:[z("div",{className:"text-sm font-semibold text-foreground truncate",children:G.name||Y.new_chat()}),z("div",{className:"text-xs text-muted-foreground mt-0.5",children:zz(G.createdAt)})]}),z("button",{onClick:($)=>{if($.stopPropagation(),Z&&confirm(Y.delete_session_confirm()))Uz(Z,G.id)},className:"absolute right-3 opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity text-muted-foreground hover:text-destructive p-1 rounded hover:bg-muted",title:"Delete Session",children:z(h,{className:"h-4 w-4"})})]},G.id)})})}):J(M,{children:[z(A,{ref:y,className:"flex-1 p-4 min-h-0 [&>div>div]:!block",children:D.length===0?J("div",{className:"flex flex-col items-center justify-center h-48 border-2 border-dashed border-border rounded-lg text-muted-foreground p-4 text-center",children:[z(R,{className:"h-8 w-8 mb-2 opacity-50 text-muted-foreground"}),z("p",{className:"text-sm",children:Y.chatbot_drag_drop_hint()})]}):J("div",{className:"space-y-4 pb-4",children:[D.map(Cz),O&&D.length>0&&D[D.length-1].role==="user"&&J("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground italic",children:[z(n,{className:"h-3 w-3 animate-spin text-primary"}),z("span",{children:"Thinking..."})]}),z("div",{ref:j})]})}),z("div",{className:"p-2 flex-shrink-0 bg-background",children:J("div",{className:"relative flex flex-col w-full border border-foreground/20 rounded-2xl shadow-xs transition-all duration-200 focus-within:ring-2 focus-within:ring-primary focus-within:border-transparent bg-background overflow-hidden",children:[p.length>0&&z("div",{className:"flex flex-col gap-1.5 min-h-0 max-h-[160px] overflow-y-auto border-b border-border bg-muted/5 p-3 divide-y divide-border/50",children:p.map((G)=>J("div",{className:"flex items-center justify-between py-1.5 text-xs group",children:[J("div",{className:"flex items-baseline gap-1.5 min-w-0 pr-2",children:[z("span",{className:"truncate font-medium text-foreground",children:G.name}),z("span",{className:"text-[9px] text-muted-foreground uppercase flex-shrink-0",children:G.type})]}),z("button",{onClick:()=>Kz(G.id),className:"text-muted-foreground hover:text-destructive transition-colors p-0.5",title:Y.remove_from_context(),children:z(h,{className:"h-3.5 w-3.5"})})]},G.id))}),z("textarea",{value:F,onChange:(G)=>m(G.target.value),onKeyDown:Dz,placeholder:"Type a message...",rows:2,className:"w-full bg-transparent border-none focus:ring-0 focus:outline-hidden resize-none min-h-[44px] max-h-[120px] px-3 py-2 text-sm focus-visible:outline-hidden focus:ring-transparent focus:border-transparent focus-visible:ring-0",disabled:O}),J("div",{className:"flex justify-between items-center px-3 pb-2 pt-1",children:[z("div",{className:"flex items-center gap-1.5 min-w-0 max-w-[70%]",children:C.length>0?J(Jz,{value:E||"",onValueChange:(G)=>T(G),disabled:O,children:[z(Yz,{className:"h-8 border-none bg-transparent hover:bg-muted text-muted-foreground hover:text-foreground focus:ring-0 focus:ring-offset-0 px-2 py-0 gap-1.5 text-xs shrink-0 select-none shadow-none max-w-full",children:z(Xz,{placeholder:Y.select_agent()})}),z(Zz,{children:C.map((G)=>z(_z,{value:G.id,children:J("div",{className:"flex items-center gap-2",children:[G.avatar?z("img",{src:G.avatar,alt:G.name,className:"w-4 h-4 rounded-full object-cover"}):z(R,{className:"w-4 h-4 text-muted-foreground"}),z("span",{className:"text-xs",children:G.name})]})},G.id))})]}):z("div",{className:"flex items-center gap-1.5 px-2 py-1 text-[11px] text-muted-foreground/60 italic select-none",children:z("span",{children:Y.no_chat_agents_warning()})})}),O?z("button",{onClick:()=>{if(Z)Lz(Z)},className:"p-2 rounded-full transition-all duration-200 flex items-center justify-center shrink-0 shadow-sm bg-destructive text-destructive-foreground hover:bg-destructive/90 transform hover:-translate-y-0.5",title:"Stop generation",children:z("div",{className:"h-4 w-4 flex items-center justify-center",children:z("div",{className:"h-3 w-3 bg-current rounded-[2px] bg-white"})})}):z("button",{onClick:d,disabled:!F.trim()||!E,className:B("p-2 rounded-full transition-all duration-200 flex items-center justify-center shrink-0 shadow-sm",F.trim()&&E?"bg-primary text-primary-foreground hover:bg-primary/95 transform hover:-translate-y-0.5":"bg-muted text-muted-foreground cursor-not-allowed opacity-50"),children:z(o,{className:"h-4 w-4"})})]})]})})]})]})}
2
+ export{Sz as k};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import"./chunk-xg9xscqz.js";import{Ac as I,Sc as w}from"./chunk-8abs8d48.js";import"./chunk-qag3w2dd.js";import"./chunk-976v5s8y.js";function R(q,$){if(typeof q==="string"&&typeof $==="string")return q.toLowerCase()===$.toLowerCase();return q===$}function y(q,$){if(typeof q!=="string")return $.includes(q);return $.some((E)=>typeof E==="string"&&q.toLowerCase()===E.toLowerCase())}function j(q,$){return!y(q,$)}function g(q,$){if(typeof q!=="string"||typeof $!=="string")return!1;return q.toLowerCase().includes($.toLowerCase())}function f(q,$){if(typeof q!=="string"||typeof $!=="string")return!1;return q.toLowerCase().startsWith($.toLowerCase())}function V(q,$){if(typeof q!=="string"||typeof $!=="string")return!1;return q.toLowerCase().endsWith($.toLowerCase())}var v=(q,$)=>{let E=null,M=w({config:{adapterId:"memory",adapterName:"Memory Adapter",usePlural:!1,debugLogs:$?.debugLogs||!1,supportsArrays:!0,customTransformInput(P){if(P.options.advanced?.database?.generateId==="serial"&&P.field==="id"&&P.action==="create")return q[P.model].length+1;return P.data},transaction:async(P)=>{let A=structuredClone(q);try{return await P(M(E))}catch(_){throw Object.keys(q).forEach((S)=>{q[S]=A[S]}),_}}},adapter:({getFieldName:P,getDefaultFieldName:A,options:_,getModelName:S})=>{let N=(x,K,Y)=>{if(!K)return x;return x.sort((L,Z)=>{let z=P({model:Y,field:K.field}),D=L[z],X=Z[z],Q=0;if(D==null&&X==null)Q=0;else if(D==null)Q=-1;else if(X==null)Q=1;else if(typeof D==="string"&&typeof X==="string")Q=D.localeCompare(X);else if(D instanceof Date&&X instanceof Date)Q=D.getTime()-X.getTime();else if(typeof D==="number"&&typeof X==="number")Q=D-X;else if(typeof D==="boolean"&&typeof X==="boolean")Q=D===X?0:D?1:-1;else Q=String(D).localeCompare(String(X));return K.direction==="asc"?Q:-Q})};function F(x,K,Y,L){let Z=(()=>{let X=q[K];if(!X)throw I.error(`[MemoryAdapter] Model ${K} not found in the DB`,Object.keys(q)),Error(`Model ${K} not found`);let Q=(G,O)=>{let{field:J,value:H,operator:B,mode:k="sensitive"}=O,U=k==="insensitive"&&(typeof H==="string"||Array.isArray(H)&&H.every((W)=>typeof W==="string"));switch(B){case"in":if(!Array.isArray(H))throw Error("Value must be an array");if(U)return y(G[J],H);return H.includes(G[J]);case"not_in":if(!Array.isArray(H))throw Error("Value must be an array");if(U)return j(G[J],H);return!H.includes(G[J]);case"contains":if(U)return g(G[J],H);return G[J]?.includes(H);case"starts_with":if(U)return f(G[J],H);return G[J].startsWith(H);case"ends_with":if(U)return V(G[J],H);return G[J].endsWith(H);case"ne":return U?!R(G[J],H):G[J]!==H;case"gt":return H!=null&&Boolean(G[J]>H);case"gte":return H!=null&&Boolean(G[J]>=H);case"lt":return H!=null&&Boolean(G[J]<H);case"lte":return H!=null&&Boolean(G[J]<=H);default:if(U)return R(G[J],H);if(H===null)return G[J]==null;return G[J]===H}},T=X.filter((G)=>{if(!x.length||x.length===0)return!0;let O=Q(G,x[0]);for(let J of x){let H=Q(G,J);if(J.connector==="OR")O=O||H;else O=O&&H}return O});if(L?.length&&L.length>0)T=T.map((G)=>Object.fromEntries(Object.entries(G).filter(([O])=>L.includes(A({model:K,field:O})))));return T})();if(!Y)return Z;let z=new Map,D=new Map;for(let X of Z){let Q=String(X.id);if(!z.has(Q)){let G={...X};for(let[O,J]of Object.entries(Y)){let H=S(O);if(J.relation==="one-to-one")G[H]=null;else G[H]=[],D.set(`${Q}-${O}`,new Set)}z.set(Q,G)}let T=z.get(Q);for(let[G,O]of Object.entries(Y)){let J=S(G),H=q[J];if(!H)throw I.error(`[MemoryAdapter] JoinOption model ${J} not found in the DB`,Object.keys(q)),Error(`JoinOption model ${J} not found`);let B=H.filter((k)=>k[O.on.to]===X[O.on.from]);if(O.relation==="one-to-one")T[J]=B[0]||null;else{let k=D.get(`${Q}-${G}`),U=O.limit??100,W=0;for(let C of B){if(W>=U)break;if(!k.has(C.id))T[J].push(C),k.add(C.id),W++}}}}return Array.from(z.values())}return{create:async({model:x,data:K})=>{if(_.advanced?.database?.generateId==="serial")K.id=q[S(x)].length+1;if(!q[x])q[x]=[];return q[x].push(K),K},findOne:async({model:x,where:K,select:Y,join:L})=>{let Z=F(K,x,L,Y);if(L){let z=Z;if(!z.length)return null;return z[0]}return Z[0]||null},findMany:async({model:x,where:K,sortBy:Y,limit:L,select:Z,offset:z,join:D})=>{let X=F(K||[],x,D,Z);if(D){let T=X;if(!T.length)return[];N(T,Y,x);let G=T;if(z!==void 0)G=G.slice(z);if(L!==void 0)G=G.slice(0,L);return G}let Q=N(X,Y,x);if(z!==void 0)Q=Q.slice(z);if(L!==void 0)Q=Q.slice(0,L);return Q||[]},count:async({model:x,where:K})=>{if(K)return F(K,x).length;return q[x].length},update:async({model:x,where:K,update:Y})=>{let L=F(K,x);return L.forEach((Z)=>{Object.assign(Z,Y)}),L[0]||null},delete:async({model:x,where:K})=>{let Y=q[x],L=F(K,x);q[x]=Y.filter((Z)=>!L.includes(Z))},deleteMany:async({model:x,where:K})=>{let Y=q[x],L=F(K,x),Z=0;return q[x]=Y.filter((z)=>{if(L.includes(z))return Z++,!1;return!L.includes(z)}),Z},consumeOne:async({model:x,where:K})=>{let Y=q[x],L=F(K,x)[0];if(!L)return null;return q[x]=Y.filter((Z)=>Z!==L),L},updateMany({model:x,where:K,update:Y}){let L=F(K,x);return L.forEach((Z)=>{Object.assign(Z,Y)}),L[0]||null}}}});return(P)=>{return E=P,M(P)}};export{v as memoryAdapter};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{_j as N}from"./chunk-kbzm1pwx.js";var y=N((O)=>{Object.defineProperty(O,"__esModule",{value:!0});O.Allow=O.ALL=O.COLLECTION=O.ATOM=O.SPECIAL=O.INF=O._INFINITY=O.INFINITY=O.NAN=O.BOOL=O.NULL=O.OBJ=O.ARR=O.NUM=O.STR=void 0;O.STR=1;O.NUM=2;O.ARR=4;O.OBJ=8;O.NULL=16;O.BOOL=32;O.NAN=64;O.INFINITY=128;O._INFINITY=256;O.INF=O.INFINITY|O._INFINITY;O.SPECIAL=O.NULL|O.BOOL|O.INF|O.NAN;O.ATOM=O.STR|O.NUM|O.SPECIAL;O.COLLECTION=O.ARR|O.OBJ;O.ALL=O.ATOM|O.COLLECTION;O.Allow={STR:O.STR,NUM:O.NUM,ARR:O.ARR,OBJ:O.OBJ,NULL:O.NULL,BOOL:O.BOOL,NAN:O.NAN,INFINITY:O.INFINITY,_INFINITY:O._INFINITY,INF:O.INF,SPECIAL:O.SPECIAL,ATOM:O.ATOM,COLLECTION:O.COLLECTION,ALL:O.ALL};O.default=O.Allow});var x=N((K)=>{var d=K&&K.__createBinding||(Object.create?function(D,F,G,z){if(z===void 0)z=G;var Q=Object.getOwnPropertyDescriptor(F,G);if(!Q||("get"in Q?!F.__esModule:Q.writable||Q.configurable))Q={enumerable:!0,get:function(){return F[G]}};Object.defineProperty(D,z,Q)}:function(D,F,G,z){if(z===void 0)z=G;D[z]=F[G]}),j=K&&K.__exportStar||function(D,F){for(var G in D)if(G!=="default"&&!Object.prototype.hasOwnProperty.call(F,G))d(F,D,G)};Object.defineProperty(K,"__esModule",{value:!0});K.Allow=K.MalformedJSON=K.PartialJSON=K.parseJSON=K.parse=void 0;var L=y();Object.defineProperty(K,"Allow",{enumerable:!0,get:function(){return L.Allow}});j(y(),K);class f extends Error{}K.PartialJSON=f;class b extends Error{}K.MalformedJSON=b;function h(D,F=L.Allow.ALL){if(typeof D!=="string")throw TypeError(`expecting str, got ${typeof D}`);if(!D.trim())throw Error(`${D} is empty`);return g(D.trim(),F)}K.parseJSON=h;var g=(D,F)=>{let G=D.length,z=0,Q=(H)=>{throw new f(`${H} at position ${z}`)},X=(H)=>{throw new b(`${H} at position ${z}`)},Y=()=>{if(W(),z>=G)Q("Unexpected end of input");if(D[z]==='"')return J();if(D[z]==="{")return c();if(D[z]==="[")return m();if(D.substring(z,z+4)==="null"||L.Allow.NULL&F&&G-z<4&&"null".startsWith(D.substring(z)))return z+=4,null;if(D.substring(z,z+4)==="true"||L.Allow.BOOL&F&&G-z<4&&"true".startsWith(D.substring(z)))return z+=4,!0;if(D.substring(z,z+5)==="false"||L.Allow.BOOL&F&&G-z<5&&"false".startsWith(D.substring(z)))return z+=5,!1;if(D.substring(z,z+8)==="Infinity"||L.Allow.INFINITY&F&&G-z<8&&"Infinity".startsWith(D.substring(z)))return z+=8,1/0;if(D.substring(z,z+9)==="-Infinity"||L.Allow._INFINITY&F&&1<G-z&&G-z<9&&"-Infinity".startsWith(D.substring(z)))return z+=9,-1/0;if(D.substring(z,z+3)==="NaN"||L.Allow.NAN&F&&G-z<3&&"NaN".startsWith(D.substring(z)))return z+=3,NaN;return w()},J=()=>{let H=z,U=!1;z++;while(z<G&&(D[z]!=='"'||U&&D[z-1]==="\\"))U=D[z]==="\\"?!U:!1,z++;if(D.charAt(z)=='"')try{return JSON.parse(D.substring(H,++z-Number(U)))}catch(V){X(String(V))}else if(L.Allow.STR&F)try{return JSON.parse(D.substring(H,z-Number(U))+'"')}catch(V){return JSON.parse(D.substring(H,D.lastIndexOf("\\"))+'"')}Q("Unterminated string literal")},c=()=>{z++,W();let H={};try{while(D[z]!=="}"){if(W(),z>=G&&L.Allow.OBJ&F)return H;let U=J();W(),z++;try{let V=Y();H[U]=V}catch(V){if(L.Allow.OBJ&F)return H;else throw V}if(W(),D[z]===",")z++}}catch(U){if(L.Allow.OBJ&F)return H;else Q("Expected '}' at end of object")}return z++,H},m=()=>{z++;let H=[];try{while(D[z]!=="]")if(H.push(Y()),W(),D[z]===",")z++}catch(U){if(L.Allow.ARR&F)return H;Q("Expected ']' at end of array")}return z++,H},w=()=>{if(z===0){if(D==="-")X("Not sure what '-' is");try{return JSON.parse(D)}catch(U){if(L.Allow.NUM&F)try{return JSON.parse(D.substring(0,D.lastIndexOf("e")))}catch(V){}X(String(U))}}let H=z;if(D[z]==="-")z++;while(D[z]&&",]}".indexOf(D[z])===-1)z++;if(z==G&&!(L.Allow.NUM&F))Q("Unterminated number literal");try{return JSON.parse(D.substring(H,z))}catch(U){if(D.substring(H,z)==="-")Q("Not sure what '-' is");try{return JSON.parse(D.substring(H,D.lastIndexOf("e")))}catch(V){X(String(V))}}},W=()=>{while(z<G&&`
2
+ import{Qk as N}from"./chunk-976v5s8y.js";var y=N((O)=>{Object.defineProperty(O,"__esModule",{value:!0});O.Allow=O.ALL=O.COLLECTION=O.ATOM=O.SPECIAL=O.INF=O._INFINITY=O.INFINITY=O.NAN=O.BOOL=O.NULL=O.OBJ=O.ARR=O.NUM=O.STR=void 0;O.STR=1;O.NUM=2;O.ARR=4;O.OBJ=8;O.NULL=16;O.BOOL=32;O.NAN=64;O.INFINITY=128;O._INFINITY=256;O.INF=O.INFINITY|O._INFINITY;O.SPECIAL=O.NULL|O.BOOL|O.INF|O.NAN;O.ATOM=O.STR|O.NUM|O.SPECIAL;O.COLLECTION=O.ARR|O.OBJ;O.ALL=O.ATOM|O.COLLECTION;O.Allow={STR:O.STR,NUM:O.NUM,ARR:O.ARR,OBJ:O.OBJ,NULL:O.NULL,BOOL:O.BOOL,NAN:O.NAN,INFINITY:O.INFINITY,_INFINITY:O._INFINITY,INF:O.INF,SPECIAL:O.SPECIAL,ATOM:O.ATOM,COLLECTION:O.COLLECTION,ALL:O.ALL};O.default=O.Allow});var x=N((K)=>{var d=K&&K.__createBinding||(Object.create?function(D,F,G,z){if(z===void 0)z=G;var Q=Object.getOwnPropertyDescriptor(F,G);if(!Q||("get"in Q?!F.__esModule:Q.writable||Q.configurable))Q={enumerable:!0,get:function(){return F[G]}};Object.defineProperty(D,z,Q)}:function(D,F,G,z){if(z===void 0)z=G;D[z]=F[G]}),j=K&&K.__exportStar||function(D,F){for(var G in D)if(G!=="default"&&!Object.prototype.hasOwnProperty.call(F,G))d(F,D,G)};Object.defineProperty(K,"__esModule",{value:!0});K.Allow=K.MalformedJSON=K.PartialJSON=K.parseJSON=K.parse=void 0;var L=y();Object.defineProperty(K,"Allow",{enumerable:!0,get:function(){return L.Allow}});j(y(),K);class f extends Error{}K.PartialJSON=f;class b extends Error{}K.MalformedJSON=b;function h(D,F=L.Allow.ALL){if(typeof D!=="string")throw TypeError(`expecting str, got ${typeof D}`);if(!D.trim())throw Error(`${D} is empty`);return g(D.trim(),F)}K.parseJSON=h;var g=(D,F)=>{let G=D.length,z=0,Q=(H)=>{throw new f(`${H} at position ${z}`)},X=(H)=>{throw new b(`${H} at position ${z}`)},Y=()=>{if(W(),z>=G)Q("Unexpected end of input");if(D[z]==='"')return J();if(D[z]==="{")return c();if(D[z]==="[")return m();if(D.substring(z,z+4)==="null"||L.Allow.NULL&F&&G-z<4&&"null".startsWith(D.substring(z)))return z+=4,null;if(D.substring(z,z+4)==="true"||L.Allow.BOOL&F&&G-z<4&&"true".startsWith(D.substring(z)))return z+=4,!0;if(D.substring(z,z+5)==="false"||L.Allow.BOOL&F&&G-z<5&&"false".startsWith(D.substring(z)))return z+=5,!1;if(D.substring(z,z+8)==="Infinity"||L.Allow.INFINITY&F&&G-z<8&&"Infinity".startsWith(D.substring(z)))return z+=8,1/0;if(D.substring(z,z+9)==="-Infinity"||L.Allow._INFINITY&F&&1<G-z&&G-z<9&&"-Infinity".startsWith(D.substring(z)))return z+=9,-1/0;if(D.substring(z,z+3)==="NaN"||L.Allow.NAN&F&&G-z<3&&"NaN".startsWith(D.substring(z)))return z+=3,NaN;return w()},J=()=>{let H=z,U=!1;z++;while(z<G&&(D[z]!=='"'||U&&D[z-1]==="\\"))U=D[z]==="\\"?!U:!1,z++;if(D.charAt(z)=='"')try{return JSON.parse(D.substring(H,++z-Number(U)))}catch(V){X(String(V))}else if(L.Allow.STR&F)try{return JSON.parse(D.substring(H,z-Number(U))+'"')}catch(V){return JSON.parse(D.substring(H,D.lastIndexOf("\\"))+'"')}Q("Unterminated string literal")},c=()=>{z++,W();let H={};try{while(D[z]!=="}"){if(W(),z>=G&&L.Allow.OBJ&F)return H;let U=J();W(),z++;try{let V=Y();H[U]=V}catch(V){if(L.Allow.OBJ&F)return H;else throw V}if(W(),D[z]===",")z++}}catch(U){if(L.Allow.OBJ&F)return H;else Q("Expected '}' at end of object")}return z++,H},m=()=>{z++;let H=[];try{while(D[z]!=="]")if(H.push(Y()),W(),D[z]===",")z++}catch(U){if(L.Allow.ARR&F)return H;Q("Expected ']' at end of array")}return z++,H},w=()=>{if(z===0){if(D==="-")X("Not sure what '-' is");try{return JSON.parse(D)}catch(U){if(L.Allow.NUM&F)try{return JSON.parse(D.substring(0,D.lastIndexOf("e")))}catch(V){}X(String(U))}}let H=z;if(D[z]==="-")z++;while(D[z]&&",]}".indexOf(D[z])===-1)z++;if(z==G&&!(L.Allow.NUM&F))Q("Unterminated number literal");try{return JSON.parse(D.substring(H,z))}catch(U){if(D.substring(H,z)==="-")Q("Not sure what '-' is");try{return JSON.parse(D.substring(H,D.lastIndexOf("e")))}catch(V){X(String(V))}}},W=()=>{while(z<G&&`
3
3
  \r `.includes(D[z]))z++};return Y()},S=h;K.parse=S});
4
- export{x as Fj};
4
+ export{x as vk};
@@ -1,4 +1,4 @@
1
- import{$f as x0,bg as TJ,cg as PZ,og as N5}from"./chunk-nwtb6dt1.js";import{Zj as TZ}from"./chunk-kbzm1pwx.js";var FQ=TZ(x0(),1);var b5=({onResize:J,className:Q=""})=>{let[Z,$]=FQ.useState(!1),q=FQ.useRef(0);FQ.useEffect(()=>{if(!Z)return;let K=(B)=>{let N=B.clientX-q.current;q.current=B.clientX,J(N)},X=()=>{$(!1),document.body.style.cursor=""};return document.addEventListener("mousemove",K),document.addEventListener("mouseup",X),document.body.style.cursor="col-resize",()=>{document.removeEventListener("mousemove",K),document.removeEventListener("mouseup",X),document.body.style.cursor=""}},[Z,J]);let Y=(K)=>{K.preventDefault(),K.stopPropagation(),$(!0),q.current=K.clientX},H=()=>TJ("div",{className:"absolute inset-y-0 -left-4 -right-4 z-20 cursor-col-resize touch-none"});return PZ("div",{className:`group relative z-20 flex h-full w-[2px] cursor-col-resize items-center justify-center bg-border transition-all hover:bg-transparent ${Q}`,onMouseDown:Y,children:[TJ(H,{}),TJ("div",{className:`absolute inset-y-0 w-[2px] transition-all duration-300 ease-out
1
+ import{Rg as x0,Tg as TJ,Ug as PZ,eh as N5}from"./chunk-wf4d1anc.js";import{Pk as TZ}from"./chunk-976v5s8y.js";var FQ=TZ(x0(),1);var b5=({onResize:J,className:Q=""})=>{let[Z,$]=FQ.useState(!1),q=FQ.useRef(0);FQ.useEffect(()=>{if(!Z)return;let K=(B)=>{let N=B.clientX-q.current;q.current=B.clientX,J(N)},X=()=>{$(!1),document.body.style.cursor=""};return document.addEventListener("mousemove",K),document.addEventListener("mouseup",X),document.body.style.cursor="col-resize",()=>{document.removeEventListener("mousemove",K),document.removeEventListener("mouseup",X),document.body.style.cursor=""}},[Z,J]);let Y=(K)=>{K.preventDefault(),K.stopPropagation(),$(!0),q.current=K.clientX},H=()=>TJ("div",{className:"absolute inset-y-0 -left-4 -right-4 z-20 cursor-col-resize touch-none"});return PZ("div",{className:`group relative z-20 flex h-full w-[2px] cursor-col-resize items-center justify-center bg-border transition-all hover:bg-transparent ${Q}`,onMouseDown:Y,children:[TJ(H,{}),TJ("div",{className:`absolute inset-y-0 w-[2px] transition-all duration-300 ease-out
2
2
  ${Z?"bg-blue-600 shadow-[0_0_15px_rgba(37,99,235,0.6)] opacity-100":"bg-blue-400 opacity-0 group-hover:opacity-100 group-hover:shadow-[0_0_8px_rgba(96,165,250,0.5)]"}
3
3
  `}),TJ("div",{className:`absolute top-1/2 left-1/2 h-10 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-blue-600 transition-all duration-300 ease-out
4
4
  ${Z?"opacity-100 scale-100 shadow-[0_0_10px_rgba(37,99,235,0.5)]":"opacity-0 scale-75 group-hover:opacity-100 group-hover:scale-100"}`})]})};var e$=Symbol.for("preact-signals");function xZ(){if(!(PJ>1)){var J,Q=!1;(function(){var q=SZ;SZ=void 0;while(q!==void 0){if(q.S.v===q.v)q.S.i=q.i;q=q.o}})();while(cQ!==void 0){var Z=cQ;cQ=void 0,EZ++;while(Z!==void 0){var $=Z.u;if(Z.u=void 0,Z.f&=-3,!(8&Z.f)&&_9(Z))try{Z.c()}catch(q){if(!Q)J=q,Q=!0}Z=$}}if(EZ=0,PJ--,Q)throw J}else PJ--}function JJ(J){if(PJ>0)return J();h0=++Jq,PJ++;try{return J()}finally{xZ()}}var k=void 0;function C(J){var Q=k;k=void 0;try{return J()}finally{k=Q}}var p9,cQ=void 0,PJ=0,EZ=0,Jq=0,h0=0,SZ=void 0,kZ=0;function d9(J){if(k!==void 0){var Q=J.n;if(Q===void 0||Q.t!==k){if(Q={i:0,S:J,p:k.s,n:void 0,t:k,e:void 0,x:void 0,r:Q},k.s!==void 0)k.s.n=Q;if(k.s=Q,J.n=Q,32&k.f)J.S(Q);return Q}else if(Q.i===-1){if(Q.i=0,Q.n!==void 0){if(Q.n.p=Q.p,Q.p!==void 0)Q.p.n=Q.n;Q.p=k.s,Q.n=void 0,k.s.n=Q,k.s=Q}return Q}}}function r(J,Q){this.v=J,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=Q==null?void 0:Q.watched,this.Z=Q==null?void 0:Q.unwatched,this.name=Q==null?void 0:Q.name}r.prototype.brand=e$;r.prototype.h=function(){return!0};r.prototype.S=function(J){var Q=this,Z=this.t;if(Z!==J&&J.e===void 0)if(J.x=Z,this.t=J,Z!==void 0)Z.e=J;else C(function(){var $;($=Q.W)==null||$.call(Q)})};r.prototype.U=function(J){var Q=this;if(this.t!==void 0){var{e:Z,x:$}=J;if(Z!==void 0)Z.x=$,J.e=void 0;if($!==void 0)$.e=Z,J.x=void 0;if(J===this.t){if(this.t=$,$===void 0)C(function(){var q;(q=Q.Z)==null||q.call(Q)})}}};r.prototype.subscribe=function(J){var Q=this;return o(function(){var Z=Q.value,$=k;k=void 0;try{J(Z)}finally{k=$}},{name:"sub"})};r.prototype.valueOf=function(){return this.value};r.prototype.toString=function(){return this.value+""};r.prototype.toJSON=function(){return this.value};r.prototype.peek=function(){var J=this;return C(function(){return J.value})};Object.defineProperty(r.prototype,"value",{get:function(){var J=d9(this);if(J!==void 0)J.i=this.i;return this.v},set:function(J){if(J!==this.v){if(EZ>100)throw Error("Cycle detected");(function(Z){if(PJ!==0&&EZ===0){if(Z.l!==h0)Z.l=h0,SZ={S:Z,v:Z.v,i:Z.i,o:SZ}}})(this),this.v=J,this.i++,kZ++,PJ++;try{for(var Q=this.t;Q!==void 0;Q=Q.x)Q.t.N()}finally{xZ()}}}});function IJ(J,Q){return new r(J,Q)}function _9(J){for(var Q=J.s;Q!==void 0;Q=Q.n)if(Q.S.i!==Q.i||!Q.S.h()||Q.S.i!==Q.i)return!0;return!1}function c9(J){for(var Q=J.s;Q!==void 0;Q=Q.n){var Z=Q.S.n;if(Z!==void 0)Q.r=Z;if(Q.S.n=Q,Q.i=-1,Q.n===void 0){J.s=Q;break}}}function l9(J){var Q=J.s,Z=void 0;while(Q!==void 0){var $=Q.p;if(Q.i===-1){if(Q.S.U(Q),$!==void 0)$.n=Q.n;if(Q.n!==void 0)Q.n.p=$}else Z=Q;if(Q.S.n=Q.r,Q.r!==void 0)Q.r=void 0;Q=$}J.s=Z}function sJ(J,Q){r.call(this,void 0),this.x=J,this.s=void 0,this.g=kZ-1,this.f=4,this.W=Q==null?void 0:Q.watched,this.Z=Q==null?void 0:Q.unwatched,this.name=Q==null?void 0:Q.name}sJ.prototype=new r;sJ.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32)return!0;if(this.f&=-5,this.g===kZ)return!0;if(this.g=kZ,this.f|=1,this.i>0&&!_9(this))return this.f&=-2,!0;var J=k;try{c9(this),k=this;var Q=this.x();if(16&this.f||this.v!==Q||this.i===0)this.v=Q,this.f&=-17,this.i++}catch(Z){this.v=Z,this.f|=16,this.i++}return k=J,l9(this),this.f&=-2,!0};sJ.prototype.S=function(J){if(this.t===void 0){this.f|=36;for(var Q=this.s;Q!==void 0;Q=Q.n)Q.S.S(Q)}r.prototype.S.call(this,J)};sJ.prototype.U=function(J){if(this.t!==void 0){if(r.prototype.U.call(this,J),this.t===void 0){this.f&=-33;for(var Q=this.s;Q!==void 0;Q=Q.n)Q.S.U(Q)}}};sJ.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var J=this.t;J!==void 0;J=J.x)J.t.N()}};Object.defineProperty(sJ.prototype,"value",{get:function(){if(1&this.f)throw Error("Cycle detected");var J=d9(this);if(this.h(),J!==void 0)J.i=this.i;if(16&this.f)throw this.v;return this.v}});function y0(J,Q){return new sJ(J,Q)}function s9(J){var Q=J.m;if(J.m=void 0,typeof Q=="function"){PJ++;var Z=k;k=void 0;try{Q()}catch($){throw J.f&=-2,J.f|=8,f0(J),$}finally{k=Z,xZ()}}}function f0(J){for(var Q=J.s;Q!==void 0;Q=Q.n)Q.S.U(Q);J.x=void 0,J.s=void 0,s9(J)}function Qq(J){if(k!==this)throw Error("Out-of-order effect");if(l9(this),k=J,this.f&=-2,8&this.f)f0(this);xZ()}function zQ(J,Q){if(this.x=J,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=Q==null?void 0:Q.name,p9)p9.push(this)}zQ.prototype.c=function(){var J=this.S();try{if(8&this.f)return;if(this.x===void 0)return;var Q=this.x();if(typeof Q=="function")this.m=Q}finally{J()}};zQ.prototype.S=function(){if(1&this.f)throw Error("Cycle detected");this.f|=1,this.f&=-9,s9(this),c9(this),PJ++;var J=k;return k=this,Qq.bind(this,J)};zQ.prototype.N=function(){if(!(2&this.f))this.f|=2,this.u=cQ,cQ=this};zQ.prototype.d=function(){if(this.f|=8,!(1&this.f))f0(this)};zQ.prototype.dispose=function(){this.d()};function o(J,Q){var Z=new zQ(J,Q);try{Z.c()}catch(q){throw Z.d(),q}var $=Z.d.bind(Z);return $[Symbol.dispose]=$,$}var{create:Zq,defineProperty:s0,defineProperties:$q,getOwnPropertyDescriptor:qq,getOwnPropertyDescriptors:Yq,getOwnPropertySymbols:o9}=Object,Kq=Object.prototype.hasOwnProperty,Hq=Object.prototype.propertyIsEnumerable,n9=(J,Q)=>(Q=Symbol[J])?Q:Symbol.for("Symbol."+J),MQ=(J)=>{throw TypeError(J)},m0=(J,Q,Z)=>(Q in J)?s0(J,Q,{enumerable:!0,configurable:!0,writable:!0,value:Z}):J[Q]=Z,Xq=(J,Q)=>{for(var Z in Q||(Q={}))if(Kq.call(Q,Z))m0(J,Z,Q[Z]);if(o9){for(var Z of o9(Q))if(Hq.call(Q,Z))m0(J,Z,Q[Z])}return J},Wq=(J,Q)=>$q(J,Yq(Q)),i9=(J,Q)=>s0(J,"name",{value:Q,configurable:!0}),Bq=(J)=>{var Q;return[,,,Zq((Q=J==null?void 0:J[n9("metadata")])!=null?Q:null)]},a9=["class","method","getter","setter","accessor","field","value","get","set"],lQ=(J)=>J!==void 0&&typeof J!=="function"?MQ("Function expected"):J,Nq=(J,Q,Z,$,q)=>({kind:a9[J],name:Q,metadata:$,addInitializer:(Y)=>Z._?MQ("Already initialized"):q.push(lQ(Y||null))}),r9=(J,Q)=>m0(Q,n9("metadata"),J[3]),oJ=(J,Q,Z,$)=>{for(var q=0,Y=J[Q>>1],H=Y&&Y.length;q<H;q++)Q&1?Y[q].call(Z):$=Y[q].call(Z,$);return $},wQ=(J,Q,Z,$,q,Y)=>{var H,K,X,B,N,W=Q&7,G=!!(Q&8),L=!!(Q&16),F=W>3?J.length+1:W?G?1:2:0,z=a9[W+5],A=W>3&&(J[F-1]=[]),I=J[F]||(J[F]=[]),U=W&&(!L&&!G&&(q=q.prototype),W<5&&(W>3||!L)&&qq(W<4?q:{get[Z](){return LJ(this,Y)},set[Z](V){return vJ(this,Y,V)}},Z));W?L&&W<4&&i9(Y,(W>2?"set ":W>1?"get ":"")+Z):i9(q,Z);for(var M=$.length-1;M>=0;M--){if(B=Nq(W,Z,X={},J[3],I),W){if(B.static=G,B.private=L,N=B.access={has:L?(V)=>Uq(q,V):(V)=>(Z in V)},W^3)N.get=L?(V)=>(W^1?LJ:Lq)(V,q,W^4?Y:U.get):(V)=>V[Z];if(W>2)N.set=L?(V,w)=>vJ(V,q,w,W^4?Y:U.set):(V,w)=>V[Z]=w}if(K=(0,$[M])(W?W<4?L?Y:U[z]:W>4?void 0:{get:U.get,set:U.set}:q,B),X._=1,W^4||K===void 0)lQ(K)&&(W>4?A.unshift(K):W?L?Y=K:U[z]=K:q=K);else if(typeof K!=="object"||K===null)MQ("Object expected");else lQ(H=K.get)&&(U.get=H),lQ(H=K.set)&&(U.set=H),lQ(H=K.init)&&A.unshift(H)}return W||r9(J,q),U&&s0(q,Z,U),L?W^4?Y:U:q},o0=(J,Q,Z)=>Q.has(J)||MQ("Cannot "+Z),Uq=(J,Q)=>Object(Q)!==Q?MQ('Cannot use the "in" operator on this value'):J.has(Q),LJ=(J,Q,Z)=>(o0(J,Q,"read from private field"),Z?Z.call(J):Q.get(J)),sQ=(J,Q,Z)=>Q.has(J)?MQ("Cannot add the same private member more than once"):Q instanceof WeakSet?Q.add(J):Q.set(J,Z),vJ=(J,Q,Z,$)=>(o0(J,Q,"write to private field"),$?$.call(J,Z):Q.set(J,Z),Z),Lq=(J,Q,Z)=>(o0(J,Q,"access private method"),Z);function AQ(J,Q){if(Q){let Z;return y0(()=>{let $=J();if($&&Z&&Q(Z,$))return Z;return Z=$,$})}return y0(J)}function EJ(J,Q){if(Object.is(J,Q))return!0;if(J===null||Q===null)return!1;if(typeof J==="function"&&typeof Q==="function")return J===Q;if(J instanceof Set&&Q instanceof Set){if(J.size!==Q.size)return!1;for(let Z of J)if(!Q.has(Z))return!1;return!0}if(Array.isArray(J)){if(!Array.isArray(Q)||J.length!==Q.length)return!1;return!J.some(($,q)=>!EJ($,Q[q]))}if(typeof J==="object"&&typeof Q==="object"){let Z=Object.keys(J),$=Object.keys(Q);if(Z.length!==$.length)return!1;return!Z.some((Y)=>!EJ(J[Y],Q[Y]))}return!1}function T({get:J},Q){return{init(Z){return IJ(Z)},get(){return J.call(this).value},set(Z){let $=J.call(this);if($.peek()===Z)return;$.value=Z}}}function h(J,Q){let Z=new WeakMap;return function(){let $=Z.get(this);if(!$)$=AQ(J.bind(this)),Z.set(this,$);return $.value}}function v0(J=!0){return function(Q,Z){Z.addInitializer(function(){let $=Z.kind==="field"?this:Z.static?this:Object.getPrototypeOf(this),q=Object.getOwnPropertyDescriptor($,Z.name);if(q)Object.defineProperty($,Z.name,Wq(Xq({},q),{enumerable:J}))})}}function nJ(...J){let Q=J.map((Z)=>o(Z));return()=>Q.forEach((Z)=>Z())}var t9,e9,J8,Q8,Z8,$8,QJ,i0,b0,p0,d0,t,n0,g0,q8,_0,a0,u0,c0,l0;$8=[T],Z8=[T],Q8=[T],J8=[v0()],e9=[v0()],t9=[v0()];var jJ=class{constructor(J,Q=Object.is){this.defaultValue=J,this.equals=Q,oJ(QJ,5,this),sQ(this,t),sQ(this,i0,oJ(QJ,8,this)),oJ(QJ,11,this),sQ(this,n0,oJ(QJ,12,this)),oJ(QJ,15,this),sQ(this,a0,oJ(QJ,16,this)),oJ(QJ,19,this),this.reset=this.reset.bind(this),this.reset()}get current(){return LJ(this,t,c0)}get initial(){return LJ(this,t,p0)}get previous(){return LJ(this,t,q8)}set current(J){let Q=C(()=>LJ(this,t,c0));if(J&&Q&&this.equals(Q,J))return;JJ(()=>{if(!LJ(this,t,p0))vJ(this,t,J,d0);vJ(this,t,Q,_0),vJ(this,t,J,l0)})}reset(J=this.defaultValue){JJ(()=>{vJ(this,t,void 0,_0),vJ(this,t,J,d0),vJ(this,t,J,l0)})}};QJ=Bq(null);i0=new WeakMap;t=new WeakSet;n0=new WeakMap;a0=new WeakMap;b0=wQ(QJ,20,"#initial",$8,t,i0),p0=b0.get,d0=b0.set;g0=wQ(QJ,20,"#previous",Z8,t,n0),q8=g0.get,_0=g0.set;u0=wQ(QJ,20,"#current",Q8,t,a0),c0=u0.get,l0=u0.set;wQ(QJ,2,"current",J8,jJ);wQ(QJ,2,"initial",e9,jJ);wQ(QJ,2,"previous",t9,jJ);r9(QJ,jJ);function hZ(J){return C(()=>{let Q={};for(let Z in J)Q[Z]=J[Z];return Q})}var iJ,o5=class{constructor(){sQ(this,iJ,new WeakMap)}get(J,Q){var Z;return J?(Z=LJ(this,iJ).get(J))==null?void 0:Z.get(Q):void 0}set(J,Q,Z){var $;if(!J)return;if(!LJ(this,iJ).has(J))LJ(this,iJ).set(J,new Map);return($=LJ(this,iJ).get(J))==null?void 0:$.set(Q,Z)}clear(J){var Q;return J?(Q=LJ(this,iJ).get(J))==null?void 0:Q.clear():void 0}};iJ=new WeakMap;var{create:Gq,defineProperty:Q1,getOwnPropertyDescriptor:Vq,getOwnPropertySymbols:Y8}=Object,Fq=Object.prototype.hasOwnProperty,zq=Object.prototype.propertyIsEnumerable,X8=(J,Q)=>(Q=Symbol[J])?Q:Symbol.for("Symbol."+J),IQ=(J)=>{throw TypeError(J)},K8=Math.pow,r0=(J,Q,Z)=>(Q in J)?Q1(J,Q,{enumerable:!0,configurable:!0,writable:!0,value:Z}):J[Q]=Z,Mq=(J,Q)=>{for(var Z in Q||(Q={}))if(Fq.call(Q,Z))r0(J,Z,Q[Z]);if(Y8){for(var Z of Y8(Q))if(zq.call(Q,Z))r0(J,Z,Q[Z])}return J},H8=(J,Q)=>Q1(J,"name",{value:Q,configurable:!0}),wq=(J)=>{var Q;return[,,,Gq((Q=J==null?void 0:J[X8("metadata")])!=null?Q:null)]},W8=["class","method","getter","setter","accessor","field","value","get","set"],oQ=(J)=>J!==void 0&&typeof J!=="function"?IQ("Function expected"):J,Aq=(J,Q,Z,$,q)=>({kind:W8[J],name:Q,metadata:$,addInitializer:(Y)=>Z._?IQ("Already initialized"):q.push(oQ(Y||null))}),B8=(J,Q)=>r0(Q,X8("metadata"),J[3]),Iq=(J,Q,Z,$)=>{for(var q=0,Y=J[Q>>1],H=Y&&Y.length;q<H;q++)Q&1?Y[q].call(Z):$=Y[q].call(Z,$);return $},N8=(J,Q,Z,$,q,Y)=>{var H,K,X,B,N,W=Q&7,G=!!(Q&8),L=!!(Q&16),F=W>3?J.length+1:W?G?1:2:0,z=W8[W+5],A=W>3&&(J[F-1]=[]),I=J[F]||(J[F]=[]),U=W&&(!L&&!G&&(q=q.prototype),W<5&&(W>3||!L)&&Vq(W<4?q:{get[Z](){return t0(this,Y)},set[Z](V){return e0(this,Y,V)}},Z));W?L&&W<4&&H8(Y,(W>2?"set ":W>1?"get ":"")+Z):H8(q,Z);for(var M=$.length-1;M>=0;M--){if(B=Aq(W,Z,X={},J[3],I),W){if(B.static=G,B.private=L,N=B.access={has:L?(V)=>jq(q,V):(V)=>(Z in V)},W^3)N.get=L?(V)=>(W^1?t0:Rq)(V,q,W^4?Y:U.get):(V)=>V[Z];if(W>2)N.set=L?(V,w)=>e0(V,q,w,W^4?Y:U.set):(V,w)=>V[Z]=w}if(K=(0,$[M])(W?W<4?L?Y:U[z]:W>4?void 0:{get:U.get,set:U.set}:q,B),X._=1,W^4||K===void 0)oQ(K)&&(W>4?A.unshift(K):W?L?Y=K:U[z]=K:q=K);else if(typeof K!=="object"||K===null)IQ("Object expected");else oQ(H=K.get)&&(U.get=H),oQ(H=K.set)&&(U.set=H),oQ(H=K.init)&&A.unshift(H)}return W||B8(J,q),U&&Q1(q,Z,U),L?W^4?Y:U:q},Z1=(J,Q,Z)=>Q.has(J)||IQ("Cannot "+Z),jq=(J,Q)=>Object(Q)!==Q?IQ('Cannot use the "in" operator on this value'):J.has(Q),t0=(J,Q,Z)=>(Z1(J,Q,"read from private field"),Z?Z.call(J):Q.get(J)),Oq=(J,Q,Z)=>Q.has(J)?IQ("Cannot add the same private member more than once"):Q instanceof WeakSet?Q.add(J):Q.set(J,Z),e0=(J,Q,Z,$)=>(Z1(J,Q,"write to private field"),$?$.call(J,Z):Q.set(J,Z),Z),Rq=(J,Q,Z)=>(Z1(J,Q,"access private method"),Z),e=class J{constructor(Q,Z){this.x=Q,this.y=Z}static delta(Q,Z){return new J(Q.x-Z.x,Q.y-Z.y)}static distance(Q,Z){return Math.hypot(Q.x-Z.x,Q.y-Z.y)}static equals(Q,Z){return Q.x===Z.x&&Q.y===Z.y}static from({x:Q,y:Z}){return new J(Q,Z)}},XJ=class J{constructor(Q,Z,$,q){this.left=Q,this.top=Z,this.width=$,this.height=q,this.scale={x:1,y:1}}get inverseScale(){return{x:1/this.scale.x,y:1/this.scale.y}}translate(Q,Z){let{top:$,left:q,width:Y,height:H,scale:K}=this,X=new J(q+Q,$+Z,Y,H);return X.scale=Mq({},K),X}get boundingRectangle(){let{width:Q,height:Z,left:$,top:q,right:Y,bottom:H}=this;return{width:Q,height:Z,left:$,top:q,right:Y,bottom:H}}get center(){let{left:Q,top:Z,right:$,bottom:q}=this;return new e((Q+$)/2,(Z+q)/2)}get area(){let{width:Q,height:Z}=this;return Q*Z}equals(Q){if(!(Q instanceof J))return!1;let{left:Z,top:$,width:q,height:Y}=this;return Z===Q.left&&$===Q.top&&q===Q.width&&Y===Q.height}containsPoint(Q){let{top:Z,left:$,bottom:q,right:Y}=this;return Z<=Q.y&&Q.y<=q&&$<=Q.x&&Q.x<=Y}intersectionArea(Q){if(Q instanceof J)return Dq(this,Q);return 0}intersectionRatio(Q){let{area:Z}=this,$=this.intersectionArea(Q);return $/(Q.area+Z-$)}get bottom(){let{top:Q,height:Z}=this;return Q+Z}get right(){let{left:Q,width:Z}=this;return Q+Z}get aspectRatio(){let{width:Q,height:Z}=this;return Q/Z}get corners(){return[{x:this.left,y:this.top},{x:this.right,y:this.top},{x:this.left,y:this.bottom},{x:this.right,y:this.bottom}]}static from({top:Q,left:Z,width:$,height:q}){return new J(Z,Q,$,q)}static delta(Q,Z,$={x:"center",y:"center"}){let q=(Y,H)=>{let K=$[H],X=H==="x"?Y.left:Y.top,B=H==="x"?Y.width:Y.height;if(K=="start")return X;if(K=="end")return X+B;return X+B/2};return e.delta({x:q(Q,"x"),y:q(Q,"y")},{x:q(Z,"x"),y:q(Z,"y")})}static intersectionRatio(Q,Z){return J.from(Q).intersectionRatio(J.from(Z))}};function Dq(J,Q){let Z=Math.max(Q.top,J.top),$=Math.max(Q.left,J.left),q=Math.min(Q.left+Q.width,J.left+J.width),Y=Math.min(Q.top+Q.height,J.top+J.height),H=q-$,K=Y-Z;if($<q&&Z<Y)return H*K;return 0}var U8,L8,J1,yZ,iQ,nQ=class extends(J1=jJ,L8=[h],U8=[h],J1){constructor(J){let Q=e.from(J);super(Q,(Z,$)=>e.equals(Z,$));Iq(iQ,5,this),Oq(this,yZ,0),this.velocity={x:0,y:0}}get delta(){return e.delta(this.current,this.initial)}get direction(){let{current:J,previous:Q}=this;if(!Q)return null;let Z={x:J.x-Q.x,y:J.y-Q.y};if(!Z.x&&!Z.y)return null;if(Math.abs(Z.x)>Math.abs(Z.y))return Z.x>0?"right":"left";return Z.y>0?"down":"up"}get current(){return super.current}set current(J){let{current:Q}=this,Z=e.from(J),$={x:Z.x-Q.x,y:Z.y-Q.y},q=Date.now(),Y=q-t0(this,yZ),H=(K)=>Math.round(K/Y*100);JJ(()=>{e0(this,yZ,q),this.velocity={x:H($.x),y:H($.y)},super.current=Z})}reset(J=this.defaultValue){super.reset(e.from(J)),this.velocity={x:0,y:0}}};iQ=wq(J1);yZ=new WeakMap;N8(iQ,2,"delta",L8,nQ);N8(iQ,2,"direction",U8,nQ);B8(iQ,nQ);function fZ({x:J,y:Q},Z){let $=Math.abs(J),q=Math.abs(Q);if(typeof Z==="number")return Math.sqrt(K8($,2)+K8(q,2))>Z;if("x"in Z&&"y"in Z)return $>Z.x&&q>Z.y;if("x"in Z)return $>Z.x;if("y"in Z)return q>Z.y;return!1}var G8=((J)=>{return J.Horizontal="x",J.Vertical="y",J})(G8||{}),$1=Object.values(G8);var{create:Cq,defineProperty:X1,defineProperties:Tq,getOwnPropertyDescriptor:Pq,getOwnPropertyDescriptors:Eq,getOwnPropertySymbols:dZ}=Object,M8=Object.prototype.hasOwnProperty,w8=Object.prototype.propertyIsEnumerable,A8=(J,Q)=>(Q=Symbol[J])?Q:Symbol.for("Symbol."+J),TQ=(J)=>{throw TypeError(J)},Y1=(J,Q,Z)=>(Q in J)?X1(J,Q,{enumerable:!0,configurable:!0,writable:!0,value:Z}):J[Q]=Z,W1=(J,Q)=>{for(var Z in Q||(Q={}))if(M8.call(Q,Z))Y1(J,Z,Q[Z]);if(dZ){for(var Z of dZ(Q))if(w8.call(Q,Z))Y1(J,Z,Q[Z])}return J},B1=(J,Q)=>Tq(J,Eq(Q)),V8=(J,Q)=>X1(J,"name",{value:Q,configurable:!0}),I8=(J,Q)=>{var Z={};for(var $ in J)if(M8.call(J,$)&&Q.indexOf($)<0)Z[$]=J[$];if(J!=null&&dZ){for(var $ of dZ(J))if(Q.indexOf($)<0&&w8.call(J,$))Z[$]=J[$]}return Z},PQ=(J)=>{var Q;return[,,,Cq((Q=J==null?void 0:J[A8("metadata")])!=null?Q:null)]},j8=["class","method","getter","setter","accessor","field","value","get","set"],aQ=(J)=>J!==void 0&&typeof J!=="function"?TQ("Function expected"):J,Sq=(J,Q,Z,$,q)=>({kind:j8[J],name:Q,metadata:$,addInitializer:(Y)=>Z._?TQ("Already initialized"):q.push(aQ(Y||null))}),rJ=(J,Q)=>Y1(Q,A8("metadata"),J[3]),O=(J,Q,Z,$)=>{for(var q=0,Y=J[Q>>1],H=Y&&Y.length;q<H;q++)Q&1?Y[q].call(Z):$=Y[q].call(Z,$);return $},P=(J,Q,Z,$,q,Y)=>{var H,K,X,B,N,W=Q&7,G=!!(Q&8),L=!!(Q&16),F=W>3?J.length+1:W?G?1:2:0,z=j8[W+5],A=W>3&&(J[F-1]=[]),I=J[F]||(J[F]=[]),U=W&&(!L&&!G&&(q=q.prototype),W<5&&(W>3||!L)&&Pq(W<4?q:{get[Z](){return u(this,Y)},set[Z](V){return WJ(this,Y,V)}},Z));W?L&&W<4&&V8(Y,(W>2?"set ":W>1?"get ":"")+Z):V8(q,Z);for(var M=$.length-1;M>=0;M--){if(B=Sq(W,Z,X={},J[3],I),W){if(B.static=G,B.private=L,N=B.access={has:L?(V)=>kq(q,V):(V)=>(Z in V)},W^3)N.get=L?(V)=>(W^1?u:O8)(V,q,W^4?Y:U.get):(V)=>V[Z];if(W>2)N.set=L?(V,w)=>WJ(V,q,w,W^4?Y:U.set):(V,w)=>V[Z]=w}if(K=(0,$[M])(W?W<4?L?Y:U[z]:W>4?void 0:{get:U.get,set:U.set}:q,B),X._=1,W^4||K===void 0)aQ(K)&&(W>4?A.unshift(K):W?L?Y=K:U[z]=K:q=K);else if(typeof K!=="object"||K===null)TQ("Object expected");else aQ(H=K.get)&&(U.get=H),aQ(H=K.set)&&(U.set=H),aQ(H=K.init)&&A.unshift(H)}return W||rJ(J,q),U&&X1(q,Z,U),L?W^4?Y:U:q},N1=(J,Q,Z)=>Q.has(J)||TQ("Cannot "+Z),kq=(J,Q)=>Object(Q)!==Q?TQ('Cannot use the "in" operator on this value'):J.has(Q),u=(J,Q,Z)=>(N1(J,Q,"read from private field"),Z?Z.call(J):Q.get(J)),E=(J,Q,Z)=>Q.has(J)?TQ("Cannot add the same private member more than once"):Q instanceof WeakSet?Q.add(J):Q.set(J,Z),WJ=(J,Q,Z,$)=>(N1(J,Q,"write to private field"),$?$.call(J,Z):Q.set(J,Z),Z),O8=(J,Q,Z)=>(N1(J,Q,"access private method"),Z);function R8(J,Q){return{plugin:J,options:Q}}function EQ(J){return(Q)=>{return R8(J,Q)}}function CQ(J){if(typeof J==="function")return{plugin:J,options:void 0};return J}var D8,eQ,U1,bZ;D8=[T];var $J=class{constructor(J,Q){this.manager=J,this.options=Q,E(this,U1,O(eQ,8,this,!1)),O(eQ,11,this),E(this,bZ,new Set)}enable(){this.disabled=!1}disable(){this.disabled=!0}isDisabled(){return C(()=>{return this.disabled})}configure(J){this.options=J}registerEffect(J){let Q=o(J.bind(this));return u(this,bZ).add(Q),Q}destroy(){u(this,bZ).forEach((J)=>J())}static configure(J){return R8(this,J)}};eQ=PQ(null);U1=new WeakMap;bZ=new WeakMap;P(eQ,4,"disabled",D8,$J,U1);rJ(eQ,$J);var SQ=class extends $J{},gZ,q1=class{constructor(J){this.manager=J,this.instances=new Map,E(this,gZ,[])}get values(){return Array.from(this.instances.values())}set values(J){let Q=J.map(CQ).reduce(($,q)=>{let Y=$.find(({plugin:H})=>H===q.plugin);if(Y)return Y.options=q.options,$;return[...$,q]},[]),Z=Q.map(({plugin:$})=>$);for(let $ of u(this,gZ))if(!Z.includes($)){if($.prototype instanceof SQ)continue;this.unregister($)}for(let{plugin:$,options:q}of Q)this.register($,q);WJ(this,gZ,Z)}get(J){return this.instances.get(J)}register(J,Q){let Z=this.instances.get(J);if(Z){if(Z.options!==Q)Z.options=Q;return Z}let $=new J(this.manager,Q);return this.instances.set(J,$),$}unregister(J){let Q=this.instances.get(J);if(Q)Q.destroy(),this.instances.delete(J)}destroy(){for(let J of this.instances.values())J.destroy();this.instances.clear()}};gZ=new WeakMap;function xq(J,Q){if(J.priority===Q.priority){if(J.type===Q.type)return Q.value-J.value;return Q.type-J.type}return Q.priority-J.priority}var vZ=[],jQ,OQ,hq=class extends $J{constructor(J){super(J);E(this,jQ),E(this,OQ),this.computeCollisions=this.computeCollisions.bind(this),WJ(this,OQ,IJ(vZ)),this.destroy=nJ(()=>{let Q=this.computeCollisions(),Z=C(()=>this.manager.dragOperation.position.current);if(Q!==vZ){let $=u(this,jQ);if(WJ(this,jQ,Z),$&&Z.x==$.x&&Z.y==$.y)return}else WJ(this,jQ,void 0);u(this,OQ).value=Q},()=>{let{dragOperation:Q}=this.manager;if(Q.status.initialized)this.forceUpdate()})}forceUpdate(J=!0){C(()=>{if(J)u(this,OQ).value=this.computeCollisions();else WJ(this,jQ,void 0)})}computeCollisions(J,Q){let{registry:Z,dragOperation:$}=this.manager,{source:q,shape:Y,status:H}=$;if(!H.initialized||!Y)return vZ;let K=[],X=[];for(let B of J!=null?J:Z.droppables){if(B.disabled)continue;if(q&&!B.accepts(q))continue;let N=Q!=null?Q:B.collisionDetector;if(!N)continue;X.push(B),B.shape;let W=C(()=>N({droppable:B,dragOperation:$}));if(W){if(B.collisionPriority!=null)W.priority=B.collisionPriority;K.push(W)}}if(X.length===0)return vZ;return K.sort(xq),K}get collisions(){return u(this,OQ).value}};jQ=new WeakMap;OQ=new WeakMap;var C8,T8,P8,L1,E8,zJ,G1,DQ,V1,F1;P8=[T],T8=[T],C8=[T];var SJ=class J{constructor(Q,Z){E(this,G1,O(zJ,8,this)),O(zJ,11,this),E(this,DQ),E(this,V1,O(zJ,12,this)),O(zJ,15,this),E(this,F1,O(zJ,16,this)),O(zJ,19,this);let{effects:$,id:q,data:Y={},disabled:H=!1,register:K=!0}=Q,X=q;if(WJ(this,DQ,IJ(q)),this.manager=Z,this.data=Y,this.disabled=H,this.effects=()=>{var B;return[()=>{let{id:N,manager:W}=this;if(N===X)return;return X=N,W==null||W.registry.register(this),()=>W==null?void 0:W.registry.unregister(this)},...(B=$==null?void 0:$())!=null?B:[]]},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this),this.destroy=this.destroy.bind(this),Z&&K)queueMicrotask(this.register)}get id(){var Q,Z;let $=u(this,DQ).value;return(Z=(Q=J.pendingIdChanges)==null?void 0:Q.get(this))!=null?Z:$}set id(Q){var Z,$;let q=($=(Z=J.pendingIdChanges)==null?void 0:Z.get(this))!=null?$:u(this,DQ).peek();if(Q===q)return;if(!J.pendingIdChanges)J.pendingIdChanges=new Map,queueMicrotask(()=>{var Y;return O8(Y=J,L1,E8).call(Y)});J.pendingIdChanges.set(this,Q)}register(){var Q;return(Q=this.manager)==null?void 0:Q.registry.register(this)}unregister(){var Q;(Q=this.manager)==null||Q.registry.unregister(this)}destroy(){var Q;(Q=this.manager)==null||Q.registry.unregister(this)}};zJ=PQ(null);L1=new WeakSet;E8=function(){let J=SJ.pendingIdChanges;if(SJ.pendingIdChanges=null,J)JJ(()=>{for(let[Q,Z]of J)u(Q,DQ).value=Z})};G1=new WeakMap;DQ=new WeakMap;V1=new WeakMap;F1=new WeakMap;P(zJ,4,"manager",P8,SJ,G1);P(zJ,4,"data",T8,SJ,V1);P(zJ,4,"disabled",C8,SJ,F1);E(SJ,L1);rJ(zJ,SJ);SJ.pendingIdChanges=null;var _Z=SJ,F8=class{constructor(){this.map=IJ(new Map),this.cleanupFunctions=new WeakMap,this.register=(J,Q)=>{let Z=this.map.peek(),$=Z.get(J),q=()=>this.unregister(J,Q);if($===Q)return q;if($){if($.id===J){let K=this.cleanupFunctions.get($);K==null||K(),this.cleanupFunctions.delete($)}}let Y=new Map(Z);for(let[K,X]of Z)if(X===Q&&K!==J){Y.delete(K);break}Y.set(J,Q),this.map.value=Y;let H=nJ(...Q.effects());return this.cleanupFunctions.set(Q,H),q},this.unregister=(J,Q)=>{let Z=this.map.peek();if(Z.get(J)!==Q)return;let $=this.cleanupFunctions.get(Q);$==null||$(),this.cleanupFunctions.delete(Q);let q=new Map(Z);q.delete(J),this.map.value=q}}[Symbol.iterator](){return this.map.peek().values()}get value(){return this.map.value.values()}has(J){return this.map.value.has(J)}get(J){return this.map.value.get(J)}destroy(){for(let J of this){let Q=this.cleanupFunctions.get(J);Q==null||Q(),J.destroy()}this.map.value=new Map}},S8,k8,x8,h8,y8,f8,K1,ZJ,z1,M1,w1,MJ=class extends(K1=_Z,f8=[T],y8=[T],h8=[T],x8=[h],k8=[h],S8=[h],K1){constructor(J,Q){var Z=J,{modifiers:$,type:q,sensors:Y,plugins:H,effects:K}=Z,X=I8(Z,["modifiers","type","sensors","plugins","effects"]);super(B1(W1({},X),{effects:()=>{var B;return[...(B=K==null?void 0:K())!=null?B:[],()=>{let{manager:N,plugins:W}=this;if(!N||!W)return;for(let G of W){let{plugin:L}=CQ(G);N.registry.plugins.register(L)}}]}}),Q);O(ZJ,5,this),E(this,z1,O(ZJ,8,this)),O(ZJ,11,this),E(this,M1,O(ZJ,12,this)),O(ZJ,15,this),E(this,w1,O(ZJ,16,this,this.isDragSource?"dragging":"idle")),O(ZJ,19,this),this.type=q,this.sensors=Y,this.modifiers=$,this.alignment=X.alignment,this.plugins=H}pluginConfig(J){if(!this.plugins)return;for(let Q of this.plugins){let Z=CQ(Q);if(Z.plugin===J)return Z.options}return}get isDropping(){return this.status==="dropping"&&this.isDragSource}get isDragging(){return this.status==="dragging"&&this.isDragSource}get isDragSource(){var J,Q;return((Q=(J=this.manager)==null?void 0:J.dragOperation.source)==null?void 0:Q.id)===this.id}};ZJ=PQ(K1);z1=new WeakMap;M1=new WeakMap;w1=new WeakMap;P(ZJ,4,"type",f8,MJ,z1);P(ZJ,4,"modifiers",y8,MJ,M1);P(ZJ,4,"status",h8,MJ,w1);P(ZJ,2,"isDropping",x8,MJ);P(ZJ,2,"isDragging",k8,MJ);P(ZJ,2,"isDragSource",S8,MJ);rJ(ZJ,MJ);var v8,b8,g8,u8,m8,p8,H1,c,A1,I1,j1,O1,R1,wJ=class extends(H1=_Z,p8=[T],m8=[T],u8=[T],g8=[T],b8=[T],v8=[h],H1){constructor(J,Q){var Z=J,{accept:$,collisionDetector:q,collisionPriority:Y,type:H}=Z,K=I8(Z,["accept","collisionDetector","collisionPriority","type"]);super(K,Q);O(c,5,this),E(this,A1,O(c,8,this)),O(c,11,this),E(this,I1,O(c,12,this)),O(c,15,this),E(this,j1,O(c,16,this)),O(c,19,this),E(this,O1,O(c,20,this)),O(c,23,this),E(this,R1,O(c,24,this)),O(c,27,this),this.accept=$,this.collisionDetector=q,this.collisionPriority=Y,this.type=H}accepts(J){let{accept:Q}=this;if(!Q)return!0;if(typeof Q==="function")return Q(J);if(!J.type)return!1;if(Array.isArray(Q))return Q.includes(J.type);return J.type===Q}get isDropTarget(){var J,Q;return((Q=(J=this.manager)==null?void 0:J.dragOperation.target)==null?void 0:Q.id)===this.id}};c=PQ(H1);A1=new WeakMap;I1=new WeakMap;j1=new WeakMap;O1=new WeakMap;R1=new WeakMap;P(c,4,"accept",p8,wJ,A1);P(c,4,"type",m8,wJ,I1);P(c,4,"collisionDetector",u8,wJ,j1);P(c,4,"collisionPriority",g8,wJ,O1);P(c,4,"shape",b8,wJ,R1);P(c,2,"isDropTarget",v8,wJ);rJ(c,wJ);var yq=class{constructor(){this.registry=new Map}addEventListener(J,Q){let{registry:Z}=this,$=new Set(Z.get(J));return $.add(Q),Z.set(J,$),()=>this.removeEventListener(J,Q)}removeEventListener(J,Q){let{registry:Z}=this,$=new Set(Z.get(J));$.delete(Q),Z.set(J,$)}dispatch(J,...Q){let{registry:Z}=this,$=Z.get(J);if(!$)return;for(let q of $)q(...Q)}},fq=class extends yq{constructor(J){super();this.manager=J}dispatch(J,Q){let Z=[Q,this.manager];super.dispatch(J,...Z)}};function uZ(J,Q=!0){let Z=!1;return B1(W1({},J),{cancelable:Q,get defaultPrevented(){return Z},preventDefault(){if(!Q)return;Z=!0}})}var vq=class extends SQ{constructor(J){super(J);let Q=($,q)=>$.map(({id:Y})=>Y).join("")===q.map(({id:Y})=>Y).join(""),Z=[];this.destroy=nJ(()=>{let{dragOperation:$,collisionObserver:q}=J;if($.status.initializing)Z=[],q.enable()},()=>{let{collisionObserver:$,monitor:q}=J,{collisions:Y}=$;if($.isDisabled())return;if(_Z.pendingIdChanges)return;let H=uZ({collisions:Y});if(q.dispatch("collision",H),H.defaultPrevented)return;if(Q(Y,Z))return;else Z=Y;let[K]=Y;C(()=>{var X;if((K==null?void 0:K.id)!==((X=J.dragOperation.target)==null?void 0:X.id))$.disable(),J.actions.setDropTarget(K==null?void 0:K.id).then(()=>{$.enable()})})})}},OJ=((J)=>{return J[J.Lowest=0]="Lowest",J[J.Low=1]="Low",J[J.Normal=2]="Normal",J[J.High=3]="High",J[J.Highest=4]="Highest",J})(OJ||{}),RJ=((J)=>{return J[J.Collision=0]="Collision",J[J.ShapeIntersection=1]="ShapeIntersection",J[J.PointerIntersection=2]="PointerIntersection",J})(RJ||{}),d8,_8,c8,l8,s8,o8,i8,GJ,D1;i8=[T],o8=[h],s8=[h],l8=[h],c8=[h],_8=[h],d8=[h];var kJ=class{constructor(){O(GJ,5,this),E(this,D1,O(GJ,8,this,"idle")),O(GJ,11,this)}get current(){return this.value}get idle(){return this.value==="idle"}get initializing(){return this.value==="initializing"}get initialized(){let{value:J}=this;return J!=="idle"&&J!=="initialization-pending"}get dragging(){return this.value==="dragging"}get dropped(){return this.value==="dropped"}set(J){this.value=J}};GJ=PQ(null);D1=new WeakMap;P(GJ,4,"value",i8,kJ,D1);P(GJ,2,"current",o8,kJ);P(GJ,2,"idle",s8,kJ);P(GJ,2,"initializing",l8,kJ);P(GJ,2,"initialized",c8,kJ);P(GJ,2,"dragging",_8,kJ);P(GJ,2,"dropped",d8,kJ);rJ(GJ,kJ);var bq=class{constructor(J){this.manager=J}setDragSource(J){let{dragOperation:Q}=this.manager;Q.sourceIdentifier=typeof J==="string"||typeof J==="number"?J:J.id}setDropTarget(J){return C(()=>{let{dragOperation:Q}=this.manager,Z=J!=null?J:null;if(Q.targetIdentifier===Z)return Promise.resolve(!1);Q.targetIdentifier=Z;let $=uZ({operation:Q.snapshot()});if(Q.status.dragging)this.manager.monitor.dispatch("dragover",$);return this.manager.renderer.rendering.then(()=>$.defaultPrevented)})}start(J){return C(()=>{let{dragOperation:Q}=this.manager;if(J.source!=null)this.setDragSource(J.source);if(!Q.source)throw Error("Cannot start a drag operation without a drag source");if(!Q.status.idle)throw Error("Cannot start a drag operation while another is active");let $=new AbortController,{event:q,coordinates:Y}=J;JJ(()=>{Q.status.set("initialization-pending"),Q.shape=null,Q.canceled=!1,Q.activatorEvent=q!=null?q:null,Q.position.reset(Y)});let H=uZ({operation:Q.snapshot()});if(this.manager.monitor.dispatch("beforedragstart",H),H.defaultPrevented)return Q.reset(),$.abort(),$;return Q.status.set("initializing"),Q.controller=$,this.manager.renderer.rendering.then(()=>{if($.signal.aborted)return;let{status:K}=Q;if(K.current!=="initializing")return;JJ(()=>{Q.status.set("dragging"),this.manager.monitor.dispatch("dragstart",{nativeEvent:q,operation:Q.snapshot(),cancelable:!1})})}),$})}move(J){return C(()=>{var Q,Z;let{dragOperation:$}=this.manager,{status:q,controller:Y}=$;if(!q.dragging||!Y||Y.signal.aborted)return;let H=uZ({nativeEvent:J.event,operation:$.snapshot(),by:J.by,to:J.to},(Q=J.cancelable)!=null?Q:!0);if((Z=J.propagate)!=null?Z:!0)this.manager.monitor.dispatch("dragmove",H);queueMicrotask(()=>{var K,X,B,N,W;if(H.defaultPrevented)return;let G=(W=J.to)!=null?W:{x:$.position.current.x+((X=(K=J.by)==null?void 0:K.x)!=null?X:0),y:$.position.current.y+((N=(B=J.by)==null?void 0:B.y)!=null?N:0)};$.position.current=G})})}stop(J={}){return C(()=>{var Q,Z;let{dragOperation:$}=this.manager,{controller:q}=$;if(!q||q.signal.aborted)return;let Y,H=()=>{let X={resume:()=>{},abort:()=>{}};return Y=new Promise((B,N)=>{X.resume=B,X.abort=N}),X};q.abort();let K=()=>{this.manager.renderer.rendering.then(()=>{$.status.set("dropped");let X=C(()=>{var N;return((N=$.source)==null?void 0:N.status)==="dropping"}),B=()=>{if($.controller===q)$.controller=void 0;$.reset()};if(X){let{source:N}=$,W=o(()=>{if((N==null?void 0:N.status)==="idle")W(),B()})}else this.manager.renderer.rendering.then(B)})};if($.canceled=(Q=J.canceled)!=null?Q:!1,this.manager.monitor.dispatch("dragend",{nativeEvent:J.event,operation:$.snapshot(),canceled:(Z=J.canceled)!=null?Z:!1,suspend:H}),Y)Y.then(K).catch(()=>$.reset());else K()})}},aJ=class extends $J{constructor(J,Q){super(J,Q);this.manager=J,this.options=Q}},n8=class extends AbortController{constructor(J,Q){super();this.constraints=J,this.onActivate=Q,this.activated=!1;for(let Z of J!=null?J:[])Z.controller=this}onEvent(J){var Q;if(this.activated)return;if((Q=this.constraints)==null?void 0:Q.length)for(let Z of this.constraints)Z.onEvent(J);else this.activate(J)}activate(J){if(this.activated)return;this.activated=!0,this.onActivate(J)}abort(J){this.activated=!1,super.abort(J)}},mZ,C1=class{constructor(J){this.options=J,E(this,mZ)}set controller(J){WJ(this,mZ,J),J.signal.addEventListener("abort",()=>this.abort())}activate(J){var Q;(Q=u(this,mZ))==null||Q.activate(J)}};mZ=new WeakMap;var z8=class extends $J{constructor(J,Q){super(J,Q);this.manager=J,this.options=Q}apply(J){return J.transform}},gq=class{constructor(J){this.draggables=new F8,this.droppables=new F8,this.plugins=new q1(J),this.sensors=new q1(J),this.modifiers=new q1(J)}register(J,Q){if(J instanceof MJ)return this.draggables.register(J.id,J);if(J instanceof wJ)return this.droppables.register(J.id,J);if(J.prototype instanceof z8)return this.modifiers.register(J,Q);if(J.prototype instanceof aJ)return this.sensors.register(J,Q);if(J.prototype instanceof $J)return this.plugins.register(J,Q);throw Error("Invalid instance type")}unregister(J){if(J instanceof _Z){if(J instanceof MJ)return this.draggables.unregister(J.id,J);if(J instanceof wJ)return this.droppables.unregister(J.id,J);return()=>{}}if(J.prototype instanceof z8)return this.modifiers.unregister(J);if(J.prototype instanceof aJ)return this.sensors.unregister(J);if(J.prototype instanceof $J)return this.plugins.unregister(J);throw Error("Invalid instance type")}destroy(){this.draggables.destroy(),this.droppables.destroy(),this.plugins.destroy(),this.sensors.destroy(),this.modifiers.destroy()}},a8,r8,t8,e8,J2,Q2,Z2,$2,q2,rQ,pZ,RQ,g,T1,P1,E1,S1,k1,tQ;q2=[h],$2=[T],Z2=[T],Q2=[T],J2=[T],e8=[T],t8=[h],r8=[h],a8=[h];var AJ=class{constructor(J){O(g,5,this),E(this,rQ),E(this,pZ),E(this,RQ,new jJ(void 0,(Q,Z)=>Q&&Z?Q.equals(Z):Q===Z)),this.status=new kJ,E(this,T1,O(g,8,this,!1)),O(g,11,this),E(this,P1,O(g,12,this,null)),O(g,15,this),E(this,E1,O(g,16,this,null)),O(g,19,this),E(this,S1,O(g,20,this,null)),O(g,23,this),E(this,k1,O(g,24,this,[])),O(g,27,this),this.position=new nQ({x:0,y:0}),E(this,tQ,{x:0,y:0}),WJ(this,rQ,J)}get shape(){let{current:J,initial:Q,previous:Z}=u(this,RQ);if(!J||!Q)return null;return{current:J,initial:Q,previous:Z}}set shape(J){if(!J)u(this,RQ).reset();else u(this,RQ).current=J}get source(){var J;let Q=this.sourceIdentifier;if(Q==null)return null;let Z=u(this,rQ).registry.draggables.get(Q);if(Z)WJ(this,pZ,Z);return(J=Z!=null?Z:u(this,pZ))!=null?J:null}get target(){var J;let Q=this.targetIdentifier;return Q!=null?(J=u(this,rQ).registry.droppables.get(Q))!=null?J:null:null}get transform(){let{x:J,y:Q}=this.position.delta,Z={x:J,y:Q};for(let $ of this.modifiers)Z=$.apply(B1(W1({},this.snapshot()),{transform:Z}));return WJ(this,tQ,Z),Z}snapshot(){return C(()=>({source:this.source,target:this.target,activatorEvent:this.activatorEvent,transform:u(this,tQ),shape:this.shape?hZ(this.shape):null,position:hZ(this.position),status:hZ(this.status),canceled:this.canceled}))}reset(){JJ(()=>{this.status.set("idle"),this.sourceIdentifier=null,this.targetIdentifier=null,u(this,RQ).reset(),this.position.reset({x:0,y:0}),WJ(this,tQ,{x:0,y:0}),this.modifiers=[]})}};g=PQ(null);rQ=new WeakMap;pZ=new WeakMap;RQ=new WeakMap;T1=new WeakMap;P1=new WeakMap;E1=new WeakMap;S1=new WeakMap;k1=new WeakMap;tQ=new WeakMap;P(g,2,"shape",q2,AJ);P(g,4,"canceled",$2,AJ,T1);P(g,4,"activatorEvent",Z2,AJ,P1);P(g,4,"sourceIdentifier",Q2,AJ,E1);P(g,4,"targetIdentifier",J2,AJ,S1);P(g,4,"modifiers",e8,AJ,k1);P(g,2,"source",t8,AJ);P(g,2,"target",r8,AJ);P(g,2,"transform",a8,AJ);rJ(g,AJ);var uq={get rendering(){return Promise.resolve()}};function VJ(J,Q){if(typeof J==="function")return J(Q);return J!=null?J:Q}var Y2=class{constructor(J){this.destroy=()=>{if(!this.dragOperation.status.idle)this.actions.stop({canceled:!0});this.dragOperation.modifiers.forEach((W)=>W.destroy()),this.registry.destroy(),this.collisionObserver.destroy()};var Q;let Z=J!=null?J:{},$=VJ(Z.plugins,[]),q=VJ(Z.sensors,[]),Y=VJ(Z.modifiers,[]),H=(Q=Z.renderer)!=null?Q:uq,K=new fq(this),X=new gq(this);this.registry=X,this.monitor=K,this.renderer=H,this.actions=new bq(this),this.dragOperation=new AJ(this),this.collisionObserver=new hq(this),this.plugins=[vq,...$],this.modifiers=Y,this.sensors=q;let{destroy:B}=this,N=nJ(()=>{var W,G,L;let F=C(()=>this.dragOperation.modifiers),z=this.modifiers;for(let A of F)if(!z.includes(A))A.destroy();this.dragOperation.modifiers=(L=(G=(W=this.dragOperation.source)==null?void 0:W.modifiers)==null?void 0:G.map((A)=>{let{plugin:I,options:U}=CQ(A);return new I(this,U)}))!=null?L:z});this.destroy=()=>{N(),B()}}get plugins(){return this.registry.plugins.values}set plugins(J){this.registry.plugins.values=J}get modifiers(){return this.registry.modifiers.values}set modifiers(J){this.registry.modifiers.values=J}get sensors(){return this.registry.sensors.values}set sensors(J){this.registry.sensors.values=J}};var U2=(J)=>{throw TypeError(J)},y1=(J,Q,Z)=>Q.has(J)||U2("Cannot "+Z),R=(J,Q,Z)=>(y1(J,Q,"read from private field"),Q.get(J)),YJ=(J,Q,Z)=>Q.has(J)?U2("Cannot add the same private member more than once"):Q instanceof WeakSet?Q.add(J):Q.set(J,Z),BJ=(J,Q,Z,$)=>(y1(J,Q,"write to private field"),Q.set(J,Z),Z),L2=(J,Q,Z)=>(y1(J,Q,"access private method"),Z);function eZ(J){if(!J)return!1;if(J instanceof KeyframeEffect)return!0;return"getKeyframes"in J&&typeof J.getKeyframes==="function"}function f1(J,Q){let Z=J.getAnimations(),$=null;for(let q of Z){if(q.playState!=="running")continue;let{effect:Y}=q,K=(eZ(Y)?Y.getKeyframes():[]).filter(Q);if(K.length>0)$=[K[K.length-1],q]}return $}function J0(J){let{width:Q,height:Z,top:$,left:q,bottom:Y,right:H}=J.getBoundingClientRect();return{width:Q,height:Z,top:$,left:q,bottom:Y,right:H}}function v1(J){let Q=Object.prototype.toString.call(J);return Q==="[object Window]"||Q==="[object global]"}function KZ(J){return"nodeType"in J}function NJ(J){var Q,Z,$;if(!J)return window;if(v1(J))return J;if(!KZ(J))return window;if("defaultView"in J)return(Q=J.defaultView)!=null?Q:window;return($=(Z=J.ownerDocument)==null?void 0:Z.defaultView)!=null?$:window}function Q0(J){let{Document:Q}=NJ(J);return J instanceof Q||"nodeType"in J&&J.nodeType===Node.DOCUMENT_NODE}function xJ(J){if(!J||v1(J))return!1;return J instanceof NJ(J).HTMLElement||"namespaceURI"in J&&typeof J.namespaceURI==="string"&&J.namespaceURI.endsWith("html")}function G2(J){return J instanceof NJ(J).SVGElement||"namespaceURI"in J&&typeof J.namespaceURI==="string"&&J.namespaceURI.endsWith("svg")}function QQ(J){if(!J)return document;if(v1(J))return J.document;if(!KZ(J))return document;if(Q0(J))return J;if(xJ(J)||G2(J))return J.ownerDocument;return document}function mq(J){var Q,Z,$,q;let{documentElement:Y}=QQ(J),H=NJ(J).visualViewport,K=(Q=H==null?void 0:H.width)!=null?Q:Y.clientWidth,X=(Z=H==null?void 0:H.height)!=null?Z:Y.clientHeight,B=($=H==null?void 0:H.offsetTop)!=null?$:0,N=(q=H==null?void 0:H.offsetLeft)!=null?q:0;return{top:B,left:N,right:N+K,bottom:B+X,width:K,height:X}}function pq(J,Q){if(dq(J)&&J.open===!1)return!1;let{overflow:Z,overflowX:$,overflowY:q}=getComputedStyle(J);return Z==="visible"&&$==="visible"&&q==="visible"}function dq(J){return J.tagName==="DETAILS"}function iZ(J,Q=J.getBoundingClientRect(),Z=0){var $,q,Y,H,K;let X=Q,{ownerDocument:B}=J,N=($=B.defaultView)!=null?$:window,W=J.parentElement;while(W&&W!==B.documentElement){if(!pq(W)){let M=W.getBoundingClientRect(),V=Z*(M.bottom-M.top),w=Z*(M.right-M.left),f=Z*(M.bottom-M.top),j=Z*(M.right-M.left);X={top:Math.max(X.top,M.top-V),right:Math.min(X.right,M.right+w),bottom:Math.min(X.bottom,M.bottom+f),left:Math.max(X.left,M.left-j),width:0,height:0},X.width=X.right-X.left,X.height=X.bottom-X.top}W=W.parentElement}let G=N.visualViewport,L=(q=G==null?void 0:G.offsetTop)!=null?q:0,F=(Y=G==null?void 0:G.offsetLeft)!=null?Y:0,z=(H=G==null?void 0:G.width)!=null?H:N.innerWidth,A=(K=G==null?void 0:G.height)!=null?K:N.innerHeight,I=Z*A,U=Z*z;if(X={top:Math.max(X.top,L-I),right:Math.min(X.right,F+z+U),bottom:Math.min(X.bottom,L+A+I),left:Math.max(X.left,F-U),width:0,height:0},X.width=X.right-X.left,X.height=X.bottom-X.top,X.width<0)X.width=0;if(X.height<0)X.height=0;return X}function ZQ(J){return{x:J.clientX,y:J.clientY}}var V2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function nZ(J=document,Q=new Set){if(Q.has(J))return[];Q.add(J);let Z=[J];for(let $ of Array.from(J.querySelectorAll("iframe, frame")))try{let q=$.contentDocument;if(q&&!Q.has(q))Z.push(...nZ(q,Q))}catch(q){}try{let $=J.defaultView;if($&&$!==window.top){let q=$.parent;if(q&&q.document&&q.document!==J)Z.push(...nZ(q.document,Q))}}catch($){}return Z}function Z0(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function b1(){var J,Q;let Z=Z0()?window.visualViewport:null;return{x:(J=Z==null?void 0:Z.offsetLeft)!=null?J:0,y:(Q=Z==null?void 0:Z.offsetTop)!=null?Q:0}}function $0(J){if(!J||!KZ(J))return!1;return J instanceof NJ(J).ShadowRoot}function HZ(J){if(J&&KZ(J)){let Q=J.getRootNode();if($0(Q))return Q;else if(Q instanceof Document)return Q}return QQ(J)}function g1(J){return J.matchMedia("(prefers-reduced-motion: reduce)").matches}function F2(J){let Z=J.cloneNode(!0),$=Array.from(J.querySelectorAll("input, textarea, select, canvas, [contenteditable]"));return Array.from(Z.querySelectorAll("input, textarea, select, canvas, [contenteditable]")).forEach((Y,H)=>{let K=$[H];if(K2(Y)&&K2(K)){if(Y.type!=="file")Y.value=K.value;if(Y.type==="radio"&&Y.name)Y.name=`Cloned__${Y.name}`}if(H2(Y)&&H2(K)&&K.width>0&&K.height>0){let X=Y.getContext("2d");X==null||X.drawImage(K,0,0)}}),Z}function K2(J){return"value"in J}function H2(J){return J.tagName==="CANVAS"}function u1(J,{x:Q,y:Z}){let $=J.elementFromPoint(Q,Z);if(_q($)){let{contentDocument:q}=$;if(q){let{left:Y,top:H}=$.getBoundingClientRect();return u1(q,{x:Q-Y,y:Z-H})}}return $}function _q(J){return(J==null?void 0:J.tagName)==="IFRAME"}var m1=new WeakMap;function z2(J){return Boolean(J.closest(`
@@ -68,4 +68,4 @@ import{$f as x0,bg as TJ,cg as PZ,og as N5}from"./chunk-nwtb6dt1.js";import{Zj a
68
68
  visibility: hidden;
69
69
  }
70
70
  `.replace(/\n+/g," ").replace(/\s+/g," ").trim();function mY(J,Q="hidden"){return C(()=>{let{element:Z,manager:$}=J;if(!Z||!$)return;let q=pY(Z,$.registry.droppables),Y=[],H=F2(Z),{remove:K}=H;return dY(q,H,Y),_Y(H,Q),H.remove=()=>{Y.forEach((X)=>X()),K.call(H)},H})}function pY(J,Q){let Z=new Map;for(let $ of Q){if(!$.element)continue;if(J===$.element||J.contains($.element)){let q=`${AZ}${H0("dom-id")}`;$.element.setAttribute(q,""),Z.set($,q)}}return Z}function dY(J,Q,Z){for(let[$,q]of J){if(!$.element)continue;let Y=`[${q}]`,H=Q.matches(Y)?Q:Q.querySelector(Y);if($.element.removeAttribute(q),!H)continue;let K=$.element;$.proxy=H,H.removeAttribute(q),m1.set(K,H),Z.push(()=>{m1.delete(K),$.proxy=void 0})}}function _Y(J,Q="hidden"){J.setAttribute("inert","true"),J.setAttribute("tab-index","-1"),J.setAttribute("aria-hidden","true"),J.setAttribute(U0,Q)}function J$(J,Q){if(J===Q)return!0;return JQ(J)===JQ(Q)}function f2(J){let{target:Q}=J;if("newState"in J&&J.newState==="closed"&&gJ(Q)&&Q.hasAttribute("popover"))requestAnimationFrame(()=>$Q(Q))}function i1(J){return J.tagName==="TR"}function cY(J,Q,Z){let $=new MutationObserver((q)=>{let Y=!1;for(let H of q){if(H.target!==J){Y=!0;continue}if(H.type!=="attributes")continue;let K=H.attributeName;if(K.startsWith("aria-")||bY.includes(K))continue;let X=J.getAttribute(K);if(K==="style"){if(kQ(J)&&kQ(Q)){let B=J.style;for(let N of Array.from(Q.style))if(B.getPropertyValue(N)==="")Q.style.removeProperty(N);for(let N of Array.from(B)){if(gY.includes(N)||N.startsWith(n))continue;let W=B.getPropertyValue(N);Q.style.setProperty(N,W)}}}else if(X!==null)Q.setAttribute(K,X);else Q.removeAttribute(K)}if(Y&&Z)Q.replaceChildren(...J.cloneNode(!0).childNodes)});return $.observe(J,{attributes:!0,subtree:!0,childList:!0}),$}function lY(J,Q,Z){let $=new MutationObserver((q)=>{for(let Y of q){if(Y.addedNodes.length===0)continue;for(let H of Array.from(Y.addedNodes)){if(H.contains(J)&&J.nextElementSibling!==Q){J.insertAdjacentElement("afterend",Q),$Q(Z);return}if(H.contains(Q)&&Q.previousElementSibling!==J){Q.insertAdjacentElement("beforebegin",J),$Q(Z);return}}}if(J.isConnected&&Q.isConnected&&J.nextElementSibling!==Q)J.insertAdjacentElement("afterend",Q),$Q(Z)});return $.observe(J.ownerDocument.body,{childList:!0,subtree:!0}),$}function sY(J){return new ResizeObserver(()=>{var Q,Z,$;let q=new hJ(J.placeholder,{frameTransform:J.frameTransform,ignoreTransforms:!0}),Y=(Q=J.transformOrigin)!=null?Q:{x:1,y:1},H=(J.width-q.width)*Y.x+J.delta.x,K=(J.height-q.height)*Y.y+J.delta.y,X=b1();if(J.styles.set({width:q.width-J.widthOffset,height:q.height-J.heightOffset,top:J.top+K+X.y,left:J.left+H+X.x},n),(Z=J.getElementMutationObserver())==null||Z.takeRecords(),i1(J.element)&&i1(J.placeholder)){let z=Array.from(J.element.cells),A=Array.from(J.placeholder.cells);if(!J.getSavedCellWidths())J.setSavedCellWidths(z.map((I)=>I.style.width));for(let[I,U]of z.entries()){let M=A[I];U.style.width=`${M.getBoundingClientRect().width}px`}}let B=($=J.getTranslate())!=null?$:{x:0,y:0},N=J.left+H+X.x+B.x,W=J.top+K+X.y+B.y,G=q.width-J.widthOffset,L=q.height-J.heightOffset,F=J.frameTransform;J.dragOperation.shape=new XJ(N*F.scaleX+F.x,W*F.scaleY+F.y,G*F.scaleX,L*F.scaleY)})}var oY=250,iY="ease";function nY(J){var Q,Z,$,q;let{animation:Y}=J;if(typeof Y==="function"){let U=Y({source:J.source,element:J.element,feedbackElement:J.feedbackElement,placeholder:J.placeholder,translate:J.translate,moved:J.moved});Promise.resolve(U).then(()=>{J.cleanup(),requestAnimationFrame(J.restoreFocus)});return}let{duration:H=oY,easing:K=iY}=Y!=null?Y:{};$Q(J.feedbackElement);let[,X]=(Q=f1(J.feedbackElement,(U)=>("translate"in U)))!=null?Q:[];X==null||X.pause();let B=(Z=J.placeholder)!=null?Z:J.element,N={frameTransform:J$(J.feedbackElement,B)?null:void 0},W=new hJ(J.feedbackElement,N),G=($=xQ(DJ(J.feedbackElement).translate))!=null?$:J.translate,L=new hJ(B,N),F=XJ.delta(W,L,J.alignment),z={x:G.x-F.x,y:G.y-F.y},A=Math.round(W.intrinsicHeight)!==Math.round(L.intrinsicHeight)?{minHeight:[`${W.intrinsicHeight}px`,`${L.intrinsicHeight}px`],maxHeight:[`${W.intrinsicHeight}px`,`${L.intrinsicHeight}px`]}:{},I=Math.round(W.intrinsicWidth)!==Math.round(L.intrinsicWidth)?{minWidth:[`${W.intrinsicWidth}px`,`${L.intrinsicWidth}px`],maxWidth:[`${W.intrinsicWidth}px`,`${L.intrinsicWidth}px`]}:{};J.styles.set({transition:J.transition},n),J.feedbackElement.setAttribute(o1,""),(q=J.getElementMutationObserver())==null||q.takeRecords(),P2({element:J.feedbackElement,keyframes:$9(FZ(FZ({},A),I),{translate:[`${G.x}px ${G.y}px 0`,`${z.x}px ${z.y}px 0`]}),options:{duration:g1(NJ(J.feedbackElement))?0:J.moved||J.feedbackElement!==J.element?H:0,easing:K}}).then(()=>{J.feedbackElement.removeAttribute(o1),X==null||X.finish(),J.cleanup(),requestAnimationFrame(J.restoreFocus)})}var Q$,n1,zZ,K9,W0,Z$,$$,uQ=class extends(n1=$J,Q$=[T],n1){constructor(Q,Z){super(Q,Z);m(this,W0),m(this,K9,l(zZ,8,this)),l(zZ,11,this),this.state={initial:{},current:{}};let $=Q.registry.plugins.get(V0),q=$==null?void 0:$.register(uY);if(q){let Y=this.destroy.bind(this);this.destroy=()=>{q(),Y()}}this.registerEffect(XQ(this,W0,Z$).bind(this,$)),this.registerEffect(XQ(this,W0,$$))}};zZ=pQ(n1);K9=new WeakMap;W0=new WeakSet;Z$=function(J){let{overlay:Q}=this;if(!Q||!J)return;let Z=HZ(Q);if(!Z)return;return J.addRoot(Z)};$$=function(){var J,Q,Z,$,q,Y,H;let{state:K,manager:X,options:B}=this,{dragOperation:N}=X,{position:W,source:G,status:L}=N;if(L.idle){K.current={},K.initial={};return}if(!G)return;let{element:F}=G,z=G.pluginConfig(uQ),A=(Q=(J=z==null?void 0:z.feedback)!=null?J:B==null?void 0:B.feedback)!=null?Q:"default",I=typeof A==="function"?A(G,X):A;if(!F||I==="none"||!L.initialized||L.initializing)return;let{initial:U}=K,M=(Z=this.overlay)!=null?Z:F,V=qQ(M),w=qQ(F),f=!J$(F,M),j=new hJ(F,{frameTransform:f?w:null,ignoreTransforms:!f}),p={x:w.scaleX/V.scaleX,y:w.scaleY/V.scaleY},{width:b,height:y,top:GQ,left:s}=j;if(f)b=b/p.x,y=y/p.y;let v=new E2(M),R0=DJ(F),{transition:A9,translate:I9,boxSizing:v$,paddingBlockStart:b$,paddingBlockEnd:g$,paddingInlineStart:u$,paddingInlineEnd:m$,borderInlineStartWidth:p$,borderInlineEndWidth:d$,borderBlockStartWidth:_$,borderBlockEndWidth:c$}=R0,OZ=A9.split(",").filter((S)=>!/^\s*(transform|translate|scale)\b/.test(S)).join(","),cJ=WZ(R0),l$=R0.transform,j9=I==="clone",O9=v$==="content-box",R9=O9?parseInt(u$)+parseInt(m$)+parseInt(p$)+parseInt(d$):0,D9=O9?parseInt(b$)+parseInt(g$)+parseInt(_$)+parseInt(c$):0,KJ=I!=="move"&&!this.overlay?mY(G,j9?"clone":"hidden"):null,D0=C(()=>K0(X.dragOperation.activatorEvent));if(!U.translate){if(this.overlay&&cJ)U.translate={x:cJ.x,y:cJ.y};else if(I9!=="none"){let S=xQ(I9);if(S)U.translate=S}}if(!U.transformOrigin){let S=C(()=>W.current),_=s+(($=cJ==null?void 0:cJ.x)!=null?$:0),HJ=GQ+((q=cJ==null?void 0:cJ.y)!=null?q:0);U.transformOrigin={x:(S.x-_*V.scaleX-V.x)/(b*V.scaleX),y:(S.y-HJ*V.scaleY-V.y)/(y*V.scaleY)}}let{transformOrigin:VQ}=U,C9=GQ*V.scaleY+V.y,T9=s*V.scaleX+V.x;if(!U.coordinates){if(U.coordinates={x:T9,y:C9},p.x!==1||p.y!==1){let{scaleX:S,scaleY:_}=w,{x:HJ,y:fJ}=VQ;U.coordinates.x+=(b*S-b)*HJ,U.coordinates.y+=(y*_-y)*fJ}}if(!U.dimensions)U.dimensions={width:b,height:y};if(!U.frameTransform)U.frameTransform=V;let P9={x:U.coordinates.x-T9,y:U.coordinates.y-C9},E9={width:(U.dimensions.width*U.frameTransform.scaleX-b*V.scaleX)*VQ.x,height:(U.dimensions.height*U.frameTransform.scaleY-y*V.scaleY)*VQ.y},C0={x:P9.x/V.scaleX+E9.width,y:P9.y/V.scaleY+E9.height},S9={left:s+C0.x,top:GQ+C0.y};M.setAttribute(CJ,"true");let k9=C(()=>N.transform),x9=(Y=U.translate)!=null?Y:{x:0,y:0},s$=k9.x*V.scaleX+x9.x,o$=k9.y*V.scaleY+x9.y,h9=b1();if(v.set({width:b-R9,height:y-D9,top:S9.top+h9.y,left:S9.left+h9.x,translate:`${s$}px ${o$}px 0`,transform:this.overlay?"none":l$,transition:OZ?`${OZ}, translate 0ms linear`:"translate 0ms linear",scale:f?`${p.x} ${p.y}`:"","transform-origin":`${VQ.x*100}% ${VQ.y*100}%`},n),KJ){if(F.insertAdjacentElement("afterend",KJ),B==null?void 0:B.rootElement)(typeof B.rootElement==="function"?B.rootElement(G):B.rootElement).appendChild(F)}if(q0(M)){if(!M.hasAttribute("popover"))M.setAttribute("popover","manual");$Q(M),M.addEventListener("beforetoggle",f2)}let lJ,T0,RZ,y9=sY({placeholder:KJ,element:F,feedbackElement:M,frameTransform:V,transformOrigin:VQ,width:b,height:y,top:GQ,left:s,widthOffset:R9,heightOffset:D9,delta:C0,styles:v,dragOperation:N,getTranslate:()=>K.current.translate,getElementMutationObserver:()=>lJ,getSavedCellWidths:()=>RZ,setSavedCellWidths:(S)=>{RZ=S}}),f9=new hJ(M);C(()=>N.shape=f9);let P0=NJ(M),v9=(S)=>{this.manager.actions.stop({event:S})},i$=g1(P0);if(D0)P0.addEventListener("resize",v9);if(C(()=>G.status)==="idle")requestAnimationFrame(()=>G.status="dragging");if(KJ)y9.observe(KJ),lJ=cY(F,KJ,j9),T0=lY(F,KJ,M);let b9=(H=X.dragOperation.source)==null?void 0:H.id,n$=()=>{var S;if(!D0||b9==null)return;let _=X.registry.draggables.get(b9),HJ=(S=_==null?void 0:_.handle)!=null?S:_==null?void 0:_.element;if(xJ(HJ))HJ.focus()},E0=()=>{var S;if(lJ==null||lJ.disconnect(),T0==null||T0.disconnect(),y9.disconnect(),P0.removeEventListener("resize",v9),q0(M))M.removeEventListener("beforetoggle",f2),M.removeAttribute("popover");if(M.removeAttribute(CJ),v.reset(),RZ&&i1(F)){let fJ=Array.from(F.cells);for(let[S0,DZ]of fJ.entries())DZ.style.width=(S=RZ[S0])!=null?S:""}G.status="idle";let _=K.current.translate!=null,HJ=N.status.dragging;if(KJ&&(!HJ&&_||KJ.parentElement!==M.parentElement)&&M.isConnected)KJ.replaceWith(M);KJ==null||KJ.remove()},a$=B==null?void 0:B.dropAnimation,g9=this,r$=nJ(()=>{var S,_,HJ;let{transform:fJ,status:S0}=N;if(!fJ.x&&!fJ.y&&!K.current.translate)return;if(S0.dragging){let DZ=(S=U.translate)!=null?S:{x:0,y:0},CZ={x:fJ.x/V.scaleX+DZ.x,y:fJ.y/V.scaleY+DZ.y},u9=K.current.translate,t$=C(()=>N.modifiers),k0=C(()=>{var _Q;return(_Q=N.shape)==null?void 0:_Q.current}),dQ=B==null?void 0:B.keyboardTransition,m9=D0&&!i$&&dQ!==null?`${(_=dQ==null?void 0:dQ.duration)!=null?_:250}ms ${(HJ=dQ==null?void 0:dQ.easing)!=null?HJ:"cubic-bezier(0.25, 1, 0.5, 1)"}`:"0ms linear";if(v.set({transition:OZ?`${OZ}, translate ${m9}`:`translate ${m9}`,translate:`${CZ.x}px ${CZ.y}px 0`},n),lJ==null||lJ.takeRecords(),k0&&k0!==f9&&u9&&!t$.length){let _Q=e.delta(CZ,u9);N.shape=XJ.from(k0.boundingRectangle).translate(_Q.x*V.scaleX,_Q.y*V.scaleY)}else N.shape=new hJ(M);K.current.translate=CZ}},function(){if(N.status.dropped){this.dispose(),G.status="dropping";let S=(z==null?void 0:z.dropAnimation)!==void 0?z.dropAnimation:g9.dropAnimation!==void 0?g9.dropAnimation:a$,_=K.current.translate,HJ=_!=null;if(!_&&F!==M)_={x:0,y:0};if(!_||S===null){E0();return}X.renderer.rendering.then(()=>{nY({source:G,element:F,feedbackElement:M,placeholder:KJ,translate:_,moved:HJ,transition:A9,alignment:G.alignment,styles:v,animation:S!=null?S:void 0,getElementMutationObserver:()=>lJ,cleanup:E0,restoreFocus:n$})})}});return()=>{E0(),r$()}};FJ(zZ,4,"overlay",Q$,uQ,K9);WQ(zZ,uQ);uQ.configure=EQ(uQ);var F0=uQ,BZ=!0,aY=!1,q$,Y$,K$,H$,mJ,H9,X9;H$=(K$=[T],UJ.Forward),Y$=(q$=[T],UJ.Reverse);var MZ=class{constructor(){m(this,H9,l(mJ,8,this,BZ)),l(mJ,11,this),m(this,X9,l(mJ,12,this,BZ)),l(mJ,15,this)}isLocked(J){if(J===UJ.Idle)return!1;if(J==null)return this[UJ.Forward]===BZ&&this[UJ.Reverse]===BZ;return this[J]===BZ}unlock(J){if(J===UJ.Idle)return;this[J]=aY}};mJ=pQ(null);H9=new WeakMap;X9=new WeakMap;FJ(mJ,4,H$,K$,MZ,H9);FJ(mJ,4,Y$,q$,MZ,X9);WQ(mJ,MZ);var rY=[UJ.Forward,UJ.Reverse],v2=class{constructor(){this.x=new MZ,this.y=new MZ}isLocked(){return this.x.isLocked()&&this.y.isLocked()}},tY=class extends $J{constructor(J){super(J);let Q=IJ(new v2),Z=null;this.signal=Q,o(()=>{let{status:$}=J.dragOperation;if(!$.initialized){Z=null,Q.value=new v2;return}let{delta:q}=J.dragOperation.position;if(Z){let Y={x:b2(q.x,Z.x),y:b2(q.y,Z.y)},H=Q.peek();JJ(()=>{for(let K of $1)for(let X of rY)if(Y[K]===X)H[K].unlock(X);Q.value=H})}Z=q})}get current(){return this.signal.peek()}};function b2(J,Q){return Math.sign(J-Q)}var X$,a1,wZ,W9,uJ,r1,z0=class extends(a1=SQ,X$=[T],a1){constructor(J){super(J);m(this,W9,l(wZ,8,this,!1)),l(wZ,11,this),m(this,uJ),m(this,r1,()=>{if(!x(this,uJ))return;let{element:Y,by:H}=x(this,uJ);if(H.y)Y.scrollTop+=H.y;if(H.x)Y.scrollLeft+=H.x}),this.scroll=(Y,H)=>{var K;if(this.disabled)return!1;let X=this.getScrollableElements();if(!X)return qJ(this,uJ,void 0),!1;let{position:B}=this.manager.dragOperation,N=B==null?void 0:B.current;if(N){let{by:W}=Y!=null?Y:{},G=W?{x:g2(W.x),y:g2(W.y)}:void 0,L=G?void 0:this.scrollIntentTracker.current;if(L==null?void 0:L.isLocked())return!1;for(let F of X){let z=D2(F,W);if(z.x||z.y){let{speed:A,direction:I}=C2(F,N,G,H==null?void 0:H.acceleration,H==null?void 0:H.threshold);if(L){for(let U of $1)if(L[U].isLocked(I[U]))A[U]=0,I[U]=0}if(I.x||I.y){let{x:U,y:M}=W!=null?W:I,V=U*A.x,w=M*A.y;if(V||w){let f=(K=x(this,uJ))==null?void 0:K.by;if(this.autoScrolling&&f){if(f.x&&!V||f.y&&!w)continue}return qJ(this,uJ,{element:F,by:{x:V,y:w}}),XZ.schedule(x(this,r1)),!0}}}}}return qJ(this,uJ,void 0),!1};let Q=null,Z=null,$=AQ(()=>{let{position:Y,source:H}=J.dragOperation;if(!Y)return null;let K=u1(HZ(H==null?void 0:H.element),Y.current);if(K)Q=K;return K!=null?K:Q}),q=AQ(()=>{let Y=$.value,{documentElement:H}=QQ(Y);if(!Y||Y===H){let{target:K}=J.dragOperation,X=K==null?void 0:K.element;if(X){let B=Y0(X,{excludeElement:!1});return Z=B,B}}if(Y){let K=Y0(Y,{excludeElement:!1});if(this.autoScrolling&&Z&&K.size<(Z==null?void 0:Z.size))return Z;return Z=K,K}return Z=null,null},EJ);this.getScrollableElements=()=>{return q.value},this.scrollIntentTracker=new tY(J),this.destroy=J.monitor.addEventListener("dragmove",(Y)=>{if(this.disabled||Y.defaultPrevented||!K0(J.dragOperation.activatorEvent)||!Y.by)return;if(this.scroll({by:Y.by}))Y.preventDefault()})}};wZ=pQ(a1);W9=new WeakMap;uJ=new WeakMap;r1=new WeakMap;FJ(wZ,4,"autoScrolling",X$,z0,W9);WQ(wZ,z0);function g2(J){if(J>0)return UJ.Forward;if(J<0)return UJ.Reverse;return UJ.Idle}var eY=class{constructor(J){this.scheduler=J,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{let{tasks:Q,resolvers:Z}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(let $ of Q)$();for(let $ of Z)$()}}schedule(J){if(this.tasks.add(J),!this.pending)this.pending=!0,this.scheduler(this.flush);return new Promise((Q)=>this.resolvers.add(Q))}},J5=new eY((J)=>{if(typeof requestAnimationFrame==="function")requestAnimationFrame(J);else J()}),Q5=10,t1=class extends $J{constructor(Q,Z){super(Q,Z);let $=Q.registry.plugins.get(z0);if(!$)throw Error("AutoScroller plugin depends on Scroller plugin");this.destroy=o(()=>{var q,Y,H;if(this.disabled)return;let{position:K,status:X}=Q.dragOperation;if(X.dragging){let B={acceleration:(q=this.options)==null?void 0:q.acceleration,threshold:typeof((Y=this.options)==null?void 0:Y.threshold)==="number"?{x:this.options.threshold,y:this.options.threshold}:(H=this.options)==null?void 0:H.threshold};if($.scroll(void 0,B)){$.autoScrolling=!0;let W=setInterval(()=>J5.schedule(()=>$.scroll(void 0,B)),Q5);return()=>{clearInterval(W)}}else $.autoScrolling=!1}})}};t1.configure=EQ(t1);var W$=t1,u2={capture:!0,passive:!0},UZ,Z5=class extends SQ{constructor(J){super(J);m(this,UZ),this.handleScroll=()=>{if(x(this,UZ)==null)qJ(this,UZ,setTimeout(()=>{this.manager.collisionObserver.forceUpdate(!1),qJ(this,UZ,void 0)},50))};let{dragOperation:Q}=this.manager;this.destroy=o(()=>{var Z,$,q;if(Q.status.dragging){let H=(q=($=(Z=Q.source)==null?void 0:Z.element)==null?void 0:$.ownerDocument)!=null?q:document;return H.addEventListener("scroll",this.handleScroll,u2),()=>{H.removeEventListener("scroll",this.handleScroll,u2)}}})}};UZ=new WeakMap;var $5="* { user-select: none !important; -webkit-user-select: none !important; }",q5=class extends $J{constructor(J){super(J);this.manager=J;let Q=J.registry.plugins.get(V0),Z=Q==null?void 0:Q.register($5);if(this.destroy=o(()=>{let{dragOperation:$}=this.manager;if($.status.initialized)return _1(),document.addEventListener("selectionchange",_1,{capture:!0}),()=>{document.removeEventListener("selectionchange",_1,{capture:!0})}}),Z){let $=this.destroy.bind(this);this.destroy=()=>{Z(),$()}}}};function _1(){var J;(J=document.getSelection())==null||J.removeAllRanges()}var LZ=Object.freeze({offset:10,keyboardCodes:{start:["Space","Enter"],cancel:["Escape"],end:["Space","Enter","Tab"],up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},preventActivation(J,Q){var Z;let $=(Z=Q.handle)!=null?Z:Q.element;return J.target!==$}}),yQ,L0=class extends aJ{constructor(Q,Z){super(Q);this.manager=Q,this.options=Z,m(this,yQ,[]),this.listeners=new p1,this.handleSourceKeyDown=($,q,Y)=>{if(this.disabled||$.defaultPrevented)return;if(!gJ($.target))return;if(q.disabled)return;let{keyboardCodes:H=LZ.keyboardCodes,preventActivation:K=LZ.preventActivation}=Y!=null?Y:{};if(!H.start.includes($.code))return;if(!this.manager.dragOperation.status.idle)return;if(K==null?void 0:K($,q))return;this.handleStart($,q,Y)}}bind(Q,Z=this.options){return o(()=>{var q;let Y=(q=Q.handle)!=null?q:Q.element,H=(K)=>{if(K0(K))this.handleSourceKeyDown(K,Q,Z)};if(Y)return Y.addEventListener("keydown",H),()=>{Y.removeEventListener("keydown",H)}})}handleStart(Q,Z,$){let{element:q}=Z;if(!q)throw Error("Source draggable does not have an associated element");Q.preventDefault(),Q.stopImmediatePropagation(),T2(q);let{center:Y}=new hJ(q);if(this.manager.actions.start({event:Q,coordinates:{x:Y.x,y:Y.y},source:Z}).signal.aborted)return this.cleanup();this.sideEffects();let K=QQ(q),X=[this.listeners.bind(K,[{type:"keydown",listener:(B)=>this.handleKeyDown(B,Z,$),options:{capture:!0}}])];x(this,yQ).push(...X)}handleKeyDown(Q,Z,$){let{keyboardCodes:q=LZ.keyboardCodes}=$!=null?$:{};if(hQ(Q,[...q.end,...q.cancel])){Q.preventDefault();let Y=hQ(Q,q.cancel);this.handleEnd(Q,Y);return}if(hQ(Q,q.up))this.handleMove("up",Q);else if(hQ(Q,q.down))this.handleMove("down",Q);if(hQ(Q,q.left))this.handleMove("left",Q);else if(hQ(Q,q.right))this.handleMove("right",Q)}handleEnd(Q,Z){this.manager.actions.stop({event:Q,canceled:Z}),this.cleanup()}handleMove(Q,Z){var $,q;let{shape:Y}=this.manager.dragOperation,H=Z.shiftKey?5:1,K={x:0,y:0},X=(q=($=this.options)==null?void 0:$.offset)!=null?q:LZ.offset;if(typeof X==="number")X={x:X,y:X};if(!Y)return;switch(Q){case"up":K={x:0,y:-X.y*H};break;case"down":K={x:0,y:X.y*H};break;case"left":K={x:-X.x*H,y:0};break;case"right":K={x:X.x*H,y:0};break}if(K.x||K.y)Z.preventDefault(),this.manager.actions.move({event:Z,by:K})}sideEffects(){let Q=this.manager.registry.plugins.get(W$);if((Q==null?void 0:Q.disabled)===!1)Q.disable(),x(this,yQ).push(()=>{Q.enable()})}cleanup(){x(this,yQ).forEach((Q)=>Q()),qJ(this,yQ,[])}destroy(){this.cleanup(),this.listeners.clear()}};yQ=new WeakMap;L0.configure=EQ(L0);L0.defaults=LZ;var B$=L0;function hQ(J,Q){return Q.includes(J.code)}var YQ,Y5=class extends C1{constructor(){super(...arguments);m(this,YQ)}onEvent(J){switch(J.type){case"pointerdown":qJ(this,YQ,ZQ(J));break;case"pointermove":if(!x(this,YQ))return;let{x:Q,y:Z}=ZQ(J),$={x:Q-x(this,YQ).x,y:Z-x(this,YQ).y},{tolerance:q}=this.options;if(q&&fZ($,q)){this.abort();return}if(fZ($,this.options.value))this.activate(J);break;case"pointerup":this.abort();break}}abort(){qJ(this,YQ,void 0)}};YQ=new WeakMap;var fQ,KQ,K5=class extends C1{constructor(){super(...arguments);m(this,fQ),m(this,KQ)}onEvent(J){switch(J.type){case"pointerdown":qJ(this,KQ,ZQ(J)),qJ(this,fQ,setTimeout(()=>this.activate(J),this.options.value));break;case"pointermove":if(!x(this,KQ))return;let{x:Q,y:Z}=ZQ(J),$={x:Q-x(this,KQ).x,y:Z-x(this,KQ).y};if(fZ($,this.options.tolerance))this.abort();break;case"pointerup":this.abort();break}}abort(){if(x(this,fQ))clearTimeout(x(this,fQ)),qJ(this,KQ,void 0),qJ(this,fQ,void 0)}};fQ=new WeakMap;KQ=new WeakMap;var bQ=class{};bQ.Delay=K5;bQ.Distance=Y5;var e1=Object.freeze({activationConstraints(J,Q){var Z;let{pointerType:$,target:q}=J;if($==="mouse"&&gJ(q)&&(Q.handle===q||((Z=Q.handle)==null?void 0:Z.contains(q))))return;if($==="touch")return[new bQ.Delay({value:250,tolerance:5})];if(k2(q)&&!J.defaultPrevented)return[new bQ.Delay({value:200,tolerance:0})];return[new bQ.Delay({value:200,tolerance:10}),new bQ.Distance({value:5})]},preventActivation(J,Q){var Z;let{target:$}=J;if($===Q.element)return!1;if($===Q.handle)return!1;if(!gJ($))return!1;if((Z=Q.handle)==null?void 0:Z.contains($))return!1;return z2($)}}),vQ,G0=class extends aJ{constructor(Q,Z){super(Q);this.manager=Q,this.options=Z,m(this,vQ,new Set),this.listeners=new p1,this.latest={event:void 0,coordinates:void 0},this.handleMove=()=>{let{event:$,coordinates:q}=this.latest;if(!$||!q)return;this.manager.actions.move({event:$,to:q})},this.handleCancel=this.handleCancel.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}activationConstraints(Q,Z,$=this.options){let{activationConstraints:q=e1.activationConstraints}=$!=null?$:{};return typeof q==="function"?q(Q,Z):q}bind(Q,Z=this.options){return o(()=>{var q;let Y=new AbortController,{signal:H}=Y,K=(B)=>{if(S2(B))this.handlePointerDown(B,Q,Z)},X=[(q=Q.handle)!=null?q:Q.element];if(Z==null?void 0:Z.activatorElements)if(Array.isArray(Z.activatorElements))X=Z.activatorElements;else X=Z.activatorElements(Q);for(let B of X){if(!B)continue;W5(B.ownerDocument.defaultView),B.addEventListener("pointerdown",K,{signal:H})}return()=>Y.abort()})}handlePointerDown(Q,Z,$){if(this.disabled||!Q.isPrimary||Q.button!==0||!gJ(Q.target)||Z.disabled||H5(Q)||!this.manager.dragOperation.status.idle)return;let{preventActivation:q=e1.preventActivation}=$!=null?$:{};if(q==null?void 0:q(Q,Z))return;let{target:Y}=Q,H=xJ(Y)&&Y.draggable&&Y.getAttribute("draggable")==="true",K=qQ(Z.element),{x:X,y:B}=ZQ(Q);this.initialCoordinates={x:X*K.scaleX+K.x,y:B*K.scaleY+K.y};let N=this.activationConstraints(Q,Z,$);Q.sensor=this;let W=new n8(N,(z)=>this.handleStart(Z,z));W.signal.onabort=()=>this.handleCancel(Q),W.onEvent(Q),this.controller=W;let G=nZ(),L=this.listeners.bind(G,[{type:"pointermove",listener:(z)=>this.handlePointerMove(z,Z)},{type:"pointerup",listener:this.handlePointerUp,options:{capture:!0}},{type:"pointercancel",listener:this.handleCancel},{type:"dragstart",listener:H?this.handleCancel:X0,options:{capture:!0}}]),F=()=>{L(),this.initialCoordinates=void 0};x(this,vQ).add(F)}handlePointerMove(Q,Z){var $,q;if((($=this.controller)==null?void 0:$.activated)===!1){(q=this.controller)==null||q.onEvent(Q);return}if(this.manager.dragOperation.status.dragging){let Y=ZQ(Q),H=qQ(Z.element);Y.x=Y.x*H.scaleX+H.x,Y.y=Y.y*H.scaleY+H.y,Q.preventDefault(),Q.stopPropagation(),this.latest.event=Q,this.latest.coordinates=Y,XZ.schedule(this.handleMove)}}handlePointerUp(Q){let{status:Z}=this.manager.dragOperation;if(!Z.idle){Q.preventDefault(),Q.stopPropagation();let $=!Z.initialized;this.manager.actions.stop({event:Q,canceled:$})}this.cleanup()}handleKeyDown(Q){if(Q.key==="Escape")Q.preventDefault(),this.handleCancel(Q)}handleStart(Q,Z){let{manager:$,initialCoordinates:q}=this;if(!q||!$.dragOperation.status.idle)return;if(Z.defaultPrevented)return;if($.actions.start({coordinates:q,event:Z,source:Q}).signal.aborted)return this.cleanup();Z.preventDefault();let K=QQ(Z.target).body;try{K.setPointerCapture(Z.pointerId)}catch(N){this.handleCancel(Z);return}let X=gJ(Z.target)?[Z.target,K]:K,B=this.listeners.bind(X,[{type:"touchmove",listener:X0,options:{passive:!1}},{type:"click",listener:X0},{type:"contextmenu",listener:X0},{type:"keydown",listener:this.handleKeyDown}]);x(this,vQ).add(B)}handleCancel(Q){let{dragOperation:Z}=this.manager;if(Z.status.initialized)this.manager.actions.stop({event:Q,canceled:!0});this.cleanup()}cleanup(){let{controller:Q}=this;if(this.controller=void 0,Q&&!Q.signal.aborted)Q.abort();this.latest={event:void 0,coordinates:void 0},x(this,vQ).forEach((Z)=>Z()),x(this,vQ).clear()}destroy(){this.cleanup(),this.listeners.clear()}};vQ=new WeakMap;G0.configure=EQ(G0);G0.defaults=e1;var N$=G0;function H5(J){return"sensor"in J}function X0(J){J.preventDefault()}function X5(){}var m2=new WeakSet;function W5(J){if(!J||m2.has(J))return;J.addEventListener("touchmove",X5,{capture:!1,passive:!1}),m2.add(J)}var HQ={modifiers:[],plugins:[yY,W$,vY,F0,q5],sensors:[N$,B$]},B9=class extends Y2{constructor(J={}){let Q=VJ(J.plugins,HQ.plugins),Z=VJ(J.sensors,HQ.sensors),$=VJ(J.modifiers,HQ.modifiers);super($9(FZ({},J),{plugins:[Z5,z0,V0,...Q],sensors:Z,modifiers:$}))}},U$,L$,J9,pJ,N9,U9,IZ=class extends(J9=MJ,L$=[T],U$=[T],J9){constructor(J,Q){var Z=J,{element:$,effects:q=()=>[],handle:Y}=Z,H=c2(Z,["element","effects","handle"]);super(FZ({effects:()=>[...q(),()=>{var K,X;let{manager:B}=this;if(!B)return;let W=((X=(K=this.sensors)==null?void 0:K.map(CQ))!=null?X:[...B.sensors]).map((G)=>{let L=G instanceof aJ?G:B.registry.register(G.plugin),F=G instanceof aJ?void 0:G.options;return L.bind(this,F)});return function(){W.forEach((L)=>L())}}]},H),Q);m(this,N9,l(pJ,8,this)),l(pJ,11,this),m(this,U9,l(pJ,12,this)),l(pJ,15,this),this.element=$,this.handle=Y}};pJ=pQ(J9);N9=new WeakMap;U9=new WeakMap;FJ(pJ,4,"handle",L$,IZ,N9);FJ(pJ,4,"element",U$,IZ,U9);WQ(pJ,IZ);var G$,V$,Q9,dJ,L9,c1,F$,z$,VZ,G9,M0=class extends(Q9=wJ,V$=[T],G$=[T],Q9){constructor(J,Q){var Z=J,{element:$,effects:q=()=>[]}=Z,Y=c2(Z,["element","effects"]);let{collisionDetector:H=x2}=Y,K=(B)=>{let{manager:N,element:W}=this;if(!W||B===null){this.shape=void 0;return}if(!N)return;let G=new hJ(W),L=C(()=>this.shape);if(G&&(L==null?void 0:L.equals(G)))return L;return this.shape=G,G},X=IJ(!1);super($9(FZ({},Y),{collisionDetector:H,effects:()=>[...q(),()=>{let{element:B,manager:N}=this;if(!N)return;let{dragOperation:W}=N,{source:G}=W;X.value=Boolean(G&&W.status.initialized&&B&&!this.disabled&&this.accepts(G))},()=>{let{element:B}=this;if(X.value&&B){let N=new O2(B,K);return()=>{N.disconnect(),this.shape=void 0}}},()=>{var B;if((B=this.manager)==null?void 0:B.dragOperation.status.initialized)return()=>{this.shape=void 0}}]}),Q);m(this,VZ),m(this,L9,l(dJ,8,this)),l(dJ,11,this),m(this,G9,l(dJ,12,this)),l(dJ,15,this),this.element=$,this.refreshShape=()=>K()}set element(J){qJ(this,VZ,J,z$)}get element(){var J;return(J=this.proxy)!=null?J:x(this,VZ,F$)}};dJ=pQ(Q9);L9=new WeakMap;VZ=new WeakSet;G9=new WeakMap;c1=FJ(dJ,20,"#element",V$,VZ,L9),F$=c1.get,z$=c1.set;FJ(dJ,4,"proxy",G$,M0,G9);WQ(dJ,M0);var D=TZ(x0(),1);var d=TZ(x0(),1);var V9=TZ(N5(),1);function B5(J){return J!=null&&typeof J==="object"&&"current"in J}function BQ(J){var Q;if(J==null)return;if(B5(J))return(Q=J.current)!=null?Q:void 0;return J}var U5=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",NQ=U5?d.useLayoutEffect:d.useEffect;function M$(){let J=d.useState(0)[1];return d.useCallback(()=>{J((Q)=>Q+1)},[J])}function L5(J,Q=!1){let Z=d.useRef(J.peek()),$=d.useRef(!1),q=M$();return NQ(()=>o(()=>{let Y=Z.current,H=J.value;if(Y!==H){if(Z.current=H,!$.current)return;if(Q)V9.flushSync(q);else q()}}),[J,Q,q]),{get value(){return $.current=!0,J.peek()}}}function w$(J,Q=[],Z=!1){let $=d.useRef(J);return $.current=J,L5(d.useMemo(()=>AQ(()=>$.current()),Q),Z)}function w0(J,Q){let Z=d.useRef(new Map),$=M$();return NQ(()=>{if(!J){Z.current.clear();return}return o(()=>{var q;let Y=!1,H=!1;for(let K of Z.current){let[X]=K,B=C(()=>K[1]),N=J[X];if(B!==N)Y=!0,Z.current.set(X,N),H=(q=Q==null?void 0:Q(X,B,N))!=null?q:!1}if(Y)if(H)queueMicrotask(()=>V9.flushSync($));else $()})},[J]),d.useMemo(()=>J?new Proxy(J,{get(q,Y){let H=q[Y];return Z.current.set(Y,H),H}}):J,[J])}function NH(J,Q){J()}function UQ(J){let Q=d.useRef(J);return NQ(()=>{Q.current=J},[J]),Q}function a(J,Q,Z=d.useEffect,$=Object.is){let q=d.useRef(J);Z(()=>{let Y=q.current;if(!$(J,Y))q.current=J,Q(J,Y)},[Q,J])}function A0(J,Q){let Z=d.useRef(BQ(J));NQ(()=>{let $=BQ(J);if($!==Z.current)Z.current=$,Q($)})}var{defineProperty:G5,defineProperties:V5,getOwnPropertyDescriptors:F5,getOwnPropertySymbols:j0}=Object,I$=Object.prototype.hasOwnProperty,j$=Object.prototype.propertyIsEnumerable,A$=(J,Q,Z)=>(Q in J)?G5(J,Q,{enumerable:!0,configurable:!0,writable:!0,value:Z}):J[Q]=Z,O$=(J,Q)=>{for(var Z in Q||(Q={}))if(I$.call(Q,Z))A$(J,Z,Q[Z]);if(j0){for(var Z of j0(Q))if(j$.call(Q,Z))A$(J,Z,Q[Z])}return J},R$=(J,Q)=>V5(J,F5(Q)),z5=(J,Q)=>{var Z={};for(var $ in J)if(I$.call(J,$)&&Q.indexOf($)<0)Z[$]=J[$];if(J!=null&&j0){for(var $ of j0(J))if(Q.indexOf($)<0&&j$.call(J,$))Z[$]=J[$]}return Z},M5=new B9,M9=D.createContext(M5),w5=D.memo(D.forwardRef(({children:J},Q)=>{let[Z,$]=D.useState(0),q=D.useRef(null),Y=D.useRef(null),H=D.useMemo(()=>({renderer:{get rendering(){var K;return(K=q.current)!=null?K:Promise.resolve()}},trackRendering(K){if(!q.current)q.current=new Promise((X)=>{Y.current=X});D.startTransition(()=>{K(),$((X)=>X+1)})}}),[]);return NQ(()=>{var K;(K=Y.current)==null||K.call(Y),q.current=null},[J,Z]),D.useImperativeHandle(Q,()=>H),null})),F9=[void 0,EJ];function wH(J){var Q=J,{children:Z,onCollision:$,onBeforeDragStart:q,onDragStart:Y,onDragMove:H,onDragOver:K,onDragEnd:X}=Q,B=z5(Q,["children","onCollision","onBeforeDragStart","onDragStart","onDragMove","onDragOver","onDragEnd"]);let N=D.useRef(null),{plugins:W,modifiers:G,sensors:L}=B,F=VJ(W,HQ.plugins),z=VJ(L,HQ.sensors),A=VJ(G,HQ.modifiers),I=UQ(q),U=UQ(Y),M=UQ(K),V=UQ(H),w=UQ(X),f=UQ($),j=A5(()=>{var p;return(p=B.manager)!=null?p:new B9(B)});return D.useEffect(()=>{if(!N.current)throw Error("Renderer not found");let{renderer:p,trackRendering:b}=N.current,{monitor:y}=j;j.renderer=p;let GQ=[y.addEventListener("beforedragstart",(s)=>{let v=I.current;if(v)b(()=>v(s,j))}),y.addEventListener("dragstart",(s)=>{var v;return(v=U.current)==null?void 0:v.call(U,s,j)}),y.addEventListener("dragover",(s)=>{let v=M.current;if(v)b(()=>v(s,j))}),y.addEventListener("dragmove",(s)=>{let v=V.current;if(v)b(()=>v(s,j))}),y.addEventListener("dragend",(s)=>{let v=w.current;if(v)b(()=>v(s,j))}),y.addEventListener("collision",(s)=>{var v;return(v=f.current)==null?void 0:v.call(f,s,j)})];return()=>GQ.forEach((s)=>s())},[j]),a(F,()=>j&&(j.plugins=F),...F9),a(z,()=>j&&(j.sensors=z),...F9),a(A,()=>j&&(j.modifiers=A),...F9),PZ(M9.Provider,{value:j,children:[TJ(w5,{ref:N,children:Z}),Z]})}function A5(J){let Q=D.useRef(null);if(!Q.current)Q.current=J();return D.useInsertionEffect(()=>{return()=>{var Z;return(Z=Q.current)==null?void 0:Z.destroy()}},[]),Q.current}function D$(){return D.useContext(M9)}function C$(J){var Q;let Z=(Q=D$())!=null?Q:void 0,[$]=D.useState(()=>J(Z));if($.manager!==Z)$.manager=Z;return NQ($.register,[Z,$]),$}function AH(J){let{disabled:Q,data:Z,element:$,handle:q,id:Y,modifiers:H,sensors:K,plugins:X}=J,B=C$((W)=>new IZ(R$(O$({},J),{register:!1,handle:BQ(q),element:BQ($)}),W)),N=w0(B,I5);return a(Y,()=>B.id=Y),A0(q,(W)=>B.handle=W),A0($,(W)=>B.element=W),a(Z,()=>Z&&(B.data=Z)),a(Q,()=>B.disabled=Q===!0),a(K,()=>B.sensors=K),a(H,()=>B.modifiers=H,void 0,EJ),a(X,()=>B.plugins=X,void 0,EJ),a(J.alignment,()=>B.alignment=J.alignment),{draggable:N,get isDragging(){return N.isDragging},get isDropping(){return N.isDropping},get isDragSource(){return N.isDragSource},handleRef:D.useCallback((W)=>{B.handle=W!=null?W:void 0},[B]),ref:D.useCallback((W)=>{var G,L;if(!W&&((G=B.element)==null?void 0:G.isConnected)&&!((L=B.manager)==null?void 0:L.dragOperation.status.idle))return;B.element=W!=null?W:void 0},[B])}}function I5(J,Q,Z){if(J==="isDragSource"&&!Z&&Q)return!0;return!1}function IH({children:J,className:Q,dropAnimation:Z,style:$,tag:q,disabled:Y}){var H;let K=D.useRef(null),X=D$(),B=(H=w$(()=>X==null?void 0:X.dragOperation.source,[X]).value)!=null?H:null,N=typeof Y==="function"?Y(B):Y;D.useEffect(()=>{if(!K.current||!X||N)return;let L=X.plugins.find((F)=>F instanceof F0);if(!L)return;return L.overlay=K.current,()=>{L.overlay=void 0}},[X,N]),D.useEffect(()=>{if(!X)return;let L=X.plugins.find((F)=>F instanceof F0);if(!L)return;return L.dropAnimation=Z,()=>{L.dropAnimation=void 0}},[X,Z]);let W=D.useMemo(()=>{if(!X)return null;let L=new Proxy(X.registry,{get(F,z){if(z==="register"||z==="unregister")return j5;return F[z]}});return new Proxy(X,{get(F,z){if(z==="registry")return L;return F[z]}})},[X]);return TJ(M9.Provider,{value:W,children:D.createElement(q||"div",{ref:K,className:Q,style:$,"data-dnd-overlay":!0},G())});function G(){if(!B||N)return null;if(typeof J==="function")return TJ(O5,{source:B,children:J});return J}}function j5(){return()=>{}}function O5({children:J,source:Q}){return J(w0(Q))}var{create:R5,defineProperty:T$,getOwnPropertyDescriptor:D5}=Object,P$=(J,Q)=>(Q=Symbol[J])?Q:Symbol.for("Symbol."+J),O0=(J)=>{throw TypeError(J)},C5=(J,Q,Z)=>(Q in J)?T$(J,Q,{enumerable:!0,configurable:!0,writable:!0,value:Z}):J[Q]=Z,T5=(J)=>{var Q;return[,,,R5((Q=J==null?void 0:J[P$("metadata")])!=null?Q:null)]},E$=["class","method","getter","setter","accessor","field","value","get","set"],S$=(J)=>J!==void 0&&typeof J!=="function"?O0("Function expected"):J,P5=(J,Q,Z,$,q)=>({kind:E$[J],name:Q,metadata:$,addInitializer:(Y)=>Z._?O0("Already initialized"):q.push(S$(Y||null))}),E5=(J,Q)=>C5(Q,P$("metadata"),J[3]),S5=(J,Q,Z,$)=>{for(var q=0,Y=J[Q>>1],H=Y&&Y.length;q<H;q++)Y[q].call(Z);return $},k$=(J,Q,Z,$,q,Y)=>{var H,K,X,B,N=Q&7,W=!1,G=!1,L=2,F=E$[N+5],z=J[L]||(J[L]=[]),A=(q=q.prototype,D5(q,Z));for(var I=$.length-1;I>=0;I--)X=P5(N,Z,K={},J[3],z),X.static=W,X.private=G,B=X.access={has:(U)=>(Z in U)},B.get=(U)=>U[Z],H=(0,$[I])(A[F],X),K._=1,S$(H)&&(A[F]=H);return A&&T$(q,Z,A),q},x$=(J,Q,Z)=>Q.has(J)||O0("Cannot "+Z),k5=(J,Q,Z)=>(x$(J,Q,"read from private field"),Q.get(J)),x5=(J,Q,Z)=>Q.has(J)?O0("Cannot add the same private member more than once"):Q instanceof WeakSet?Q.add(J):Q.set(J,Z),h5=(J,Q,Z,$)=>(x$(J,Q,"write to private field"),Q.set(J,Z),Z),LQ=class J{constructor(Q,Z){this.x=Q,this.y=Z}static delta(Q,Z){return new J(Q.x-Z.x,Q.y-Z.y)}static distance(Q,Z){return Math.hypot(Q.x-Z.x,Q.y-Z.y)}static equals(Q,Z){return Q.x===Z.x&&Q.y===Z.y}static from({x:Q,y:Z}){return new J(Q,Z)}},h$,y$,z9,I0,jZ,w9=class extends(z9=jJ,y$=[h],h$=[h],z9){constructor(J){let Q=LQ.from(J);super(Q,(Z,$)=>LQ.equals(Z,$));S5(jZ,5,this),x5(this,I0,0),this.velocity={x:0,y:0}}get delta(){return LQ.delta(this.current,this.initial)}get direction(){let{current:J,previous:Q}=this;if(!Q)return null;let Z={x:J.x-Q.x,y:J.y-Q.y};if(!Z.x&&!Z.y)return null;if(Math.abs(Z.x)>Math.abs(Z.y))return Z.x>0?"right":"left";return Z.y>0?"down":"up"}get current(){return super.current}set current(J){let{current:Q}=this,Z=LQ.from(J),$={x:Z.x-Q.x,y:Z.y-Q.y},q=Date.now(),Y=q-k5(this,I0),H=(K)=>Math.round(K/Y*100);JJ(()=>{h5(this,I0,q),this.velocity={x:H($.x),y:H($.y)},super.current=Z})}reset(J=this.defaultValue){super.reset(LQ.from(J)),this.velocity={x:0,y:0}}};jZ=T5(z9);I0=new WeakMap;k$(jZ,2,"delta",y$,w9);k$(jZ,2,"direction",h$,w9);E5(jZ,w9);var f$=((J)=>{return J.Horizontal="x",J.Vertical="y",J})(f$||{});Object.values(f$);var y5=({dragOperation:J,droppable:Q})=>{let Z=J.position.current;if(!Z)return null;let{id:$}=Q;if(!Q.shape)return null;if(Q.shape.containsPoint(Z)){let q=LQ.distance(Q.shape.center,Z);return{id:$,value:1/q,type:RJ.PointerIntersection,priority:OJ.High}}return null},f5=({dragOperation:J,droppable:Q})=>{let{shape:Z}=J;if(!Q.shape||!(Z==null?void 0:Z.current))return null;let $=Z.current.intersectionArea(Q.shape);if($){let{position:q}=J,Y=LQ.distance(Q.shape.center,q.current),K=$/(Z.current.area+Q.shape.area-$)/Y;return{id:Q.id,value:K,type:RJ.ShapeIntersection,priority:OJ.Normal}}return null},v5=(J)=>{var Q;return(Q=y5(J))!=null?Q:f5(J)};function jH(J){let{collisionDetector:Q,data:Z,disabled:$,element:q,id:Y,accept:H,type:K}=J,X=C$((N)=>new M0(R$(O$({},J),{register:!1,element:BQ(q)}),N)),B=w0(X);return a(Y,()=>X.id=Y),A0(q,(N)=>X.element=N),a(H,()=>X.accept=H,void 0,EJ),a(Q,()=>X.collisionDetector=Q!=null?Q:v5),a(Z,()=>Z&&(X.data=Z)),a($,()=>X.disabled=$===!0),a(K,()=>X.type=K),{droppable:B,get isDropTarget(){return B.isDropTarget},ref:D.useCallback((N)=>{var W,G;if(!N&&((W=X.element)==null?void 0:W.isConnected)&&!((G=X.manager)==null?void 0:G.dragOperation.status.idle))return;X.element=N!=null?N:void 0},[X])}}
71
- export{JJ as ha,C as ia,o as ja,EJ as ka,T as la,o5 as ma,XJ as na,EQ as oa,$J as pa,z8 as qa,VJ as ra,NJ as sa,iZ as ta,g1 as ua,m1 as va,DJ as wa,T2 as xa,P2 as ya,OK as za,hJ as Aa,K0 as Ba,x2 as Ca,gK as Da,F0 as Ea,z0 as Fa,B$ as Ga,bQ as Ha,N$ as Ia,IZ as Ja,M0 as Ka,BQ as La,NQ as Ma,w0 as Na,NH as Oa,a as Pa,A0 as Qa,wH as Ra,C$ as Sa,AH as Ta,IH as Ua,jH as Va,b5 as Wa};
71
+ export{JJ as ga,C as ha,o as ia,EJ as ja,T as ka,o5 as la,XJ as ma,EQ as na,$J as oa,z8 as pa,VJ as qa,NJ as ra,iZ as sa,g1 as ta,m1 as ua,DJ as va,T2 as wa,P2 as xa,OK as ya,hJ as za,K0 as Aa,x2 as Ba,gK as Ca,F0 as Da,z0 as Ea,B$ as Fa,bQ as Ga,N$ as Ha,IZ as Ia,M0 as Ja,BQ as Ka,NQ as La,w0 as Ma,NH as Na,a as Oa,A0 as Pa,wH as Qa,C$ as Ra,AH as Sa,IH as Ta,jH as Ua,b5 as Va};