omniroute 2.8.3 → 2.8.5

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 (167) hide show
  1. package/app/.next/BUILD_ID +1 -1
  2. package/app/.next/build-manifest.json +2 -2
  3. package/app/.next/prerender-manifest.json +3 -3
  4. package/app/.next/server/app/(dashboard)/dashboard/a2a/page_client-reference-manifest.js +1 -1
  5. package/app/.next/server/app/(dashboard)/dashboard/agents/page_client-reference-manifest.js +1 -1
  6. package/app/.next/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
  7. package/app/.next/server/app/(dashboard)/dashboard/api-manager/page_client-reference-manifest.js +1 -1
  8. package/app/.next/server/app/(dashboard)/dashboard/audit-log/page_client-reference-manifest.js +1 -1
  9. package/app/.next/server/app/(dashboard)/dashboard/auto-combo/page_client-reference-manifest.js +1 -1
  10. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  11. package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  12. package/app/.next/server/app/(dashboard)/dashboard/costs/page_client-reference-manifest.js +1 -1
  13. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  14. package/app/.next/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
  15. package/app/.next/server/app/(dashboard)/dashboard/limits/page_client-reference-manifest.js +1 -1
  16. package/app/.next/server/app/(dashboard)/dashboard/logs/page_client-reference-manifest.js +1 -1
  17. package/app/.next/server/app/(dashboard)/dashboard/mcp/page_client-reference-manifest.js +1 -1
  18. package/app/.next/server/app/(dashboard)/dashboard/media/page_client-reference-manifest.js +1 -1
  19. package/app/.next/server/app/(dashboard)/dashboard/onboarding/page_client-reference-manifest.js +1 -1
  20. package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  21. package/app/.next/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  22. package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  23. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  24. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  25. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  26. package/app/.next/server/app/(dashboard)/dashboard/search-tools/page_client-reference-manifest.js +1 -1
  27. package/app/.next/server/app/(dashboard)/dashboard/settings/page_client-reference-manifest.js +1 -1
  28. package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  29. package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  30. package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  31. package/app/.next/server/app/400/page_client-reference-manifest.js +1 -1
  32. package/app/.next/server/app/401/page_client-reference-manifest.js +1 -1
  33. package/app/.next/server/app/403/page_client-reference-manifest.js +1 -1
  34. package/app/.next/server/app/408/page_client-reference-manifest.js +1 -1
  35. package/app/.next/server/app/429/page_client-reference-manifest.js +1 -1
  36. package/app/.next/server/app/500/page_client-reference-manifest.js +1 -1
  37. package/app/.next/server/app/502/page_client-reference-manifest.js +1 -1
  38. package/app/.next/server/app/503/page_client-reference-manifest.js +1 -1
  39. package/app/.next/server/app/_global-error.html +2 -2
  40. package/app/.next/server/app/_global-error.rsc +1 -1
  41. package/app/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  42. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  43. package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  44. package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  45. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  46. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  47. package/app/.next/server/app/api/models/catalog/route.js +1 -1
  48. package/app/.next/server/app/api/models/catalog/route.js.nft.json +1 -1
  49. package/app/.next/server/app/api/providers/[id]/models/route.js +2 -2
  50. package/app/.next/server/app/api/providers/[id]/test/route.js +3 -3
  51. package/app/.next/server/app/api/providers/route.js +1 -1
  52. package/app/.next/server/app/api/providers/test-batch/route.js +6 -6
  53. package/app/.next/server/app/api/v1/models/route.js +3 -3
  54. package/app/.next/server/app/api/v1/models/route.js.nft.json +1 -1
  55. package/app/.next/server/app/api/v1/route.js +3 -3
  56. package/app/.next/server/app/api/v1/route.js.nft.json +1 -1
  57. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  58. package/app/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  59. package/app/.next/server/app/forbidden/page_client-reference-manifest.js +1 -1
  60. package/app/.next/server/app/forgot-password/page_client-reference-manifest.js +1 -1
  61. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  62. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  63. package/app/.next/server/app/maintenance/page_client-reference-manifest.js +1 -1
  64. package/app/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  65. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  66. package/app/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
  67. package/app/.next/server/app/status/page_client-reference-manifest.js +1 -1
  68. package/app/.next/server/app/terms/page_client-reference-manifest.js +1 -1
  69. package/app/.next/server/chunks/[root-of-the-server]__09c944b3._.js +2 -2
  70. package/app/.next/server/chunks/[root-of-the-server]__134baf4c._.js +2 -2
  71. package/app/.next/server/chunks/[root-of-the-server]__179c5303._.js +1 -1
  72. package/app/.next/server/chunks/[root-of-the-server]__237e5042._.js +1 -1
  73. package/app/.next/server/chunks/[root-of-the-server]__2f8f5f38._.js +2 -2
  74. package/app/.next/server/chunks/[root-of-the-server]__31027061._.js +4 -0
  75. package/app/.next/server/chunks/[root-of-the-server]__3e042fbd._.js +2 -2
  76. package/app/.next/server/chunks/[root-of-the-server]__46fad57a._.js +1 -1
  77. package/app/.next/server/chunks/[root-of-the-server]__7a9b72a4._.js +2 -2
  78. package/app/.next/server/chunks/[root-of-the-server]__7d9b23e7._.js +2 -2
  79. package/app/.next/server/chunks/[root-of-the-server]__80e3bfc3._.js +2 -2
  80. package/app/.next/server/chunks/[root-of-the-server]__84e445b2._.js +1 -1
  81. package/app/.next/server/chunks/[root-of-the-server]__92cb0def._.js +1 -1
  82. package/app/.next/server/chunks/[root-of-the-server]__9bbd49c8._.js +1 -1
  83. package/app/.next/server/chunks/[root-of-the-server]__add0a68c._.js +1 -1
  84. package/app/.next/server/chunks/[root-of-the-server]__c393c81f._.js +1 -1
  85. package/app/.next/server/chunks/[root-of-the-server]__cd42b732._.js +1 -1
  86. package/app/.next/server/chunks/[root-of-the-server]__d4563e10._.js +1 -1
  87. package/app/.next/server/chunks/[root-of-the-server]__d7914418._.js +4 -0
  88. package/app/.next/server/chunks/[root-of-the-server]__db2f9fe0._.js +1 -1
  89. package/app/.next/server/chunks/[root-of-the-server]__e27a89bd._.js +1 -1
  90. package/app/.next/server/chunks/[root-of-the-server]__e56edf04._.js +1 -1
  91. package/app/.next/server/chunks/[root-of-the-server]__e6e94646._.js +1 -1
  92. package/app/.next/server/chunks/[root-of-the-server]__eb98039a._.js +1 -1
  93. package/app/.next/server/chunks/[root-of-the-server]__ebf3fe48._.js +2 -2
  94. package/app/.next/server/chunks/[root-of-the-server]__f0131d95._.js +4 -0
  95. package/app/.next/server/chunks/[root-of-the-server]__f31b4656._.js +3 -3
  96. package/app/.next/server/chunks/[root-of-the-server]__fad1679d._.js +2 -2
  97. package/app/.next/server/chunks/_05c48915._.js +1 -1
  98. package/app/.next/server/chunks/_2115d8de._.js +1 -1
  99. package/app/.next/server/chunks/_3ac953eb._.js +1 -1
  100. package/app/.next/server/chunks/_4b8fd853._.js +1 -1
  101. package/app/.next/server/chunks/_68683848._.js +1 -1
  102. package/app/.next/server/chunks/_ee9b677b._.js +1 -1
  103. package/app/.next/server/chunks/open-sse_cf4d5692._.js +1 -1
  104. package/app/.next/server/chunks/open-sse_config_constants_ts_9583de19._.js +1 -1
  105. package/app/.next/server/chunks/open-sse_services_826884e1._.js +2 -1
  106. package/app/.next/server/chunks/ssr/[root-of-the-server]__9affb65e._.js +1 -1
  107. package/app/.next/server/chunks/ssr/[root-of-the-server]__a6942102._.js +1 -1
  108. package/app/.next/server/chunks/ssr/_19b3d5b1._.js +2 -2
  109. package/app/.next/server/chunks/ssr/src_9197fb9b._.js +1 -1
  110. package/app/.next/server/chunks/ssr/src_ec615d6e._.js +2 -2
  111. package/app/.next/server/chunks/ssr/src_lib_initCloudSync_ts_982b9d4d._.js +1 -1
  112. package/app/.next/server/pages/500.html +2 -2
  113. package/app/.next/server/server-reference-manifest.js +1 -1
  114. package/app/.next/server/server-reference-manifest.json +1 -1
  115. package/app/.next/static/chunks/{37e9976d0367faad.js → 3fa6c964786c962d.js} +4 -4
  116. package/app/.next/static/chunks/{19b1432393321fcf.js → d9a70775eb233dc3.js} +1 -1
  117. package/app/.next/static/chunks/{0f71d7fbf89bb737.js → ec1938d17386c6db.js} +1 -1
  118. package/app/CHANGELOG.md +53 -0
  119. package/app/docs/ARCHITECTURE.md +1 -1
  120. package/app/docs/VM_DEPLOYMENT_GUIDE.md +2 -0
  121. package/app/docs/i18n/README.md +9 -17
  122. package/app/docs/i18n/ar/VM_DEPLOYMENT_GUIDE.md +110 -112
  123. package/app/docs/i18n/bg/VM_DEPLOYMENT_GUIDE.md +110 -112
  124. package/app/docs/i18n/da/VM_DEPLOYMENT_GUIDE.md +110 -112
  125. package/app/docs/i18n/de/VM_DEPLOYMENT_GUIDE.md +110 -112
  126. package/app/docs/i18n/es/VM_DEPLOYMENT_GUIDE.md +107 -109
  127. package/app/docs/i18n/fi/VM_DEPLOYMENT_GUIDE.md +110 -112
  128. package/app/docs/i18n/fr/VM_DEPLOYMENT_GUIDE.md +110 -112
  129. package/app/docs/i18n/he/VM_DEPLOYMENT_GUIDE.md +110 -112
  130. package/app/docs/i18n/hu/VM_DEPLOYMENT_GUIDE.md +110 -112
  131. package/app/docs/i18n/id/VM_DEPLOYMENT_GUIDE.md +110 -112
  132. package/app/docs/i18n/in/VM_DEPLOYMENT_GUIDE.md +102 -210
  133. package/app/docs/i18n/it/VM_DEPLOYMENT_GUIDE.md +110 -112
  134. package/app/docs/i18n/ja/VM_DEPLOYMENT_GUIDE.md +110 -112
  135. package/app/docs/i18n/ko/VM_DEPLOYMENT_GUIDE.md +109 -111
  136. package/app/docs/i18n/ms/VM_DEPLOYMENT_GUIDE.md +110 -112
  137. package/app/docs/i18n/nl/VM_DEPLOYMENT_GUIDE.md +110 -112
  138. package/app/docs/i18n/no/VM_DEPLOYMENT_GUIDE.md +110 -112
  139. package/app/docs/i18n/phi/VM_DEPLOYMENT_GUIDE.md +110 -112
  140. package/app/docs/i18n/pl/VM_DEPLOYMENT_GUIDE.md +110 -112
  141. package/app/docs/i18n/pt/VM_DEPLOYMENT_GUIDE.md +96 -98
  142. package/app/docs/i18n/pt-BR/VM_DEPLOYMENT_GUIDE.md +96 -98
  143. package/app/docs/i18n/ro/VM_DEPLOYMENT_GUIDE.md +110 -112
  144. package/app/docs/i18n/ru/VM_DEPLOYMENT_GUIDE.md +110 -112
  145. package/app/docs/i18n/sk/VM_DEPLOYMENT_GUIDE.md +110 -112
  146. package/app/docs/i18n/sv/VM_DEPLOYMENT_GUIDE.md +110 -112
  147. package/app/docs/i18n/th/VM_DEPLOYMENT_GUIDE.md +110 -112
  148. package/app/docs/i18n/uk-UA/VM_DEPLOYMENT_GUIDE.md +110 -112
  149. package/app/docs/i18n/vi/VM_DEPLOYMENT_GUIDE.md +110 -112
  150. package/app/docs/i18n/zh-CN/VM_DEPLOYMENT_GUIDE.md +110 -112
  151. package/app/docs/openapi.yaml +1 -1
  152. package/app/open-sse/config/constants.ts +3 -3
  153. package/app/open-sse/services/comboAgentMiddleware.ts +9 -1
  154. package/app/package-lock.json +5 -5
  155. package/app/package.json +1 -1
  156. package/app/scripts/i18n/generate-multilang.mjs +1 -0
  157. package/app/src/shared/constants/cliTools.ts +2 -2
  158. package/app/src/shared/constants/providers.ts +3 -0
  159. package/app/src/shared/validation/providerSchema.ts +6 -0
  160. package/app/tests/e2e/providers-bailian-coding-plan.spec.ts +14 -0
  161. package/package.json +1 -1
  162. package/app/.next/server/chunks/[root-of-the-server]__61396d77._.js +0 -4
  163. package/app/.next/server/chunks/[root-of-the-server]__d5ecc2ba._.js +0 -4
  164. package/app/.next/server/chunks/[root-of-the-server]__daa26645._.js +0 -4
  165. /package/app/.next/static/{IiXcm5VJcOKrDneQQSdf- → coLESPH6_RrEzzULWq8F5}/_buildManifest.js +0 -0
  166. /package/app/.next/static/{IiXcm5VJcOKrDneQQSdf- → coLESPH6_RrEzzULWq8F5}/_clientMiddlewareManifest.json +0 -0
  167. /package/app/.next/static/{IiXcm5VJcOKrDneQQSdf- → coLESPH6_RrEzzULWq8F5}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- module.exports=[918622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},556704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},832319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},324725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},270406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},193695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},442315,(e,t,r)=>{"use strict";t.exports=e.r(918622)},347540,(e,t,r)=>{"use strict";t.exports=e.r(442315).vendored["react-rsc"].React},819481,(e,t,r)=>{"use strict";var n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,s={},l={RequestCookies:()=>f,ResponseCookies:()=>m,parseCookie:()=>d,parseSetCookie:()=>p,stringifyCookie:()=>c};for(var u in l)n(s,u,{get:l[u],enumerable:!0});function c(e){var t;let r=["path"in e&&e.path&&`Path=${e.path}`,"expires"in e&&(e.expires||0===e.expires)&&`Expires=${("number"==typeof e.expires?new Date(e.expires):e.expires).toUTCString()}`,"maxAge"in e&&"number"==typeof e.maxAge&&`Max-Age=${e.maxAge}`,"domain"in e&&e.domain&&`Domain=${e.domain}`,"secure"in e&&e.secure&&"Secure","httpOnly"in e&&e.httpOnly&&"HttpOnly","sameSite"in e&&e.sameSite&&`SameSite=${e.sameSite}`,"partitioned"in e&&e.partitioned&&"Partitioned","priority"in e&&e.priority&&`Priority=${e.priority}`].filter(Boolean),n=`${e.name}=${encodeURIComponent(null!=(t=e.value)?t:"")}`;return 0===r.length?n:`${n}; ${r.join("; ")}`}function d(e){let t=new Map;for(let r of e.split(/; */)){if(!r)continue;let e=r.indexOf("=");if(-1===e){t.set(r,"true");continue}let[n,i]=[r.slice(0,e),r.slice(e+1)];try{t.set(n,decodeURIComponent(null!=i?i:"true"))}catch{}}return t}function p(e){if(!e)return;let[[t,r],...n]=d(e),{domain:i,expires:o,httponly:a,maxage:s,path:l,samesite:u,secure:c,partitioned:p,priority:f}=Object.fromEntries(n.map(([e,t])=>[e.toLowerCase().replace(/-/g,""),t]));{var m,y,_={name:t,value:decodeURIComponent(r),domain:i,...o&&{expires:new Date(o)},...a&&{httpOnly:!0},..."string"==typeof s&&{maxAge:Number(s)},path:l,...u&&{sameSite:g.includes(m=(m=u).toLowerCase())?m:void 0},...c&&{secure:!0},...f&&{priority:h.includes(y=(y=f).toLowerCase())?y:void 0},...p&&{partitioned:!0}};let e={};for(let t in _)_[t]&&(e[t]=_[t]);return e}}t.exports=((e,t,r,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of o(t))a.call(e,r)||void 0===r||n(e,r,{get:()=>t[r],enumerable:!(s=i(t,r))||s.enumerable});return e})(n({},"__esModule",{value:!0}),s);var g=["strict","lax","none"],h=["low","medium","high"],f=class{constructor(e){this._parsed=new Map,this._headers=e;const t=e.get("cookie");if(t)for(const[e,r]of d(t))this._parsed.set(e,{name:e,value:r})}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed);if(!e.length)return r.map(([e,t])=>t);let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(([e])=>e===n).map(([e,t])=>t)}has(e){return this._parsed.has(e)}set(...e){let[t,r]=1===e.length?[e[0].name,e[0].value]:e,n=this._parsed;return n.set(t,{name:t,value:r}),this._headers.set("cookie",Array.from(n).map(([e,t])=>c(t)).join("; ")),this}delete(e){let t=this._parsed,r=Array.isArray(e)?e.map(e=>t.delete(e)):t.delete(e);return this._headers.set("cookie",Array.from(t).map(([e,t])=>c(t)).join("; ")),r}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(e=>`${e.name}=${encodeURIComponent(e.value)}`).join("; ")}},m=class{constructor(e){var t,r,n;this._parsed=new Map,this._headers=e;const i=null!=(n=null!=(r=null==(t=e.getSetCookie)?void 0:t.call(e))?r:e.get("set-cookie"))?n:[];for(const e of Array.isArray(i)?i:function(e){if(!e)return[];var t,r,n,i,o,a=[],s=0;function l(){for(;s<e.length&&/\s/.test(e.charAt(s));)s+=1;return s<e.length}for(;s<e.length;){for(t=s,o=!1;l();)if(","===(r=e.charAt(s))){for(n=s,s+=1,l(),i=s;s<e.length&&"="!==(r=e.charAt(s))&&";"!==r&&","!==r;)s+=1;s<e.length&&"="===e.charAt(s)?(o=!0,s=i,a.push(e.substring(t,n)),t=s):s=n+1}else s+=1;(!o||s>=e.length)&&a.push(e.substring(t,e.length))}return a}(i)){const t=p(e);t&&this._parsed.set(t.name,t)}}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed.values());if(!e.length)return r;let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(e=>e.name===n)}has(e){return this._parsed.has(e)}set(...e){let[t,r,n]=1===e.length?[e[0].name,e[0].value,e[0]]:e,i=this._parsed;return i.set(t,function(e={name:"",value:""}){return"number"==typeof e.expires&&(e.expires=new Date(e.expires)),e.maxAge&&(e.expires=new Date(Date.now()+1e3*e.maxAge)),(null===e.path||void 0===e.path)&&(e.path="/"),e}({name:t,value:r,...n})),function(e,t){for(let[,r]of(t.delete("set-cookie"),e)){let e=c(r);t.append("set-cookie",e)}}(i,this._headers),this}delete(...e){let[t,r]="string"==typeof e[0]?[e[0]]:[e[0].name,e[0]];return this.set({...r,name:t,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(c).join("; ")}}},677850,e=>e.a(async(t,r)=>{try{let t=await e.y("zod");e.n(t),r()}catch(e){r(e)}},!0),200392,e=>e.a(async(t,r)=>{try{var n=e.i(677850),i=t([n]);function o(e,t){let r=e.safeParse(t);if(r.success)return{success:!0,data:r.data};let n=Array.isArray(r.error?.issues)?r.error.issues:[];return{success:!1,error:{message:"Invalid request",details:n.map(e=>({field:e.path.join("."),message:e.message}))}}}function a(e){return!1===e.success}[n]=i.then?(await i)():i,n.z.object({password:n.z.string().min(1,"Password is required").max(200)}),e.s(["isValidationFailure",()=>a,"validateBody",()=>o]),r()}catch(e){r(e)}},!1),16023,e=>{"use strict";var t=e.i(522734),r=e.i(814747);let n=["clientId","clientSecret","tokenUrl","authUrl","refreshUrl"],i=0,o=null;var a=e.i(828059);let s=parseInt(process.env.FETCH_TIMEOUT_MS||"120000",10),l=parseInt(process.env.STREAM_IDLE_TIMEOUT_MS||"300000",10),u=(0,a.generateLegacyProviders)();!function(e){let a;if(o&&Date.now()-i<6e4)return;let s=(a=process.env.DATA_DIR||(0,r.join)(process.cwd(),"data"),(0,r.join)(a,"provider-credentials.json"));if(!(0,t.existsSync)(s))return o||console.log("[CREDENTIALS] No external credentials file found, using defaults."),o=e,i=Date.now();try{let r=(0,t.readFileSync)(s,"utf-8"),i=JSON.parse(r),a=0;for(let[t,r]of Object.entries(i)){if(!e[t]){console.log(`[CREDENTIALS] Warning: unknown provider "${t}" in credentials file, skipping.`);continue}if(!r||"object"!=typeof r){console.log(`[CREDENTIALS] Warning: provider "${t}" value must be an object, got ${typeof r}. Skipping.`);continue}for(let i of n)void 0!==r[i]&&(e[t][i]=r[i],a++)}let l=null!==o;console.log(`[CREDENTIALS] ${l?"Reloaded":"Loaded"} external credentials: ${a} field(s) from ${s}`)}catch(e){console.log(`[CREDENTIALS] Error reading credentials file: ${e.message}. Using defaults.`)}o=e,i=Date.now()}(u);let c={BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,NOT_ACCEPTABLE:406,REQUEST_TIMEOUT:408,RATE_LIMITED:429,SERVER_ERROR:500,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504},d={[c.BAD_REQUEST]:{type:"invalid_request_error",code:"bad_request"},[c.UNAUTHORIZED]:{type:"authentication_error",code:"invalid_api_key"},[c.FORBIDDEN]:{type:"permission_error",code:"insufficient_quota"},[c.NOT_FOUND]:{type:"invalid_request_error",code:"model_not_found"},[c.RATE_LIMITED]:{type:"rate_limit_error",code:"rate_limit_exceeded"},[c.SERVER_ERROR]:{type:"server_error",code:"internal_server_error"},[c.BAD_GATEWAY]:{type:"server_error",code:"bad_gateway"},[c.SERVICE_UNAVAILABLE]:{type:"server_error",code:"service_unavailable"},[c.GATEWAY_TIMEOUT]:{type:"server_error",code:"gateway_timeout"}},p={[c.BAD_REQUEST]:"Bad request",[c.UNAUTHORIZED]:"Invalid API key provided",[c.FORBIDDEN]:"You exceeded your current quota",[c.NOT_FOUND]:"Model not found",[c.RATE_LIMITED]:"Rate limit exceeded",[c.SERVER_ERROR]:"Internal server error",[c.BAD_GATEWAY]:"Bad gateway - upstream provider error",[c.SERVICE_UNAVAILABLE]:"Service temporarily unavailable",[c.GATEWAY_TIMEOUT]:"Gateway timeout"};e.s(["ANTIGRAVITY_DEFAULT_SYSTEM",0,"Please ignore the following [ignore]You are Antigravity, a powerful agentic AI coding assistant designed by the Google Deepmind team working on Advanced Agentic Coding.You are pair programming with a USER to solve their coding task. The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.**Absolute paths only****Proactiveness**[/ignore]","BACKOFF_CONFIG",0,{base:1e3,max:12e4,maxLevel:15},"BACKOFF_STEPS_MS",0,[6e4,12e4,3e5,6e5,12e5],"CACHE_TTL",0,{userInfo:300,modelAlias:3600},"CLAUDE_SYSTEM_PROMPT",0,"You are Claude Code, Anthropic's official CLI for Claude.","COOLDOWN_MS",0,{unauthorized:12e4,paymentRequired:12e4,notFound:12e4,notFoundLocal:5e3,transientInitial:5e3,transientMax:6e4,transient:5e3,requestNotAllowed:5e3,rateLimit:12e4,serviceUnavailable:2e3,authExpired:12e4},"DEFAULT_API_LIMITS",0,{requestsPerMinute:100,minTimeBetweenRequests:200,concurrentRequests:10},"DEFAULT_ERROR_MESSAGES",0,p,"DEFAULT_MAX_TOKENS",0,64e3,"DEFAULT_MIN_TOKENS",0,32e3,"ERROR_TYPES",0,d,"FETCH_TIMEOUT_MS",0,s,"HTTP_STATUS",0,c,"OAUTH_ENDPOINTS",0,{google:{token:"https://oauth2.googleapis.com/token",auth:"https://accounts.google.com/o/oauth2/auth"},openai:{token:"https://auth.openai.com/oauth/token",auth:"https://auth.openai.com/oauth/authorize"},anthropic:{token:"https://console.anthropic.com/v1/oauth/token",auth:"https://console.anthropic.com/v1/oauth/authorize"},qwen:{token:"https://chat.qwen.ai/api/v1/oauth2/token",auth:"https://chat.qwen.ai/api/v1/oauth2/device/code"},iflow:{token:"https://iflow.cn/oauth/token",auth:"https://iflow.cn/oauth"},github:{token:"https://github.com/login/oauth/access_token",auth:"https://github.com/login/oauth/authorize",deviceCode:"https://github.com/login/device/code"}},"PROVIDERS",0,u,"PROVIDER_PROFILES",0,{oauth:{transientCooldown:5e3,rateLimitCooldown:6e4,maxBackoffLevel:8,circuitBreakerThreshold:3,circuitBreakerReset:6e4},apikey:{transientCooldown:3e3,rateLimitCooldown:0,maxBackoffLevel:5,circuitBreakerThreshold:5,circuitBreakerReset:3e4},local:{transientCooldown:2e3,rateLimitCooldown:5e3,maxBackoffLevel:3,circuitBreakerThreshold:2,circuitBreakerReset:15e3}},"RateLimitReason",0,{QUOTA_EXHAUSTED:"quota_exhausted",RATE_LIMIT_EXCEEDED:"rate_limit_exceeded",MODEL_CAPACITY:"model_capacity",SERVER_ERROR:"server_error",AUTH_ERROR:"auth_error",UNKNOWN:"unknown"},"SKIP_PATTERNS",0,["Please write a 5-10 word title for the following conversation:"],"STREAM_IDLE_TIMEOUT_MS",0,l],16023)},85713,e=>{"use strict";var t=e.i(16023),r=e.i(828059);let n="https://api.openai.com/v1",i="https://api.anthropic.com/v1";function o(e){return"string"==typeof e&&e.startsWith("openai-compatible-")}function a(e){return"string"==typeof e&&e.startsWith("anthropic-compatible-")}function s(e){return o(e)&&e.includes("responses")?"responses":"chat"}function l(e){let t=Object.prototype.hasOwnProperty.call(e,"input")&&void 0!==e.input,r=void 0!==e.max_output_tokens||void 0!==e.previous_response_id||void 0!==e.reasoning;if(t||r)return"openai-responses";if(e.request?.contents&&"antigravity"===e.userAgent)return"antigravity";if(e.contents&&Array.isArray(e.contents))return"gemini";if(e.stream_options||e.response_format||void 0!==e.logprobs||void 0!==e.top_logprobs||void 0!==e.n||void 0!==e.presence_penalty||void 0!==e.frequency_penalty||e.logit_bias||e.user)return"openai";if(e.messages&&Array.isArray(e.messages)){let t=e.messages[0];if(t?.content&&Array.isArray(t.content)){let r=t.content[0];if(r?.type==="text"&&!e.model?.includes("/")){if(e.system||e.anthropic_version)return"claude";let r=t.content.some(e=>"image"===e.type&&e.source?.type==="base64"),n=t.content.some(e=>"image_url"===e.type&&e.image_url?.url);if(r)return"claude";if(n)return"openai";if(t.content.some(e=>"tool_use"===e.type||"tool_result"===e.type))return"claude"}}if(void 0!==e.system||e.anthropic_version||e.max_tokens&&!e.stream_options&&!e.response_format)return"claude"}return"openai"}function u(e){if(o(e)){let r=s(e);return{...t.PROVIDERS.openai,format:"responses"===r?"openai-responses":"openai",baseUrl:n}}return a(e)?{...t.PROVIDERS.anthropic,format:"claude",baseUrl:i}:t.PROVIDERS[e]||t.PROVIDERS.openai}function c(e,t,l=!0,d={}){if(o(e)){var p;let t,r=s(e);return p=d?.baseUrl||n,t=p.replace(/\/$/,""),`${t}${"responses"===r?"/responses":"/chat/completions"}`}if(a(e)){let e;return e=(d?.baseUrl||i).replace(/\/$/,""),`${e}/messages`}let g=(0,r.getRegistryEntry)(e),h=u(e);if(g){if(g.baseUrls){let e=d?.baseUrlIndex||0,r=g.baseUrls[e]||g.baseUrls[0];return g.urlBuilder?g.urlBuilder(r,t,l):r}if(g.urlBuilder)return g.urlBuilder(g.baseUrl,t,l);if(g.urlSuffix)return`${g.baseUrl}${g.urlSuffix}`}return h.baseUrl}function d(e,t,n=!0,i=null){let o=u(e),s=(0,r.getRegistryEntry)(e),l={"Content-Type":"application/json",...o.headers};if(a(e))t.apiKey?l["x-api-key"]=t.apiKey:t.accessToken&&(l.Authorization=`Bearer ${t.accessToken}`),l["anthropic-version"]||(l["anthropic-version"]="2023-06-01");else if("github"===e){let e=t.copilotToken||t.accessToken;l.Authorization=`Bearer ${e}`,l["x-request-id"]=crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}),n||(l.Accept="application/json")}else if(s){let e=s.authHeader||"bearer";if("x-api-key"===e){let e=t.apiKey||t.accessToken;e&&(l["x-api-key"]=e)}else"x-goog-api-key"===e?t.apiKey?l["x-goog-api-key"]=t.apiKey:t.accessToken&&(l.Authorization=`Bearer ${t.accessToken}`):l.Authorization=`Bearer ${t.apiKey||t.accessToken}`}else l.Authorization=`Bearer ${t.apiKey||t.accessToken}`;return n&&(l.Accept="text/event-stream"),l}function p(e){if(o(e))return"responses"===s(e)?"openai-responses":"openai";if(a(e))return"claude";let t=(0,r.getRegistryEntry)(e);return t?t.format||"openai":u(e).format||"openai"}function g(e){return!function(e){let t=e.messages||e.contents;if(!t?.length)return!0;let r=t[t.length-1];return r?.role==="user"}(e)&&(delete e.reasoning_effort,delete e.thinking),e}e.s(["buildProviderHeaders",()=>d,"buildProviderUrl",()=>c,"detectFormat",()=>l,"getTargetFormat",()=>p,"normalizeThinkingConfig",()=>g])},496727,e=>{"use strict";e.s(["FORMATS",0,{OPENAI:"openai",OPENAI_RESPONSES:"openai-responses",OPENAI_RESPONSE:"openai-response",CLAUDE:"claude",GEMINI:"gemini",GEMINI_CLI:"gemini-cli",CODEX:"codex",ANTIGRAVITY:"antigravity",KIRO:"kiro",CURSOR:"cursor"}])},384094,e=>{"use strict";let t="passthrough",r={none:0,low:1024,medium:10240,high:131072},n={none:0,low:1024,medium:10240,high:131072},i={mode:t,customBudget:10240,effortLevel:"medium"},o={...i};function a(e){o={...i,...e}}function s(){return{...o}}function l(e,i=null){let a=i||o;if(!e||"object"!=typeof e)return e;let s=function(e){if(!e||"object"!=typeof e)return e;let t={...e},r=t.thinkingLevel||t.thinking_level;if("string"==typeof r&&void 0!==n[r]){let e=n[r];t.thinking={type:e>0?"enabled":"disabled",budget_tokens:e},delete t.thinkingLevel,delete t.thinking_level}let i=t.generationConfig?.thinkingConfig?.thinkingLevel||t.generationConfig?.thinking_config?.thinkingLevel;if("string"==typeof i&&void 0!==n[i]){let e=n[i];t.generationConfig={...t.generationConfig,thinking_config:{thinking_budget:e}},t.generationConfig.thinkingConfig&&delete t.generationConfig.thinkingConfig}return t}(e);switch(s=function(e){if(!e||"object"!=typeof e||!(e.model||"").endsWith("-thinking")||e.thinking)return e;let t={...e};return t.thinking={type:"enabled",budget_tokens:r.medium},t}(s),a.mode){case"auto":let c;return c={...s},delete c.thinking,delete c.reasoning_effort,delete c.reasoning,c.generationConfig&&(c.generationConfig={...c.generationConfig},delete c.generationConfig.thinking_config,delete c.generationConfig.thinkingConfig),c;case t:default:return s;case"custom":return u(s,a.customBudget);case"adaptive":return function(e,t){let n=e.messages||e.input||[],i=n.length,o=(e.tools||[]).length,a=0;for(let e=n.length-1;e>=0;e--){let t=n[e];if("user"===t.role){a="string"==typeof t.content?t.content.length:JSON.stringify(t.content||"").length;break}}let s=1;return i>10&&(s+=.5),o>3&&(s+=.5),a>2e3&&(s+=.3),u(e,Math.min(Math.ceil((r[t.effortLevel]||r.medium)*s),131072))}(s,a)}}function u(e,t){let r,n={...e};return(n.thinking||(r=n.model||"").includes("claude")||r.includes("o1")||r.includes("o3")||r.includes("o4")||r.includes("gemini")||r.endsWith("-thinking")||r.includes("thinking"))&&(n.thinking={type:t>0?"enabled":"disabled",budget_tokens:t}),(void 0!==n.reasoning_effort||void 0!==n.reasoning)&&(t<=0?(delete n.reasoning_effort,delete n.reasoning):t<=1024?n.reasoning_effort="low":t<=10240?n.reasoning_effort="medium":n.reasoning_effort="high"),(n.generationConfig?.thinking_config||n.generationConfig?.thinkingConfig)&&(n.generationConfig={...n.generationConfig,thinking_config:{thinking_budget:t}}),n}e.s(["applyThinkingBudget",()=>l,"getThinkingBudgetConfig",()=>s,"setThinkingBudgetConfig",()=>a])},466712,e=>e.a(async(t,r)=>{try{var n=e.i(89171),i=e.i(85713),o=e.i(352812),a=e.i(496727);e.i(245272);var s=e.i(385498),l=e.i(676088),u=e.i(200392),c=t([l,u]);function d(e){return e&&"object"==typeof e&&!Array.isArray(e)?e:{}}function p(e){let t=d(e.body);return Object.keys(t).length>0?t:e}function g(e){let t=e.model;return"string"==typeof t&&t.trim().length>0?t:"test-model"}async function h(e){let t;try{t=await e.json()}catch{return n.NextResponse.json({success:!1,error:{message:"Invalid request",details:[{field:"body",message:"Invalid JSON body"}]}},{status:400})}try{let e,c=(0,u.validateBody)(l.translatorTranslateSchema,t);if((0,u.isValidationFailure)(c))return n.NextResponse.json({success:!1,error:c.error},{status:400});let{step:h,provider:f,body:m,sourceFormat:y,targetFormat:_}=c.data;if("direct"===h){let e=y||(0,i.detectFormat)(m),t=_||(f?(0,i.getTargetFormat)(f):"openai"),r=g(d(m)),a=(0,o.translateRequest)(e,t,r,m,!0,null,f);return n.NextResponse.json({success:!0,sourceFormat:e,targetFormat:t,result:a})}switch(h){case 1:{let t=p(d(m)),r=(0,i.detectFormat)(t);e={timestamp:m.timestamp||new Date().toISOString(),endpoint:m.endpoint||"/v1/messages",headers:m.headers||{},body:t,_detectedFormat:r};break}case 2:{let t=p(d(m)),r=(0,i.detectFormat)(t),n=a.FORMATS.OPENAI,s=g(t),l=(0,o.translateRequest)(r,n,s,t,!0,null,f);e={timestamp:new Date().toISOString(),headers:{},body:l};break}case 3:{let t=p(d(m)),r=a.FORMATS.OPENAI,n=(0,i.getTargetFormat)(f),s=g(t),l=(0,o.translateRequest)(r,n,s,t,!0,null,f);e={timestamp:new Date().toISOString(),body:l};break}case 4:{var r;let t,o=p(d(m)),a=g(o),l=(await (0,s.getProviderConnections)({provider:f})).find(e=>!1!==e.isActive);if(!l)return n.NextResponse.json({success:!1,error:`No active connection found for provider: ${f}`},{status:400});let u={apiKey:l.apiKey,accessToken:l.accessToken,refreshToken:l.refreshToken,copilotToken:l.copilotToken,projectId:l.projectId,providerSpecificData:l.providerSpecificData},c=(0,i.buildProviderUrl)(f,a,!0,{baseUrlIndex:0,baseUrl:(r=l.providerSpecificData,t=d(r).baseUrl,"string"==typeof t&&t.trim().length>0?t:void 0)}),h=(0,i.buildProviderHeaders)(f,u,!0,o);e={timestamp:new Date().toISOString(),url:c,headers:h,body:o};break}default:return n.NextResponse.json({success:!1,error:"Invalid step"},{status:400})}return n.NextResponse.json({success:!0,result:e})}catch(e){return console.error("Error translating:",e),n.NextResponse.json({success:!1,error:"Failed to translate request"},{status:500})}}[l,u]=c.then?(await c)():c,e.s(["POST",()=>h]),r()}catch(e){r(e)}},!1),590068,e=>e.a(async(t,r)=>{try{var n=e.i(747909),i=e.i(174017),o=e.i(996250),a=e.i(759756),s=e.i(561916),l=e.i(174677),u=e.i(869741),c=e.i(316795),d=e.i(487718),p=e.i(995169),g=e.i(47587),h=e.i(666012),f=e.i(570101),m=e.i(626937),y=e.i(10372),_=e.i(193695);e.i(52474);var v=e.i(600220),E=e.i(466712),R=t([E]);[E]=R.then?(await R)():R;let T=new n.AppRouteRouteModule({definition:{kind:i.RouteKind.APP_ROUTE,page:"/api/translator/translate/route",pathname:"/api/translator/translate",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/translator/translate/route.ts",nextConfigOutput:"standalone",userland:E}),{workAsyncStorage:k,workUnitAsyncStorage:b,serverHooks:S}=T;function x(){return(0,o.patchFetch)({workAsyncStorage:k,workUnitAsyncStorage:b})}async function A(e,t,r){T.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let n="/api/translator/translate/route";n=n.replace(/\/index$/,"")||"/";let o=await T.prepare(e,t,{srcPage:n,multiZoneDraftMode:!1});if(!o)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:E,params:R,nextConfig:x,parsedUrl:A,isDraftMode:k,prerenderManifest:b,routerServerContext:S,isOnDemandRevalidate:C,revalidateOnlyGenerated:O,resolvedPathname:I,clientReferenceManifest:w,serverActionsManifest:U}=o,D=(0,u.normalizeAppPath)(n),N=!!(b.dynamicRoutes[D]||b.routes[I]),P=async()=>((null==S?void 0:S.render404)?await S.render404(e,t,A,!1):t.end("This page could not be found"),null);if(N&&!k){let e=!!b.routes[I],t=b.dynamicRoutes[D];if(t&&!1===t.fallback&&!e){if(x.experimental.adapterPath)return await P();throw new _.NoFallbackError}}let j=null;!N||T.isDev||k||(j=I,j="/index"===j?"/":j);let L=!0===T.isDev||!N,M=N&&!L;U&&w&&(0,l.setManifestsSingleton)({page:n,clientReferenceManifest:w,serverActionsManifest:U});let q=e.method||"GET",B=(0,s.getTracer)(),F=B.getActiveScopeSpan(),$={params:R,prerenderManifest:b,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:L,incrementalCache:(0,a.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:x.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,i)=>T.onRequestError(e,t,n,i,S)},sharedContext:{buildId:E}},H=new c.NodeNextRequest(e),K=new c.NodeNextResponse(t),V=d.NextRequestAdapter.fromNodeNextRequest(H,(0,d.signalFromNodeResponse)(t));try{let o=async e=>T.handle(V,$).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=B.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let i=r.get("next.route");if(i){let t=`${q} ${i}`;e.setAttributes({"next.route":i,"http.route":i,"next.span_name":t}),e.updateName(t)}else e.updateName(`${q} ${n}`)}),l=!!(0,a.getRequestMeta)(e,"minimalMode"),u=async a=>{var s,u;let c=async({previousCacheEntry:i})=>{try{if(!l&&C&&O&&!i)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await o(a);e.fetchMetrics=$.renderOpts.fetchMetrics;let s=$.renderOpts.pendingWaitUntil;s&&r.waitUntil&&(r.waitUntil(s),s=void 0);let u=$.renderOpts.collectedTags;if(!N)return await (0,h.sendResponse)(H,K,n,$.renderOpts.pendingWaitUntil),null;{let e=await n.blob(),t=(0,f.toNodeOutgoingHttpHeaders)(n.headers);u&&(t[y.NEXT_CACHE_TAGS_HEADER]=u),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==$.renderOpts.collectedRevalidate&&!($.renderOpts.collectedRevalidate>=y.INFINITE_CACHE)&&$.renderOpts.collectedRevalidate,i=void 0===$.renderOpts.collectedExpire||$.renderOpts.collectedExpire>=y.INFINITE_CACHE?void 0:$.renderOpts.collectedExpire;return{value:{kind:v.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:i}}}}catch(t){throw(null==i?void 0:i.isStale)&&await T.onRequestError(e,t,{routerKind:"App Router",routePath:n,routeType:"route",revalidateReason:(0,g.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,S),t}},d=await T.handleResponse({req:e,nextConfig:x,cacheKey:j,routeKind:i.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:b,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:O,responseGenerator:c,waitUntil:r.waitUntil,isMinimalMode:l});if(!N)return null;if((null==d||null==(s=d.value)?void 0:s.kind)!==v.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(u=d.value)?void 0:u.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});l||t.setHeader("x-nextjs-cache",C?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),k&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let p=(0,f.fromNodeOutgoingHttpHeaders)(d.value.headers);return l&&N||p.delete(y.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||p.get("Cache-Control")||p.set("Cache-Control",(0,m.getCacheControlHeader)(d.cacheControl)),await (0,h.sendResponse)(H,K,new Response(d.value.body,{headers:p,status:d.value.status||200})),null};F?await u(F):await B.withPropagatedContext(e.headers,()=>B.trace(p.BaseServerSpan.handleRequest,{spanName:`${q} ${n}`,kind:s.SpanKind.SERVER,attributes:{"http.method":q,"http.target":e.url}},u))}catch(t){if(t instanceof _.NoFallbackError||await T.onRequestError(e,t,{routerKind:"App Router",routePath:D,routeType:"route",revalidateReason:(0,g.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,S),N)throw t;return await (0,h.sendResponse)(H,K,new Response(null,{status:500})),null}}e.s(["handler",()=>A,"patchFetch",()=>x,"routeModule",()=>T,"serverHooks",()=>S,"workAsyncStorage",()=>k,"workUnitAsyncStorage",()=>b]),r()}catch(e){r(e)}},!1),606102,e=>{e.v(e=>Promise.resolve().then(()=>e(548941)))},789543,e=>{e.v(e=>Promise.resolve().then(()=>e(385498)))},579042,e=>{e.v(t=>Promise.all(["server/chunks/src_shared_utils_apiKey_ts_fa113e09._.js"].map(t=>e.l(t))).then(()=>t(65448)))},49794,e=>{e.v(t=>Promise.all(["server/chunks/src_shared_constants_pricing_ts_65de0558._.js"].map(t=>e.l(t))).then(()=>t(404503)))},386305,e=>{e.v(e=>Promise.resolve().then(()=>e(878947)))}];
1
+ module.exports=[918622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},556704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},832319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},324725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},270406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},193695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},442315,(e,t,r)=>{"use strict";t.exports=e.r(918622)},347540,(e,t,r)=>{"use strict";t.exports=e.r(442315).vendored["react-rsc"].React},819481,(e,t,r)=>{"use strict";var n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,s={},l={RequestCookies:()=>f,ResponseCookies:()=>m,parseCookie:()=>d,parseSetCookie:()=>p,stringifyCookie:()=>c};for(var u in l)n(s,u,{get:l[u],enumerable:!0});function c(e){var t;let r=["path"in e&&e.path&&`Path=${e.path}`,"expires"in e&&(e.expires||0===e.expires)&&`Expires=${("number"==typeof e.expires?new Date(e.expires):e.expires).toUTCString()}`,"maxAge"in e&&"number"==typeof e.maxAge&&`Max-Age=${e.maxAge}`,"domain"in e&&e.domain&&`Domain=${e.domain}`,"secure"in e&&e.secure&&"Secure","httpOnly"in e&&e.httpOnly&&"HttpOnly","sameSite"in e&&e.sameSite&&`SameSite=${e.sameSite}`,"partitioned"in e&&e.partitioned&&"Partitioned","priority"in e&&e.priority&&`Priority=${e.priority}`].filter(Boolean),n=`${e.name}=${encodeURIComponent(null!=(t=e.value)?t:"")}`;return 0===r.length?n:`${n}; ${r.join("; ")}`}function d(e){let t=new Map;for(let r of e.split(/; */)){if(!r)continue;let e=r.indexOf("=");if(-1===e){t.set(r,"true");continue}let[n,i]=[r.slice(0,e),r.slice(e+1)];try{t.set(n,decodeURIComponent(null!=i?i:"true"))}catch{}}return t}function p(e){if(!e)return;let[[t,r],...n]=d(e),{domain:i,expires:o,httponly:a,maxage:s,path:l,samesite:u,secure:c,partitioned:p,priority:f}=Object.fromEntries(n.map(([e,t])=>[e.toLowerCase().replace(/-/g,""),t]));{var m,y,_={name:t,value:decodeURIComponent(r),domain:i,...o&&{expires:new Date(o)},...a&&{httpOnly:!0},..."string"==typeof s&&{maxAge:Number(s)},path:l,...u&&{sameSite:g.includes(m=(m=u).toLowerCase())?m:void 0},...c&&{secure:!0},...f&&{priority:h.includes(y=(y=f).toLowerCase())?y:void 0},...p&&{partitioned:!0}};let e={};for(let t in _)_[t]&&(e[t]=_[t]);return e}}t.exports=((e,t,r,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of o(t))a.call(e,r)||void 0===r||n(e,r,{get:()=>t[r],enumerable:!(s=i(t,r))||s.enumerable});return e})(n({},"__esModule",{value:!0}),s);var g=["strict","lax","none"],h=["low","medium","high"],f=class{constructor(e){this._parsed=new Map,this._headers=e;const t=e.get("cookie");if(t)for(const[e,r]of d(t))this._parsed.set(e,{name:e,value:r})}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed);if(!e.length)return r.map(([e,t])=>t);let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(([e])=>e===n).map(([e,t])=>t)}has(e){return this._parsed.has(e)}set(...e){let[t,r]=1===e.length?[e[0].name,e[0].value]:e,n=this._parsed;return n.set(t,{name:t,value:r}),this._headers.set("cookie",Array.from(n).map(([e,t])=>c(t)).join("; ")),this}delete(e){let t=this._parsed,r=Array.isArray(e)?e.map(e=>t.delete(e)):t.delete(e);return this._headers.set("cookie",Array.from(t).map(([e,t])=>c(t)).join("; ")),r}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(e=>`${e.name}=${encodeURIComponent(e.value)}`).join("; ")}},m=class{constructor(e){var t,r,n;this._parsed=new Map,this._headers=e;const i=null!=(n=null!=(r=null==(t=e.getSetCookie)?void 0:t.call(e))?r:e.get("set-cookie"))?n:[];for(const e of Array.isArray(i)?i:function(e){if(!e)return[];var t,r,n,i,o,a=[],s=0;function l(){for(;s<e.length&&/\s/.test(e.charAt(s));)s+=1;return s<e.length}for(;s<e.length;){for(t=s,o=!1;l();)if(","===(r=e.charAt(s))){for(n=s,s+=1,l(),i=s;s<e.length&&"="!==(r=e.charAt(s))&&";"!==r&&","!==r;)s+=1;s<e.length&&"="===e.charAt(s)?(o=!0,s=i,a.push(e.substring(t,n)),t=s):s=n+1}else s+=1;(!o||s>=e.length)&&a.push(e.substring(t,e.length))}return a}(i)){const t=p(e);t&&this._parsed.set(t.name,t)}}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed.values());if(!e.length)return r;let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(e=>e.name===n)}has(e){return this._parsed.has(e)}set(...e){let[t,r,n]=1===e.length?[e[0].name,e[0].value,e[0]]:e,i=this._parsed;return i.set(t,function(e={name:"",value:""}){return"number"==typeof e.expires&&(e.expires=new Date(e.expires)),e.maxAge&&(e.expires=new Date(Date.now()+1e3*e.maxAge)),(null===e.path||void 0===e.path)&&(e.path="/"),e}({name:t,value:r,...n})),function(e,t){for(let[,r]of(t.delete("set-cookie"),e)){let e=c(r);t.append("set-cookie",e)}}(i,this._headers),this}delete(...e){let[t,r]="string"==typeof e[0]?[e[0]]:[e[0].name,e[0]];return this.set({...r,name:t,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(c).join("; ")}}},677850,e=>e.a(async(t,r)=>{try{let t=await e.y("zod");e.n(t),r()}catch(e){r(e)}},!0),200392,e=>e.a(async(t,r)=>{try{var n=e.i(677850),i=t([n]);function o(e,t){let r=e.safeParse(t);if(r.success)return{success:!0,data:r.data};let n=Array.isArray(r.error?.issues)?r.error.issues:[];return{success:!1,error:{message:"Invalid request",details:n.map(e=>({field:e.path.join("."),message:e.message}))}}}function a(e){return!1===e.success}[n]=i.then?(await i)():i,n.z.object({password:n.z.string().min(1,"Password is required").max(200)}),e.s(["isValidationFailure",()=>a,"validateBody",()=>o]),r()}catch(e){r(e)}},!1),16023,e=>{"use strict";var t=e.i(522734),r=e.i(814747);let n=["clientId","clientSecret","tokenUrl","authUrl","refreshUrl"],i=0,o=null;var a=e.i(828059);let s=parseInt(process.env.FETCH_TIMEOUT_MS||"120000",10),l=parseInt(process.env.STREAM_IDLE_TIMEOUT_MS||"120000",10),u=(0,a.generateLegacyProviders)();!function(e){let a;if(o&&Date.now()-i<6e4)return;let s=(a=process.env.DATA_DIR||(0,r.join)(process.cwd(),"data"),(0,r.join)(a,"provider-credentials.json"));if(!(0,t.existsSync)(s))return o||console.log("[CREDENTIALS] No external credentials file found, using defaults."),o=e,i=Date.now();try{let r=(0,t.readFileSync)(s,"utf-8"),i=JSON.parse(r),a=0;for(let[t,r]of Object.entries(i)){if(!e[t]){console.log(`[CREDENTIALS] Warning: unknown provider "${t}" in credentials file, skipping.`);continue}if(!r||"object"!=typeof r){console.log(`[CREDENTIALS] Warning: provider "${t}" value must be an object, got ${typeof r}. Skipping.`);continue}for(let i of n)void 0!==r[i]&&(e[t][i]=r[i],a++)}let l=null!==o;console.log(`[CREDENTIALS] ${l?"Reloaded":"Loaded"} external credentials: ${a} field(s) from ${s}`)}catch(e){console.log(`[CREDENTIALS] Error reading credentials file: ${e.message}. Using defaults.`)}o=e,i=Date.now()}(u);let c={BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,NOT_ACCEPTABLE:406,REQUEST_TIMEOUT:408,RATE_LIMITED:429,SERVER_ERROR:500,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504},d={[c.BAD_REQUEST]:{type:"invalid_request_error",code:"bad_request"},[c.UNAUTHORIZED]:{type:"authentication_error",code:"invalid_api_key"},[c.FORBIDDEN]:{type:"permission_error",code:"insufficient_quota"},[c.NOT_FOUND]:{type:"invalid_request_error",code:"model_not_found"},[c.RATE_LIMITED]:{type:"rate_limit_error",code:"rate_limit_exceeded"},[c.SERVER_ERROR]:{type:"server_error",code:"internal_server_error"},[c.BAD_GATEWAY]:{type:"server_error",code:"bad_gateway"},[c.SERVICE_UNAVAILABLE]:{type:"server_error",code:"service_unavailable"},[c.GATEWAY_TIMEOUT]:{type:"server_error",code:"gateway_timeout"}},p={[c.BAD_REQUEST]:"Bad request",[c.UNAUTHORIZED]:"Invalid API key provided",[c.FORBIDDEN]:"You exceeded your current quota",[c.NOT_FOUND]:"Model not found",[c.RATE_LIMITED]:"Rate limit exceeded",[c.SERVER_ERROR]:"Internal server error",[c.BAD_GATEWAY]:"Bad gateway - upstream provider error",[c.SERVICE_UNAVAILABLE]:"Service temporarily unavailable",[c.GATEWAY_TIMEOUT]:"Gateway timeout"};e.s(["ANTIGRAVITY_DEFAULT_SYSTEM",0,"Please ignore the following [ignore]You are Antigravity, a powerful agentic AI coding assistant designed by the Google Deepmind team working on Advanced Agentic Coding.You are pair programming with a USER to solve their coding task. The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.**Absolute paths only****Proactiveness**[/ignore]","BACKOFF_CONFIG",0,{base:1e3,max:12e4,maxLevel:15},"BACKOFF_STEPS_MS",0,[6e4,12e4,3e5,6e5,12e5],"CACHE_TTL",0,{userInfo:300,modelAlias:3600},"CLAUDE_SYSTEM_PROMPT",0,"You are Claude Code, Anthropic's official CLI for Claude.","COOLDOWN_MS",0,{unauthorized:12e4,paymentRequired:12e4,notFound:12e4,notFoundLocal:5e3,transientInitial:5e3,transientMax:6e4,transient:5e3,requestNotAllowed:5e3,rateLimit:12e4,serviceUnavailable:2e3,authExpired:12e4},"DEFAULT_API_LIMITS",0,{requestsPerMinute:100,minTimeBetweenRequests:200,concurrentRequests:10},"DEFAULT_ERROR_MESSAGES",0,p,"DEFAULT_MAX_TOKENS",0,64e3,"DEFAULT_MIN_TOKENS",0,32e3,"ERROR_TYPES",0,d,"FETCH_TIMEOUT_MS",0,s,"HTTP_STATUS",0,c,"OAUTH_ENDPOINTS",0,{google:{token:"https://oauth2.googleapis.com/token",auth:"https://accounts.google.com/o/oauth2/auth"},openai:{token:"https://auth.openai.com/oauth/token",auth:"https://auth.openai.com/oauth/authorize"},anthropic:{token:"https://console.anthropic.com/v1/oauth/token",auth:"https://console.anthropic.com/v1/oauth/authorize"},qwen:{token:"https://chat.qwen.ai/api/v1/oauth2/token",auth:"https://chat.qwen.ai/api/v1/oauth2/device/code"},iflow:{token:"https://iflow.cn/oauth/token",auth:"https://iflow.cn/oauth"},github:{token:"https://github.com/login/oauth/access_token",auth:"https://github.com/login/oauth/authorize",deviceCode:"https://github.com/login/device/code"}},"PROVIDERS",0,u,"PROVIDER_PROFILES",0,{oauth:{transientCooldown:5e3,rateLimitCooldown:6e4,maxBackoffLevel:8,circuitBreakerThreshold:3,circuitBreakerReset:6e4},apikey:{transientCooldown:3e3,rateLimitCooldown:0,maxBackoffLevel:5,circuitBreakerThreshold:5,circuitBreakerReset:3e4},local:{transientCooldown:2e3,rateLimitCooldown:5e3,maxBackoffLevel:3,circuitBreakerThreshold:2,circuitBreakerReset:15e3}},"RateLimitReason",0,{QUOTA_EXHAUSTED:"quota_exhausted",RATE_LIMIT_EXCEEDED:"rate_limit_exceeded",MODEL_CAPACITY:"model_capacity",SERVER_ERROR:"server_error",AUTH_ERROR:"auth_error",UNKNOWN:"unknown"},"SKIP_PATTERNS",0,["Please write a 5-10 word title for the following conversation:"],"STREAM_IDLE_TIMEOUT_MS",0,l],16023)},85713,e=>{"use strict";var t=e.i(16023),r=e.i(828059);let n="https://api.openai.com/v1",i="https://api.anthropic.com/v1";function o(e){return"string"==typeof e&&e.startsWith("openai-compatible-")}function a(e){return"string"==typeof e&&e.startsWith("anthropic-compatible-")}function s(e){return o(e)&&e.includes("responses")?"responses":"chat"}function l(e){let t=Object.prototype.hasOwnProperty.call(e,"input")&&void 0!==e.input,r=void 0!==e.max_output_tokens||void 0!==e.previous_response_id||void 0!==e.reasoning;if(t||r)return"openai-responses";if(e.request?.contents&&"antigravity"===e.userAgent)return"antigravity";if(e.contents&&Array.isArray(e.contents))return"gemini";if(e.stream_options||e.response_format||void 0!==e.logprobs||void 0!==e.top_logprobs||void 0!==e.n||void 0!==e.presence_penalty||void 0!==e.frequency_penalty||e.logit_bias||e.user)return"openai";if(e.messages&&Array.isArray(e.messages)){let t=e.messages[0];if(t?.content&&Array.isArray(t.content)){let r=t.content[0];if(r?.type==="text"&&!e.model?.includes("/")){if(e.system||e.anthropic_version)return"claude";let r=t.content.some(e=>"image"===e.type&&e.source?.type==="base64"),n=t.content.some(e=>"image_url"===e.type&&e.image_url?.url);if(r)return"claude";if(n)return"openai";if(t.content.some(e=>"tool_use"===e.type||"tool_result"===e.type))return"claude"}}if(void 0!==e.system||e.anthropic_version||e.max_tokens&&!e.stream_options&&!e.response_format)return"claude"}return"openai"}function u(e){if(o(e)){let r=s(e);return{...t.PROVIDERS.openai,format:"responses"===r?"openai-responses":"openai",baseUrl:n}}return a(e)?{...t.PROVIDERS.anthropic,format:"claude",baseUrl:i}:t.PROVIDERS[e]||t.PROVIDERS.openai}function c(e,t,l=!0,d={}){if(o(e)){var p;let t,r=s(e);return p=d?.baseUrl||n,t=p.replace(/\/$/,""),`${t}${"responses"===r?"/responses":"/chat/completions"}`}if(a(e)){let e;return e=(d?.baseUrl||i).replace(/\/$/,""),`${e}/messages`}let g=(0,r.getRegistryEntry)(e),h=u(e);if(g){if(g.baseUrls){let e=d?.baseUrlIndex||0,r=g.baseUrls[e]||g.baseUrls[0];return g.urlBuilder?g.urlBuilder(r,t,l):r}if(g.urlBuilder)return g.urlBuilder(g.baseUrl,t,l);if(g.urlSuffix)return`${g.baseUrl}${g.urlSuffix}`}return h.baseUrl}function d(e,t,n=!0,i=null){let o=u(e),s=(0,r.getRegistryEntry)(e),l={"Content-Type":"application/json",...o.headers};if(a(e))t.apiKey?l["x-api-key"]=t.apiKey:t.accessToken&&(l.Authorization=`Bearer ${t.accessToken}`),l["anthropic-version"]||(l["anthropic-version"]="2023-06-01");else if("github"===e){let e=t.copilotToken||t.accessToken;l.Authorization=`Bearer ${e}`,l["x-request-id"]=crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}),n||(l.Accept="application/json")}else if(s){let e=s.authHeader||"bearer";if("x-api-key"===e){let e=t.apiKey||t.accessToken;e&&(l["x-api-key"]=e)}else"x-goog-api-key"===e?t.apiKey?l["x-goog-api-key"]=t.apiKey:t.accessToken&&(l.Authorization=`Bearer ${t.accessToken}`):l.Authorization=`Bearer ${t.apiKey||t.accessToken}`}else l.Authorization=`Bearer ${t.apiKey||t.accessToken}`;return n&&(l.Accept="text/event-stream"),l}function p(e){if(o(e))return"responses"===s(e)?"openai-responses":"openai";if(a(e))return"claude";let t=(0,r.getRegistryEntry)(e);return t?t.format||"openai":u(e).format||"openai"}function g(e){return!function(e){let t=e.messages||e.contents;if(!t?.length)return!0;let r=t[t.length-1];return r?.role==="user"}(e)&&(delete e.reasoning_effort,delete e.thinking),e}e.s(["buildProviderHeaders",()=>d,"buildProviderUrl",()=>c,"detectFormat",()=>l,"getTargetFormat",()=>p,"normalizeThinkingConfig",()=>g])},496727,e=>{"use strict";e.s(["FORMATS",0,{OPENAI:"openai",OPENAI_RESPONSES:"openai-responses",OPENAI_RESPONSE:"openai-response",CLAUDE:"claude",GEMINI:"gemini",GEMINI_CLI:"gemini-cli",CODEX:"codex",ANTIGRAVITY:"antigravity",KIRO:"kiro",CURSOR:"cursor"}])},384094,e=>{"use strict";let t="passthrough",r={none:0,low:1024,medium:10240,high:131072},n={none:0,low:1024,medium:10240,high:131072},i={mode:t,customBudget:10240,effortLevel:"medium"},o={...i};function a(e){o={...i,...e}}function s(){return{...o}}function l(e,i=null){let a=i||o;if(!e||"object"!=typeof e)return e;let s=function(e){if(!e||"object"!=typeof e)return e;let t={...e},r=t.thinkingLevel||t.thinking_level;if("string"==typeof r&&void 0!==n[r]){let e=n[r];t.thinking={type:e>0?"enabled":"disabled",budget_tokens:e},delete t.thinkingLevel,delete t.thinking_level}let i=t.generationConfig?.thinkingConfig?.thinkingLevel||t.generationConfig?.thinking_config?.thinkingLevel;if("string"==typeof i&&void 0!==n[i]){let e=n[i];t.generationConfig={...t.generationConfig,thinking_config:{thinking_budget:e}},t.generationConfig.thinkingConfig&&delete t.generationConfig.thinkingConfig}return t}(e);switch(s=function(e){if(!e||"object"!=typeof e||!(e.model||"").endsWith("-thinking")||e.thinking)return e;let t={...e};return t.thinking={type:"enabled",budget_tokens:r.medium},t}(s),a.mode){case"auto":let c;return c={...s},delete c.thinking,delete c.reasoning_effort,delete c.reasoning,c.generationConfig&&(c.generationConfig={...c.generationConfig},delete c.generationConfig.thinking_config,delete c.generationConfig.thinkingConfig),c;case t:default:return s;case"custom":return u(s,a.customBudget);case"adaptive":return function(e,t){let n=e.messages||e.input||[],i=n.length,o=(e.tools||[]).length,a=0;for(let e=n.length-1;e>=0;e--){let t=n[e];if("user"===t.role){a="string"==typeof t.content?t.content.length:JSON.stringify(t.content||"").length;break}}let s=1;return i>10&&(s+=.5),o>3&&(s+=.5),a>2e3&&(s+=.3),u(e,Math.min(Math.ceil((r[t.effortLevel]||r.medium)*s),131072))}(s,a)}}function u(e,t){let r,n={...e};return(n.thinking||(r=n.model||"").includes("claude")||r.includes("o1")||r.includes("o3")||r.includes("o4")||r.includes("gemini")||r.endsWith("-thinking")||r.includes("thinking"))&&(n.thinking={type:t>0?"enabled":"disabled",budget_tokens:t}),(void 0!==n.reasoning_effort||void 0!==n.reasoning)&&(t<=0?(delete n.reasoning_effort,delete n.reasoning):t<=1024?n.reasoning_effort="low":t<=10240?n.reasoning_effort="medium":n.reasoning_effort="high"),(n.generationConfig?.thinking_config||n.generationConfig?.thinkingConfig)&&(n.generationConfig={...n.generationConfig,thinking_config:{thinking_budget:t}}),n}e.s(["applyThinkingBudget",()=>l,"getThinkingBudgetConfig",()=>s,"setThinkingBudgetConfig",()=>a])},466712,e=>e.a(async(t,r)=>{try{var n=e.i(89171),i=e.i(85713),o=e.i(352812),a=e.i(496727);e.i(245272);var s=e.i(385498),l=e.i(676088),u=e.i(200392),c=t([l,u]);function d(e){return e&&"object"==typeof e&&!Array.isArray(e)?e:{}}function p(e){let t=d(e.body);return Object.keys(t).length>0?t:e}function g(e){let t=e.model;return"string"==typeof t&&t.trim().length>0?t:"test-model"}async function h(e){let t;try{t=await e.json()}catch{return n.NextResponse.json({success:!1,error:{message:"Invalid request",details:[{field:"body",message:"Invalid JSON body"}]}},{status:400})}try{let e,c=(0,u.validateBody)(l.translatorTranslateSchema,t);if((0,u.isValidationFailure)(c))return n.NextResponse.json({success:!1,error:c.error},{status:400});let{step:h,provider:f,body:m,sourceFormat:y,targetFormat:_}=c.data;if("direct"===h){let e=y||(0,i.detectFormat)(m),t=_||(f?(0,i.getTargetFormat)(f):"openai"),r=g(d(m)),a=(0,o.translateRequest)(e,t,r,m,!0,null,f);return n.NextResponse.json({success:!0,sourceFormat:e,targetFormat:t,result:a})}switch(h){case 1:{let t=p(d(m)),r=(0,i.detectFormat)(t);e={timestamp:m.timestamp||new Date().toISOString(),endpoint:m.endpoint||"/v1/messages",headers:m.headers||{},body:t,_detectedFormat:r};break}case 2:{let t=p(d(m)),r=(0,i.detectFormat)(t),n=a.FORMATS.OPENAI,s=g(t),l=(0,o.translateRequest)(r,n,s,t,!0,null,f);e={timestamp:new Date().toISOString(),headers:{},body:l};break}case 3:{let t=p(d(m)),r=a.FORMATS.OPENAI,n=(0,i.getTargetFormat)(f),s=g(t),l=(0,o.translateRequest)(r,n,s,t,!0,null,f);e={timestamp:new Date().toISOString(),body:l};break}case 4:{var r;let t,o=p(d(m)),a=g(o),l=(await (0,s.getProviderConnections)({provider:f})).find(e=>!1!==e.isActive);if(!l)return n.NextResponse.json({success:!1,error:`No active connection found for provider: ${f}`},{status:400});let u={apiKey:l.apiKey,accessToken:l.accessToken,refreshToken:l.refreshToken,copilotToken:l.copilotToken,projectId:l.projectId,providerSpecificData:l.providerSpecificData},c=(0,i.buildProviderUrl)(f,a,!0,{baseUrlIndex:0,baseUrl:(r=l.providerSpecificData,t=d(r).baseUrl,"string"==typeof t&&t.trim().length>0?t:void 0)}),h=(0,i.buildProviderHeaders)(f,u,!0,o);e={timestamp:new Date().toISOString(),url:c,headers:h,body:o};break}default:return n.NextResponse.json({success:!1,error:"Invalid step"},{status:400})}return n.NextResponse.json({success:!0,result:e})}catch(e){return console.error("Error translating:",e),n.NextResponse.json({success:!1,error:"Failed to translate request"},{status:500})}}[l,u]=c.then?(await c)():c,e.s(["POST",()=>h]),r()}catch(e){r(e)}},!1),590068,e=>e.a(async(t,r)=>{try{var n=e.i(747909),i=e.i(174017),o=e.i(996250),a=e.i(759756),s=e.i(561916),l=e.i(174677),u=e.i(869741),c=e.i(316795),d=e.i(487718),p=e.i(995169),g=e.i(47587),h=e.i(666012),f=e.i(570101),m=e.i(626937),y=e.i(10372),_=e.i(193695);e.i(52474);var v=e.i(600220),E=e.i(466712),R=t([E]);[E]=R.then?(await R)():R;let T=new n.AppRouteRouteModule({definition:{kind:i.RouteKind.APP_ROUTE,page:"/api/translator/translate/route",pathname:"/api/translator/translate",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/translator/translate/route.ts",nextConfigOutput:"standalone",userland:E}),{workAsyncStorage:k,workUnitAsyncStorage:b,serverHooks:S}=T;function x(){return(0,o.patchFetch)({workAsyncStorage:k,workUnitAsyncStorage:b})}async function A(e,t,r){T.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let n="/api/translator/translate/route";n=n.replace(/\/index$/,"")||"/";let o=await T.prepare(e,t,{srcPage:n,multiZoneDraftMode:!1});if(!o)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:E,params:R,nextConfig:x,parsedUrl:A,isDraftMode:k,prerenderManifest:b,routerServerContext:S,isOnDemandRevalidate:C,revalidateOnlyGenerated:O,resolvedPathname:I,clientReferenceManifest:w,serverActionsManifest:U}=o,D=(0,u.normalizeAppPath)(n),N=!!(b.dynamicRoutes[D]||b.routes[I]),P=async()=>((null==S?void 0:S.render404)?await S.render404(e,t,A,!1):t.end("This page could not be found"),null);if(N&&!k){let e=!!b.routes[I],t=b.dynamicRoutes[D];if(t&&!1===t.fallback&&!e){if(x.experimental.adapterPath)return await P();throw new _.NoFallbackError}}let j=null;!N||T.isDev||k||(j=I,j="/index"===j?"/":j);let L=!0===T.isDev||!N,M=N&&!L;U&&w&&(0,l.setManifestsSingleton)({page:n,clientReferenceManifest:w,serverActionsManifest:U});let q=e.method||"GET",B=(0,s.getTracer)(),F=B.getActiveScopeSpan(),$={params:R,prerenderManifest:b,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:L,incrementalCache:(0,a.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:x.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,i)=>T.onRequestError(e,t,n,i,S)},sharedContext:{buildId:E}},H=new c.NodeNextRequest(e),K=new c.NodeNextResponse(t),V=d.NextRequestAdapter.fromNodeNextRequest(H,(0,d.signalFromNodeResponse)(t));try{let o=async e=>T.handle(V,$).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=B.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let i=r.get("next.route");if(i){let t=`${q} ${i}`;e.setAttributes({"next.route":i,"http.route":i,"next.span_name":t}),e.updateName(t)}else e.updateName(`${q} ${n}`)}),l=!!(0,a.getRequestMeta)(e,"minimalMode"),u=async a=>{var s,u;let c=async({previousCacheEntry:i})=>{try{if(!l&&C&&O&&!i)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await o(a);e.fetchMetrics=$.renderOpts.fetchMetrics;let s=$.renderOpts.pendingWaitUntil;s&&r.waitUntil&&(r.waitUntil(s),s=void 0);let u=$.renderOpts.collectedTags;if(!N)return await (0,h.sendResponse)(H,K,n,$.renderOpts.pendingWaitUntil),null;{let e=await n.blob(),t=(0,f.toNodeOutgoingHttpHeaders)(n.headers);u&&(t[y.NEXT_CACHE_TAGS_HEADER]=u),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==$.renderOpts.collectedRevalidate&&!($.renderOpts.collectedRevalidate>=y.INFINITE_CACHE)&&$.renderOpts.collectedRevalidate,i=void 0===$.renderOpts.collectedExpire||$.renderOpts.collectedExpire>=y.INFINITE_CACHE?void 0:$.renderOpts.collectedExpire;return{value:{kind:v.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:i}}}}catch(t){throw(null==i?void 0:i.isStale)&&await T.onRequestError(e,t,{routerKind:"App Router",routePath:n,routeType:"route",revalidateReason:(0,g.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,S),t}},d=await T.handleResponse({req:e,nextConfig:x,cacheKey:j,routeKind:i.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:b,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:O,responseGenerator:c,waitUntil:r.waitUntil,isMinimalMode:l});if(!N)return null;if((null==d||null==(s=d.value)?void 0:s.kind)!==v.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==d||null==(u=d.value)?void 0:u.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});l||t.setHeader("x-nextjs-cache",C?"REVALIDATED":d.isMiss?"MISS":d.isStale?"STALE":"HIT"),k&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let p=(0,f.fromNodeOutgoingHttpHeaders)(d.value.headers);return l&&N||p.delete(y.NEXT_CACHE_TAGS_HEADER),!d.cacheControl||t.getHeader("Cache-Control")||p.get("Cache-Control")||p.set("Cache-Control",(0,m.getCacheControlHeader)(d.cacheControl)),await (0,h.sendResponse)(H,K,new Response(d.value.body,{headers:p,status:d.value.status||200})),null};F?await u(F):await B.withPropagatedContext(e.headers,()=>B.trace(p.BaseServerSpan.handleRequest,{spanName:`${q} ${n}`,kind:s.SpanKind.SERVER,attributes:{"http.method":q,"http.target":e.url}},u))}catch(t){if(t instanceof _.NoFallbackError||await T.onRequestError(e,t,{routerKind:"App Router",routePath:D,routeType:"route",revalidateReason:(0,g.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,S),N)throw t;return await (0,h.sendResponse)(H,K,new Response(null,{status:500})),null}}e.s(["handler",()=>A,"patchFetch",()=>x,"routeModule",()=>T,"serverHooks",()=>S,"workAsyncStorage",()=>k,"workUnitAsyncStorage",()=>b]),r()}catch(e){r(e)}},!1),606102,e=>{e.v(e=>Promise.resolve().then(()=>e(548941)))},789543,e=>{e.v(e=>Promise.resolve().then(()=>e(385498)))},579042,e=>{e.v(t=>Promise.all(["server/chunks/src_shared_utils_apiKey_ts_fa113e09._.js"].map(t=>e.l(t))).then(()=>t(65448)))},49794,e=>{e.v(t=>Promise.all(["server/chunks/src_shared_constants_pricing_ts_65de0558._.js"].map(t=>e.l(t))).then(()=>t(404503)))},386305,e=>{e.v(e=>Promise.resolve().then(()=>e(878947)))}];
2
2
 
3
3
  //# sourceMappingURL=%5Broot-of-the-server%5D__e56edf04._.js.map
@@ -13,6 +13,6 @@ module.exports=[254799,(e,t,r)=>{t.exports=e.x("crypto",()=>require("crypto"))},
13
13
  `)}function s(e){let t=r();if(t)try{t.prepare(`
14
14
  INSERT INTO audit_log (action, actor, target, details, ip_address)
15
15
  VALUES (?, ?, ?, ?, ?)
16
- `).run(e.action,e.actor||"system",e.target||null,"object"==typeof e.details?JSON.stringify(e.details):e.details||null,e.ipAddress||null)}catch{}}function i(e={}){let t=r();if(!t)return[];let o=[],n=[];e.action&&(o.push("action = ?"),n.push(e.action)),e.actor&&(o.push("actor = ?"),n.push(e.actor));let s=o.length>0?`WHERE ${o.join(" AND ")}`:"",a=e.limit||100,l=e.offset||0;return t.prepare(`SELECT * FROM audit_log ${s} ORDER BY timestamp DESC LIMIT ? OFFSET ?`).all(...n,a,l).map(e=>({...e,details:e.details?JSON.parse(String(e.details)):null}))}let a=new Set,l=new Map,u=!1,c=!1;for(let e of(process.env.NO_LOG_API_KEY_IDS||"").split(",").map(e=>e.trim()).filter(Boolean))a.add(e);function d(e,t){t?a.add(e):a.delete(e),l.set(e,{value:t,timestamp:Date.now()})}function p(e){if(!e)return!1;if(a.has(e))return!0;let t=function(e){let t=r();if(!t||!e||!function(e){if(u)return c;try{c=e.prepare("PRAGMA table_info(api_keys)").all().some(e=>"no_log"===e.name)}catch{c=!1}return u=!0,c}(t))return!1;let o=l.get(e);if(o&&Date.now()-o.timestamp<3e4)return o.value;try{let r=t.prepare("SELECT no_log FROM api_keys WHERE id = ?").get(e),o=!!(r&&1===Number(r.no_log));return l.set(e,{value:o,timestamp:Date.now()}),o}catch{return!1}}(e);return t&&a.add(e),t}function E(){return o}function h(){let e=r();if(!e)return{deletedUsage:0,deletedCallLogs:0,deletedAuditLogs:0};let t=new Date(Date.now()-24*o*36e5).toISOString(),n=0,i=0,a=0;try{n=e.prepare("DELETE FROM usage_history WHERE timestamp < ?").run(t).changes}catch{}try{i=e.prepare("DELETE FROM call_logs WHERE timestamp < ?").run(t).changes}catch{}try{let t=new Date(Date.now()-2*o*864e5).toISOString();a=e.prepare("DELETE FROM audit_log WHERE timestamp < ?").run(t).changes}catch{}return s({action:"compliance.cleanup",details:{deletedUsage:n,deletedCallLogs:i,deletedAuditLogs:a,retentionDays:o}}),{deletedUsage:n,deletedCallLogs:i,deletedAuditLogs:a}}e.s(["cleanupExpiredLogs",()=>h,"getAuditLog",()=>i,"getRetentionDays",()=>E,"initAuditLog",()=>n,"isNoLog",()=>p,"logAuditEvent",()=>s,"setNoLog",()=>d])},359281,e=>{"use strict";var t=e.i(522734),r=e.i(814747);let o=["clientId","clientSecret","tokenUrl","authUrl","refreshUrl"],n=0,s=null;var i=e.i(142225);let a=parseInt(process.env.FETCH_TIMEOUT_MS||"120000",10);parseInt(process.env.STREAM_IDLE_TIMEOUT_MS||"300000",10);let l=(0,i.generateLegacyProviders)();!function(e){let i;if(s&&Date.now()-n<6e4)return;let a=(i=process.env.DATA_DIR||(0,r.join)(process.cwd(),"data"),(0,r.join)(i,"provider-credentials.json"));if(!(0,t.existsSync)(a))return s||console.log("[CREDENTIALS] No external credentials file found, using defaults."),s=e,n=Date.now();try{let r=(0,t.readFileSync)(a,"utf-8"),n=JSON.parse(r),i=0;for(let[t,r]of Object.entries(n)){if(!e[t]){console.log(`[CREDENTIALS] Warning: unknown provider "${t}" in credentials file, skipping.`);continue}if(!r||"object"!=typeof r){console.log(`[CREDENTIALS] Warning: provider "${t}" value must be an object, got ${typeof r}. Skipping.`);continue}for(let n of o)void 0!==r[n]&&(e[t][n]=r[n],i++)}let l=null!==s;console.log(`[CREDENTIALS] ${l?"Reloaded":"Loaded"} external credentials: ${i} field(s) from ${a}`)}catch(e){console.log(`[CREDENTIALS] Error reading credentials file: ${e.message}. Using defaults.`)}s=e,n=Date.now()}(l);let u={BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,NOT_ACCEPTABLE:406,REQUEST_TIMEOUT:408,RATE_LIMITED:429,SERVER_ERROR:500,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504};u.BAD_REQUEST,u.UNAUTHORIZED,u.FORBIDDEN,u.NOT_FOUND,u.RATE_LIMITED,u.SERVER_ERROR,u.BAD_GATEWAY,u.SERVICE_UNAVAILABLE,u.GATEWAY_TIMEOUT,u.BAD_REQUEST,u.UNAUTHORIZED,u.FORBIDDEN,u.NOT_FOUND,u.RATE_LIMITED,u.SERVER_ERROR,u.BAD_GATEWAY,u.SERVICE_UNAVAILABLE,u.GATEWAY_TIMEOUT,e.s(["FETCH_TIMEOUT_MS",0,a,"HTTP_STATUS",0,u,"OAUTH_ENDPOINTS",0,{google:{token:"https://oauth2.googleapis.com/token",auth:"https://accounts.google.com/o/oauth2/auth"},openai:{token:"https://auth.openai.com/oauth/token",auth:"https://auth.openai.com/oauth/authorize"},anthropic:{token:"https://console.anthropic.com/v1/oauth/token",auth:"https://console.anthropic.com/v1/oauth/authorize"},qwen:{token:"https://chat.qwen.ai/api/v1/oauth2/token",auth:"https://chat.qwen.ai/api/v1/oauth2/device/code"},iflow:{token:"https://iflow.cn/oauth/token",auth:"https://iflow.cn/oauth"},github:{token:"https://github.com/login/oauth/access_token",auth:"https://github.com/login/oauth/authorize",deviceCode:"https://github.com/login/device/code"}},"PROVIDERS",0,l],359281)},833389,e=>{e.v(t=>Promise.all(["server/chunks/[root-of-the-server]__b813a3b3._.js","server/chunks/src_lib_db_core_ts_e0a3105a._.js","server/chunks/src_lib_db_providers_ts_d85526d8._.js"].map(t=>e.l(t))).then(()=>t(543125)))},893231,e=>{e.v(t=>Promise.all(["server/chunks/[root-of-the-server]__09627431._.js"].map(t=>e.l(t))).then(()=>t(36886)))},38463,e=>{e.v(t=>Promise.all(["server/chunks/src_shared_constants_pricing_ts_4245a86e._.js"].map(t=>e.l(t))).then(()=>t(384064)))},822244,e=>{e.v(t=>Promise.all(["server/chunks/open-sse_config_providerModels_ts_4c77a918._.js","server/chunks/open-sse_config_providerRegistry_ts_2f74ec2a._.js"].map(t=>e.l(t))).then(()=>t(588617)))}];
16
+ `).run(e.action,e.actor||"system",e.target||null,"object"==typeof e.details?JSON.stringify(e.details):e.details||null,e.ipAddress||null)}catch{}}function i(e={}){let t=r();if(!t)return[];let o=[],n=[];e.action&&(o.push("action = ?"),n.push(e.action)),e.actor&&(o.push("actor = ?"),n.push(e.actor));let s=o.length>0?`WHERE ${o.join(" AND ")}`:"",a=e.limit||100,l=e.offset||0;return t.prepare(`SELECT * FROM audit_log ${s} ORDER BY timestamp DESC LIMIT ? OFFSET ?`).all(...n,a,l).map(e=>({...e,details:e.details?JSON.parse(String(e.details)):null}))}let a=new Set,l=new Map,u=!1,c=!1;for(let e of(process.env.NO_LOG_API_KEY_IDS||"").split(",").map(e=>e.trim()).filter(Boolean))a.add(e);function d(e,t){t?a.add(e):a.delete(e),l.set(e,{value:t,timestamp:Date.now()})}function p(e){if(!e)return!1;if(a.has(e))return!0;let t=function(e){let t=r();if(!t||!e||!function(e){if(u)return c;try{c=e.prepare("PRAGMA table_info(api_keys)").all().some(e=>"no_log"===e.name)}catch{c=!1}return u=!0,c}(t))return!1;let o=l.get(e);if(o&&Date.now()-o.timestamp<3e4)return o.value;try{let r=t.prepare("SELECT no_log FROM api_keys WHERE id = ?").get(e),o=!!(r&&1===Number(r.no_log));return l.set(e,{value:o,timestamp:Date.now()}),o}catch{return!1}}(e);return t&&a.add(e),t}function E(){return o}function h(){let e=r();if(!e)return{deletedUsage:0,deletedCallLogs:0,deletedAuditLogs:0};let t=new Date(Date.now()-24*o*36e5).toISOString(),n=0,i=0,a=0;try{n=e.prepare("DELETE FROM usage_history WHERE timestamp < ?").run(t).changes}catch{}try{i=e.prepare("DELETE FROM call_logs WHERE timestamp < ?").run(t).changes}catch{}try{let t=new Date(Date.now()-2*o*864e5).toISOString();a=e.prepare("DELETE FROM audit_log WHERE timestamp < ?").run(t).changes}catch{}return s({action:"compliance.cleanup",details:{deletedUsage:n,deletedCallLogs:i,deletedAuditLogs:a,retentionDays:o}}),{deletedUsage:n,deletedCallLogs:i,deletedAuditLogs:a}}e.s(["cleanupExpiredLogs",()=>h,"getAuditLog",()=>i,"getRetentionDays",()=>E,"initAuditLog",()=>n,"isNoLog",()=>p,"logAuditEvent",()=>s,"setNoLog",()=>d])},359281,e=>{"use strict";var t=e.i(522734),r=e.i(814747);let o=["clientId","clientSecret","tokenUrl","authUrl","refreshUrl"],n=0,s=null;var i=e.i(142225);let a=parseInt(process.env.FETCH_TIMEOUT_MS||"120000",10);parseInt(process.env.STREAM_IDLE_TIMEOUT_MS||"120000",10);let l=(0,i.generateLegacyProviders)();!function(e){let i;if(s&&Date.now()-n<6e4)return;let a=(i=process.env.DATA_DIR||(0,r.join)(process.cwd(),"data"),(0,r.join)(i,"provider-credentials.json"));if(!(0,t.existsSync)(a))return s||console.log("[CREDENTIALS] No external credentials file found, using defaults."),s=e,n=Date.now();try{let r=(0,t.readFileSync)(a,"utf-8"),n=JSON.parse(r),i=0;for(let[t,r]of Object.entries(n)){if(!e[t]){console.log(`[CREDENTIALS] Warning: unknown provider "${t}" in credentials file, skipping.`);continue}if(!r||"object"!=typeof r){console.log(`[CREDENTIALS] Warning: provider "${t}" value must be an object, got ${typeof r}. Skipping.`);continue}for(let n of o)void 0!==r[n]&&(e[t][n]=r[n],i++)}let l=null!==s;console.log(`[CREDENTIALS] ${l?"Reloaded":"Loaded"} external credentials: ${i} field(s) from ${a}`)}catch(e){console.log(`[CREDENTIALS] Error reading credentials file: ${e.message}. Using defaults.`)}s=e,n=Date.now()}(l);let u={BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,NOT_ACCEPTABLE:406,REQUEST_TIMEOUT:408,RATE_LIMITED:429,SERVER_ERROR:500,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504};u.BAD_REQUEST,u.UNAUTHORIZED,u.FORBIDDEN,u.NOT_FOUND,u.RATE_LIMITED,u.SERVER_ERROR,u.BAD_GATEWAY,u.SERVICE_UNAVAILABLE,u.GATEWAY_TIMEOUT,u.BAD_REQUEST,u.UNAUTHORIZED,u.FORBIDDEN,u.NOT_FOUND,u.RATE_LIMITED,u.SERVER_ERROR,u.BAD_GATEWAY,u.SERVICE_UNAVAILABLE,u.GATEWAY_TIMEOUT,e.s(["FETCH_TIMEOUT_MS",0,a,"HTTP_STATUS",0,u,"OAUTH_ENDPOINTS",0,{google:{token:"https://oauth2.googleapis.com/token",auth:"https://accounts.google.com/o/oauth2/auth"},openai:{token:"https://auth.openai.com/oauth/token",auth:"https://auth.openai.com/oauth/authorize"},anthropic:{token:"https://console.anthropic.com/v1/oauth/token",auth:"https://console.anthropic.com/v1/oauth/authorize"},qwen:{token:"https://chat.qwen.ai/api/v1/oauth2/token",auth:"https://chat.qwen.ai/api/v1/oauth2/device/code"},iflow:{token:"https://iflow.cn/oauth/token",auth:"https://iflow.cn/oauth"},github:{token:"https://github.com/login/oauth/access_token",auth:"https://github.com/login/oauth/authorize",deviceCode:"https://github.com/login/device/code"}},"PROVIDERS",0,l],359281)},833389,e=>{e.v(t=>Promise.all(["server/chunks/[root-of-the-server]__b813a3b3._.js","server/chunks/src_lib_db_core_ts_e0a3105a._.js","server/chunks/src_lib_db_providers_ts_d85526d8._.js"].map(t=>e.l(t))).then(()=>t(543125)))},893231,e=>{e.v(t=>Promise.all(["server/chunks/[root-of-the-server]__09627431._.js"].map(t=>e.l(t))).then(()=>t(36886)))},38463,e=>{e.v(t=>Promise.all(["server/chunks/src_shared_constants_pricing_ts_4245a86e._.js"].map(t=>e.l(t))).then(()=>t(384064)))},822244,e=>{e.v(t=>Promise.all(["server/chunks/open-sse_config_providerModels_ts_4c77a918._.js","server/chunks/open-sse_config_providerRegistry_ts_2f74ec2a._.js"].map(t=>e.l(t))).then(()=>t(588617)))}];
17
17
 
18
18
  //# sourceMappingURL=%5Broot-of-the-server%5D__e6e94646._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[814747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},522734,(e,t,r)=>{t.exports=e.x("fs",()=>require("fs"))},918622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},556704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},832319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},324725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},270406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},193695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},442315,(e,t,r)=>{"use strict";t.exports=e.r(918622)},347540,(e,t,r)=>{"use strict";t.exports=e.r(442315).vendored["react-rsc"].React},819481,(e,t,r)=>{"use strict";var n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,s={},l={RequestCookies:()=>m,ResponseCookies:()=>g,parseCookie:()=>p,parseSetCookie:()=>d,stringifyCookie:()=>c};for(var u in l)n(s,u,{get:l[u],enumerable:!0});function c(e){var t;let r=["path"in e&&e.path&&`Path=${e.path}`,"expires"in e&&(e.expires||0===e.expires)&&`Expires=${("number"==typeof e.expires?new Date(e.expires):e.expires).toUTCString()}`,"maxAge"in e&&"number"==typeof e.maxAge&&`Max-Age=${e.maxAge}`,"domain"in e&&e.domain&&`Domain=${e.domain}`,"secure"in e&&e.secure&&"Secure","httpOnly"in e&&e.httpOnly&&"HttpOnly","sameSite"in e&&e.sameSite&&`SameSite=${e.sameSite}`,"partitioned"in e&&e.partitioned&&"Partitioned","priority"in e&&e.priority&&`Priority=${e.priority}`].filter(Boolean),n=`${e.name}=${encodeURIComponent(null!=(t=e.value)?t:"")}`;return 0===r.length?n:`${n}; ${r.join("; ")}`}function p(e){let t=new Map;for(let r of e.split(/; */)){if(!r)continue;let e=r.indexOf("=");if(-1===e){t.set(r,"true");continue}let[n,a]=[r.slice(0,e),r.slice(e+1)];try{t.set(n,decodeURIComponent(null!=a?a:"true"))}catch{}}return t}function d(e){if(!e)return;let[[t,r],...n]=p(e),{domain:a,expires:o,httponly:i,maxage:s,path:l,samesite:u,secure:c,partitioned:d,priority:m}=Object.fromEntries(n.map(([e,t])=>[e.toLowerCase().replace(/-/g,""),t]));{var g,y,E={name:t,value:decodeURIComponent(r),domain:a,...o&&{expires:new Date(o)},...i&&{httpOnly:!0},..."string"==typeof s&&{maxAge:Number(s)},path:l,...u&&{sameSite:h.includes(g=(g=u).toLowerCase())?g:void 0},...c&&{secure:!0},...m&&{priority:f.includes(y=(y=m).toLowerCase())?y:void 0},...d&&{partitioned:!0}};let e={};for(let t in E)E[t]&&(e[t]=E[t]);return e}}t.exports=((e,t,r,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of o(t))i.call(e,r)||void 0===r||n(e,r,{get:()=>t[r],enumerable:!(s=a(t,r))||s.enumerable});return e})(n({},"__esModule",{value:!0}),s);var h=["strict","lax","none"],f=["low","medium","high"],m=class{constructor(e){this._parsed=new Map,this._headers=e;const t=e.get("cookie");if(t)for(const[e,r]of p(t))this._parsed.set(e,{name:e,value:r})}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed);if(!e.length)return r.map(([e,t])=>t);let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(([e])=>e===n).map(([e,t])=>t)}has(e){return this._parsed.has(e)}set(...e){let[t,r]=1===e.length?[e[0].name,e[0].value]:e,n=this._parsed;return n.set(t,{name:t,value:r}),this._headers.set("cookie",Array.from(n).map(([e,t])=>c(t)).join("; ")),this}delete(e){let t=this._parsed,r=Array.isArray(e)?e.map(e=>t.delete(e)):t.delete(e);return this._headers.set("cookie",Array.from(t).map(([e,t])=>c(t)).join("; ")),r}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(e=>`${e.name}=${encodeURIComponent(e.value)}`).join("; ")}},g=class{constructor(e){var t,r,n;this._parsed=new Map,this._headers=e;const a=null!=(n=null!=(r=null==(t=e.getSetCookie)?void 0:t.call(e))?r:e.get("set-cookie"))?n:[];for(const e of Array.isArray(a)?a:function(e){if(!e)return[];var t,r,n,a,o,i=[],s=0;function l(){for(;s<e.length&&/\s/.test(e.charAt(s));)s+=1;return s<e.length}for(;s<e.length;){for(t=s,o=!1;l();)if(","===(r=e.charAt(s))){for(n=s,s+=1,l(),a=s;s<e.length&&"="!==(r=e.charAt(s))&&";"!==r&&","!==r;)s+=1;s<e.length&&"="===e.charAt(s)?(o=!0,s=a,i.push(e.substring(t,n)),t=s):s=n+1}else s+=1;(!o||s>=e.length)&&i.push(e.substring(t,e.length))}return i}(a)){const t=d(e);t&&this._parsed.set(t.name,t)}}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed.values());if(!e.length)return r;let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(e=>e.name===n)}has(e){return this._parsed.has(e)}set(...e){let[t,r,n]=1===e.length?[e[0].name,e[0].value,e[0]]:e,a=this._parsed;return a.set(t,function(e={name:"",value:""}){return"number"==typeof e.expires&&(e.expires=new Date(e.expires)),e.maxAge&&(e.expires=new Date(Date.now()+1e3*e.maxAge)),(null===e.path||void 0===e.path)&&(e.path="/"),e}({name:t,value:r,...n})),function(e,t){for(let[,r]of(t.delete("set-cookie"),e)){let e=c(r);t.append("set-cookie",e)}}(a,this._headers),this}delete(...e){let[t,r]="string"==typeof e[0]?[e[0]]:[e[0].name,e[0]];return this.set({...r,name:t,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(c).join("; ")}}},677850,e=>e.a(async(t,r)=>{try{let t=await e.y("zod");e.n(t),r()}catch(e){r(e)}},!0),200392,e=>e.a(async(t,r)=>{try{var n=e.i(677850),a=t([n]);function o(e,t){let r=e.safeParse(t);if(r.success)return{success:!0,data:r.data};let n=Array.isArray(r.error?.issues)?r.error.issues:[];return{success:!1,error:{message:"Invalid request",details:n.map(e=>({field:e.path.join("."),message:e.message}))}}}function i(e){return!1===e.success}[n]=a.then?(await a)():a,n.z.object({password:n.z.string().min(1,"Password is required").max(200)}),e.s(["isValidationFailure",()=>i,"validateBody",()=>o]),r()}catch(e){r(e)}},!1),16023,e=>{"use strict";var t=e.i(522734),r=e.i(814747);let n=["clientId","clientSecret","tokenUrl","authUrl","refreshUrl"],a=0,o=null;var i=e.i(828059);let s=parseInt(process.env.FETCH_TIMEOUT_MS||"120000",10),l=parseInt(process.env.STREAM_IDLE_TIMEOUT_MS||"300000",10),u=(0,i.generateLegacyProviders)();!function(e){let i;if(o&&Date.now()-a<6e4)return;let s=(i=process.env.DATA_DIR||(0,r.join)(process.cwd(),"data"),(0,r.join)(i,"provider-credentials.json"));if(!(0,t.existsSync)(s))return o||console.log("[CREDENTIALS] No external credentials file found, using defaults."),o=e,a=Date.now();try{let r=(0,t.readFileSync)(s,"utf-8"),a=JSON.parse(r),i=0;for(let[t,r]of Object.entries(a)){if(!e[t]){console.log(`[CREDENTIALS] Warning: unknown provider "${t}" in credentials file, skipping.`);continue}if(!r||"object"!=typeof r){console.log(`[CREDENTIALS] Warning: provider "${t}" value must be an object, got ${typeof r}. Skipping.`);continue}for(let a of n)void 0!==r[a]&&(e[t][a]=r[a],i++)}let l=null!==o;console.log(`[CREDENTIALS] ${l?"Reloaded":"Loaded"} external credentials: ${i} field(s) from ${s}`)}catch(e){console.log(`[CREDENTIALS] Error reading credentials file: ${e.message}. Using defaults.`)}o=e,a=Date.now()}(u);let c={BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,NOT_ACCEPTABLE:406,REQUEST_TIMEOUT:408,RATE_LIMITED:429,SERVER_ERROR:500,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504},p={[c.BAD_REQUEST]:{type:"invalid_request_error",code:"bad_request"},[c.UNAUTHORIZED]:{type:"authentication_error",code:"invalid_api_key"},[c.FORBIDDEN]:{type:"permission_error",code:"insufficient_quota"},[c.NOT_FOUND]:{type:"invalid_request_error",code:"model_not_found"},[c.RATE_LIMITED]:{type:"rate_limit_error",code:"rate_limit_exceeded"},[c.SERVER_ERROR]:{type:"server_error",code:"internal_server_error"},[c.BAD_GATEWAY]:{type:"server_error",code:"bad_gateway"},[c.SERVICE_UNAVAILABLE]:{type:"server_error",code:"service_unavailable"},[c.GATEWAY_TIMEOUT]:{type:"server_error",code:"gateway_timeout"}},d={[c.BAD_REQUEST]:"Bad request",[c.UNAUTHORIZED]:"Invalid API key provided",[c.FORBIDDEN]:"You exceeded your current quota",[c.NOT_FOUND]:"Model not found",[c.RATE_LIMITED]:"Rate limit exceeded",[c.SERVER_ERROR]:"Internal server error",[c.BAD_GATEWAY]:"Bad gateway - upstream provider error",[c.SERVICE_UNAVAILABLE]:"Service temporarily unavailable",[c.GATEWAY_TIMEOUT]:"Gateway timeout"};e.s(["ANTIGRAVITY_DEFAULT_SYSTEM",0,"Please ignore the following [ignore]You are Antigravity, a powerful agentic AI coding assistant designed by the Google Deepmind team working on Advanced Agentic Coding.You are pair programming with a USER to solve their coding task. The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.**Absolute paths only****Proactiveness**[/ignore]","BACKOFF_CONFIG",0,{base:1e3,max:12e4,maxLevel:15},"BACKOFF_STEPS_MS",0,[6e4,12e4,3e5,6e5,12e5],"CACHE_TTL",0,{userInfo:300,modelAlias:3600},"CLAUDE_SYSTEM_PROMPT",0,"You are Claude Code, Anthropic's official CLI for Claude.","COOLDOWN_MS",0,{unauthorized:12e4,paymentRequired:12e4,notFound:12e4,notFoundLocal:5e3,transientInitial:5e3,transientMax:6e4,transient:5e3,requestNotAllowed:5e3,rateLimit:12e4,serviceUnavailable:2e3,authExpired:12e4},"DEFAULT_API_LIMITS",0,{requestsPerMinute:100,minTimeBetweenRequests:200,concurrentRequests:10},"DEFAULT_ERROR_MESSAGES",0,d,"DEFAULT_MAX_TOKENS",0,64e3,"DEFAULT_MIN_TOKENS",0,32e3,"ERROR_TYPES",0,p,"FETCH_TIMEOUT_MS",0,s,"HTTP_STATUS",0,c,"OAUTH_ENDPOINTS",0,{google:{token:"https://oauth2.googleapis.com/token",auth:"https://accounts.google.com/o/oauth2/auth"},openai:{token:"https://auth.openai.com/oauth/token",auth:"https://auth.openai.com/oauth/authorize"},anthropic:{token:"https://console.anthropic.com/v1/oauth/token",auth:"https://console.anthropic.com/v1/oauth/authorize"},qwen:{token:"https://chat.qwen.ai/api/v1/oauth2/token",auth:"https://chat.qwen.ai/api/v1/oauth2/device/code"},iflow:{token:"https://iflow.cn/oauth/token",auth:"https://iflow.cn/oauth"},github:{token:"https://github.com/login/oauth/access_token",auth:"https://github.com/login/oauth/authorize",deviceCode:"https://github.com/login/device/code"}},"PROVIDERS",0,u,"PROVIDER_PROFILES",0,{oauth:{transientCooldown:5e3,rateLimitCooldown:6e4,maxBackoffLevel:8,circuitBreakerThreshold:3,circuitBreakerReset:6e4},apikey:{transientCooldown:3e3,rateLimitCooldown:0,maxBackoffLevel:5,circuitBreakerThreshold:5,circuitBreakerReset:3e4},local:{transientCooldown:2e3,rateLimitCooldown:5e3,maxBackoffLevel:3,circuitBreakerThreshold:2,circuitBreakerReset:15e3}},"RateLimitReason",0,{QUOTA_EXHAUSTED:"quota_exhausted",RATE_LIMIT_EXCEEDED:"rate_limit_exceeded",MODEL_CAPACITY:"model_capacity",SERVER_ERROR:"server_error",AUTH_ERROR:"auth_error",UNKNOWN:"unknown"},"SKIP_PATTERNS",0,["Please write a 5-10 word title for the following conversation:"],"STREAM_IDLE_TIMEOUT_MS",0,l],16023)},85713,e=>{"use strict";var t=e.i(16023),r=e.i(828059);let n="https://api.openai.com/v1",a="https://api.anthropic.com/v1";function o(e){return"string"==typeof e&&e.startsWith("openai-compatible-")}function i(e){return"string"==typeof e&&e.startsWith("anthropic-compatible-")}function s(e){return o(e)&&e.includes("responses")?"responses":"chat"}function l(e){let t=Object.prototype.hasOwnProperty.call(e,"input")&&void 0!==e.input,r=void 0!==e.max_output_tokens||void 0!==e.previous_response_id||void 0!==e.reasoning;if(t||r)return"openai-responses";if(e.request?.contents&&"antigravity"===e.userAgent)return"antigravity";if(e.contents&&Array.isArray(e.contents))return"gemini";if(e.stream_options||e.response_format||void 0!==e.logprobs||void 0!==e.top_logprobs||void 0!==e.n||void 0!==e.presence_penalty||void 0!==e.frequency_penalty||e.logit_bias||e.user)return"openai";if(e.messages&&Array.isArray(e.messages)){let t=e.messages[0];if(t?.content&&Array.isArray(t.content)){let r=t.content[0];if(r?.type==="text"&&!e.model?.includes("/")){if(e.system||e.anthropic_version)return"claude";let r=t.content.some(e=>"image"===e.type&&e.source?.type==="base64"),n=t.content.some(e=>"image_url"===e.type&&e.image_url?.url);if(r)return"claude";if(n)return"openai";if(t.content.some(e=>"tool_use"===e.type||"tool_result"===e.type))return"claude"}}if(void 0!==e.system||e.anthropic_version||e.max_tokens&&!e.stream_options&&!e.response_format)return"claude"}return"openai"}function u(e){if(o(e)){let r=s(e);return{...t.PROVIDERS.openai,format:"responses"===r?"openai-responses":"openai",baseUrl:n}}return i(e)?{...t.PROVIDERS.anthropic,format:"claude",baseUrl:a}:t.PROVIDERS[e]||t.PROVIDERS.openai}function c(e,t,l=!0,p={}){if(o(e)){var d;let t,r=s(e);return d=p?.baseUrl||n,t=d.replace(/\/$/,""),`${t}${"responses"===r?"/responses":"/chat/completions"}`}if(i(e)){let e;return e=(p?.baseUrl||a).replace(/\/$/,""),`${e}/messages`}let h=(0,r.getRegistryEntry)(e),f=u(e);if(h){if(h.baseUrls){let e=p?.baseUrlIndex||0,r=h.baseUrls[e]||h.baseUrls[0];return h.urlBuilder?h.urlBuilder(r,t,l):r}if(h.urlBuilder)return h.urlBuilder(h.baseUrl,t,l);if(h.urlSuffix)return`${h.baseUrl}${h.urlSuffix}`}return f.baseUrl}function p(e,t,n=!0,a=null){let o=u(e),s=(0,r.getRegistryEntry)(e),l={"Content-Type":"application/json",...o.headers};if(i(e))t.apiKey?l["x-api-key"]=t.apiKey:t.accessToken&&(l.Authorization=`Bearer ${t.accessToken}`),l["anthropic-version"]||(l["anthropic-version"]="2023-06-01");else if("github"===e){let e=t.copilotToken||t.accessToken;l.Authorization=`Bearer ${e}`,l["x-request-id"]=crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}),n||(l.Accept="application/json")}else if(s){let e=s.authHeader||"bearer";if("x-api-key"===e){let e=t.apiKey||t.accessToken;e&&(l["x-api-key"]=e)}else"x-goog-api-key"===e?t.apiKey?l["x-goog-api-key"]=t.apiKey:t.accessToken&&(l.Authorization=`Bearer ${t.accessToken}`):l.Authorization=`Bearer ${t.apiKey||t.accessToken}`}else l.Authorization=`Bearer ${t.apiKey||t.accessToken}`;return n&&(l.Accept="text/event-stream"),l}function d(e){if(o(e))return"responses"===s(e)?"openai-responses":"openai";if(i(e))return"claude";let t=(0,r.getRegistryEntry)(e);return t?t.format||"openai":u(e).format||"openai"}function h(e){return!function(e){let t=e.messages||e.contents;if(!t?.length)return!0;let r=t[t.length-1];return r?.role==="user"}(e)&&(delete e.reasoning_effort,delete e.thinking),e}e.s(["buildProviderHeaders",()=>p,"buildProviderUrl",()=>c,"detectFormat",()=>l,"getTargetFormat",()=>d,"normalizeThinkingConfig",()=>h])},693618,e=>e.a(async(t,r)=>{try{var n=e.i(89171),a=e.i(85713),o=e.i(676088),i=e.i(200392),s=t([o,i]);async function l(e){let t;try{t=await e.json()}catch{return n.NextResponse.json({success:!1,error:{message:"Invalid request",details:[{field:"body",message:"Invalid JSON body"}]}},{status:400})}try{let e=(0,i.validateBody)(o.translatorDetectSchema,t);if((0,i.isValidationFailure)(e))return n.NextResponse.json({success:!1,error:e.error},{status:400});let{body:r}=e.data,s=(0,a.detectFormat)(r);return n.NextResponse.json({success:!0,format:s})}catch(e){return console.error("Error detecting format:",e),n.NextResponse.json({success:!1,error:"Failed to detect format"},{status:500})}}[o,i]=s.then?(await s)():s,e.s(["POST",()=>l]),r()}catch(e){r(e)}},!1),520469,e=>e.a(async(t,r)=>{try{var n=e.i(747909),a=e.i(174017),o=e.i(996250),i=e.i(759756),s=e.i(561916),l=e.i(174677),u=e.i(869741),c=e.i(316795),p=e.i(487718),d=e.i(995169),h=e.i(47587),f=e.i(666012),m=e.i(570101),g=e.i(626937),y=e.i(10372),E=e.i(193695);e.i(52474);var _=e.i(600220),x=e.i(693618),v=t([x]);[x]=v.then?(await v)():v;let T=new n.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/translator/detect/route",pathname:"/api/translator/detect",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/translator/detect/route.ts",nextConfigOutput:"standalone",userland:x}),{workAsyncStorage:S,workUnitAsyncStorage:w,serverHooks:b}=T;function R(){return(0,o.patchFetch)({workAsyncStorage:S,workUnitAsyncStorage:w})}async function A(e,t,r){T.isDev&&(0,i.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let n="/api/translator/detect/route";n=n.replace(/\/index$/,"")||"/";let o=await T.prepare(e,t,{srcPage:n,multiZoneDraftMode:!1});if(!o)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:x,params:v,nextConfig:R,parsedUrl:A,isDraftMode:S,prerenderManifest:w,routerServerContext:b,isOnDemandRevalidate:O,revalidateOnlyGenerated:I,resolvedPathname:C,clientReferenceManifest:k,serverActionsManifest:U}=o,D=(0,u.normalizeAppPath)(n),N=!!(w.dynamicRoutes[D]||w.routes[C]),P=async()=>((null==b?void 0:b.render404)?await b.render404(e,t,A,!1):t.end("This page could not be found"),null);if(N&&!S){let e=!!w.routes[C],t=w.dynamicRoutes[D];if(t&&!1===t.fallback&&!e){if(R.experimental.adapterPath)return await P();throw new E.NoFallbackError}}let L=null;!N||T.isDev||S||(L=C,L="/index"===L?"/":L);let M=!0===T.isDev||!N,q=N&&!M;U&&k&&(0,l.setManifestsSingleton)({page:n,clientReferenceManifest:k,serverActionsManifest:U});let j=e.method||"GET",B=(0,s.getTracer)(),$=B.getActiveScopeSpan(),F={params:v,prerenderManifest:w,renderOpts:{experimental:{authInterrupts:!!R.experimental.authInterrupts},cacheComponents:!!R.cacheComponents,supportsDynamicResponse:M,incrementalCache:(0,i.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:R.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,a)=>T.onRequestError(e,t,n,a,b)},sharedContext:{buildId:x}},H=new c.NodeNextRequest(e),V=new c.NodeNextResponse(t),K=p.NextRequestAdapter.fromNodeNextRequest(H,(0,p.signalFromNodeResponse)(t));try{let o=async e=>T.handle(K,F).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=B.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${j} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t)}else e.updateName(`${j} ${n}`)}),l=!!(0,i.getRequestMeta)(e,"minimalMode"),u=async i=>{var s,u;let c=async({previousCacheEntry:a})=>{try{if(!l&&O&&I&&!a)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await o(i);e.fetchMetrics=F.renderOpts.fetchMetrics;let s=F.renderOpts.pendingWaitUntil;s&&r.waitUntil&&(r.waitUntil(s),s=void 0);let u=F.renderOpts.collectedTags;if(!N)return await (0,f.sendResponse)(H,V,n,F.renderOpts.pendingWaitUntil),null;{let e=await n.blob(),t=(0,m.toNodeOutgoingHttpHeaders)(n.headers);u&&(t[y.NEXT_CACHE_TAGS_HEADER]=u),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==F.renderOpts.collectedRevalidate&&!(F.renderOpts.collectedRevalidate>=y.INFINITE_CACHE)&&F.renderOpts.collectedRevalidate,a=void 0===F.renderOpts.collectedExpire||F.renderOpts.collectedExpire>=y.INFINITE_CACHE?void 0:F.renderOpts.collectedExpire;return{value:{kind:_.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==a?void 0:a.isStale)&&await T.onRequestError(e,t,{routerKind:"App Router",routePath:n,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:q,isOnDemandRevalidate:O})},!1,b),t}},p=await T.handleResponse({req:e,nextConfig:R,cacheKey:L,routeKind:a.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:w,isRoutePPREnabled:!1,isOnDemandRevalidate:O,revalidateOnlyGenerated:I,responseGenerator:c,waitUntil:r.waitUntil,isMinimalMode:l});if(!N)return null;if((null==p||null==(s=p.value)?void 0:s.kind)!==_.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==p||null==(u=p.value)?void 0:u.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});l||t.setHeader("x-nextjs-cache",O?"REVALIDATED":p.isMiss?"MISS":p.isStale?"STALE":"HIT"),S&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let d=(0,m.fromNodeOutgoingHttpHeaders)(p.value.headers);return l&&N||d.delete(y.NEXT_CACHE_TAGS_HEADER),!p.cacheControl||t.getHeader("Cache-Control")||d.get("Cache-Control")||d.set("Cache-Control",(0,g.getCacheControlHeader)(p.cacheControl)),await (0,f.sendResponse)(H,V,new Response(p.value.body,{headers:d,status:p.value.status||200})),null};$?await u($):await B.withPropagatedContext(e.headers,()=>B.trace(d.BaseServerSpan.handleRequest,{spanName:`${j} ${n}`,kind:s.SpanKind.SERVER,attributes:{"http.method":j,"http.target":e.url}},u))}catch(t){if(t instanceof E.NoFallbackError||await T.onRequestError(e,t,{routerKind:"App Router",routePath:D,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:q,isOnDemandRevalidate:O})},!1,b),N)throw t;return await (0,f.sendResponse)(H,V,new Response(null,{status:500})),null}}e.s(["handler",()=>A,"patchFetch",()=>R,"routeModule",()=>T,"serverHooks",()=>b,"workAsyncStorage",()=>S,"workUnitAsyncStorage",()=>w]),r()}catch(e){r(e)}},!1)];
1
+ module.exports=[814747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},522734,(e,t,r)=>{t.exports=e.x("fs",()=>require("fs"))},918622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},556704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},832319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},324725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},270406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},193695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},442315,(e,t,r)=>{"use strict";t.exports=e.r(918622)},347540,(e,t,r)=>{"use strict";t.exports=e.r(442315).vendored["react-rsc"].React},819481,(e,t,r)=>{"use strict";var n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,s={},l={RequestCookies:()=>m,ResponseCookies:()=>g,parseCookie:()=>p,parseSetCookie:()=>d,stringifyCookie:()=>c};for(var u in l)n(s,u,{get:l[u],enumerable:!0});function c(e){var t;let r=["path"in e&&e.path&&`Path=${e.path}`,"expires"in e&&(e.expires||0===e.expires)&&`Expires=${("number"==typeof e.expires?new Date(e.expires):e.expires).toUTCString()}`,"maxAge"in e&&"number"==typeof e.maxAge&&`Max-Age=${e.maxAge}`,"domain"in e&&e.domain&&`Domain=${e.domain}`,"secure"in e&&e.secure&&"Secure","httpOnly"in e&&e.httpOnly&&"HttpOnly","sameSite"in e&&e.sameSite&&`SameSite=${e.sameSite}`,"partitioned"in e&&e.partitioned&&"Partitioned","priority"in e&&e.priority&&`Priority=${e.priority}`].filter(Boolean),n=`${e.name}=${encodeURIComponent(null!=(t=e.value)?t:"")}`;return 0===r.length?n:`${n}; ${r.join("; ")}`}function p(e){let t=new Map;for(let r of e.split(/; */)){if(!r)continue;let e=r.indexOf("=");if(-1===e){t.set(r,"true");continue}let[n,a]=[r.slice(0,e),r.slice(e+1)];try{t.set(n,decodeURIComponent(null!=a?a:"true"))}catch{}}return t}function d(e){if(!e)return;let[[t,r],...n]=p(e),{domain:a,expires:o,httponly:i,maxage:s,path:l,samesite:u,secure:c,partitioned:d,priority:m}=Object.fromEntries(n.map(([e,t])=>[e.toLowerCase().replace(/-/g,""),t]));{var g,y,E={name:t,value:decodeURIComponent(r),domain:a,...o&&{expires:new Date(o)},...i&&{httpOnly:!0},..."string"==typeof s&&{maxAge:Number(s)},path:l,...u&&{sameSite:h.includes(g=(g=u).toLowerCase())?g:void 0},...c&&{secure:!0},...m&&{priority:f.includes(y=(y=m).toLowerCase())?y:void 0},...d&&{partitioned:!0}};let e={};for(let t in E)E[t]&&(e[t]=E[t]);return e}}t.exports=((e,t,r,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of o(t))i.call(e,r)||void 0===r||n(e,r,{get:()=>t[r],enumerable:!(s=a(t,r))||s.enumerable});return e})(n({},"__esModule",{value:!0}),s);var h=["strict","lax","none"],f=["low","medium","high"],m=class{constructor(e){this._parsed=new Map,this._headers=e;const t=e.get("cookie");if(t)for(const[e,r]of p(t))this._parsed.set(e,{name:e,value:r})}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed);if(!e.length)return r.map(([e,t])=>t);let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(([e])=>e===n).map(([e,t])=>t)}has(e){return this._parsed.has(e)}set(...e){let[t,r]=1===e.length?[e[0].name,e[0].value]:e,n=this._parsed;return n.set(t,{name:t,value:r}),this._headers.set("cookie",Array.from(n).map(([e,t])=>c(t)).join("; ")),this}delete(e){let t=this._parsed,r=Array.isArray(e)?e.map(e=>t.delete(e)):t.delete(e);return this._headers.set("cookie",Array.from(t).map(([e,t])=>c(t)).join("; ")),r}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(e=>`${e.name}=${encodeURIComponent(e.value)}`).join("; ")}},g=class{constructor(e){var t,r,n;this._parsed=new Map,this._headers=e;const a=null!=(n=null!=(r=null==(t=e.getSetCookie)?void 0:t.call(e))?r:e.get("set-cookie"))?n:[];for(const e of Array.isArray(a)?a:function(e){if(!e)return[];var t,r,n,a,o,i=[],s=0;function l(){for(;s<e.length&&/\s/.test(e.charAt(s));)s+=1;return s<e.length}for(;s<e.length;){for(t=s,o=!1;l();)if(","===(r=e.charAt(s))){for(n=s,s+=1,l(),a=s;s<e.length&&"="!==(r=e.charAt(s))&&";"!==r&&","!==r;)s+=1;s<e.length&&"="===e.charAt(s)?(o=!0,s=a,i.push(e.substring(t,n)),t=s):s=n+1}else s+=1;(!o||s>=e.length)&&i.push(e.substring(t,e.length))}return i}(a)){const t=d(e);t&&this._parsed.set(t.name,t)}}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed.values());if(!e.length)return r;let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(e=>e.name===n)}has(e){return this._parsed.has(e)}set(...e){let[t,r,n]=1===e.length?[e[0].name,e[0].value,e[0]]:e,a=this._parsed;return a.set(t,function(e={name:"",value:""}){return"number"==typeof e.expires&&(e.expires=new Date(e.expires)),e.maxAge&&(e.expires=new Date(Date.now()+1e3*e.maxAge)),(null===e.path||void 0===e.path)&&(e.path="/"),e}({name:t,value:r,...n})),function(e,t){for(let[,r]of(t.delete("set-cookie"),e)){let e=c(r);t.append("set-cookie",e)}}(a,this._headers),this}delete(...e){let[t,r]="string"==typeof e[0]?[e[0]]:[e[0].name,e[0]];return this.set({...r,name:t,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(c).join("; ")}}},677850,e=>e.a(async(t,r)=>{try{let t=await e.y("zod");e.n(t),r()}catch(e){r(e)}},!0),200392,e=>e.a(async(t,r)=>{try{var n=e.i(677850),a=t([n]);function o(e,t){let r=e.safeParse(t);if(r.success)return{success:!0,data:r.data};let n=Array.isArray(r.error?.issues)?r.error.issues:[];return{success:!1,error:{message:"Invalid request",details:n.map(e=>({field:e.path.join("."),message:e.message}))}}}function i(e){return!1===e.success}[n]=a.then?(await a)():a,n.z.object({password:n.z.string().min(1,"Password is required").max(200)}),e.s(["isValidationFailure",()=>i,"validateBody",()=>o]),r()}catch(e){r(e)}},!1),16023,e=>{"use strict";var t=e.i(522734),r=e.i(814747);let n=["clientId","clientSecret","tokenUrl","authUrl","refreshUrl"],a=0,o=null;var i=e.i(828059);let s=parseInt(process.env.FETCH_TIMEOUT_MS||"120000",10),l=parseInt(process.env.STREAM_IDLE_TIMEOUT_MS||"120000",10),u=(0,i.generateLegacyProviders)();!function(e){let i;if(o&&Date.now()-a<6e4)return;let s=(i=process.env.DATA_DIR||(0,r.join)(process.cwd(),"data"),(0,r.join)(i,"provider-credentials.json"));if(!(0,t.existsSync)(s))return o||console.log("[CREDENTIALS] No external credentials file found, using defaults."),o=e,a=Date.now();try{let r=(0,t.readFileSync)(s,"utf-8"),a=JSON.parse(r),i=0;for(let[t,r]of Object.entries(a)){if(!e[t]){console.log(`[CREDENTIALS] Warning: unknown provider "${t}" in credentials file, skipping.`);continue}if(!r||"object"!=typeof r){console.log(`[CREDENTIALS] Warning: provider "${t}" value must be an object, got ${typeof r}. Skipping.`);continue}for(let a of n)void 0!==r[a]&&(e[t][a]=r[a],i++)}let l=null!==o;console.log(`[CREDENTIALS] ${l?"Reloaded":"Loaded"} external credentials: ${i} field(s) from ${s}`)}catch(e){console.log(`[CREDENTIALS] Error reading credentials file: ${e.message}. Using defaults.`)}o=e,a=Date.now()}(u);let c={BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,NOT_ACCEPTABLE:406,REQUEST_TIMEOUT:408,RATE_LIMITED:429,SERVER_ERROR:500,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504},p={[c.BAD_REQUEST]:{type:"invalid_request_error",code:"bad_request"},[c.UNAUTHORIZED]:{type:"authentication_error",code:"invalid_api_key"},[c.FORBIDDEN]:{type:"permission_error",code:"insufficient_quota"},[c.NOT_FOUND]:{type:"invalid_request_error",code:"model_not_found"},[c.RATE_LIMITED]:{type:"rate_limit_error",code:"rate_limit_exceeded"},[c.SERVER_ERROR]:{type:"server_error",code:"internal_server_error"},[c.BAD_GATEWAY]:{type:"server_error",code:"bad_gateway"},[c.SERVICE_UNAVAILABLE]:{type:"server_error",code:"service_unavailable"},[c.GATEWAY_TIMEOUT]:{type:"server_error",code:"gateway_timeout"}},d={[c.BAD_REQUEST]:"Bad request",[c.UNAUTHORIZED]:"Invalid API key provided",[c.FORBIDDEN]:"You exceeded your current quota",[c.NOT_FOUND]:"Model not found",[c.RATE_LIMITED]:"Rate limit exceeded",[c.SERVER_ERROR]:"Internal server error",[c.BAD_GATEWAY]:"Bad gateway - upstream provider error",[c.SERVICE_UNAVAILABLE]:"Service temporarily unavailable",[c.GATEWAY_TIMEOUT]:"Gateway timeout"};e.s(["ANTIGRAVITY_DEFAULT_SYSTEM",0,"Please ignore the following [ignore]You are Antigravity, a powerful agentic AI coding assistant designed by the Google Deepmind team working on Advanced Agentic Coding.You are pair programming with a USER to solve their coding task. The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.**Absolute paths only****Proactiveness**[/ignore]","BACKOFF_CONFIG",0,{base:1e3,max:12e4,maxLevel:15},"BACKOFF_STEPS_MS",0,[6e4,12e4,3e5,6e5,12e5],"CACHE_TTL",0,{userInfo:300,modelAlias:3600},"CLAUDE_SYSTEM_PROMPT",0,"You are Claude Code, Anthropic's official CLI for Claude.","COOLDOWN_MS",0,{unauthorized:12e4,paymentRequired:12e4,notFound:12e4,notFoundLocal:5e3,transientInitial:5e3,transientMax:6e4,transient:5e3,requestNotAllowed:5e3,rateLimit:12e4,serviceUnavailable:2e3,authExpired:12e4},"DEFAULT_API_LIMITS",0,{requestsPerMinute:100,minTimeBetweenRequests:200,concurrentRequests:10},"DEFAULT_ERROR_MESSAGES",0,d,"DEFAULT_MAX_TOKENS",0,64e3,"DEFAULT_MIN_TOKENS",0,32e3,"ERROR_TYPES",0,p,"FETCH_TIMEOUT_MS",0,s,"HTTP_STATUS",0,c,"OAUTH_ENDPOINTS",0,{google:{token:"https://oauth2.googleapis.com/token",auth:"https://accounts.google.com/o/oauth2/auth"},openai:{token:"https://auth.openai.com/oauth/token",auth:"https://auth.openai.com/oauth/authorize"},anthropic:{token:"https://console.anthropic.com/v1/oauth/token",auth:"https://console.anthropic.com/v1/oauth/authorize"},qwen:{token:"https://chat.qwen.ai/api/v1/oauth2/token",auth:"https://chat.qwen.ai/api/v1/oauth2/device/code"},iflow:{token:"https://iflow.cn/oauth/token",auth:"https://iflow.cn/oauth"},github:{token:"https://github.com/login/oauth/access_token",auth:"https://github.com/login/oauth/authorize",deviceCode:"https://github.com/login/device/code"}},"PROVIDERS",0,u,"PROVIDER_PROFILES",0,{oauth:{transientCooldown:5e3,rateLimitCooldown:6e4,maxBackoffLevel:8,circuitBreakerThreshold:3,circuitBreakerReset:6e4},apikey:{transientCooldown:3e3,rateLimitCooldown:0,maxBackoffLevel:5,circuitBreakerThreshold:5,circuitBreakerReset:3e4},local:{transientCooldown:2e3,rateLimitCooldown:5e3,maxBackoffLevel:3,circuitBreakerThreshold:2,circuitBreakerReset:15e3}},"RateLimitReason",0,{QUOTA_EXHAUSTED:"quota_exhausted",RATE_LIMIT_EXCEEDED:"rate_limit_exceeded",MODEL_CAPACITY:"model_capacity",SERVER_ERROR:"server_error",AUTH_ERROR:"auth_error",UNKNOWN:"unknown"},"SKIP_PATTERNS",0,["Please write a 5-10 word title for the following conversation:"],"STREAM_IDLE_TIMEOUT_MS",0,l],16023)},85713,e=>{"use strict";var t=e.i(16023),r=e.i(828059);let n="https://api.openai.com/v1",a="https://api.anthropic.com/v1";function o(e){return"string"==typeof e&&e.startsWith("openai-compatible-")}function i(e){return"string"==typeof e&&e.startsWith("anthropic-compatible-")}function s(e){return o(e)&&e.includes("responses")?"responses":"chat"}function l(e){let t=Object.prototype.hasOwnProperty.call(e,"input")&&void 0!==e.input,r=void 0!==e.max_output_tokens||void 0!==e.previous_response_id||void 0!==e.reasoning;if(t||r)return"openai-responses";if(e.request?.contents&&"antigravity"===e.userAgent)return"antigravity";if(e.contents&&Array.isArray(e.contents))return"gemini";if(e.stream_options||e.response_format||void 0!==e.logprobs||void 0!==e.top_logprobs||void 0!==e.n||void 0!==e.presence_penalty||void 0!==e.frequency_penalty||e.logit_bias||e.user)return"openai";if(e.messages&&Array.isArray(e.messages)){let t=e.messages[0];if(t?.content&&Array.isArray(t.content)){let r=t.content[0];if(r?.type==="text"&&!e.model?.includes("/")){if(e.system||e.anthropic_version)return"claude";let r=t.content.some(e=>"image"===e.type&&e.source?.type==="base64"),n=t.content.some(e=>"image_url"===e.type&&e.image_url?.url);if(r)return"claude";if(n)return"openai";if(t.content.some(e=>"tool_use"===e.type||"tool_result"===e.type))return"claude"}}if(void 0!==e.system||e.anthropic_version||e.max_tokens&&!e.stream_options&&!e.response_format)return"claude"}return"openai"}function u(e){if(o(e)){let r=s(e);return{...t.PROVIDERS.openai,format:"responses"===r?"openai-responses":"openai",baseUrl:n}}return i(e)?{...t.PROVIDERS.anthropic,format:"claude",baseUrl:a}:t.PROVIDERS[e]||t.PROVIDERS.openai}function c(e,t,l=!0,p={}){if(o(e)){var d;let t,r=s(e);return d=p?.baseUrl||n,t=d.replace(/\/$/,""),`${t}${"responses"===r?"/responses":"/chat/completions"}`}if(i(e)){let e;return e=(p?.baseUrl||a).replace(/\/$/,""),`${e}/messages`}let h=(0,r.getRegistryEntry)(e),f=u(e);if(h){if(h.baseUrls){let e=p?.baseUrlIndex||0,r=h.baseUrls[e]||h.baseUrls[0];return h.urlBuilder?h.urlBuilder(r,t,l):r}if(h.urlBuilder)return h.urlBuilder(h.baseUrl,t,l);if(h.urlSuffix)return`${h.baseUrl}${h.urlSuffix}`}return f.baseUrl}function p(e,t,n=!0,a=null){let o=u(e),s=(0,r.getRegistryEntry)(e),l={"Content-Type":"application/json",...o.headers};if(i(e))t.apiKey?l["x-api-key"]=t.apiKey:t.accessToken&&(l.Authorization=`Bearer ${t.accessToken}`),l["anthropic-version"]||(l["anthropic-version"]="2023-06-01");else if("github"===e){let e=t.copilotToken||t.accessToken;l.Authorization=`Bearer ${e}`,l["x-request-id"]=crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}),n||(l.Accept="application/json")}else if(s){let e=s.authHeader||"bearer";if("x-api-key"===e){let e=t.apiKey||t.accessToken;e&&(l["x-api-key"]=e)}else"x-goog-api-key"===e?t.apiKey?l["x-goog-api-key"]=t.apiKey:t.accessToken&&(l.Authorization=`Bearer ${t.accessToken}`):l.Authorization=`Bearer ${t.apiKey||t.accessToken}`}else l.Authorization=`Bearer ${t.apiKey||t.accessToken}`;return n&&(l.Accept="text/event-stream"),l}function d(e){if(o(e))return"responses"===s(e)?"openai-responses":"openai";if(i(e))return"claude";let t=(0,r.getRegistryEntry)(e);return t?t.format||"openai":u(e).format||"openai"}function h(e){return!function(e){let t=e.messages||e.contents;if(!t?.length)return!0;let r=t[t.length-1];return r?.role==="user"}(e)&&(delete e.reasoning_effort,delete e.thinking),e}e.s(["buildProviderHeaders",()=>p,"buildProviderUrl",()=>c,"detectFormat",()=>l,"getTargetFormat",()=>d,"normalizeThinkingConfig",()=>h])},693618,e=>e.a(async(t,r)=>{try{var n=e.i(89171),a=e.i(85713),o=e.i(676088),i=e.i(200392),s=t([o,i]);async function l(e){let t;try{t=await e.json()}catch{return n.NextResponse.json({success:!1,error:{message:"Invalid request",details:[{field:"body",message:"Invalid JSON body"}]}},{status:400})}try{let e=(0,i.validateBody)(o.translatorDetectSchema,t);if((0,i.isValidationFailure)(e))return n.NextResponse.json({success:!1,error:e.error},{status:400});let{body:r}=e.data,s=(0,a.detectFormat)(r);return n.NextResponse.json({success:!0,format:s})}catch(e){return console.error("Error detecting format:",e),n.NextResponse.json({success:!1,error:"Failed to detect format"},{status:500})}}[o,i]=s.then?(await s)():s,e.s(["POST",()=>l]),r()}catch(e){r(e)}},!1),520469,e=>e.a(async(t,r)=>{try{var n=e.i(747909),a=e.i(174017),o=e.i(996250),i=e.i(759756),s=e.i(561916),l=e.i(174677),u=e.i(869741),c=e.i(316795),p=e.i(487718),d=e.i(995169),h=e.i(47587),f=e.i(666012),m=e.i(570101),g=e.i(626937),y=e.i(10372),E=e.i(193695);e.i(52474);var _=e.i(600220),x=e.i(693618),v=t([x]);[x]=v.then?(await v)():v;let T=new n.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/translator/detect/route",pathname:"/api/translator/detect",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/translator/detect/route.ts",nextConfigOutput:"standalone",userland:x}),{workAsyncStorage:S,workUnitAsyncStorage:w,serverHooks:b}=T;function R(){return(0,o.patchFetch)({workAsyncStorage:S,workUnitAsyncStorage:w})}async function A(e,t,r){T.isDev&&(0,i.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let n="/api/translator/detect/route";n=n.replace(/\/index$/,"")||"/";let o=await T.prepare(e,t,{srcPage:n,multiZoneDraftMode:!1});if(!o)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:x,params:v,nextConfig:R,parsedUrl:A,isDraftMode:S,prerenderManifest:w,routerServerContext:b,isOnDemandRevalidate:O,revalidateOnlyGenerated:I,resolvedPathname:C,clientReferenceManifest:k,serverActionsManifest:U}=o,D=(0,u.normalizeAppPath)(n),N=!!(w.dynamicRoutes[D]||w.routes[C]),P=async()=>((null==b?void 0:b.render404)?await b.render404(e,t,A,!1):t.end("This page could not be found"),null);if(N&&!S){let e=!!w.routes[C],t=w.dynamicRoutes[D];if(t&&!1===t.fallback&&!e){if(R.experimental.adapterPath)return await P();throw new E.NoFallbackError}}let L=null;!N||T.isDev||S||(L=C,L="/index"===L?"/":L);let M=!0===T.isDev||!N,q=N&&!M;U&&k&&(0,l.setManifestsSingleton)({page:n,clientReferenceManifest:k,serverActionsManifest:U});let j=e.method||"GET",B=(0,s.getTracer)(),$=B.getActiveScopeSpan(),F={params:v,prerenderManifest:w,renderOpts:{experimental:{authInterrupts:!!R.experimental.authInterrupts},cacheComponents:!!R.cacheComponents,supportsDynamicResponse:M,incrementalCache:(0,i.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:R.cacheLife,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,a)=>T.onRequestError(e,t,n,a,b)},sharedContext:{buildId:x}},H=new c.NodeNextRequest(e),V=new c.NodeNextResponse(t),K=p.NextRequestAdapter.fromNodeNextRequest(H,(0,p.signalFromNodeResponse)(t));try{let o=async e=>T.handle(K,F).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=B.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${j} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t)}else e.updateName(`${j} ${n}`)}),l=!!(0,i.getRequestMeta)(e,"minimalMode"),u=async i=>{var s,u;let c=async({previousCacheEntry:a})=>{try{if(!l&&O&&I&&!a)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await o(i);e.fetchMetrics=F.renderOpts.fetchMetrics;let s=F.renderOpts.pendingWaitUntil;s&&r.waitUntil&&(r.waitUntil(s),s=void 0);let u=F.renderOpts.collectedTags;if(!N)return await (0,f.sendResponse)(H,V,n,F.renderOpts.pendingWaitUntil),null;{let e=await n.blob(),t=(0,m.toNodeOutgoingHttpHeaders)(n.headers);u&&(t[y.NEXT_CACHE_TAGS_HEADER]=u),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==F.renderOpts.collectedRevalidate&&!(F.renderOpts.collectedRevalidate>=y.INFINITE_CACHE)&&F.renderOpts.collectedRevalidate,a=void 0===F.renderOpts.collectedExpire||F.renderOpts.collectedExpire>=y.INFINITE_CACHE?void 0:F.renderOpts.collectedExpire;return{value:{kind:_.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==a?void 0:a.isStale)&&await T.onRequestError(e,t,{routerKind:"App Router",routePath:n,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:q,isOnDemandRevalidate:O})},!1,b),t}},p=await T.handleResponse({req:e,nextConfig:R,cacheKey:L,routeKind:a.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:w,isRoutePPREnabled:!1,isOnDemandRevalidate:O,revalidateOnlyGenerated:I,responseGenerator:c,waitUntil:r.waitUntil,isMinimalMode:l});if(!N)return null;if((null==p||null==(s=p.value)?void 0:s.kind)!==_.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==p||null==(u=p.value)?void 0:u.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});l||t.setHeader("x-nextjs-cache",O?"REVALIDATED":p.isMiss?"MISS":p.isStale?"STALE":"HIT"),S&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let d=(0,m.fromNodeOutgoingHttpHeaders)(p.value.headers);return l&&N||d.delete(y.NEXT_CACHE_TAGS_HEADER),!p.cacheControl||t.getHeader("Cache-Control")||d.get("Cache-Control")||d.set("Cache-Control",(0,g.getCacheControlHeader)(p.cacheControl)),await (0,f.sendResponse)(H,V,new Response(p.value.body,{headers:d,status:p.value.status||200})),null};$?await u($):await B.withPropagatedContext(e.headers,()=>B.trace(d.BaseServerSpan.handleRequest,{spanName:`${j} ${n}`,kind:s.SpanKind.SERVER,attributes:{"http.method":j,"http.target":e.url}},u))}catch(t){if(t instanceof E.NoFallbackError||await T.onRequestError(e,t,{routerKind:"App Router",routePath:D,routeType:"route",revalidateReason:(0,h.getRevalidateReason)({isStaticGeneration:q,isOnDemandRevalidate:O})},!1,b),N)throw t;return await (0,f.sendResponse)(H,V,new Response(null,{status:500})),null}}e.s(["handler",()=>A,"patchFetch",()=>R,"routeModule",()=>T,"serverHooks",()=>b,"workAsyncStorage",()=>S,"workUnitAsyncStorage",()=>w]),r()}catch(e){r(e)}},!1)];
2
2
 
