@zuplo/cli 6.73.17 → 6.73.19

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 (176) hide show
  1. package/node_modules/@hono/node-server/README.md +58 -25
  2. package/node_modules/@hono/node-server/dist/conninfo.cjs +22 -0
  3. package/node_modules/@hono/node-server/dist/{conninfo.d.ts → conninfo.d.cts} +4 -3
  4. package/node_modules/@hono/node-server/dist/conninfo.d.mts +4 -3
  5. package/node_modules/@hono/node-server/dist/conninfo.mjs +19 -16
  6. package/node_modules/@hono/node-server/dist/constants-BLSFu_RU.mjs +5 -0
  7. package/node_modules/@hono/node-server/dist/constants-BXAKTxRC.cjs +11 -0
  8. package/node_modules/@hono/node-server/dist/index.cjs +1173 -0
  9. package/node_modules/@hono/node-server/dist/index.d.cts +101 -0
  10. package/node_modules/@hono/node-server/dist/index.d.mts +101 -8
  11. package/node_modules/@hono/node-server/dist/index.mjs +1143 -637
  12. package/node_modules/@hono/node-server/dist/serve-static.cjs +151 -0
  13. package/node_modules/@hono/node-server/dist/serve-static.d.cts +18 -0
  14. package/node_modules/@hono/node-server/dist/serve-static.d.mts +14 -13
  15. package/node_modules/@hono/node-server/dist/serve-static.mjs +143 -145
  16. package/node_modules/@hono/node-server/dist/utils/response.cjs +8 -0
  17. package/node_modules/@hono/node-server/dist/utils/response.d.cts +4 -0
  18. package/node_modules/@hono/node-server/dist/utils/response.d.mts +3 -2
  19. package/node_modules/@hono/node-server/dist/utils/response.mjs +6 -9
  20. package/node_modules/@hono/node-server/dist/utils/stream.cjs +65 -0
  21. package/node_modules/@hono/node-server/dist/utils/stream.d.cts +6 -0
  22. package/node_modules/@hono/node-server/dist/utils/stream.d.mts +6 -0
  23. package/node_modules/@hono/node-server/dist/utils/stream.mjs +64 -0
  24. package/node_modules/@hono/node-server/package.json +65 -54
  25. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/index.d.ts.map +1 -1
  26. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/index.js +1 -12
  27. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/index.js.map +1 -1
  28. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.d.ts +7 -0
  29. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.d.ts.map +1 -1
  30. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.js +9 -3
  31. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/stdio.js.map +1 -1
  32. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.d.ts.map +1 -1
  33. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.js +5 -3
  34. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/client/streamableHttp.js.map +1 -1
  35. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.d.ts.map +1 -1
  36. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.js +1 -12
  37. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.js.map +1 -1
  38. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sseKeepAlive.d.ts +5 -0
  39. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sseKeepAlive.d.ts.map +1 -0
  40. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sseKeepAlive.js +17 -0
  41. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/sseKeepAlive.js.map +1 -0
  42. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.d.ts +9 -1
  43. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.d.ts.map +1 -1
  44. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.js +10 -4
  45. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/stdio.js.map +1 -1
  46. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.d.ts +21 -0
  47. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.d.ts.map +1 -1
  48. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.js +239 -41
  49. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/webStandardStreamableHttp.js.map +1 -1
  50. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-compat.d.ts.map +1 -1
  51. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-compat.js +25 -6
  52. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/zod-compat.js.map +1 -1
  53. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/mediaType.d.ts +32 -0
  54. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/mediaType.d.ts.map +1 -0
  55. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/mediaType.js +64 -0
  56. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/mediaType.js.map +1 -0
  57. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.d.ts +5 -0
  58. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.d.ts.map +1 -1
  59. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.js +10 -1
  60. package/node_modules/@modelcontextprotocol/sdk/dist/cjs/shared/stdio.js.map +1 -1
  61. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.d.ts.map +1 -1
  62. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js +2 -13
  63. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js.map +1 -1
  64. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.d.ts +7 -0
  65. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.d.ts.map +1 -1
  66. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js +9 -3
  67. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js.map +1 -1
  68. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.d.ts.map +1 -1
  69. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js +5 -3
  70. package/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js.map +1 -1
  71. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.d.ts.map +1 -1
  72. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js +2 -13
  73. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js.map +1 -1
  74. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sseKeepAlive.d.ts +5 -0
  75. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sseKeepAlive.d.ts.map +1 -0
  76. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sseKeepAlive.js +13 -0
  77. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sseKeepAlive.js.map +1 -0
  78. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.d.ts +9 -1
  79. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.d.ts.map +1 -1
  80. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js +10 -4
  81. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js.map +1 -1
  82. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.d.ts +21 -0
  83. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.d.ts.map +1 -1
  84. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js +239 -41
  85. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js.map +1 -1
  86. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.d.ts.map +1 -1
  87. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js +25 -6
  88. package/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js.map +1 -1
  89. package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.d.ts +32 -0
  90. package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.d.ts.map +1 -0
  91. package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.js +57 -0
  92. package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.js.map +1 -0
  93. package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.d.ts +5 -0
  94. package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.d.ts.map +1 -1
  95. package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js +9 -0
  96. package/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js.map +1 -1
  97. package/node_modules/@modelcontextprotocol/sdk/package.json +4 -3
  98. package/node_modules/@zuplo/core/package.json +1 -1
  99. package/node_modules/@zuplo/graphql/package.json +1 -1
  100. package/node_modules/@zuplo/openapi-tools/package.json +1 -1
  101. package/node_modules/@zuplo/otel/out/esm/chunk-JYT2Q52R.js +26 -0
  102. package/node_modules/@zuplo/otel/out/esm/chunk-JYT2Q52R.js.map +1 -0
  103. package/node_modules/@zuplo/otel/out/esm/index.js +1 -1
  104. package/node_modules/@zuplo/otel/package.json +1 -1
  105. package/node_modules/@zuplo/runtime/out/esm/{chunk-OAVAM6CR.js → chunk-JPPAUB3E.js} +3 -3
  106. package/node_modules/@zuplo/runtime/out/esm/chunk-JPPAUB3E.js.map +1 -0
  107. package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
  108. package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
  109. package/node_modules/@zuplo/runtime/out/types/index.d.ts +10 -3
  110. package/node_modules/@zuplo/runtime/package.json +1 -1
  111. package/node_modules/express-rate-limit/dist/index.d.cts +10 -12
  112. package/node_modules/express-rate-limit/dist/index.d.mts +10 -12
  113. package/node_modules/express-rate-limit/dist/index.d.ts +10 -12
  114. package/node_modules/express-rate-limit/package.json +5 -5
  115. package/node_modules/express-rate-limit/readme.md +2 -2
  116. package/node_modules/ip-address/README.md +102 -100
  117. package/node_modules/ip-address/dist/common.d.ts +23 -0
  118. package/node_modules/ip-address/dist/common.js +27 -4
  119. package/node_modules/ip-address/dist/common.js.map +1 -1
  120. package/node_modules/ip-address/dist/ipv4.d.ts +7 -0
  121. package/node_modules/ip-address/dist/ipv4.js +19 -7
  122. package/node_modules/ip-address/dist/ipv4.js.map +1 -1
  123. package/node_modules/ip-address/dist/ipv6.d.ts +7 -0
  124. package/node_modules/ip-address/dist/ipv6.js +38 -25
  125. package/node_modules/ip-address/dist/ipv6.js.map +1 -1
  126. package/node_modules/ip-address/dist/v4/constants.js +5 -1
  127. package/node_modules/ip-address/dist/v4/constants.js.map +1 -1
  128. package/node_modules/ip-address/package.json +2 -2
  129. package/package.json +6 -6
  130. package/node_modules/@hono/node-server/dist/conninfo.js +0 -42
  131. package/node_modules/@hono/node-server/dist/globals.d.mts +0 -2
  132. package/node_modules/@hono/node-server/dist/globals.d.ts +0 -2
  133. package/node_modules/@hono/node-server/dist/globals.js +0 -29
  134. package/node_modules/@hono/node-server/dist/globals.mjs +0 -5
  135. package/node_modules/@hono/node-server/dist/index.d.ts +0 -8
  136. package/node_modules/@hono/node-server/dist/index.js +0 -702
  137. package/node_modules/@hono/node-server/dist/listener.d.mts +0 -13
  138. package/node_modules/@hono/node-server/dist/listener.d.ts +0 -13
  139. package/node_modules/@hono/node-server/dist/listener.js +0 -670
  140. package/node_modules/@hono/node-server/dist/listener.mjs +0 -635
  141. package/node_modules/@hono/node-server/dist/request.d.mts +0 -25
  142. package/node_modules/@hono/node-server/dist/request.d.ts +0 -25
  143. package/node_modules/@hono/node-server/dist/request.js +0 -238
  144. package/node_modules/@hono/node-server/dist/request.mjs +0 -206
  145. package/node_modules/@hono/node-server/dist/response.d.mts +0 -26
  146. package/node_modules/@hono/node-server/dist/response.d.ts +0 -26
  147. package/node_modules/@hono/node-server/dist/response.js +0 -112
  148. package/node_modules/@hono/node-server/dist/response.mjs +0 -85
  149. package/node_modules/@hono/node-server/dist/serve-static.d.ts +0 -17
  150. package/node_modules/@hono/node-server/dist/serve-static.js +0 -177
  151. package/node_modules/@hono/node-server/dist/server.d.mts +0 -10
  152. package/node_modules/@hono/node-server/dist/server.d.ts +0 -10
  153. package/node_modules/@hono/node-server/dist/server.js +0 -696
  154. package/node_modules/@hono/node-server/dist/server.mjs +0 -660
  155. package/node_modules/@hono/node-server/dist/types.d.mts +0 -44
  156. package/node_modules/@hono/node-server/dist/types.d.ts +0 -44
  157. package/node_modules/@hono/node-server/dist/types.js +0 -18
  158. package/node_modules/@hono/node-server/dist/types.mjs +0 -0
  159. package/node_modules/@hono/node-server/dist/utils/response/constants.d.mts +0 -3
  160. package/node_modules/@hono/node-server/dist/utils/response/constants.d.ts +0 -3
  161. package/node_modules/@hono/node-server/dist/utils/response/constants.js +0 -30
  162. package/node_modules/@hono/node-server/dist/utils/response/constants.mjs +0 -5
  163. package/node_modules/@hono/node-server/dist/utils/response.d.ts +0 -3
  164. package/node_modules/@hono/node-server/dist/utils/response.js +0 -37
  165. package/node_modules/@hono/node-server/dist/utils.d.mts +0 -9
  166. package/node_modules/@hono/node-server/dist/utils.d.ts +0 -9
  167. package/node_modules/@hono/node-server/dist/utils.js +0 -99
  168. package/node_modules/@hono/node-server/dist/utils.mjs +0 -71
  169. package/node_modules/@hono/node-server/dist/vercel.d.mts +0 -7
  170. package/node_modules/@hono/node-server/dist/vercel.d.ts +0 -7
  171. package/node_modules/@hono/node-server/dist/vercel.js +0 -677
  172. package/node_modules/@hono/node-server/dist/vercel.mjs +0 -640
  173. package/node_modules/@zuplo/otel/out/esm/chunk-JWNK52ES.js +0 -26
  174. package/node_modules/@zuplo/otel/out/esm/chunk-JWNK52ES.js.map +0 -1
  175. package/node_modules/@zuplo/runtime/out/esm/chunk-OAVAM6CR.js.map +0 -1
  176. /package/node_modules/@zuplo/runtime/out/esm/{chunk-OAVAM6CR.js.LEGAL.txt → chunk-JPPAUB3E.js.LEGAL.txt} +0 -0
@@ -62,7 +62,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
62
62
  `,pad:u,indent:u+p}:m={newline:"@@__STRINGIFY_OBJECT_NEW_LINE__@@",newlineOrSpace:"@@__STRINGIFY_OBJECT_NEW_LINE_OR_SPACE__@@",pad:"@@__STRINGIFY_OBJECT_PAD__@@",indent:"@@__STRINGIFY_OBJECT_INDENT__@@"};let g=s(h=>{if(c.inlineCharacterLimit===void 0)return h;let f=h.replace(new RegExp(m.newline,"g"),"").replace(new RegExp(m.newlineOrSpace,"g")," ").replace(new RegExp(`${m.pad}|${m.indent}`,"g"),"");return f.length<=c.inlineCharacterLimit?f:h.replace(new RegExp(`${m.newline}|${m.newlineOrSpace}`,"g"),`
63
63
  `).replace(new RegExp(m.pad,"g"),u).replace(new RegExp(m.indent,"g"),u+p)},"expandWhiteSpace");if(o.includes(a))return'"[Circular]"';if(a==null||typeof a=="number"||typeof a=="boolean"||typeof a=="function"||typeof a=="symbol"||eI(a))return String(a);if(a instanceof Date)return`new Date('${a.toISOString()}')`;if(d>r)return"...";if(Array.isArray(a)){if(a.length===0)return"[]";o.push(a);let h="["+m.newline+a.map((f,v)=>{let b=a.length-1===v?m.newline:`,${m.newlineOrSpace}`,w=i(f,c,u+p,d+1);return c.transform&&(w=c.transform(a,v,w)),m.indent+w+b}).join("")+m.pad+"]";return o.pop(),g(h)}if(Xr(a)){let h=tI(a);if(c.filter&&(h=h.filter(v=>c.filter?.(a,v))),h.length===0)return"{}";o.push(a);let f="{"+m.newline+h.map((v,b)=>{let w=h.length-1===b?m.newline:`,${m.newlineOrSpace}`,S=typeof v=="symbol",x=!S&&/^[a-z$_][$\w]*$/i.test(v),C=S||x?v:i(v,c,"",d+1),A=i(a[v],c,u+p,d+1);return c.transform&&(A=c.transform(a,v,A)),`${m.indent+String(C)}: ${A}${w}`}).join("")+m.pad+"}";return o.pop(),g(f)}return a=a.replace(/\\/g,"\\\\"),a=String(a).replace(/[\r\n]/g,h=>h===`
64
64
  `?"\\n":"\\r"),c.singleQuotes===!1?(a=a.replace(/"/g,'\\"'),`"${a}"`):(a=a.replace(/'/g,"\\'"),`'${a}'`)}),"stringify")(t,e,n,0)}s(fc,"stringifyObject");function Xt(t){return lI(eo(t))}s(Xt,"serializeMessage");function jn(t){return t.map(e=>Xt(e))}s(jn,"serializeMessages");function zo(t){if(t.length===0)return"<no data provided to log>";let e=t[0];return typeof e=="string"?e:e instanceof Error?e.message:lI(eo(e))}s(zo,"extractBestMessage");function uI(t){let e=[];return t.forEach(n=>{if(typeof n=="string")e.push(n);else if(ns(n))if(n.stack)e.push(n.stack);else{let o=fc(eo(n));e.push(o)}else if(typeof n=="object"){let o=fc(n);e.push(o)}else{let o=gc(n);e.push(o)}}),e.join(`
