@shumai-one/shumai 0.6.2 → 0.6.4
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-mcj1xpcc.js → chunk-01vx2chc.js} +2 -2
- package/bin/chunk-0epkrexd.js +2 -0
- package/bin/chunk-0h5239kt.js +2 -0
- package/bin/{chunk-jt0ykktx.js → chunk-0jnstdgf.js} +1 -1
- package/bin/{chunk-x03jwaga.js → chunk-0njsjy6x.js} +4 -4
- package/bin/{chunk-7naa7tpn.js → chunk-13rq2gtr.js} +2 -2
- package/bin/chunk-1aqs9sdh.js +3 -0
- package/bin/{chunk-m0q2cgfg.js → chunk-22jbsrka.js} +1 -1
- package/bin/chunk-2qknebmd.js +1 -0
- package/bin/{chunk-a411xhmm.js → chunk-2qzmh3ae.js} +4 -4
- package/bin/{chunk-2nhgdqdg.js → chunk-2tt0b8ym.js} +2 -2
- package/bin/{chunk-p3f5aevs.js → chunk-2zm7czk6.js} +1 -1
- package/bin/{chunk-p4s95471.js → chunk-396tfwdx.js} +1 -1
- package/bin/chunk-3mx4trvh.js +10 -0
- package/bin/{chunk-b5rhvzv9.js → chunk-45pb3kzz.js} +2 -2
- package/bin/{chunk-q83h0hkx.js → chunk-47fmhzwv.js} +2 -2
- package/bin/chunk-4awk4xhq.js +2 -0
- package/bin/{chunk-2cdxm1cp.js → chunk-4b2x2qba.js} +23 -23
- package/bin/{chunk-knj2s8mg.js → chunk-4rjy7ybr.js} +8 -8
- package/bin/{chunk-q8w4mbw4.js → chunk-598x693h.js} +2 -2
- package/bin/chunk-5c7ztqs7.js +1 -0
- package/bin/{chunk-2jj4j8cn.js → chunk-65dh7x4c.js} +2 -2
- package/bin/{chunk-hnkcgvcj.js → chunk-66e2vrky.js} +1 -1
- package/bin/{chunk-g22wmpk1.js → chunk-6j3beg6n.js} +2 -2
- package/bin/{chunk-cgmebxx6.js → chunk-6ke13k69.js} +1 -1
- package/bin/{chunk-7sgrtxbt.js → chunk-6rqakmg0.js} +2 -2
- package/bin/{chunk-4mws03es.js → chunk-6ty4tfmf.js} +3 -3
- package/bin/chunk-7e9ws6dh.js +129 -0
- package/bin/chunk-7mdddkfc.js +1 -0
- package/bin/{chunk-q2bew2vc.js → chunk-7q4mgd5x.js} +2 -2
- package/bin/chunk-7yv7shad.js +1 -0
- package/bin/{chunk-qwpkcp8d.js → chunk-81b8rfv7.js} +2 -2
- package/bin/{chunk-atfz7g7e.js → chunk-8a7ymmd4.js} +2 -2
- package/bin/chunk-8ac9at5y.js +2 -0
- package/bin/{chunk-gxepkvt2.js → chunk-8zcfgz9c.js} +1 -1
- package/bin/{chunk-mcw198kg.js → chunk-955kf5kc.js} +8 -8
- package/bin/{chunk-jzgbxqdg.js → chunk-978rm9a9.js} +2 -2
- package/bin/{chunk-jt02kpfc.js → chunk-9qzbrp4d.js} +2 -2
- package/bin/{chunk-tekwpkjf.js → chunk-a283dh05.js} +2 -2
- package/bin/chunk-aa2a06cc.js +1 -0
- package/bin/{chunk-8cjet7pp.js → chunk-ajr1w3vq.js} +6 -6
- package/bin/chunk-akafypge.js +218 -0
- package/bin/chunk-amk373q2.js +2 -0
- package/bin/chunk-apq2gvvp.js +4 -0
- package/bin/chunk-av2w1sez.js +2 -0
- package/bin/{chunk-5wapd171.js → chunk-b6kmj34z.js} +12 -12
- package/bin/chunk-bkzaw9p8.js +1 -0
- package/bin/{chunk-zezje74z.js → chunk-bssb9tar.js} +3 -3
- package/bin/chunk-bwvj1aqc.js +1 -0
- package/bin/chunk-by9esjn7.js +3 -0
- package/bin/chunk-bywk8mbc.js +2 -0
- package/bin/{chunk-9xhjy897.js → chunk-c61g9hfa.js} +4 -4
- package/bin/{chunk-zrszykjf.js → chunk-cdcgjh8k.js} +1 -1
- package/bin/{chunk-yk12hydf.js → chunk-d277evce.js} +4 -4
- package/bin/{chunk-55h9ze53.js → chunk-d3brvxh7.js} +2 -2
- package/bin/{chunk-9t3p4xp6.js → chunk-dcb1nzf1.js} +1 -1
- package/bin/{chunk-mzsw9var.js → chunk-dfbzatq9.js} +2 -2
- package/bin/chunk-e0bckx12.js +2 -0
- package/bin/{chunk-3ckkwdjx.js → chunk-e2p4s2pj.js} +3 -3
- package/bin/chunk-e8zzg57c.js +2 -0
- package/bin/{chunk-vp3czaeh.js → chunk-edfaqwaq.js} +2 -2
- package/bin/chunk-ehgrp0f9.js +1 -0
- package/bin/chunk-evs2aaav.js +12 -0
- package/bin/{chunk-s9ksftq2.js → chunk-f5bhcjhw.js} +1 -1
- package/bin/{chunk-ns33grgx.js → chunk-fb9dedm2.js} +2 -2
- package/bin/{chunk-srxp5jav.js → chunk-ff0mh9p3.js} +32 -32
- package/bin/chunk-fpfby5tz.js +1 -0
- package/bin/{chunk-eyjfhdp9.js → chunk-gd3b5akr.js} +2 -2
- package/bin/{chunk-1wfg56z3.js → chunk-gm1fy3hm.js} +5 -5
- package/bin/{chunk-9n1w5dw1.js → chunk-gqkjx7rz.js} +3 -3
- package/bin/{chunk-1nvd90g2.js → chunk-h7f5370s.js} +1 -1
- package/bin/chunk-hcyhsn8e.js +2 -0
- package/bin/{chunk-vcrmjtcz.js → chunk-jxm0gzmf.js} +2 -2
- package/bin/{chunk-b7bnp021.js → chunk-k3ggy3xk.js} +2 -2
- package/bin/{chunk-257dcd2f.js → chunk-k9vjs21p.js} +2 -2
- package/bin/chunk-ka40gv72.js +1 -0
- package/bin/chunk-km70p970.js +2 -0
- package/bin/{chunk-e4yscwen.js → chunk-m6v8rb39.js} +8 -8
- package/bin/chunk-m8spagwp.js +4 -0
- package/bin/{chunk-y241cxff.js → chunk-mfh7mg5b.js} +1 -1
- package/bin/chunk-n0cn0218.js +2 -0
- package/bin/chunk-n54ftsdx.js +2 -0
- package/bin/{chunk-02fvcrej.js → chunk-n7cvj15k.js} +7 -7
- package/bin/chunk-na5fh7er.js +2 -0
- package/bin/chunk-neazdbxy.js +1 -0
- package/bin/chunk-nk24qw3m.js +1 -0
- package/bin/{chunk-73yncv54.js → chunk-nsbbseff.js} +2 -2
- package/bin/chunk-nseef85h.js +1 -0
- package/bin/chunk-p35ztj2z.js +3 -0
- package/bin/chunk-pcjc9ygv.js +2 -0
- package/bin/{chunk-167z646e.js → chunk-pemmtd8q.js} +1 -1
- package/bin/{chunk-82tps5n1.js → chunk-pzrqnnpg.js} +1 -1
- package/bin/{chunk-a74g6h8a.js → chunk-q43m934j.js} +2 -2
- package/bin/{chunk-r1xer8gn.js → chunk-q57m34h0.js} +3 -3
- package/bin/chunk-q5k72jz9.js +3 -0
- package/bin/chunk-q9fsxakd.js +2 -0
- package/bin/chunk-qadpe0ct.js +2 -0
- package/bin/chunk-qeypjv4f.css +1 -0
- package/bin/chunk-qw92z3wf.js +2 -0
- package/bin/chunk-r0byfq1t.js +1 -0
- package/bin/chunk-r0q88qw3.js +2 -0
- package/bin/chunk-rjhczkh3.js +2 -0
- package/bin/{chunk-mwktrwtx.js → chunk-s0wxbybf.js} +1 -1
- package/bin/{chunk-q5vkxee3.js → chunk-s4hkcw24.js} +2 -2
- package/bin/chunk-szta50g1.js +1 -0
- package/bin/chunk-t6cb99gp.js +2 -0
- package/bin/chunk-tcr080b9.js +1 -0
- package/bin/{chunk-yq32evnn.js → chunk-v4nqx084.js} +5 -5
- package/bin/{chunk-ympbfzz4.js → chunk-v7jzc3ye.js} +1 -1
- package/bin/{chunk-9zsv6d2f.js → chunk-vbe8wred.js} +1 -1
- package/bin/{chunk-hpbn0k9n.js → chunk-vf9s8b5t.js} +2 -2
- package/bin/{chunk-m9adtgzk.js → chunk-vk3eqr65.js} +1 -1
- package/bin/{chunk-hpwv4am3.js → chunk-vm9bbk97.js} +4 -4
- package/bin/{chunk-v05rrxp5.js → chunk-w4gqg27w.js} +2 -2
- package/bin/{chunk-x8mjh387.js → chunk-w6ym7tsd.js} +4 -4
- package/bin/{chunk-hzkjgcre.js → chunk-ways29d1.js} +1 -1
- package/bin/chunk-wesg7tg9.js +1 -0
- package/bin/chunk-wmrrapwv.js +2 -0
- package/bin/chunk-wnwsjgj8.js +2 -0
- package/bin/{chunk-hw6czrya.js → chunk-wrb4xq9v.js} +1 -1
- package/bin/{chunk-v5cn90cf.js → chunk-wzrzc07t.js} +2 -2
- package/bin/chunk-xd1axsdv.js +2 -0
- package/bin/{chunk-cwat1jwx.js → chunk-xk0jmx4s.js} +2 -2
- package/bin/{chunk-g6sdezec.js → chunk-y545vfn0.js} +1 -1
- package/bin/{chunk-fatmqnp1.js → chunk-y6h885fs.js} +1 -1
- package/bin/{chunk-cz13a82m.js → chunk-yncmfr39.js} +2 -2
- package/bin/{chunk-01052ssf.js → chunk-yxnz4ypt.js} +11 -11
- package/bin/chunk-zc1asygg.js +2 -0
- package/bin/{chunk-m82tkhaa.js → chunk-zc7wzcvh.js} +7 -7
- package/bin/chunk-zdvhh8mk.js +2 -0
- package/bin/{chunk-kvhf12b4.js → chunk-zg0b902x.js} +2 -2
- package/bin/{chunk-7v7mypc6.js → chunk-zhq7a7hs.js} +2 -2
- package/bin/{chunk-f25fe9th.js → chunk-zmnvskn7.js} +11 -11
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +470 -389
- package/package.json +7 -7
- package/prisma/migrations/20261102032402_add_archive_storage/migration.sql +25 -0
- package/prisma/schema.prisma +12 -6
- package/bin/chunk-0bj887zm.js +0 -2
- package/bin/chunk-1ktk6764.js +0 -10
- package/bin/chunk-26qn7fek.js +0 -2
- package/bin/chunk-2ne2b54t.js +0 -2
- package/bin/chunk-2vbeqczj.js +0 -1
- package/bin/chunk-37p6bcx2.js +0 -1
- package/bin/chunk-3knfx6dm.js +0 -1
- package/bin/chunk-3z85zxkn.js +0 -1
- package/bin/chunk-54tbfvya.js +0 -2
- package/bin/chunk-56kh5fxc.js +0 -1
- package/bin/chunk-576nj64j.js +0 -2
- package/bin/chunk-6cnqjngz.js +0 -1
- package/bin/chunk-7g46e1wy.js +0 -3
- package/bin/chunk-84x8p7v5.js +0 -1
- package/bin/chunk-88jg9dq5.js +0 -2
- package/bin/chunk-8fyg9dy4.js +0 -2
- package/bin/chunk-8gtfgkrn.js +0 -2
- package/bin/chunk-8mqbztj8.js +0 -2
- package/bin/chunk-8qdtvfx3.css +0 -1
- package/bin/chunk-8xb6yz11.js +0 -2
- package/bin/chunk-8yjsmr7g.js +0 -2
- package/bin/chunk-91rb0jpb.js +0 -2
- package/bin/chunk-96qpjght.js +0 -2
- package/bin/chunk-9f1xk1nt.js +0 -1
- package/bin/chunk-9mk9cvbk.js +0 -1
- package/bin/chunk-9nw5w8vh.js +0 -1
- package/bin/chunk-ah8fjb6f.js +0 -2
- package/bin/chunk-cf5axr8c.js +0 -1
- package/bin/chunk-dk42gf7v.js +0 -2
- package/bin/chunk-e4f56spj.js +0 -4
- package/bin/chunk-eb7mzbfm.js +0 -1
- package/bin/chunk-er14d498.js +0 -3
- package/bin/chunk-f6avg5qe.js +0 -129
- package/bin/chunk-fvx9k1dc.js +0 -2
- package/bin/chunk-gtf19jc1.js +0 -2
- package/bin/chunk-h1n7jqnw.js +0 -1
- package/bin/chunk-hfm82066.js +0 -2
- package/bin/chunk-j2s311yc.js +0 -3
- package/bin/chunk-kj6h5j5a.js +0 -4
- package/bin/chunk-km4gn6b6.js +0 -1
- package/bin/chunk-ny1kbmxt.js +0 -2
- package/bin/chunk-p3j6ydk1.js +0 -1
- package/bin/chunk-pk406dgy.js +0 -2
- package/bin/chunk-s1e4qy3q.js +0 -14
- package/bin/chunk-swtwaaqe.js +0 -1
- package/bin/chunk-tagdrg7p.js +0 -1
- package/bin/chunk-twtxnzbv.js +0 -2
- package/bin/chunk-v5mcjwxy.js +0 -2
- package/bin/chunk-vkzasgxw.js +0 -2
- package/bin/chunk-x342vzdx.js +0 -2
- package/bin/chunk-xc54vhfz.js +0 -2
- package/bin/chunk-xvkwbczx.js +0 -3
- package/bin/chunk-z1p13dnc.js +0 -2
- package/bin/chunk-zarz3sqn.js +0 -211
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S,L,a,ee,Je,R,Ft,$t,Kg}from"./chunk-akafypge.js";import"./chunk-7e9ws6dh.js";import"./chunk-evs2aaav.js";import"./chunk-fb9dedm2.js";import"./chunk-7q4mgd5x.js";import"./chunk-d3brvxh7.js";import"./chunk-3mx4trvh.js";import"./chunk-wmrrapwv.js";import"./chunk-t6cb99gp.js";import"./chunk-xd1axsdv.js";import"./chunk-zdvhh8mk.js";import"./chunk-bssb9tar.js";import"./chunk-q57m34h0.js";import"./chunk-s4hkcw24.js";import{To}from"./chunk-e0bckx12.js";import"./chunk-vf9s8b5t.js";import{yr}from"./chunk-e8zzg57c.js";import"./chunk-av2w1sez.js";import"./chunk-km70p970.js";import"./chunk-8a7ymmd4.js";import"./chunk-k9vjs21p.js";import"./chunk-n54ftsdx.js";import"./chunk-na5fh7er.js";import"./chunk-qw92z3wf.js";import"./chunk-zg0b902x.js";import"./chunk-81b8rfv7.js";import"./chunk-wzrzc07t.js";L();function s(){let{projectId:e}=c.useParams(),{teamId:r,ensureTeamIdForProject:t}=Ft();S(()=>{t(e)},[e,t]);let{data:n}=yr(Kg(e)),o=n?.rootFolder,{data:m}=ee({queryKey:["folders",o],queryFn:async()=>{let d=await R.api.folders[":folderId"].$get({param:{folderId:o}});if(!d.ok)throw Error("failed to fetch folder");return await d.json()},enabled:!!o});if(!r||!o||!m)return a($t,{});return a(To,{teamId:r,projectId:e,projectName:n.name??"",assetId:o,rootFolderId:o})}var c=Je("/projects/$projectId/")({component:s});export{c as Route};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{EA,Jm,ld,Vr,cd,ks,ud,Dl,Nl,Ko,Lf,Nc,bv,kn,lo,rn,Zf}from"./chunk-8zcfgz9c.js";export{ud as EncryptJWT,ks as SignJWT,Nc as UnsecuredJWT,Jm as base64url,Nl as calculateJwkThumbprint,ld as compactVerify,Ko as createLocalJWKSet,Lf as createRemoteJWKSet,rn as decodeJwt,lo as decodeProtectedHeader,EA as errors,Dl as exportJWK,Zf as generateKeyPair,kn as importJWK,bv as importPKCS8,cd as jwtDecrypt,Vr as jwtVerify};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j}from"./chunk-akafypge.js";var e=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],bl=j("bell",e);
|
|
2
|
+
export{bl};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ei,Ss}from"./chunk-yq32evnn.js";import{Is}from"./chunk-4mws03es.js";import{Ts,Ko,Yt}from"./chunk-9xhjy897.js";import{Kn,br,at,Tn,hr,Jo,sr}from"./chunk-e4yscwen.js";var{awsEndpointFunctions:me,emitWarningIfUnsupportedVersion:xe,createDefaultUserAgentProvider:fe,NODE_APP_ID_CONFIG_OPTIONS:Se,getAwsRegionExtensionConfiguration:ve,resolveAwsRegionExtensionConfiguration:Pe,resolveUserAgentConfig:Ie,resolveHostHeaderConfig:Ce,getUserAgentPlugin:Ae,getHostHeaderPlugin:ye,getLoggerPlugin:Te,getRecursionDetectionPlugin:Oe}=Yt(),{NoAuthSigner:Re,getHttpAuthSchemeEndpointRuleSetPlugin:De,DefaultIdentityProviderConfig:ke,getHttpSigningPlugin:$e}=Ko(),{normalizeProvider:j,getSmithyContext:we,ServiceException:Ne,NoOpLogger:be,emitWarningIfUnsupportedVersion:Ue,loadConfigsForDefaultMode:Fe,getDefaultExtensionConfiguration:qe,resolveDefaultRuntimeConfig:He,Client:K,makeBuilder:Me,createAggregatedClient:Ge}=br(),{Command:je}=br();var Ur=je,Fr=K;var{resolveDefaultsModeConfig:Ke,loadConfig:h,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:Ve,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:ze,NODE_REGION_CONFIG_OPTIONS:Le,NODE_REGION_CONFIG_FILE_OPTIONS:Be,resolveRegionConfig:We}=at(),{BinaryDecisionDiagram:Ye,EndpointCache:Je,decideEndpoint:Xe,customEndpointFunctions:Qe,resolveEndpointConfig:Ze,getEndpointPlugin:et}=Tn(),{parseUrl:tt,getHttpHandlerExtensionConfiguration:rt,resolveHttpHandlerRuntimeConfig:ot,getContentLengthPlugin:nt}=sr(),{DEFAULT_RETRY_MODE:st,NODE_RETRY_MODE_CONFIG_OPTIONS:it,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:ct,resolveRetryConfig:pt,getRetryPlugin:dt}=Ts(),{TypeRegistry:V,getSchemaSerdePlugin:ut}=Kn(),{resolveAwsSdkSigV4Config:lt,AwsSdkSigV4Signer:ht,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:_t}=Ss(),{toUtf8:gt,fromUtf8:Et,toBase64:mt,fromBase64:xt,calculateBodyLength:ft}=hr(),{streamCollector:St,NodeHttpHandler:vt}=Is(),{AwsRestJsonProtocol:Pt}=Ei(),{Sha256:It}=Jo(),Ct=async(e,t,n)=>({operation:we(t).operation,region:await j(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function At(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(t,n)=>({signingProperties:{config:t,context:n}})}}function yt(e){return{schemeId:"smithy.api#noAuth"}}var Tt=(e)=>{let t=[];switch(e.operation){case"CreateToken":{t.push(yt());break}default:t.push(At(e))}return t},Ot=(e)=>{let t=lt(e);return Object.assign(t,{authSchemePreference:j(e.authSchemePreference??[])})},Rt=(e)=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}),Dt={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},kt="3.997.43",$t={version:kt},E="ref",_=-1,x=!0,q="isSet",z="PartitionResult",f="booleanEquals",w="getAttr",H={[E]:"Endpoint"},N={[E]:z},g={},M=[{[E]:"Region"}],G={conditions:[[q,[H]],[q,M],["aws.partition",M,z],[f,[{[E]:"UseFIPS"},x]],[f,[{[E]:"UseDualStack"},x]],[f,[{fn:w,argv:[N,"supportsDualStack"]},x]],[f,[{fn:w,argv:[N,"supportsFIPS"]},x]],["stringEquals",[{fn:w,argv:[N,"name"]},"aws-us-gov"]]],results:[[_],[_,"Invalid Configuration: FIPS and custom endpoint are not supported"],[_,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[H,g],["https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",g],[_,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://oidc.{Region}.amazonaws.com",g],["https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",g],[_,"FIPS is enabled but this partition does not support FIPS"],["https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",g],[_,"DualStack is enabled but this partition does not support DualStack"],["https://oidc.{Region}.{PartitionResult#dnsSuffix}",g],[_,"Invalid Configuration: Missing Region"]]},wt=2,c=1e8,Nt=new Int32Array([-1,1,-1,0,13,3,1,4,c+12,2,5,c+12,3,8,6,4,7,c+11,5,c+9,c+10,4,11,9,6,10,c+8,7,c+6,c+7,5,12,c+5,6,c+4,c+5,3,c+1,14,4,c+2,c+3]),bt=Ye.from(Nt,wt,G.conditions,G.results),Ut=new Je({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Ft=(e,t={})=>Ut.get(e,()=>Xe(bt,{endpointParams:e,logger:t.logger}));Qe.aws=me;class i extends Ne{constructor(e){super(e);Object.setPrototypeOf(this,i.prototype)}}class S extends i{name="AccessDeniedException";$fault="client";error;reason;error_description;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});Object.setPrototypeOf(this,S.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class v extends i{name="AuthorizationPendingException";$fault="client";error;error_description;constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e});Object.setPrototypeOf(this,v.prototype),this.error=e.error,this.error_description=e.error_description}}class P extends i{name="ExpiredTokenException";$fault="client";error;error_description;constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e});Object.setPrototypeOf(this,P.prototype),this.error=e.error,this.error_description=e.error_description}}class I extends i{name="InternalServerException";$fault="server";error;error_description;constructor(e){super({name:"InternalServerException",$fault:"server",...e});Object.setPrototypeOf(this,I.prototype),this.error=e.error,this.error_description=e.error_description}}class C extends i{name="InvalidClientException";$fault="client";error;error_description;constructor(e){super({name:"InvalidClientException",$fault:"client",...e});Object.setPrototypeOf(this,C.prototype),this.error=e.error,this.error_description=e.error_description}}class A extends i{name="InvalidGrantException";$fault="client";error;error_description;constructor(e){super({name:"InvalidGrantException",$fault:"client",...e});Object.setPrototypeOf(this,A.prototype),this.error=e.error,this.error_description=e.error_description}}class y extends i{name="InvalidRequestException";$fault="client";error;reason;error_description;constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});Object.setPrototypeOf(this,y.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class T extends i{name="InvalidScopeException";$fault="client";error;error_description;constructor(e){super({name:"InvalidScopeException",$fault:"client",...e});Object.setPrototypeOf(this,T.prototype),this.error=e.error,this.error_description=e.error_description}}class O extends i{name="SlowDownException";$fault="client";error;error_description;constructor(e){super({name:"SlowDownException",$fault:"client",...e});Object.setPrototypeOf(this,O.prototype),this.error=e.error,this.error_description=e.error_description}}class R extends i{name="UnauthorizedClientException";$fault="client";error;error_description;constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e});Object.setPrototypeOf(this,R.prototype),this.error=e.error,this.error_description=e.error_description}}class D extends i{name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e});Object.setPrototypeOf(this,D.prototype),this.error=e.error,this.error_description=e.error_description}}var qt="AccessDeniedException",Ht="AuthorizationPendingException",Mt="AccessToken",Gt="ClientSecret",jt="CreateToken",Kt="CreateTokenRequest",Vt="CreateTokenResponse",zt="CodeVerifier",Lt="ExpiredTokenException",Bt="InvalidClientException",Wt="InvalidGrantException",Jt="InvalidRequestException",Xt="InternalServerException",Qt="InvalidScopeException",Zt="IdToken",er="RefreshToken",tr="SlowDownException",rr="UnauthorizedClientException",or="UnsupportedGrantTypeException",nr="accessToken",l="client",ir="clientId",cr="clientSecret",ar="codeVerifier",pr="code",dr="deviceCode",r="error",ur="expiresIn",d="error_description",lr="grantType",_r="http",u="httpError",gr="idToken",L="reason",B="refreshToken",Er="redirectUri",W="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc",mr="scope",xr="server",fr="tokenType",o="com.amazonaws.ssooidc",Y=V.for(W),J=[-3,W,"SSOOIDCServiceException",0,[],[]];Y.registerError(J,i);var a=V.for(o),X=[-3,o,qt,{[r]:l,[u]:400},[r,L,d],[0,0,0]];a.registerError(X,S);var Q=[-3,o,Ht,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(Q,v);var Z=[-3,o,Lt,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(Z,P);var ee=[-3,o,Xt,{[r]:xr,[u]:500},[r,d],[0,0]];a.registerError(ee,I);var te=[-3,o,Bt,{[r]:l,[u]:401},[r,d],[0,0]];a.registerError(te,C);var re=[-3,o,Wt,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(re,A);var oe=[-3,o,Jt,{[r]:l,[u]:400},[r,L,d],[0,0,0]];a.registerError(oe,y);var ne=[-3,o,Qt,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(ne,T);var se=[-3,o,tr,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(se,O);var ie=[-3,o,rr,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(ie,R);var ce=[-3,o,or,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(ce,D);var ae=[Y,a],Sr=[0,o,Mt,8,0],vr=[0,o,Gt,8,0],Pr=[0,o,zt,8,0],Ir=[0,o,Zt,8,0],pe=[0,o,er,8,0],de=[3,o,Kt,0,[ir,cr,lr,dr,pr,B,mr,Er,ar],[0,[()=>vr,0],0,0,0,[()=>pe,0],64,0,[()=>Pr,0]],3],ue=[3,o,Vt,0,[nr,fr,ur,B,gr],[[()=>Sr,0],0,1,[()=>pe,0],[()=>Ir,0]]],le=[9,o,jt,{[_r]:["POST","/token",200]},()=>de,()=>ue],Cr=(e)=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??xt,base64Encoder:e?.base64Encoder??mt,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Ft,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Tt,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(t)=>t.getIdentityProvider("aws.auth#sigv4"),signer:new ht},{schemeId:"smithy.api#noAuth",identityProvider:(t)=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Re}],logger:e?.logger??new be,protocol:e?.protocol??Pt,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.ssooidc",errorTypeRegistries:ae,version:"2019-06-10",serviceTarget:"AWSSSOOIDCService"},serviceId:e?.serviceId??"SSO OIDC",sha256:e?.sha256??It,urlParser:e?.urlParser??tt,utf8Decoder:e?.utf8Decoder??Et,utf8Encoder:e?.utf8Encoder??gt}),Ar=(e)=>{Ue(process.version);let t=Ke(e),n=()=>t().then(Fe),p=Cr(e);xe(process.version);let s={profile:e?.profile,logger:p.logger};return{...p,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??h(_t,s),bodyLengthChecker:e?.bodyLengthChecker??ft,defaultUserAgentProvider:e?.defaultUserAgentProvider??fe({serviceId:p.serviceId,clientVersion:$t.version}),maxAttempts:e?.maxAttempts??h(ct,e),region:e?.region??h(Le,{...Be,...s}),requestHandler:vt.create(e?.requestHandler??n),retryMode:e?.retryMode??h({...it,default:async()=>(await n()).retryMode||st},e),streamCollector:e?.streamCollector??St,useDualstackEndpoint:e?.useDualstackEndpoint??h(ze,s),useFipsEndpoint:e?.useFipsEndpoint??h(Ve,s),userAgentAppId:e?.userAgentAppId??h(Se,s)}},yr=(e)=>{let{httpAuthSchemes:t,httpAuthSchemeProvider:n,credentials:p}=e;return{setHttpAuthScheme(s){let m=t.findIndex((k)=>k.schemeId===s.schemeId);if(m===-1)t.push(s);else t.splice(m,1,s)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(s){n=s},httpAuthSchemeProvider(){return n},setCredentials(s){p=s},credentials(){return p}}},Tr=(e)=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),Or=(e,t)=>{let n=Object.assign(ve(e),qe(e),rt(e),yr(e));return t.forEach((p)=>p.configure(n)),Object.assign(e,Pe(n),He(n),ot(n),Tr(n))};class b extends K{config;constructor(...[e]){let t=Ar(e||{});super(t);this.initConfig=t;let n=Rt(t),p=Ie(n),s=pt(p),m=We(s),k=Ce(m),he=Ze(k),_e=Ot(he),ge=Or(_e,e?.extensions||[]);this.config=ge,this.middlewareStack.use(ut(this.config)),this.middlewareStack.use(Ae(this.config)),this.middlewareStack.use(dt(this.config)),this.middlewareStack.use(nt(this.config)),this.middlewareStack.use(ye(this.config)),this.middlewareStack.use(Te(this.config)),this.middlewareStack.use(Oe(this.config)),this.middlewareStack.use(De(this.config,{httpAuthSchemeParametersProvider:Ct,identityProviderConfigProvider:async(Ee)=>new ke({"aws.auth#sigv4":Ee.credentials})})),this.middlewareStack.use($e(this.config))}destroy(){super.destroy()}}var Rr=Me(Dt,"AWSSSOOIDCService","SSOOIDCClient",et),Dr={},kr=(e,t,n,p)=>[];class U extends Rr(Dr,kr,"CreateToken",le){}var $r={CreateTokenCommand:U};class F extends b{}Ge($r,F);var wr={KMS_ACCESS_DENIED:"KMS_AccessDeniedException"},Nr={KMS_DISABLED_KEY:"KMS_DisabledException",KMS_INVALID_KEY_USAGE:"KMS_InvalidKeyUsageException",KMS_INVALID_STATE:"KMS_InvalidStateException",KMS_KEY_NOT_FOUND:"KMS_NotFoundException"};var qr=S,Hr=X,Mr=wr,Gr=v,jr=Q,Kr=le,Vr=U,zr=de,Lr=ue,Br=P,Wr=Z,Yr=I,Jr=ee,Xr=C,Qr=te,Zr=A,eo=re,to=y,ro=oe,oo=Nr,no=T,so=ne,io=F,co=b,ao=i,po=J,uo=O,lo=se,ho=R,_o=ie,go=D,Eo=ce,mo=ae;export{Ur as $Command,Fr as __Client,qr as AccessDeniedException,Hr as AccessDeniedException$,Mr as AccessDeniedExceptionReason,Gr as AuthorizationPendingException,jr as AuthorizationPendingException$,Kr as CreateToken$,Vr as CreateTokenCommand,zr as CreateTokenRequest$,Lr as CreateTokenResponse$,Br as ExpiredTokenException,Wr as ExpiredTokenException$,Yr as InternalServerException,Jr as InternalServerException$,Xr as InvalidClientException,Qr as InvalidClientException$,Zr as InvalidGrantException,eo as InvalidGrantException$,to as InvalidRequestException,ro as InvalidRequestException$,oo as InvalidRequestExceptionReason,no as InvalidScopeException,so as InvalidScopeException$,io as SSOOIDC,co as SSOOIDCClient,ao as SSOOIDCServiceException,po as SSOOIDCServiceException$,uo as SlowDownException,lo as SlowDownException$,ho as UnauthorizedClientException,_o as UnauthorizedClientException$,go as UnsupportedGrantTypeException,Eo as UnsupportedGrantTypeException$,mo as errorTypeRegistries};
|
|
2
|
+
import{Ti,Ds}from"./chunk-v4nqx084.js";import{Ns}from"./chunk-6ty4tfmf.js";import{Fs,Yo,Xt}from"./chunk-c61g9hfa.js";import{Jn,Er,At,Mn,gr,es,ar}from"./chunk-m6v8rb39.js";var{awsEndpointFunctions:me,emitWarningIfUnsupportedVersion:xe,createDefaultUserAgentProvider:fe,NODE_APP_ID_CONFIG_OPTIONS:Se,getAwsRegionExtensionConfiguration:ve,resolveAwsRegionExtensionConfiguration:Pe,resolveUserAgentConfig:Ie,resolveHostHeaderConfig:Ce,getUserAgentPlugin:Ae,getHostHeaderPlugin:ye,getLoggerPlugin:Te,getRecursionDetectionPlugin:Oe}=Xt(),{NoAuthSigner:Re,getHttpAuthSchemeEndpointRuleSetPlugin:De,DefaultIdentityProviderConfig:ke,getHttpSigningPlugin:$e}=Yo(),{normalizeProvider:j,getSmithyContext:we,ServiceException:Ne,NoOpLogger:be,emitWarningIfUnsupportedVersion:Ue,loadConfigsForDefaultMode:Fe,getDefaultExtensionConfiguration:qe,resolveDefaultRuntimeConfig:He,Client:K,makeBuilder:Me,createAggregatedClient:Ge}=Er(),{Command:je}=Er();var Ur=je,Fr=K;var{resolveDefaultsModeConfig:Ke,loadConfig:h,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:Ve,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:ze,NODE_REGION_CONFIG_OPTIONS:Le,NODE_REGION_CONFIG_FILE_OPTIONS:Be,resolveRegionConfig:We}=At(),{BinaryDecisionDiagram:Ye,EndpointCache:Je,decideEndpoint:Xe,customEndpointFunctions:Qe,resolveEndpointConfig:Ze,getEndpointPlugin:et}=Mn(),{parseUrl:tt,getHttpHandlerExtensionConfiguration:rt,resolveHttpHandlerRuntimeConfig:ot,getContentLengthPlugin:nt}=ar(),{DEFAULT_RETRY_MODE:st,NODE_RETRY_MODE_CONFIG_OPTIONS:it,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:ct,resolveRetryConfig:at,getRetryPlugin:pt}=Fs(),{TypeRegistry:V,getSchemaSerdePlugin:dt}=Jn(),{resolveAwsSdkSigV4Config:ut,AwsSdkSigV4Signer:lt,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:ht}=Ds(),{toUtf8:_t,fromUtf8:gt,toBase64:Et,fromBase64:mt,calculateBodyLength:xt}=gr(),{streamCollector:ft,NodeHttpHandler:St}=Ns(),{AwsRestJsonProtocol:vt}=Ti(),{Sha256:Pt}=es(),It=async(e,t,n)=>({operation:we(t).operation,region:await j(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function Ct(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(t,n)=>({signingProperties:{config:t,context:n}})}}function yt(e){return{schemeId:"smithy.api#noAuth"}}var Tt=(e)=>{let t=[];switch(e.operation){case"CreateToken":{t.push(yt());break}default:t.push(Ct(e))}return t},Ot=(e)=>{let t=ut(e);return Object.assign(t,{authSchemePreference:j(e.authSchemePreference??[])})},Rt=(e)=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}),Dt={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},kt="3.997.43",$t={version:kt},E="ref",_=-1,x=!0,q="isSet",z="PartitionResult",f="booleanEquals",w="getAttr",H={[E]:"Endpoint"},N={[E]:z},g={},M=[{[E]:"Region"}],G={conditions:[[q,[H]],[q,M],["aws.partition",M,z],[f,[{[E]:"UseFIPS"},x]],[f,[{[E]:"UseDualStack"},x]],[f,[{fn:w,argv:[N,"supportsDualStack"]},x]],[f,[{fn:w,argv:[N,"supportsFIPS"]},x]],["stringEquals",[{fn:w,argv:[N,"name"]},"aws-us-gov"]]],results:[[_],[_,"Invalid Configuration: FIPS and custom endpoint are not supported"],[_,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[H,g],["https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",g],[_,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://oidc.{Region}.amazonaws.com",g],["https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",g],[_,"FIPS is enabled but this partition does not support FIPS"],["https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",g],[_,"DualStack is enabled but this partition does not support DualStack"],["https://oidc.{Region}.{PartitionResult#dnsSuffix}",g],[_,"Invalid Configuration: Missing Region"]]},wt=2,c=1e8,Nt=new Int32Array([-1,1,-1,0,13,3,1,4,c+12,2,5,c+12,3,8,6,4,7,c+11,5,c+9,c+10,4,11,9,6,10,c+8,7,c+6,c+7,5,12,c+5,6,c+4,c+5,3,c+1,14,4,c+2,c+3]),bt=Ye.from(Nt,wt,G.conditions,G.results),Ut=new Je({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Ft=(e,t={})=>Ut.get(e,()=>Xe(bt,{endpointParams:e,logger:t.logger}));Qe.aws=me;class i extends Ne{constructor(e){super(e);Object.setPrototypeOf(this,i.prototype)}}class S extends i{name="AccessDeniedException";$fault="client";error;reason;error_description;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});Object.setPrototypeOf(this,S.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class v extends i{name="AuthorizationPendingException";$fault="client";error;error_description;constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e});Object.setPrototypeOf(this,v.prototype),this.error=e.error,this.error_description=e.error_description}}class P extends i{name="ExpiredTokenException";$fault="client";error;error_description;constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e});Object.setPrototypeOf(this,P.prototype),this.error=e.error,this.error_description=e.error_description}}class I extends i{name="InternalServerException";$fault="server";error;error_description;constructor(e){super({name:"InternalServerException",$fault:"server",...e});Object.setPrototypeOf(this,I.prototype),this.error=e.error,this.error_description=e.error_description}}class C extends i{name="InvalidClientException";$fault="client";error;error_description;constructor(e){super({name:"InvalidClientException",$fault:"client",...e});Object.setPrototypeOf(this,C.prototype),this.error=e.error,this.error_description=e.error_description}}class A extends i{name="InvalidGrantException";$fault="client";error;error_description;constructor(e){super({name:"InvalidGrantException",$fault:"client",...e});Object.setPrototypeOf(this,A.prototype),this.error=e.error,this.error_description=e.error_description}}class y extends i{name="InvalidRequestException";$fault="client";error;reason;error_description;constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});Object.setPrototypeOf(this,y.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class T extends i{name="InvalidScopeException";$fault="client";error;error_description;constructor(e){super({name:"InvalidScopeException",$fault:"client",...e});Object.setPrototypeOf(this,T.prototype),this.error=e.error,this.error_description=e.error_description}}class O extends i{name="SlowDownException";$fault="client";error;error_description;constructor(e){super({name:"SlowDownException",$fault:"client",...e});Object.setPrototypeOf(this,O.prototype),this.error=e.error,this.error_description=e.error_description}}class R extends i{name="UnauthorizedClientException";$fault="client";error;error_description;constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e});Object.setPrototypeOf(this,R.prototype),this.error=e.error,this.error_description=e.error_description}}class D extends i{name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e});Object.setPrototypeOf(this,D.prototype),this.error=e.error,this.error_description=e.error_description}}var qt="AccessDeniedException",Ht="AuthorizationPendingException",Mt="AccessToken",Gt="ClientSecret",jt="CreateToken",Kt="CreateTokenRequest",Vt="CreateTokenResponse",zt="CodeVerifier",Lt="ExpiredTokenException",Bt="InvalidClientException",Wt="InvalidGrantException",Yt="InvalidRequestException",Jt="InternalServerException",Qt="InvalidScopeException",Zt="IdToken",er="RefreshToken",tr="SlowDownException",rr="UnauthorizedClientException",or="UnsupportedGrantTypeException",nr="accessToken",l="client",sr="clientId",ir="clientSecret",cr="codeVerifier",pr="code",dr="deviceCode",r="error",ur="expiresIn",d="error_description",lr="grantType",hr="http",u="httpError",_r="idToken",L="reason",B="refreshToken",mr="redirectUri",W="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc",xr="scope",fr="server",Sr="tokenType",o="com.amazonaws.ssooidc",Y=V.for(W),J=[-3,W,"SSOOIDCServiceException",0,[],[]];Y.registerError(J,i);var a=V.for(o),X=[-3,o,qt,{[r]:l,[u]:400},[r,L,d],[0,0,0]];a.registerError(X,S);var Q=[-3,o,Ht,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(Q,v);var Z=[-3,o,Lt,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(Z,P);var ee=[-3,o,Jt,{[r]:fr,[u]:500},[r,d],[0,0]];a.registerError(ee,I);var te=[-3,o,Bt,{[r]:l,[u]:401},[r,d],[0,0]];a.registerError(te,C);var re=[-3,o,Wt,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(re,A);var oe=[-3,o,Yt,{[r]:l,[u]:400},[r,L,d],[0,0,0]];a.registerError(oe,y);var ne=[-3,o,Qt,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(ne,T);var se=[-3,o,tr,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(se,O);var ie=[-3,o,rr,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(ie,R);var ce=[-3,o,or,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(ce,D);var ae=[Y,a],vr=[0,o,Mt,8,0],Pr=[0,o,Gt,8,0],Ir=[0,o,zt,8,0],Cr=[0,o,Zt,8,0],pe=[0,o,er,8,0],de=[3,o,Kt,0,[sr,ir,lr,dr,pr,B,xr,mr,cr],[0,[()=>Pr,0],0,0,0,[()=>pe,0],64,0,[()=>Ir,0]],3],ue=[3,o,Vt,0,[nr,Sr,ur,B,_r],[[()=>vr,0],0,1,[()=>pe,0],[()=>Cr,0]]],le=[9,o,jt,{[hr]:["POST","/token",200]},()=>de,()=>ue],Ar=(e)=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??mt,base64Encoder:e?.base64Encoder??Et,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Ft,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Tt,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(t)=>t.getIdentityProvider("aws.auth#sigv4"),signer:new lt},{schemeId:"smithy.api#noAuth",identityProvider:(t)=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Re}],logger:e?.logger??new be,protocol:e?.protocol??vt,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.ssooidc",errorTypeRegistries:ae,version:"2019-06-10",serviceTarget:"AWSSSOOIDCService"},serviceId:e?.serviceId??"SSO OIDC",sha256:e?.sha256??Pt,urlParser:e?.urlParser??tt,utf8Decoder:e?.utf8Decoder??gt,utf8Encoder:e?.utf8Encoder??_t}),yr=(e)=>{Ue(process.version);let t=Ke(e),n=()=>t().then(Fe),p=Ar(e);xe(process.version);let s={profile:e?.profile,logger:p.logger};return{...p,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??h(ht,s),bodyLengthChecker:e?.bodyLengthChecker??xt,defaultUserAgentProvider:e?.defaultUserAgentProvider??fe({serviceId:p.serviceId,clientVersion:$t.version}),maxAttempts:e?.maxAttempts??h(ct,e),region:e?.region??h(Le,{...Be,...s}),requestHandler:St.create(e?.requestHandler??n),retryMode:e?.retryMode??h({...it,default:async()=>(await n()).retryMode||st},e),streamCollector:e?.streamCollector??ft,useDualstackEndpoint:e?.useDualstackEndpoint??h(ze,s),useFipsEndpoint:e?.useFipsEndpoint??h(Ve,s),userAgentAppId:e?.userAgentAppId??h(Se,s)}},Tr=(e)=>{let{httpAuthSchemes:t,httpAuthSchemeProvider:n,credentials:p}=e;return{setHttpAuthScheme(s){let m=t.findIndex((k)=>k.schemeId===s.schemeId);if(m===-1)t.push(s);else t.splice(m,1,s)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(s){n=s},httpAuthSchemeProvider(){return n},setCredentials(s){p=s},credentials(){return p}}},Or=(e)=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),Rr=(e,t)=>{let n=Object.assign(ve(e),qe(e),rt(e),Tr(e));return t.forEach((p)=>p.configure(n)),Object.assign(e,Pe(n),He(n),ot(n),Or(n))};class b extends K{config;constructor(...[e]){let t=yr(e||{});super(t);this.initConfig=t;let n=Rt(t),p=Ie(n),s=at(p),m=We(s),k=Ce(m),he=Ze(k),_e=Ot(he),ge=Rr(_e,e?.extensions||[]);this.config=ge,this.middlewareStack.use(dt(this.config)),this.middlewareStack.use(Ae(this.config)),this.middlewareStack.use(pt(this.config)),this.middlewareStack.use(nt(this.config)),this.middlewareStack.use(ye(this.config)),this.middlewareStack.use(Te(this.config)),this.middlewareStack.use(Oe(this.config)),this.middlewareStack.use(De(this.config,{httpAuthSchemeParametersProvider:It,identityProviderConfigProvider:async(Ee)=>new ke({"aws.auth#sigv4":Ee.credentials})})),this.middlewareStack.use($e(this.config))}destroy(){super.destroy()}}var Dr=Me(Dt,"AWSSSOOIDCService","SSOOIDCClient",et),kr={},$r=(e,t,n,p)=>[];class U extends Dr(kr,$r,"CreateToken",le){}var wr={CreateTokenCommand:U};class F extends b{}Ge(wr,F);var Nr={KMS_ACCESS_DENIED:"KMS_AccessDeniedException"},br={KMS_DISABLED_KEY:"KMS_DisabledException",KMS_INVALID_KEY_USAGE:"KMS_InvalidKeyUsageException",KMS_INVALID_STATE:"KMS_InvalidStateException",KMS_KEY_NOT_FOUND:"KMS_NotFoundException"};var qr=S,Hr=X,Mr=Nr,Gr=v,jr=Q,Kr=le,Vr=U,zr=de,Lr=ue,Br=P,Wr=Z,Yr=I,Jr=ee,Xr=C,Qr=te,Zr=A,eo=re,to=y,ro=oe,oo=br,no=T,so=ne,io=F,co=b,ao=i,po=J,uo=O,lo=se,ho=R,_o=ie,go=D,Eo=ce,mo=ae;export{Ur as $Command,Fr as __Client,qr as AccessDeniedException,Hr as AccessDeniedException$,Mr as AccessDeniedExceptionReason,Gr as AuthorizationPendingException,jr as AuthorizationPendingException$,Kr as CreateToken$,Vr as CreateTokenCommand,zr as CreateTokenRequest$,Lr as CreateTokenResponse$,Br as ExpiredTokenException,Wr as ExpiredTokenException$,Yr as InternalServerException,Jr as InternalServerException$,Xr as InvalidClientException,Qr as InvalidClientException$,Zr as InvalidGrantException,eo as InvalidGrantException$,to as InvalidRequestException,ro as InvalidRequestException$,oo as InvalidRequestExceptionReason,no as InvalidScopeException,so as InvalidScopeException$,io as SSOOIDC,co as SSOOIDCClient,ao as SSOOIDCServiceException,po as SSOOIDCServiceException$,uo as SlowDownException,lo as SlowDownException$,ho as UnauthorizedClientException,_o as UnauthorizedClientException$,go as UnsupportedGrantTypeException,Eo as UnsupportedGrantTypeException$,mo as errorTypeRegistries};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{S,M,w,
|
|
1
|
+
import{S,M,w,L,a,g}from"./chunk-akafypge.js";L();var en=({onResize:s,className:l=""})=>{let[t,r]=w(!1),o=M(0);S(()=>{if(!t)return;let e=(u)=>{let d=u.clientX-o.current;o.current=u.clientX,s(d)},n=()=>{r(!1),document.body.style.cursor=""};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",n),document.body.style.cursor="col-resize",()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",n),document.body.style.cursor=""}},[t,s]);let c=(e)=>{e.preventDefault(),e.stopPropagation(),r(!0),o.current=e.clientX},i=()=>a("div",{className:"absolute inset-y-0 -left-4 -right-4 z-20 cursor-col-resize touch-none"});return g("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 ${l}`,onMouseDown:c,children:[a(i,{}),a("div",{className:`absolute inset-y-0 w-[2px] transition-all duration-300 ease-out
|
|
2
2
|
${t?"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
|
`}),a("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
|
${t?"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"}`})]})};
|
|
5
|
-
export{
|
|
5
|
+
export{en};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Y,G,S,Q,M,w,Fo,L,W,a,g,ae,op,sp,Hr,Sd,sl,ts,lr,Ls,ip,ap,lp,cp,Id,up,ee,X,Rt,Je,R,j,Ar,V,Dr,Ht,qe,Be,dr,gn,or,Zs,Ke,U,zt,Le,me,Gt,Jr,tr,we,Sr,N,$e,He,Qe,wv,Ev,dh,Kb,Yb,Xb,Rw,_h,Zw,S_,Ge,CE,kE,RE,dl,P_,Mx,Rp,Ld,L_,Li,as,ey,fS,ty,Fh,US,zS,jS,qS,kI,gy,QI,VT,KT,Vh,I1,eg,tg,z1,K1,ek,bk,Hy,jd,Ok,t0,Jp,f0,hR,AR,ug,yR,wR,m0,xR,CR,h0,SR,TR,nm,om,sm,du,gg,FR,LR,ZR,BR,im,GR,Ui,lM,EM,SM,BM,Cg,zM,YM,XM,tO,rO,nO,oO,F0,sO,L0,q0,PO,DO,NO,iP,Q0,V0,aP,J0,dm,uP,mP,kP,NP,rv,to,Zg,oD,uD,dD,Kd,AD,jg,OD,ct,ut,dt,ft,pt,mt,ht,gt,Se,xe,ke,Ce,Nt,re,Ie,Vt,B,ic,ac,_u,sn,Hg,ho,go,Xr,_n,ge,wt,Et,xt,Ir,Tr,Im,st,Ct,St,Zt,_t}from"./chunk-akafypge.js";import{ds,Ur}from"./chunk-7q4mgd5x.js";import{Du}from"./chunk-bssb9tar.js";import{$i,no,xs,Eu,uc,ka,xu}from"./chunk-598x693h.js";import"./chunk-vf9s8b5t.js";import{zn,jn,qn,Rr,bt,yt}from"./chunk-bywk8mbc.js";import"./chunk-km70p970.js";import{$o}from"./chunk-8a7ymmd4.js";import{Nu}from"./chunk-na5fh7er.js";import{$n}from"./chunk-qw92z3wf.js";import{zr}from"./chunk-wzrzc07t.js";L();function de(e,t){let s=new Set(t);return e.filter((i)=>!s.has(i))}var ce=class extends ts{#r;#e;#o;#a;#t;#s;#i;#n;#l;#d=[];constructor(e,t,s){super();this.#r=e,this.#a=s,this.#o=[],this.#t=[],this.#e=[],this.setQueries(t)}onSubscribe(){if(this.listeners.size===1)this.#t.forEach((e)=>{e.subscribe((t)=>{this.#p(e,t)})})}onUnsubscribe(){if(!this.listeners.size)this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach((e)=>{e.destroy()})}setQueries(e,t){this.#o=e,this.#a=t,lr.batch(()=>{let s=this.#t,i=this.#u(this.#o);i.forEach((p)=>p.observer.setOptions(p.defaultedQueryOptions));let n=i.map((p)=>p.observer),o=n.map((p)=>p.getCurrentResult()),c=s.length!==n.length,u=n.some((p,b)=>p!==s[b]),f=c||u,v=f?!0:o.some((p,b)=>{let h=this.#e[b];return!h||!sl(p,h)});if(!f&&!v)return;if(f)this.#d=i,this.#t=n;if(this.#e=o,!this.hasListeners())return;if(f)de(s,n).forEach((p)=>{p.destroy()}),de(n,s).forEach((p)=>{p.subscribe((b)=>{this.#p(p,b)})});this.#f()})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map((e)=>e.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(e,t){let s=this.#u(e),i=s.map((o)=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),n=s.map((o)=>o.defaultedQueryOptions.queryHash);return[i,(o)=>this.#c(o??i,t,n),()=>this.#m(i,s)]}#m(e,t){let s=new Set;return t.map((i,n)=>{let o=e[n];return!i.defaultedQueryOptions.notifyOnChangeProps?i.observer.trackResult(o,(c)=>{if(!s.has(c))s.add(c),t.forEach((u)=>{u.observer.trackProp(c)})}):o})}#c(e,t,s){if(t){let i=this.#l,n=s!==void 0&&i!==void 0&&(i.length!==s.length||s.some((o,c)=>o!==i[c]));if(this.#e!==this.#n||n||t!==this.#i){if(this.#i=t,this.#n=this.#e,s!==void 0)this.#l=s;this.#s=Sd(this.#s,t(e))}return this.#s}return e}#g(){return!this.#a?.combine||this.#t.some((e,t)=>e.options.suspense&&this.#e[t]?.data===void 0)}#u(e){let t=new Map;this.#t.forEach((i)=>{let n=i.options.queryHash;if(!n)return;let o=t.get(n);if(o)o.push(i);else t.set(n,[i])});let s=[];return e.forEach((i)=>{let n=this.#r.defaultQueryOptions(i),o=t.get(n.queryHash)?.shift()??new Ls(this.#r,n);s.push({defaultedQueryOptions:n,observer:o})}),s}#p(e,t){let s=this.#t.indexOf(e);if(s!==-1)this.#e=this.#e.slice(),this.#e[s]=t,this.#f()}#f(){if(this.hasListeners()){let e=this.#g(),t=this.#s,s=e?t:this.#c(this.#m(this.#e,this.#d),this.#a?.combine);if(e||t!==s)lr.batch(()=>{this.listeners.forEach((i)=>{i(this.#e)})})}}};L();function ue({queries:e,...t},s){let i=ae(s),n=op(),o=sp(),c=t.subscribed!==!1,u=Q(()=>e.map((m)=>{let x=i.defaultQueryOptions(m);return x._optimisticResults=n?"isRestoring":c?"optimistic":void 0,x}),[e,i,n,c]);u.forEach((m)=>{cp(m);let x=i.getQueryCache().get(m.queryHash);ip(m,o,x)}),ap(o);let[f]=w(()=>new ce(i,u,t)),[v,p,b]=f.getOptimisticResult(u,t.combine),h=!n&&c;Fo(G((m)=>h?f.subscribe(lr.batchCalls(m)):Hr,[f,h]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),S(()=>{f.setQueries(u,t)},[u,t,f]);let l=v.some((m,x)=>Id(u[x],m))?v.flatMap((m,x)=>{let _=u[x];if(_&&Id(_,m)){let A=new Ls(i,_);return up(_,A,o)}return[]}):[];if(l.length>0)throw Promise.all(l);let T=v.find((m,x)=>{let _=u[x];return _&&lp({result:m,errorResetBoundary:o,throwOnError:_.throwOnError,query:i.getQueryCache().get(_.queryHash),suspense:_.suspense})});if(T)throw T.error;return p(b())}L();L();var je=Object.defineProperty,z=(e,t)=>je(e,"name",{value:t,configurable:!0}),oe="Collapsible",[Fe,da]=zt(oe),[We,ie]=Fe(oe),ze=Y(z(function(t,s){let{__scopeCollapsible:i,open:n,defaultOpen:o,disabled:c,onOpenChange:u,...f}=t,[v,p]=tr({prop:n,defaultProp:o??!1,onChange:u,caller:oe});return a(We,{scope:i,disabled:c,contentId:Jr(),open:v,onOpenToggle:G(()=>p((b)=>!b),[p]),children:a(we.div,{"data-state":te(v),"data-disabled":c?"":void 0,...f,ref:s})})},"Collapsible")),Ue="CollapsibleTrigger",Ve=Y(z(function(t,s){let{__scopeCollapsible:i,...n}=t,o=ie(Ue,i);return a(we.button,{type:"button","aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open||!1,"data-state":te(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:s,onClick:me(t.onClick,o.onOpenToggle)})},"CollapsibleTrigger")),pe="CollapsibleContent",Xe=Y(z(function(t,s){let{forceMount:i,...n}=t,o=ie(pe,t.__scopeCollapsible);return a(Sr,{present:i||o.open,children:({present:c})=>a(Ye,{...n,ref:s,present:c})})},"CollapsibleContent")),Ye=Y(z(function(t,s){let{__scopeCollapsible:i,present:n,children:o,...c}=t,u=ie(pe,i),[f,v]=w(n),p=M(null),b=Le(s,p),h=M(0),l=h.current,T=M(0),m=T.current,x=u.open||f,_=M(x),A=M(void 0);return S(()=>{let k=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(k)},[]),Gt(()=>{let k=p.current;if(k){A.current=A.current||{transitionDuration:k.style.transitionDuration,animationName:k.style.animationName},k.style.transitionDuration="0s",k.style.animationName="none";let I=k.getBoundingClientRect();if(h.current=I.height,T.current=I.width,!_.current)k.style.transitionDuration=A.current.transitionDuration,k.style.animationName=A.current.animationName;v(n)}},[u.open,n]),a(we.div,{"data-state":te(u.open),"data-disabled":u.disabled?"":void 0,id:u.contentId,hidden:!x,...c,ref:b,style:{["--radix-collapsible-content-height"]:l?`${l}px`:void 0,["--radix-collapsible-content-width"]:m?`${m}px`:void 0,...t.style},children:x&&o})},"CollapsibleContentImpl"));function te(e){return e?"open":"closed"}z(te,"getState");var Ze=ze;var tt=[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V3",key:"1lcnhd"}],["path",{d:"M19 21V9",key:"unv183"}]],fe=j("chart-no-axes-column",tt);var at=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],H=j("funnel",at);var rt=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],be=j("eye",rt);var ot=[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]],K=j("messages-square",ot);var it=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],he=j("rotate-cw",it);var nt=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],se=j("workflow",nt);function ve({teamId:e}){let[t,s]=w("team"),[i,n]=w("1h"),{data:o,isLoading:c}=ee({queryKey:["teams",e,"ai-usage",i,"team"],queryFn:async()=>{let m=await R.api.teams[":teamId"]["ai-usage"].$get({param:{teamId:e},query:{timeframe:i}});if(!m.ok)throw Error("Failed to fetch team AI usage");return await m.json()},enabled:!!e&&t==="team"}),{data:u,isLoading:f}=ee({queryKey:["teams",e,"members"],queryFn:async()=>{let m=await R.api.teams[":teamId"].members.$get({param:{teamId:e},query:{}});if(!m.ok)throw Error("Failed to fetch team members");return await m.json()},enabled:!!e&&t==="members"}),v=ue({queries:(u||[]).map((m)=>({queryKey:["teams",e,"ai-usage",i,m.id],queryFn:async()=>{let x=await R.api.teams[":teamId"]["ai-usage"].$get({param:{teamId:e},query:{timeframe:i,userId:m.id}});if(!x.ok)throw Error(`Failed to fetch AI usage for member ${m.id}`);return await x.json()},enabled:!!e&&t==="members"}))}),p=f||v.some((m)=>m.isLoading),b=(m)=>{if(!m)return"U";let x=m.split(" ");if(x.length>1)return`${x[0][0]}${x[x.length-1][0]}`.toUpperCase();return m.substring(0,2).toUpperCase()},h=(m)=>{if(!m)return"";switch(m.toLowerCase()){case"owner":return jd();case"editor":return Li();case"reviewer":return Ui();default:return m}},l=(m)=>(m??0).toLocaleString(),T=(m)=>`$${(m??0).toFixed(6)}`;return g(st,{className:"border-border/60 shadow-sm",children:[g(Ct,{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between pb-6",children:[g("div",{children:[a(St,{className:"text-xl font-semibold tracking-tight",children:Yb()}),a(Zt,{className:"text-sm text-muted-foreground mt-1",children:Xb()})]}),g("div",{className:"flex flex-wrap items-center gap-3",children:[g(ds,{type:"single",value:t,onValueChange:(m)=>{if(m)s(m)},className:"border rounded-lg p-1 bg-muted/30",children:[a(Ur,{value:"team",className:"px-3 py-1.5 text-xs font-medium",children:mP()}),a(Ur,{value:"members",className:"px-3 py-1.5 text-xs font-medium",children:KT()})]}),g(ds,{type:"single",value:i,onValueChange:(m)=>{if(m)n(m)},className:"border rounded-lg p-1 bg-muted/30",children:[a(Ur,{value:"1h",className:"px-2.5 py-1.5 text-xs font-medium",children:"1h"}),a(Ur,{value:"24h",className:"px-2.5 py-1.5 text-xs font-medium",children:"24h"}),a(Ur,{value:"7d",className:"px-2.5 py-1.5 text-xs font-medium",children:"7d"}),a(Ur,{value:"30d",className:"px-2.5 py-1.5 text-xs font-medium",children:"30d"})]})]})]}),a(_t,{children:t==="team"?c?a("div",{className:"flex h-48 items-center justify-center",children:a(V,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):a("div",{className:"rounded-md border",children:g(zn,{children:[a(jn,{children:g(Rr,{children:[a(bt,{children:dm()}),a(bt,{className:"text-right",children:gy()}),a(bt,{className:"text-right",children:Hy()}),a(bt,{className:"text-right",children:S_()}),a(bt,{className:"text-right",children:rv()}),a(bt,{className:"text-right",children:P_()})]})}),a(qn,{children:g(Rr,{children:[a(yt,{className:"font-medium",children:dm()}),a(yt,{className:"text-right",children:l(o?.team?.inputTokens)}),a(yt,{className:"text-right",children:l(o?.team?.outputTokens)}),a(yt,{className:"text-right",children:l(o?.team?.cacheReadTokens)}),a(yt,{className:"text-right font-medium",children:l(o?.team?.totalTokens)}),a(yt,{className:"text-right font-medium",children:T(o?.team?.cost)})]})})]})}):p?a("div",{className:"flex h-48 items-center justify-center",children:a(V,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):a("div",{className:"rounded-md border",children:g(zn,{children:[a(jn,{children:g(Rr,{children:[a(bt,{children:VT()}),a(bt,{children:lM()}),a(bt,{className:"text-right",children:gy()}),a(bt,{className:"text-right",children:Hy()}),a(bt,{className:"text-right",children:S_()}),a(bt,{className:"text-right",children:rv()}),a(bt,{className:"text-right",children:P_()})]})}),a(qn,{children:(u||[]).map((m,x)=>{let _=v[x]?.data?.member;return g(Rr,{children:[a(yt,{children:g("div",{className:"flex items-center gap-3",children:[g($e,{className:"h-8 w-8 rounded-full",children:[m.image&&a(He,{src:m.image,alt:m.name,className:"object-cover"}),a(Qe,{className:"bg-primary/20 text-xs",children:b(m.name)})]}),g("div",{className:"flex flex-col",children:[a("span",{className:"text-sm font-medium leading-none",children:m.name}),a("span",{className:"text-xs text-muted-foreground mt-0.5",children:m.email})]})]})}),a(yt,{className:"text-xs text-muted-foreground",children:h(m.role)}),a(yt,{className:"text-right",children:l(_?.inputTokens)}),a(yt,{className:"text-right",children:l(_?.outputTokens)}),a(yt,{className:"text-right",children:l(_?.cacheReadTokens)}),a(yt,{className:"text-right font-medium",children:l(_?.totalTokens)}),a(yt,{className:"text-right font-medium",children:T(_?.cost)})]},m.id)})})]})})})]})}L();function Ne({teamId:e}){let[t,s]=w(null),{ref:i,inView:n}=Vt(),{data:o,isLoading:c,isError:u,fetchNextPage:f,hasNextPage:v,isFetchingNextPage:p}=Rt({queryKey:["teams",e,"agent-sessions"],queryFn:async({pageParam:l})=>{let T=await R.api.teams[":teamId"]["agent-sessions"].$get({param:{teamId:e},query:{first:"20",after:l?String(l):void 0}});if(!T.ok)throw Error("Failed to fetch agent sessions");return await T.json()},initialPageParam:"",getNextPageParam:(l)=>l.pageInfo.cursor||void 0,enabled:!!e});S(()=>{if(n&&v&&!p)f()},[n,v,p,f]);let b=o?.pages.flatMap((l)=>l.data).filter((l)=>l.id!=="pending")||[],h=(l)=>{switch(l){case"comment":return a(ge,{variant:"outline",className:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20",children:nO()});case"chat":return a(ge,{variant:"outline",className:"bg-violet-500/10 text-violet-600 dark:text-violet-400 border-violet-500/20",children:rO()});case"naming":return a(ge,{variant:"outline",className:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20",children:oO()});default:return a(ge,{variant:"outline",className:"bg-muted text-muted-foreground border-border",children:l})}};return g("div",{className:"space-y-6",children:[g(st,{className:"border border-border/50 shadow-xs",children:[a(Ct,{className:"pb-4",children:a("div",{className:"flex items-center justify-between",children:g("div",{children:[g(St,{className:"text-xl font-bold flex items-center gap-2",children:[a(K,{className:"w-5 h-5 text-violet-500"}),F0()]}),a(Zt,{className:"mt-1 text-sm text-muted-foreground",children:sO()})]})})}),a(_t,{children:c?a("div",{className:"flex h-64 items-center justify-center",children:a(V,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):u?a("div",{className:"flex h-64 items-center justify-center text-destructive",children:"Failed to load agent sessions."}):b.length===0?g("div",{className:"flex flex-col items-center justify-center py-12 text-center text-muted-foreground",children:[a(K,{className:"w-10 h-10 text-muted-foreground/40 mb-3"}),a("p",{className:"text-base font-medium",children:z1()})]}):g("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[g(zn,{children:[a(jn,{className:"bg-muted/40",children:g(Rr,{children:[a(bt,{children:XM()}),a(bt,{children:Ld()}),a(bt,{children:tO()}),a(bt,{className:"text-right",children:Mx()})]})}),a(qn,{children:b.map((l)=>g(Rr,{onClick:()=>s(l.id),className:"cursor-pointer hover:bg-muted/50 transition-colors",children:[a(yt,{className:"font-medium",children:g("div",{className:"flex flex-col",children:[a("span",{className:"text-sm font-semibold text-foreground",children:l.name||Zg()}),a("span",{className:"text-xs font-mono text-muted-foreground/70",children:l.id})]})}),a(yt,{children:g("div",{className:"flex items-center gap-2",children:[g($e,{className:"h-6 w-6",children:[a(He,{src:l.creator?.image||void 0}),a(Qe,{className:"text-[10px]",children:l.creator?.name?.[0]?.toUpperCase()||"?"})]}),a("span",{className:"text-sm text-foreground/90",children:l.creator?.name||"System / Agent"})]})}),a(yt,{children:h(l.type)}),a(yt,{className:"text-right text-xs text-muted-foreground",children:sn(l.createdAt)})]},l.id))})]}),a("div",{ref:i,className:"py-4 flex justify-center",children:p&&a(V,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]})})]}),a(Du,{sessionId:t,open:!!t,onOpenChange:(l)=>{if(!l)s(null)}})]})}L();function ye({...e}){return a(Ze,{"data-slot":"collapsible",...e})}function Te({...e}){return a(Ve,{"data-slot":"collapsible-trigger",...e})}function _e({...e}){return a(Xe,{"data-slot":"collapsible-content",...e})}function ne(e){switch(e.toLowerCase()){case"owner":return jd();case"editor":return Li();case"reviewer":return Ui();default:return e}}function lt(e,t){if(typeof e==="object"&&e!==null&&"message"in e){let s=e.message;if(typeof s==="string")return s}return t}function vt({rule:e}){let t=e.resourceData??{};if(e.resource==="agent_mcp_call_count")return a("span",{children:LR({value:String(t.id??"")})});if(e.resource==="agent_bash_call_count")return a("span",{children:FR({value:String(t.match??"*")})});if(e.resource==="agent_tool_call_count")return a("span",{children:ZR({value:String(t.name??t.toolName??"*")})});return null}function Tt({rule:e}){if(e.scopeMode==="all_members")return g(ge,{variant:"secondary",className:"gap-1 text-xs",children:[a($o,{className:"h-3 w-3"}),g("span",{children:[nm(),e.role?` (${ne(e.role)})`:` (${du()})`]})]});if(e.scopeMode==="each_member")return g(ge,{variant:"secondary",className:"gap-1 text-xs",children:[a($n,{className:"h-3 w-3"}),g("span",{children:[om(),e.role?` (${ne(e.role)})`:` (${du()})`]})]});return g(ge,{variant:"secondary",className:"gap-1 text-xs",children:[a(Zs,{className:"h-3 w-3"}),g("span",{children:[sm()," (",e.userIds?.length||0,")"]})]})}function kt({teamId:e,rule:t,record:s}){let i=ae(),[n,o]=w(!1),[c,u]=w(()=>new Date),f=uc[t.resource],v=t.scopeMode==="all_members",p=s.percent>=100,b=v?t.role?`${TR()}: ${ne(t.role)}`:BR():s.user?.name||s.userId||to();S(()=>{if(!s.isWindowActive||!s.periodEnd)return;let l=window.setInterval(()=>u(new Date),60000);return()=>window.clearInterval(l)},[s.isWindowActive,s.periodEnd]);let h=X({mutationFn:async()=>{let l=await R.api.teams[":teamId"].quotas[":id"].records.reset.$post({param:{teamId:e,id:t.id},json:{userId:s.userId??null}});if(!l.ok){let T=await l.json().catch(()=>null);throw Error(lt(T,ty()))}return await l.json()},onSuccess:()=>{i.invalidateQueries({queryKey:["teams",e,"quotas",t.id,"records"]}),i.invalidateQueries({queryKey:["teams",e,"quotas"]}),o(!1),B.success(CR())},onError:(l)=>{let T=l instanceof Error?l.message:ty();o(!1),B.error(T)}});return g(W,{children:[g("div",{className:"space-y-3 rounded-xl border border-border/70 bg-card p-4 text-card-foreground shadow-2xs",children:[g("div",{className:"flex items-center justify-between gap-3",children:[g("div",{className:"flex min-w-0 items-center gap-3",children:[v?a("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:a($o,{className:"h-5 w-5"})}):g($e,{className:"h-9 w-9 shrink-0 border border-border/50",children:[a(He,{src:s.user?.image||void 0}),a(Qe,{className:"text-xs font-semibold",children:s.user?.name?.[0]?.toUpperCase()||"U"})]}),g("div",{className:"min-w-0",children:[a("div",{className:"truncate text-sm font-semibold text-foreground",children:b}),!v&&s.user?.email&&a("div",{className:"truncate text-xs text-muted-foreground",children:s.user.email})]})]}),g("div",{className:"flex shrink-0 items-center gap-2",children:[s.isWindowActive&&s.periodEnd?g(ge,{variant:"outline",className:"hidden gap-1 border-primary/30 bg-primary/5 text-xs text-primary sm:flex",children:[a(dr,{className:"h-3 w-3"}),a("span",{children:m0({time:Hg(s.periodEnd,c)})})]}):g(ge,{variant:"secondary",className:"hidden gap-1 text-xs text-muted-foreground sm:flex",children:[a(Ar,{className:"h-3 w-3 text-primary"}),a("span",{children:f0()})]}),g(N,{type:"button",variant:"outline",size:"sm",className:"gap-1.5",onClick:()=>o(!0),disabled:h.isPending,children:[h.isPending?a(V,{className:"h-3.5 w-3.5 animate-spin"}):a($i,{className:"h-3.5 w-3.5"}),h0()]})]})]}),g("div",{className:"space-y-1.5 pt-1",children:[a(Im,{value:Math.min(100,Math.max(0,s.percent)),className:"h-2"}),g("div",{className:"flex items-center justify-between gap-2 text-xs font-medium",children:[g("span",{className:p?"font-bold text-destructive":"text-foreground",children:[ka(t.resource,s.consumed)," /"," ",ka(t.resource,t.limit)," ",f?.unit]}),g("span",{className:p?"font-bold text-destructive":"text-muted-foreground",children:[s.percent,"%"]})]})]}),g("div",{className:"flex items-center justify-between gap-2 text-xs text-muted-foreground sm:hidden",children:[s.isWindowActive&&s.periodEnd?g("span",{className:"flex items-center gap-1 text-primary",children:[a(dr,{className:"h-3 w-3"}),m0({time:Hg(s.periodEnd,c)})]}):g("span",{className:"flex items-center gap-1",children:[a(Ar,{className:"h-3 w-3 text-primary"}),f0()]}),g("span",{children:[xR(),": ",ka(t.resource,s.remaining)," ",f?.unit]})]})]}),a(ct,{open:n,onOpenChange:o,children:g(ut,{children:[g(dt,{children:[a(pt,{children:h0()}),a(mt,{children:SR({target:b})})]}),g(ft,{children:[a(gt,{disabled:h.isPending,children:Ge()}),g(ht,{onClick:(l)=>{l.preventDefault(),h.mutate()},disabled:h.isPending,children:[h.isPending&&a(V,{className:"mr-2 h-4 w-4 animate-spin"}),dl()]})]})]})})]})}function At({teamId:e,rule:t}){let[s,i]=w(!1),[n,o]=w(""),c=uc[t.resource],u=c?.icon||xs,{data:f,isLoading:v,isError:p}=ee({queryKey:["teams",e,"quotas",t.id,"records"],queryFn:async()=>{let l=await R.api.teams[":teamId"].quotas[":id"].records.$get({param:{teamId:e,id:t.id}});if(!l.ok)throw Error(ey());return await l.json()},enabled:s,refetchInterval:s?1e4:!1}),b=f?.records??[],h=b.filter((l)=>{if(!n.trim())return!0;let T=n.toLowerCase();return l.user?.name.toLowerCase().includes(T)||l.user?.email.toLowerCase().includes(T)});return g(ye,{open:s,onOpenChange:i,className:"rounded-xl border border-border/70",children:[a(Te,{asChild:!0,children:g("button",{type:"button","aria-label":s?hR():yR(),className:"flex w-full items-center justify-between gap-4 p-4 text-left transition-colors hover:bg-muted/40",children:[g("div",{className:"flex min-w-0 items-start gap-3",children:[a("div",{className:"mt-0.5 rounded-lg bg-primary/10 p-2 text-primary",children:a(u,{className:"h-5 w-5"})}),g("div",{className:"min-w-0",children:[g("div",{className:"flex flex-wrap items-center gap-2",children:[a("span",{className:"font-semibold text-foreground",children:c?.label()||t.resource}),!t.enabled&&a(ge,{variant:"secondary",children:ug()})]}),g("div",{className:"mt-1 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground",children:[a(Tt,{rule:t}),g(ge,{variant:"outline",className:"gap-1 text-xs",children:[a(dr,{className:"h-3 w-3"}),ka(t.resource,t.limit)," ",c?.unit," /"," ",xu(t.period)]}),a(vt,{rule:t})]})]})]}),a(Be,{className:`h-5 w-5 shrink-0 text-muted-foreground transition-transform ${s?"rotate-180":""}`})]})}),a(_e,{children:g("div",{className:"space-y-3 border-t border-border/60 bg-muted/10 p-4",children:[t.scopeMode!=="all_members"&&b.length>3&&g("div",{className:"relative",children:[a(or,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),a(re,{value:n,onChange:(l)=>o(l.target.value),placeholder:gg(),className:"h-9 pl-9 text-sm"})]}),v?a("div",{className:"flex justify-center py-10",children:a(V,{className:"h-7 w-7 animate-spin text-primary"})}):p?a("div",{className:"py-8 text-center text-sm text-destructive",children:ey()}):h.length===0?a("div",{className:"py-8 text-center text-sm text-muted-foreground",children:wR()}):h.map((l,T)=>a(kt,{teamId:e,rule:t,record:l},l.id||l.userId||`record-${T}`))]})})]})}function Ae({teamId:e}){let{data:t,isLoading:s,isError:i}=ee({queryKey:["teams",e,"quotas"],queryFn:async()=>{let o=await R.api.teams[":teamId"].quotas.$get({param:{teamId:e}});if(!o.ok)throw Error(as());return await o.json()},enabled:!!e}),n=t?.rules??[];return g(st,{className:"border-border/60 shadow-sm",children:[g(Ct,{children:[g(St,{className:"flex items-center gap-2 text-xl font-semibold tracking-tight",children:[a(xs,{className:"h-5 w-5 text-primary"}),im()]}),a(Zt,{children:AR()})]}),a(_t,{children:s?a("div",{className:"flex h-48 items-center justify-center",children:a(V,{className:"h-7 w-7 animate-spin text-muted-foreground"})}):i?a("div",{className:"py-10 text-center text-sm text-destructive",children:as()}):n.length===0?g("div",{className:"flex flex-col items-center justify-center rounded-xl border-2 border-dashed border-border py-12 text-center",children:[a(xs,{className:"mb-3 h-10 w-10 text-muted-foreground/50"}),a("p",{className:"text-base font-medium text-foreground",children:tg()}),a("p",{className:"mt-1 max-w-md text-sm text-muted-foreground",children:eg()})]}):a("div",{className:"space-y-3",children:n.map((o)=>a(At,{teamId:e,rule:o},o.id))})})]})}L();var Dt=Object.values(_u);function Re({teamId:e}){let[t,s]=w([]),[i,n]=w([]),[o,c]=w(""),{ref:u,inView:f}=Vt(),{data:v}=ee({queryKey:["teams",e,"members"],queryFn:async()=>{let d=await R.api.teams[":teamId"].members.$get({param:{teamId:e},query:{}});if(!d.ok)return[];return await d.json()},enabled:!!e}),p=v||[],{data:b,isLoading:h,isError:l,fetchNextPage:T,hasNextPage:m,isFetchingNextPage:x}=Rt({queryKey:["teams",e,"audit-logs",t,i,o],queryFn:async({pageParam:d})=>{let y=await R.api.teams[":teamId"]["audit-logs"].$get({param:{teamId:e},query:{first:"20",after:d?String(d):void 0,actions:t.length>0?t:void 0,userIds:i.length>0?i:void 0,itemId:o.trim()||void 0}});if(!y.ok)throw Error("Failed to fetch audit logs");return await y.json()},initialPageParam:"",getNextPageParam:(d)=>d.pageInfo.endCursor||void 0,enabled:!!e});S(()=>{if(f&&m&&!x)T()},[f,m,x,T]);let _=b?.pages.flatMap((d)=>d.nodes)||[],A=b?.pages[0]?.total??0,k=(d)=>{s((y)=>y.includes(d)?y.filter((q)=>q!==d):[...y,d])},I=(d)=>{n((y)=>y.includes(d)?y.filter((q)=>q!==d):[...y,d])},P=(d)=>{if(d.includes("delete")||d.includes("remove")||d.includes("revoke"))return a(ge,{variant:"outline",className:"bg-destructive/10 text-destructive border-destructive/20 font-mono text-xs",children:d});if(d.includes("create")||d.includes("add"))return a(ge,{variant:"outline",className:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20 font-mono text-xs",children:d});if(d.includes("update")||d.includes("reparent")||d.includes("copy"))return a(ge,{variant:"outline",className:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20 font-mono text-xs",children:d});return a(ge,{variant:"outline",className:"bg-muted text-muted-foreground border-border font-mono text-xs",children:d})},J=new Map(p.map((d)=>[d.userId||d.id,d]));return a("div",{className:"space-y-6",children:g(st,{className:"border border-border/50 shadow-xs",children:[g(Ct,{className:"pb-4",children:[g("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[g("div",{children:[g(St,{className:"text-xl font-bold flex items-center gap-2",children:[a($i,{className:"h-5 w-5 text-primary"}),_h()]}),a(Zt,{className:"mt-1",children:Zw()})]}),A>0&&g(ge,{variant:"secondary",className:"w-fit text-xs font-normal",children:[A," ",_h()]})]}),g("div",{className:"mt-4 flex flex-wrap items-center gap-3 pt-4 border-t border-border/40",children:[g(wt,{children:[a(Et,{asChild:!0,children:g(N,{variant:"outline",size:"sm",className:"h-9 gap-2 text-xs border-dashed",children:[a(H,{className:"h-3.5 w-3.5"}),US(),t.length>0&&a(ge,{variant:"secondary",className:"ml-1 px-1.5 py-0 text-[10px]",children:t.length})]})}),g(xt,{className:"w-64 p-2",align:"start",children:[a("div",{className:"text-xs font-semibold text-muted-foreground px-2 py-1 mb-1",children:SM()}),a("div",{className:"max-h-60 overflow-y-auto space-y-1 pr-1",children:Dt.map((d)=>g("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-accent rounded-md cursor-pointer text-xs",children:[a(Ir,{checked:t.includes(d),onCheckedChange:()=>k(d)}),a("span",{className:"font-mono",children:d})]},d))}),t.length>0&&a(N,{variant:"ghost",size:"sm",className:"w-full mt-2 h-7 text-xs text-muted-foreground hover:text-foreground",onClick:()=>s([]),children:"Clear Actions"})]})]}),g(wt,{children:[a(Et,{asChild:!0,children:g(N,{variant:"outline",size:"sm",className:"h-9 gap-2 text-xs border-dashed",children:[a(H,{className:"h-3.5 w-3.5"}),qS(),i.length>0&&a(ge,{variant:"secondary",className:"ml-1 px-1.5 py-0 text-[10px]",children:i.length})]})}),g(xt,{className:"w-64 p-2",align:"start",children:[a("div",{className:"text-xs font-semibold text-muted-foreground px-2 py-1 mb-1",children:zM()}),a("div",{className:"max-h-60 overflow-y-auto space-y-1 pr-1",children:p.map((d)=>{let y=d.userId||d.user?.id||d.id,q=d.user?.name||d.name||y,O=d.user?.image||d.image;return g("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-accent rounded-md cursor-pointer text-xs",children:[a(Ir,{checked:i.includes(y),onCheckedChange:()=>I(y)}),g($e,{className:"h-5 w-5",children:[a(He,{src:O||void 0}),a(Qe,{className:"text-[10px]",children:q.slice(0,2).toUpperCase()})]}),a("span",{className:"truncate",children:q})]},y)})}),i.length>0&&a(N,{variant:"ghost",size:"sm",className:"w-full mt-2 h-7 text-xs text-muted-foreground hover:text-foreground",onClick:()=>n([]),children:"Clear Users"})]})]}),g("div",{className:"relative flex-1 min-w-[200px] max-w-xs",children:[a(or,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),a(re,{type:"text",placeholder:EM(),value:o,onChange:(d)=>c(d.target.value),className:"pl-8 pr-8 h-9 text-xs"}),o&&a("button",{onClick:()=>c(""),className:"absolute right-2.5 top-2.5 text-muted-foreground hover:text-foreground",children:a(Ke,{className:"h-4 w-4"})})]}),(t.length>0||i.length>0||o)&&a(N,{variant:"ghost",size:"sm",className:"h-9 px-2 text-xs text-muted-foreground hover:text-foreground",onClick:()=>{s([]),n([]),c("")},children:"Clear all"})]})]}),g(_t,{className:"p-0",children:[h?a("div",{className:"flex h-64 items-center justify-center",children:a(V,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):l?a("div",{className:"p-8 text-center text-sm text-destructive",children:"Failed to load audit logs."}):_.length===0?a("div",{className:"p-12 text-center text-sm text-muted-foreground",children:I1()}):g(zn,{children:[a(jn,{children:g(Rr,{className:"hover:bg-transparent border-b border-border/50",children:[a(bt,{className:"w-[180px] pl-6 text-xs font-semibold",children:Ev()}),a(bt,{className:"w-[200px] px-4 text-xs font-semibold",children:dD()}),a(bt,{className:"px-4 text-xs font-semibold",children:QI()}),a(bt,{className:"px-4 text-xs font-semibold",children:t0()}),a(bt,{className:"w-[160px] pr-6 text-right text-xs font-semibold",children:kP()})]})}),a(qn,{children:_.map((d)=>{let y=d.userId?J.get(d.userId):null,q=y?.user?.name||y?.name||d.userId||"System",O=y?.user?.image||y?.image;return g(Rr,{className:"hover:bg-muted/40 transition-colors",children:[a(yt,{className:"py-3 pl-6 font-medium",children:P(d.action)}),a(yt,{className:"py-3 px-4",children:g("div",{className:"flex items-center gap-2",children:[g($e,{className:"h-6 w-6",children:[a(He,{src:O||void 0}),a(Qe,{className:"text-[10px]",children:q.slice(0,2).toUpperCase()})]}),a("span",{className:"text-xs font-medium text-foreground truncate max-w-[160px]",children:d.agent?Kd({user:q,agent:d.agent.name}):q}),d.agent&&a(Ht,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"})]})}),a(yt,{className:"py-3 px-4 text-xs font-mono text-muted-foreground",children:d.itemId||"-"}),a(yt,{className:"py-3 px-4 text-xs font-mono text-muted-foreground",children:d.projectId||"-"}),a(yt,{className:"py-3 pr-6 text-right text-xs text-muted-foreground",children:sn(d.createdAt)})]},d.id)})})]}),a("div",{ref:u,className:"py-4 flex justify-center",children:x&&a(V,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]})]})})}L();L();function De({task:e,open:t,onOpenChange:s}){let[i,n]=w(null);if(!e)return null;let o=(u,f)=>{navigator.clipboard.writeText(u),n(f),setTimeout(()=>{n(null)},2000)},c=(u)=>{switch(u){case"completed":return a(ge,{variant:"outline",className:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20 text-xs font-mono",children:"completed"});case"processing":return a(ge,{variant:"outline",className:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20 text-xs font-mono",children:"processing"});case"pending":return a(ge,{variant:"outline",className:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 border-yellow-500/20 text-xs font-mono",children:"pending"});case"failed":return a(ge,{variant:"outline",className:"bg-destructive/10 text-destructive border-destructive/20 text-xs font-mono",children:"failed"});default:return a(ge,{variant:"outline",className:"text-xs font-mono",children:u||"unknown"})}};return a(Se,{open:t,onOpenChange:s,children:g(xe,{className:"max-w-2xl max-h-[90vh] flex flex-col p-6",children:[g(ke,{className:"pb-2 border-b border-border/50",children:[g("div",{className:"flex items-center justify-between gap-2 pr-6",children:[g("div",{className:"flex items-center gap-2",children:[a(gn,{className:"h-5 w-5 text-primary"}),a(Ce,{className:"text-lg font-bold",children:iP()})]}),g("div",{className:"flex items-center gap-2",children:[c(e.status),e.type&&a(ge,{variant:"secondary",className:"font-mono text-xs",children:e.type})]})]}),g(Nt,{className:"text-xs text-muted-foreground mt-1 flex items-center gap-2",children:[g("span",{children:[Q0(),": ",a("span",{className:"font-mono text-foreground",children:e.id})]}),a(N,{variant:"ghost",size:"icon",className:"h-5 w-5 text-muted-foreground hover:text-foreground",onClick:()=>o(e.id,"task_id"),children:i==="task_id"?a(qe,{className:"h-3 w-3 text-emerald-500"}):a(zr,{className:"h-3 w-3"})})]})]}),g("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3 py-3 text-xs border-b border-border/40",children:[g("div",{children:[a("div",{className:"text-muted-foreground",children:Fh()}),a("div",{className:"truncate font-medium text-foreground mt-0.5",title:e.fileName||"-",children:e.fileName||"-"})]}),g("div",{children:[a("div",{className:"text-muted-foreground",children:L0()}),a("div",{className:"font-mono truncate font-medium text-foreground mt-0.5",children:e.fileSize!==null&&e.fileSize!==void 0?Tr(e.fileSize):"-"})]}),g("div",{children:[a("div",{className:"text-muted-foreground",children:Jp()}),a("div",{className:"truncate font-medium text-foreground mt-0.5",title:e.projectName||"-",children:e.projectName||"-"})]}),g("div",{children:[a("div",{className:"text-muted-foreground",children:Rw()}),a("div",{className:"font-mono truncate font-medium text-foreground mt-0.5",children:e.assetId||"-"})]}),g("div",{children:[a("div",{className:"text-muted-foreground",children:t0()}),a("div",{className:"font-mono truncate font-medium text-foreground mt-0.5",children:e.projectId||"-"})]}),g("div",{children:[a("div",{className:"text-muted-foreground",children:Rp()}),g("div",{className:"font-medium text-foreground mt-0.5 flex items-center gap-1",children:[a(dr,{className:"h-3 w-3 text-muted-foreground"}),sn(e.createdAt)]})]}),g("div",{children:[a("div",{className:"text-muted-foreground",children:oD()}),a("div",{className:"font-medium text-foreground mt-0.5",children:sn(e.updatedAt)})]}),e.heartbeat&&g("div",{children:[a("div",{className:"text-muted-foreground",children:kI()}),a("div",{className:"font-medium text-foreground mt-0.5",children:sn(e.heartbeat)})]}),e.model&&g("div",{children:[a("div",{className:"text-muted-foreground",children:Vh()}),a("div",{className:"font-mono truncate font-medium text-foreground mt-0.5",children:e.model})]}),(e.inputTokens>0||e.outputTokens>0)&&g("div",{children:[g("div",{className:"text-muted-foreground flex items-center gap-1",children:[a(no,{className:"h-3 w-3"})," ",NP()]}),g("div",{className:"font-medium text-foreground mt-0.5 font-mono",children:[e.inputTokens.toLocaleString()," in / ",e.outputTokens.toLocaleString()," out"]})]}),e.sessionId&&g("div",{className:"col-span-2",children:[a("div",{className:"text-muted-foreground",children:YM()}),a("div",{className:"font-mono truncate font-medium text-foreground mt-0.5",children:e.sessionId})]})]}),a("div",{className:"flex-1 min-h-0 pt-3",children:g(ho,{defaultValue:"payload",className:"w-full h-full flex flex-col",children:[g(go,{className:"grid w-full grid-cols-2",children:[a(Xr,{value:"payload",children:Ok()}),a(Xr,{value:"output",children:bk()})]}),a(_n,{value:"payload",className:"flex-1 mt-2 min-h-0",children:a(Ie,{className:"h-64 w-full rounded-md border border-border/50 bg-muted/30 p-3 font-mono text-xs",children:a("pre",{className:"whitespace-pre-wrap break-all text-foreground/90",children:e.payload?JSON.stringify(e.payload,null,2):"null"})})}),a(_n,{value:"output",className:"flex-1 mt-2 min-h-0",children:a(Ie,{className:"h-64 w-full rounded-md border border-border/50 bg-muted/30 p-3 font-mono text-xs",children:a("pre",{className:"whitespace-pre-wrap break-all text-foreground/90",children:e.output?JSON.stringify(e.output,null,2):"null"})})})]})})]})})}var qt=Object.values(ic),It=Object.values(ac);function Pe({teamId:e}){let t=ae(),[s,i]=w([]),[n,o]=w([]),[c,u]=w(null),[f,v]=w(null),{ref:p,inView:b}=Vt(),h=Q(()=>["teams",e,"workflow-tasks",s,n],[e,s,n]),{data:l,isLoading:T,isError:m,fetchNextPage:x,hasNextPage:_,isFetchingNextPage:A,refetch:k,isRefetching:I}=Rt({queryKey:h,queryFn:async({pageParam:r})=>{let C=await R.api.teams[":teamId"]["workflow-tasks"].$get({param:{teamId:e},query:{first:"20",after:r?String(r):void 0,status:s.length>0?s:void 0,types:n.length>0?n:void 0}});if(!C.ok)throw Error("Failed to fetch workflow tasks");return await C.json()},initialPageParam:"",getNextPageParam:(r)=>r.pageInfo.endCursor||void 0,enabled:!!e});S(()=>{if(b&&_&&!A)x()},[b,_,A,x]);let P=Q(()=>l?.pages.flatMap((r)=>r.nodes)||[],[l]),J=l?.pages[0]?.total??0,d=Q(()=>P.filter((r)=>r.status==="pending"||r.status==="processing").map((r)=>r.id),[P]);ee({queryKey:["teams",e,"workflow-tasks","batch-status",d],queryFn:async()=>{if(d.length===0)return null;let r=await R.api.teams[":teamId"]["workflow-tasks"]["batch-status"].$post({param:{teamId:e},json:{taskIds:d}});if(!r.ok)return null;let C=await r.json();if(C.tasks&&C.tasks.length>0)t.setQueryData(h,(D)=>{if(!D)return D;let Z=new Map(C.tasks.map((F)=>[F.id,F]));return{...D,pages:D.pages.map((F)=>({...F,nodes:F.nodes.map((le)=>Z.get(le.id)||le)}))}});return C},enabled:d.length>0,refetchInterval:6000});let y=X({mutationFn:async(r)=>{let C=await R.api.teams[":teamId"]["workflow-tasks"][":taskId"].stop.$post({param:{teamId:e,taskId:r}});if(!C.ok){let D=await C.json().catch(()=>({message:"Failed to stop task"}));throw Error(D.message||"Failed to stop task")}return await C.json()},onSuccess:(r)=>{B.success(aP()),t.setQueryData(h,(C)=>{if(!C)return C;return{...C,pages:C.pages.map((D)=>({...D,nodes:D.nodes.map((Z)=>Z.id===r.task.id?r.task:Z)}))}}),u(null)},onError:(r)=>{B.error(r.message||"Failed to stop task")}}),q=(r)=>{i((C)=>C.includes(r)?C.filter((D)=>D!==r):[...C,r])},O=(r)=>{o((C)=>C.includes(r)?C.filter((D)=>D!==r):[...C,r])},Ee=(r)=>{switch(r){case"completed":return a(ge,{variant:"outline",className:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20 font-mono text-xs",children:"completed"});case"processing":return g(ge,{variant:"outline",className:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20 font-mono text-xs gap-1.5",children:[a(V,{className:"h-3 w-3 animate-spin"}),"processing"]});case"pending":return a(ge,{variant:"outline",className:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 border-yellow-500/20 font-mono text-xs",children:"pending"});case"failed":return a(ge,{variant:"outline",className:"bg-destructive/10 text-destructive border-destructive/20 font-mono text-xs",children:"failed"});default:return a(ge,{variant:"outline",className:"font-mono text-xs",children:r||"-"})}},Oe=(r)=>{if(!r)return a(ge,{variant:"outline",children:"-"});if(r.startsWith("transcode"))return a(ge,{variant:"outline",className:"bg-purple-500/10 text-purple-600 dark:text-purple-400 border-purple-500/20 font-mono text-xs",children:r});if(r.startsWith("ai_")||r==="chat")return a(ge,{variant:"outline",className:"bg-indigo-500/10 text-indigo-600 dark:text-indigo-400 border-indigo-500/20 font-mono text-xs",children:r});if(r==="archive_asset"||r==="restore_asset")return a(ge,{variant:"outline",className:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20 font-mono text-xs",children:r});return a(ge,{variant:"secondary",className:"font-mono text-xs",children:r})};return g("div",{className:"space-y-6",children:[g(st,{className:"border border-border/50 shadow-xs",children:[g(Ct,{className:"pb-4",children:[g("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[g("div",{children:[g(St,{className:"text-xl font-bold flex items-center gap-2",children:[a(se,{className:"h-5 w-5 text-primary"}),jg()]}),a(Zt,{className:"mt-1",children:OD()})]}),g("div",{className:"flex items-center gap-3",children:[J>0&&g(ge,{variant:"secondary",className:"w-fit text-xs font-normal",children:[J," ",jg()]}),g(N,{variant:"outline",size:"sm",className:"h-9 gap-1.5 text-xs",onClick:()=>k(),disabled:I,children:[a(he,{className:`h-3.5 w-3.5 ${I?"animate-spin":""}`}),GR()]})]})]}),g("div",{className:"mt-4 flex flex-wrap items-center gap-3 pt-4 border-t border-border/40",children:[g(wt,{children:[a(Et,{asChild:!0,children:g(N,{variant:"outline",size:"sm",className:"h-9 gap-2 text-xs border-dashed",children:[a(H,{className:"h-3.5 w-3.5"}),zS(),s.length>0&&a(ge,{variant:"secondary",className:"ml-1 px-1.5 py-0 text-[10px]",children:s.length})]})}),g(xt,{className:"w-56 p-2",align:"start",children:[a("div",{className:"text-xs font-semibold text-muted-foreground px-2 py-1 mb-1",children:BM()}),a("div",{className:"space-y-1",children:It.map((r)=>g("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-accent rounded-md cursor-pointer text-xs",children:[a(Ir,{checked:s.includes(r),onCheckedChange:()=>q(r)}),a("span",{className:"font-mono",children:r})]},r))}),s.length>0&&a(N,{variant:"ghost",size:"sm",className:"w-full mt-2 h-7 text-xs text-muted-foreground hover:text-foreground",onClick:()=>i([]),children:kE()})]})]}),g(wt,{children:[a(Et,{asChild:!0,children:g(N,{variant:"outline",size:"sm",className:"h-9 gap-2 text-xs border-dashed",children:[a(H,{className:"h-3.5 w-3.5"}),jS(),n.length>0&&a(ge,{variant:"secondary",className:"ml-1 px-1.5 py-0 text-[10px]",children:n.length})]})}),g(xt,{className:"w-64 p-2",align:"start",children:[a("div",{className:"text-xs font-semibold text-muted-foreground px-2 py-1 mb-1",children:Cg()}),a("div",{className:"max-h-60 overflow-y-auto space-y-1 pr-1",children:qt.map((r)=>g("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-accent rounded-md cursor-pointer text-xs",children:[a(Ir,{checked:n.includes(r),onCheckedChange:()=>O(r)}),a("span",{className:"font-mono truncate",children:r})]},r))}),n.length>0&&a(N,{variant:"ghost",size:"sm",className:"w-full mt-2 h-7 text-xs text-muted-foreground hover:text-foreground",onClick:()=>o([]),children:RE()})]})]}),(s.length>0||n.length>0)&&a(N,{variant:"ghost",size:"sm",className:"h-9 px-2 text-xs text-muted-foreground hover:text-foreground",onClick:()=>{i([]),o([])},children:CE()})]})]}),g(_t,{className:"p-0",children:[T?a("div",{className:"flex h-64 items-center justify-center",children:a(V,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):m?a("div",{className:"p-8 text-center text-sm text-destructive",children:fS()}):P.length===0?a("div",{className:"p-12 text-center text-sm text-muted-foreground",children:K1()}):g(zn,{children:[a(jn,{children:g(Rr,{className:"hover:bg-transparent border-b border-border/50",children:[a(bt,{className:"w-[170px] pl-6 text-xs font-semibold",children:J0()}),a(bt,{className:"w-[130px] px-4 text-xs font-semibold",children:V0()}),a(bt,{className:"min-w-[180px] px-4 text-xs font-semibold",children:Fh()}),a(bt,{className:"w-[110px] px-4 text-xs font-semibold",children:L0()}),a(bt,{className:"w-[160px] px-4 text-xs font-semibold",children:Jp()}),a(bt,{className:"w-[130px] px-4 text-right text-xs font-semibold",children:Rp()}),a(bt,{className:"w-[120px] pr-6 text-right text-xs font-semibold",children:dh()})]})}),a(qn,{children:P.map((r)=>{let C=r.status==="pending"||r.status==="processing";return g(Rr,{className:"hover:bg-muted/40 transition-colors",children:[a(yt,{className:"py-3 pl-6 font-medium",children:Oe(r.type)}),a(yt,{className:"py-3 px-4 font-medium",children:Ee(r.status)}),a(yt,{className:"py-3 px-4 text-xs font-medium",children:a("span",{className:"truncate block max-w-[220px]",title:r.fileName||r.assetId||"-",children:r.fileName||r.assetId||"-"})}),a(yt,{className:"py-3 px-4 text-xs font-mono text-muted-foreground",children:r.fileSize!==null&&r.fileSize!==void 0?Tr(r.fileSize):"-"}),a(yt,{className:"py-3 px-4 text-xs text-muted-foreground",children:a("span",{className:"truncate block max-w-[160px]",title:r.projectName||r.projectId||"-",children:r.projectName||r.projectId||"-"})}),a(yt,{className:"py-3 px-4 text-right text-xs text-muted-foreground whitespace-nowrap",children:sn(r.createdAt)}),a(yt,{className:"py-3 pr-6 text-right",children:g("div",{className:"flex items-center justify-end gap-1",children:[a(N,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-muted-foreground hover:text-foreground",onClick:()=>v(r),title:AD(),children:a(be,{className:"h-4 w-4"})}),C&&g(N,{variant:"outline",size:"sm",className:"h-8 px-2 text-xs border-destructive/30 text-destructive hover:bg-destructive/10",onClick:()=>u(r),disabled:y.isPending,children:[a(Nu,{className:"h-3 w-3 mr-1 fill-current"}),q0()]})]})})]},r.id)})})]}),a("div",{ref:p,className:"py-4 flex justify-center",children:A&&a(V,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]})]}),a(ct,{open:!!c,onOpenChange:(r)=>{if(!r)u(null)},children:g(ut,{children:[g(dt,{children:[g("div",{className:"flex items-center gap-2",children:[a(Dr,{className:"h-5 w-5 text-destructive"}),a(pt,{children:DO()})]}),a(mt,{className:"pt-2 text-sm text-muted-foreground",children:PO()}),c&&g("div",{className:"mt-3 p-2.5 rounded-md bg-muted/50 border border-border/40 font-mono text-xs space-y-1",children:[g("div",{children:[Q0(),": ",c.id]}),c.fileName&&g("div",{className:"font-sans",children:[Fh(),":"," ",a("span",{className:"font-medium text-foreground",children:c.fileName})]}),g("div",{children:[J0(),": ",c.type||"unknown"]}),g("div",{children:[V0(),": ",c.status]})]})]}),g(ft,{children:[a(gt,{disabled:y.isPending,children:Ge()}),a(ht,{className:"bg-destructive hover:bg-destructive/90 text-destructive-foreground",disabled:y.isPending,onClick:()=>{if(c)y.mutate(c.id)},children:y.isPending?g(W,{children:[a(V,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),NO()]}):q0()})]})]})}),a(De,{task:f,open:!!f,onOpenChange:(r)=>{if(!r)v(null)}})]})}function Pt(){let{teamId:e}=Bt.useParams(),[t,s]=w("audit-logs"),{data:i,isLoading:n}=ee({queryKey:["teams",e,"me"],queryFn:async()=>{let o=await R.api.teams[":teamId"].me.$get({param:{teamId:e}});if(!o.ok)throw Error("Failed to fetch me");return await o.json()},enabled:!!e});if(n)return a("div",{className:"flex h-screen items-center justify-center",children:a(V,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(i?.role?.toLowerCase()!=="owner")return g("div",{className:"flex h-full flex-col items-center justify-center p-8 text-center",children:[a(Eu,{className:"h-12 w-12 text-destructive mb-4"}),a("h2",{className:"text-xl font-bold tracking-tight mb-2",children:wv()}),a("p",{className:"text-sm text-muted-foreground max-w-md",children:ek()})]});return a("div",{className:"h-full bg-background font-sans selection:bg-primary/20 transition-colors duration-300",children:g("div",{className:"flex flex-col md:flex-row h-full",children:[a("div",{className:"w-full h-full md:w-72 bg-sidebar border-b md:border-b-0 md:border-r border-sidebar-border z-10 md:left-16 overflow-y-auto transition-colors duration-300",children:g("nav",{className:"p-4 space-y-1 mt-4",children:[a("div",{className:"mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider",children:L_()}),a("div",{className:"mt-4 mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider pt-4 border-t border-sidebar-border",children:uP()}),g("button",{onClick:()=>s("audit-logs"),className:U("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",t==="audit-logs"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[a($i,{className:"w-5 h-5"}),_h(),t==="audit-logs"&&a("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),g("button",{onClick:()=>s("workflow-tasks"),className:U("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",t==="workflow-tasks"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[a(se,{className:"w-5 h-5"}),jg(),t==="workflow-tasks"&&a("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),g("button",{onClick:()=>s("quotas"),className:U("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",t==="quotas"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[a(xs,{className:"w-5 h-5"}),im(),t==="quotas"&&a("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),a("div",{className:"mt-4 mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider pt-4 border-t border-sidebar-border",children:Kb()}),g("button",{onClick:()=>s("ai-usage"),className:U("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",t==="ai-usage"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[a(fe,{className:"w-5 h-5"}),uD(),t==="ai-usage"&&a("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),g("button",{onClick:()=>s("ai-sessions"),className:U("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",t==="ai-sessions"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[a(K,{className:"w-5 h-5"}),F0(),t==="ai-sessions"&&a("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]})]})}),a("div",{className:"flex-1 overflow-y-auto p-4 md:p-8",children:g("div",{className:"max-w-6xl mx-auto space-y-8",children:[t==="audit-logs"&&a(Re,{teamId:e}),t==="workflow-tasks"&&a(Pe,{teamId:e}),t==="ai-usage"&&a(ve,{teamId:e}),t==="ai-sessions"&&a(Ne,{teamId:e}),t==="quotas"&&a(Ae,{teamId:e})]})})]})})}var Bt=Je("/teams/$teamId/dashboard")({component:Pt});export{Bt as Route};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{w,L,ae,X,R,pl,pm,B,kr}from"./chunk-akafypge.js";var U={x:0.5,y:0.5};class yl extends pm{apply({activatorEvent:y,shape:m,transform:g}){if(!m||!(y instanceof PointerEvent))return g;let I=this.options?.anchor??U,{boundingRectangle:p}=m.initial,h=p.left+p.width*I.x,u=p.top+p.height*I.y;return{x:g.x+y.clientX-h,y:g.y+y.clientY-u}}static configure=pl(yl)}L();function Cu({teamId:y,projectId:m,assetId:g,folders:I,files:p,selectedIds:h,onClearSelection:u}){let F=ae(),[d,A]=w(void 0),k=(n,r)=>{let s=["search",y,g,n?"folder":"file"],i=F.getQueriesData({queryKey:s}),o=(t)=>{if(typeof t!=="object"||t===null)return!1;let e=t;return"field"in e&&"order"in e&&typeof e.field==="string"&&(e.order==="asc"||e.order==="desc")};for(let[t,e]of i){if(!e||!Array.isArray(e.pages))continue;let f=t.find(o),a=e.pages.flatMap((c)=>c.data??[]),S=a.findIndex((c)=>c.id===r.id);if(S===-1)continue;if(a[S]={...a[S],...r},f?.field==="custom"){let c=f.order==="desc";a.sort((D,E)=>{let T=D.sortIndex??"",b=E.sortIndex??"";if(T===b)return 0;if(c)return T<b?1:-1;else return T<b?-1:1})}let x=0,O=e.pages.map((c)=>{let D=c.data?c.data.length:0,E=a.slice(x,x+D);return x+=D,{...c,data:E}});F.setQueryData(t,{...e,pages:O})}},q=R.api.projects[":projectId"].reparent.$post,{mutate:j}=X({mutationFn:async(n)=>{if(!(await q(n)).ok)throw Error("Failed to move assets");return null}}),v=R.api.folders[":folderId"].order.$patch,{mutate:P}=X({mutationFn:async(n)=>{let r=await v(n);if(!r.ok)throw Error("Failed to reorder folder");return await r.json()}}),C=R.api.files[":fileId"].order.$patch,{mutate:K}=X({mutationFn:async(n)=>{let r=await C(n);if(!r.ok)throw Error("Failed to reorder file");return await r.json()}}),Q=R.api.shares[":shareId"].assets.$post,{mutate:M}=X({mutationFn:async(n)=>{let r=await Q(n);if(!r.ok)throw Error("Failed to add asset to share");return await r.json()}});return{dragState:d,handleDragStart:(n)=>{let r=n.operation.source;if(!r)return;let l=r.id.split(":").pop(),s=r.data;if(!s)return;let i,o;if(h.has(l))i=new Set(h),o=[...I,...p].filter((f)=>h.has(f.id));else i=new Set([l]),o=[s.item];let t=o.some((f)=>f.type==="folder"),e=i.size===1&&o.length===1&&o[0].type==="file";A({isActive:!0,draggedIds:i,hasFolders:t,isSingleFile:e,itemCount:i.size})},handleDragEnd:(n)=>{let{target:r}=n.operation;if(r&&d){let l=r.id.split(":").pop(),s=r.data;if(s?.type==="chatbot-sidebar"){let t=[...I,...p].filter((e)=>d.draggedIds.has(e.id)).map((e)=>({id:e.id,name:e.name||"Unnamed",type:e.type}));kr.getState().addAssets(t),u(),A(void 0);return}if(s?.type==="share-link"){let o=l,t=Array.from(d.draggedIds);M({param:{shareId:o},json:{assetIds:t}},{onSuccess:(e)=>{if(e.addedCount===0)B.info("Assets already exists in share");else B.success(`Added ${e.addedCount} item(s) to share link`);F.invalidateQueries({queryKey:["shares",m]}),u()},onError:(e)=>{B.error(`Failed to add to share: ${e.message}`)}}),A(void 0);return}let i=!1;if(s&&!d.draggedIds.has(l)){if(s.type==="folder"||s.type==="reorder")i=!0;else if(s.type==="file"||s.type==="version_stack"){if(d.isSingleFile)i=!0}}if(s?.type==="reorder"){let{position:o,item:t}=s,e=d.hasFolders,f=Array.from(d.draggedIds)[0];if(e)P({param:{folderId:f},json:o==="before"?{beforeIndex:t.sortIndex??void 0}:{afterIndex:t.sortIndex??void 0}},{onSuccess:(a)=>{B.success("Folder reordered"),k(!0,a),u()},onError:(a)=>{B.error(`Failed to reorder: ${a.message}`)}});else K({param:{fileId:f},json:o==="before"?{beforeIndex:t.sortIndex??void 0}:{afterIndex:t.sortIndex??void 0}},{onSuccess:(a)=>{B.success("File reordered"),k(!1,a),u()},onError:(a)=>{B.error(`Failed to reorder: ${a.message}`)}})}else if(i)j({param:{projectId:m},json:{assetIds:Array.from(d.draggedIds),newParentId:l}},{onSuccess:()=>{B.success("Assets moved successfully"),F.invalidateQueries({queryKey:["search",y,g]}),F.invalidateQueries({queryKey:["folders"]}),u()},onError:()=>{B.error("Failed to move assets")}})}A(void 0)}}}
|
|
2
|
+
export{yl,Cu};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S,L,a,ee,Je,R,Ft,$t,Yg}from"./chunk-akafypge.js";import"./chunk-d3brvxh7.js";import"./chunk-3mx4trvh.js";import"./chunk-wmrrapwv.js";import"./chunk-s4hkcw24.js";import{dc}from"./chunk-ff0mh9p3.js";import"./chunk-45pb3kzz.js";import"./chunk-6rqakmg0.js";import"./chunk-vf9s8b5t.js";import{yr}from"./chunk-e8zzg57c.js";import"./chunk-k9vjs21p.js";import"./chunk-n54ftsdx.js";import"./chunk-na5fh7er.js";L();function m(){let{projectId:e}=c.useParams(),{teamId:r,ensureTeamIdForProject:t}=Ft();S(()=>{t(e)},[e,t]);let{data:n}=yr(Yg(e)),o=n?.rootFolder,{data:s}=ee({queryKey:["folders",o],queryFn:async()=>{let d=await R.api.folders[":folderId"].$get({param:{folderId:o}});if(!d.ok)throw Error("failed to fetch folder");return await d.json()},enabled:!!o});if(!r||!o||!s)return a($t,{});return a(dc,{teamId:r,projectId:e,projectName:n.name??"",assetId:o,rootFolderId:o,isRoot:!0})}var c=Je("/projects/$projectId/agentsmd")({component:m});export{c as Route};
|