3
3
  //# sourceMappingURL=%5Broot-of-the-server%5D__eb98039a._.js.map
@@ -1,4 +1,4 @@
1
- module.exports=[918622,(e,t,i)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},556704,(e,t,i)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},832319,(e,t,i)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},324725,(e,t,i)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},270406,(e,t,i)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},193695,(e,t,i)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},442315,(e,t,i)=>{"use strict";t.exports=e.r(918622)},347540,(e,t,i)=>{"use strict";t.exports=e.r(442315).vendored["react-rsc"].React},819481,(e,t,i)=>{"use strict";var o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,s={},c={RequestCookies:()=>b,ResponseCookies:()=>x,parseCookie:()=>d,parseSetCookie:()=>m,stringifyCookie:()=>p};for(var l in c)o(s,l,{get:c[l],enumerable:!0});function p(e){var t;let i=["path"in e&&e.path&&`Path=${e.path}`,"expires"in e&&(e.expires||0===e.expires)&&`Expires=${("number"==typeof e.expires?new Date(e.expires):e.expires).toUTCString()}`,"maxAge"in e&&"number"==typeof e.maxAge&&`Max-Age=${e.maxAge}`,"domain"in e&&e.domain&&`Domain=${e.domain}`,"secure"in e&&e.secure&&"Secure","httpOnly"in e&&e.httpOnly&&"HttpOnly","sameSite"in e&&e.sameSite&&`SameSite=${e.sameSite}`,"partitioned"in e&&e.partitioned&&"Partitioned","priority"in e&&e.priority&&`Priority=${e.priority}`].filter(Boolean),o=`${e.name}=${encodeURIComponent(null!=(t=e.value)?t:"")}`;return 0===i.length?o:`${o}; ${i.join("; ")}`}function d(e){let t=new Map;for(let i of e.split(/; */)){if(!i)continue;let e=i.indexOf("=");if(-1===e){t.set(i,"true");continue}let[o,a]=[i.slice(0,e),i.slice(e+1)];try{t.set(o,decodeURIComponent(null!=a?a:"true"))}catch{}}return t}function m(e){if(!e)return;let[[t,i],...o]=d(e),{domain:a,expires:r,httponly:n,maxage:s,path:c,samesite:l,secure:p,partitioned:m,priority:b}=Object.fromEntries(o.map(([e,t])=>[e.toLowerCase().replace(/-/g,""),t]));{var x,g,y={name:t,value:decodeURIComponent(i),domain:a,...r&&{expires:new Date(r)},...n&&{httpOnly:!0},..."string"==typeof s&&{maxAge:Number(s)},path:c,...l&&{sameSite:h.includes(x=(x=l).toLowerCase())?x:void 0},...p&&{secure:!0},...b&&{priority:u.includes(g=(g=b).toLowerCase())?g:void 0},...m&&{partitioned:!0}};let e={};for(let t in y)y[t]&&(e[t]=y[t]);return e}}t.exports=((e,t,i,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of r(t))n.call(e,i)||void 0===i||o(e,i,{get:()=>t[i],enumerable:!(s=a(t,i))||s.enumerable});return e})(o({},"__esModule",{value:!0}),s);var h=["strict","lax","none"],u=["low","medium","high"],b=class{constructor(e){this._parsed=new Map,this._headers=e;const t=e.get("cookie");if(t)for(const[e,i]of d(t))this._parsed.set(e,{name:e,value:i})}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let i=Array.from(this._parsed);if(!e.length)return i.map(([e,t])=>t);let o="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return i.filter(([e])=>e===o).map(([e,t])=>t)}has(e){return this._parsed.has(e)}set(...e){let[t,i]=1===e.length?[e[0].name,e[0].value]:e,o=this._parsed;return o.set(t,{name:t,value:i}),this._headers.set("cookie",Array.from(o).map(([e,t])=>p(t)).join("; ")),this}delete(e){let t=this._parsed,i=Array.isArray(e)?e.map(e=>t.delete(e)):t.delete(e);return this._headers.set("cookie",Array.from(t).map(([e,t])=>p(t)).join("; ")),i}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(e=>`${e.name}=${encodeURIComponent(e.value)}`).join("; ")}},x=class{constructor(e){var t,i,o;this._parsed=new Map,this._headers=e;const a=null!=(o=null!=(i=null==(t=e.getSetCookie)?void 0:t.call(e))?i:e.get("set-cookie"))?o:[];for(const e of Array.isArray(a)?a:function(e){if(!e)return[];var t,i,o,a,r,n=[],s=0;function c(){for(;s<e.length&&/\s/.test(e.charAt(s));)s+=1;return s<e.length}for(;s<e.length;){for(t=s,r=!1;c();)if(","===(i=e.charAt(s))){for(o=s,s+=1,c(),a=s;s<e.length&&"="!==(i=e.charAt(s))&&";"!==i&&","!==i;)s+=1;s<e.length&&"="===e.charAt(s)?(r=!0,s=a,n.push(e.substring(t,o)),t=s):s=o+1}else s+=1;(!r||s>=e.length)&&n.push(e.substring(t,e.length))}return n}(a)){const t=m(e);t&&this._parsed.set(t.name,t)}}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let i=Array.from(this._parsed.values());if(!e.length)return i;let o="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return i.filter(e=>e.name===o)}has(e){return this._parsed.has(e)}set(...e){let[t,i,o]=1===e.length?[e[0].name,e[0].value,e[0]]:e,a=this._parsed;return a.set(t,function(e={name:"",value:""}){return"number"==typeof e.expires&&(e.expires=new Date(e.expires)),e.maxAge&&(e.expires=new Date(Date.now()+1e3*e.maxAge)),(null===e.path||void 0===e.path)&&(e.path="/"),e}({name:t,value:i,...o})),function(e,t){for(let[,i]of(t.delete("set-cookie"),e)){let e=p(i);t.append("set-cookie",e)}}(a,this._headers),this}delete(...e){let[t,i]="string"==typeof e[0]?[e[0]]:[e[0].name,e[0]];return this.set({...i,name:t,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(p).join("; ")}}},677850,e=>e.a(async(t,i)=>{try{let t=await e.y("zod");e.n(t),i()}catch(e){i(e)}},!0),180725,e=>{"use strict";e.i(245272),e.s([])},102835,e=>e.a(async(t,i)=>{try{var o=e.i(677850),a=t([o]);[o]=a.then?(await a)():a;let n=o.z.object({id:o.z.string().min(1),alias:o.z.string().min(1),name:o.z.string().min(1),icon:o.z.string().min(1),color:o.z.string().regex(/^#[0-9A-Fa-f]{6}$/,"Must be a valid hex color (#RRGGBB)"),textIcon:o.z.string().optional(),website:o.z.string().url().optional(),passthroughModels:o.z.boolean().optional()}),s=o.z.record(o.z.string(),n);function r(e,t){let i=s.safeParse(e);if(!i.success){let e=i.error.issues.map(e=>` ${e.path.join(".")}: ${e.message}`).join("\n");throw console.error(`[PROVIDER VALIDATION] ${t} has invalid entries:
2
- ${e}`),Error(`Provider validation failed for ${t}`)}}e.s(["validateProviders",()=>r]),i()}catch(e){i(e)}},!1),963219,e=>e.a(async(t,i)=>{try{var o=e.i(102835),a=t([o]);[o]=a.then?(await a)():a;let s={iflow:{id:"iflow",alias:"if",name:"iFlow AI",icon:"water_drop",color:"#6366F1"},qwen:{id:"qwen",alias:"qw",name:"Qwen Code",icon:"psychology",color:"#10B981"},"gemini-cli":{id:"gemini-cli",alias:"gc",name:"Gemini CLI",icon:"terminal",color:"#4285F4"},kiro:{id:"kiro",alias:"kr",name:"Kiro AI",icon:"psychology_alt",color:"#FF6B35"}},c={claude:{id:"claude",alias:"cc",name:"Claude Code",icon:"smart_toy",color:"#D97757"},antigravity:{id:"antigravity",alias:"ag",name:"Antigravity",icon:"rocket_launch",color:"#F59E0B"},codex:{id:"codex",alias:"cx",name:"OpenAI Codex",icon:"code",color:"#3B82F6"},github:{id:"github",alias:"gh",name:"GitHub Copilot",icon:"code",color:"#333333"},cursor:{id:"cursor",alias:"cu",name:"Cursor IDE",icon:"edit_note",color:"#00D4AA"},"kimi-coding":{id:"kimi-coding",alias:"kmc",name:"Kimi Coding",icon:"psychology",color:"#1E40AF",textIcon:"KC"},kilocode:{id:"kilocode",alias:"kc",name:"Kilo Code",icon:"code",color:"#FF6B35",textIcon:"KC"},cline:{id:"cline",alias:"cl",name:"Cline",icon:"smart_toy",color:"#5B9BD5",textIcon:"CL"}},l={openrouter:{id:"openrouter",alias:"openrouter",name:"OpenRouter",icon:"router",color:"#F97316",textIcon:"OR",passthroughModels:!0,website:"https://openrouter.ai"},glm:{id:"glm",alias:"glm",name:"GLM Coding",icon:"code",color:"#2563EB",textIcon:"GL",website:"https://open.bigmodel.cn"},"bailian-coding-plan":{id:"bailian-coding-plan",alias:"bcp",name:"Alibaba Coding Plan",icon:"code",color:"#FF6A00",textIcon:"BCP",website:"https://www.alibabacloud.com/help/en/model-studio/coding-plan"},kimi:{id:"kimi",alias:"kimi",name:"Kimi",icon:"psychology",color:"#1E3A8A",textIcon:"KM",website:"https://kimi.moonshot.cn"},"kimi-coding-apikey":{id:"kimi-coding-apikey",alias:"kmca",name:"Kimi Coding (API Key)",icon:"psychology",color:"#1E40AF",textIcon:"KC",website:"https://kimi.com"},minimax:{id:"minimax",alias:"minimax",name:"Minimax Coding",icon:"memory",color:"#7C3AED",textIcon:"MM",website:"https://www.minimaxi.com"},"minimax-cn":{id:"minimax-cn",alias:"minimax-cn",name:"Minimax (China)",icon:"memory",color:"#DC2626",textIcon:"MC",website:"https://www.minimaxi.com"},alicode:{id:"alicode",alias:"alicode",name:"Alibaba",icon:"cloud",color:"#FF6A00",textIcon:"ALi",website:"https://bailian.console.aliyun.com"},"alicode-intl":{id:"alicode-intl",alias:"alicode-intl",name:"Alibaba Intl",icon:"cloud",color:"#FF6A00",textIcon:"ALi",website:"https://modelstudio.console.alibabacloud.com"},openai:{id:"openai",alias:"openai",name:"OpenAI",icon:"auto_awesome",color:"#10A37F",textIcon:"OA",website:"https://platform.openai.com"},anthropic:{id:"anthropic",alias:"anthropic",name:"Anthropic",icon:"smart_toy",color:"#D97757",textIcon:"AN",website:"https://console.anthropic.com"},gemini:{id:"gemini",alias:"gemini",name:"Gemini",icon:"diamond",color:"#4285F4",textIcon:"GE",website:"https://ai.google.dev"},deepseek:{id:"deepseek",alias:"ds",name:"DeepSeek",icon:"bolt",color:"#4D6BFE",textIcon:"DS",website:"https://deepseek.com"},groq:{id:"groq",alias:"groq",name:"Groq",icon:"speed",color:"#F55036",textIcon:"GQ",website:"https://groq.com",hasFree:!0,freeNote:"Free tier: 30 RPM / 14.4K RPD — no credit card"},blackbox:{id:"blackbox",alias:"bb",name:"Blackbox AI",icon:"view_in_ar",color:"#1A1A2E",textIcon:"BB",website:"https://blackbox.ai"},xai:{id:"xai",alias:"xai",name:"xAI (Grok)",icon:"auto_awesome",color:"#1DA1F2",textIcon:"XA",website:"https://x.ai"},mistral:{id:"mistral",alias:"mistral",name:"Mistral",icon:"air",color:"#FF7000",textIcon:"MI",website:"https://mistral.ai"},perplexity:{id:"perplexity",alias:"pplx",name:"Perplexity",icon:"search",color:"#20808D",textIcon:"PP",website:"https://www.perplexity.ai"},together:{id:"together",alias:"together",name:"Together AI",icon:"group_work",color:"#0F6FFF",textIcon:"TG",website:"https://www.together.ai"},fireworks:{id:"fireworks",alias:"fireworks",name:"Fireworks AI",icon:"local_fire_department",color:"#7B2EF2",textIcon:"FW",website:"https://fireworks.ai"},cerebras:{id:"cerebras",alias:"cerebras",name:"Cerebras",icon:"memory",color:"#FF4F00",textIcon:"CB",website:"https://inference.cerebras.ai",hasFree:!0,freeNote:"Free: 1M tokens/day, 60K TPM — world's fastest inference"},cohere:{id:"cohere",alias:"cohere",name:"Cohere",icon:"hub",color:"#39594D",textIcon:"CO",website:"https://cohere.com"},nvidia:{id:"nvidia",alias:"nvidia",name:"NVIDIA NIM",icon:"developer_board",color:"#76B900",textIcon:"NV",website:"https://build.nvidia.com",hasFree:!0,freeNote:"Free dev access: ~40 RPM, 70+ models (Kimi K2.5, GLM 4.7, DeepSeek V3.2...)"},nebius:{id:"nebius",alias:"nebius",name:"Nebius AI",icon:"cloud",color:"#6C5CE7",textIcon:"NB",website:"https://nebius.com"},siliconflow:{id:"siliconflow",alias:"siliconflow",name:"SiliconFlow",icon:"cloud_queue",color:"#5B6EF5",textIcon:"SF",website:"https://cloud.siliconflow.com"},hyperbolic:{id:"hyperbolic",alias:"hyp",name:"Hyperbolic",icon:"bolt",color:"#00D4FF",textIcon:"HY",website:"https://hyperbolic.xyz"},deepgram:{id:"deepgram",alias:"dg",name:"Deepgram",icon:"mic",color:"#13EF93",textIcon:"DG",website:"https://deepgram.com"},assemblyai:{id:"assemblyai",alias:"aai",name:"AssemblyAI",icon:"record_voice_over",color:"#0062FF",textIcon:"AA",website:"https://assemblyai.com"},nanobanana:{id:"nanobanana",alias:"nb",name:"NanoBanana",icon:"image",color:"#FFD700",textIcon:"NB",website:"https://nanobananaapi.ai"},"ollama-cloud":{id:"ollama-cloud",alias:"ollamacloud",name:"Ollama Cloud",icon:"cloud",color:"#58A6FF",textIcon:"OC",website:"https://ollama.com/settings/api-keys"},elevenlabs:{id:"elevenlabs",alias:"el",name:"ElevenLabs",icon:"record_voice_over",color:"#6C47FF",textIcon:"EL",website:"https://elevenlabs.io"},cartesia:{id:"cartesia",alias:"cartesia",name:"Cartesia",icon:"spatial_audio",color:"#FF4F8B",textIcon:"CA",website:"https://cartesia.ai"},playht:{id:"playht",alias:"playht",name:"PlayHT",icon:"play_circle",color:"#00B4D8",textIcon:"PH",website:"https://play.ht"},inworld:{id:"inworld",alias:"inworld",name:"Inworld",icon:"voice_chat",color:"#7B2EF2",textIcon:"IW",website:"https://inworld.ai"},sdwebui:{id:"sdwebui",alias:"sdwebui",name:"SD WebUI",icon:"brush",color:"#FF7043",textIcon:"SD",website:"https://github.com/AUTOMATIC1111/stable-diffusion-webui"},comfyui:{id:"comfyui",alias:"comfyui",name:"ComfyUI",icon:"account_tree",color:"#4CAF50",textIcon:"CF",website:"https://github.com/comfyanonymous/ComfyUI"},huggingface:{id:"huggingface",alias:"hf",name:"HuggingFace",icon:"face",color:"#FFD21E",textIcon:"HF",website:"https://huggingface.co",hasFree:!0,freeNote:"Free Inference API for thousands of models (Whisper, VITS, SDXL…)"},synthetic:{id:"synthetic",alias:"synthetic",name:"Synthetic",icon:"verified_user",color:"#6366F1",textIcon:"SY",website:"https://synthetic.new",passthroughModels:!0},"kilo-gateway":{id:"kilo-gateway",alias:"kg",name:"Kilo Gateway",icon:"hub",color:"#617A91",textIcon:"KG",website:"https://kilo.ai",passthroughModels:!0},vertex:{id:"vertex",alias:"vertex",name:"Vertex AI",icon:"cloud",color:"#4285F4",textIcon:"VA",website:"https://cloud.google.com/vertex-ai",authHint:"Provide Service Account JSON or OAuth access_token"},zai:{id:"zai",alias:"zai",name:"Z.AI (GLM-5)",icon:"psychology",color:"#2563EB",textIcon:"ZA",website:"https://open.bigmodel.cn",apiHint:"API key from https://open.bigmodel.cn/usercenter/apikeys"},"perplexity-search":{id:"perplexity-search",alias:"pplx-search",name:"Perplexity Search",icon:"search",color:"#20808D",textIcon:"PS",website:"https://docs.perplexity.ai/guides/search-quickstart",authHint:"Same API key as Perplexity (pplx-...)"},"serper-search":{id:"serper-search",alias:"serper-search",name:"Serper Search",icon:"search",color:"#4285F4",textIcon:"SP",website:"https://serper.dev",authHint:"API key from serper.dev dashboard"},"brave-search":{id:"brave-search",alias:"brave-search",name:"Brave Search",icon:"travel_explore",color:"#FB542B",textIcon:"BR",website:"https://brave.com/search/api",authHint:"Subscription token from Brave Search API dashboard"},"exa-search":{id:"exa-search",alias:"exa-search",name:"Exa Search",icon:"neurology",color:"#1E40AF",textIcon:"EX",website:"https://exa.ai",authHint:"API key from dashboard.exa.ai"},"tavily-search":{id:"tavily-search",alias:"tavily-search",name:"Tavily Search",icon:"manage_search",color:"#5B4FDB",textIcon:"TV",website:"https://tavily.com",authHint:"API key from app.tavily.com (format: tvly-...)"}},p="openai-compatible-",d="anthropic-compatible-";function r(e){return"string"==typeof e&&e.startsWith(p)}function n(e){return"string"==typeof e&&e.startsWith(d)}let m={...s,...c,...l},h=Object.values(m).reduce((e,t)=>(e[t.alias]=t.id,e),{});Object.values(m).reduce((e,t)=>(e[t.id]=t.alias,e),{}),(0,o.validateProviders)(s,"FREE_PROVIDERS"),(0,o.validateProviders)(c,"OAUTH_PROVIDERS"),(0,o.validateProviders)(l,"APIKEY_PROVIDERS"),e.s(["AI_PROVIDERS",0,m,"ALIAS_TO_ID",0,h,"ANTHROPIC_COMPATIBLE_PREFIX",0,d,"APIKEY_PROVIDERS",0,l,"FREE_PROVIDERS",0,s,"OAUTH_PROVIDERS",0,c,"OPENAI_COMPATIBLE_PREFIX",0,p,"isAnthropicCompatibleProvider",()=>n,"isOpenAICompatibleProvider",()=>r]),i()}catch(e){i(e)}},!1),606102,e=>{e.v(e=>Promise.resolve().then(()=>e(548941)))},789543,e=>{e.v(e=>Promise.resolve().then(()=>e(385498)))},579042,e=>{e.v(t=>Promise.all(["server/chunks/src_shared_utils_apiKey_ts_fa113e09._.js"].map(t=>e.l(t))).then(()=>t(65448)))},49794,e=>{e.v(t=>Promise.all(["server/chunks/src_shared_constants_pricing_ts_65de0558._.js"].map(t=>e.l(t))).then(()=>t(404503)))},386305,e=>{e.v(e=>Promise.resolve().then(()=>e(878947)))}];
1
+ module.exports=[918622,(e,t,i)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},556704,(e,t,i)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},832319,(e,t,i)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},324725,(e,t,i)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},270406,(e,t,i)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},193695,(e,t,i)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},442315,(e,t,i)=>{"use strict";t.exports=e.r(918622)},347540,(e,t,i)=>{"use strict";t.exports=e.r(442315).vendored["react-rsc"].React},819481,(e,t,i)=>{"use strict";var o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,s={},c={RequestCookies:()=>b,ResponseCookies:()=>g,parseCookie:()=>d,parseSetCookie:()=>m,stringifyCookie:()=>p};for(var l in c)o(s,l,{get:c[l],enumerable:!0});function p(e){var t;let i=["path"in e&&e.path&&`Path=${e.path}`,"expires"in e&&(e.expires||0===e.expires)&&`Expires=${("number"==typeof e.expires?new Date(e.expires):e.expires).toUTCString()}`,"maxAge"in e&&"number"==typeof e.maxAge&&`Max-Age=${e.maxAge}`,"domain"in e&&e.domain&&`Domain=${e.domain}`,"secure"in e&&e.secure&&"Secure","httpOnly"in e&&e.httpOnly&&"HttpOnly","sameSite"in e&&e.sameSite&&`SameSite=${e.sameSite}`,"partitioned"in e&&e.partitioned&&"Partitioned","priority"in e&&e.priority&&`Priority=${e.priority}`].filter(Boolean),o=`${e.name}=${encodeURIComponent(null!=(t=e.value)?t:"")}`;return 0===i.length?o:`${o}; ${i.join("; ")}`}function d(e){let t=new Map;for(let i of e.split(/; */)){if(!i)continue;let e=i.indexOf("=");if(-1===e){t.set(i,"true");continue}let[o,a]=[i.slice(0,e),i.slice(e+1)];try{t.set(o,decodeURIComponent(null!=a?a:"true"))}catch{}}return t}function m(e){if(!e)return;let[[t,i],...o]=d(e),{domain:a,expires:r,httponly:n,maxage:s,path:c,samesite:l,secure:p,partitioned:m,priority:b}=Object.fromEntries(o.map(([e,t])=>[e.toLowerCase().replace(/-/g,""),t]));{var g,x,y={name:t,value:decodeURIComponent(i),domain:a,...r&&{expires:new Date(r)},...n&&{httpOnly:!0},..."string"==typeof s&&{maxAge:Number(s)},path:c,...l&&{sameSite:h.includes(g=(g=l).toLowerCase())?g:void 0},...p&&{secure:!0},...b&&{priority:u.includes(x=(x=b).toLowerCase())?x:void 0},...m&&{partitioned:!0}};let e={};for(let t in y)y[t]&&(e[t]=y[t]);return e}}t.exports=((e,t,i,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of r(t))n.call(e,i)||void 0===i||o(e,i,{get:()=>t[i],enumerable:!(s=a(t,i))||s.enumerable});return e})(o({},"__esModule",{value:!0}),s);var h=["strict","lax","none"],u=["low","medium","high"],b=class{constructor(e){this._parsed=new Map,this._headers=e;const t=e.get("cookie");if(t)for(const[e,i]of d(t))this._parsed.set(e,{name:e,value:i})}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let i=Array.from(this._parsed);if(!e.length)return i.map(([e,t])=>t);let o="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return i.filter(([e])=>e===o).map(([e,t])=>t)}has(e){return this._parsed.has(e)}set(...e){let[t,i]=1===e.length?[e[0].name,e[0].value]:e,o=this._parsed;return o.set(t,{name:t,value:i}),this._headers.set("cookie",Array.from(o).map(([e,t])=>p(t)).join("; ")),this}delete(e){let t=this._parsed,i=Array.isArray(e)?e.map(e=>t.delete(e)):t.delete(e);return this._headers.set("cookie",Array.from(t).map(([e,t])=>p(t)).join("; ")),i}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(e=>`${e.name}=${encodeURIComponent(e.value)}`).join("; ")}},g=class{constructor(e){var t,i,o;this._parsed=new Map,this._headers=e;const a=null!=(o=null!=(i=null==(t=e.getSetCookie)?void 0:t.call(e))?i:e.get("set-cookie"))?o:[];for(const e of Array.isArray(a)?a:function(e){if(!e)return[];var t,i,o,a,r,n=[],s=0;function c(){for(;s<e.length&&/\s/.test(e.charAt(s));)s+=1;return s<e.length}for(;s<e.length;){for(t=s,r=!1;c();)if(","===(i=e.charAt(s))){for(o=s,s+=1,c(),a=s;s<e.length&&"="!==(i=e.charAt(s))&&";"!==i&&","!==i;)s+=1;s<e.length&&"="===e.charAt(s)?(r=!0,s=a,n.push(e.substring(t,o)),t=s):s=o+1}else s+=1;(!r||s>=e.length)&&n.push(e.substring(t,e.length))}return n}(a)){const t=m(e);t&&this._parsed.set(t.name,t)}}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let i=Array.from(this._parsed.values());if(!e.length)return i;let o="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return i.filter(e=>e.name===o)}has(e){return this._parsed.has(e)}set(...e){let[t,i,o]=1===e.length?[e[0].name,e[0].value,e[0]]:e,a=this._parsed;return a.set(t,function(e={name:"",value:""}){return"number"==typeof e.expires&&(e.expires=new Date(e.expires)),e.maxAge&&(e.expires=new Date(Date.now()+1e3*e.maxAge)),(null===e.path||void 0===e.path)&&(e.path="/"),e}({name:t,value:i,...o})),function(e,t){for(let[,i]of(t.delete("set-cookie"),e)){let e=p(i);t.append("set-cookie",e)}}(a,this._headers),this}delete(...e){let[t,i]="string"==typeof e[0]?[e[0]]:[e[0].name,e[0]];return this.set({...i,name:t,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(p).join("; ")}}},677850,e=>e.a(async(t,i)=>{try{let t=await e.y("zod");e.n(t),i()}catch(e){i(e)}},!0),180725,e=>{"use strict";e.i(245272),e.s([])},102835,e=>e.a(async(t,i)=>{try{var o=e.i(677850),a=t([o]);[o]=a.then?(await a)():a;let n=o.z.object({id:o.z.string().min(1),alias:o.z.string().min(1),name:o.z.string().min(1),icon:o.z.string().min(1),color:o.z.string().regex(/^#[0-9A-Fa-f]{6}$/,"Must be a valid hex color (#RRGGBB)"),textIcon:o.z.string().optional(),website:o.z.string().url().optional(),passthroughModels:o.z.boolean().optional(),deprecated:o.z.boolean().optional(),deprecationReason:o.z.string().optional(),hasFree:o.z.boolean().optional(),freeNote:o.z.string().optional(),authHint:o.z.string().optional(),apiHint:o.z.string().optional()}),s=o.z.record(o.z.string(),n);function r(e,t){let i=s.safeParse(e);if(!i.success){let e=i.error.issues.map(e=>` ${e.path.join(".")}: ${e.message}`).join("\n");throw console.error(`[PROVIDER VALIDATION] ${t} has invalid entries:
2
+ ${e}`),Error(`Provider validation failed for ${t}`)}}e.s(["validateProviders",()=>r]),i()}catch(e){i(e)}},!1),963219,e=>e.a(async(t,i)=>{try{var o=e.i(102835),a=t([o]);[o]=a.then?(await a)():a;let s={iflow:{id:"iflow",alias:"if",name:"iFlow AI",icon:"water_drop",color:"#6366F1"},qwen:{id:"qwen",alias:"qw",name:"Qwen Code",icon:"psychology",color:"#10B981"},"gemini-cli":{id:"gemini-cli",alias:"gc",name:"Gemini CLI",icon:"terminal",color:"#4285F4",deprecated:!0,deprecationReason:"Google restricts third-party OAuth usage for Gemini CLI (Mar 2026). Pro models require paid plans. Use 'gemini' (API key) provider instead."},kiro:{id:"kiro",alias:"kr",name:"Kiro AI",icon:"psychology_alt",color:"#FF6B35"}},c={claude:{id:"claude",alias:"cc",name:"Claude Code",icon:"smart_toy",color:"#D97757"},antigravity:{id:"antigravity",alias:"ag",name:"Antigravity",icon:"rocket_launch",color:"#F59E0B"},codex:{id:"codex",alias:"cx",name:"OpenAI Codex",icon:"code",color:"#3B82F6"},github:{id:"github",alias:"gh",name:"GitHub Copilot",icon:"code",color:"#333333"},cursor:{id:"cursor",alias:"cu",name:"Cursor IDE",icon:"edit_note",color:"#00D4AA"},"kimi-coding":{id:"kimi-coding",alias:"kmc",name:"Kimi Coding",icon:"psychology",color:"#1E40AF",textIcon:"KC"},kilocode:{id:"kilocode",alias:"kc",name:"Kilo Code",icon:"code",color:"#FF6B35",textIcon:"KC"},cline:{id:"cline",alias:"cl",name:"Cline",icon:"smart_toy",color:"#5B9BD5",textIcon:"CL"}},l={openrouter:{id:"openrouter",alias:"openrouter",name:"OpenRouter",icon:"router",color:"#F97316",textIcon:"OR",passthroughModels:!0,website:"https://openrouter.ai"},glm:{id:"glm",alias:"glm",name:"GLM Coding",icon:"code",color:"#2563EB",textIcon:"GL",website:"https://open.bigmodel.cn"},"bailian-coding-plan":{id:"bailian-coding-plan",alias:"bcp",name:"Alibaba Coding Plan",icon:"code",color:"#FF6A00",textIcon:"BCP",website:"https://www.alibabacloud.com/help/en/model-studio/coding-plan"},kimi:{id:"kimi",alias:"kimi",name:"Kimi",icon:"psychology",color:"#1E3A8A",textIcon:"KM",website:"https://kimi.moonshot.cn"},"kimi-coding-apikey":{id:"kimi-coding-apikey",alias:"kmca",name:"Kimi Coding (API Key)",icon:"psychology",color:"#1E40AF",textIcon:"KC",website:"https://kimi.com"},minimax:{id:"minimax",alias:"minimax",name:"Minimax Coding",icon:"memory",color:"#7C3AED",textIcon:"MM",website:"https://www.minimaxi.com"},"minimax-cn":{id:"minimax-cn",alias:"minimax-cn",name:"Minimax (China)",icon:"memory",color:"#DC2626",textIcon:"MC",website:"https://www.minimaxi.com"},alicode:{id:"alicode",alias:"alicode",name:"Alibaba",icon:"cloud",color:"#FF6A00",textIcon:"ALi",website:"https://bailian.console.aliyun.com"},"alicode-intl":{id:"alicode-intl",alias:"alicode-intl",name:"Alibaba Intl",icon:"cloud",color:"#FF6A00",textIcon:"ALi",website:"https://modelstudio.console.alibabacloud.com"},openai:{id:"openai",alias:"openai",name:"OpenAI",icon:"auto_awesome",color:"#10A37F",textIcon:"OA",website:"https://platform.openai.com"},anthropic:{id:"anthropic",alias:"anthropic",name:"Anthropic",icon:"smart_toy",color:"#D97757",textIcon:"AN",website:"https://console.anthropic.com"},gemini:{id:"gemini",alias:"gemini",name:"Gemini",icon:"diamond",color:"#4285F4",textIcon:"GE",website:"https://ai.google.dev"},deepseek:{id:"deepseek",alias:"ds",name:"DeepSeek",icon:"bolt",color:"#4D6BFE",textIcon:"DS",website:"https://deepseek.com"},groq:{id:"groq",alias:"groq",name:"Groq",icon:"speed",color:"#F55036",textIcon:"GQ",website:"https://groq.com",hasFree:!0,freeNote:"Free tier: 30 RPM / 14.4K RPD — no credit card"},blackbox:{id:"blackbox",alias:"bb",name:"Blackbox AI",icon:"view_in_ar",color:"#1A1A2E",textIcon:"BB",website:"https://blackbox.ai"},xai:{id:"xai",alias:"xai",name:"xAI (Grok)",icon:"auto_awesome",color:"#1DA1F2",textIcon:"XA",website:"https://x.ai"},mistral:{id:"mistral",alias:"mistral",name:"Mistral",icon:"air",color:"#FF7000",textIcon:"MI",website:"https://mistral.ai"},perplexity:{id:"perplexity",alias:"pplx",name:"Perplexity",icon:"search",color:"#20808D",textIcon:"PP",website:"https://www.perplexity.ai"},together:{id:"together",alias:"together",name:"Together AI",icon:"group_work",color:"#0F6FFF",textIcon:"TG",website:"https://www.together.ai"},fireworks:{id:"fireworks",alias:"fireworks",name:"Fireworks AI",icon:"local_fire_department",color:"#7B2EF2",textIcon:"FW",website:"https://fireworks.ai"},cerebras:{id:"cerebras",alias:"cerebras",name:"Cerebras",icon:"memory",color:"#FF4F00",textIcon:"CB",website:"https://inference.cerebras.ai",hasFree:!0,freeNote:"Free: 1M tokens/day, 60K TPM — world's fastest inference"},cohere:{id:"cohere",alias:"cohere",name:"Cohere",icon:"hub",color:"#39594D",textIcon:"CO",website:"https://cohere.com"},nvidia:{id:"nvidia",alias:"nvidia",name:"NVIDIA NIM",icon:"developer_board",color:"#76B900",textIcon:"NV",website:"https://build.nvidia.com",hasFree:!0,freeNote:"Free dev access: ~40 RPM, 70+ models (Kimi K2.5, GLM 4.7, DeepSeek V3.2...)"},nebius:{id:"nebius",alias:"nebius",name:"Nebius AI",icon:"cloud",color:"#6C5CE7",textIcon:"NB",website:"https://nebius.com"},siliconflow:{id:"siliconflow",alias:"siliconflow",name:"SiliconFlow",icon:"cloud_queue",color:"#5B6EF5",textIcon:"SF",website:"https://cloud.siliconflow.com"},hyperbolic:{id:"hyperbolic",alias:"hyp",name:"Hyperbolic",icon:"bolt",color:"#00D4FF",textIcon:"HY",website:"https://hyperbolic.xyz"},deepgram:{id:"deepgram",alias:"dg",name:"Deepgram",icon:"mic",color:"#13EF93",textIcon:"DG",website:"https://deepgram.com"},assemblyai:{id:"assemblyai",alias:"aai",name:"AssemblyAI",icon:"record_voice_over",color:"#0062FF",textIcon:"AA",website:"https://assemblyai.com"},nanobanana:{id:"nanobanana",alias:"nb",name:"NanoBanana",icon:"image",color:"#FFD700",textIcon:"NB",website:"https://nanobananaapi.ai"},"ollama-cloud":{id:"ollama-cloud",alias:"ollamacloud",name:"Ollama Cloud",icon:"cloud",color:"#58A6FF",textIcon:"OC",website:"https://ollama.com/settings/api-keys"},elevenlabs:{id:"elevenlabs",alias:"el",name:"ElevenLabs",icon:"record_voice_over",color:"#6C47FF",textIcon:"EL",website:"https://elevenlabs.io"},cartesia:{id:"cartesia",alias:"cartesia",name:"Cartesia",icon:"spatial_audio",color:"#FF4F8B",textIcon:"CA",website:"https://cartesia.ai"},playht:{id:"playht",alias:"playht",name:"PlayHT",icon:"play_circle",color:"#00B4D8",textIcon:"PH",website:"https://play.ht"},inworld:{id:"inworld",alias:"inworld",name:"Inworld",icon:"voice_chat",color:"#7B2EF2",textIcon:"IW",website:"https://inworld.ai"},sdwebui:{id:"sdwebui",alias:"sdwebui",name:"SD WebUI",icon:"brush",color:"#FF7043",textIcon:"SD",website:"https://github.com/AUTOMATIC1111/stable-diffusion-webui"},comfyui:{id:"comfyui",alias:"comfyui",name:"ComfyUI",icon:"account_tree",color:"#4CAF50",textIcon:"CF",website:"https://github.com/comfyanonymous/ComfyUI"},huggingface:{id:"huggingface",alias:"hf",name:"HuggingFace",icon:"face",color:"#FFD21E",textIcon:"HF",website:"https://huggingface.co",hasFree:!0,freeNote:"Free Inference API for thousands of models (Whisper, VITS, SDXL…)"},synthetic:{id:"synthetic",alias:"synthetic",name:"Synthetic",icon:"verified_user",color:"#6366F1",textIcon:"SY",website:"https://synthetic.new",passthroughModels:!0},"kilo-gateway":{id:"kilo-gateway",alias:"kg",name:"Kilo Gateway",icon:"hub",color:"#617A91",textIcon:"KG",website:"https://kilo.ai",passthroughModels:!0},vertex:{id:"vertex",alias:"vertex",name:"Vertex AI",icon:"cloud",color:"#4285F4",textIcon:"VA",website:"https://cloud.google.com/vertex-ai",authHint:"Provide Service Account JSON or OAuth access_token"},zai:{id:"zai",alias:"zai",name:"Z.AI (GLM-5)",icon:"psychology",color:"#2563EB",textIcon:"ZA",website:"https://open.bigmodel.cn",apiHint:"API key from https://open.bigmodel.cn/usercenter/apikeys"},"perplexity-search":{id:"perplexity-search",alias:"pplx-search",name:"Perplexity Search",icon:"search",color:"#20808D",textIcon:"PS",website:"https://docs.perplexity.ai/guides/search-quickstart",authHint:"Same API key as Perplexity (pplx-...)"},"serper-search":{id:"serper-search",alias:"serper-search",name:"Serper Search",icon:"search",color:"#4285F4",textIcon:"SP",website:"https://serper.dev",authHint:"API key from serper.dev dashboard"},"brave-search":{id:"brave-search",alias:"brave-search",name:"Brave Search",icon:"travel_explore",color:"#FB542B",textIcon:"BR",website:"https://brave.com/search/api",authHint:"Subscription token from Brave Search API dashboard"},"exa-search":{id:"exa-search",alias:"exa-search",name:"Exa Search",icon:"neurology",color:"#1E40AF",textIcon:"EX",website:"https://exa.ai",authHint:"API key from dashboard.exa.ai"},"tavily-search":{id:"tavily-search",alias:"tavily-search",name:"Tavily Search",icon:"manage_search",color:"#5B4FDB",textIcon:"TV",website:"https://tavily.com",authHint:"API key from app.tavily.com (format: tvly-...)"}},p="openai-compatible-",d="anthropic-compatible-";function r(e){return"string"==typeof e&&e.startsWith(p)}function n(e){return"string"==typeof e&&e.startsWith(d)}let m={...s,...c,...l},h=Object.values(m).reduce((e,t)=>(e[t.alias]=t.id,e),{});Object.values(m).reduce((e,t)=>(e[t.id]=t.alias,e),{}),(0,o.validateProviders)(s,"FREE_PROVIDERS"),(0,o.validateProviders)(c,"OAUTH_PROVIDERS"),(0,o.validateProviders)(l,"APIKEY_PROVIDERS"),e.s(["AI_PROVIDERS",0,m,"ALIAS_TO_ID",0,h,"ANTHROPIC_COMPATIBLE_PREFIX",0,d,"APIKEY_PROVIDERS",0,l,"FREE_PROVIDERS",0,s,"OAUTH_PROVIDERS",0,c,"OPENAI_COMPATIBLE_PREFIX",0,p,"isAnthropicCompatibleProvider",()=>n,"isOpenAICompatibleProvider",()=>r]),i()}catch(e){i(e)}},!1),606102,e=>{e.v(e=>Promise.resolve().then(()=>e(548941)))},789543,e=>{e.v(e=>Promise.resolve().then(()=>e(385498)))},579042,e=>{e.v(t=>Promise.all(["server/chunks/src_shared_utils_apiKey_ts_fa113e09._.js"].map(t=>e.l(t))).then(()=>t(65448)))},49794,e=>{e.v(t=>Promise.all(["server/chunks/src_shared_constants_pricing_ts_65de0558._.js"].map(t=>e.l(t))).then(()=>t(404503)))},386305,e=>{e.v(e=>Promise.resolve().then(()=>e(878947)))}];
3
3
 
4
4
  //# sourceMappingURL=%5Broot-of-the-server%5D__ebf3fe48._.js.map