65
- `)}s(uI,"messagesToMultilineText");function lI(t){return typeof t=="string"?t:JSON.stringify(t)}s(lI,"stringifyNonString");function gc(t){return typeof t=="string"?t:t===null?"null":typeof t>"u"?"undefined":typeof t=="number"||typeof t=="boolean"||typeof t=="bigint"||typeof t=="symbol"?t.toString():typeof t=="function"?`[function ${t.name}]`:typeof t=="object"&&Array.isArray(t)?`[array ${t.length}]`:t instanceof Error?`${t.name??"Error"}: ${t.message??"unknown"}`:typeof t=="object"?Fd(t):"unknown"}s(gc,"stringifyNonStringToText");var ZM={internal:1,trace:2,debug:5,info:9,warn:13,error:17,fatal:21},hc=s(t=>e=>{let n={};return n.accountName=t.accountName,n.projectName=t.projectName,n.deploymentName=t.deploymentName,n.environmentType=t.loggingEnvironmentStage,n.labels={requestId:e.requestId,source:e.logSource,logOwner:e.logOwner},n.rayId=e.rayId??"",n.runtime={buildId:t.build.BUILD_ID,buildTimestamp:t.build.TIMESTAMP,gitSHA:t.build.GIT_SHA,version:t.build.ZUPLO_VERSION},n.atomicCounter=e.vectorClock,{logId:e.logId,timestamp:e.timestamp,observerdTimestamp:e.timestamp,traceId:e.requestId,severityText:e.level,severityNumber:ZM[e.level],body:jn(e.messages),attributes:n}},"unifiedFormatter");async function Ce(t,e){if(t.level==="error"&&D.console.error(t.messages),!T.instance.remoteLogURL||!T.instance.loggingId||!T.instance.remoteLogToken)return;let n;try{n=await e?.text()}catch{}try{let o={...t,messages:[...t.messages,...n?[n]:[]],logId:crypto.randomUUID(),logOwner:"user",logSource:"runtime",rayId:null,requestId:`global-${crypto.randomUUID()}`,timestamp:new Date,buildId:T.instance.build.BUILD_ID,loggingId:T.instance.loggingId,vectorClock:0};await dI(T.instance,[o])}catch(o){D.console.error(o)}}s(Ce,"sendRemoteGlobalLog");async function dI(t,e){let n=hc(t);try{let o=new Headers({"content-type":"application/json",authentication:`Bearer ${t.remoteLogToken}`});Ve(o),await D.fetch(new URL("/v1/runtime-logs",t.remoteLogURL).toString(),{method:"POST",body:JSON.stringify({entries:e.map(n)}),headers:{"content-type":"application/json","user-agent":T.instance.systemUserAgent,"zp-dn":T.instance.deploymentName??"unknown"}})}catch(o){D.console.error(o)}}s(dI,"sendLogs");var HM=s(t=>async e=>{e.length!==0&&await dI(t,e)},"dispatchFunction"),yc,rs=class{static{s(this,"UnifiedLogTransport")}constructor(e){yc||(yc=new be({name:"unified-log-transport",msDelay:1,dispatchFunction:HM(e)}))}log(e,n){yc.enqueue(e),n.waitUntil(yc.waitUntilFlushed())}};var Wd=class extends lt{constructor(n){super();this.options=n}options;static{s(this,"GoogleCloudLoggingPlugin")}getTransport(){return new os(this.options)}},FM="https://logging.googleapis.com/v2/entries:write?alt=json",Yd={error:"ERROR",warn:"WARNING",info:"INFO",debug:"DEBUG"},os=class{static{s(this,"GoogleLogTransport")}constructor(e){B("logging.google-cloud"),this.#r=e.logName,this.#e=e.serviceAccountJson,this.#o=T.instance.loggingEnvironmentType,this.#i=T.instance.loggingEnvironmentStage,this.#n=T.instance.deploymentName,this.#s=e.fields??{}}#e;#t;#r;#n;#o;#i;#s;async init(){this.#t=await qt.init(this.#e)}log(e,n){if(!this.#t)throw new Pe("Invalid state - Google log transport is not initialized");if(e.messages.length===0)return;let o=Object.assign({allMessages:jn(e.messages)},this.#s,n.properties??{}),r=this.#t.projectId??"zuplo-production",i={logName:this.#r,resource:{type:"global"},severity:Yd[e.level],timestamp:e.timestamp,trace:`projects/${r}/traces/${e.requestId}`,labels:{requestId:e.requestId,buildId:e.buildId,source:e.logSource,loggingId:e.loggingId,logOwner:e.logOwner,environment:this.#n,environmentType:this.#o,environmentStage:this.#i}};e.rayId&&(i.labels.rayId=e.rayId);let a=zo(o.allMessages);i.jsonPayload={...o,message:a},this.batcher.enqueue(i),n.waitUntil(this.batcher.waitUntilFlushed())}dispatchFunction=s(async e=>{if(e.length===0)return;this.#t||(this.#t=await qt.init(this.#e));let n=await yn({serviceAccount:this.#t,audience:"https://logging.googleapis.com/google.logging.v2.LoggingServiceV2"});try{let o=await D.fetch(FM,{method:"POST",body:JSON.stringify({entries:e}),headers:{Authorization:`Bearer ${n}`,"content-type":"application/json;charset=UTF-8"}});o.ok||await Ce({level:"error",messages:[`Failed to send logs to Google: ${o.status} - ${o.statusText}`]},o)}catch{await Ce({level:"error",messages:["Failed to connect to Google logging service. Check that the URL is correct."]})}},"dispatchFunction");batcher=new be({name:"google-log-transport",msDelay:1,dispatchFunction:this.dispatchFunction})};var tp=class extends lt{constructor(n){super();this.options=n}options;static{s(this,"DataDogLoggingPlugin")}getTransport(){return new is(this.options)}},Qd="__ddtags",Xd="__ddattr",ep=s(t=>t.replaceAll(",","_").replaceAll(":","_"),"cleanTagText"),GM=s(t=>{let e=Object.keys(t),n=[];return e.forEach(o=>{let r=t[o];r==null?n.push(ep(o)):n.push(`${ep(o)}:${ep(r.toString())}`)}),n.join(",")},"formatTags"),is=class{static{s(this,"DataDogTransport")}constructor(e){B("logging.datadog"),this.#e=e.apiKey,this.#t=e.url??"https://http-intake.logs.datadoghq.com/api/v2/logs",this.#n=T.instance.loggingEnvironmentType,this.#o=T.instance.loggingEnvironmentStage,this.#r=T.instance.deploymentName,this.#i=e.fields??{},this.#s=e.tags??{},this.#a=e.source??"Zuplo"}#e;#t;#r;#n;#o;#i;#s;#a;log(e,n){let o=Object.assign({},this.#s),r=Object.assign({},this.#i,n.properties??{}),i=[...e.messages];if(!T.instance.build.COMPATIBILITY_FLAGS.removeLegacyLogInitialization){let d=n.custom[Qd];d&&typeof d=="object"&&(B("logging.datadog.legacy-tags"),Object.assign(o,d));let p=e.messages.findIndex(h=>h[Qd]!==void 0);p>-1&&(Object.assign(o,i[p][Qd]),i.splice(p,1));let m=n.custom[Xd];m&&typeof m=="object"&&(B("logging.datadog.legacy-attributes"),Object.assign(r,m));let g=e.messages.findIndex(h=>h[Xd]!==void 0);g>-1&&(Object.assign(r,i[g][Xd]),i.splice(g,1))}let a=jn(i),c={...e,activityId:e.requestId,trace:e.requestId},u=Object.assign({message:{...c,messages:a},ddsource:this.#a,hostname:new URL(n.originalRequest.url).hostname,msg:zo(a),atomic_counter:e.vectorClock,service:e.loggingId,ddtags:GM(o),environment:this.#r,environment_type:this.#n,environment_stage:this.#o,ray_id:e.rayId,request_id:e.requestId},r);this.batcher.enqueue(u),n.waitUntil(this.batcher.waitUntilFlushed())}dispatchFunction=s(async e=>{if(e.length!==0)try{let n=await D.fetch(this.#t,{method:"POST",body:JSON.stringify([...e]),headers:{"content-type":"application/json","DD-API-KEY":this.#e}});n.ok||await Ce({level:"error",messages:[`Failed to send logs to DataDog: ${n.status} - ${n.statusText}`]},n)}catch{await Ce({level:"error",messages:["Failed to connect to DataDog logging service. Check that the URL is correct."]})}},"dispatchFunction");batcher=new be({name:"data-dog-transport",msDelay:10,dispatchFunction:this.dispatchFunction})};var bc=class{static{s(this,"ErrorClassifier")}#e=new Set;#t=0;record(e){this.#e.add(e),this.#t+=1}get count(){return this.#t}classes(){return[...this.#e]}hasErrors(){return this.#t>0}};function pI(t){return t===401||t===403?"auth":t===408||t===504?"timeout":t>=500?"resolver":null}s(pI,"classifyHttpStatus");function mI(){return{startTimeMs:performance.now(),documentHash:null,documentSnippet:null,operationType:"",operationName:"",maxDepth:0,complexity:null,persistedQueryHash:null,errors:new bc,cacheState:null}}s(mI,"createOperationContext");var np=new ne(Symbol("graphql-operation-context"));function fI(t,e){np.set(t,e)}s(fI,"attachOperationContext");function gI(t){return np.get(t)}s(gI,"getOperationContext");function BM(t,e){let n=np.get(t);n&&(n.cacheState=e)}s(BM,"recordGraphqlCacheState");var jo=class{static{s(this,"LookupResult")}constructor(e,n,o){this.routeConfiguration=e,this.params=o??{},this.executableHandler=n}executableHandler;routeConfiguration;params},wc=class extends Error{static{s(this,"RouterError")}};import{trace as $N}from"@opentelemetry/api";import{SpanStatusCode as JM,trace as KM}from"@opentelemetry/api";var VM="custom";function hI(t,e){let o=e.module?.[e.export]?.handlerType;t.setAttribute(Qt.HandlerType,o??VM),t.setAttribute(Qt.HandlerExport,e.export)}s(hI,"applyHandlerSpanTelemetry");function bn(t,e,n,o){e.log.error(n,o);let r={};if(T.instance.isLocalDevelopment||T.instance.isWorkingCopy)if(o instanceof Z&&o.extensionMembers)r=o.extensionMembers;else if(o.cause){let i=eo(o.cause);"stack"in i&&(i.stack=Kd(i.stack)),r={cause:i}}else{let i=eo(o);"stack"in i&&(i.stack=Kd(i.stack)),r={cause:i}}return $.internalServerError(t,e,{detail:o.message,...r})}s(bn,"errorHandler");import{SpanStatusCode as Rc,trace as Sc}from"@opentelemetry/api";var yI=s(t=>(e,n)=>t(e,n),"globalRequestHandlerProxy");function bI(t){yI=t}s(bI,"setTelemetryInitFunction");var wI=s(t=>yI(t),"proxyHandler");var ap={},An=[],rp=[],op=[],ip=[],sp=[];var vc={addPlugin(t){An.push(t)},addRequestHook(t){rp.push(t)},addResponseSendingHook(t){op.push(t)},addResponseSendingFinalHook(t){ip.push(t)},addPreRoutingHook(t){sp.push(t)}},RI=s(async(t,e)=>{if(rp.length===0)return t;let n=Sc.getTracer("extension");return n.startActiveSpan("hook:onRequest",async o=>{try{let r=t;for(let i of rp){let a=await n.startActiveSpan(i.name,async c=>{let u=await i(r,e);if(u instanceof we||u instanceof Response)return c.end(),u;{let d=new I(`Invalid state - the OnRequest hook must return a ZuploRequest or Response. Received ${typeof r}.`);throw c.end(),c.recordException(d),c.setStatus({code:Rc.ERROR}),d}});if(a instanceof we)r=a;else return a}return r}finally{o.end()}})},"invokeOnRequestExtensions"),SI=s(async(t,e,n)=>{if(op.length===0)return t;let o=Sc.getTracer("extension"),r=T.instance.build.COMPATIBILITY_FLAGS.chainResponseSendingHooks;return o.startActiveSpan("hook:onResponseSending",async i=>{try{let a=t;for(let c of op)await o.startActiveSpan(c.name,async u=>{let d=await c(r?a:t,e,n);if(d instanceof Response)a=d,u.end();else{let p=new I(`Invalid state - the OnResponseSending hook must return a Response. Received ${typeof a}.`);throw u.recordException(p),u.setStatus({code:Rc.ERROR}),u.end(),p}});return a}finally{i.end()}})},"invokeOnResponseSendingExtensions"),II=s(async(t,e,n)=>{if(ip.length===0)return;let o=Sc.getTracer("extension");return o.startActiveSpan("hook:onResponseSendingFinal",async r=>{try{for(let i of ip)await o.startActiveSpan(i.name,async a=>{try{await i(t,e,n)}catch(c){throw a.recordException(c),a.setStatus({code:Rc.ERROR}),a.end(),c}a.end()})}finally{r.end()}})},"invokeOnResponseSendingFinalExtensions"),xI=s(async t=>{if(sp.length===0)return t;let e=Sc.getTracer("extension");return e.startActiveSpan("hook:preRouting",async n=>{try{let o=t;for(let r of sp)o=await e.startActiveSpan(r.name,async a=>{try{let c=await r(o);if(c instanceof Request)return c;{let u=new Z(`Invalid state - the PreRouting hook must return a Request. Received ${typeof c}.`);throw a.recordException(u),a.setStatus({code:Rc.ERROR}),u}}finally{a.end()}});return o}finally{n.end()}})},"invokePreRoutingHooks"),vI=!1;async function CI(t){if(!vI){t&&(B("runtime.extensions"),await t(vc)),ap.value=vc;for(let e of An)if(e instanceof Qr){let{requestHandlerProxy:n}=e.instrument({accountName:T.instance.accountName,projectName:T.instance.projectName,buildId:T.instance.build.BUILD_ID,zuploVersion:T.instance.build.ZUPLO_VERSION,compatibilityDate:T.instance.build.COMPATIBILITY_DATE,instanceId:T.instance.instanceId,environmentType:T.instance.loggingEnvironmentType,environmentStage:T.instance.loggingEnvironmentStage,deploymentName:T.instance.deploymentName,__internalOnlyRemoteLogUrl:T.instance.remoteLogURL,__internalOnlyRemoteLogToken:T.instance.remoteLogToken});bI(n)}await Promise.all(An.map(async e=>{e instanceof mt&&await e.initialize(vc)})),ts.setProblemResponseFormat(vc.problemResponseFormat),vI=!0}}s(CI,"initializeRuntime");function qo(t){let{developerPortal:e}=je.instance.runtimeSettings;return e.enabled&&e.basePath&&t.pathname.startsWith(e.basePath)||t.pathname.startsWith("/__zuplo/")||t.pathname.startsWith("/__/zuplo/")}s(qo,"isSystemRoute");var St=class{static{s(this,"Pipeline")}constructor(e){this.execute=this.#t(e)}execute;#e=s(e=>async(n,o)=>KM.getTracer("pipeline").startActiveSpan(`handler:${o.route.handler.export}`,async i=>{hI(i,o.route.handler);try{return await e(n,o)}catch(a){let c=bn(n,o,"Error executing request handler.",a);return i.setStatus({code:JM.ERROR}),c}finally{i.end()}}),"#errorWrappedHandler");#t=s(({processors:e,handler:n})=>async(o,r)=>{let i=it.getContextExtensions(r),a=[...e],c=s(async f=>{let v=a.pop();if(!v){let w=await this.#e(async S=>{let x=await n(S,r);return WM(x)})(f,r);try{await i.onHandlerResponse(w,f,r)}catch(S){return bn(o,r,"Error invoking 'context.onHandlerResponse' hook",S)}return w}return v(f,r,c)},"nextPipe"),d=await c(o),p=new URL(o.url);if(qo(p)&&T.instance.build.COMPATIBILITY_FLAGS.doNotRunHooksOnSystemRoutes)return d;let m=new ss(o,d);r.dispatchEvent(m);let g=i.latestRequest,h;try{h=await m.mutableResponse}catch(f){return bn(o,r,"Error retrieving mutableResponse",f)}try{h=await i.onResponseSending(h,g,r)}catch(f){return bn(o,r,"Error invoking 'context.onResponseSending' hook",f)}try{h=await SI(h,g,r)}catch(f){return bn(o,r,"Error invoking 'context.onResponseSending' hook",f)}r.dispatchEvent(new as(o,h));try{await i.onResponseSendingFinal(d,g,r)}catch(f){throw r.log.error("Error invoking 'runtime.onResponseSending' hook",f),f}try{await II(d,g,r)}catch(f){throw r.log.error("Error invoking 'runtime.onResponseSending' hook",f),f}return h},"#toZuploPipeline")};function WM(t){return t instanceof Response?t:typeof t>"u"?new Response:new Response(Hd(t),{headers:{"content-type":"application/json"}})}s(WM,"resultToResponse");var wn=class extends Pr{static{s(this,"MetricsPlugin")}};var Ic=class{static{s(this,"ZuploMetricsTransport")}#e;#t;constructor(e){this.#e=e,this.#t=new be({name:"zuplo-metrics-transport",msDelay:10,dispatchFunction:this.dispatchFunction,systemLogger:H.getLogger(e)})}pushMetrics(e,n){this.#t.enqueue(e),n.waitUntil(this.#t.waitUntilFlushed())}dispatchFunction=s(async e=>{if(e.length!==0)try{let{remoteLogURL:n,deploymentName:o,accountName:r,projectName:i}=T.instance,a=e.map(m=>{let g=Object.assign({},m);return delete g.requestContentLength,delete g.responseContentLength,g}),c=WS(),u={metadata:{timestamp:new Date,accountName:r,projectName:i,deploymentName:o},metrics:a,features:c},d=new Headers({"content-type":"application/json"});Ve(d);let p=await ct({retries:3,retryDelayMs:1e3,logger:D.console},new URL("/v2/runtime/metrics",n).toString(),{method:"POST",body:JSON.stringify(u),headers:d});if(!p.ok){let m=await p.text();H.getLogger(this.#e).error(`Metrics POST responded ${p.status}: ${p.statusText}`,m),YS(c)}}catch(n){H.getLogger(this.#e).error("Failed to send Zuplo metrics.",n)}},"dispatchFunction")};var Zo="SYSTEM_IGNORED";var yt=class{static{s(this,"SystemRouteConfiguration")}constructor({label:e,path:n,methods:o,systemRouteName:r,corsPolicy:i="none"}){this.label=e,this.path=n,this.methods=o,this.corsPolicy=i,this.handler={export:Zo,module:Zo},this.systemRouteName=r}label;path;methods;handler;corsPolicy;policies;systemRouteName;metadata;raw(){return{}}};var cp="x-real-ip",YM="true-client-ip",QM="cf-connecting-ip",XM="x-forwarded-for";function Ft(t){let e=t.headers,n=e.get(cp)??e.get(YM)??e.get(QM);if(n)return n;let o=e.get(XM);if(o){let r=o.split(/,\s*/).map(i=>i.trim()).find(i=>i.length>0);if(r)return r}}s(Ft,"getClientIp");var Gt=s(async(t,e,n)=>{let o=new Date,r=Date.now(),i=await n(t),a=t.headers.get(Mo)??void 0,c=Ft(t),u=e.incomingRequestProperties,d;e.route instanceof yt&&(d=e.route.systemRouteName);let p=it.getContextExtensions(e).latestRequest,m={timestamp:o,statusCode:i.status,durationMs:Date.now()-r,requestContentLength:t.headers.get("content-length")?Number(t.headers.get("content-length")):void 0,responseContentLength:i.headers.get("content-length")?Number(i.headers.get("content-length")):void 0,routePath:e.route?.path??"SYSTEM_OR_NOT_FOUND",systemRouteName:d,contextId:e.contextId,parentContextId:e.parentContext?.contextId,requestId:e.requestId,parentRequestId:e.parentContext?.requestId,method:t.method,asn:u.asn,asOrganization:u.asOrganization,colo:u.colo,continent:u.continent,country:u.country,city:u.city,latitude:u.latitude,longitude:u.longitude,rayId:a,instanceId:T.instance.instanceId,userSub:p.user?.sub,clientIp:c},g=[];return!T.instance.isLocalDevelopment&&T.instance.remoteLogURL&&T.instance.remoteLogToken&&T.instance.loggingId&&g.push(new Ic(e)),An.forEach(h=>{if(h instanceof wn){let f=h.getTransport();g.push(f)}}),g.forEach(h=>{h.pushMetrics(m,e)}),i},"metricsProcessor");var up=s(t=>{let e=s(async(r,i)=>{let a=new URL(r.url),c=T.instance.build,u={buildId:c.BUILD_ID,zuploVersion:c.ZUPLO_VERSION,compatibilityDate:c.COMPATIBILITY_DATE,apiVersion:c.API_VERSION,gitSha:c.GIT_SHA,timestamp:c.TIMESTAMP,isProduction:c.ENVIRONMENT_TYPE==="PRODUCTION"};if(a.searchParams.get("system_log")==="true"&&H.getLogger(i).error("Test System Log",u),a.searchParams.get("error")==="true")throw new Error("this is an unhandled error");return new Response(JSON.stringify(u,null,2),{status:200,headers:{"content-type":"application/json"}})},"buildRouteHandler"),n=new St({processors:[Gt],handler:e}),o=new yt({label:"SYSTEM_BUILD_ROUTE",methods:["GET"],path:"/__zuplo/build",systemRouteName:"build-data"});t.addRoute(o,n.execute)},"registerBuildRoute");var xc=class{static{s(this,"BoundedSet")}limit;items;constructor(e){this.limit=e,this.items=new Map}add(e){if(this.items.has(e))this.items.delete(e);else if(this.items.size>=this.limit){let n=this.items.keys().next().value;n&&this.items.delete(n)}this.items.set(e,!0)}has(e){return this.items.has(e)}values(){return Array.from(this.items.keys())}size(){return this.items.size}};var TI=new Map;function qn(t){if(Array.isArray(t)&&!t.some(r=>typeof r!="number"))return t;if(typeof t!="string")throw new Error("Input must be a string or an array of numbers");if(!/^\d+(?:-\d+)?(?:,\s*\d+(?:-\d+)?)*$/.test(t))throw new I("Malformed input string");let e=TI.get(t);if(e)return e;let n=t.split(","),o=[];for(let r of n){let i=r.split("-");if(i.length===2){let a=parseInt(i[0],10),c=parseInt(i[1],10);for(let u=a;u<=c;u++)o.push(u)}else o.push(parseInt(r,10))}return TI.set(t,o),o}s(qn,"statusCodesStringToNumberArray");function or(t,e,n){if(!e.startsWith("."))throw new I(`Invalid ${n} - must start with '.' - '${e}' does not`);let o=e.split(".").splice(1),r=t;return o.forEach(i=>{if(r===void 0)throw new Z(`Error applying ${n} '${e}', reading '${i}'`);r=r[i]}),`${r}`}s(or,"getValueFromRequestUser");var PI=new Map;function cs(t){let e=PI.get(t);if(e)return e;let n=[],o=0;for(;o<t.length;){if(t[o]==="."){o++;continue}if(t[o]==="["){for(o++;o<t.length&&/\s/.test(t[o]);)o++;let r=t[o];if(r!=='"'&&r!=="'")throw new I(`Invalid selector '${t}' - bracket segments must be quoted, e.g. ["my.key"]`);o++;let i=o;for(;o<t.length&&t[o]!==r;)o++;if(o>=t.length)throw new I(`Invalid selector '${t}' - unterminated quoted segment`);for(n.push(t.substring(i,o)),o++;o<t.length&&/\s/.test(t[o]);)o++;t[o]==="]"&&o++}else{let r=o;for(;o<t.length&&t[o]!=="."&&t[o]!=="[";)o++;let i=t.substring(r,o).trim();i.length>0&&n.push(i)}}return PI.set(t,n),n}s(cs,"parseJsonPath");function Cc(t,e){let n=t;for(let o of cs(e)){if(n===null||typeof n!="object")return;n=Reflect.get(n,o)}return n}s(Cc,"getValueAtPath");function AI(t,e){if(!e.startsWith(".")&&!e.startsWith("["))throw new I(`Invalid selector. must start with '.' - '${e}' does not`);let n=cs(e),o=t;return n.forEach(r=>{if(o===void 0)throw new Z(`Error applying'${e}', reading '${r}'`);if(o&&typeof o=="object")o=Reflect.get(o,r);else throw new Z(`Error applying'${e}', reading '${r}'`)}),`${o}`}s(AI,"selectPropertyUsingJsonPath");function to(t){if(Array.isArray(t)){if(t.includes(n=>typeof n!="string"))throw new I("Received an array that contains non-string values.");return t}if(zn(t))return t.includes(",")?t.split(",").map(n=>n.trim()).filter(n=>n!==","&&n!==""):[t];throw new I(`Expected type of string, received type '${typeof t}'`)}s(to,"parseValueToStringArray");function kI(t){if(t==null)return[];if(!Array.isArray(t))throw new I(`Invalid corsPolicy configuration. Expected an array of objects, received '${typeof t}'`);return t.map(n=>{if(!Xr(n))throw new I(`Invalid custom cors policy is set. Expected an object, received '${typeof n}'`);if(!XS(n.name))throw new I("Value of 'name' on custom cors policies must be a non-empty string.");if(n.maxAge!==void 0&&!Gd(n.maxAge))throw new I(`Value of 'maxAge' on custom cors policies must be a non-empty string. Received type '${typeof n.maxAge}'`);if(n.allowCredentials!==void 0&&!Bd(n.allowCredentials))throw new I("Value of 'allowCredentials' on custom cors policies must be a boolean or not be set. If using an environment variable, check that it is set correctly.");let o=lp(n,"allowedHeaders"),r=lp(n,"allowedMethods"),i=lp(n,"exposeHeaders"),a;try{a=to(n.allowedOrigins)}catch(u){throw new I(`Value of 'allowedOrigins' on custom cors policies is invalid. ${u.message} If using an environment variable, check that it is set correctly.`)}return{name:n.name,allowCredentials:typeof n.allowCredentials=="boolean"?String(n.allowCredentials):void 0,allowedOrigins:a,allowedHeaders:o?o.join(", "):void 0,allowedMethods:r?r.join(", "):void 0,exposeHeaders:i?i.join(", "):void 0,maxAge:typeof n.maxAge=="number"?n.maxAge.toString():void 0}})}s(kI,"parseCorsPolicies");function lp(t,e){let n;if(t[e]!==void 0)try{n=to(t[e])}catch(o){throw new I(`Value of '${e}' on custom cors policies is invalid. ${o.message} If using an environment variable, check that it is set correctly.`)}return n}s(lp,"parseOptionalProperty");var dp=new Map,eL=s((t,e,n)=>{for(let o of t){let r=o.trim().toLowerCase();if(r==="*")return e;if(r.includes("*.")){let a=r.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*\\\./g,"[^.]+\\.");if(new RegExp(`^${a}$`).test(n))return e}else{let i=r.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*");if(new RegExp(`^${i}$`).test(n))return e}}},"testMatchinOrigin"),Tc=s((t,e,n)=>{if(n===null)return;let o=n.trim().toLowerCase(),r=dp.get(t);if(r?.has(o))return n;let i=eL(e,n,o);return i&&(r||dp.set(t,new xc(20)),dp.get(t)?.add(o)),i},"findMatchingOrigin"),Pc=s((t,e)=>{let n={"access-control-allow-origin":e};t.allowedHeaders&&(n["access-control-allow-headers"]=t.allowedHeaders),t.allowedMethods&&(n["access-control-allow-methods"]=t.allowedMethods),t.exposeHeaders&&(n["access-control-expose-headers"]=t.exposeHeaders);let o=t.allowCredentials;o&&(n["access-control-allow-credentials"]=o);let r=t.maxAge?.toString()??void 0;return r&&(n["access-control-max-age"]=r),n},"generateCorsHeaders"),Ac=s((t,e)=>{if(!t)return!1;let{developerPortal:n}=e;return n.enabled&&n.type==="zudoku"&&n.urls?n.urls.urls.includes(t):!1},"isDevPortalOrigin");var tL=new Map([["McpProxyHandler","$import(@zuplo/runtime/mcp-gateway)"],["mcpServerHandler","$import(@zuplo/runtime)"]]),EI={allow:"POST"};function nL(t){let e=t.handler?.export;if(e===void 0)return!1;let n=tL.get(e);return n===void 0?!1:t.raw()?.["x-zuplo-route"]?.handler?.module===n}s(nL,"isBuiltInMcpHandler");var kc=s((t,e)=>t.lookupByPathOnly(e).find(n=>{let{routeConfiguration:o}=n;return nL(o)&&o.methods.some(r=>r.toUpperCase()==="POST")})?.routeConfiguration,"findMcpPostRouteByPath");var pp=s((t,e,n)=>{let o=s(async(a,c)=>{let u=new URL(a.url.toString()).pathname,d=a.headers.get("access-control-request-method"),p=a.headers.get("access-control-request-headers"),m=a.headers.get("origin");if(m===null||d===null)return $.badRequest(a,c,{detail:"Expect headers origin and access-control-request-method"});if(Ac(m,e)){let w={"access-control-allow-origin":m,"access-control-allow-methods":d,"access-control-allow-headers":p??"*","access-control-expose-headers":"*","access-control-allow-credentials":"true","access-control-max-age":"600"};return new Response(void 0,{status:200,statusText:"OK",headers:w})}let h=t.lookup(u,d)?.routeConfiguration,v=(h instanceof yt&&h.systemRouteName==="unmatched-path"?void 0:h)??(d==="GET"?kc(t,u):void 0);if(!v)return $.notFound(a,c);let b=rL({requestedMethod:d,requestedHeaders:p,requestedOrigin:m,routeConfig:v,customPolicies:n});return b.isValid?new Response(void 0,{status:200,statusText:"OK",headers:b.headers}):(b.error&&c.log.warn(b.error),$.notFound(a,c))},"optionsHandler"),r=new St({processors:[Gt],handler:o}),i=new yt({label:"SYSTEM_CORS_ROUTE",methods:["OPTIONS"],path:"/(.*)",systemRouteName:"cors-preflight"});t.addRoute(i,r.execute)},"registerCorsRoute"),rL=s(({requestedMethod:t,requestedHeaders:e,requestedOrigin:n,routeConfig:o,customPolicies:r})=>{let i={isValid:!1,headers:{}};if(o.corsPolicy==="anything-goes")return{isValid:!0,headers:{"access-control-allow-origin":n,"access-control-allow-methods":t,"access-control-allow-headers":e??"*","access-control-expose-headers":"*","access-control-allow-credentials":"true","access-control-max-age":"600"}};if(o.corsPolicy==="none")return{...i,error:`No CORS policy set for the route '${o.pathPattern}'`};let a=r?.find(d=>d.name===o.corsPolicy);if(!a)throw new I(`Invalid Configuration - corsPolicy '${o.corsPolicy}' not found in *.oas.json 'corsPolicies' section.`);let c=Tc(a.name,a.allowedOrigins,n);return c?{isValid:!0,headers:Pc(a,c)}:{...i,error:`The CORS policy '${a.name}' does not allow the origin '${n}'`}},"validateAndBuildResponseHeaders");var _I=s(t=>{let e=s(async()=>new Response("You have no routes. Add a route in routes.oas.json to get started",{status:200}),"noRoutesHandler"),n=new St({processors:[Gt],handler:e}),o=new yt({label:"SYSTEM_NO_ROUTES",methods:["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"],path:"/(.*)",systemRouteName:"empty-gateway-catchall"});t.addRoute(o,n.execute)},"registerNoRoutes");var Ar=class{static{s(this,"UserRouteConfiguration")}constructor(e){this.path=e.path,this.methods=e.methods,this.label=e.label,this.key=e.key,this.handler=e.handler,this.corsPolicy=e.corsPolicy,this.custom=e.custom,this.mcp=e.mcp,this.policies=e.policies,this.excludeFromOpenApi=e.excludeFromOpenApi,this.pathPattern=e.pathPattern,this.metadata=e.metadata,this.raw=e.raw}raw;get summary(){return this.raw()?.summary}get operationId(){return this.raw()?.operationId}get tags(){return this.raw()?.tags}get parameters(){return this.raw()?.parameters}get responses(){return this.raw()?.responses}label;key;path;excludeFromOpenApi;pathPattern;metadata;custom;mcp;methods;handler;corsPolicy;policies};var oL=new yt({label:"SYSTEM_NOT_FOUND_ROUTE",methods:["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"],path:"/(.*)",systemRouteName:"unmatched-path"}),OI=s(t=>{let e=s(async(o,r)=>{let i=ap.value?.notFoundHandler;if(i){let u=new URL(o.url);return i(o,r,{get routesMatchedByPathOnly(){return t.lookupByPathOnly(u.pathname).map(p=>p.routeConfiguration).filter(p=>p instanceof Ar)}})}let a=new URL(o.url);return kc(t,a.pathname)&&o.method!=="POST"?$.methodNotAllowed(o,r,void 0,EI):$.notFound(o,r)},"notFoundHandler"),n=new St({processors:[Gt],handler:e});t.addRoute(oL,n.execute)},"registerNotMatchedHandler");var iL=["access-control-allow-origin","access-control-allow-headers","access-control-expose-headers","access-control-allow-credentials","access-control-max-age"],$I=s(t=>{iL.forEach(e=>t.delete(e))},"stripCorsHeaders"),Fo=s(async(t,e,n)=>{let o=await n(t);if(T.instance.isDeno&&o.status===101&&[...o.headers.keys()].length===0&&!o.body)return o;let r=e.route,i=t.headers.get("origin"),a=Ac(i,je.instance.runtimeSettings);if((!r.corsPolicy||r.corsPolicy==="none")&&!a){let m=new Headers(o.headers);return $I(m),new Response(o.body,{status:o.status,statusText:o.statusText,headers:m,webSocket:o.webSocket})}if(!(o instanceof Response))throw new Pe(`The CorsProcessor is in the wrong place in the pipeline. It should only receive HttpResponse type but got '${typeof o}'`);let c=sL(r,je.instance.routeData.corsPolicies,a),u=aL(i,c),d=new Headers(o.headers);return $I(d),Object.entries(u).forEach(([m,g])=>{d.set(m,g)}),new Response(o.body,{status:o.status,statusText:o.statusText,headers:d,webSocket:o.webSocket})},"corsProcessor"),sL=s((t,e,n)=>{if(t.corsPolicy==="anything-goes")return{name:"anything-goes",allowedHeaders:"*",allowedOrigins:["*"],allowedMethods:t.methods.join(", "),exposeHeaders:"*",allowCredentials:"true",maxAge:"600"};if(n)return{name:"dev-portal-anything-goes",allowedHeaders:"*",allowedOrigins:["*"],allowedMethods:t.methods.join(", "),exposeHeaders:"*",allowCredentials:"true",maxAge:"600"};let o=e?.find(r=>r.name===t.corsPolicy);if(o===void 0)throw new I(`Invalid Configuration - no corsPolicy '${t.corsPolicy}' found in *.oas.json`);return o},"getCorsPolicy"),aL=s((t,e)=>{let n=Tc(e.name,e.allowedOrigins,t);return n?Pc(e,n):{}},"getCorsHeaders");var mp=s(t=>{let e=s(async()=>new Response(JSON.stringify({buildId:T.instance.build.BUILD_ID}),{status:200,headers:{"content-type":"application/json"}}),"pingRouteHandler"),n=new St({processors:[Fo],handler:e}),o=new yt({corsPolicy:"anything-goes",label:"SYSTEM_PING_ROUTE",methods:["GET"],path:"/__zuplo/ping",systemRouteName:"ping"});t.addRoute(o,n.execute)},"registerPingRoute");import{SpanStatusCode as LI,trace as NI}from"@opentelemetry/api";var cL="custom";function Go(t,e){t.setAttribute(Qt.PolicyName,e.policyName),t.setAttribute(Qt.PolicyDirection,e.direction),t.setAttribute(Qt.PolicyType,e.policyType??cL),e.policyType!==void 0&&B(`policy.${e.direction}.${e.policyType}`)}s(Go,"applyPolicySpanTelemetry");var Ec=class extends ce{static{s(this,"InboundFunctionOnlyPolicy")}#e;constructor(e,n,o){super(n,o),this.policyType=e.policyType,this.#e=e}handler(e,n){return this.#e(e,n,this.options,this.policyName)}},hp=class extends rr{static{s(this,"OutboundFunctionOnlyPolicy")}#e;constructor(e,n,o){super(n,o),this.policyType=e.policyType,this.#e=e}handler(e,n,o){return this.#e(e,n,o,this.options,this.policyName)}},fp=new Map;function MI(t){return t===null?"null":Array.isArray(t)?"array":typeof t}s(MI,"describeValueType");function _c(t,e,...n){if(n.length===1){let[r]=n,i=e?.find(m=>m.name===t);if(!i)throw new I(`Invalid state - no Policy with the name '${t}' was found in the policies configuration (check case).`);if(typeof i.handler?.module!="object"||i.handler.module===null||Array.isArray(i.handler.module))throw new I(`Invalid state - invalid policy '${t}' (handler.module is '${MI(i.handler?.module)}')`);let a=i.handler.module[i.handler.export];if(typeof a!="function")throw new I(`Invalid state - invalid policy '${t}' (handler.module export '${i.handler.export}' is '${MI(a)}')`);let c=a.prototype instanceof ce,u=a.prototype instanceof rr||Function.prototype.toString.call(a).startsWith("class ");if(a.policyDirection==="outbound"||!c&&u)throw new I(`Invalid state - invalid policy '${t}' (handler.module export '${i.handler.export}' must be an inbound policy function or a class extending InboundPolicy)`);let p=c?new a(r,i.name):new Ec(a,r,i.name);if(typeof p.handler!="function")throw new I(`Invalid state - invalid handler on policy '${t}' (typeof handler '${typeof p.handler}')`);return p}let[o]=Bo([t],e);if(!o)throw new Z("Internal error. Policy not found in cache.");return o}s(_c,"getInboundPolicyInstance");function Bo(t,e){let n,o;return Array.isArray(t)?n=t:(n=t.policies?.inbound??[],o=t.path),n.filter(i=>!fp.has(i)).forEach(i=>{let a=e?.find(d=>d.name===i);if(!a)throw new I(`Invalid state - no Policy with the name '${i}' ${o&&`on route '${o}'`} was found in the policies configuration (check case).`);if(typeof a.handler?.module!="object")throw new I(`Invalid state - invalid policy '${i}' on route '${o}' (typeof policy '${typeof a.handler?.module}')`);let c=a.handler?.module[a.handler.export];if(typeof c!="function")throw new I(`Invalid state - invalid policy '${i}' on route '${o}' (typeof module '${typeof c}')`);let u;if(typeof c!="function")throw new I(`Invalid state - invalid policy '${i}' on route '${o}' (typeof module '${typeof c}')`);if(c.prototype instanceof ce)u=new c(a.handler.options,a.name);else if(typeof c=="function")u=new Ec(c,a.handler.options,a.name);else throw new I(`Invalid state - invalid policy '${i}' on route '${o}' (typeof policy '${typeof c}')`);if(typeof u.handler!="function")throw new I(`Invalid state - invalid handler on policy '${i}' on route '${o}' (typeof handler '${typeof u.handler}')`);fp.set(a.name,u)}),n.map(i=>{let a=fp.get(i);if(a===void 0)throw new Z("Internal error. Policy not found in cache.");return a})}s(Bo,"getInboundPolicyInstances");var gp=new Map;function us(t,e){let n,o;return Array.isArray(t)?n=t:(n=t.policies?.outbound??[],o=t.path),n.filter(i=>!gp.has(i)).forEach(i=>{let a=e?.find(d=>d.name===i);if(!a)throw new I(`Invalid state - no Policy with the name '${i}' on route '${o}' was found in the policies configuration (check case).`);if(typeof a.handler?.module!="object")throw new I(`Invalid state - invalid policy '${i}' on route '${o}' (typeof policy '${typeof a.handler?.module}')`);let c=a.handler?.module[a.handler.export],u;if(typeof c!="function")throw new I(`Invalid state - invalid policy '${i}' on route '${o}' (typeof module '${typeof c}')`);if(c.prototype instanceof rr)u=new c(a.handler.options??{},a.name);else if(typeof c=="function")u=new hp(c,a.handler.options??{},a.name);else throw new I(`Invalid state - invalid policy '${i}' on route '${o}' (typeof policy '${typeof c}')`);if(typeof u.handler!="function")throw new I(`Invalid state - invalid handler on policy '${i}' on route '${o}'`);gp.set(a.name,u)}),n.map(i=>{let a=gp.get(i);if(a===void 0)throw new Z("Internal error. Policy not found in cache.");return a})}s(us,"getOutboundPolicyInstances");var ls=s(t=>async(e,n)=>{let o=it.getContextExtensions(n),r=NI.getTracer("pipeline");return await r.startActiveSpan("policies:inbound",async i=>{try{let a=[...t],c=e;for(;a.length>0;){let u=a.shift();if(!u)return c;let d=await r.startActiveSpan(`policy:${u.policyName}`,async p=>{Go(p,u);let m=await u.handler(c,n);if(m instanceof Request||m instanceof we||m instanceof Response){if(p.end(),m instanceof Response||m instanceof we)return m;{let g=c.user;return new we(m,{user:g})}}else{let g=new I(`Invalid state - invalid handler on policy '${u.policyName}' on route '${n.route.path}. The result of an inbound policy must be a Response or Request.`);throw p.end(),p.setStatus({code:LI.ERROR}),p.recordException(g),g}});if(d instanceof we)c=d;else if(d instanceof Request){let p=c.user;c=new we(d,{user:p})}else if(d instanceof Response)return d;o.latestRequest=c}return c}finally{i.end()}})},"toStackedInboundHandler"),yp=s(t=>async(e,n,o)=>{let r=NI.getTracer("pipeline");return await r.startActiveSpan("policies:outbound",async i=>{try{let a=[...t],c=e;for(;a.length>0;){let u=a.shift();if(!u)return c;c=await r.startActiveSpan(`policy:${u.policyName}`,async p=>{try{Go(p,u);let m=await u.handler(c,n,o);if(m instanceof Response)return m;{let g=new I(`Invalid state - invalid handler on policy '${u.policyName}' on route '${o.route.path}. The result of an outbound policy must be a Response.`);throw p.setStatus({code:LI.ERROR}),p.recordException(g),g}}finally{p.end()}})}return c}finally{i.end()}})},"toStackedOutboundHandler"),Oc=s(async(t,e,n)=>{let o=Bo(e.route,je.instance.routeData.policies),r=us(e.route,je.instance.routeData.policies);return uL({request:t,context:e,inboundPolicies:o,outboundPolicies:r,next:n})},"policyProcessor");async function uL({request:t,context:e,inboundPolicies:n,outboundPolicies:o,next:r}){let i=ls(n);try{let a=await i(t,e);if(a instanceof Response)return a;let c=await r(a),u=yp(o),d;return T.instance.build.COMPATIBILITY_FLAGS.runOutboundPoliciesOnHandlerOnAllStatuses?d=u(c,t,e):d=c.ok?u(c,t,e):c,d}catch(a){return bn(t,e,"Error executing policies",a)}}s(uL,"executePolicyProcessor");var jI=uM(zI(),1);function qI(t,e){try{let n=/v\d+(-\d+)?/g,r=(0,jI.parse)(e.get("Cookie")||"")["zp-dev-portal"];return r!==null&&r&&n.test(r)?`https://dev-portal-${r}.zuplo.com`:t}catch{}return t}s(qI,"devPortalBaseURL");var ZI="/__zuplo/dev-portal",vL="dev-portal-id",RL="dev-portal-host",SL="zp-account",IL="zp-project",xL="dev-portal-build",CL=`
65
+ `)}s(uI,"messagesToMultilineText");function lI(t){return typeof t=="string"?t:JSON.stringify(t)}s(lI,"stringifyNonString");function gc(t){return typeof t=="string"?t:t===null?"null":typeof t>"u"?"undefined":typeof t=="number"||typeof t=="boolean"||typeof t=="bigint"||typeof t=="symbol"?t.toString():typeof t=="function"?`[function ${t.name}]`:typeof t=="object"&&Array.isArray(t)?`[array ${t.length}]`:t instanceof Error?`${t.name??"Error"}: ${t.message??"unknown"}`:typeof t=="object"?Fd(t):"unknown"}s(gc,"stringifyNonStringToText");var ZM={internal:1,trace:2,debug:5,info:9,warn:13,error:17,fatal:21},hc=s(t=>e=>{let n={};return n.accountName=t.accountName,n.projectName=t.projectName,n.deploymentName=t.deploymentName,n.environmentType=t.loggingEnvironmentStage,n.labels={requestId:e.requestId,source:e.logSource,logOwner:e.logOwner},n.rayId=e.rayId??"",n.runtime={buildId:t.build.BUILD_ID,buildTimestamp:t.build.TIMESTAMP,gitSHA:t.build.GIT_SHA,version:t.build.ZUPLO_VERSION},n.atomicCounter=e.vectorClock,{logId:e.logId,timestamp:e.timestamp,observerdTimestamp:e.timestamp,traceId:e.requestId,severityText:e.level,severityNumber:ZM[e.level],body:jn(e.messages),attributes:n}},"unifiedFormatter");async function Ce(t,e){if(t.level==="error"&&D.console.error(t.messages),!T.instance.remoteLogURL||!T.instance.loggingId||!T.instance.remoteLogToken)return;let n;try{n=await e?.text()}catch{}try{let o={...t,messages:[...t.messages,...n?[n]:[]],logId:crypto.randomUUID(),logOwner:"user",logSource:"runtime",rayId:null,requestId:`global-${crypto.randomUUID()}`,timestamp:new Date,buildId:T.instance.build.BUILD_ID,loggingId:T.instance.loggingId,vectorClock:0};await dI(T.instance,[o])}catch(o){D.console.error(o)}}s(Ce,"sendRemoteGlobalLog");async function dI(t,e){let n=hc(t);try{let o=new Headers({"content-type":"application/json",authentication:`Bearer ${t.remoteLogToken}`});Ve(o),await D.fetch(new URL("/v1/runtime-logs",t.remoteLogURL).toString(),{method:"POST",body:JSON.stringify({entries:e.map(n)}),headers:{"content-type":"application/json","user-agent":T.instance.systemUserAgent,"zp-dn":T.instance.deploymentName??"unknown"}})}catch(o){D.console.error(o)}}s(dI,"sendLogs");var HM=s(t=>async e=>{e.length!==0&&await dI(t,e)},"dispatchFunction"),yc,rs=class{static{s(this,"UnifiedLogTransport")}constructor(e){yc||(yc=new be({name:"unified-log-transport",msDelay:1,dispatchFunction:HM(e)}))}log(e,n){yc.enqueue(e),n.waitUntil(yc.waitUntilFlushed())}};var Wd=class extends lt{constructor(n){super();this.options=n}options;static{s(this,"GoogleCloudLoggingPlugin")}getTransport(){return new os(this.options)}},FM="https://logging.googleapis.com/v2/entries:write?alt=json",Yd={error:"ERROR",warn:"WARNING",info:"INFO",debug:"DEBUG"},os=class{static{s(this,"GoogleLogTransport")}constructor(e){B("logging.google-cloud"),this.#r=e.logName,this.#e=e.serviceAccountJson,this.#o=T.instance.loggingEnvironmentType,this.#i=T.instance.loggingEnvironmentStage,this.#n=T.instance.deploymentName,this.#s=e.fields??{}}#e;#t;#r;#n;#o;#i;#s;async init(){this.#t=await qt.init(this.#e)}log(e,n){if(!this.#t)throw new Pe("Invalid state - Google log transport is not initialized");if(e.messages.length===0)return;let o=Object.assign({allMessages:jn(e.messages)},this.#s,n.properties??{}),r=this.#t.projectId??"zuplo-production",i={logName:this.#r,resource:{type:"global"},severity:Yd[e.level],timestamp:e.timestamp,trace:`projects/${r}/traces/${e.requestId}`,labels:{requestId:e.requestId,buildId:e.buildId,source:e.logSource,loggingId:e.loggingId,logOwner:e.logOwner,environment:this.#n,environmentType:this.#o,environmentStage:this.#i}};e.rayId&&(i.labels.rayId=e.rayId);let a=zo(o.allMessages);i.jsonPayload={...o,message:a},this.batcher.enqueue(i),n.waitUntil(this.batcher.waitUntilFlushed())}dispatchFunction=s(async e=>{if(e.length===0)return;this.#t||(this.#t=await qt.init(this.#e));let n=await yn({serviceAccount:this.#t,audience:"https://logging.googleapis.com/google.logging.v2.LoggingServiceV2"});try{let o=await D.fetch(FM,{method:"POST",body:JSON.stringify({entries:e}),headers:{Authorization:`Bearer ${n}`,"content-type":"application/json;charset=UTF-8"}});o.ok||await Ce({level:"error",messages:[`Failed to send logs to Google: ${o.status} - ${o.statusText}`]},o)}catch{await Ce({level:"error",messages:["Failed to connect to Google logging service. Check that the URL is correct."]})}},"dispatchFunction");batcher=new be({name:"google-log-transport",msDelay:1,dispatchFunction:this.dispatchFunction})};var tp=class extends lt{constructor(n){super();this.options=n}options;static{s(this,"DataDogLoggingPlugin")}getTransport(){return new is(this.options)}},Qd="__ddtags",Xd="__ddattr",ep=s(t=>t.replaceAll(",","_").replaceAll(":","_"),"cleanTagText"),GM=s(t=>{let e=Object.keys(t),n=[];return e.forEach(o=>{let r=t[o];r==null?n.push(ep(o)):n.push(`${ep(o)}:${ep(r.toString())}`)}),n.join(",")},"formatTags"),is=class{static{s(this,"DataDogTransport")}constructor(e){B("logging.datadog"),this.#e=e.apiKey,this.#t=e.url??"https://http-intake.logs.datadoghq.com/api/v2/logs",this.#n=T.instance.loggingEnvironmentType,this.#o=T.instance.loggingEnvironmentStage,this.#r=T.instance.deploymentName,this.#i=e.fields??{},this.#s=e.tags??{},this.#a=e.source??"Zuplo"}#e;#t;#r;#n;#o;#i;#s;#a;log(e,n){let o=Object.assign({},this.#s),r=Object.assign({},this.#i,n.properties??{}),i=[...e.messages];if(!T.instance.build.COMPATIBILITY_FLAGS.removeLegacyLogInitialization){let d=n.custom[Qd];d&&typeof d=="object"&&(B("logging.datadog.legacy-tags"),Object.assign(o,d));let p=e.messages.findIndex(h=>h[Qd]!==void 0);p>-1&&(Object.assign(o,i[p][Qd]),i.splice(p,1));let m=n.custom[Xd];m&&typeof m=="object"&&(B("logging.datadog.legacy-attributes"),Object.assign(r,m));let g=e.messages.findIndex(h=>h[Xd]!==void 0);g>-1&&(Object.assign(r,i[g][Xd]),i.splice(g,1))}let a=jn(i),c={...e,activityId:e.requestId,trace:e.requestId},u=Object.assign({message:{...c,messages:a},ddsource:this.#a,hostname:new URL(n.originalRequest.url).hostname,msg:zo(a),atomic_counter:e.vectorClock,service:e.loggingId,ddtags:GM(o),environment:this.#r,environment_type:this.#n,environment_stage:this.#o,ray_id:e.rayId,request_id:e.requestId},r);this.batcher.enqueue(u),n.waitUntil(this.batcher.waitUntilFlushed())}dispatchFunction=s(async e=>{if(e.length!==0)try{let n=await D.fetch(this.#t,{method:"POST",body:JSON.stringify([...e]),headers:{"content-type":"application/json","DD-API-KEY":this.#e}});n.ok||await Ce({level:"error",messages:[`Failed to send logs to DataDog: ${n.status} - ${n.statusText}`]},n)}catch{await Ce({level:"error",messages:["Failed to connect to DataDog logging service. Check that the URL is correct."]})}},"dispatchFunction");batcher=new be({name:"data-dog-transport",msDelay:10,dispatchFunction:this.dispatchFunction})};var bc=class{static{s(this,"ErrorClassifier")}#e=new Set;#t=0;record(e){this.#e.add(e),this.#t+=1}get count(){return this.#t}classes(){return[...this.#e]}hasErrors(){return this.#t>0}};function pI(t){return t===401||t===403?"auth":t===408||t===504?"timeout":t>=500?"resolver":null}s(pI,"classifyHttpStatus");function mI(){return{startTimeMs:performance.now(),documentHash:null,documentSnippet:null,operationType:"",operationName:"",maxDepth:0,complexity:null,persistedQueryHash:null,errors:new bc,cacheState:null}}s(mI,"createOperationContext");var np=new ne(Symbol("graphql-operation-context"));function fI(t,e){np.set(t,e)}s(fI,"attachOperationContext");function gI(t){return np.get(t)}s(gI,"getOperationContext");function BM(t,e){let n=np.get(t);n&&(n.cacheState=e)}s(BM,"recordGraphqlCacheState");var jo=class{static{s(this,"LookupResult")}constructor(e,n,o){this.routeConfiguration=e,this.params=o??{},this.executableHandler=n}executableHandler;routeConfiguration;params},wc=class extends Error{static{s(this,"RouterError")}};import{trace as $N}from"@opentelemetry/api";import{SpanStatusCode as JM,trace as KM}from"@opentelemetry/api";var VM="custom";function hI(t,e){let o=e.module?.[e.export]?.handlerType;t.setAttribute(Qt.HandlerType,o??VM),t.setAttribute(Qt.HandlerExport,e.export)}s(hI,"applyHandlerSpanTelemetry");function bn(t,e,n,o){e.log.error(n,o);let r={};if(T.instance.isLocalDevelopment||T.instance.isWorkingCopy)if(o instanceof Z&&o.extensionMembers)r=o.extensionMembers;else if(o.cause){let i=eo(o.cause);"stack"in i&&(i.stack=Kd(i.stack)),r={cause:i}}else{let i=eo(o);"stack"in i&&(i.stack=Kd(i.stack)),r={cause:i}}return $.internalServerError(t,e,{detail:o.message,...r})}s(bn,"errorHandler");import{SpanStatusCode as Rc,trace as Sc}from"@opentelemetry/api";var yI=s(t=>(e,n)=>t(e,n),"globalRequestHandlerProxy");function bI(t){yI=t}s(bI,"setTelemetryInitFunction");var wI=s(t=>yI(t),"proxyHandler");var ap={},An=[],rp=[],op=[],ip=[],sp=[];var vc={addPlugin(t){An.push(t)},addRequestHook(t){rp.push(t)},addResponseSendingHook(t){op.push(t)},addResponseSendingFinalHook(t){ip.push(t)},addPreRoutingHook(t){sp.push(t)}},RI=s(async(t,e)=>{if(rp.length===0)return t;let n=Sc.getTracer("extension");return n.startActiveSpan("hook:onRequest",async o=>{try{let r=t;for(let i of rp){let a=await n.startActiveSpan(i.name,async c=>{try{let u=await i(r,e);if(u instanceof we||u instanceof Response)return u;throw new I(`Invalid state - the OnRequest hook must return a ZuploRequest or Response. Received ${typeof u}.`)}catch(u){throw c.recordException(u),c.setStatus({code:Rc.ERROR}),u}finally{c.end()}});if(a instanceof we)r=a;else return a}return r}finally{o.end()}})},"invokeOnRequestExtensions"),SI=s(async(t,e,n)=>{if(op.length===0)return t;let o=Sc.getTracer("extension"),r=T.instance.build.COMPATIBILITY_FLAGS.chainResponseSendingHooks;return o.startActiveSpan("hook:onResponseSending",async i=>{try{let a=t;for(let c of op)await o.startActiveSpan(c.name,async u=>{try{let d=await c(r?a:t,e,n);if(d instanceof Response)a=d;else throw new I(`Invalid state - the OnResponseSending hook must return a Response. Received ${typeof d}.`)}catch(d){throw u.recordException(d),u.setStatus({code:Rc.ERROR}),d}finally{u.end()}});return a}finally{i.end()}})},"invokeOnResponseSendingExtensions"),II=s(async(t,e,n)=>{if(ip.length===0)return;let o=Sc.getTracer("extension");return o.startActiveSpan("hook:onResponseSendingFinal",async r=>{try{for(let i of ip)await o.startActiveSpan(i.name,async a=>{try{await i(t,e,n)}catch(c){throw a.recordException(c),a.setStatus({code:Rc.ERROR}),a.end(),c}a.end()})}finally{r.end()}})},"invokeOnResponseSendingFinalExtensions"),xI=s(async t=>{if(sp.length===0)return t;let e=Sc.getTracer("extension");return e.startActiveSpan("hook:preRouting",async n=>{try{let o=t;for(let r of sp)o=await e.startActiveSpan(r.name,async a=>{try{let c=await r(o);if(c instanceof Request)return c;{let u=new Z(`Invalid state - the PreRouting hook must return a Request. Received ${typeof c}.`);throw a.recordException(u),a.setStatus({code:Rc.ERROR}),u}}finally{a.end()}});return o}finally{n.end()}})},"invokePreRoutingHooks"),vI=!1;async function CI(t){if(!vI){t&&(B("runtime.extensions"),await t(vc)),ap.value=vc;for(let e of An)if(e instanceof Qr){let{requestHandlerProxy:n}=e.instrument({accountName:T.instance.accountName,projectName:T.instance.projectName,buildId:T.instance.build.BUILD_ID,zuploVersion:T.instance.build.ZUPLO_VERSION,compatibilityDate:T.instance.build.COMPATIBILITY_DATE,instanceId:T.instance.instanceId,environmentType:T.instance.loggingEnvironmentType,environmentStage:T.instance.loggingEnvironmentStage,deploymentName:T.instance.deploymentName,__internalOnlyRemoteLogUrl:T.instance.remoteLogURL,__internalOnlyRemoteLogToken:T.instance.remoteLogToken});bI(n)}await Promise.all(An.map(async e=>{e instanceof mt&&await e.initialize(vc)})),ts.setProblemResponseFormat(vc.problemResponseFormat),vI=!0}}s(CI,"initializeRuntime");function qo(t){let{developerPortal:e}=je.instance.runtimeSettings;return e.enabled&&e.basePath&&t.pathname.startsWith(e.basePath)||t.pathname.startsWith("/__zuplo/")||t.pathname.startsWith("/__/zuplo/")}s(qo,"isSystemRoute");var St=class{static{s(this,"Pipeline")}constructor(e){this.execute=this.#t(e)}execute;#e=s(e=>async(n,o)=>KM.getTracer("pipeline").startActiveSpan(`handler:${o.route.handler.export}`,async i=>{hI(i,o.route.handler);try{return await e(n,o)}catch(a){let c=bn(n,o,"Error executing request handler.",a);return i.setStatus({code:JM.ERROR}),c}finally{i.end()}}),"#errorWrappedHandler");#t=s(({processors:e,handler:n})=>async(o,r)=>{let i=it.getContextExtensions(r),a=[...e],c=s(async f=>{let v=a.pop();if(!v){let w=await this.#e(async S=>{let x=await n(S,r);return WM(x)})(f,r);try{await i.onHandlerResponse(w,f,r)}catch(S){return bn(o,r,"Error invoking 'context.onHandlerResponse' hook",S)}return w}return v(f,r,c)},"nextPipe"),d=await c(o),p=new URL(o.url);if(qo(p)&&T.instance.build.COMPATIBILITY_FLAGS.doNotRunHooksOnSystemRoutes)return d;let m=new ss(o,d);r.dispatchEvent(m);let g=i.latestRequest,h;try{h=await m.mutableResponse}catch(f){return bn(o,r,"Error retrieving mutableResponse",f)}try{h=await i.onResponseSending(h,g,r)}catch(f){return bn(o,r,"Error invoking 'context.onResponseSending' hook",f)}try{h=await SI(h,g,r)}catch(f){return bn(o,r,"Error invoking 'context.onResponseSending' hook",f)}r.dispatchEvent(new as(o,h));try{await i.onResponseSendingFinal(d,g,r)}catch(f){throw r.log.error("Error invoking 'runtime.onResponseSending' hook",f),f}try{await II(d,g,r)}catch(f){throw r.log.error("Error invoking 'runtime.onResponseSending' hook",f),f}return h},"#toZuploPipeline")};function WM(t){return t instanceof Response?t:typeof t>"u"?new Response:new Response(Hd(t),{headers:{"content-type":"application/json"}})}s(WM,"resultToResponse");var wn=class extends Pr{static{s(this,"MetricsPlugin")}};var Ic=class{static{s(this,"ZuploMetricsTransport")}#e;#t;constructor(e){this.#e=e,this.#t=new be({name:"zuplo-metrics-transport",msDelay:10,dispatchFunction:this.dispatchFunction,systemLogger:H.getLogger(e)})}pushMetrics(e,n){this.#t.enqueue(e),n.waitUntil(this.#t.waitUntilFlushed())}dispatchFunction=s(async e=>{if(e.length!==0)try{let{remoteLogURL:n,deploymentName:o,accountName:r,projectName:i}=T.instance,a=e.map(m=>{let g=Object.assign({},m);return delete g.requestContentLength,delete g.responseContentLength,g}),c=WS(),u={metadata:{timestamp:new Date,accountName:r,projectName:i,deploymentName:o},metrics:a,features:c},d=new Headers({"content-type":"application/json"});Ve(d);let p=await ct({retries:3,retryDelayMs:1e3,logger:D.console},new URL("/v2/runtime/metrics",n).toString(),{method:"POST",body:JSON.stringify(u),headers:d});if(!p.ok){let m=await p.text();H.getLogger(this.#e).error(`Metrics POST responded ${p.status}: ${p.statusText}`,m),YS(c)}}catch(n){H.getLogger(this.#e).error("Failed to send Zuplo metrics.",n)}},"dispatchFunction")};var Zo="SYSTEM_IGNORED";var yt=class{static{s(this,"SystemRouteConfiguration")}constructor({label:e,path:n,methods:o,systemRouteName:r,corsPolicy:i="none"}){this.label=e,this.path=n,this.methods=o,this.corsPolicy=i,this.handler={export:Zo,module:Zo},this.systemRouteName=r}label;path;methods;handler;corsPolicy;policies;systemRouteName;metadata;raw(){return{}}};var cp="x-real-ip",YM="true-client-ip",QM="cf-connecting-ip",XM="x-forwarded-for";function Ft(t){let e=t.headers,n=e.get(cp)??e.get(YM)??e.get(QM);if(n)return n;let o=e.get(XM);if(o){let r=o.split(/,\s*/).map(i=>i.trim()).find(i=>i.length>0);if(r)return r}}s(Ft,"getClientIp");var Gt=s(async(t,e,n)=>{let o=new Date,r=Date.now(),i=await n(t),a=t.headers.get(Mo)??void 0,c=Ft(t),u=e.incomingRequestProperties,d;e.route instanceof yt&&(d=e.route.systemRouteName);let p=it.getContextExtensions(e).latestRequest,m={timestamp:o,statusCode:i.status,durationMs:Date.now()-r,requestContentLength:t.headers.get("content-length")?Number(t.headers.get("content-length")):void 0,responseContentLength:i.headers.get("content-length")?Number(i.headers.get("content-length")):void 0,routePath:e.route?.path??"SYSTEM_OR_NOT_FOUND",systemRouteName:d,contextId:e.contextId,parentContextId:e.parentContext?.contextId,requestId:e.requestId,parentRequestId:e.parentContext?.requestId,method:t.method,asn:u.asn,asOrganization:u.asOrganization,colo:u.colo,continent:u.continent,country:u.country,city:u.city,latitude:u.latitude,longitude:u.longitude,rayId:a,instanceId:T.instance.instanceId,userSub:p.user?.sub,clientIp:c},g=[];return!T.instance.isLocalDevelopment&&T.instance.remoteLogURL&&T.instance.remoteLogToken&&T.instance.loggingId&&g.push(new Ic(e)),An.forEach(h=>{if(h instanceof wn){let f=h.getTransport();g.push(f)}}),g.forEach(h=>{h.pushMetrics(m,e)}),i},"metricsProcessor");var up=s(t=>{let e=s(async(r,i)=>{let a=new URL(r.url),c=T.instance.build,u={buildId:c.BUILD_ID,zuploVersion:c.ZUPLO_VERSION,compatibilityDate:c.COMPATIBILITY_DATE,apiVersion:c.API_VERSION,gitSha:c.GIT_SHA,timestamp:c.TIMESTAMP,isProduction:c.ENVIRONMENT_TYPE==="PRODUCTION"};if(a.searchParams.get("system_log")==="true"&&H.getLogger(i).error("Test System Log",u),a.searchParams.get("error")==="true")throw new Error("this is an unhandled error");return new Response(JSON.stringify(u,null,2),{status:200,headers:{"content-type":"application/json"}})},"buildRouteHandler"),n=new St({processors:[Gt],handler:e}),o=new yt({label:"SYSTEM_BUILD_ROUTE",methods:["GET"],path:"/__zuplo/build",systemRouteName:"build-data"});t.addRoute(o,n.execute)},"registerBuildRoute");var xc=class{static{s(this,"BoundedSet")}limit;items;constructor(e){this.limit=e,this.items=new Map}add(e){if(this.items.has(e))this.items.delete(e);else if(this.items.size>=this.limit){let n=this.items.keys().next().value;n&&this.items.delete(n)}this.items.set(e,!0)}has(e){return this.items.has(e)}values(){return Array.from(this.items.keys())}size(){return this.items.size}};var TI=new Map;function qn(t){if(Array.isArray(t)&&!t.some(r=>typeof r!="number"))return t;if(typeof t!="string")throw new Error("Input must be a string or an array of numbers");if(!/^\d+(?:-\d+)?(?:,\s*\d+(?:-\d+)?)*$/.test(t))throw new I("Malformed input string");let e=TI.get(t);if(e)return e;let n=t.split(","),o=[];for(let r of n){let i=r.split("-");if(i.length===2){let a=parseInt(i[0],10),c=parseInt(i[1],10);for(let u=a;u<=c;u++)o.push(u)}else o.push(parseInt(r,10))}return TI.set(t,o),o}s(qn,"statusCodesStringToNumberArray");function or(t,e,n){if(!e.startsWith("."))throw new I(`Invalid ${n} - must start with '.' - '${e}' does not`);let o=e.split(".").splice(1),r=t;return o.forEach(i=>{if(r===void 0)throw new Z(`Error applying ${n} '${e}', reading '${i}'`);r=r[i]}),`${r}`}s(or,"getValueFromRequestUser");var PI=new Map;function cs(t){let e=PI.get(t);if(e)return e;let n=[],o=0;for(;o<t.length;){if(t[o]==="."){o++;continue}if(t[o]==="["){for(o++;o<t.length&&/\s/.test(t[o]);)o++;let r=t[o];if(r!=='"'&&r!=="'")throw new I(`Invalid selector '${t}' - bracket segments must be quoted, e.g. ["my.key"]`);o++;let i=o;for(;o<t.length&&t[o]!==r;)o++;if(o>=t.length)throw new I(`Invalid selector '${t}' - unterminated quoted segment`);for(n.push(t.substring(i,o)),o++;o<t.length&&/\s/.test(t[o]);)o++;t[o]==="]"&&o++}else{let r=o;for(;o<t.length&&t[o]!=="."&&t[o]!=="[";)o++;let i=t.substring(r,o).trim();i.length>0&&n.push(i)}}return PI.set(t,n),n}s(cs,"parseJsonPath");function Cc(t,e){let n=t;for(let o of cs(e)){if(n===null||typeof n!="object")return;n=Reflect.get(n,o)}return n}s(Cc,"getValueAtPath");function AI(t,e){if(!e.startsWith(".")&&!e.startsWith("["))throw new I(`Invalid selector. must start with '.' - '${e}' does not`);let n=cs(e),o=t;return n.forEach(r=>{if(o===void 0)throw new Z(`Error applying'${e}', reading '${r}'`);if(o&&typeof o=="object")o=Reflect.get(o,r);else throw new Z(`Error applying'${e}', reading '${r}'`)}),`${o}`}s(AI,"selectPropertyUsingJsonPath");function to(t){if(Array.isArray(t)){if(t.includes(n=>typeof n!="string"))throw new I("Received an array that contains non-string values.");return t}if(zn(t))return t.includes(",")?t.split(",").map(n=>n.trim()).filter(n=>n!==","&&n!==""):[t];throw new I(`Expected type of string, received type '${typeof t}'`)}s(to,"parseValueToStringArray");function kI(t){if(t==null)return[];if(!Array.isArray(t))throw new I(`Invalid corsPolicy configuration. Expected an array of objects, received '${typeof t}'`);return t.map(n=>{if(!Xr(n))throw new I(`Invalid custom cors policy is set. Expected an object, received '${typeof n}'`);if(!XS(n.name))throw new I("Value of 'name' on custom cors policies must be a non-empty string.");if(n.maxAge!==void 0&&!Gd(n.maxAge))throw new I(`Value of 'maxAge' on custom cors policies must be a non-empty string. Received type '${typeof n.maxAge}'`);if(n.allowCredentials!==void 0&&!Bd(n.allowCredentials))throw new I("Value of 'allowCredentials' on custom cors policies must be a boolean or not be set. If using an environment variable, check that it is set correctly.");let o=lp(n,"allowedHeaders"),r=lp(n,"allowedMethods"),i=lp(n,"exposeHeaders"),a;try{a=to(n.allowedOrigins)}catch(u){throw new I(`Value of 'allowedOrigins' on custom cors policies is invalid. ${u.message} If using an environment variable, check that it is set correctly.`)}return{name:n.name,allowCredentials:typeof n.allowCredentials=="boolean"?String(n.allowCredentials):void 0,allowedOrigins:a,allowedHeaders:o?o.join(", "):void 0,allowedMethods:r?r.join(", "):void 0,exposeHeaders:i?i.join(", "):void 0,maxAge:typeof n.maxAge=="number"?n.maxAge.toString():void 0}})}s(kI,"parseCorsPolicies");function lp(t,e){let n;if(t[e]!==void 0)try{n=to(t[e])}catch(o){throw new I(`Value of '${e}' on custom cors policies is invalid. ${o.message} If using an environment variable, check that it is set correctly.`)}return n}s(lp,"parseOptionalProperty");var dp=new Map,eL=s((t,e,n)=>{for(let o of t){let r=o.trim().toLowerCase();if(r==="*")return e;if(r.includes("*.")){let a=r.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*\\\./g,"[^.]+\\.");if(new RegExp(`^${a}$`).test(n))return e}else{let i=r.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*");if(new RegExp(`^${i}$`).test(n))return e}}},"testMatchinOrigin"),Tc=s((t,e,n)=>{if(n===null)return;let o=n.trim().toLowerCase(),r=dp.get(t);if(r?.has(o))return n;let i=eL(e,n,o);return i&&(r||dp.set(t,new xc(20)),dp.get(t)?.add(o)),i},"findMatchingOrigin"),Pc=s((t,e)=>{let n={"access-control-allow-origin":e};t.allowedHeaders&&(n["access-control-allow-headers"]=t.allowedHeaders),t.allowedMethods&&(n["access-control-allow-methods"]=t.allowedMethods),t.exposeHeaders&&(n["access-control-expose-headers"]=t.exposeHeaders);let o=t.allowCredentials;o&&(n["access-control-allow-credentials"]=o);let r=t.maxAge?.toString()??void 0;return r&&(n["access-control-max-age"]=r),n},"generateCorsHeaders"),Ac=s((t,e)=>{if(!t)return!1;let{developerPortal:n}=e;return n.enabled&&n.type==="zudoku"&&n.urls?n.urls.urls.includes(t):!1},"isDevPortalOrigin");var tL=new Map([["McpProxyHandler","$import(@zuplo/runtime/mcp-gateway)"],["mcpServerHandler","$import(@zuplo/runtime)"]]),EI={allow:"POST"};function nL(t){let e=t.handler?.export;if(e===void 0)return!1;let n=tL.get(e);return n===void 0?!1:t.raw()?.["x-zuplo-route"]?.handler?.module===n}s(nL,"isBuiltInMcpHandler");var kc=s((t,e)=>t.lookupByPathOnly(e).find(n=>{let{routeConfiguration:o}=n;return nL(o)&&o.methods.some(r=>r.toUpperCase()==="POST")})?.routeConfiguration,"findMcpPostRouteByPath");var pp=s((t,e,n)=>{let o=s(async(a,c)=>{let u=new URL(a.url.toString()).pathname,d=a.headers.get("access-control-request-method"),p=a.headers.get("access-control-request-headers"),m=a.headers.get("origin");if(m===null||d===null)return $.badRequest(a,c,{detail:"Expect headers origin and access-control-request-method"});if(Ac(m,e)){let w={"access-control-allow-origin":m,"access-control-allow-methods":d,"access-control-allow-headers":p??"*","access-control-expose-headers":"*","access-control-allow-credentials":"true","access-control-max-age":"600"};return new Response(void 0,{status:200,statusText:"OK",headers:w})}let h=t.lookup(u,d)?.routeConfiguration,v=(h instanceof yt&&h.systemRouteName==="unmatched-path"?void 0:h)??(d==="GET"?kc(t,u):void 0);if(!v)return $.notFound(a,c);let b=rL({requestedMethod:d,requestedHeaders:p,requestedOrigin:m,routeConfig:v,customPolicies:n});return b.isValid?new Response(void 0,{status:200,statusText:"OK",headers:b.headers}):(b.error&&c.log.warn(b.error),$.notFound(a,c))},"optionsHandler"),r=new St({processors:[Gt],handler:o}),i=new yt({label:"SYSTEM_CORS_ROUTE",methods:["OPTIONS"],path:"/(.*)",systemRouteName:"cors-preflight"});t.addRoute(i,r.execute)},"registerCorsRoute"),rL=s(({requestedMethod:t,requestedHeaders:e,requestedOrigin:n,routeConfig:o,customPolicies:r})=>{let i={isValid:!1,headers:{}};if(o.corsPolicy==="anything-goes")return{isValid:!0,headers:{"access-control-allow-origin":n,"access-control-allow-methods":t,"access-control-allow-headers":e??"*","access-control-expose-headers":"*","access-control-allow-credentials":"true","access-control-max-age":"600"}};if(o.corsPolicy==="none")return{...i,error:`No CORS policy set for the route '${o.pathPattern}'`};let a=r?.find(d=>d.name===o.corsPolicy);if(!a)throw new I(`Invalid Configuration - corsPolicy '${o.corsPolicy}' not found in *.oas.json 'corsPolicies' section.`);let c=Tc(a.name,a.allowedOrigins,n);return c?{isValid:!0,headers:Pc(a,c)}:{...i,error:`The CORS policy '${a.name}' does not allow the origin '${n}'`}},"validateAndBuildResponseHeaders");var _I=s(t=>{let e=s(async()=>new Response("You have no routes. Add a route in routes.oas.json to get started",{status:200}),"noRoutesHandler"),n=new St({processors:[Gt],handler:e}),o=new yt({label:"SYSTEM_NO_ROUTES",methods:["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"],path:"/(.*)",systemRouteName:"empty-gateway-catchall"});t.addRoute(o,n.execute)},"registerNoRoutes");var Ar=class{static{s(this,"UserRouteConfiguration")}constructor(e){this.path=e.path,this.methods=e.methods,this.label=e.label,this.key=e.key,this.handler=e.handler,this.corsPolicy=e.corsPolicy,this.custom=e.custom,this.mcp=e.mcp,this.policies=e.policies,this.excludeFromOpenApi=e.excludeFromOpenApi,this.pathPattern=e.pathPattern,this.metadata=e.metadata,this.raw=e.raw}raw;get summary(){return this.raw()?.summary}get operationId(){return this.raw()?.operationId}get tags(){return this.raw()?.tags}get parameters(){return this.raw()?.parameters}get responses(){return this.raw()?.responses}label;key;path;excludeFromOpenApi;pathPattern;metadata;custom;mcp;methods;handler;corsPolicy;policies};var oL=new yt({label:"SYSTEM_NOT_FOUND_ROUTE",methods:["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"],path:"/(.*)",systemRouteName:"unmatched-path"}),OI=s(t=>{let e=s(async(o,r)=>{let i=ap.value?.notFoundHandler;if(i){let u=new URL(o.url);return i(o,r,{get routesMatchedByPathOnly(){return t.lookupByPathOnly(u.pathname).map(p=>p.routeConfiguration).filter(p=>p instanceof Ar)}})}let a=new URL(o.url);return kc(t,a.pathname)&&o.method!=="POST"?$.methodNotAllowed(o,r,void 0,EI):$.notFound(o,r)},"notFoundHandler"),n=new St({processors:[Gt],handler:e});t.addRoute(oL,n.execute)},"registerNotMatchedHandler");var iL=["access-control-allow-origin","access-control-allow-headers","access-control-expose-headers","access-control-allow-credentials","access-control-max-age"],$I=s(t=>{iL.forEach(e=>t.delete(e))},"stripCorsHeaders"),Fo=s(async(t,e,n)=>{let o=await n(t);if(T.instance.isDeno&&o.status===101&&[...o.headers.keys()].length===0&&!o.body)return o;let r=e.route,i=t.headers.get("origin"),a=Ac(i,je.instance.runtimeSettings);if((!r.corsPolicy||r.corsPolicy==="none")&&!a){let m=new Headers(o.headers);return $I(m),new Response(o.body,{status:o.status,statusText:o.statusText,headers:m,webSocket:o.webSocket})}if(!(o instanceof Response))throw new Pe(`The CorsProcessor is in the wrong place in the pipeline. It should only receive HttpResponse type but got '${typeof o}'`);let c=sL(r,je.instance.routeData.corsPolicies,a),u=aL(i,c),d=new Headers(o.headers);return $I(d),Object.entries(u).forEach(([m,g])=>{d.set(m,g)}),new Response(o.body,{status:o.status,statusText:o.statusText,headers:d,webSocket:o.webSocket})},"corsProcessor"),sL=s((t,e,n)=>{if(t.corsPolicy==="anything-goes")return{name:"anything-goes",allowedHeaders:"*",allowedOrigins:["*"],allowedMethods:t.methods.join(", "),exposeHeaders:"*",allowCredentials:"true",maxAge:"600"};if(n)return{name:"dev-portal-anything-goes",allowedHeaders:"*",allowedOrigins:["*"],allowedMethods:t.methods.join(", "),exposeHeaders:"*",allowCredentials:"true",maxAge:"600"};let o=e?.find(r=>r.name===t.corsPolicy);if(o===void 0)throw new I(`Invalid Configuration - no corsPolicy '${t.corsPolicy}' found in *.oas.json`);return o},"getCorsPolicy"),aL=s((t,e)=>{let n=Tc(e.name,e.allowedOrigins,t);return n?Pc(e,n):{}},"getCorsHeaders");var mp=s(t=>{let e=s(async()=>new Response(JSON.stringify({buildId:T.instance.build.BUILD_ID}),{status:200,headers:{"content-type":"application/json"}}),"pingRouteHandler"),n=new St({processors:[Fo],handler:e}),o=new yt({corsPolicy:"anything-goes",label:"SYSTEM_PING_ROUTE",methods:["GET"],path:"/__zuplo/ping",systemRouteName:"ping"});t.addRoute(o,n.execute)},"registerPingRoute");import{SpanStatusCode as LI,trace as NI}from"@opentelemetry/api";var cL="custom";function Go(t,e){t.setAttribute(Qt.PolicyName,e.policyName),t.setAttribute(Qt.PolicyDirection,e.direction),t.setAttribute(Qt.PolicyType,e.policyType??cL),e.policyType!==void 0&&B(`policy.${e.direction}.${e.policyType}`)}s(Go,"applyPolicySpanTelemetry");var Ec=class extends ce{static{s(this,"InboundFunctionOnlyPolicy")}#e;constructor(e,n,o){super(n,o),this.policyType=e.policyType,this.#e=e}handler(e,n){return this.#e(e,n,this.options,this.policyName)}},hp=class extends rr{static{s(this,"OutboundFunctionOnlyPolicy")}#e;constructor(e,n,o){super(n,o),this.policyType=e.policyType,this.#e=e}handler(e,n,o){return this.#e(e,n,o,this.options,this.policyName)}},fp=new Map;function MI(t){return t===null?"null":Array.isArray(t)?"array":typeof t}s(MI,"describeValueType");function _c(t,e,...n){if(n.length===1){let[r]=n,i=e?.find(m=>m.name===t);if(!i)throw new I(`Invalid state - no Policy with the name '${t}' was found in the policies configuration (check case).`);if(typeof i.handler?.module!="object"||i.handler.module===null||Array.isArray(i.handler.module))throw new I(`Invalid state - invalid policy '${t}' (handler.module is '${MI(i.handler?.module)}')`);let a=i.handler.module[i.handler.export];if(typeof a!="function")throw new I(`Invalid state - invalid policy '${t}' (handler.module export '${i.handler.export}' is '${MI(a)}')`);let c=a.prototype instanceof ce,u=a.prototype instanceof rr||Function.prototype.toString.call(a).startsWith("class ");if(a.policyDirection==="outbound"||!c&&u)throw new I(`Invalid state - invalid policy '${t}' (handler.module export '${i.handler.export}' must be an inbound policy function or a class extending InboundPolicy)`);let p=c?new a(r,i.name):new Ec(a,r,i.name);if(typeof p.handler!="function")throw new I(`Invalid state - invalid handler on policy '${t}' (typeof handler '${typeof p.handler}')`);return p}let[o]=Bo([t],e);if(!o)throw new Z("Internal error. Policy not found in cache.");return o}s(_c,"getInboundPolicyInstance");function Bo(t,e){let n,o;return Array.isArray(t)?n=t:(n=t.policies?.inbound??[],o=t.path),n.filter(i=>!fp.has(i)).forEach(i=>{let a=e?.find(d=>d.name===i);if(!a)throw new I(`Invalid state - no Policy with the name '${i}' ${o&&`on route '${o}'`} was found in the policies configuration (check case).`);if(typeof a.handler?.module!="object")throw new I(`Invalid state - invalid policy '${i}' on route '${o}' (typeof policy '${typeof a.handler?.module}')`);let c=a.handler?.module[a.handler.export];if(typeof c!="function")throw new I(`Invalid state - invalid policy '${i}' on route '${o}' (typeof module '${typeof c}')`);let u;if(typeof c!="function")throw new I(`Invalid state - invalid policy '${i}' on route '${o}' (typeof module '${typeof c}')`);if(c.prototype instanceof ce)u=new c(a.handler.options,a.name);else if(typeof c=="function")u=new Ec(c,a.handler.options,a.name);else throw new I(`Invalid state - invalid policy '${i}' on route '${o}' (typeof policy '${typeof c}')`);if(typeof u.handler!="function")throw new I(`Invalid state - invalid handler on policy '${i}' on route '${o}' (typeof handler '${typeof u.handler}')`);fp.set(a.name,u)}),n.map(i=>{let a=fp.get(i);if(a===void 0)throw new Z("Internal error. Policy not found in cache.");return a})}s(Bo,"getInboundPolicyInstances");var gp=new Map;function us(t,e){let n,o;return Array.isArray(t)?n=t:(n=t.policies?.outbound??[],o=t.path),n.filter(i=>!gp.has(i)).forEach(i=>{let a=e?.find(d=>d.name===i);if(!a)throw new I(`Invalid state - no Policy with the name '${i}' on route '${o}' was found in the policies configuration (check case).`);if(typeof a.handler?.module!="object")throw new I(`Invalid state - invalid policy '${i}' on route '${o}' (typeof policy '${typeof a.handler?.module}')`);let c=a.handler?.module[a.handler.export],u;if(typeof c!="function")throw new I(`Invalid state - invalid policy '${i}' on route '${o}' (typeof module '${typeof c}')`);if(c.prototype instanceof rr)u=new c(a.handler.options??{},a.name);else if(typeof c=="function")u=new hp(c,a.handler.options??{},a.name);else throw new I(`Invalid state - invalid policy '${i}' on route '${o}' (typeof policy '${typeof c}')`);if(typeof u.handler!="function")throw new I(`Invalid state - invalid handler on policy '${i}' on route '${o}'`);gp.set(a.name,u)}),n.map(i=>{let a=gp.get(i);if(a===void 0)throw new Z("Internal error. Policy not found in cache.");return a})}s(us,"getOutboundPolicyInstances");var ls=s(t=>async(e,n)=>{let o=it.getContextExtensions(n),r=NI.getTracer("pipeline");return await r.startActiveSpan("policies:inbound",async i=>{try{let a=[...t],c=e;for(;a.length>0;){let u=a.shift();if(!u)return c;let d=await r.startActiveSpan(`policy:${u.policyName}`,async p=>{try{Go(p,u);let m=await u.handler(c,n);if(m instanceof Request||m instanceof we||m instanceof Response){if(m instanceof Response||m instanceof we)return m;{let g=c.user;return new we(m,{user:g})}}else{let g=new I(`Invalid state - invalid handler on policy '${u.policyName}' on route '${n.route.path}'. The result of an inbound policy must be a Response or Request.`);throw p.setStatus({code:LI.ERROR}),p.recordException(g),g}}finally{p.end()}});if(d instanceof we)c=d;else if(d instanceof Request){let p=c.user;c=new we(d,{user:p})}else if(d instanceof Response)return d;o.latestRequest=c}return c}finally{i.end()}})},"toStackedInboundHandler"),yp=s(t=>async(e,n,o)=>{let r=NI.getTracer("pipeline");return await r.startActiveSpan("policies:outbound",async i=>{try{let a=[...t],c=e;for(;a.length>0;){let u=a.shift();if(!u)return c;c=await r.startActiveSpan(`policy:${u.policyName}`,async p=>{try{Go(p,u);let m=await u.handler(c,n,o);if(m instanceof Response)return m;{let g=new I(`Invalid state - invalid handler on policy '${u.policyName}' on route '${o.route.path}'. The result of an outbound policy must be a Response.`);throw p.setStatus({code:LI.ERROR}),p.recordException(g),g}}finally{p.end()}})}return c}finally{i.end()}})},"toStackedOutboundHandler"),Oc=s(async(t,e,n)=>{let o=Bo(e.route,je.instance.routeData.policies),r=us(e.route,je.instance.routeData.policies);return uL({request:t,context:e,inboundPolicies:o,outboundPolicies:r,next:n})},"policyProcessor");async function uL({request:t,context:e,inboundPolicies:n,outboundPolicies:o,next:r}){let i=ls(n);try{let a=await i(t,e);if(a instanceof Response)return a;let c=await r(a),u=yp(o),d;return T.instance.build.COMPATIBILITY_FLAGS.runOutboundPoliciesOnHandlerOnAllStatuses?d=u(c,t,e):d=c.ok?u(c,t,e):c,d}catch(a){return bn(t,e,"Error executing policies",a)}}s(uL,"executePolicyProcessor");var jI=uM(zI(),1);function qI(t,e){try{let n=/v\d+(-\d+)?/g,r=(0,jI.parse)(e.get("Cookie")||"")["zp-dev-portal"];return r!==null&&r&&n.test(r)?`https://dev-portal-${r}.zuplo.com`:t}catch{}return t}s(qI,"devPortalBaseURL");var ZI="/__zuplo/dev-portal",vL="dev-portal-id",RL="dev-portal-host",SL="zp-account",IL="zp-project",xL="dev-portal-build",CL=`
66
66
  <!DOCTYPE html>
