apitestcenter 0.18.1 → 0.18.3

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 (108) hide show
  1. package/dist/THIRD-PARTY-NOTICES-UI.txt +11 -11
  2. package/dist/THIRD-PARTY-NOTICES.txt +6 -6
  3. package/dist/cli.mjs +600 -593
  4. package/dist/ui/404/index.html +1 -1
  5. package/dist/ui/404.html +1 -1
  6. package/dist/ui/__next.__PAGE__.txt +32 -21
  7. package/dist/ui/__next._full.txt +29 -18
  8. package/dist/ui/__next._tree.txt +5 -4
  9. package/dist/ui/_next/static/chunks/0-zga2d528cxt.js +50 -0
  10. package/dist/ui/_next/static/chunks/03ligbvtk7nsc.js +123 -0
  11. package/dist/ui/_next/static/chunks/03y58w9gmwqc-.js +50 -0
  12. package/dist/ui/_next/static/chunks/08rlo-0gnct9m.js +50 -0
  13. package/dist/ui/_next/static/chunks/0bgmfb8f3pd8e.js +1 -0
  14. package/dist/ui/_next/static/chunks/0g9k0swrer6i5.js +1 -0
  15. package/dist/ui/_next/static/chunks/0q8iq_7i4ohjr.js +50 -0
  16. package/dist/ui/_next/static/chunks/1-t79a3q7gmjn.js +31 -0
  17. package/dist/ui/_next/static/chunks/12whdxhkvkd-y.js +1 -0
  18. package/dist/ui/_next/static/chunks/14dtemzsvcfmn.js +50 -0
  19. package/dist/ui/_next/static/chunks/1snbdq1z951ks.js +906 -0
  20. package/dist/ui/_next/static/chunks/20j4wusnbtqa2.js +4 -0
  21. package/dist/ui/_next/static/chunks/243c1-49gb3pr.js +1 -0
  22. package/dist/ui/_next/static/chunks/{109szqnizl8c5.css → 2sjog4to0fmbb.css} +3 -3
  23. package/dist/ui/_next/static/chunks/2sr5dm3__ghgo.js +27 -0
  24. package/dist/ui/_next/static/chunks/2su0ql-zu4q0_.js +3 -0
  25. package/dist/ui/_next/static/chunks/3-rdixjnndtyk.js +51 -0
  26. package/dist/ui/_next/static/chunks/32_tmz8ibsdo3.js +22 -0
  27. package/dist/ui/_next/static/chunks/3eti_s9gpiis0.js +2 -0
  28. package/dist/ui/_next/static/chunks/3wtqdtu331_vc.js +50 -0
  29. package/dist/ui/_next/static/chunks/3wzu1zkfqdmn6.js +2 -0
  30. package/dist/ui/_next/static/chunks/turbopack-3-ry682tkyiqk.js +1 -0
  31. package/dist/ui/_not-found/__next._full.txt +25 -17
  32. package/dist/ui/_not-found/__next._not-found.__PAGE__.txt +28 -20
  33. package/dist/ui/_not-found/__next._tree.txt +4 -2
  34. package/dist/ui/_not-found/index.html +1 -1
  35. package/dist/ui/_not-found/index.txt +25 -17
  36. package/dist/ui/compare/__next._full.txt +32 -20
  37. package/dist/ui/compare/__next._tree.txt +6 -4
  38. package/dist/ui/compare/__next.compare.__PAGE__.txt +36 -24
  39. package/dist/ui/compare/index.html +1 -1
  40. package/dist/ui/compare/index.txt +32 -20
  41. package/dist/ui/connections/__next._full.txt +30 -20
  42. package/dist/ui/connections/__next._tree.txt +6 -4
  43. package/dist/ui/connections/__next.connections.__PAGE__.txt +34 -24
  44. package/dist/ui/connections/index.html +2 -2
  45. package/dist/ui/connections/index.txt +30 -20
  46. package/dist/ui/history/__next._full.txt +35 -23
  47. package/dist/ui/history/__next._tree.txt +6 -4
  48. package/dist/ui/history/__next.history.__PAGE__.txt +39 -27
  49. package/dist/ui/history/index.html +1 -1
  50. package/dist/ui/history/index.txt +35 -23
  51. package/dist/ui/home/__next._full.txt +32 -20
  52. package/dist/ui/home/__next._tree.txt +6 -4
  53. package/dist/ui/home/__next.home.__PAGE__.txt +36 -24
  54. package/dist/ui/home/index.html +1 -1
  55. package/dist/ui/home/index.txt +32 -20
  56. package/dist/ui/index.html +1 -1
  57. package/dist/ui/index.txt +29 -18
  58. package/dist/ui/preview/__next._full.txt +33 -23
  59. package/dist/ui/preview/__next._tree.txt +6 -4
  60. package/dist/ui/preview/__next.preview.__PAGE__.txt +37 -27
  61. package/dist/ui/preview/index.html +1 -1
  62. package/dist/ui/preview/index.txt +33 -23
  63. package/dist/ui/suite/__next._full.txt +29 -20
  64. package/dist/ui/suite/__next._tree.txt +6 -4
  65. package/dist/ui/suite/__next.suite.__PAGE__.txt +33 -24
  66. package/dist/ui/suite/index.html +1 -1
  67. package/dist/ui/suite/index.txt +29 -20
  68. package/dist/ui/tests/__next._full.txt +28 -20
  69. package/dist/ui/tests/__next._tree.txt +6 -4
  70. package/dist/ui/tests/__next.tests.__PAGE__.txt +32 -24
  71. package/dist/ui/tests/index.html +1 -1
  72. package/dist/ui/tests/index.txt +28 -20
  73. package/package.json +1 -1
  74. package/dist/ui/_next/static/chunks/01sqehfan_2j_.js +0 -1
  75. package/dist/ui/_next/static/chunks/036rg3itpc5ge.js +0 -50
  76. package/dist/ui/_next/static/chunks/0e8f1i6w6dqos.js +0 -50
  77. package/dist/ui/_next/static/chunks/0hvubzjy33qo9.js +0 -2
  78. package/dist/ui/_next/static/chunks/0ktc3lx37s0t5.js +0 -4
  79. package/dist/ui/_next/static/chunks/0wrod6xlhsv0m.js +0 -3
  80. package/dist/ui/_next/static/chunks/1-d6f0jo8p7jc.js +0 -913
  81. package/dist/ui/_next/static/chunks/15pu58j0qz9i8.js +0 -31
  82. package/dist/ui/_next/static/chunks/1af6jzcoirzrb.js +0 -27
  83. package/dist/ui/_next/static/chunks/1apjslkz52j1a.js +0 -22
  84. package/dist/ui/_next/static/chunks/1pz4ugabfd0qn.js +0 -1
  85. package/dist/ui/_next/static/chunks/1t823xy7gguwx.js +0 -1
  86. package/dist/ui/_next/static/chunks/23_x0u07xh89v.js +0 -123
  87. package/dist/ui/_next/static/chunks/2aifruy-vhchn.js +0 -50
  88. package/dist/ui/_next/static/chunks/2t65s4y0z2a60.js +0 -50
  89. package/dist/ui/_next/static/chunks/33kvaxr7qvnue.js +0 -50
  90. package/dist/ui/_next/static/chunks/366zannfx6qet.js +0 -1
  91. package/dist/ui/_next/static/chunks/36wzwezwmtzq7.js +0 -51
  92. package/dist/ui/_next/static/chunks/3n2xlaj16gyb-.js +0 -2
  93. package/dist/ui/_next/static/chunks/3vso5wrs90xx-.js +0 -50
  94. package/dist/ui/_next/static/chunks/turbopack-2qka98q_-4ca1.js +0 -1
  95. /package/dist/ui/_next/static/{-I9ZGWDULRW2FcJsZc5oY → lomhkNrlljr9WxdUu6_Mc}/_buildManifest.js +0 -0
  96. /package/dist/ui/_next/static/{-I9ZGWDULRW2FcJsZc5oY → lomhkNrlljr9WxdUu6_Mc}/_clientMiddlewareManifest.js +0 -0
  97. /package/dist/ui/_next/static/{-I9ZGWDULRW2FcJsZc5oY → lomhkNrlljr9WxdUu6_Mc}/_ssgManifest.js +0 -0
  98. /package/dist/ui/_next/static/media/{8a480f0b521d4e75-s.1qq4vpdcun5oj.woff2 → 07935285219a259d-s.1qq4vpdcun5oj.woff2} +0 -0
  99. /package/dist/ui/_next/static/media/{797e433ab948586e-s.p.0r6juujl39pe6.woff2 → 07a39a8a4660cc7c-s.p.0r6juujl39pe6.woff2} +0 -0
  100. /package/dist/ui/_next/static/media/{bbc41e54d2fcbd21-s.1rgnod-3esatf.woff2 → 2a04751c893bf294-s.1rgnod-3esatf.woff2} +0 -0
  101. /package/dist/ui/_next/static/media/{6306c77e7c8268e4-s.2dbetqa9o8jxf.woff2 → 2bb852295097cd96-s.2dbetqa9o8jxf.woff2} +0 -0
  102. /package/dist/ui/_next/static/media/{fef07dbb0973bf53-s.3p2_lha1f2xer.woff2 → 4f6667dd39116621-s.3p2_lha1f2xer.woff2} +0 -0
  103. /package/dist/ui/_next/static/media/{caa3a2e1cccd8315-s.p.0wgildi0cnwt9.woff2 → 605ce01b664af129-s.p.0wgildi0cnwt9.woff2} +0 -0
  104. /package/dist/ui/_next/static/media/{4fa387ec64143e14-s.2tuy5pz7dlieh.woff2 → 6e342921ee4dcd9d-s.2tuy5pz7dlieh.woff2} +0 -0
  105. /package/dist/ui/_next/static/media/{7178b3e590c64307-s.21jp631_3pja2.woff2 → 77814b00d5ca94a4-s.21jp631_3pja2.woff2} +0 -0
  106. /package/dist/ui/_next/static/media/{7d817b4c03b0c5f1-s.1uyisp29ctx0d.woff2 → 9eb5a876700c0028-s.1uyisp29ctx0d.woff2} +0 -0
  107. /package/dist/ui/_next/static/media/{5ce348bf30bf5439-s.31988l_ccedte.woff2 → b0c6b664fd57c2c6-s.31988l_ccedte.woff2} +0 -0
  108. /package/dist/ui/_next/static/media/{53b9e256198e5412-s.390ncx5urfkfu.woff2 → f58031ded4338640-s.390ncx5urfkfu.woff2} +0 -0
@@ -0,0 +1,906 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[22543,e=>{var t=e.i(72587),r=e.i(55218),n=e.i(90484),s=e.i(14865);e.s(["f",0,function({text:e,label:i="More information"}){let a=(0,r.useRef)(null),o=(0,r.useRef)(null),[l,u]=(0,r.useState)(!1),[c,p]=(0,r.useState)(!1),[d,h]=(0,r.useState)(null),f=l||c;return(0,r.useLayoutEffect)(()=>{if(!f)return h(null);let e=()=>{if(!a.current)return;let e=(0,s.C)(a.current),t=(0,s.v)(),r=Math.min(256,t.width-32),n=o.current?.offsetHeight??80,i=Math.min(Math.max(16,e.left),t.width-r-16);h({top:e.bottom+6+n<=t.height-8?e.bottom+6:Math.max(8,e.top-6-n),left:i})};e();let t=requestAnimationFrame(e);return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{cancelAnimationFrame(t),window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[f]),(0,r.useEffect)(()=>{if(!l)return;let e=e=>{let t=e.target;a.current?.contains(t)||o.current?.contains(t)||u(!1)},t=e=>{"Escape"===e.key&&u(!1)};return document.addEventListener("pointerdown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t)}},[l]),(0,t.jsxs)("span",{ref:a,className:"relative inline-flex align-middle",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[(0,t.jsx)("button",{type:"button",className:"grid h-4 w-4 place-items-center rounded-full border border-line text-[11px] leading-none text-mute hover:border-accent hover:text-accent","aria-label":i,"aria-expanded":f,onClick:e=>{e.stopPropagation(),u(e=>!e)},onFocus:()=>p(!0),onBlur:()=>p(!1),children:"?"}),f&&"u">typeof document?(0,n.createPortal)((0,t.jsx)("span",{ref:o,role:"tooltip",style:{width:"min(256px, calc(100vw - 2rem))",top:d?.top??-9999,left:d?.left??-9999},className:"fixed z-[80] rounded-md border border-line bg-panel-2 px-2.5 py-2 text-xs leading-5 font-normal tracking-normal text-ink normal-case shadow-lg",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:e}),document.body):null]})}])},39170,e=>{var t=e.i(72587),r=e.i(53012),n=e.i(55218);let s=(0,n.createContext)(async()=>!1);function i({options:e,onClose:s}){let a=(0,n.useRef)(null),o=(0,n.useRef)(null),l=(0,n.useRef)(null),u="danger"===e.tone;return(0,n.useEffect)(()=>{let e=document.activeElement;return(u?o:l).current?.focus(),()=>e?.focus()},[u]),(0,t.jsx)("div",{className:"fixed inset-0 z-[95] grid place-items-center bg-black/50 p-4 backdrop-blur-sm",onMouseDown:e=>{e.target===e.currentTarget&&s(!1)},children:(0,t.jsxs)("div",{ref:a,role:"alertdialog","aria-modal":"true","aria-labelledby":"confirm-title",onKeyDown:function(e){if("Escape"===e.key&&(e.stopPropagation(),s(!1)),"Tab"===e.key){let t=a.current?.querySelectorAll("button");if(!t||0===t.length)return;let r=t[0],n=t[t.length-1];e.shiftKey&&document.activeElement===r?(e.preventDefault(),n.focus()):e.shiftKey||document.activeElement!==n||(e.preventDefault(),r.focus())}},className:"w-full max-w-md rounded-xl border border-line bg-panel p-5 shadow-2xl",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[u?(0,t.jsx)("span",{className:"mt-0.5 grid h-8 w-8 shrink-0 place-items-center rounded-full bg-warn/15 text-warn",children:(0,t.jsx)(r.f,{size:16})}):null,(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h2",{id:"confirm-title",className:"text-base font-medium text-ink",children:e.title}),e.body?(0,t.jsx)("div",{className:"mt-2 text-sm text-mute",children:e.body}):null]})]}),(0,t.jsxs)("div",{className:"mt-5 flex justify-end gap-2",children:[(0,t.jsx)("button",{ref:o,type:"button",className:"btn btn-secondary",onClick:()=>s(!1),children:e.cancelLabel??"Cancel"}),(0,t.jsx)("button",{ref:l,type:"button",className:"btn btn-primary",onClick:()=>s(!0),children:e.confirmLabel??"Continue"})]})]})})}e.s(["a",0,function({children:e}){let[r,a]=(0,n.useState)(null),o=(0,n.useCallback)(e=>new Promise(t=>a({...e,resolve:t})),[]);return(0,t.jsxs)(s.Provider,{value:o,children:[e,r?(0,t.jsx)(i,{options:r,onClose:function(e){r?.resolve(e),a(null)}}):null]})},"L",0,function(){return(0,n.useContext)(s)}])},28867,e=>{var t=e.i(72587);e.s(["f",0,function({value:e,options:r,onChange:n,label:s,size:i="sm"}){return(0,t.jsx)("div",{role:"group","aria-label":s,className:"inline-flex flex-wrap rounded-md border border-line bg-panel-2 p-0.5",children:r.map(r=>{let s=r.value===e;return(0,t.jsx)("button",{type:"button","aria-pressed":s,title:r.title,onClick:()=>n(r.value),className:`rounded px-2.5 ${"md"===i?"py-1.5 text-sm":"py-1 text-xs"} transition-colors ${s?"bg-panel text-ink shadow-sm":"text-mute hover:text-ink"}`,children:r.label},r.value)})})}])},56396,e=>{var t=e.i(72587),r=e.i(17118),n=e.i(42967),s=e.i(87283),i=e.i(27122),a=e.i(55218);let o=(0,a.createContext)(()=>{}),l=1;e.s(["N",0,function({children:e}){let[u,c]=(0,a.useState)([]),p=(0,a.useCallback)(e=>c(t=>t.filter(t=>t.id!==e)),[]),d=(0,a.useCallback)((e,t="info")=>{let r=l++;c(n=>[...n.slice(-3),{id:r,tone:t,message:e}]),window.setTimeout(()=>p(r),"error"===t?6e3:3200)},[p]);return(0,t.jsxs)(o.Provider,{value:d,children:[e,(0,t.jsx)("div",{"aria-live":"polite",className:"pointer-events-none fixed right-4 bottom-4 z-50 flex w-[min(24rem,calc(100vw-2rem))] flex-col gap-2",children:u.map(e=>{let a="success"===e.tone?r.f:"error"===e.tone?i.f:n.f,o="success"===e.tone?"text-ok":"error"===e.tone?"text-bad":"text-accent";return(0,t.jsxs)("div",{role:"error"===e.tone?"alert":"status",className:"pointer-events-auto flex items-start gap-2 rounded-lg border border-line bg-panel px-3 py-2.5 text-sm text-ink shadow-xl",children:[(0,t.jsx)(a,{size:16,className:`mt-0.5 shrink-0 ${o}`}),(0,t.jsx)("span",{className:"min-w-0 flex-1",children:e.message}),(0,t.jsx)("button",{type:"button","aria-label":"Dismiss",className:"shrink-0 rounded p-0.5 text-mute hover:text-ink",onClick:()=>p(e.id),children:(0,t.jsx)(s.X,{size:14})})]},e.id)})})]})},"d",0,function(){return(0,a.useContext)(o)}])},44505,e=>{e.s(["f",0,function(){return window.atcDesktop??null}])},15060,e=>{function t(e,t){let r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download=e,document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(r),6e4)}e.s(["h",0,t,"N",0,function(e,r,n){t(e,new Blob([r],{type:n}))}])},19656,e=>{e.s(["L",0,function(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(2)} MB`},"B",0,function(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})},"W",0,function(e){return new Intl.NumberFormat("en-US").format(Math.round(e))},"M",0,function(e,t){let r=Math.max(0,Math.round((Date.parse(t)-Date.parse(e))/1e3));if(r<60)return`${r}s`;let n=Math.floor(r/60),s=r%60;return s?`${n}m ${s}s`:`${n}m`},"E",0,function(e){return Number.isFinite(e)?e<10?`${e.toFixed(1)} ms`:`${Math.round(e)} ms`:"—"},"Z",0,function(e){return`${(100*e).toFixed(e<.01?2:1)}%`},"m",0,function(e){return Number.isFinite(e)?e>=1e3?`${(e/1e3).toFixed(2)}k`:e.toFixed(e>=100?0:1):"—"}])},59180,e=>{var t=e.i(72587),r=e.i(55218);async function n(e){let t=await e.text(),r=null;try{r=t?JSON.parse(t):null}catch{}if(!e.ok)throw Error(r?.error??`Engine error (${e.status})`);return r}let s=(e,t)=>fetch(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),i={index:()=>fetch("/engine/history",{cache:"no-store"}).then(e=>n(e)),run:e=>fetch(`/engine/history/runs/${encodeURIComponent(e)}`,{cache:"no-store"}).then(e=>n(e)),compare:e=>fetch(`/engine/history/compares/${encodeURIComponent(e)}`,{cache:"no-store"}).then(e=>n(e)),updateRun:(e,t)=>fetch(`/engine/history/runs/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}).then(e=>n(e)),updateCompare:(e,t)=>fetch(`/engine/history/compares/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}).then(e=>n(e)),remove:e=>s("/engine/history/delete",e).then(e=>n(e)),saveCompare:e=>s("/engine/history/compares",e).then(e=>n(e)),import:e=>s("/engine/history/import",e).then(e=>n(e)),reveal:e=>s("/engine/history/reveal",e??{}).then(e=>n(e))},a=(0,r.createContext)({index:null,error:null,loading:!0,refresh:async()=>null,baselineFor:()=>void 0}),o="apitestcenter-history-migrated";async function l(){try{if(localStorage.getItem(o))return;let e=JSON.parse(sessionStorage.getItem("apitestcenter-session-runs")??"[]"),t=JSON.parse(sessionStorage.getItem("apitestcenter-compare-history")??"[]");for(let t of Array.isArray(e)?e:[])await i.import({report:t}).catch(()=>void 0);for(let e of Array.isArray(t)?t:[])e?.apis&&!(e.apis.length<2)&&await i.import({kind:"compare",mode:"parallel"===e.mode?"parallel":"sequence",apis:e.apis,meta:{name:e.title}}).catch(()=>void 0);sessionStorage.removeItem("apitestcenter-session-runs"),sessionStorage.removeItem("apitestcenter-compare-history"),localStorage.setItem(o,new Date().toISOString())}catch{}}e.s(["w",0,function({children:e}){let[n,s]=(0,r.useState)(null),[o,u]=(0,r.useState)(null),[c,p]=(0,r.useState)(!0),d=(0,r.useRef)(null),h=(0,r.useCallback)(()=>{if(d.current)return d.current;let e=i.index().then(e=>(s(e),u(null),e)).catch(e=>(u(e instanceof Error?e.message:"History unavailable"),null)).finally(()=>{p(!1),d.current=null});return d.current=e,e},[]);(0,r.useEffect)(()=>{l().finally(()=>void h());let e=()=>void h();return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[h]);let f=(0,r.useMemo)(()=>{let e=new Map;for(let t of n?.runs??[])t.baseline&&e.set(t.endpoint,t);return{index:n,error:o,loading:c,refresh:h,baselineFor:t=>e.get(t)}},[n,o,c,h]);return(0,t.jsx)(a.Provider,{value:f,children:e})},"c",0,i,"K",0,function(){return(0,r.useContext)(a)}])},14865,e=>{var t=e.i(72587),r=e.i(55218);let n=[.8,.9,1,1.1,1.25,1.4,1.6],s="apitestcenter-zoom",i="apitestcenter-density",a="apitestcenter-layout",o=(0,r.createContext)({zoom:1,zoomIn:()=>{},zoomOut:()=>{},resetZoom:()=>{},density:"comfortable",setDensity:()=>{},layout:"beside",setLayout:()=>{}});function l(e){try{return localStorage.getItem(e)}catch{return null}}function u(e,t){try{localStorage.setItem(e,t)}catch{}}e.s(["c",0,function({children:e}){let[c,p]=(0,r.useState)(1),[d,h]=(0,r.useState)("comfortable"),[f,m]=(0,r.useState)("beside");(0,r.useEffect)(()=>{let e=Number(l(s));n.includes(e)&&p(e),"compact"===l(i)&&h("compact"),"below"===l(a)&&m("below")},[]),(0,r.useEffect)(()=>{document.documentElement.style.setProperty("--zoom",String(c)),document.documentElement.style.zoom=1===c?"":String(c)},[c]),(0,r.useEffect)(()=>{document.documentElement.dataset.density=d},[d]);let y=(0,r.useCallback)(e=>{p(t=>{let r=n.findIndex(e=>e>=t-.001),i=n[Math.min(n.length-1,Math.max(0,(r<0?2:r)+e))];return u(s,String(i)),i})},[]),g=(0,r.useCallback)(()=>{p(1),u(s,"1")},[]),b=(0,r.useCallback)(e=>{h(e),u(i,e)},[]),v=(0,r.useCallback)(e=>{m(e),u(a,e)},[]);(0,r.useEffect)(()=>{let e=e=>{if((e.ctrlKey||e.metaKey)&&!e.altKey){if("="===e.key||"+"===e.key)y(1);else if("-"===e.key||"_"===e.key)y(-1);else{if("0"!==e.key)return;g()}e.preventDefault()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[y,g]);let w=(0,r.useMemo)(()=>({zoom:c,zoomIn:()=>y(1),zoomOut:()=>y(-1),resetZoom:g,density:d,setDensity:b,layout:f,setLayout:v}),[c,y,g,d,b,f,v]);return(0,t.jsx)(o.Provider,{value:w,children:e})},"C",0,function(e){let t=Number(document.documentElement.style.zoom)||1,r=e.getBoundingClientRect();return{top:r.top/t,left:r.left/t,bottom:r.bottom/t,right:r.right/t,width:r.width/t,height:r.height/t}},"v",0,function(){let e=Number(document.documentElement.style.zoom)||1;return{width:window.innerWidth/e,height:window.innerHeight/e}},"x",0,()=>(0,r.useContext)(o)])},99522,e=>{var t=e.i(55218);let r=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)},n=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();var s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,t.forwardRef)(({color:e="currentColor",size:r=24,strokeWidth:i=2,absoluteStrokeWidth:a,className:o="",children:l,iconNode:u,...c},p)=>(0,t.createElement)("svg",{ref:p,...s,width:r,height:r,stroke:e,strokeWidth:a?24*Number(i)/Number(r):i,className:n("lucide",o),...!l&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(c)&&{"aria-hidden":"true"},...c},[...u.map(([e,r])=>(0,t.createElement)(e,r)),...Array.isArray(l)?l:[l]]));e.s(["f",0,(e,s)=>{let a=(0,t.forwardRef)(({className:a,...o},l)=>(0,t.createElement)(i,{ref:l,iconNode:s,className:n(`lucide-${r(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,a),...o}));return a.displayName=r(e),a}],99522)},1675,e=>{let t=(0,e.i(99522).f)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["f",0,t],1675)},95486,e=>{let t=(0,e.i(99522).f)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["f",0,t],95486)},95754,e=>{let t=(0,e.i(99522).f)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["f",0,t])},17118,e=>{var t=e.i(95754);e.s(["f",()=>t.f])},27122,e=>{let t=(0,e.i(99522).f)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["f",0,t],27122)},89932,e=>{let t=(0,e.i(99522).f)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["f",0,t],89932)},75117,e=>{let t=(0,e.i(99522).f)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["f",0,t],75117)},67938,e=>{let t=(0,e.i(99522).f)("file-up",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]);e.s(["f",0,t],67938)},42967,e=>{let t=(0,e.i(99522).f)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["f",0,t],42967)},27813,e=>{let t=(0,e.i(99522).f)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["f",0,t],27813)},95987,e=>{let t=(0,e.i(99522).f)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);e.s(["f",0,t],95987)},71189,e=>{let t=(0,e.i(99522).f)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["f",0,t],71189)},43514,e=>{let t=(0,e.i(99522).f)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);e.s(["f",0,t],43514)},53012,30844,e=>{let t=(0,e.i(99522).f)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["f",0,t],30844),e.s(["f",0,t],53012)},87283,e=>{let t=(0,e.i(99522).f)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],87283)},24856,86483,70632,15487,59100,99112,75606,64478,89662,36163,78451,5305,25949,90372,47253,48191,2385,94122,54608,55658,46306,60617,81609,88491,94713,19166,30340,54185,e=>{let t,r,n,s,i,a,o,l,u,c,p;e.s(["BIGINT_FORMAT_RANGES",()=>ew,"CONSTANT_CATCH",()=>e6,"Class",()=>eG,"NUMBER_FORMAT_RANGES",()=>ev,"aborted",()=>eM,"allowsEval",()=>ea,"assert",()=>I,"assertEqual",()=>O,"assertIs",()=>j,"assertNever",()=>N,"assertNotEqual",()=>E,"assignProp",()=>Z,"attachSchema",()=>ez,"base64ToUint8Array",()=>eK,"base64urlToUint8Array",()=>eJ,"cached",()=>R,"captureStackTrace",()=>es,"cleanEnum",()=>eB,"cleanRegex",()=>U,"clone",()=>ef,"cloneDef",()=>Y,"codePointLength",()=>eL,"constantCatch",()=>e4,"createTransparentProxy",()=>ey,"defineLazy",()=>B,"defineLazyInternal",()=>e5,"derived",()=>e0,"esc",()=>er,"escapeRegex",()=>eh,"explicitlyAborted",()=>ej,"extend",()=>eS,"finalizeIssue",()=>eC,"floatSafeRemainder",()=>F,"getElementAtPath",()=>Q,"getEnumValues",()=>q,"getLengthableOrigin",()=>eU,"getParsedType",()=>ec,"getSizableOrigin",()=>eP,"hexToUint8Array",()=>eV,"hide",()=>eQ,"installLazyProp",()=>e9,"isObject",()=>ei,"isPlainObject",()=>eo,"issue",()=>eD,"joinValues",()=>z,"jsonStringifyReplacer",()=>C,"members",()=>eX,"merge",()=>eT,"mergeDefs",()=>X,"normalizeParams",()=>em,"nullish",()=>L,"numKeys",()=>eu,"objectClone",()=>K,"omit",()=>e$,"optionalKeys",()=>eb,"own",()=>eY,"parsedType",()=>eF,"partial",()=>eO,"pick",()=>ek,"prefixIssues",()=>eN,"primitiveTypes",()=>ed,"promiseAllObject",()=>ee,"propertyKeyTypes",()=>ep,"randomString",()=>et,"rawShape",()=>J,"required",()=>eE,"safeExtend",()=>eA,"shallowClone",()=>el,"sizeCaps",()=>eq,"slugify",()=>en,"stringifyPrimitive",()=>eg,"toZod",()=>M,"uint8ArrayToBase64",()=>eZ,"uint8ArrayToBase64url",()=>eH,"uint8ArrayToHex",()=>eW,"unwrapMessage",()=>eI],22210),e.s(["_",()=>lv,"j",()=>lT,"n",()=>lx],25949),e.s(["y",()=>pO,"g",()=>pE,"w",()=>pI],90372),Date.parse("2026-08-20T10:00:00.000Z");let d=["p50","p90","p95","p99","p999","max"],h={p50:"Typical (p50)",p90:"Most requests (p90)",p95:"95% of requests (p95)",p99:"Slowest 1% (p99)",p999:"Slowest 0.1% (p99.9)",max:"Slowest (max)"},f=["throughput","peakRps","p95","p50","avg","p99","max","ttfb","errors","checks","vus","requests","dropped","apdex","data","sent","duration"],m={throughput:"Requests per second",p95:"Response time",p99:"Slowest 1%",errors:"Failed requests",vus:"Simulated users",requests:"Total requests",dropped:"Requests not sent",apdex:"User satisfaction",data:"Data received",peakRps:"Peak requests per second",p50:"Typical response time",avg:"Average response time",max:"Slowest response",ttfb:"Server time",checks:"Checks passing",sent:"Data sent",duration:"Test length"},y={throughput:"throughput · RPS",p95:"p95 latency",p99:"p99 latency",errors:"error rate",vus:"VUs",requests:"HTTP requests",dropped:"dropped iterations",apdex:"Apdex",data:"bytes in",peakRps:"max throughput",p50:"p50 · median",avg:"mean latency",max:"max latency",ttfb:"TTFB average",checks:"check pass rate",sent:"bytes out",duration:"run duration"},g=["ttfb","connect","tls","blocked"],b={kpis:{id:"kpis",autoHeight:!0,label:"Key numbers",description:"The headline numbers — speed, response time, failures, users. Pick which ones.",group:"Summary",kinds:["stat","table"],size:{w:12,h:3},min:{w:3,h:3},compare:!0,defaults:{kpis:["throughput","p95","errors","vus","requests"]}},number:{id:"number",autoHeight:!0,label:"Single number",description:"One number, big — place and size it anywhere. Shows the change against your reference run.",group:"Summary",kinds:["stat"],size:{w:3,h:3},min:{w:2,h:2},compare:!0,defaults:{kpis:["p95"]}},heading:{id:"heading",autoHeight:!0,bare:!0,label:"Section heading",description:"A title that groups the widgets under it — like “Speed” or “Reliability”.",group:"Layout",kinds:["panel"],size:{w:12,h:2},min:{w:3,h:1},compare:!0,defaults:{note:""}},verdict:{id:"verdict",autoHeight:!0,label:"Result",tech:"verdict",description:"Pass / warn / fail in plain words, with the reasons.",group:"Summary",kinds:["panel"],size:{w:12,h:3},min:{w:4,h:2},compare:!0},apdex:{id:"apdex",autoHeight:!0,label:"User satisfaction score",tech:"Apdex",description:"0–1 user-satisfaction score from response times against your p95 target (or 500 ms).",group:"Summary",kinds:["stat"],size:{w:3,h:4},min:{w:2,h:3},compare:!0,recent:!0},latency:{id:"latency",label:"Response time",tech:"latency percentiles",description:"Percentiles per second. Pick which percentiles to draw.",group:"Over time",kinds:["line","area"],size:{w:6,h:8},min:{w:3,h:5},compare:!0,defaults:{percentiles:["p50","p95","p99"],showTarget:!0}},throughput:{id:"throughput",label:"Requests per second",tech:"throughput",description:"Requests per second, with the target rate in rate mode.",group:"Over time",kinds:["line","area","bar"],size:{w:6,h:8},min:{w:3,h:5},compare:!0,defaults:{showTarget:!0}},vus:{id:"vus",label:"Simulated users",tech:"VUs",description:"How many simulated users were sending requests at each moment.",group:"Over time",kinds:["area","line"],size:{w:6,h:6},min:{w:3,h:4},compare:!0},errors:{id:"errors",label:"Failed requests",tech:"error rate",description:"Share of failed requests per second.",group:"Over time",kinds:["line","area","bar"],size:{w:6,h:6},min:{w:3,h:4},compare:!0,defaults:{showTarget:!0}},status:{id:"status",label:"Responses by outcome",tech:"HTTP status",description:"Responses per second by outcome: 2xx, 4xx, 5xx, network failures.",group:"Over time",kinds:["stacked-area","stacked-bar"],size:{w:6,h:8},min:{w:3,h:5},compare:!1},data:{id:"data",label:"Data transfer",tech:"bytes in / out",description:"Bytes received and sent per second.",group:"Over time",kinds:["line","area"],size:{w:6,h:6},min:{w:3,h:4},compare:!0},serverTime:{id:"serverTime",label:"Server and connection time",tech:"TTFB · TCP · TLS",description:"Average server time (TTFB), connect, TLS, and wait time per second.",group:"Over time",kinds:["line","area"],size:{w:6,h:8},min:{w:3,h:5},compare:!0,recent:!0,defaults:{phases:["ttfb","connect","tls"]}},checksRate:{id:"checksRate",label:"Checks passing",tech:"check pass rate",description:"Share of checks passing each second.",group:"Correctness",kinds:["line","area","bar"],size:{w:6,h:6},min:{w:3,h:4},compare:!0,recent:!0},dropped:{id:"dropped",label:"Requests not sent",tech:"dropped iterations",description:"Requests a rate-mode run could not start each second.",group:"Over time",kinds:["bar","line"],size:{w:6,h:6},min:{w:3,h:4},compare:!0,recent:!0},histogram:{id:"histogram",label:"Response time spread",tech:"latency histogram",description:"How many requests fell into each response-time band.",group:"Distribution",kinds:["histogram"],size:{w:6,h:8},min:{w:3,h:5},compare:!0,recent:!0},heatmap:{id:"heatmap",label:"Response time over time, by speed",tech:"latency heatmap",description:"Response-time bands over time; darker = more requests. Shows bimodal or drifting latency.",group:"Distribution",kinds:["heatmap"],size:{w:12,h:8},min:{w:4,h:5},compare:!1,recent:!0},percentiles:{id:"percentiles",label:"Response time distribution",tech:"min · p50 · p95 · p99 · max",description:"min, p50, p90, p95, p99, max over the whole run.",group:"Distribution",kinds:["ladder","table","bar"],size:{w:6,h:7},min:{w:3,h:4},compare:!0},phases:{id:"phases",autoHeight:!0,label:"Where the time went",tech:"timing phases",description:"Average split of each request: DNS, connect, TLS, server, download.",group:"Distribution",kinds:["breakdown","table"],size:{w:6,h:7},min:{w:3,h:4},compare:!0},concurrency:{id:"concurrency",label:"Load vs response time",tech:"VUs or RPS vs p95",description:"Each second as a dot: load against response time. Where the dots bend upward is the point the API starts to struggle.",group:"Distribution",kinds:["scatter"],size:{w:6,h:8},min:{w:3,h:5},compare:!0},targets:{id:"targets",autoHeight:!0,label:"Pass/fail goals",tech:"thresholds and checks",description:"Each target met or missed, and each check's pass rate.",group:"Correctness",kinds:["panel"],size:{w:6,h:7},min:{w:3,h:4},compare:!1},statusTable:{id:"statusTable",autoHeight:!0,label:"Response codes",tech:"HTTP status codes",description:"Count of every HTTP status code returned.",group:"Details",kinds:["table","bar"],size:{w:4,h:6},min:{w:3,h:4},compare:!0},config:{id:"config",autoHeight:!0,label:"Test settings",tech:"run configuration",description:"Method, URL, auth type, load shape, times, bytes.",group:"Details",kinds:["panel"],size:{w:12,h:5},min:{w:4,h:3},compare:!1}},v=Object.keys(b);function w(e,t,r,n,s={}){let i=b[t];return{id:e,metric:t,kind:i.kinds[0],x:r,y:n,w:i.size.w,h:i.size.h,options:i.defaults,...s}}let k=[{id:"builtin-overview",name:"Overview",scope:"run",builtIn:!0,widgets:[w("kpis","kpis",0,0),w("verdict","verdict",0,3),w("latency","latency",0,6),w("throughput","throughput",6,6),w("status","status",0,14),w("percentiles","percentiles",6,14,{h:8}),w("phases","phases",0,22),w("targets","targets",6,22),w("config","config",0,29)]},{id:"builtin-developer",name:"Developer",scope:"run",builtIn:!0,widgets:[w("latency","latency",0,0,{w:12,options:{percentiles:["p50","p90","p95","p99","max"],showTarget:!0}}),w("server","serverTime",0,8),w("phases","phases",6,8,{h:8}),w("histogram","histogram",0,16),w("status","status",6,16),w("heatmap","heatmap",0,24),w("targets","targets",0,32),w("codes","statusTable",6,32,{w:6,h:7})]},{id:"builtin-capacity",name:"Capacity",scope:"run",builtIn:!0,widgets:[w("kpis","kpis",0,0,{options:{kpis:["throughput","p95","errors","vus","dropped"]}}),w("concurrency","concurrency",0,3),w("throughput","throughput",6,3),w("latency","latency",0,11,{options:{percentiles:["p95","p99"],showTarget:!0}}),w("vus","vus",6,11,{h:8}),w("errors","errors",0,19),w("dropped","dropped",6,19)]},{id:"builtin-executive",name:"Executive",scope:"run",builtIn:!0,widgets:[w("verdict","verdict",0,0),w("kpis","kpis",0,3,{w:9,options:{kpis:["p95","errors","throughput","requests"]}}),w("apdex","apdex",9,3,{h:3}),w("latency","latency",0,6,{options:{percentiles:["p95"],showTarget:!0}}),w("targets","targets",6,6,{h:8})]},{id:"builtin-topics",name:"By topic",scope:"run",builtIn:!0,widgets:[w("verdict","verdict",0,0),w("h-speed","heading",0,3,{title:"Speed",options:{note:"How fast the API answers"}}),w("n-p95","number",0,5,{options:{kpis:["p95"]}}),w("n-p50","number",3,5,{options:{kpis:["p50"]}}),w("n-max","number",6,5,{options:{kpis:["max"]}}),w("n-ttfb","number",9,5,{options:{kpis:["ttfb"]}}),w("latency","latency",0,8,{options:{percentiles:["p50","p95","p99"],showTarget:!0}}),w("percentiles","percentiles",6,8),w("h-rel","heading",0,18,{title:"Reliability",options:{note:"Did it answer correctly, every time?"}}),w("n-errors","number",0,20,{options:{kpis:["errors"]}}),w("n-checks","number",3,20,{options:{kpis:["checks"]}}),w("status","status",6,20,{w:6}),w("targets","targets",0,23,{w:6}),w("h-load","heading",0,33,{title:"Load",options:{note:"How much traffic it handled"}}),w("n-rps","number",0,35,{options:{kpis:["throughput"]}}),w("n-peak","number",3,35,{options:{kpis:["peakRps"]}}),w("n-vus","number",6,35,{options:{kpis:["vus"]}}),w("n-total","number",9,35,{options:{kpis:["requests"]}}),w("throughput","throughput",0,38),w("concurrency","concurrency",6,38)]},{id:"builtin-compare",name:"Compare overview",scope:"compare",builtIn:!0,widgets:[w("kpis","kpis",0,0,{kind:"table",h:6,options:{kpis:["throughput","p95","p99","errors","requests"]}}),w("verdict","verdict",0,6,{h:7}),w("latency","latency",0,13,{options:{percentiles:["p95"],showTarget:!0}}),w("throughput","throughput",6,13),w("errors","errors",0,21,{h:7}),w("vus","vus",6,21,{h:7}),w("phases","phases",0,28,{w:12,kind:"table"})]}];function x(e){return k.find(t=>t.scope===e)}let $=(e,t,r)=>Math.min(r,Math.max(t,Math.round(e)));function S(e){if(!e||"object"!=typeof e||"string"!=typeof e.id||!e.id||"string"!=typeof e.name)return null;let t="compare"===e.scope?"compare":"run",r=new Set,n=[];for(let s of Array.isArray(e.widgets)?e.widgets:[]){let e=b[s.metric];if(!e||"compare"===t&&!e.compare)continue;let i="string"==typeof s.id&&s.id?s.id:`${e.id}-${n.length}`;for(;r.has(i);)i=`${i}-x`;r.add(i);let a=e.kinds.includes(s.kind)?s.kind:e.kinds[0],o=$(s.w??e.size.w,e.min.w,12);n.push({id:i,metric:e.id,kind:a,title:"string"==typeof s.title&&s.title.trim()?s.title.trim().slice(0,80):void 0,options:function(e,t){let r=t&&"object"==typeof t?t:{},n=(e,t,r)=>{let n=Array.isArray(e)?e.filter(e=>t.includes(e)):[];return n.length?n:r},s={};if(e.defaults?.percentiles&&(s.percentiles=n(r.percentiles,d,e.defaults.percentiles)),e.defaults?.kpis){let t=[...new Set(n(r.kpis,f,e.defaults.kpis))];s.kpis="number"===e.id?t.slice(0,1):t}return e.defaults?.note!==void 0&&(s.note="string"==typeof r.note?r.note.slice(0,200):""),e.defaults?.phases&&(s.phases=n(r.phases,g,e.defaults.phases)),e.defaults?.showTarget!==void 0&&(s.showTarget=r.showTarget??e.defaults.showTarget),Object.keys(s).length?s:void 0}(e,s.options),x:$(s.x??0,0,12-o),y:$(s.y??0,0,1e4),w:o,h:$(s.h??e.size.h,e.min.h,40)})}return{id:e.id,name:e.name.trim().slice(0,60)||"Untitled view",scope:t,builtIn:!0===e.builtIn,widgets:n}}function _(e){return e.title?e.title:"number"===e.metric?m[e.options?.kpis?.[0]??"p95"]:b[e.metric].label}function A(e){if(!e.title)return"number"===e.metric?y[e.options?.kpis?.[0]??"p95"]:b[e.metric].tech}function T(e){return[...e].sort((e,t)=>e.y-t.y||e.x-t.x)}function O(e){return e}function E(e){return e}function M(){return e=>e}function j(e){}function N(e){throw Error("Unexpected value in exhaustive check")}function I(e){}function q(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function z(e,t="|"){return e.map(e=>eg(e)).join(t)}function C(e,t){return"bigint"==typeof t?t.toString():t}e.s(["W",0,k,"Z",0,{line:"Line",area:"Area",bar:"Bars","stacked-area":"Stacked area","stacked-bar":"Stacked bars",stat:"Numbers",table:"Table",histogram:"Histogram",heatmap:"Heatmap",ladder:"Percentile ladder",breakdown:"Breakdown bar",scatter:"Scatter",panel:"Panel"},"c",0,12,"B",0,36,"f",0,f,"O",0,m,"t",0,y,"U",0,b,"r",0,d,"T",0,h,"E",0,g,"J",0,{ttfb:"Server time (TTFB)",connect:"TCP connect",tls:"TLS handshake",blocked:"Waiting for a connection"},"g",0,x,"s",0,function(e){let t={latency:"latency",throughput:"throughput",status:"status",phases:"phase",percentiles:"percentiles",targets:"thresholds"},r=[];for(let n of T(e.widgets)){let e=t[n.metric];!e||r.some(t=>t.id===e)||r.push({id:e,w:n.w>=9?2:1,h:n.h>=12?2:1})}return r},"x",0,function(e){return v.map(e=>b[e]).filter(t=>"run"===e||t.compare)},"A",0,function(e,t,r){let n=T(e),s=n.findIndex(e=>e.id===t);if(s<0)return e;if("first"===r||"last"===r){let e=n[s],i=n.filter(e=>e.id!==t);if("first"===r)return[{...e,x:0,y:0},...i.map(t=>({...t,y:t.y+e.h}))];let a=i.reduce((e,t)=>Math.max(e,t.y+t.h),0);return[...i,{...e,x:0,y:a}]}let i="earlier"===r?s-1:s+1;if(i<0||i>=n.length)return e;let a=n[s],o=n[i];return e.map(e=>e.id===a.id?{...e,x:Math.min(o.x,12-e.w),y:o.y}:e.id===o.id?{...e,x:Math.min(a.x,12-e.w),y:a.y}:e)},"V",0,function(e,t){let r=b[e],n=t.reduce((e,t)=>Math.max(e,t.y+t.h),0),s=t.length+1,i=new Set(t.map(e=>e.id));for(;i.has(`${e}-${s}`);)s++;return{id:`${e}-${s}`,metric:e,kind:r.kinds[0],title:"heading"===e?"New section":void 0,x:0,y:n,w:r.size.w,h:r.size.h,options:r.defaults}},"R",0,S,"e",0,function(e){let t=e&&"object"==typeof e?e:{},r=(Array.isArray(t.views)?t.views:[]).map(S).filter(e=>!!e&&!e.builtIn&&!e.id.startsWith("builtin-")),n=[...k,...r],s=(e,t)=>"string"==typeof t&&n.some(r=>r.id===t&&r.scope===e)?t:x(e).id;return{version:1,defaults:{run:s("run",t.defaults?.run),compare:s("compare",t.defaults?.compare)},views:r}},"F",0,T,"u",0,function(e,t,r,n){return e.map(e=>{if(e.id!==t)return e;let s=b[e.metric],i=$(e.w+r,s.min.w,12);return{...e,w:i,h:$(e.h+n,s.min.h,40),x:Math.min(e.x,12-i)}})},"X",0,A,"L",0,_],86483);class P{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return void 0!==e&&(this._value=e(),this._getter=void 0),this._value}}function R(e){return new P(e)}function L(e){return null==e}function U(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function F(e,t){let r=e/t,n=Math.round(r),s=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<s?0:r-n}let D=Symbol("evaluating");function B(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==D)return void 0===n&&(n=D,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function K(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Z(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function J(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function H(e){return J(e._zod.def)??e._zod.def.shape}function V(e,t,r){Object.defineProperty(e,t,{get(){let e=r();return Z(this,t,e),e},enumerable:!0,configurable:!0})}function W(e,t,r){t in e?Z(e,t,r):e[t]=r}function G(e,t,r,n){let s=H(t);for(let i of r){let r=Object.getOwnPropertyDescriptor(s,i);r.enumerable&&(r.get?V(e,i,()=>{let e=t._zod.def.shape[i];return n?n(e,i):e}):W(e,i,n?n(r.value,i):r.value))}}function X(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}function Y(e){return X(e._zod.def)}function Q(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function ee(e){let t=Object.keys(e);return Promise.all(t.map(t=>e[t])).then(e=>{let r={};for(let n=0;n<t.length;n++)r[t[n]]=e[n];return r})}function et(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function er(e){return JSON.stringify(e)}function en(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}let es="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ei(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let ea=R(()=>{if(tr.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function eo(e){if(!1===ei(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==ei(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function el(e){return eo(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function eu(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}let ec=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return"promise";if("u">typeof Map&&e instanceof Map)return"map";if("u">typeof Set&&e instanceof Set)return"set";if("u">typeof Date&&e instanceof Date)return"date";if("u">typeof File&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},ep=new Set(["string","number","symbol"]),ed=new Set(["string","number","bigint","boolean","symbol","undefined"]);function eh(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ef(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function em(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function ey(e){let t;return new Proxy({},{get:(r,n,s)=>(t??(t=e()),Reflect.get(t,n,s)),set:(r,n,s,i)=>(t??(t=e()),Reflect.set(t,n,s,i)),has:(r,n)=>(t??(t=e()),Reflect.has(t,n)),deleteProperty:(r,n)=>(t??(t=e()),Reflect.deleteProperty(t,n)),ownKeys:r=>(t??(t=e()),Reflect.ownKeys(t)),getOwnPropertyDescriptor:(r,n)=>(t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)),defineProperty:(r,n,s)=>(t??(t=e()),Reflect.defineProperty(t,n,s))})}function eg(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}function eb(e){return Object.keys(e).filter(t=>void 0!==e[t]._zod.optin&&"optional"===e[t]._zod.optout)}let ev={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ew={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ek(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let s={};return G(s,e,ex(e,t)),ef(e,X(r,{shape:s,checks:[]}))}function ex(e,t){let r=H(e),n=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&n.push(e)}return n}function e$(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(ex(e,t)),i={};return G(i,e,Reflect.ownKeys(H(e)).filter(e=>!s.has(e))),ef(e,X(r,{shape:i,checks:[]}))}function eS(e,t){if(!eo(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let r=H(e);for(let e of Reflect.ownKeys(t))if(void 0!==Object.getOwnPropertyDescriptor(r,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ef(e,X(e._zod.def,{shape:e_(e,t)}))}function e_(e,t){let r={};G(r,e,Reflect.ownKeys(H(e)));for(let e of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,e);n.enumerable&&(n.get?V(r,e,()=>t[e]):W(r,e,n.value))}return r}function eA(e,t){if(!eo(t))throw Error("Invalid input to safeExtend: expected a plain object");return ef(e,X(e._zod.def,{shape:e_(e,t)}))}function eT(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};G(r,e,Reflect.ownKeys(H(e))),G(r,t,Reflect.ownKeys(H(t)));let n=X(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ef(e,n)}function eO(e,t,r,n="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw Error(`.${n}() cannot be used on object schemas containing refinements`);let i=r?new Set(ex(t,r)):void 0,a={};return G(a,t,Reflect.ownKeys(H(t)),e&&((t,r)=>i&&!i.has(r)?t:new e({type:"optional",innerType:t}))),ef(t,X(t._zod.def,{shape:a,checks:[]}))}function eE(e,t,r){let n=r?new Set(ex(t,r)):void 0,s={};return G(s,t,Reflect.ownKeys(H(t)),(t,r)=>n&&!n.has(r)?t:new e({type:"nonoptional",innerType:t})),ef(t,X(t._zod.def,{shape:s}))}function eM(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function ej(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function eN(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function eI(e){return"string"==typeof e?e:e?.message}function eq(e){let t=[];for(let r of e??[]){let e=r._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let n=e.maximum??e.length??e.size;n>=0&&t.push([n,r])}return t}function ez(e,t,r){var n;for(let s=t;s<e.length;s++)(n=e[s]).schema??(n.schema=r)}function eC(e,t,r){let n=e.inst?._zod?.traits;n?.has("$ZodType")&&(n.has("$ZodCheck")?e.schema??(e.schema=e.inst):e.schema=e.inst);let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:eI(e.inst?._zod.def?.error?.(e))??eI(s?.(e))??eI(t?.error?.(e))??eI(r.customError?.(e))??eI(r.localeError?.(e))??"Invalid input",a={};for(let t of Object.keys(e))"inst"!==t&&"schema"!==t&&"continue"!==t&&"input"!==t&&"__proto__"!==t&&(a[t]=e[t]);return a.path??(a.path=[]),a.message=i,t?.reportInput&&(a.input=e.input),a}function eP(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}let eR=/[\uD800-\uDBFF]/;function eL(e){let t=e.length;if(!eR.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(64512&e.charCodeAt(n))==55296&&(64512&e.charCodeAt(n+1))==56320&&(r--,n++);return r}function eU(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function eF(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":if(null===e)return"null";if(Array.isArray(e))return"array";if(e&&Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&e.constructor)return e.constructor.name}return t}function eD(...e){let[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}function eB(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function eK(e){let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}function eZ(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function eJ(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return eK(t+r)}function eH(e){return eZ(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function eV(e){let t=e.replace(/^0x/,"");if(t.length%2!=0)throw Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)r[e/2]=Number.parseInt(t.slice(e,e+2),16);return r}function eW(e){return Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("")}class eG{constructor(...e){}}function eX(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:!1}):function(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:eY(this,t,r.bind(this))},set(e){eY(this,t,e)}})}(e,r,n.value)}}function eY(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function eQ(e,t,r){return eY(e,t,r,!1)}function e0(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return eY(this,r,n(this))},set(e){eY(this,r,e)}})}return t}let e1=!1,e2={configurable:!0,get(){e1=!0}};function e5(e,r,n){let s=Object.getPrototypeOf(e._zod);if(r in s&&t!==e._zod){t=void 0;return}t=e._zod,Object.defineProperty(s,r,{configurable:!0,get(){Object.defineProperty(this,r,e2);let e=e1;e1=!1;try{let t=n(this);return e1?delete this[r]:Object.defineProperty(this,r,{configurable:!0,writable:!0,value:t}),e1=e1||e,t}catch(t){throw delete this[r],e1=e1||e,t}},set(e){Object.defineProperty(this,r,{configurable:!0,writable:!0,value:e})}})}function e9(e,t,r,n){let s,i=t in(s=Object.getPrototypeOf(e))?void 0:s;i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,e),e.value=r(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:e})}})}let e6="~constantCatch";function e4(e){let t=()=>e;return t[e6]=!0,t}let e3={value:void 0,enumerable:!1},e8="captureStackTrace"in Error?Error:null;function e7(e,t,r,n){function s(e){this.def=e,this.constr=u,this.traits=new Set}s.prototype={};let i=r&&new WeakSet;function a(n,a){if(n._zod){if(n._zod.traits.has(e))return}else{e3.value=new s(a);try{Object.defineProperty(n,"_zod",e3)}finally{e3.value=void 0}}if(n._zod.traits.add(e),t(n,a),i){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,s=e;for(;s&&s!==t;)s=Object.getPrototypeOf(s);let a=s??e;i.has(a)||(i.add(a),eX(a,r))}let o=u.prototype;for(let e in o)Object.prototype.hasOwnProperty.call(o,e)&&(e in n||(n[e]=o[e].bind(n)))}let o=n?.Parent??Object;class l extends o{}function u(e){let t=n?.Parent?function(e){let t=e8;if(t){let r=t.stackTraceLimit;if("number"==typeof r){try{t.stackTraceLimit=0}catch{return e8=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}(l):this;a(t,e);let r=t._zod.deferred;if(r){for(let e of r)e();t._zod.deferred=void 0}let s=globalThis.__zod_globalConfig?.postProcessor;return s&&s(t),t}return Object.defineProperty(l,"name",{value:e}),Object.defineProperty(u,"init",{value:a}),Object.defineProperty(u,Symbol.hasInstance,{value:t=>!!n?.Parent&&t instanceof n.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}class te extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class tt extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(sb=globalThis).__zod_globalConfig??(sb.__zod_globalConfig={});let tr=globalThis.__zod_globalConfig;function tn(e){return e&&Object.assign(tr,e),tr}class ts extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}let ti="~memo",ta=[];function to(e){return null!==e&&"object"==typeof e}function tl(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let tu=new WeakMap,tc=[],tp={alloc(e,t,n){let s=r;if(!s)return n;r=void 0;let i={value:n,issues:null};return s.set(t.value,i),tc.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,r=(e,r)=>{var n,s;let i;if("backward"!==r.direction&&(n=r,s=e.value,void 0!==(i=n[ti]?.backEdges)&&to(s)&&i.has(s)))throw new ts;return t(e,r)};e._zod.parse=r,e._zod.run===t&&(e._zod.run=r)})},attach(e){var t;let n,s,i,a=!1;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(l,u)=>{let c;if(void 0===n){let r=function e(t,r,n){var s,i;let a=tu.get(t);if(void 0!==a)return 2*!!a;if(r.has(t))return 2;r.add(t);let o=0,l=t=>{if(2!==o&&t?._zod){let s=e(t,r,n);s>o&&(o=s)}},u=e=>{e>o&&(o=e)},c=t._zod.def;switch(c.type){case"object":{let t=J(c);u(t?((t,s)=>{let i=0;for(let a of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,a);if(s&&!o.enumerable)continue;let l=o.get?1:o.value?._zod?e(o.value,r,n):0;l>i&&(i=l)}return i})(t,!0):1),l(c.catchall);break}case"array":l(c.element);break;case"tuple":for(let e of c.items)l(e);l(c.rest);break;case"record":case"map":l(c.keyType),l(c.valueType);break;case"set":l(c.valueType);break;case"union":for(let e of c.options)l(e);break;case"intersection":l(c.left),l(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":l(c.innerType);break;case"pipe":l(c.in),l(c.out);break;case"function":l(c.input),l(c.output);break;case"lazy":{let s=c._cachedInner??(n?t._zod.innerType:void 0);u(s?e(s,r,!1):1);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let r=t.value;if(r&&"object"==typeof r){if(r._zod)l(r);else if(Array.isArray(r))for(let e of r)l(e)}}}return r.delete(t),s=t,1!==(i=o)&&tu.set(s,2===i),i}(e,new Set,!1);if(0===r)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(l,u);2===r||a?n=!0:a=!0}let p=l.value;if(!to(p))return t(l,u);let d=u[ti];if(d||(d={buckets:new WeakMap,backEdges:void 0},u[ti]=d),s===u)c=i;else{var h;let t;(t=(h=d).buckets.get(e))||(t=new WeakMap,h.buckets.set(e,t)),c=t,s=u,i=c}let f=c.get(p);if(f)return l.value=f.value,f.issues?f.issues.length&&l.issues.push(...tl(f.issues)):(l.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(f.value)),l;r=c;let m=tc.length,y=t(l,u);r=void 0;let g=tc.length>m?tc.pop():void 0;return y instanceof Promise?y.then(e=>(g&&(g.issues=e.issues.length?tl(e.issues):ta),e)):(g&&(g.issues=y.issues.length?tl(y.issues):ta),y)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};(sv=globalThis).__zod_globalRegistry??(sv.__zod_globalRegistry=new class e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];return this._map.set(e,r),r&&"object"==typeof r&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});let td=globalThis.__zod_globalRegistry,th=/^[cC][0-9a-z]{6,}$/,tf=/^[0-9a-z]+$/,tm=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,ty=/^[0-9a-vA-V]{20}$/,tg=/^[A-Za-z0-9]{27}$/,tb=/^[a-zA-Z0-9_-]{21}$/;function tv(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}let tw=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,tk=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,tx=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,t$=tx(4),tS=tx(6),t_=tx(7),tA=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,tT=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u;function tO(){return RegExp("^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$","u")}let tE=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,tM=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,tj=e=>{let t=eh(e??":");return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},tN=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,tI=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tq=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,tz=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,tC=/^https?$/,tP=/^\+[1-9]\d{6,14}$/,tR=/^\d(?:[ -]?\d){11,18}$/,tL=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,tU="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",tF=RegExp(`^${tU}$`);function tD(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function tB(e){return RegExp(`^${tD(e)}$`)}function tK(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${tD({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${tD({precision:e.precision})}`:r;return RegExp(`^${tU}T(?:${n})$`)}let tZ=/^[\s\S]{0,}$/,tJ=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},tH=/^-?\d+n?$/,tV=/^-?\d+$/,tW=/^-?\d+(?:\.\d+)?$/,tG=/^(?:true|false)$/i,tX=/^null$/i,tY=/^undefined$/i,tQ=/^[^A-Z]*$/,t0=/^[^a-z]*$/;function t1(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function t2(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}let t5=t1(22,"=="),t9=t2(22),t6=t1(27,"="),t4=t2(27),t3=t1(43,"="),t8=t2(43),t7=t1(64,""),re=t2(64),rt=t1(86,"=="),rr=t2(86);e.s(["anyString",0,tZ,"base64",0,tq,"base64url",0,tz,"bigint",0,tH,"boolean",0,tG,"browserEmail",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"cidrv4",0,tN,"cidrv6",0,tI,"creditCard",0,tR,"cuid",0,th,"cuid2",0,tf,"currencyCode",0,/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,"date",0,tF,"datetime",0,tK,"domain",0,/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,"duration",0,tw,"e164",0,tP,"email",0,tA,"emoji",0,tO,"extendedDuration",0,/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,"guid",0,tk,"hex",0,/^[0-9a-fA-F]*$/,"hostname",0,/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,"html5Email",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"httpProtocol",0,tC,"iban",0,tL,"idnEmail",0,tT,"integer",0,tV,"ipv4",0,tE,"ipv6",0,tM,"ksuid",0,tg,"lowercase",0,tQ,"mac",0,tj,"md5_base64",0,t5,"md5_base64url",0,t9,"md5_hex",0,/^[0-9a-fA-F]{32}$/,"nanoid",0,tb,"nanoidOfLength",0,tv,"null",0,tX,"number",0,tW,"rfc5322Email",0,/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,"sha1_base64",0,t6,"sha1_base64url",0,t4,"sha1_hex",0,/^[0-9a-fA-F]{40}$/,"sha256_base64",0,t3,"sha256_base64url",0,t8,"sha256_hex",0,/^[0-9a-fA-F]{64}$/,"sha384_base64",0,t7,"sha384_base64url",0,re,"sha384_hex",0,/^[0-9a-fA-F]{96}$/,"sha512_base64",0,rt,"sha512_base64url",0,rr,"sha512_hex",0,/^[0-9a-fA-F]{128}$/,"string",0,tJ,"time",0,tB,"ulid",0,tm,"undefined",0,tY,"unicodeEmail",0,tT,"uppercase",0,t0,"uuid",0,tx,"uuid4",0,t$,"uuid6",0,tS,"uuid7",0,t_,"xid",0,ty],79692);let rn=e7("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),rs=e=>{let t=e.value;return!L(t)&&void 0!==t.size},ri=e=>{let t=e.value;return!L(t)&&void 0!==t.length},ra={number:"number",bigint:"bigint",object:"date"},ro=e7("$ZodCheckLessThan",(e,t)=>{rn.init(e,t);let r=ra[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:ra[typeof n.value]??r,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),rl=e7("$ZodCheckGreaterThan",(e,t)=>{rn.init(e,t);let r=ra[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:ra[typeof n.value]??r,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ru=e7("$ZodCheckMultipleOf",(e,t)=>{rn.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):0===F(r.value,t.value))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),rc=e7("$ZodCheckNumberFormat",(e,t)=>{rn.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[s,i]=ev[t.format];e._zod.check=a=>{let o=a.value;if(r){if(!Number.isInteger(o))return void a.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:o,inst:e});if(!Number.isSafeInteger(o))return void(o>0?a.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):a.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}))}o<s&&a.issues.push({origin:"number",input:o,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),o>i&&a.issues.push({origin:"number",input:o,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),rp=e7("$ZodCheckBigIntFormat",(e,t)=>{rn.init(e,t);let[r,n]=ew[t.format];e._zod.check=s=>{let i=s.value;i<r&&s.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>n&&s.issues.push({origin:"bigint",input:i,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),rd=e7("$ZodCheckMaxSize",(e,t)=>{var r;rn.init(e,t),(r=e._zod.def).when??(r.when=rs),e._zod.check=r=>{let n=r.value;n.size<=t.maximum||r.issues.push({origin:eP(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),rh=e7("$ZodCheckMinSize",(e,t)=>{var r;rn.init(e,t),(r=e._zod.def).when??(r.when=rs),e._zod.check=r=>{let n=r.value;n.size>=t.minimum||r.issues.push({origin:eP(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),rf=e7("$ZodCheckSizeEquals",(e,t)=>{var r;rn.init(e,t),(r=e._zod.def).when??(r.when=rs),e._zod.check=r=>{let n=r.value,s=n.size;if(s===t.size)return;let i=s>t.size;r.issues.push({origin:eP(n),...i?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),rm=e7("$ZodCheckMaxLength",(e,t)=>{var r;rn.init(e,t),(r=e._zod.def).when??(r.when=ri),e._zod.check=r=>{let n=r.value,s=n.length;if(("string"==typeof n&&s>t.maximum?eL(n):s)<=t.maximum)return;let i=eU(n);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),ry=e7("$ZodCheckMinLength",(e,t)=>{var r;rn.init(e,t),(r=e._zod.def).when??(r.when=ri),e._zod.check=r=>{let n=r.value,s=n.length;if(("string"==typeof n&&s>=t.minimum&&s<2*t.minimum?eL(n):s)>=t.minimum)return;let i=eU(n);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),rg=e7("$ZodCheckLengthEquals",(e,t)=>{var r;rn.init(e,t),(r=e._zod.def).when??(r.when=ri),e._zod.check=r=>{let n=r.value,s=n.length,i="string"==typeof n&&s>=t.length&&s<=2*t.length?eL(n):s;if(i===t.length)return;let a=eU(n),o=i>t.length;r.issues.push({origin:a,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),rb=e7("$ZodCheckStringFormat",(e,t)=>{var r,n;rn.init(e,t),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),rv=e7("$ZodCheckRegex",(e,t)=>{rb.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),rw=e7("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=tQ),rb.init(e,t)}),rk=e7("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=t0),rb.init(e,t)}),rx=e7("$ZodCheckIncludes",(e,t)=>{rn.init(e,t);let r=eh(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),r$=e7("$ZodCheckStartsWith",(e,t)=>{rn.init(e,t);let r=RegExp(`^${eh(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),rS=e7("$ZodCheckEndsWith",(e,t)=>{rn.init(e,t);let r=RegExp(`.*${eh(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function r_(e,t,r){e.issues.length&&t.issues.push(...eN(r,e.issues))}(e,t)=>{let r;rn.init(e,t),eQ(e,Symbol.iterator,function*(){yield e}),e._zod.check=n=>{let s;if(null==n.value)return void n.issues.push({expected:"object",code:"invalid_type",input:n.value,inst:e});r??(r=Reflect.ownKeys(t.shape).map(e=>[e,t.shape[e]]));let i=n.value;for(let[e,t]of r){let r=t._zod.run({value:i[e],issues:[]},{});r instanceof Promise?(s??(s=[]),s.push(r.then(t=>r_(t,n,e)))):r_(r,n,e)}if(s)return Promise.all(s).then(()=>void 0)}},(e,t)=>{rn.init(e,t);let r=new Set(t.mime);e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort})}};let rA=e7("$ZodCheckOverwrite",(e,t)=>{rn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class rT{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
2
+ ${t.join("\n")}
3
+ };`)(...Object.values(this.closed))}}let rO={get:function(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,C,2)),e.message},set:function(e){this._zod.message=e},enumerable:!0,configurable:!0},rE={value:void 0,enumerable:!1},rM=new WeakSet([Object.prototype,Error.prototype]),rj=(e,t)=>{e.name="$ZodError",rE.value=t,Object.defineProperty(e,"issues",rE),rE.value=void 0,Object.defineProperty(e,"message",rO);let r=Object.getPrototypeOf(e);rM.has(r)||(rM.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},rN=e7("$ZodError",rj),rI=e7("$ZodError",rj,void 0,{Parent:Error});function rq(e,t){return{callee:t?.callee??e,Err:t?.Err}}let rz=e=>{let t=(r,n,s,i)=>{let a=s?{...s,async:!1}:{async:!1},o=r._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new te;if(o.issues.length){let r=new(i?.Err??e)(o.issues.map(e=>eC(e,a,tn())));throw es(r,i?.callee??t),r}return o.value};return t},rC=rz(rI),rP=e=>{let t=async(r,n,s,i)=>{let a=s?{...s,async:!0}:{async:!0},o=r._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let r=new(i?.Err??e)(o.issues.map(e=>eC(e,a,tn())));throw es(r,i?.callee??t),r}return o.value};return t},rR=rP(rI),rL=e=>(t,r,n)=>{let s=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new te;return i.issues.length?rU(e,i.issues,s):{success:!0,data:i.value}};function rU(e,t,r){let n;return{success:!1,get error(){return n||(n=new e(t.map(e=>eC(e,r,tn()))),t=void 0,r=void 0),n},set error(e){n=e,t=void 0,r=void 0}}}let rF=e=>async(t,r,n)=>{let s=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?rU(e,i.issues,s):{success:!0,data:i.value}},rD=Symbol.for("zod.compile.invalid"),rB=Symbol.for("zod.compile.fallback"),rK=async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},s=e._zod.run({value:t,issues:[]},n);return s instanceof Promise&&(s=await s),0===s.issues.length},rZ={major:4,minor:6,patch:7},rJ=e7("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=rZ;let n=e._zod.def.checks,s=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let t of s)for(let r of t._zod.onattach)r(e);if(0===s.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,r,n)=>{let s;if(t.memo)return t;let i=eM(t);for(let a of r){if(a._zod.def.when){if(ej(t)||!a._zod.def.when(t))continue}else if(i)continue;let r=t.issues.length,o=a._zod.check(t);if(o instanceof Promise&&n?.async===!1)throw new te;if(s||o instanceof Promise)s=(s??Promise.resolve()).then(async()=>{await o,t.issues.length!==r&&(ez(t.issues,r,e),i||(i=eM(t,r)))});else{if(t.issues.length===r)continue;ez(t.issues,r,e),i||(i=eM(t,r))}}return s?s.then(()=>t):t},r=(r,n,i)=>{if(eM(r))return r.aborted=!0,r;let a=t(n,s,i);if(a instanceof Promise){if(!1===i.async)throw new te;return a.then(t=>e._zod.parse(t,i))}return e._zod.parse(a,i)};e._zod.run=(n,i)=>{if(i.skipChecks)return e._zod.parse(n,i);if("backward"===i.direction){let t=e._zod.parse({value:n.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,n,i)):r(t,n,i)}let a=e._zod.parse(n,i);if(a instanceof Promise){if(!1===i.async)throw new te;return a.then(e=>t(e,s,i))}return t(a,s,i)}}},{get"~standard"(){return eQ(this,"~standard",rW(this))},set"~standard"(e){eY(this,"~standard",e)}}),rH=(e,t)=>e.issues.length?{issues:e.issues.map(e=>eC(e,t,tn()))}:{value:e.value};async function rV(e,t){let r={async:!0};return rH(await e._zod.run({value:t,issues:[]},r),r)}function rW(e){return{validate:t=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return rH(n,r)}catch(e){}return rV(e,t)},vendor:"zod",version:1}}let rG=e7("$ZodString",(e,t)=>{rJ.init(e,t),e._zod.pattern=t.pattern??tZ,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(e){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),rX=e7("$ZodStringFormat",(e,t)=>{rb.init(e,t),rG.init(e,t)}),rY=e7("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=tk),rX.init(e,t)}),rQ=e7("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=tx(e))}else t.pattern??(t.pattern=tx());rX.init(e,t)}),r0=e7("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=tA),rX.init(e,t)});function r1(e){try{if("u">typeof URL&&"function"==typeof URL.canParse)return URL.canParse(e);return new URL(e),!0}catch{return!1}}let r2=/[\t\n\r]/g;function r5(e){return e.replace(r2,"")}let r9=e7("$ZodURL",(e,t)=>{rX.init(e,t),e._zod.check=r=>{try{var n,s;let i=r.value.trim(),a="normalize"in t||"hostname"in t||"protocol"in t?function(e,t){if(!t.normalize&&t.protocol?.source===tC.source&&!/^https?:\/\//i.test(e))return 1;try{if("u">typeof URL){let t=URL;if("function"==typeof t.parse)return t.parse(e)??2}return new URL(e)}catch{return 2}}(i,t):r1(i)||2;if(1===a)return void r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});if(2===a)return void r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});if(!0===a){r.value=r5(i);return}t.hostname&&((n=t.hostname).lastIndex=0,!n.test(a.hostname))&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort}),t.protocol&&((s=t.protocol).lastIndex=0,!s.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol))&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?a.href:r5(i);return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),r6=e7("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=tO()),rX.init(e,t)}),r4=e7("$ZodNanoID",(e,t)=>{if(void 0!==t.length&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=void 0===t.length?tb:tv(t.length)),rX.init(e,t)}),r3=e7("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=th),rX.init(e,t)}),r8=e7("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=tf),rX.init(e,t)}),r7=e7("$ZodULID",(e,t)=>{t.pattern??(t.pattern=tm),rX.init(e,t)}),ne=e7("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ty),rX.init(e,t)}),nt=e7("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=tg),rX.init(e,t)}),nr=e7("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=tK(t)),rX.init(e,t)}),nn=e7("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=tF),rX.init(e,t)}),ns=e7("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=tB(t)),rX.init(e,t)}),ni=e7("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=tw),rX.init(e,t)}),na=e7("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=tE),rX.init(e,t)}),no=/^[0-9a-fA-F:.]+$/;function nl(e){return!!no.test(e)&&r1(`http://[${e}]`)}let nu=e7("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=tM),rX.init(e,t),e._zod.check=r=>{nl(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}),nc=((e,t)=>{t.pattern??(t.pattern=tj(t.delimiter)),rX.init(e,t)},e7("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=tN),rX.init(e,t)})),np=e7("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=tI),rX.init(e,t),e._zod.check=r=>{!function(e){let t=e.split("/");if(2!==t.length)return!1;let[r,n]=t;if(!n)return!1;let s=Number(n);return`${s}`===n&&!(s<0)&&!(s>128)&&nl(r)}(r.value)&&r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function nd(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let nh=/^[0-9a-zA-Z+/]*={0,2}$/,nf=e7("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=nh),rX.init(e,t),e._zod.check=r=>{nd(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),nm=/^[A-Za-z0-9_-]*$/,ny=e7("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=nm),rX.init(e,t),e._zod.check=r=>{!function(e){if(!nm.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return nd(t.padEnd(4*Math.ceil(t.length/4),"="))}(r.value)&&r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),ng=e7("$ZodE164",(e,t)=>{t.pattern??(t.pattern=tP),rX.init(e,t)}),nb=/[- ]/g,nv=((e,t)=>{t.pattern??(t.pattern=tR),rX.init(e,t),e._zod.check=r=>{var n;n=r.value,tR.test(n)&&function(e){let t=e.length,r=1,n=0;for(;t;){let s=e.charCodeAt(--t)-48;r^=1,n+=r?[0,2,4,6,8,1,3,5,7,9][s]:s}return n%10==0}(n.replace(nb,""))||r.issues.push({code:"invalid_format",format:"credit_card",input:r.value,inst:e,continue:!t.abort})}},e7("$ZodJWT",(e,t)=>{rX.init(e,t),e._zod.check=r=>{!function(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[n]=r;if(!n)return!1;let s=JSON.parse(atob(n));if("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))return!1;return!0}catch{return!1}}(r.value,t.alg)&&r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}})),nw=((e,t)=>{rX.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}},e7("$ZodNumber",(e,t)=>{rJ.init(e,t),e._zod.pattern=tW,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let s=r.value;if("number"==typeof s&&!Number.isNaN(s)&&Number.isFinite(s))return r;let i="number"==typeof s?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:String(s):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...i?{received:i}:{}}),r}})),nk=e7("$ZodNumberFormat",(e,t)=>{rc.init(e,t),nw.init(e,t)}),nx=e7("$ZodBoolean",(e,t)=>{rJ.init(e,t),e._zod.pattern=tG,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let s=r.value;return"boolean"==typeof s||r.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),r}}),n$=e7("$ZodBigInt",(e,t)=>{rJ.init(e,t),e._zod.pattern=tH,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch(e){}return"bigint"==typeof r.value||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),nS=((e,t)=>{rp.init(e,t),n$.init(e,t)},e7("$ZodUnknown",(e,t)=>{rJ.init(e,t),e._zod.parse=e=>e})),n_=e7("$ZodNever",(e,t)=>{rJ.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function nA(e,t){let r=eq(e._zod.def.checks);if(!r.length)return;let n=Math.min(...r.map(e=>e[0])),s=e._zod.parse;e._zod.parse=(r,i)=>{let a=t(r.value);if(a>n&&!i?.skipChecks&&i?.direction!=="backward"){for(let[t,n]of eq(e._zod.def.checks))if(a>t&&n._zod.def.when(r)){let t=r.issues.length;return n._zod.check(r),r.issues[t].continue=!1,ez(r.issues,t,e),r}}return s(r,i)}}(e,t)=>{rJ.init(e,t),e._zod.parse=(t,r)=>{let n=t.value;return void 0===n||t.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),t}},(e,t)=>{rJ.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch(e){}let s=r.value,i=s instanceof Date;return i&&!Number.isNaN(s.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:s,...i?{received:"Invalid Date"}:{},inst:e}),r}};let nT=e=>Array.isArray(e)?e.length:-1,nO=e=>e instanceof Map?e.size:-1,nE=e=>e instanceof Set?e.size:-1;function nM(e,t,r){e.issues.length&&t.issues.push(...eN(r,e.issues)),t.value[r]=e.value}let nj=e7("$ZodArray",(e,t)=>{rJ.init(e,t);let r=tr.memoizer;r?.attach(e),e._zod.parse=(n,s)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=r?r.alloc(e,n,Array(i.length),s):Array(i.length);let a=[],o=s?.abortEarly;for(let e=0;e<i.length;e++){let r=i[e],l=t.element._zod.run({value:r,issues:[]},s);if(l instanceof Promise)a.push(l.then(t=>nM(t,n,e)));else if(nM(l,n,e),o&&0!==l.issues.length&&eM(l))break}return a.length?Promise.all(a).then(()=>n):n},nA(e,nT)});function nN(e,t,r,n,s,i){let a=r in n,o="optional"===i;if(a||!o||"optional"!==s){if(e.issues.length){if(void 0!==s&&o&&!a)return;t.issues.push(...eN(r,e.issues))}if(!a&&void 0===s){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}void 0===e.value?(a||"defaulted"===s&&!o)&&(t.value[r]=void 0):t.value[r]=e.value}}let nI=[];function nq(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:nI,s=n.length?[...t,...n]:t;for(let t of s)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let i=eb(e.shape);return{...e,allKeys:s,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function nz(e,t,r,n,s,i,a){let o=[],l=s.keySet,u=s.catchall._zod,c=u.def.type,p=u.optin,d=u.optout,h=0;for(let s in t){if(a&&r.issues.length!==h){if(eM(r,h))break;h=r.issues.length}if(l.has(s))continue;if("__proto__"===s){"never"===c&&o.push(s);continue}if("never"===c){o.push(s);continue}let i=u.run({value:t[s],issues:[]},n);i instanceof Promise?e.push(i.then(e=>nN(e,r,s,t,p,d))):nN(i,r,s,t,p,d)}return(o.length&&r.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:i,continue:!0}),e.length)?Promise.all(e).then(()=>r):r}let nC=e7("$ZodObject",(e,t)=>{let r;rJ.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape"),s=n?.get?n.get.raw:t.shape??{};if(s){let e=()=>{let r={...s};return Object.defineProperty(t,"shape",{value:r}),e.raw=r,r};e.raw=s,Object.defineProperty(t,"shape",{get:e})}let i=R(()=>nq(t));e5(e,"propValues",e=>{let t=e.def.shape,r={};for(let e in t){let n=t[e]._zod;if(n.values){for(let t of(Object.prototype.hasOwnProperty.call(r,e)||Z(r,e,new Set),n.values))r[e].add(t);void 0!==n.optin&&r[e].add(void 0)}}return r});let a=t.catchall,o=tr.memoizer;o?.attach(e),e._zod.parse=(t,n)=>{r??(r=i.value);let s=t.value;if(!ei(s))return t.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),t;t.value=o?o.alloc(e,t,{},n):{};let l=[],u=r.shape,c=n?.abortEarly,p=t.issues.length;for(let e of r.allKeys){if(c&&t.issues.length!==p){if(eM(t,p))break;p=t.issues.length}if("__proto__"===e)continue;let r=u[e],i=r._zod.optin,a=r._zod.optout,o=r._zod.run({value:s[e],issues:[]},n);o instanceof Promise?l.push(o.then(r=>nN(r,t,e,s,i,a))):nN(o,t,e,s,i,a)}return a?nz(l,s,t,n,i.value,e,!0===c):l.length?Promise.all(l).then(()=>t):t}}),nP=e7("$ZodObjectJIT",(e,t)=>{let r,n;nC.init(e,t);let s=e._zod.parse,i=R(()=>nq(t)),a=tr.memoizer,o=!tr.jitless,l=o&&ea.value,u=t.catchall;e._zod.parse=(c,p)=>{n??(n=i.value);let d=c.value;return ei(d)?o&&l&&p?.async===!1&&!0!==p.jitless?(r||(r=(t=>{let r=i.value,n=r.symbolKeys,s=new rT(["payload","ctx"],{shape:t,inst:e,memo:a,syms:n}),o=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,l=(e,t)=>`
4
+ let ${e}_ab = false;
5
+ for (let i = 0; i < ${e}.issues.length; i++) {
6
+ const iss = ${e}.issues[i];
7
+ iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
8
+ payload.issues.push(iss);
9
+ if (iss.continue !== true) ${e}_ab = true;
10
+ }
11
+ if (${e}_ab && ctx && ctx.abortEarly) {
12
+ payload.value = newResult;
13
+ return payload;
14
+ }`;s.write("const input = payload.value;");let u=Object.create(null),c=0;for(let e of r.allKeys)u[e]=`key_${c++}`;for(let e of(s.write(a?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};"),r.allKeys)){if("__proto__"===e)continue;let r=u[e],i="symbol"==typeof e?`syms[${n.indexOf(e)}]`:er(e),a=`${i} in input`,c=t[e],p=c?._zod?.optin,d=void 0!==p,h=c?._zod?.optout==="optional";if(s.write(`const ${r} = ${o(i)};`),d&&h){let e="optional"===p?`${r}_present`:`${r}.value !== undefined || ${r}_present`;s.write(`
15
+ const ${r}_present = ${a};
16
+ if (!${r}.issues.length || ${r}_present) {
17
+ if (${r}.issues.length) {${l(r,i)}
18
+ }
19
+
20
+ if (${e}) {
21
+ newResult[${i}] = ${r}.value;
22
+ }
23
+ }
24
+
25
+ `)}else d?(s.write(`
26
+ if (${r}.issues.length) {${l(r,i)}
27
+ }
28
+ `),"defaulted"===p?s.write(`newResult[${i}] = ${r}.value;`):s.write(`
29
+ if (${r}.value !== undefined || ${a}) {
30
+ newResult[${i}] = ${r}.value;
31
+ }
32
+ `)):s.write(`
33
+ const ${r}_present = ${a};
34
+ if (${r}.issues.length) {${l(r,i)}
35
+ }
36
+ if (!${r}_present && !${r}.issues.length) {
37
+ payload.issues.push({
38
+ code: "invalid_type",
39
+ expected: "nonoptional",
40
+ input: undefined,
41
+ path: [${i}]
42
+ });
43
+ if (ctx && ctx.abortEarly) {
44
+ payload.value = newResult;
45
+ return payload;
46
+ }
47
+ }
48
+
49
+ if (${r}_present) {
50
+ newResult[${i}] = ${r}.value;
51
+ }
52
+
53
+ `)}return s.write("payload.value = newResult;"),s.write("return payload;"),s.compile()})(t.shape)),c=r(c,p),u)?nz([],d,c,p,n,e,p?.abortEarly===!0):c:s(c,p):(c.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),c)}});function nR(e,t,r,n){for(let r of e)if(0===r.issues.length)return t.value=r.value,t;let s=e.filter(e=>!eM(e));return 1===s.length?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>eC(e,n,tn())))}),t)}let nL=e7("$ZodUnion",(e,t)=>{rJ.init(e,t),e5(e,"optin",e=>e.def.options.some(e=>"defaulted"===e._zod.optin)?"defaulted":e.def.options.some(e=>void 0!==e._zod.optin)?"optional":void 0),e5(e,"optout",e=>e.def.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),e5(e,"values",e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),e5(e,"pattern",e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>U(e.source)).join("|")})$`)}});let r=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(n,s)=>{if(r)return r(n,s);let i=!1,a=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},s);if(t instanceof Promise)a.push(t),i=!0;else{if(0===t.issues.length)return t;a.push(t)}}return i?Promise.all(a).then(t=>nR(t,n,e,s)):nR(a,n,e,s)}});function nU(e,t,r,n){let s=[];for(let t=0;t<e.length;t++)0===e[t].issues.length&&s.push(t);return 1===s.length?t.value=e[s[0]].value:0===s.length?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>eC(e,n,tn())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1,matches:s}),t}(e,t)=>{nL.init(e,t),t.inclusive=!1;let r=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(n,s)=>{if(r)return r(n,s);let i=!1,a=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},s);t instanceof Promise?(a.push(t),i=!0):a.push(t)}return i?Promise.all(a).then(t=>nU(t,n,e,s)):nU(a,n,e,s)}};let nF=e7("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,nL.init(e,t);let r=e._zod.parse;e5(e,"propValues",e=>{let t={},r=0;for(let n of e.def.options){let s=n._zod.propValues;if(!s||0===Object.keys(s).length)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(n)}"`);for(let[n,i]of(s[e.def.discriminator]?.has(void 0)&&r++,Object.entries(s)))for(let e of(Object.prototype.hasOwnProperty.call(t,n)||Z(t,n,new Set),i))t[n].add(e)}return!e.def.unionFallback&&r>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,r)=>{let n=J(e._zod.def);if(n&&!Object.prototype.hasOwnProperty.call(n,t.discriminator))throw Error(`Invalid discriminated union option at index "${r}"`)});let n=R(()=>(function(e){let t=new Map;for(let r of e.options){let n=r._zod.propValues?.[e.discriminator];if(!n||0===n.size)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let e of n)if(t.has(e)){if(void 0!==e)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,r)}return t})(t));e._zod.parse=(s,i)=>{let a=s.value;if(!ei(a))return s.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),s;let o=a?.[t.discriminator],l=n.value.get(o);return l&&(void 0!==o||"backward"!==i.direction)?l._zod.run(s,i):t.unionFallback||"backward"===i.direction?r(s,i):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()).filter(e=>null!==n.value.get(e)),input:a,path:[t.discriminator],inst:e}),s)}}),nD=e7("$ZodIntersection",(e,t)=>{rJ.init(e,t),e._zod.parse=(e,r)=>{let n=e.value,s=t.left._zod.run({value:n,issues:[]},r),i=t.right._zod.run({value:n,issues:[]},r);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([t,r])=>nB(e,t,r)):nB(e,s,i)}});function nB(e,t,r){let n,s=new Map,i=new Map,a=(e,t)=>{let r;if("unrecognized_keys"!==e.code||e.path?.length)if("invalid_key"!==e.code||"record"!==e.origin||e.path?.length!==1)return!1;else{let t=String(e.path[0]);i.has(t)||i.set(t,e),r=[t]}else n??(n=e),r=e.keys;for(let e of r)s.has(e)||s.set(e,{}),s.get(e)[t]=!0;return!0};for(let r of t.issues)a(r,"l")||e.issues.push(r);for(let t of r.issues)a(t,"r")||e.issues.push(t);let o=[...s].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(o.length){let t=n?o.filter(e=>n.keys.includes(e)):[];for(let r of(t.length&&e.issues.push({...n,keys:t}),o))!t.includes(r)&&i.has(r)&&e.issues.push(i.get(r))}let l=function e(t,r){if(t===r||t instanceof Date&&r instanceof Date&&+t==+r)return{valid:!0,data:t};if(eo(t)&&eo(r)){let n=Object.keys(r),s=Object.keys(t).filter(e=>-1!==n.indexOf(e)),i={...t,...r};for(let n of(Object.prototype.hasOwnProperty.call(i,"__proto__")&&delete i.__proto__,s)){if("__proto__"===n)continue;let s=e(t[n],r[n]);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};i[n]=s.data}return{valid:!0,data:i}}if(Array.isArray(t)&&Array.isArray(r)){if(t.length!==r.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let s=0;s<t.length;s++){let i=e(t[s],r[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}(t.value,r.value);if(!l.valid){if(eM(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`)}return e.value=l.data,e}let nK=e7("$ZodTuple",(e,t)=>{rJ.init(e,t);let r=t.items,n=tr.memoizer;n?.attach(e),e._zod.parse=(s,i)=>{let a=s.value;if(!Array.isArray(a))return s.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),s;s.value=n?n.alloc(e,s,[],i):[];let o=[],l=nZ(r,"optin"),u=nZ(r,"optout");if(!t.rest){if(a.length<l)return s.issues.push({code:"too_small",minimum:l,inclusive:!0,input:a,inst:e,origin:"array"}),s;a.length>r.length&&s.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:a,inst:e,origin:"array"})}let c=Array(r.length),p=t.rest?i?.abortEarly:void 0,d=!1;for(let e=0;e<r.length;e++){let t=r[e]._zod.run({value:a[e],issues:[]},i);t instanceof Promise?o.push(t.then(t=>{c[e]=t})):(c[e]=t,p&&!d&&t.issues.length&&(d=eM(t)))}if(t.rest&&!d){let e=r.length-1,n=a.slice(r.length),l=s.issues.length;for(let r of n){if(p&&s.issues.length!==l){if(eM(s,l))break;l=s.issues.length}e++;let n=t.rest._zod.run({value:r,issues:[]},i);n instanceof Promise?o.push(n.then(t=>nJ(t,s,e))):nJ(n,s,e)}}return o.length?Promise.all(o).then(()=>nH(c,s,r,a,u)):nH(c,s,r,a,u)}});function nZ(e,t){for(let r=e.length-1;r>=0;r--)if(!("optin"===t?void 0!==e[r]._zod.optin:"optional"===e[r]._zod.optout))return r+1;return 0}function nJ(e,t,r){e.issues.length&&t.issues.push(...eN(r,e.issues)),t.value[r]=e.value}function nH(e,t,r,n,s){for(let i=0;i<r.length;i++){let a=e[i],o=i<n.length;if(!o&&i>=s&&"optional"===r[i]._zod.optin){t.value.length=i;break}if(a.issues.length){if(!o&&i>=s){t.value.length=i;break}t.issues.push(...eN(i,a.issues))}t.value[i]=a.value}for(let e=t.value.length-1;e>=n.length;e--)if("optional"===r[e]._zod.optout&&void 0===t.value[e])t.value.length=e;else break;return t}function nV(e,t,r,n,s,i,a){e.issues.length&&(ep.has(typeof n)?r.issues.push(...eN(n,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:s,inst:i,issues:e.issues.map(e=>eC(e,a,tn()))})),t.issues.length&&(ep.has(typeof n)?r.issues.push(...eN(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:s,inst:i,key:n,issues:t.issues.map(e=>eC(e,a,tn()))})),r.value.set(e.value,t.value)}function nW(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}(e,t)=>{rJ.init(e,t);let r=tr.memoizer;r?.attach(e),e._zod.parse=(n,s)=>{let i=n.value;if(!eo(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o&&!t.partial){let l;n.value=r?r.alloc(e,n,{},s):{};let u=new Set;for(let r of o)if("string"==typeof r||"number"==typeof r||"symbol"==typeof r){if(u.add("number"==typeof r?r.toString():r),"__proto__"===r)continue;let o=t.keyType._zod.run({value:r,issues:[]},s);if(o instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(o.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:o.issues.map(e=>eC(e,s,tn())),input:r,path:[r],inst:e});continue}let l=o.value;if("__proto__"===l)continue;let c=t.valueType._zod.run({value:i[r],issues:[]},s);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...eN(r,e.issues)),n.value[l]=e.value})):(c.issues.length&&n.issues.push(...eN(r,c.issues)),n.value[l]=c.value)}for(let e in i)if(!u.has(e))if("loose"===t.mode){if("__proto__"===e)continue;n.value[e]=i[e]}else(l=l??[]).push(e);l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:l,continue:!0})}else{let l;for(let u of(n.value=r?r.alloc(e,n,{},s):{},Reflect.ownKeys(i))){if("__proto__"===u||!Object.prototype.propertyIsEnumerable.call(i,u))continue;let r=t.keyType._zod.run({value:u,issues:[]},s);if(r instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof u&&tW.test(u)&&r.issues.length){let e=t.keyType._zod.run({value:Number(u),issues:[]},s);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(r=e)}if(r.issues.length){"loose"===t.mode?n.value[u]=i[u]:o?(l=l??[]).push(u):n.issues.push({code:"invalid_key",origin:"record",issues:r.issues.map(e=>eC(e,s,tn())),input:u,path:[u],inst:e});continue}let c=r.value;if("__proto__"===c)continue;let p=t.valueType._zod.run({value:i[u],issues:[]},s);p instanceof Promise?a.push(p.then(e=>{e.issues.length&&n.issues.push(...eN(u,e.issues)),n.value[c]=e.value})):(p.issues.length&&n.issues.push(...eN(u,p.issues)),n.value[c]=p.value)}l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:l,continue:!0})}return a.length?Promise.all(a).then(()=>n):n}},(e,t)=>{rJ.init(e,t);let r=tr.memoizer;r?.attach(e),e._zod.parse=(n,s)=>{let i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),n;let a=[];n.value=r?r.alloc(e,n,new Set,s):new Set;let o=s?.abortEarly,l=n.issues.length;for(let e of i){if(o&&n.issues.length!==l){if(eM(n,l))break;l=n.issues.length}let r=t.valueType._zod.run({value:e,issues:[]},s);r instanceof Promise?a.push(r.then(e=>nW(e,n))):nW(r,n)}return a.length?Promise.all(a).then(()=>n):n},nA(e,nE)};let nG=e7("$ZodEnum",(e,t)=>{rJ.init(e,t);let r=q(t.entries),n=new Set(r);e._zod.values=n,e5(e,"pattern",e=>{let t=q(e.def.entries).filter(e=>ep.has(typeof e));return new RegExp(t.length?`^(${t.map(e=>eh(e.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(t,s)=>{let i=t.value;return n.has(i)||t.issues.push({code:"invalid_value",values:r,input:i,inst:e}),t}}),nX=e7("$ZodLiteral",(e,t)=>{rJ.init(e,t);let r=new Set(t.values);e._zod.values=r,e5(e,"pattern",e=>{let t=e.def.values;return new RegExp(t.length?`^(${t.map(e=>"string"==typeof e?eh(e):e?eh(e.toString()):String(e)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,s)=>{let i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}}),nY=((e,t)=>{rJ.init(e,t),e._zod.parse=(t,r)=>{let n=t.value;return n instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),t}},e7("$ZodTransform",(e,t)=>{rJ.init(e,t),e._zod.optin="optional",tr.memoizer?.guard(e),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new tt(e.constructor.name);let s=t.transform(r.value,r);if(n.async)return(s instanceof Promise?s:Promise.resolve(s)).then(e=>(r.value=e,r));if(s instanceof Promise)throw new te;return r.value=s,r}}));function nQ(e,t){return e.value=t.issues.length?void 0:t.value,e}let n0=e7("$ZodOptional",(e,t)=>{rJ.init(e,t),e5(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),e._zod.optout="optional",e5(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),e5(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${U(t.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if(void 0===e.value){if("defaulted"!==t.innerType._zod.optin)return e;let n=t.innerType._zod.run({value:e.value,issues:[]},r);return n instanceof Promise?n.then(t=>nQ(e,t)):nQ(e,n)}return t.innerType._zod.run(e,r)}}),n1=e7("$ZodExactOptional",(e,t)=>{n0.init(e,t),e5(e,"values",e=>e.def.innerType._zod.values),e5(e,"pattern",e=>e.def.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),n2=e7("$ZodNullable",(e,t)=>{rJ.init(e,t),e5(e,"optin",e=>e.def.innerType._zod.optin),e5(e,"optout",e=>e.def.innerType._zod.optout),e5(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${U(t.source)}|null)$`):void 0}),e5(e,"values",e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),n5=e7("$ZodDefault",(e,t)=>{rJ.init(e,t),e._zod.optin="defaulted",e5(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);if(void 0===e.value)return e.value=t.defaultValue,e;let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(e=>n9(e,t)):n9(n,t)}});function n9(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let n6=e7("$ZodPrefault",(e,t)=>{rJ.init(e,t),e._zod.optin="defaulted",e5(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,r)=>("backward"===r.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),n4=e7("$ZodNonOptional",(e,t)=>{rJ.init(e,t),e5(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,n)=>{let s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(t=>n3(t,e)):n3(s,e)}});function n3(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function n8(e,t,r,n){return t.issues.length?e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>eC(e,n,tn()))},input:e.value}):(e.value=t.value,t.memo&&(e.memo=!0)),e}(e,t)=>{rJ.init(e,t),e._zod.parse=(e,r)=>{if("backward"===r.direction)throw new tt("ZodSuccess");let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(t=>(e.value=0===t.issues.length,e)):(e.value=0===n.issues.length,e)}};let n7=e7("$ZodCatch",(e,t)=>{rJ.init(e,t),e5(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),e5(e,"optout",e=>e.def.innerType._zod.optout),e5(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let n=t.innerType._zod.run({value:e.value,issues:[]},r);return n instanceof Promise?n.then(n=>n8(e,n,t,r)):n8(e,n,t,r)}}),se=((e,t)=>{rJ.init(e,t),e._zod.parse=(t,r)=>("number"==typeof t.value&&Number.isNaN(t.value)||t.issues.push({input:t.value,inst:e,expected:"nan",code:"invalid_type"}),t)},e7("$ZodPipe",(e,t)=>{rJ.init(e,t),e5(e,"values",e=>e.def.in._zod.values),e5(e,"optin",e=>e.def.in._zod.optin),e5(e,"optout",e=>e.def.out._zod.optout),e5(e,"propValues",e=>e.def.in._zod.propValues),e._zod.parse=(e,r)=>{if("backward"===r.direction){let n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>st(e,t.in,r)):st(n,t.in,r)}let n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>st(e,t.out,r)):st(n,t.out,r)}}));function st(e,t,r){return e.issues.some(e=>"unrecognized_keys"!==e.code)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}function sr(e,t,r){if(e.issues.length)return e.aborted=!0,e;if("forward"===(r.direction||"forward")){let n=t.transform(e.value,e);return n instanceof Promise?n.then(n=>sn(e,n,t.out,r)):sn(e,n,t.out,r)}{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(n=>sn(e,n,t.in,r)):sn(e,n,t.in,r)}}function sn(e,t,r,n){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},n)}(e,t)=>{rJ.init(e,t),e5(e,"values",e=>e.def.in._zod.values),e5(e,"optin",e=>e.def.in._zod.optin),e5(e,"optout",e=>e.def.out._zod.optout),e5(e,"propValues",e=>e.def.in._zod.propValues),e._zod.parse=(e,r)=>{if("forward"===(r.direction||"forward")){let n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>sr(e,t,r)):sr(n,t,r)}{let n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>sr(e,t,r)):sr(n,t,r)}}},(e,t)=>{se.init(e,t)};let ss=e7("$ZodReadonly",(e,t)=>{rJ.init(e,t),e5(e,"propValues",e=>e.def.innerType._zod.propValues),e5(e,"values",e=>e.def.innerType._zod.values),e5(e,"optin",e=>e.def.innerType?._zod?.optin),e5(e,"optout",e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(si):si(n)}});function si(e){return e.memo||(e.value=Object.freeze(e.value)),e}(e,t)=>{rJ.init(e,t);let r=[];for(let e of t.parts)if("object"==typeof e&&null!==e){let t=function e(t){let r=t._zod.def,n=t._zod.pattern?.source,s=r.innerType??t._zod.innerType;if(s){let t=s._zod.pattern?.source,r=e(s);return n&&t&&r&&r!==t?n.replace(U(t),()=>U(r)):n}if(r.options){let t=r.options.map(e);if(t.every(Boolean))return`^(${t.map(e=>U(e)).join("|")})$`}return function(e){let t,r,n=e._zod.def,s=n.pattern,i=!!n.format?.includes("int");for(let e of n.checks??[]){let n=e._zod.def;n.pattern&&(s=n.pattern),i||(i=!!n.format?.includes("int"));let a=n.minimum??n.length,o=n.maximum??n.length;void 0!==a&&(void 0===t||a>t)&&(t=a),void 0!==o&&(void 0===r||o<r)&&(r=o)}if(s)return s.source;if(void 0!==t&&void 0!==r&&t>r)return"(?!)";if(void 0!==t||void 0!==r)return tJ({minimum:t,maximum:r}).source;let a=e._zod.pattern;return(i&&a===tW?tV:a)?.source}(t)}(e);if(!t)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);r.push(U(t))}else if(null===e||ed.has(typeof e))r.push(eh(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${r.join("")}$`),e._zod.parse=(r,n)=>("string"!=typeof r.value?r.issues.push({input:r.value,inst:e,expected:"string",code:"invalid_type"}):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source})),r)},(e,t)=>{rJ.init(e,t),B(e._zod,"innerType",()=>(t._cachedInner||(t._cachedInner=t.getter()),t._cachedInner)),e5(e,"pattern",e=>e.innerType?._zod?.pattern),e5(e,"propValues",e=>e.innerType?._zod?.propValues),e5(e,"optin",e=>e.innerType?._zod?.optin??void 0),e5(e,"optout",e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,r)=>e._zod.innerType._zod.run(t,r)};let sa=e7("$ZodCustom",(e,t)=>{rn.init(e,t),rJ.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{let n=r.value,s=t.fn(n);if(s instanceof Promise)return s.then(t=>so(t,r,n,e));so(s,r,n,e)}});function so(e,t,r,n){if(!e){let e={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(e.params=n._zod.def.params),t.issues.push(eD(e))}}function sl(e){return e.checks&&(e.checks=[...e.checks]),e}function su(e,t){return new ro({check:"less_than",...em(t),value:e,inclusive:!1})}function sc(e,t){return new ro({check:"less_than",...em(t),value:e,inclusive:!0})}function sp(e,t){return new rl({check:"greater_than",...em(t),value:e,inclusive:!1})}function sd(e,t){return new rl({check:"greater_than",...em(t),value:e,inclusive:!0})}function sh(e,t){return new ru({check:"multiple_of",...em(t),value:e})}function sf(e,t){return new rm({check:"max_length",...em(t),maximum:e})}function sm(e,t){return new ry({check:"min_length",...em(t),minimum:e})}function sy(e,t){return new rg({check:"length_equals",...em(t),length:e})}function sg(e){return new rA({check:"overwrite",tx:e})}e.i(79692);var sb,sv,sw,sk=e.i(22210),sk=sk,sx=sk,s$=sk,sS=sk,s_=sk,sA=sk,sT=sk,sO=sk,sE=sk,sM=sk,sj=sk,sN=sk,sI=sk,sq=sk,sz=sk,sC=sk;function sP(e,...t){for(let r of t)for(let t of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,t)&&Z(e,t,r[t]);return e}function sR(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??td,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function sL(e,t,r,n,s){let i="function"==typeof t.unrepresentable?t.unrepresentable({zodSchema:e,path:n.path,message:s}):t.unrepresentable;if("any"===i)return!1;if(void 0===i||"throw"===i)throw Error(s);return Object.assign(r,i),!0}function sU(e,t,r={path:[],schemaPath:[]}){var n;let s=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let o=e._zod.toJSONSchema?.();if(o)a.schema=o;else{let n={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,n);else{let r=a.schema,i=t.processors[s.type];if(!i)throw Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);i(e,t,r,n)}let i=e._zod.parent;i&&(a.ref||(a.ref=i),sU(i,t,n),t.seen.get(i).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&sP(a.schema,l),"input"===t.io&&function e(t,r){let n=r??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let s=t._zod.def;if("transform"===s.type)return!0;if("array"===s.type)return e(s.element,n);if("set"===s.type)return e(s.valueType,n);if("lazy"===s.type)return e(s.getter(),n);if("promise"===s.type||"optional"===s.type||"nonoptional"===s.type||"nullable"===s.type||"readonly"===s.type||"default"===s.type||"prefault"===s.type||"catch"===s.type)return e(s.innerType,n);if("intersection"===s.type)return e(s.left,n)||e(s.right,n);if("record"===s.type||"map"===s.type)return e(s.keyType,n)||e(s.valueType,n);if("pipe"===s.type)return!!t._zod.traits.has("$ZodCodec")||e(s.in,n)||e(s.out,n);if("object"===s.type){for(let t in s.shape)if(e(s.shape[t],n))return!0;return!1}if("union"===s.type){for(let t of s.options)if(e(t,n))return!0;return!1}if("tuple"===s.type){for(let t of s.items)if(e(t,n))return!0;if(s.rest&&e(s.rest,n))return!0}return!1}(e)&&(delete a.schema.examples,delete a.schema.default),"input"===t.io&&"_prefault"in a.schema&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function sF(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function sD(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let n=new Map;for(let t of e.seen.entries()){let r=e.metadataRegistry.get(t[0])?.id;if(r){let e=n.get(r);if(e&&e!==t[0])throw Error(`Duplicate schema id "${r}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(r,t[0])}}let s=t=>{if(t[1].schema.$ref)return;let n=t[1],{ref:s,defId:i}=(t=>{let n="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let r=e.external.registry.get(t[0])?.id,s=e.external.uri??(e=>e);if(r)return{ref:s(r)};let i=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=i,{defId:i,ref:`${s("__shared")}#/${n}/${sF(i)}`}}let s=`#/${n}/`;if(t[1]===r&&!t[1].schema.id)return{ref:"#"};let i=t[1].schema.id??`__schema${e.counter++}`;return{defId:i,ref:s+sF(i)}})(t);n.def={...n.schema},i&&(n.defId=i);let a=n.schema;for(let e in a)delete a[e];a.$ref=s};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
54
+
55
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let r of e.seen.entries()){let n=r[1];if(t===r[0]){s(r);continue}if(e.external){let n=e.external.registry.get(r[0])?.id;if(t!==r[0]&&n){s(r);continue}}if(e.metadataRegistry.get(r[0])?.id||n.cycle){s(r);continue}n.count>1&&"ref"===e.reused&&s(r)}e.external&&(e.sharedDefsExtractedFor=e.external)}let sB=new Set(["type","properties","required","additionalProperties"]),sK=["oneOf","anyOf"];function sZ(e){let t=e.additionalProperties;return void 0===t||!1===t||"object"!=typeof t||null===t?null:Object.keys(t).length?t:null}function sJ(e){let t=[];for(let r of e){if("object"!=typeof r||"object"!==r.type)return null;for(let e in r)if(!sB.has(e))return null;t.push(r)}let r={},n=new Set;for(let e of t){for(let n in e.properties){if(Object.prototype.hasOwnProperty.call(r,n))continue;let e=[];for(let r of t){let t=r.properties?.[n]??sZ(r);null!=t&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Z(r,n,1===e.length?e[0]:sJ(e)??{allOf:e})}for(let t of e.required??[])n.add(t)}let s={type:"object",properties:r};if(n.size&&(s.required=[...n]),t.every(e=>!1===e.additionalProperties))s.additionalProperties=!1;else{let e=[];for(let r of t){let t=sZ(r);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}1===e.length?s.additionalProperties=e[0]:e.length>1&&(s.additionalProperties={allOf:e})}return s}function sH(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=t=>{let r=e.seen.get(t);if(null===r.ref)return;let s=r.def??r.schema,i={...s},a=r.ref;if(r.ref=null,a){n(a);let r=e.seen.get(a),o=r.schema;if(o.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(s.allOf=s.allOf??[],s.allOf.push(o)):sP(s,o),sP(s,i),t._zod.parent===a)for(let e in s)"$ref"!==e&&"allOf"!==e&&(e in i||delete s[e]);if(o.$ref&&r.def)for(let e in s)"$ref"!==e&&"allOf"!==e&&e in r.def&&JSON.stringify(s[e])===JSON.stringify(r.def[e])&&delete s[e]}let o=t._zod.parent;if(o&&o!==a){n(o);let t=e.seen.get(o);if(t?.schema.$ref&&(s.$ref=t.schema.$ref,t.def))for(let e in s)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(s[e])===JSON.stringify(t.def[e])&&delete s[e]}e.override({zodSchema:t,jsonSchema:s,path:r.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())n(t[0]);if("openapi-3.0"!==e.target)for(let t of e.seen.entries())!function e(t){let r=t.anyOf;if(!Array.isArray(r)||0===r.length||void 0!==t.type)return;let n=[];for(let t of r){if(!t||"object"!=typeof t)return;e(t);let r=Object.keys(t);if(1!==r.length||"type"!==r[0])return;let s=t.type;for(let e of Array.isArray(s)?s:[s]){if("string"!=typeof e)return;n.includes(e)||n.push(e)}}delete t.anyOf,t.type=1===n.length?n[0]:n}(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let r of e.seen.values())for(let e of[r.schema,r.def]){let r=e?.allOf;if(!Array.isArray(r))continue;let n=t.get(r);n?n.push(e):t.set(r,[e])}for(let r of e.intersections)for(let e of t.get(r)??[])!function(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of sB)if(t in e)return;let r=t.filter(e=>sK.some(t=>Array.isArray(e[t]))),n=null;if(r.length){let e=r[0],s=sK.find(t=>Array.isArray(e[t]));if(1!==Object.keys(e).length)return;let i=t.filter(t=>t!==e),a=e[s].map(e=>sJ([...i,e]));if(a.some(e=>!e))return;n={[s]:a}}else n=sJ(t);n&&(delete e.allOf,sP(e,n))}(e)}}let s={};if("draft-2020-12"===e.target?s.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?s.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let r=e.external.registry.get(t)?.id;if(!r)throw Error("Schema is missing an `id` property");s.$id=e.external.uri(r)}sP(s,r.defId?r.schema:r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;void 0!==i&&s.id===i&&delete s.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Z(a,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&("draft-2020-12"===e.target?s.$defs=a:s.definitions=a);try{let r=JSON.parse(JSON.stringify(s));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:sV(t,"input",e.processors),output:sV(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw Error("Error converting schema to JSON.")}}let sV=(e,t,r={})=>n=>{let{libraryOptions:s,target:i}=n??{},a=sR({...s??{},target:i,io:t,processors:r});return sU(e,a),sD(a,e),sH(a,e)},sW=(e,t,r)=>{(void 0===e[t]||r>e[t])&&(e[t]=r)},sG=(e,t,r)=>{(void 0===e[t]||r<e[t])&&(e[t]=r)},sX=(e,t)=>{sW(e,"minimum",t),sG(e,"maximum",t)},sY=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},sQ=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},s0=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},s1=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},s2=(e,t)=>sW(e,"minimum",t.minimum),s5=(e,t)=>sG(e,"maximum",t.maximum),s9=e=>(t,r)=>{s1(t,r.format);let[n,s]=e[r.format];sW(t,"minimum",n),sG(t,"maximum",s)},s6={greater_than:(e,t)=>sW(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>sG(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>sY(e,t.value),number_format:s9(ev),bigint_format:s9(ew),min_length:s2,max_length:s5,length_equals:(e,t)=>sX(e,t.length),min_size:s2,max_size:s5,size_equals:(e,t)=>sX(e,t.size),string_format:(e,t)=>{s1(e,t.format),t.pattern&&sQ(e,t.pattern),("base64"===t.format||"base64url"===t.format)&&(e.contentEncoding=t.format),(t.local||-1===t.precision)&&(e.laxFormat=!0)},mime_type:(e,t)=>s0(e,t.mime)};function s4(e){let t={},r=e._zod.def;for(let n of e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[])s6[n._zod.def.check]?.(t,n._zod.def);let n=e._zod.bag;for(let e of(void 0!==n.minimum&&sW(t,"minimum",n.minimum),void 0!==n.exclusiveMinimum&&sW(t,"exclusiveMinimum",n.exclusiveMinimum),void 0!==n.maximum&&sG(t,"maximum",n.maximum),void 0!==n.exclusiveMaximum&&sG(t,"exclusiveMaximum",n.exclusiveMaximum),void 0!==n.multipleOf&&sY(t,n.multipleOf),void 0!==n.format&&(t.format??(t.format=n.format),n.format.includes("int")&&(t.isInt=!0)),n.mime&&s0(t,n.mime),n.patterns??[]))sQ(t,e);return t}let s3={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},s8=new Map([[nh,tq],[nm,tz]]),s7=e=>s8.get(e)??e;new WeakMap;let ie=Symbol();function it(e,t,r,n,s){let i=!1,a=JSON.stringify(e,(e,t)=>"bigint"!=typeof t?t:(i=!0,null));return i?(sL(t,r,n,s,"BigInt defaults cannot be represented in JSON Schema"),ie):JSON.parse(a)}let ir=(e,t,r,n)=>{let s=e._zod.def;sU(s.innerType,t,n),t.seen.get(e).ref=s.innerType},is=new WeakSet([Object.prototype,Error.prototype]);function ii(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=r(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}let ia=e7("ZodError",(e,t)=>{rN.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);is.has(r)||(is.add(r),ii(r,"format",e=>t=>(function(e,t=e=>e.message){let r={_errors:[]},n=(e,s=[])=>{for(let i of e.issues)if("invalid_union"===i.code&&i.errors.length)i.errors.map(e=>n({issues:e},[...s,...i.path]));else if("invalid_key"===i.code)n({issues:i.issues},[...s,...i.path]);else if("invalid_element"===i.code)n({issues:i.issues},[...s,...i.path]);else{let e=[...s,...i.path];if(0===e.length)r._errors.push(t(i));else{let n=r,s=0;for(;s<e.length;){let r=e[s],a=s===e.length-1;if("_errors"===r){a&&n._errors.push(t(i)),s++;continue}Object.prototype.hasOwnProperty.call(n,r)||Object.defineProperty(n,r,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let o=n[r];a&&o._errors.push(t(i)),n=o,s++}}}};return n(e),r})(e,t)),ii(r,"flatten",e=>t=>(function(e,t=e=>e.message){let r={},n=[];for(let a of e.issues)if(a.path.length>0){var s,i;(s=a.path[0],i=()=>[],!Object.prototype.hasOwnProperty.call(r,s)&&("__proto__"===s?Object.defineProperty(r,s,{value:i(),writable:!0,enumerable:!0,configurable:!0}):r[s]=i()),r[s]).push(t(a))}else n.push(t(a));return{formErrors:n,fieldErrors:r}})(e,t)),ii(r,"addIssue",e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,C,2)}),ii(r,"addIssues",e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,C,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return 0===this.issues.length}}))},void 0,{Parent:Error});e.s(["ZodRealError",0,ia],75214);let io=rz(ia),il=rP(ia),iu=rL(ia),ic=rF(ia),ip=(s=rz(ia),i=(e,t,r,n)=>s(e,t,r?{...r,direction:"backward"}:{direction:"backward"},rq(i,n))),id=(a=rz(ia),o=(e,t,r,n)=>a(e,t,r,rq(o,n))),ih=(l=rP(ia),u=async(e,t,r,n)=>{let s=r?{...r,direction:"backward"}:{direction:"backward"};return await l(e,t,s,rq(u,n))}),im=(c=rP(ia),p=async(e,t,r,n)=>await c(e,t,r,rq(p,n))),iy=(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return rL(ia)(e,t,n)},ig=(e,t,r)=>rL(ia)(e,t,r),ib=async(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return rF(ia)(e,t,n)},iv=async(e,t,r)=>rF(ia)(e,t,r);function iw(){tr.memoizer||tn({memoizer:tp})}let ik=e7("ZodType",(e,t)=>(tr.localeError||tn({localeError:(()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}},t={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function n(e,t){return"number"!==e||"number"!=typeof t||Number.isFinite(t)?r[e]??e:String(t)}return r=>{switch(r.code){case"invalid_type":{let e=n(r.expected),t=n(eF(r.input),r.input);return`Invalid input: expected ${e}, received ${t}`}case"invalid_value":if(1===r.values.length)return`Invalid input: expected ${eg(r.values[0])}`;return`Invalid option: expected one of ${z(r.values,"|")}`;case"too_big":{let t=r.exact?"exactly ":r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Too big: expected ${r.origin??"value"} to have ${t}${r.maximum.toString()} ${n.unit??"elements"}`;return`Too big: expected ${r.origin??"value"} to be ${t}${r.maximum.toString()}`}case"too_small":{let t=r.exact?"exactly ":r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Too small: expected ${r.origin} to have ${t}${r.minimum.toString()} ${n.unit}`;return`Too small: expected ${r.origin} to be ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Invalid string: must start with "${r.prefix}"`;if("ends_with"===r.format)return`Invalid string: must end with "${r.suffix}"`;if("includes"===r.format)return`Invalid string: must include "${r.includes}"`;if("regex"===r.format)return`Invalid string: must match pattern ${r.pattern}`;return`Invalid ${t[r.format]??r.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${z(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":if(r.options&&Array.isArray(r.options)&&r.options.length>0){let e=r.options.map(e=>`'${e}'`).join(" | ");return`Invalid discriminator value. Expected ${e}`}if(!1===r.inclusive)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}})()}),rJ.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(sx.mergeDefs(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return ef(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return new av({type:"custom",check:"custom",fn:e,...em(t)})}(e,t))},superRefine(e,t){return this.check(function(e,t){var r;let n,s;return r=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(eD(e,t.value,n._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),"input"in e||(e.input=t.value),e.inst??(e.inst=n),e.continue??(e.continue=!n._zod.def.abort),t.issues.push(eD(e)))},e(t.value,t)),(s=new rn({check:"custom",...em(t)}))._zod.check=r,n=s}(e,t))},overwrite(e){return this.check(sg(e))},optional(){return al(this)},exactOptional(){var e;return e=this,new au({type:"optional",innerType:e})},nullable(){return ap(this)},nullish(){return al(ap(this))},nonoptional(e){var t,r;return t=this,r=e,new af({type:"nonoptional",innerType:t,...sA.normalizeParams(r)})},array(){return i6(this)},or(e){return new i8({type:"union",options:[this,e],...sA.normalizeParams(void 0)})},and(e){var t;return t=this,new at({type:"intersection",left:t,right:e})},transform(e){return ag(this,new aa({type:"transform",transform:e}))},default(e){var t,r;return t=this,r=e,new ad({type:"default",innerType:t,get defaultValue(){return"function"==typeof r?r():sC.shallowClone(r)}})},prefault(e){var t,r;return t=this,r=e,new ah({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof r?r():sC.shallowClone(r)}})},catch(e){var t,r;return t=this,new am({type:"catch",innerType:t,catchValue:"function"==typeof(r=e)?r:sk.constantCatch(r)})},pipe(e){return ag(this,e)},readonly(){var e;return e=this,new ab({type:"readonly",innerType:e})},describe(e){let t=this.clone();return td.add(t,{description:e}),t},meta(...e){if(0===e.length)return td.get(this);let t=this.clone();return td.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return 0===t.length?e(this):e(this,...t)},get"~standard"(){return s$.hide(this,"~standard",{...rW(this),jsonSchema:{input:sV(this,"input"),output:sV(this,"output")}})},set"~standard"(e){sS.own(this,"~standard",e)},parse:function e(t,r){return io(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await il(this,t,r,{callee:e})},safeParse(e,t){return iu(this,e,t)},async safeParseAsync(e,t){return ic(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){sS.own(this,"spa",e)},validate(e,t){let r=this._zod.bag.validator;if(void 0!==r){if(r(e)!==rD)return!0;if(!0===r.definite&&void 0===t)return!1}return function(e,t,r){let n,s=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun;if(i?(s[rB]=!0,n=i({value:t,issues:[]},s)):n=e._zod.run({value:t,issues:[]},s),n instanceof Promise)throw new te;return 0===n.issues.length}(this,e,t)},validateAsync(e,t){return rK(this,e,t)},encode:function e(t,r){return ip(this,t,r,{callee:e})},decode:function e(t,r){return id(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await ih(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await im(this,t,r,{callee:e})},safeEncode(e,t){return iy(this,e,t)},safeDecode(e,t){return ig(this,e,t)},async safeEncodeAsync(e,t){return ib(this,e,t)},async safeDecodeAsync(e,t){return iv(this,e,t)},toJSONSchema(e){return((e,t={})=>r=>{let n=sR({...r,processors:t});return sU(e,n),sD(n,e),sH(n,e)})(this,{})(e)},get description(){return td.get(this)?.description},get _def(){return this._zod.def}}),ix=e7("_ZodString",(e,t)=>{rG.init(e,t),ik.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r)=>{r.type="string";let{minimum:n,maximum:s,format:i,patterns:a,contentEncoding:o,laxFormat:l}=s4(e);if("number"==typeof n&&(r.minLength=n),"number"==typeof s&&(r.maxLength=s),i&&(r.format=s3[i]??i,""===r.format&&delete r.format,("time"===i||l)&&delete r.format),o&&(r.contentEncoding=o),a&&a.size>0){let e=[...a].map(s7);1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,r)},s_.derived({format:e=>s4(e).format??null,minLength:e=>s4(e).minimum??null,maxLength:e=>s4(e).maximum??null},{regex(...e){return this.check(function(e,t){return new rv({check:"string_format",format:"regex",...em(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new rx({check:"string_format",format:"includes",...em(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new r$({check:"string_format",format:"starts_with",...em(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new rS({check:"string_format",format:"ends_with",...em(t),suffix:e})}(...e))},min(...e){return this.check(sm(...e))},max(...e){return this.check(sf(...e))},length(...e){return this.check(sy(...e))},nonempty(...e){return this.check(sm(1,...e))},lowercase(e){return this.check(new rw({check:"string_format",format:"lowercase",...em(e)}))},uppercase(e){return this.check(new rk({check:"string_format",format:"uppercase",...em(e)}))},trim(){return this.check(sg(e=>e.trim()))},normalize(...e){return this.check(function(e){return sg(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(sg(e=>e.toLowerCase()))},toUpperCase(){return this.check(sg(e=>e.toUpperCase()))},slugify(){return this.check(sg(e=>en(e)))}})),i$=e7("ZodString",(e,t)=>{rG.init(e,t),ix.init(e,t)},{email(e){return this.check(new iM({type:"string",format:"email",check:"string_format",abort:!1,...em(e)}))},url(e){return this.check(new iI({type:"string",format:"url",check:"string_format",abort:!1,...em(e)}))},jwt(e){return this.check(new iV({type:"string",format:"jwt",check:"string_format",abort:!1,...em(e)}))},emoji(e){return this.check(new iq({type:"string",format:"emoji",check:"string_format",abort:!1,...em(e)}))},guid(e){return this.check(new ij({type:"string",format:"guid",check:"string_format",abort:!1,...em(e)}))},uuid(e){return this.check(new iN({type:"string",format:"uuid",check:"string_format",abort:!1,...em(e)}))},uuidv4(e){return this.check(new iN({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...em(e)}))},uuidv6(e){return this.check(new iN({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...em(e)}))},uuidv7(e){return this.check(new iN({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...em(e)}))},nanoid(e){return this.check(new iz({type:"string",format:"nanoid",check:"string_format",abort:!1,...em(e)}))},cuid(e){return this.check(new iC({type:"string",format:"cuid",check:"string_format",abort:!1,...em(e)}))},cuid2(e){return this.check(new iP({type:"string",format:"cuid2",check:"string_format",abort:!1,...em(e)}))},ulid(e){return this.check(new iR({type:"string",format:"ulid",check:"string_format",abort:!1,...em(e)}))},base64(e){return this.check(new iZ({type:"string",format:"base64",check:"string_format",abort:!1,...em(e)}))},base64url(e){return this.check(new iJ({type:"string",format:"base64url",check:"string_format",abort:!1,...em(e)}))},xid(e){return this.check(new iL({type:"string",format:"xid",check:"string_format",abort:!1,...em(e)}))},ksuid(e){return this.check(new iU({type:"string",format:"ksuid",check:"string_format",abort:!1,...em(e)}))},ipv4(e){return this.check(new iF({type:"string",format:"ipv4",check:"string_format",abort:!1,...em(e)}))},ipv6(e){return this.check(new iD({type:"string",format:"ipv6",check:"string_format",abort:!1,...em(e)}))},cidrv4(e){return this.check(new iB({type:"string",format:"cidrv4",check:"string_format",abort:!1,...em(e)}))},cidrv6(e){return this.check(new iK({type:"string",format:"cidrv6",check:"string_format",abort:!1,...em(e)}))},e164(e){return this.check(new iH({type:"string",format:"e164",check:"string_format",abort:!1,...em(e)}))},datetime(e){return this.check(new iA({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...em(e)}))},date(e){return this.check(new iT({type:"string",format:"date",check:"string_format",...em(e)}))},time(e){return this.check(new iO({type:"string",format:"time",check:"string_format",precision:null,...em(e)}))},duration(e){return this.check(new iE({type:"string",format:"duration",check:"string_format",...em(e)}))}});function iS(e){return new i$(sl({type:"string",...em(e)}))}let i_=e7("ZodStringFormat",(e,t)=>{rX.init(e,t),ix.init(e,t)}),iA=e7("ZodISODateTime",(e,t)=>{nr.init(e,t),i_.init(e,t)}),iT=e7("ZodISODate",(e,t)=>{nn.init(e,t),i_.init(e,t)}),iO=e7("ZodISOTime",(e,t)=>{ns.init(e,t),i_.init(e,t)}),iE=e7("ZodISODuration",(e,t)=>{ni.init(e,t),i_.init(e,t)}),iM=e7("ZodEmail",(e,t)=>{r0.init(e,t),i_.init(e,t)}),ij=e7("ZodGUID",(e,t)=>{rY.init(e,t),i_.init(e,t)}),iN=e7("ZodUUID",(e,t)=>{rQ.init(e,t),i_.init(e,t)}),iI=e7("ZodURL",(e,t)=>{r9.init(e,t),i_.init(e,t)}),iq=e7("ZodEmoji",(e,t)=>{r6.init(e,t),i_.init(e,t)}),iz=e7("ZodNanoID",(e,t)=>{r4.init(e,t),i_.init(e,t)}),iC=e7("ZodCUID",(e,t)=>{r3.init(e,t),i_.init(e,t)}),iP=e7("ZodCUID2",(e,t)=>{r8.init(e,t),i_.init(e,t)}),iR=e7("ZodULID",(e,t)=>{r7.init(e,t),i_.init(e,t)}),iL=e7("ZodXID",(e,t)=>{ne.init(e,t),i_.init(e,t)}),iU=e7("ZodKSUID",(e,t)=>{nt.init(e,t),i_.init(e,t)}),iF=e7("ZodIPv4",(e,t)=>{na.init(e,t),i_.init(e,t)}),iD=e7("ZodIPv6",(e,t)=>{nu.init(e,t),i_.init(e,t)}),iB=e7("ZodCIDRv4",(e,t)=>{nc.init(e,t),i_.init(e,t)}),iK=e7("ZodCIDRv6",(e,t)=>{np.init(e,t),i_.init(e,t)}),iZ=e7("ZodBase64",(e,t)=>{nf.init(e,t),i_.init(e,t)}),iJ=e7("ZodBase64URL",(e,t)=>{ny.init(e,t),i_.init(e,t)}),iH=e7("ZodE164",(e,t)=>{ng.init(e,t),i_.init(e,t)}),iV=e7("ZodJWT",(e,t)=>{nv.init(e,t),i_.init(e,t)}),iW=e7("ZodNumber",(e,t)=>{nw.init(e,t),ik.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let{minimum:s,maximum:i,multipleOf:a,exclusiveMaximum:o,exclusiveMinimum:l,isInt:u}=s4(e);r.type=u?"integer":"number";let c="number"==typeof l&&l>=(s??-1/0),p="number"==typeof o&&o<=(i??1/0),d="draft-04"===t.target||"openapi-3.0"===t.target;if(c?d?(r.minimum=l,r.exclusiveMinimum=!0):r.exclusiveMinimum=l:"number"==typeof s&&(r.minimum=s),p?d?(r.maximum=o,r.exclusiveMaximum=!0):r.exclusiveMaximum=o:"number"==typeof i&&(r.maximum=i),a){let s=new Set;for(let i of a)Number.isFinite(i)&&0!==i?s.add(Math.abs(i)):sL(e,t,r,n,`A multipleOf divisor of ${i} cannot be represented in JSON Schema`);let[i,...o]=s;void 0!==i&&(r.multipleOf=i),o.length&&(r.allOf=[...r.allOf??[],...o.map(e=>({multipleOf:e}))])}})(e,t,r,n),e.isFinite=!0},s_.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=s4(e);return Math.max(t??-1/0,r??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=s4(e);return Math.min(t??1/0,r??1/0)},isInt:e=>{let{isInt:t,multipleOf:r}=s4(e);return!!t||!!r?.some(Number.isSafeInteger)},format:e=>s4(e).format??null},{gt(e,t){return this.check(sp(e,t))},gte(e,t){return this.check(sd(e,t))},min(e,t){return this.check(sd(e,t))},lt(e,t){return this.check(su(e,t))},lte(e,t){return this.check(sc(e,t))},max(e,t){return this.check(sc(e,t))},int(e){return this.check(iY(e))},safe(e){return this.check(iY(e))},positive(e){return this.check(sp(0,e))},nonnegative(e){return this.check(sd(0,e))},negative(e){return this.check(su(0,e))},nonpositive(e){return this.check(sc(0,e))},multipleOf(e,t){return this.check(sh(e,t))},step(e,t){return this.check(sh(e,t))},finite(){return this}}));function iG(e){return new iW(sl({type:"number",checks:[],...em(e)}))}let iX=e7("ZodNumberFormat",(e,t)=>{nk.init(e,t),iW.init(e,t)});function iY(e){return new iX({type:"number",check:"number_format",abort:!1,format:"safeint",...em(e)})}let iQ=e7("ZodBoolean",(e,t)=>{nx.init(e,t),ik.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{t.type="boolean"}});function i0(e){return new iQ({type:"boolean",...em(e)})}(e,t)=>{n$.init(e,t),ik.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{sL(e,t,r,n,"BigInt cannot be represented in JSON Schema")}};let i1=e7("ZodUnknown",(e,t)=>{nS.init(e,t),ik.init(e,t),e._zod.processJSONSchema=(e,t,r)=>void 0});function i2(){return new i1({type:"unknown"})}let i5=e7("ZodNever",(e,t)=>{n_.init(e,t),ik.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{t.not={}}}),i9=e7("ZodArray",(e,t)=>{iw(),nj.init(e,t),ik.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let s=e._zod.def,{minimum:i,maximum:a}=s4(e);"number"==typeof i&&(r.minItems=i),"number"==typeof a&&(r.maxItems=a),r.type="array",r.items=sU(s.element,t,{...n,path:[...n.path,"items"]})})(e,t,r,n),e.element=t.element},{min(e,t){return this.check(sm(e,t))},nonempty(e){return this.check(sm(1,e))},max(e,t){return this.check(sf(e,t))},length(e,t){return this.check(sy(e,t))},unwrap(){return this.element}});function i6(e,t){return new i9({type:"array",element:e,...em(t)})}let i4=e7("ZodObject",(e,t)=>{iw(),nP.init(e,t),ik.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let s=e._zod.def,i=s.shape;if(Object.getOwnPropertySymbols(i).length&&sL(e,t,r,n,"Symbol keys cannot be represented in JSON Schema"))return;for(let e in r.type="object",r.properties={},i)Z(r.properties,e,sU(i[e],t,{...n,path:[...n.path,"properties",e]}));let a=[];for(let e of Object.keys(i)){let r=s.shape[e];("input"===t.io?void 0===function e(t){let r=t._zod.def;return"pipe"===r.type&&r.in._zod.traits.has("$ZodTransform")?e(r.out):"catch"===r.type?e(r.innerType):t._zod.optin}(r):void 0===r._zod.optout)&&a.push(e)}a.length>0&&(r.required=a),s.catchall?._zod.def.type==="never"?r.additionalProperties=!1:s.catchall?s.catchall&&(r.additionalProperties=sU(s.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):"output"===t.io&&(r.additionalProperties=!1)})(e,t,r,n),sq.installLazyProp(e,"shape",e=>e._zod.def.shape,!1)},{keyof(){return an(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(sx.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(sx.mergeDefs(this._zod.def,{catchall:i2()}))},loose(){return this.clone(sx.mergeDefs(this._zod.def,{catchall:i2()}))},strict(){return this.clone(sx.mergeDefs(this._zod.def,{catchall:new i5({type:"never",...em(void 0)})}))},strip(){return this.clone(sx.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return sT.extend(this,e)},safeExtend(e){return sO.safeExtend(this,e)},merge(e){return sE.merge(this,e)},pick(e){return sM.pick(this,e)},omit(e){return sj.omit(this,e)},partial(...e){return sN.partial(ao,this,e[0])},exactPartial(...e){return sN.partial(au,this,e[0],"exactPartial")},required(...e){return sI.required(af,this,e[0])}});function i3(e,t){return new i4({type:"object",shape:e??{},...sA.normalizeParams(t)})}let i8=e7("ZodUnion",(e,t)=>{nL.init(e,t),ik.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{var s,i,a,o;let l,u,c;return s=e,i=t,a=r,o=n,u=!1===(l=s._zod.def).inclusive,c=l.options.map((e,t)=>sU(e,i,{...o,path:[...o.path,u?"oneOf":"anyOf",t]})),void(u?a.oneOf=c:a.anyOf=c)},e.options=t.options}),i7=e7("ZodDiscriminatedUnion",(e,t)=>{i8.init(e,t),nF.init(e,t)});function ae(e,t,r){return new i7({type:"union",options:t,discriminator:e,...sA.normalizeParams(r)})}let at=e7("ZodIntersection",(e,t)=>{nD.init(e,t),ik.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let s,i,a,o,l;return i=sU((s=e._zod.def).left,t,{...n,path:[...n.path,"allOf",0]}),a=sU(s.right,t,{...n,path:[...n.path,"allOf",1]}),void(r.allOf=l=[...(o=e=>"allOf"in e&&1===Object.keys(e).length)(i)?i.allOf:[i],...o(a)?a.allOf:[a]],t.intersections.push(l))}}),ar=e7("ZodEnum",(e,t)=>{nG.init(e,t),ik.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t)=>{let r=q(e._zod.def.entries);if(0===r.length){t.not={};return}r.every(e=>"number"==typeof e)&&(t.type="number"),r.every(e=>"string"==typeof e)&&(t.type="string"),t.enum=r})(e,r),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(e,n)=>{let s={};for(let n of e)if(r.has(n))s[n]=t.entries[n];else throw Error(`Key ${n} not found in enum`);return new ar({...t,checks:[],...sA.normalizeParams(n),entries:s})},e.exclude=(e,n)=>{let s={...t.entries};for(let t of e)if(r.has(t))delete s[t];else throw Error(`Key ${t} not found in enum`);return new ar({...t,checks:[],...sA.normalizeParams(n),entries:s})}});function an(e,t){return new ar({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...sA.normalizeParams(t)})}let as=e7("ZodLiteral",(e,t)=>{nX.init(e,t),ik.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let s=e._zod.def;if(0===s.values.length){r.not={};return}let i=[];for(let a of s.values)if(void 0===a){if(sL(e,t,r,n,"Literal `undefined` cannot be represented in JSON Schema"))return}else if("bigint"==typeof a){if(sL(e,t,r,n,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(a))}else i.push(a);if(0===i.length);else if(1===i.length){let e=i[0];r.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?r.enum=[e]:r.const=e}else i.every(e=>"number"==typeof e)&&(r.type="number"),i.every(e=>"string"==typeof e)&&(r.type="string"),i.every(e=>"boolean"==typeof e)&&(r.type="boolean"),i.every(e=>null===e)&&(r.type="null"),r.enum=i})(e,t,r,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function ai(e,t){return new as({type:"literal",values:Array.isArray(e)?e:[e],...sA.normalizeParams(t)})}let aa=e7("ZodTransform",(e,t)=>{iw(),nY.init(e,t),ik.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{sL(e,t,r,n,"Transforms cannot be represented in JSON Schema")},e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new tt(e.constructor.name);r.addIssue=n=>{"string"==typeof n?r.issues.push(sz.issue(n,r.value,t)):(n.fatal&&(n.continue=!1),n.code??(n.code="custom"),"input"in n||(n.input=r.value),n.inst??(n.inst=e),r.issues.push(sz.issue(n)))};let s=t.transform(r.value,r);return s instanceof Promise?s.then(e=>(r.value=e,r)):(r.value=s,r)}}),ao=e7("ZodOptional",(e,t)=>{n0.init(e,t),ik.init(e,t),e._zod.processJSONSchema=(t,r,n)=>ir(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});function al(e){return new ao({type:"optional",innerType:e})}let au=e7("ZodExactOptional",(e,t)=>{n1.init(e,t),ik.init(e,t),e._zod.processJSONSchema=(t,r,n)=>ir(e,t,r,n),e.unwrap=()=>e._zod.def.innerType}),ac=e7("ZodNullable",(e,t)=>{n2.init(e,t),ik.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let s,i,a;return i=sU((s=e._zod.def).innerType,t,n),a=t.seen.get(e),void("openapi-3.0"===t.target?(a.ref=s.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}])},e.unwrap=()=>e._zod.def.innerType});function ap(e){return new ac({type:"nullable",innerType:e})}let ad=e7("ZodDefault",(e,t)=>{n5.init(e,t),ik.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let s,i;return sU((s=e._zod.def).innerType,t,n),t.seen.get(e).ref=s.innerType,void((i=it(s.defaultValue,e,t,r,n))!==ie&&(r.default=i))},e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),ah=e7("ZodPrefault",(e,t)=>{n6.init(e,t),ik.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let s=e._zod.def;if(sU(s.innerType,t,n),t.seen.get(e).ref=s.innerType,"input"!==t.io)return;let i=it(s.defaultValue,e,t,r,n);i!==ie&&(r._prefault=i)})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType}),af=e7("ZodNonOptional",(e,t)=>{n4.init(e,t),ik.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let s;sU((s=e._zod.def).innerType,t,n),t.seen.get(e).ref=s.innerType},e.unwrap=()=>e._zod.def.innerType}),am=e7("ZodCatch",(e,t)=>{n7.init(e,t),ik.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let s,i=e._zod.def;sU(i.innerType,t,n),t.seen.get(e).ref=i.innerType;try{s=i.catchValue(void 0)}catch{sL(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=s})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),ay=e7("ZodPipe",(e,t)=>{se.init(e,t),ik.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let s,i,a;return i=(s=e._zod.def).in._zod.traits.has("$ZodTransform"),void(sU(a="input"===t.io?i?s.out:s.in:s.out,t,n),t.seen.get(e).ref=a)},e.in=t.in,e.out=t.out});function ag(e,t){return new ay({type:"pipe",in:e,out:t})}let ab=e7("ZodReadonly",(e,t)=>{ss.init(e,t),ik.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let s;sU((s=e._zod.def).innerType,t,n),t.seen.get(e).ref=s.innerType,r.readOnly=!0},e.unwrap=()=>e._zod.def.innerType}),av=e7("ZodCustom",(e,t)=>{sa.init(e,t),ik.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{sL(e,t,r,n,"Custom types cannot be represented in JSON Schema")}});e.s(["array",0,i6,"boolean",0,i0,"discriminatedUnion",0,ae,"enum",0,an,"literal",0,ai,"number",0,iG,"object",0,i3,"string",0,iS,"unknown",0,i2],86752),e.i(86752),e.s([],4435),e.i(4435),e.i(75214),e.s([],68959),e.i(68959);let aw={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};sw||(sw={}),e.s(["ZodIssueCode",0,aw],38220),e.i(38220),e.s(["ZodIssueCode",0,aw,"array",0,i6,"boolean",0,i0,"discriminatedUnion",0,ae,"enum",0,an,"literal",0,ai,"number",0,iG,"object",0,i3,"string",0,iS,"unknown",0,i2],77698);var ak=e.i(77698),ak=ak,ax=ak,a$=ak,aS=ak,a_=ak,aA=ak;let aT=ak.discriminatedUnion("type",[ax.object({type:a$.literal("status"),expect:aS.string().min(1).max(100)}).strict(),ax.object({type:a$.literal("body"),op:a_.enum(["contains","not_contains","matches","is_json"]),value:aS.string().max(2e3).default("")}).strict(),ax.object({type:a$.literal("json"),path:aS.string().min(1).max(300),op:a_.enum(["exists","not_exists","equals","not_equals","contains","greater","less","matches","type","length"]),value:aS.string().max(2e3).default("")}).strict(),ax.object({type:a$.literal("header"),name:aS.string().min(1).max(200),op:a_.enum(["exists","not_exists","equals","contains","matches"]),value:aS.string().max(2e3).default("")}).strict(),ax.object({type:a$.literal("time"),maxMs:aA.number().positive().max(6e5)}).strict(),ax.object({type:a$.literal("schema"),schema:aS.string().max(2e5)}).strict()]);function aO(e){switch(e.type){case"status":return`status is ${e.expect.replace(/\s+/g,"")}`;case"body":if("is_json"===e.op)return"body is JSON";if("matches"===e.op)return`body matches /${aE(e.value)}/`;return`body ${"contains"===e.op?"contains":"does not contain"} "${aE(e.value)}"`;case"json":{let t,r=(t=e.path.trim().replace(/^\$\.?/,""))?`$.${t}`:"$";switch(e.op){case"exists":return`${r} exists`;case"not_exists":return`${r} does not exist`;case"greater":return`${r} > ${aE(e.value)}`;case"less":return`${r} < ${aE(e.value)}`;case"matches":return`${r} matches /${aE(e.value)}/`;case"type":return`${r} is ${/^[aeiou]/.test(e.value)?"an":"a"} ${e.value||"?"}`;case"length":return`length of ${r} ${function(e){let t=/^\s*(>=|<=|!=|>|<|=)?\s*(\d+)\s*$/.exec(e);if(!t)return{label:`is ${e.trim()||"?"}`};let r=t[1]??"=";return{label:`${"="===r?"=":"!="===r?"≠":">="===r?"≥":"<="===r?"≤":r} ${t[2]}`}}(e.value).label}`;default:return`${r} ${"equals"===e.op?"=":"not_equals"===e.op?"≠":"contains"} "${aE(e.value)}"`}}case"header":if("exists"===e.op)return`header ${e.name} exists`;if("not_exists"===e.op)return`header ${e.name} does not exist`;if("matches"===e.op)return`header ${e.name} matches /${aE(e.value)}/`;return`header ${e.name} ${"equals"===e.op?"=":"contains"} "${aE(e.value)}"`;case"time":return`responds within ${e.maxMs} ms`;case"schema":{let t=function(e){try{let t=JSON.parse(e);return"string"==typeof t?.title&&t.title.trim()?t.title.trim():void 0}catch{return}}(e.schema);return t?`body matches schema "${aE(t)}"`:"body matches the JSON schema"}}}function aE(e){return e.length>40?`${e.slice(0,39)}…`:e}String.raw`
56
+ function __atcStatusOk(expect, status) {
57
+ var parts = String(expect).split(",");
58
+ for (var i = 0; i < parts.length; i++) {
59
+ var p = parts[i].trim().toLowerCase();
60
+ if (!p) continue;
61
+ var cls = p.match(/^([1-5])xx$/);
62
+ if (cls) { if (Math.floor(status / 100) === Number(cls[1])) return true; continue; }
63
+ var range = p.match(/^(\d{3})\s*-\s*(\d{3})$/);
64
+ if (range) { if (status >= Number(range[1]) && status <= Number(range[2])) return true; continue; }
65
+ if (/^\d{3}$/.test(p) && Number(p) === status) return true;
66
+ }
67
+ return false;
68
+ }
69
+ function __atcJsonGet(root, path) {
70
+ var text = String(path).trim().replace(/^\$\.?/, "");
71
+ if (!text) return { found: true, value: root };
72
+ var tokens = [];
73
+ var re = /([^.\[\]]+)|\[(\d+)\]/g;
74
+ var m;
75
+ while ((m = re.exec(text)) !== null) tokens.push(m[1] !== undefined ? m[1] : Number(m[2]));
76
+ var cur = root;
77
+ for (var i = 0; i < tokens.length; i++) {
78
+ if (cur === null || typeof cur !== "object" || !(tokens[i] in cur)) return { found: false, value: undefined };
79
+ cur = cur[tokens[i]];
80
+ }
81
+ return { found: true, value: cur };
82
+ }
83
+ function __atcAsText(value) {
84
+ if (typeof value === "string") return value;
85
+ if (value === undefined) return "";
86
+ return JSON.stringify(value);
87
+ }
88
+ function __atcTypeOf(value) {
89
+ if (value === null) return "null";
90
+ if (Array.isArray(value)) return "array";
91
+ return typeof value;
92
+ }
93
+ function __atcIsType(value, type) {
94
+ if (type === "integer") return typeof value === "number" && isFinite(value) && Math.floor(value) === value;
95
+ if (type === "number") return typeof value === "number" && isFinite(value);
96
+ return __atcTypeOf(value) === type;
97
+ }
98
+ function __atcMatches(pattern, text) {
99
+ try { return new RegExp(pattern).test(text); } catch (e) { return false; }
100
+ }
101
+ function __atcLengthOk(rule, n) {
102
+ var m = String(rule).match(/^\s*(>=|<=|!=|>|<|=)?\s*(\d+)\s*$/);
103
+ if (!m) return false;
104
+ var want = Number(m[2]);
105
+ var op = m[1] || "=";
106
+ if (op === ">") return n > want;
107
+ if (op === "<") return n < want;
108
+ if (op === ">=") return n >= want;
109
+ if (op === "<=") return n <= want;
110
+ if (op === "!=") return n !== want;
111
+ return n === want;
112
+ }
113
+ function __atcPathText(path) { return path === "" ? "$" : "$" + path; }
114
+ // JSON Schema, the parts APIs use: type (and nullable), enum, const, properties, required,
115
+ // additionalProperties, items, min/max (Length, Items, imum), pattern, allOf/anyOf/oneOf,
116
+ // local $ref. Returns the first problem as "$.items[0].id should be number", or null.
117
+ function __atcSchemaError(schema, value, path, root, depth) {
118
+ if (schema === true || schema === undefined || schema === null) return null;
119
+ if (schema === false) return __atcPathText(path) + " should not be there";
120
+ if (depth > 60) return null;
121
+ if (typeof schema.$ref === "string") {
122
+ var ref = schema.$ref.replace(/^#\/?/, "").split("/");
123
+ var target = root;
124
+ for (var r = 0; r < ref.length && target; r++) if (ref[r]) target = target[ref[r].replace(/~1/g, "/").replace(/~0/g, "~")];
125
+ return target ? __atcSchemaError(target, value, path, root, depth + 1) : null;
126
+ }
127
+ var where = __atcPathText(path);
128
+ if (schema.type !== undefined) {
129
+ var types = Array.isArray(schema.type) ? schema.type : [schema.type];
130
+ if (schema.nullable === true) types = types.concat(["null"]);
131
+ var okType = false;
132
+ for (var t = 0; t < types.length; t++) if (__atcIsType(value, types[t])) okType = true;
133
+ if (!okType) return where + " should be " + types.join(" or ") + " (it is " + __atcTypeOf(value) + ")";
134
+ }
135
+ if (schema.enum && Array.isArray(schema.enum)) {
136
+ var inEnum = false;
137
+ for (var e = 0; e < schema.enum.length; e++) if (JSON.stringify(schema.enum[e]) === JSON.stringify(value)) inEnum = true;
138
+ if (!inEnum) return where + " should be one of " + JSON.stringify(schema.enum);
139
+ }
140
+ if (schema.const !== undefined && JSON.stringify(schema.const) !== JSON.stringify(value)) return where + " should be " + JSON.stringify(schema.const);
141
+ if (typeof value === "string") {
142
+ if (typeof schema.minLength === "number" && value.length < schema.minLength) return where + " should be at least " + schema.minLength + " characters";
143
+ if (typeof schema.maxLength === "number" && value.length > schema.maxLength) return where + " should be at most " + schema.maxLength + " characters";
144
+ if (typeof schema.pattern === "string" && !__atcMatches(schema.pattern, value)) return where + " should match /" + schema.pattern + "/";
145
+ }
146
+ if (typeof value === "number") {
147
+ if (typeof schema.minimum === "number" && value < schema.minimum) return where + " should be at least " + schema.minimum;
148
+ if (typeof schema.maximum === "number" && value > schema.maximum) return where + " should be at most " + schema.maximum;
149
+ if (typeof schema.exclusiveMinimum === "number" && value <= schema.exclusiveMinimum) return where + " should be more than " + schema.exclusiveMinimum;
150
+ if (typeof schema.exclusiveMaximum === "number" && value >= schema.exclusiveMaximum) return where + " should be less than " + schema.exclusiveMaximum;
151
+ }
152
+ if (Array.isArray(value)) {
153
+ if (typeof schema.minItems === "number" && value.length < schema.minItems) return where + " should have at least " + schema.minItems + " items";
154
+ if (typeof schema.maxItems === "number" && value.length > schema.maxItems) return where + " should have at most " + schema.maxItems + " items";
155
+ if (schema.items && typeof schema.items === "object" && !Array.isArray(schema.items)) {
156
+ for (var i = 0; i < value.length; i++) {
157
+ var itemErr = __atcSchemaError(schema.items, value[i], path + "[" + i + "]", root, depth + 1);
158
+ if (itemErr) return itemErr;
159
+ }
160
+ }
161
+ }
162
+ if (value !== null && typeof value === "object" && !Array.isArray(value)) {
163
+ var req = Array.isArray(schema.required) ? schema.required : [];
164
+ for (var q = 0; q < req.length; q++) if (!Object.prototype.hasOwnProperty.call(value, req[q])) return where + " should have " + req[q];
165
+ var props = schema.properties && typeof schema.properties === "object" ? schema.properties : {};
166
+ for (var key in value) {
167
+ if (!Object.prototype.hasOwnProperty.call(value, key)) continue;
168
+ var sub = path + (/^[A-Za-z_$][\w$]*$/.test(key) ? "." + key : "[" + JSON.stringify(key) + "]");
169
+ if (Object.prototype.hasOwnProperty.call(props, key)) {
170
+ var propErr = __atcSchemaError(props[key], value[key], sub, root, depth + 1);
171
+ if (propErr) return propErr;
172
+ } else if (schema.additionalProperties === false) {
173
+ return __atcPathText(sub) + " is not expected";
174
+ } else if (schema.additionalProperties && typeof schema.additionalProperties === "object") {
175
+ var addErr = __atcSchemaError(schema.additionalProperties, value[key], sub, root, depth + 1);
176
+ if (addErr) return addErr;
177
+ }
178
+ }
179
+ }
180
+ if (Array.isArray(schema.allOf)) {
181
+ for (var a = 0; a < schema.allOf.length; a++) {
182
+ var allErr = __atcSchemaError(schema.allOf[a], value, path, root, depth + 1);
183
+ if (allErr) return allErr;
184
+ }
185
+ }
186
+ var some = schema.anyOf || schema.oneOf;
187
+ if (Array.isArray(some) && some.length) {
188
+ var first = null;
189
+ var matched = 0;
190
+ for (var s = 0; s < some.length; s++) {
191
+ var someErr = __atcSchemaError(some[s], value, path, root, depth + 1);
192
+ if (!someErr) matched++;
193
+ else if (!first) first = someErr;
194
+ }
195
+ if (!matched) return first;
196
+ if (schema.oneOf && matched > 1) return where + " matches more than one of oneOf";
197
+ }
198
+ return null;
199
+ }
200
+ function __atcParsedSchema(check) {
201
+ if (check.__parsed === undefined) {
202
+ try { check.__parsed = JSON.parse(check.schema); } catch (e) { check.__parsed = null; }
203
+ }
204
+ return check.__parsed;
205
+ }
206
+ function __atcCheck(check, res) {
207
+ if (check.type === "status") return __atcStatusOk(check.expect, res.status);
208
+ if (check.type === "time") return res.durationMs <= check.maxMs;
209
+ if (check.type === "header") {
210
+ var h = res.headers[String(check.name).toLowerCase()];
211
+ if (check.op === "exists") return h !== undefined;
212
+ if (check.op === "not_exists") return h === undefined;
213
+ if (h === undefined) return false;
214
+ if (check.op === "matches") return __atcMatches(check.value, h);
215
+ return check.op === "equals" ? h === check.value : h.indexOf(check.value) >= 0;
216
+ }
217
+ if (res.body === null || res.body === undefined) return false;
218
+ if (check.type === "body") {
219
+ if (check.op === "is_json") { try { JSON.parse(res.body); return true; } catch (e) { return false; } }
220
+ if (check.op === "matches") return __atcMatches(check.value, res.body);
221
+ var has = res.body.indexOf(check.value) >= 0;
222
+ return check.op === "contains" ? has : !has;
223
+ }
224
+ var parsed;
225
+ try { parsed = JSON.parse(res.body); } catch (e) { return false; }
226
+ if (check.type === "schema") {
227
+ var schema = __atcParsedSchema(check);
228
+ return schema !== null && __atcSchemaError(schema, parsed, "", schema, 0) === null;
229
+ }
230
+ if (check.type === "json") {
231
+ var got = __atcJsonGet(parsed, check.path);
232
+ if (check.op === "exists") return got.found;
233
+ if (check.op === "not_exists") return !got.found;
234
+ if (!got.found) return check.op === "not_equals";
235
+ if (check.op === "type") return __atcIsType(got.value, String(check.value).trim().toLowerCase());
236
+ if (check.op === "length") {
237
+ var v = got.value;
238
+ var n = typeof v === "string" || Array.isArray(v) ? v.length : v !== null && typeof v === "object" ? Object.keys(v).length : -1;
239
+ return n >= 0 && __atcLengthOk(check.value, n);
240
+ }
241
+ if (check.op === "greater" || check.op === "less") {
242
+ var num = Number(got.value);
243
+ var lim = Number(check.value);
244
+ if (got.value === null || got.value === "" || typeof got.value === "boolean" || !isFinite(num) || String(check.value).trim() === "" || !isFinite(lim)) return false;
245
+ return check.op === "greater" ? num > lim : num < lim;
246
+ }
247
+ var text = __atcAsText(got.value);
248
+ if (check.op === "matches") return __atcMatches(check.value, text);
249
+ if (check.op === "equals") return text === check.value;
250
+ if (check.op === "not_equals") return text !== check.value;
251
+ return text.indexOf(check.value) >= 0;
252
+ }
253
+ return false;
254
+ }
255
+ `,e.s(["t",0,["string","number","integer","boolean","array","object","null"],"w",0,aO,"U",0,aT,"s",0,function(e){return{$schema:"http://json-schema.org/draft-07/schema#",...function e(t,r){if(r>30)return{};if(null===t)return{type:"null"};if(Array.isArray(t)){let n=t.slice(0,50).map(t=>e(t,r+1));return n.length?{type:"array",items:n.reduce(function e(t,r){let n=e=>Array.isArray(e.type)?e.type:e.type?[e.type]:[],s=[...new Set([...n(t),...n(r)])];s.includes("integer")&&s.includes("number")&&(s=s.filter(e=>"integer"!==e));let i={type:1===s.length?s[0]:s};if(t.properties||r.properties){let n=t.properties??{},s=r.properties??{},a=[...new Set([...Object.keys(n),...Object.keys(s)])];i.properties=Object.fromEntries(a.map(t=>[t,n[t]&&s[t]?e(n[t],s[t]):n[t]??s[t]]));let o=new Set(t.required??(t.properties?[]:Object.keys(s))),l=new Set(r.required??(r.properties?[]:Object.keys(n)));i.required=a.filter(e=>o.has(e)&&l.has(e))}return(t.items||r.items)&&(i.items=t.items&&r.items?e(t.items,r.items):t.items??r.items),i})}:{type:"array"}}if("object"==typeof t){let n=Object.entries(t);return{type:"object",properties:Object.fromEntries(n.map(([t,n])=>[t,e(n,r+1)])),required:n.map(([e])=>e)}}return"number"==typeof t?{type:"number"}:{type:typeof t}}(e,0)}}],70632);var a_=ak,aS=ak,ax=ak,aA=ak,ak=ak,a$=ak,aM=ak,aj=ak,aN=ak,aI=ak;function aq(e){let t=new Set;for(let r of e.matchAll(/(?:pm\.(?:environment|variables|collectionVariables|globals)\.set|postman\.set(?:Environment|Global)Variable)\(\s*(["'`])([A-Za-z_][\w.-]*)\1/g))t.add(r[2]);return[...t]}String.raw`
256
+ function __atcScriptText(v) {
257
+ if (typeof v === "string") return v;
258
+ if (v === undefined) return "undefined";
259
+ try { return JSON.stringify(v); } catch (e) { return String(v); }
260
+ }
261
+ function __atcDeepEqual(a, b) {
262
+ if (a === b) return true;
263
+ if (typeof a !== typeof b || a === null || b === null || typeof a !== "object") return a !== a && b !== b;
264
+ if (Array.isArray(a) !== Array.isArray(b)) return false;
265
+ var ka = Object.keys(a), kb = Object.keys(b);
266
+ if (ka.length !== kb.length) return false;
267
+ for (var i = 0; i < ka.length; i++) if (!__atcDeepEqual(a[ka[i]], b[ka[i]])) return false;
268
+ return true;
269
+ }
270
+ function __atcTypeName(v) {
271
+ if (v === null) return "null";
272
+ if (Array.isArray(v)) return "array";
273
+ if (v instanceof RegExp) return "regexp";
274
+ return typeof v;
275
+ }
276
+ function __atcExpect(actual) {
277
+ var flags = { not: false, deep: false };
278
+ var self = {};
279
+ function check(ok, message, negMessage) {
280
+ if (flags.not ? ok : !ok) throw new Error(flags.not ? negMessage : message);
281
+ return self;
282
+ }
283
+ // Long values (a whole response) are cut, so the message stays readable.
284
+ var show = function (v) { var t = __atcScriptText(v); return t.length > 120 ? t.slice(0, 119) + "…" : t; };
285
+ var chain = ["to", "be", "been", "is", "that", "which", "and", "has", "have", "with", "at", "of", "same", "but", "does", "still"];
286
+ for (var c = 0; c < chain.length; c++) Object.defineProperty(self, chain[c], { get: function () { return self; } });
287
+ Object.defineProperty(self, "not", { get: function () { flags.not = !flags.not; return self; } });
288
+ Object.defineProperty(self, "deep", { get: function () { flags.deep = true; return self; } });
289
+ var props = {
290
+ ok: function () { return check(!!actual, "expected " + show(actual) + " to be truthy", "expected " + show(actual) + " to be falsy"); },
291
+ true: function () { return check(actual === true, "expected " + show(actual) + " to be true", "expected " + show(actual) + " not to be true"); },
292
+ false: function () { return check(actual === false, "expected " + show(actual) + " to be false", "expected " + show(actual) + " not to be false"); },
293
+ null: function () { return check(actual === null, "expected " + show(actual) + " to be null", "expected value not to be null"); },
294
+ undefined: function () { return check(actual === undefined, "expected " + show(actual) + " to be undefined", "expected value not to be undefined"); },
295
+ exist: function () { return check(actual !== null && actual !== undefined, "expected value to exist", "expected " + show(actual) + " not to exist"); },
296
+ empty: function () {
297
+ var n = typeof actual === "string" || Array.isArray(actual) ? actual.length : actual && typeof actual === "object" ? Object.keys(actual).length : -1;
298
+ return check(n === 0, "expected " + show(actual) + " to be empty", "expected " + show(actual) + " not to be empty");
299
+ },
300
+ NaN: function () { return check(actual !== actual, "expected " + show(actual) + " to be NaN", "expected value not to be NaN"); }
301
+ };
302
+ for (var p in props) (function (name, fn) { Object.defineProperty(self, name, { get: fn }); })(p, props[p]);
303
+ self.equal = self.equals = self.eq = function (v) {
304
+ var ok = flags.deep ? __atcDeepEqual(actual, v) : actual === v;
305
+ return check(ok, "expected " + show(actual) + " to equal " + show(v), "expected " + show(actual) + " not to equal " + show(v));
306
+ };
307
+ self.eql = self.eqls = function (v) { return check(__atcDeepEqual(actual, v), "expected " + show(actual) + " to deeply equal " + show(v), "expected " + show(actual) + " not to deeply equal " + show(v)); };
308
+ self.above = self.gt = self.greaterThan = function (n) { return check(actual > n, "expected " + show(actual) + " to be above " + n, "expected " + show(actual) + " to be at most " + n); };
309
+ self.below = self.lt = self.lessThan = function (n) { return check(actual < n, "expected " + show(actual) + " to be below " + n, "expected " + show(actual) + " to be at least " + n); };
310
+ self.least = self.gte = function (n) { return check(actual >= n, "expected " + show(actual) + " to be at least " + n, "expected " + show(actual) + " to be below " + n); };
311
+ self.most = self.lte = function (n) { return check(actual <= n, "expected " + show(actual) + " to be at most " + n, "expected " + show(actual) + " to be above " + n); };
312
+ self.within = function (a, b) { return check(actual >= a && actual <= b, "expected " + show(actual) + " to be within " + a + ".." + b, "expected " + show(actual) + " not to be within " + a + ".." + b); };
313
+ self.a = self.an = function (type) {
314
+ var t = String(type).toLowerCase();
315
+ return check(__atcTypeName(actual) === t, "expected " + show(actual) + " to be " + (/^[aeiou]/.test(t) ? "an " : "a ") + t, "expected " + show(actual) + " not to be " + (/^[aeiou]/.test(t) ? "an " : "a ") + t);
316
+ };
317
+ self.include = self.includes = self.contain = self.contains = function (v) {
318
+ var ok;
319
+ if (typeof actual === "string") ok = actual.indexOf(String(v)) >= 0;
320
+ else if (Array.isArray(actual)) { ok = false; for (var i = 0; i < actual.length; i++) if (flags.deep ? __atcDeepEqual(actual[i], v) : actual[i] === v) ok = true; }
321
+ else if (actual && typeof actual === "object" && v && typeof v === "object") { ok = true; for (var k in v) if (!__atcDeepEqual(actual[k], v[k])) ok = false; }
322
+ else ok = false;
323
+ return check(ok, "expected " + show(actual) + " to include " + show(v), "expected " + show(actual) + " not to include " + show(v));
324
+ };
325
+ self.property = function (name, value) {
326
+ var has = actual !== null && actual !== undefined && typeof actual === "object" && name in actual;
327
+ if (arguments.length < 2) return check(has, "expected " + show(actual) + " to have property " + name, "expected " + show(actual) + " not to have property " + name);
328
+ return check(has && __atcDeepEqual(actual[name], value), "expected property " + name + " to be " + show(value) + " (it is " + show(has ? actual[name] : undefined) + ")", "expected property " + name + " not to be " + show(value));
329
+ };
330
+ self.lengthOf = self.length = function (n) {
331
+ var len = actual === null || actual === undefined ? undefined : actual.length;
332
+ return check(len === n, "expected length " + n + " (it is " + len + ")", "expected length not to be " + n);
333
+ };
334
+ self.match = self.matches = function (re) { return check(re instanceof RegExp ? re.test(String(actual)) : new RegExp(re).test(String(actual)), "expected " + show(actual) + " to match " + re, "expected " + show(actual) + " not to match " + re); };
335
+ self.oneOf = function (list) { var ok = false; for (var i = 0; i < list.length; i++) if (__atcDeepEqual(list[i], actual)) ok = true; return check(ok, "expected " + show(actual) + " to be one of " + show(list), "expected " + show(actual) + " not to be one of " + show(list)); };
336
+ self.keys = self.key = function () {
337
+ var want = arguments.length === 1 && Array.isArray(arguments[0]) ? arguments[0] : Array.prototype.slice.call(arguments);
338
+ var ok = actual && typeof actual === "object";
339
+ for (var i = 0; ok && i < want.length; i++) if (!(want[i] in actual)) ok = false;
340
+ return check(!!ok, "expected " + show(actual) + " to have keys " + show(want), "expected " + show(actual) + " not to have keys " + show(want));
341
+ };
342
+ self.status = function (code) { return check(actual && actual.code === code, "expected status " + code + " (it is " + (actual && actual.code) + ")", "expected status not to be " + code); };
343
+ return self;
344
+ }
345
+ function __atcScriptStart(fn, input, host) {
346
+ var out = { request: input.request, set: {}, unset: [], tests: [], logs: [] };
347
+ var vars = {};
348
+ for (var k in input.vars) vars[k] = input.vars[k];
349
+ function log() {
350
+ if (out.logs.length >= 200) return;
351
+ var parts = [];
352
+ for (var i = 0; i < arguments.length; i++) parts.push(__atcScriptText(arguments[i]));
353
+ out.logs.push(parts.join(" ").slice(0, 2000));
354
+ }
355
+ var store = {
356
+ get: function (name) { return Object.prototype.hasOwnProperty.call(vars, name) ? vars[name] : undefined; },
357
+ has: function (name) { return Object.prototype.hasOwnProperty.call(vars, name); },
358
+ set: function (name, value) {
359
+ var v = typeof value === "string" ? value : __atcScriptText(value);
360
+ vars[name] = v; out.set[name] = v;
361
+ var i = out.unset.indexOf(name); if (i >= 0) out.unset.splice(i, 1);
362
+ },
363
+ unset: function (name) { delete vars[name]; delete out.set[name]; if (out.unset.indexOf(name) < 0) out.unset.push(name); },
364
+ toObject: function () { var o = {}; for (var k in vars) o[k] = vars[k]; return o; },
365
+ replaceIn: function (text) { return String(text).replace(/\{\{\s*([A-Za-z_][\w.-]*)\s*\}\}/g, function (w, n) { return Object.prototype.hasOwnProperty.call(vars, n) ? vars[n] : w; }); }
366
+ };
367
+ function headerList(list, editable) {
368
+ var find = function (name) { for (var i = 0; i < list.length; i++) if (list[i][0].toLowerCase() === String(name).toLowerCase()) return i; return -1; };
369
+ var api = {
370
+ get: function (name) { var i = find(name); return i < 0 ? undefined : list[i][1]; },
371
+ has: function (name) { return find(name) >= 0; },
372
+ toObject: function () { var o = {}; for (var i = 0; i < list.length; i++) o[list[i][0]] = list[i][1]; return o; },
373
+ all: function () { var a = []; for (var i = 0; i < list.length; i++) a.push({ key: list[i][0], value: list[i][1] }); return a; },
374
+ each: function (cb) { for (var i = 0; i < list.length; i++) cb({ key: list[i][0], value: list[i][1] }); },
375
+ count: function () { return list.length; }
376
+ };
377
+ if (editable) {
378
+ api.add = function (h) { if (h && h.key) list.push([String(h.key), String(h.value === undefined ? "" : h.value)]); };
379
+ api.upsert = function (h) { if (!h || !h.key) return; var i = find(h.key); if (i < 0) list.push([String(h.key), String(h.value === undefined ? "" : h.value)]); else list[i][1] = String(h.value === undefined ? "" : h.value); };
380
+ api.remove = function (name) { var i = find(name); while (i >= 0) { list.splice(i, 1); i = find(name); } };
381
+ }
382
+ return api;
383
+ }
384
+ var req = out.request;
385
+ var request = {
386
+ get method() { return req.method; },
387
+ set method(v) { req.method = String(v).toUpperCase(); },
388
+ url: {
389
+ toString: function () { return req.url; },
390
+ update: function (v) { req.url = String(v); },
391
+ getHost: function () { var m = /^[a-z]+:\/\/([^/:?#]+)/i.exec(req.url); return m ? m[1] : ""; },
392
+ getPath: function () { var m = /^[a-z]+:\/\/[^/?#]*([^?#]*)/i.exec(req.url); return m ? m[1] || "/" : ""; }
393
+ },
394
+ headers: headerList(req.headers, input.phase === "pre"),
395
+ body: {
396
+ get raw() { return req.body === undefined ? "" : req.body; },
397
+ set raw(v) { req.body = String(v); },
398
+ update: function (v) { req.body = typeof v === "string" ? v : __atcScriptText(v); },
399
+ toString: function () { return req.body === undefined ? "" : req.body; }
400
+ },
401
+ addHeader: function (h) { request.headers.add ? request.headers.add(h) : null; },
402
+ removeHeader: function (name) { request.headers.remove ? request.headers.remove(name) : null; }
403
+ };
404
+ function makeResponse(r) {
405
+ var rh = [];
406
+ for (var hk in r.headers) rh.push([hk, r.headers[hk]]);
407
+ var parsed;
408
+ var response = {
409
+ code: r.code,
410
+ status: String(r.code),
411
+ responseTime: r.responseTime,
412
+ responseSize: r.body.length,
413
+ headers: headerList(rh, false),
414
+ text: function () { return r.body; },
415
+ json: function () { if (parsed === undefined) parsed = JSON.parse(r.body); return parsed; }
416
+ };
417
+ var to = {};
418
+ var be = {
419
+ get ok() { if (!(r.code >= 200 && r.code < 300)) throw new Error("expected a 2xx status (it is " + r.code + ")"); return true; },
420
+ get success() { return be.ok; },
421
+ get json() { try { JSON.parse(r.body); } catch (e) { throw new Error("expected the body to be JSON"); } return true; },
422
+ get notFound() { if (r.code !== 404) throw new Error("expected status 404 (it is " + r.code + ")"); return true; },
423
+ get error() { if (r.code < 400) throw new Error("expected a 4xx or 5xx status (it is " + r.code + ")"); return true; }
424
+ };
425
+ to.be = be;
426
+ to.have = {
427
+ status: function (code) {
428
+ if (typeof code === "number" ? r.code !== code : false) throw new Error("expected status " + code + " (it is " + r.code + ")");
429
+ return true;
430
+ },
431
+ header: function (name, value) {
432
+ var v = response.headers.get(name);
433
+ if (v === undefined) throw new Error("expected header " + name);
434
+ if (arguments.length > 1 && v !== String(value)) throw new Error("expected header " + name + " to be " + value + " (it is " + v + ")");
435
+ return true;
436
+ },
437
+ body: function (text) { if (r.body.indexOf(String(text)) < 0) throw new Error("expected the body to contain " + text); return true; },
438
+ jsonBody: function (path) { var o = response.json(); if (arguments.length && !(path in o)) throw new Error("expected the JSON body to have " + path); return true; }
439
+ };
440
+ to.not = { have: { status: function (code) { if (r.code === code) throw new Error("expected status not to be " + code); return true; } } };
441
+ response.to = to;
442
+ return response;
443
+ }
444
+ var response = input.response ? makeResponse(input.response) : undefined;
445
+ var legacyTests = {};
446
+ var state = { out: out, done: false, bodyDone: false, pending: 0, sends: 0, listeners: [] };
447
+ function fail(e) { if (!out.error) out.error = String(e && e.message || e).slice(0, 500); }
448
+ // Finished when the script body has run (an async one: settled) and nothing is outstanding.
449
+ function settle() {
450
+ if (state.done || !state.bodyDone || state.pending > 0) return;
451
+ state.done = true;
452
+ for (var t in legacyTests) out.tests.push({ name: t, ok: !!legacyTests[t] });
453
+ for (var i = 0; i < state.listeners.length; i++) state.listeners[i](out);
454
+ }
455
+ // pm.sendRequest(url | { url, method, header, body }, callback?) — Postman's, both styles.
456
+ function normRequest(req) {
457
+ if (typeof req === "string") return { method: "GET", url: store.replaceIn(req), headers: {} };
458
+ if (!req || typeof req !== "object") throw new Error("pm.sendRequest needs an address or { url, method, header, body }");
459
+ var url = typeof req.url === "string" ? req.url : req.url && typeof req.url.raw === "string" ? req.url.raw : req.url && req.url.toString ? req.url.toString() : "";
460
+ if (!url) throw new Error("pm.sendRequest: the request has no url");
461
+ var headers = {};
462
+ var h = req.header !== undefined ? req.header : req.headers;
463
+ if (Array.isArray(h)) { for (var i = 0; i < h.length; i++) if (h[i] && h[i].key && !h[i].disabled) headers[h[i].key] = store.replaceIn(String(h[i].value === undefined ? "" : h[i].value)); }
464
+ else if (typeof h === "string") { var lines = h.split(/\r?\n/); for (var l = 0; l < lines.length; l++) { var c = lines[l].indexOf(":"); if (c > 0) headers[lines[l].slice(0, c).trim()] = store.replaceIn(lines[l].slice(c + 1).trim()); } }
465
+ else if (h && typeof h === "object") { for (var k in h) headers[k] = store.replaceIn(String(h[k])); }
466
+ var hasType = function () { for (var n in headers) if (n.toLowerCase() === "content-type") return true; return false; };
467
+ var body;
468
+ var b = req.body;
469
+ if (typeof b === "string") body = b;
470
+ else if (b && typeof b === "object") {
471
+ if (b.mode === "raw" || (b.mode === undefined && typeof b.raw === "string")) body = String(b.raw === undefined ? "" : b.raw);
472
+ else if (b.mode === "urlencoded" || b.mode === "formdata") {
473
+ var pairs = Array.isArray(b[b.mode]) ? b[b.mode] : [];
474
+ var parts = [];
475
+ for (var q = 0; q < pairs.length; q++) if (pairs[q] && pairs[q].key && !pairs[q].disabled && pairs[q].type !== "file") parts.push(encodeURIComponent(pairs[q].key) + "=" + encodeURIComponent(store.replaceIn(String(pairs[q].value === undefined ? "" : pairs[q].value))));
476
+ body = parts.join("&");
477
+ if (!hasType()) headers["Content-Type"] = "application/x-www-form-urlencoded";
478
+ } else if (b.mode === "graphql" && b.graphql) {
479
+ body = JSON.stringify({ query: b.graphql.query, variables: typeof b.graphql.variables === "string" ? JSON.parse(b.graphql.variables || "{}") : b.graphql.variables || {} });
480
+ if (!hasType()) headers["Content-Type"] = "application/json";
481
+ }
482
+ if (body !== undefined) body = store.replaceIn(body);
483
+ }
484
+ return { method: String(req.method || "GET").toUpperCase(), url: store.replaceIn(url), headers: headers, body: body };
485
+ }
486
+ function sendRequest(req, cb) {
487
+ if (!host || typeof host.send !== "function") throw new Error("pm.sendRequest isn't available here");
488
+ if (++state.sends > 20) throw new Error("A script can make at most 20 requests with pm.sendRequest");
489
+ var norm = normRequest(req);
490
+ state.pending++;
491
+ return new Promise(function (resolve, reject) {
492
+ host.send(norm, function (err, raw) {
493
+ var res = raw ? makeResponse(raw) : undefined;
494
+ var e = err ? new Error(String(err)) : null;
495
+ if (typeof cb === "function") {
496
+ try { cb(e, res); } catch (x) { fail(x); }
497
+ resolve(res);
498
+ } else if (e) reject(e);
499
+ else resolve(res);
500
+ state.pending--;
501
+ settle();
502
+ });
503
+ });
504
+ }
505
+ var pm = {
506
+ environment: store, variables: store, collectionVariables: store, globals: store,
507
+ iterationData: { get: store.get, has: store.has, toObject: store.toObject },
508
+ request: request,
509
+ response: response,
510
+ info: { requestName: input.name, iteration: input.iteration, eventName: input.phase === "pre" ? "prerequest" : "test" },
511
+ test: function (name, f) {
512
+ var at = out.tests.length;
513
+ var bad = function (e) { out.tests[at] = { name: String(name), ok: false, error: String(e && e.message || e).slice(0, 300) }; };
514
+ out.tests.push({ name: String(name), ok: true });
515
+ try {
516
+ var ret = f();
517
+ // An async test (it awaits pm.sendRequest, say) counts when it settles.
518
+ if (ret && typeof ret.then === "function") {
519
+ state.pending++;
520
+ ret.then(function () { state.pending--; settle(); }, function (e) { bad(e); state.pending--; settle(); });
521
+ }
522
+ } catch (e) { bad(e); }
523
+ },
524
+ expect: __atcExpect,
525
+ sendRequest: sendRequest,
526
+ require: function (name) { throw new Error("require(\"" + name + "\") isn't available in scripts"); }
527
+ };
528
+ pm.test.skip = function (name) { out.tests.push({ name: String(name) + " (skipped)", ok: true }); };
529
+ var con = { log: log, info: log, warn: log, error: log, debug: log };
530
+ var postman = {
531
+ setEnvironmentVariable: store.set, getEnvironmentVariable: store.get, clearEnvironmentVariable: store.unset,
532
+ setGlobalVariable: store.set, getGlobalVariable: store.get, clearGlobalVariable: store.unset
533
+ };
534
+ var r0 = input.response;
535
+ try {
536
+ var ret = fn(pm, con, postman, legacyTests,
537
+ r0 ? r0.body : undefined, r0 ? { code: r0.code } : undefined, r0 ? r0.responseTime : undefined, r0 ? r0.headers : undefined,
538
+ store.toObject(), store.toObject());
539
+ if (ret && typeof ret.then === "function") ret.then(function () { state.bodyDone = true; settle(); }, function (e) { fail(e); state.bodyDone = true; settle(); });
540
+ else state.bodyDone = true;
541
+ } catch (e) {
542
+ fail(e);
543
+ state.bodyDone = true;
544
+ }
545
+ // Old-style tests["name"] = true are added in settle().
546
+ settle();
547
+ return state;
548
+ }
549
+ /** Run to the end when nothing is asynchronous (tests, and sendRequest answered at once). */
550
+ function __atcScriptRun(fn, input, host) {
551
+ return __atcScriptStart(fn, input, host).out;
552
+ }
553
+ /** Run, and resolve when the script and every pm.sendRequest it made have finished. */
554
+ function __atcScriptRunAsync(fn, input, host) {
555
+ var st = __atcScriptStart(fn, input, host);
556
+ if (st.done) return Promise.resolve(st.out);
557
+ return new Promise(function (resolve) { st.listeners.push(resolve); });
558
+ }
559
+ `,String.raw`
560
+ function __atcScriptCompile(code) {
561
+ var params = ["pm", "console", "postman", "tests", "responseBody", "responseCode", "responseTime", "responseHeaders", "environment", "globals"];
562
+ // A script that awaits (const res = await pm.sendRequest(…)) runs as an async function.
563
+ if (/\bawait\b/.test(code)) {
564
+ var AsyncFunction = Object.getPrototypeOf(async function () {}).constructor;
565
+ return AsyncFunction.apply(null, params.concat([code]));
566
+ }
567
+ return Function.apply(null, params.concat([code]));
568
+ }
569
+ `,e.s(["b",0,1e5,"$",0,aq],15487);let az=a_.enum(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),aC=aS.string().regex(/^\d+(\.\d+)?(ms|s|m|h)$/,"Use a duration like 30s, 5m, or 1h"),aP=aS.string().min(1).refine(e=>!/^authorization$/i.test(e)&&!/^cookie$/i.test(e),{message:"Put credentials on auth, not on request headers"}),aR=ax.object({key:aS.string().min(1),value:aS.string()}),aL=ax.object({key:aP,value:aS.string()}),aU=ax.object({id:aS.string().regex(/^[a-z0-9-]{8,64}$/,"not a file id"),name:aS.string().min(1).max(255),size:aA.number().int().nonnegative(),contentType:aS.string().max(200).default("application/octet-stream")}),aF=ak.discriminatedUnion("kind",[ax.object({kind:a$.literal("text"),key:aS.string().min(1),value:aS.string()}).strict(),ax.object({kind:a$.literal("file"),key:aS.string().min(1),file:aU}).strict()]),aD=ak.discriminatedUnion("mode",[ax.object({mode:a$.literal("none")}).strict(),ax.object({mode:a$.literal("json"),json:aM.unknown()}).strict(),ax.object({mode:a$.literal("text"),text:aS.string()}).strict(),ax.object({mode:a$.literal("form"),fields:aj.array(aR)}).strict(),ax.object({mode:a$.literal("raw"),raw:aS.string(),contentType:aS.string().min(1)}).strict(),ax.object({mode:a$.literal("multipart"),parts:aj.array(aF).max(100)}).strict(),ax.object({mode:a$.literal("file"),file:aU,contentType:aS.string().min(1)}).strict()]),aB=ax.object({method:az,url:aS.string().min(1).refine(e=>e.startsWith("/")||/^https?:\/\//i.test(e),{message:"URL must be http(s) or a path starting with /"}),query:aj.array(aR).default([]),headers:aj.array(aL).default([]),body:aD.default({mode:"none"}),expectedStatus:aj.array(aA.number().int().min(0).max(599)).default([]),checks:aj.array(aT).max(20).default([])}).strict(),aK=ax.object({duration:aC,target:aA.number().int().min(0).max(1e5)}).strict();function aZ(e){return"constant-arrival-rate"===e||"ramping-arrival-rate"===e}let aJ=ax.object({executor:a_.enum(["constant-vus","ramping-vus","constant-arrival-rate","ramping-arrival-rate"]),vus:aA.number().int().min(1).max(500).default(10),rate:aA.number().int().min(1).max(1e5).optional(),maxVUs:aA.number().int().min(1).max(2e3).optional(),startVUs:aA.number().int().min(0).max(500).default(0),duration:aC.default("30s"),stages:aj.array(aK).default([]),thinkTimeMs:aA.number().min(0).default(0),thinkJitterMs:aA.number().min(0).default(0),gracefulStop:aC.default("10s"),testType:a_.enum(["smoke","average","stress","spike","soak","breakpoint","custom"]).optional()}).strict().superRefine((e,t)=>{("ramping-vus"===e.executor||"ramping-arrival-rate"===e.executor)&&0===e.stages.length&&t.addIssue({code:aN.ZodIssueCode.custom,message:`${e.executor} requires at least one stage`,path:["stages"]}),"constant-arrival-rate"!==e.executor||e.rate||t.addIssue({code:aN.ZodIssueCode.custom,message:"constant-arrival-rate needs a rate",path:["rate"]}),!aZ(e.executor)&&e.stages.some(e=>e.target>500)&&t.addIssue({code:aN.ZodIssueCode.custom,message:"A stage can use at most 500 virtual users",path:["stages"]})}),aH=ax.object({p95Ms:aA.number().positive().optional(),p99Ms:aA.number().positive().optional(),errorRate:aA.number().min(0).max(1).optional(),checksRate:aA.number().min(0).max(1).optional(),abortOnFail:aI.boolean().default(!1)}).strict(),aV=ax.object({source:a_.enum(["http_req_duration","http_req_failed","http_reqs"]),agg:a_.enum(["p95","p99","rate","count"]),op:a_.enum(["<","<=",">",">="]),value:aA.number()}).strict(),aW=ax.object({timeout:aC.default("60s"),maxRedirects:aA.number().int().min(0).max(20).default(5),httpVersion:a_.enum(["1.1","2"]).default("1.1"),tlsSkipVerify:aI.boolean().default(!1),connectionReuse:aI.boolean().default(!0),cookies:aI.boolean().default(!0)}).strict(),aG=ax.object({grant:a_.enum(["client_credentials","password","authorization_code","jwt_bearer","saml_bearer"]),tokenUrl:aS.string().url(),authUrl:aS.string().default(""),redirectUri:aS.string().default(""),clientId:aS.string().default(""),clientSecret:aS.string().default(""),scope:aS.string().default(""),username:aS.string().default(""),password:aS.string().default(""),clientAuth:a_.enum(["basic","body","private_key_jwt"]).default("basic"),privateKey:aS.string().default(""),assertionAlgorithm:a_.enum(["RS256","RS384","RS512","PS256","ES256","ES384"]).default("RS256"),issuer:aS.string().default(""),subject:aS.string().default(""),audience:aS.string().default(""),kid:aS.string().default(""),certificate:aS.string().default(""),extraClaims:aS.string().default(""),samlSource:a_.enum(["idp","assertion"]).default("idp"),idpUrl:aS.string().default(""),userId:aS.string().default(""),companyId:aS.string().default(""),assertion:aS.string().default(""),pkce:aI.boolean().default(!0),extra:aj.array(aR).max(20).default([])}).strict(),aX=ak.discriminatedUnion("mode",[ax.object({mode:a$.literal("oauth2"),oauth:aG}).strict(),ax.object({mode:a$.literal("digest"),username:aS.string().min(1),password:aS.string()}).strict(),ax.object({mode:a$.literal("ntlm"),username:aS.string().min(1),password:aS.string(),domain:aS.string().default("")}).strict(),ax.object({mode:a$.literal("jwt"),algorithm:a_.enum(["HS256","HS384","HS512","RS256","RS384","RS512","PS256","ES256","ES384","ES512"]),key:aS.string().min(1),payload:aS.string().max(2e4).default("{}"),lifetimeSec:aA.number().int().min(10).max(31536e3).default(3600),kid:aS.string().default(""),headerName:aS.string().min(1).default("Authorization"),prefix:aS.string().default("Bearer")}).strict(),ax.object({mode:a$.literal("oauth1"),consumerKey:aS.string().min(1),consumerSecret:aS.string(),token:aS.string().default(""),tokenSecret:aS.string().default(""),signatureMethod:a_.enum(["HMAC-SHA256","HMAC-SHA1","PLAINTEXT"]).default("HMAC-SHA256"),realm:aS.string().default(""),addTo:a_.enum(["header","query"]).default("header")}).strict(),ax.object({mode:a$.literal("aws_sigv4"),accessKeyId:aS.string().min(1),secretAccessKey:aS.string().min(1),sessionToken:aS.string().default(""),region:aS.string().min(1),service:aS.string().min(1)}).strict(),ax.object({mode:a$.literal("none")}).strict(),ax.object({mode:a$.literal("bearer"),token:aS.string().min(1)}).strict(),ax.object({mode:a$.literal("basic"),username:aS.string().min(1),password:aS.string()}).strict(),ax.object({mode:a$.literal("api_key"),name:aS.string().min(1),value:aS.string().min(1),in:a_.enum(["header","query"]).default("header")}).strict()]),aY=/^[A-Za-z_][\w.-]*$/,aQ=aS.string().max(60).regex(aY,"Use letters, numbers, _ . or - (start with a letter)"),a0=ax.object({name:aQ,from:a_.enum(["json","header","body"]),path:aS.string().min(1).max(300)}).strict(),a1=ax.object({label:aS.string().min(1).max(120),request:aB,auth:aX.default({mode:"none"}),options:aW.prefault({}),extract:aj.array(a0).min(1).max(20)}).strict(),a2=ax.object({fileName:aS.string().max(200).default("data.csv"),columns:aj.array(aQ).min(1).max(50),rows:aj.array(aj.array(aS.string().max(1e4))).min(1).max(1e5),order:a_.enum(["sequential","random","per-user"]).default("sequential")}).strict();function a5(e,t){if(/^https?:\/\//i.test(e.request.url)||t.addIssue({code:"custom",message:"Use an absolute http(s) URL",path:["request","url"]}),e.setup&&!/^https?:\/\//i.test(e.setup.request.url)&&t.addIssue({code:"custom",message:"The run-first request needs an absolute http(s) URL",path:["setup","request","url"]}),e.data){let r=e.data.columns.length,n=e.data.rows.findIndex(e=>e.length!==r);n>=0&&t.addIssue({code:"custom",message:`Test data row ${n+1} has ${e.data.rows[n].length} values, expected ${r}`,path:["data","rows",n]}),new Set(e.data.columns).size!==r&&t.addIssue({code:"custom",message:"Test data has two columns with the same name",path:["data","columns"]})}let r=new Set(e.setup?.extract.map(e=>e.name)??[]);r.size!==(e.setup?.extract.length??0)&&t.addIssue({code:"custom",message:"Two run-first values have the same name",path:["setup","extract"]});let n=e.data?.columns.find(e=>r.has(e));n&&t.addIssue({code:"custom",message:`{{${n}}} comes from both the run-first step and the test data`,path:["data","columns"]})}ax.object({id:aS.string().uuid().optional(),name:aS.string().min(1).max(120),request:aB,auth:aX.default({mode:"none"}),load:aJ,thresholds:aj.array(aV).default([]),options:aW.prefault({})}).strict();let a9=ax.object({pre:aS.string().max(1e5).default(""),post:aS.string().max(1e5).default("")}).strict();function a6(e){return e.replace(/^\s*Bearer\s+/i,"").trim()}function a4(e){let t=e.match(/^(\d+(?:\.\d+)?)(ms|s|m|h)$/);if(!t)return 6e4;let r=Number(t[1]);switch(t[2]){case"ms":return r;case"s":return 1e3*r;case"m":return 6e4*r;case"h":return 36e5*r;default:return 6e4}}ax.object({request:aB,auth:aX.default({mode:"none"}),options:aW.prefault({}),setup:a1.optional(),data:a2.optional(),save:aj.array(a0).max(20).optional(),scripts:a9.optional(),live:aI.boolean().optional(),contract:aS.string().regex(/^[\w-]{1,80}$/).optional()}).strict().superRefine(a5),ax.object({name:aS.string().min(1).max(120).default("Lab run"),request:aB,auth:aX.default({mode:"none"}),options:aW.prefault({}),load:aJ,targets:aH.optional(),setup:a1.optional(),data:a2.optional(),save:aj.array(a0).max(20).optional(),scripts:a9.optional(),contract:aS.string().regex(/^[\w-]{1,80}$/).optional()}).strict().superRefine(a5);let a3={thinkTimeMs:0,thinkJitterMs:0,gracefulStop:"10s"},a8=["smoke","average","stress","spike","soak","breakpoint"],a7={smoke:{vus:2,duration:"30s",rampUp:"0s",rampDown:"0s",...a3},average:{vus:10,duration:"5m",rampUp:"0s",rampDown:"0s",...a3},stress:{vus:20,duration:"1m",rampUp:"30s",rampDown:"30s",...a3},spike:{vus:50,duration:"1m",rampUp:"10s",rampDown:"10s",...a3,stages:[{duration:"10s",target:5},{duration:"30s",target:5},{duration:"10s",target:50},{duration:"1m",target:50},{duration:"10s",target:5},{duration:"30s",target:5},{duration:"10s",target:0}]},soak:{vus:10,duration:"30m",rampUp:"1m",rampDown:"1m",...a3},breakpoint:{vus:200,duration:"10m",rampUp:"0s",rampDown:"0s",...a3,stages:[{duration:"10m",target:200}]}};function oe(e){let t={thinkTimeMs:e.thinkTimeMs,thinkJitterMs:e.thinkJitterMs,gracefulStop:e.gracefulStop},r=a4(e.rampUp),n=a4(e.rampDown),s=e.stages&&e.stages.length>0?e.stages:null;if("rate"===e.mode){let i=Math.max(1,Math.min(2e3,e.maxVus??100)),a=s?Math.max(1,...s.map(e=>e.target)):Math.max(1,e.rps??10),o={vus:Math.max(1,Math.min(i,500,Math.ceil(a/10))),maxVUs:i,startVUs:0,duration:e.duration,...t};if(s)return{executor:"ramping-arrival-rate",...o,stages:s};if(r<=0&&n<=0)return{executor:"constant-arrival-rate",...o,rate:a,stages:[]};let l=[];return r>0&&l.push({duration:e.rampUp,target:a}),l.push({duration:e.duration,target:a}),n>0&&l.push({duration:e.rampDown,target:0}),{executor:"ramping-arrival-rate",...o,stages:l}}if(s)return{executor:"ramping-vus",vus:Math.max(1,...s.map(e=>e.target)),startVUs:0,duration:e.duration,stages:s,...t};if(r<=0&&n<=0)return{executor:"constant-vus",vus:e.vus,startVUs:0,duration:e.duration,stages:[],...t};let i=[];return r>0&&i.push({duration:e.rampUp,target:e.vus}),i.push({duration:e.duration,target:e.vus}),n>0&&i.push({duration:e.rampDown,target:0}),{executor:"ramping-vus",vus:e.vus,startVUs:r>0?0:e.vus,duration:e.duration,stages:i,...t}}function ot(e){return[...e.setup?.extract.map(e=>e.name)??[],...e.data?.columns??[]]}e.s(["a",0,a7,"G",0,a8,"y",0,aY,"L",0,a4,"W",0,a0,"b",0,aU,"V",0,aZ,"E",0,oe,"X",0,a6,"_",0,a2],59100),String.raw`
570
+ var __ATC_FIRST = ["Alex", "Maria", "Sam", "Priya", "Omar", "Lena", "Kofi", "Yuki", "Diego", "Emma", "Noah", "Aisha", "Ivan", "Sofia", "Liam", "Mei"];
571
+ var __ATC_LAST = ["Smith", "Garcia", "Kim", "Patel", "Muller", "Silva", "Nguyen", "Okafor", "Rossi", "Cohen", "Tanaka", "Novak", "Brown", "Khan", "Lopez", "Berg"];
572
+ function __atcRand(n) { return Math.floor(Math.random() * n); }
573
+ function __atcRandText(len, chars) {
574
+ var out = "";
575
+ for (var i = 0; i < len; i++) out += chars.charAt(__atcRand(chars.length));
576
+ return out;
577
+ }
578
+ function __atcBuiltin(name, arg) {
579
+ var args = arg === undefined || String(arg).trim() === "" ? [] : String(arg).split(",");
580
+ for (var i = 0; i < args.length; i++) args[i] = Number(String(args[i]).trim());
581
+ switch (name.slice(1).toLowerCase()) {
582
+ case "uuid": case "guid": case "randomuuid":
583
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) { var r = __atcRand(16); return (c === "x" ? r : (r & 3) | 8).toString(16); });
584
+ case "timestamp": return String(Math.floor(Date.now() / 1000));
585
+ case "timestampms": return String(Date.now());
586
+ case "isotimestamp": return new Date().toISOString();
587
+ case "isodate": return new Date().toISOString().slice(0, 10);
588
+ case "randomint": {
589
+ var lo = args.length > 1 ? args[0] : 0;
590
+ var hi = args.length > 1 ? args[1] : args.length ? args[0] : 1000;
591
+ if (!isFinite(lo) || !isFinite(hi)) return undefined;
592
+ var min = Math.ceil(Math.min(lo, hi)), max = Math.floor(Math.max(lo, hi));
593
+ return String(min + __atcRand(max - min + 1));
594
+ }
595
+ case "randomstring": {
596
+ var len = args.length && isFinite(args[0]) ? Math.max(1, Math.min(1000, Math.floor(args[0]))) : 8;
597
+ return __atcRandText(len, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
598
+ }
599
+ case "randomemail": return "user." + __atcRandText(8, "abcdefghijklmnopqrstuvwxyz0123456789") + "@example.com";
600
+ case "randomfirstname": return __ATC_FIRST[__atcRand(__ATC_FIRST.length)];
601
+ case "randomlastname": return __ATC_LAST[__atcRand(__ATC_LAST.length)];
602
+ case "randomfullname": return __ATC_FIRST[__atcRand(__ATC_FIRST.length)] + " " + __ATC_LAST[__atcRand(__ATC_LAST.length)];
603
+ case "randomboolean": return Math.random() < 0.5 ? "true" : "false";
604
+ }
605
+ return undefined;
606
+ }
607
+ function __atcFill(text, vars, mode, builtins) {
608
+ if (typeof text !== "string") return text;
609
+ return text.replace(/\{\{\s*(\$?[A-Za-z_][\w.-]*)(?:\(([^(){}]*)\))?\s*\}\}|%7B%7B(\$?[A-Za-z_][\w.-]*)(?:\(([^(){}]*)\))?%7D%7D/gi, function (whole, a, aArg, b, bArg) {
610
+ var name = a || b;
611
+ var arg = a ? aArg : bArg;
612
+ var v;
613
+ if (name.charAt(0) === "$") {
614
+ if (builtins === false) return whole;
615
+ if (b && arg !== undefined) { try { arg = decodeURIComponent(arg); } catch (e) {} }
616
+ v = __atcBuiltin(name, arg);
617
+ if (v === undefined) return whole;
618
+ } else {
619
+ if (arg !== undefined || !Object.prototype.hasOwnProperty.call(vars, name)) return whole;
620
+ v = String(vars[name]);
621
+ }
622
+ if (mode === "url") return encodeURIComponent(v);
623
+ if (mode === "json") return JSON.stringify(v).slice(1, -1);
624
+ return v;
625
+ });
626
+ }
627
+ `,e.s(["Z",0,[{name:"$uuid",example:"{{$uuid}}",description:"A random UUID (v4). Also {{$guid}}."},{name:"$timestamp",example:"{{$timestamp}}",description:"Now, in seconds since 1970 (Unix time)."},{name:"$timestampMs",example:"{{$timestampMs}}",description:"Now, in milliseconds since 1970."},{name:"$isoTimestamp",example:"{{$isoTimestamp}}",description:"Now, as 2026-10-19T09:30:00.000Z (UTC)."},{name:"$isoDate",example:"{{$isoDate}}",description:"Today, as 2026-10-19 (UTC)."},{name:"$randomInt",example:"{{$randomInt(1,100)}}",description:"A whole number from 0 to 1000, or between the two numbers you give."},{name:"$randomString",example:"{{$randomString(12)}}",description:"Letters and digits, 8 long or as long as you give."},{name:"$randomEmail",example:"{{$randomEmail}}",description:"An address at example.com, e.g. user.k3x9q2ma@example.com."},{name:"$randomFirstName",example:"{{$randomFirstName}}",description:"A first name, e.g. Maria."},{name:"$randomLastName",example:"{{$randomLastName}}",description:"A last name, e.g. Okafor."},{name:"$randomFullName",example:"{{$randomFullName}}",description:"A first and last name."},{name:"$randomBoolean",example:"{{$randomBoolean}}",description:"true or false."}],"v",0,function(e){let t=e.replace(/^/,""),r=t.split(/\r?\n/,1)[0]??"",n=[",",";"," "].map(e=>[e,r.split(e).length]).sort((e,t)=>t[1]-e[1])[0][0],s=[],i="",a=[],o=!1;for(let e=0;e<t.length;e++){let r=t[e];o?'"'===r?'"'===t[e+1]?(i+='"',e++):o=!1:i+=r:'"'===r&&""===i?o=!0:r===n?(a.push(i),i=""):"\n"===r||"\r"===r?("\r"===r&&"\n"===t[e+1]&&e++,a.push(i),s.push(a),a=[],i=""):i+=r}(""!==i||a.length)&&(a.push(i),s.push(a));let l=s.filter(e=>e.some(e=>""!==e.trim())),u=[],c=(l.shift()??[]).map(e=>e.trim()).map((e,t)=>{let r=e.replace(/\s+/g,"_").replace(/[^\w.-]/g,""),n=aY.test(r)?r:`column${t+1}`;return n!==e&&u.push(e?`Column “${e}” is used as {{${n}}}`:`Column ${t+1} has no name; it is used as {{${n}}}`),n}),p=new Set;c.forEach((e,t)=>{p.has(e)&&(c[t]=`${e}_${t+1}`,u.push(`Two columns are called “${e}”; the second is used as {{${c[t]}}}`)),p.add(c[t])});let d=0,h=l.map(e=>(e.length!==c.length&&d++,c.map((t,r)=>e[r]??"")));return d&&u.push(`${d} row${1===d?" has":"s have"} a different number of values than the header; missing values are left empty`),{columns:c,rows:h,problems:u}},"C",0,ot],99112);let or="<hidden>",on=new Set(["host","content-length","connection","accept-encoding"]);function os(e){return e.headers.filter(([e,t])=>!on.has(e.toLowerCase())&&!("user-agent"===e.toLowerCase()&&t.startsWith("ApiTestCenter/")))}let oi=e=>JSON.stringify(e),oa=e=>`'${e.replace(/'/g,"'\\''")}'`,oo=e=>`'${e.replace(/'/g,"''")}'`,ol=e=>`@"${e.replace(/"/g,'""')}"`;function ou(e,t){if(t.form||t.file)return function(e,t){let r=t.form,n=t.file,s=os(t).filter(([e])=>!(r&&"content-type"===e.toLowerCase())),i=t.method.toUpperCase(),a=(r??[]).filter(e=>void 0!==e.file),o=a.length+ +!!n===1,l=e=>`${e} ${o?"The file name stands for the file you chose: put its path there.":"File names stand for the files you chose: put their paths there."}`,u=e=>e.replace(/["\\\r\n]/g,"_"),c=[];switch(e){case"curl":for(let[e,r]of(c.push(`curl -X ${i} ${oa(t.url)}`),s))c.push(` -H ${oa(`${e}: ${r}`)}`);for(let e of r??[])c.push(void 0!==e.file?` -F ${oa(`${e.name}=@${e.file}${e.contentType?`;type=${e.contentType}`:""}`)}`:` --form-string ${oa(`${e.name}=${e.value??""}`)}`);return n&&c.push(` --data-binary ${oa(`@${n.name}`)}`),t.insecure&&c.push(" -k"),`${l("#")}
628
+ ${c.join(" \\\n")}`;case"powershell":{let e=s.filter(([e])=>"content-type"!==e.toLowerCase());if(c.push(l("#"),"# PowerShell 7 or later."),e.length){for(let[t,r]of(c.push("$headers = @{"),e))c.push(` ${oo(t)} = ${oo(r)}`);c.push("}")}let a=[`-Uri ${oo(t.url)}`,`-Method ${i}`];if(e.length&&a.push("-Headers $headers"),r){for(let e of(c.push("$form = @{"),r))c.push(` ${oo(e.name)} = ${void 0!==e.file?`Get-Item -Path ${oo(e.file)}`:oo(e.value??"")}`);c.push("}"),a.push("-Form $form")}return n&&a.push(`-InFile ${oo(n.name)}`,`-ContentType ${oo(n.contentType)}`),t.insecure&&a.push("-SkipCertificateCheck"),c.push(`$response = Invoke-WebRequest ${a.join(" ")}`,"$response.StatusCode","$response.Content"),c.join("\n")}case"javascript":if(c.push(l("//"),'import { openAsBlob } from "node:fs";',""),r)for(let e of(c.push("const form = new FormData();"),r))c.push(void 0!==e.file?`form.append(${oi(e.name)}, await openAsBlob(${oi(e.file)}${e.contentType?`, { type: ${oi(e.contentType)} }`:""}), ${oi(e.file)});`:`form.append(${oi(e.name)}, ${oi(e.value??"")});`);if(c.push(`const response = await fetch(${oi(t.url)}, {`,` method: ${oi(i)},`),s.length){for(let[e,t]of(c.push(" headers: {"),s))c.push(` ${oi(e)}: ${oi(t)},`);c.push(" },")}return c.push(r?" body: form,":` body: await openAsBlob(${oi(n.name)}),`),c.push("});","console.log(response.status);","console.log(await response.text());"),c.join("\n");case"python":{if(c.push(l("#"),"import requests","",`url = ${oi(t.url)}`),s.length){for(let[e,t]of(c.push("headers = {"),s))c.push(` ${oi(e)}: ${oi(t)},`);c.push("}")}let e=[oi(i),"url"];if(s.length&&e.push("headers=headers"),r){let t=r.filter(e=>void 0===e.file);if(t.length){for(let e of(c.push("data = ["),t))c.push(` (${oi(e.name)}, ${oi(e.value??"")}),`);c.push("]"),e.push("data=data")}for(let e of(c.push("files = ["),a))c.push(` (${oi(e.name)}, (${oi(e.file)}, open(${oi(e.file)}, "rb")${e.contentType?`, ${oi(e.contentType)}`:""})),`);c.push("]"),e.push("files=files")}return n&&e.push(`data=open(${oi(n.name)}, "rb")`),t.insecure&&e.push("verify=False"),c.push("",`response = requests.request(${e.join(", ")})`,"print(response.status_code)","print(response.text)"),c.join("\n")}case"csharp":{let e=s.filter(([e])=>"content-type"!==e.toLowerCase());for(let[r,n]of(c.push(l("//"),"using System.Net.Http.Headers;",""),c.push(t.insecure?"using var client = new HttpClient(new HttpClientHandler { ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator });":"using var client = new HttpClient();"),c.push(`var request = new HttpRequestMessage(new HttpMethod(${ol(i)}), ${ol(t.url)});`),e))c.push(`request.Headers.TryAddWithoutValidation(${ol(r)}, ${ol(n)});`);return r&&(c.push("var form = new MultipartFormDataContent();"),r.forEach((e,t)=>{void 0===e.file?c.push(`form.Add(new StringContent(${ol(e.value??"")}), ${ol(e.name)});`):(c.push(`var file${t} = new ByteArrayContent(File.ReadAllBytes(${ol(e.file)}));`),e.contentType&&c.push(`file${t}.Headers.ContentType = MediaTypeHeaderValue.Parse(${ol(e.contentType)});`),c.push(`form.Add(file${t}, ${ol(e.name)}, ${ol(e.file)});`))}),c.push("request.Content = form;")),n&&c.push(`request.Content = new ByteArrayContent(File.ReadAllBytes(${ol(n.name)}));`,`request.Content.Headers.ContentType = MediaTypeHeaderValue.Parse(${ol(n.contentType)});`),c.push("var response = await client.SendAsync(request);","Console.WriteLine((int)response.StatusCode);","Console.WriteLine(await response.Content.ReadAsStringAsync());"),c.join("\n")}case"java":if(c.push(l("//"),"import java.net.URI;","import java.net.http.HttpClient;","import java.net.http.HttpRequest;","import java.net.http.HttpResponse;","import java.nio.file.Files;","import java.nio.file.Path;"),r&&c.push("import java.util.ArrayList;"),c.push(""),r){for(let e of(c.push('String boundary = "----ApiTestCenter" + System.currentTimeMillis();',"var parts = new ArrayList<byte[]>();"),r)){let t=`form-data; name="${u(e.name)}"`;void 0===e.file?c.push(`parts.add(("--" + boundary + ${oi(`\r
629
+ Content-Disposition: ${t}\r
630
+ \r
631
+ `)} + ${oi(e.value??"")} + "\\r\\n").getBytes("UTF-8"));`):(c.push(`parts.add(("--" + boundary + ${oi(`\r
632
+ Content-Disposition: ${t}; filename="${u(e.file)}"\r
633
+ Content-Type: ${e.contentType??"application/octet-stream"}\r
634
+ \r
635
+ `)}).getBytes("UTF-8"));`),c.push(`parts.add(Files.readAllBytes(Path.of(${oi(e.file)})));`,'parts.add("\\r\\n".getBytes("UTF-8"));'))}c.push('parts.add(("--" + boundary + "--\\r\\n").getBytes("UTF-8"));',"")}for(let[e,r]of(t.insecure&&c.push("// The certificate check was skipped in the app; Java's HttpClient needs an SSLContext that trusts the test server."),c.push("HttpClient client = HttpClient.newHttpClient();","HttpRequest request = HttpRequest.newBuilder()",` .uri(URI.create(${oi(t.url)}))`),s))c.push(` .header(${oi(e)}, ${oi(r)})`);return r&&c.push(' .header("Content-Type", "multipart/form-data; boundary=" + boundary)'),c.push(` .method(${oi(i)}, ${r?"HttpRequest.BodyPublishers.ofByteArrays(parts)":`HttpRequest.BodyPublishers.ofFile(Path.of(${oi(n.name)}))`})`," .build();"),c.push("HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());","System.out.println(response.statusCode());","System.out.println(response.body());"),c.join("\n");case"go":{let e=['"fmt"','"io"','"net/http"','"os"',...r?['"bytes"','"mime/multipart"','"net/textproto"']:[],...t.insecure?['"crypto/tls"']:[]].sort();if(c.push(l("//"),"package main","","import (",...e.map(e=>` ${e}`),")","","func main() {"),r){for(let e of(c.push(" var body bytes.Buffer"," w := multipart.NewWriter(&body)"),r)){if(void 0===e.file){c.push(` w.WriteField(${oi(e.name)}, ${oi(e.value??"")})`);continue}c.push(" {"," h := make(textproto.MIMEHeader)",` h.Set("Content-Disposition", ${oi(`form-data; name="${u(e.name)}"; filename="${u(e.file)}"`)})`,` h.Set("Content-Type", ${oi(e.contentType??"application/octet-stream")})`," part, _ := w.CreatePart(h)",` data, err := os.ReadFile(${oi(e.file)})`," if err != nil {"," panic(err)"," }"," part.Write(data)"," }")}c.push(" w.Close()")}else c.push(` body, err := os.Open(${oi(n.name)})`," if err != nil {"," panic(err)"," }"," defer body.Close()");for(let[e,n]of(c.push(` req, err := http.NewRequest(${oi(i)}, ${oi(t.url)}, ${r?"&body":"body"})`," if err != nil {"," panic(err)"," }"),s))c.push(` req.Header.Set(${oi(e)}, ${oi(n)})`);return r&&c.push(' req.Header.Set("Content-Type", w.FormDataContentType())'),c.push(t.insecure?" client := &http.Client{Transport: &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}}}":" client := http.DefaultClient"," res, err := client.Do(req)"," if err != nil {"," panic(err)"," }"," defer res.Body.Close()"," data, _ := io.ReadAll(res.Body)"," fmt.Println(res.StatusCode)"," fmt.Println(string(data))","}"),c.join("\n")}case"k6":if(c.push(l("//"),'import http from "k6/http";','import { check, sleep } from "k6";',""),a.forEach((e,t)=>c.push(`const file${t} = open(${oi(e.file)}, "b");`)),n&&c.push(`const body = open(${oi(n.name)}, "b");`),c.push("",`export const options = { vus: 5, duration: "30s"${t.insecure?", insecureSkipTLSVerify: true":""} };`,""),c.push("export default function () {"),r){let e=0;for(let t of(c.push(" const body = {"),r))c.push(` ${oi(t.name)}: ${void 0!==t.file?`http.file(file${e++}, ${oi(t.file)}${t.contentType?`, ${oi(t.contentType)}`:""})`:oi(t.value??"")},`);c.push(" };")}if(c.push(` const res = http.request(${oi(i)}, ${oi(t.url)}, body, {`),s.length){for(let[e,t]of(c.push(" headers: {"),s))c.push(` ${oi(e)}: ${oi(t)},`);c.push(" },")}return c.push(" });",' check(res, { "status is 2xx": (r) => r.status >= 200 && r.status < 300 });'," sleep(1);","}"),c.join("\n")}}(e,t);let r=os(t),n=t.body,s=t.method.toUpperCase(),i=[];switch(e){case"curl":for(let[e,a]of(i.push(`curl${"GET"===s&&void 0===n?"":` -X ${s}`} ${oa(t.url)}`),r))i.push(` -H ${oa(`${e}: ${a}`)}`);return void 0!==n&&i.push(` --data-raw ${oa(n)}`),t.insecure&&i.push(" -k"),i.join(" \\\n");case"powershell":{let e=r.find(([e])=>"content-type"===e.toLowerCase())?.[1],a=r.filter(([e])=>"content-type"!==e.toLowerCase());if(a.length){for(let[e,t]of(i.push("$headers = @{"),a))i.push(` ${oo(e)} = ${oo(t)}`);i.push("}")}let o=[`-Uri ${oo(t.url)}`,`-Method ${s}`];return a.length&&o.push("-Headers $headers"),e&&o.push(`-ContentType ${oo(e)}`),void 0!==n&&o.push(/^[\x20-\x7e\r\n\t]*$/.test(n)?`-Body ${oo(n)}`:`-Body ([System.Text.Encoding]::UTF8.GetBytes(${oo(n)}))`),t.insecure&&o.push("-SkipCertificateCheck"),i.push(`$response = Invoke-WebRequest ${o.join(" ")}`,"$response.StatusCode","$response.Content"),i.join("\n")}case"javascript":if(i.push(`const response = await fetch(${oi(t.url)}, {`,` method: ${oi(s)},`),r.length){for(let[e,t]of(i.push(" headers: {"),r))i.push(` ${oi(e)}: ${oi(t)},`);i.push(" },")}return void 0!==n&&i.push(` body: ${oi(n)},`),i.push("});","console.log(response.status);","console.log(await response.text());"),t.insecure&&i.unshift("// The certificate check was skipped in the app; in Node.js run with NODE_TLS_REJECT_UNAUTHORIZED=0 for a test server only."),i.join("\n");case"python":{if(i.push("import requests","",`url = ${oi(t.url)}`),r.length){for(let[e,t]of(i.push("headers = {"),r))i.push(` ${oi(e)}: ${oi(t)},`);i.push("}")}void 0!==n&&i.push(`payload = ${oi(n)}`);let e=[oi(s),"url"];return r.length&&e.push("headers=headers"),void 0!==n&&e.push('data=payload.encode("utf-8")'),t.insecure&&e.push("verify=False"),i.push("",`response = requests.request(${e.join(", ")})`,"print(response.status_code)","print(response.text)"),i.join("\n")}case"csharp":{let e=r.find(([e])=>"content-type"===e.toLowerCase())?.[1],a=r.filter(([e])=>"content-type"!==e.toLowerCase());for(let[e,r]of(i.push("using System.Net.Http.Headers;",""),i.push(t.insecure?"using var client = new HttpClient(new HttpClientHandler { ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator });":"using var client = new HttpClient();"),i.push(`var request = new HttpRequestMessage(new HttpMethod(${ol(s)}), ${ol(t.url)});`),a))i.push(`request.Headers.TryAddWithoutValidation(${ol(e)}, ${ol(r)});`);return void 0!==n&&(i.push(`request.Content = new StringContent(${ol(n)});`),e&&i.push(`request.Content.Headers.ContentType = MediaTypeHeaderValue.Parse(${ol(e)});`)),i.push("var response = await client.SendAsync(request);","Console.WriteLine((int)response.StatusCode);","Console.WriteLine(await response.Content.ReadAsStringAsync());"),i.join("\n")}case"java":for(let[e,n]of(i.push("import java.net.URI;","import java.net.http.HttpClient;","import java.net.http.HttpRequest;","import java.net.http.HttpResponse;",""),t.insecure&&i.push("// The certificate check was skipped in the app; Java's HttpClient needs an SSLContext that trusts the test server."),i.push("HttpClient client = HttpClient.newHttpClient();","HttpRequest request = HttpRequest.newBuilder()",` .uri(URI.create(${oi(t.url)}))`),r))i.push(` .header(${oi(e)}, ${oi(n)})`);return i.push(` .method(${oi(s)}, ${void 0!==n?`HttpRequest.BodyPublishers.ofString(${oi(n)})`:"HttpRequest.BodyPublishers.noBody()"})`," .build();"),i.push("HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());","System.out.println(response.statusCode());","System.out.println(response.body());"),i.join("\n");case"go":{let e=['"fmt"','"io"','"net/http"',...void 0!==n?['"strings"']:[],...t.insecure?['"crypto/tls"']:[]].sort();for(let[a,o]of(i.push("package main","","import (",...e.map(e=>` ${e}`),")","","func main() {"),i.push(` req, err := http.NewRequest(${oi(s)}, ${oi(t.url)}, ${void 0!==n?`strings.NewReader(${oi(n)})`:"nil"})`),i.push(" if err != nil {"," panic(err)"," }"),r))i.push(` req.Header.Set(${oi(a)}, ${oi(o)})`);return i.push(t.insecure?" client := &http.Client{Transport: &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}}}":" client := http.DefaultClient"," res, err := client.Do(req)"," if err != nil {"," panic(err)"," }"," defer res.Body.Close()"," data, _ := io.ReadAll(res.Body)"," fmt.Println(res.StatusCode)"," fmt.Println(string(data))","}"),i.join("\n")}case"k6":if(i.push('import http from "k6/http";','import { check, sleep } from "k6";',""),i.push(`export const options = { vus: 5, duration: "30s"${t.insecure?", insecureSkipTLSVerify: true":""} };`,""),i.push("export default function () {"),i.push(` const res = http.request(${oi(s)}, ${oi(t.url)}, ${void 0!==n?oi(n):"null"}, {`),r.length){for(let[e,t]of(i.push(" headers: {"),r))i.push(` ${oi(e)}: ${oi(t)},`);i.push(" },")}return i.push(" });",' check(res, { "status is 2xx": (r) => r.status >= 200 && r.status < 300 });'," sleep(1);","}"),i.join("\n")}}e.s(["X",0,[{id:"curl",label:"curl"},{id:"powershell",label:"PowerShell"},{id:"javascript",label:"JavaScript"},{id:"python",label:"Python"},{id:"csharp",label:"C#"},{id:"java",label:"Java"},{id:"go",label:"Go"},{id:"k6",label:"k6 load test"}],"Z",0,or,"T",0,ou,"A",0,function(e){let t=new Set(e.secretHeaders.map(e=>e.toLowerCase())),r=e.headers.map(([e,r])=>[e,t.has(e.toLowerCase())?function(e,t){if("authorization"===e.toLowerCase()||"proxy-authorization"===e.toLowerCase()){let e=/^(\w+)\s+/.exec(t);if(e)return`${e[1]} ${or}`}return or}(e,r):r]),n=e.url;if(e.secretQuery.length)try{let t=new URL(e.url);for(let r of e.secretQuery)t.searchParams.has(r)&&t.searchParams.set(r,or);n=t.toString().replace(/%3Chidden%3E/g,or)}catch{}return{...e,url:n,headers:r}}],75606);let oc=/^---\n([\s\S]*?)\n---[ \t]*(?:\n|$)/;function op(e,t){let r=e=>e.replace(/^v/,"").split("-")[0].split(".").map(e=>Number.parseInt(e,10)||0),[n,s]=[r(e),r(t)];for(let e=0;e<Math.max(n.length,s.length);e++)if((n[e]??0)!==(s[e]??0))return(n[e]??0)-(s[e]??0);return 0}let od=e=>!!(e&&/^v?\d+\.\d+/.test(e)),oh=/`([^`]+)`|\*\*(.+?)\*\*|\[([^\]]+)\]\(([^)\s]+)\)|(?<=^|[\s(])\*([^*\s][^*]*?)\*/;function of(e){let t=[],r=e;for(;r;){let e=oh.exec(r);if(!e)break;e.index&&t.push({kind:"text",text:r.slice(0,e.index)}),null!=e[1]?t.push({kind:"code",text:e[1]}):null!=e[2]?t.push({kind:"strong",parts:of(e[2])}):null!=e[3]?/^(https?:|mailto:)/i.test(e[4])?t.push({kind:"link",href:e[4],parts:of(e[3])}):t.push(...of(e[3])):t.push({kind:"em",parts:of(e[5])}),r=r.slice(e.index+e[0].length)}return r&&t.push({kind:"text",text:r}),t}e.s(["U",0,function(e){let t=[],r=[],n=null,s=()=>{r.length&&t.push({kind:"paragraph",parts:of(r.join(" "))}),n&&t.push({kind:"list",ordered:n.ordered,items:n.items.map(of)}),r=[],n=null};for(let i of e.replace(/\r\n/g,"\n").split("\n")){let e=/^(#{1,4})\s+(.*)$/.exec(i),a=/^\s*(?:([-*])|\d+\.)\s+(.*)$/.exec(i);if(e)s(),t.push({kind:"heading",level:Math.min(4,Math.max(2,e[1].length)),parts:of(e[2])});else if(a){let e=!a[1];(r.length||n&&n.ordered!==e)&&s(),(n??={ordered:e,items:[]}).items.push(a[2])}else!i.trim()||/^\|/.test(i)?s():n?n.items[n.items.length-1]+=` ${i.trim()}`:r.push(i.trim())}return s(),t},"J",0,function(e,t){return od(t)?e.find(e=>0===op(e.version,t)):[...e].sort((e,t)=>op(t.version,e.version))[0]},"n",0,of,"K",0,function(e){return Object.entries(e).map(([e,t])=>(function(e,t){let r=t.replace(/\r\n/g,"\n"),n={};for(let e of oc.exec(r)?.[1]?.split("\n")??[]){let t=/^(\w+):\s*(.*)$/.exec(e.trim());t&&(n[t[1].toLowerCase()]=t[2].replace(/^["']|["']$/g,"").trim())}let s=r.replace(/\r\n/g,"\n").replace(oc,"").trimStart().split(/\n## Download\b/)[0].replace(/^## What's new in [^\n]*\n/i,"").trim();return{version:e,level:"important"===n.level?"important":"optional",...n.why?{why:n.why}:{},markdown:s}})(e,t)).sort((e,t)=>op(t.version,e.version))},"R",0,function(e,t,r,n){if(!od(t))return[];let s=e.filter(e=>0>=op(e.version,t)).sort((e,t)=>op(t.version,e.version));return od(r)?s.filter(e=>op(e.version,r)>0):n?s.filter(e=>0===op(e.version,t)):[]}],64478);let om=/^\s*(```|~~~)\s*([\w+#.-]*)/,oy=/^\s{0,3}(#{1,6})\s+(.*?)\s*#*\s*$/,og=/^\s{0,3}([-*_])(\s*\1){2,}\s*$/,ob=/^\s*(?:([-*+])|\d+[.)])\s+(.*)$/,ov=/^\s{0,3}>\s?(.*)$/,ow=/^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)*\|?\s*$/;function ok(e){return e.trim().replace(/^\|/,"").replace(/(?<!\\)\|$/,"").split(/(?<!\\)\|/).map(e=>e.trim().replace(/\\\|/g,"|"))}function ox(e){let t=e.slice(0,5e4).replace(/\r\n?/g,"\n").split("\n"),r=[],n=[],s=null,i=null,a=()=>{n.length&&r.push({kind:"paragraph",parts:of(n.join(" "))}),s&&r.push({kind:"list",ordered:s.ordered,items:s.items.map(of)}),i&&r.push({kind:"quote",parts:of(i.join(" "))}),n=[],s=null,i=null};for(let e=0;e<t.length;e++){let o=t[e],l=om.exec(o);if(l){a();let n=[];for(e++;e<t.length&&!t[e].trim().startsWith(l[1]);e++)n.push(t[e]);r.push({kind:"code",lang:l[2]??"",text:n.join("\n")});continue}let u=oy.exec(o);if(u){a(),r.push({kind:"heading",level:Math.min(4,u[1].length),parts:of(u[2])});continue}if(og.test(o)&&!(n.length&&/^\s*-+\s*$/.test(o))){a(),r.push({kind:"rule"});continue}if(n.length&&/^\s*(-+|=+)\s*$/.test(o)){let e=n.join(" ");n=[],a(),r.push({kind:"heading",level:o.includes("=")?1:2,parts:of(e)});continue}if(o.includes("|")&&e+1<t.length&&ow.test(t[e+1])){a();let n=ok(o),s=[];for(e+=2;e<t.length&&t[e].includes("|")&&t[e].trim();e++)s.push(ok(t[e]));e--,r.push({kind:"table",head:n.map(of),rows:s.map(e=>n.map((t,r)=>of(e[r]??"")))});continue}let c=ov.exec(o);if(c){i||a(),i??=[],c[1].trim()&&i.push(c[1].trim());continue}let p=ob.exec(o);if(p){let e=!p[1];(n.length||i||s&&s.ordered!==e)&&a(),(s??={ordered:e,items:[]}).items.push(p[2]);continue}o.trim()?s&&/^\s+/.test(o)?s.items[s.items.length-1]+=` ${o.trim()}`:i?i.push(o.trim()):(s&&a(),n.push(o.trim())):a()}return a(),r}function o$(e,t=140){let r=ox(e).find(e=>"paragraph"===e.kind);if(!r||"paragraph"!==r.kind)return"";let n=(function e(t){return t.map(t=>"text"===t.kind||"code"===t.kind?t.text:e(t.parts)).join("")})(r.parts).replace(/\s+/g," ").trim();return n.length>t?`${n.slice(0,t-1).trimEnd()}…`:n}let oS=e=>e.replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e]);function o_(e){return e.map(e=>"text"===e.kind?oS(e.text):"code"===e.kind?`<code>${oS(e.text)}</code>`:"strong"===e.kind?`<strong>${o_(e.parts)}</strong>`:"em"===e.kind?`<em>${o_(e.parts)}</em>`:`<a href="${oS(e.href)}" target="_blank" rel="noreferrer">${o_(e.parts)}</a>`).join("")}function oA(e,t=0){return e.map(e=>{switch(e.kind){case"heading":{let r=Math.min(6,e.level+t);return`<h${r}>${o_(e.parts)}</h${r}>`}case"paragraph":return`<p>${o_(e.parts)}</p>`;case"list":{let t=e.ordered?"ol":"ul";return`<${t}>${e.items.map(e=>`<li>${o_(e)}</li>`).join("")}</${t}>`}case"code":return`<pre><code${e.lang?` data-lang="${oS(e.lang)}"`:""}>${oS(e.text)}</code></pre>`;case"table":return`<table><thead><tr>${e.head.map(e=>`<th>${o_(e)}</th>`).join("")}</tr></thead><tbody>${e.rows.map(e=>`<tr>${e.map(e=>`<td>${o_(e)}</td>`).join("")}</tr>`).join("")}</tbody></table>`;case"quote":return`<blockquote><p>${o_(e.parts)}</p></blockquote>`;case"rule":return"<hr>"}}).join("\n")}let oT=(e,t=0)=>oA(ox(e),t);e.s(["o",0,5e4,"y",0,oA,"s",0,ox,"q",0,o$,"e",0,oS,"K",0,oT],89662);var oO=e.i(46880);let oE={baseUrl:"",endpoint:"",params:[],valid:!1};function oM(e){let t=e.trim();if(!t)return oE;try{let e=new URL(t);if("http:"!==e.protocol&&"https:"!==e.protocol)return oE;let r=[];return e.searchParams.forEach((e,t)=>{r.push({key:t,value:e})}),{baseUrl:e.origin,endpoint:e.pathname||"/",params:r,valid:!0}}catch{return oE}}function oj(e){let t=e.baseUrl.trim();if(!t)return"";try{let r=new URL(t.includes("://")?t:`https://${t}`);if("http:"!==r.protocol&&"https:"!==r.protocol)return"";let n=e.endpoint.trim()||"/";for(let t of(n.startsWith("/")||(n=`/${n}`),r.pathname=n,r.search="",r.hash="",e.params)){let e=t.key.trim();e&&!1!==t.enabled&&r.searchParams.append(e,t.value)}return r.toString()}catch{return""}}let oN=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]);function oI(e){if(!e)return;let t=e.toUpperCase();return oN.has(t)?t:void 0}function oq(e){return e.replace(/[),.;]+$/g,"").replace(/[<>]/g,"")}let oz=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),oC=new Set(["-d","--data","--data-raw","--data-binary","--data-ascii","--data-urlencode","--json"]),oP=new Set(["-A","--user-agent","-b","--cookie","-e","--referer","-o","--output","-m","--max-time","--connect-timeout","-x","--proxy","-w","--write-out"]);function oR(e){if(!e||"object"!=typeof e)return null;let t=Number(e.status);if(!Number.isInteger(t)||t<100||t>599)return null;let r=Array.isArray(e.headers)?e.headers.flatMap(e=>Array.isArray(e)&&"string"==typeof e[0]&&"string"==typeof e[1]&&e[0].trim()?[[e[0],e[1]]]:[]):[],n=Number(e.delayMs);return{status:t,headers:r.slice(0,50),body:"string"==typeof e.body?e.body.slice(0,1e6):"",delayMs:Number.isFinite(n)?Math.max(0,Math.min(3e4,Math.round(n))):0}}let oL=/^(content-type|location|cache-control|etag|x-[\w-]+|link|retry-after|www-authenticate)$/i;e.s(["j",0,function(e,t,r){return{status:e,headers:Object.entries(t).filter(([e,t])=>oL.test(e)&&"[redacted]"!==t).slice(0,50),body:(function(e,t){let r=Object.entries(t).find(([e])=>"content-type"===e.toLowerCase())?.[1]??"";if(!/json/i.test(r)&&!/^\s*[[{]/.test(e))return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}})(r,t).slice(0,1e6),delayMs:0}},"S",0,oR],36163);let oU=["token","password","apiValue"],oF=/\{\{\s*([A-Za-z_][\w.-]*)\s*\}\}/g;function oD(e){return/^\s*\{\{\s*[A-Za-z_][\w.-]*\s*\}\}\s*$/.test(e)}function oB(e,t){let r=new Set;return{text:e.replace(oF,(e,n)=>Object.prototype.hasOwnProperty.call(t,n)?t[n]:(r.add(n),e)),missing:[...r]}}function oK(e,t){let r=new Set,n=e=>{if("string"==typeof e){let n=oB(e,t);return n.missing.forEach(e=>r.add(e)),n.text}return Array.isArray(e)?e.map(n):e&&"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,n(t)])):e};return{value:n(e),missing:[...r]}}function oZ(){return{grant:"client_credentials",tokenUrl:"",authUrl:"",redirectUri:"http://127.0.0.1:53682/callback",clientId:"",clientSecret:"",scope:"",username:"",password:"",clientAuth:"basic",pkce:!0,extra:[],privateKey:"",assertionAlgorithm:"RS256",issuer:"",subject:"",audience:"",kid:"",certificate:"",extraClaims:"",samlSource:"idp",idpUrl:"",userId:"",companyId:"",assertion:""}}function oJ(e){let t=oZ();if(!e||"object"!=typeof e)return t;let r=(e,t)=>"string"==typeof e?e:t;return{grant:["client_credentials","password","authorization_code","jwt_bearer","saml_bearer"].includes(e.grant)?e.grant:t.grant,tokenUrl:r(e.tokenUrl,""),authUrl:r(e.authUrl,""),redirectUri:r(e.redirectUri,t.redirectUri),clientId:r(e.clientId,""),clientSecret:r(e.clientSecret,""),scope:r(e.scope,""),username:r(e.username,""),password:r(e.password,""),clientAuth:"body"===e.clientAuth?"body":"private_key_jwt"===e.clientAuth?"private_key_jwt":"basic",pkce:!1!==e.pkce,privateKey:r(e.privateKey,""),assertionAlgorithm:["RS256","RS384","RS512","PS256","ES256","ES384"].includes(e.assertionAlgorithm)?e.assertionAlgorithm:"RS256",issuer:r(e.issuer,""),subject:r(e.subject,""),audience:r(e.audience,""),kid:r(e.kid,""),certificate:r(e.certificate,""),extraClaims:r(e.extraClaims,""),samlSource:"assertion"===e.samlSource?"assertion":"idp",idpUrl:r(e.idpUrl,""),userId:r(e.userId,""),companyId:r(e.companyId,""),assertion:r(e.assertion,""),extra:(Array.isArray(e.extra)?e.extra:[]).flatMap(e=>e&&"string"==typeof e.key?[{key:e.key,value:r(e.value,"")}]:[])}}function oH(){return{accessKeyId:"",secretAccessKey:"",sessionToken:"",region:"us-east-1",service:"execute-api"}}function oV(e){let t=oH();if(!e||"object"!=typeof e)return t;let r=(e,t)=>"string"==typeof e?e:t;return{accessKeyId:r(e.accessKeyId,""),secretAccessKey:r(e.secretAccessKey,""),sessionToken:r(e.sessionToken,""),region:r(e.region,t.region),service:r(e.service,t.service)}}function oW(){return{algorithm:"HS256",secret:"",privateKey:"",payload:'{\n "sub": "load-test-user"\n}',lifetimeSec:3600,kid:"",headerName:"Authorization",prefix:"Bearer"}}function oG(e){let t=oW();if(!e||"object"!=typeof e)return t;let r=(e,t)=>"string"==typeof e?e:t,n=Number(e.lifetimeSec);return{algorithm:["HS256","HS384","HS512","RS256","RS384","RS512","PS256","ES256","ES384","ES512"].includes(e.algorithm)?e.algorithm:t.algorithm,secret:r(e.secret,""),privateKey:r(e.privateKey,""),payload:r(e.payload,t.payload),lifetimeSec:Number.isFinite(n)&&n>=10?Math.round(n):t.lifetimeSec,kid:r(e.kid,""),headerName:r(e.headerName,t.headerName),prefix:r(e.prefix,t.prefix)}}function oX(){return{consumerKey:"",consumerSecret:"",token:"",tokenSecret:"",signatureMethod:"HMAC-SHA256",realm:"",addTo:"header"}}function oY(e){let t=oX();if(!e||"object"!=typeof e)return t;let r=(e,t)=>"string"==typeof e?e:t;return{consumerKey:r(e.consumerKey,""),consumerSecret:r(e.consumerSecret,""),token:r(e.token,""),tokenSecret:r(e.tokenSecret,""),signatureMethod:["HMAC-SHA256","HMAC-SHA1","PLAINTEXT"].includes(e.signatureMethod)?e.signatureMethod:t.signatureMethod,realm:r(e.realm,""),addTo:"query"===e.addTo?"query":"header"}}let oQ={oauth:["clientSecret","password","privateKey","assertion"],aws:["secretAccessKey","sessionToken"],jwt:["secret","privateKey"],oauth1:["consumerSecret","tokenSecret"]};function o0(){return{auth:{authMode:"inherit",oauth:oZ(),oauth1:oX(),aws:oH(),jwt:oW(),domain:"",token:"",username:"",password:"",apiName:"X-API-Key",apiValue:"",apiIn:"header"},headers:[],variables:[],preScript:"",postScript:""}}function o1(e){return"inherit"===e.auth.authMode&&!e.headers.some(e=>e.key.trim())&&0===e.variables.length&&!e.preScript.trim()&&!e.postScript.trim()&&!e.contract&&!e.description?.trim()}function o2(e){return e.split(/[\\/]/).map(e=>e.trim()).filter(Boolean).slice(0,6).map(e=>(function(e,t="untitled"){return e.normalize("NFKD").replace(/[<>:"/\\|?*\u0000-\u001f]/g," ").replace(/\s+/g," ").trim().replace(/[. ]+$/,"").slice(0,60)||t})(e)).join("/")}e.s(["c",0,6,"F",0,oQ,"m",0,oU,"d",0,oV,"j",0,oH,"k",0,oW,"Z",0,oZ,"s",0,oX,"I",0,o0,"n",0,function(e){let t=new Set;for(let r of e.matchAll(oF))t.add(r[1]);return[...t]},"W",0,function(e){let t=e?e.split("/"):[];return t.map((e,r)=>t.slice(0,r+1).join("/"))},"g",0,function(e){return e.split("/").at(-1)??""},"y",0,o2,"T",0,function(e,t){return""===t||e===t||e.startsWith(`${t}/`)},"u",0,o1,"e",0,oD,"v",0,oG,"t",0,oY,"X",0,oJ,"L",0,function(e){return e.split("/").slice(0,-1).join("/")},"M",0,function(e){let t={...e};for(let e=0;e<5;e++){let e=!1,r={};for(let[n,s]of Object.entries(t)){let i=s.includes("{{")?oB(s,Object.fromEntries(Object.entries(t).filter(([e])=>e!==n))).text:s;i!==s&&(e=!0),r[n]=i}if(t=r,!e)break}return t},"N",0,oB,"J",0,oK,"Q",0,function(e){let t={};for(let r of e?.variables??[])r.key.trim()&&(t[r.key.trim()]=r.value);return t}],78451);let o5=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],o9=e=>!!e.key.trim()&&!1!==e.enabled,o6=["none","json","text","graphql","form","multipart","file"],o4=["smoke","average","stress","spike","soak","custom"],o3={preset:"smoke",...a7.smoke},o8={},o7="smoke";function le(){return{...lt(),...o8}}function lt(){return{method:"GET",url:"",baseUrl:"",endpoint:"",params:[],headers:[],bodyMode:"none",graphqlQuery:"",graphqlVariables:"",graphqlOperation:"",graphqlErrorsFail:!0,bodyText:"",formRows:[],bodyFile:null,bodyFileType:"",authMode:"inherit",oauth:oZ(),oauth1:oX(),aws:oH(),jwt:oW(),domain:"",token:"",username:"",password:"",apiName:"X-API-Key",apiValue:"",apiIn:"header",timeout:"5m",maxRedirects:5,connectionReuse:!0,useCookies:!0,tlsSkip:!0,checks:[],before:null,testData:null,saveValues:[],preScript:"",postScript:"",mock:null,description:""}}function lr(e){let t=aU.safeParse(e);return t.success?t.data:null}function ln(e){return Array.isArray(e)?e.map(e=>({key:"string"==typeof e?.key?e.key:"",value:"string"==typeof e?.value?e.value:"",...e?.enabled===!1?{enabled:!1}:{},..."string"==typeof e?.description&&e.description?{description:e.description}:{}})).filter(e=>e.key||e.value):[]}let ls=(e,t)=>"string"==typeof e?e:t,li=(e,t)=>"number"==typeof e&&Number.isFinite(e)?e:t;function la(e){var t,r;let n=lt();if(!e||"object"!=typeof e)return n;let s=o6.includes(e.bodyMode)?e.bodyMode:"none",i="bearer"===e.authMode||"basic"===e.authMode||"api_key"===e.authMode||"inherit"===e.authMode||"oauth2"===e.authMode||"digest"===e.authMode||"ntlm"===e.authMode||"aws_sigv4"===e.authMode||"jwt"===e.authMode||"oauth1"===e.authMode?e.authMode:void 0===e.authMode?"inherit":"none";return{method:o5.includes(e.method)?e.method:"GET",url:ls(e.url,""),baseUrl:ls(e.baseUrl,""),endpoint:ls(e.endpoint,""),params:ln(e.params),headers:ln(e.headers),bodyMode:s,bodyText:ls(e.bodyText,""),formRows:Array.isArray(t=e.formRows)?t.slice(0,100).map(e=>{let t=e??{};return{key:"string"==typeof t.key?t.key:"",value:"string"==typeof t.value?t.value:"",kind:"file"===t.kind?"file":"text",file:lr(t.file)}}):[],bodyFile:lr(e.bodyFile),bodyFileType:ls(e.bodyFileType,""),graphqlQuery:ls(e.graphqlQuery,""),graphqlVariables:ls(e.graphqlVariables,""),graphqlOperation:ls(e.graphqlOperation,""),graphqlErrorsFail:!1!==e.graphqlErrorsFail,authMode:i,oauth:oJ(e.oauth),oauth1:oY(e.oauth1),aws:oV(e.aws),jwt:oG(e.jwt),domain:ls(e.domain,""),token:ls(e.token,""),username:ls(e.username,""),password:ls(e.password,""),apiName:ls(e.apiName,n.apiName),apiValue:ls(e.apiValue,""),apiIn:"query"===e.apiIn?"query":"header",timeout:ls(e.timeout,n.timeout),maxRedirects:li(e.maxRedirects,n.maxRedirects),connectionReuse:!1!==e.connectionReuse,useCookies:!1!==e.useCookies,tlsSkip:!0===e.tlsSkip,checks:Array.isArray(r=e.checks)?r.flatMap(e=>{let t=aT.safeParse(e);return t.success?[t.data]:[]}):[],before:function(e){if(!e||"string"!=typeof e.requestId||!e.requestId)return null;let t=(Array.isArray(e.extract)?e.extract:[]).flatMap(e=>{let t=a0.safeParse(e);return t.success?[t.data]:[]});return{requestId:e.requestId,requestName:"string"==typeof e.requestName?e.requestName:"Saved request",extract:t}}(e.before),testData:function(e){if(!e)return null;let t=a2.safeParse(e);return t.success?t.data:null}(e.testData),saveValues:(Array.isArray(e.saveValues)?e.saveValues:[]).flatMap(e=>{let t=a0.safeParse(e);return t.success?[t.data]:[]}),preScript:ls(e.preScript,"").slice(0,1e5),postScript:ls(e.postScript,"").slice(0,1e5),mock:oR(e.mock),description:ls(e.description,"").slice(0,5e4)}}let lo=e=>e.split(/(\{\{[^}]*\}\})/).map(e=>e.startsWith("{{")?e:encodeURIComponent(e)).join(""),ll=e=>{try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}};function lu(e,t){return e.map(e=>{let r=t.find(t=>t.key===e.key&&!1!==t.enabled)?.description;return r?{key:e.key,value:e.value,description:r}:{key:e.key,value:e.value}})}function lc(e,t){if(!t.trim())return{...e,url:"",baseUrl:"",endpoint:"",params:[]};let r=oM(t);if(!r.valid){let r=t.indexOf("?"),n=r<0?[]:t.slice(r+1).split("&").filter(Boolean).map(e=>{let t=e.indexOf("=");return{key:ll(t<0?e:e.slice(0,t)),value:ll(t<0?"":e.slice(t+1))}}),s=e.params.filter(e=>!1===e.enabled);return{...e,url:t,params:[...lu(n,e.params),...s]}}let n=e.params.filter(e=>!1===e.enabled);return{...e,url:t,baseUrl:r.baseUrl,endpoint:r.endpoint,params:[...lu(r.params,e.params),...n]}}function lp(e){return"GET"!==e&&"HEAD"!==e}function ld(e){return[...ot({setup:e.before,data:e.testData}),...aq(e.preScript??"")]}function lh(e){let t=oM(e.url),r=t.valid?t:oj({baseUrl:e.baseUrl,endpoint:e.endpoint,params:e.params})?{baseUrl:e.baseUrl,endpoint:e.endpoint,params:e.params}:null;if(!r)throw Error(e.url.trim().startsWith("/")?"That's a path, not a full address — pick a Base URL next to the method, or add a variable like baseUrl (https://…) under Manage and start the URL with {{baseUrl}}":"Enter a full http:// or https:// URL");let n=oj({baseUrl:r.baseUrl,endpoint:r.endpoint,params:[]}),s={mode:"none"};if("bearer"===e.authMode){let t=a6(e.token);if(!t)throw Error("Bearer auth is on but the token is empty");s={mode:"bearer",token:t}}else if("basic"===e.authMode){if(!e.username)throw Error("Basic auth needs a username");s={mode:"basic",username:e.username,password:e.password}}else if("api_key"===e.authMode){if(!e.apiName.trim()||!e.apiValue)throw Error("API key auth needs a name and a value");s={mode:"api_key",name:e.apiName.trim(),value:e.apiValue,in:e.apiIn}}else if("oauth2"===e.authMode)s={mode:"oauth2",oauth:lg(e.oauth)};else if("digest"===e.authMode){if(!e.username)throw Error("Digest auth needs a username");s={mode:"digest",username:e.username,password:e.password}}else if("ntlm"===e.authMode){if(!e.username)throw Error("NTLM needs a username");let[t,r]=e.username.includes("\\")?e.username.split("\\",2):[e.domain,e.username];s={mode:"ntlm",username:r,password:e.password,domain:t.trim()}}else if("aws_sigv4"===e.authMode){let t=e.aws;if(!t.accessKeyId.trim()||!t.secretAccessKey)throw Error("AWS signing needs the access key ID and the secret access key");if(!t.region.trim()||!t.service.trim())throw Error("AWS signing needs the region (like eu-west-1) and the service (like execute-api or s3)");s={mode:"aws_sigv4",accessKeyId:t.accessKeyId.trim(),secretAccessKey:t.secretAccessKey,sessionToken:t.sessionToken.trim(),region:t.region.trim(),service:t.service.trim()}}else if("oauth1"===e.authMode){let t=e.oauth1;if(!t.consumerKey.trim())throw Error("OAuth 1.0 needs the consumer key");if(t.token.trim()&&!t.tokenSecret)throw Error("OAuth 1.0: the token needs its token secret");s={mode:"oauth1",consumerKey:t.consumerKey.trim(),consumerSecret:t.consumerSecret,token:t.token.trim(),tokenSecret:t.tokenSecret,signatureMethod:t.signatureMethod,realm:t.realm.trim(),addTo:t.addTo}}else if("jwt"===e.authMode){let t=e.jwt,r=t.algorithm.startsWith("HS"),n=r?t.secret:t.privateKey.trim();if(!n)throw Error(r?"JWT needs the secret to sign with":"JWT needs the private key (PEM) to sign with");try{let e=JSON.parse(t.payload||"{}");if(!e||"object"!=typeof e||Array.isArray(e))throw Error("not an object")}catch{throw Error('The JWT claims must be a JSON object, like { "sub": "user-1" }')}s={mode:"jwt",algorithm:t.algorithm,key:n,payload:t.payload||"{}",lifetimeSec:t.lifetimeSec,kid:t.kid.trim(),headerName:t.headerName.trim()||"Authorization",prefix:t.prefix.trim()}}let i={mode:"none"};if(lp(e.method)&&"json"===e.bodyMode)try{i={mode:"json",json:e.bodyText.trim()?JSON.parse(e.bodyText):{}}}catch(n){let t=ld(e).find(t=>RegExp(`(^|[^"])\\{\\{\\s*${t.replace(/[.-]/g,"\\$&")}\\s*\\}\\}(?!")`).test(e.bodyText));if(t)throw Error(`Put quotes around {{${t}}} in the JSON body — values from test data and run-first steps are filled in as text`);let r=/(^|[^"])\{\{\s*(\$[A-Za-z]+)/.exec(e.bodyText)?.[2];if(r)throw Error(`Put quotes around {{${r}}} in the JSON body — built-in values are filled in as text`);throw Error(`Body is not valid JSON: ${n instanceof Error?n.message:"parse error"}`)}else if(lp(e.method)&&"graphql"===e.bodyMode){if(!e.graphqlQuery.trim())throw Error("Write the GraphQL query");let t={};if(e.graphqlVariables.trim())try{t=JSON.parse(e.graphqlVariables)}catch(e){throw Error(`GraphQL variables are not valid JSON: ${e instanceof Error?e.message:"parse error"} — put quotes around "{{values}}" from test data`)}i={mode:"json",json:{query:e.graphqlQuery,variables:t,...e.graphqlOperation.trim()?{operationName:e.graphqlOperation.trim()}:{}}}}else if(lp(e.method)&&"text"===e.bodyMode)i={mode:"text",text:e.bodyText};else if(lp(e.method)&&"form"===e.bodyMode)i={mode:"form",fields:e.formRows.filter(e=>"text"===e.kind&&e.key.trim()).map(e=>({key:e.key,value:e.value}))};else if(lp(e.method)&&"multipart"===e.bodyMode){let t=[];for(let r of e.formRows)if(r.key.trim())if("text"===r.kind)t.push({kind:"text",key:r.key,value:r.value});else if(r.file)t.push({kind:"file",key:r.key,file:r.file});else throw Error(`Choose a file for "${r.key}" in the body`);i={mode:"multipart",parts:t}}else if(lp(e.method)&&"file"===e.bodyMode){if(!e.bodyFile)throw Error("Choose the file to send as the body");i={mode:"file",file:e.bodyFile,contentType:e.bodyFileType.trim()||e.bodyFile.contentType||"application/octet-stream"}}return{request:{method:e.method,url:n,query:r.params.filter(o9),headers:e.headers.filter(o9),body:i,expectedStatus:[],checks:[...e.checks.filter(e=>{if("status"===e.type)return e.expect.trim().length>0;if("body"===e.type)return"is_json"===e.op||e.value.length>0;if("json"===e.type)return e.path.trim().length>0;if("header"===e.type)return e.name.trim().length>0;if("schema"===e.type){var t=e.schema;try{let e=JSON.parse(t);return!!e&&"object"==typeof e&&!Array.isArray(e)}catch{return!1}}return e.maxMs>0}),...lp(e.method)&&"graphql"===e.bodyMode&&e.graphqlErrorsFail?[{type:"json",path:"errors",op:"not_exists",value:""}]:[]]},auth:s,options:{timeout:e.timeout,maxRedirects:e.maxRedirects,httpVersion:"1.1",tlsSkipVerify:e.tlsSkip,connectionReuse:e.connectionReuse,cookies:e.useCookies}}}let lf=["url","baseUrl","endpoint","params","headers","bodyText","graphqlQuery","graphqlVariables","token","username","password","apiName","apiValue","oauth","oauth1","aws","jwt","domain"],lm=/^\d+(\.\d+)?(ms|s|m|h)$/;function ly(e,t=!0){return lm.test(e.trim())?!t&&/^0+(\.0+)?(ms|s|m|h)$/.test(e.trim())?"Must be longer than 0":void 0:"Use a duration like 30s, 5m, or 1h"}function lg(e){let t=e.tokenUrl.trim();if(!/^https?:\/\//i.test(t))throw Error("OAuth 2.0 needs the token URL (https://…/token)");if("password"===e.grant&&!e.username.trim())throw Error("OAuth 2.0 password grant needs a username");if("authorization_code"===e.grant&&!/^https?:\/\//i.test(e.authUrl.trim()))throw Error("OAuth 2.0 authorization code needs the authorization URL (https://…/authorize)");if("authorization_code"===e.grant&&!/^http:\/\/(127\.0\.0\.1|localhost)(:\d+)?\//i.test(e.redirectUri.trim()))throw Error("The redirect URL must be on this computer, like http://127.0.0.1:53682/callback — add the same one in your OAuth app");if(!e.clientId.trim())throw Error("OAuth 2.0 needs a client ID");if(("jwt_bearer"===e.grant||"private_key_jwt"===e.clientAuth||"saml_bearer"===e.grant&&"idp"===e.samlSource)&&!e.privateKey.trim())throw Error("OAuth 2.0: this sign-in needs the private key (PEM)");if("jwt_bearer"===e.grant&&e.extraClaims.trim())try{let t=JSON.parse(e.extraClaims);if(!t||"object"!=typeof t||Array.isArray(t))throw Error("x")}catch{throw Error("OAuth 2.0: the extra claims must be a JSON object")}if("saml_bearer"===e.grant&&"idp"===e.samlSource&&(!/^https?:\/\//i.test(e.idpUrl.trim())||!e.userId.trim()))throw Error("SAML bearer needs the assertion URL (SuccessFactors: https://<api-server>/oauth/idp) and the user ID");if("saml_bearer"===e.grant&&"assertion"===e.samlSource&&!e.assertion.trim())throw Error("SAML bearer needs the assertion (base64)");return{grant:e.grant,tokenUrl:t,authUrl:e.authUrl.trim(),redirectUri:e.redirectUri.trim(),clientId:e.clientId.trim(),clientSecret:e.clientSecret,scope:e.scope.trim(),username:e.username,password:e.password,clientAuth:e.clientAuth,pkce:e.pkce,extra:e.extra.filter(e=>e.key.trim()),privateKey:e.privateKey.trim(),assertionAlgorithm:e.assertionAlgorithm,issuer:e.issuer.trim(),subject:e.subject.trim(),audience:e.audience.trim(),kid:e.kid.trim(),certificate:e.certificate.trim(),extraClaims:e.extraClaims.trim(),samlSource:e.samlSource,idpUrl:e.idpUrl.trim(),userId:e.userId.trim(),companyId:e.companyId.trim(),assertion:e.assertion.trim()}}e.s(["J",0,o3,"C",0,o5,"y",0,function(e,t){let r=e,n=null,s=!1;if("inherit"===e.authMode){let e=[...t].reverse().find(e=>"inherit"!==e.settings.auth.authMode),i=e?.settings.auth;e&&i&&"none"!==i.authMode?(n=e.path,s=!!e.connection,r={...r,authMode:i.authMode,oauth:i.oauth,oauth1:i.oauth1,aws:i.aws,jwt:i.jwt,domain:i.domain,token:i.token,username:i.username,password:i.password,apiName:i.apiName,apiValue:i.apiValue,apiIn:i.apiIn}):r={...r,authMode:"none"}}let i=new Set(e.headers.filter(o9).map(e=>e.key.trim().toLowerCase())),a=new Map;for(let e of t)for(let t of e.settings.headers)o9(t)&&a.set(t.key.trim().toLowerCase(),{key:t.key.trim(),value:t.value});let o=[...a.entries()].filter(([e])=>!i.has(e)).map(([,e])=>e);o.length&&(r={...r,headers:[...o,...r.headers]});let l=t.filter(e=>e.settings.preScript.trim()||e.settings.postScript.trim()).map(e=>e.path),u=(e,r)=>{let n=t.filter(e=>r(e.settings).trim()).map(e=>`// From the ${e.connection?"connection":"folder"} “${e.path}”
636
+ {
637
+ ${r(e.settings)}
638
+ }`);return n.length?[...n,...e.trim()?[`// This request's own
639
+ {
640
+ ${e}
641
+ }`]:[]].join("\n\n"):e};r={...r,preScript:u(e.preScript,e=>e.preScript),postScript:u(e.postScript,e=>e.postScript)};let c={};for(let e of t)for(let t of e.settings.variables)c[t.key]=t.value;let p=[...t].reverse().find(e=>e.settings.contract),d=p?{id:p.settings.contract,from:p.path}:void 0;return{draft:r,vars:c,inherited:{authFrom:n,...s?{authFromConnection:s}:{},headers:o.map(e=>e.key),scripts:l,...d?{contract:d}:{}}}},"V",0,function(e,t){return"custom"===t?{...e,preset:t}:{preset:t,mode:"users",rps:e.rps,maxVus:e.maxVus,stages:null,...a7[t]}},"m",0,function(e,t){let r=e.endpoint.trim();if(!r&&/^\s*\{\{[^}]+\}\}/.test(e.url)&&(r=e.url.replace(/^\s*\{\{[^}]+\}\}/,"").split("?")[0]||"/"),!r)try{r=new URL(e.url).pathname}catch{r=e.url}let n=new Date().toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"});return`${t?`${t} \xb7 `:""}${e.method} ${r||"/"} \xb7 ${n}`},"M",0,function(e,t,r,n){let s,i=lh(e);return{name:r.slice(0,120),...i,load:t,targets:n,setup:void 0,contract:void 0,data:e.testData&&e.testData.rows.length?e.testData:void 0,save:(s=e.saveValues.filter(e=>e.name.trim()&&e.path.trim()&&aY.test(e.name.trim()))).length?s.map(e=>({...e,name:e.name.trim(),path:e.path.trim()})):void 0,scripts:e.preScript.trim()||e.postScript.trim()?{pre:e.preScript,post:e.postScript}:void 0}},"d",0,function(e,t){if(!e.extract.length)throw Error(`Run first: choose at least one value to take from “${e.requestName}”`);for(let t of e.extract){if(!t.name.trim())throw Error("Run first: every value needs a name, like token");if(!t.path.trim())throw Error(`Run first: say where to find {{${t.name}}} in the answer of “${e.requestName}”`)}let r=lh({...t,checks:[],before:null,testData:null,saveValues:[],preScript:"",postScript:""});return{label:e.requestName.slice(0,120)||"Run first",...r,extract:e.extract}},"j",0,function(){return{preset:o7,...a7[o7]}},"t",0,le,"b",0,function(e){return{params:e.params.filter(o9).length,headers:e.headers.filter(o9).length,auth:"none"!==e.authMode&&"inherit"!==e.authMode,body:lp(e.method)&&function(e){switch(e.bodyMode){case"none":return!1;case"graphql":return e.graphqlQuery.trim().length>0;case"form":case"multipart":return e.formRows.some(e=>e.key.trim());case"file":return null!==e.bodyFile;default:return e.bodyText.trim().length>0}}(e),checks:e.checks.length,before:null!==e.before,testData:e.testData?.rows.length??0,saveValues:e.saveValues.filter(e=>e.name.trim()&&e.path.trim()).length,scripts:+!!e.preScript.trim()+ +!!e.postScript.trim()}},"h",0,ld,"R",0,ly,"T",0,lp,"o",0,o9,"k",0,function(e){return oM(e.url).valid||!!oj(e)||/\{\{.+\}\}/.test(e.url)},"W",0,function(e){return e&&"object"==typeof e?{preset:o4.includes(e.preset)?e.preset:"smoke",vus:li(e.vus,o3.vus),duration:ls(e.duration,o3.duration),rampUp:ls(e.rampUp,o3.rampUp),rampDown:ls(e.rampDown,o3.rampDown),thinkTimeMs:li(e.thinkTimeMs,o3.thinkTimeMs),thinkJitterMs:li(e.thinkJitterMs,o3.thinkJitterMs),gracefulStop:ls(e.gracefulStop,o3.gracefulStop),mode:"rate"===e.mode?"rate":"users",rps:li(e.rps,20),maxVus:li(e.maxVus,100),stages:function(e){if(!Array.isArray(e)||0===e.length)return null;let t=e.map(e=>e).filter(e=>"string"==typeof e.duration&&"number"==typeof e.target).map(e=>({duration:e.duration,target:e.target}));return t.length?t:null}(e.stages)}:{...o3}},"w",0,function(e){if(e.stages&&e.stages.length){for(let[t,r]of e.stages.entries()){let n=ly(r.duration,!1);if(n)return`Stage ${t+1}: ${n}`;if(!(r.target>=0))return`Stage ${t+1}: target must be 0 or more`;if("rate"!==e.mode&&r.target>500)return`Stage ${t+1}: at most 500 virtual users`}return e.stages.some(e=>e.target>0)?ly(e.gracefulStop)??null:"At least one stage needs a target above 0"}if("rate"===e.mode){if(!(e.rps>=1&&e.rps<=1e5))return"Requests per second must be 1–100,000";if(!(e.maxVus>=1&&e.maxVus<=2e3))return"Max virtual users must be 1–2,000"}else if(!(e.vus>=1&&e.vus<=500))return"Virtual users must be 1–500";return ly(e.duration,!1)??ly(e.rampUp)??ly(e.rampDown)??ly(e.gracefulStop)??null},"A",0,lg,"i",0,la,"x",0,function(e,t,r){let n=Object.fromEntries(lf.map(t=>[t,e[t]])),s=new Set(ld(e)),i={...t};for(let e of s)i[e]=`{{${e}}}`;let{value:a,missing:o}=oK(n,i);if(o.length){let e=o.map(e=>`{{${e}}}`).join(", ");throw Error(r?`${e} ${1===o.length?"is":"are"} not defined in ${r}`:`${e} needs an environment — pick one next to the URL`)}let l={...e,...a};return l.url!==e.url?lc(l,l.url):l},"P",0,function(e){e.requests&&(o8={...e.requests}),e.loadPreset&&(o7=e.loadPreset)},"n",0,function(e){if(e)return{p95Ms:e.p95Ms,p99Ms:e.p99Ms||void 0,errorRate:e.errorRate,checksRate:e.checksRate,abortOnFail:!0===e.abortOnFail}},"S",0,function(e){let{preset:t,...r}=e;return{...oe(r),testType:t}},"K",0,function(e,t){let r={...e,...t},n=oj({baseUrl:r.baseUrl,endpoint:r.endpoint,params:r.params});if(n)return{...r,url:n};if(t.params&&void 0===t.baseUrl&&void 0===t.endpoint){let t=e.url.split("?")[0]??"",n=r.params.filter(o9).map(e=>`${lo(e.key.trim())}=${lo(e.value)}`).join("&");return{...r,url:n?`${t}?${n}`:t}}return{...r,url:e.url}},"X",0,function(e,t){let r=function(e){let t,r,n,s,i=function(e){let t=/\^\s*\r?\n/.test(e)||/\^"/.test(e)?e.replace(/\^\s*\r?\n/g," ").replace(/\^(.)/g,"$1"):e.replace(/\\\r?\n/g," "),r=[],n="",s=!1,i=null;for(let e=0;e<t.length;e++){let a=t[e];if("'"===i){"'"===a?i=null:n+=a;continue}if('"'===i){'"'===a?i=null:"\\"===a&&e+1<t.length&&'"\\$`'.includes(t[e+1])?n+=t[++e]:n+=a;continue}if("'"===a||'"'===a){i=a,s=!0;continue}if("\\"===a&&e+1<t.length){n+=t[++e],s=!0;continue}if(/\s/.test(a)){(s||n)&&r.push(n),n="",s=!1;continue}n+=a,s=!0}return(s||n)&&r.push(n),r}(e.trim());if(0===i.length||!/^curl(\.exe)?$/i.test(i[0]))return null;let a=[],o=[],l=!1,u=!1,c=!1,p=[];for(let e=1;e<i.length;e++){let s=i[e],d=()=>i[++e]??"",[h,f]=s.startsWith("--")&&s.includes("=")?[s.slice(0,s.indexOf("=")),s.slice(s.indexOf("=")+1)]:[s,void 0],m=()=>f??d();if("-X"===h||"--request"===h)t=m().toUpperCase();else if(/^-X[A-Za-z]+$/.test(s))t=s.slice(2).toUpperCase();else if("-H"===h||"--header"===h){let e=m(),t=e.indexOf(":");t>0&&a.push({key:e.slice(0,t).trim(),value:e.slice(t+1).trim()})}else if(oC.has(h))"--json"===h&&(c=!0),o.push(m());else if("-F"===h||"--form"===h||"--form-string"===h){let e=m(),t=e.indexOf("=");if(t>0){let r=e.slice(0,t),n=e.slice(t+1);"--form-string"!==h&&/^[@<]/.test(n)?p.push({key:r,value:"",file:n.slice(1).split(";")[0].replace(/^.*[\/]/,"")||"file"}):p.push({key:r,value:"--form-string"===h?n:n.replace(/;type=[^;]*$/,"")})}}else if("-u"===h||"--user"===h){let e=m(),t=e.indexOf(":");n={mode:"basic",username:t<0?e:e.slice(0,t),password:t<0?"":e.slice(t+1)}}else"-k"===h||"--insecure"===h?l=!0:"-G"===h||"--get"===h?u=!0:"--url"===h?r=m():oP.has(h)?m():!s.startsWith("-")&&!r&&/^https?:\/\//i.test(s)&&(r=s)}if(!r||!oM(r).valid)return null;let d=[];for(let e of a){if("authorization"===e.key.toLowerCase()){let[t,...r]=e.value.split(/\s+/),s=r.join(" ");if(/^bearer$/i.test(t??"")&&s){n={mode:"bearer",token:s};continue}if(/^basic$/i.test(t??"")&&s){let e=function(e){try{let t="function"==typeof atob?atob(e):oO.Buffer.from(e,"base64").toString("utf8"),r=t.indexOf(":");if(r<0)return;return{mode:"basic",username:t.slice(0,r),password:t.slice(r+1)}}catch{return}}(s);if(e){n=e;continue}}}d.push(e)}let h=o.join("&"),f=d.find(e=>"content-type"===e.key.toLowerCase())?.value??"",m=r;return h&&u?m=`${r}${r.includes("?")?"&":"?"}${h}`:h&&(s={mode:c||f.includes("json")||function(e){let t=e.trim();if(!(t.startsWith("{")||t.startsWith("[")))return!1;try{return JSON.parse(t),!0}catch{return!1}}(h)?"json":"text",text:h}),{method:t&&oz.has(t)?t:s||p.length?"POST":"GET",url:m,headers:p.length?d.filter(e=>!("content-type"===e.key.toLowerCase()&&/multipart/i.test(e.value))):d,body:s,...p.length?{form:p}:{},auth:n,tlsSkip:l}}(t);if(r){let t=lc({...e,method:r.method},r.url);t={...t,headers:r.headers,tlsSkip:r.tlsSkip||t.tlsSkip},r.body&&(t={...t,bodyMode:r.body.mode,bodyText:function(e,t){if("json"!==t)return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}(r.body.text,r.body.mode)}),r.form&&(t={...t,bodyMode:"multipart",formRows:r.form.map(e=>({key:e.key,value:e.value,kind:void 0!==e.file?"file":"text",file:null}))}),r.auth?.mode==="bearer"&&(t={...t,authMode:"bearer",token:r.auth.token}),r.auth?.mode==="basic"&&(t={...t,authMode:"basic",username:r.auth.username,password:r.auth.password});let n=[r.headers.length?`${r.headers.length} header${1===r.headers.length?"":"s"}`:null,r.body?"body":null,r.form?"form":null,r.auth?`${r.auth.mode} auth`:null].filter(Boolean),s=r.form?.filter(e=>void 0!==e.file).length??0,i=s?` — choose the file${1===s?"":"s"} in the Body tab`:"";return{draft:t,note:`Imported curl${n.length?`: ${n.join(", ")}`:""}${i}`}}let n=function(e){let t=e.trim().replace(/^['"]+|['"]+$/g,"");if(!t)return null;let r=t.match(/^(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\s+(https?:\/\/\S+)/i);if(r){let e=oq(r[2]??"");if(oM(e).valid)return{url:e,method:oI(r[1])}}if(/\bcurl\b/i.test(t)){let e=t.match(/https?:\/\/[^\s'"]+/),r=t.match(/\s-X\s*['"]?([A-Za-z]+)/);if(e){let t=oq(e[0]);if(oM(t).valid)return{url:t,method:oI(r?.[1])??"GET"}}}let n=t.match(/https?:\/\/[^\s'"]+/);if(n){let e=oq(n[0]);if(oM(e).valid)return{url:e}}return null}(t);return n?{draft:lc(n.method?{...e,method:n.method}:e,n.url)}:null},"e",0,lc],5305);let lb="apitestcenter.collection/1",lv=[{id:"apitestcenter",label:"APITestCenter",note:"Everything; double-click opens it in the app",extension:".apitestcenter",mime:"application/json"},{id:"postman",label:"Postman v2.1",note:"For teammates on Postman or Insomnia",extension:".postman_collection.json",mime:"application/json"},{id:"openapi",label:"OpenAPI 3.1",note:"For docs, gateways and code generators",extension:".openapi.json",mime:"application/json"},{id:"http",label:".http file",note:"VS Code REST Client and JetBrains",extension:".http",mime:"text/plain"},{id:"docs",label:"API docs (HTML)",note:"One page to share or host: every request, an example answer, code",extension:".html",mime:"text/html"},{id:"markdown",label:"Markdown docs",note:"For a README or a wiki",extension:".md",mime:"text/markdown"}],lw=/^(authorization|proxy-authorization|cookie|x-api-key|api-key|x-auth-token|x-access-token)$/i,lk=e=>"string"==typeof e&&""!==e&&!oD(e);function lx(e){let t=structuredClone(e);for(let e of oU)lk(t[e])&&(t[e]="");for(let[e,r]of Object.entries(oQ)){let n=t[e];if(n)for(let e of r)lk(n[e])&&(n[e]="")}return t.headers=t.headers.map(e=>lw.test(e.key.trim())&&lk(e.value)&&!/\{\{/.test(e.value)?{...e,value:""}:e),t}function l$(e,t){return t?e===t?"":e.startsWith(`${t}/`)?e.slice(t.length+1):e:e}let lS=e=>(e?.variables??[]).map(e=>({key:e.key,value:e.secret?"":e.value,secret:e.secret}));function l_(e){let t,r=e.headers.filter(e=>e.key.trim()).map(e=>({key:e.key,value:e.value,...!1===e.enabled?{disabled:!0}:{},...e.description?{description:e.description}:{}}));"json"===e.bodyMode||"text"===e.bodyMode?t={mode:"raw",raw:e.bodyText,options:{raw:{language:"json"===e.bodyMode?"json":"text"}}}:"form"===e.bodyMode?t={mode:"urlencoded",urlencoded:e.formRows.filter(e=>e.key).map(e=>({key:e.key,value:e.value}))}:"multipart"===e.bodyMode?t={mode:"formdata",formdata:e.formRows.filter(e=>e.key).map(e=>"file"===e.kind?{key:e.key,type:"file",src:[]}:{key:e.key,value:e.value,type:"text"})}:"graphql"===e.bodyMode&&(t={mode:"graphql",graphql:{query:e.graphqlQuery,variables:e.graphqlVariables}});let n="bearer"===e.authMode?{type:"bearer",bearer:[{key:"token",value:e.token,type:"string"}]}:"basic"===e.authMode?{type:"basic",basic:[{key:"username",value:e.username,type:"string"},{key:"password",value:e.password,type:"string"}]}:"api_key"===e.authMode?{type:"apikey",apikey:[{key:"key",value:e.apiName},{key:"value",value:e.apiValue},{key:"in",value:e.apiIn}]}:"none"===e.authMode?{type:"noauth"}:void 0;return{method:e.method,header:r,url:{raw:e.url},...t?{body:t}:{},...n?{auth:n}:{},...e.description.trim()?{description:e.description}:{}}}let lA=e=>{try{return JSON.parse(e)}catch{return e}};function lT(e,t){let r=function(e){let{examples:t=!0,checks:r=!0,scripts:n=!0}=e.include??{};return t&&r&&n?e:{...e,requests:e.requests.map(e=>({...e,request:{...e.request,...t?{}:{mock:null},...r?{}:{checks:[]},...n?{}:{preScript:"",postScript:""}}}))}}(t);switch(e){case"apitestcenter":let n,s,i,a;return`${JSON.stringify((n=new Set(r.requests.map(e=>e.id)),s=e=>`r-${e.slice(0,8)}`,i=new Set(r.requests.flatMap(e=>e.request.before&&n.has(e.request.before.requestId)?[e.request.before.requestId]:[])),a=r.requests.map(e=>{let t=lx(e.request),a=t.before&&n.has(t.before.requestId)?t.before:null;return{...i.has(e.id)?{ref:s(e.id)}:{},...l$(e.collection,r.root)?{folder:l$(e.collection,r.root)}:{},name:e.name,request:function(e){let t=le(),r={};for(let[n,s]of Object.entries(e))"before"!==n&&JSON.stringify(s)!==JSON.stringify(t[n])&&(r[n]=s);return r}(t),...a?{runFirst:{ref:s(a.requestId),extract:a.extract}}:{}}}),{format:lb,name:r.title,...r.environment?{variables:lS(r.environment)}:{},requests:a}),null,2)}
642
+ `;case"postman":return`${JSON.stringify(function(e){let t={name:e.title,item:[]},r=r=>{let n=t,s=r?r.split("/"):[];return s.forEach((t,r)=>{let i=n.item.find(e=>e.item&&e.name===t);if(!i){let a=e.folders?.[[e.root,...s.slice(0,r+1)].filter(Boolean).join("/")];n.item.push(i={name:t,item:[],...a?.trim()?{description:a}:{}})}n=i}),n};for(let t of e.requests){let n=lx(t.request),s=[...n.preScript.trim()?[{listen:"prerequest",script:{type:"text/javascript",exec:n.preScript.split("\n")}}]:[],...n.postScript.trim()?[{listen:"test",script:{type:"text/javascript",exec:n.postScript.split("\n")}}]:[]],i=n.mock?[{name:"Example",originalRequest:l_(n),code:n.mock.status,header:n.mock.headers.map(([e,t])=>({key:e,value:t})),body:n.mock.body}]:void 0;r(l$(t.collection,e.root)).item.push({name:t.name,request:l_(n),...s.length?{event:s}:{},...i?{response:i}:{}})}return{info:{name:e.title,schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json",description:e.description?.trim()||"Exported from APITestCenter. Secret values are left empty."},item:t.item,...e.environment?{variable:lS(e.environment).map(e=>({key:e.key,value:e.value}))}:{}}}(r),null,2)}
643
+ `;case"openapi":return`${JSON.stringify(function(e){let t={},r=new Map,n=new Set;for(let s of e.requests){let i=lx(s.request),a=function(e){let[t,r=""]=e.split("?",2),n=/^(\{\{\s*[\w.-]+\s*\}\}|[a-z][a-z0-9+.-]*:\/\/[^/]+)?(.*)$/i.exec(t.trim()),s=[],i=(n[2]||"/").replace(/\{\{\s*([\w.-]+)\s*\}\}/g,(e,t)=>(s.push(t),`{${t}}`))||"/",a=r?r.split("&").map(e=>decodeURIComponent(e.split("=")[0]??"")).filter(Boolean):[];return{origin:n[1]??"",path:i.startsWith("/")?i:`/${i}`,pathParams:s,query:a}}(i.url);a.origin&&r.set(a.origin,(r.get(a.origin)??0)+1);let o=l$(s.collection,e.root)||s.collection;o&&n.add(o);let l=[...a.pathParams.map(e=>({name:e,in:"path",required:!0,schema:{type:"string"}})),...a.query.map(e=>({name:e,in:"query",schema:{type:"string"}})),...i.headers.filter(e=>o9(e)&&!lw.test(e.key.trim())&&!/^content-type$/i.test(e.key.trim())).map(e=>({name:e.key.trim(),in:"header",schema:{type:"string"},example:e.value,...e.description?{description:e.description}:{}}))],u="json"===i.bodyMode?{"application/json":{example:lA(i.bodyText)}}:"text"===i.bodyMode?{"text/plain":{example:i.bodyText}}:"graphql"===i.bodyMode?{"application/json":{example:{query:i.graphqlQuery,variables:lA(i.graphqlVariables||"{}"),operationName:i.graphqlOperation||void 0}}}:"form"===i.bodyMode||"multipart"===i.bodyMode?{["form"===i.bodyMode?"application/x-www-form-urlencoded":"multipart/form-data"]:{schema:{type:"object",properties:Object.fromEntries(i.formRows.filter(e=>e.key).map(e=>[e.key,"file"===e.kind?{type:"string",format:"binary"}:{type:"string",example:e.value}]))}}}:null,c=i.mock?{[String(i.mock.status)]:{description:"Example answer",content:i.mock.body?{"application/json":{example:lA(i.mock.body)}}:void 0}}:{200:{description:"OK"}},p="bearer"===i.authMode?[{bearerAuth:[]}]:"basic"===i.authMode?[{basicAuth:[]}]:"api_key"===i.authMode?[{apiKeyAuth:[]}]:void 0,d=t[a.path]??(t[a.path]={});d[i.method.toLowerCase()]||(d[i.method.toLowerCase()]={summary:s.name,...i.description.trim()?{description:i.description}:{},...o?{tags:[o]}:{},...l.length?{parameters:l}:{},...u?{requestBody:{content:u}}:{},responses:c,...p?{security:p}:{}})}let s=new Map((e.environment?.variables??[]).map(e=>[e.key,e.secret?"":e.value])),i=[...r.keys()].sort((e,t)=>r.get(t)-r.get(e)).map(e=>{let t=/^\{\{\s*([\w.-]+)\s*\}\}$/.exec(e);return t?{url:`{${t[1]}}`,variables:{[t[1]]:{default:s.get(t[1])||"https://api.example.com"}}}:{url:e}});return{openapi:"3.1.0",info:{title:e.title,version:"1.0.0",description:e.description?.trim()||"Exported from APITestCenter."},...i.length?{servers:i}:{},...n.size?{tags:[...n].sort().map(t=>{let r=e.folders?.[e.root?`${e.root}/${t}`:t];return{name:t,...r?.trim()?{description:r}:{}}})}:{},paths:t,components:{securitySchemes:{bearerAuth:{type:"http",scheme:"bearer"},basicAuth:{type:"http",scheme:"basic"},apiKeyAuth:{type:"apiKey",in:"header",name:"X-API-Key"}}}}}(r),null,2)}
644
+ `;case"http":let o=[`# ${r.title} — exported from APITestCenter. Secret values are left empty.`,""];for(let e of lS(r.environment))o.push(`@${e.key} = ${e.value}${e.secret?" # secret: fill in":""}`);for(let e of(r.environment?.variables.length&&o.push(""),r.requests)){let t=lx(e.request),n=l$(e.collection,r.root);for(let r of(o.push(`### ${n?`${n} / `:""}${e.name}`,`${t.method} ${t.url}`),t.headers.filter(o9)))o.push(`${r.key}: ${r.value}`);"bearer"===t.authMode&&o.push(`Authorization: Bearer ${t.token}`),"basic"===t.authMode&&o.push(`Authorization: Basic ${t.username} ${t.password}`),"api_key"===t.authMode&&"header"===t.apiIn&&o.push(`${t.apiName}: ${t.apiValue}`);let s="json"===t.bodyMode||"text"===t.bodyMode?t.bodyText:"graphql"===t.bodyMode?JSON.stringify({query:t.graphqlQuery,variables:lA(t.graphqlVariables||"{}")},null,2):"form"===t.bodyMode?t.formRows.filter(e=>e.key).map(e=>`${encodeURIComponent(e.key)}=${encodeURIComponent(e.value)}`).join("&"):"";"json"!==t.bodyMode&&"graphql"!==t.bodyMode||t.headers.some(e=>/^content-type$/i.test(e.key))||o.push("Content-Type: application/json"),"form"!==t.bodyMode||t.headers.some(e=>/^content-type$/i.test(e.key))||o.push("Content-Type: application/x-www-form-urlencoded"),s&&o.push("",s),"multipart"===t.bodyMode&&o.push("","# A form with files: add the parts by hand (this format writes them differently in each editor)."),o.push("")}return`${o.join("\n").trimEnd()}
645
+ `;case"markdown":return function(e){let t=[`# ${e.title}`,""];e.description?.trim()&&t.push(e.description.trim(),""),t.push(`${e.requests.length} request${1===e.requests.length?"":"s"}, exported from APITestCenter. Secret values are left out.`,"");let r=lS(e.environment);if(r.length){for(let n of(t.push(`## Environment: ${e.environment.name}`,"","| Variable | Value |","| --- | --- |"),r))t.push(`| \`${n.key}\` | ${n.secret?"*secret*":n.value?`\`${n.value}\``:""} |`);t.push("")}let n=new Map;for(let t of e.requests){let r=l$(t.collection,e.root);n.set(r,[...n.get(r)??[],t])}for(let[r,s]of[...n].sort(([e],[t])=>e.localeCompare(t))){r&&t.push(`## ${r}`,"");let n=e.folders?.[[e.root,r].filter(Boolean).join("/")];for(let e of(r&&n?.trim()&&t.push(n.trim(),""),s)){let n=lx(e.request);t.push(`${r?"###":"##"} ${e.name}`,"",`**${n.method}** \`${n.url}\``,""),n.description.trim()&&t.push(n.description.trim(),"");let s=n.headers.filter(o9);s.length&&t.push("| Header | Value |","| --- | --- |",...s.map(e=>`| \`${e.key}\` | \`${e.value||" "}\` |`),""),"none"!==n.authMode&&"inherit"!==n.authMode&&t.push(`Auth: ${n.authMode.replace("_"," ")}`,""),n.before&&t.push(`Runs **${n.before.requestName}** first${n.before.extract.length?`, keeping ${n.before.extract.map(e=>`\`{{${e.name}}}\``).join(", ")}`:""}.`,"");let i="json"===n.bodyMode||"text"===n.bodyMode?n.bodyText:"graphql"===n.bodyMode?n.graphqlQuery:"";i.trim()&&t.push("```"+("json"===n.bodyMode?"json":"graphql"===n.bodyMode?"graphql":""),i,"```",""),n.checks.length&&t.push("Checks:","",...n.checks.map(e=>`- ${aO(e)}`),"")}}return`${t.join("\n").trimEnd()}
646
+ `}(r);case"docs":return function(e){let t=new Set(["top"]),r=t=>e.root?t===e.root?"":t.startsWith(`${e.root}/`)?t.slice(e.root.length+1):t:t,n=new Map;for(let t of e.requests)n.set(r(t.collection),[...n.get(r(t.collection))??[],t]);let s=new Set;for(let e of n.keys()){let t=e?e.split("/"):[];for(let e=0;e<=t.length;e++)s.add(t.slice(0,e).join("/"))}let i=[...s].sort((e,t)=>""===e?-1:""===t?1:e.localeCompare(t)),a=t=>e.folders?.[e.root?t?`${e.root}/${t}`:e.root:t]??"",o=[],l=[];for(let e of i){let r=n.get(e)??[],s=e?e.split("/").length:0,i=e?e.split("/").at(-1):"",u=e?lM(`folder-${e}`,t):"";if(e){o.push(`<li class="folder" style="--depth:${s-1}"><a href="#${u}">${oS(i)}</a></li>`),l.push(`<section class="folder" id="${u}"><h2>${oS(e.split("/").join(" › "))}</h2>`);let t=a(e);t.trim()&&l.push(`<div class="desc">${oT(t,2)}</div>`)}else r.length&&l.push('<section class="folder">');for(let e of r){let r=lM(e.name,t);o.push(`<li class="req" style="--depth:${s}" data-search="${oS(`${e.name} ${e.request.method} ${e.request.url}`.toLowerCase())}"><a href="#${r}"><span class="method m-${e.request.method.toLowerCase()}">${e.request.method}</span>${oS(e.name)}</a></li>`),l.push(function(e,t){let r=lx(e.request),n=[];n.push(`<section class="request" id="${t}" data-search="${oS(`${e.name} ${r.method} ${r.url}`.toLowerCase())}">`),n.push(`<h3><span class="method m-${r.method.toLowerCase()}">${r.method}</span> ${oS(e.name)}</h3>`),n.push(`<p class="url">${lN(r.url||"(no address)")}</p>`),r.description.trim()&&n.push(`<div class="desc">${oT(r.description,3)}</div>`),"inherit"===r.authMode?n.push('<p class="note">Auth: from its folder.</p>'):"none"!==r.authMode&&n.push(`<p class="note">Auth: ${oS(lE[r.authMode]??r.authMode)}.</p>`),r.before&&n.push(`<p class="note">Runs <strong>${oS(r.before.requestName)}</strong> first${r.before.extract.length?`, for ${r.before.extract.map(e=>lN(`{{${e.name}}}`)).join(", ")}`:""}.</p>`);let s=r.params.filter(o9);s.length&&n.push("<h4>Query parameters</h4>",lj(["Name","Value","About"],s.map(e=>[lN(e.key),e.value?lN(e.value):"",oS(e.description??"")])));let i=r.headers.filter(o9);if(i.length&&n.push("<h4>Headers</h4>",lj(["Name","Value","About"],i.map(e=>[lN(e.key),e.value?lN(e.value):"<em>secret</em>",oS(e.description??"")]))),"GET"!==r.method&&"HEAD"!==r.method)if(("json"===r.bodyMode||"text"===r.bodyMode)&&r.bodyText.trim()){let e="json"===r.bodyMode?lq(r.bodyText):{text:r.bodyText,json:!1};n.push("<h4>Body</h4>",lI(e.text,e.json?"json":""))}else if("graphql"===r.bodyMode&&r.graphqlQuery.trim())n.push("<h4>GraphQL query</h4>",lI(r.graphqlQuery,"graphql")),r.graphqlVariables.trim()&&n.push("<h4>Variables</h4>",lI(lq(r.graphqlVariables).text,"json"));else if("form"===r.bodyMode||"multipart"===r.bodyMode){let e=r.formRows.filter(e=>e.key.trim());e.length&&n.push(`<h4>${"form"===r.bodyMode?"Form":"Form with files"}</h4>`,lj(["Field","Value"],e.map(e=>[lN(e.key),e.file?`<em>file</em> ${oS(e.file.name)}`:e.value?lN(e.value):""])))}else"file"===r.bodyMode&&r.bodyFile&&n.push("<h4>Body</h4>",`<p>A file: ${oS(r.bodyFile.name)}</p>`);if(r.mock){let e=lq(r.mock.body);n.push(`<h4>Example answer <span class="status s${String(r.mock.status)[0]}">${r.mock.status}</span></h4>`),r.mock.body.trim()&&n.push(lI(e.text,e.json?"json":""))}r.checks.length&&n.push("<h4>What it checks</h4>",`<ul>${r.checks.map(e=>`<li>${oS(aO(e))}</li>`).join("")}</ul>`);let a=function(e){let t=e.headers.filter(o9).map(e=>[e.key.trim(),e.value]),r=e=>t.some(([t])=>t.toLowerCase()===e.toLowerCase()),n=e.url;"bearer"!==e.authMode||r("authorization")||t.push(["Authorization",`Bearer ${e.token||"<token>"}`]),"basic"!==e.authMode||r("authorization")||t.push(["Authorization","Basic <user name:password, base64>"]),"api_key"===e.authMode&&e.apiName&&("query"===e.apiIn?n+=`${n.includes("?")?"&":"?"}${encodeURIComponent(e.apiName)}=${e.apiValue||"<api key>"}`:r(e.apiName)||t.push([e.apiName,e.apiValue||"<api key>"])),"oauth2"!==e.authMode||r("authorization")||t.push(["Authorization","Bearer <access token>"]);let s={method:e.method,url:n,headers:t,secretHeaders:[],secretQuery:[]};if("GET"===e.method||"HEAD"===e.method)return s;if("json"===e.bodyMode||"text"===e.bodyMode)e.bodyText.trim()&&(s.body=e.bodyText,"json"!==e.bodyMode||r("content-type")||t.push(["Content-Type","application/json"]));else if("graphql"===e.bodyMode){let n;try{n=e.graphqlVariables.trim()?JSON.parse(e.graphqlVariables):void 0}catch{n=void 0}s.body=JSON.stringify({query:e.graphqlQuery,...n?{variables:n}:{},...e.graphqlOperation?{operationName:e.graphqlOperation}:{}}),r("content-type")||t.push(["Content-Type","application/json"])}else"form"===e.bodyMode?(s.body=e.formRows.filter(e=>e.key.trim()).map(e=>`${encodeURIComponent(e.key)}=${encodeURIComponent(e.value)}`).join("&"),r("content-type")||t.push(["Content-Type","application/x-www-form-urlencoded"])):"multipart"===e.bodyMode?s.form=e.formRows.filter(e=>e.key.trim()).map(e=>e.file?{name:e.key,file:e.file.name,...e.file.contentType?{contentType:e.file.contentType}:{}}:{name:e.key,value:e.value}):"file"===e.bodyMode&&e.bodyFile&&(s.file={name:e.bodyFile.name,contentType:e.bodyFileType||e.bodyFile.contentType||"application/octet-stream"});return s}(r);return n.push('<div class="code" role="group" aria-label="Code that sends it">'),lO.forEach((e,t)=>n.push(`<details${0===t?" open":""}><summary>${e.label}</summary>${lI(ou(e.id,a),e.id)}</details>`)),n.push("</div></section>"),n.join("\n")}(e,r))}(e||r.length)&&l.push("</section>")}let u=(e.environment?.variables??[]).filter(e=>e.key.trim()),c=e.description??a(""),p=`${e.requests.length} request${1===e.requests.length?"":"s"}`,d=o$(c)||`${p}: what each one sends, what comes back, and code that sends it.`,h=[`<header id="top"><h1>${oS(e.title)}</h1>`,c.trim()?`<div class="desc">${oA(ox(c),1)}</div>`:`<p class="lead">${oS(d)}</p>`,u.length?`<h2>Variables${e.environment?.name?` <span class="muted">(${oS(e.environment.name)})</span>`:""}</h2><p class="note">Write them as ${lN("{{name}}")}; the requests below use them.</p>${lj(["Name","Value"],u.map(e=>[lN(e.key),e.secret?"<em>secret</em>":e.value?lN(e.value):""]))}`:"","</header>"].join("\n");return`<!doctype html>
647
+ <html lang="en">
648
+ <head>
649
+ <meta charset="utf-8">
650
+ <meta name="viewport" content="width=device-width, initial-scale=1">
651
+ <title>${oS(e.title)} — API docs</title>
652
+ <meta name="description" content="${oS(d)}">
653
+ <meta name="generator" content="APITestCenter">
654
+ <style>${lz}</style>
655
+ </head>
656
+ <body>
657
+ <nav aria-label="Requests">
658
+ <a class="brand" href="#top">${oS(e.title)}</a>
659
+ <input type="search" placeholder="Find a request" aria-label="Find a request" oninput="find(this.value)">
660
+ <ul>${o.join("")}</ul>
661
+ </nav>
662
+ <main>
663
+ ${h}
664
+ ${l.join("\n")}
665
+ <footer>${p}${e.generatedAt?` \xb7 made ${oS(e.generatedAt)}`:""} \xb7 with <a href="https://apitestcenter.com" target="_blank" rel="noreferrer">APITestCenter</a>. Secret values are left out.</footer>
666
+ </main>
667
+ <script>
668
+ function find(q) {
669
+ q = q.trim().toLowerCase();
670
+ for (const el of document.querySelectorAll("[data-search]")) el.hidden = !!q && !el.dataset.search.includes(q);
671
+ }
672
+ </script>
673
+ </body>
674
+ </html>
675
+ `}(r)}}let lO=[{id:"curl",label:"curl"},{id:"javascript",label:"JavaScript"},{id:"python",label:"Python"}],lE={bearer:"Bearer token",basic:"Basic (user name and password)",api_key:"API key",oauth2:"OAuth 2.0",oauth1:"OAuth 1.0",digest:"Digest",ntlm:"NTLM (Windows)",aws_sigv4:"AWS Signature",jwt:"JWT"},lM=(e,t)=>{let r=e.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-|-$/g,"")||"request",n=r;for(let e=2;t.has(n);e++)n=`${r}-${e}`;return t.add(n),n};function lj(e,t){return`<table><thead><tr>${e.map(e=>`<th>${e}</th>`).join("")}</tr></thead><tbody>${t.map(e=>`<tr>${e.map(e=>`<td>${e}</td>`).join("")}</tr>`).join("")}</tbody></table>`}let lN=e=>`<code>${oS(e)}</code>`,lI=(e,t="")=>`<pre><code${t?` data-lang="${t}"`:""}>${oS(e)}</code></pre>`;function lq(e){try{return{text:JSON.stringify(JSON.parse(e),null,2),json:!0}}catch{return{text:e,json:!1}}}let lz=`
676
+ :root{color-scheme:light dark;--bg:#f4f5f2;--panel:#fff;--ink:#16191f;--mute:#5b6270;--line:#dfe2dc;--accent:#3f6212;--code:#eef0ea;
677
+ --get:#15803d;--post:#a16207;--put:#1d4ed8;--patch:#7c3aed;--delete:#b91c1c;--other:#4b5563}
678
+ @media (prefers-color-scheme:dark){:root{--bg:#0d0f12;--panel:#16191f;--ink:#e7e9ed;--mute:#9aa1ad;--line:#2a2f38;--accent:#c8f560;--code:#1d2129;
679
+ --get:#4ade80;--post:#facc15;--put:#60a5fa;--patch:#c084fc;--delete:#f87171;--other:#9ca3af}}
680
+ *{box-sizing:border-box}
681
+ body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.6 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;display:flex;min-height:100vh}
682
+ nav{position:sticky;top:0;height:100vh;overflow-y:auto;width:280px;flex-shrink:0;border-right:1px solid var(--line);padding:16px 12px;background:var(--panel)}
683
+ nav .brand{display:block;font-weight:600;color:var(--ink);text-decoration:none;padding:4px 8px 12px}
684
+ nav input{width:100%;padding:7px 10px;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--ink);font:inherit;font-size:14px;margin-bottom:10px}
685
+ nav ul{list-style:none;margin:0;padding:0}
686
+ nav li a{display:flex;gap:8px;align-items:baseline;padding:4px 8px 4px calc(8px + var(--depth,0) * 14px);border-radius:6px;color:var(--ink);text-decoration:none;font-size:14px}
687
+ nav li a:hover{background:var(--code)}
688
+ nav li.folder a{color:var(--mute);font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;margin-top:10px}
689
+ main{flex:1;min-width:0;max-width:900px;margin:0 auto;padding:32px 40px 64px}
690
+ h1{font-size:30px;line-height:1.2;margin:0 0 12px}
691
+ h2{font-size:22px;margin:40px 0 8px;padding-top:8px;border-top:1px solid var(--line)}
692
+ h3{font-size:18px;margin:0 0 8px;display:flex;gap:10px;align-items:center}
693
+ h4{font-size:13px;text-transform:uppercase;letter-spacing:.04em;color:var(--mute);margin:20px 0 6px}
694
+ .desc h4,.desc h5,.desc h6{text-transform:none;letter-spacing:0;color:var(--ink);font-size:15px}
695
+ .lead,.muted,.note{color:var(--mute)}
696
+ .note{font-size:14px;margin:4px 0}
697
+ section.request{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:20px 22px;margin:18px 0}
698
+ .url code{font-size:14px;word-break:break-all}
699
+ .method{font:600 11px/1 ui-monospace,SFMono-Regular,Consolas,monospace;padding:4px 6px;border-radius:5px;border:1px solid currentColor;flex-shrink:0;color:var(--other)}
700
+ nav .method{border:0;padding:0;min-width:44px;font-size:10px}
701
+ .m-get{color:var(--get)}.m-post{color:var(--post)}.m-put{color:var(--put)}.m-patch{color:var(--patch)}.m-delete{color:var(--delete)}
702
+ .status{font:600 12px ui-monospace,monospace;padding:2px 6px;border-radius:5px;background:var(--code);color:var(--ink);text-transform:none;letter-spacing:0}
703
+ .s2{color:var(--get)}.s4,.s5{color:var(--delete)}
704
+ code{font:13px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;background:var(--code);padding:1px 5px;border-radius:4px}
705
+ pre{background:var(--code);border-radius:8px;padding:12px 14px;overflow-x:auto;margin:6px 0}
706
+ pre code{background:none;padding:0;white-space:pre}
707
+ table{border-collapse:collapse;width:100%;font-size:14px;margin:6px 0}
708
+ th,td{text-align:left;padding:6px 10px;border-bottom:1px solid var(--line);vertical-align:top}
709
+ th{color:var(--mute);font-weight:500}
710
+ blockquote{margin:8px 0;padding:2px 14px;border-left:3px solid var(--accent);color:var(--mute)}
711
+ a{color:var(--accent)}
712
+ .code{margin-top:18px}
713
+ details{border:1px solid var(--line);border-radius:8px;margin:6px 0;padding:0 10px}
714
+ summary{cursor:pointer;padding:6px 0;font-size:14px;color:var(--mute)}
715
+ details[open] summary{color:var(--ink)}
716
+ footer{margin-top:48px;color:var(--mute);font-size:13px}
717
+ [hidden]{display:none!important}
718
+ @media (max-width:800px){body{display:block}nav{position:static;height:auto;width:auto;border-right:0;border-bottom:1px solid var(--line)}main{padding:20px 16px 48px}}
719
+ @media print{nav{display:none}section.request{break-inside:avoid;border:0;padding:0}details{border:0}details:not([open]){display:none}}
720
+ `,lC=Symbol.for("yaml.alias"),lP=Symbol.for("yaml.document"),lR=Symbol.for("yaml.map"),lL=Symbol.for("yaml.pair"),lU=Symbol.for("yaml.scalar"),lF=Symbol.for("yaml.seq"),lD=Symbol.for("yaml.node.type"),lB=e=>!!e&&"object"==typeof e&&e[lD]===lC,lK=e=>!!e&&"object"==typeof e&&e[lD]===lP,lZ=e=>!!e&&"object"==typeof e&&e[lD]===lR,lJ=e=>!!e&&"object"==typeof e&&e[lD]===lL,lH=e=>!!e&&"object"==typeof e&&e[lD]===lU,lV=e=>!!e&&"object"==typeof e&&e[lD]===lF;function lW(e){if(e&&"object"==typeof e)switch(e[lD]){case lR:case lF:return!0}return!1}function lG(e){if(e&&"object"==typeof e)switch(e[lD]){case lC:case lR:case lU:case lF:return!0}return!1}let lX=e=>(lH(e)||lW(e))&&!!e.anchor,lY=Symbol("break visit"),lQ=Symbol("skip children"),l0=Symbol("remove node");function l1(e,t){let r=l6(t);lK(e)?l2(null,e.contents,r,Object.freeze([e]))===l0&&(e.contents=null):l2(null,e,r,Object.freeze([]))}function l2(e,t,r,n){let s=l4(e,t,r,n);if(lG(s)||lJ(s))return l3(e,n,s),l2(e,s,r,n);if("symbol"!=typeof s){if(lW(t)){n=Object.freeze(n.concat(t));for(let e=0;e<t.items.length;++e){let s=l2(e,t.items[e],r,n);if("number"==typeof s)e=s-1;else{if(s===lY)return lY;s===l0&&(t.items.splice(e,1),e-=1)}}}else if(lJ(t)){n=Object.freeze(n.concat(t));let e=l2("key",t.key,r,n);if(e===lY)return lY;e===l0&&(t.key=null);let s=l2("value",t.value,r,n);if(s===lY)return lY;s===l0&&(t.value=null)}}return s}async function l5(e,t){let r=l6(t);lK(e)?await l9(null,e.contents,r,Object.freeze([e]))===l0&&(e.contents=null):await l9(null,e,r,Object.freeze([]))}async function l9(e,t,r,n){let s=await l4(e,t,r,n);if(lG(s)||lJ(s))return l3(e,n,s),l9(e,s,r,n);if("symbol"!=typeof s){if(lW(t)){n=Object.freeze(n.concat(t));for(let e=0;e<t.items.length;++e){let s=await l9(e,t.items[e],r,n);if("number"==typeof s)e=s-1;else{if(s===lY)return lY;s===l0&&(t.items.splice(e,1),e-=1)}}}else if(lJ(t)){n=Object.freeze(n.concat(t));let e=await l9("key",t.key,r,n);if(e===lY)return lY;e===l0&&(t.key=null);let s=await l9("value",t.value,r,n);if(s===lY)return lY;s===l0&&(t.value=null)}}return s}function l6(e){return"object"==typeof e&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function l4(e,t,r,n){return"function"==typeof r?r(e,t,n):lZ(t)?r.Map?.(e,t,n):lV(t)?r.Seq?.(e,t,n):lJ(t)?r.Pair?.(e,t,n):lH(t)?r.Scalar?.(e,t,n):lB(t)?r.Alias?.(e,t,n):void 0}function l3(e,t,r){let n=t[t.length-1];if(lW(n))n.items[e]=r;else if(lJ(n))"key"===e?n.key=r:n.value=r;else if(lK(n))n.contents=r;else{let e=lB(n)?"alias":"scalar";throw Error(`Cannot replace node with ${e} parent`)}}l1.BREAK=lY,l1.SKIP=lQ,l1.REMOVE=l0,l5.BREAK=lY,l5.SKIP=lQ,l5.REMOVE=l0;let l8={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},l7=e=>e.replace(/[!,[\]{}]/g,e=>l8[e]);class ue{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},ue.defaultYaml,e),this.tags=Object.assign({},ue.defaultTags,t)}clone(){let e=new ue(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new ue(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:ue.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},ue.defaultTags)}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:ue.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},ue.defaultTags),this.atNextDocument=!1);let r=e.trim().split(/[ \t]+/),n=r.shift();switch(n){case"%TAG":{if(2!==r.length&&(t(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[e,n]=r;return this.tags[e]=n,!0}case"%YAML":{if(this.yaml.explicit=!0,1!==r.length)return t(0,"%YAML directive should contain exactly one part"),!1;let[e]=r;if("1.1"===e||"1.2"===e)return this.yaml.version=e,!0;{let r=/^\d+\.\d+$/.test(e);return t(6,`Unsupported YAML version ${e}`,r),!1}}default:return t(0,`Unknown directive ${n}`,!0),!1}}tagName(e,t){if("!"===e)return"!";if("!"!==e[0])return t(`Not a valid tag: ${e}`),null;if("<"===e[1]){let r=e.slice(2,-1);return"!"===r||"!!"===r?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(">"!==e[e.length-1]&&t("Verbatim tags must end with a >"),r)}let[,r,n]=e.match(/^(.*!)([^!]*)$/s);n||t(`The ${e} tag has no suffix`);let s=this.tags[r];if(s)try{return s+decodeURIComponent(n)}catch(e){return t(String(e)),null}return"!"===r?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,r]of Object.entries(this.tags))if(e.startsWith(r))return t+l7(e.substring(r.length));return"!"===e[0]?e:`!<${e}>`}toString(e){let t,r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);if(e&&n.length>0&&lG(e.contents)){let r={};l1(e.contents,(e,t)=>{lG(t)&&t.tag&&(r[t.tag]=!0)}),t=Object.keys(r)}else t=[];for(let[s,i]of n)("!!"!==s||"tag:yaml.org,2002:"!==i)&&(!e||t.some(e=>e.startsWith(i)))&&r.push(`%TAG ${s} ${i}`);return r.join("\n")}}function ut(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=JSON.stringify(e);throw Error(`Anchor must not contain whitespace or control characters: ${t}`)}return!0}function ur(e){let t=new Set;return l1(e,{Value(e,r){r.anchor&&t.add(r.anchor)}}),t}function un(e,t){for(let r=1;;++r){let n=`${e}${r}`;if(!t.has(n))return n}}function us(e,t,r,n){if(n&&"object"==typeof n)if(Array.isArray(n))for(let t=0,r=n.length;t<r;++t){let r=n[t],s=us(e,n,String(t),r);void 0===s?delete n[t]:s!==r&&(n[t]=s)}else if(n instanceof Map)for(let t of Array.from(n.keys())){let r=n.get(t),s=us(e,n,t,r);void 0===s?n.delete(t):s!==r&&n.set(t,s)}else if(n instanceof Set)for(let t of Array.from(n)){let r=us(e,n,t,t);void 0===r?n.delete(t):r!==t&&(n.delete(t),n.add(r))}else for(let[t,r]of Object.entries(n)){let s=us(e,n,t,r);void 0===s?delete n[t]:s!==r&&(n[t]=s)}return e.call(t,r,n)}function ui(e,t,r){if(Array.isArray(e))return e.map((e,t)=>ui(e,String(t),r));if(e&&"function"==typeof e.toJSON){if(!r||!lX(e))return e.toJSON(t,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(e,n),r.onCreate=e=>{n.res=e,delete r.onCreate};let s=e.toJSON(t,r);return r.onCreate&&r.onCreate(s),s}return"bigint"!=typeof e||r?.keep?e:Number(e)}ue.defaultYaml={explicit:!1,version:"1.2"},ue.defaultTags={"!!":"tag:yaml.org,2002:"};class ua{constructor(e){Object.defineProperty(this,lD,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:r,onAnchor:n,reviver:s}={}){if(!lK(e))throw TypeError("A document argument is required");let i={anchors:new Map,doc:e,keep:!0,mapAsMap:!0===t,mapKeyWarned:!1,maxAliasCount:"number"==typeof r?r:100},a=ui(this,"",i);if("function"==typeof n)for(let{count:e,res:t}of i.anchors.values())n(t,e);return"function"==typeof s?us(s,{"":a},"",a):a}}class uo extends ua{constructor(e){super(lC),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(e,t){let r,n;if(t?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");for(let s of(t?.aliasResolveCache?r=t.aliasResolveCache:(r=[],l1(e,{Node:(e,t)=>{(lB(t)||lX(t))&&r.push(t)}}),t&&(t.aliasResolveCache=r)),r)){if(s===this)break;s.anchor===this.source&&(n=s)}if(n&&t){let{anchors:e,doc:r,maxAliasCount:s}=t,i=e.get(n);if(i||(ui(n,null,t),i=e.get(n)),i?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(s>=0&&(i.count+=1,0===i.aliasCount&&(i.aliasCount=function e(t,r,n){if(lB(r)){let e=r.resolve(t),s=n&&e&&n.get(e);return s?s.count*s.aliasCount:0}if(lW(r)){let s=0;for(let i of r.items){let r=e(t,i,n);r>s&&(s=r)}return s}return lJ(r)?Math.max(e(t,r.key,n),e(t,r.value,n)):1}(r,n,e)),i.count*i.aliasCount>s))throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return n}toJSON(e,t){if(!t)return{source:this.source};let r=this.resolve(t.doc,t);if(!r)throw ReferenceError(`Unresolved alias (the anchor must be set before the alias): ${this.source}`);return t.anchors.get(r).res}toString(e,t,r){let n=`*${this.source}`;if(e){if(ut(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source))throw Error(`Unresolved alias (the anchor must be set before the alias): ${this.source}`);if(e.implicitKey)return`${n} `}return n}}let ul=e=>!e||"function"!=typeof e&&"object"!=typeof e;class uu extends ua{constructor(e){super(lU),this.value=e}toJSON(e,t){return t?.keep?this.value:ui(this.value,e,t)}toString(){return String(this.value)}}function uc(e,t,r){let n;if(lK(e)&&(e=e.contents),lG(e))return e;if(lJ(e)){let t=r.schema[lR].createNode?.(r.schema,null,r);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||"u">typeof BigInt&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:s,onAnchor:i,onTagObj:a,schema:o,sourceObjects:l}=r;if(s&&e&&"object"==typeof e){if(n=l.get(e))return n.anchor??(n.anchor=i(e)),new uo(n.anchor);n={anchor:null,node:null},l.set(e,n)}t?.startsWith("!!")&&(t="tag:yaml.org,2002:"+t.slice(2));let u=function(e,t,r){if(t){let e=r.filter(e=>e.tag===t),n=e.find(e=>!e.format)??e[0];if(!n)throw Error(`Tag ${t} not found`);return n}return r.find(t=>t.identify?.(e)&&!t.format)}(e,t,o.tags);if(!u){if(e&&"function"==typeof e.toJSON&&(e=e.toJSON()),!e||"object"!=typeof e){let t=new uu(e);return n&&(n.node=t),t}u=e instanceof Map?o[lR]:Symbol.iterator in Object(e)?o[lF]:o[lR]}a&&(a(u),delete r.onTagObj);let c=u?.createNode?u.createNode(r.schema,e,r):"function"==typeof u?.nodeClass?.from?u.nodeClass.from(r.schema,e,r):new uu(e);return t?c.tag=t:u.default||(c.tag=u.tag),n&&(n.node=c),c}function up(e,t,r){let n=r;for(let e=t.length-1;e>=0;--e){let r=t[e];if("number"==typeof r&&Number.isInteger(r)&&r>=0){let e=[];e[r]=n,n=e}else n=new Map([[r,n]])}return uc(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}uu.BLOCK_FOLDED="BLOCK_FOLDED",uu.BLOCK_LITERAL="BLOCK_LITERAL",uu.PLAIN="PLAIN",uu.QUOTE_DOUBLE="QUOTE_DOUBLE",uu.QUOTE_SINGLE="QUOTE_SINGLE";let ud=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;class uh extends ua{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>lG(t)||lJ(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(ud(e))this.add(t);else{let[r,...n]=e,s=this.get(r,!0);if(lW(s))s.addIn(n,t);else if(void 0===s&&this.schema)this.set(r,up(this.schema,n,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}}deleteIn(e){let[t,...r]=e;if(0===r.length)return this.delete(t);let n=this.get(t,!0);if(lW(n))return n.deleteIn(r);throw Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...n]=e,s=this.get(r,!0);return 0===n.length?!t&&lH(s)?s.value:s:lW(s)?s.getIn(n,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!lJ(t))return!1;let r=t.value;return null==r||e&&lH(r)&&null==r.value&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[t,...r]=e;if(0===r.length)return this.has(t);let n=this.get(t,!0);return!!lW(n)&&n.hasIn(r)}setIn(e,t){let[r,...n]=e;if(0===n.length)this.set(r,t);else{let e=this.get(r,!0);if(lW(e))e.setIn(n,t);else if(void 0===e&&this.schema)this.set(r,up(this.schema,n,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}}}let uf=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function um(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}let uy=(e,t,r)=>e.endsWith("\n")?um(r,t):r.includes("\n")?"\n"+um(r,t):(e.endsWith(" ")?"":" ")+r,ug="flow",ub="block",uv="quoted";function uw(e,t,r="flow",{indentAtStart:n,lineWidth:s=80,minContentWidth:i=20,onFold:a,onOverflow:o}={}){let l,u,c;if(!s||s<0)return e;s<i&&(i=0);let p=Math.max(1+i,1+s-t.length);if(e.length<=p)return e;let d=[],h={},f=s-t.length;"number"==typeof n&&(n>s-Math.max(2,i)?d.push(0):f=s-n);let m=!1,y=-1,g=-1,b=-1;for(r===ub&&-1!==(y=uk(e,y,t.length))&&(f=y+p);c=e[y+=1];){if(r===uv&&"\\"===c){switch(g=y,e[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}b=y}if("\n"===c)r===ub&&(y=uk(e,y,t.length)),f=y+t.length+p,l=void 0;else{if(" "===c&&u&&" "!==u&&"\n"!==u&&" "!==u){let t=e[y+1];t&&" "!==t&&"\n"!==t&&" "!==t&&(l=y)}if(y>=f)if(l)d.push(l),f=l+p,l=void 0;else if(r===uv){for(;" "===u||" "===u;)u=c,c=e[y+=1],m=!0;let t=y>b+1?y-2:g-1;if(h[t])return e;d.push(t),h[t]=!0,f=t+p,l=void 0}else m=!0}u=c}if(m&&o&&o(),0===d.length)return e;a&&a();let v=e.slice(0,d[0]);for(let n=0;n<d.length;++n){let s=d[n],i=d[n+1]||e.length;0===s?v=`
721
+ ${t}${e.slice(0,i)}`:(r===uv&&h[s]&&(v+=`${e[s]}\\`),v+=`
722
+ ${t}${e.slice(s+1,i)}`)}return v}function uk(e,t,r){let n=t,s=t+1,i=e[s];for(;" "===i||" "===i;)if(t<s+r)i=e[++t];else{do i=e[++t];while(i&&"\n"!==i)n=t,i=e[s=t+1]}return n}let ux=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth});function u$(e,t){let r=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=t,s=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(/^(%|---|\.\.\.)/m.test(e)?" ":""),a="",o=0;for(let e=0,t=r[e];t;t=r[++e])if(" "===t&&"\\"===r[e+1]&&"n"===r[e+2]&&(a+=r.slice(o,e)+"\\ ",e+=1,o=e,t="\\"),"\\"===t)switch(r[e+1]){case"u":{a+=r.slice(o,e);let t=r.substr(e+2,4);switch(t){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:"00"===t.substr(0,2)?a+="\\x"+t.substr(2):a+=r.substr(e,6)}e+=5,o=e+1}break;case"n":if(n||'"'===r[e+2]||r.length<s)e+=1;else{for(a+=r.slice(o,e)+"\n\n";"\\"===r[e+2]&&"n"===r[e+3]&&'"'!==r[e+4];)a+="\n",e+=2;a+=i," "===r[e+2]&&(a+="\\"),e+=1,o=e+1}break;default:e+=1}return a=o?a+r.slice(o):r,n?a:uw(a,i,uv,ux(t,!1))}function uS(e,t){if(!1===t.options.singleQuote||t.implicitKey&&e.includes("\n")||/[ \t]\n|\n[ \t]/.test(e))return u$(e,t);let r=t.indent||(/^(%|---|\.\.\.)/m.test(e)?" ":""),n="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
723
+ ${r}`)+"'";return t.implicitKey?n:uw(n,r,ug,ux(t,!1))}function u_(e,t){let r,{singleQuote:n}=t.options;if(!1===n)r=u$;else{let t=e.includes('"'),s=e.includes("'");r=t&&!s?uS:s&&!t?u$:n?uS:u$}return r(e,t)}try{n=RegExp("(^|(?<!\n))\n+(?!\n|$)","g")}catch{n=/\n+(?!\n|$)/g}function uA({comment:e,type:t,value:r},s,i,a){let o,l,u,c,{blockQuote:p,commentString:d,lineWidth:h}=s.options;if(!p||/\n[\t ]+$/.test(r))return u_(r,s);let f=s.indent||(s.forceBlockIndent||(c=r,/^(%|---|\.\.\.)/m.test(c))?" ":""),m="literal"===p||"folded"!==p&&t!==uu.BLOCK_FOLDED&&(t===uu.BLOCK_LITERAL||!function(e,t,r){if(!t||t<0)return!1;let n=t-r,s=e.length;if(s<=n)return!1;for(let t=0,r=0;t<s;++t)if("\n"===e[t]){if(t-r>n)return!0;if(s-(r=t+1)<=n)return!1}return!0}(r,h,f.length));if(!r)return m?"|\n":">\n";for(l=r.length;l>0;--l){let e=r[l-1];if("\n"!==e&&" "!==e&&" "!==e)break}let y=r.substring(l),g=y.indexOf("\n");-1===g?o="-":r===y||g!==y.length-1?(o="+",a&&a()):o="",y&&(r=r.slice(0,-y.length),"\n"===y[y.length-1]&&(y=y.slice(0,-1)),y=y.replace(n,`$&${f}`));let b=!1,v=-1;for(u=0;u<r.length;++u){let e=r[u];if(" "===e)b=!0;else if("\n"===e)v=u;else break}let w=r.substring(0,v<u?v+1:u);w&&(r=r.substring(w.length),w=w.replace(/\n+/g,`$&${f}`));let k=f?"2":"1",x=(b?k:"")+o;if(e&&(x+=" "+d(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!m){let e=r.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${f}`),n=!1,i=ux(s,!0);"folded"!==p&&t!==uu.BLOCK_FOLDED&&(i.onOverflow=()=>{n=!0});let a=uw(`${w}${e}${y}`,f,ub,i);if(!n)return`>${x}
724
+ ${f}${a}`}return r=r.replace(/\n+/g,`$&${f}`),`|${x}
725
+ ${f}${w}${r}${y}`}function uT(e,t,r,n){let{implicitKey:s,inFlow:i}=t,a="string"==typeof e.value?e:Object.assign({},e,{value:String(e.value)}),{type:o}=e;o!==uu.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(o=uu.QUOTE_DOUBLE);let l=e=>{switch(e){case uu.BLOCK_FOLDED:case uu.BLOCK_LITERAL:return s||i?u_(a.value,t):uA(a,t,r,n);case uu.QUOTE_DOUBLE:return u$(a.value,t);case uu.QUOTE_SINGLE:return uS(a.value,t);case uu.PLAIN:return function(e,t,r,n){let{type:s,value:i}=e,{actualString:a,implicitKey:o,indent:l,indentStep:u,inFlow:c}=t;if(o&&i.includes("\n")||c&&/[[\]{},]/.test(i))return u_(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return o||c||!i.includes("\n")?u_(i,t):uA(e,t,r,n);if(!o&&!c&&s!==uu.PLAIN&&i.includes("\n"))return uA(e,t,r,n);if(/^(%|---|\.\.\.)/m.test(i)){if(""===l)return t.forceBlockIndent=!0,uA(e,t,r,n);else if(o&&l===u)return u_(i,t)}let p=i.replace(/\n+/g,`$&
726
+ ${l}`);if(a){let e=e=>e.default&&"tag:yaml.org,2002:str"!==e.tag&&e.test?.test(p),{compat:r,tags:n}=t.doc.schema;if(n.some(e)||r?.some(e))return u_(i,t)}return o?p:uw(p,l,ug,ux(t,!1))}(a,t,r,n);default:return null}},u=l(o);if(null===u){let{defaultKeyType:e,defaultStringType:r}=t.options,n=s&&e||r;if(null===(u=l(n)))throw Error(`Unsupported default string type ${n}`)}return u}function uO(e,t){let r,n=Object.assign({blockQuote:!0,commentString:uf,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:"number"==typeof n.indent?" ".repeat(n.indent):" ",inFlow:r,options:n}}function uE(e,t,r,n){let s;if(lJ(e))return e.toString(t,r,n);if(lB(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i=lG(e)?e:t.doc.createNode(e,{onTagObj:e=>s=e});s??(s=function(e,t){let r,n;if(t.tag){let r=e.filter(e=>e.tag===t.tag);if(r.length>0)return r.find(e=>e.format===t.format)??r[0]}if(lH(t)){r=t.value;let s=e.filter(e=>e.identify?.(r));if(s.length>1){let e=s.filter(e=>e.test);e.length>0&&(s=e)}n=s.find(e=>e.format===t.format)??s.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(null===r?"null":typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}(t.doc.schema.tags,i));let a=function(e,t,{anchors:r,doc:n}){if(!n.directives)return"";let s=[],i=(lH(e)||lW(e))&&e.anchor;i&&ut(i)&&(r.add(i),s.push(`&${i}`));let a=e.tag??(t.default?null:t.tag);return a&&s.push(n.directives.tagString(a)),s.join(" ")}(i,s,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);let o="function"==typeof s.stringify?s.stringify(i,t,r,n):lH(i)?uT(i,t,r,n):i.toString(t,r,n);return a?lH(i)||"{"===o[0]||"["===o[0]?`${a} ${o}`:`${a}
727
+ ${t.indent}${o}`:o}function uM(e,t){("debug"===e||"warn"===e)&&console.warn(t)}let uj={identify:e=>"<<"===e||"symbol"==typeof e&&"<<"===e.description,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new uu(Symbol("<<")),{addToJSMap:uN}),stringify:()=>"<<"};function uN(e,t,r){let n=uq(e,r);if(lV(n))for(let r of n.items)uI(e,t,r);else if(Array.isArray(n))for(let r of n)uI(e,t,r);else uI(e,t,n)}function uI(e,t,r){let n=uq(e,r);if(!lZ(n))throw Error("Merge sources must be maps or map aliases");for(let[r,s]of n.toJSON(null,e,Map))t instanceof Map?t.has(r)||t.set(r,s):t instanceof Set?t.add(r):Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{value:s,writable:!0,enumerable:!0,configurable:!0});return t}function uq(e,t){return e&&lB(t)?t.resolve(e.doc,e):t}function uz(e,t,{key:r,value:n}){if(lG(r)&&r.addToJSMap)r.addToJSMap(e,t,n);else if((uj.identify(r)||lH(r)&&(!r.type||r.type===uu.PLAIN)&&uj.identify(r.value))&&e?.doc.schema.tags.some(e=>e.tag===uj.tag&&e.default))uN(e,t,n);else{let s=ui(r,"",e);if(t instanceof Map)t.set(s,ui(n,s,e));else if(t instanceof Set)t.add(s);else{let i=function(e,t,r){if(null===t)return"";if("object"!=typeof t)return String(t);if(lG(e)&&r?.doc){let t=uO(r.doc,{});for(let e of(t.anchors=new Set,r.anchors.keys()))t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let n=e.toString(t);if(!r.mapKeyWarned){let e=JSON.stringify(n);e.length>40&&(e=e.substring(0,36)+'..."'),uM(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return n}return JSON.stringify(t)}(r,s,e),a=ui(n,i,e);i in t?Object.defineProperty(t,i,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[i]=a}}return t}function uC(e,t,r){return new uP(uc(e,void 0,r),uc(t,void 0,r))}class uP{constructor(e,t=null){Object.defineProperty(this,lD,{value:lL}),this.key=e,this.value=t}clone(e){let{key:t,value:r}=this;return lG(t)&&(t=t.clone(e)),lG(r)&&(r=r.clone(e)),new uP(t,r)}toJSON(e,t){let r=t?.mapAsMap?new Map:{};return uz(t,r,this)}toString(e,t,r){return e?.doc?function({key:e,value:t},r,n,s){let i,a,o,{allNullValues:l,doc:u,indent:c,indentStep:p,options:{commentString:d,indentSeq:h,simpleKeys:f}}=r,m=lG(e)&&e.comment||null;if(f){if(m)throw Error("With simple keys, key nodes cannot have comments");if(lW(e)||!lG(e)&&"object"==typeof e)throw Error("With simple keys, collection cannot be used as a key value")}let y=!f&&(!e||m&&null==t&&!r.inFlow||lW(e)||(lH(e)?e.type===uu.BLOCK_FOLDED||e.type===uu.BLOCK_LITERAL:"object"==typeof e));r=Object.assign({},r,{allNullValues:!1,implicitKey:!y&&(f||!l),indent:c+p});let g=!1,b=!1,v=uE(e,r,()=>g=!0,()=>b=!0);if(!y&&!r.inFlow&&v.length>1024){if(f)throw Error("With simple keys, single line scalar must not span more than 1024 characters");y=!0}if(r.inFlow){if(l||null==t)return g&&n&&n(),""===v?"?":y?`? ${v}`:v}else if(l&&!f||null==t&&y)return v=`? ${v}`,m&&!g?v+=uy(v,r.indent,d(m)):b&&s&&s(),v;g&&(m=null),y?(m&&(v+=uy(v,r.indent,d(m))),v=`? ${v}
728
+ ${c}:`):(v=`${v}:`,m&&(v+=uy(v,r.indent,d(m)))),lG(t)?(i=!!t.spaceBefore,a=t.commentBefore,o=t.comment):(i=!1,a=null,o=null,t&&"object"==typeof t&&(t=u.createNode(t))),r.implicitKey=!1,!y&&!m&&lH(t)&&(r.indentAtStart=v.length+1),b=!1,!(!h&&p.length>=2&&!r.inFlow&&!y&&lV(t))||t.flow||t.tag||t.anchor||(r.indent=r.indent.substring(2));let w=!1,k=uE(t,r,()=>w=!0,()=>b=!0),x=" ";if(m||i||a){if(x=i?"\n":"",a){let e=d(a);x+=`
729
+ ${um(e,r.indent)}`}""!==k||r.inFlow?x+=`
730
+ ${r.indent}`:"\n"===x&&o&&(x="\n\n")}else if(!y&&lW(t)){let e=k[0],n=k.indexOf("\n"),s=-1!==n,i=r.inFlow??t.flow??0===t.items.length;if(s||!i){let t=!1;if(s&&("&"===e||"!"===e)){let r=k.indexOf(" ");"&"===e&&-1!==r&&r<n&&"!"===k[r+1]&&(r=k.indexOf(" ",r+1)),(-1===r||n<r)&&(t=!0)}t||(x=`
731
+ ${r.indent}`)}}else(""===k||"\n"===k[0])&&(x="");return v+=x+k,r.inFlow?w&&n&&n():o&&!w?v+=uy(v,r.indent,d(o)):b&&s&&s(),v}(this,e,t,r):JSON.stringify(this)}}function uR(e,t,r){return(t.inFlow??e.flow?function({items:e},t,{flowChars:r,itemIndent:n}){let{indent:s,indentStep:i,flowCollectionPadding:a,options:{commentString:o}}=t,l=Object.assign({},t,{indent:n+=i,inFlow:!0,type:null}),u=!1,c=0,p=[];for(let r=0;r<e.length;++r){let s=e[r],i=null;if(lG(s))s.spaceBefore&&p.push(""),uL(t,p,s.commentBefore,!1),s.comment&&(i=s.comment);else if(lJ(s)){let e=lG(s.key)?s.key:null;e&&(e.spaceBefore&&p.push(""),uL(t,p,e.commentBefore,!1),e.comment&&(u=!0));let r=lG(s.value)?s.value:null;r?(r.comment&&(i=r.comment),r.commentBefore&&(u=!0)):null==s.value&&e?.comment&&(i=e.comment)}i&&(u=!0);let a=uE(s,l,()=>i=null);u||(u=p.length>c||a.includes("\n")),r<e.length-1?a+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(u||(u=p.reduce((e,t)=>e+t.length+2,2)+(a.length+2)>t.options.lineWidth)),u&&(a+=",")),i&&(a+=uy(a,n,o(i))),p.push(a),c=p.length}let{start:d,end:h}=r;if(0===p.length)return d+h;if(!u){let e=p.reduce((e,t)=>e+t.length+2,2);u=t.options.lineWidth>0&&e>t.options.lineWidth}if(!u)return`${d}${a}${p.join(" ")}${a}${h}`;{let e=d;for(let t of p)e+=t?`
732
+ ${i}${s}${t}`:"\n";return`${e}
733
+ ${s}${h}`}}:function({comment:e,items:t},r,{blockItemPrefix:n,flowChars:s,itemIndent:i,onChompKeep:a,onComment:o}){let l,{indent:u,options:{commentString:c}}=r,p=Object.assign({},r,{indent:i,type:null}),d=!1,h=[];for(let e=0;e<t.length;++e){let s=t[e],a=null;if(lG(s))!d&&s.spaceBefore&&h.push(""),uL(r,h,s.commentBefore,d),s.comment&&(a=s.comment);else if(lJ(s)){let e=lG(s.key)?s.key:null;e&&(!d&&e.spaceBefore&&h.push(""),uL(r,h,e.commentBefore,d))}d=!1;let o=uE(s,p,()=>a=null,()=>d=!0);a&&(o+=uy(o,i,c(a))),d&&a&&(d=!1),h.push(n+o)}if(0===h.length)l=s.start+s.end;else{l=h[0];for(let e=1;e<h.length;++e){let t=h[e];l+=t?`
734
+ ${u}${t}`:"\n"}}return e?(l+="\n"+um(c(e),u),o&&o()):d&&a&&a(),l})(e,t,r)}function uL({indent:e,options:{commentString:t}},r,n,s){if(n&&s&&(n=n.replace(/^\n+/,"")),n){let s=um(t(n),e);r.push(s.trimStart())}}function uU(e,t){let r=lH(t)?t.value:t;for(let n of e)if(lJ(n)&&(n.key===t||n.key===r||lH(n.key)&&n.key.value===r))return n}class uF extends uh{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(lR,e),this.items=[]}static from(e,t,r){let{keepUndefined:n,replacer:s}=r,i=new this(e),a=(e,a)=>{if("function"==typeof s)a=s.call(t,e,a);else if(Array.isArray(s)&&!s.includes(e))return;(void 0!==a||n)&&i.items.push(uC(e,a,r))};if(t instanceof Map)for(let[e,r]of t)a(e,r);else if(t&&"object"==typeof t)for(let e of Object.keys(t))a(e,t[e]);return"function"==typeof e.sortMapEntries&&i.items.sort(e.sortMapEntries),i}add(e,t){let r;r=lJ(e)?e:e&&"object"==typeof e&&"key"in e?new uP(e.key,e.value):new uP(e,e?.value);let n=uU(this.items,r.key),s=this.schema?.sortMapEntries;if(n){if(!t)throw Error(`Key ${r.key} already set`);lH(n.value)&&ul(r.value)?n.value.value=r.value:n.value=r.value}else if(s){let e=this.items.findIndex(e=>0>s(r,e));-1===e?this.items.push(r):this.items.splice(e,0,r)}else this.items.push(r)}delete(e){let t=uU(this.items,e);return!!t&&this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){let r=uU(this.items,e),n=r?.value;return(!t&&lH(n)?n.value:n)??void 0}has(e){return!!uU(this.items,e)}set(e,t){this.add(new uP(e,t),!0)}toJSON(e,t,r){let n=r?new r:t?.mapAsMap?new Map:{};for(let e of(t?.onCreate&&t.onCreate(n),this.items))uz(t,n,e);return n}toString(e,t,r){if(!e)return JSON.stringify(this);for(let e of this.items)if(!lJ(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),uR(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:t})}}let uD={collection:"map",default:!0,nodeClass:uF,tag:"tag:yaml.org,2002:map",resolve:(e,t)=>(lZ(e)||t("Expected a mapping for this tag"),e),createNode:(e,t,r)=>uF.from(e,t,r)};class uB extends uh{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(lF,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=uK(e);return"number"==typeof t&&this.items.splice(t,1).length>0}get(e,t){let r=uK(e);if("number"!=typeof r)return;let n=this.items[r];return!t&&lH(n)?n.value:n}has(e){let t=uK(e);return"number"==typeof t&&t<this.items.length}set(e,t){let r=uK(e);if("number"!=typeof r)throw Error(`Expected a valid index, not ${e}.`);let n=this.items[r];lH(n)&&ul(t)?n.value=t:this.items[r]=t}toJSON(e,t){let r=[];t?.onCreate&&t.onCreate(r);let n=0;for(let e of this.items)r.push(ui(e,String(n++),t));return r}toString(e,t,r){return e?uR(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:t}):JSON.stringify(this)}static from(e,t,r){let{replacer:n}=r,s=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let i of t){if("function"==typeof n){let r=t instanceof Set?i:String(e++);i=n.call(t,r,i)}s.items.push(uc(i,void 0,r))}}return s}}function uK(e){let t=lH(e)?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),"number"==typeof t&&Number.isInteger(t)&&t>=0?t:null}let uZ={collection:"seq",default:!0,nodeClass:uB,tag:"tag:yaml.org,2002:seq",resolve:(e,t)=>(lV(e)||t("Expected a sequence for this tag"),e),createNode:(e,t,r)=>uB.from(e,t,r)},uJ={identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(e,t,r,n)=>uT(e,t=Object.assign({actualString:!0},t),r,n)},uH={identify:e=>null==e,createNode:()=>new uu(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new uu(null),stringify:({source:e},t)=>"string"==typeof e&&uH.test.test(e)?e:t.options.nullStr},uV={identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new uu("t"===e[0]||"T"===e[0]),stringify:({source:e,value:t},r)=>e&&uV.test.test(e)&&t===("t"===e[0]||"T"===e[0])?e:t?r.options.trueStr:r.options.falseStr};function uW({format:e,minFractionDigits:t,tag:r,value:n}){if("bigint"==typeof n)return String(n);let s="number"==typeof n?n:Number(n);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=Object.is(n,-0)?"-0":JSON.stringify(n);if(!e&&t&&(!r||"tag:yaml.org,2002:float"===r)&&/^-?\d/.test(i)&&!i.includes("e")){let e=i.indexOf(".");e<0&&(e=i.length,i+=".");let r=t-(i.length-e-1);for(;r-- >0;)i+="0"}return i}let uG={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?0/0:"-"===e[0]?-1/0:1/0,stringify:uW},uX={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():uW(e)}},uY={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new uu(parseFloat(e)),r=e.indexOf(".");return -1!==r&&"0"===e[e.length-1]&&(t.minFractionDigits=e.length-r-1),t},stringify:uW},uQ=e=>"bigint"==typeof e||Number.isInteger(e),u0=(e,t,r,{intAsBigInt:n})=>n?BigInt(e):parseInt(e.substring(t),r);function u1(e,t,r){let{value:n}=e;return uQ(n)&&n>=0?r+n.toString(t):uW(e)}let u2={identify:e=>uQ(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,r)=>u0(e,2,8,r),stringify:e=>u1(e,8,"0o")},u5={identify:uQ,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,r)=>u0(e,0,10,r),stringify:uW},u9={identify:e=>uQ(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,r)=>u0(e,2,16,r),stringify:e=>u1(e,16,"0x")},u6=[uD,uZ,uJ,uH,uV,u2,u5,u9,uG,uX,uY];function u4(e){return"bigint"==typeof e||Number.isInteger(e)}let u3=({value:e})=>JSON.stringify(e),u8=[uD,uZ].concat([{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:u3},{identify:e=>null==e,createNode:()=>new uu(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:u3},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>"true"===e,stringify:u3},{identify:u4,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:r})=>r?BigInt(e):parseInt(e,10),stringify:({value:e})=>u4(e)?e.toString():JSON.stringify(e)},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:u3}],{default:!0,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)}),u7={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if("function"!=typeof atob)return t("This environment does not support reading binary tags; either Buffer or atob is required"),e;{let t=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(t.length);for(let e=0;e<t.length;++e)r[e]=t.charCodeAt(e);return r}},stringify({comment:e,type:t,value:r},n,s,i){let a;if(!r)return"";if("function"==typeof btoa){let e="";for(let t=0;t<r.length;++t)e+=String.fromCharCode(r[t]);a=btoa(e)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=uu.BLOCK_LITERAL),t!==uu.QUOTE_DOUBLE){let e=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),r=Math.ceil(a.length/e),s=Array(r);for(let t=0,n=0;t<r;++t,n+=e)s[t]=a.substr(n,e);a=s.join(t===uu.BLOCK_LITERAL?"\n":" ")}return uT({comment:e,type:t,value:a},n,s,i)}};function ce(e,t){if(lV(e))for(let r=0;r<e.items.length;++r){let n=e.items[r];if(!lJ(n)){if(lZ(n)){n.items.length>1&&t("Each pair must have its own sequence indicator");let e=n.items[0]||new uP(new uu(null));if(n.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${n.commentBefore}
735
+ ${e.key.commentBefore}`:n.commentBefore),n.comment){let t=e.value??e.key;t.comment=t.comment?`${n.comment}
736
+ ${t.comment}`:n.comment}n=e}e.items[r]=lJ(n)?n:new uP(n)}}else t("Expected a sequence for this tag");return e}function ct(e,t,r){let{replacer:n}=r,s=new uB(e);s.tag="tag:yaml.org,2002:pairs";let i=0;if(t&&Symbol.iterator in Object(t))for(let e of t){let a,o;if("function"==typeof n&&(e=n.call(t,String(i++),e)),Array.isArray(e))if(2===e.length)a=e[0],o=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`);else if(e&&e instanceof Object){let t=Object.keys(e);if(1===t.length)o=e[a=t[0]];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else a=e;s.items.push(uC(a,o,r))}return s}let cr={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:ce,createNode:ct};class cn extends uB{constructor(){super(),this.add=uF.prototype.add.bind(this),this.delete=uF.prototype.delete.bind(this),this.get=uF.prototype.get.bind(this),this.has=uF.prototype.has.bind(this),this.set=uF.prototype.set.bind(this),this.tag=cn.tag}toJSON(e,t){if(!t)return super.toJSON(e);let r=new Map;for(let e of(t?.onCreate&&t.onCreate(r),this.items)){let n,s;if(lJ(e)?(n=ui(e.key,"",t),s=ui(e.value,n,t)):n=ui(e,"",t),r.has(n))throw Error("Ordered maps must not include duplicate keys");r.set(n,s)}return r}static from(e,t,r){let n=ct(e,t,r),s=new this;return s.items=n.items,s}}cn.tag="tag:yaml.org,2002:omap";let cs={collection:"seq",identify:e=>e instanceof Map,nodeClass:cn,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let r=ce(e,t),n=[];for(let{key:e}of r.items)lH(e)&&(n.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):n.push(e.value));return Object.assign(new cn,r)},createNode:(e,t,r)=>cn.from(e,t,r)};function ci({value:e,source:t},r){return t&&(e?ca:co).test.test(t)?t:e?r.options.trueStr:r.options.falseStr}let ca={identify:e=>!0===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new uu(!0),stringify:ci},co={identify:e=>!1===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new uu(!1),stringify:ci},cl=e=>"bigint"==typeof e||Number.isInteger(e);function cu(e,t,r,{intAsBigInt:n}){let s=e[0];if(("-"===s||"+"===s)&&(t+=1),e=e.substring(t).replace(/_/g,""),n){switch(r){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return"-"===s?BigInt(-1)*t:t}let i=parseInt(e,r);return"-"===s?-1*i:i}function cc(e,t,r){let{value:n}=e;if(cl(n)){let e=n.toString(t);return n<0?"-"+r+e.substr(1):r+e}return uW(e)}class cp extends uF{constructor(e){super(e),this.tag=cp.tag}add(e){let t;t=lJ(e)?e:e&&"object"==typeof e&&"key"in e&&"value"in e&&null===e.value?new uP(e.key,null):new uP(e,null),uU(this.items,t.key)||this.items.push(t)}get(e,t){let r=uU(this.items,e);return!t&&lJ(r)?lH(r.key)?r.key.value:r.key:r}set(e,t){if("boolean"!=typeof t)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let r=uU(this.items,e);r&&!t?this.items.splice(this.items.indexOf(r),1):!r&&t&&this.items.push(new uP(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,r);throw Error("Set items must all have null values")}static from(e,t,r){let{replacer:n}=r,s=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)"function"==typeof n&&(e=n.call(t,e,e)),s.items.push(uC(e,null,r));return s}}cp.tag="tag:yaml.org,2002:set";let cd={collection:"map",identify:e=>e instanceof Set,nodeClass:cp,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,r)=>cp.from(e,t,r),resolve(e,t){if(lZ(e))if(e.hasAllNullValues(!0))return Object.assign(new cp,e);else t("Set items must all have null values");else t("Expected a mapping for this tag");return e}};function ch(e,t){let r=e[0],n="-"===r||"+"===r?e.substring(1):e,s=e=>t?BigInt(e):Number(e),i=n.replace(/_/g,"").split(":").reduce((e,t)=>e*s(60)+s(t),s(0));return"-"===r?s(-1)*i:i}function cf(e){let{value:t}=e,r=e=>e;if("bigint"==typeof t)r=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return uW(e);let n="";t<0&&(n="-",t*=r(-1));let s=r(60),i=[t%s];return t<60?i.unshift(0):(t=(t-i[0])/s,i.unshift(t%s),t>=60&&(t=(t-i[0])/s,i.unshift(t))),n+i.map(e=>String(e).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}let cm={identify:e=>"bigint"==typeof e||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:r})=>ch(e,r),stringify:cf},cy={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>ch(e,!1),stringify:cf},cg={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(cg.test);if(!t)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,s,i,a,o]=t.map(Number),l=Date.UTC(r,n-1,s,i||0,a||0,o||0,t[7]?Number((t[7]+"00").substr(1,3)):0),u=t[8];if(u&&"Z"!==u){let e=ch(u,!1);30>Math.abs(e)&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},cb=[uD,uZ,uJ,uH,ca,co,{identify:cl,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,r)=>cu(e,2,2,r),stringify:e=>cc(e,2,"0b")},{identify:cl,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,r)=>cu(e,1,8,r),stringify:e=>cc(e,8,"0")},{identify:cl,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,r)=>cu(e,0,10,r),stringify:uW},{identify:cl,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,r)=>cu(e,2,16,r),stringify:e=>cc(e,16,"0x")},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?0/0:"-"===e[0]?-1/0:1/0,stringify:uW},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():uW(e)}},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new uu(parseFloat(e.replace(/_/g,""))),r=e.indexOf(".");if(-1!==r){let n=e.substring(r+1).replace(/_/g,"");"0"===n[n.length-1]&&(t.minFractionDigits=n.length)}return t},stringify:uW},u7,uj,cs,cr,cd,cm,cy,cg],cv=new Map([["core",u6],["failsafe",[uD,uZ,uJ]],["json",u8],["yaml11",cb],["yaml-1.1",cb]]),cw={binary:u7,bool:uV,float:uY,floatExp:uX,floatNaN:uG,floatTime:cy,int:u5,intHex:u9,intOct:u2,intTime:cm,map:uD,merge:uj,null:uH,omap:cs,pairs:cr,seq:uZ,set:cd,timestamp:cg},ck={"tag:yaml.org,2002:binary":u7,"tag:yaml.org,2002:merge":uj,"tag:yaml.org,2002:omap":cs,"tag:yaml.org,2002:pairs":cr,"tag:yaml.org,2002:set":cd,"tag:yaml.org,2002:timestamp":cg};function cx(e,t,r){let n=cv.get(t);if(n&&!e)return r&&!n.includes(uj)?n.concat(uj):n.slice();let s=n;if(!s)if(Array.isArray(e))s=[];else{let e=Array.from(cv.keys()).filter(e=>"yaml11"!==e).map(e=>JSON.stringify(e)).join(", ");throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}if(Array.isArray(e))for(let t of e)s=s.concat(t);else"function"==typeof e&&(s=e(s.slice()));return r&&(s=s.concat(uj)),s.reduce((e,t)=>{let r="string"==typeof t?cw[t]:t;if(!r){let e=JSON.stringify(t),r=Object.keys(cw).map(e=>JSON.stringify(e)).join(", ");throw Error(`Unknown custom tag ${e}; use one of ${r}`)}return e.includes(r)||e.push(r),e},[])}let c$=(e,t)=>e.key<t.key?-1:+(e.key>t.key);class cS{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:n,schema:s,sortMapEntries:i,toStringDefaults:a}){this.compat=Array.isArray(e)?cx(e,"compat"):e?cx(null,e):null,this.name="string"==typeof s&&s||"core",this.knownTags=n?ck:{},this.tags=cx(t,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,lR,{value:uD}),Object.defineProperty(this,lU,{value:uJ}),Object.defineProperty(this,lF,{value:uZ}),this.sortMapEntries="function"==typeof i?i:!0===i?c$:null}clone(){let e=Object.create(cS.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}class c_{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,lD,{value:lP});let n=null;"function"==typeof t||Array.isArray(t)?n=t:void 0===r&&t&&(r=t,t=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=s;let{version:i}=s;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(i=this.directives.yaml.version)):this.directives=new ue({version:i}),this.setSchema(i,r),this.contents=void 0===e?null:this.createNode(e,n,r)}clone(){let e=Object.create(c_.prototype,{[lD]:{value:lP}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=lG(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){cA(this.contents)&&this.contents.add(e)}addIn(e,t){cA(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let r=ur(this);e.anchor=!t||r.has(t)?un(t||"a",r):t}return new uo(e.anchor)}createNode(e,t,r){var n,s;let i,a,o,l;if("function"==typeof t)e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){let e=t.filter(e=>"number"==typeof e||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),i=t}else void 0===r&&t&&(r=t,t=void 0);let{aliasDuplicateObjects:u,anchorPrefix:c,flow:p,keepUndefined:d,onTagObj:h,tag:f}=r??{},{onAnchor:m,setAnchors:y,sourceObjects:g}=(n=this,s=c||"a",a=[],o=new Map,l=null,{onAnchor:e=>{a.push(e),l??(l=ur(n));let t=un(s,l);return l.add(t),t},setAnchors:()=>{for(let e of a){let t=o.get(e);if("object"==typeof t&&t.anchor&&(lH(t.node)||lW(t.node)))t.node.anchor=t.anchor;else{let t=Error("Failed to resolve repeated object (this should not happen)");throw t.source=e,t}}},sourceObjects:o}),b={aliasDuplicateObjects:u??!0,keepUndefined:d??!1,onAnchor:m,onTagObj:h,replacer:i,schema:this.schema,sourceObjects:g},v=uc(e,f,b);return p&&lW(v)&&(v.flow=!0),y(),v}createPair(e,t,r={}){return new uP(this.createNode(e,null,r),this.createNode(t,null,r))}delete(e){return!!cA(this.contents)&&this.contents.delete(e)}deleteIn(e){return ud(e)?null!=this.contents&&(this.contents=null,!0):!!cA(this.contents)&&this.contents.deleteIn(e)}get(e,t){return lW(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return ud(e)?!t&&lH(this.contents)?this.contents.value:this.contents:lW(this.contents)?this.contents.getIn(e,t):void 0}has(e){return!!lW(this.contents)&&this.contents.has(e)}hasIn(e){return ud(e)?void 0!==this.contents:!!lW(this.contents)&&this.contents.hasIn(e)}set(e,t){null==this.contents?this.contents=up(this.schema,[e],t):cA(this.contents)&&this.contents.set(e,t)}setIn(e,t){ud(e)?this.contents=t:null==this.contents?this.contents=up(this.schema,Array.from(e),t):cA(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){let r;switch("number"==typeof e&&(e=String(e)),e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ue({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new ue({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(r)this.schema=new cS(Object.assign(r,t));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:r,maxAliasCount:n,onAnchor:s,reviver:i}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:!0===r,mapKeyWarned:!1,maxAliasCount:"number"==typeof n?n:100},o=ui(this.contents,t??"",a);if("function"==typeof s)for(let{count:e,res:t}of a.anchors.values())s(t,e);return"function"==typeof i?us(i,{"":o},"",o):o}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||0>=Number(e.indent))){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return function(e,t){let r=[],n=!0===t.directives;if(!1!==t.directives&&e.directives){let t=e.directives.toString(e);t?(r.push(t),n=!0):e.directives.docStart&&(n=!0)}n&&r.push("---");let s=uO(e,t),{commentString:i}=s.options;if(e.commentBefore){1!==r.length&&r.unshift("");let t=i(e.commentBefore);r.unshift(um(t,""))}let a=!1,o=null;if(e.contents){if(lG(e.contents)){if(e.contents.spaceBefore&&n&&r.push(""),e.contents.commentBefore){let t=i(e.contents.commentBefore);r.push(um(t,""))}s.forceBlockIndent=!!e.comment,o=e.contents.comment}let t=o?void 0:()=>a=!0,l=uE(e.contents,s,()=>o=null,t);o&&(l+=uy(l,"",i(o))),("|"===l[0]||">"===l[0])&&"---"===r[r.length-1]?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(uE(e.contents,s));if(e.directives?.docEnd)if(e.comment){let t=i(e.comment);t.includes("\n")?(r.push("..."),r.push(um(t,""))):r.push(`... ${t}`)}else r.push("...");else{let t=e.comment;t&&a&&(t=t.replace(/^\n+/,"")),t&&((!a||o)&&""!==r[r.length-1]&&r.push(""),r.push(um(i(t),"")))}return r.join("\n")+"\n"}(this,e)}}function cA(e){if(lW(e))return!0;throw Error("Expected a YAML collection as document contents")}class cT extends Error{constructor(e,t,r,n){super(),this.name=e,this.code=r,this.message=n,this.pos=t}}class cO extends cT{constructor(e,t,r){super("YAMLParseError",e,t,r)}}class cE extends cT{constructor(e,t,r){super("YAMLWarning",e,t,r)}}let cM=(e,t)=>r=>{if(-1===r.pos[0])return;r.linePos=r.pos.map(e=>t.linePos(e));let{line:n,col:s}=r.linePos[0];r.message+=` at line ${n}, column ${s}`;let i=s-1,a=e.substring(t.lineStarts[n-1],t.lineStarts[n]).replace(/[\n\r]+$/,"");if(i>=60&&a.length>80){let e=Math.min(i-39,a.length-79);a="…"+a.substring(e),i-=e-1}if(a.length>80&&(a=a.substring(0,79)+"…"),n>1&&/^ *$/.test(a.substring(0,i))){let r=e.substring(t.lineStarts[n-2],t.lineStarts[n-1]);r.length>80&&(r=r.substring(0,79)+"…\n"),a=r+a}if(/[^ ]/.test(a)){let e=1,t=r.linePos[1];t?.line===n&&t.col>s&&(e=Math.max(1,Math.min(t.col-s,80-i)));let o=" ".repeat(i)+"^".repeat(e);r.message+=`:
737
+
738
+ ${a}
739
+ ${o}
740
+ `}};function cj(e,{flow:t,indicator:r,next:n,offset:s,onError:i,parentIndent:a,startOnNewline:o}){let l=!1,u=o,c=o,p="",d="",h=!1,f=!1,m=null,y=null,g=null,b=null,v=null,w=null,k=null;for(let s of e)switch(f&&("space"!==s.type&&"newline"!==s.type&&"comma"!==s.type&&i(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),f=!1),m&&(u&&"comment"!==s.type&&"newline"!==s.type&&i(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),s.type){case"space":!t&&("doc-start"!==r||n?.type!=="flow-collection")&&s.source.includes(" ")&&(m=s),c=!0;break;case"comment":{c||i(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let e=s.source.substring(1)||" ";p?p+=d+e:p=e,d="",u=!1;break}case"newline":u?p?p+=s.source:w&&"seq-item-ind"===r||(l=!0):d+=s.source,u=!0,h=!0,(y||g)&&(b=s),c=!0;break;case"anchor":y&&i(s,"MULTIPLE_ANCHORS","A node can have at most one anchor"),s.source.endsWith(":")&&i(s.offset+s.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),y=s,k??(k=s.offset),u=!1,c=!1,f=!0;break;case"tag":g&&i(s,"MULTIPLE_TAGS","A node can have at most one tag"),g=s,k??(k=s.offset),u=!1,c=!1,f=!0;break;case r:(y||g)&&i(s,"BAD_PROP_ORDER",`Anchors and tags must be after the ${s.source} indicator`),w&&i(s,"UNEXPECTED_TOKEN",`Unexpected ${s.source} in ${t??"collection"}`),w=s,u="seq-item-ind"===r||"explicit-key-ind"===r,c=!1;break;case"comma":if(t){v&&i(s,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),v=s,u=!1,c=!1;break}default:i(s,"UNEXPECTED_TOKEN",`Unexpected ${s.type} token`),u=!1,c=!1}let x=e[e.length-1],$=x?x.offset+x.source.length:s;return f&&n&&"space"!==n.type&&"newline"!==n.type&&"comma"!==n.type&&("scalar"!==n.type||""!==n.source)&&i(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(u&&m.indent<=a||n?.type==="block-map"||n?.type==="block-seq")&&i(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:v,found:w,spaceBefore:l,comment:p,hasNewline:h,anchor:y,tag:g,newlineAfterProp:b,end:$,start:k??$}}function cN(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes("\n"))return!0;if(e.end){for(let t of e.end)if("newline"===t.type)return!0}return!1;case"flow-collection":for(let t of e.items){for(let e of t.start)if("newline"===e.type)return!0;if(t.sep){for(let e of t.sep)if("newline"===e.type)return!0}if(cN(t.key)||cN(t.value))return!0}return!1;default:return!0}}function cI(e,t,r){if(t?.type==="flow-collection"){let n=t.end[0];n.indent===e&&("]"===n.source||"}"===n.source)&&cN(t)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function cq(e,t,r){let{uniqueKeys:n}=e.options;if(!1===n)return!1;let s="function"==typeof n?n:(e,t)=>e===t||lH(e)&&lH(t)&&e.value===t.value;return t.some(e=>s(e.key,r))}let cz="All mapping items must start at the same column";function cC(e,t,r,n){let s="";if(e){let i=!1,a="";for(let o of e){let{source:e,type:l}=o;switch(l){case"space":i=!0;break;case"comment":{r&&!i&&n(o,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let t=e.substring(1)||" ";s?s+=a+t:s=t,a="";break}case"newline":s&&(a+=e),i=!0;break;default:n(o,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=e.length}}return{comment:s,offset:t}}let cP="Block collections are not allowed within flow collections",cR=e=>e&&("block-map"===e.type||"block-seq"===e.type);function cL(e,t,r,n,s,i){let a="block-map"===r.type?function({composeNode:e,composeEmptyNode:t},r,n,s,i){let a=new(i?.nodeClass??uF)(r.schema);r.atRoot&&(r.atRoot=!1);let o=n.offset,l=null;for(let i of n.items){let{start:u,key:c,sep:p,value:d}=i,h=cj(u,{indicator:"explicit-key-ind",next:c??p?.[0],offset:o,onError:s,parentIndent:n.indent,startOnNewline:!0}),f=!h.found;if(f){if(c&&("block-seq"===c.type?s(o,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in c&&c.indent!==n.indent&&s(o,"BAD_INDENT",cz)),!h.anchor&&!h.tag&&!p){l=h.end,h.comment&&(a.comment?a.comment+="\n"+h.comment:a.comment=h.comment);continue}(h.newlineAfterProp||cN(c))&&s(c??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==n.indent&&s(o,"BAD_INDENT",cz);r.atKey=!0;let m=h.end,y=c?e(r,c,h,s):t(r,m,u,null,h,s);r.schema.compat&&cI(n.indent,c,s),r.atKey=!1,cq(r,a.items,y)&&s(m,"DUPLICATE_KEY","Map keys must be unique");let g=cj(p??[],{indicator:"map-value-ind",next:d,offset:y.range[2],onError:s,parentIndent:n.indent,startOnNewline:!c||"block-scalar"===c.type});if(o=g.end,g.found){f&&(d?.type!=="block-map"||g.hasNewline||s(o,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&h.start<g.found.offset-1024&&s(y.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let l=d?e(r,d,g,s):t(r,o,p,null,g,s);r.schema.compat&&cI(n.indent,d,s),o=l.range[2];let u=new uP(y,l);r.options.keepSourceTokens&&(u.srcToken=i),a.items.push(u)}else{f&&s(y.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),g.comment&&(y.comment?y.comment+="\n"+g.comment:y.comment=g.comment);let e=new uP(y);r.options.keepSourceTokens&&(e.srcToken=i),a.items.push(e)}}return l&&l<o&&s(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,o,l??o],a}(e,t,r,n,i):"block-seq"===r.type?function({composeNode:e,composeEmptyNode:t},r,n,s,i){let a=new(i?.nodeClass??uB)(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let o=n.offset,l=null;for(let{start:i,value:u}of n.items){let c=cj(i,{indicator:"seq-item-ind",next:u,offset:o,onError:s,parentIndent:n.indent,startOnNewline:!0});if(!c.found)if(c.anchor||c.tag||u)u?.type==="block-seq"?s(c.end,"BAD_INDENT","All sequence items must start at the same column"):s(o,"MISSING_CHAR","Sequence item without - indicator");else{l=c.end,c.comment&&(a.comment=c.comment);continue}let p=u?e(r,u,c,s):t(r,c.end,i,null,c,s);r.schema.compat&&cI(n.indent,u,s),o=p.range[2],a.items.push(p)}return a.range=[n.offset,o,l??o],a}(e,t,r,n,i):function({composeNode:e,composeEmptyNode:t},r,n,s,i){let a="{"===n.start.source,o=a?"flow map":"flow sequence",l=new(i?.nodeClass??(a?uF:uB))(r.schema);l.flow=!0;let u=r.atRoot;u&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset+n.start.source.length;for(let i=0;i<n.items.length;++i){let u=n.items[i],{start:p,key:d,sep:h,value:f}=u,m=cj(p,{flow:o,indicator:"explicit-key-ind",next:d??h?.[0],offset:c,onError:s,parentIndent:n.indent,startOnNewline:!1});if(!m.found){if(!m.anchor&&!m.tag&&!h&&!f){0===i&&m.comma?s(m.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`):i<n.items.length-1&&s(m.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${o}`),m.comment&&(l.comment?l.comment+="\n"+m.comment:l.comment=m.comment),c=m.end;continue}!a&&r.options.strict&&cN(d)&&s(d,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(0===i)m.comma&&s(m.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`);else if(m.comma||s(m.start,"MISSING_CHAR",`Missing , between ${o} items`),m.comment){let e="";e:for(let t of p)switch(t.type){case"comma":case"space":break;case"comment":e=t.source.substring(1);break e;default:break e}if(e){let t=l.items[l.items.length-1];lJ(t)&&(t=t.value??t.key),t.comment?t.comment+="\n"+e:t.comment=e,m.comment=m.comment.substring(e.length+1)}}if(a||h||m.found){r.atKey=!0;let i=m.end,y=d?e(r,d,m,s):t(r,i,p,null,m,s);cR(d)&&s(y.range,"BLOCK_IN_FLOW",cP),r.atKey=!1;let g=cj(h??[],{flow:o,indicator:"map-value-ind",next:f,offset:y.range[2],onError:s,parentIndent:n.indent,startOnNewline:!1});if(g.found){if(!a&&!m.found&&r.options.strict){if(h)for(let e of h){if(e===g.found)break;if("newline"===e.type){s(e,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}m.start<g.found.offset-1024&&s(g.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else f&&("source"in f&&f.source?.[0]===":"?s(f,"MISSING_CHAR",`Missing space after : in ${o}`):s(g.start,"MISSING_CHAR",`Missing , or : between ${o} items`));let b=f?e(r,f,g,s):g.found?t(r,g.end,h,null,g,s):null;b?cR(f)&&s(b.range,"BLOCK_IN_FLOW",cP):g.comment&&(y.comment?y.comment+="\n"+g.comment:y.comment=g.comment);let v=new uP(y,b);if(r.options.keepSourceTokens&&(v.srcToken=u),a)cq(r,l.items,y)&&s(i,"DUPLICATE_KEY","Map keys must be unique"),l.items.push(v);else{let e=new uF(r.schema);e.flow=!0,e.items.push(v);let t=(b??y).range;e.range=[y.range[0],t[1],t[2]],l.items.push(e)}c=b?b.range[2]:g.end}else{let n=f?e(r,f,m,s):t(r,m.end,h,null,m,s);l.items.push(n),c=n.range[2],cR(f)&&s(n.range,"BLOCK_IN_FLOW",cP)}}let p=a?"}":"]",[d,...h]=n.end,f=c;if(d?.source===p)f=d.offset+d.source.length;else{let e=o[0].toUpperCase()+o.substring(1),t=u?`${e} must end with a ${p}`:`${e} in block collection must be sufficiently indented and end with a ${p}`;s(c,u?"MISSING_CHAR":"BAD_INDENT",t),d&&1!==d.source.length&&h.unshift(d)}if(h.length>0){let e=cC(h,f,r.options.strict,s);e.comment&&(l.comment?l.comment+="\n"+e.comment:l.comment=e.comment),l.range=[n.offset,f,e.offset]}else l.range=[n.offset,f,f];return l}(e,t,r,n,i),o=a.constructor;return"!"===s||s===o.tagName?a.tag=o.tagName:s&&(a.tag=s),a}function cU(e,t,r){let n=t.offset,s=function({offset:e,props:t},r,n){if("block-scalar-header"!==t[0].type)return n(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:s}=t[0],i=s[0],a=0,o="",l=-1;for(let t=1;t<s.length;++t){let r=s[t];if(o||"-"!==r&&"+"!==r){let n=Number(r);!a&&n?a=n:-1===l&&(l=e+t)}else o=r}-1!==l&&n(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let u=!1,c="",p=s.length;for(let e=1;e<t.length;++e){let s=t[e];switch(s.type){case"space":u=!0;case"newline":p+=s.source.length;break;case"comment":r&&!u&&n(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),p+=s.source.length,c=s.source.substring(1);break;case"error":n(s,"UNEXPECTED_TOKEN",s.message),p+=s.source.length;break;default:{let e=`Unexpected token in block scalar header: ${s.type}`;n(s,"UNEXPECTED_TOKEN",e);let t=s.source;t&&"string"==typeof t&&(p+=t.length)}}}return{mode:i,indent:a,chomp:o,comment:c,length:p}}(t,e.options.strict,r);if(!s)return{value:"",type:null,comment:"",range:[n,n,n]};let i=">"===s.mode?uu.BLOCK_FOLDED:uu.BLOCK_LITERAL,a=t.source?function(e){let t=e.split(/\n( *)/),r=t[0],n=r.match(/^( *)/),s=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let e=1;e<t.length;e+=2)s.push([t[e],t[e+1]]);return s}(t.source):[],o=a.length;for(let e=a.length-1;e>=0;--e){let t=a[e][1];if(""===t||"\r"===t)o=e;else break}if(0===o){let e="+"===s.chomp&&a.length>0?"\n".repeat(Math.max(1,a.length-1)):"",r=n+s.length;return t.source&&(r+=t.source.length),{value:e,type:i,comment:s.comment,range:[n,r,r]}}let l=t.indent+s.indent,u=t.offset+s.length,c=0;for(let t=0;t<o;++t){let[n,i]=a[t];if(""===i||"\r"===i)0===s.indent&&n.length>l&&(l=n.length);else{n.length<l&&r(u+n.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),0===s.indent&&(l=n.length),c=t,0!==l||e.atRoot||r(u,"BAD_INDENT","Block scalar values in collections must be indented");break}u+=n.length+i.length+1}for(let e=a.length-1;e>=o;--e)a[e][0].length>l&&(o=e+1);let p="",d="",h=!1;for(let e=0;e<c;++e)p+=a[e][0].slice(l)+"\n";for(let e=c;e<o;++e){let[t,n]=a[e];u+=t.length+n.length+1;let o="\r"===n[n.length-1];if(o&&(n=n.slice(0,-1)),n&&t.length<l){let e=s.indent?"explicit indentation indicator":"first line",i=`Block scalar lines must not be less indented than their ${e}`;r(u-n.length-(o?2:1),"BAD_INDENT",i),t=""}i===uu.BLOCK_LITERAL?(p+=d+t.slice(l)+n,d="\n"):t.length>l||" "===n[0]?(" "===d?d="\n":h||"\n"!==d||(d="\n\n"),p+=d+t.slice(l)+n,d="\n",h=!0):""===n?"\n"===d?p+="\n":d="\n":(p+=d+n,d=" ",h=!1)}switch(s.chomp){case"-":break;case"+":for(let e=o;e<a.length;++e)p+="\n"+a[e][0].slice(l);"\n"!==p[p.length-1]&&(p+="\n");break;default:p+="\n"}let f=n+s.length+t.source.length;return{value:p,type:i,comment:s.comment,range:[n,f,f]}}function cF(e,t,r){let n,s,{offset:i,type:a,source:o,end:l}=e,u=(e,t,n)=>r(i+e,t,n);switch(a){case"scalar":n=uu.PLAIN,s=function(e,t){let r="";switch(e[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":r=`block scalar indicator ${e[0]}`;break;case"@":case"`":r=`reserved character ${e[0]}`}return r&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),cD(e)}(o,u);break;case"single-quoted-scalar":var c,p;n=uu.QUOTE_SINGLE,c=o,p=u,("'"!==c[c.length-1]||1===c.length)&&p(c.length,"MISSING_CHAR","Missing closing 'quote"),s=cD(c.slice(1,-1)).replace(/''/g,"'");break;case"double-quoted-scalar":n=uu.QUOTE_DOUBLE,s=function(e,t){let r="";for(let n=1;n<e.length-1;++n){let s=e[n];if("\r"!==s||"\n"!==e[n+1])if("\n"===s){let{fold:t,offset:s}=function(e,t){let r="",n=e[t+1];for(;(" "===n||" "===n||"\n"===n||"\r"===n)&&("\r"!==n||"\n"===e[t+2]);)"\n"===n&&(r+="\n"),t+=1,n=e[t+1];return r||(r=" "),{fold:r,offset:t}}(e,n);r+=t,n=s}else if("\\"===s){let s=e[++n],i=cB[s];if(i)r+=i;else if("\n"===s)for(s=e[n+1];" "===s||" "===s;)s=e[++n+1];else if("\r"===s&&"\n"===e[n+1])for(s=e[++n+1];" "===s||" "===s;)s=e[++n+1];else if("x"===s||"u"===s||"U"===s){let i="x"===s?2:"u"===s?4:8;r+=function(e,t,r,n){let s=e.substr(t,r),i=s.length===r&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):0/0;try{return String.fromCodePoint(i)}catch{let s=e.substr(t-2,r+2);return n(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),s}}(e,n+1,i,t),n+=i}else{let s=e.substr(n-1,2);t(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),r+=s}}else if(" "===s||" "===s){let t=n,i=e[n+1];for(;" "===i||" "===i;)i=e[++n+1];"\n"!==i&&("\r"!==i||"\n"!==e[n+2])&&(r+=n>t?e.slice(t,n+1):s)}else r+=s}return('"'!==e[e.length-1]||1===e.length)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),r}(o,u);break;default:return r(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${a}`),{value:"",type:null,comment:"",range:[i,i+o.length,i+o.length]}}let d=i+o.length,h=cC(l,d,t,r);return{value:s,type:n,comment:h.comment,range:[i,d,h.offset]}}function cD(e){let t,r,n=/(.*?)\r?\n/sy,s=n.exec(e);if(!s)return e;try{t=RegExp("(?<![ ])[ ]+$"),r=RegExp("^[ ]+|(?<![ ])[ ]+$","g")}catch{t=/[ \t]+$/,r=/^[ \t]+|[ \t]+$/g}let i=s[1].replace(t,""),a=" ",o=n.lastIndex;for(;s=n.exec(e);){let e=s[1].replace(r,"");""===e?"\n"===a?i+=a:a="\n":(i+=a+e,a=" "),o=n.lastIndex}let l=/[ \t]*(.*)/sy;return l.lastIndex=o,s=l.exec(e),i+a+(s?.[1]??"")}let cB={0:"\0",a:"\x07",b:"\b",e:"\x1b",f:"\f",n:"\n",r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function cK(e,t,r,n){let s,i,{value:a,type:o,comment:l,range:u}="block-scalar"===t.type?cU(e,t,n):cF(t,e.options.strict,n),c=r?e.directives.tagName(r.source,e=>n(r,"TAG_RESOLVE_FAILED",e)):null;s=e.options.stringKeys&&e.atKey?e.schema[lU]:c?function(e,t,r,n,s){if("!"===r)return e[lU];let i=[];for(let t of e.tags)if(!t.collection&&t.tag===r)if(!t.default||!t.test)return t;else i.push(t);for(let e of i)if(e.test?.test(t))return e;let a=e.knownTags[r];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(s(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,"tag:yaml.org,2002:str"!==r),e[lU])}(e.schema,a,c,r,n):"scalar"===t.type?function({atKey:e,directives:t,schema:r},n,s,i){let a=r.tags.find(t=>(!0===t.default||e&&"key"===t.default)&&t.test?.test(n))||r[lU];if(r.compat){let e=r.compat.find(e=>e.default&&e.test?.test(n))??r[lU];if(a.tag!==e.tag){let r=t.tagString(a.tag),n=t.tagString(e.tag);i(s,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${r} or ${n}`,!0)}}return a}(e,a,t,n):e.schema[lU];try{let o=s.resolve(a,e=>n(r??t,"TAG_RESOLVE_FAILED",e),e.options);i=lH(o)?o:new uu(o)}catch(e){n(r??t,"TAG_RESOLVE_FAILED",e instanceof Error?e.message:String(e)),i=new uu(a)}return i.range=u,i.source=a,o&&(i.type=o),c&&(i.tag=c),s.format&&(i.format=s.format),l&&(i.comment=l),i}let cZ={composeNode:cJ,composeEmptyNode:cH};function cJ(e,t,r,n){let s,i=e.atKey,{spaceBefore:a,comment:o,anchor:l,tag:u}=r,c=!0;switch(t.type){case"alias":s=function({options:e},{offset:t,source:r,end:n},s){let i=new uo(r.substring(1));""===i.source&&s(t,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&s(t+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let a=t+r.length,o=cC(n,a,e.strict,s);return i.range=[t,a,o.offset],o.comment&&(i.comment=o.comment),i}(e,t,n),(l||u)&&n(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":s=cK(e,t,u,n),l&&(s.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{s=function(e,t,r,n,s){let i=n.tag,a=i?t.directives.tagName(i.source,e=>s(i,"TAG_RESOLVE_FAILED",e)):null;if("block-seq"===r.type){let{anchor:e,newlineAfterProp:t}=n,r=e&&i?e.offset>i.offset?e:i:e??i;r&&(!t||t.offset<r.offset)&&s(r,"MISSING_CHAR","Missing newline after block sequence props")}let o="block-map"===r.type?"map":"block-seq"===r.type?"seq":"{"===r.start.source?"map":"seq";if(!i||!a||"!"===a||a===uF.tagName&&"map"===o||a===uB.tagName&&"seq"===o)return cL(e,t,r,s,a);let l=t.schema.tags.find(e=>e.tag===a&&e.collection===o);if(!l){let n=t.schema.knownTags[a];if(n?.collection!==o)return n?s(i,"BAD_COLLECTION_TYPE",`${n.tag} used for ${o} collection, but expects ${n.collection??"scalar"}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),cL(e,t,r,s,a);t.schema.tags.push(Object.assign({},n,{default:!1})),l=n}let u=cL(e,t,r,s,a,l),c=l.resolve?.(u,e=>s(i,"TAG_RESOLVE_FAILED",e),t.options)??u,p=lG(c)?c:new uu(c);return p.range=u.range,p.tag=a,l?.format&&(p.format=l.format),p}(cZ,e,t,r,n),l&&(s.anchor=l.source.substring(1))}catch(e){n(t,"RESOURCE_EXHAUSTION",e instanceof Error?e.message:String(e))}break;default:{let e="error"===t.type?t.message:`Unsupported token (type: ${t.type})`;n(t,"UNEXPECTED_TOKEN",e),c=!1}}return s??(s=cH(e,t.offset,void 0,null,r,n)),l&&""===s.anchor&&n(l,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!lH(s)||"string"!=typeof s.value||s.tag&&"tag:yaml.org,2002:str"!==s.tag)&&n(u??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),a&&(s.spaceBefore=!0),o&&("scalar"===t.type&&""===t.source?s.comment=o:s.commentBefore=o),e.options.keepSourceTokens&&c&&(s.srcToken=t),s}function cH(e,t,r,n,{spaceBefore:s,comment:i,anchor:a,tag:o,end:l},u){let c=cK(e,{type:"scalar",offset:function(e,t,r){if(t){r??(r=t.length);for(let n=r-1;n>=0;--n){let r=t[n];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++n];r?.type==="space";)e+=r.source.length,r=t[++n];break}}return e}(t,r,n),indent:-1,source:""},o,u);return a&&(c.anchor=a.source.substring(1),""===c.anchor&&u(a,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(c.spaceBefore=!0),i&&(c.comment=i,c.range[2]=l),c}function cV(e){if("number"==typeof e)return[e,e+1];if(Array.isArray(e))return 2===e.length?e:[e[0],e[1]];let{offset:t,source:r}=e;return[t,t+("string"==typeof r?r.length:1)]}function cW(e){let t="",r=!1,n=!1;for(let s=0;s<e.length;++s){let i=e[s];switch(i[0]){case"#":t+=(""===t?"":n?"\n\n":"\n")+(i.substring(1)||" "),r=!0,n=!1;break;case"%":e[s+1]?.[0]!=="#"&&(s+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:t,afterEmptyLine:n}}class cG{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,r,n)=>{let s=cV(e);n?this.warnings.push(new cE(s,t,r)):this.errors.push(new cO(s,t,r))},this.directives=new ue({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:r,afterEmptyLine:n}=cW(this.prelude);if(r){let s=e.contents;if(t)e.comment=e.comment?`${e.comment}
741
+ ${r}`:r;else if(n||e.directives.docStart||!s)e.commentBefore=r;else if(lW(s)&&!s.flow&&s.items.length>0){let e=s.items[0];lJ(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${r}
742
+ ${t}`:r}else{let e=s.commentBefore;s.commentBefore=e?`${r}
743
+ ${e}`:r}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:cW(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,r=-1){for(let t of e)yield*this.next(t);yield*this.end(t,r)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,r,n)=>{let s=cV(e);s[0]+=t,this.onError(s,"BAD_DIRECTIVE",r,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=function(e,t,{offset:r,start:n,value:s,end:i},a){let o=new c_(void 0,Object.assign({_directives:t},e)),l={atKey:!1,atRoot:!0,directives:o.directives,options:o.options,schema:o.schema},u=cj(n,{indicator:"doc-start",next:s??i?.[0],offset:r,onError:a,parentIndent:0,startOnNewline:!0});u.found&&(o.directives.docStart=!0,s&&("block-map"===s.type||"block-seq"===s.type)&&!u.hasNewline&&a(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),o.contents=s?cJ(l,s,u,a):cH(l,u.end,n,null,u,a);let c=o.contents.range[2],p=cC(i,c,!1,a);return p.comment&&(o.comment=p.comment),o.range=[r,c,p.offset],o}(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new cO(cV(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){this.errors.push(new cO(cV(e),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let t=cC(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}
744
+ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new cO(cV(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new c_(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),e.range=[0,t,t],this.decorate(e,!1),yield e}}}function cX(e,t){if(t)for(let r of t)switch(r.type){case"space":case"comment":e.push(r);break;case"newline":return e.push(r),!0}return!1}function cY(e,t,r){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=r,e.source=t;break;case"block-scalar":{let n=e.props.slice(1),s=t.length;for(let t of("block-scalar-header"===e.props[0].type&&(s-=e.props[0].source.length),n))t.offset+=s;delete e.props,Object.assign(e,{type:r,source:t,end:n});break}case"block-map":case"block-seq":{let n={type:"newline",offset:e.offset+t.length,indent:e.indent,source:"\n"};delete e.items,Object.assign(e,{type:r,source:t,end:[n]});break}default:{let n="indent"in e?e.indent:-1,s="end"in e&&Array.isArray(e.end)?e.end.filter(e=>"space"===e.type||"comment"===e.type||"newline"===e.type):[];for(let t of Object.keys(e))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:r,indent:n,source:t,end:s})}}}let cQ=Symbol("break visit"),c0=Symbol("skip children"),c1=Symbol("remove item");function c2(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),function e(t,r,n){let s=n(r,t);if("symbol"==typeof s)return s;for(let i of["key","value"]){let a=r[i];if(a&&"items"in a){for(let r=0;r<a.items.length;++r){let s=e(Object.freeze(t.concat([[i,r]])),a.items[r],n);if("number"==typeof s)r=s-1;else{if(s===cQ)return cQ;s===c1&&(a.items.splice(r,1),r-=1)}}"function"==typeof s&&"key"===i&&(s=s(r,t))}}return"function"==typeof s?s(r,t):s}(Object.freeze([]),e,t)}function c5(e){switch(e){case"\uFEFF":return"byte-order-mark";case"\x02":return"doc-mode";case"\x18":return"flow-error-end";case"\x1f":return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function c9(e){switch(e.type){case"block-scalar":{let t="";for(let r of e.props)t+=c9(r);return t+e.source}case"block-map":case"block-seq":{let t="";for(let r of e.items)t+=c6(r);return t}case"flow-collection":{let t=e.start.source;for(let r of e.items)t+=c6(r);for(let r of e.end)t+=r.source;return t}case"document":{let t=c6(e);if(e.end)for(let r of e.end)t+=r.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let r of e.end)t+=r.source;return t}}}function c6({start:e,key:t,sep:r,value:n}){let s="";for(let t of e)s+=t.source;if(t&&(s+=c9(t)),r)for(let e of r)s+=e.source;return n&&(s+=c9(n)),s}c2.BREAK=cQ,c2.SKIP=c0,c2.REMOVE=c1,c2.itemAtPath=(e,t)=>{let r=e;for(let[e,n]of t){let t=r?.[e];if(!t||!("items"in t))return;r=t.items[n]}return r},c2.parentCollection=(e,t)=>{let r=c2.itemAtPath(e,t.slice(0,-1)),n=t[t.length-1][0],s=r?.[n];if(s&&"items"in s)return s;throw Error("Parent collection not found")},e.s(["BOM",0,"\uFEFF","DOCUMENT",0,"\x02","FLOW_END",0,"\x18","SCALAR",0,"\x1f","createScalarToken",0,function(e,t){let{implicitKey:r=!1,indent:n,inFlow:s=!1,offset:i=-1,type:a="PLAIN"}=t,o=uT({type:a,value:e},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}}),l=t.end??[{type:"newline",offset:-1,indent:n,source:"\n"}];switch(o[0]){case"|":case">":{let e=o.indexOf("\n"),t=o.substring(0,e),r=o.substring(e+1)+"\n",s=[{type:"block-scalar-header",offset:i,indent:n,source:t}];return cX(s,l)||s.push({type:"newline",offset:-1,indent:n,source:"\n"}),{type:"block-scalar",offset:i,indent:n,props:s,source:r}}case'"':return{type:"double-quoted-scalar",offset:i,indent:n,source:o,end:l};case"'":return{type:"single-quoted-scalar",offset:i,indent:n,source:o,end:l};default:return{type:"scalar",offset:i,indent:n,source:o,end:l}}},"isCollection",0,e=>!!e&&"items"in e,"isScalar",0,e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type),"prettyToken",0,function(e){switch(e){case"\uFEFF":return"<BOM>";case"\x02":return"<DOC>";case"\x18":return"<FLOW_END>";case"\x1f":return"<SCALAR>";default:return JSON.stringify(e)}},"resolveAsScalar",0,function(e,t=!0,r){if(e){let n=(e,t,n)=>{let s="number"==typeof e?e:Array.isArray(e)?e[0]:e.offset;if(r)r(s,t,n);else throw new cO([s,s+1],t,n)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return cF(e,t,n);case"block-scalar":return cU({options:{strict:t}},e,n)}}return null},"setScalarValue",0,function(e,t,r={}){let{afterKey:n=!1,implicitKey:s=!1,inFlow:i=!1,type:a}=r,o="indent"in e?e.indent:null;if(n&&"number"==typeof o&&(o+=2),!a)switch(e.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{let t=e.props[0];if("block-scalar-header"!==t.type)throw Error("Invalid block scalar header");a=">"===t.source[0]?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}let l=uT({type:a,value:t},{implicitKey:s||null===o,indent:null!==o&&o>0?" ".repeat(o):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":!function(e,t){let r=t.indexOf("\n"),n=t.substring(0,r),s=t.substring(r+1)+"\n";if("block-scalar"===e.type){let t=e.props[0];if("block-scalar-header"!==t.type)throw Error("Invalid block scalar header");t.source=n,e.source=s}else{let{offset:t}=e,r="indent"in e?e.indent:-1,i=[{type:"block-scalar-header",offset:t,indent:r,source:n}];for(let t of(cX(i,"end"in e?e.end:void 0)||i.push({type:"newline",offset:-1,indent:r,source:"\n"}),Object.keys(e)))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:"block-scalar",indent:r,props:i,source:s})}}(e,l);break;case'"':cY(e,l,"double-quoted-scalar");break;case"'":cY(e,l,"single-quoted-scalar");break;default:cY(e,l,"scalar")}},"stringify",0,e=>"type"in e?c9(e):c6(e),"tokenType",0,c5,"visit",0,c2],91723);var c4=e.i(91723);function c3(e){switch(e){case void 0:case" ":case"\n":case"\r":case" ":return!0;default:return!1}}let c8=new Set("0123456789ABCDEFabcdef"),c7=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),pe=new Set(",[]{}"),pt=new Set(" ,[]{}\n\r "),pr=e=>!e||pt.has(e);class pn{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if("string"!=typeof e)throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let r=this.next??"stream";for(;r&&(t||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;" "===t||" "===t;)t=this.buffer[++e];return!t||"#"===t||"\n"===t||"\r"===t&&"\n"===this.buffer[e+1]}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let r=0;for(;" "===t;)t=this.buffer[++r+e];if("\r"===t){let t=this.buffer[r+e+1];if("\n"===t||!t&&!this.atEnd)return e+r+1}return"\n"!==t&&!(r>=this.indentNext)&&(t||this.atEnd)?-1:e+r}if("-"===t||"."===t){let t=this.buffer.substr(e,3);if(("---"===t||"..."===t)&&c3(this.buffer[e+3]))return -1}return e}getLine(){let e=this.lineEndPos;return(("number"!=typeof e||-1!==e&&e<this.pos)&&(e=this.buffer.indexOf("\n",this.pos),this.lineEndPos=e),-1===e)?this.atEnd?this.buffer.substring(this.pos):null:("\r"===this.buffer[e-1]&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(null===e)return this.setNext("stream");if("\uFEFF"===e[0]&&(yield*this.pushCount(1),e=e.substring(1)),"%"===e[0]){let t=e.length,r=e.indexOf("#");for(;-1!==r;){let n=e[r-1];if(" "===n||" "===n){t=r-1;break}r=e.indexOf("#",r+1)}for(;;){let r=e[t-1];if(" "===r||" "===r)t-=1;else break}let n=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-n),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield"\x02",yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if("-"===e||"."===e){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let e=this.peek(3);if(("---"===e||"..."===e)&&c3(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,"---"===e?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!c3(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if(("-"===e||"?"===e||":"===e)&&c3(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(null===e)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(pr),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,r=-1;do(e=yield*this.pushNewline())>0?(t=yield*this.pushSpaces(!1),this.indentValue=r=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0)let n=this.getLine();if(null===n)return this.setNext("flow");if((-1!==r&&r<this.indentNext&&"#"!==n[0]||0===r&&(n.startsWith("---")||n.startsWith("..."))&&c3(n[3]))&&(r!==this.indentNext-1||1!==this.flowLevel||"]"!==n[0]&&"}"!==n[0]))return this.flowLevel=0,yield"\x18",yield*this.parseLineStart();let s=0;for(;","===n[s];)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(n[s+=yield*this.pushIndicators()]){case void 0:return"flow";case"#":return yield*this.pushCount(n.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(pr),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let e=this.charAt(1);if(this.flowKey||c3(e)||","===e)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if("'"===e)for(;-1!==t&&"'"===this.buffer[t+1];)t=this.buffer.indexOf("'",t+2);else for(;-1!==t;){let e=0;for(;"\\"===this.buffer[t-1-e];)e+=1;if(e%2==0)break;t=this.buffer.indexOf('"',t+1)}let r=this.buffer.substring(0,t),n=r.indexOf("\n",this.pos);if(-1!==n){for(;-1!==n;){let e=this.continueScalar(n+1);if(-1===e)break;n=r.indexOf("\n",e)}-1!==n&&(t=n-("\r"===r[n-1]?2:1))}if(-1===t){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if("+"===t)this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if("-"!==t)break}return yield*this.pushUntil(e=>c3(e)||"#"===e)}*parseBlockScalar(){let e,t=this.pos-1,r=0;e:for(let n=this.pos;e=this.buffer[n];++n)switch(e){case" ":r+=1;break;case"\n":t=n,r=0;break;case"\r":{let e=this.buffer[n+1];if(!e&&!this.atEnd)return this.setNext("block-scalar");if("\n"===e)break}default:break e}if(!e&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){-1===this.blockScalarIndent?this.indentNext=r:this.indentNext=this.blockScalarIndent+(0===this.indentNext?1:this.indentNext);do{let e=this.continueScalar(t+1);if(-1===e)break;t=this.buffer.indexOf("\n",e)}while(-1!==t)if(-1===t){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let n=t+1;for(e=this.buffer[n];" "===e;)e=this.buffer[++n];if(" "===e){for(;" "===e||" "===e||"\r"===e||"\n"===e;)e=this.buffer[++n];t=n-1}else if(!this.blockScalarKeep)for(;;){let e=t-1,n=this.buffer[e];"\r"===n&&(n=this.buffer[--e]);let s=e;for(;" "===n;)n=this.buffer[--e];if("\n"===n&&e>=this.pos&&e+1+r>s)t=e;else break}return yield"\x1f",yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e,t=this.flowLevel>0,r=this.pos-1,n=this.pos-1;for(;e=this.buffer[++n];)if(":"===e){let e=this.buffer[n+1];if(c3(e)||t&&pe.has(e))break;r=n}else if(c3(e)){let s=this.buffer[n+1];if("\r"===e&&("\n"===s?(n+=1,e="\n",s=this.buffer[n+1]):r=n),"#"===s||t&&pe.has(s))break;if("\n"===e){let e=this.continueScalar(n+1);if(-1===e)break;n=Math.max(n,e-2)}}else{if(t&&pe.has(e))break;r=n}return e||this.atEnd?(yield"\x1f",yield*this.pushToIndex(r+1,!0),t?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(t&&(yield""),0)}*pushIndicators(){let e=0;for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue;case"&":e+=yield*this.pushUntil(pr),e+=yield*this.pushSpaces(!0);continue;case"-":case"?":case":":{let t=this.flowLevel>0,r=this.charAt(1);if(c3(r)||t&&pe.has(r)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue}}}break}return e}*pushTag(){if("<"===this.charAt(1)){let e=this.pos+2,t=this.buffer[e];for(;!c3(t)&&">"!==t;)t=this.buffer[++e];return yield*this.pushToIndex(">"===t?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(c7.has(t))t=this.buffer[++e];else if("%"===t&&c8.has(this.buffer[e+1])&&c8.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return"\n"===e?yield*this.pushCount(1):"\r"===e&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(e){let t,r=this.pos-1;do t=this.buffer[++r];while(" "===t||e&&" "===t)let n=r-this.pos;return n>0&&(yield this.buffer.substr(this.pos,n),this.pos=r),n}*pushUntil(e){let t=this.pos,r=this.buffer[t];for(;!e(r);)r=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}function ps(e,t){for(let r=0;r<e.length;++r)if(e[r].type===t)return!0;return!1}function pi(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return -1}function pa(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function po(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function pl(e){if(0===e.length)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function pu(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let r=0;r<t.length;++r)e.push(t[r])}function pc(e){if("flow-seq-start"===e.start.type)for(let t of e.items)!t.sep||t.value||ps(t.start,"explicit-key-ind")||ps(t.sep,"map-value-ind")||(t.key&&(t.value=t.key),delete t.key,pa(t.value)?t.value.end?pu(t.value.end,t.sep):t.value.end=t.sep:pu(t.start,t.sep),delete t.sep)}class pp{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new pn,this.onNewLine=e}*parse(e,t=!1){for(let r of(this.onNewLine&&0===this.offset&&this.onNewLine(0),this.lexer.lex(e,t)))yield*this.next(r);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=c5(e);if(t)if("scalar"===t)this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&" "===e[0]&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let t=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:t,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if("doc-end"===this.type&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(t)if(0===this.stack.length)yield t;else{let e=this.peek(1);switch("block-scalar"===t.type?t.indent="indent"in e?e.indent:0:"flow-collection"===t.type&&"document"===e.type&&(t.indent=0),"flow-collection"===t.type&&pc(t),e.type){case"document":e.value=t;break;case"block-scalar":e.props.push(t);break;case"block-map":{let r=e.items[e.items.length-1];if(r.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(r.sep)r.value=t;else{Object.assign(r,{key:t,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=e.items[e.items.length-1];r.value?e.items.push({start:[],value:t}):r.value=t;break}case"flow-collection":{let r=e.items[e.items.length-1];!r||r.value?e.items.push({start:[],key:t,sep:[]}):r.sep?r.value=t:Object.assign(r,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if(("document"===e.type||"block-map"===e.type||"block-seq"===e.type)&&("block-map"===t.type||"block-seq"===t.type)){let r=t.items[t.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&-1===pi(r.start)&&(0===t.indent||r.start.every(e=>"comment"!==e.type||e.indent<t.indent))&&("document"===e.type?e.end=r.start:e.items.push({start:r.start}),t.items.splice(-1,1))}}else yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};"doc-start"===this.type&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":-1!==pi(e.start)?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return;case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if("map-value-ind"===this.type){let t,r=pl(po(this.peek(2)));e.end?((t=e.end).push(this.sourceToken),delete e.end):t=[this.sourceToken];let n={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:t}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=n}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let r="end"in t.value?t.value.end:void 0,n=Array.isArray(r)?r[r.length-1]:void 0;n?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let r=e.items[e.items.length-2],n=r?.value?.end;if(Array.isArray(n)){pu(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,n=r&&(t.sep||t.explicitKey)&&"seq-item-ind"!==this.type,s=[];if(n&&t.sep&&!t.value){let r=[];for(let n=0;n<t.sep.length;++n){let s=t.sep[n];switch(s.type){case"newline":r.push(n);break;case"space":break;case"comment":s.indent>e.indent&&(r.length=0);break;default:r.length=0}}r.length>=2&&(s=t.sep.splice(r[1]))}switch(this.type){case"anchor":case"tag":n||t.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":t.sep||t.explicitKey?n||t.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}):(t.start.push(this.sourceToken),t.explicitKey=!0),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ps(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(pa(t.key)&&!ps(t.sep,"newline")){let e=pl(t.start),r=t.key,n=t.sep;n.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:r,sep:n}]})}else s.length>0?t.sep=t.sep.concat(s,this.sourceToken):t.sep.push(this.sourceToken);else if(ps(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=pl(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||n?e.items.push({start:s,key:null,sep:[this.sourceToken]}):ps(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);n||t.value?(e.items.push({start:s,key:r,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(r):(Object.assign(t,{key:r,sep:[]}),this.onKeyLine=!0);return}default:{let n=this.startBlockValue(e);if(n){if("block-seq"===n.type){if(!t.explicitKey&&t.sep&&!ps(t.sep,"newline"))return void(yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source}))}else r&&e.items.push({start:s});this.stack.push(n);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let r="end"in t.value?t.value.end:void 0,n=Array.isArray(r)?r[r.length-1]:void 0;n?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let r=e.items[e.items.length-2],n=r?.value?.end;if(Array.isArray(n)){pu(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||ps(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t)return void this.stack.push(t)}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if("flow-error-end"===this.type){let e;do yield*this.pop(),e=this.peek(1);while(e?.type==="flow-collection")}else if(0===e.end.length){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:r,sep:[]}):t.sep?this.stack.push(r):Object.assign(t,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if("block-map"!==t.type||("map-value-ind"!==this.type||t.indent!==e.indent)&&("newline"!==this.type||t.items[t.items.length-1].sep))if("map-value-ind"===this.type&&"flow-collection"!==t.type){let r=pl(po(t));pc(e);let n=e.end.splice(1,e.end.length);n.push(this.sourceToken);let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e);else yield*this.pop(),yield*this.step()}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=pl(po(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=pl(po(e));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return"comment"===this.type&&!(this.indent<=t)&&e.every(e=>"newline"===e.type||"space"===e.type)}*documentEnd(e){"doc-mode"!==this.type&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}}class pd{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,r=this.lineStarts.length;for(;t<r;){let n=t+r>>1;this.lineStarts[n]<e?t=n+1:r=n}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(0===t)return{line:0,col:e};let n=this.lineStarts[t-1];return{line:t,col:e-n+1}}}}function ph(e){let t=!1!==e.prettyErrors;return{lineCounter:e.lineCounter||t&&new pd||null,prettyErrors:t}}function pf(e,t={}){let{lineCounter:r,prettyErrors:n}=ph(t),s=new pp(r?.addNewLine),i=new cG(t),a=null;for(let t of i.compose(s.parse(e),!0,e.length))if(a){if("silent"!==a.options.logLevel){a.errors.push(new cO(t.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else a=t;return n&&r&&(a.errors.forEach(cM(e,r)),a.warnings.forEach(cM(e,r))),a}function pm(e,t,r){let n;"function"==typeof t?n=t:void 0===r&&t&&"object"==typeof t&&(r=t);let s=pf(e,r);if(!s)return null;if(s.warnings.forEach(e=>uM(s.options.logLevel,e)),s.errors.length>0)if("silent"!==s.options.logLevel)throw s.errors[0];else s.errors=[];return s.toJS(Object.assign({reviver:n},r))}e.s(["Alias",0,uo,"CST",0,c4,"Composer",0,cG,"Document",0,c_,"Lexer",0,pn,"LineCounter",0,pd,"Pair",0,uP,"Parser",0,pp,"Scalar",0,uu,"Schema",0,cS,"YAMLError",0,cT,"YAMLMap",0,uF,"YAMLParseError",0,cO,"YAMLSeq",0,uB,"YAMLWarning",0,cE,"isAlias",0,lB,"isCollection",0,lW,"isDocument",0,lK,"isMap",0,lZ,"isNode",0,lG,"isPair",0,lJ,"isScalar",0,lH,"isSeq",0,lV,"parse",0,pm,"parseAllDocuments",0,function(e,t={}){let{lineCounter:r,prettyErrors:n}=ph(t),s=new pp(r?.addNewLine),i=new cG(t),a=Array.from(i.compose(s.parse(e)));if(n&&r)for(let t of a)t.errors.forEach(cM(e,r)),t.warnings.forEach(cM(e,r));return a.length>0?a:Object.assign([],{empty:!0},i.streamInfo())},"parseDocument",0,pf,"stringify",0,function(e,t,r){let n=null;if("function"==typeof t||Array.isArray(t)?n=t:void 0===r&&t&&(r=t),"string"==typeof r&&(r=r.length),"number"==typeof r){let e=Math.round(r);r=e<1?void 0:e>8?{indent:8}:{indent:e}}if(void 0===e){let{keepUndefined:e}=r??t??{};if(!e)return}return lK(e)&&!n?e.toString(r):new c_(e,n,r).toString(r)},"visit",0,l1,"visitAsync",0,l5],32861),e.i(32861);let py=/^(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\s+(\S+)(?:\s+HTTP\/[\d.]+)?\s*$/,pg=e=>e.replace(/^.*[\\/]/,"").replace(/\.[^.]+$/,"")||"Imported";function pb(e,t,r=""){let n=t.replace(/\s+$/,"");if(!n)return e;let s=/json/i.test(r)||/^\s*[{[]/.test(n);return{...e,bodyMode:s?"json":"text",bodyText:n}}function pv(e,t,r,n){let s=pI(t,e,r,n);return{...s.draft,headers:s.headers}}function pw(e,t){let r=pg(t),n=new Set,s=e=>n.add(e),i=[],a=[],o=e.replace(/\r\n?/g,"\n").split(/^###(.*)$/m),l=[{title:"",text:o[0]}];for(let e=1;e<o.length;e+=2)l.push({title:o[e].trim(),text:o[e+1]??""});for(let[e,{title:t,text:n}]of l.entries()){let o=n.split("\n"),l=t,u=0;for(;u<o.length;u++){let e=o[u].trim();if(!e)continue;let t=/^(?:#|\/\/)\s*@name\s+(.+)$/.exec(e);if(t){l=t[1].trim();continue}let r=/^@([\w.-]+)\s*=\s*(.*)$/.exec(e);if(r){i.push({key:r[1],value:r[2].trim(),secret:!1});continue}if(/^(#|\/\/)/.test(e)){l||(l=e.replace(/^(#|\/\/)\s*/,"").slice(0,120));continue}break}if(u>=o.length)continue;let c=o[u].trim(),p=py.exec(c)??(/^(https?:\/\/|\{\{)/.test(c)?["","GET",c.split(/\s+/)[0]]:null);if(!p){s(`Request ${e+1}: "${c.slice(0,60)}" isn't a request line — skipped`);continue}let d=p[1],h=p[2];for(u++;u<o.length&&/^\s+[?&]/.test(o[u]);)h+=o[u++].trim();let f=[];for(;u<o.length;u++){let e=o[u];if(!e.trim()){u++;break}if(/^\s*(#|\/\/)/.test(e))continue;let t=/^([^:\s][^:]*):\s*(.*)$/.exec(e.trim());t&&f.push({key:t[1].trim(),value:t[2].trim()})}let m=o.slice(u),y=m.findIndex(e=>/^\s*>\s/.test(e)||/^\s*<>\s/.test(e));y>=0&&s(`${l||`${d} ${h}`}: response handler scripts (> {% … %}) aren't imported — add checks on the Checks tab`);let g=(y>=0?m.slice(0,y):m).filter(e=>!/^\s*(#|\/\/)/.test(e));g.some(e=>/^\s*<\s+\S/.test(e))&&s(`${l||`${d} ${h}`}: a body read from a file (< path) — choose the file again in the Body tab`);let b=l||`${d} ${h}`,v=lc({...le(),method:d},h),w=f.find(e=>/^content-type$/i.test(e.key))?.value??"";if(v=pb(v,g.filter(e=>!/^\s*<\s+\S/.test(e)).join("\n"),w),a.push({collection:o2(r),name:(l||`${d} ${h.replace(/^\{\{[^}]+\}\}/,"")}`).slice(0,120),request:pv(v,f,s,b)}),a.length>=2e3)break}if(!a.length)throw Error("No requests found — each request starts with a line like GET https://api.example.com/items");let u=i.length?[{name:r,variables:function(e){let t=new Map;for(let r of e)t.set(r.key,r);return[...t.values()]}(i)}]:[];return{kind:"http",title:r,requests:a,environments:u,warnings:[...n]}}let pk=e=>e.trim().replace(/^\$\.?/,"").replace(/\['([^']+)'\]/g,".$1").replace(/^\./,"")||"",px=e=>{let t=e.trim();if(/^".*"$/.test(t))try{return JSON.parse(t)}catch{return t.slice(1,-1)}return t};function p$(e,t){let r=pg(t),n=new Set,s=e=>n.add(e),i=[],a=e.replace(/\r\n?/g,"\n").split("\n"),o=[],l=null,u="headers",c=null,p=!1,d="";for(let e of a){let t=e.replace(/\s+$/,"");if(p){/^```/.test(t.trim())?p=!1:l?.body.push(e);continue}if(/^\s*#/.test(t)){d=t.replace(/^\s*#\s*/,"").trim();continue}let r=py.exec(t.trim());if(r&&!t.startsWith(" ")){l={method:r[1],url:r[2],headers:[],sections:new Map,body:[],status:null,response:new Map,comment:d},d="",o.push(l),u="headers",c=null;continue}if(!l)continue;let n=/^HTTP(?:\/[\d.]+)?\s+(\d{3}|\*)/.exec(t.trim());if(n){l.status="*"===n[1]?null:n[1],u="response",c=null;continue}let s=/^\[(\w+)\]$/.exec(t.trim());if(s){c=s[1],("response"===u?l.response:l.sections).set(c,[]);continue}if(!t.trim()){"headers"===u&&!c&&l.headers.length&&(u="body");continue}if(c){("response"===u?l.response:l.sections).get(c).push(t.trim());continue}if("headers"===u){let e=/^([\w-]+):\s*(.*)$/.exec(t.trim());if(e){l.headers.push({key:e[1],value:e[2]});continue}u="body"}if("body"===u){if(/^```/.test(t.trim())){p=!0;continue}l.body.push(e)}}let h=(e=[])=>e.map(e=>/^([^:]+):\s*(.*)$/.exec(e)).filter(e=>!!e).map(e=>({key:e[1].trim(),value:px(e[2])}));for(let e of o){let t=e.comment||`${e.method} ${e.url}`,n=lc({...le(),method:e.method},e.url),a=h(e.sections.get("QueryStringParams")??e.sections.get("Query"));a.length&&(n={...n,params:[...n.params,...a]});let o=h(e.sections.get("BasicAuth"))[0];o&&(n={...n,authMode:"basic",username:o.key,password:o.value});let l=h(e.sections.get("FormParams")??e.sections.get("Form")),u=h(e.sections.get("MultipartFormData")??e.sections.get("Multipart"));if(l.length)n={...n,bodyMode:"form",formRows:l.map(e=>({...e,kind:"text",file:null}))};else if(u.length){let e=u.map(e=>/^file,/.test(e.value)?{key:e.key,value:"",kind:"file",file:null}:{...e,kind:"text",file:null});e.some(e=>"file"===e.kind)&&s(`${t}: choose the files for the form again in the Body tab`),n={...n,bodyMode:"multipart",formRows:e}}else{let r=e.body.join("\n").trim();/^file,/.test(r)?s(`${t}: a body read from a file — choose it again (Body → File)`):n=pb(n,r.replace(/^`([\s\S]*)`$/,"$1"),e.headers.find(e=>/^content-type$/i.test(e.key))?.value??"")}let c=[];e.status&&c.push({type:"status",expect:e.status});let p=0;for(let t of e.response.get("Asserts")??[]){let e=function(e){let t=/^(jsonpath|header|status|body|duration)(?:\s+("(?:[^"\\]|\\.)*"))?\s+(not\s+)?(==|!=|>=|<=|>|<|contains|startsWith|endsWith|matches|exists|isString|isNumber|isInteger|isFloat|isBoolean|isCollection|isList|isObject|count)\s*(.*)$/.exec(e.trim());if(!t)return null;let[,r,n="",s,i,a=""]=t,o=px(a);if("status"===r&&"=="===i&&!s)return{type:"status",expect:o};if("duration"===r&&("<"===i||"<="===i))return{type:"time",maxMs:Number(o)||1e3};if("body"===r&&"contains"===i)return{type:"body",op:s?"not_contains":"contains",value:o};if("body"===r&&"matches"===i)return{type:"body",op:"matches",value:o.replace(/^\/|\/$/g,"")};if("header"===r){let e=px(n);return"exists"===i?{type:"header",name:e,op:s?"not_exists":"exists",value:""}:"=="!==i||s?"contains"!==i||s?"matches"!==i||s?null:{type:"header",name:e,op:"matches",value:o.replace(/^\/|\/$/g,"")}:{type:"header",name:e,op:"contains",value:o}:{type:"header",name:e,op:"equals",value:o}}if("jsonpath"===r){let e=pk(px(n));if(!e)return null;if("exists"===i)return{type:"json",path:e,op:s?"not_exists":"exists",value:""};if("=="===i)return{type:"json",path:e,op:s?"not_equals":"equals",value:o};if("!="===i)return{type:"json",path:e,op:"not_equals",value:o};if("contains"===i&&!s)return{type:"json",path:e,op:"contains",value:o};if((">"===i||">="===i)&&!s)return{type:"json",path:e,op:"greater",value:">="===i?String(Number(o)-1e-9):o};if(("<"===i||"<="===i)&&!s)return{type:"json",path:e,op:"less",value:"<="===i?String(Number(o)+1e-9):o};if("matches"===i&&!s)return{type:"json",path:e,op:"matches",value:o.replace(/^\/|\/$/g,"")};if("count"===i&&!s)return{type:"json",path:e,op:"length",value:a.replace(/^==\s*/,"").trim()};let t={isString:"string",isNumber:"number",isInteger:"number",isFloat:"number",isBoolean:"boolean",isCollection:"array",isList:"array",isObject:"object"};if(t[i]&&!s)return{type:"json",path:e,op:"type",value:t[i]}}return null}(t);e?c.push(e):p++}p&&s(`${t}: ${p} assert${1===p?"":"s"} the app has no check for were left out`);let d=[];for(let r of e.response.get("Captures")??[]){let e=/^([A-Za-z_][\w]*)\s*:\s*(jsonpath|header)\s+("(?:[^"\\]|\\.)*")/.exec(r);e?d.push({name:e[1],from:"header"===e[2]?"header":"json",path:"header"===e[2]?px(e[3]):pk(px(e[3]))}):s(`${t}: a capture the app can't take ("${r.slice(0,50)}") was left out`)}n={...n,checks:c,saveValues:d};let f=(e.comment||`${e.method} ${e.url.replace(/^\{\{[^}]+\}\}/,"")}`).slice(0,120);if(i.push({collection:o2(r),name:f,request:pv(n,e.headers,s,t)}),i.length>=2e3)break}if(!i.length)throw Error("No requests found in this Hurl file");return{kind:"hurl",title:r,requests:i,environments:[],warnings:[...n]}}function pS(e=""){return e.split("\n").map(e=>/^(~?)([^:]+):\s?(.*)$/.exec(e.trim())).filter(e=>!!e).map(e=>({key:e[2].trim(),value:e[3],enabled:!e[1]}))}function p_(e,t){let r=e.name,n=e.method.toUpperCase(),s=lc({...le(),method:o5.includes(n)?n:"GET"},e.url),i=e.params.filter(e=>e.enabled).map(e=>({key:e.name,value:e.value})),a=new Set(s.params.map(e=>e.key)),o=i.filter(e=>!a.has(e.key));o.length&&(s={...s,params:[...s.params,...o]});let l=e.body;switch(e.bodyMode){case"json":s=pb(s,l.json??"","json");break;case"text":"json"!==(s=pb({...s},l.text??"","text/plain")).bodyMode||/^\s*[{[]/.test(l.text??"")||(s={...s,bodyMode:"text"});break;case"xml":l.xml&&(s={...s,bodyMode:"text",bodyText:l.xml});break;case"graphql":s={...s,bodyMode:"graphql",graphqlQuery:l.graphql?.query??"",graphqlVariables:l.graphql?.variables??""};break;case"formUrlEncoded":s={...s,bodyMode:"form",formRows:l.form.map(e=>({...e,kind:"text",file:null}))};break;case"multipartForm":l.multipart.some(e=>e.file)&&t(`${r}: choose the files for the form again in the Body tab`),s={...s,bodyMode:"multipart",formRows:l.multipart.map(e=>e.file?{key:e.key,value:"",kind:"file",file:null}:{key:e.key,value:e.value,kind:"text",file:null})}}let u=e.auth;"bearer"===u.mode?s={...s,authMode:"bearer",token:u.token??""}:"basic"===u.mode?s={...s,authMode:"basic",username:u.username??"",password:u.password??""}:"apikey"===u.mode?s={...s,authMode:"api_key",apiName:u.key||"X-API-Key",apiValue:u.value??"",apiIn:"queryparams"===u.placement?"query":"header"}:"none"===u.mode?s={...s,authMode:"none"}:u.mode&&"inherit"!==u.mode&&t(`${r}: ${u.mode} auth isn't imported from Bruno — set it on the Auth tab`);let c=[],p=0;for(let t of e.assertions.filter(e=>e.enabled)){let e=function(e,t){let r=/^(eq|neq|gt|gte|lt|lte|contains|notContains|isDefined|isUndefined|isNull|isString|isNumber|isBoolean|isArray|isJson|matches|length)\s*(.*)$/.exec(t.trim());if(!r)return null;let[,n,s=""]=r,i=px(s);if("res.status"===e&&"eq"===n)return{type:"status",expect:i};if("res.responseTime"===e&&("lt"===n||"lte"===n))return{type:"time",maxMs:Number(i)||1e3};let a=/^res\.headers?\[["']?([^"'\]]+)["']?\]$|^res\.headers?\.([\w-]+)$/.exec(e);if(a){let e=a[1]??a[2];return"isDefined"===n?{type:"header",name:e,op:"exists",value:""}:"eq"===n?{type:"header",name:e,op:"equals",value:i}:"contains"===n?{type:"header",name:e,op:"contains",value:i}:null}if("res.body"===e&&"contains"===n)return{type:"body",op:"contains",value:i};if("res.body"===e&&"isJson"===n)return{type:"body",op:"is_json",value:""};let o=/^res\.body\.?(.*)$/.exec(e)?.[1];if(!o)return null;switch(n){case"eq":return{type:"json",path:o,op:"equals",value:i};case"neq":return{type:"json",path:o,op:"not_equals",value:i};case"gt":case"gte":return{type:"json",path:o,op:"greater",value:"gte"===n?String(Number(i)-1e-9):i};case"lt":case"lte":return{type:"json",path:o,op:"less",value:"lte"===n?String(Number(i)+1e-9):i};case"contains":return{type:"json",path:o,op:"contains",value:i};case"isDefined":return{type:"json",path:o,op:"exists",value:""};case"isUndefined":return{type:"json",path:o,op:"not_exists",value:""};case"isString":case"isNumber":case"isBoolean":case"isArray":return{type:"json",path:o,op:"type",value:n.slice(2).toLowerCase()};case"matches":return{type:"json",path:o,op:"matches",value:i.replace(/^\/|\/$/g,"")};case"length":return{type:"json",path:o,op:"length",value:i};default:return null}}(t.name,t.value);e?c.push(e):p++}return p&&t(`${r}: ${p} assertion${1===p?"":"s"} the app has no check for were left out`),(e.scripts||e.tests)&&t(`${r}: Bruno scripts and tests (bru.*, res.*) aren't imported — the app's scripts use Postman's pm.* — re-create them as checks or pm.test`),pv(s={...s,checks:c,description:e.docs.trim().slice(0,5e4)},e.headers.filter(e=>e.enabled).map(e=>({key:e.name,value:e.value})),t,r)}let pA=e=>"string"==typeof e?e:null==e?"":String(e),pT=e=>Array.isArray(e)?e:[];function pO(e,t=""){let r=function(e,t){let r=t.toLowerCase(),n=e.replace(/^/,"");if(r.endsWith(".hurl"))return p$(n,t);if(r.endsWith(".bru")||/^meta\s*\{\s*$/m.test(n))return function(e,t){let r=function(e){let t=new Map,r=e.replace(/\r\n?/g,"\n").split("\n");for(let e=0;e<r.length;e++){let n=/^([\w:-]+)\s*\{\s*$/.exec(r[e]);if(!n)continue;let s=[];for(e++;e<r.length&&"}"!==r[e];e++)s.push(r[e].replace(/^ {2}/,""));t.set(n[1],s.join("\n"))}return t}(e),n=Object.fromEntries(pS(r.get("meta")).map(e=>[e.key,e.value])),s=[...r.keys()].find(e=>{let t;return t=e.toUpperCase(),o5.includes(t)});if(!s){if(r.has("vars")||/^vars:secret\s*\[/m.test(e)){let n=pg(t),s=pS(r.get("vars")).filter(e=>e.enabled).map(e=>({key:e.key,value:e.value,secret:!1})),i=/^vars:secret\s*\[([\s\S]*?)\]/m.exec(e)?.[1]?.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean)??[];for(let e of i)s.push({key:e,value:"",secret:!0});return{kind:"bruno",title:"Bruno",requests:[],environments:[{name:n,variables:s}],warnings:i.length?[`${n}: fill in the secret values (${i.join(", ")}) under Environments — Bruno keeps them out of its files`]:[]}}if(r.has("meta")||r.has("headers")||[...r.keys()].some(e=>e.startsWith("auth")))return{kind:"bruno",title:"Bruno",requests:[],environments:[],warnings:[`${pg(t)}.bru: folder-wide headers and auth aren't imported — set them in the folder's settings (⋯ → Folder settings)`]};throw Error("No request found in this .bru file (it has no get { … }, post { … } block)")}let i=Object.fromEntries(pS(r.get(s)).map(e=>[e.key,e.value])),a=new Set,o=Object.fromEntries(pS(r.get(`auth:${i.auth??""}`)).map(e=>[e.key,e.value])),l={name:n.name||pg(t),method:s,url:i.url??"",headers:pS(r.get("headers")).map(e=>({name:e.key,value:e.value,enabled:e.enabled})),params:pS(r.get("params:query")??r.get("query")).map(e=>({name:e.key,value:e.value,enabled:e.enabled})),bodyMode:{json:"json",text:"text",xml:"xml",graphql:"graphql","form-urlencoded":"formUrlEncoded","multipart-form":"multipartForm"}[i.body??""]??"none",body:{json:r.get("body:json"),text:r.get("body:text"),xml:r.get("body:xml"),graphql:{query:r.get("body:graphql"),variables:r.get("body:graphql:vars")},form:pS(r.get("body:form-urlencoded")).filter(e=>e.enabled),multipart:pS(r.get("body:multipart-form")).filter(e=>e.enabled).map(e=>({key:e.key,value:e.value,file:/^@file\(/.test(e.value)}))},auth:{mode:i.auth??"inherit",token:o.token,username:o.username,password:o.password,key:o.key,value:o.value,placement:o.placement},assertions:pS(r.get("assert")).map(e=>({name:e.key,value:e.value,enabled:e.enabled})),scripts:r.has("script:pre-request")||r.has("script:post-response"),tests:r.has("tests"),docs:r.get("docs")??""},u=p_(l,e=>a.add(e)),c="Bruno";return{kind:"bruno",title:c,requests:[{collection:o2(c),name:l.name.slice(0,120),request:u}],environments:[],warnings:[...a]}}(n,t);if(r.endsWith(".http")||r.endsWith(".rest"))return pw(n,t);let s=n.split(/\r?\n/).find(e=>e.trim()&&!/^\s*(#|\/\/)/.test(e))?.trim()??"";return/^[{[]/.test(s)?null:py.test(s)||/^@[\w.-]+\s*=/.test(s)||/^###/m.test(n)?/^HTTP(\/[\d.]+)?\s+(\d{3}|\*)\s*$/m.test(n)||/^\[(Asserts|Captures|QueryStringParams|FormParams|BasicAuth)\]\s*$/m.test(n)?p$(n,t):pw(n,t):null}(e,t);if(r)return r;let n=function(e,t){let r=e.replace(/^/,"").trim();if(!r)return null;if(r.startsWith("{")||r.startsWith("["))try{return JSON.parse(r)}catch(e){if(/\.json$/i.test(t))throw Error(`Not valid JSON: ${e instanceof Error?e.message:"parse error"}`)}try{return pm(r,{maxAliasCount:200})}catch(e){throw Error(`Not valid JSON or YAML: ${e instanceof Error?e.message.split("\n")[0]:"parse error"}`)}}(e,t);if(!n||"object"!=typeof n)throw Error("This file is empty or not JSON/YAML");let s=n.info;if("string"==typeof s?.schema&&/collection\/v2/.test(s.schema)||Array.isArray(n.item)&&s)return function(e){let t=pM((e.info??{}).name,"Imported collection").trim()||"Imported collection",r=[],n=new Set,s=e=>n.add(e),i=new Set,a=[],o=e=>o2([t,...e].map(e=>e.replace(/[\\/]/g," ")).join("/")),l=0,u=0,c=0,p=(e,t,r,n,i)=>{let u=o0(),c=pR(i,"prerequest").slice(0,1e5),p=pR(i,"test").slice(0,1e5);if((c||p)&&(u={...u,preScript:c,postScript:p},l++),t?.type&&"inherit"!==t.type){let e=pz({...le(),authMode:"inherit"},t,s,n);u={...u,auth:{authMode:e.authMode,oauth:e.oauth,oauth1:e.oauth1,aws:e.aws,jwt:e.jwt,domain:e.domain,token:e.token,username:e.username,password:e.password,apiName:e.apiName,apiValue:e.apiValue,apiIn:e.apiIn}}}let d=pj(r).map(e=>e).filter(e=>pM(e.key).trim()&&!e.disabled).map(e=>({key:pM(e.key).trim(),value:pM(e.value),secret:"secret"===e.type}));d.length&&(u={...u,variables:pF(d)});let h=pU(e.length?i.description:i.info?.description);h&&(u={...u,description:h}),o1(u)||a.push({path:o(e),settings:u})},d=(e,t)=>{for(let n of e){if(Array.isArray(n.item)){let e=[...t,pM(n.name,"Folder")];e.length>=6&&s(`${e.join(" › ")}: folders deeper than 6 levels were put in the folder above`),p(e,n.auth,n.variable,e.join(" › "),n),d(n.item,e);continue}if(r.length>=2e3)return void s("Only the first 2000 requests were imported");let e=pM(n.name,"Request"),a=[...t,e].join(" › "),h="string"==typeof n.request?{url:n.request}:n.request??{},f=pN(h.method);if(!f){s(`${a}: ${pM(h.method)} requests are not supported; skipped`);continue}let m=function(e){if("string"==typeof e)return e;let t=e??{};if("string"==typeof t.raw)return t.raw;let r=pM(t.protocol),n=Array.isArray(t.host)?t.host.map(e=>pM(e)).join("."):pM(t.host),s=Array.isArray(t.path)?t.path.map(e=>pM(e)).join("/"):pM(t.path),i=pj(t.query).filter(e=>!e.disabled).map(e=>`${pM(e.key)}=${pM(e.value)}`).join("&");return`${r?`${r}://`:""}${n}${s?`/${s}`:""}${i?`?${i}`:""}`}(h.url);for(let e of JSON.stringify(h).matchAll(/\{\{\s*(\$[A-Za-z]+)/g))pL.has(e[1].toLowerCase())||i.add(e[1]);let y=lc({...le(),method:f},m);!y.baseUrl&&m&&(y={...y,url:m}),y=pz({...y,authMode:"inherit"},h.auth,s,a);let g=pj(h.header).filter(e=>!e.disabled).map(e=>{let t=pU(e.description);return{key:pM(e.key),value:pM(e.value),...t?{description:t}:{}}}),b=new Map(pj(h.url?.query).flatMap(e=>{let t=pU(e.description);return t?[[pM(e.key),t]]:[]}));b.size&&(y={...y,params:y.params.map(e=>b.has(e.key)?{...e,description:b.get(e.key)}:e)});let v=pI(g,y,s,a);v=function(e,t,r,n,s){if(!t||t.disabled)return{draft:e,headers:r};let i=r.some(e=>/^content-type$/i.test(e.key));switch(t.mode){case"raw":{let n=pM(t.raw),s="json"===pM(t.options?.raw?.language)||r.some(e=>/^content-type$/i.test(e.key)&&/json/i.test(e.value))||/^\s*[{[]/.test(n);return{draft:{...e,bodyMode:s?"json":"text",bodyText:n},headers:r}}case"urlencoded":{let n=pj(t.urlencoded).filter(e=>!e.disabled).map(e=>`${encodeURIComponent(pM(e.key))}=${encodeURIComponent(pM(e.value))}`).join("&");return{draft:{...e,bodyMode:"text",bodyText:n},headers:i?r:[...r,{key:"Content-Type",value:"application/x-www-form-urlencoded"}]}}case"graphql":{let n=t.graphql??{},s="string"==typeof n.variables?n.variables:n.variables?JSON.stringify(n.variables,null,2):"";return{draft:{...e,bodyMode:"graphql",graphqlQuery:pM(n.query),graphqlVariables:s},headers:r.filter(e=>!/^content-type$/i.test(e.key))}}case"formdata":return{draft:pP(e,pj(t.formdata).filter(e=>!e.disabled).map(e=>"file"===e.type?pC(pM(e.key)):{key:pM(e.key),value:pM(e.value),kind:"text",file:null}),n,s),headers:r.filter(e=>!(/^content-type$/i.test(e.key)&&/multipart/i.test(e.value)))};case"file":return n(`${s}: the body is a file — choose it again in the Body tab (the file itself isn't in the export)`),{draft:{...e,bodyMode:"file",bodyFile:null},headers:r};default:return{draft:e,headers:r}}}(v.draft,h.body,v.headers,s,a);let w=pR(n,"prerequest").slice(0,1e5),k=pR(n,"test").slice(0,1e5);(w||k)&&l++;let x=function(e){let t=pj(e.response).map(e=>e).filter(e=>Number.isInteger(Number(e.code))),r=t.find(e=>Number(e.code)>=200&&300>Number(e.code))??t[0];if(!r)return{mock:null,count:0};let n=pj(r.header).flatMap(e=>{let{key:t,value:r,disabled:n}=e??{};return"string"==typeof t&&t.trim()&&!n?[[t,pM(r)]]:[]});return{mock:oR({status:Number(r.code),headers:n,body:pM(r.body),delayMs:0}),count:t.length}}(n);x.mock&&u++,x.count>1&&c++,r.push({collection:o(t),name:e,request:{...v.draft,headers:v.headers,preScript:w,postScript:k,mock:x.mock,description:pU(h.description??n.description)}})}};return p([],e.auth,e.variable,t,e),d(pj(e.item),[]),l&&s(`Pre-request or test scripts came along on ${l} request${1===l?"":"s"} or folder${1===l?"":"s"} — they run as in Postman (Scripts tab, and Folder settings → Scripts)`),u&&s(`Saved examples came along on ${u} request${1===u?"":"s"} as the Example tab (what the mock server answers)${c?`; ${c} had more than one, and only the first successful one was kept`:""}`),i.size&&s(`Postman dynamic values the app doesn't make: ${[...i].slice(0,8).map(e=>`{{${e}}}`).join(", ")} — they are sent as written`),{kind:"postman",title:t,requests:r,folders:a,environments:[],warnings:[...n]}}(n);if(Array.isArray(n.values)&&("environment"===n._postman_variable_scope||"string"==typeof n.name)){var i;let e;return{kind:"postman-environment",title:e=pM((i=n).name,"Imported environment").trim()||"Imported environment",requests:[],environments:[{name:e,variables:pF(pj(i.values).map(e=>e).filter(e=>pM(e.key).trim()&&!1!==e.enabled).map(e=>({key:pM(e.key).trim(),value:pM(e.value),secret:"secret"===e.type})))}],warnings:[]}}if(n.log&&"object"==typeof n.log&&Array.isArray(n.log.entries))return function(e,t){let r=e.log,n=t.replace(/\.har$/i,"").replace(/[_-]+/g," ").trim()||"Browser recording",s=[],i=new Set,a=e=>i.add(e),o=new Set,l=0,u=0;for(let e of pj(r.entries)){var c;let t=e.request??{},r=pM(t.url);if(!/^https?:\/\//i.test(r))continue;let i=pN(t.method);if(!i||"OPTIONS"===i)continue;let p=pM(e._resourceType),d=pM(e.response?.content?.mimeType);if(p&&!["xhr","fetch","document",""].includes(p)||pZ.test(r)||pJ.test(d)){l++;continue}let h=`${i} ${r}`;if(o.has(h))continue;if(o.add(h),s.length>=2e3){a("Only the first 2000 requests were imported");break}let f=new URL(r),m=`${i} ${f.pathname}`,y=lc({...le(),method:i},r),g=pj(t.headers).map(e=>({key:pM(e.name),value:pM(e.value)})).filter(e=>e.key&&!pH.test(e.key));g.some(e=>/^cookie$/i.test(e.key))&&u++;let b=pI(g.filter(e=>!/^cookie$/i.test(e.key)),y,a,m);y=b.draft;let v=t.postData;if(v&&("POST"===(c=i)||"PUT"===c||"PATCH"===c||"DELETE"===c)){let e=pM(v.mimeType),t=pM(v.text);if(/json/i.test(e))y={...y,bodyMode:"json",bodyText:t};else if(/multipart\/form-data/i.test(e)){let e=pj(v.params).map(e=>void 0!==e.fileName?pC(pM(e.name)):{key:pM(e.name),value:pM(e.value),kind:"text",file:null});e.length?y=pP(y,e,a,m):a(`${m}: the recording doesn't have the form's fields; the body was left out`)}else t&&(y={...y,bodyMode:"text",bodyText:t});!e||b.headers.some(e=>/^content-type$/i.test(e.key))||/multipart/i.test(e)||(b={...b,headers:[...b.headers,{key:"Content-Type",value:e.split(";")[0]}]})}s.push({collection:o2(`${n}/${f.host.replace(/:/g," ")}`),name:m.slice(0,120),request:{...y,headers:b.headers}})}if(!s.length)throw Error("No API calls found in this recording — record with DevTools open while you use the app, then Save all as HAR");return l&&a(`${l} page files (images, scripts, styles, fonts) were left out — only API calls are imported`),u&&a(`Cookies were left out of ${u} request${1===u?"":"s"} — send the login request first; the cookie jar keeps its session`),{kind:"har",title:n,requests:s,environments:[],warnings:[...i]}}(n,t);if("export"===n._type&&Array.isArray(n.resources)||"string"==typeof n.type&&n.type.startsWith("collection.insomnia.rest/"))return function(e){let t=new Set,r=e=>t.add(e),n=e=>pV(e,r,"Some values"),s="Insomnia collection",i=[],a=[];if("export"===e._type){let t=pj(e.resources).map(e=>e),r=t.find(e=>"workspace"===e._type);s=pM(r?.name,s)||s;let n=new Map;for(let e of t)"request_group"===e._type&&n.set(pM(e._id),{kind:"folder",name:pM(e.name,"Folder"),raw:e,children:[]}),"request"===e._type&&n.set(pM(e._id),{kind:"request",name:pM(e.name,"Request"),raw:e,children:[]});for(let e of t){let t=n.get(pM(e._id));if(!t)continue;let r=n.get(pM(e.parentId));r?r.children.push(t):i.push(t)}let o=t.find(e=>"environment"===e._type&&e.parentId===r?._id),l=t.filter(e=>"environment"===e._type&&o&&e.parentId===o._id),u=pW(o?.data);if(l.length)for(let e of l)a.push({name:pM(e.name,"Environment"),variables:pF([...u,...pW(e.data)])});else u.length&&a.push({name:`${s} (base)`,variables:u})}else{s=pM(e.name,s)||s;let t=e=>e.map(e=>Array.isArray(e.children)?{kind:"folder",name:pM(e.name,"Folder"),raw:e,children:t(e.children)}:{kind:"request",name:pM(e.name,"Request"),raw:e,children:[]});i=t(pj(e.collection));let r=e.environments;if(r){let e=pW(r.data),t=pj(r.subEnvironments).map(e=>e);if(t.length)for(let r of t)a.push({name:pM(r.name,"Environment"),variables:pF([...e,...pW(r.data)])});else e.length&&a.push({name:`${s} (base)`,variables:e})}}let o=[],l=[],u=o2(s),c=(e,t)=>{for(let s of e){if("folder"===s.kind){let e=[...t,s.name],i=o0();i={...i,auth:pG(i.auth,s.raw.authentication,r,e.join(" › "),n)};let a=pW(s.raw.environment);a.length&&(i={...i,variables:a}),pM(s.raw.description).trim()&&(i={...i,description:pM(s.raw.description).trim().slice(0,5e4)}),o1(i)||l.push({path:o2(`${u}/${e.map(e=>e.replace(/[\\/]/g," ")).join("/")}`),settings:i}),c(s.children,e);continue}if(o.length>=2e3)return void r("Only the first 2000 requests were imported");let e=s.raw,i=[...t,s.name].join(" › "),a=pN(e.method);if(!a){r(`${i}: ${pM(e.method)} requests are not supported; skipped`);continue}let p=lc({...le(),method:a},pV(pM(e.url),r,i)),d=pj(e.parameters).filter(e=>!e.disabled).map(e=>({key:pM(e.name),value:n(pM(e.value))})).filter(e=>e.key);d.length&&(p={...p,params:[...p.params,...d]}),p=pG(p,e.authentication,r,i,n);let h=pI(pj(e.headers).filter(e=>!e.disabled).map(e=>({key:pM(e.name),value:n(pM(e.value))})),p,r,i);p=h.draft;let f=e.body??{},m=pM(f.mimeType);if("application/graphql"===m)try{let e=JSON.parse(pM(f.text,"{}"));p={...p,bodyMode:"graphql",graphqlQuery:n(pM(e.query)),graphqlVariables:e.variables?JSON.stringify(e.variables,null,2):""}}catch{r(`${i}: the GraphQL body could not be read`)}else if(/json/i.test(m))p={...p,bodyMode:"json",bodyText:n(pM(f.text))};else if("application/x-www-form-urlencoded"===m){let e=pj(f.params).filter(e=>!e.disabled).map(e=>`${encodeURIComponent(pM(e.name))}=${encodeURIComponent(n(pM(e.value)))}`).join("&");p={...p,bodyMode:"text",bodyText:e}}else"multipart/form-data"===m?p=pP(p,pj(f.params).filter(e=>!e.disabled).map(e=>"file"===e.type?pC(pM(e.name)):{key:pM(e.name),value:n(pM(e.value)),kind:"text",file:null}),r,i):pM(f.text)&&(p={...p,bodyMode:"text",bodyText:n(pM(f.text))});let y=!m||/graphql|multipart/.test(m)||h.headers.some(e=>/^content-type$/i.test(e.key))?h.headers:[...h.headers,{key:"Content-Type",value:m}];o.push({collection:o2(`${u}/${t.map(e=>e.replace(/[\\/]/g," ")).join("/")}`),name:s.name.slice(0,120),request:{...p,headers:"graphql"===p.bodyMode?h.headers:y,description:pM(e.description).trim().slice(0,5e4)}})}};if(c(i,[]),!o.length)throw Error("No requests found in this Insomnia file");return{kind:"insomnia",title:s,requests:o,folders:l,environments:a,warnings:[...t]}}(n);if("string"==typeof n.openapi&&n.openapi.startsWith("3"))return pK(n,"openapi");if("2.0"===n.swagger)return pK(n,"swagger");if(Array.isArray(n.items)&&"string"==typeof n.name&&(void 0!==n.brunoConfig||"1"===n.version)&&pT(n.items).every(e=>"http"===e.type||"graphql"===e.type||"folder"===e.type||"http-request"===e.type||"graphql-request"===e.type))return function(e){let t=pA(e.name).trim()||"Bruno collection",r=new Set,n=e=>r.add(e),s=[],i=(e,r)=>{for(let a of e){if(s.length>=2e3)return;if("folder"===a.type){i(pT(a.items),[...r,pA(a.name).replace(/[\\/]/g," ")]);continue}let e=a.request??{},o=e.body??{},l=e.auth??{},u=pA(l.mode),c=l[u]??{},p=e.script??{},d={name:pA(a.name)||"Request",method:pA(e.method)||"GET",url:pA(e.url),headers:pT(e.headers).map(e=>({name:pA(e.name),value:pA(e.value),enabled:!1!==e.enabled})),params:pT(e.params).filter(e=>"query"===pA(e.type||"query")).map(e=>({name:pA(e.name),value:pA(e.value),enabled:!1!==e.enabled})),bodyMode:pA(o.mode)||"none",body:{json:pA(o.json),text:pA(o.text),xml:pA(o.xml),graphql:{query:pA(o.graphql?.query),variables:pA(o.graphql?.variables)},form:pT(o.formUrlEncoded).filter(e=>!1!==e.enabled).map(e=>({key:pA(e.name),value:pA(e.value)})),multipart:pT(o.multipartForm).filter(e=>!1!==e.enabled).map(e=>({key:pA(e.name),value:Array.isArray(e.value)?"":pA(e.value),file:"file"===e.type}))},auth:{mode:u,token:pA(c.token),username:pA(c.username),password:pA(c.password),key:pA(c.key),value:pA(c.value),placement:pA(c.placement)},assertions:pT(e.assertions).map(e=>({name:pA(e.name),value:pA(e.value),enabled:!1!==e.enabled})),scripts:!!(pA(p.req).trim()||pA(p.res).trim()),tests:!!pA(e.tests).trim(),docs:pA(e.docs)};s.push({collection:o2([t,...r].join("/")),name:d.name.slice(0,120),request:p_(d,n)})}};if(i(pT(e.items),[]),!s.length)throw Error("This Bruno collection has no requests");let a=pT(e.environments).map(e=>({name:pA(e.name)||"Bruno",variables:pT(e.variables).filter(e=>!1!==e.enabled&&pA(e.name)).map(e=>({key:pA(e.name),value:e.secret?"":pA(e.value),secret:!!e.secret}))}));return pT(e.environments).some(e=>pT(e.variables).some(e=>e.secret))&&n("Secret environment values aren't in Bruno's export — fill them in under Environments"),{kind:"bruno",title:t,requests:s,environments:a,warnings:[...r]}}(n);if(n.format===lb&&Array.isArray(n.requests))return function(e){let t="string"==typeof e.name&&e.name.trim()||"Imported collection",r=[],n=new Map;for(let t of e.requests)"string"==typeof t?.ref&&"string"==typeof t.name&&n.set(t.ref,t.name);let s=[];for(let[i,a]of e.requests.entries()){if(!a||"string"!=typeof a.name||!a.request||"object"!=typeof a.request){r.push(`Request ${i+1} isn't a request — skipped`);continue}let e=la({...le(),...a.request,before:null}),o=a.runFirst&&n.has(a.runFirst.ref)?{ref:a.runFirst.ref,requestName:n.get(a.runFirst.ref),extract:Array.isArray(a.runFirst.extract)?a.runFirst.extract:[]}:void 0;a.runFirst&&!o&&r.push(`${a.name}: runs first "${a.runFirst.ref}", which isn't in the file`);let l="string"==typeof a.folder&&a.folder.trim()?`/${a.folder.trim()}`:"";s.push({collection:o2(`${t}${l}`),name:a.name.slice(0,120),request:e,...a.ref?{ref:a.ref}:{},...o?{runFirst:o}:{}})}let i=(e.variables??[]).filter(e=>"string"==typeof e?.key&&e.key.trim()).map(e=>({key:e.key,value:String(e.value??""),secret:!!e.secret}));return{kind:"apitestcenter",title:t,requests:s,environments:i.length?[{name:t,variables:i}]:[],warnings:r}}(n);if("string"==typeof n.openapi)throw Error(`OpenAPI ${n.openapi} is not supported yet — use 3.x or Swagger 2.0`);throw Error("Not a Postman collection or environment, an Insomnia export, a HAR recording, an OpenAPI/Swagger file, a Bruno collection, or an .http / Hurl file")}function pE(e){if(1===e.length)return pO(e[0].text,e[0].name);let t=[],r=[],n="";for(let s of e){if(/(^|[\\/])bruno\.json$/i.test(s.name)){try{let e=JSON.parse(s.text).name;"string"==typeof e&&e.trim()&&(n=e.trim().slice(0,60))}catch{}continue}try{t.push(pO(s.text,s.name))}catch(e){r.push(`${s.name}: ${e instanceof Error?e.message:"could not be read"}`)}}if(!t.length)throw Error(r.join("; ")||"No files");let s=new Set(t.map(e=>e.kind)),i=1===s.size&&s.has("bruno")?n||"Bruno":t[0].title;return{kind:1===s.size?t[0].kind:"several",title:i,requests:t.flatMap(e=>e.requests).slice(0,2e3),folders:t.flatMap(e=>e.folders??[]),environments:t.flatMap(e=>e.environments),warnings:[...r,...t.flatMap(e=>e.warnings)]}}let pM=(e,t="")=>"string"==typeof e?e:"number"==typeof e||"boolean"==typeof e?String(e):t,pj=e=>Array.isArray(e)?e:[],pN=e=>{let t=pM(e,"GET").toUpperCase();return o5.includes(t)?t:null};function pI(e,t,r,n){let s=[],i=t;for(let t of e){let e=t.key.trim();if(/^authorization$/i.test(e)){let e=/^bearer\s+(.+)$/i.exec(t.value.trim()),s=/^basic\s+(.+)$/i.exec(t.value.trim()),a="none"===i.authMode||"inherit"===i.authMode;if(e&&a)i={...i,authMode:"bearer",token:e[1]};else if(s&&a)try{let[e,...t]=atob(s[1]).split(":");i={...i,authMode:"basic",username:e??"",password:t.join(":")}}catch{r(`${n}: an Authorization header could not be read; set Auth by hand`)}else a&&r(`${n}: an Authorization header was dropped; set Auth by hand`);continue}if(/^cookie$/i.test(e)){r(`${n}: a Cookie header was left out — send the login request first; the cookie jar keeps its session`);continue}e&&s.push({key:e,value:t.value,...t.description?{description:t.description}:{}})}return{draft:i,headers:s}}function pq(e,t,r){let n=e[t],s=e=>"boolean"==typeof e||"number"==typeof e?String(e):pM(e);return Array.isArray(n)?s(n.find(e=>e.key===r)?.value):n&&"object"==typeof n?s(n[r]):""}function pz(e,t,r,n){if(!t||!t.type||"inherit"===t.type)return e;if("noauth"===t.type)return{...e,authMode:"none"};if("bearer"===t.type)return{...e,authMode:"bearer",token:pq(t,"bearer","token")};if("basic"===t.type)return{...e,authMode:"basic",username:pq(t,"basic","username"),password:pq(t,"basic","password")};if("apikey"===t.type)return{...e,authMode:"api_key",apiName:pq(t,"apikey","key")||"X-API-Key",apiValue:pq(t,"apikey","value"),apiIn:"query"===pq(t,"apikey","in")?"query":"header"};if("digest"===t.type)return{...e,authMode:"digest",username:pq(t,t.type,"username"),password:pq(t,t.type,"password")};if("ntlm"===t.type)return{...e,authMode:"ntlm",username:pq(t,t.type,"username"),password:pq(t,t.type,"password"),domain:pq(t,t.type,"domain")};if("awsv4"===t.type)return{...e,authMode:"aws_sigv4",aws:{accessKeyId:pq(t,t.type,"accessKey"),secretAccessKey:pq(t,t.type,"secretKey"),sessionToken:pq(t,t.type,"sessionToken"),region:pq(t,t.type,"region")||"us-east-1",service:pq(t,t.type,"service")||"execute-api"}};if("oauth1"===t.type){let r=pq(t,t.type,"signatureMethod").toUpperCase();return{...e,authMode:"oauth1",oauth1:{consumerKey:pq(t,t.type,"consumerKey"),consumerSecret:pq(t,t.type,"consumerSecret"),token:pq(t,t.type,"token"),tokenSecret:pq(t,t.type,"tokenSecret"),signatureMethod:"HMAC-SHA1"===r||"PLAINTEXT"===r?r:"HMAC-SHA256",realm:pq(t,t.type,"realm"),addTo:"false"===pq(t,t.type,"addParamsToHeader")?"query":"header"}}}if("jwt"===t.type){let r=pq(t,t.type,"algorithm").toUpperCase(),n=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","ES256","ES384","ES512"].includes(r)?r:"HS256";return{...e,authMode:"jwt",jwt:{...e.jwt,algorithm:n,secret:pq(t,t.type,"secret"),privateKey:pq(t,t.type,"privateKey"),payload:pq(t,t.type,"payload")||e.jwt.payload,prefix:pq(t,t.type,"headerPrefix")||"Bearer"}}}return r("oauth2"===t.type?`${n}: OAuth 2.0 settings were not imported — set the token URL and client under Auth → OAuth 2.0`:`${n}: ${t.type} auth is not supported yet; set Auth by hand`),e}function pC(e){return{key:e,value:"",kind:"file",file:null}}function pP(e,t,r,n){let s=t.filter(e=>"file"===e.kind).length;return s&&r(`${n}: choose the file${1===s?"":"s"} for the form again in the Body tab (files aren't in the export)`),{...e,bodyMode:"multipart",formRows:t}}function pR(e,t){return pj(e.event).map(e=>e).filter(e=>e.listen===t&&!e.disabled).map(e=>{let t=(e.script??{}).exec;return Array.isArray(t)?t.map(e=>pM(e)).join("\n"):pM(t)}).filter(e=>e.trim()).join("\n")}let pL=new Set(["$guid","$uuid","$randomuuid","$timestamp","$isotimestamp","$randomint","$randomemail","$randomfirstname","$randomlastname","$randomfullname","$randomboolean","$randomalphanumeric"]);function pU(e){return("string"==typeof e?e:e&&"object"==typeof e?pM(e.content):"").trim().slice(0,5e4)}function pF(e){let t=new Map;for(let r of e)/^[A-Za-z_][\w.-]*$/.test(r.key)&&t.set(r.key,r);return[...t.values()]}function pD(e,t,r=0){let n=t;for(let t=0;n&&"string"==typeof n.$ref&&t<20;t++){let t=n.$ref;if(!t.startsWith("#/"))return{};n=t.slice(2).split("/").map(e=>e.replace(/~1/g,"/").replace(/~0/g,"~")).reduce((e,t)=>e&&"object"==typeof e?e[t]:void 0,e)}return r>40?{}:n??{}}function pB(e,t,r=0,n=new Set){let s=pD(e,t);if(r>6||n.has(s))return null;if("example"in s)return s.example;if(Array.isArray(s.examples)&&s.examples.length)return s.examples[0];if("default"in s)return s.default;if(Array.isArray(s.enum)&&s.enum.length)return s.enum[0];let i=new Set(n).add(s),a=pj(s.allOf);if(a.length)return Object.assign({},...a.map(t=>pB(e,t,r+1,i)).filter(e=>e&&"object"==typeof e));let o=pj(s.oneOf).concat(pj(s.anyOf));if(o.length)return pB(e,o[0],r+1,i);let l=Array.isArray(s.type)?s.type.find(e=>"null"!==e):s.type;if("object"===l||s.properties){let t={};for(let[n,a]of Object.entries(s.properties??{}))t[n]=pB(e,a,r+1,i);return t}if("array"===l)return[pB(e,s.items,r+1,i)];if("integer"===l||"number"===l)return 0;if("boolean"===l)return!1;if("string"===l){let e=pM(s.format);return"date-time"===e?"2026-01-01T00:00:00Z":"date"===e?"2026-01-01":"email"===e?"user@example.com":"uuid"===e?"00000000-0000-0000-0000-000000000000":"string"}return null}function pK(e,t){let r=e.info??{},n=pM(r.title,"Imported API").trim()||"Imported API",s=new Set,i=e=>s.add(e),a=[],o=0,l=new Map,u=(e,t="",r=!1)=>{/^[A-Za-z_][\w.-]*$/.test(e)&&!l.has(e)&&l.set(e,{key:e,value:t,secret:r})},c=function(e,t){if("swagger"===t){let t=pM(e.host);if(!t)return null;let r=pj(e.schemes).includes("https")||!pj(e.schemes).length?"https":pM(pj(e.schemes)[0]);return`${r}://${t}${pM(e.basePath).replace(/\/$/,"")}`}let r=pj(e.servers)[0];if(!r)return null;let n=pM(r.url);for(let[e,t]of Object.entries(r.variables??{}))n=n.replace(`{${e}}`,pM(t.default));return n.replace(/\/$/,"")}(e,t);c&&/^https?:\/\//i.test(c)?u("baseUrl",c):(u("baseUrl","https://api.example.com"),i(c?`The server URL “${c}” is relative — set baseUrl in the “${n}” environment`:`No server URL in the file — set baseUrl in the “${n}” environment`));let p="swagger"===t?e.securityDefinitions:(e.components??{}).securitySchemes,d=(t,r)=>{let n=pj(t)[0],s=n?Object.keys(n)[0]:void 0,a=s?pD(e,p?.[s]):void 0;if(!a)return r;let o=pM(a.type),l=pM(a.scheme).toLowerCase();return"http"===o&&"bearer"===l||"oauth2"===o||"openIdConnect"===o?(u("token","",!0),"http"!==o&&i(`${o} sign-in is set up as a Bearer token — paste a token into {{token}}, or use Run first to fetch one`),{...r,authMode:"bearer",token:"{{token}}"}):"http"===o&&"basic"===l||"basic"===o?(u("username"),u("password","",!0),{...r,authMode:"basic",username:"{{username}}",password:"{{password}}"}):"apiKey"===o?"cookie"===a.in?(i("Cookie API keys are not supported; set Auth by hand"),r):(u("apiKey","",!0),{...r,authMode:"api_key",apiName:pM(a.name,"X-API-Key"),apiValue:"{{apiKey}}",apiIn:"query"===a.in?"query":"header"}):r};for(let[r,s]of Object.entries(e.paths??{})){let l=pD(e,s),c=pj(l.parameters);for(let[s,p]of Object.entries(l)){let l,h,f=pN(s);if(!f||"parameters"===s||"object"!=typeof p)continue;if(a.length>=2e3){i("Only the first 2000 operations were imported");break}let m=pM(pj(p.tags)[0]),y=pM(p.summary).trim()||pM(p.operationId).trim()||`${f} ${r}`,g=m?`${m} › ${y}`:y,b=[...c,...pj(p.parameters)].map(t=>pD(e,t)),v=r.replace(/\{([^}]+)\}/g,(t,r)=>{let n=r.replace(/[^\w.-]/g,"_"),s=b.find(e=>"path"===e.in&&e.name===r);return u(n,pM(s?.example??pD(e,s?.schema).example??"")),`{{${n}}}`}),w=b.filter(e=>"query"===e.in&&(e.required||"example"in e)).map(t=>({key:pM(t.name),value:pM(t.example??pB(e,t.schema)??""),...pM(t.description).trim()?{description:pM(t.description).trim()}:{}})),k=lc({...le(),method:f},`{{baseUrl}}${v}`);k={...k,url:`{{baseUrl}}${v}${w.length?`?${w.map(e=>`${e.key}=${e.value}`).join("&")}`:""}`,params:w};let x=pI(b.filter(e=>"header"===e.in).map(e=>({key:pM(e.name),value:pM(e.example??""),...pM(e.description).trim()?{description:pM(e.description).trim()}:{}})),k=d(p.security??e.security,k),i,g);k={...x.draft,headers:x.headers};let $=!0,S=!1;if("openapi"===t&&p.requestBody){let t=pD(e,p.requestBody).content??{},r=Object.keys(t).find(e=>/json/i.test(e))??Object.keys(t)[0];if(r){let n=t[r];if($=/json/i.test(r),l=n.schema,h=n.example??Object.values(n.examples??{})[0]?.value,!/json/i.test(r)){if(/x-www-form-urlencoded/i.test(r)&&!k.headers.some(e=>/^content-type$/i.test(e.key)))k={...k,headers:[...k.headers,{key:"Content-Type",value:r}]};else if(/multipart/i.test(r)){let t=Object.entries(pD(e,n.schema)?.properties??{}).map(([t,r])=>{let n=pD(e,r);return"binary"===n.format||"base64"===n.format||"array"===n.type&&pD(e,n.items)?.format==="binary"?pC(t):{key:t,value:void 0!==n.example?pM(n.example,JSON.stringify(n.example)):"",kind:"text",file:null}});k={...k,bodyMode:"multipart",formRows:t},S=!0}}}}else if("swagger"===t){let e=b.find(e=>"body"===e.in);e&&(l=e.schema)}if(!S&&(l||void 0!==h)&&"GET"!==f&&"HEAD"!==f){let t=h??pB(e,l);k=$?{...k,bodyMode:"json",bodyText:JSON.stringify(t??{},null,2)}:{...k,bodyMode:"text",bodyText:"object"==typeof t&&t?new URLSearchParams(Object.entries(t).map(([e,t])=>[e,pM(t)])).toString():pM(t)}}let _=Object.keys(p.responses??{}).find(e=>/^2\d\d$/.test(e)),A=[{type:"status",expect:_??"2xx"}],T=null;if(_){let r=pD(e,(p.responses??{})[_]),n=r.content??{},s=Object.keys(n).find(e=>/json/i.test(e)),i="swagger"===t?r.schema:s?n[s].schema:void 0,a=function(e,t,r){if(!t||"object"!=typeof t)return null;let n=new Map,s=(t,r)=>{if(!(r>60)&&t&&"object"==typeof t){if(Array.isArray(t))return t.forEach(e=>s(e,r+1));if("string"==typeof t.$ref&&t.$ref.startsWith("#/")&&!n.has(t.$ref)){let i=pD(e,{$ref:t.$ref});n.set(t.$ref,i),s(i,r+1)}for(let[e,n]of Object.entries(t))"$ref"!==e&&"example"!==e&&"examples"!==e&&s(n,r+1)}};s(t,0);let i=pD(e,t);if(!["type","properties","items","allOf","anyOf","oneOf","enum","required"].some(e=>e in i)||n.size>200)return null;let a={title:r,...t};for(let[e,t]of n){let r=e.slice(2).split("/").map(e=>e.replace(/~1/g,"/").replace(/~0/g,"~")),n=a;for(let e of r.slice(0,-1))n=n[e]??={};n[r[r.length-1]]=t}let o=JSON.stringify(a);return o.length<=2e5?o:null}(e,i,`${y} (${_})`);a&&(A.push({type:"schema",schema:a}),o++);let l=s?n[s]:void 0,u="swagger"===t?(r.examples??{})["application/json"]:l?.example??Object.values(l?.examples??{})[0]?.value,c=void 0!==u?u:i?pB(e,i):void 0;void 0!==c?T={status:Number(_),headers:[["Content-Type","application/json"]],body:JSON.stringify(c,null,2),delayMs:0}:"204"!==_&&Object.keys(n).length||(T={status:Number(_),headers:[],body:"",delayMs:0})}let O=[pM(p.summary).trim()&&pM(p.summary).trim()!==y?pM(p.summary).trim():"",pM(p.description).trim()].filter(Boolean).join("\n\n");a.push({collection:n,name:g,request:{...k,checks:A,mock:T,description:O.slice(0,5e4)}})}}a.length||i("The file has no operations under “paths”"),o&&i(`${o} request${1===o?" checks its answer":"s check their answers"} against the response schema in the file (Checks tab) — remove a check where the API differs from its documentation`);let h=pM(r.description).trim(),f=h?[{path:o2(n),settings:{...o0(),description:h.slice(0,5e4)}}]:[];return{kind:t,title:n,requests:a,folders:f,environments:[{name:n,variables:[...l.values()]}],warnings:[...s]}}let pZ=/\.(png|jpe?g|gif|svg|webp|avif|ico|bmp|css|js|mjs|map|woff2?|ttf|otf|eot|mp4|webm|mp3|wav|pdf)(\?|$)/i,pJ=/^(image|font|audio|video)\/|^text\/(css|javascript)|javascript/i,pH=/^(:|host$|content-length$|connection$|accept-encoding$|accept-language$|user-agent$|origin$|referer$|priority$|upgrade-insecure-requests$|cache-control$|pragma$|dnt$|sec-|te$)/i;function pV(e,t,r){return/\{%/.test(e)&&t(`${r}: Insomnia template tags ({% … %}) were kept as text — replace them with {{variables}} or Run first`),e.replace(/\{\{\s*_\.([\w.-]+)\s*\}\}/g,"{{$1}}")}function pW(e,t=""){if(!e||"object"!=typeof e||Array.isArray(e))return[];let r=[];for(let[n,s]of Object.entries(e)){let e=t?`${t}.${n}`:n;s&&"object"==typeof s&&!Array.isArray(s)?r.push(...pW(s,e)):/^[A-Za-z_][\w.-]*$/.test(e)&&r.push({key:e,value:"string"==typeof s?s:JSON.stringify(s),secret:!1})}return r}function pG(e,t,r,n,s){if(!t||!t.type||"none"===t.type||t.disabled)return t?.type==="none"?{...e,authMode:"none"}:e;let i=e=>s(pM(t[e]));switch(t.type){case"bearer":return{...e,authMode:"bearer",token:i("token")};case"basic":return{...e,authMode:"basic",username:i("username"),password:i("password")};case"digest":return{...e,authMode:"digest",username:i("username"),password:i("password")};case"ntlm":return{...e,authMode:"ntlm",username:i("username"),password:i("password")};case"apikey":return{...e,authMode:"api_key",apiName:i("key")||"X-API-Key",apiValue:i("value"),apiIn:"queryParams"===pM(t.addTo)?"query":"header"};case"iam":return{...e,authMode:"aws_sigv4",aws:{accessKeyId:i("accessKeyId"),secretAccessKey:i("secretAccessKey"),sessionToken:i("sessionToken"),region:i("region")||"us-east-1",service:i("service")||"execute-api"}};case"oauth1":{let s=pM(t.signatureMethod).toUpperCase();return s.startsWith("RSA")&&r(`${n}: OAuth 1.0 with ${s} isn't supported; set the signature method by hand`),{...e,authMode:"oauth1",oauth1:{consumerKey:i("consumerKey"),consumerSecret:i("consumerSecret"),token:i("tokenKey"),tokenSecret:i("tokenSecret"),signatureMethod:"HMAC-SHA1"===s||"PLAINTEXT"===s?s:"HMAC-SHA256",realm:i("realm"),addTo:"header"}}}case"oauth2":{let s=pM(t.grantType);return"implicit"===s&&r(`${n}: the OAuth 2.0 implicit grant is outdated and not supported — it was set to client credentials`),{...e,authMode:"oauth2",oauth:{...oZ(),grant:"password"===s||"authorization_code"===s?s:"client_credentials",tokenUrl:i("accessTokenUrl"),authUrl:i("authorizationUrl"),clientId:i("clientId"),clientSecret:i("clientSecret"),scope:i("scope"),username:i("username"),password:i("password"),redirectUri:i("redirectUrl")||oZ().redirectUri,pkce:!1!==t.usePkce}}}default:return r(`${n}: ${t.type} auth is not supported yet; set Auth by hand`),e}}let pX=[1,2,3,5,7.5,10,15,20,30,50,75,100,150,200,300,500,750,1e3,1500,2e3,3e3,5e3,1e4,1/0];function pY(e){let t=pX[e]??1/0,r=0===e?0:pX[e-1],n=e=>e>=1e3?`${e/1e3}s`:`${e}ms`;return 1/0===t?`> ${n(r)}`:`${n(r)}–${n(t)}`}function pQ(e){let t=Array(pX.length).fill(0),r=!1;for(let n of e)if(n){r=!0;for(let e=0;e<t.length;e++)t[e]+=n[e]??0}return r?t:null}function p0(e,t){let r=0,n=0,s=0;for(let i=0;i<e.length;i++){let a=e[i]??0;r+=a;let o=pX[i]??1/0;o<=t?n+=a:o<=4*t&&(s+=a)}return r?(n+s/2)/r:null}function p1(e){let t=Number(e);switch(t){case 0:return"no answer at all — a timeout, a refused connection, or a network problem";case 400:return"bad request — the API did not accept what was sent";case 401:return"not signed in — the token or password is missing or expired";case 403:return"forbidden — refused on purpose, often by a firewall that blocks heavy traffic";case 404:return"not found — the address is wrong";case 408:return"the server gave up waiting for the request";case 409:return"conflict — the request clashed with the current state of the data";case 413:return"the request body is too large";case 422:return"the API understood the request but rejected its content";case 429:return"too many requests — the server or its firewall is limiting how fast you can call it";case 500:return"server error — the API itself crashed or hit a bug";case 502:return"bad gateway — a proxy in front of the API could not reach it";case 503:return"unavailable — the API is overloaded or down";case 504:return"gateway timeout — a proxy in front of the API waited too long"}return t>=500?"server error":t>=400?"the request was refused":"unexpected response"}e.s(["M",0,pX,"G",0,p0,"B",0,pY,"p",0,pQ],47253);let p2=new Set(["429","403"]);function p5(e){let t=e.summary,r=t.http.failed.rate,n=Object.entries(t.http.status).filter(([e])=>"0"===e||Number(e)>=400),s=n.reduce((e,[,t])=>e+t,0),i=[...n].sort((e,t)=>t[1]-e[1])[0],a=i&&s?{code:i[0],count:i[1],share:i[1]/s,meaning:p1(i[0])}:null,o=n.filter(([e])=>p2.has(e)).reduce((e,[,t])=>e+t,0),l=e.buckets.filter(e=>e.rps>0||e.vus>0),u=function(e){for(let t=0;t<e.length;t++){let r=e.slice(t,t+3).filter(e=>e.rps>0);if(r.length&&r.every(e=>e.failedRate>=.5))return t}return -1}(l),c=u>=0?l[u]:null,p=c?{elapsedS:c.elapsedS,vus:Math.round(c.vus),rps:Math.round(c.rps)}:null,d=null;if(c){let e=Math.max(...l.slice(u).map(e=>e.vus)),t=l.findIndex((t,r)=>r>=u&&t.vus===e),r=l.slice(t+1).filter(e=>e.rps>0&&e.vus<=Math.max(1,.6*c.vus));if(r.length>=3){let e=r.slice(Math.floor(r.length/3));d=e.reduce((e,t)=>e+t.failedRate,0)/e.length<.1}}let h=c?l.slice(0,u).filter(e=>e.rps>0&&e.failedRate<.5):[],f=h.length?{vus:Math.round(Math.max(...h.map(e=>e.vus))),rps:Math.round(Math.max(...h.map(e=>e.rps)))}:null,m=null;if(t.latencyOkMs&&t.latencyOkMs.p95>0)m=t.latencyOkMs.p95;else{let e=pQ((c?h:l.filter(e=>e.failedRate<.5)).map(e=>e.hist));m=e?function(e){let t=e.reduce((e,t)=>e+t,0);if(!t)return null;let r=0;for(let n=0;n<e.length;n++)if((r+=e[n])/t>=.95){let e=pX[n];return Number.isFinite(e)?e:pX[pX.length-2]}return null}(e):null}return{failedRate:r,dominant:a,blocked:s>0&&o/s>=.5,timingsUnreliable:r>=.5,onset:p,recovered:d,lastHealthy:f,healthyP95Ms:m}}e.s(["R",0,p2,"F",0,p5,"Q",0,function(e){let t=function(e){let t=e.buckets.filter(e=>e.rps>0);if(t.length<2)return null;let r=t.map(e=>e.rps).sort((e,t)=>e-t),n=e=>Math.round(100*e)/100,s=e.summary.http.rps.avg||r.reduce((e,t)=>e+t,0)/e.buckets.length,i=e.buckets.filter(e=>e.vus>0);return{rps:{min:n(r[0]),max:n(r[r.length-1]),avg:n(s),p95:n(r[Math.min(r.length-1,Math.max(0,Math.ceil(.95*r.length)-1))])},vusAvg:i.length?n(i.reduce((e,t)=>e+t.vus,0)/i.length):e.summary.vus.avg}}(e);if(!t)return e;let{rps:r}=e.summary.http,n=r.min===r.max,s=e.summary.vus.avg<t.vusAvg/2;return n||s?{...e,summary:{...e.summary,http:{...e.summary.http,rps:n?t.rps:r},vus:{...e.summary.vus,avg:s?t.vusAvg:e.summary.vus.avg}}}:e},"j",0,p1],48191);let p9={errorWarn:.01,errorFail:.05,p95WarnMs:500,p95FailMs:2e3,stabilityWarn:1.5,stabilityFail:2.5};function p6(e){return e&&e.p95Ms>0&&e.errorRate>=0?{errorWarn:.5*e.errorRate,errorFail:e.errorRate,p95WarnMs:.8*e.p95Ms,p95FailMs:e.p95Ms,owned:!0}:{...p9,owned:!1}}function p4(e,t,r){let{buckets:n}=e;if(0===n.length)return 0;let s=Math.floor(n.length*t),i=Math.max(s+1,Math.ceil(n.length*r)),a=n.slice(s,i).map(e=>e.p95Ms).filter(e=>e>0);return 0===a.length?0:a.reduce((e,t)=>e+t,0)/a.length}function p3(e){let t,r=e.summary.http.status;return{failedRate:e.summary.http.failed.rate,p95:e.summary.latencyMs.p95,requests:e.summary.http.requests,bucketCount:e.buckets.length,earlyP95:p4(e,0,.33),lateP95:p4(e,.66,1),status5xx:Object.entries(r).filter(([e])=>Number(e)>=500).reduce((e,[,t])=>e+t,0),status0:r["0"]??0,checksPassed:e.summary.checks.reduce((e,t)=>e+t.passes,0),checksFailed:e.summary.checks.reduce((e,t)=>e+t.fails,0),dropped:e.summary.droppedIterations??0,topFailure:(t=Object.entries(r).filter(([e])=>"0"===e||Number(e)>=400).sort((e,t)=>t[1]-e[1])[0])?{code:t[0],count:t[1]}:null,blockedCount:Object.entries(r).filter(([e])=>p2.has(e)).reduce((e,[,t])=>e+t,0),status503:r["503"]??0,okP95:e.summary.latencyOkMs?.p95||null}}function p8(e,t={}){return p7(p3(e),t)}function p7(e,t={}){var r;let{failedRate:n,p95:s,requests:i,status5xx:a,status0:o}=e,l=p6(t.slo),u=l.owned?`your target: fail ≥ ${(100*l.errorFail).toFixed(l.errorFail<.01?2:1)}%`:"default: fail ≥ 5%",c=l.owned?`your target: warn ≥ ${(100*l.errorWarn).toFixed(l.errorWarn<.01?2:1)}%`:"default: warn ≥ 1%",p=Math.round(n*i),d=n>=l.errorFail&&(e.blockedCount??0)>=.5*p&&p>0,h=i>0&&n>=.5,f=e.topFailure,m=f&&p?` Mostly ${"0"===f.code?"no answer":f.code}: ${p1(f.code)}.`:"",y=l.owned?`your target: fail ≥ ${Math.round(l.p95FailMs)} ms`:"default: fail ≥ 2 s",g=l.owned?`your target: warn ≥ ${Math.round(l.p95WarnMs)} ms`:"default: warn ≥ 500 ms",b=0===i?{id:"errors",title:"Errors",level:"fail",summary:"No HTTP requests completed. The target may be unreachable, hanging, or blocked."}:n>=l.errorFail?{id:"errors",title:"Errors",level:"fail",summary:`${(100*n).toFixed(1)}% of requests failed (${u}).${m||" Clients would see this as broken."}`}:n>=l.errorWarn?{id:"errors",title:"Errors",level:"warn",summary:`${(100*n).toFixed(1)}% failed (${c}).${m||" Fine for a spike test; noisy for a smoke test."}`}:{id:"errors",title:"Errors",level:"pass",summary:`${(100*n).toFixed(2)}% failed. Under this load the API mostly answered.`},v=(()=>{if(h){let t=e.okP95;return{id:"latency",title:"Latency",level:null!=t&&t>=l.p95FailMs?"fail":"warn",summary:`Not meaningful here: ${(100*n).toFixed(0)}% of responses were errors, and errors come back fast.${null!=t?` Successful requests alone: p95 ${Math.round(t)} ms.`:""}`}}return s<=0&&0===i?{id:"latency",title:"Latency",level:"fail",summary:"No latency samples. Nothing to judge."}:s>=l.p95FailMs?{id:"latency",title:"Latency",level:"fail",summary:`p95 is ${Math.round(s)} ms (${y}). Most users would feel this as stuck.`}:s>=l.p95WarnMs?{id:"latency",title:"Latency",level:"warn",summary:`p95 is ${Math.round(s)} ms (${g}). OK for a heavy report API; slow for a ping/health check.`}:{id:"latency",title:"Latency",level:"pass",summary:`p95 is ${Math.round(s)} ms. 95% of calls were faster than that under this load.`}})(),w=e.earlyP95,k=e.lateP95,x=w>0?k/w:1,$=k-w>=Math.max(20,.1*l.p95WarnMs),S=h?{id:"stability",title:"Stability",level:"warn",summary:"Not judged: most responses were errors, so changes in response time describe the errors, not the API."}:e.bucketCount<6?{id:"stability",title:"Stability",level:"warn",summary:"Run was too short to judge whether latency stayed flat. Use Average (minutes) for a stability read."}:$&&x>=p9.stabilityFail?{id:"stability",title:"Stability",level:"fail",summary:`p95 grew ~${x.toFixed(1)}\xd7 from the first third to the last third. The API (or the generator) degraded as the test went on.`}:$&&x>=p9.stabilityWarn?{id:"stability",title:"Stability",level:"warn",summary:`p95 rose ~${x.toFixed(1)}\xd7 later in the run. Watch for warm-up, lock contention, or GC.`}:{id:"stability",title:"Stability",level:"pass",summary:"Latency did not blow up over time in this run. That is a healthy pattern."},_=e.dropped??0,A=d?{id:"capacity",title:"Capacity",level:"fail",summary:`Refused on purpose (${f&&p2.has(f.code)?f.code:"429/403"}): a rate limit or firewall stopped the load. This shows the limit you hit, not how much the API can take.`}:(e.status503??0)>=.5*p&&n>=l.errorFail?{id:"capacity",title:"Capacity",level:"fail",summary:"Mostly 503 (unavailable): the API, or something in front of it, was overloaded at this load."}:_>0&&_>=Math.max(1,(i+_)*.05)?{id:"capacity",title:"Capacity",level:"fail",summary:`${_.toLocaleString("en-US")} requests were never sent: this computer ran out of virtual users to hold the rate. Raise Max virtual users, or the API is too slow for this rate.`}:o>.1*i&&i>0?{id:"capacity",title:"Capacity",level:"fail",summary:"Many requests never got an HTTP status (network/timeout). Either the API or this machine’s generator is saturated."}:a>0&&a/Math.max(i,1)>=.02?{id:"capacity",title:"Capacity",level:"fail",summary:"Server 5xx responses appeared. The API is shedding load or crashing under these VUs."}:_>0?{id:"capacity",title:"Capacity",level:"warn",summary:`${_.toLocaleString("en-US")} requests were dropped because no virtual user was free. The rate you asked for was not fully held.`}:s>=l.p95WarnMs&&n<l.errorWarn?{id:"capacity",title:"Capacity",level:"warn",summary:"It still answers, but slowly. You are near a capacity cliff: raise VUs carefully or add think time."}:{id:"capacity",title:"Capacity",level:"pass",summary:"No clear saturation signal (timeouts / 5xx) at this VU level."},T=e.checksPassed??0,O=e.checksFailed??0,E=T+O,M=t.slo?.checksRate??.99,j=0===E?null:T/E<M?{id:"checks",title:"Checks",level:"fail",summary:`${(T/E*100).toFixed(1)}% of checks passed (needs ${(100*M).toFixed(+(M<1))}%). Responses arrived, but not all of them were correct.`}:O>0?{id:"checks",title:"Checks",level:"warn",summary:`${O.toLocaleString("en-US")} of ${E.toLocaleString("en-US")} checks failed — within your bar, but look at which ones.`}:{id:"checks",title:"Checks",level:"pass",summary:`All ${E.toLocaleString("en-US")} checks passed. Responses were correct, not just fast.`},N=[b,v,S,A,...j?[j]:[]],I=(r=N.map(e=>e.level)).includes("fail")?"fail":r.includes("warn")?"warn":"pass",q=d?"Blocked by a rate limit or firewall at this load — the results show that limit, not the API’s speed.":l.owned?"pass"===I?"Meets your performance targets under this load.":"warn"===I?"Close to your performance targets. Read the checks before you trust it in UAT.":"Misses your performance targets at this load.":"pass"===I?"Looks healthy under this load (built-in defaults — set your own under Goals).":"warn"===I?"Usable, with caveats. Read the lines below before you trust it in UAT.":"This run does not look production-ready at this load.";return{overall:I,headline:q,aspects:N,disclaimer:l.owned?`Your targets: errors < ${(100*l.errorFail).toFixed(l.errorFail<.01?2:1)}%, p95 < ${Math.round(l.p95FailMs)} ms. Stability and capacity use built-in rules.`:"Heuristics only (errors < 1%, p95 < 500 ms as a starting bar). Set your own thresholds when you know the API’s contract."}}function de(e,t){try{let r=new URL(t);return`${e.toUpperCase()} ${r.origin}${r.pathname.replace(/\/+$/,"")||"/"}`}catch{return`${e.toUpperCase()} ${t}`}}function dt(e,t){let r=(e,t)=>t>0?e/t-1:null;return{p95:r(e.p95,t.p95),rps:r(e.rps,t.rps),errorRate:t.errorRate>0?e.errorRate/t.errorRate-1:e.errorRate>0?null:0}}e.s(["s",0,p8,"F",0,p7,"X",0,function(e){let t=e.definition.load.stages;return t.length>0?t.reduce((e,t)=>e+a4(t.duration),0):3e4},"P",0,function(e,t){let r=p8(e,{slo:t}),n=e=>"pass"===e?"[PASS]":"warn"===e?"[WARN]":"[FAIL]",s=e.summary.http.rps.avg,i=s>=100?String(Math.round(s)):s>=10?s.toFixed(1):s.toFixed(2),a=["APITestCenter | load test result",`${n(r.overall)} ${r.overall.toUpperCase()}`,r.headline,"","Request",`${e.definition.method} ${e.definition.url}`,"","Results",`p95 ${Math.round(e.summary.latencyMs.p95)} ms`,`Errors ${(100*e.summary.http.failed.rate).toFixed(2)}%`,`Requests ${e.summary.http.requests.toLocaleString("en-US")}`,`Peak VUs ${e.summary.vus.max}`,`Avg rps ${i}`,"","Checks",...r.aspects.map(e=>`${n(e.level)} ${e.title} — ${e.summary}`),"","Please attach the HTML report (charts) and the Excel workbook (numbers).","Tokens are not included.","",r.disclaimer];return{subject:`API test ${r.overall.toUpperCase()}: ${e.testName}`,body:a.join("\n")}},"v",0,p6,"b",0,p3],2385),e.s(["L",0,dt,"U",0,de],94122);let dr=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),dn=e=>e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:2)} s`:`${e>=100?Math.round(e):e>=10?e.toFixed(1):e.toFixed(2)} ms`,ds=e=>`${(100*e).toFixed(e>0&&e<.001?3:2)}%`,di={pass:{word:"PASS",mark:"✓",ink:"#137333",bg:"#e6f4ea",line:"#a8dab5"},warn:{word:"WARNING",mark:"!",ink:"#975300",bg:"#fef3e0",line:"#f5cf8b"},fail:{word:"FAIL",mark:"✕",ink:"#c62828",bg:"#fdecea",line:"#f3b0aa"}},da={"constant-vus":"Steady users","ramping-vus":"Changing users","constant-arrival-rate":"Steady request rate","ramping-arrival-rate":"Changing request rate"};function dl(e){let t=Math.max(0,Math.round((Date.parse(e.endedAt)-Date.parse(e.startedAt))/1e3));return t>=60?`${Math.floor(t/60)} min ${t%60} s`:`${t} s`}function du(e,t){return null!=e&&Number.isFinite(e)?.005>Math.abs(e)?{text:"no change",ink:"#5c6778"}:{text:`${e>0?"▲":"▼"} ${Math.abs(100*e).toFixed(0)}%`,ink:(t?e>0:e<0)?"#c62828":"#137333"}:null}function dc(e){let t=new TextEncoder().encode(e),r="";for(let e=0;e<t.length;e+=32768)r+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(r).replace(/.{76}/g,"$&\r\n")}e.s(["H",0,function(e,t={}){let r,n=p8(e,{slo:t.slo??null}),s=di[n.overall],i=e.summary,a=t.appUrl??"https://apitestcenter.com",o=t.baseline?dt({p95:i.latencyMs.p95,rps:i.http.rps.avg,errorRate:i.http.failed.rate},t.baseline):null;i.checks.reduce((e,t)=>e+t.passes,0),i.checks.reduce((e,t)=>e+t.fails,0);let l=e.definition.load.executor.endsWith("arrival-rate"),u=new Date(e.startedAt).toLocaleString("en-GB",{dateStyle:"medium",timeStyle:"short"}),c=[{label:"Response time",tech:"95% of requests (p95)",value:dn(i.latencyMs.p95),change:du(o?.p95??null,!0)},{label:"Requests per second",tech:"throughput",value:(r=i.http.rps.avg)>=100?String(Math.round(r)):r>=10?r.toFixed(1):r.toFixed(2),change:du(o?.rps??null,!1)},{label:"Failed requests",tech:"error rate",value:ds(i.http.failed.rate),change:du(o?.errorRate??null,!0)},{label:"Typical response",tech:"median (p50)",value:dn(i.latencyMs.median)},{label:"Slowest 1%",tech:"p99",value:dn(i.latencyMs.p99)},{label:l?"Users needed":"Simulated users",tech:"peak VUs",value:String(i.vus.max)}],p=[["Fastest",i.latencyMs.min],["Typical (p50)",i.latencyMs.median],["Most (p90)",i.latencyMs.p90],["95% (p95)",i.latencyMs.p95],["Slowest 1% (p99)",i.latencyMs.p99],["Slowest",i.latencyMs.max]],d=Math.max(...p.map(([,e])=>e),1),h="font-family:Segoe UI,Roboto,Helvetica,Arial,sans-serif",f=(e,t="")=>`<td style="${h};font-size:14px;color:#12151c;${t}">${e}</td>`,m=e=>`<tr><td style="${h};padding:22px 24px 8px;font-size:13px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:#5c6778">${dr(e)}</td></tr>`,y=c.map(e=>`<td width="33%" valign="top" style="${h};padding:6px">
745
+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background:#f4f6f9;border-radius:8px"><tr><td style="${h};padding:12px 14px">
746
+ <div style="font-size:13px;color:#5c6778">${dr(e.label)}</div>
747
+ <div style="font-size:11px;color:#8b97a8">${dr(e.tech)}</div>
748
+ <div style="font-size:22px;font-weight:600;color:#12151c;margin-top:4px;font-family:Consolas,Menlo,monospace">${dr(e.value)}</div>
749
+ ${e.change?`<div style="font-size:12px;color:${e.change.ink};margin-top:2px">${dr(e.change.text)} vs reference run</div>`:""}
750
+ </td></tr></table></td>`).reduce((e,t,r)=>(r%3==0&&e.push(""),e[e.length-1]+=t,e),[]).map(e=>`<tr>${e}</tr>`).join(""),g=p.map(([e,t])=>{let r=Math.max(1,Math.round(t/d*100));return`<tr>
751
+ ${f(dr(e),"padding:3px 10px 3px 0;color:#5c6778;font-size:13px;white-space:nowrap")}
752
+ <td width="100%" style="padding:3px 0"><table role="presentation" width="${r}%" cellpadding="0" cellspacing="0"><tr><td style="background:#2a78d6;height:10px;border-radius:3px;font-size:0;line-height:0">&nbsp;</td></tr></table></td>
753
+ ${f(dr(dn(t)),"padding:3px 0 3px 10px;font-family:Consolas,Menlo,monospace;font-size:13px;white-space:nowrap;text-align:right")}
754
+ </tr>`}).join(""),b=i.thresholds.length?i.thresholds.map(e=>`<tr>${f(e.ok?"✓":"✕",`padding:4px 8px 4px 0;color:${e.ok?"#137333":"#c62828"};font-weight:700`)}${f(dr(e.name),"padding:4px 0")}${f(dr(e.actual?`measured ${e.actual}`:""),"padding:4px 0;color:#5c6778;font-size:13px;text-align:right")}</tr>`).join(""):`<tr>${f("No goals were set — the result uses built-in defaults (errors under 1%, 95% of requests under 500 ms).","color:#5c6778;font-size:13px")}</tr>`,v=i.checks.map(e=>{let t=e.passes+e.fails,r=0===e.fails;return`<tr>${f(r?"✓":"✕",`padding:4px 8px 4px 0;color:${r?"#137333":"#c62828"};font-weight:700`)}${f(dr(e.name),"padding:4px 0;font-family:Consolas,Menlo,monospace;font-size:13px")}${f(`${t?ds(e.passes/t):"—"} \xb7 ${e.fails.toLocaleString("en-US")} failed of ${t.toLocaleString("en-US")}`,"padding:4px 0;color:#5c6778;font-size:13px;text-align:right")}</tr>`}).join(""),w=n.aspects.map(e=>{let t=di[e.level];return`<tr>${f(t.mark,`padding:5px 8px 5px 0;color:${t.ink};font-weight:700`)}${f(`<b>${dr(e.title)}</b> — ${dr(e.summary)}`,"padding:5px 0;font-size:13px")}</tr>`}).join(""),k=[["Request",`${e.definition.method} ${e.definition.url}`],["Load style",da[e.definition.load.executor]??e.definition.load.executor],[l?"Peak request rate":"Simulated users",l?`${e.definition.load.rate??"—"} per second`:String(Math.max(...e.definition.load.stages.map(e=>e.target),0))],["Test length",dl(e)],["Total requests",i.http.requests.toLocaleString("en-US")],["Sign-in type","none"===e.definition.auth.mode?"none":e.definition.auth.mode]];e.definition.data?.before&&k.push(["Runs first",e.definition.data.before.label]),e.definition.data?.testData&&k.push(["Test data",`${e.definition.data.testData.fileName} \xb7 ${e.definition.data.testData.rows.toLocaleString("en-US")} rows`]);let x=k.map(([e,t])=>`<tr>${f(dr(e),"padding:4px 16px 4px 0;color:#5c6778;font-size:13px;white-space:nowrap;vertical-align:top")}${f(dr(t),"padding:4px 0;font-size:13px;word-break:break-all")}</tr>`).join(""),$=`<!doctype html>
755
+ <html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width"><title>${dr(e.testName)}</title></head>
756
+ <body style="margin:0;padding:0;background:#f4f6f9">
757
+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background:#f4f6f9"><tr><td align="center" style="padding:24px 12px">
758
+ <table role="presentation" width="640" cellpadding="0" cellspacing="0" style="max-width:640px;width:100%;background:#ffffff;border:1px solid #d5dce6;border-radius:12px">
759
+ <tr><td style="${h};padding:20px 24px 4px;font-size:12px;color:#5c6778">APITestCenter \xb7 Load test result</td></tr>
760
+ <tr><td style="${h};padding:0 24px;font-size:20px;font-weight:600;color:#12151c">${dr(e.testName)}</td></tr>
761
+ <tr><td style="${h};padding:4px 24px 0;font-size:13px;color:#5c6778">${dr(u)} \xb7 ${dr(dl(e))} \xb7 ${dr(e.definition.method)} <span style="font-family:Consolas,Menlo,monospace">${dr(e.definition.url)}</span></td></tr>
762
+ <tr><td style="padding:16px 24px 0">
763
+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background:${s.bg};border:1px solid ${s.line};border-radius:10px"><tr>
764
+ <td style="${h};padding:14px 16px;font-size:15px;color:${s.ink}"><b style="font-size:13px;letter-spacing:.06em">${s.mark} ${s.word}</b><br><span style="color:#12151c">${dr(n.headline)}</span></td>
765
+ </tr></table>
766
+ </td></tr>
767
+ ${m("Key numbers")}
768
+ <tr><td style="padding:0 18px"><table role="presentation" width="100%" cellpadding="0" cellspacing="0">${y}</table></td></tr>
769
+ ${m("Response time, fastest to slowest")}
770
+ <tr><td style="padding:0 24px"><table role="presentation" width="100%" cellpadding="0" cellspacing="0">${g}</table></td></tr>
771
+ ${m("Pass/fail goals")}
772
+ <tr><td style="padding:0 24px"><table role="presentation" width="100%" cellpadding="0" cellspacing="0">${b}</table></td></tr>
773
+ ${v?`${m("Checks on every response")}<tr><td style="padding:0 24px"><table role="presentation" width="100%" cellpadding="0" cellspacing="0">${v}</table></td></tr>`:""}
774
+ ${m("What the result is based on")}
775
+ <tr><td style="padding:0 24px"><table role="presentation" width="100%" cellpadding="0" cellspacing="0">${w}</table></td></tr>
776
+ ${m("Test settings")}
777
+ <tr><td style="padding:0 24px"><table role="presentation" width="100%" cellpadding="0" cellspacing="0">${x}</table></td></tr>
778
+ <tr><td style="${h};padding:22px 24px 6px;font-size:12px;color:#5c6778">${dr(n.disclaimer)}</td></tr>
779
+ <tr><td style="${h};padding:0 24px 22px;font-size:12px;color:#5c6778">The full report with charts is attached as an HTML file. Made with <a href="${dr(a)}" style="color:#08705f">APITestCenter</a>. No tokens or passwords are included.</td></tr>
780
+ </table>
781
+ </td></tr></table>
782
+ </body></html>`,S=["APITestCenter — load test result",`${e.testName}`,`${u} \xb7 ${dl(e)} \xb7 ${e.definition.method} ${e.definition.url}`,"",`${s.word}: ${n.headline}`,"","Key numbers",...c.map(e=>` ${`${e.label}:`.padEnd(22)}${e.value}${e.change?` (${e.change.text} vs reference run)`:""}`),"","Pass/fail goals",...i.thresholds.length?i.thresholds.map(e=>` ${e.ok?"[met] ":"[missed]"} ${e.name}${e.actual?` — measured ${e.actual}`:""}`):[" None set — built-in defaults were used."],...i.checks.length?["","Checks",...i.checks.map(e=>` ${e.fails?"[fail]":"[ok] "} ${e.name} — ${e.fails.toLocaleString("en-US")} failed of ${(e.passes+e.fails).toLocaleString("en-US")}`)]:[],"","What the result is based on",...n.aspects.map(e=>` [${di[e.level].word}] ${e.title} — ${e.summary}`),"",n.disclaimer,`Made with APITestCenter — ${a}`].join("\n");return{subject:`Load test ${di[n.overall].word}: ${e.testName} — ${dn(i.latencyMs.p95)} p95, ${ds(i.http.failed.rate)} failed`,html:$,text:S}},"W",0,function(e){let t=`atc-mixed-${Math.random().toString(36).slice(2)}`,r=`atc-alt-${Math.random().toString(36).slice(2)}`,n=e=>`=?UTF-8?B?${dc(e).replace(/\r\n/g,"")}?=`,s=["X-Unsent: 1",`Subject: ${n(e.subject)}`,"MIME-Version: 1.0",`Content-Type: multipart/mixed; boundary="${t}"`,"",`--${t}`,`Content-Type: multipart/alternative; boundary="${r}"`,"",`--${r}`,"Content-Type: text/plain; charset=UTF-8","Content-Transfer-Encoding: base64","",dc(e.text),`--${r}`,"Content-Type: text/html; charset=UTF-8","Content-Transfer-Encoding: base64","",dc(e.html),`--${r}--`];for(let r of e.attachments??[])s.push(`--${t}`,`Content-Type: ${r.type}; charset=UTF-8; name="${n(r.name)}"`,`Content-Disposition: attachment; filename="${n(r.name)}"`,"Content-Transfer-Encoding: base64","",dc(r.content));return s.push(`--${t}--`,""),s.join("\r\n")}],54608);let dp={p50:["Typical response time","p50"],p95:["Response time","p95"],p99:["Slowest 1%","p99"],rps:["Requests per second","throughput"],errorRate:["Failed requests","error rate"],checksRate:["Checks passed","checks rate"]};function dd(e){let t=e.summary.checks.reduce((e,t)=>e+t.passes,0),r=e.summary.checks.reduce((e,t)=>e+t.fails,0);return t+r?t/(t+r):null}function dh(e){let t=e.definition.load,r=t.executor.endsWith("arrival-rate"),n=r?t.rate??Math.max(0,...t.stages.map(e=>e.target)):Math.max(0,...t.stages.map(e=>e.target));return{rate:r,peak:n,ms:t.stages.reduce((e,t)=>e+a4(t.duration),0)}}let df=e=>`${Math.round(100*Math.abs(e))}%`,dm=e=>e>=1e3?`${(e/1e3).toFixed(2)} s`:`${Math.round(e)} ms`,dy=e=>`${(100*e).toFixed(+(e<.1))}%`;function dg(e,t,r={}){let n,s,i=r.minRelative??.05,a=r.minMs??10,o=r.minRate??.005,l=e.summary.http.failed.rate>=.5||t.summary.http.failed.rate>=.5,u=(e,t,r,n,s)=>{let[u,c]=dp[e],p={key:e,label:u,tech:c,before:t,after:r};if(null==t||null==r)return{...p,relative:null,absolute:null,direction:"n/a",note:"not measured in both runs"};let d=r-t,h=t>0?r/t-1:r>0?null:0;if("ms"===s&&l)return{...p,relative:h,absolute:d,direction:"n/a",note:"mostly error responses — not the API's speed"};let f="rate"===s?Math.abs(d)<o:Math.abs(h??1)<i||"ms"===s&&Math.abs(d)<a;return{...p,relative:h,absolute:d,direction:f||0===d?"same":d>0===n?"better":"worse"}},c=e.summary,p=t.summary,d=[u("p95",c.latencyMs.p95,p.latencyMs.p95,!1,"ms"),u("p50",c.latencyMs.median,p.latencyMs.median,!1,"ms"),u("p99",c.latencyMs.p99,p.latencyMs.p99,!1,"ms"),u("rps",c.http.rps.avg,p.http.rps.avg,!0,"count"),u("errorRate",c.http.failed.rate,p.http.failed.rate,!1,"rate")],h=dd(e),f=dd(t);(null!=h||null!=f)&&d.push(u("checksRate",h,f,!0,"rate"));let{unfair:m,caveats:y}=function(e,t){let r=[],n=[],s=de(e.definition.method,e.definition.url),i=de(t.definition.method,t.definition.url);s!==i&&r.push(`they test different requests (${s} and ${i})`);let a=dh(e),o=dh(t);for(let[s,i]of(a.rate!==o.rate?r.push("one held a request rate and the other used simulated users"):a.peak!==o.peak&&r.push(`the load was different (${a.peak} vs ${o.peak} ${a.rate?"requests per second":"users"} at the peak)`),a.ms&&o.ms&&Math.abs(a.ms-o.ms)/Math.max(a.ms,o.ms)>.25&&n.push("the runs were planned for different lengths"),[[e,"before"],[t,"after"]]))"stopped"===s.endReason&&n.push(`the ${i} run was stopped early`),"target-missed"===s.endReason&&n.push(`the ${i} run stopped early because a goal was missed`);return{unfair:r,caveats:n}}(e,t),g=Object.fromEntries(d.map(e=>[e.key,e])),b=g.p95,v=g.errorRate,w=g.checksRate;if(m.length)n="unfair",s=`Not a fair comparison: ${m.join("; ")}. The numbers are shown, but don't read them as better or worse.`;else if("worse"===v.direction)n="worse",s=`After fails more often: ${dy(v.before)} → ${dy(v.after)} of requests failed.`;else if(w?.direction==="worse")n="worse",s=`After gives more wrong answers: checks passed ${dy(w.before)} → ${dy(w.after)}.`;else if("worse"===b.direction)n="worse",s=`After is ${df(b.relative??0)} slower: 95% of requests within ${dm(b.before)} → ${dm(b.after)}. That is more than normal run-to-run variation.`;else if("better"===b.direction){let e=d.some(e=>"worse"===e.direction);n=e?"mixed":"better",s=`After is ${df(b.relative??0)} faster: 95% of requests within ${dm(b.before)} → ${dm(b.after)}.${e?" Some other measures got worse — see below.":""}`}else if("better"===v.direction)n="better",s=`After fails less often: ${dy(v.before)} → ${dy(v.after)} of requests failed. Speed is about the same.`;else if("n/a"===b.direction)n="same",s="Speed can't be compared: most responses in at least one run were errors.";else{let e=d.filter(e=>"worse"===e.direction);n=e.length?"mixed":"same",s=e.length?`Response time is about the same, but ${e.map(e=>e.label.toLowerCase()).join(" and ")} got worse.`:"About the same — the differences are within normal run-to-run variation."}return!m.length&&y.length&&(s+=` Note: ${y.join("; ")}.`),{before:{id:e.id,name:e.testName,startedAt:e.startedAt},after:{id:t.id,name:t.testName,startedAt:t.startedAt},metrics:d,fair:0===m.length,reasons:[...m,...y],level:n,headline:s}}e.s(["d",0,function(e,t){let r=[],n=e.map((e,n)=>{let s=dh(e),i=Date.parse(e.endedAt)-Date.parse(e.startedAt),a=Number.isFinite(i)&&i>0?i:(e.buckets.at(-1)?.elapsedS??0)*1e3,o=s.rate?s.peak:Math.max(0,...e.buckets.map(e=>e.vus))||s.peak;return"stopped"===e.endReason&&r.push(`${t[n]} was stopped early`),"target-missed"===e.endReason&&r.push(`${t[n]} stopped early because a goal was missed`),{label:t[n],rate:s.rate,peak:o,ms:a,stopped:"stopped"===e.endReason||"target-missed"===e.endReason}});if(n.length<2)return{unfair:null,caveats:r};let s=Math.max(...n.map(e=>e.ms));if(!(n.some(e=>e.rate!==n[0].rate)||n.some(e=>Math.abs(e.peak-n[0].peak)>Math.max(1,.1*n[0].peak))||n.some(e=>s>0&&(s-e.ms)/s>.25)))return{unfair:null,caveats:r};let i=[];for(let e of n){let t=(e,t)=>Math.abs(e-t)<=.1*Math.max(e,t),r=i.find(({first:r})=>r.rate===e.rate&&r.stopped===e.stopped&&t(r.ms,e.ms)&&t(r.peak,e.peak));r?r.names.push(e.label):i.push({first:e,names:[e.label]})}let a=[...i].sort((e,t)=>e.names.length-t.names.length).map(e=>{var t;let r;return`${(t=e.names).length<=1?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t.at(-1)}`} ${r=e.first,`ran ${function(e){let t=Math.max(1,Math.round(e/1e3));if(t<60)return`${t} s`;let r=Math.floor(t/60);return t%60?`${r} min ${t%60} s`:`${r} min`}(r.ms)} ${r.rate?`at ${r.peak} requests per second`:`with up to ${r.peak} user${1===r.peak?"":"s"}`}${r.stopped?" (stopped early)":""}`}`});return{unfair:`Not a like-for-like comparison: ${a.join("; ")}.`,caveats:[]}},"c",0,dg],55658);let db=["latency","throughput","status","phase","percentiles","thresholds"],dv=db.map(e=>({id:e,w:1,h:1}));function dw(e){return[{key:"p50",label:"Median latency (p50)",unit:"ms",better:"lower",read:e=>e.summary.latencyMs.median},{key:"p95",label:"95th percentile latency",unit:"ms",better:"lower",read:e=>e.summary.latencyMs.p95},{key:"p99",label:"99th percentile latency",unit:"ms",better:"lower",read:e=>e.summary.latencyMs.p99},{key:"rps",label:"Requests per second",unit:"rps",better:"higher",read:e=>e.summary.http.rps.avg},{key:"err",label:"Error rate",unit:"pct",better:"lower",read:e=>e.summary.http.failed.rate},{key:"reqs",label:"Total requests",unit:"count",better:"neutral",read:e=>e.summary.http.requests}].map(t=>{let r=e.map(t.read);return{key:t.key,label:t.label,unit:t.unit,better:t.better,values:r,winner:function(e,t){if("neutral"===t||0===e.length)return null;let r=0;for(let n=1;n<e.length;n++){let s=e[n]??0,i=e[r]??0;("lower"===t?s<i:s>i)&&(r=n)}let n=e[r];return null==n||e.filter(e=>e===n).length>1?null:r}(r,t.better)}})}e.s(["p",0,{latency:"Latency over time",throughput:"Throughput and offered load",status:"Status codes over time",phase:"Where time went",percentiles:"Latency distribution",thresholds:"Thresholds / SLO"},"L",0,function(e){return e.summary.thresholds.length>0||e.summary.checks.length>0},"$",0,function(e,t){let r=new Set,n=[];if(Array.isArray(e))for(let s of e){if(!db.includes(s.id))continue;let e=s.id;!r.has(e)&&("thresholds"!==e||t)&&(r.add(e),n.push({id:e,w:2===s.w?2:1,h:2===s.h?2:1}))}for(let e of dv)("thresholds"!==e.id||t)&&(r.has(e.id)||n.push({...e}));return n}],46306),e.s(["l",0,dw,"u",0,function(e,t){let r=`API ${e+1}`,n=t?.trim();return!n||/^API\s*\d+$/i.test(n)?r:/^API\s*\d+\s*\(.*\)$/i.test(n)?n:`${r} (${n})`},"g",0,function(e,t={}){let r=e.map(e=>{let t=new Map;for(let r of e.buckets)t.set(r.elapsedS,r);return t}),n=[...new Set(r.flatMap(e=>[...e.keys()]))],s=n.length?Math.max(...n):0;return Array.from({length:Math.max(t.durationS&&t.durationS>0?Math.ceil(t.durationS):0,s,0)+1},(e,t)=>t).map(e=>({elapsedS:e,p50:r.map(t=>t.get(e)?.p50Ms),p95:r.map(t=>t.get(e)?.p95Ms),p99:r.map(t=>t.get(e)?.p99Ms),rps:r.map(t=>t.get(e)?.rps),failedRate:r.map(t=>t.get(e)?.failedRate),vus:r.map(t=>t.get(e)?.vus)}))}],60617),e.s(["f",0,1],81609),e.s(["y",0,function(e,t){return e.map(e=>{let r=p8(e.report,{slo:t});return{id:e.id,title:e.title,overall:r.overall,headline:r.headline}})},"z",0,function(e,t){return null==e.winner?"tie":t[e.winner]??`API ${e.winner+1}`},"E",0,function(e,t,r=new Date().toISOString()){let n=e.map(e=>e.report),s={exportedAt:r,exporter:"ApiTestCenter",version:1,kind:"compare",mode:t,apis:e,kpis:n.length>=2?dw(n):[]};return`${JSON.stringify(s,null,2)}
783
+ `},"m",0,function(e,t=new Date().toISOString()){return`${JSON.stringify({exportedAt:t,exporter:"ApiTestCenter",version:1,kind:"probe",probe:{ok:e.ok,status:e.status,statusText:e.statusText??"",url:e.url,headers:e.headers,body:e.body,truncated:!!e.truncated,durationMs:e.durationMs??0,error:e.error}},null,2)}
784
+ `}],88491);let dk="#12151c",dx="#5c6778",d$="#d5dce6",dS="#ffffff",d_="#137333",dA="#975300",dT="#c62828",dO={p50:"#86b6ef",p90:"#3987e5",p95:"#256abf",p99:"#104281",p999:"#6250d6",max:"#12151c"},dE="#0ca30c",dM="#fab219",dj="#d03b3b",dN="#898781",dI=["#eef4fc","#c3d9f5","#86b6ef","#3987e5","#256abf","#104281"],dq=e=>String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),dz=e=>Number.isFinite(e)?e<10?`${e.toFixed(1)} ms`:e>=1e4?`${(e/1e3).toFixed(1)} s`:`${Math.round(e)} ms`:"—",dC=e=>Number.isFinite(e)?e>=1e3?`${(e/1e3).toFixed(2)}k`:e.toFixed(e>=100?0:1):"—",dP=e=>`${(100*e).toFixed(e<.01?2:1)}%`,dR=e=>new Intl.NumberFormat("en-US").format(Math.round(e)),dL=e=>e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(2)} MB`,dU=e=>e>=60?`${Math.floor(e/60)}m ${e%60?`${e%60}s`:""}`.trim():`${e}s`,dF=e=>Math.max(0,Math.round((Date.parse(e.endedAt)-Date.parse(e.startedAt))/1e3)),dD=e=>"ok"===e?d_:"warn"===e?dA:"bad"===e?dT:dk;function dB(e,t,r){let n=e.summary;switch(t){case"throughput":return{text:`${dC(n.http.rps.avg)} rps`,hint:`max ${dC(n.http.rps.max)}`};case"peakRps":return{text:`${dC(n.http.rps.max)} rps`,hint:`average ${dC(n.http.rps.avg)}`};case"p95":{let e=r?.p95Ms??500;if(n.http.failed.rate>=.5)return{text:dz(n.latencyMs.p95),hint:"mostly error responses — not the API’s speed"};let t=n.latencyMs.p95>=(r?e:2e3)?"bad":n.latencyMs.p95>=e*(r?.8:1)?"warn":"ok";return{text:dz(n.latencyMs.p95),hint:`slowest 1% ${dz(n.latencyMs.p99)}`,tone:t}}case"p50":return{text:dz(n.latencyMs.median),hint:"half of requests were faster"};case"avg":return{text:dz(n.latencyMs.mean),hint:`typical spread \xb1${dz(n.latencyMs.stdDev)}`};case"p99":return{text:dz(n.latencyMs.p99),hint:`slowest ${dz(n.latencyMs.max)}`};case"max":return{text:dz(n.latencyMs.max),hint:`fastest ${dz(n.latencyMs.min)}`};case"ttfb":{let e=n.latencyMs.mean>0?Math.min(1,n.phasesMs.ttfb.avg/n.latencyMs.mean):0;return{text:dz(n.phasesMs.ttfb.avg),hint:`${Math.round(100*e)}% of the response time`}}case"errors":{let e=n.http.failed.rate,t=e>=(r?r.errorRate:.05)?"bad":e>=(r?.5*r.errorRate:.01)?"warn":"ok";return{text:dP(e),hint:`${dR(n.http.failed.count)} failed`,tone:t}}case"checks":{let e=n.checks.reduce((e,t)=>e+t.passes,0),t=n.checks.reduce((e,t)=>e+t.fails,0);if(!e&&!t)return{text:"—",hint:"no checks set"};let s=e/(e+t),i=r?.checksRate??.99;return{text:dP(s),hint:`${dR(t)} failed`,tone:s>=i?"ok":s>=i-.05?"warn":"bad"}}case"vus":return{text:String(n.vus.max),hint:`average ${n.vus.avg.toFixed(1)}`};case"requests":return{text:dR(n.http.requests),hint:`${dR(n.iterations.count)} iterations`};case"dropped":{let e=n.droppedIterations;return null==e?{text:"—",hint:"rate mode only"}:{text:dR(e),tone:e>0?"warn":"ok",hint:"requests that could not start on time"}}case"apdex":{let t=pQ(e.buckets.map(e=>e.hist)),n=t?p0(t,r?.p95Ms??500):null;return null==n?{text:"—",hint:"not recorded"}:{text:n.toFixed(2),tone:n>=.85?"ok":n>=.7?"warn":"bad",hint:n>=.94?"excellent":n>=.85?"good":n>=.7?"fair":"poor"}}case"data":return{text:dL(n.data.bytesIn),hint:`sent ${dL(n.data.bytesOut)}`};case"sent":return{text:dL(n.data.bytesOut),hint:`received ${dL(n.data.bytesIn)}`};case"duration":return{text:dU(dF(e)),hint:`${dR(n.http.requests)} requests`}}}let dK=640;function dZ(e){if(!(e>0))return 1;let t=Math.pow(10,Math.floor(Math.log10(e)));for(let r of[1,1.5,2,2.5,3,4,5,6,8,10])if(r*t>=e)return r*t;return 10*t}function dJ(e,t,r,n={}){let s=n.h??210;if(!e.length||!t.length)return'<p class="empty">Not recorded for this run.</p>';let i=n.stacked?t.map((r,n)=>e.map((e,r)=>t.slice(0,n+1).reduce((e,t)=>e+(t.values[r]??0),0))):t.map(e=>e.values),a=dZ(Math.max(...i.flat().filter(e=>null!=e&&Number.isFinite(e)),n.ref?.value??0,0)),o=e[0],l=e[e.length-1]===o?o+1:e[e.length-1],u=e=>52+(e-o)/(l-o)*(dK-52-12),c=e=>s-24-e/a*(s-10-24),p=[0,.25,.5,.75,1].map(e=>a*e).map(e=>`<line x1="52" x2="${dK-12}" y1="${c(e).toFixed(1)}" y2="${c(e).toFixed(1)}" class="g"/><text x="${46}" y="${(c(e)+3.5).toFixed(1)}" class="t" text-anchor="end">${dq(r(e))}</text>`).join(""),d=Array.from({length:6},(e,t)=>Math.round(o+(l-o)*t/5)).map(e=>`<text x="${u(e).toFixed(1)}" y="${s-6}" class="t" text-anchor="middle">${dq(dU(e))}</text>`).join(""),h=i.map((r,s)=>{let a,o,l,p=t[s],d="",h=!1;if(r.forEach((t,r)=>{null!=t&&Number.isFinite(t)?(d+=`${h?"L":"M"}${u(e[r]).toFixed(1)},${c(t).toFixed(1)}`,h=!0):h=!1}),!d)return"";let f=n.area||n.stacked?(a=n.stacked&&s>0?i[s-1]:e.map(()=>0),o=r.map((t,r)=>`${u(e[r]).toFixed(1)},${c(t??0).toFixed(1)}`).join(" L"),l=[...a].reverse().map((t,r)=>`${u(e[e.length-1-r]).toFixed(1)},${c(t??0).toFixed(1)}`).join(" L"),`<path d="M${o} L${l} Z" fill="${p.color}" fill-opacity="${n.stacked?.85:.18}" stroke="none"/>`):"";return`${f}<path d="${d}" fill="none" stroke="${p.color}" stroke-width="2" stroke-linejoin="round"${p.dash?' stroke-dasharray="5 4"':""}/>`}).join(""),f=n.ref?`<line x1="52" x2="${dK-12}" y1="${c(n.ref.value).toFixed(1)}" y2="${c(n.ref.value).toFixed(1)}" stroke="${dx}" stroke-dasharray="6 4"/><text x="${dK-12}" y="${(c(n.ref.value)-4).toFixed(1)}" class="t" text-anchor="end">${dq(n.ref.label)}</text>`:"",m=Math.max(1,Math.ceil(e.length/240)),y=(dK-52-12)/Math.max(1,(e.length-1)/m),g=e.map((e,n)=>n%m?"":`<rect x="${(u(e)-y/2).toFixed(1)}" y="10" width="${y.toFixed(1)}" height="${s-10-24}" fill="transparent"><title>${dq(dU(e))}
785
+ ${t.map(e=>`${e.label}: ${null==e.values[n]?"—":r(e.values[n])}`).join("\n")}</title></rect>`).join(""),b=t.length>1?`<div class="legend">${t.map(e=>`<span><i style="background:${e.color}"></i>${dq(e.label)}</span>`).join("")}</div>`:"";return`<svg viewBox="0 0 ${dK} ${s}" role="img" aria-label="${dq(t.map(e=>e.label).join(", "))} over time">${p}${d}${f}${h}${g}</svg>${b}`}function dH(e){let t=Math.max(...e.map(e=>e.value),1);return`<table class="bars">${e.map(e=>`<tr><th>${dq(e.label)}</th><td><span class="bar" style="width:${Math.max(1,e.value/t*100).toFixed(1)}%;background:${e.color}"></span></td><td class="v">${dq(e.text)}</td></tr>`).join("")}</table>`}let dV={"constant-vus":"Steady users","ramping-vus":"Changing users","constant-arrival-rate":"Steady request rate","ramping-arrival-rate":"Changing request rate"};function dW(e){let t=e.definition.load.executor.endsWith("arrival-rate"),r=e=>t?`${e} requests/s`:`${e} ${1===e?"user":"users"}`,n=e.definition.load.stages,s=e.definition.load.executor.startsWith("constant")?n[0]?.target??0:0,i=n.map(e=>{let t=e.target===s?`stay at ${r(e.target)} for ${e.duration}`:`${e.target>s?"go up":"go down"} to ${r(e.target)} over ${e.duration}`;return s=e.target,t}).join(", then ");return i.charAt(0).toUpperCase()+i.slice(1)}e.s(["f",0,function(e,t={}){let r=t.generatedAt??new Date().toISOString(),n=t.view??x("run"),s=p8(e,{slo:t.slo??null}),i=function(e,t={}){let r=e.summary,n=e.buckets,s=t.slo??null,i=p3(e),a=[],o=[],l=e.definition.load.executor.endsWith("arrival-rate"),u=p5(e);a.push(`<b>Load.</b> ${dq(dW(e))}. In ${dq(dU(dF(e)))} the API answered ${dq(dR(r.http.requests))} requests — ${dq(dC(r.http.rps.avg))} per second on average, ${dq(dC(r.http.rps.max))} at the busiest second.`);let c=r.latencyMs.p95;if(u.timingsUnreliable){let e=u.healthyP95Ms;a.push(`<b>Speed.</b> The response times of this run are not meaningful: ${dq(dP(r.http.failed.rate))} of responses were errors, and errors come back almost instantly.${e?u.onset?` While requests were still succeeding (before ${dq(dU(u.onset.elapsedS))}), 95% took about ${dq(dz(e))}.`:` Successful requests alone: 95% took about ${dq(dz(e))}.`:""}`)}else{let e=`<b>Speed.</b> A typical request took ${dq(dz(r.latencyMs.median))}; 95% finished within ${dq(dz(c))}, and the slowest took ${dq(dz(r.latencyMs.max))}.`;s?.p95Ms&&(e+=c<=s.p95Ms?` That is within your ${dq(dz(s.p95Ms))} goal.`:` That is over your ${dq(dz(s.p95Ms))} goal by ${dq(dz(c-s.p95Ms))}.`),r.latencyMs.p99>3*c&&r.latencyMs.p99>100&&(e+=` The slowest 1% (${dq(dz(r.latencyMs.p99))}) is much slower than the rest — a few requests hit something slow, like a cold cache, a lock, or garbage collection.`),a.push(e)}if(n.length>=6&&i.earlyP95>0&&!u.onset&&!u.timingsUnreliable){let e=i.lateP95/i.earlyP95;e>1.5?(a.push(`<b>Over time.</b> It got slower as the test went on: 95% of requests took ${dq(dz(i.earlyP95))} early on and ${dq(dz(i.lateP95))} near the end (\xd7${e.toFixed(1)}). That often means work piling up — a queue, a connection pool, or memory that keeps growing.`),o.push("Run it longer (the Soak preset) to see whether the slowdown keeps growing.")):e<.67?a.push(`<b>Over time.</b> It got faster after the start (${dq(dz(i.earlyP95))} → ${dq(dz(i.lateP95))}) — typical of warm-up: caches filling, connections opening, code getting compiled.`):a.push("<b>Over time.</b> Response time stayed steady from start to finish.")}let p=r.http.failed.count;if(p){let e=Object.entries(r.http.status).filter(([e])=>"0"===e||Number(e)>=400).sort((e,t)=>t[1]-e[1]).slice(0,4).map(([e,t])=>`${"0"===e?"no answer":e} \xd7${dR(t)}`).join(", "),t=n.find(e=>e.failedRate>0),s=u.dominant,l=`<b>Errors.</b> ${dq(dR(p))} requests failed (${dq(dP(r.http.failed.rate))})${e?`: ${dq(e)}`:""}.`;s&&(l+=` ${dq("0"===s.code?"No answer":s.code)} means ${dq(s.meaning)}.`),u.onset?(l+=` From ${dq(dU(u.onset.elapsedS))} on — at about ${dq(dR(u.onset.vus))} simultaneous users and ${dq(dC(u.onset.rps))} requests per second — most requests failed.`,u.lastHealthy&&(l+=` Up to about ${dq(dR(u.lastHealthy.vus))} users (${dq(dC(u.lastHealthy.rps))} requests per second) it answered normally.`),!1===u.recovered?l+=" They kept failing even after the load dropped back — a lockout, typical of a rate limit or firewall that blocks a caller for a while.":!0===u.recovered&&(l+=" When the load dropped, it recovered.")):t&&(l+=` The first failures appeared at ${dq(dU(t.elapsedS))}.`),a.push(l),u.blocked?o.push(s?.code==="403"?"You were blocked (403). If this API is yours, ask for this computer’s address to be allowed through the firewall, or test a staging server without it.":"You were rate-limited (429). Lower the load — Requests per second mode with a modest rate — or test a staging server without the limit. Don’t load test public sites or APIs you don’t control."):s?.code==="503"&&o.push("The API was overloaded (503). Lower the load step by step to find where the 503s start — that is its current limit."),i.status5xx>0&&o.push("Look at the server logs around the time of the 5xx errors — the API itself reported a problem."),i.status0>0&&o.push("Some requests got no answer at all: check timeouts, the network, and whether the API was overloaded.")}else a.push("<b>Errors.</b> No request failed.");let d=r.checks.reduce((e,t)=>e+t.passes,0),h=r.checks.reduce((e,t)=>e+t.fails,0);if(d+h>0){let e=[...r.checks].sort((e,t)=>t.fails-e.fails)[0];a.push(h?`<b>Correctness.</b> ${dq(dR(h))} of ${dq(dR(d+h))} checks failed; the most often failed was <code>${dq(e.name)}</code>. A fast answer is not a correct one.`:`<b>Correctness.</b> Every check passed on every response (${dq(dR(d))} checks).`)}else o.push("Add checks (Checks tab) so a fast answer that is wrong still counts as a failure.");let f=r.phasesMs,m=f.blocked.avg+f.dns.avg+f.tcp.avg+f.tls.avg+f.send.avg+f.ttfb.avg+f.download.avg;if(m>0&&!u.timingsUnreliable){let e=f.ttfb.avg/m,t=(f.blocked.avg+f.dns.avg+f.tcp.avg+f.tls.avg)/m;e>=.7?a.push(`<b>Where the time went.</b> Most of each request (${Math.round(100*e)}%) was the API working on the answer, so speed-ups will come from the API itself — its code, database, or downstream calls.`):t>=.4?(a.push(`<b>Where the time went.</b> ${Math.round(100*t)}% of each request was spent connecting (waiting for a connection, DNS, TCP, TLS), not in the API.`),o.push("Connection time is high: check that connections are reused (Settings → keep connections), and the network between this computer and the API.")):a.push(`<b>Where the time went.</b> Time was split between the server (${Math.round(100*e)}%) and moving data or connecting.`)}let y=n.filter(e=>e.rps>0);if(y.length>=8&&!u.onset&&!u.timingsUnreliable){let e=e=>l?e.rps:e.vus,t=[...y].sort((t,r)=>e(t)-e(r)),r=Math.max(1,Math.floor(t.length/4)),n=t.slice(0,r),s=t.slice(-r),i=(e,t)=>e.reduce((e,r)=>e+t(r),0)/e.length,u=i(n,e=>e.p95Ms),c=i(s,e=>e.p95Ms);if(e(s[0])>e(n[n.length-1])&&u>0){let t=c/u;t>2?(a.push(`<b>Capacity.</b> Under the heaviest load, 95% of requests took ${dq(dz(c))}, against ${dq(dz(u))} at light load (\xd7${t.toFixed(1)}). The API is near its comfortable limit at about ${dq(l?`${dC(i(s,e))} requests per second`:`${Math.round(i(s,e))} simultaneous users`)}.`),o.push("Use the Load vs response time chart to find where the dots start climbing — that is the most this API can take comfortably.")):(a.push(`<b>Capacity.</b> Response time barely changed between light and full load (${dq(dz(u))} → ${dq(dz(c))}), so this load is comfortably within what the API can handle.`),o.push("Raise the load (more users, or the Stress preset) to find where it starts to slow down."))}}if((r.droppedIterations??0)>0&&(a.push(`<b>Requests not sent.</b> ${dq(dR(r.droppedIterations))} requests could not start on time because every simulated user was busy — the API, or this computer, could not keep up with the requested rate.`),o.push("Increase “Max simulated users” in the Load tab, or lower the request rate, then compare.")),t.baseline){let e=dt({p95:c,rps:r.http.rps.avg,errorRate:r.http.failed.rate},t.baseline),n=(e,t)=>null==e?"":.05>Math.abs(e)?"about the same":`${(t?e>0:e<0)?"worse":"better"} by ${Math.abs(100*e).toFixed(0)}%`;a.push(`<b>Against your reference run.</b> Response time ${dq(n(e.p95,!0))}; requests per second ${dq(n(e.rps,!1))}; failed requests ${dq(n(e.errorRate,!0)||"unchanged")}.`)}else o.push("Mark a good run as the reference run, so later runs show whether they got faster or slower.");return s||o.splice(u.blocked||u.dominant?.code==="503"?1:0,0,"Set pass/fail goals (Goals tab) so the result reflects what “fast enough” means for this API."),{findings:a,next:o.slice(0,5)}}(e,t),a=s.overall,o=r=>{let n=b[r.metric],s=_(r),i=A(r);dK=Math.max(320,Math.round(r.w/12*1080));let a=function(e,t,r){let n=t.buckets,s=n.map(e=>e.elapsedS),i=e.options??{},a=r.slo??null,o=p8(t,{slo:a});switch(e.metric){case"kpis":case"number":{let n=i.kpis?.length?i.kpis:["throughput","p95","errors","vus","requests"],s=r.baseline?dt({p95:t.summary.latencyMs.p95,rps:t.summary.http.rps.avg,errorRate:t.summary.http.failed.rate},r.baseline):null;return`<div class="kpis ${"number"===e.metric?"one":""}">${n.map(r=>{let n=dB(t,r,a),i=s&&("p95"===r?s.p95:"throughput"===r?s.rps:"errors"===r?s.errorRate:null),o=null!=i&&Number.isFinite(i)?`<div class="chg" style="color:${("throughput"===r?i<0:i>0)?dT:d_}">${i>0?"▲":"▼"} ${Math.abs(100*i).toFixed(0)}% vs reference run</div>`:"";return`<div class="kpi">${"number"===e.metric?"":`<div class="kl">${dq(m[r])}</div><div class="kt">${dq(y[r])}</div>`}<div class="kv" style="color:${dD(n.tone)}">${dq(n.text)}</div>${n.hint?`<div class="kh">${dq(n.hint)}</div>`:""}${o}</div>`}).join("")}</div>`}case"verdict":{let e=o.overall;return`<div class="verdict ${e}"><b>${"pass"===e?"✓ PASS":"warn"===e?"! WARNING":"✕ FAIL"}</b> ${dq(o.headline)}</div><ul class="aspects">${o.aspects.map(e=>`<li><b class="${e.level}">${"pass"===e.level?"✓":"warn"===e.level?"!":"✕"}</b> <strong>${dq(e.title)}</strong> — ${dq(e.summary)}</li>`).join("")}</ul><p class="note">${dq(o.disclaimer)}</p>`}case"heading":return i.note?`<p class="note">${dq(i.note)}</p>`:"";case"latency":{let e=i.percentiles?.length?i.percentiles:["p50","p95","p99"],t={p50:e=>e.p50Ms,p90:e=>e.p90Ms,p95:e=>e.p95Ms,p99:e=>e.p99Ms,p999:e=>e.p999Ms,max:e=>e.maxMs};return dJ(s,e.map(e=>({label:h[e],color:dO[e],values:n.map(r=>t[e](r)??null)})),dz,{ref:!1!==i.showTarget&&a?.p95Ms?{value:a.p95Ms,label:`goal ${dz(a.p95Ms)}`}:void 0})}case"throughput":return dJ(s,[{label:"Requests per second",color:"#2a78d6",values:n.map(e=>e.rps)}],dC,{area:"area"===e.kind});case"vus":return dJ(s,[{label:"Simulated users",color:"#6250d6",values:n.map(e=>e.vus)}],e=>String(Math.round(e)),{area:!0});case"errors":return dJ(s,[{label:"Failed requests",color:dT,values:n.map(e=>e.failedRate)}],dP,{ref:!1!==i.showTarget&&a?{value:a.errorRate,label:`goal ${dP(a.errorRate)}`}:void 0});case"status":return dJ(s,[{label:"2xx success",color:dE,values:n.map(e=>e.http2xx)},{label:"4xx client error",color:dM,values:n.map(e=>e.http4xx)},{label:"5xx server error",color:dj,values:n.map(e=>e.http5xx)},{label:"No answer",color:dN,values:n.map(e=>e.http0)}],e=>String(Math.round(e)),{stacked:!0});case"data":return dJ(s,[{label:"Received",color:"#2a78d6",values:n.map(e=>e.bytesIn)},{label:"Sent",color:"#eb6834",values:n.map(e=>e.bytesOut)}],e=>`${dL(Math.round(e))}/s`);case"serverTime":return dJ(s,[{label:"Server time (TTFB)",color:"#2a78d6",values:n.map(e=>e.ttfbMs??null)},{label:"TCP connect",color:"#eb6834",values:n.map(e=>e.connectMs??null)},{label:"TLS handshake",color:"#1baf7a",values:n.map(e=>e.tlsMs??null)}],dz);case"checksRate":return dJ(s,[{label:"Checks passing",color:d_,values:n.map(e=>null!=e.checksPassed&&e.checksPassed+(e.checksFailed??0)>0?e.checksPassed/(e.checksPassed+(e.checksFailed??0)):null)}],dP);case"dropped":return dJ(s,[{label:"Requests not sent",color:dA,values:n.map(e=>e.dropped??null)}],e=>String(Math.round(e)));case"histogram":return function(e){let t=pQ(e.buckets.map(e=>e.hist));if(!t)return'<p class="empty">Not recorded for this run.</p>';let r=t.map((e,t)=>[e,t]).filter(([e])=>e>0),n=r[0]?.[1]??0,s=r[r.length-1]?.[1]??0,i=t.slice(n,s+1),a=Math.max(...i,1),o=(dK-52-12)/i.length,l=i.map((e,t)=>{let r=e/a*156;return`<rect x="${(52+t*o+1).toFixed(1)}" y="${(166-r).toFixed(1)}" width="${Math.max(1,o-2).toFixed(1)}" height="${r.toFixed(1)}" rx="2" fill="#2a78d6"><title>${dq(pY(n+t))}: ${dq(dR(e))} requests</title></rect>`}).join(""),u=i.map((e,t)=>t%Math.ceil(i.length/6)?"":`<text x="${(52+t*o+o/2).toFixed(1)}" y="184" class="t" text-anchor="middle">${dq(pY(n+t))}</text>`).join("");return`<svg viewBox="0 0 ${dK} 190" role="img" aria-label="How many requests took each amount of time"><line x1="52" x2="${dK-12}" y1="${166}" y2="${166}" class="g"/>${l}${u}</svg>`}(t);case"heatmap":return function(e){let t=e.buckets.filter(e=>e.hist);if(!t.length)return'<p class="empty">Not recorded for this run.</p>';let r=pX.map((e,t)=>t).filter(e=>t.some(t=>(t.hist[e]??0)>0)),n=Math.max(1,Math.ceil(t.length/120)),s=[];for(let e=0;e<t.length;e+=n)s.push(t.slice(e,e+n));let i=Math.min(260,24+14*r.length),a=(dK-52-12)/s.length,o=(i-10-24)/r.length,l=1,u=s.map(e=>r.map(t=>e.reduce((e,r)=>e+(r.hist[t]??0),0)));for(let e of u)for(let t of e)l=Math.max(l,t);let c=u.map((e,t)=>e.map((e,n)=>{if(!e)return"";let u=Math.min(dI.length-1,Math.floor(e/l*dI.length));return`<rect x="${(52+t*a).toFixed(1)}" y="${(i-24-(n+1)*o).toFixed(1)}" width="${(a+.3).toFixed(1)}" height="${(o+.3).toFixed(1)}" fill="${dI[u]}"><title>${dq(dU(s[t][0].elapsedS))} \xb7 ${dq(pY(r[n]))}: ${dq(dR(e))}</title></rect>`}).join("")).join(""),p=r.map((e,t)=>t%Math.ceil(r.length/6)?"":`<text x="${46}" y="${(i-24-t*o-o/2+3).toFixed(1)}" class="t" text-anchor="end">${dq(pY(e))}</text>`).join("");return`<svg viewBox="0 0 ${dK} ${i}" role="img" aria-label="Response times each second; darker means more requests">${c}${p}</svg><p class="note">Each column is a moment in the run; darker squares mean more requests took that long.</p>`}(t);case"percentiles":{let e=t.summary.latencyMs;return dH([{label:"Fastest",value:e.min,color:dx,text:dz(e.min)},{label:h.p50,value:e.median,color:dO.p50,text:dz(e.median)},{label:h.p90,value:e.p90,color:dO.p90,text:dz(e.p90)},{label:h.p95,value:e.p95,color:dO.p95,text:dz(e.p95)},{label:h.p99,value:e.p99,color:dO.p99,text:dz(e.p99)},{label:h.max,value:e.max,color:dk,text:dz(e.max)}])}case"phases":{let e=t.summary.phasesMs,r=[{label:"Waiting for a connection",value:e.blocked.avg,color:"#2a78d6"},{label:"DNS lookup",value:e.dns.avg,color:"#eb6834"},{label:"TCP connect",value:e.tcp.avg,color:"#1baf7a"},{label:"TLS handshake",value:e.tls.avg,color:"#eda100"},{label:"Sending",value:e.send.avg,color:"#008300"},{label:"Server time (TTFB)",value:e.ttfb.avg,color:"#e87ba4"},{label:"Download",value:e.download.avg,color:"#6250d6"}],n=r.reduce((e,t)=>e+t.value,0)||1;return`<div class="stack">${r.filter(e=>e.value>0).map(e=>`<span style="width:${(e.value/n*100).toFixed(2)}%;background:${e.color}" title="${dq(e.label)} ${dq(dz(e.value))}"></span>`).join("")}</div>${dH(r.map(e=>({...e,text:`${dz(e.value)} \xb7 ${Math.round(e.value/n*100)}%`})))}<p class="note">“Server time” is your API working on the answer; high connection times point to the network or the testing computer.</p>`}case"concurrency":return function(e){let t=e.definition.load.executor.endsWith("arrival-rate"),r=e.buckets.filter(e=>e.rps>0).map(e=>({x:t?e.rps:e.vus,y:e.p95Ms,t:e.elapsedS}));if(r.length<3)return'<p class="empty">Not enough data points.</p>';let n=dZ(Math.max(...r.map(e=>e.x))),s=dZ(Math.max(...r.map(e=>e.y))),i=e=>52+e/n*(dK-52-12),a=e=>186-e/s*176,o=r.map(e=>`<circle cx="${i(e.x).toFixed(1)}" cy="${a(e.y).toFixed(1)}" r="4" fill="#2a78d6" fill-opacity=".75" stroke="#fff" stroke-width="1.5"><title>${dq(dU(e.t))}: ${t?`${dC(e.x)} rps`:`${e.x} users`} → ${dq(dz(e.y))}</title></circle>`).join(""),l=[0,.5,1].map(e=>`<line x1="52" x2="${dK-12}" y1="${a(s*e)}" y2="${a(s*e)}" class="g"/><text x="${46}" y="${a(s*e)+3.5}" class="t" text-anchor="end">${dq(dz(s*e))}</text><text x="${i(n*e)}" y="204" class="t" text-anchor="middle">${dq(t?dC(n*e):String(Math.round(n*e)))}</text>`).join("");return`<svg viewBox="0 0 ${dK} 210" role="img" aria-label="Load against response time">${l}${o}</svg><p class="note">Each dot is one second: ${t?"requests per second":"simulated users"} across, response time (95% of requests) up. Where the dots climb is where the API starts to struggle.</p>`}(t);case"apdex":{let e=dB(t,"apdex",a);return`<div class="kpis one"><div class="kpi"><div class="kv" style="color:${dD(e.tone)}">${dq(e.text)}</div><div class="kh">${dq(e.hint??"")} \xb7 1.00 means every answer was fast enough</div></div></div>`}case"targets":{let e=t.summary.thresholds,r=e.length?`<ul class="list">${e.map(e=>`<li><b class="${e.ok?"pass":"fail"}">${e.ok?"✓":"✕"}</b> ${dq(e.name)}${e.actual?` <span class="note">measured ${dq(e.actual)}</span>`:""}</li>`).join("")}</ul>`:'<p class="note">No goals were set for this run.</p>',n=t.summary.checks.length?`<h4>Checks on every response</h4><ul class="list">${t.summary.checks.map(e=>`<li><b class="${e.fails?"fail":"pass"}">${e.fails?"✕":"✓"}</b> <code>${dq(e.name)}</code> <span class="note">${dq(dP(e.passes/Math.max(1,e.passes+e.fails)))} \xb7 ${dq(dR(e.fails))} failed of ${dq(dR(e.passes+e.fails))}</span></li>`).join("")}</ul>`:"";return`<h4>Goals</h4>${r}${n}`}case"statusTable":{let e=Object.entries(t.summary.http.status).sort((e,t)=>t[1]-e[1]),r=e.reduce((e,[,t])=>e+t,0)||1;return`<table class="tbl"><thead><tr><th>Code</th><th>Meaning</th><th>Count</th><th>Share</th></tr></thead><tbody>${e.map(([e,t])=>{let n=Number(e);return`<tr><td><code>${dq(e)}</code></td><td>${dq("0"===e?"No answer (timeout or connection error)":n<300?"Success":n<400?"Redirect":n<500?"Client error":"Server error")}</td><td>${dq(dR(t))}</td><td>${dq(dP(t/r))}</td></tr>`}).join("")}</tbody></table>`}case"config":var l;let u,c;return u=(l=t).definition,c=[["Request",`${u.method} ${u.url}`],["Sign-in type","none"===u.auth.mode?"none":u.auth.mode],["Load style",`${dV[u.load.executor]??u.load.executor}`],["Load over time",dW(l)],["Started",new Date(l.startedAt).toLocaleString("en-GB",{dateStyle:"medium",timeStyle:"medium"})],["Length",dU(dF(l))],["Data received / sent",`${dL(l.summary.data.bytesIn)} / ${dL(l.summary.data.bytesOut)}`]],u.data?.before&&c.push(["Runs first",`${u.data.before.label} → ${u.data.before.values.map(e=>`{{${e}}}`).join(", ")}`]),u.data?.testData&&c.push(["Test data",`${u.data.testData.fileName} \xb7 ${dR(u.data.testData.rows)} rows`]),`<table class="kv-tbl">${c.map(([e,t])=>`<tr><th>${dq(e)}</th><td>${dq(t)}</td></tr>`).join("")}</table>`}}(r,e,t),o=n.bare?"w head":"w";return`<section class="${o}">${n.bare?`<h2>${dq(s)}</h2>`:`<h3>${dq(s)}${i?` <small>${dq(i)}</small>`:""}</h3>`}${a}</section>`},l=(function(e){let t=[],r=-1;for(let n of T(e))(!t.length||n.y>=r)&&t.push([]),t[t.length-1].push(n),r=Math.max(r,n.y+n.h);return t.map(e=>{let t=[];for(let r of[...e].sort((e,t)=>e.x-t.x||e.y-t.y)){let e=t.find(e=>r.x<e.end&&r.x+r.w>e.x);e?(e.widgets.push(r),e.x=Math.min(e.x,r.x),e.end=Math.max(e.end,r.x+r.w)):t.push({x:r.x,end:r.x+r.w,widgets:[r]})}for(let e=!0;e;){e=!1,t.sort((e,t)=>e.x-t.x);for(let r=1;r<t.length;r++)if(t[r].x<t[r-1].end){t[r-1].end=Math.max(t[r-1].end,t[r].end),t[r-1].widgets.push(...t[r].widgets),t.splice(r,1),e=!0;break}}return t.map(e=>({x:e.x,w:e.end-e.x,widgets:e.widgets.sort((e,t)=>e.y-t.y||e.x-t.x)}))})})(n.widgets).map(e=>`<div class="band">${e.map(e=>`<div class="lane" style="--x:${e.x+1};--w:${e.w}">${e.widgets.map(o).join("")}</div>`).join("")}</div>`).join("\n");dK=640;let u=e.buckets.map(e=>`<tr><td>${dq(dU(e.elapsedS))}</td><td>${e.vus}</td><td>${dq(dC(e.rps))}</td><td>${dq(dz(e.p50Ms))}</td><td>${dq(dz(e.p95Ms))}</td><td>${dq(dz(e.p99Ms))}</td><td>${dq(dP(e.failedRate))}</td><td>${e.http2xx}</td><td>${e.http4xx}</td><td>${e.http5xx}</td><td>${e.http0}</td></tr>`).join("");return`<!DOCTYPE html>
786
+ <html lang="en">
787
+ <head>
788
+ <meta charset="utf-8">
789
+ <meta name="viewport" content="width=device-width, initial-scale=1">
790
+ <title>${dq(e.testName)} — APITestCenter</title>
791
+ <style>
792
+ :root { color-scheme: light; }
793
+ * { box-sizing: border-box; }
794
+ body { margin: 0; background: #f4f6f9; color: ${dk}; font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
795
+ code, .kv, .tbl td, .series td { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
796
+ header.top { background: ${dS}; border-bottom: 1px solid ${d$}; padding: 20px 28px; }
797
+ header.top .brand { font-size: 12px; color: ${dx}; }
798
+ header.top h1 { margin: 2px 0 4px; font-size: 22px; letter-spacing: -.01em; }
799
+ header.top .meta { color: ${dx}; font-size: 13px; word-break: break-all; }
800
+ main { max-width: 1240px; margin: 0 auto; padding: 20px 20px 56px; }
801
+ .verdict { border-radius: 10px; padding: 12px 14px; font-size: 15px; }
802
+ .verdict.pass { background: #e6f4ea; border: 1px solid #a8dab5; } .verdict.pass b { color: ${d_}; }
803
+ .verdict.warn { background: #fef3e0; border: 1px solid #f5cf8b; } .verdict.warn b { color: ${dA}; }
804
+ .verdict.fail { background: #fdecea; border: 1px solid #f3b0aa; } .verdict.fail b { color: ${dT}; }
805
+ .debrief { background: ${dS}; border: 1px solid ${d$}; border-radius: 12px; padding: 16px 20px; margin: 16px 0; }
806
+ .debrief h2 { margin: 0 0 8px; font-size: 17px; }
807
+ .debrief p { margin: 6px 0; } .debrief ol { margin: 6px 0 0; padding-left: 20px; } .debrief li { margin: 3px 0; }
808
+ .grid { display: flex; flex-direction: column; gap: 12px; }
809
+ .band { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; align-items: start; }
810
+ .lane { grid-column: var(--x) / span var(--w); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
811
+ .w { background: ${dS}; border: 1px solid ${d$}; border-radius: 12px; padding: 12px 14px; min-width: 0; break-inside: avoid; }
812
+ .w.head { background: none; border: 0; padding: 14px 2px 0; }
813
+ .w.head h2 { margin: 0; padding-bottom: 4px; border-bottom: 1px solid ${d$}; font-size: 18px; }
814
+ .w h3 { margin: 0 0 8px; font-size: 14px; } .w h3 small { color: ${dx}; font-weight: 400; font-size: 12px; margin-left: 4px; }
815
+ .w h4 { margin: 10px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: ${dx}; }
816
+ svg { width: 100%; height: auto; display: block; }
817
+ svg .g { stroke: ${d$}; stroke-width: 1; } svg .t { fill: ${dx}; font: 11px ui-monospace, Consolas, monospace; }
818
+ .legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: ${dx}; margin-top: 4px; }
819
+ .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
820
+ .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
821
+ .kpis.one { grid-template-columns: 1fr; }
822
+ .kpi { background: #eef1f6; border-radius: 10px; padding: 10px 12px; }
823
+ .kl { font-size: 12px; color: ${dx}; font-weight: 600; } .kt { font-size: 11px; color: #7a8596; }
824
+ .kv { font-size: 24px; font-weight: 600; margin-top: 2px; } .kpis.one .kv { font-size: 34px; }
825
+ .kh, .chg, .note { font-size: 12px; color: ${dx}; } .chg { margin-top: 2px; }
826
+ .aspects, .list { list-style: none; padding: 0; margin: 10px 0 0; } .aspects li, .list li { margin: 5px 0; font-size: 13px; }
827
+ b.pass { color: ${d_}; } b.warn { color: ${dA}; } b.fail { color: ${dT}; }
828
+ table { border-collapse: collapse; width: 100%; }
829
+ .bars th { text-align: left; font-weight: 400; color: ${dx}; font-size: 12px; padding: 3px 10px 3px 0; white-space: nowrap; width: 1%; }
830
+ .bars td { padding: 3px 0; } .bars td.v { text-align: right; font: 12px ui-monospace, Consolas, monospace; padding-left: 10px; white-space: nowrap; width: 1%; }
831
+ .bar { display: block; height: 10px; border-radius: 3px; }
832
+ .stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin: 2px 0 10px; gap: 2px; } .stack span { display: block; height: 100%; }
833
+ .tbl th, .tbl td, .series th, .series td, .kv-tbl th, .kv-tbl td { text-align: left; padding: 6px 8px; border-top: 1px solid ${d$}; font-size: 12px; }
834
+ .tbl th, .series th { color: ${dx}; font-weight: 600; border-top: 0; }
835
+ .kv-tbl th { color: ${dx}; font-weight: 400; width: 30%; white-space: nowrap; vertical-align: top; } .kv-tbl td { word-break: break-all; }
836
+ .empty { color: ${dx}; font-size: 13px; }
837
+ details.appendix { margin-top: 20px; background: ${dS}; border: 1px solid ${d$}; border-radius: 12px; padding: 12px 16px; }
838
+ details.appendix summary { cursor: pointer; font-weight: 600; }
839
+ .series-wrap { max-height: 420px; overflow: auto; margin-top: 10px; }
840
+ footer { color: ${dx}; font-size: 12px; margin-top: 24px; }
841
+ @media (max-width: 900px) { .lane { grid-column: 1 / -1; } }
842
+ @media print { body { background: #fff; } .series-wrap { max-height: none; } details.appendix { display: none; } .w, .debrief { box-shadow: none; } }
843
+ </style>
844
+ </head>
845
+ <body>
846
+ <header class="top">
847
+ <div class="brand">APITestCenter \xb7 Load test report</div>
848
+ <h1>${dq(e.testName)}</h1>
849
+ <div class="meta">${dq(e.definition.method)} ${dq(e.definition.url)} \xb7 ${dq(new Date(e.startedAt).toLocaleString("en-GB",{dateStyle:"medium",timeStyle:"short"}))} \xb7 ${dq(dU(dF(e)))} \xb7 ${dq(e.status)} \xb7 sign-in ${dq(e.definition.auth.mode)}</div>
850
+ </header>
851
+ <main>
852
+ <div class="verdict ${a}"><b>${"pass"===a?"✓ PASS":"warn"===a?"! WARNING":"✕ FAIL"}</b> ${dq(s.headline)}</div>
853
+ <section class="debrief">
854
+ <h2>What happened in this run</h2>
855
+ ${i.findings.map(e=>`<p>${e}</p>`).join("\n ")}
856
+ ${i.next.length?`<h2 style="margin-top:14px">Suggested next steps</h2><ol>${i.next.map(e=>`<li>${dq(e)}</li>`).join("")}</ol>`:""}
857
+ <p class="note">Written from the measured numbers by fixed rules. ${dq(s.disclaimer)}</p>
858
+ </section>
859
+ ${function(e,t){if(!t||t.id===e.id)return"";let r=dg(t,e),n="worse"===r.level?"fail":"better"===r.level?"pass":"same"===r.level?"same":"warn",s=(e,t)=>null==t?"—":"rps"===e?`${dC(t)}/s`:"errorRate"===e||"checksRate"===e?dP(t):dz(t),i=r.metrics.map(e=>`<tr><th>${dq(e.label)} <span class="sub">${dq(e.tech)}</span></th><td>${dq(s(e.key,e.before))}</td><td>${dq(s(e.key,e.after))}</td><td>${(e=>{if("n/a"===e.direction)return`<span class="sub">${dq(e.note??"—")}</span>`;if("same"===e.direction)return'<span class="sub">= about the same</span>';let t=(e.absolute??0)>0,r="errorRate"===e.key||"checksRate"===e.key?`${t?"+":"−"}${(100*Math.abs(e.absolute??0)).toFixed(1)} points`:null!=e.relative?`${t?"+":"−"}${Math.round(100*Math.abs(e.relative))}%`:"";return`<span style="color:${"better"===e.direction?d_:dT};font-weight:600">${t?"↑":"↓"} ${dq(r)} \xb7 ${e.direction}</span>`})(e)}</td></tr>`).join("");return` <section class="debrief">
860
+ <h2>Before / after</h2>
861
+ <p class="sub">This run compared with “${dq(t.testName)}” (${dq(new Date(t.startedAt).toLocaleString("en-GB"))}).</p>
862
+ <div class="verdict ${n}" style="margin:10px 0">${dq(r.headline)}</div>
863
+ <table class="kv-tbl"><tr><th>Measure</th><th>Before</th><th>After</th><th>Change</th></tr>${i}</table>
864
+ <p class="note">Changes under 5% (or under 10 ms) count as about the same — two runs of an unchanged API never match exactly.</p>
865
+ </section>`}(e,t.before??null)}
866
+ <div class="grid">
867
+ ${l}
868
+ </div>
869
+ <details class="appendix">
870
+ <summary>Every second of the run (${e.buckets.length} rows)</summary>
871
+ <div class="series-wrap"><table class="series"><thead><tr><th>Time</th><th>Users</th><th>Req/s</th><th>Typical</th><th>95%</th><th>Slowest 1%</th><th>Failed</th><th>2xx</th><th>4xx</th><th>5xx</th><th>No answer</th></tr></thead><tbody>${u}</tbody></table></div>
872
+ </details>
873
+ <footer>Report view: ${dq(n.name)} \xb7 made ${dq(r)} with APITestCenter (apitestcenter.com). Secrets are never included; sign-in is shown as a type only.</footer>
874
+ </main>
875
+ </body>
876
+ </html>
877
+ `}],94713);let dG={proxy:{mode:"environment",url:"",username:"",bypass:""},requests:{timeout:"5m",maxRedirects:5,useCookies:!0,tlsSkip:!0},load:{preset:"smoke"}};e.s(["g",0,dG,"b",0,function(e){let t=e??{},r=t.proxy??{},n=t.requests??{},s=["off","environment","manual"].find(e=>e===r.mode)??dG.proxy.mode,i="string"==typeof r.url?function(e){let t=e.trim();if(!t)return{url:""};try{let e=new URL(/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:`http://${t}`);if("http:"!==e.protocol&&"https:"!==e.protocol)return null;let r=decodeURIComponent(e.username),n=decodeURIComponent(e.password);return e.username="",e.password="",{url:`${e.protocol}//${e.host}`,...r?{username:r}:{},...n?{password:n}:{}}}catch{return null}}(r.url):null,a=Number(n.maxRedirects);return{proxy:{mode:s,url:i?.url??"",username:"string"==typeof r.username?r.username.trim():i?.username??"",bypass:"string"==typeof r.bypass?r.bypass.trim():""},requests:{timeout:"string"==typeof n.timeout&&/^\d+(ms|s|m)$/.test(n.timeout.trim())?n.timeout.trim():dG.requests.timeout,maxRedirects:Number.isInteger(a)&&a>=0&&a<=20?a:dG.requests.maxRedirects,useCookies:"boolean"==typeof n.useCookies?n.useCookies:dG.requests.useCookies,tlsSkip:"boolean"==typeof n.tlsSkip?n.tlsSkip:dG.requests.tlsSkip},load:{preset:a8.find(e=>e===t.load?.preset)??dG.load.preset}}}],19166);let dX=[{id:"smoke",label:"Smoke",question:"Does it work under a little load?",hint:"2 users for 30 seconds — a quick check before anything bigger."},{id:"average",label:"Load",question:"Does it hold up on a normal day?",hint:"10 users for 5 minutes — your usual traffic."},{id:"stress",label:"Stress",question:"How does it do above normal?",hint:"Ramp to 20 users and hold — more than a normal day. Do the targets still hold at the peak?"},{id:"spike",label:"Spike",question:"Does it survive a sudden burst, and recover?",hint:"5 users, a sudden jump to 50, then back to 5."},{id:"soak",label:"Soak",question:"Does it slow down over time?",hint:"10 users for 30 minutes — finds leaks and slow decline that short tests miss."},{id:"breakpoint",label:"Breakpoint",question:"How much can it take?",hint:"Adds users steadily (up to 200 over 10 minutes) and stops when a target breaks — the report says the most it handled."}],dY=e=>e.length?e.reduce((e,t)=>e+t,0)/e.length:0,dQ=e=>e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)} s`:`${Math.round(e)} ms`,d0=e=>`${(100*e).toFixed(e>0&&e<.01?2:1)}%`,d1=e=>dY(e.map(e=>e.p95Ms).filter(e=>e>0)),d2=e=>dY(e.map(e=>e.failedRate));e.s(["R",0,dX,"w",0,e=>dX.find(t=>t.id===e)?.label??("custom"===e?"Custom":void 0),"a",0,function(e,t){let r,n=e.definition.load.testType,s=e.buckets.filter(e=>e.rps>0);if(s.length<3)return null;let i=p6(t),a={rate:r=e.definition.load.executor.includes("arrival-rate"),at:e=>r?Math.round(e.rps):e.vus,unit:e=>r?`${e} req/s`:`${e} ${1===e?"user":"users"}`},o=Math.max(...s.map(a.at));if("stress"===n){let e=s.filter(e=>a.at(e)>=.9*o),t=d1(e),r=d2(e),n=r>=i.errorFail||t>=i.p95FailMs?"fail":r>=i.errorWarn||t>=i.p95WarnMs?"warn":"pass";return{title:"At the peak",level:n,summary:`With ${a.unit(o)}, p95 was ${dQ(t)} and ${d0(r)} of requests failed.${"pass"===n?" It held up above a normal day.":""}`}}if("spike"===n){let e=s.map((e,t)=>a.at(e)>=.8*o?t:-1).filter(e=>e>=0);if(!e.length)return null;let t=e=>a.at(e)>0&&a.at(e)<=.3*o,r=s.slice(0,e[0]).filter(t),n=e.map(e=>s[e]),l=s.slice(e.at(-1)+1).filter(t);if(r.length<2||l.length<2)return null;let[u,c,p]=[d1(r),d1(n),d1(l)],[d,h,f]=[d2(r),d2(n),d2(l)],m=p<=Math.max(1.5*u,u+50)&&f<=d+.01;return{title:"Recovery after the spike",level:m?h>=i.errorFail?"warn":"pass":"fail",summary:`p95 ${dQ(u)} before the spike, ${dQ(c)} during it (${d0(h)} errors), ${dQ(p)} after.${m?" It recovered.":" It didn't recover: still slower or failing more after the burst."}`}}if("soak"===n){let e=s.filter(e=>a.at(e)>=.9*o);if(e.length<10)return null;let t=Math.max(2,Math.floor(e.length/5)),[r,n]=[d1(e.slice(0,t)),d1(e.slice(-t))],[l,u]=[d2(e.slice(0,t)),d2(e.slice(-t))],c=r>0?n/r:1,p=c>=2||u>=l+i.errorFail?"fail":c>=1.3||u>=l+i.errorWarn?"warn":"pass",d=c>=1?`+${Math.round((c-1)*100)}%`:`−${Math.round((1-c)*100)}%`;return{title:"Over time",level:p,summary:`p95 went from ${dQ(r)} at the start to ${dQ(n)} at the end (${d}); errors ${d0(l)} → ${d0(u)}.${"pass"===p?" No slowdown over the run.":" It got slower as it ran — look for leaks, growing queues or caches."}`}}if("breakpoint"===n){let e=e=>e.p95Ms>=i.p95FailMs||e.failedRate>=i.errorFail,t=-1;for(let r=0;r+2<s.length;r++)if(e(s[r])&&e(s[r+1])&&e(s[r+2])){t=r;break}let r=`p95 under ${dQ(i.p95FailMs)} and errors under ${d0(i.errorFail)}${i.owned?" (your targets)":" (defaults — set your own in Goals)"}`;if(t<0)return{title:"Breaking point",level:"pass",summary:`It didn't break: still within ${r} at ${a.unit(o)}, the most this test reached. Raise the top to find the limit.`};let n=s.slice(0,t).filter(t=>!e(t)),l=n.length?Math.max(...n.map(a.at)):0,u=s[t],c=u.failedRate>=i.errorFail?`${d0(u.failedRate)} errors`:`p95 ${dQ(u.p95Ms)}`;return{title:"Breaking point",level:"warn",summary:l?`It handled up to ${a.unit(l)} within ${r}. It broke at ${a.unit(a.at(u))} — ${c}.`:`It broke straight away, at ${a.unit(a.at(u))} — ${c}. Start lower, or check the API with a Smoke test first.`}}return null}],30340);let d5=e=>!!e&&"object"==typeof e&&!Array.isArray(e),d9=`openapi: 3.0.3
878
+ info:
879
+ title: Orders API
880
+ version: "1.0"
881
+ servers:
882
+ - url: https://api.example.com/v1
883
+ paths:
884
+ /orders/{orderId}:
885
+ get:
886
+ summary: One order
887
+ parameters:
888
+ - name: orderId
889
+ in: path
890
+ required: true
891
+ schema: { type: string }
892
+ responses:
893
+ "200":
894
+ description: The order
895
+ content:
896
+ application/json:
897
+ schema:
898
+ type: object
899
+ required: [id, status]
900
+ properties:
901
+ id: { type: string }
902
+ status: { type: string, enum: [open, paid, shipped] }
903
+ total: { type: number }
904
+ "404":
905
+ description: No order with that id
906
+ `;e.s(["_",0,d9,"J",0,function(e){let t;e=e.replace(/^\uFEFF/,"");try{t=JSON.parse(e)}catch{try{t=pm(e,{maxAliasCount:1e3})}catch{throw Error("That file is neither JSON nor YAML")}}if(!d5(t))throw Error(Array.isArray(t)?"It's a list, not an OpenAPI description — those start with openapi: 3… (or swagger: 2.0), then info and paths":"That file is not an OpenAPI description");let r="string"==typeof t.openapi&&t.openapi.startsWith("3")?"openapi":"2.0"===t.swagger?"swagger":null;if(!r)throw Error("string"==typeof t.openapi?`OpenAPI ${t.openapi} is not supported — use 3.x or Swagger 2.0`:function(e,t){let r=d5(e.info)?e.info:null,n="Import it (Import in the sidebar) to get its requests; contract tests need the API's own OpenAPI file";if(r&&("string"==typeof r._postman_id||"string"==typeof r.schema&&r.schema.includes("getpostman"))||Array.isArray(e.item)&&r)return`It's a Postman collection, not an API description. ${n}`;if(Array.isArray(e.values)&&"string"==typeof e._postman_variable_scope)return"It's a Postman environment, not an API description. Import it to get its variables";if(d5(e.log)&&Array.isArray(e.log.entries))return`It's a browser recording (HAR), not an API description. ${n}`;if("export"===e._type||"string"==typeof e.type&&e.type.startsWith("collection.insomnia.rest/"))return`It's an Insomnia export, not an API description. ${n}`;if("string"==typeof e.asyncapi)return"It's an AsyncAPI file — that describes event and message APIs. Contract tests need OpenAPI 3 or Swagger 2";if(d5(e.__schema)||d5(e.data)&&d5(e.data.__schema))return"It's a GraphQL schema. Contract tests check REST APIs against OpenAPI; GraphQL requests check their answers with checks instead";if("string"==typeof e.$schema&&!e.paths)return"It's a JSON Schema — one shape of data, not a whole API. An OpenAPI file holds schemas like it under components, with the API's paths";let s=Object.keys(e),i=s.length?` This one starts with ${s.slice(0,3).join(", ")}${s.length>3?` and ${s.length-3} more`:""}.`:"";return`It's ${t}, but not an OpenAPI or Swagger description: those start with openapi: 3… (or swagger: 2.0), then info and paths.${i}`}(t,/^\s*[{[]/.test(e)?"JSON":"YAML"));if(!d5(t.paths))throw Error("The description has no paths: an OpenAPI file lists the API's operations under paths");let n=d5(t.info)?t.info:{};return{kind:r,title:"string"==typeof n.title&&n.title.trim()?n.title.trim():"API",version:"string"==typeof n.version?n.version:"",doc:t}}],54185),e.s([],24856)}],46880,(e,t,r)=>{var n={872:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,i=l(e),a=i[0],o=i[1],u=new s((a+o)*3/4-o),c=0,p=o>0?a-4:a;for(r=0;r<p;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===o&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===o&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,s=n%3,i=[],a=0,o=n-s;a<o;a+=16383)i.push(function(e,t,n){for(var s,i=[],a=t;a<n;a+=3)s=(e[a]<<16&0xff0000)+(e[a+1]<<8&65280)+(255&e[a+2]),i.push(r[s>>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return i.join("")}(e,a,a+16383>o?o:a+16383));return 1===s?i.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===s&&i.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),i.join("")};for(var r=[],n=[],s="u">typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,o=i.length;a<o;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},230:function(e,t,r){"use strict";var n=r(872),s=r(321),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return c(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e){var n=e,s=t;if(("string"!=typeof s||""===s)&&(s="utf8"),!o.isEncoding(s))throw TypeError("Unknown encoding: "+s);var i=0|h(n,s),l=a(i),u=l.write(n,s);return u!==i&&(l=l.slice(0,u)),l}if(ArrayBuffer.isView(e))return p(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(E(e,ArrayBuffer)||e&&E(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(E(e,SharedArrayBuffer)||e&&E(e.buffer,SharedArrayBuffer)))return function(e,t,r){var n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),o.prototype),n}(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var c=e.valueOf&&e.valueOf();if(null!=c&&c!==e)return o.from(c,t,r);var f=function(e){if(o.isBuffer(e)){var t=0|d(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?a(0):p(e):"Buffer"===e.type&&Array.isArray(e.data)?p(e.data):void 0}(e);if(f)return f;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return u(e),a(e<0?0:0|d(e))}function p(e){for(var t=e.length<0?0:0|d(e.length),r=a(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}t.Buffer=o,t.SlowBuffer=function(e){return+e!=e&&(e=0),o.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,o.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),!o.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(e,t,r){return(u(e),e<=0)?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)},o.allocUnsafe=function(e){return c(e)},o.allocUnsafeSlow=function(e){return c(e)};function d(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function h(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||E(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var s=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return _(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return T(e).length;default:if(s)return n?-1:_(e).length;t=(""+t).toLowerCase(),s=!0}}function f(e,t,r){var s,i,a,o=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var s="",i=t;i<r;++i)s+=M[e[i]];return s}(this,t,r);case"utf8":case"utf-8":return b(this,t,r);case"ascii":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var s=t;s<r;++s)n+=String.fromCharCode(127&e[s]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var s=t;s<r;++s)n+=String.fromCharCode(e[s]);return n}(this,t,r);case"base64":return s=this,i=t,a=r,0===i&&a===s.length?n.fromByteArray(s):n.fromByteArray(s.slice(i,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var n=e.slice(t,r),s="",i=0;i<n.length;i+=2)s+=String.fromCharCode(n[i]+256*n[i+1]);return s}(this,t,r);default:if(o)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,s){var i;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(i=r*=1)!=i&&(r=s?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(s)return -1;else r=e.length-1;else if(r<0)if(!s)return -1;else r=0;if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,s);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(s)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return g(e,[t],r,n,s)}throw TypeError("val must be string, number or Buffer")}function g(e,t,r,n,s){var i,a=1,o=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;a=2,o/=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(s){var c=-1;for(i=r;i<o;i++)if(u(e,i)===u(t,-1===c?0:i-c)){if(-1===c&&(c=i),i-c+1===l)return c*a}else -1!==c&&(i-=i-c),c=-1}else for(r+l>o&&(r=o-l),i=r;i>=0;i--){for(var p=!0,d=0;d<l;d++)if(u(e,i+d)!==u(t,d)){p=!1;break}if(p)return i}return -1}o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(E(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),E(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,s=0,i=Math.min(r,n);s<i;++s)if(e[s]!==t[s]){r=e[s],n=t[s];break}return r<n?-1:+(n<r)},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;var r,n=o.allocUnsafe(t),s=0;for(r=0;r<e.length;++r){var i=e[r];if(E(i,Uint8Array)&&(i=o.from(i)),!o.isBuffer(i))throw TypeError('"list" argument must be an Array of Buffers');i.copy(n,s),s+=i.length}return n},o.byteLength=h,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},o.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},o.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},o.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?b(this,0,e):f.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},i&&(o.prototype[i]=o.prototype.inspect),o.prototype.compare=function(e,t,r,n,s){if(E(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===s&&(s=this.length),t<0||r>e.length||n<0||s>this.length)throw RangeError("out of range index");if(n>=s&&t>=r)return 0;if(n>=s)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,s>>>=0,this===e)return 0;for(var i=s-n,a=r-t,l=Math.min(i,a),u=this.slice(n,s),c=e.slice(t,r),p=0;p<l;++p)if(u[p]!==c[p]){i=u[p],a=c[p];break}return i<a?-1:+(a<i)},o.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)};function b(e,t,r){r=Math.min(e.length,r);for(var n=[],s=t;s<r;){var i,a,o,l,u=e[s],c=null,p=u>239?4:u>223?3:u>191?2:1;if(s+p<=r)switch(p){case 1:u<128&&(c=u);break;case 2:(192&(i=e[s+1]))==128&&(l=(31&u)<<6|63&i)>127&&(c=l);break;case 3:i=e[s+1],a=e[s+2],(192&i)==128&&(192&a)==128&&(l=(15&u)<<12|(63&i)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:i=e[s+1],a=e[s+2],o=e[s+3],(192&i)==128&&(192&a)==128&&(192&o)==128&&(l=(15&u)<<18|(63&i)<<12|(63&a)<<6|63&o)>65535&&l<1114112&&(c=l)}null===c?(c=65533,p=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),s+=p}var d=n,h=d.length;if(h<=4096)return String.fromCharCode.apply(String,d);for(var f="",m=0;m<h;)f+=String.fromCharCode.apply(String,d.slice(m,m+=4096));return f}function v(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function w(e,t,r,n,s,i){if(!o.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>s||t<i)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function k(e,t,r,n,s,i){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function x(e,t,r,n,i){return t*=1,r>>>=0,i||k(e,t,r,4,34028234663852886e22,-34028234663852886e22),s.write(e,t,r,n,23,4),r+4}function $(e,t,r,n,i){return t*=1,r>>>=0,i||k(e,t,r,8,17976931348623157e292,-17976931348623157e292),s.write(e,t,r,n,52,8),r+8}o.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s,i,a,o,l,u,c,p,d=this.length-t;if((void 0===r||r>d)&&(r=d),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var h=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var s=e.length-r;n?(n=Number(n))>s&&(n=s):n=s;var i=t.length;n>i/2&&(n=i/2);for(var a=0;a<n;++a){var o,l=parseInt(t.substr(2*a,2),16);if((o=l)!=o)break;e[r+a]=l}return a}(this,e,t,r);case"utf8":case"utf-8":return s=t,i=r,O(_(e,this.length-s),this,s,i);case"ascii":return a=t,o=r,O(A(e),this,a,o);case"latin1":case"binary":return function(e,t,r,n){return O(A(t),e,r,n)}(this,e,t,r);case"base64":return l=t,u=r,O(T(e),this,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=t,p=r,O(function(e,t){for(var r,n,s=[],i=0;i<e.length&&!((t-=2)<0);++i)n=(r=e.charCodeAt(i))>>8,s.push(r%256),s.push(n);return s}(e,this.length-c),this,c,p);default:if(h)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),h=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n},o.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e],s=1,i=0;++i<t&&(s*=256);)n+=this[e+i]*s;return n},o.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e+--t],s=1;t>0&&(s*=256);)n+=this[e+--t]*s;return n},o.prototype.readUInt8=function(e,t){return e>>>=0,t||v(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e],s=1,i=0;++i<t&&(s*=256);)n+=this[e+i]*s;return n>=(s*=128)&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=t,s=1,i=this[e+--n];n>0&&(s*=256);)i+=this[e+--n]*s;return i>=(s*=128)&&(i-=Math.pow(2,8*t)),i},o.prototype.readInt8=function(e,t){return(e>>>=0,t||v(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||v(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||v(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||v(e,4,this.length),s.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||v(e,4,this.length),s.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||v(e,8,this.length),s.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||v(e,8,this.length),s.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var s=Math.pow(2,8*r)-1;w(this,e,t,r,s,0)}var i=1,a=0;for(this[t]=255&e;++a<r&&(i*=256);)this[t+a]=e/i&255;return t+r},o.prototype.writeUIntBE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var s=Math.pow(2,8*r)-1;w(this,e,t,r,s,0)}var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},o.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var s=Math.pow(2,8*r-1);w(this,e,t,r,s-1,-s)}var i=0,a=1,o=0;for(this[t]=255&e;++i<r&&(a*=256);)e<0&&0===o&&0!==this[t+i-1]&&(o=1),this[t+i]=(e/a|0)-o&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var s=Math.pow(2,8*r-1);w(this,e,t,r,s-1,-s)}var i=r-1,a=1,o=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/a|0)-o&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,r){return x(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return x(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return $(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return $(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(!o.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var s=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var i=s-1;i>=0;--i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return s},o.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var s,i=e.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(e=i)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(s=t;s<r;++s)this[s]=e;else{var a=o.isBuffer(e)?e:o.from(e,n),l=a.length;if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<r-t;++s)this[s+t]=a[s%l]}return this};var S=/[^+/0-9A-Za-z-_]/g;function _(e,t){t=t||1/0;for(var r,n=e.length,s=null,i=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!s){if(r>56319||a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}s=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),s=r;continue}r=(s-55296<<10|r-56320)+65536}else s&&(t-=3)>-1&&i.push(239,191,189);if(s=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return i}function A(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function T(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(S,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function O(e,t,r,n){for(var s=0;s<n&&!(s+r>=t.length)&&!(s>=e.length);++s)t[s+r]=e[s];return s}function E(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var M=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,s=0;s<16;++s)t[n+s]=e[r]+e[s];return t}()},321:function(e,t){t.read=function(e,t,r,n,s){var i,a,o=8*s-n-1,l=(1<<o)-1,u=l>>1,c=-7,p=r?s-1:0,d=r?-1:1,h=e[t+p];for(p+=d,i=h&(1<<-c)-1,h>>=-c,c+=o;c>0;i=256*i+e[t+p],p+=d,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=n;c>0;a=256*a+e[t+p],p+=d,c-=8);if(0===i)i=1-u;else{if(i===l)return a?0/0:(h?-1:1)*2e308;a+=Math.pow(2,n),i-=u}return(h?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,s,i){var a,o,l,u=8*i-s-1,c=(1<<u)-1,p=c>>1,d=5960464477539062e-23*(23===s),h=n?0:i-1,f=n?1:-1,m=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||1/0===t?(o=+!!isNaN(t),a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+p>=1?t+=d/l:t+=d*Math.pow(2,1-p),t*l>=2&&(a++,l/=2),a+p>=c?(o=0,a=c):a+p>=1?(o=(t*l-1)*Math.pow(2,s),a+=p):(o=t*Math.pow(2,p-1)*Math.pow(2,s),a=0));s>=8;e[r+h]=255&o,h+=f,o/=256,s-=8);for(a=a<<s|o,u+=s;u>0;e[r+h]=255&a,h+=f,a/=256,u-=8);e[r+h-f]|=128*m}}},s={};function i(e){var t=s[e];if(void 0!==t)return t.exports;var r=s[e]={exports:{}},a=!0;try{n[e](r,r.exports,i),a=!1}finally{a&&delete s[e]}return r.exports}i.ab="/ROOT/node_modules/.pnpm/next@16.4.3_@playwright+test@1.64.1_@types+node@24.13.3_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/next/dist/compiled/buffer/",t.exports=i(230)}]);