@shumai-one/shumai 0.5.3 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/bin/{chunk-hsx4pns6.js → chunk-0502p2k7.js} +1 -1
  2. package/bin/chunk-0b0t6y8h.js +11 -0
  3. package/bin/{chunk-rh8dy99a.js → chunk-0tvnfy4k.js} +2 -2
  4. package/bin/{chunk-fpjvr3qw.js → chunk-16n160h1.js} +1 -1
  5. package/bin/{chunk-wbmqbpgm.js → chunk-1eqw2dpx.js} +2 -2
  6. package/bin/chunk-1vt9ss7d.js +2 -0
  7. package/bin/chunk-2cpsfc87.js +1 -0
  8. package/bin/{chunk-nmd1901j.js → chunk-2w0d9veg.js} +1 -1
  9. package/bin/{chunk-zzbn0b6c.js → chunk-2xp9prpq.js} +1 -1
  10. package/bin/chunk-3gqs15zq.js +2 -0
  11. package/bin/{chunk-929abwgr.js → chunk-3j82q2gj.js} +1 -1
  12. package/bin/{chunk-5bpvwv66.js → chunk-3me1v3z5.js} +2 -2
  13. package/bin/chunk-3pw7z25v.js +3 -0
  14. package/bin/{chunk-vsnq4381.js → chunk-3tx9v8kj.js} +1 -1
  15. package/bin/chunk-3wdtp4ht.js +1 -0
  16. package/bin/chunk-57axjy7y.js +1 -0
  17. package/bin/{chunk-6pwf7qa6.js → chunk-5aqthcm6.js} +2 -2
  18. package/bin/{chunk-scvepfv8.js → chunk-5gq4q1bb.js} +1 -1
  19. package/bin/{chunk-zq5j9wsc.js → chunk-5r1br11d.js} +1 -1
  20. package/bin/chunk-61hrdg0g.js +1 -0
  21. package/bin/chunk-6aa4xmnw.js +2 -0
  22. package/bin/{chunk-y5h5d5gx.js → chunk-6mrgtn78.js} +7 -7
  23. package/bin/chunk-6s55r0z9.js +1 -0
  24. package/bin/chunk-6vkfzzvt.js +5 -0
  25. package/bin/chunk-7dprpnm6.js +2 -0
  26. package/bin/chunk-7rycq6wb.js +129 -0
  27. package/bin/{chunk-26am2rzm.js → chunk-895gzdtp.js} +2 -2
  28. package/bin/chunk-8d1p8qpv.js +1 -0
  29. package/bin/chunk-8qdtvfx3.css +1 -0
  30. package/bin/chunk-8r3k84dh.js +2 -0
  31. package/bin/{chunk-24da4wg9.js → chunk-99sarrvt.js} +1 -1
  32. package/bin/{chunk-5y3kx4kk.js → chunk-9s0k533c.js} +1 -1
  33. package/bin/{chunk-b6dbqs39.js → chunk-acmr8v0d.js} +1 -1
  34. package/bin/{chunk-tqdde9bj.js → chunk-agcnbjxk.js} +1 -1
  35. package/bin/{chunk-y6xyc4wp.js → chunk-ahgq10a7.js} +2 -2
  36. package/bin/{chunk-b3tkvdfk.js → chunk-am6dg0a5.js} +2 -2
  37. package/bin/chunk-b21z62fj.js +1 -0
  38. package/bin/{chunk-zsg61vr0.js → chunk-b7qs7hxg.js} +2 -2
  39. package/bin/{chunk-8ts3xkme.js → chunk-b9d8xdhb.js} +1 -1
  40. package/bin/{chunk-rq2h2bwt.js → chunk-bg6waaf9.js} +2 -2
  41. package/bin/{chunk-sbyyn9yw.js → chunk-bs6saf4d.js} +2 -2
  42. package/bin/{chunk-b88tdt79.js → chunk-bv589v2m.js} +2 -2
  43. package/bin/{chunk-qjdvs1s5.js → chunk-c60j1b4w.js} +1 -1
  44. package/bin/{chunk-q7t5zs7n.js → chunk-c6f8x05m.js} +2 -2
  45. package/bin/chunk-c8kjpmfe.js +2 -0
  46. package/bin/chunk-c9xyejnk.js +2 -0
  47. package/bin/{chunk-srv5kvm4.js → chunk-cb9peqy5.js} +1 -1
  48. package/bin/chunk-ckczqmrz.js +5 -0
  49. package/bin/chunk-cr33cs6j.js +2 -0
  50. package/bin/chunk-cxet91kt.js +2 -0
  51. package/bin/{chunk-hy5ncvpf.js → chunk-d18v5vmp.js} +2 -2
  52. package/bin/{chunk-xdrpahym.js → chunk-d4hk62q2.js} +4 -4
  53. package/bin/{chunk-j420aqk8.js → chunk-d7e351jd.js} +3 -3
  54. package/bin/{chunk-ppb4aj0y.js → chunk-dfecgpce.js} +12 -12
  55. package/bin/chunk-ebcfbn00.js +2 -0
  56. package/bin/chunk-f0b4a9y3.js +2 -0
  57. package/bin/{chunk-2pt9h882.js → chunk-fkn6f4qt.js} +3 -3
  58. package/bin/chunk-fre31bhw.js +2 -0
  59. package/bin/{chunk-fxg81vtx.js → chunk-fxtzy5f5.js} +2 -2
  60. package/bin/{chunk-k3ds96cb.js → chunk-g78vapcm.js} +2 -2
  61. package/bin/{chunk-q4qqmes7.js → chunk-gdpfwxea.js} +2 -2
  62. package/bin/chunk-gwqqq0b1.js +32 -0
  63. package/bin/chunk-h3cwf9aw.js +2 -0
  64. package/bin/{chunk-cvfznrnt.js → chunk-h4ty530v.js} +5 -5
  65. package/bin/{chunk-p7zw53ep.js → chunk-h58yfx7w.js} +1 -1
  66. package/bin/chunk-h6f2gyt5.js +3 -0
  67. package/bin/chunk-h9ngpxyd.js +1 -0
  68. package/bin/chunk-hbr17jvr.js +13 -0
  69. package/bin/{chunk-4bc3gqmn.js → chunk-hc0xbmtt.js} +2 -2
  70. package/bin/{chunk-68xsb3t8.js → chunk-ht5rht98.js} +2 -2
  71. package/bin/{chunk-hn2g40r6.js → chunk-hzv1mhr5.js} +1 -1
  72. package/bin/{chunk-909h3qzp.js → chunk-j9t7tvt5.js} +2 -2
  73. package/bin/{chunk-m41tbrvt.js → chunk-jb8vbeb0.js} +2 -2
  74. package/bin/{chunk-wperd2h9.js → chunk-jq3pq545.js} +2 -2
  75. package/bin/{chunk-9ca8a5f2.js → chunk-jvt8q0eg.js} +1 -1
  76. package/bin/chunk-jzgtthsj.js +3 -0
  77. package/bin/chunk-jzjhg7ng.js +1 -0
  78. package/bin/{chunk-gvcjqcjf.js → chunk-k547syp2.js} +1 -1
  79. package/bin/chunk-k7sjpke6.js +2 -0
  80. package/bin/chunk-k8ct1qgv.js +3 -0
  81. package/bin/chunk-k9q4nn8b.js +11 -0
  82. package/bin/{chunk-s9sf37dv.js → chunk-keetdtxb.js} +2 -2
  83. package/bin/chunk-kjjw8mbg.js +1 -0
  84. package/bin/{chunk-pwq6dbb5.js → chunk-kywdke0y.js} +5 -5
  85. package/bin/chunk-mey80kv9.js +54 -0
  86. package/bin/chunk-n412a1hp.js +20 -0
  87. package/bin/chunk-nfncawpm.js +12 -0
  88. package/bin/chunk-nvwt8atc.js +1 -0
  89. package/bin/chunk-p1d500sf.js +211 -0
  90. package/bin/{chunk-9fyb95r5.js → chunk-p1ed0pa6.js} +1 -1
  91. package/bin/chunk-q0vs124k.js +2 -0
  92. package/bin/{chunk-fsr83nb1.js → chunk-q5795f3s.js} +1 -1
  93. package/bin/{chunk-b5r0be06.js → chunk-q5j3b0h5.js} +2 -2
  94. package/bin/chunk-qd7pvaxb.js +2 -0
  95. package/bin/{chunk-s0vfj06y.js → chunk-qhpt7170.js} +1 -1
  96. package/bin/{chunk-40tmh04g.js → chunk-qqj2m1b1.js} +2 -2
  97. package/bin/chunk-qt78vs3g.js +2 -0
  98. package/bin/{chunk-fnkkwna8.js → chunk-r5g84kj4.js} +3 -3
  99. package/bin/{chunk-59ayg5am.js → chunk-r9gp9yqw.js} +1 -1
  100. package/bin/chunk-ra6mdjr0.js +1 -0
  101. package/bin/{chunk-jt6v15wx.js → chunk-ryfvaz6v.js} +2 -2
  102. package/bin/{chunk-xbw7ffrz.js → chunk-s01p4w8d.js} +2 -2
  103. package/bin/{chunk-qcpeefhr.js → chunk-s22eapcc.js} +1 -1
  104. package/bin/chunk-sbg86tch.js +2 -0
  105. package/bin/chunk-sbqy6m8t.js +1 -0
  106. package/bin/{chunk-ncv8v6mj.js → chunk-sd6w0z6a.js} +2 -2
  107. package/bin/chunk-sdp9w627.js +14 -0
  108. package/bin/chunk-sn0nypvd.js +42 -0
  109. package/bin/chunk-sv92vkyh.js +2 -0
  110. package/bin/{chunk-mzme3m82.js → chunk-swz6v48q.js} +1 -1
  111. package/bin/{chunk-a8bymrv1.js → chunk-t6cn018t.js} +2 -2
  112. package/bin/{chunk-4nkwe7dz.js → chunk-ts4d1mxf.js} +2 -2
  113. package/bin/{chunk-cdk8vqeg.js → chunk-w4ydfy9d.js} +2 -2
  114. package/bin/chunk-wkdkc12e.js +4 -0
  115. package/bin/chunk-wsprap60.js +3 -0
  116. package/bin/chunk-xgnvktq6.js +10 -0
  117. package/bin/{chunk-2rrcdhkj.js → chunk-xjw3mpvx.js} +1 -1
  118. package/bin/{chunk-qqapw198.js → chunk-xsfy8hz3.js} +1 -1
  119. package/bin/chunk-xznq2axj.js +1 -0
  120. package/bin/chunk-y4v08wq7.js +1 -0
  121. package/bin/chunk-yncvy335.js +3 -0
  122. package/bin/chunk-ytzddcj2.js +1 -0
  123. package/bin/{chunk-03zkxckm.js → chunk-zxqasmvz.js} +1 -1
  124. package/bin/shumai-app.html +1 -1
  125. package/bin/shumai-app.js +466 -458
  126. package/package.json +8 -11
  127. package/bin/chunk-04nqnkzs.js +0 -4
  128. package/bin/chunk-157axqz1.js +0 -1
  129. package/bin/chunk-1tesbv8w.js +0 -2
  130. package/bin/chunk-24nx3krz.js +0 -2
  131. package/bin/chunk-2w2bknn2.js +0 -10
  132. package/bin/chunk-3ahax79y.js +0 -11
  133. package/bin/chunk-3fjgf7eb.js +0 -3
  134. package/bin/chunk-3wcvema0.js +0 -32
  135. package/bin/chunk-45p7d22e.js +0 -2
  136. package/bin/chunk-461gcgrs.js +0 -2
  137. package/bin/chunk-5ebb2pdf.js +0 -5
  138. package/bin/chunk-6hs63sva.js +0 -42
  139. package/bin/chunk-6sq6dfa1.js +0 -3
  140. package/bin/chunk-87secbzy.js +0 -1
  141. package/bin/chunk-8pykp70z.js +0 -1
  142. package/bin/chunk-axeq2pq5.js +0 -2
  143. package/bin/chunk-bcyvxp1c.js +0 -12
  144. package/bin/chunk-bn0taqr3.js +0 -3
  145. package/bin/chunk-cb37q6t0.js +0 -1
  146. package/bin/chunk-cfqny70c.js +0 -3
  147. package/bin/chunk-cqnected.js +0 -2
  148. package/bin/chunk-d1q1tn36.js +0 -1
  149. package/bin/chunk-d1rjpbgv.js +0 -2
  150. package/bin/chunk-eshwjf91.js +0 -2
  151. package/bin/chunk-fa9yq17g.js +0 -129
  152. package/bin/chunk-fznchvm7.js +0 -1
  153. package/bin/chunk-g2z0c39g.js +0 -1
  154. package/bin/chunk-gnt9gewm.js +0 -2
  155. package/bin/chunk-hbnpx0a5.js +0 -1
  156. package/bin/chunk-hgy9rqt1.js +0 -1
  157. package/bin/chunk-hk659cg2.css +0 -1
  158. package/bin/chunk-k97axrc4.js +0 -13
  159. package/bin/chunk-m9f21ye9.js +0 -1
  160. package/bin/chunk-md7pgk86.js +0 -2
  161. package/bin/chunk-me3zmpj5.js +0 -14
  162. package/bin/chunk-mg6sybt0.js +0 -1
  163. package/bin/chunk-n08h1jgx.js +0 -2
  164. package/bin/chunk-np39aknv.js +0 -2
  165. package/bin/chunk-q1gfypy3.js +0 -2
  166. package/bin/chunk-qx553512.js +0 -211
  167. package/bin/chunk-r3s1x5wp.js +0 -1
  168. package/bin/chunk-s6g2mzpn.js +0 -2
  169. package/bin/chunk-sjbvt3wa.js +0 -2
  170. package/bin/chunk-srmx5z3v.js +0 -3
  171. package/bin/chunk-t1h12r3q.js +0 -54
  172. package/bin/chunk-t6myw0jf.js +0 -2
  173. package/bin/chunk-t8jfp3vx.js +0 -1
  174. package/bin/chunk-v5hz09a1.js +0 -3
  175. package/bin/chunk-vk9ecq8n.js +0 -2
  176. package/bin/chunk-w4adkd0a.js +0 -20
  177. package/bin/chunk-xfmnfcv2.js +0 -5
  178. package/bin/chunk-xhngtwn9.js +0 -1
  179. package/bin/chunk-xjnehexk.js +0 -2
  180. package/bin/chunk-xzb0t8mx.js +0 -1
  181. package/bin/chunk-zpk87b33.js +0 -11
  182. package/bin/chunk-zts21ft7.js +0 -1
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- var f=-1/0,e=0;function a(n){if(globalThis.crypto?.getRandomValues){globalThis.crypto.getRandomValues(n);return}for(let i=0;i<n.length;i++)n[i]=Math.floor(Math.random()*256)}function il(){let n=new Uint8Array(16);a(n);let i=Date.now();if(i>f)e=n[6]*16777216+n[7]*65536+n[8]*256+n[9],f=i;else if(e=e+1>>>0,e===0)f++;let t=new Uint8Array(16);t[0]=f/1099511627776&255,t[1]=f/4294967296&255,t[2]=f/16777216&255,t[3]=f/65536&255,t[4]=f/256&255,t[5]=f&255,t[6]=112|e>>>28&15,t[7]=e>>>20&255,t[8]=128|e>>>14&63,t[9]=e>>>6&255,t[10]=(e&63)<<2|n[10]&3,t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15];let o=Array.from(t,(x)=>x.toString(16).padStart(2,"0"));return`${o.slice(0,4).join("")}-${o.slice(4,6).join("")}-${o.slice(6,8).join("")}-${o.slice(8,10).join("")}-${o.slice(10,16).join("")}`}
3
- export{il};
2
+ var f=-1/0,e=0;function a(n){if(globalThis.crypto?.getRandomValues){globalThis.crypto.getRandomValues(n);return}for(let i=0;i<n.length;i++)n[i]=Math.floor(Math.random()*256)}function ll(){let n=new Uint8Array(16);a(n);let i=Date.now();if(i>f)e=n[6]*16777216+n[7]*65536+n[8]*256+n[9],f=i;else if(e=e+1>>>0,e===0)f++;let t=new Uint8Array(16);t[0]=f/1099511627776&255,t[1]=f/4294967296&255,t[2]=f/16777216&255,t[3]=f/65536&255,t[4]=f/256&255,t[5]=f&255,t[6]=112|e>>>28&15,t[7]=e>>>20&255,t[8]=128|e>>>14&63,t[9]=e>>>6&255,t[10]=(e&63)<<2|n[10]&3,t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15];let o=Array.from(t,(x)=>x.toString(16).padStart(2,"0"));return`${o.slice(0,4).join("")}-${o.slice(4,6).join("")}-${o.slice(6,8).join("")}-${o.slice(8,10).join("")}-${o.slice(10,16).join("")}`}
3
+ export{ll};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{xu}from"./chunk-cdk8vqeg.js";import{dr}from"./chunk-b5r0be06.js";import"./chunk-5ebb2pdf.js";import{ri,ni,oi}from"./chunk-pwq6dbb5.js";import{as}from"./chunk-23780yj6.js";import{xn,Sn}from"./chunk-sbyyn9yw.js";import{ls}from"./chunk-6hzktewz.js";import{Wn,Tr}from"./chunk-m41tbrvt.js";import{pn}from"./chunk-3fjgf7eb.js";import{Gr}from"./chunk-ncv8v6mj.js";import{Jt}from"./chunk-q7t5zs7n.js";var d="v1",A=new Set(["openai","openai-codex","opencode","azure-openai-responses"]),E=16;function R(r){let a=new Map;if(!r)return a;for(let e of r.split(",")){let n=e.trim();if(!n)continue;let[s,t]=n.split("=",2);if(!s||!t)continue;a.set(s.trim(),t.trim())}return a}function h(r,a){if(a?.azureDeploymentName)return a.azureDeploymentName;return R(dr("AZURE_OPENAI_DEPLOYMENT_NAME_MAP",a?.env)).get(r.id)||r.id}function g(r){return Sn(xn(r),"Azure OpenAI API error")}var y=(r,a,e)=>{let n=new Jt;return(async()=>{let s=h(r,e),t={role:"assistant",content:[],api:"azure-openai-responses",provider:r.provider,model:r.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{let o=e?.apiKey;if(!o)throw Error(`No API key for provider: ${r.provider}`);let i=O(r,o,e),m=Wn(a.tools,r.compat?.supportsOpenAIGrammarTools??!1),p=U(r,a,e,s,m),u=await e?.onPayload?.(p,r);if(u!==void 0)p=u;let f={...e?.signal?{signal:e.signal}:{},...e?.timeoutMs!==void 0?{timeout:e.timeoutMs}:{},maxRetries:0},{data:l,response:c}=await ls(()=>i.responses.create(p,f).withResponse(),{maxRetries:e?.maxRetries,maxRetryDelayMs:e?.maxRetryDelayMs,signal:e?.signal});if(await e?.onResponse?.({status:c.status,headers:pn(c.headers)},r),n.push({type:"start",partial:t}),await oi(l,t,n,r,{grammarToolInputProperties:m}),e?.signal?.aborted)throw Error("Request was aborted");if(t.stopReason==="aborted"||t.stopReason==="error")throw Error("An unknown error occurred");n.push({type:"done",reason:t.stopReason,message:t}),n.end()}catch(o){for(let i of t.content)delete i.index,delete i.partialJson,delete i.customInput;t.stopReason=e?.signal?.aborted?"aborted":"error",t.errorMessage=g(o),n.push({type:"error",reason:t.stopReason,error:t}),n.end()}})(),n},B=(r,a,e)=>{let n=e?.apiKey;if(!n)throw Error(`No API key for provider: ${r.provider}`);let s=Tr(r,a,e,n),t=e?.reasoning?Gr(r,e.reasoning):void 0;return y(r,a,{...s,reasoningEffort:t==="off"?void 0:t})};function _(r){let a=r.trim().replace(/\/+$/,""),e;try{e=new URL(a)}catch{throw Error(`Invalid Azure OpenAI base URL: ${r}`)}let n=e.hostname.endsWith(".openai.azure.com")||e.hostname.endsWith(".cognitiveservices.azure.com")||e.hostname.endsWith(".ai.azure.com"),s=e.pathname.replace(/\/+$/,"");if(n&&(s===""||s==="/"||s==="/openai"||s==="/openai/v1/responses"))e.pathname="/openai/v1",e.search="";return e.toString().replace(/\/+$/,"")}function I(r){return`https://${r}.openai.azure.com/openai/v1`}function v(r,a){let e=a?.azureApiVersion||dr("AZURE_OPENAI_API_VERSION",a?.env)||d,n=a?.azureBaseUrl?.trim()||dr("AZURE_OPENAI_BASE_URL",a?.env)?.trim()||void 0,s=a?.azureResourceName||dr("AZURE_OPENAI_RESOURCE_NAME",a?.env),t=n;if(!t&&s)t=I(s);if(!t&&r.baseUrl)t=r.baseUrl;if(!t)throw Error("Azure OpenAI base URL is required. Set AZURE_OPENAI_BASE_URL or AZURE_OPENAI_RESOURCE_NAME, or pass azureBaseUrl, azureResourceName, or model.baseUrl.");return{baseUrl:_(t),apiVersion:e}}function O(r,a,e){let n={...r.headers};if(e?.headers)Object.assign(n,e.headers);let{baseUrl:s,apiVersion:t}=v(r,e);return new xu({apiKey:a,apiVersion:t,dangerouslyAllowBrowser:!0,defaultHeaders:n,baseURL:s})}function U(r,a,e,n,s=Wn(a.tools,r.compat?.supportsOpenAIGrammarTools??!1)){let t=ri(r,a,A,{grammarToolInputProperties:s}),o={model:n,input:t,stream:!0,prompt_cache_key:as(e?.sessionId),store:!1};if(e?.maxTokens)o.max_output_tokens=Math.max(e.maxTokens,E);if(e?.temperature!==void 0)o.temperature=e?.temperature;if(a.tools&&a.tools.length>0)o.tools=ni(a.tools,{supportsStrictMode:r.compat?.supportsStrictMode??!0,supportsOpenAIGrammarTools:r.compat?.supportsOpenAIGrammarTools??!1});if(r.reasoning){if(e?.reasoningEffort||e?.reasoningSummary){let i=e?.reasoningEffort?r.thinkingLevelMap?.[e.reasoningEffort]??e.reasoningEffort:"medium";o.reasoning={effort:i,summary:e?.reasoningSummary||"auto"},o.include=["reasoning.encrypted_content"]}else if(r.thinkingLevelMap?.off!==null)o.reasoning={effort:r.thinkingLevelMap?.off??"none"}}return o}export{y as stream,B as streamSimple};
2
+ import{Tu}from"./chunk-w4ydfy9d.js";import{pr}from"./chunk-q5j3b0h5.js";import"./chunk-ckczqmrz.js";import{ni,oi,si}from"./chunk-kywdke0y.js";import{as}from"./chunk-23780yj6.js";import{kn,Rn}from"./chunk-bs6saf4d.js";import{ls}from"./chunk-6hzktewz.js";import{Xn,kr}from"./chunk-jb8vbeb0.js";import{bn}from"./chunk-3pw7z25v.js";import{Yr}from"./chunk-sd6w0z6a.js";import{Xt}from"./chunk-c6f8x05m.js";var d="v1",A=new Set(["openai","openai-codex","opencode","azure-openai-responses"]),E=16;function R(r){let a=new Map;if(!r)return a;for(let e of r.split(",")){let n=e.trim();if(!n)continue;let[s,t]=n.split("=",2);if(!s||!t)continue;a.set(s.trim(),t.trim())}return a}function h(r,a){if(a?.azureDeploymentName)return a.azureDeploymentName;return R(pr("AZURE_OPENAI_DEPLOYMENT_NAME_MAP",a?.env)).get(r.id)||r.id}function g(r){return Rn(kn(r),"Azure OpenAI API error")}var y=(r,a,e)=>{let n=new Xt;return(async()=>{let s=h(r,e),t={role:"assistant",content:[],api:"azure-openai-responses",provider:r.provider,model:r.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{let o=e?.apiKey;if(!o)throw Error(`No API key for provider: ${r.provider}`);let i=O(r,o,e),m=Xn(a.tools,r.compat?.supportsOpenAIGrammarTools??!1),p=U(r,a,e,s,m),u=await e?.onPayload?.(p,r);if(u!==void 0)p=u;let f={...e?.signal?{signal:e.signal}:{},...e?.timeoutMs!==void 0?{timeout:e.timeoutMs}:{},maxRetries:0},{data:l,response:c}=await ls(()=>i.responses.create(p,f).withResponse(),{maxRetries:e?.maxRetries,maxRetryDelayMs:e?.maxRetryDelayMs,signal:e?.signal});if(await e?.onResponse?.({status:c.status,headers:bn(c.headers)},r),n.push({type:"start",partial:t}),await si(l,t,n,r,{grammarToolInputProperties:m}),e?.signal?.aborted)throw Error("Request was aborted");if(t.stopReason==="aborted"||t.stopReason==="error")throw Error("An unknown error occurred");n.push({type:"done",reason:t.stopReason,message:t}),n.end()}catch(o){for(let i of t.content)delete i.index,delete i.partialJson,delete i.customInput;t.stopReason=e?.signal?.aborted?"aborted":"error",t.errorMessage=g(o),n.push({type:"error",reason:t.stopReason,error:t}),n.end()}})(),n},B=(r,a,e)=>{let n=e?.apiKey;if(!n)throw Error(`No API key for provider: ${r.provider}`);let s=kr(r,a,e,n),t=e?.reasoning?Yr(r,e.reasoning):void 0;return y(r,a,{...s,reasoningEffort:t==="off"?void 0:t})};function _(r){let a=r.trim().replace(/\/+$/,""),e;try{e=new URL(a)}catch{throw Error(`Invalid Azure OpenAI base URL: ${r}`)}let n=e.hostname.endsWith(".openai.azure.com")||e.hostname.endsWith(".cognitiveservices.azure.com")||e.hostname.endsWith(".ai.azure.com"),s=e.pathname.replace(/\/+$/,"");if(n&&(s===""||s==="/"||s==="/openai"||s==="/openai/v1/responses"))e.pathname="/openai/v1",e.search="";return e.toString().replace(/\/+$/,"")}function I(r){return`https://${r}.openai.azure.com/openai/v1`}function v(r,a){let e=a?.azureApiVersion||pr("AZURE_OPENAI_API_VERSION",a?.env)||d,n=a?.azureBaseUrl?.trim()||pr("AZURE_OPENAI_BASE_URL",a?.env)?.trim()||void 0,s=a?.azureResourceName||pr("AZURE_OPENAI_RESOURCE_NAME",a?.env),t=n;if(!t&&s)t=I(s);if(!t&&r.baseUrl)t=r.baseUrl;if(!t)throw Error("Azure OpenAI base URL is required. Set AZURE_OPENAI_BASE_URL or AZURE_OPENAI_RESOURCE_NAME, or pass azureBaseUrl, azureResourceName, or model.baseUrl.");return{baseUrl:_(t),apiVersion:e}}function O(r,a,e){let n={...r.headers};if(e?.headers)Object.assign(n,e.headers);let{baseUrl:s,apiVersion:t}=v(r,e);return new Tu({apiKey:a,apiVersion:t,dangerouslyAllowBrowser:!0,defaultHeaders:n,baseURL:s})}function U(r,a,e,n,s=Xn(a.tools,r.compat?.supportsOpenAIGrammarTools??!1)){let t=ni(r,a,A,{grammarToolInputProperties:s}),o={model:n,input:t,stream:!0,prompt_cache_key:as(e?.sessionId),store:!1};if(e?.maxTokens)o.max_output_tokens=Math.max(e.maxTokens,E);if(e?.temperature!==void 0)o.temperature=e?.temperature;if(a.tools&&a.tools.length>0)o.tools=oi(a.tools,{supportsStrictMode:r.compat?.supportsStrictMode??!0,supportsOpenAIGrammarTools:r.compat?.supportsOpenAIGrammarTools??!1});if(r.reasoning){if(e?.reasoningEffort||e?.reasoningSummary){let i=e?.reasoningEffort?r.thinkingLevelMap?.[e.reasoningEffort]??e.reasoningEffort:"medium";o.reasoning={effort:i,summary:e?.reasoningSummary||"auto"},o.include=["reasoning.encrypted_content"]}else if(r.thinkingLevelMap?.off!==null)o.reasoning={effort:r.thinkingLevelMap?.off??"none"}}return o}export{y as stream,B as streamSimple};
@@ -1,2 +1,2 @@
1
- import{I}from"./chunk-qx553512.js";var a=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],uo=I("upload",a);
2
- export{uo};
1
+ import{I}from"./chunk-p1d500sf.js";var a=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],po=I("upload",a);
2
+ export{po};
@@ -0,0 +1,2 @@
1
+ import{I}from"./chunk-p1d500sf.js";var e=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],ec=I("square",e);
2
+ export{ec};
@@ -0,0 +1 @@
1
+ import{m,E,t,Z,ze,g,gt,Tt,hm}from"./chunk-p1d500sf.js";import"./chunk-7rycq6wb.js";import"./chunk-sdp9w627.js";import"./chunk-c8kjpmfe.js";import"./chunk-qt78vs3g.js";import"./chunk-cxet91kt.js";import"./chunk-xgnvktq6.js";import"./chunk-keetdtxb.js";import"./chunk-j9t7tvt5.js";import"./chunk-sbg86tch.js";import"./chunk-k7sjpke6.js";import"./chunk-fkn6f4qt.js";import"./chunk-6vkfzzvt.js";import"./chunk-5aqthcm6.js";import{Yn}from"./chunk-h3cwf9aw.js";import{tr}from"./chunk-qd7pvaxb.js";import"./chunk-ahgq10a7.js";import"./chunk-1vt9ss7d.js";import"./chunk-agcnbjxk.js";import"./chunk-zxqasmvz.js";import"./chunk-ts4d1mxf.js";import"./chunk-xsfy8hz3.js";import"./chunk-1eqw2dpx.js";import"./chunk-b7qs7hxg.js";import"./chunk-ht5rht98.js";E();function c(){let{projectId:e}=f.useParams(),{teamId:r,ensureTeamIdForProject:n}=gt();m(()=>{n(e)},[e,n]);let{data:a}=tr(hm(e)),o=a?.rootFolder,{data:s}=Z({queryKey:["folders",o],queryFn:async()=>{let d=await g.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 t(Tt,{});return t(Yn,{teamId:r,projectId:e,projectName:a.name??"",assetId:o,rootFolderId:o})}var f=ze("/projects/$projectId/")({component:c});export{f as Route};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Dt}from"./chunk-3ahax79y.js";import{Ge,qt}from"./chunk-y5h5d5gx.js";import{H}from"./chunk-a8bymrv1.js";var A=H(Dt()),f=H(Ge());var g=H(Ge()),P=H(qt());import{createHash as F,createPrivateKey as L,createPublicKey as O,sign as K}from"crypto";import{promises as x}from"fs";import{homedir as _}from"os";import{dirname as v,join as I}from"path";class h{profileData;init;callerClientConfig;static REFRESH_THRESHOLD=300000;constructor(e,t,s){this.profileData=e,this.init=t,this.callerClientConfig=s}async loadCredentials(){let e=await this.loadToken();if(!e)throw new g.CredentialsProviderError(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`,{tryNextLink:!1,logger:this.logger});let t=e.accessToken,s=Date.now();if(new Date(t.expiresAt).getTime()-s<=h.REFRESH_THRESHOLD)return this.refresh(e);return this.toCredentials(e.accessToken)}get logger(){return this.init?.logger}get loginSession(){return this.profileData.login_session}toCredentials(e){return{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,sessionToken:e.sessionToken,accountId:e.accountId,expiration:new Date(e.expiresAt)}}async refresh(e){let t=await this.loadToken().catch(()=>e),s=Date.now(),r=new Date(t.accessToken.expiresAt).getTime(),n=new Date(e.accessToken.expiresAt).getTime(),o=r<=s&&n>s?e:t;if(new Date(o.accessToken.expiresAt).getTime()-Date.now()>h.REFRESH_THRESHOLD)return this.toCredentials(o.accessToken);let{SigninClient:p,CreateOAuth2TokenCommand:w}=await import("./chunk-vsnq4381.js"),{logger:y,userAgentAppId:m}=this.callerClientConfig??{},T=((i)=>i?.metadata?.handlerProtocol==="h2")(this.callerClientConfig?.requestHandler)?void 0:this.callerClientConfig?.requestHandler,d=this.profileData.region??await this.callerClientConfig?.region?.()??process.env.AWS_REGION,u=new p({credentials:{accessKeyId:"",secretAccessKey:""},region:d,requestHandler:T,logger:y,userAgentAppId:m,...this.init?.clientConfig});this.createDPoPInterceptor(u.middlewareStack);let S={tokenInput:{clientId:o.clientId,refreshToken:o.refreshToken,grantType:"refresh_token"}};try{let i=await u.send(new w(S)),{accessKeyId:c,secretAccessKey:k,sessionToken:l}=i.tokenOutput?.accessToken??{},{refreshToken:D,expiresIn:N}=i.tokenOutput??{};if(!c||!k||!l||!D)throw new g.CredentialsProviderError("Token refresh response missing required fields",{logger:this.logger,tryNextLink:!1});let R=(N??900)*1000,b=new Date(Date.now()+R),C={...o,accessToken:{...o.accessToken,accessKeyId:c,secretAccessKey:k,sessionToken:l,expiresAt:b.toISOString()},refreshToken:D};return await this.saveToken(C),this.toCredentials(C.accessToken)}catch(i){if(i.name==="AccessDeniedException"){let k=i.error,l;switch(k){case"TOKEN_EXPIRED":l="Your session has expired. Please reauthenticate.";break;case"USER_CREDENTIALS_CHANGED":l="Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password.";break;case"INSUFFICIENT_PERMISSIONS":l="Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action.";break;default:l=`Failed to refresh token: ${String(i)}. Please re-authenticate using \`aws login\``}throw new g.CredentialsProviderError(l,{logger:this.logger,tryNextLink:!1})}if(new Date(o.accessToken.expiresAt).getTime()>Date.now())return this.logger?.warn?.(`Failed to refresh token: ${String(i)}. Using existing token until expiry.`),this.toCredentials(o.accessToken);throw new g.CredentialsProviderError(`Failed to refresh token: ${String(i)}. Please re-authenticate using aws login`,{logger:this.logger})}}async loadToken(){let e=this.getTokenFilePath();try{let t=await x.readFile(e,"utf8"),s=JSON.parse(t),r=["accessToken","clientId","refreshToken","dpopKey"].filter((n)=>!s[n]);if(!s.accessToken?.accountId)r.push("accountId");if(r.length>0)throw new g.CredentialsProviderError(`Token validation failed, missing fields: ${r.join(", ")}`,{logger:this.logger,tryNextLink:!1});return s}catch(t){throw new g.CredentialsProviderError(`Failed to load token from ${e}: ${String(t)}`,{logger:this.logger,tryNextLink:!1})}}async saveToken(e){let t=this.getTokenFilePath(),s=v(t);try{await x.mkdir(s,{recursive:!0})}catch(r){}await x.writeFile(t,JSON.stringify(e,null,2),"utf8")}getTokenFilePath(){let e=process.env.AWS_LOGIN_CACHE_DIRECTORY??I(_(),".aws","login","cache"),t=Buffer.from(this.loginSession,"utf8"),s=F("sha256").update(t).digest("hex");return I(e,`${s}.json`)}derToRawSignature(e){let t=2;if(e[t]!==2)throw Error("Invalid DER signature");t++;let s=e[t++],r=e.subarray(t,t+s);if(t+=s,e[t]!==2)throw Error("Invalid DER signature");t++;let n=e[t++],o=e.subarray(t,t+n);r=r[0]===0?r.subarray(1):r,o=o[0]===0?o.subarray(1):o;let a=Buffer.concat([Buffer.alloc(32-r.length),r]),p=Buffer.concat([Buffer.alloc(32-o.length),o]);return Buffer.concat([a,p])}createDPoPInterceptor(e){e.add((t)=>async(s)=>{if(P.HttpRequest.isInstance(s.request)){let r=s.request,n=`${r.protocol}//${r.hostname}${r.port?`:${r.port}`:""}${r.path}`,o=await this.generateDpop(r.method,n);r.headers={...r.headers,DPoP:o}}return t(s)},{step:"finalizeRequest",name:"dpopInterceptor",override:!0})}async generateDpop(e="POST",t){let s=await this.loadToken();try{let r=L({key:s.dpopKey,format:"pem",type:"sec1"}),o=O(r).export({format:"der",type:"spki"}),a=-1;for(let c=0;c<o.length;c++)if(o[c]===4){a=c;break}let p=o.slice(a+1,a+33),w=o.slice(a+33,a+65),y={alg:"ES256",typ:"dpop+jwt",jwk:{kty:"EC",crv:"P-256",x:p.toString("base64url"),y:w.toString("base64url")}},m={jti:crypto.randomUUID(),htm:e,htu:t,iat:Math.floor(Date.now()/1000)},E=Buffer.from(JSON.stringify(y)).toString("base64url"),T=Buffer.from(JSON.stringify(m)).toString("base64url"),d=`${E}.${T}`,u=K("sha256",Buffer.from(d),r),i=this.derToRawSignature(u).toString("base64url");return`${d}.${i}`}catch(r){throw new g.CredentialsProviderError(`Failed to generate Dpop proof: ${r instanceof Error?r.message:String(r)}`,{logger:this.logger,tryNextLink:!1})}}}var B=(e)=>async({callerClientConfig:t}={})=>{e?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials");let s=await f.parseKnownFiles(e||{}),r=f.getProfileName({profile:e?.profile??t?.profile}),n=s[r];if(!n?.login_session)throw new f.CredentialsProviderError(`Profile ${r} does not contain login_session.`,{tryNextLink:!0,logger:e?.logger});let a=await new h(n,e,t).loadCredentials();return A.setCredentialFeature(a,"CREDENTIALS_LOGIN","AD")};export{B as fromLoginCredentials};
2
+ import{Ot}from"./chunk-k9q4nn8b.js";import{Ge,Ht}from"./chunk-6mrgtn78.js";import{H}from"./chunk-t6cn018t.js";var A=H(Ot()),f=H(Ge());var g=H(Ge()),P=H(Ht());import{createHash as F,createPrivateKey as L,createPublicKey as O,sign as K}from"crypto";import{promises as x}from"fs";import{homedir as _}from"os";import{dirname as v,join as I}from"path";class h{profileData;init;callerClientConfig;static REFRESH_THRESHOLD=300000;constructor(e,t,s){this.profileData=e,this.init=t,this.callerClientConfig=s}async loadCredentials(){let e=await this.loadToken();if(!e)throw new g.CredentialsProviderError(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`,{tryNextLink:!1,logger:this.logger});let t=e.accessToken,s=Date.now();if(new Date(t.expiresAt).getTime()-s<=h.REFRESH_THRESHOLD)return this.refresh(e);return this.toCredentials(e.accessToken)}get logger(){return this.init?.logger}get loginSession(){return this.profileData.login_session}toCredentials(e){return{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,sessionToken:e.sessionToken,accountId:e.accountId,expiration:new Date(e.expiresAt)}}async refresh(e){let t=await this.loadToken().catch(()=>e),s=Date.now(),r=new Date(t.accessToken.expiresAt).getTime(),n=new Date(e.accessToken.expiresAt).getTime(),o=r<=s&&n>s?e:t;if(new Date(o.accessToken.expiresAt).getTime()-Date.now()>h.REFRESH_THRESHOLD)return this.toCredentials(o.accessToken);let{SigninClient:p,CreateOAuth2TokenCommand:w}=await import("./chunk-3tx9v8kj.js"),{logger:y,userAgentAppId:m}=this.callerClientConfig??{},T=((i)=>i?.metadata?.handlerProtocol==="h2")(this.callerClientConfig?.requestHandler)?void 0:this.callerClientConfig?.requestHandler,d=this.profileData.region??await this.callerClientConfig?.region?.()??process.env.AWS_REGION,u=new p({credentials:{accessKeyId:"",secretAccessKey:""},region:d,requestHandler:T,logger:y,userAgentAppId:m,...this.init?.clientConfig});this.createDPoPInterceptor(u.middlewareStack);let S={tokenInput:{clientId:o.clientId,refreshToken:o.refreshToken,grantType:"refresh_token"}};try{let i=await u.send(new w(S)),{accessKeyId:c,secretAccessKey:k,sessionToken:l}=i.tokenOutput?.accessToken??{},{refreshToken:D,expiresIn:N}=i.tokenOutput??{};if(!c||!k||!l||!D)throw new g.CredentialsProviderError("Token refresh response missing required fields",{logger:this.logger,tryNextLink:!1});let R=(N??900)*1000,b=new Date(Date.now()+R),C={...o,accessToken:{...o.accessToken,accessKeyId:c,secretAccessKey:k,sessionToken:l,expiresAt:b.toISOString()},refreshToken:D};return await this.saveToken(C),this.toCredentials(C.accessToken)}catch(i){if(i.name==="AccessDeniedException"){let k=i.error,l;switch(k){case"TOKEN_EXPIRED":l="Your session has expired. Please reauthenticate.";break;case"USER_CREDENTIALS_CHANGED":l="Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password.";break;case"INSUFFICIENT_PERMISSIONS":l="Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action.";break;default:l=`Failed to refresh token: ${String(i)}. Please re-authenticate using \`aws login\``}throw new g.CredentialsProviderError(l,{logger:this.logger,tryNextLink:!1})}if(new Date(o.accessToken.expiresAt).getTime()>Date.now())return this.logger?.warn?.(`Failed to refresh token: ${String(i)}. Using existing token until expiry.`),this.toCredentials(o.accessToken);throw new g.CredentialsProviderError(`Failed to refresh token: ${String(i)}. Please re-authenticate using aws login`,{logger:this.logger})}}async loadToken(){let e=this.getTokenFilePath();try{let t=await x.readFile(e,"utf8"),s=JSON.parse(t),r=["accessToken","clientId","refreshToken","dpopKey"].filter((n)=>!s[n]);if(!s.accessToken?.accountId)r.push("accountId");if(r.length>0)throw new g.CredentialsProviderError(`Token validation failed, missing fields: ${r.join(", ")}`,{logger:this.logger,tryNextLink:!1});return s}catch(t){throw new g.CredentialsProviderError(`Failed to load token from ${e}: ${String(t)}`,{logger:this.logger,tryNextLink:!1})}}async saveToken(e){let t=this.getTokenFilePath(),s=v(t);try{await x.mkdir(s,{recursive:!0})}catch(r){}await x.writeFile(t,JSON.stringify(e,null,2),"utf8")}getTokenFilePath(){let e=process.env.AWS_LOGIN_CACHE_DIRECTORY??I(_(),".aws","login","cache"),t=Buffer.from(this.loginSession,"utf8"),s=F("sha256").update(t).digest("hex");return I(e,`${s}.json`)}derToRawSignature(e){let t=2;if(e[t]!==2)throw Error("Invalid DER signature");t++;let s=e[t++],r=e.subarray(t,t+s);if(t+=s,e[t]!==2)throw Error("Invalid DER signature");t++;let n=e[t++],o=e.subarray(t,t+n);r=r[0]===0?r.subarray(1):r,o=o[0]===0?o.subarray(1):o;let a=Buffer.concat([Buffer.alloc(32-r.length),r]),p=Buffer.concat([Buffer.alloc(32-o.length),o]);return Buffer.concat([a,p])}createDPoPInterceptor(e){e.add((t)=>async(s)=>{if(P.HttpRequest.isInstance(s.request)){let r=s.request,n=`${r.protocol}//${r.hostname}${r.port?`:${r.port}`:""}${r.path}`,o=await this.generateDpop(r.method,n);r.headers={...r.headers,DPoP:o}}return t(s)},{step:"finalizeRequest",name:"dpopInterceptor",override:!0})}async generateDpop(e="POST",t){let s=await this.loadToken();try{let r=L({key:s.dpopKey,format:"pem",type:"sec1"}),o=O(r).export({format:"der",type:"spki"}),a=-1;for(let c=0;c<o.length;c++)if(o[c]===4){a=c;break}let p=o.slice(a+1,a+33),w=o.slice(a+33,a+65),y={alg:"ES256",typ:"dpop+jwt",jwk:{kty:"EC",crv:"P-256",x:p.toString("base64url"),y:w.toString("base64url")}},m={jti:crypto.randomUUID(),htm:e,htu:t,iat:Math.floor(Date.now()/1000)},E=Buffer.from(JSON.stringify(y)).toString("base64url"),T=Buffer.from(JSON.stringify(m)).toString("base64url"),d=`${E}.${T}`,u=K("sha256",Buffer.from(d),r),i=this.derToRawSignature(u).toString("base64url");return`${d}.${i}`}catch(r){throw new g.CredentialsProviderError(`Failed to generate Dpop proof: ${r instanceof Error?r.message:String(r)}`,{logger:this.logger,tryNextLink:!1})}}}var B=(e)=>async({callerClientConfig:t}={})=>{e?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials");let s=await f.parseKnownFiles(e||{}),r=f.getProfileName({profile:e?.profile??t?.profile}),n=s[r];if(!n?.login_session)throw new f.CredentialsProviderError(`Profile ${r} does not contain login_session.`,{tryNextLink:!0,logger:e?.logger});let a=await new h(n,e,t).loadCredentials();return A.setCredentialFeature(a,"CREDENTIALS_LOGIN","AD")};export{B as fromLoginCredentials};
@@ -1 +1 @@
1
- import{m,_,u,S,L,t,o,V,Ta,Z,B,Re,ze,A,I,rr,O,Pe,de,Ne,C,E,Ce,Ie,Te,ge,Ae,_e,K,QA,KA,f_,De,ry,yy,xy,Of,ct,eb,tb,cb,$b,gv,Av,Gc,Kw,OS,TE,PE,FE,LE,ZE,BE,UE,kg,zE,RC,Vs,Wc,Ol,iT,Fl,Yc,Jc,lT,Xc,uT,LT,C1,M1,R1,P1,Yp,eu,Xe,et,tt,rt,nt,ot,st,it,ue,ae,pe,qe,le,Mt,z,Ot,M,OA,W,Me,_r}from"./chunk-qx553512.js";import{Jl}from"./chunk-461gcgrs.js";import{Hl}from"./chunk-24nx3krz.js";import{ga}from"./chunk-9ca8a5f2.js";import{uo}from"./chunk-wbmqbpgm.js";import{dn}from"./chunk-zsg61vr0.js";import"./chunk-68xsb3t8.js";var $e=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]],te=I("arrow-down-wide-narrow",$e);var Le=[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]],ne=I("sliders-vertical",Le);S();function ce({open:a,onOpenChange:c,mode:d,teamId:h,project:l}){let g=V(),f=Re(),[n,b]=u(""),[k,x]=u(!0),[T,w]=u(void 0),[F,y]=u(void 0),[v,P]=u(!1),N=_(null);m(()=>{if(a)if(d==="edit"&&l)b(l.name||""),w(l.coverImageKey),y(l.coverImage),x(l.enableNotification!==!1);else b(""),w(void 0),y(void 0),x(!0)},[a,d,l]);let q=A.api.teams[":teamId"].projects.$post,{mutate:Y}=B({mutationFn:async(i)=>{let s=await q({param:{teamId:h},json:i});if(!s.ok)throw Error($b());return await s.json()},onSuccess:(i)=>{g.invalidateQueries({queryKey:["teams",h,"projects"]}),c(!1);let s=i;if(s&&typeof s.id==="string")f({to:"/projects/$projectId",params:{projectId:s.id}})}}),R=A.api.projects[":projectId"].$put,{mutate:G}=B({mutationFn:async(i)=>{let s=await R({param:{projectId:l.id},json:i});if(!s.ok)throw Error(gv());return await s.json()},onSuccess:()=>{g.invalidateQueries({queryKey:["teams",h,"projects"]}),c(!1)}}),J=A.api.teams[":teamId"].files.$post,{mutate:U}=B({mutationFn:async({file:i})=>{let s=await J({param:{teamId:h},form:{file:i}});if(!s.ok)throw Error(Gc());return await s.json()},onSuccess:(i)=>{let s=i;if(s&&typeof s.key==="string")w(s.key);P(!1)},onError:()=>{P(!1)}}),p=(i)=>{let s=i.target.files?.[0];if(s){P(!0);let ee=URL.createObjectURL(s);y(ee),U({file:s})}},D=()=>{N.current?.click()},Q=(i)=>{i.stopPropagation(),w(void 0),y(void 0)},j=()=>{if(!n.trim())return;if(d==="create")Y({name:n.trim(),coverImageKey:T,enableNotification:k});else if(d==="edit"&&l?.id)G({name:n.trim(),coverImageKey:T,enableNotification:k})};return t(ue,{open:a,onOpenChange:c,children:o(ae,{className:"sm:max-w-[550px] overflow-hidden rounded-2xl border border-border/60 bg-background/95 backdrop-blur-md shadow-2xl p-0 gap-0",children:[o(pe,{className:"relative overflow-hidden bg-gradient-to-br from-primary/5 to-transparent p-6 border-b border-border/40",children:[t("div",{className:"absolute top-0 right-0 w-24 h-24 bg-primary/10 rounded-full blur-2xl pointer-events-none"}),t("div",{className:"absolute bottom-0 left-10 w-32 h-12 bg-primary/5 rounded-full blur-xl pointer-events-none"}),t("div",{className:"flex items-center gap-3",children:o("div",{children:[t(le,{className:"text-xl font-semibold tracking-tight text-foreground",children:d==="create"?xy():kg()}),t(Mt,{className:"text-xs text-muted-foreground/80 mt-1",children:d==="create"?ry():Kw()})]})})]}),o("div",{className:"space-y-6 p-6 max-h-[75vh] overflow-y-auto",children:[o("div",{className:"space-y-2",children:[t(W,{htmlFor:"name",className:"text-sm font-semibold tracking-tight text-foreground",children:FE()}),o("div",{className:"relative",children:[t(z,{id:"name",value:n,onChange:(i)=>b(i.target.value),placeholder:ZE(),className:"h-11 px-4 rounded-xl border-border/80 focus-visible:ring-ring/25 focus-visible:border-primary transition-all shadow-xs pr-10"}),n.trim()&&t("div",{className:"absolute inset-y-0 right-3 flex items-center",children:t(Pe,{className:"w-4 h-4 text-primary"})})]}),t("p",{className:"text-[11px] text-muted-foreground",children:LE()})]}),o("div",{className:"space-y-3 border-t border-border/40 pt-5",children:[o("div",{className:"flex items-center justify-between",children:[o(W,{className:"text-sm font-semibold tracking-tight text-foreground flex items-center gap-1.5",children:[t(dn,{className:"w-4 h-4 text-primary"}),PE()]}),F&&o("button",{type:"button",onClick:Q,className:"text-xs text-muted-foreground hover:text-destructive hover:bg-destructive/5 px-2.5 py-1 rounded-lg transition-all flex items-center gap-1 font-medium",children:[t(Ne,{className:"w-3.5 h-3.5"}),RC()]})]}),o("div",{className:"relative aspect-square w-48 mx-auto rounded-2xl border border-dashed border-border flex items-center justify-center cursor-pointer overflow-hidden group shadow-inner bg-muted/20 transition-all duration-300 hover:border-primary/50 hover:bg-muted/40",onClick:D,children:[t("input",{type:"file",ref:N,className:"hidden",accept:"image/*",onChange:p}),v&&t("div",{className:"absolute inset-0 bg-background/70 backdrop-blur-xs flex flex-col items-center justify-center gap-2 z-20",children:o("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-background border rounded-full shadow-lg",children:[t(O,{className:"w-4 h-4 animate-spin text-primary"}),t("span",{className:"text-xs font-semibold text-foreground",children:eu()})]})}),F?o(L,{children:[t("img",{src:F,alt:yy(),className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"}),o("div",{className:"absolute inset-0 bg-black/45 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex flex-col items-center justify-center gap-1.5 text-white z-10",children:[t(uo,{className:"w-5 h-5 transform translate-y-1 group-hover:translate-y-0 transition-transform duration-300"}),t("span",{className:"text-xs font-semibold",children:Yp()})]})]}):o("div",{className:"flex flex-col items-center gap-2 text-center p-4",children:[t("div",{className:"p-2.5 rounded-full bg-background border shadow-xs group-hover:scale-110 transition-transform duration-300",children:t(uo,{className:"w-4 h-4 text-muted-foreground"})}),o("div",{children:[t("p",{className:"text-xs font-medium text-foreground",children:R1()}),t("p",{className:"text-[11px] text-muted-foreground mt-0.5 max-w-[140px] mx-auto leading-normal",children:P1()})]})]})]})]}),o("div",{className:"space-y-3 border-t border-border/40 pt-5",children:[o(W,{className:"text-sm font-semibold tracking-tight text-foreground flex items-center gap-1.5",children:[t(ne,{className:"w-4 h-4 text-primary"}),UE()]}),o("div",{className:"flex items-start justify-between rounded-xl border border-border/50 bg-muted/10 p-4 transition-all duration-300 hover:bg-muted/20",children:[o("div",{className:"space-y-1 pr-4",children:[o("div",{className:"text-sm font-semibold flex items-center gap-2 text-foreground",children:[t(ga,{className:"w-4 h-4 text-primary"}),QA()]}),t("p",{className:"text-xs text-muted-foreground leading-normal",children:KA()})]}),t(Me,{checked:k,onCheckedChange:x,disabled:v,className:"mt-0.5"})]})]})]}),o(qe,{className:"flex items-center justify-end gap-3 px-6 py-4 bg-muted/20 border-t border-border/40",children:[t(E,{type:"button",variant:"ghost",onClick:()=>c(!1),disabled:v,className:"rounded-xl h-10 px-4 hover:bg-muted font-medium text-sm text-muted-foreground hover:text-foreground transition-colors",children:De()}),t(E,{type:"submit",onClick:j,disabled:!n.trim()||v,className:"rounded-xl h-10 px-5 bg-primary text-primary-foreground hover:bg-primary/90 font-semibold text-sm shadow-lg shadow-primary/10 hover:shadow-primary/20 active:scale-98 transition-all flex items-center gap-2",children:v?o(L,{children:[t(O,{className:"w-4 h-4 animate-spin"}),TE()]}):d==="create"?Of():Vs()})]})]})})}function me({sortBy:a,sortDirection:c,onSortChange:d}){let h=(n)=>{d(n,c)},l=()=>{d(a,c==="asc"?"desc":"asc")},g=(n)=>{switch(n){case"name":return Fl();case"created_at":return iT();case"updated_at":return lT();default:return n}},f=c==="asc";return o(ge,{children:[t(Ae,{asChild:!0,children:o(E,{variant:"outline",className:"gap-2 bg-muted/50",children:[t("span",{className:"text-muted-foreground",children:uT()}),t("span",{className:"font-medium text-foreground",children:g(a)})]})}),o(_e,{align:"end",className:"w-56 p-2",children:[t("div",{className:"text-xs font-semibold text-muted-foreground mb-2 px-2",children:Ol()}),o(ge,{children:[t(Ae,{asChild:!0,children:o(E,{variant:"ghost",className:"w-full justify-between font-normal px-2 h-10 bg-muted/50 hover:bg-muted mb-2 border",children:[t("span",{children:g(a)}),t(te,{className:"h-4 w-4 opacity-50"})]})}),t(_e,{className:"w-52",children:["name","created_at","updated_at"].map((n)=>o(K,{onClick:()=>h(n),className:"justify-between",children:[g(n),a===n&&t(Pe,{className:"h-4 w-4"})]},n))})]}),o(E,{variant:"ghost",className:"w-full justify-between font-normal px-2 h-10 bg-muted/50 hover:bg-muted border",onClick:l,children:[t("span",{className:"text-muted-foreground",children:a==="name"?f?t(L,{children:Wc()}):t(L,{children:Xc()}):f?t(L,{children:Jc()}):t(L,{children:Yc()})}),f?t(Hl,{className:"h-4 w-4 opacity-50"}):t(te,{className:"h-4 w-4 opacity-50"})]})]})]})}S();function Ke(){let{teamId:a}=Ue.useParams(),{canEdit:c,canAdmin:d}=Ot(),h=Re(),l=V(),[g,f]=u(null),[n,b]=u(!1),[k,x]=u("create"),[T,w]=u(void 0),[F,y]=u(!1),[v,P]=u(void 0),[N,q]=u(""),[Y,R]=u(!1),{metadata:G,setMetadata:J}=_r(),U=`team:${a}:projects:sort`,p=G[U],[D,Q]=u(()=>p?.sortBy||"name"),[j,i]=u(()=>p?.sortDirection||"asc");m(()=>{if(p?.sortBy&&p.sortBy!==D)Q(p.sortBy);if(p?.sortDirection&&p.sortDirection!==j)i(p.sortDirection)},[p]);let s=A.api.teams[":teamId"].projects.$get,{data:ee}=Z({queryKey:["teams",a,"projects",D,j],queryFn:async()=>{let e=await s({param:{teamId:a},query:{sortBy:D,sortDirection:j}});if(!e.ok)throw Error("Failed to fetch projects");return await e.json()},placeholderData:Ta}),{data:oe}=Z({queryKey:["teams",a,"members"],queryFn:async()=>{let e=await A.api.teams[":teamId"].members.$get({param:{teamId:a},query:{}});if(!e.ok)throw Error("Failed to fetch members");return await e.json()}}),{data:re}=Z({queryKey:["teams",a,"me"],queryFn:async()=>{let e=await A.api.teams[":teamId"].me.$get({param:{teamId:a}});if(!e.ok)throw Error("Failed to fetch me");return await e.json()}}),fe=A.api.teams[":teamId"].invite.$post,ve=B({mutationFn:async(e)=>{let r=await fe(e);if(!r.ok)throw Error("Failed to invite");return await r.json()}}),H=B({mutationFn:async(e)=>{if(!(await A.api.projects[":projectId"].$delete({param:{projectId:e}})).ok)throw Error("Failed to delete project")},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"projects"]})}}),he=B({mutationFn:async(e)=>{let r=await A.api.projects[":projectId"].$put({param:{projectId:e.id},json:{enableNotification:!e.enableNotification}});if(!r.ok)throw Error("Failed to update project notification settings");return await r.json()},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"projects"]}),M.success(BE())},onError:(e)=>{M.error(e instanceof Error?e.message:Av())}}),se=()=>{x("create"),w(void 0),b(!0)},ye=()=>{f("create"),setTimeout(()=>{f(null)},100),setTimeout(()=>{se()},200)},be=(e)=>{x("edit"),w(e),b(!0)},we=(e)=>{P(e),q(""),y(!0)},xe=async()=>{if(v&&N==="delete")try{await H.mutateAsync(v.id),y(!1)}catch(e){console.error(e)}},je=(e,r)=>{if(r.detail>1)return;f(e),setTimeout(()=>{f(null)},100),setTimeout(()=>{h({to:"/projects/$projectId",params:{projectId:e}})},200)},ke=async(e)=>(await ve.mutateAsync({param:{teamId:a},json:{role:e}})).code,Fe=B({mutationFn:async({userId:e,role:r})=>{if(!(await A.api.teams[":teamId"].members[":userId"].$patch({param:{teamId:a,userId:e},json:{role:r}})).ok)throw Error("Failed to update member role")},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"members"]})}}),Ee=B({mutationFn:async(e)=>{if(!(await A.api.teams[":teamId"].members[":userId"].$delete({param:{teamId:a,userId:e}})).ok)throw Error("Failed to remove member")},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"members"]})}}),Be=(e)=>{if(!e)return"??";return e.split(" ").map((r)=>r[0]).slice(0,2).join("").toUpperCase()},Se=(e,r)=>{Q(e),i(r),J(a,U,{sortBy:e,sortDirection:r})},X=Array.isArray(oe)?oe:[];return o("div",{className:"flex-1 overflow-y-auto p-4",children:[o("div",{className:"flex flex-wrap items-center justify-between mb-4 gap-4",children:[t("h1",{className:"text-2xl font-bold",children:zE()}),o("div",{className:"flex flex-wrap items-center gap-4",children:[o("div",{className:"flex items-center -space-x-2 cursor-pointer hover:opacity-90",onClick:()=>R(!0),"data-testid":"team-members-trigger",children:[X.slice(0,3).map((e)=>o(Ce,{className:"border-2 border-background w-8 h-8",children:[e.image&&t(Ie,{src:e.image,alt:e.name,className:"object-cover"}),t(Te,{className:"text-[10px]",children:Be(e.name)})]},e.id)),X.length>3&&o("div",{className:"flex items-center justify-center w-8 h-8 rounded-full border-2 border-background bg-muted text-[10px] font-medium",children:["+",X.length-3]})]}),t(me,{sortBy:D,sortDirection:j,onSortChange:Se}),c&&o(E,{className:"bg-orange-600 hover:bg-orange-700 text-white gap-2",onClick:se,children:[t(de,{className:"w-4 h-4"}),Of()]})]})]}),o("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 gap-4",children:[ee?.data?.map((e)=>t("div",{className:C("shadow-md relative border rounded-xl overflow-hidden cursor-pointer transition-transform duration-100 ease-in-out",g===e.id?"scale-95":"scale-100"),onClick:(r)=>je(e.id,r),children:o("div",{className:"flex flex-col",children:[o("div",{className:"relative w-full h-full aspect-square flex items-center justify-center bg-zinc-400/20",children:[e.coverImage?t("img",{src:e.coverImage,alt:e.name,className:"w-full h-full object-cover rounded"}):o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 180.95 164.7",preserveAspectRatio:"xMidYMid slice",className:"w-full h-full object-cover rounded",children:[t("polygon",{fill:"#FC9F8E",points:"0 18.5 0 76.0 151.69 164.7 180.95 164.7 180.95 113.6"}),t("polygon",{fill:"#FEBAB8",points:"0 0 74.58 61.5 90.53 51.6 110.33 63.9 180.95 18.9 180.95 0"}),t("polyline",{fill:"#FAA5A5",points:"0 18.5 74.58 61.5 90.53 51.6 110.33 63.9 180.95 18.9 180.95 0 0 0"}),t("polygon",{fill:"#EC5B6C",points:"0 76.0 0 164.7 151.69 164.7"}),t("polygon",{fill:"#E85C71",points:"180.95 18.9 110.33 63.9 117.37 68.0 117.26 73.4 180.95 113.6"}),t("polygon",{fill:"#C8405B",points:"117.26 73.4 117.37 99.0 90.53 114.9 174.35 164.7 180.95 164.7 180.95 113.6"}),t("polygon",{fill:"#FFCCBE",points:"90.53 51.6 63.69 68.1 90.53 83.4"}),t("path",{fill:"#FB9991",d:"M 90.53 51.6 L 90.53 61.3 L 100.87 67.4 L 90.53 73.5 L 90.53 83.4 L 117.37 68.0 C 117.15 67.6 90.53 51.6 90.53 51.6 Z"}),t("path",{fill:"#FFEACD",d:"M 63.69 68.1 C 63.47 68.5 64.02 99.3 64.02 99.3 C 64.02 99.3 64.46 99.6 64.9 99.9 L 90.53 83.4 L 63.69 68.1 Z"}),t("polygon",{fill:"#FFCFB5",points:"64.02 99.3 90.53 114.9 90.53 83.4"}),t("path",{fill:"#F67D73",d:"M 90.53 83.4 L 90.53 114.9 L 117.37 99.0 Z"}),t("path",{fill:"#F26560",d:"M 90.53 83.4 L 117.37 99.0 L 117.37 68.0 Z"}),t("polygon",{fill:"#EB5F5B",points:"80.08 67.5 90.53 73.5 90.53 61.3"}),t("polygon",{fill:"#DB4D50",points:"90.53 61.3 90.53 73.5 100.87 67.4"})]}),t("div",{className:"absolute bottom-0 left-0 w-full h-[65%] bg-linear-to-t from-black/35 to-black/0"}),t("p",{className:"absolute left-1 bottom-2 text-white",children:e.name})]}),o("div",{className:"px-2 h-10 flex justify-between items-center",children:[o("p",{className:"truncate pr-1 text-xs text-muted-foreground",children:[M1()," ",OA(e.updatedAt??"")]}),t("div",{onClick:(r)=>r.stopPropagation(),children:o(ge,{modal:!1,children:[t(Ae,{asChild:!0,children:t("button",{className:"hover:bg-muted outline-none flex px-1",children:t(rr,{className:"w-5 h-5 text-muted-foreground"})})}),o(_e,{align:"end",children:[c&&t(K,{onClick:(r)=>{r.stopPropagation(),be(e)},children:kg()}),o(K,{className:"flex items-center justify-between gap-4 cursor-pointer",onSelect:(r)=>{r.preventDefault(),he.mutate(e)},children:[t("span",{children:OS()}),t(Me,{checked:e.enableNotification??!0,className:"pointer-events-none"})]}),d&&t(K,{className:"text-destructive focus:text-destructive",onClick:()=>we(e),children:ct()})]})]})})]})]})},e.id)),c&&t("div",{className:C("shadow-md relative border rounded-xl overflow-hidden cursor-pointer transition-transform duration-100 ease-in-out border-dashed hover:border-orange-600/50 group",g==="create"?"scale-95":"scale-100"),onClick:ye,children:o("div",{className:"flex flex-col",children:[t("div",{className:"relative w-full aspect-square flex items-center justify-center bg-zinc-400/5 group-hover:bg-orange-600/5 transition-colors",children:t(de,{className:"w-8 h-8 text-zinc-400 group-hover:text-orange-600 transition-colors"})}),t("div",{className:"px-2 h-10 flex items-center justify-center bg-zinc-400/10 border-t group-hover:bg-orange-600/10 transition-colors",children:t("p",{className:"text-sm text-muted-foreground group-hover:text-orange-600 transition-colors",children:Of()})})]})})]}),t(ce,{open:n,onOpenChange:b,mode:k,teamId:a,project:T}),t(Xe,{open:F,onOpenChange:y,children:o(et,{children:[o(tt,{children:[t(nt,{children:f_()}),o(ot,{children:[tb({name:v?.name??""}),o("div",{className:"mt-4 flex flex-col gap-2 text-foreground",children:[t("span",{className:"text-sm font-medium",children:C1()}),t(z,{value:N,onChange:(e)=>q(e.target.value),placeholder:eb(),className:"h-9",autoFocus:!0})]})]})]}),o(rt,{children:[t(it,{disabled:H.isPending,children:De()}),t(st,{onClick:(e)=>{e.preventDefault(),xe()},disabled:N!=="delete"||H.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:H.isPending?cb():ct()})]})]})}),t(Jl,{open:Y,onOpenChange:R,title:LT(),type:"team",members:X,isOwner:re?.role==="owner",onInvite:ke,onUpdateRole:async(e,r)=>{await Fe.mutateAsync({userId:e,role:r})},onRemoveMember:async(e)=>{await Ee.mutateAsync(e)},currentUserId:re?.id})]})}var Ue=ze("/teams/$teamId/")({component:Ke});export{Ue as Route};
1
+ import{m,_,u,E,L,t,o,G,Ta,Z,B,Pe,ze,g,I,rr,O,Me,pe,Ne,C,S,Ce,Ie,Te,ge,Ae,_e,K,c0,u0,I_,Re,vy,Zy,jy,jf,ht,_b,yb,Ib,cv,Ov,Fv,Yc,Ax,nE,JE,rC,Fd,sC,iC,aC,lC,Hg,cC,eI,Qs,tu,Ll,kT,Zl,ru,nu,PT,ou,DT,f1,rM,sM,lM,cM,am,su,nt,ot,st,it,at,lt,ct,ut,de,ce,me,He,ue,Et,z,Ft,M,e0,W,ke,br}from"./chunk-p1d500sf.js";import{tc}from"./chunk-sbg86tch.js";import{Gl}from"./chunk-sv92vkyh.js";import{ga}from"./chunk-jvt8q0eg.js";import{po}from"./chunk-1eqw2dpx.js";import{_n}from"./chunk-b7qs7hxg.js";import"./chunk-ht5rht98.js";var Se=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]],te=I("arrow-down-wide-narrow",Se);var $e=[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]],se=I("sliders-vertical",$e);E();function ie({open:a,onOpenChange:c,mode:d,teamId:y,project:l}){let v=G(),f=Pe(),[n,w]=u(""),[F,N]=u(!0),[T,x]=u(void 0),[P,b]=u(void 0),[h,A]=u(!1),D=_(null);m(()=>{if(a)if(d==="edit"&&l)w(l.name||""),x(l.coverImageKey),b(l.coverImage),N(l.enableNotification!==!1);else w(""),x(void 0),b(void 0),N(!0)},[a,d,l]);let q=g.api.teams[":teamId"].projects.$post,{mutate:X}=B({mutationFn:async(i)=>{let s=await q({param:{teamId:y},json:i});if(!s.ok)throw Error(cv());return await s.json()},onSuccess:(i)=>{v.invalidateQueries({queryKey:["teams",y,"projects"]}),c(!1);let s=i;if(s&&typeof s.id==="string")f({to:"/projects/$projectId",params:{projectId:s.id}})}}),R=g.api.projects[":projectId"].$put,{mutate:Y}=B({mutationFn:async(i)=>{let s=await R({param:{projectId:l.id},json:i});if(!s.ok)throw Error(Ov());return await s.json()},onSuccess:()=>{v.invalidateQueries({queryKey:["teams",y,"projects"]}),c(!1)}}),J=g.api.teams[":teamId"].files.$post,{mutate:U}=B({mutationFn:async({file:i})=>{let s=await J({param:{teamId:y},form:{file:i}});if(!s.ok)throw Error(Yc());return await s.json()},onSuccess:(i)=>{let s=i;if(s&&typeof s.key==="string")x(s.key);A(!1)},onError:()=>{A(!1)}}),p=(i)=>{let s=i.target.files?.[0];if(s){A(!0);let ee=URL.createObjectURL(s);b(ee),U({file:s})}},j=()=>{D.current?.click()},Q=(i)=>{i.stopPropagation(),x(void 0),b(void 0)},k=()=>{if(!n.trim())return;if(d==="create")X({name:n.trim(),coverImageKey:T,enableNotification:F});else if(d==="edit"&&l?.id)Y({name:n.trim(),coverImageKey:T,enableNotification:F})};return t(de,{open:a,onOpenChange:c,children:o(ce,{className:"sm:max-w-[550px] overflow-hidden rounded-2xl border border-border/60 bg-background/95 backdrop-blur-md shadow-2xl p-0 gap-0",children:[o(me,{className:"relative overflow-hidden bg-gradient-to-br from-primary/5 to-transparent p-6 border-b border-border/40",children:[t("div",{className:"absolute top-0 right-0 w-24 h-24 bg-primary/10 rounded-full blur-2xl pointer-events-none"}),t("div",{className:"absolute bottom-0 left-10 w-32 h-12 bg-primary/5 rounded-full blur-xl pointer-events-none"}),t("div",{className:"flex items-center gap-3",children:o("div",{children:[t(ue,{className:"text-xl font-semibold tracking-tight text-foreground",children:d==="create"?jy():Hg()}),t(Et,{className:"text-xs text-muted-foreground/80 mt-1",children:d==="create"?vy():Ax()})]})})]}),o("div",{className:"space-y-6 p-6 max-h-[75vh] overflow-y-auto",children:[o("div",{className:"space-y-2",children:[t(W,{htmlFor:"name",className:"text-sm font-semibold tracking-tight text-foreground",children:Fd()}),o("div",{className:"relative",children:[t(z,{id:"name",value:n,onChange:(i)=>w(i.target.value),placeholder:iC(),className:"h-11 px-4 rounded-xl border-border/80 focus-visible:ring-ring/25 focus-visible:border-primary transition-all shadow-xs pr-10"}),n.trim()&&t("div",{className:"absolute inset-y-0 right-3 flex items-center",children:t(Me,{className:"w-4 h-4 text-primary"})})]}),t("p",{className:"text-[11px] text-muted-foreground",children:sC()})]}),o("div",{className:"space-y-3 border-t border-border/40 pt-5",children:[o("div",{className:"flex items-center justify-between",children:[o(W,{className:"text-sm font-semibold tracking-tight text-foreground flex items-center gap-1.5",children:[t(_n,{className:"w-4 h-4 text-primary"}),rC()]}),P&&o("button",{type:"button",onClick:Q,className:"text-xs text-muted-foreground hover:text-destructive hover:bg-destructive/5 px-2.5 py-1 rounded-lg transition-all flex items-center gap-1 font-medium",children:[t(Ne,{className:"w-3.5 h-3.5"}),eI()]})]}),o("div",{className:"relative aspect-square w-48 mx-auto rounded-2xl border border-dashed border-border flex items-center justify-center cursor-pointer overflow-hidden group shadow-inner bg-muted/20 transition-all duration-300 hover:border-primary/50 hover:bg-muted/40",onClick:j,children:[t("input",{type:"file",ref:D,className:"hidden",accept:"image/*",onChange:p}),h&&t("div",{className:"absolute inset-0 bg-background/70 backdrop-blur-xs flex flex-col items-center justify-center gap-2 z-20",children:o("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-background border rounded-full shadow-lg",children:[t(O,{className:"w-4 h-4 animate-spin text-primary"}),t("span",{className:"text-xs font-semibold text-foreground",children:su()})]})}),P?o(L,{children:[t("img",{src:P,alt:Zy(),className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"}),o("div",{className:"absolute inset-0 bg-black/45 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex flex-col items-center justify-center gap-1.5 text-white z-10",children:[t(po,{className:"w-5 h-5 transform translate-y-1 group-hover:translate-y-0 transition-transform duration-300"}),t("span",{className:"text-xs font-semibold",children:am()})]})]}):o("div",{className:"flex flex-col items-center gap-2 text-center p-4",children:[t("div",{className:"p-2.5 rounded-full bg-background border shadow-xs group-hover:scale-110 transition-transform duration-300",children:t(po,{className:"w-4 h-4 text-muted-foreground"})}),o("div",{children:[t("p",{className:"text-xs font-medium text-foreground",children:lM()}),t("p",{className:"text-[11px] text-muted-foreground mt-0.5 max-w-[140px] mx-auto leading-normal",children:cM()})]})]})]})]}),o("div",{className:"space-y-3 border-t border-border/40 pt-5",children:[o(W,{className:"text-sm font-semibold tracking-tight text-foreground flex items-center gap-1.5",children:[t(se,{className:"w-4 h-4 text-primary"}),lC()]}),o("div",{className:"flex items-start justify-between rounded-xl border border-border/50 bg-muted/10 p-4 transition-all duration-300 hover:bg-muted/20",children:[o("div",{className:"space-y-1 pr-4",children:[o("div",{className:"text-sm font-semibold flex items-center gap-2 text-foreground",children:[t(ga,{className:"w-4 h-4 text-primary"}),c0()]}),t("p",{className:"text-xs text-muted-foreground leading-normal",children:u0()})]}),t(ke,{checked:F,onCheckedChange:N,disabled:h,className:"mt-0.5"})]})]})]}),o(He,{className:"flex items-center justify-end gap-3 px-6 py-4 bg-muted/20 border-t border-border/40",children:[t(S,{type:"button",variant:"ghost",onClick:()=>c(!1),disabled:h,className:"rounded-xl h-10 px-4 hover:bg-muted font-medium text-sm text-muted-foreground hover:text-foreground transition-colors",children:Re()}),t(S,{type:"submit",onClick:k,disabled:!n.trim()||h,className:"rounded-xl h-10 px-5 bg-primary text-primary-foreground hover:bg-primary/90 font-semibold text-sm shadow-lg shadow-primary/10 hover:shadow-primary/20 active:scale-98 transition-all flex items-center gap-2",children:h?o(L,{children:[t(O,{className:"w-4 h-4 animate-spin"}),JE()]}):d==="create"?jf():Qs()})]})]})})}function le({sortBy:a,sortDirection:c,onSortChange:d}){let y=(n)=>{d(n,c)},l=()=>{d(a,c==="asc"?"desc":"asc")},v=(n)=>{switch(n){case"name":return Zl();case"created_at":return kT();case"updated_at":return PT();default:return n}},f=c==="asc";return o(ge,{children:[t(Ae,{asChild:!0,children:o(S,{variant:"outline",className:"gap-2 bg-muted/50",children:[t("span",{className:"text-muted-foreground",children:DT()}),t("span",{className:"font-medium text-foreground",children:v(a)})]})}),o(_e,{align:"end",className:"w-56 p-2",children:[t("div",{className:"text-xs font-semibold text-muted-foreground mb-2 px-2",children:Ll()}),o(ge,{children:[t(Ae,{asChild:!0,children:o(S,{variant:"ghost",className:"w-full justify-between font-normal px-2 h-10 bg-muted/50 hover:bg-muted mb-2 border",children:[t("span",{children:v(a)}),t(te,{className:"h-4 w-4 opacity-50"})]})}),t(_e,{className:"w-52",children:["name","created_at","updated_at"].map((n)=>o(K,{onClick:()=>y(n),className:"justify-between",children:[v(n),a===n&&t(Me,{className:"h-4 w-4"})]},n))})]}),o(S,{variant:"ghost",className:"w-full justify-between font-normal px-2 h-10 bg-muted/50 hover:bg-muted border",onClick:l,children:[t("span",{className:"text-muted-foreground",children:a==="name"?f?t(L,{children:tu()}):t(L,{children:ou()}):f?t(L,{children:nu()}):t(L,{children:ru()})}),f?t(Gl,{className:"h-4 w-4 opacity-50"}):t(te,{className:"h-4 w-4 opacity-50"})]})]})]})}E();function Le(){let{teamId:a}=Ke.useParams(),{canEdit:c,canAdmin:d}=Ft(),y=Pe(),l=G(),[v,f]=u(null),[n,w]=u(!1),[F,N]=u("create"),[T,x]=u(void 0),[P,b]=u(!1),[h,A]=u(void 0),[D,q]=u(""),[X,R]=u(!1),{metadata:Y,setMetadata:J}=br(),U=`team:${a}:projects:sort`,p=Y[U],[j,Q]=u(()=>p?.sortBy||"name"),[k,i]=u(()=>p?.sortDirection||"asc");m(()=>{if(p?.sortBy&&p.sortBy!==j)Q(p.sortBy);if(p?.sortDirection&&p.sortDirection!==k)i(p.sortDirection)},[p]);let s=g.api.teams[":teamId"].projects.$get,{data:ee}=Z({queryKey:["teams",a,"projects",j,k],queryFn:async()=>{let e=await s({param:{teamId:a},query:{sortBy:j,sortDirection:k}});if(!e.ok)throw Error("Failed to fetch projects");return await e.json()},placeholderData:Ta}),{data:oe}=Z({queryKey:["teams",a,"members"],queryFn:async()=>{let e=await g.api.teams[":teamId"].members.$get({param:{teamId:a},query:{}});if(!e.ok)throw Error("Failed to fetch members");return await e.json()}}),{data:re}=Z({queryKey:["teams",a,"me"],queryFn:async()=>{let e=await g.api.teams[":teamId"].me.$get({param:{teamId:a}});if(!e.ok)throw Error("Failed to fetch me");return await e.json()}}),fe=g.api.teams[":teamId"].invite.$post,ve=B({mutationFn:async(e)=>{let r=await fe(e);if(!r.ok)throw Error("Failed to invite");return await r.json()}}),H=B({mutationFn:async(e)=>{if(!(await g.api.projects[":projectId"].$delete({param:{projectId:e}})).ok)throw Error("Failed to delete project")},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"projects"]})}}),he=B({mutationFn:async(e)=>{let r=await g.api.projects[":projectId"].$put({param:{projectId:e.id},json:{enableNotification:!e.enableNotification}});if(!r.ok)throw Error("Failed to update project notification settings");return await r.json()},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"projects"]}),M.success(aC())},onError:(e)=>{M.error(e instanceof Error?e.message:Fv())}}),ae=()=>{N("create"),x(void 0),w(!0)},ye=()=>{f("create"),setTimeout(()=>{f(null)},100),setTimeout(()=>{ae()},200)},be=(e)=>{N("edit"),x(e),w(!0)},we=(e)=>{A(e),q(""),b(!0)},xe=async()=>{if(h&&D==="delete")try{await H.mutateAsync(h.id),b(!1)}catch(e){console.error(e)}},De=(e,r)=>{if(r.detail>1)return;f(e),setTimeout(()=>{f(null)},100),setTimeout(()=>{y({to:"/projects/$projectId",params:{projectId:e}})},200)},je=async(e)=>(await ve.mutateAsync({param:{teamId:a},json:{role:e}})).code,Fe=B({mutationFn:async({userId:e,role:r})=>{if(!(await g.api.teams[":teamId"].members[":userId"].$patch({param:{teamId:a,userId:e},json:{role:r}})).ok)throw Error("Failed to update member role")},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"members"]})}}),Ee=B({mutationFn:async(e)=>{if(!(await g.api.teams[":teamId"].members[":userId"].$delete({param:{teamId:a,userId:e}})).ok)throw Error("Failed to remove member")},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"members"]})}}),qe=(e)=>{if(!e)return"??";return e.split(" ").map((r)=>r[0]).slice(0,2).join("").toUpperCase()},Be=(e,r)=>{Q(e),i(r),J(a,U,{sortBy:e,sortDirection:r})},V=Array.isArray(oe)?oe:[];return o("div",{className:"flex-1 overflow-y-auto p-4",children:[o("div",{className:"flex flex-wrap items-center justify-between mb-4 gap-4",children:[t("h1",{className:"text-2xl font-bold",children:cC()}),o("div",{className:"flex flex-wrap items-center gap-4",children:[o("div",{className:"flex items-center -space-x-2 cursor-pointer hover:opacity-90",onClick:()=>R(!0),"data-testid":"team-members-trigger",children:[V.slice(0,3).map((e)=>o(Ce,{className:"border-2 border-background w-8 h-8",children:[e.image&&t(Ie,{src:e.image,alt:e.name,className:"object-cover"}),t(Te,{className:"text-[10px]",children:qe(e.name)})]},e.id)),V.length>3&&o("div",{className:"flex items-center justify-center w-8 h-8 rounded-full border-2 border-background bg-muted text-[10px] font-medium",children:["+",V.length-3]})]}),t(le,{sortBy:j,sortDirection:k,onSortChange:Be}),c&&o(S,{className:"bg-orange-600 hover:bg-orange-700 text-white gap-2",onClick:ae,children:[t(pe,{className:"w-4 h-4"}),jf()]})]})]}),o("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 gap-4",children:[ee?.data?.map((e)=>t("div",{className:C("shadow-md relative border rounded-xl overflow-hidden cursor-pointer transition-transform duration-100 ease-in-out",v===e.id?"scale-95":"scale-100"),onClick:(r)=>De(e.id,r),children:o("div",{className:"flex flex-col",children:[o("div",{className:"relative w-full h-full aspect-square flex items-center justify-center bg-zinc-400/20",children:[e.coverImage?t("img",{src:e.coverImage,alt:e.name,className:"w-full h-full object-cover rounded"}):o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 180.95 164.7",preserveAspectRatio:"xMidYMid slice",className:"w-full h-full object-cover rounded",children:[t("polygon",{fill:"#FC9F8E",points:"0 18.5 0 76.0 151.69 164.7 180.95 164.7 180.95 113.6"}),t("polygon",{fill:"#FEBAB8",points:"0 0 74.58 61.5 90.53 51.6 110.33 63.9 180.95 18.9 180.95 0"}),t("polyline",{fill:"#FAA5A5",points:"0 18.5 74.58 61.5 90.53 51.6 110.33 63.9 180.95 18.9 180.95 0 0 0"}),t("polygon",{fill:"#EC5B6C",points:"0 76.0 0 164.7 151.69 164.7"}),t("polygon",{fill:"#E85C71",points:"180.95 18.9 110.33 63.9 117.37 68.0 117.26 73.4 180.95 113.6"}),t("polygon",{fill:"#C8405B",points:"117.26 73.4 117.37 99.0 90.53 114.9 174.35 164.7 180.95 164.7 180.95 113.6"}),t("polygon",{fill:"#FFCCBE",points:"90.53 51.6 63.69 68.1 90.53 83.4"}),t("path",{fill:"#FB9991",d:"M 90.53 51.6 L 90.53 61.3 L 100.87 67.4 L 90.53 73.5 L 90.53 83.4 L 117.37 68.0 C 117.15 67.6 90.53 51.6 90.53 51.6 Z"}),t("path",{fill:"#FFEACD",d:"M 63.69 68.1 C 63.47 68.5 64.02 99.3 64.02 99.3 C 64.02 99.3 64.46 99.6 64.9 99.9 L 90.53 83.4 L 63.69 68.1 Z"}),t("polygon",{fill:"#FFCFB5",points:"64.02 99.3 90.53 114.9 90.53 83.4"}),t("path",{fill:"#F67D73",d:"M 90.53 83.4 L 90.53 114.9 L 117.37 99.0 Z"}),t("path",{fill:"#F26560",d:"M 90.53 83.4 L 117.37 99.0 L 117.37 68.0 Z"}),t("polygon",{fill:"#EB5F5B",points:"80.08 67.5 90.53 73.5 90.53 61.3"}),t("polygon",{fill:"#DB4D50",points:"90.53 61.3 90.53 73.5 100.87 67.4"})]}),t("div",{className:"absolute bottom-0 left-0 w-full h-[65%] bg-linear-to-t from-black/35 to-black/0"}),t("p",{className:"absolute left-1 bottom-2 text-white",children:e.name})]}),o("div",{className:"px-2 h-10 flex justify-between items-center",children:[o("p",{className:"truncate pr-1 text-xs text-muted-foreground",children:[sM()," ",e0(e.updatedAt??"")]}),t("div",{onClick:(r)=>r.stopPropagation(),children:o(ge,{modal:!1,children:[t(Ae,{asChild:!0,children:t("button",{className:"hover:bg-muted outline-none flex px-1",children:t(rr,{className:"w-5 h-5 text-muted-foreground"})})}),o(_e,{align:"end",children:[c&&t(K,{onClick:(r)=>{r.stopPropagation(),be(e)},children:Hg()}),o(K,{className:"flex items-center justify-between gap-4 cursor-pointer",onSelect:(r)=>{r.preventDefault(),he.mutate(e)},children:[t("span",{children:nE()}),t(ke,{checked:e.enableNotification??!0,className:"pointer-events-none"})]}),d&&t(K,{className:"text-destructive focus:text-destructive",onClick:()=>we(e),children:ht()})]})]})})]})]})},e.id)),c&&t("div",{className:C("shadow-md relative border rounded-xl overflow-hidden cursor-pointer transition-transform duration-100 ease-in-out border-dashed hover:border-orange-600/50 group",v==="create"?"scale-95":"scale-100"),onClick:ye,children:o("div",{className:"flex flex-col",children:[t("div",{className:"relative w-full aspect-square flex items-center justify-center bg-zinc-400/5 group-hover:bg-orange-600/5 transition-colors",children:t(pe,{className:"w-8 h-8 text-zinc-400 group-hover:text-orange-600 transition-colors"})}),t("div",{className:"px-2 h-10 flex items-center justify-center bg-zinc-400/10 border-t group-hover:bg-orange-600/10 transition-colors",children:t("p",{className:"text-sm text-muted-foreground group-hover:text-orange-600 transition-colors",children:jf()})})]})})]}),t(ie,{open:n,onOpenChange:w,mode:F,teamId:a,project:T}),t(nt,{open:P,onOpenChange:b,children:o(ot,{children:[o(st,{children:[t(at,{children:I_()}),o(lt,{children:[yb({name:h?.name??""}),o("div",{className:"mt-4 flex flex-col gap-2 text-foreground",children:[t("span",{className:"text-sm font-medium",children:rM()}),t(z,{value:D,onChange:(e)=>q(e.target.value),placeholder:_b(),className:"h-9",autoFocus:!0})]})]})]}),o(it,{children:[t(ut,{disabled:H.isPending,children:Re()}),t(ct,{onClick:(e)=>{e.preventDefault(),xe()},disabled:D!=="delete"||H.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:H.isPending?Ib():ht()})]})]})}),t(tc,{open:X,onOpenChange:R,title:f1(),type:"team",members:V,isOwner:re?.role==="owner",onInvite:je,onUpdateRole:async(e,r)=>{await Fe.mutateAsync({userId:e,role:r})},onRemoveMember:async(e)=>{await Ee.mutateAsync(e)},currentUserId:re?.id})]})}var Ke=ze("/teams/$teamId/")({component:Le});export{Ke as Route};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{al}from"./chunk-jzgtthsj.js";export default al();
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Aa,sc,_a,ic,ac,lc,cc,uc}from"./chunk-cvfznrnt.js";import{xn,Sn}from"./chunk-sbyyn9yw.js";import{He,Tr}from"./chunk-m41tbrvt.js";import{qi}from"./chunk-3fjgf7eb.js";import{mn,Gr}from"./chunk-ncv8v6mj.js";import{Jt}from"./chunk-q7t5zs7n.js";var w=0,m=(e,a,n)=>{let i=new Jt;return(async()=>{let t={role:"assistant",content:[],api:"google-generative-ai",provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{let l=n?.apiKey;if(!l)throw Error(`No API key for provider: ${e.provider}`);let s=M(e,l,n?.headers),g=T(e,a,n),h=await n?.onPayload?.(g,e);if(h!==void 0)g=h;let b=await s.models.generateContentStream(g);i.push({type:"start",partial:t});let o=null,C=t.content,u=()=>C.length-1;for await(let c of b){t.responseId||=c.responseId;let p=c.candidates?.[0];if(p?.content?.parts)for(let r of p.content.parts){if(r.text!==void 0){let d=sc(r);if(!o||d&&o.type!=="thinking"||!d&&o.type!=="text"){if(o)if(o.type==="text")i.push({type:"text_end",contentIndex:C.length-1,content:o.text,partial:t});else i.push({type:"thinking_end",contentIndex:u(),content:o.thinking,partial:t});if(d)o={type:"thinking",thinking:"",thinkingSignature:void 0},t.content.push(o),i.push({type:"thinking_start",contentIndex:u(),partial:t});else o={type:"text",text:""},t.content.push(o),i.push({type:"text_start",contentIndex:u(),partial:t})}if(o.type==="thinking")o.thinking+=r.text,o.thinkingSignature=_a(o.thinkingSignature,r.thoughtSignature),i.push({type:"thinking_delta",contentIndex:u(),delta:r.text,partial:t});else o.text+=r.text,o.textSignature=_a(o.textSignature,r.thoughtSignature),i.push({type:"text_delta",contentIndex:u(),delta:r.text,partial:t})}if(r.functionCall){if(o){if(o.type==="text")i.push({type:"text_end",contentIndex:u(),content:o.text,partial:t});else i.push({type:"thinking_end",contentIndex:u(),content:o.thinking,partial:t});o=null}let d=r.functionCall.id,f={type:"toolCall",id:!d||t.content.some((I)=>I.type==="toolCall"&&I.id===d)?`${r.functionCall.name}_${Date.now()}_${++w}`:d,name:r.functionCall.name||"",arguments:r.functionCall.args??{},...r.thoughtSignature&&{thoughtSignature:r.thoughtSignature}};t.content.push(f),i.push({type:"toolcall_start",contentIndex:u(),partial:t}),i.push({type:"toolcall_delta",contentIndex:u(),delta:JSON.stringify(f.arguments),partial:t}),i.push({type:"toolcall_end",contentIndex:u(),toolCall:f,partial:t})}}if(p?.finishReason){if(t.stopReason=uc(p.finishReason),t.content.some((r)=>r.type==="toolCall"))t.stopReason="toolUse"}if(c.usageMetadata)t.usage={input:(c.usageMetadata.promptTokenCount||0)-(c.usageMetadata.cachedContentTokenCount||0),output:(c.usageMetadata.candidatesTokenCount||0)+(c.usageMetadata.thoughtsTokenCount||0),cacheRead:c.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:c.usageMetadata.thoughtsTokenCount||0,totalTokens:c.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},mn(e,t.usage)}if(o)if(o.type==="text")i.push({type:"text_end",contentIndex:u(),content:o.text,partial:t});else i.push({type:"thinking_end",contentIndex:u(),content:o.thinking,partial:t});if(n?.signal?.aborted)throw Error("Request was aborted");if(t.stopReason==="aborted"||t.stopReason==="error")throw Error("An unknown error occurred");i.push({type:"done",reason:t.stopReason,message:t}),i.end()}catch(l){for(let s of t.content)if("index"in s)delete s.index;t.stopReason=n?.signal?.aborted?"aborted":"error",t.errorMessage=Sn(xn(l)),i.push({type:"error",reason:t.stopReason,error:t}),i.end()}})(),i},B=(e,a,n)=>{let i=n?.apiKey;if(!i)throw Error(`No API key for provider: ${e.provider}`);let t=Tr(e,a,n,i);if(!n?.reasoning)return m(e,a,{...t,thinking:{enabled:!1}});let l=Gr(e,n.reasoning),s=l==="off"?"high":l,g=e;if(y(g)||x(g)||k(g))return m(e,a,{...t,thinking:{enabled:!0,level:S(s,g)}});return m(e,a,{...t,thinking:{enabled:!0,budgetTokens:R(g,s,n.thinkingBudgets)}})};function M(e,a,n){let i={};if(e.baseUrl)i.baseUrl=e.baseUrl,i.apiVersion="";let t=qi({...e.headers,...n});if(t)i.headers=t;return new Aa({apiKey:a,httpOptions:Object.keys(i).length>0?i:void 0})}function T(e,a,n={}){let i=ic(e,a),t={};if(n.temperature!==void 0)t.temperature=n.temperature;if(n.maxTokens!==void 0)t.maxOutputTokens=n.maxTokens;let l=a.tools?.length?cc(a.tools,n.toolChoice,lc(e.id)):void 0,s={...Object.keys(t).length>0&&t,...a.systemPrompt&&{systemInstruction:He(a.systemPrompt)},...a.tools&&a.tools.length>0&&{tools:ac(a.tools)},...l!==void 0&&{toolConfig:{functionCallingConfig:{mode:l}}}};if(n.thinking?.enabled&&e.reasoning){let h={includeThoughts:!0};if(n.thinking.level!==void 0)h.thinkingLevel=n.thinking.level;else if(n.thinking.budgetTokens!==void 0)h.thinkingBudget=n.thinking.budgetTokens;s.thinkingConfig=h}else if(e.reasoning&&n.thinking&&!n.thinking.enabled)s.thinkingConfig=v(e);if(n.signal){if(n.signal.aborted)throw Error("Request aborted");s.abortSignal=n.signal}return{model:e.id,contents:i,config:s}}function k(e){return/gemma-?4/.test(e.id.toLowerCase())}function y(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function x(e){let a=e.id.toLowerCase();return/gemini-3(?:\.\d+)?-flash/.test(a)||a==="gemini-flash-latest"||a==="gemini-flash-lite-latest"}function v(e){if(y(e))return{thinkingLevel:"LOW"};if(x(e))return{thinkingLevel:"MINIMAL"};if(k(e))return{thinkingLevel:"MINIMAL"};return{thinkingBudget:0}}function S(e,a){if(y(a))switch(e){case"minimal":case"low":return"LOW";case"medium":case"high":return"HIGH"}if(k(a))switch(e){case"minimal":case"low":return"MINIMAL";case"medium":case"high":return"HIGH"}switch(e){case"minimal":return"MINIMAL";case"low":return"LOW";case"medium":return"MEDIUM";case"high":return"HIGH"}}function R(e,a,n){if(n?.[a]!==void 0)return n[a];if(e.id.includes("2.5-pro"))return{minimal:128,low:2048,medium:8192,high:32768}[a];if(e.id.includes("2.5-flash-lite"))return{minimal:512,low:2048,medium:8192,high:24576}[a];if(e.id.includes("2.5-flash"))return{minimal:128,low:2048,medium:8192,high:24576}[a];return-1}export{m as stream,B as streamSimple};
2
+ import{Aa,lc,_a,cc,uc,dc,fc,pc}from"./chunk-h4ty530v.js";import{kn,Rn}from"./chunk-bs6saf4d.js";import{$e,kr}from"./chunk-jb8vbeb0.js";import{Hi}from"./chunk-3pw7z25v.js";import{vn,Yr}from"./chunk-sd6w0z6a.js";import{Xt}from"./chunk-c6f8x05m.js";var w=0,m=(e,a,n)=>{let i=new Xt;return(async()=>{let t={role:"assistant",content:[],api:"google-generative-ai",provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{let l=n?.apiKey;if(!l)throw Error(`No API key for provider: ${e.provider}`);let s=M(e,l,n?.headers),g=T(e,a,n),h=await n?.onPayload?.(g,e);if(h!==void 0)g=h;let b=await s.models.generateContentStream(g);i.push({type:"start",partial:t});let o=null,C=t.content,u=()=>C.length-1;for await(let c of b){t.responseId||=c.responseId;let p=c.candidates?.[0];if(p?.content?.parts)for(let r of p.content.parts){if(r.text!==void 0){let d=lc(r);if(!o||d&&o.type!=="thinking"||!d&&o.type!=="text"){if(o)if(o.type==="text")i.push({type:"text_end",contentIndex:C.length-1,content:o.text,partial:t});else i.push({type:"thinking_end",contentIndex:u(),content:o.thinking,partial:t});if(d)o={type:"thinking",thinking:"",thinkingSignature:void 0},t.content.push(o),i.push({type:"thinking_start",contentIndex:u(),partial:t});else o={type:"text",text:""},t.content.push(o),i.push({type:"text_start",contentIndex:u(),partial:t})}if(o.type==="thinking")o.thinking+=r.text,o.thinkingSignature=_a(o.thinkingSignature,r.thoughtSignature),i.push({type:"thinking_delta",contentIndex:u(),delta:r.text,partial:t});else o.text+=r.text,o.textSignature=_a(o.textSignature,r.thoughtSignature),i.push({type:"text_delta",contentIndex:u(),delta:r.text,partial:t})}if(r.functionCall){if(o){if(o.type==="text")i.push({type:"text_end",contentIndex:u(),content:o.text,partial:t});else i.push({type:"thinking_end",contentIndex:u(),content:o.thinking,partial:t});o=null}let d=r.functionCall.id,f={type:"toolCall",id:!d||t.content.some((I)=>I.type==="toolCall"&&I.id===d)?`${r.functionCall.name}_${Date.now()}_${++w}`:d,name:r.functionCall.name||"",arguments:r.functionCall.args??{},...r.thoughtSignature&&{thoughtSignature:r.thoughtSignature}};t.content.push(f),i.push({type:"toolcall_start",contentIndex:u(),partial:t}),i.push({type:"toolcall_delta",contentIndex:u(),delta:JSON.stringify(f.arguments),partial:t}),i.push({type:"toolcall_end",contentIndex:u(),toolCall:f,partial:t})}}if(p?.finishReason){if(t.stopReason=pc(p.finishReason),t.content.some((r)=>r.type==="toolCall"))t.stopReason="toolUse"}if(c.usageMetadata)t.usage={input:(c.usageMetadata.promptTokenCount||0)-(c.usageMetadata.cachedContentTokenCount||0),output:(c.usageMetadata.candidatesTokenCount||0)+(c.usageMetadata.thoughtsTokenCount||0),cacheRead:c.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:c.usageMetadata.thoughtsTokenCount||0,totalTokens:c.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},vn(e,t.usage)}if(o)if(o.type==="text")i.push({type:"text_end",contentIndex:u(),content:o.text,partial:t});else i.push({type:"thinking_end",contentIndex:u(),content:o.thinking,partial:t});if(n?.signal?.aborted)throw Error("Request was aborted");if(t.stopReason==="aborted"||t.stopReason==="error")throw Error("An unknown error occurred");i.push({type:"done",reason:t.stopReason,message:t}),i.end()}catch(l){for(let s of t.content)if("index"in s)delete s.index;t.stopReason=n?.signal?.aborted?"aborted":"error",t.errorMessage=Rn(kn(l)),i.push({type:"error",reason:t.stopReason,error:t}),i.end()}})(),i},B=(e,a,n)=>{let i=n?.apiKey;if(!i)throw Error(`No API key for provider: ${e.provider}`);let t=kr(e,a,n,i);if(!n?.reasoning)return m(e,a,{...t,thinking:{enabled:!1}});let l=Yr(e,n.reasoning),s=l==="off"?"high":l,g=e;if(y(g)||x(g)||k(g))return m(e,a,{...t,thinking:{enabled:!0,level:S(s,g)}});return m(e,a,{...t,thinking:{enabled:!0,budgetTokens:R(g,s,n.thinkingBudgets)}})};function M(e,a,n){let i={};if(e.baseUrl)i.baseUrl=e.baseUrl,i.apiVersion="";let t=Hi({...e.headers,...n});if(t)i.headers=t;return new Aa({apiKey:a,httpOptions:Object.keys(i).length>0?i:void 0})}function T(e,a,n={}){let i=cc(e,a),t={};if(n.temperature!==void 0)t.temperature=n.temperature;if(n.maxTokens!==void 0)t.maxOutputTokens=n.maxTokens;let l=a.tools?.length?fc(a.tools,n.toolChoice,dc(e.id)):void 0,s={...Object.keys(t).length>0&&t,...a.systemPrompt&&{systemInstruction:$e(a.systemPrompt)},...a.tools&&a.tools.length>0&&{tools:uc(a.tools)},...l!==void 0&&{toolConfig:{functionCallingConfig:{mode:l}}}};if(n.thinking?.enabled&&e.reasoning){let h={includeThoughts:!0};if(n.thinking.level!==void 0)h.thinkingLevel=n.thinking.level;else if(n.thinking.budgetTokens!==void 0)h.thinkingBudget=n.thinking.budgetTokens;s.thinkingConfig=h}else if(e.reasoning&&n.thinking&&!n.thinking.enabled)s.thinkingConfig=v(e);if(n.signal){if(n.signal.aborted)throw Error("Request aborted");s.abortSignal=n.signal}return{model:e.id,contents:i,config:s}}function k(e){return/gemma-?4/.test(e.id.toLowerCase())}function y(e){return/gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase())}function x(e){let a=e.id.toLowerCase();return/gemini-3(?:\.\d+)?-flash/.test(a)||a==="gemini-flash-latest"||a==="gemini-flash-lite-latest"}function v(e){if(y(e))return{thinkingLevel:"LOW"};if(x(e))return{thinkingLevel:"MINIMAL"};if(k(e))return{thinkingLevel:"MINIMAL"};return{thinkingBudget:0}}function S(e,a){if(y(a))switch(e){case"minimal":case"low":return"LOW";case"medium":case"high":return"HIGH"}if(k(a))switch(e){case"minimal":case"low":return"MINIMAL";case"medium":case"high":return"HIGH"}switch(e){case"minimal":return"MINIMAL";case"low":return"LOW";case"medium":return"MEDIUM";case"high":return"HIGH"}}function R(e,a,n){if(n?.[a]!==void 0)return n[a];if(e.id.includes("2.5-pro"))return{minimal:128,low:2048,medium:8192,high:32768}[a];if(e.id.includes("2.5-flash-lite"))return{minimal:512,low:2048,medium:8192,high:24576}[a];if(e.id.includes("2.5-flash"))return{minimal:128,low:2048,medium:8192,high:24576}[a];return-1}export{m as stream,B as streamSimple};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- var c=(s)=>s;function Ui(s,i,t=c){let n=new Map;for(let e of s.tools??[])n.set(t(e.name),e);if(!i)return{immediate:[...n.values()],deferred:new Map};let a=new Set,f=new Set;for(let e of s.messages)if(e.role==="assistant"){for(let o of e.content)if(o.type==="toolCall")f.add(t(o.name))}else if(e.role==="toolResult")for(let o of e.addedToolNames??[]){let l=t(o);if(!f.has(l))a.add(l)}let d=[],r=new Map;for(let[e,o]of n)if(a.has(e))r.set(e,o);else d.push(o);return{immediate:d,deferred:r}}
3
- export{Ui};
2
+ var c=(s)=>s;function zi(s,i,t=c){let n=new Map;for(let e of s.tools??[])n.set(t(e.name),e);if(!i)return{immediate:[...n.values()],deferred:new Map};let a=new Set,f=new Set;for(let e of s.messages)if(e.role==="assistant"){for(let o of e.content)if(o.type==="toolCall")f.add(t(o.name))}else if(e.role==="toolResult")for(let o of e.addedToolNames??[]){let l=t(o);if(!f.has(l))a.add(l)}let d=[],r=new Map;for(let[e,o]of n)if(a.has(e))r.set(e,o);else d.push(o);return{immediate:d,deferred:r}}
3
+ export{zi};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ function bn(n){let e={};for(let[t,r]of n.entries())e[t]=r;return e}function Hi(n){if(!n)return;let e={};for(let[t,r]of Object.entries(n))if(r!==null)e[t]=r;return Object.keys(e).length>0?e:void 0}
3
+ export{bn,Hi};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Fs,Qo}from"./chunk-w4adkd0a.js";import{Ko}from"./chunk-4bc3gqmn.js";import{Wo,yo,Dt}from"./chunk-3ahax79y.js";import{hn,sr,Ge,en,Xt,vo,qt}from"./chunk-y5h5d5gx.js";var{awsEndpointFunctions:De,emitWarningIfUnsupportedVersion:Ne,createDefaultUserAgentProvider:we,NODE_APP_ID_CONFIG_OPTIONS:$e,getAwsRegionExtensionConfiguration:Ue,resolveAwsRegionExtensionConfiguration:Fe,resolveUserAgentConfig:be,resolveHostHeaderConfig:qe,getUserAgentPlugin:Me,getHostHeaderPlugin:He,getLoggerPlugin:Ve,getRecursionDetectionPlugin:We}=Dt(),{NoAuthSigner:Le,getHttpAuthSchemeEndpointRuleSetPlugin:ze,DefaultIdentityProviderConfig:Be,getHttpSigningPlugin:je}=yo(),{normalizeProvider:se,getSmithyContext:Ke,ServiceException:Xe,NoOpLogger:Qe,emitWarningIfUnsupportedVersion:Ye,loadConfigsForDefaultMode:Je,getDefaultExtensionConfiguration:Ze,resolveDefaultRuntimeConfig:et,Client:ne,makeBuilder:tt,createAggregatedClient:st}=sr(),{Command:nt}=sr();var Us=nt,bs=ne;var{resolveDefaultsModeConfig:ot,loadConfig:E,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:rt,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:it,NODE_REGION_CONFIG_OPTIONS:at,NODE_REGION_CONFIG_FILE_OPTIONS:ct,resolveRegionConfig:ut}=Ge(),{BinaryDecisionDiagram:pt,EndpointCache:dt,decideEndpoint:ht,customEndpointFunctions:gt,resolveEndpointConfig:lt,getEndpointPlugin:Et}=en(),{parseUrl:mt,getHttpHandlerExtensionConfiguration:At,resolveHttpHandlerRuntimeConfig:_t,getContentLengthPlugin:Ot}=qt(),{DEFAULT_RETRY_MODE:St,NODE_RETRY_MODE_CONFIG_OPTIONS:It,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:Ct,resolveRetryConfig:Rt,getRetryPlugin:vt}=Wo(),{TypeRegistry:oe,getSchemaSerdePlugin:ft}=hn(),{resolveAwsSdkSigV4Config:Pt,AwsSdkSigV4Signer:Tt,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:kt}=Qo(),{toUtf8:xt,fromUtf8:yt,toBase64:Nt,fromBase64:wt,calculateBodyLength:$t}=Xt(),{streamCollector:Ut,NodeHttpHandler:Ft}=Ko(),{AwsRestJsonProtocol:bt}=Fs(),{Sha256:Mt}=vo(),Ht=async(e,s,n)=>({operation:Ke(s).operation,region:await se(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function Vt(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"signin",region:e.region},propertiesExtractor:(s,n)=>({signingProperties:{config:s,context:n}})}}function Wt(e){return{schemeId:"smithy.api#noAuth"}}var Lt=(e)=>{let s=[];switch(e.operation){case"CreateOAuth2Token":{s.push(Wt());break}default:s.push(Vt(e))}return s},zt=(e)=>{let s=Pt(e);return Object.assign(s,{authSchemePreference:se(e.authSchemePreference??[])})},Bt=(e)=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"signin"}),jt={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},Gt="3.997.43",Kt={version:Gt},h="ref",p=-1,V=!1,m=!0,W="isSet",A="booleanEquals",L="coalesce",w="PartitionResult",u="stringEquals",k="getAttr",z="https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}",B={[h]:"Endpoint"},d={fn:k,argv:[{[h]:w},"name"]},re={[h]:"Region"},j={[h]:w},S={authSchemes:[{name:"sigv4",signingName:"signin",signingRegion:"{Region}"}]},r={},G=[re],K={conditions:[[W,G],[A,[{fn:L,argv:[{[h]:"IsControlPlane"},V]},m]],[W,[B]],["aws.partition",G,w],[A,[{[h]:"UseFIPS"},m]],[u,[d,"aws"]],[A,[{fn:L,argv:[{[h]:"IsOAuthEndpoint"},V]},m]],[A,[{[h]:"UseDualStack"},m]],[u,[d,"aws-cn"]],[u,[re,"us-gov-west-1"]],[u,[d,"aws-us-gov"]],[A,[{fn:k,argv:[j,"supportsFIPS"]},m]],[u,[d,"aws-iso"]],[u,[d,"aws-iso-b"]],[u,[d,"aws-iso-f"]],[u,[d,"aws-iso-e"]],[u,[d,"aws-eusc"]],[A,[{fn:k,argv:[j,"supportsDualStack"]},m]]],results:[[p],["https://signin.{Region}.api.aws",S],["https://signin.{Region}.api.amazonwebservices.com.cn",S],[z,S],[p,"FIPS endpoints are not supported for OAuth operations. Disable FIPS or use a non-OAuth operation."],["https://{Region}.oauth.signin.aws",S],["https://{Region}.signin.aws.amazon.com",r],["https://{Region}.signin.amazonaws.cn",r],["https://{Region}.signin.amazonaws-us-gov.com",r],["https://{Region}.signin.c2shome.ic.gov",r],["https://{Region}.signin.sc2shome.sgov.gov",r],["https://{Region}.signin.csphome.hci.ic.gov",r],["https://{Region}.signin.csphome.adc-e.uk",r],["https://{Region}.signin.amazonaws-eusc.eu",r],["https://signin-fips.amazonaws-us-gov.com",r],["https://{Region}.signin-fips.amazonaws-us-gov.com",r],["https://{Region}.signin.{PartitionResult#dnsSuffix}",r],[p,"Invalid Configuration: FIPS and custom endpoint are not supported"],[p,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[B,r],["https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",r],[p,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://signin-fips.{Region}.{PartitionResult#dnsSuffix}",r],[p,"FIPS is enabled but this partition does not support FIPS"],[z,r],[p,"DualStack is enabled but this partition does not support DualStack"],["https://signin.{Region}.{PartitionResult#dnsSuffix}",r],[p,"Invalid Configuration: Missing Region"]]},Qt=2,t=1e8,Yt=new Int32Array([-1,1,-1,0,6,3,2,36,4,4,5,t+27,6,t+4,t+27,1,29,7,2,36,8,3,9,31,4,22,10,5,19,11,7,21,12,8,t+7,13,10,t+8,14,12,t+9,15,13,t+10,16,14,t+11,17,15,t+12,18,16,t+13,t+16,6,t+5,20,7,21,t+6,17,t+24,t+25,6,t+4,23,7,27,24,9,t+14,25,10,t+15,26,11,t+22,t+23,11,28,t+21,17,t+20,t+21,2,35,30,3,39,31,4,32,t+27,6,t+4,33,7,t+27,34,9,t+14,t+27,3,39,36,4,38,37,7,t+18,t+19,6,t+4,t+17,5,t+1,40,8,t+2,t+3]),Jt=pt.from(Yt,Qt,K.conditions,K.results),Zt=new dt({size:50,params:["Endpoint","IsControlPlane","IsOAuthEndpoint","Region","UseDualStack","UseFIPS"]}),es=(e,s={})=>Zt.get(e,()=>ht(Jt,{endpointParams:e,logger:s.logger}));gt.aws=De;class l extends Xe{constructor(e){super(e);Object.setPrototypeOf(this,l.prototype)}}class C extends l{name="AccessDeniedException";$fault="client";error;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});Object.setPrototypeOf(this,C.prototype),this.error=e.error}}class R extends l{name="InternalServerException";$fault="server";error;constructor(e){super({name:"InternalServerException",$fault:"server",...e});Object.setPrototypeOf(this,R.prototype),this.error=e.error}}class v extends l{name="TooManyRequestsError";$fault="client";error;constructor(e){super({name:"TooManyRequestsError",$fault:"client",...e});Object.setPrototypeOf(this,v.prototype),this.error=e.error}}class f extends l{name="ValidationException";$fault="client";error;constructor(e){super({name:"ValidationException",$fault:"client",...e});Object.setPrototypeOf(this,f.prototype),this.error=e.error}}var ts="AccessDeniedException",ss="AccessToken",ns="CreateOAuth2Token",os="CreateOAuth2TokenRequest",rs="CreateOAuth2TokenRequestBody",is="CreateOAuth2TokenResponseBody",as="CreateOAuth2TokenResponse",cs="CreateOAuth2TokenWithIAM",us="CreateOAuth2TokenWithIAMRequest",ps="CreateOAuth2TokenWithIAMResponse",ds="InternalServerException",hs="OAuthAccessToken",gs="RefreshToken",ls="TooManyRequestsError",Es="ValidationException",X="accessKeyId",x="accessToken",ms="access_token",U="client",Q="clientId",Y="codeVerifier",As="code",g="error",y="expiresIn",_s="expires_in",D="grantType",Os="grant_type",ie="http",F="httpError",J="idToken",o="jsonName",P="message",Ss="resource",I="refreshToken",Z="redirectUri",ae="smithy.ts.sdk.synthetic.com.amazonaws.signin",ee="secretAccessKey",te="sessionToken",Is="server",Cs="tokenInput",Rs="tokenOutput",N="tokenType",vs="token_type",i="com.amazonaws.signin",ce=oe.for(ae),ue=[-3,ae,"SigninServiceException",0,[],[]];ce.registerError(ue,l);var _=oe.for(i),pe=[-3,i,ts,{[g]:U},[g,P],[0,0],2];_.registerError(pe,C);var de=[-3,i,ds,{[g]:Is,[F]:500},[g,P],[0,0],2];_.registerError(de,R);var he=[-3,i,ls,{[g]:U,[F]:429},[g,P],[0,0],2];_.registerError(he,v);var ge=[-3,i,Es,{[g]:U,[F]:400},[g,P],[0,0],2];_.registerError(ge,f);var le=[ce,_],fs=[0,i,hs,8,0],Ee=[0,i,gs,8,0],me=[3,i,ss,8,[X,ee,te],[[0,{[o]:X}],[0,{[o]:ee}],[0,{[o]:te}]],3],Ae=[3,i,os,0,[Cs],[[()=>_e,16]],1],_e=[3,i,rs,0,[Q,D,As,Z,Y,I],[[0,{[o]:Q}],[0,{[o]:D}],0,[0,{[o]:Z}],[0,{[o]:Y}],[()=>Ee,{[o]:I}]],2],Oe=[3,i,as,0,[Rs],[[()=>Se,16]],1],Se=[3,i,is,0,[x,N,y,I,J],[[()=>me,{[o]:x}],[0,{[o]:N}],[1,{[o]:y}],[()=>Ee,{[o]:I}],[0,{[o]:J}]],4],Ie=[3,i,us,0,[D,Ss],[[0,{[o]:Os}],0],2],Ce=[3,i,ps,0,[x,N,y],[[()=>fs,{[o]:ms}],[0,{[o]:vs}],[1,{[o]:_s}]],3],Re=[9,i,ns,{[ie]:["POST","/v1/token",200]},()=>Ae,()=>Oe],ve=[9,i,cs,{[ie]:["POST","/v1/token?x-amz-client-auth-method=iam",200]},()=>Ie,()=>Ce],Ps=(e)=>({apiVersion:"2023-01-01",base64Decoder:e?.base64Decoder??wt,base64Encoder:e?.base64Encoder??Nt,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??es,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Lt,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new Tt},{schemeId:"smithy.api#noAuth",identityProvider:(s)=>s.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Le}],logger:e?.logger??new Qe,protocol:e?.protocol??bt,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.signin",errorTypeRegistries:le,version:"2023-01-01",serviceTarget:"Signin"},serviceId:e?.serviceId??"Signin",sha256:e?.sha256??Mt,urlParser:e?.urlParser??mt,utf8Decoder:e?.utf8Decoder??yt,utf8Encoder:e?.utf8Encoder??xt}),Ts=(e)=>{Ye(process.version);let s=ot(e),n=()=>s().then(Je),c=Ps(e);Ne(process.version);let a={profile:e?.profile,logger:c.logger};return{...c,...e,runtime:"node",defaultsMode:s,authSchemePreference:e?.authSchemePreference??E(kt,a),bodyLengthChecker:e?.bodyLengthChecker??$t,defaultUserAgentProvider:e?.defaultUserAgentProvider??we({serviceId:c.serviceId,clientVersion:Kt.version}),maxAttempts:e?.maxAttempts??E(Ct,e),region:e?.region??E(at,{...ct,...a}),requestHandler:Ft.create(e?.requestHandler??n),retryMode:e?.retryMode??E({...It,default:async()=>(await n()).retryMode||St},e),streamCollector:e?.streamCollector??Ut,useDualstackEndpoint:e?.useDualstackEndpoint??E(it,a),useFipsEndpoint:e?.useFipsEndpoint??E(rt,a),userAgentAppId:e?.userAgentAppId??E($e,a)}},ks=(e)=>{let{httpAuthSchemes:s,httpAuthSchemeProvider:n,credentials:c}=e;return{setHttpAuthScheme(a){let O=s.findIndex((T)=>T.schemeId===a.schemeId);if(O===-1)s.push(a);else s.splice(O,1,a)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(a){n=a},httpAuthSchemeProvider(){return n},setCredentials(a){c=a},credentials(){return c}}},xs=(e)=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),ys=(e,s)=>{let n=Object.assign(Ue(e),Ze(e),At(e),ks(e));return s.forEach((c)=>c.configure(n)),Object.assign(e,Fe(n),et(n),_t(n),xs(n))};class b extends ne{config;constructor(...[e]){let s=Ts(e||{});super(s);this.initConfig=s;let n=Bt(s),c=be(n),a=Rt(c),O=ut(a),T=qe(O),Te=lt(T),ke=zt(Te),xe=ys(ke,e?.extensions||[]);this.config=xe,this.middlewareStack.use(ft(this.config)),this.middlewareStack.use(Me(this.config)),this.middlewareStack.use(vt(this.config)),this.middlewareStack.use(Ot(this.config)),this.middlewareStack.use(He(this.config)),this.middlewareStack.use(Ve(this.config)),this.middlewareStack.use(We(this.config)),this.middlewareStack.use(ze(this.config,{httpAuthSchemeParametersProvider:Ht,identityProviderConfigProvider:async(ye)=>new Be({"aws.auth#sigv4":ye.credentials})})),this.middlewareStack.use(je(this.config))}destroy(){super.destroy()}}var fe=tt(jt,"Signin","SigninClient",Et),Ds={IsControlPlane:{type:"staticContextParams",value:!1}},Ns={IsOAuthEndpoint:{type:"staticContextParams",value:!0}},Pe=(e,s,n,c)=>[];class q extends fe(Ds,Pe,"CreateOAuth2Token",Re){}class M extends fe(Ns,Pe,"CreateOAuth2TokenWithIAM",ve){}var ws={CreateOAuth2TokenCommand:q,CreateOAuth2TokenWithIAMCommand:M};class H extends b{}st(ws,H);var $s={AUTHCODE_EXPIRED:"AUTHCODE_EXPIRED",CONFLICT:"CONFLICT",INSUFFICIENT_PERMISSIONS:"INSUFFICIENT_PERMISSIONS",INVALID_REQUEST:"INVALID_REQUEST",RESOURCE_NOT_FOUND:"RESOURCE_NOT_FOUND",SERVER_ERROR:"server_error",SERVICE_QUOTA_EXCEEDED:"SERVICE_QUOTA_EXCEEDED",TOKEN_EXPIRED:"TOKEN_EXPIRED",USER_CREDENTIALS_CHANGED:"USER_CREDENTIALS_CHANGED"};var qs=C,Ms=pe,Hs=me,Vs=Re,Ws=q,Ls=Ae,zs=_e,Bs=Oe,js=Se,Gs=ve,Ks=M,Xs=Ie,Qs=Ce,Ys=R,Js=de,Zs=$s,tn=H,sn=b,nn=l,on=ue,rn=v,an=he,cn=f,un=ge,pn=le;export{Us as $Command,bs as __Client,qs as AccessDeniedException,Ms as AccessDeniedException$,Hs as AccessToken$,Vs as CreateOAuth2Token$,Ws as CreateOAuth2TokenCommand,Ls as CreateOAuth2TokenRequest$,zs as CreateOAuth2TokenRequestBody$,Bs as CreateOAuth2TokenResponse$,js as CreateOAuth2TokenResponseBody$,Gs as CreateOAuth2TokenWithIAM$,Ks as CreateOAuth2TokenWithIAMCommand,Xs as CreateOAuth2TokenWithIAMRequest$,Qs as CreateOAuth2TokenWithIAMResponse$,Ys as InternalServerException,Js as InternalServerException$,Zs as OAuth2ErrorCode,tn as Signin,sn as SigninClient,nn as SigninServiceException,on as SigninServiceException$,rn as TooManyRequestsError,an as TooManyRequestsError$,cn as ValidationException,un as ValidationException$,pn as errorTypeRegistries};
2
+ import{Ls,Qo}from"./chunk-n412a1hp.js";import{Ko}from"./chunk-hc0xbmtt.js";import{Wo,vo,Ot}from"./chunk-k9q4nn8b.js";import{wn,sr,Ge,nn,er,xo,Ht}from"./chunk-6mrgtn78.js";var{awsEndpointFunctions:De,emitWarningIfUnsupportedVersion:Ne,createDefaultUserAgentProvider:we,NODE_APP_ID_CONFIG_OPTIONS:$e,getAwsRegionExtensionConfiguration:Ue,resolveAwsRegionExtensionConfiguration:Fe,resolveUserAgentConfig:be,resolveHostHeaderConfig:qe,getUserAgentPlugin:Me,getHostHeaderPlugin:He,getLoggerPlugin:Ve,getRecursionDetectionPlugin:We}=Ot(),{NoAuthSigner:Le,getHttpAuthSchemeEndpointRuleSetPlugin:ze,DefaultIdentityProviderConfig:Be,getHttpSigningPlugin:je}=vo(),{normalizeProvider:se,getSmithyContext:Ke,ServiceException:Xe,NoOpLogger:Qe,emitWarningIfUnsupportedVersion:Ye,loadConfigsForDefaultMode:Je,getDefaultExtensionConfiguration:Ze,resolveDefaultRuntimeConfig:et,Client:ne,makeBuilder:tt,createAggregatedClient:st}=sr(),{Command:nt}=sr();var $s=nt,Us=ne;var{resolveDefaultsModeConfig:ot,loadConfig:E,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:rt,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:it,NODE_REGION_CONFIG_OPTIONS:at,NODE_REGION_CONFIG_FILE_OPTIONS:ct,resolveRegionConfig:ut}=Ge(),{BinaryDecisionDiagram:pt,EndpointCache:dt,decideEndpoint:ht,customEndpointFunctions:gt,resolveEndpointConfig:lt,getEndpointPlugin:Et}=nn(),{parseUrl:mt,getHttpHandlerExtensionConfiguration:At,resolveHttpHandlerRuntimeConfig:_t,getContentLengthPlugin:St}=Ht(),{DEFAULT_RETRY_MODE:It,NODE_RETRY_MODE_CONFIG_OPTIONS:Ct,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:Rt,resolveRetryConfig:vt,getRetryPlugin:ft}=Wo(),{TypeRegistry:oe,getSchemaSerdePlugin:Pt}=wn(),{resolveAwsSdkSigV4Config:Tt,AwsSdkSigV4Signer:kt,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:xt}=Qo(),{toUtf8:yt,fromUtf8:Dt,toBase64:Nt,fromBase64:wt,calculateBodyLength:$t}=er(),{streamCollector:Ut,NodeHttpHandler:Ft}=Ko(),{AwsRestJsonProtocol:bt}=Ls(),{Sha256:qt}=xo(),Mt=async(e,s,n)=>({operation:Ke(s).operation,region:await se(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function Vt(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"signin",region:e.region},propertiesExtractor:(s,n)=>({signingProperties:{config:s,context:n}})}}function Wt(e){return{schemeId:"smithy.api#noAuth"}}var Lt=(e)=>{let s=[];switch(e.operation){case"CreateOAuth2Token":{s.push(Wt());break}default:s.push(Vt(e))}return s},zt=(e)=>{let s=Tt(e);return Object.assign(s,{authSchemePreference:se(e.authSchemePreference??[])})},Bt=(e)=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"signin"}),jt={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},Gt="3.997.43",Kt={version:Gt},h="ref",p=-1,V=!1,m=!0,W="isSet",A="booleanEquals",L="coalesce",w="PartitionResult",u="stringEquals",k="getAttr",z="https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}",B={[h]:"Endpoint"},d={fn:k,argv:[{[h]:w},"name"]},re={[h]:"Region"},j={[h]:w},S={authSchemes:[{name:"sigv4",signingName:"signin",signingRegion:"{Region}"}]},r={},G=[re],K={conditions:[[W,G],[A,[{fn:L,argv:[{[h]:"IsControlPlane"},V]},m]],[W,[B]],["aws.partition",G,w],[A,[{[h]:"UseFIPS"},m]],[u,[d,"aws"]],[A,[{fn:L,argv:[{[h]:"IsOAuthEndpoint"},V]},m]],[A,[{[h]:"UseDualStack"},m]],[u,[d,"aws-cn"]],[u,[re,"us-gov-west-1"]],[u,[d,"aws-us-gov"]],[A,[{fn:k,argv:[j,"supportsFIPS"]},m]],[u,[d,"aws-iso"]],[u,[d,"aws-iso-b"]],[u,[d,"aws-iso-f"]],[u,[d,"aws-iso-e"]],[u,[d,"aws-eusc"]],[A,[{fn:k,argv:[j,"supportsDualStack"]},m]]],results:[[p],["https://signin.{Region}.api.aws",S],["https://signin.{Region}.api.amazonwebservices.com.cn",S],[z,S],[p,"FIPS endpoints are not supported for OAuth operations. Disable FIPS or use a non-OAuth operation."],["https://{Region}.oauth.signin.aws",S],["https://{Region}.signin.aws.amazon.com",r],["https://{Region}.signin.amazonaws.cn",r],["https://{Region}.signin.amazonaws-us-gov.com",r],["https://{Region}.signin.c2shome.ic.gov",r],["https://{Region}.signin.sc2shome.sgov.gov",r],["https://{Region}.signin.csphome.hci.ic.gov",r],["https://{Region}.signin.csphome.adc-e.uk",r],["https://{Region}.signin.amazonaws-eusc.eu",r],["https://signin-fips.amazonaws-us-gov.com",r],["https://{Region}.signin-fips.amazonaws-us-gov.com",r],["https://{Region}.signin.{PartitionResult#dnsSuffix}",r],[p,"Invalid Configuration: FIPS and custom endpoint are not supported"],[p,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[B,r],["https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",r],[p,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://signin-fips.{Region}.{PartitionResult#dnsSuffix}",r],[p,"FIPS is enabled but this partition does not support FIPS"],[z,r],[p,"DualStack is enabled but this partition does not support DualStack"],["https://signin.{Region}.{PartitionResult#dnsSuffix}",r],[p,"Invalid Configuration: Missing Region"]]},Xt=2,t=1e8,Qt=new Int32Array([-1,1,-1,0,6,3,2,36,4,4,5,t+27,6,t+4,t+27,1,29,7,2,36,8,3,9,31,4,22,10,5,19,11,7,21,12,8,t+7,13,10,t+8,14,12,t+9,15,13,t+10,16,14,t+11,17,15,t+12,18,16,t+13,t+16,6,t+5,20,7,21,t+6,17,t+24,t+25,6,t+4,23,7,27,24,9,t+14,25,10,t+15,26,11,t+22,t+23,11,28,t+21,17,t+20,t+21,2,35,30,3,39,31,4,32,t+27,6,t+4,33,7,t+27,34,9,t+14,t+27,3,39,36,4,38,37,7,t+18,t+19,6,t+4,t+17,5,t+1,40,8,t+2,t+3]),Yt=pt.from(Qt,Xt,K.conditions,K.results),Jt=new dt({size:50,params:["Endpoint","IsControlPlane","IsOAuthEndpoint","Region","UseDualStack","UseFIPS"]}),Zt=(e,s={})=>Jt.get(e,()=>ht(Yt,{endpointParams:e,logger:s.logger}));gt.aws=De;class l extends Xe{constructor(e){super(e);Object.setPrototypeOf(this,l.prototype)}}class C extends l{name="AccessDeniedException";$fault="client";error;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});Object.setPrototypeOf(this,C.prototype),this.error=e.error}}class R extends l{name="InternalServerException";$fault="server";error;constructor(e){super({name:"InternalServerException",$fault:"server",...e});Object.setPrototypeOf(this,R.prototype),this.error=e.error}}class v extends l{name="TooManyRequestsError";$fault="client";error;constructor(e){super({name:"TooManyRequestsError",$fault:"client",...e});Object.setPrototypeOf(this,v.prototype),this.error=e.error}}class f extends l{name="ValidationException";$fault="client";error;constructor(e){super({name:"ValidationException",$fault:"client",...e});Object.setPrototypeOf(this,f.prototype),this.error=e.error}}var es="AccessDeniedException",ts="AccessToken",ss="CreateOAuth2Token",ns="CreateOAuth2TokenRequest",os="CreateOAuth2TokenRequestBody",rs="CreateOAuth2TokenResponseBody",is="CreateOAuth2TokenResponse",as="CreateOAuth2TokenWithIAM",cs="CreateOAuth2TokenWithIAMRequest",us="CreateOAuth2TokenWithIAMResponse",ps="InternalServerException",ds="OAuthAccessToken",hs="RefreshToken",gs="TooManyRequestsError",ls="ValidationException",X="accessKeyId",x="accessToken",Es="access_token",U="client",Q="clientId",Y="codeVerifier",ms="code",g="error",y="expiresIn",As="expires_in",D="grantType",_s="grant_type",ie="http",F="httpError",J="idToken",o="jsonName",P="message",Os="resource",I="refreshToken",Z="redirectUri",ae="smithy.ts.sdk.synthetic.com.amazonaws.signin",ee="secretAccessKey",te="sessionToken",Ss="server",Is="tokenInput",Cs="tokenOutput",N="tokenType",Rs="token_type",i="com.amazonaws.signin",ce=oe.for(ae),ue=[-3,ae,"SigninServiceException",0,[],[]];ce.registerError(ue,l);var _=oe.for(i),pe=[-3,i,es,{[g]:U},[g,P],[0,0],2];_.registerError(pe,C);var de=[-3,i,ps,{[g]:Ss,[F]:500},[g,P],[0,0],2];_.registerError(de,R);var he=[-3,i,gs,{[g]:U,[F]:429},[g,P],[0,0],2];_.registerError(he,v);var ge=[-3,i,ls,{[g]:U,[F]:400},[g,P],[0,0],2];_.registerError(ge,f);var le=[ce,_],vs=[0,i,ds,8,0],Ee=[0,i,hs,8,0],me=[3,i,ts,8,[X,ee,te],[[0,{[o]:X}],[0,{[o]:ee}],[0,{[o]:te}]],3],Ae=[3,i,ns,0,[Is],[[()=>_e,16]],1],_e=[3,i,os,0,[Q,D,ms,Z,Y,I],[[0,{[o]:Q}],[0,{[o]:D}],0,[0,{[o]:Z}],[0,{[o]:Y}],[()=>Ee,{[o]:I}]],2],Oe=[3,i,is,0,[Cs],[[()=>Se,16]],1],Se=[3,i,rs,0,[x,N,y,I,J],[[()=>me,{[o]:x}],[0,{[o]:N}],[1,{[o]:y}],[()=>Ee,{[o]:I}],[0,{[o]:J}]],4],Ie=[3,i,cs,0,[D,Os],[[0,{[o]:_s}],0],2],Ce=[3,i,us,0,[x,N,y],[[()=>vs,{[o]:Es}],[0,{[o]:Rs}],[1,{[o]:As}]],3],Re=[9,i,ss,{[ie]:["POST","/v1/token",200]},()=>Ae,()=>Oe],ve=[9,i,as,{[ie]:["POST","/v1/token?x-amz-client-auth-method=iam",200]},()=>Ie,()=>Ce],fs=(e)=>({apiVersion:"2023-01-01",base64Decoder:e?.base64Decoder??wt,base64Encoder:e?.base64Encoder??Nt,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Zt,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Lt,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new kt},{schemeId:"smithy.api#noAuth",identityProvider:(s)=>s.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Le}],logger:e?.logger??new Qe,protocol:e?.protocol??bt,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.signin",errorTypeRegistries:le,version:"2023-01-01",serviceTarget:"Signin"},serviceId:e?.serviceId??"Signin",sha256:e?.sha256??qt,urlParser:e?.urlParser??mt,utf8Decoder:e?.utf8Decoder??Dt,utf8Encoder:e?.utf8Encoder??yt}),Ps=(e)=>{Ye(process.version);let s=ot(e),n=()=>s().then(Je),c=fs(e);Ne(process.version);let a={profile:e?.profile,logger:c.logger};return{...c,...e,runtime:"node",defaultsMode:s,authSchemePreference:e?.authSchemePreference??E(xt,a),bodyLengthChecker:e?.bodyLengthChecker??$t,defaultUserAgentProvider:e?.defaultUserAgentProvider??we({serviceId:c.serviceId,clientVersion:Kt.version}),maxAttempts:e?.maxAttempts??E(Rt,e),region:e?.region??E(at,{...ct,...a}),requestHandler:Ft.create(e?.requestHandler??n),retryMode:e?.retryMode??E({...Ct,default:async()=>(await n()).retryMode||It},e),streamCollector:e?.streamCollector??Ut,useDualstackEndpoint:e?.useDualstackEndpoint??E(it,a),useFipsEndpoint:e?.useFipsEndpoint??E(rt,a),userAgentAppId:e?.userAgentAppId??E($e,a)}},Ts=(e)=>{let{httpAuthSchemes:s,httpAuthSchemeProvider:n,credentials:c}=e;return{setHttpAuthScheme(a){let O=s.findIndex((T)=>T.schemeId===a.schemeId);if(O===-1)s.push(a);else s.splice(O,1,a)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(a){n=a},httpAuthSchemeProvider(){return n},setCredentials(a){c=a},credentials(){return c}}},ks=(e)=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),xs=(e,s)=>{let n=Object.assign(Ue(e),Ze(e),At(e),Ts(e));return s.forEach((c)=>c.configure(n)),Object.assign(e,Fe(n),et(n),_t(n),ks(n))};class b extends ne{config;constructor(...[e]){let s=Ps(e||{});super(s);this.initConfig=s;let n=Bt(s),c=be(n),a=vt(c),O=ut(a),T=qe(O),Te=lt(T),ke=zt(Te),xe=xs(ke,e?.extensions||[]);this.config=xe,this.middlewareStack.use(Pt(this.config)),this.middlewareStack.use(Me(this.config)),this.middlewareStack.use(ft(this.config)),this.middlewareStack.use(St(this.config)),this.middlewareStack.use(He(this.config)),this.middlewareStack.use(Ve(this.config)),this.middlewareStack.use(We(this.config)),this.middlewareStack.use(ze(this.config,{httpAuthSchemeParametersProvider:Mt,identityProviderConfigProvider:async(ye)=>new Be({"aws.auth#sigv4":ye.credentials})})),this.middlewareStack.use(je(this.config))}destroy(){super.destroy()}}var fe=tt(jt,"Signin","SigninClient",Et),ys={IsControlPlane:{type:"staticContextParams",value:!1}},Ds={IsOAuthEndpoint:{type:"staticContextParams",value:!0}},Pe=(e,s,n,c)=>[];class q extends fe(ys,Pe,"CreateOAuth2Token",Re){}class M extends fe(Ds,Pe,"CreateOAuth2TokenWithIAM",ve){}var Ns={CreateOAuth2TokenCommand:q,CreateOAuth2TokenWithIAMCommand:M};class H extends b{}st(Ns,H);var ws={AUTHCODE_EXPIRED:"AUTHCODE_EXPIRED",CONFLICT:"CONFLICT",INSUFFICIENT_PERMISSIONS:"INSUFFICIENT_PERMISSIONS",INVALID_REQUEST:"INVALID_REQUEST",RESOURCE_NOT_FOUND:"RESOURCE_NOT_FOUND",SERVER_ERROR:"server_error",SERVICE_QUOTA_EXCEEDED:"SERVICE_QUOTA_EXCEEDED",TOKEN_EXPIRED:"TOKEN_EXPIRED",USER_CREDENTIALS_CHANGED:"USER_CREDENTIALS_CHANGED"};var Fs=C,bs=pe,qs=me,Ms=Re,Hs=q,Vs=Ae,Ws=_e,zs=Oe,Bs=Se,js=ve,Gs=M,Ks=Ie,Xs=Ce,Qs=R,Ys=de,Js=ws,Zs=H,en=b,tn=l,sn=ue,on=v,rn=he,an=f,cn=ge,un=le;export{$s as $Command,Us as __Client,Fs as AccessDeniedException,bs as AccessDeniedException$,qs as AccessToken$,Ms as CreateOAuth2Token$,Hs as CreateOAuth2TokenCommand,Vs as CreateOAuth2TokenRequest$,Ws as CreateOAuth2TokenRequestBody$,zs as CreateOAuth2TokenResponse$,Bs as CreateOAuth2TokenResponseBody$,js as CreateOAuth2TokenWithIAM$,Gs as CreateOAuth2TokenWithIAMCommand,Ks as CreateOAuth2TokenWithIAMRequest$,Xs as CreateOAuth2TokenWithIAMResponse$,Qs as InternalServerException,Ys as InternalServerException$,Js as OAuth2ErrorCode,Zs as Signin,en as SigninClient,tn as SigninServiceException,sn as SigninServiceException$,on as TooManyRequestsError,rn as TooManyRequestsError$,an as ValidationException,cn as ValidationException$,un as errorTypeRegistries};
@@ -0,0 +1 @@
1
+ import{m,E,t,Z,ze,g,gt,Tt,Am}from"./chunk-p1d500sf.js";import"./chunk-7rycq6wb.js";import"./chunk-sdp9w627.js";import"./chunk-c8kjpmfe.js";import"./chunk-qt78vs3g.js";import"./chunk-cxet91kt.js";import"./chunk-xgnvktq6.js";import"./chunk-keetdtxb.js";import"./chunk-j9t7tvt5.js";import"./chunk-sbg86tch.js";import"./chunk-k7sjpke6.js";import"./chunk-fkn6f4qt.js";import"./chunk-6vkfzzvt.js";import"./chunk-5aqthcm6.js";import{Yn}from"./chunk-h3cwf9aw.js";import{tr}from"./chunk-qd7pvaxb.js";import"./chunk-ahgq10a7.js";import"./chunk-1vt9ss7d.js";import"./chunk-agcnbjxk.js";import"./chunk-zxqasmvz.js";import"./chunk-ts4d1mxf.js";import"./chunk-xsfy8hz3.js";import"./chunk-1eqw2dpx.js";import"./chunk-b7qs7hxg.js";import"./chunk-ht5rht98.js";E();function s(){let{projectId:o}=c.useParams(),{teamId:r,ensureTeamIdForProject:n}=gt();m(()=>{n(o)},[o,n]);let{data:d}=tr(Am(o)),e=d?.rootFolder,{data:a}=Z({queryKey:["folders",e],queryFn:()=>(async()=>await(await g.api.folders[":folderId"].$get({param:{folderId:e}})).json())(),enabled:!!e});if(!r||!e||!a)return t(Tt,{});return t(Yn,{teamId:r,projectId:o,projectName:d.name??"",assetId:"recently-deleted",rootFolderId:e})}var c=ze("/projects/$projectId/recently-deleted")({component:s});export{c as Route};
@@ -0,0 +1 @@
1
+ import{t,ze}from"./chunk-p1d500sf.js";import"./chunk-sdp9w627.js";import"./chunk-c8kjpmfe.js";import"./chunk-qt78vs3g.js";import"./chunk-7rycq6wb.js";import"./chunk-cxet91kt.js";import"./chunk-sbg86tch.js";import"./chunk-k7sjpke6.js";import"./chunk-fkn6f4qt.js";import"./chunk-6vkfzzvt.js";import"./chunk-xgnvktq6.js";import"./chunk-f0b4a9y3.js";import"./chunk-5aqthcm6.js";import{Ti}from"./chunk-8r3k84dh.js";import"./chunk-ahgq10a7.js";import"./chunk-1vt9ss7d.js";import"./chunk-zxqasmvz.js";import"./chunk-ts4d1mxf.js";import"./chunk-xsfy8hz3.js";import"./chunk-1eqw2dpx.js";import"./chunk-b7qs7hxg.js";import"./chunk-ht5rht98.js";function r(){let{shareId:e}=a.useParams();return t(Ti,{shareId:e})}var a=ze("/share/$shareId/")({component:r});export{a as Route};
@@ -1,5 +1,5 @@
1
- import{m,_,u,S,t,o}from"./chunk-qx553512.js";S();var Ir=({onResize:n,className:i=""})=>{let[s,a]=u(!1),r=_(0);m(()=>{if(!s)return;let e=(c)=>{let v=c.clientX-r.current;r.current=c.clientX,n(v)},l=()=>{a(!1),document.body.style.cursor=""};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",l),document.body.style.cursor="col-resize",()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",l),document.body.style.cursor=""}},[s,n]);let d=(e)=>{e.preventDefault(),e.stopPropagation(),a(!0),r.current=e.clientX},p=()=>t("div",{className:"absolute inset-y-0 -left-4 -right-4 z-20 cursor-col-resize touch-none"});return o("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 ${i}`,onMouseDown:d,children:[t(p,{}),t("div",{className:`absolute inset-y-0 w-[2px] transition-all duration-300 ease-out
1
+ import{m,_,u,E,t,o}from"./chunk-p1d500sf.js";E();var Mr=({onResize:n,className:i=""})=>{let[s,a]=u(!1),r=_(0);m(()=>{if(!s)return;let e=(c)=>{let v=c.clientX-r.current;r.current=c.clientX,n(v)},l=()=>{a(!1),document.body.style.cursor=""};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",l),document.body.style.cursor="col-resize",()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",l),document.body.style.cursor=""}},[s,n]);let d=(e)=>{e.preventDefault(),e.stopPropagation(),a(!0),r.current=e.clientX},p=()=>t("div",{className:"absolute inset-y-0 -left-4 -right-4 z-20 cursor-col-resize touch-none"});return o("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 ${i}`,onMouseDown:d,children:[t(p,{}),t("div",{className:`absolute inset-y-0 w-[2px] transition-all duration-300 ease-out
2
2
  ${s?"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
  `}),t("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
  ${s?"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{Ir};
5
+ export{Mr};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Dt}from"./chunk-3ahax79y.js";import{Ge}from"./chunk-y5h5d5gx.js";import{H}from"./chunk-a8bymrv1.js";var a=H(Dt()),t=H(Ge());import{readFileSync as p}from"fs";var c=(e)=>async(s)=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");let{roleArn:o,roleSessionName:r,webIdentityToken:i,providerId:n,policyArns:m,policy:f,durationSeconds:g}=e,{roleAssumerWithWebIdentity:l}=e;if(!l){let{getDefaultRoleAssumerWithWebIdentity:E}=await import("./chunk-59ayg5am.js");l=E({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:{...s?.callerClientConfig,...e.parentClientConfig}},e.clientPlugins)}return l({RoleArn:o,RoleSessionName:r??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:i,ProviderId:n,PolicyArns:m,Policy:f,DurationSeconds:g})};var d="AWS_WEB_IDENTITY_TOKEN_FILE",_="AWS_ROLE_ARN",S="AWS_ROLE_SESSION_NAME",T=(e={})=>async(s)=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");let o=e?.webIdentityTokenFile??process.env[d],r=e?.roleArn??process.env[_],i=e?.roleSessionName??process.env[S];if(!o||!r)throw new t.CredentialsProviderError("Web identity configuration not specified",{logger:e.logger});let n=await c({...e,webIdentityToken:t.externalDataInterceptor?.getTokenRecord?.()[o]??p(o,{encoding:"ascii"}),roleArn:r,roleSessionName:i})(s);if(o===process.env[d])a.setCredentialFeature(n,"CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN","h");return n};export{T as fromTokenFile};
2
+ import{Ot}from"./chunk-k9q4nn8b.js";import{Ge}from"./chunk-6mrgtn78.js";import{H}from"./chunk-t6cn018t.js";var a=H(Ot()),t=H(Ge());import{readFileSync as p}from"fs";var c=(e)=>async(s)=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");let{roleArn:o,roleSessionName:r,webIdentityToken:i,providerId:n,policyArns:m,policy:f,durationSeconds:g}=e,{roleAssumerWithWebIdentity:l}=e;if(!l){let{getDefaultRoleAssumerWithWebIdentity:E}=await import("./chunk-r9gp9yqw.js");l=E({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:{...s?.callerClientConfig,...e.parentClientConfig}},e.clientPlugins)}return l({RoleArn:o,RoleSessionName:r??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:i,ProviderId:n,PolicyArns:m,Policy:f,DurationSeconds:g})};var d="AWS_WEB_IDENTITY_TOKEN_FILE",_="AWS_ROLE_ARN",S="AWS_ROLE_SESSION_NAME",T=(e={})=>async(s)=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");let o=e?.webIdentityTokenFile??process.env[d],r=e?.roleArn??process.env[_],i=e?.roleSessionName??process.env[S];if(!o||!r)throw new t.CredentialsProviderError("Web identity configuration not specified",{logger:e.logger});let n=await c({...e,webIdentityToken:t.externalDataInterceptor?.getTokenRecord?.()[o]??p(o,{encoding:"ascii"}),roleArn:r,roleSessionName:i})(s);if(o===process.env[d])a.setCredentialFeature(n,"CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN","h");return n};export{T as fromTokenFile};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Oe,mr}from"./chunk-srmx5z3v.js";import{Bn,Xr,Cn}from"./chunk-b88tdt79.js";var n=class{get supportsCreateIfNotExists(){return!0}get supportsTransactionalDdl(){return!1}get supportsReturning(){return!0}async acquireMigrationLock(){}async releaseMigrationLock(){}get supportsOutput(){return!0}},s=class{#e;#t=new o;#r;#a;constructor(e){this.#e={...e}}async init(){if(this.#r=this.#e.database,this.#a=new i(this.#r),this.#e.onCreateConnection)await this.#e.onCreateConnection(this.#a)}async acquireConnection(){return await this.#t.lock(),this.#a}async beginTransaction(e){await e.executeQuery(mr.raw("begin"))}async commitTransaction(e){await e.executeQuery(mr.raw("commit"))}async rollbackTransaction(e){await e.executeQuery(mr.raw("rollback"))}async releaseConnection(){this.#t.unlock()}async destroy(){this.#r?.close()}},i=class{#e;constructor(e){this.#e=e}executeQuery(e){let{sql:r,parameters:a}=e,t=this.#e.prepare(r).all(...a);return Promise.resolve({rows:t})}async*streamQuery(){throw Error("Streaming query is not supported by SQLite driver.")}},o=class{#e;#t;async lock(){while(this.#e!==void 0)await this.#e;this.#e=new Promise((e)=>{this.#t=e})}unlock(){let e=this.#t;this.#e=void 0,this.#t=void 0,e?.()}},c=class{#e;constructor(e){this.#e=e}async getSchemas(){return[]}async getTables(e={withInternalKyselyTables:!1}){let r=this.#e.selectFrom("sqlite_schema").where("type","=","table").where("name","not like","sqlite_%").select("name").$castTo();if(!e.withInternalKyselyTables)r=r.where("name","!=",Xr).where("name","!=",Cn);let a=await r.execute();return Promise.all(a.map(({name:t})=>this.#t(t)))}async getMetadata(e){return{tables:await this.getTables(e)}}async#t(e){let r=this.#e,a=(await r.selectFrom("sqlite_master").where("name","=",e).select("sql").$castTo().execute())[0]?.sql?.split(/[\(\),]/)?.find((t)=>t.toLowerCase().includes("autoincrement"))?.split(/\s+/)?.[0]?.replace(/["`]/g,"");return{name:e,columns:(await r.selectFrom(Oe`pragma_table_info(${e})`.as("table_info")).select(["name","type","notnull","dflt_value"]).execute()).map((t)=>({name:t.name,dataType:t.type,isNullable:!t.notnull,isAutoIncrementing:t.name===a,hasDefaultValue:t.dflt_value!=null})),isView:!0}}},l=class extends Bn{getCurrentParameterPlaceholder(){return"?"}getLeftIdentifierWrapper(){return'"'}getRightIdentifierWrapper(){return'"'}getAutoIncrement(){return"autoincrement"}},m=class{#e;constructor(e){this.#e={...e}}createDriver(){return new s(this.#e)}createQueryCompiler(){return new l}createAdapter(){return new n}createIntrospector(e){return new c(e)}};export{m as NodeSqliteDialect};
2
+ import{De,gr}from"./chunk-yncvy335.js";import{qn,rn,Nn}from"./chunk-bv589v2m.js";var n=class{get supportsCreateIfNotExists(){return!0}get supportsTransactionalDdl(){return!1}get supportsReturning(){return!0}async acquireMigrationLock(){}async releaseMigrationLock(){}get supportsOutput(){return!0}},s=class{#e;#t=new o;#r;#a;constructor(e){this.#e={...e}}async init(){if(this.#r=this.#e.database,this.#a=new i(this.#r),this.#e.onCreateConnection)await this.#e.onCreateConnection(this.#a)}async acquireConnection(){return await this.#t.lock(),this.#a}async beginTransaction(e){await e.executeQuery(gr.raw("begin"))}async commitTransaction(e){await e.executeQuery(gr.raw("commit"))}async rollbackTransaction(e){await e.executeQuery(gr.raw("rollback"))}async releaseConnection(){this.#t.unlock()}async destroy(){this.#r?.close()}},i=class{#e;constructor(e){this.#e=e}executeQuery(e){let{sql:r,parameters:a}=e,t=this.#e.prepare(r).all(...a);return Promise.resolve({rows:t})}async*streamQuery(){throw Error("Streaming query is not supported by SQLite driver.")}},o=class{#e;#t;async lock(){while(this.#e!==void 0)await this.#e;this.#e=new Promise((e)=>{this.#t=e})}unlock(){let e=this.#t;this.#e=void 0,this.#t=void 0,e?.()}},c=class{#e;constructor(e){this.#e=e}async getSchemas(){return[]}async getTables(e={withInternalKyselyTables:!1}){let r=this.#e.selectFrom("sqlite_schema").where("type","=","table").where("name","not like","sqlite_%").select("name").$castTo();if(!e.withInternalKyselyTables)r=r.where("name","!=",rn).where("name","!=",Nn);let a=await r.execute();return Promise.all(a.map(({name:t})=>this.#t(t)))}async getMetadata(e){return{tables:await this.getTables(e)}}async#t(e){let r=this.#e,a=(await r.selectFrom("sqlite_master").where("name","=",e).select("sql").$castTo().execute())[0]?.sql?.split(/[\(\),]/)?.find((t)=>t.toLowerCase().includes("autoincrement"))?.split(/\s+/)?.[0]?.replace(/["`]/g,"");return{name:e,columns:(await r.selectFrom(De`pragma_table_info(${e})`.as("table_info")).select(["name","type","notnull","dflt_value"]).execute()).map((t)=>({name:t.name,dataType:t.type,isNullable:!t.notnull,isAutoIncrementing:t.name===a,hasDefaultValue:t.dflt_value!=null})),isView:!0}}},l=class extends qn{getCurrentParameterPlaceholder(){return"?"}getLeftIdentifierWrapper(){return'"'}getRightIdentifierWrapper(){return'"'}getAutoIncrement(){return"autoincrement"}},m=class{#e;constructor(e){this.#e={...e}}createDriver(){return new s(this.#e)}createQueryCompiler(){return new l}createAdapter(){return new n}createIntrospector(e){return new c(e)}};export{m as NodeSqliteDialect};
@@ -0,0 +1 @@
1
+ import{t,ze}from"./chunk-p1d500sf.js";import"./chunk-sdp9w627.js";import"./chunk-c8kjpmfe.js";import"./chunk-qt78vs3g.js";import"./chunk-7rycq6wb.js";import"./chunk-cxet91kt.js";import"./chunk-sbg86tch.js";import"./chunk-k7sjpke6.js";import"./chunk-fkn6f4qt.js";import"./chunk-6vkfzzvt.js";import"./chunk-xgnvktq6.js";import"./chunk-f0b4a9y3.js";import"./chunk-5aqthcm6.js";import{Ti}from"./chunk-8r3k84dh.js";import"./chunk-ahgq10a7.js";import"./chunk-1vt9ss7d.js";import"./chunk-zxqasmvz.js";import"./chunk-ts4d1mxf.js";import"./chunk-xsfy8hz3.js";import"./chunk-1eqw2dpx.js";import"./chunk-b7qs7hxg.js";import"./chunk-ht5rht98.js";function n(){let{shareId:r,fileId:a}=e.useParams(),{start:i,version:o,compare:c,cmpLeft:m,cmpRight:s,cmpActive:p}=e.useSearch();return t(Ti,{shareId:r,initialFileId:a,startTime:i,versionId:o,compare:c,compareLeftId:m,compareRightId:s,compareActiveSide:p})}var e=ze("/share/$shareId/files/$fileId")({component:n});export{e as Route};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Fc,Lc,$u}from"./chunk-c9xyejnk.js";export{Fc as ENV_KEY,Lc as ENV_SECRET,$u as fromEnv};