67
67
  <html lang="en">
68
68
  <head>
@@ -381,5 +381,5 @@ Signature verification is impossible without access to the original signed mater
381
381
  `);let R=new f("!xml"),P=R,E="",O="";this.entityExpansionCount=0,this.currentExpandedLength=0;let _=new v(this.options.processEntities);for(let F=0;F<y.length;F++)if(y[F]==="<")if(y[F+1]==="/"){let J=gn(y,">",F,"Closing Tag is not closed."),G=y.substring(F+2,J).trim();if(this.options.removeNSPrefix){let zt=G.indexOf(":");zt!==-1&&(G=G.substr(zt+1))}this.options.transformTagName&&(G=this.options.transformTagName(G)),P&&(E=this.saveTextToParentTag(E,P,O));let Ne=O.substring(O.lastIndexOf(".")+1);if(G&&this.options.unpairedTags.indexOf(G)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${G}>`);let ye=0;Ne&&this.options.unpairedTags.indexOf(Ne)!==-1?(ye=O.lastIndexOf(".",O.lastIndexOf(".")-1),this.tagsNodeStack.pop()):ye=O.lastIndexOf("."),O=O.substring(0,ye),P=this.tagsNodeStack.pop(),E="",F=J}else if(y[F+1]==="?"){let J=xr(y,F,!1,"?>");if(!J)throw new Error("Pi Tag is not closed.");if(E=this.saveTextToParentTag(E,P,O),!(this.options.ignoreDeclaration&&J.tagName==="?xml"||this.options.ignorePiTags)){let G=new f(J.tagName);G.add(this.options.textNodeName,""),J.tagName!==J.tagExp&&J.attrExpPresent&&(G[":@"]=this.buildAttributesMap(J.tagExp,O,J.tagName)),this.addChild(P,G,O,F)}F=J.closeIndex+1}else if(y.substr(F+1,3)==="!--"){let J=gn(y,"-->",F+4,"Comment is not closed.");if(this.options.commentPropName){let G=y.substring(F+4,J-2);E=this.saveTextToParentTag(E,P,O),P.add(this.options.commentPropName,[{[this.options.textNodeName]:G}])}F=J}else if(y.substr(F+1,2)==="!D"){let J=_.readDocType(y,F);this.docTypeEntities=J.entities,F=J.i}else if(y.substr(F+1,2)==="!["){let J=gn(y,"]]>",F,"CDATA is not closed.")-2,G=y.substring(F+9,J);E=this.saveTextToParentTag(E,P,O);let Ne=this.parseTextData(G,P.tagname,O,!0,!1,!0,!0);Ne==null&&(Ne=""),this.options.cdataPropName?P.add(this.options.cdataPropName,[{[this.options.textNodeName]:G}]):P.add(this.options.textNodeName,Ne),F=J+2}else{let J=xr(y,F,this.options.removeNSPrefix),G=J.tagName,Ne=J.rawTagName,ye=J.tagExp,zt=J.attrExpPresent,eS=J.closeIndex;if(this.options.transformTagName){let jt=this.options.transformTagName(G);ye===G&&(ye=jt),G=jt}P&&E&&P.tagname!=="!xml"&&(E=this.saveTextToParentTag(E,P,O,!1));let tS=P;tS&&this.options.unpairedTags.indexOf(tS.tagname)!==-1&&(P=this.tagsNodeStack.pop(),O=O.substring(0,O.lastIndexOf("."))),G!==R.tagname&&(O+=O?"."+G:G);let Ed=F;if(this.isItStopNode(this.stopNodesExact,this.stopNodesWildcard,O,G)){let jt="";if(ye.length>0&&ye.lastIndexOf("/")===ye.length-1)G[G.length-1]==="/"?(G=G.substr(0,G.length-1),O=O.substr(0,O.length-1),ye=G):ye=ye.substr(0,ye.length-1),F=J.closeIndex;else if(this.options.unpairedTags.indexOf(G)!==-1)F=J.closeIndex;else{let _d=this.readStopNodeData(y,Ne,eS+1);if(!_d)throw new Error(`Unexpected end of ${Ne}`);F=_d.i,jt=_d.tagContent}let Oo=new f(G);G!==ye&&zt&&(Oo[":@"]=this.buildAttributesMap(ye,O,G)),jt&&(jt=this.parseTextData(jt,G,O,!0,zt,!0,!0)),O=O.substr(0,O.lastIndexOf(".")),Oo.add(this.options.textNodeName,jt),this.addChild(P,Oo,O,Ed)}else{if(ye.length>0&&ye.lastIndexOf("/")===ye.length-1){if(G[G.length-1]==="/"?(G=G.substr(0,G.length-1),O=O.substr(0,O.length-1),ye=G):ye=ye.substr(0,ye.length-1),this.options.transformTagName){let Oo=this.options.transformTagName(G);ye===G&&(ye=Oo),G=Oo}let jt=new f(G);G!==ye&&zt&&(jt[":@"]=this.buildAttributesMap(ye,O,G)),this.addChild(P,jt,O,Ed),O=O.substr(0,O.lastIndexOf("."))}else{let jt=new f(G);this.tagsNodeStack.push(P),G!==ye&&zt&&(jt[":@"]=this.buildAttributesMap(ye,O,G)),this.addChild(P,jt,O,Ed),P=jt}E="",F=eS}}else E+=y[F];return R.child},"parseXml");function Te(y,R,P,E){this.options.captureMetaData||(E=void 0);let O=this.options.updateTag(R.tagname,P,R[":@"]);O===!1||(typeof O=="string"&&(R.tagname=O),y.addChild(R,E))}s(Te,"addChild"),n(Te,"addChild");var Ue=n(function(y,R,P){if(y.indexOf("&")===-1)return y;let E=this.options.processEntities;if(!E.enabled||E.allowedTags&&!E.allowedTags.includes(R)||E.tagFilter&&!E.tagFilter(R,P))return y;for(let O in this.docTypeEntities){let _=this.docTypeEntities[O],F=y.match(_.regx);if(F){if(this.entityExpansionCount+=F.length,E.maxTotalExpansions&&this.entityExpansionCount>E.maxTotalExpansions)throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${E.maxTotalExpansions}`);let pe=y.length;if(y=y.replace(_.regx,_.val),E.maxExpandedLength&&(this.currentExpandedLength+=y.length-pe,this.currentExpandedLength>E.maxExpandedLength))throw new Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${E.maxExpandedLength}`)}}if(y.indexOf("&")===-1)return y;for(let O in this.lastEntities){let _=this.lastEntities[O];y=y.replace(_.regex,_.val)}if(y.indexOf("&")===-1)return y;if(this.options.htmlEntities)for(let O in this.htmlEntities){let _=this.htmlEntities[O];y=y.replace(_.regex,_.val)}return y=y.replace(this.ampEntity.regex,this.ampEntity.val),y},"replaceEntitiesValue");function Ee(y,R,P,E){return y&&(E===void 0&&(E=R.child.length===0),y=this.parseTextData(y,R.tagname,P,!1,R[":@"]?Object.keys(R[":@"]).length!==0:!1,E),y!==void 0&&y!==""&&R.add(this.options.textNodeName,y),y=""),y}s(Ee,"saveTextToParentTag"),n(Ee,"saveTextToParentTag");function Tt(y,R,P,E){return!!(R&&R.has(E)||y&&y.has(P))}s(Tt,"isItStopNode"),n(Tt,"isItStopNode");function Un(y,R,P=">"){let E,O="";for(let _=R;_<y.length;_++){let F=y[_];if(E)F===E&&(E="");else if(F==='"'||F==="'")E=F;else if(F===P[0])if(P[1]){if(y[_+1]===P[1])return{data:O,index:_}}else return{data:O,index:_};else F===" "&&(F=" ");O+=F}}s(Un,"tagExpWithClosingIndex"),n(Un,"tagExpWithClosingIndex");function gn(y,R,P,E){let O=y.indexOf(R,P);if(O===-1)throw new Error(E);return O+R.length-1}s(gn,"findClosingIndex"),n(gn,"findClosingIndex");function xr(y,R,P,E=">"){let O=Un(y,R+1,E);if(!O)return;let _=O.data,F=O.index,pe=_.search(/\s/),J=_,G=!0;pe!==-1&&(J=_.substring(0,pe),_=_.substring(pe+1).trimStart());let Ne=J;if(P){let ye=J.indexOf(":");ye!==-1&&(J=J.substr(ye+1),G=J!==O.data.substr(ye+1))}return{tagName:J,tagExp:_,closeIndex:F,attrExpPresent:G,rawTagName:Ne}}s(xr,"readTagExp"),n(xr,"readTagExp");function Eo(y,R,P){let E=P,O=1;for(;P<y.length;P++)if(y[P]==="<")if(y[P+1]==="/"){let _=gn(y,">",P,`${R} is not closed`);if(y.substring(P+2,_).trim()===R&&(O--,O===0))return{tagContent:y.substring(E,P),i:_};P=_}else if(y[P+1]==="?")P=gn(y,"?>",P+1,"StopNode is not closed.");else if(y.substr(P+1,3)==="!--")P=gn(y,"-->",P+3,"StopNode is not closed.");else if(y.substr(P+1,2)==="![")P=gn(y,"]]>",P,"StopNode is not closed.")-2;else{let _=xr(y,P,">");_&&((_&&_.tagName)===R&&_.tagExp[_.tagExp.length-1]!=="/"&&O++,P=_.closeIndex)}}s(Eo,"readStopNodeData"),n(Eo,"readStopNodeData");function Ka(y,R,P){if(R&&typeof y=="string"){let E=y.trim();return E==="true"?!0:E==="false"?!1:L(y,P)}else return g(y)?y:""}s(Ka,"parseValue"),n(Ka,"parseValue");function Id(y,R,P){let E=Number.parseInt(y,R);return E>=0&&E<=1114111?String.fromCodePoint(E):P+y+";"}s(Id,"fromCodePoint"),n(Id,"fromCodePoint");var xd=f.getMetaDataSymbol();function GR(y,R){return Cd(y,R)}s(GR,"prettify"),n(GR,"prettify");function Cd(y,R,P){let E,O={};for(let _=0;_<y.length;_++){let F=y[_],pe=BR(F),J="";if(P===void 0?J=pe:J=P+"."+pe,pe===R.textNodeName)E===void 0?E=F[pe]:E+=""+F[pe];else{if(pe===void 0)continue;if(F[pe]){let G=Cd(F[pe],R,J),Ne=JR(G,R);F[xd]!==void 0&&(G[xd]=F[xd]),F[":@"]?VR(G,F[":@"],J,R):Object.keys(G).length===1&&G[R.textNodeName]!==void 0&&!R.alwaysCreateTextNode?G=G[R.textNodeName]:Object.keys(G).length===0&&(R.alwaysCreateTextNode?G[R.textNodeName]="":G=""),O[pe]!==void 0&&O.hasOwnProperty(pe)?(Array.isArray(O[pe])||(O[pe]=[O[pe]]),O[pe].push(G)):R.isArray(pe,J,Ne)?O[pe]=[G]:O[pe]=G}}}return typeof E=="string"?E.length>0&&(O[R.textNodeName]=E):E!==void 0&&(O[R.textNodeName]=E),O}s(Cd,"compress"),n(Cd,"compress");function BR(y){let R=Object.keys(y);for(let P=0;P<R.length;P++){let E=R[P];if(E!==":@")return E}}s(BR,"propName"),n(BR,"propName");function VR(y,R,P,E){if(R){let O=Object.keys(R),_=O.length;for(let F=0;F<_;F++){let pe=O[F];E.isArray(pe,P+"."+pe,!0,!0)?y[pe]=[R[pe]]:y[pe]=R[pe]}}}s(VR,"assignAttributes"),n(VR,"assignAttributes");function JR(y,R){let{textNodeName:P}=R,E=Object.keys(y).length;return!!(E===0||E===1&&(y[P]||typeof y[P]=="boolean"||y[P]===0))}s(JR,"isLeafTag"),n(JR,"isLeafTag");var rM={allowBooleanAttributes:!1,unpairedTags:[]};function KR(y,R){R=Object.assign({},rM,R);let P=[],E=!1,O=!1;y[0]==="\uFEFF"&&(y=y.substr(1));for(let _=0;_<y.length;_++)if(y[_]==="<"&&y[_+1]==="?"){if(_+=2,_=Pd(y,_),_.err)return _}else if(y[_]==="<"){let F=_;if(_++,y[_]==="!"){_=Ad(y,_);continue}else{let pe=!1;y[_]==="/"&&(pe=!0,_++);let J="";for(;_<y.length&&y[_]!==">"&&y[_]!==" "&&y[_]!==" "&&y[_]!==`
382
382
  `&&y[_]!=="\r";_++)J+=y[_];if(J=J.trim(),J[J.length-1]==="/"&&(J=J.substring(0,J.length-1),_--),!N(J)){let ye;return J.trim().length===0?ye="Invalid space after '<'.":ye="Tag '"+J+"' is an invalid name.",pt("InvalidTag",ye,Mt(y,_))}let G=WR(y,_);if(G===!1)return pt("InvalidAttr","Attributes for '"+J+"' have open quote.",Mt(y,_));let Ne=G.value;if(_=G.index,Ne[Ne.length-1]==="/"){let ye=_-Ne.length;Ne=Ne.substring(0,Ne.length-1);let zt=kd(Ne,R);if(zt===!0)E=!0;else return pt(zt.err.code,zt.err.msg,Mt(y,ye+zt.err.line))}else if(pe)if(G.tagClosed){if(Ne.trim().length>0)return pt("InvalidTag","Closing tag '"+J+"' can't have attributes or invalid starting.",Mt(y,F));if(P.length===0)return pt("InvalidTag","Closing tag '"+J+"' has not been opened.",Mt(y,F));{let ye=P.pop();if(J!==ye.tagName){let zt=Mt(y,ye.tagStartPos);return pt("InvalidTag","Expected closing tag '"+ye.tagName+"' (opened in line "+zt.line+", col "+zt.col+") instead of closing tag '"+J+"'.",Mt(y,F))}P.length==0&&(O=!0)}}else return pt("InvalidTag","Closing tag '"+J+"' doesn't have proper closing.",Mt(y,_));else{let ye=kd(Ne,R);if(ye!==!0)return pt(ye.err.code,ye.err.msg,Mt(y,_-Ne.length+ye.err.line));if(O===!0)return pt("InvalidXml","Multiple possible root nodes found.",Mt(y,_));R.unpairedTags.indexOf(J)!==-1||P.push({tagName:J,tagStartPos:F}),E=!0}for(_++;_<y.length;_++)if(y[_]==="<")if(y[_+1]==="!"){_++,_=Ad(y,_);continue}else if(y[_+1]==="?"){if(_=Pd(y,++_),_.err)return _}else break;else if(y[_]==="&"){let ye=QR(y,_);if(ye==-1)return pt("InvalidChar","char '&' is not expected.",Mt(y,_));_=ye}else if(O===!0&&!Td(y[_]))return pt("InvalidXml","Extra text at the end",Mt(y,_));y[_]==="<"&&_--}}else{if(Td(y[_]))continue;return pt("InvalidChar","char '"+y[_]+"' is not expected.",Mt(y,_))}if(E){if(P.length==1)return pt("InvalidTag","Unclosed tag '"+P[0].tagName+"'.",Mt(y,P[0].tagStartPos));if(P.length>0)return pt("InvalidXml","Invalid '"+JSON.stringify(P.map(_=>_.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return pt("InvalidXml","Start tag expected.",1);return!0}s(KR,"validate"),n(KR,"validate");function Td(y){return y===" "||y===" "||y===`
383
383
  `||y==="\r"}s(Td,"isWhiteSpace"),n(Td,"isWhiteSpace");function Pd(y,R){let P=R;for(;R<y.length;R++)if(y[R]=="?"||y[R]==" "){let E=y.substr(P,R-P);if(R>5&&E==="xml")return pt("InvalidXml","XML declaration allowed only at the start of the document.",Mt(y,R));if(y[R]=="?"&&y[R+1]==">"){R++;break}else continue}return R}s(Pd,"readPI"),n(Pd,"readPI");function Ad(y,R){if(y.length>R+5&&y[R+1]==="-"&&y[R+2]==="-"){for(R+=3;R<y.length;R++)if(y[R]==="-"&&y[R+1]==="-"&&y[R+2]===">"){R+=2;break}}else if(y.length>R+8&&y[R+1]==="D"&&y[R+2]==="O"&&y[R+3]==="C"&&y[R+4]==="T"&&y[R+5]==="Y"&&y[R+6]==="P"&&y[R+7]==="E"){let P=1;for(R+=8;R<y.length;R++)if(y[R]==="<")P++;else if(y[R]===">"&&(P--,P===0))break}else if(y.length>R+9&&y[R+1]==="["&&y[R+2]==="C"&&y[R+3]==="D"&&y[R+4]==="A"&&y[R+5]==="T"&&y[R+6]==="A"&&y[R+7]==="["){for(R+=8;R<y.length;R++)if(y[R]==="]"&&y[R+1]==="]"&&y[R+2]===">"){R+=2;break}}return R}s(Ad,"readCommentAndCDATA"),n(Ad,"readCommentAndCDATA");var oM='"',iM="'";function WR(y,R){let P="",E="",O=!1;for(;R<y.length;R++){if(y[R]===oM||y[R]===iM)E===""?E=y[R]:E!==y[R]||(E="");else if(y[R]===">"&&E===""){O=!0;break}P+=y[R]}return E!==""?!1:{value:P,index:R,tagClosed:O}}s(WR,"readAttributeStr"),n(WR,"readAttributeStr");var sM=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function kd(y,R){let P=p(y,sM),E={};for(let O=0;O<P.length;O++){if(P[O][1].length===0)return pt("InvalidAttr","Attribute '"+P[O][2]+"' has no space in starting.",_o(P[O]));if(P[O][3]!==void 0&&P[O][4]===void 0)return pt("InvalidAttr","Attribute '"+P[O][2]+"' is without value.",_o(P[O]));if(P[O][3]===void 0&&!R.allowBooleanAttributes)return pt("InvalidAttr","boolean attribute '"+P[O][2]+"' is not allowed.",_o(P[O]));let _=P[O][2];if(!XR(_))return pt("InvalidAttr","Attribute '"+_+"' is an invalid name.",_o(P[O]));if(!E.hasOwnProperty(_))E[_]=1;else return pt("InvalidAttr","Attribute '"+_+"' is repeated.",_o(P[O]))}return!0}s(kd,"validateAttributeString"),n(kd,"validateAttributeString");function YR(y,R){let P=/\d/;for(y[R]==="x"&&(R++,P=/[\da-fA-F]/);R<y.length;R++){if(y[R]===";")return R;if(!y[R].match(P))break}return-1}s(YR,"validateNumberAmpersand"),n(YR,"validateNumberAmpersand");function QR(y,R){if(R++,y[R]===";")return-1;if(y[R]==="#")return R++,YR(y,R);let P=0;for(;R<y.length;R++,P++)if(!(y[R].match(/\w/)&&P<20)){if(y[R]===";")break;return-1}return R}s(QR,"validateAmpersand"),n(QR,"validateAmpersand");function pt(y,R,P){return{err:{code:y,msg:R,line:P.line||P,col:P.col}}}s(pt,"getErrorObject"),n(pt,"getErrorObject");function XR(y){return m(y)}s(XR,"validateAttrName"),n(XR,"validateAttrName");function N(y){return m(y)}s(N,"validateTagName"),n(N,"validateTagName");function Mt(y,R){let P=y.substring(0,R).split(/\r?\n/);return{line:P.length,col:P[P.length-1].length+1}}s(Mt,"getLineNumberForPosition"),n(Mt,"getLineNumberForPosition");function _o(y){return y.startIndex+y[1].length}s(_o,"getPositionFromMatch"),n(_o,"getPositionFromMatch");var aM=class{static{s(this,"XMLParser")}static{n(this,"XMLParser")}constructor(y){this.externalEntities={},this.options=i(y)}parse(y,R){if(typeof y!="string"&&y.toString)y=y.toString();else if(typeof y!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(R){R===!0&&(R={});let O=KR(y,R);if(O!==!0)throw Error(`${O.err.msg}:${O.err.line}:${O.err.col}`)}let P=new Oe(this.options);P.addExternalEntities(this.externalEntities);let E=P.parseXml(y);return this.options.preserveOrder||E===void 0?E:GR(E,this.options)}addEntity(y,R){if(R.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(y.indexOf("&")!==-1||y.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(R==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[y]=R}static getMetaDataSymbol(){return f.getMetaDataSymbol()}};return new aM(t)},"getXmlParser");var ZR=class extends rr{static{s(this,"XmlToJsonOutboundPolicy")}static policyType="xml-to-json";parser;parseOnStatusCodes;constructor(e,n){super(e,n),Se(this.options,this.policyName).optional("removeNSPrefix","boolean").optional("ignoreProcessingInstructions","boolean").optional("ignoreDeclarations","boolean").optional("ignoreAttributes","boolean").optional("stopNodes","array").optional("attributeNamePrefix","string").optional("textNodeName","string").optional("trimValues","boolean"),this.parseOnStatusCodes=e.parseOnStatusCodes?qn(e.parseOnStatusCodes):void 0,this.parser=K0({removeNSPrefix:e?.removeNSPrefix??!0,ignorePiTags:e?.ignoreProcessingInstructions??!0,ignoreDeclaration:e?.ignoreDeclarations??!0,ignoreAttributes:e?.ignoreAttributes??!0,stopNodes:e?.stopNodes??[],attributeNamePrefix:e?.attributeNamePrefix??"@_",textNodeName:e?.textNodeName??"#text",trimValues:e?.trimValues??!0})}async handler(e,n,o){if(this.parseOnStatusCodes&&!this.parseOnStatusCodes.includes(e.status))return e;let r;try{let c=await e.text();r=this.parser.parse(c)}catch(c){let u=`XmlToJsonOutboundPolicy - Error parsing XML contents in policy '${this.policyName}'.`;throw o.log.error(u,c),new Z(u)}let i=new Headers(e.headers);return i.set("content-type","application/json"),new Response(JSON.stringify(r),{status:e.status,statusText:e.statusText,headers:i})}};var HR=class{static{s(this,"ServiceProviderImpl")}services=new Map;addService(e,n){if(this.services.get(e))throw new Pe(`A service with the name ${e} already exists -- you cannot have duplicate services`);this.services.set(e,n)}getService(e){return this.services.get(e)}};var FR=class{static{s(this,"ApiKeyConsumerClient")}bucketId;cacheDurationSeconds;cacheNamePromise;constructor(e){this.bucketId=e?.bucketId,this.cacheDurationSeconds=e?.cacheDurationSeconds??60}getCacheName(e){return this.cacheNamePromise||(this.cacheNamePromise=Me("zuplo-get-consumer",{bucketId:e})),this.cacheNamePromise}async get(e){B("utility.get-consumer");let n=io(),o=this.bucketId??ze.ZUPLO_SERVICE_BUCKET_ID;if(!o)throw new I("ApiKeyConsumerClient - no bucketId provided and no default bucket is configured for this environment. Pass `bucketId` explicitly (find it in the Zuplo portal under Settings > API Key Buckets).");if(!o.startsWith("bckt_"))throw new I(`ApiKeyConsumerClient - bucketId "${o}" is not a valid bucket id. Bucket ids start with "bckt_" (e.g. "bckt_2HaK3odRyJle6NJSu8mzNKBC30BYxllxL"); a bucket name (e.g. "zprj-...-working-copy") is not accepted here. Find the bucket id in the Zuplo portal under Settings > API Key Buckets.`);if(!e||e.trim()==="")throw new I("ApiKeyConsumerClient.get - consumerId is required and cannot be empty");let r=await this.getCacheName(o),i=new De(r,n);if(this.cacheDurationSeconds>0){let d=await i.get(e);if(d)return d}let a=`/v2/key-auth/${encodeURIComponent(o)}/consumers/${encodeURIComponent(e)}`,c=await Ud(a),u={id:c.id,name:c.name,createdOn:c.createdOn,updatedOn:c.updatedOn};return c.description!==void 0&&(u.description=c.description),c.metadata!==void 0&&(u.metadata=c.metadata),this.cacheDurationSeconds>0&&i.put(e,u,this.cacheDurationSeconds),u}};var W0=10,Y0=3e4,va=class{static{s(this,"BackgroundLoader")}#e=new Map;#t;#r;#n;#o;#i={};constructor(e,n){if(typeof n=="number"){let o=n;this.#r=o*1e3,this.#o=Y0,this.#n=W0}else{let o=n;this.#r=o.ttlSeconds*1e3,this.#o=o.loaderTimeoutSeconds?o.loaderTimeoutSeconds*1e3:Y0,this.#n=W0}this.#t=e}#s(e){return e.expiry<=new Date}#a(e){let n=this.#i[e];return!(n===void 0||n===0)}#u(e){let n=this.#e.get(e);if(n&&!this.#s(n))return n.data}async get(e){let n=this.#u(e);if(n)return this.#l(e),n;if(this.#a(e))try{await c6(()=>this.#u(e)!==void 0||!this.#a(e),this.#o+this.#n+1,this.#n);let o=this.#u(e);if(o)return o}catch{}return this.#c(e)}#l(e){if(!this.#a(e)){let n=this.#c(e);_r().waitUntil(n)}}async#c(e){try{this.#i[e]===void 0&&(this.#i[e]=0),this.#i[e]++;let n=await Promise.race([this.#t(e),scheduler.wait(this.#o)]);if(n===void 0)throw new I(`BackgroundLoader: Loader timed out after ${this.#o} ms.`);return this.#e.set(e,{data:n,expiry:new Date(Date.now()+this.#r)}),n}finally{this.#i[e]--}}};async function c6(t,e,n){let o=Date.now();for(;!t();){let r=Date.now()-o;if(r>e)throw new I(`BackgroundLoader: Timeout waiting for an on-going loader after ${r} ms.`);await scheduler.wait(n)}}s(c6,"waitUntilTrue");import{SpanStatusCode as Q0,trace as X0}from"@opentelemetry/api";var eM=s(async(t,e,n)=>{let o=je.instance.routeData.policies,r=Bo([t],o);if(r.length===0)throw new Z(`Invalid 'invokeInboundPolicy call' - no policy '${t}' found.`);let i=r[0];return await X0.getTracer("pipeline").startActiveSpan(`policy:${i.policyName}`,async u=>{try{Go(u,i);let d=await i.handler(e,n);if(d instanceof Request||d instanceof we||d instanceof Response)return d instanceof Response||d instanceof we?d:new we(d);{let p=new I(`Invalid state - invalid handler on policy '${i.policyName}' invoked via 'invokeInboundPolicy' on route '${n.route.path}'. The result of an inbound policy must be a Response or Request.`);throw u.setStatus({code:Q0.ERROR}),u.recordException(p),p}}finally{u.end()}})},"invokeInboundPolicy"),tM=s(async(t,e,n,o)=>{let r=je.instance.routeData.policies,i=us([t],r);if(i.length===0)throw new Z(`Invalid 'invokeOutboundPolicy call' - no policy '${t}' found.`);let a=i[0];return await X0.getTracer("pipeline").startActiveSpan(`policy:${a.policyName}`,async d=>{try{Go(d,a);let p=await a.handler(e,n,o);if(p instanceof Response)return p;{let m=new I(`Invalid state - invalid handler on policy '${a.policyName}' invoked via 'invokeOutboundPolicy' on route '${o.route.path}. The result of an outbound policy must be a Response.`);throw d.setStatus({code:Q0.ERROR}),d.recordException(m),m}}finally{d.end()}})},"invokeOutboundPolicy");function u6(t){let e={};if(!t)return e;try{let n=t.split(","),o={};return n.forEach(r=>{let[i,a]=r.split("=");i&&a&&(o[i.trim()]=a.trim())}),o.asnum&&(e[nc]=o.asnum),o.zip&&(e[rc]=o.zip.split("+")[0]),o.dma&&(e[oc]=o.dma),o.region_code&&(e[ic]=o.region_code),o.timezone&&(e[sc]=o.timezone),o.city&&(e[Ya]=o.city),o.continent&&(e[Qa]=o.continent),o.country_code&&(e[Xa]=o.country_code),o.long&&(e[ec]=o.long),o.lat&&(e[tc]=o.lat),e}catch{return{}}}s(u6,"parseEdgeScapeHeader");function nM(t,e){let n=u6(e);for(let[o,r]of Object.entries(n))t.has(o)||t.set(o,r)}s(nM,"setZpHeadersFromAkamaiEdgeScapeHeader");var Wc=class{static{s(this,"HeaderIncomingRequestProperties")}#e;constructor(e){this.#e=e;let n=e.get(ES);if(n){let o=new Headers(e);nM(o,n),this.#e=o}}get asn(){try{let e=this.#e.get(nc);if(typeof e=="string")return parseInt(e,10)}catch{}}get asOrganization(){return this.#e.get(CS)??void 0}get city(){return this.#e.get(aS)??this.#e.get(Ya)??void 0}get continent(){return this.#e.get(cS)??this.#e.get(Qa)??void 0}get country(){return this.#e.get(uS)??this.#e.get(Xa)??void 0}get latitude(){return this.#e.get(dS)??this.#e.get(tc)??void 0}get longitude(){return this.#e.get(lS)??this.#e.get(ec)??void 0}get colo(){return this.#e.get(TS)??void 0}get postalCode(){return this.#e.get(gS)??this.#e.get(rc)??void 0}get metroCode(){return this.#e.get(fS)??this.#e.get(oc)??void 0}get region(){return this.#e.get(pS)??this.#e.get(PS)??void 0}get regionCode(){return this.#e.get(mS)??this.#e.get(ic)??void 0}get timezone(){return this.#e.get(hS)??this.#e.get(sc)??void 0}get httpProtocol(){return this.#e.get(AS)??void 0}get clientCert(){return this.#e.get(yS)??void 0}get clientMtlsVerificationStatus(){return this.#e.get(bS)??void 0}get clientMtlsVerificationReason(){return this.#e.get(wS)??void 0}get clientCertFingerprintSha256(){return this.#e.get(vS)??void 0}get clientCertNotBefore(){return this.#e.get(RS)??void 0}get clientCertNotAfter(){return this.#e.get(SS)??void 0}get clientCertIssuerDn(){return this.#e.get(IS)??void 0}get clientCertSubjectDn(){return this.#e.get(xS)??void 0}toJSON(){return{asn:this.asn,asOrganization:this.asOrganization,city:this.city,continent:this.continent,country:this.country,latitude:this.latitude,longitude:this.longitude,colo:this.colo,postalCode:this.postalCode,metroCode:this.metroCode,region:this.region,regionCode:this.regionCode,timezone:this.timezone,httpProtocol:this.httpProtocol,clientCert:this.clientCert,clientMtlsVerificationStatus:this.clientMtlsVerificationStatus,clientMtlsVerificationReason:this.clientMtlsVerificationReason,clientCertFingerprintSha256:this.clientCertFingerprintSha256,clientCertNotBefore:this.clientCertNotBefore,clientCertNotAfter:this.clientCertNotAfter,clientCertIssuerDn:this.clientCertIssuerDn,clientCertSubjectDn:this.clientCertSubjectDn}}};function Zr(t){return{contextId:t.contextId,incomingRequestProperties:t.incomingRequestProperties,requestId:t.requestId,route:t.route,custom:t.custom,parentContext:t.parentContext,analyticsContext:t.analyticsContext}}s(Zr,"createRewriteContext");var ss=class extends Event{static{s(this,"ResponseSendingEvent")}constructor(e,n){super("responseSending"),this.request=e,this.mutableResponse=n}request;mutableResponse},as=class extends Event{static{s(this,"ResponseSentEvent")}constructor(e,n){super("responseSent"),this.request=e,this.response=n}request;response},it=class t{static{s(this,"ZuploContextExtensions")}static#e=new WeakMap;static initialize(e,n){if(!t.#e.has(e)){let o=new t(n);return t.#e.set(e,o),o}throw new Error(`ZuploContextExtensions already initialized for context with requestId '${e.requestId}'`)}static getContextExtensions(e){let n=t.#e.get(e);if(!n)throw new Z(`Invalid state, could not get ZuploContext extensions for context with requestId '${e.requestId}'`);return n}latestRequest;auditLogEventId="";#t;#r;#n;constructor(e){this.latestRequest=e,this.#t=[],this.#r=[],this.#n=[]}addResponseSendingHook(e){this.#r.push(e)}addResponseSendingFinalHook(e){this.#t.push(e)}addHandlerResponseHook(e){this.#n.push(e)}onResponseSendingFinal=s(async(e,n,o)=>{for(let r of this.#t)await r(e,n,o)},"onResponseSendingFinal");onResponseSending=s(async(e,n,o)=>{let r=e,i=T.instance.build.COMPATIBILITY_FLAGS.chainResponseSendingHooks;for(let a of this.#r)r=await a(i?r:e,n,o);return r},"onResponseSending");onHandlerResponse=s(async(e,n,o)=>{for(let r of this.#n)await r(e,n,o)},"onHandlerResponse")},Yc=class extends EventTarget{static{s(this,"SystemZuploContext")}constructor({logger:e,route:n,requestId:o,event:r,custom:i,incomingRequestProperties:a,parentContext:c}){super(),this.log=Object.freeze(e),this.route=n,this.requestId=o,this.custom=i,this.incomingRequestProperties=a,this.parentContext=c,this.#e=r,this.invokeInboundPolicy=(u,d)=>eM(u,d,this),this.contextId=crypto.randomUUID(),this.invokeOutboundPolicy=(u,d,p)=>tM(u,d,p,this),this.invokeRoute=async(u,d)=>{let p=u;typeof u=="string"&&u.startsWith("/")&&(p=new URL(u,"http://localhost"));let m=new we(p,d);return je.instance.handleRequest(m,this,{parentContext:this})},this.waitUntil=u=>{this.#e.waitUntil(u)},this.addResponseSendingHook=u=>{it.getContextExtensions(this).addResponseSendingHook(u)},this.addResponseSendingFinalHook=u=>{it.getContextExtensions(this).addResponseSendingFinalHook(u)},this.analyticsContext=new LS(o),Object.freeze(this)}#e;contextId;requestId;log;route;custom;incomingRequestProperties;parentContext;analyticsContext;invokeInboundPolicy;invokeOutboundPolicy;invokeRoute;waitUntil;addResponseSendingHook;addResponseSendingFinalHook;addEventListener(e,n,o){B("context.addEventListener");let r=s(i=>{try{typeof n=="function"?n(i):n.handleEvent(i)}catch(a){throw this.log.error(`Error invoking event ${e}. See following logs for details.`),a}},"wrapped");super.addEventListener(e,r,o)}removeEventListener(e,n,o){B("context.removeEventListener"),super.removeEventListener(e,n,o)}};export{dc as a,No as b,ht as c,wM as d,vM as e,Dd as f,ut as g,Kr as h,RM as i,Wr as j,B as k,Ud as l,jd as m,Qt as n,Tr as o,es as p,Yr as q,$ as r,mt as s,Qr as t,Zd as u,Hd as v,be as w,Gt as x,ce as y,rr as z,Wd as A,tp as B,BM as C,jo as D,ss as E,as as F,Op as G,tt as H,Gx as I,Bx as J,lD as K,Qx as L,Zp as M,wD as N,Hp as O,M as P,pz as Q,Ze as R,vt as S,Uz as T,$e as U,se as V,Nt as W,fe as X,rj as Y,xy as Z,l as _,Re as $,WP as aa,YP as ba,QP as ca,XP as da,eA as ea,tA as fa,nA as ga,iA as ha,Ky as ia,Yy as ja,Xy as ka,nb as la,ob as ma,sb as na,cb as oa,lb as pa,mb as qa,hb as ra,wb as sa,Sb as ta,xb as ua,Cb as va,ha as wa,ya as xa,ba as ya,Eb as za,Ra as Aa,$b as Ba,Mb as Ca,lZ as Da,Lb as Ea,Nb as Fa,wA as Ga,vA as Ha,RA as Ia,jb as Ja,Hb as Ka,Bb as La,NA as Ma,jA as Na,qA as Oa,KA as Pa,WA as Qa,YA as Ra,QA as Sa,rk as Ta,ok as Ua,aw as Va,ak as Wa,zl as Xa,f1 as Ya,cw as Za,Dt as _a,gk as $a,mw as ab,fw as bb,bk as cb,yw as db,vk as eb,Rk as fb,Sk as gb,Ik as hb,xk as ib,Ck as jb,_k as kb,Lk as lb,Cw as mb,Uk as nb,zk as ob,jk as pb,Yk as qb,Qk as rb,Xk as sb,eE as tb,iE as ub,lE as vb,dE as wb,Jl as xb,AH as yb,gE as zb,yE as Ab,bE as Bb,Gr as Cb,Di as Db,Ge as Eb,at as Fb,Yn as Gb,GIe as Hb,Oa as Ib,KIe as Jb,WIe as Kb,pn as Lb,XIe as Mb,exe as Nb,txe as Ob,nxe as Pb,$a as Qb,rxe as Rb,Co as Sb,cxe as Tb,Ql as Ub,To as Vb,zi as Wb,ov as Xb,vxe as Yb,iv as Zb,sv as _b,av as $b,cv as ac,uv as bc,lv as cc,dv as dc,pv as ec,mv as fc,fv as gc,gv as hc,vTe as ic,xn as jc,mn as kc,u_ as lc,id as mc,jF as nc,rd as oc,m_ as pc,pB as qc,yv as rc,ft as sc,M_ as tc,AB as uc,kB as vc,Cv as wc,QTe as xc,XTe as yc,ePe as zc,J_ as Ac,K_ as Bc,SPe as Cc,IPe as Dc,Tv as Ec,ja as Fc,ud as Gc,xPe as Hc,Q_ as Ic,APe as Jc,qa as Kc,KB as Lc,WB as Mc,Av as Nc,DPe as Oc,nO as Pc,rO as Qc,qPe as Rc,ZPe as Sc,HPe as Tc,FPe as Uc,oO as Vc,iO as Wc,aO as Xc,Qn as Yc,Ir as Zc,XB as _c,e2 as $c,QPe as ad,XPe as bd,eAe as cd,tAe as dd,Xn as ed,o2 as fd,mAe as gd,lO as hd,xAe as id,Ov as jd,s2 as kd,f2 as ld,h2 as md,mO as nd,zAe as od,jAe as pd,qAe as qd,yO as rd,GAe as sd,BAe as td,VAe as ud,Uv as vd,md as wd,zv as xd,nke as yd,rke as zd,oke as Ad,ike as Bd,m$ as Cd,Pn as Dd,Xv as Ed,Dke as Fd,f$ as Gd,Uke as Hd,rR as Id,oR as Jd,w$ as Kd,X4 as Ld,x$ as Md,lR as Nd,M$ as Od,pR as Pd,H$ as Qd,mR as Rd,gR as Sd,G$ as Td,B$ as Ud,V$ as Vd,bR as Wd,vR as Xd,e0 as Yd,t0 as Zd,n0 as _d,r0 as $d,o0 as ae,s0 as be,IR as ce,vV as de,d0 as ee,PR as fe,y0 as ge,b0 as he,w0 as ie,$V as je,v0 as ke,R0 as le,S0 as me,I0 as ne,x0 as oe,_R as pe,T0 as qe,P0 as re,OR as se,$R as te,E0 as ue,O0 as ve,$0 as we,NR as xe,L0 as ye,q0 as ze,jR as Ae,Z0 as Be,J0 as Ce,ZR as De,HR as Ee,FR as Fe,va as Ge};
384
- /*! For license information please see chunk-OAVAM6CR.js.LEGAL.txt */
385
- //# sourceMappingURL=chunk-OAVAM6CR.js.map
384
+ /*! For license information please see chunk-JPPAUB3E.js.LEGAL.txt */
385
+ //# sourceMappingURL=chunk-JPPAUB3E.js.map