@shumai-one/shumai 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/{chunk-qag3w2dd.js → chunk-0aj303as.js} +1 -1
- package/bin/{chunk-976v5s8y.js → chunk-0qkj838r.js} +1 -1
- package/bin/{chunk-mg6fce5x.js → chunk-0rxhc7ka.js} +1 -1
- package/bin/chunk-0xbf8bcg.js +2 -0
- package/bin/{chunk-t1mxqskx.js → chunk-15sefy5t.js} +1 -1
- package/bin/{chunk-jfjcxyhf.js → chunk-1wm57c6y.js} +3 -3
- package/bin/{chunk-7ktvhtp1.js → chunk-1xpec5r8.js} +1 -1
- package/bin/chunk-23d3968z.js +2 -0
- package/bin/{chunk-y4s3xr4n.js → chunk-262hkppb.js} +2 -2
- package/bin/{chunk-qj2kpkje.js → chunk-29tx9qe2.js} +1 -1
- package/bin/{chunk-a5s5ny4z.js → chunk-2aamsc5v.js} +1 -1
- package/bin/{chunk-gd5xwgp6.js → chunk-2aascrtb.js} +1 -1
- package/bin/chunk-2g12s6mc.js +2 -0
- package/bin/{chunk-pv76qkym.js → chunk-31baz5n0.js} +1 -1
- package/bin/{chunk-hmsb7ehr.js → chunk-46ar48f9.js} +1 -1
- package/bin/chunk-4e3jbp84.js +1 -0
- package/bin/chunk-4jk0y1w1.js +1 -0
- package/bin/{chunk-ga0drqj7.js → chunk-4qpa7b5t.js} +1 -1
- package/bin/{chunk-99db4j0k.js → chunk-54tr7y2x.js} +1 -1
- package/bin/{chunk-9n783gva.js → chunk-5d2q46mx.js} +1 -1
- package/bin/{chunk-qf7n519d.js → chunk-5m9be8an.js} +2 -2
- package/bin/{chunk-1w9dnk5p.js → chunk-5r8858hx.js} +1 -1
- package/bin/{chunk-ydagqpny.js → chunk-5t6c3038.js} +1 -1
- package/bin/chunk-6z65xd0w.js +3 -0
- package/bin/{chunk-qjjr3fff.js → chunk-77r8w95d.js} +1 -1
- package/bin/chunk-7e06b2zb.js +2 -0
- package/bin/{chunk-58aabg1f.js → chunk-7hsgmjpa.js} +2 -2
- package/bin/{chunk-7mnezagc.js → chunk-88fg1sw7.js} +1 -1
- package/bin/{chunk-m11g9hx7.js → chunk-8mkfgcvb.js} +2 -2
- package/bin/chunk-8tf6kgdj.js +2 -0
- package/bin/{chunk-b9hb5jzt.js → chunk-8wqfkm4c.js} +1 -1
- package/bin/{chunk-ag35pxnb.js → chunk-922nnh39.js} +1 -1
- package/bin/{chunk-ymyyap80.js → chunk-925q4paa.js} +1 -1
- package/bin/{chunk-wfex9jw0.js → chunk-92xxys10.js} +6 -6
- package/bin/{chunk-0a5k9avd.js → chunk-97jzve52.js} +1 -1
- package/bin/{chunk-dzm2f82x.js → chunk-9ab6k4rq.js} +1 -1
- package/bin/{chunk-mwh2n8yt.js → chunk-9avkn3x1.js} +1 -1
- package/bin/{chunk-pmx9760x.js → chunk-9h027f50.js} +1 -1
- package/bin/chunk-av71yjaa.js +1 -0
- package/bin/{chunk-mjncyjwf.js → chunk-b8js74jk.js} +1 -1
- package/bin/{chunk-861dz0bf.js → chunk-bd71dp4j.js} +1 -1
- package/bin/{chunk-v3j7acwn.js → chunk-bs0fjz3w.js} +2 -2
- package/bin/chunk-byqc8tzq.js +1 -0
- package/bin/chunk-ccw7mjgq.js +5 -0
- package/bin/{chunk-kj751zje.js → chunk-cxhmr356.js} +1 -1
- package/bin/{chunk-hcz4snm7.js → chunk-d3wmdjze.js} +1 -1
- package/bin/{chunk-82w2419d.js → chunk-de99643r.js} +2 -2
- package/bin/{chunk-dwf5e5g3.js → chunk-dghtwyq1.js} +1 -1
- package/bin/{chunk-5k03xpzq.js → chunk-dqgv5yy1.js} +1 -1
- package/bin/{chunk-q72ax3m8.js → chunk-e3s3rz2e.js} +1 -1
- package/bin/{chunk-79n633wf.js → chunk-e52nga6c.js} +1 -1
- package/bin/{chunk-8abs8d48.js → chunk-e7ndw3hg.js} +2 -2
- package/bin/chunk-f14sqw1d.js +1 -0
- package/bin/chunk-f7sbkfmk.js +2 -0
- package/bin/{chunk-2xnys7v4.js → chunk-fa2g2wge.js} +1 -1
- package/bin/{chunk-044xt1se.js → chunk-fbte2rmd.js} +1 -1
- package/bin/{chunk-k1r17nfa.js → chunk-fcvtgx1y.js} +1 -1
- package/bin/chunk-fd5a3pdd.js +1 -0
- package/bin/{chunk-hqptebzb.js → chunk-fepymbka.js} +1 -1
- package/bin/{chunk-cpr05qng.js → chunk-fz88kkk1.js} +1 -1
- package/bin/chunk-g6zzg6v2.js +1 -0
- package/bin/{chunk-6724dtsx.js → chunk-g8th86na.js} +1 -1
- package/bin/chunk-gswbc6y9.js +2 -0
- package/bin/{chunk-pvy0gccg.js → chunk-gtrc5ka2.js} +1 -1
- package/bin/chunk-h0ytx8zc.js +2 -0
- package/bin/{chunk-mv8c5fky.js → chunk-hkbybhww.js} +1 -1
- package/bin/{chunk-e3c6hyz8.js → chunk-hr97a5j5.js} +1 -1
- package/bin/{chunk-7h75r7ep.js → chunk-j8qtab70.js} +1 -1
- package/bin/{chunk-jyjnt0s9.js → chunk-jf3vn5c3.js} +2 -2
- package/bin/{chunk-azfgjqjx.js → chunk-kfhtk3eh.js} +1 -1
- package/bin/chunk-kr06nrbx.js +2 -0
- package/bin/{chunk-nceqrqey.js → chunk-m4zpf9gg.js} +1 -1
- package/bin/{chunk-1ae8csk6.js → chunk-mqjzmn0e.js} +1 -1
- package/bin/{chunk-sp75qe28.js → chunk-mzg1h07d.js} +1 -1
- package/bin/{chunk-cj5qwc9c.js → chunk-nrwna4ha.js} +1 -1
- package/bin/chunk-nyhqy6q2.js +62 -0
- package/bin/{chunk-4zq8vxcy.css → chunk-pmswtfe3.css} +1 -1
- package/bin/chunk-pq18zenh.js +2 -0
- package/bin/{chunk-p3emandj.js → chunk-q24epdh8.js} +2 -2
- package/bin/{chunk-2djd6pq1.js → chunk-qksb0v3c.js} +2 -2
- package/bin/chunk-qqk51620.js +2 -0
- package/bin/chunk-r0w920zb.js +1 -0
- package/bin/{chunk-2dz8nn9v.js → chunk-re0b7sj7.js} +1 -1
- package/bin/{chunk-x9q2vzn8.js → chunk-rtngbgpk.js} +1 -1
- package/bin/{chunk-zn9jbc6t.js → chunk-ry33f2qk.js} +1 -1
- package/bin/{chunk-k5bekrrp.js → chunk-s46zwr4p.js} +1 -1
- package/bin/chunk-s8t74q9m.js +1 -0
- package/bin/chunk-sd86v1e6.js +1 -0
- package/bin/{chunk-v98yavtp.js → chunk-srn8t0v7.js} +1 -1
- package/bin/chunk-szzff7gd.js +1 -0
- package/bin/{chunk-46c5xkmn.js → chunk-t3t6021k.js} +1 -1
- package/bin/{chunk-jbde7evp.js → chunk-thsbcbay.js} +1 -1
- package/bin/chunk-tspps87j.js +1 -0
- package/bin/{chunk-v05d1aeq.js → chunk-w7dn1m95.js} +1 -1
- package/bin/{chunk-w1d5vmtc.js → chunk-wc8sc9r9.js} +1 -1
- package/bin/chunk-wg98cacx.js +2 -0
- package/bin/chunk-wsyg4rwg.js +2 -0
- package/bin/{chunk-ga3mh3cd.js → chunk-xcwbg4w9.js} +1 -1
- package/bin/{chunk-9bpjfkjf.js → chunk-xyjw8w3r.js} +1 -1
- package/bin/chunk-y2qp11v9.js +1 -0
- package/bin/{chunk-ngd23mtc.js → chunk-ybhgmvxa.js} +1 -1
- package/bin/{chunk-phw4ne8b.js → chunk-ygz6pawn.js} +1 -1
- package/bin/{chunk-hy50c4pw.js → chunk-ymeycphq.js} +2 -2
- package/bin/{chunk-c1v946wb.js → chunk-zemrvz79.js} +2 -2
- package/bin/{chunk-29pkpmvy.js → chunk-zzx99j8t.js} +1 -1
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +248 -224
- package/package.json +7 -7
- package/prisma/migrations/20260723025234_add_ai_usage_table/migration.sql +28 -0
- package/prisma/migrations/20260723032755_add_ai_usage_unique_constraint/migration.sql +8 -0
- package/prisma/schema.prisma +25 -0
- package/bin/chunk-211y81mp.js +0 -1
- package/bin/chunk-25d1g086.js +0 -2
- package/bin/chunk-4fnak2zn.js +0 -2
- package/bin/chunk-50ebjdkv.js +0 -2
- package/bin/chunk-5j7axztv.js +0 -2
- package/bin/chunk-6h4ay2p8.js +0 -2
- package/bin/chunk-6w5cn6p3.js +0 -3
- package/bin/chunk-75jka5v9.js +0 -5
- package/bin/chunk-9evm8x70.js +0 -1
- package/bin/chunk-bepnbw1g.js +0 -2
- package/bin/chunk-bg24g9kk.js +0 -1
- package/bin/chunk-dqtq9t8e.js +0 -1
- package/bin/chunk-fgnxtqtk.js +0 -1
- package/bin/chunk-fxvb6g2r.js +0 -1
- package/bin/chunk-kjkmh26f.js +0 -1
- package/bin/chunk-m3dwydr3.js +0 -2
- package/bin/chunk-mk1jewvw.js +0 -2
- package/bin/chunk-q9sgjs4d.js +0 -1
- package/bin/chunk-s2725w64.js +0 -1
- package/bin/chunk-saq5797j.js +0 -1
- package/bin/chunk-sy8rqacm.js +0 -2
- package/bin/chunk-t84t3v6q.js +0 -1
- package/bin/chunk-ttsqdsxr.js +0 -2
- package/bin/chunk-vreq89j6.js +0 -1
- package/bin/chunk-wbhsmhgp.js +0 -2
- package/bin/chunk-wf4d1anc.js +0 -62
- package/bin/chunk-xv4mfppt.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
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"})]})}
|
|
1
|
+
import{Qj as k,dk as F,fk as A,gk as V,oh as t,ph as R}from"./chunk-nyhqy6q2.js";import{Yk as l}from"./chunk-0qkj838r.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
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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Sa as BK,Ua as gJ}from"./chunk-srn8t0v7.js";import{Wa as ZJ}from"./chunk-kfhtk3eh.js";import{$a as _K,_a as ZK,ab as $K,bb as GK,cb as zK,db as QK,eb as HK,fb as UK}from"./chunk-0xbf8bcg.js";import{og as $J}from"./chunk-fa2g2wge.js";import{Qg as N,Rg as QJ,Tg as HJ,Ug as UJ,Vg as w,Zg as KK,ch as WK,dh as XK,eh as TJ,fh as RJ,gh as SJ,hh as fJ,ih as hJ,jh as YK}from"./chunk-gswbc6y9.js";import{$h as zJ,Ah as h,Ai as XJ,Bh as GJ,Bi as YJ,Cj as uJ,Di as tJ,Ji as DJ,Pi as eJ,Qh as z,Sh as U,Wi as kJ,ai as p,ei as nJ,gi as aJ,gk as O,mh as NK,mk as W,nh as iJ,oh as J,oj as wJ,ph as X,pi as rJ,qh as lJ,uj as JK,vh as v,wh as _J,wi as oJ,yi as sJ,zh as dJ}from"./chunk-nyhqy6q2.js";import{Vk as vK}from"./chunk-0qkj838r.js";var _=vK(NK(),1);function cK({teamId:B,projectId:Z,projectName:$,rootFolderId:P,dragState:b,onSelect:M,selectedFolderId:A,hideCollections:m,hideShares:C,ancestorFolders:D}){let q=GJ(),Q=lJ(),{canEdit:V}=WK(Z),j=dJ({from:"/projects/$projectId/recently-deleted",shouldThrow:!1}),[L,r]=_.useState(!0),[T,BJ]=_.useState(!0),[u,bJ]=_.useState(!0),{data:c,fetchNextPage:i,hasNextPage:g,isFetchingNextPage:R}=_J({queryKey:["shares",Z],queryFn:async({pageParam:K})=>{let Y=await U.api.projects[":projectId"].shares.$get({param:{projectId:Z},query:{first:"20",after:K}});if(!Y.ok)throw Error(W.failed_fetch_share_links());return await Y.json()},initialPageParam:"",getNextPageParam:(K)=>K.pageInfo?.cursor||void 0,enabled:!!Z}),{data:l,fetchNextPage:o,hasNextPage:d,isFetchingNextPage:n}=_J({queryKey:["collections",Z],queryFn:async({pageParam:K})=>{let Y=await U.api.projects[":projectId"].collections.$get({param:{projectId:Z},query:{first:"20",after:K}});if(!Y.ok)throw Error(W.failed_fetch_collections());return await Y.json()},initialPageParam:"",getNextPageParam:(K)=>K.pageInfo?.cursor||void 0,enabled:!!Z}),{ref:qJ,inView:s}=$J(),{ref:VJ,inView:t}=$J();_.useEffect(()=>{if(s&&d&&!n)o()},[s,d,n,o]),_.useEffect(()=>{if(t&&g&&!R)i()},[t,g,R,i]);let AJ=_.useMemo(()=>l?.pages.flatMap((K)=>K.data)||[],[l]),OJ=_.useMemo(()=>c?.pages.flatMap((K)=>K.data)||[],[c]),{mutate:PJ}=v({mutationFn:async()=>{let K=await U.api.projects[":projectId"].collections.$post({param:{projectId:Z},json:{name:W.untitled_collection(),filter:{sourceFolderId:P,searchFilter:{conditions:[],recursively:!0}}}});if(!K.ok)throw Error(W.failed_create_collection());return await K.json()},onSuccess:(K)=>{Q.invalidateQueries({queryKey:["collections",Z]}),z.success(W.collection_created()),q({to:"/projects/$projectId/collections/$collectionId",params:{projectId:Z,collectionId:K.id}})},onError:(K)=>{z.error(`Error: ${K.message}`)}}),{mutate:MJ}=v({mutationFn:async()=>{let K=await U.api.projects[":projectId"].shares.$post({param:{projectId:Z},json:{name:new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}});if(!K.ok)throw Error(W.failed_create_share_link());return await K.json()},onSuccess:(K)=>{Q.invalidateQueries({queryKey:["shares",Z]}),z.success(W.share_link_created()),q({to:"/projects/$projectId/shares/$shareId",params:{projectId:Z,shareId:K.id}})},onError:(K)=>{z.error(`Error: ${K.message}`)}}),e=h({from:"/projects/$projectId/collections/$collectionId",shouldThrow:!1}),LJ=h({from:"/projects/$projectId/shares/$shareId",shouldThrow:!1}),G=h({from:"/projects/$projectId/folders/$folderId",shouldThrow:!1}),[y,yJ]=_.useState(null),[F,EJ]=_.useState("collection"),[E,JJ]=_.useState(""),[qK,k]=_.useState(!1),[vJ,NJ]=_.useState(null),[S,CJ]=_.useState("collection"),[VK,f]=_.useState(!1),{mutate:IJ}=v({mutationFn:async({id:K,name:Y})=>{let H=await U.api.folders[":folderId"].$put({param:{folderId:K},json:{name:Y}});if(!H.ok)throw Error(W.failed_rename_folder());return await H.json()},onSuccess:()=>{Q.invalidateQueries({queryKey:["search",B]}),Q.invalidateQueries({queryKey:["folders"]}),z.success(W.folder_renamed()),k(!1)},onError:(K)=>{z.error(`Error: ${K.message}`)}}),{mutate:AK}=v({mutationFn:async(K)=>{if(!(await U.api.folders.$delete({json:{ids:[K]}})).ok)throw Error(W.failed_delete_folder());return K},onSuccess:(K)=>{if(Q.invalidateQueries({queryKey:["search",B]}),Q.invalidateQueries({queryKey:["folders"]}),z.success(W.folder_deleted()),f(!1),G?.folderId===K)q({to:"/projects/$projectId",params:{projectId:Z}})},onError:(K)=>{z.error(`Error: ${K.message}`)}}),[OK,a]=_.useState(!1),[KJ,xJ]=_.useState(!1),[FJ,pJ]=_.useState([]),PK=async(K)=>{a(!0),xJ(!0),pJ([]);try{let Y=await U.api.files["download-links"].$post({json:{ids:[K]}});if(!Y.ok)throw Error(W.failed_to_prepare_download_links());let H=await Y.json();pJ(H.files)}catch(Y){z.error(W.failed_to_prepare_download_links()),a(!1),console.error(Y)}finally{xJ(!1)}},MK=()=>{let K=[...FJ];if(a(!1),K.length===0)return;z.info(W.starting_download_files({count:K.length}),{duration:5000});let Y=(WJ)=>new Promise((I)=>setTimeout(I,WJ));(async()=>{for(let I=0;I<K.length;I+=5){let EK=K.slice(I,I+5);for(let cJ of EK){let x=document.createElement("a");x.href=cJ.url,x.download=cJ.name,x.target="_blank",document.body.appendChild(x),x.click(),x.remove()}await Y(1000)}})().catch((WJ)=>{console.error("Background downloads failed:",WJ),z.error(W.some_downloads_failed())})},{mutate:mJ}=v({mutationFn:async({id:K,name:Y})=>{let H=await U.api.collections[":collectionId"].$patch({param:{collectionId:K},json:{name:Y}});if(!H.ok)throw Error(W.failed_rename_collection());return await H.json()},onSuccess:()=>{Q.invalidateQueries({queryKey:["collections",Z]}),z.success(W.collection_renamed()),k(!1)},onError:(K)=>{z.error(`Error: ${K.message}`)}}),{mutate:LK}=v({mutationFn:async(K)=>{let Y=await U.api.collections[":collectionId"].$delete({param:{collectionId:K}});if(!Y.ok)throw Error(W.failed_delete_collection());return await Y.json()},onSuccess:(K,Y)=>{if(Q.invalidateQueries({queryKey:["collections",Z]}),z.success(W.collection_deleted()),f(!1),e?.collectionId===Y)q({to:"/projects/$projectId",params:{projectId:Z}})},onError:(K)=>{z.error(`Error: ${K.message}`)}}),{mutate:jJ}=v({mutationFn:async({id:K,name:Y})=>{let H=await U.api.shares[":shareId"].$put({param:{shareId:K},json:{name:Y}});if(!H.ok)throw Error(W.failed_rename_share_link());return await H.json()},onSuccess:()=>{Q.invalidateQueries({queryKey:["shares",Z]}),z.success(W.share_link_renamed()),k(!1)},onError:(K)=>{z.error(`Error: ${K.message}`)}}),{mutate:yK}=v({mutationFn:async(K)=>{if(!(await U.api.shares[":shareId"].$delete({param:{shareId:K}})).ok)throw Error(W.failed_delete_share_link());return K},onSuccess:(K)=>{if(Q.invalidateQueries({queryKey:["shares",Z]}),z.success(W.share_link_deleted()),f(!1),LJ?.shareId===K)q({to:"/projects/$projectId",params:{projectId:Z}})},onError:(K)=>{z.error(`Error: ${K.message}`)}});return X("div",{className:"flex flex-col h-full overflow-hidden p-3 gap-4 bg-background",children:[X("div",{className:O("flex flex-col overflow-hidden transition-all duration-300 ease-in-out border-b border-border pb-4",L?"flex-1 min-h-[50%] h-full":"flex-none h-[44px] max-h-[44px]"),children:[J("header",{className:"group flex items-center justify-between px-2 mb-1 flex-none",children:X("div",{className:"flex-1 flex items-center gap-1.5 cursor-pointer select-none text-muted-foreground hover:text-foreground transition-colors",onClick:()=>r(!L),children:[J("h3",{className:"text-xs font-semibold uppercase tracking-wider",children:W.folder_tree_assets()}),L?J(XJ,{className:"h-3.5 w-3.5 opacity-0 group-hover:opacity-100 transition-opacity duration-200"}):J(YJ,{className:"h-3.5 w-3.5 opacity-0 group-hover:opacity-100 transition-opacity duration-200"})]})}),J(ZJ,{className:O("flex-1 min-h-0 transition-all duration-300 ease-in-out [&>div>div]:block!",L?"opacity-100 visible pointer-events-auto":"opacity-0 invisible pointer-events-none h-0"),children:X("div",{className:"space-y-0.5 pr-3",children:[J(bK,{teamId:B,projectId:Z,folder:{id:P,name:$,type:"folder",sizeByte:0,fileCount:0,status:"processed",createdAt:"",updatedAt:""},level:0,isRoot:!0,dragState:b,onSelect:M,selectedFolderId:A,canEdit:V,onRenameTrigger:(K,Y)=>{yJ(K),EJ("folder"),JJ(Y),k(!0)},onDeleteTrigger:(K)=>{NJ(K),CJ("folder"),f(!0)},onDownloadTrigger:(K)=>{PK(K)},ancestorFolders:D},P),V&&X("div",{className:O("group flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",j&&"bg-sidebar-accent text-sidebar-accent-foreground font-medium"),onClick:()=>q({to:"/projects/$projectId/recently-deleted",params:{projectId:Z}}),children:[J("div",{className:"flex h-4 w-4 items-center justify-center",children:J(uJ,{className:"h-4 w-4 text-sidebar-primary"})}),J("span",{className:"flex-1 truncate text-sidebar-foreground",children:W.recently_deleted()})]})]})})]}),!m&&X("div",{className:O("flex flex-col overflow-hidden transition-all duration-300 ease-in-out border-b border-border pb-4",T?"flex-1 min-h-0 h-full":"flex-none h-[44px] max-h-[44px]"),children:[X("header",{className:"group flex items-center justify-between px-2 mb-1 flex-none",children:[X("div",{className:"flex-1 flex items-center gap-1.5 cursor-pointer select-none text-muted-foreground hover:text-foreground transition-colors",onClick:()=>BJ(!T),children:[J("h3",{className:"text-xs font-semibold uppercase tracking-wider",children:W.collections()}),T?J(XJ,{className:"h-3.5 w-3.5 opacity-0 group-hover:opacity-100 transition-opacity duration-200"}):J(YJ,{className:"h-3.5 w-3.5 opacity-0 group-hover:opacity-100 transition-opacity duration-200"})]}),V&&J("button",{onClick:()=>PJ(),className:"text-muted-foreground hover:text-foreground flex-none",children:J(wJ,{className:"h-3.5 w-3.5"})})]}),J(ZJ,{className:O("flex-1 min-h-0 transition-all duration-300 ease-in-out [&>div>div]:block!",T?"opacity-100 visible pointer-events-auto":"opacity-0 invisible pointer-events-none h-0"),children:X("div",{className:"space-y-0.5 pr-3",children:[X("div",{className:"group flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",onClick:()=>q({to:"/projects/$projectId/collections",params:{projectId:Z}}),children:[J("div",{className:"flex h-4 w-4 items-center justify-center",children:J(kJ,{className:"h-4 w-4 text-sidebar-primary"})}),J("span",{className:"flex-1 truncate text-sidebar-foreground",children:W.all_collections_count({count:l?.pages[0]?.pageInfo?.total||0})})]}),AJ.map((K)=>{let Y=e?.collectionId===K.id;return X("div",{className:O("group flex cursor-pointer items-center justify-between rounded-md px-2 py-1 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground min-w-0",Y&&"bg-sidebar-accent text-sidebar-accent-foreground font-medium"),onClick:()=>q({to:"/projects/$projectId/collections/$collectionId",params:{projectId:Z,collectionId:K.id}}),children:[X("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[J("div",{className:"flex h-4 w-4 items-center justify-center shrink-0",children:J(rJ,{className:"h-4 w-4 text-sidebar-primary"})}),J("span",{className:"truncate text-sidebar-foreground flex-1",children:K.name})]}),V&&J("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0",onClick:(H)=>H.stopPropagation(),children:X(QJ,{modal:!1,children:[J(HJ,{asChild:!0,children:J(N,{variant:"ghost",size:"icon-sm",className:"h-6 w-6 shrink-0 hover:bg-muted hover:text-muted-foreground p-0",children:J(zJ,{className:"h-3.5 w-3.5"})})}),X(UJ,{align:"end",className:"w-32",children:[J(w,{onClick:()=>{yJ(K.id),EJ("collection"),JJ(K.name),k(!0)},children:W.rename()}),J(w,{className:"text-destructive focus:text-destructive focus:bg-destructive/10",onClick:()=>{NJ(K.id),CJ("collection"),f(!0)},children:W.delete()})]})]})})]},K.id)}),J("div",{ref:qJ,className:"h-1"}),n&&J("div",{className:"flex justify-center p-2",children:J(p,{className:"h-4 w-4 animate-spin text-muted-foreground"})})]})})]}),!C&&X("div",{className:O("flex flex-col overflow-hidden transition-all duration-300 ease-in-out",u?"flex-1 min-h-0 h-full":"flex-none h-[44px] max-h-[44px]"),children:[X("header",{className:"group flex items-center justify-between px-2 mb-1 flex-none",children:[X("div",{className:"flex-1 flex items-center gap-1.5 cursor-pointer select-none text-muted-foreground hover:text-foreground transition-colors",onClick:()=>bJ(!u),children:[J("h3",{className:"text-xs font-semibold uppercase tracking-wider",children:W.share_links()}),u?J(XJ,{className:"h-3.5 w-3.5 opacity-0 group-hover:opacity-100 transition-opacity duration-200"}):J(YJ,{className:"h-3.5 w-3.5 opacity-0 group-hover:opacity-100 transition-opacity duration-200"})]}),V&&J("div",{className:"flex items-center gap-1 flex-none",children:J("button",{onClick:()=>MJ(),className:"text-muted-foreground hover:text-foreground",children:J(wJ,{className:"h-3.5 w-3.5"})})})]}),J(ZJ,{className:O("flex-1 min-h-0 transition-all duration-300 ease-in-out [&>div>div]:block!",u?"opacity-100 visible pointer-events-auto":"opacity-0 invisible pointer-events-none h-0"),children:X("div",{className:"space-y-0.5 pr-3",children:[X("div",{className:"group flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",onClick:()=>q({to:"/projects/$projectId/shares",params:{projectId:Z}}),children:[J("div",{className:"flex h-4 w-4 items-center justify-center",children:J(kJ,{className:"h-4 w-4 text-sidebar-primary"})}),J("span",{className:"flex-1 truncate text-sidebar-foreground",children:W.all_share_links_count({count:c?.pages[0]?.pageInfo?.total||0})})]}),OJ.map((K)=>J(CK,{link:K,projectId:Z,dragState:b,canEdit:V,onRenameTrigger:(Y,H)=>{yJ(Y),EJ("share"),JJ(H),k(!0)},onDeleteTrigger:(Y)=>{NJ(Y),CJ("share"),f(!0)}},K.id)),J("div",{ref:VJ,className:"h-1"}),R&&J("div",{className:"flex justify-center p-2",children:J(p,{className:"h-4 w-4 animate-spin text-muted-foreground"})})]})})]}),J(TJ,{open:qK,onOpenChange:k,children:X(RJ,{onClick:(K)=>K.stopPropagation(),children:[J(SJ,{children:J(hJ,{children:F==="collection"?W.rename_collection():F==="share"?W.rename_share_link():W.rename_folder()})}),J("div",{className:"py-4",children:J(XK,{value:E,onChange:(K)=>JJ(K.target.value),placeholder:W.enter_new_name(),onKeyDown:(K)=>{if(K.key==="Enter"&&E.trim()){if(F==="collection")mJ({id:y,name:E});else if(F==="share")jJ({id:y,name:E});else if(F==="folder")IJ({id:y,name:E})}}})}),X(fJ,{children:[J(N,{variant:"ghost",onClick:()=>k(!1),children:W.cancel()}),J(N,{disabled:!E.trim(),onClick:()=>{if(F==="collection")mJ({id:y,name:E});else if(F==="share")jJ({id:y,name:E});else if(F==="folder")IJ({id:y,name:E})},children:W.rename()})]})]})}),J(ZK,{open:VK,onOpenChange:f,children:X(_K,{onClick:(K)=>K.stopPropagation(),children:[X($K,{children:[J(zK,{children:S==="collection"?W.delete_collection_confirm():S==="share"?W.delete_share_link_confirm():W.delete_folder_confirm()}),J(QK,{children:W.delete_confirm_description({type:S==="collection"?W.collection():S==="share"?W.share_link():W.folder().toLowerCase()})})]}),X(GK,{children:[J(UK,{children:W.cancel()}),J(HK,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{if(S==="collection")LK(vJ);else if(S==="share")yK(vJ);else if(S==="folder")AK(vJ)},children:W.delete()})]})]})}),J(TJ,{open:OK,onOpenChange:a,children:X(RJ,{className:"sm:max-w-md",children:[X(SJ,{children:[J(hJ,{children:KJ?W.preparing_download():W.confirm_download()}),J(YK,{children:KJ?W.resolving_files_wait():W.folder_files_download_description()})]}),KJ?X("div",{className:"space-y-4 py-6 flex flex-col items-center justify-center",children:[J(p,{className:"h-8 w-8 animate-spin text-primary"}),J("span",{className:"text-sm font-medium text-muted-foreground mt-2",children:W.preparing_download_links()})]}):X("div",{className:"space-y-4 py-2",children:[J("div",{className:"text-sm text-muted-foreground",children:W.download_includes_files({count:FJ.length})}),X("div",{className:"flex items-start gap-3 p-3 text-sm rounded-lg bg-amber-50 dark:bg-amber-950/30 text-amber-800 dark:text-amber-300 border border-amber-200 dark:border-amber-900/30",children:[J(aJ,{className:"h-5 w-5 shrink-0 mt-0.5"}),X("div",{children:[J("p",{className:"font-semibold",children:W.no_folder_structure()}),J("p",{className:"mt-0.5 text-xs text-amber-700/90 dark:text-amber-400/90",children:W.folder_structure_warning()})]})]})]}),J(fJ,{children:!KJ?X(iJ,{children:[J(N,{variant:"outline",onClick:()=>a(!1),children:W.cancel()}),X(N,{onClick:MK,className:"gap-2",disabled:FJ.length===0,children:[J(DJ,{className:"h-4 w-4"}),W.start_download()]})]}):J(N,{disabled:!0,variant:"outline",children:W.cancel()})})]})})]})}function CK({link:B,projectId:Z,dragState:$,canEdit:P,onRenameTrigger:b,onDeleteTrigger:M}){let A=GJ(),C=h({from:"/projects/$projectId/shares/$shareId",shouldThrow:!1})?.shareId===B.id,{ref:D,isDropTarget:q}=gJ({id:`share:${B.id}`,data:{type:"share-link",id:B.id}}),Q=!!$?.isActive;return X("div",{ref:D,className:O("group flex cursor-pointer items-center justify-between rounded-md px-2 py-1 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground min-w-0",C&&"bg-sidebar-accent text-sidebar-accent-foreground font-medium",q&&Q&&"bg-sidebar-accent ring-2 ring-primary ring-inset"),onClick:()=>A({to:"/projects/$projectId/shares/$shareId",params:{projectId:Z,shareId:B.id}}),children:[X("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[J("div",{className:"flex h-4 w-4 items-center justify-center shrink-0",children:J(JK,{className:"h-4 w-4 text-sidebar-primary"})}),J("span",{className:"truncate text-sidebar-foreground flex-1",children:B.name})]}),P&&J("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0",onClick:(V)=>V.stopPropagation(),children:X(QJ,{modal:!1,children:[J(HJ,{asChild:!0,children:J(N,{variant:"ghost",size:"icon-sm",className:"h-6 w-6 shrink-0 hover:bg-muted hover:text-muted-foreground p-0",children:J(zJ,{className:"h-3.5 w-3.5"})})}),X(UJ,{align:"end",className:"w-32",children:[J(w,{onClick:()=>{b(B.id,B.name)},children:W.rename()}),J(w,{className:"text-destructive focus:text-destructive focus:bg-destructive/10",onClick:()=>{M(B.id)},children:W.delete()})]})]})})]})}function bK({teamId:B,projectId:Z,folder:$,level:P,isRoot:b,dragState:M,onSelect:A,selectedFolderId:m,canEdit:C,onRenameTrigger:D,onDeleteTrigger:q,onDownloadTrigger:Q,ancestorFolders:V}){let j=_.useMemo(()=>{return V?.some((G)=>G.id===$.id)??!1},[V,$.id]),[L,r]=_.useState(b||j);_.useEffect(()=>{if(j)r(!0)},[j]);let T=GJ(),BJ=h({from:"/projects/$projectId/folders/$folderId",select:(G)=>({folderId:G.folderId}),shouldThrow:!1}),u=h({from:"/projects/$projectId/",shouldThrow:!1}),bJ=b?!!u:BJ?.folderId===$.id,{data:c,fetchNextPage:i,hasNextPage:g,isFetchingNextPage:R,isLoading:l}=_J({queryKey:["folders",$.id,"children",{assetType:"folder"}],queryFn:async({pageParam:G})=>{let y=await U.api.folders[":folderId"].children.$get({param:{folderId:$.id},query:{assetType:"folder",after:G,first:"20"}});if(!y.ok)throw Error(W.failed_to_fetch_folder_children());return await y.json()},initialPageParam:"",getNextPageParam:(G)=>{return G.pageInfo?.cursor||void 0},enabled:L||!!b}),{ref:o,inView:d}=$J();_.useEffect(()=>{if(d&&g&&!R)i()},[d,g,R,i]);let n=c?.pages.flatMap((G)=>G.data??[])??[],qJ=(G)=>{G.stopPropagation(),r(!L)},s=()=>{if(A){A($);return}if(b)T({to:"/projects/$projectId",params:{projectId:Z}});else T({to:"/projects/$projectId/folders/$folderId",params:{projectId:Z,folderId:$.id}})},{ref:VJ,isDragging:t}=BK({id:`tree:${$.id}`,data:{type:"folder",item:$},disabled:!!b||!!A||!C}),{ref:AJ,isDropTarget:OJ}=gJ({id:`tree:${$.id}`,data:{type:"folder",item:$},disabled:M?.draggedIds.has($.id)||!!A||!C}),PJ=(G)=>{VJ(G),AJ(G)},MJ=_.useMemo(()=>{if(A)return!1;if(!M?.isActive)return!1;if(M.draggedIds.has($.id))return!1;return!0},[M,$.id,A]),e=OJ&&MJ,LJ=m===$.id;return X("div",{children:[X("div",{ref:PJ,className:O("group flex cursor-pointer items-center gap-1 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground min-w-0",(bJ||LJ)&&"bg-sidebar-accent text-sidebar-accent-foreground font-medium",t&&"opacity-50",e&&"bg-sidebar-accent ring-2 ring-primary ring-inset"),style:{...b?{}:{paddingLeft:`${P*12+8}px`}},onClick:s,children:[!b&&J("button",{onClick:qJ,className:"flex h-4 w-4 items-center justify-center shrink-0",children:L?J(oJ,{className:"h-3 w-3"}):J(sJ,{className:"h-3 w-3"})}),b?J(tJ,{className:"h-4 w-4 text-sidebar-primary shrink-0"}):J(eJ,{className:"h-4 w-4 text-sidebar-primary shrink-0"}),J("span",{className:"flex-1 truncate text-sidebar-foreground",children:$.name}),C&&!b&&J("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0",onClick:(G)=>G.stopPropagation(),children:X(QJ,{modal:!1,children:[J(HJ,{asChild:!0,children:J(N,{variant:"ghost",size:"icon-sm",className:"h-6 w-6 shrink-0 hover:bg-muted hover:text-muted-foreground p-0",children:J(zJ,{className:"h-3.5 w-3.5"})})}),X(UJ,{align:"end",className:"w-32",children:[X(w,{onClick:()=>{D($.id,$.name)},children:[J(nJ,{className:"mr-2 h-4 w-4"}),W.rename()]}),X(w,{onClick:()=>{Q($.id)},children:[J(DJ,{className:"mr-2 h-4 w-4"}),W.download()]}),J(KK,{}),X(w,{className:"text-destructive focus:text-destructive focus:bg-destructive/10",onClick:()=>{q($.id)},children:[J(uJ,{className:"mr-2 h-4 w-4"}),W.delete()]})]})]})})]}),L&&X("div",{children:[l&&J("div",{className:"flex items-center justify-center p-2",style:{paddingLeft:`${(P+1)*12+8}px`},children:J(p,{className:"h-4 w-4 animate-spin"})}),n.map((G)=>J(bK,{teamId:B,projectId:Z,folder:G,level:P+1,dragState:M,onSelect:A,selectedFolderId:m,canEdit:C,onRenameTrigger:D,onDeleteTrigger:q,onDownloadTrigger:Q,ancestorFolders:V},G.id)),g&&J("div",{ref:o,className:"flex items-center justify-center p-2",style:{paddingLeft:`${(P+1)*12+8}px`},children:R&&J(p,{className:"h-4 w-4 animate-spin"})})]})]})}
|
|
2
|
+
export{cK as fa};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{vk as J}from"./chunk-j8qtab70.js";import{Ak as w}from"./chunk-zemrvz79.js";import{Qk as R}from"./chunk-re0b7sj7.js";import{Rk as j}from"./chunk-922nnh39.js";import{Uk as V}from"./chunk-9h027f50.js";function M(Q,E){let W={v:1,id:Q};if(E)W.phase=E;return JSON.stringify(W)}function C(Q){if(!Q)return;if(Q.startsWith("{"))try{let E=JSON.parse(Q);if(E.v===1&&typeof E.id==="string"){if(E.phase==="commentary"||E.phase==="final_answer")return{id:E.id,phase:E.phase};return{id:E.id}}}catch{}return{id:Q}}function x(Q,E,W,U){let _=[],N=(G)=>{let O=G.replace(/[^a-zA-Z0-9_-]/g,"_");return(O.length>64?O.slice(0,64):O).replace(/_+$/,"")},A=(G)=>{let O=`fc_${J(G)}`;return O.length>64?O.slice(0,64):O},y=(G,O,Y)=>{if(!W.has(Q.provider))return N(G);if(!G.includes("|"))return N(G);let[H,L]=G.split("|"),$=N(H),D=Y.provider!==Q.provider||Y.api!==Q.api?A(L):N(L);if(!D.startsWith("fc_"))D=N(`fc_${D}`);return`${$}|${D}`},Z=R(E.messages,Q,y);if((U?.includeSystemPrompt??!0)&&E.systemPrompt){let G=Q.reasoning?"developer":"system";_.push({role:G,content:V(E.systemPrompt)})}let q=0;for(let G of Z){if(G.role==="user")if(typeof G.content==="string")_.push({role:"user",content:[{type:"input_text",text:V(G.content)}]});else{let O=G.content.map((Y)=>{if(Y.type==="text")return{type:"input_text",text:V(Y.text)};return{type:"input_image",detail:"auto",image_url:`data:${Y.mimeType};base64,${Y.data}`}});if(O.length===0)continue;_.push({role:"user",content:O})}else if(G.role==="assistant"){let O=[],Y=G,H=Y.model!==Q.id&&Y.provider===Q.provider&&Y.api===Q.api,L=0;for(let $ of G.content)if($.type==="thinking"){if($.thinkingSignature){let X=JSON.parse($.thinkingSignature);O.push(X)}}else if($.type==="text"){let X=$,D=C(X.textSignature),f=L===0?`msg_pi_${q}`:`msg_pi_${q}_${L}`;L++;let F=D?.id;if(!F)F=f;else if(F.length>64)F=`msg_${J(F)}`;O.push({type:"message",role:"assistant",content:[{type:"output_text",text:V(X.text),annotations:[]}],status:"completed",id:F,phase:D?.phase})}else if($.type==="toolCall"){let X=$,[D,f]=X.id.split("|"),F=f;if(H&&F?.startsWith("fc_"))F=void 0;O.push({type:"function_call",id:F,call_id:D,name:X.name,arguments:JSON.stringify(X.arguments)})}if(O.length===0)continue;_.push(...O)}else if(G.role==="toolResult"){let O=G.content.filter((X)=>X.type==="text").map((X)=>X.text).join(`
|
|
3
3
|
`),Y=G.content.some((X)=>X.type==="image"),H=O.length>0,[L]=G.toolCallId.split("|"),$;if(Y&&Q.input.includes("image")){let X=[];if(H)X.push({type:"input_text",text:V(O)});for(let D of G.content)if(D.type==="image")X.push({type:"input_image",detail:"auto",image_url:`data:${D.mimeType};base64,${D.data}`});$=X}else $=V(H?O:"(see attached image)");_.push({type:"function_call_output",call_id:L,output:$})}q++}return _}function v(Q,E){let W=E?.strict===void 0?!1:E.strict;return Q.map((U)=>({type:"function",name:U.name,description:U.description,parameters:U.parameters,strict:W}))}async function B(Q,E,W,U,_){let N=null,A=null,y=E.content,Z=()=>y.length-1;for await(let K of Q)if(K.type==="response.created")E.responseId=K.response.id;else if(K.type==="response.output_item.added"){let q=K.item;if(q.type==="reasoning")N=q,A={type:"thinking",thinking:""},E.content.push(A),W.push({type:"thinking_start",contentIndex:Z(),partial:E});else if(q.type==="message")N=q,A={type:"text",text:""},E.content.push(A),W.push({type:"text_start",contentIndex:Z(),partial:E});else if(q.type==="function_call")N=q,A={type:"toolCall",id:`${q.call_id}|${q.id}`,name:q.name,arguments:{},partialJson:q.arguments||""},E.content.push(A),W.push({type:"toolcall_start",contentIndex:Z(),partial:E})}else if(K.type==="response.reasoning_summary_part.added"){if(N&&N.type==="reasoning")N.summary=N.summary||[],N.summary.push(K.part)}else if(K.type==="response.reasoning_summary_text.delta"){if(N?.type==="reasoning"&&A?.type==="thinking"){N.summary=N.summary||[];let q=N.summary[N.summary.length-1];if(q)A.thinking+=K.delta,q.text+=K.delta,W.push({type:"thinking_delta",contentIndex:Z(),delta:K.delta,partial:E})}}else if(K.type==="response.reasoning_summary_part.done"){if(N?.type==="reasoning"&&A?.type==="thinking"){N.summary=N.summary||[];let q=N.summary[N.summary.length-1];if(q)A.thinking+=`
|
|
4
4
|
|
|
5
5
|
`,q.text+=`
|
|
@@ -11,4 +11,4 @@ import{pk as J}from"./chunk-7h75r7ep.js";import{uk as w}from"./chunk-c1v946wb.js
|
|
|
11
11
|
`)||"",O=q.content?.map((Y)=>Y.text).join(`
|
|
12
12
|
|
|
13
13
|
`)||"";A.thinking=G||O||A.thinking,A.thinkingSignature=JSON.stringify(q),W.push({type:"thinking_end",contentIndex:Z(),content:A.thinking,partial:E}),A=null}else if(q.type==="message"&&A?.type==="text")A.text=q.content.map((G)=>G.type==="output_text"?G.text:G.refusal).join(""),A.textSignature=M(q.id,q.phase??void 0),W.push({type:"text_end",contentIndex:Z(),content:A.text,partial:E}),A=null;else if(q.type==="function_call"){let G=A?.type==="toolCall"&&A.partialJson?w(A.partialJson):w(q.arguments||"{}"),O;if(A?.type==="toolCall")A.arguments=G,delete A.partialJson,O=A;else O={type:"toolCall",id:`${q.call_id}|${q.id}`,name:q.name,arguments:G};A=null,W.push({type:"toolcall_end",contentIndex:Z(),toolCall:O,partial:E})}}else if(K.type==="response.completed"){let q=K.response;if(q?.id)E.responseId=q.id;if(q?.usage){let G=q.usage.input_tokens_details?.cached_tokens||0;E.usage={input:(q.usage.input_tokens||0)-G,output:q.usage.output_tokens||0,cacheRead:G,cacheWrite:0,totalTokens:q.usage.total_tokens||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}}}if(j(U,E.usage),_?.applyServiceTierPricing){let G=_.resolveServiceTier?_.resolveServiceTier(q?.service_tier,_.serviceTier):q?.service_tier??_.serviceTier;_.applyServiceTierPricing(E.usage,G)}if(E.stopReason=T(q?.status),E.content.some((G)=>G.type==="toolCall")&&E.stopReason==="stop")E.stopReason="toolUse"}else if(K.type==="error")throw Error(`Error Code ${K.code}: ${K.message}`||"Unknown error");else if(K.type==="response.failed"){let q=K.response?.error,G=K.response?.incomplete_details,O=q?`${q.code||"unknown"}: ${q.message||"no message"}`:G?.reason?`incomplete: ${G.reason}`:"Unknown error (no error details in response)";throw Error(O)}}function T(Q){if(!Q)return"stop";switch(Q){case"completed":return"stop";case"incomplete":return"length";case"failed":case"cancelled":return"error";case"in_progress":case"queued":return"stop";default:throw Error(`Unhandled stop reason: ${Q}`)}}
|
|
14
|
-
export{x as
|
|
14
|
+
export{x as sk,v as tk,B as uk};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Lh as F,Sh as B}from"./chunk-nyhqy6q2.js";var J=F((w,D)=>({metadata:{},isLoading:!1,error:null,fetchMetadata:async(A)=>{w({isLoading:!0,error:null});try{let h=await B.api.teams[":teamId"]["user-metadata"].$get({param:{teamId:A}});if(!h.ok)throw Error("failed to fetch user metadata");let C=(await h.json()).reduce((j,E)=>{return j[E.key]=E.value,j},{});w({metadata:C,isLoading:!1})}catch(h){w({error:h instanceof Error?h.message:String(h),isLoading:!1})}},setMetadata:async(A,h,q)=>{let C=D().metadata;w((j)=>({metadata:{...j.metadata,[h]:q}}));try{if(!(await B.api.teams[":teamId"]["user-metadata"][":key"].$put({param:{teamId:A,key:h},json:{value:q}})).ok)throw Error("failed to update user metadata")}catch(j){w({metadata:C}),console.error(j)}},getMetadata:(A,h)=>{let q=D().metadata[A];return q!==void 0?q:h}}));
|
|
2
2
|
export{J as yf};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{zf as A}from"./chunk-
|
|
2
|
-
export{B as
|
|
1
|
+
import{zf as A}from"./chunk-ry33f2qk.js";import{Fh as w,Sh as z,oh as v}from"./chunk-nyhqy6q2.js";var B=(b)=>({queryKey:["projects",b],queryFn:async()=>{let h=await z.api.projects[":projectId"].$get({param:{projectId:b}});if(!h.ok)throw Error("Failed to fetch project");return await h.json()}}),H=w("/projects/$projectId/recently-deleted")({loader:({context:{queryClient:b},params:{projectId:h}})=>b.ensureQueryData(B(h)),pendingComponent:()=>v(A,{})});
|
|
2
|
+
export{B as hf,H as if};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{nc as e,oc as p,pc as t}from"./chunk-ymeycphq.js";import"./chunk-e7ndw3hg.js";import"./chunk-14fh4s1a.js";import"./chunk-9h3ds7rn.js";import"./chunk-n4meg9wb.js";import"./chunk-0aj303as.js";import"./chunk-0qkj838r.js";export{t as kyselyAdapter,e as getKyselyDatabaseType,p as createKyselyAdapter};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Se as QN,Te as h,Ue as VN,Ve as ZN}from"./chunk-ztmj61z9.js";import{
|
|
2
|
+
import{Se as QN,Te as h,Ue as VN,Ve as ZN}from"./chunk-ztmj61z9.js";import{sk as g,tk as NN,uk as v}from"./chunk-7hsgmjpa.js";import"./chunk-j8qtab70.js";import{wk as e}from"./chunk-5t6c3038.js";import"./chunk-zemrvz79.js";import"./chunk-bs0fjz3w.js";import{Ck as b}from"./chunk-4qpa7b5t.js";import{Ok as s}from"./chunk-re0b7sj7.js";import{Sk as t,Tk as o}from"./chunk-922nnh39.js";import"./chunk-9h027f50.js";import"./chunk-0qkj838r.js";function c(N){let Q=N.filter((Z)=>Z!==void 0);if(Q.length===0)return{cleanup:()=>{}};if(Q.length===1)return{signal:Q[0],cleanup:()=>{}};let V=new AbortController,$=[],X=(Z)=>{if(!V.signal.aborted)V.abort(Z.reason)};for(let Z of Q){if(Z.aborted){X(Z);break}let G=()=>X(Z);Z.addEventListener("abort",G,{once:!0}),$.push({signal:Z,listener:G})}return{signal:V.signal,cleanup:()=>{for(let{signal:Z,listener:G}of $)Z.removeEventListener("abort",G)}}}var jN=function(N,Q){if(typeof N==="string"&&/^\.\.?\//.test(N))return N.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(V,$,X,Z,G){return $?Q?".jsx":".js":X&&(!Z||!G)?V:X+Z+"."+G.toLowerCase()+"js"});return N},C=null,$N=(N)=>import(jN(N)),UN="node:os";if(typeof process<"u"&&(process.versions?.node||process.versions?.bun))$N(UN).then((N)=>{C=N});var _N="https://chatgpt.com/backend-api",BN="https://api.openai.com/auth",WN=0,p=1000,HN=60000,l=1e4,RN=15000,XN=new Set(["openai","openai-codex","opencode"]),qN=1009,AN=new Set(["completed","incomplete","failed","cancelled","queued","in_progress"]);function wN(N){return/GoUsageLimitError|FreeUsageLimitError|Monthly usage limit reached|available balance|insufficient_quota|out of budget|quota exceeded|billing/i.test(N)}function CN(N,Q){if(N===429&&wN(Q))return!1;if(N===429||N===500||N===502||N===503||N===504)return!0;return/rate.?limit|overloaded|service.?unavailable|upstream.?connect|connection.?refused/i.test(Q)}function EN(N){let Q=N.get("retry-after-ms");if(Q!==null){let Z=Number(Q);if(Number.isFinite(Z))return Math.max(0,Z)}let V=N.get("retry-after");if(!V)return;let $=Number(V);if(Number.isFinite($))return Math.max(0,$*1000);let X=Date.parse(V);if(!Number.isNaN(X))return Math.max(0,X-Date.now());return}function fN(N,Q){let V=Q?.maxRetryDelayMs??HN;return V>0?Math.min(N,V):N}function d(N,Q){return new Promise((V,$)=>{if(Q?.aborted){$(Error("Request was aborted"));return}let X=setTimeout(V,N);Q?.addEventListener("abort",()=>{clearTimeout(X),$(Error("Request was aborted"))})})}function a(N){if(N===void 0)return;if(!Number.isFinite(N)||N<0)throw Error(`Invalid timeoutMs: ${String(N)}`);return Math.floor(N)}function MN(){let N=new AbortController,Q,V=setTimeout(()=>{Q=Error(`Codex SSE response headers timed out after ${l}ms`),N.abort(Q)},l);return{signal:N.signal,clear:()=>clearTimeout(V),error:()=>Q}}var SN=(N,Q,V)=>{let $=new o;return(async()=>{let X={role:"assistant",content:[],api:"openai-codex-responses",provider:N.provider,model:N.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{let Z=V?.apiKey;if(!Z)throw Error(`No API key for provider: ${N.provider}`);let G=NQ(Z),J=xN(N,Q,V),Y=await V?.onPayload?.(J,N);if(Y!==void 0)J=Y;let P=V?.sessionId||QQ(),O=VQ(N.headers,V?.headers,G,Z,V?.sessionId),z=ZQ(N.headers,V?.headers,G,Z,P),B=JSON.stringify(J),L=a(V?.timeoutMs),W=a(V?.websocketConnectTimeoutMs),D=V?.transport||"auto",j=D!=="sse"&&PN(V?.sessionId);if(j)i(V?.sessionId);if(D!=="sse"&&!j){let U=!1;try{if(await sN(hN(N.baseUrl),J,z,X,$,N,()=>{U=!0},L,W,V),V?.signal?.aborted)throw Error("Request was aborted");$.push({type:"done",reason:X.stopReason,message:X}),$.end();return}catch(_){if(V?.signal?.aborted||kN(_))throw _;if(ZN(X,VN("provider_transport_failure",_,{configuredTransport:D,fallbackTransport:U?void 0:"sse",eventsEmitted:U,phase:U?"after_message_stream_start":"before_message_stream_start",requestBytes:new TextEncoder().encode(B).byteLength})),uN(V?.sessionId,_),U)throw _;i(V?.sessionId)}}let F,K,R=V?.maxRetries??WN;for(let U=0;U<=R;U++){if(V?.signal?.aborted)throw Error("Request was aborted");try{let _=MN(),A=c([V?.signal,_.signal]);try{F=await fetch(FN(N.baseUrl),{method:"POST",headers:O,body:B,signal:A.signal})}catch(w){let f=_.error();throw f&&!V?.signal?.aborted?f:w}finally{A.cleanup(),_.clear()}if(await V?.onResponse?.({status:F.status,headers:b(F.headers)},N),F.ok)break;let m=await F.text();if(U<R&&CN(F.status,m)){let w=EN(F.headers),f=w===void 0?p*2**U:F.status===429?fN(w,V):w;await d(f,V?.signal);continue}let DN=new Response(m,{status:F.status,statusText:F.statusText}),u=await eN(DN);throw Error(u.friendlyMessage||u.message)}catch(_){if(_ instanceof Error){if(_.name==="AbortError"||_.message==="Request was aborted")throw Error("Request was aborted")}if(K=_ instanceof Error?_:Error(String(_)),U<R&&!K.message.includes("usage limit")){let A=p*2**U;await d(A,V?.signal);continue}throw K}}if(!F?.ok)throw K??Error("Failed after retries");if(!F.body)throw Error("No response body");if($.push({type:"start",partial:X}),await IN(F,X,$,N,V),V?.signal?.aborted)throw Error("Request was aborted");$.push({type:"done",reason:X.stopReason,message:X}),$.end()}catch(Z){for(let G of X.content)delete G.partialJson;X.stopReason=V?.signal?.aborted?"aborted":"error",X.errorMessage=Z instanceof Error?Z.message:String(Z),$.push({type:"error",reason:X.stopReason,error:X}),$.end()}})(),$},OQ=(N,Q,V)=>{let $=V?.apiKey;if(!$)throw Error(`No API key for provider: ${N.provider}`);let X=s(N,V,$),Z=V?.reasoning?t(N,V.reasoning):void 0;return SN(N,Q,{...X,reasoningEffort:Z==="off"?void 0:Z})};function xN(N,Q,V){let $=g(N,Q,XN,{includeSystemPrompt:!1}),X={model:N.id,store:!1,stream:!0,instructions:Q.systemPrompt||"You are a helpful assistant.",input:$,text:{verbosity:V?.textVerbosity||"low"},include:["reasoning.encrypted_content"],prompt_cache_key:e(V?.sessionId),tool_choice:"auto",parallel_tool_calls:!0};if(V?.temperature!==void 0)X.temperature=V.temperature;if(V?.serviceTier!==void 0)X.service_tier=V.serviceTier;if(Q.tools&&Q.tools.length>0)X.tools=NN(Q.tools,{strict:null});if(V?.reasoningEffort!==void 0){let Z=V.reasoningEffort==="none"?N.thinkingLevelMap?.off??"none":N.thinkingLevelMap?.[V.reasoningEffort]??V.reasoningEffort;if(Z!==null)X.reasoning={effort:Z,summary:V.reasoningSummary??"auto"}}return X}function TN(N,Q){switch(Q){case"flex":return 0.5;case"priority":return N.id==="gpt-5.5"?2.5:2;default:return 1}}function GN(N,Q,V){let $=TN(V,Q);if($===1)return;N.cost.input*=$,N.cost.output*=$,N.cost.cacheRead*=$,N.cost.cacheWrite*=$,N.cost.total=N.cost.input+N.cost.output+N.cost.cacheRead+N.cost.cacheWrite}function YN(N,Q){if(N==="default"&&(Q==="flex"||Q==="priority"))return Q;return N??Q}function FN(N){let V=(N&&N.trim().length>0?N:_N).replace(/\/+$/,"");if(V.endsWith("/codex/responses"))return V;if(V.endsWith("/codex"))return`${V}/responses`;return`${V}/codex/responses`}function hN(N){let Q=new URL(FN(N));if(Q.protocol==="https:")Q.protocol="wss:";if(Q.protocol==="http:")Q.protocol="ws:";return Q.toString()}async function IN(N,Q,V,$,X){await v(JN(gN(N,X?.signal)),Q,V,$,{serviceTier:X?.serviceTier,resolveServiceTier:YN,applyServiceTierPricing:(Z,G)=>GN(Z,G,$)})}class x extends Error{code;payload;constructor(N,Q){super(N);this.name="CodexApiError",this.code=Q?.code,this.payload=Q?.payload,this.cause=Q?.cause}}class I extends Error{payload;constructor(N,Q){super(N);this.name="CodexProtocolError",this.payload=Q?.payload,this.cause=Q?.cause}}function kN(N){return N instanceof x||N instanceof I}async function*JN(N){for await(let Q of N){let V=typeof Q.type==="string"?Q.type:void 0;if(!V)continue;if(V==="error"){let $=Q.code||"",X=Q.message||"";throw new x(`Codex error: ${X||$||JSON.stringify(Q)}`,{code:$||void 0,payload:Q})}if(V==="response.failed"){let $=Q.response,X=$?.error?.code,Z=$?.error?.message;throw new x(Z||"Codex response failed",{code:X,payload:Q})}if(V==="response.done"||V==="response.completed"||V==="response.incomplete"){let $=Q.response,X=$?{...$,status:bN($.status)}:$;yield{...Q,type:"response.completed",response:X};return}yield Q}}function bN(N){if(typeof N!=="string")return;return AN.has(N)?N:void 0}async function*gN(N,Q){if(!N.body)return;let V=N.body.getReader(),$=new TextDecoder,X="",Z=()=>{V.cancel().catch(()=>{})};Q?.addEventListener("abort",Z,{once:!0});try{while(!0){if(Q?.aborted)throw Error("Request was aborted");let{done:G,value:J}=await V.read();if(Q?.aborted)throw Error("Request was aborted");if(G)break;X+=$.decode(J,{stream:!0});let Y=X.indexOf(`
|
|
3
3
|
|
|
4
4
|
`);while(Y!==-1){let P=X.slice(0,Y);X=X.slice(Y+2);let O=P.split(`
|
|
5
5
|
`).filter((z)=>z.startsWith("data:")).map((z)=>z.slice(5).trim());if(O.length>0){let z=O.join(`
|